checkboxEditor.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. 'use strict';
  2. exports.__esModule = true;
  3. 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; }; }();
  4. var _baseEditor = require('./_baseEditor');
  5. var _baseEditor2 = _interopRequireDefault(_baseEditor);
  6. var _element = require('./../helpers/dom/element');
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9. 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; }
  10. 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; }
  11. /**
  12. * @private
  13. * @editor CheckboxEditor
  14. * @class CheckboxEditor
  15. */
  16. var CheckboxEditor = function (_BaseEditor) {
  17. _inherits(CheckboxEditor, _BaseEditor);
  18. function CheckboxEditor() {
  19. _classCallCheck(this, CheckboxEditor);
  20. return _possibleConstructorReturn(this, (CheckboxEditor.__proto__ || Object.getPrototypeOf(CheckboxEditor)).apply(this, arguments));
  21. }
  22. _createClass(CheckboxEditor, [{
  23. key: 'beginEditing',
  24. value: function beginEditing(initialValue, event) {
  25. // editorManager return double click event as undefined
  26. if (event === void 0) {
  27. var checkbox = this.TD.querySelector('input[type="checkbox"]');
  28. if (!(0, _element.hasClass)(checkbox, 'htBadValue')) {
  29. checkbox.click();
  30. }
  31. }
  32. }
  33. }, {
  34. key: 'finishEditing',
  35. value: function finishEditing() {}
  36. }, {
  37. key: 'init',
  38. value: function init() {}
  39. }, {
  40. key: 'open',
  41. value: function open() {}
  42. }, {
  43. key: 'close',
  44. value: function close() {}
  45. }, {
  46. key: 'getValue',
  47. value: function getValue() {}
  48. }, {
  49. key: 'setValue',
  50. value: function setValue() {}
  51. }, {
  52. key: 'focus',
  53. value: function focus() {}
  54. }]);
  55. return CheckboxEditor;
  56. }(_baseEditor2.default);
  57. exports.default = CheckboxEditor;