checkboxEditor.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5. import BaseEditor from './_baseEditor';
  6. import { hasClass } from './../helpers/dom/element';
  7. /**
  8. * @private
  9. * @editor CheckboxEditor
  10. * @class CheckboxEditor
  11. */
  12. var CheckboxEditor = function (_BaseEditor) {
  13. _inherits(CheckboxEditor, _BaseEditor);
  14. function CheckboxEditor() {
  15. _classCallCheck(this, CheckboxEditor);
  16. return _possibleConstructorReturn(this, (CheckboxEditor.__proto__ || Object.getPrototypeOf(CheckboxEditor)).apply(this, arguments));
  17. }
  18. _createClass(CheckboxEditor, [{
  19. key: 'beginEditing',
  20. value: function beginEditing(initialValue, event) {
  21. // editorManager return double click event as undefined
  22. if (event === void 0) {
  23. var checkbox = this.TD.querySelector('input[type="checkbox"]');
  24. if (!hasClass(checkbox, 'htBadValue')) {
  25. checkbox.click();
  26. }
  27. }
  28. }
  29. }, {
  30. key: 'finishEditing',
  31. value: function finishEditing() {}
  32. }, {
  33. key: 'init',
  34. value: function init() {}
  35. }, {
  36. key: 'open',
  37. value: function open() {}
  38. }, {
  39. key: 'close',
  40. value: function close() {}
  41. }, {
  42. key: 'getValue',
  43. value: function getValue() {}
  44. }, {
  45. key: 'setValue',
  46. value: function setValue() {}
  47. }, {
  48. key: 'focus',
  49. value: function focus() {}
  50. }]);
  51. return CheckboxEditor;
  52. }(BaseEditor);
  53. export default CheckboxEditor;