@vtx/modals2 5.0.12 → 5.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/lib/_components/vm-card-statistics/index.less +27 -27
  2. package/lib/_components/vm-extra-tab/index.js +8 -0
  3. package/lib/_components/vm-extra-tab/style/index.less +1 -0
  4. package/lib/_components/vm-factor-list/index.less +11 -11
  5. package/lib/_components/vm-table/index.js +4 -4
  6. package/lib/_util/http.js +6 -0
  7. package/lib/index.js +2 -1
  8. package/lib/vtx-base-modal/Header/index.less +98 -98
  9. package/lib/vtx-base-modal/Tabs/index.less +31 -31
  10. package/lib/vtx-car-modal/components/Info/index.less +6 -6
  11. package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
  12. package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
  13. package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
  14. package/lib/vtx-cp-modal/components/ExeceptionInfo/AlarmRecord.js +5 -5
  15. package/lib/vtx-cp-modal/components/SyInfo/index.js +3 -0
  16. package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
  17. package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
  18. package/lib/vtx-restaurant-modal/config.js +52 -52
  19. package/lib/vtx-road-modal/components/BaseInfo/index.less +34 -31
  20. package/lib/vtx-road-modal/components/Statistical/index.less +32 -32
  21. package/lib/vtx-wr-modal/components/Base/Ptss.js +0 -6
  22. package/lib/vtx-wr-modal/components/Base/Sjjg.js +2 -5
  23. package/lib/vtx-wr-modal/components/Base/index.less +5 -10
  24. package/lib/vtx-wr-modal/components/Build/index.js +3 -2
  25. package/lib/vtx-wr-modal/components/Score/index.js +4 -4
  26. package/lib/vtx-wr-modal/index.js +15 -2
  27. package/lib/vtx-zf-modal/components/Base/index.js +244 -0
  28. package/lib/vtx-zf-modal/components/Base/index.less +105 -0
  29. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/ckeditor.d.ts +109 -0
  30. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/ckeditor.js +5 -0
  31. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/ckeditor.js.map +1 -0
  32. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/af.js +33 -0
  33. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ar.js +222 -0
  34. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ast.js +109 -0
  35. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/az.js +221 -0
  36. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/bg.js +222 -0
  37. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/bn.js +222 -0
  38. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/bs.js +80 -0
  39. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ca.js +222 -0
  40. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/cs.js +222 -0
  41. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/da.js +222 -0
  42. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/de-ch.js +220 -0
  43. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/de.js +222 -0
  44. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/el.js +222 -0
  45. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/en-au.js +222 -0
  46. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/en-gb.js +215 -0
  47. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/en.js +92 -0
  48. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/eo.js +120 -0
  49. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/es-co.js +36 -0
  50. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/es.js +222 -0
  51. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/et.js +222 -0
  52. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/eu.js +121 -0
  53. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/fa.js +222 -0
  54. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/fi.js +222 -0
  55. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/fr.js +222 -0
  56. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/gl.js +222 -0
  57. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/gu.js +22 -0
  58. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/he.js +222 -0
  59. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/hi.js +222 -0
  60. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/hr.js +222 -0
  61. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/hu.js +222 -0
  62. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/id.js +222 -0
  63. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/it.js +222 -0
  64. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ja.js +222 -0
  65. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/jv.js +106 -0
  66. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/kk.js +13 -0
  67. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/km.js +127 -0
  68. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/kn.js +121 -0
  69. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ko.js +222 -0
  70. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ku.js +219 -0
  71. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/lt.js +222 -0
  72. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/lv.js +222 -0
  73. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ms.js +222 -0
  74. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/nb.js +199 -0
  75. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ne.js +215 -0
  76. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/nl.js +222 -0
  77. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/no.js +222 -0
  78. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/oc.js +21 -0
  79. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/pl.js +222 -0
  80. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/pt-br.js +222 -0
  81. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/pt.js +222 -0
  82. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ro.js +222 -0
  83. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ru.js +222 -0
  84. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/si.js +76 -0
  85. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/sk.js +222 -0
  86. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/sl.js +78 -0
  87. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/sq.js +208 -0
  88. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/sr-latn.js +222 -0
  89. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/sr.js +222 -0
  90. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/sv.js +222 -0
  91. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/th.js +222 -0
  92. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/tk.js +220 -0
  93. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/tr.js +222 -0
  94. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/tt.js +170 -0
  95. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ug.js +205 -0
  96. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/uk.js +222 -0
  97. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/ur.js +222 -0
  98. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/uz.js +220 -0
  99. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/vi.js +222 -0
  100. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/zh-cn.js +222 -0
  101. package/lib/vtx-zf-modal/components/CkEditorCustom/ckeditor/translations/zh.js +222 -0
  102. package/lib/vtx-zf-modal/components/CkEditorCustom/context/Event.js +42 -0
  103. package/lib/vtx-zf-modal/components/CkEditorCustom/context/context.js +98 -0
  104. package/lib/vtx-zf-modal/components/CkEditorCustom/context/index.js +3 -0
  105. package/lib/vtx-zf-modal/components/CkEditorCustom/context/useContextComponent.js +16 -0
  106. package/lib/vtx-zf-modal/components/CkEditorCustom/index.js +294 -0
  107. package/lib/vtx-zf-modal/components/CkEditorCustom/index.less +133 -0
  108. package/lib/vtx-zf-modal/components/CkEditorCustom/utils/util.js +67 -0
  109. package/lib/vtx-zf-modal/components/CkEditorCustom/view.js +216 -0
  110. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/CKModal.js +77 -0
  111. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/OpenPanelCommand.js +31 -0
  112. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/config.js +146 -0
  113. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/editableDiv/FormView.js +92 -0
  114. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/editableDiv/index.js +341 -0
  115. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/editableDiv/index.less +1 -0
  116. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/FormView.js +94 -0
  117. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/date.js +334 -0
  118. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/index.js +330 -0
  119. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/index.less +36 -0
  120. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/FormView.js +93 -0
  121. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/checkbox.js +335 -0
  122. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/index.js +335 -0
  123. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/index.less +35 -0
  124. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/sign/FormView.js +94 -0
  125. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/sign/index.js +338 -0
  126. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/sign/index.less +1 -0
  127. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/style.less +92 -0
  128. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/textarea/FormView.js +94 -0
  129. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/textarea/index.js +328 -0
  130. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/textarea/index.less +1 -0
  131. package/lib/vtx-zf-modal/components/Document/index.js +84 -0
  132. package/lib/vtx-zf-modal/components/Document/index.less +47 -0
  133. package/lib/vtx-zf-modal/components/File/index.js +192 -0
  134. package/lib/vtx-zf-modal/components/File/index.less +43 -0
  135. package/lib/vtx-zf-modal/components/Process/index.js +196 -0
  136. package/lib/vtx-zf-modal/components/Process/index.less +107 -0
  137. package/lib/vtx-zf-modal/components/Record/index.js +108 -0
  138. package/lib/vtx-zf-modal/components/Record/index.less +34 -0
  139. package/lib/vtx-zf-modal/components/Right/index.js +45 -0
  140. package/lib/vtx-zf-modal/components/index.js +6 -0
  141. package/lib/vtx-zf-modal/index.js +125 -0
  142. package/lib/vtx-zf-modal/style/index.js +7 -0
  143. package/lib/vtx-zf-modal/style/index.less +1 -0
  144. package/package.json +2 -1
@@ -0,0 +1,341 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
5
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
+ 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, _toPropertyKey(descriptor.key), descriptor); } }
14
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
20
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
21
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
+ import { Plugin, Widget, ButtonView, ContextualBalloon, Command, clickOutsideHandler, viewToModelPositionOutsideModelElement, toWidget } from "../../ckeditor/ckeditor";
25
+ import OpenPanelCommand from "../OpenPanelCommand";
26
+ import FormView from "./FormView";
27
+ import "./index.less";
28
+ var EditableDiv = /*#__PURE__*/function (_Plugin) {
29
+ _inherits(EditableDiv, _Plugin);
30
+ var _super = _createSuper(EditableDiv);
31
+ function EditableDiv() {
32
+ _classCallCheck(this, EditableDiv);
33
+ return _super.apply(this, arguments);
34
+ }
35
+ _createClass(EditableDiv, null, [{
36
+ key: "requires",
37
+ get: function get() {
38
+ return [InputEditing, InputUI];
39
+ }
40
+ }]);
41
+ return EditableDiv;
42
+ }(Plugin);
43
+ export { EditableDiv as default };
44
+ var InputEditing = /*#__PURE__*/function (_Plugin2) {
45
+ _inherits(InputEditing, _Plugin2);
46
+ var _super2 = _createSuper(InputEditing);
47
+ function InputEditing() {
48
+ _classCallCheck(this, InputEditing);
49
+ return _super2.apply(this, arguments);
50
+ }
51
+ _createClass(InputEditing, [{
52
+ key: "init",
53
+ value: function init() {
54
+ console.log('可编辑文本内容被调用');
55
+ this._defineSchema();
56
+ this._defineConverters();
57
+ this.editor.commands.add('insertEditableDiv', new InsertEditableDivCommand(this.editor));
58
+ this.editor.commands.add('openEditableDivPanel', new OpenPanelCommand(this.editor));
59
+ this.editor.editing.mapper.on('viewToModelPosition', viewToModelPositionOutsideModelElement(this.editor.model, function (viewElement) {
60
+ return viewElement.hasClass('custom-editable-div');
61
+ }));
62
+ }
63
+ }, {
64
+ key: "_defineSchema",
65
+ value: function _defineSchema() {
66
+ var schema = this.editor.model.schema;
67
+ schema.register('editableDiv', {
68
+ // 定义类型
69
+ inheritAllFrom: '$inlineObject',
70
+ // 定义属性
71
+ allowAttributes: ['configid']
72
+ });
73
+ // schema.addChildCheck((context, childDefinition) => {
74
+ // if (context.endsWith('editableDiv') && childDefinition.name == 'editableDiv') {
75
+ // return false;
76
+ // }
77
+ // });
78
+ }
79
+ }, {
80
+ key: "_defineConverters",
81
+ value: function _defineConverters() {
82
+ console.log(this.editor);
83
+ var conversion = this.editor.conversion;
84
+
85
+ // conversion.for('upcast').elementToElement({
86
+ // model: 'editableDiv',
87
+ // view: this._renderView
88
+ // });
89
+ conversion.for('upcast').elementToElement({
90
+ view: {
91
+ name: 'span',
92
+ classes: 'custom-editable-div'
93
+ },
94
+ model: function model(modelElement, props) {
95
+ var writer = props === null || props === void 0 ? void 0 : props.writer;
96
+ var configid = modelElement._attrs.get('configid');
97
+ var element = null;
98
+ if (writer) {
99
+ element = writer.createElement('editableDiv', {
100
+ configid: configid
101
+ });
102
+ }
103
+ return element;
104
+ }
105
+ });
106
+ conversion.for('dataDowncast').elementToElement({
107
+ model: 'editableDiv',
108
+ view: this._renderView
109
+ });
110
+ conversion.for('editingDowncast').elementToElement({
111
+ model: 'editableDiv',
112
+ view: this._renderView
113
+ });
114
+ }
115
+ }, {
116
+ key: "_renderView",
117
+ value: function _renderView(modelElement, props) {
118
+ var writer = props === null || props === void 0 ? void 0 : props.writer;
119
+ var components = JSON.parse(sessionStorage.getItem('ckComponents') || '{}');
120
+ var config = components[modelElement._attrs.get('configid')] || {};
121
+ var obj = {
122
+ configid: modelElement._attrs.get('configid')
123
+ },
124
+ style = '';
125
+ for (var key in config) {
126
+ if (key == 'width') {
127
+ style += "width: ".concat(config[key], "px;");
128
+ } else {
129
+ if (key == 'label') {
130
+ obj.placeholder = "\u8BF7\u8F93\u5165".concat(config[key] || '');
131
+ }
132
+ obj[key] = config[key];
133
+ }
134
+ }
135
+ var defaultStr = ' ';
136
+ if (config !== null && config !== void 0 && config.fill && Number(config.fill) !== NaN) {
137
+ defaultStr = '';
138
+ for (var i = 0; i < Number(config.fill); i++) {
139
+ defaultStr += ' ';
140
+ }
141
+ }
142
+ obj.style = style;
143
+ var element = '';
144
+ if (writer) {
145
+ element = writer.createContainerElement('span', _objectSpread(_objectSpread({}, obj), {}, {
146
+ class: 'custom-editable-div vtx_ck_widgets'
147
+ }), defaultStr);
148
+ }
149
+ // return element;
150
+ return toWidget(element, writer);
151
+ }
152
+ }], [{
153
+ key: "requires",
154
+ get: function get() {
155
+ // ADDED
156
+ return [Widget];
157
+ }
158
+ }]);
159
+ return InputEditing;
160
+ }(Plugin);
161
+ function renderView(modelElement, props) {
162
+ var writer = props === null || props === void 0 ? void 0 : props.writer;
163
+ var attr = modelElement.getAttributes();
164
+ var obj = {},
165
+ style = '';
166
+ var _iterator = _createForOfIteratorHelper(attr),
167
+ _step;
168
+ try {
169
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
170
+ var _step$value = _slicedToArray(_step.value, 2),
171
+ key = _step$value[0],
172
+ value = _step$value[1];
173
+ if (key == 'width') {
174
+ style += "width: ".concat(value, ";");
175
+ } else {
176
+ if (key == 'label') {
177
+ obj.placeholder = "\u8BF7\u8F93\u5165".concat(value || '');
178
+ }
179
+ obj[key] = value;
180
+ }
181
+ }
182
+ } catch (err) {
183
+ _iterator.e(err);
184
+ } finally {
185
+ _iterator.f();
186
+ }
187
+ obj.style = style;
188
+ var element = '';
189
+ if (writer) {
190
+ element = writer.createContainerElement('span', _objectSpread(_objectSpread({}, obj), {}, {
191
+ class: 'custom-editable-div'
192
+ }), ' ');
193
+ }
194
+ return element;
195
+ }
196
+ var InputUI = /*#__PURE__*/function (_Plugin3) {
197
+ _inherits(InputUI, _Plugin3);
198
+ var _super3 = _createSuper(InputUI);
199
+ function InputUI() {
200
+ _classCallCheck(this, InputUI);
201
+ return _super3.apply(this, arguments);
202
+ }
203
+ _createClass(InputUI, [{
204
+ key: "init",
205
+ value: function init() {
206
+ var _this = this;
207
+ console.log('可编辑文本UI被调用');
208
+ var editor = this.editor;
209
+ var t = editor.t;
210
+ this._balloon = this.editor.plugins.get(ContextualBalloon);
211
+ this.formView = this._createFormView();
212
+ editor.commands.get('openEditableDivPanel').set('uiPanel', this);
213
+ editor.ui.componentFactory.add('editableDiv', function (locale) {
214
+ var buttonView = new ButtonView(locale);
215
+ buttonView.set({
216
+ label: t('可编辑文本'),
217
+ withText: true,
218
+ tooltip: false
219
+ });
220
+
221
+ // this.listenTo(buttonView, 'execute', () => {
222
+ // editor.execute('insertEditableDiv')
223
+ // });
224
+ _this.listenTo(buttonView, 'execute', function () {
225
+ _this._showUI();
226
+ });
227
+ return buttonView;
228
+ });
229
+ }
230
+ }, {
231
+ key: "_createFormView",
232
+ value: function _createFormView() {
233
+ var _this2 = this;
234
+ var editor = this.editor;
235
+ var formView = new FormView(editor.locale);
236
+ var _editor$config$get = editor.config.get('globalConfig'),
237
+ emit = _editor$config$get.emit;
238
+ this.listenTo(formView, 'submit', function () {
239
+ var name = formView.nameInputView.fieldView.element.value;
240
+ var label = formView.labelInputView.fieldView.element.value;
241
+ var order = formView.orderInputView.fieldView.element.value;
242
+ emit('plugingChange', {
243
+ config: {
244
+ name: name,
245
+ label: label,
246
+ order: order,
247
+ type: 'editable-div',
248
+ contentEditable: true
249
+ },
250
+ callback: function callback(id) {
251
+ editor.model.change(function (writer) {
252
+ editor.execute('insertEditableDiv', {
253
+ configid: id
254
+ });
255
+ });
256
+ }
257
+ });
258
+ _this2._hideUI();
259
+ });
260
+ this.listenTo(formView, 'cancel', function () {
261
+ _this2._hideUI();
262
+ });
263
+ clickOutsideHandler({
264
+ emitter: formView,
265
+ activator: function activator() {
266
+ return _this2._balloon.visibleView === formView;
267
+ },
268
+ contextElements: [this._balloon.view.element],
269
+ callback: function callback() {
270
+ return _this2._hideUI();
271
+ }
272
+ });
273
+ return formView;
274
+ }
275
+ }, {
276
+ key: "_getBalloonPositionData",
277
+ value: function _getBalloonPositionData() {
278
+ var view = this.editor.editing.view;
279
+ var viewDocument = view.document;
280
+ var target = null;
281
+
282
+ // Set a target position by converting view selection range to DOM.
283
+ target = function target() {
284
+ return view.domConverter.viewRangeToDom(viewDocument.selection.getFirstRange());
285
+ };
286
+ return {
287
+ target: target
288
+ };
289
+ }
290
+ }, {
291
+ key: "_showUI",
292
+ value: function _showUI() {
293
+ this._balloon.add({
294
+ view: this.formView,
295
+ position: this._getBalloonPositionData()
296
+ });
297
+
298
+ // this.formView.focus();
299
+ }
300
+ }, {
301
+ key: "_hideUI",
302
+ value: function _hideUI() {
303
+ this.formView.nameInputView.fieldView.value = '';
304
+ this.formView.labelInputView.fieldView.value = '';
305
+ this.formView.orderInputView.fieldView.value = '';
306
+ this.formView.element.reset();
307
+ this._balloon.remove(this.formView);
308
+
309
+ // Focus the editing view after closing the form view.
310
+ this.editor.editing.view.focus();
311
+ }
312
+ }], [{
313
+ key: "requires",
314
+ get: function get() {
315
+ return [ContextualBalloon];
316
+ }
317
+ }]);
318
+ return InputUI;
319
+ }(Plugin);
320
+ var InsertEditableDivCommand = /*#__PURE__*/function (_Command) {
321
+ _inherits(InsertEditableDivCommand, _Command);
322
+ var _super4 = _createSuper(InsertEditableDivCommand);
323
+ function InsertEditableDivCommand() {
324
+ _classCallCheck(this, InsertEditableDivCommand);
325
+ return _super4.apply(this, arguments);
326
+ }
327
+ _createClass(InsertEditableDivCommand, [{
328
+ key: "execute",
329
+ value: function execute(param) {
330
+ var _this3 = this;
331
+ this.editor.model.change(function (writer) {
332
+ _this3.editor.model.insertObject(createEditableDivElement(writer, param));
333
+ });
334
+ }
335
+ }]);
336
+ return InsertEditableDivCommand;
337
+ }(Command);
338
+ function createEditableDivElement(writer, param) {
339
+ var element = writer.createElement('editableDiv', param);
340
+ return element;
341
+ }
@@ -0,0 +1 @@
1
+ @import url('../style.less');
@@ -0,0 +1,94 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ 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, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
8
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
11
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
13
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
+ import { View, LabeledFieldView, createLabeledInputText, ButtonView, submitHandler, icons, LabelView } from "../../ckeditor/ckeditor";
17
+ var FormView = /*#__PURE__*/function (_View) {
18
+ _inherits(FormView, _View);
19
+ var _super = _createSuper(FormView);
20
+ function FormView(locale) {
21
+ var _this;
22
+ _classCallCheck(this, FormView);
23
+ _this = _super.call(this, locale);
24
+ _this.attrLabel = _this._createLabel("属性");
25
+ _this.styleLabel = _this._createLabel("样式");
26
+ _this.labelInputView = _this._createInput('字段名');
27
+ _this.nameInputView = _this._createInput('字段');
28
+ _this.orderInputView = _this._createInput('排序号');
29
+ _this.widthInputView = _this._createInput('宽度');
30
+
31
+ // Create the save and cancel buttons.
32
+ _this.saveButtonView = _this._createButton('Save', icons.check, 'ck-button-save');
33
+ // Set the type to 'submit', which will trigger
34
+ // the submit event on entire form when clicked.
35
+ _this.saveButtonView.type = 'submit';
36
+ _this.cancelButtonView = _this._createButton('Cancel', icons.cancel, 'ck-button-cancel');
37
+ // Delegate ButtonView#execute to FormView#cancel.
38
+ _this.cancelButtonView.delegate('execute').to(_assertThisInitialized(_this), 'cancel');
39
+ _this.childViews = _this.createCollection([_this.attrLabel, _this.labelInputView, _this.nameInputView, _this.orderInputView, _this.styleLabel, _this.widthInputView, _this.saveButtonView, _this.cancelButtonView]);
40
+ _this.setTemplate({
41
+ tag: 'form',
42
+ attributes: {
43
+ class: ['ck', 'ck-abbr-form'],
44
+ tabindex: '-1'
45
+ },
46
+ children: _this.childViews
47
+ });
48
+ return _this;
49
+ }
50
+ _createClass(FormView, [{
51
+ key: "render",
52
+ value: function render() {
53
+ _get(_getPrototypeOf(FormView.prototype), "render", this).call(this);
54
+ submitHandler({
55
+ view: this
56
+ });
57
+ }
58
+ }, {
59
+ key: "focus",
60
+ value: function focus() {
61
+ this.childViews.first.focus();
62
+ }
63
+ }, {
64
+ key: "_createInput",
65
+ value: function _createInput(label) {
66
+ var labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);
67
+ labeledInput.label = label;
68
+ return labeledInput;
69
+ }
70
+ }, {
71
+ key: "_createButton",
72
+ value: function _createButton(label, icon, className) {
73
+ var button = new ButtonView();
74
+ button.set({
75
+ label: label,
76
+ icon: icon,
77
+ tooltip: true,
78
+ class: className
79
+ });
80
+ return button;
81
+ }
82
+ }, {
83
+ key: "_createLabel",
84
+ value: function _createLabel(text) {
85
+ var label = new LabelView();
86
+ label.set({
87
+ text: text
88
+ });
89
+ return label;
90
+ }
91
+ }]);
92
+ return FormView;
93
+ }(View);
94
+ export { FormView as default };