jky-component-lib 0.0.56 → 0.0.60

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 (87) hide show
  1. package/dist/es/add-input/AddInput.vue.d.ts +27 -0
  2. package/dist/es/add-input/AddInput.vue.js +151 -0
  3. package/dist/es/add-input/AddInput.vue3.js +5 -0
  4. package/dist/es/add-input/index.d.ts +4 -0
  5. package/dist/es/add-input/index.js +8 -0
  6. package/dist/es/add-input/style.css +35 -0
  7. package/dist/es/button-nav/ButtonNav.vue.d.ts +4 -4
  8. package/dist/es/code-mirror-editor/CodeMirrorEditor.vue.d.ts +4 -4
  9. package/dist/es/components.d.ts +3 -0
  10. package/dist/es/components.js +10 -1
  11. package/dist/es/form/Form.vue.d.ts +2 -2
  12. package/dist/es/form/FormItem.vue.js +12 -0
  13. package/dist/es/index.js +6 -0
  14. package/dist/es/node_modules/@element-plus/icons-vue/dist/index.js +32 -0
  15. package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js +52 -0
  16. package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js +10 -0
  17. package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js +145 -0
  18. package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js +160 -0
  19. package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js +26 -0
  20. package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js +4 -0
  21. package/dist/es/package.json.js +1 -1
  22. package/dist/es/page-header/PopoverMenu.vue.d.ts +1 -1
  23. package/dist/es/page-table/PageTable.vue.d.ts +6087 -0
  24. package/dist/es/page-table/PageTable.vue.js +378 -0
  25. package/dist/es/page-table/PageTable.vue3.js +5 -0
  26. package/dist/es/page-table/Toolbar.vue.d.ts +32 -0
  27. package/dist/es/page-table/Toolbar.vue.js +271 -0
  28. package/dist/es/page-table/Toolbar.vue3.js +5 -0
  29. package/dist/es/page-table/index.d.ts +4 -0
  30. package/dist/es/page-table/index.js +8 -0
  31. package/dist/es/page-table/style.css +4 -0
  32. package/dist/es/rich-editor/RichEditor.vue.d.ts +78 -0
  33. package/dist/es/rich-editor/RichEditor.vue.js +105 -0
  34. package/dist/es/rich-editor/RichEditor.vue3.js +5 -0
  35. package/dist/es/rich-editor/index.d.ts +4 -0
  36. package/dist/es/rich-editor/index.js +8 -0
  37. package/dist/es/rich-editor/style.css +34 -0
  38. package/dist/es/style.css +28 -0
  39. package/dist/es/styles.css +1 -1
  40. package/dist/es/utils/index.d.ts +1 -0
  41. package/dist/es/utils/responsive-toolbar.d.ts +78 -0
  42. package/dist/es/utils/responsive-toolbar.js +64 -0
  43. package/dist/lib/add-input/AddInput.vue.d.ts +27 -0
  44. package/dist/lib/add-input/AddInput.vue.js +151 -0
  45. package/dist/lib/add-input/AddInput.vue3.js +5 -0
  46. package/dist/lib/add-input/index.d.ts +4 -0
  47. package/dist/lib/add-input/index.js +8 -0
  48. package/dist/lib/add-input/style.css +35 -0
  49. package/dist/lib/button-nav/ButtonNav.vue.d.ts +4 -4
  50. package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue.d.ts +4 -4
  51. package/dist/lib/components.d.ts +3 -0
  52. package/dist/lib/components.js +30 -21
  53. package/dist/lib/form/Form.vue.d.ts +2 -2
  54. package/dist/lib/form/FormItem.vue.js +20 -8
  55. package/dist/lib/index.js +20 -14
  56. package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +32 -0
  57. package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js +52 -0
  58. package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js +10 -0
  59. package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js +145 -0
  60. package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js +160 -0
  61. package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js +26 -0
  62. package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js +4 -0
  63. package/dist/lib/package.json.js +1 -1
  64. package/dist/lib/page-header/PopoverMenu.vue.d.ts +1 -1
  65. package/dist/lib/page-table/PageTable.vue.d.ts +6087 -0
  66. package/dist/lib/page-table/PageTable.vue.js +378 -0
  67. package/dist/lib/page-table/PageTable.vue3.js +5 -0
  68. package/dist/lib/page-table/Toolbar.vue.d.ts +32 -0
  69. package/dist/lib/page-table/Toolbar.vue.js +271 -0
  70. package/dist/lib/page-table/Toolbar.vue3.js +5 -0
  71. package/dist/lib/page-table/index.d.ts +4 -0
  72. package/dist/lib/page-table/index.js +8 -0
  73. package/dist/lib/page-table/style.css +4 -0
  74. package/dist/lib/rich-editor/RichEditor.vue.d.ts +78 -0
  75. package/dist/lib/rich-editor/RichEditor.vue.js +105 -0
  76. package/dist/lib/rich-editor/RichEditor.vue3.js +5 -0
  77. package/dist/lib/rich-editor/index.d.ts +4 -0
  78. package/dist/lib/rich-editor/index.js +8 -0
  79. package/dist/lib/rich-editor/style.css +34 -0
  80. package/dist/lib/style.css +28 -0
  81. package/dist/lib/styles.css +1 -1
  82. package/dist/lib/utils/index.d.ts +1 -0
  83. package/dist/lib/utils/responsive-toolbar.d.ts +78 -0
  84. package/dist/lib/utils/responsive-toolbar.js +64 -0
  85. package/package.json +4 -1
  86. package/dist/umd/index.js +0 -3966
  87. package/dist/umd/styles.css +0 -1
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ var validEvents = [
5
+ "onActivate",
6
+ "onAddUndo",
7
+ "onBeforeAddUndo",
8
+ "onBeforeExecCommand",
9
+ "onBeforeGetContent",
10
+ "onBeforeRenderUI",
11
+ "onBeforeSetContent",
12
+ "onBeforePaste",
13
+ "onBlur",
14
+ "onChange",
15
+ "onClearUndos",
16
+ "onClick",
17
+ "onContextMenu",
18
+ "onCommentChange",
19
+ "onCompositionEnd",
20
+ "onCompositionStart",
21
+ "onCompositionUpdate",
22
+ "onCopy",
23
+ "onCut",
24
+ "onDblclick",
25
+ "onDeactivate",
26
+ "onDirty",
27
+ "onDrag",
28
+ "onDragDrop",
29
+ "onDragEnd",
30
+ "onDragGesture",
31
+ "onDragOver",
32
+ "onDrop",
33
+ "onExecCommand",
34
+ "onFocus",
35
+ "onFocusIn",
36
+ "onFocusOut",
37
+ "onGetContent",
38
+ "onHide",
39
+ "onInit",
40
+ "onInput",
41
+ "onKeyDown",
42
+ "onKeyPress",
43
+ "onKeyUp",
44
+ "onLoadContent",
45
+ "onMouseDown",
46
+ "onMouseEnter",
47
+ "onMouseLeave",
48
+ "onMouseMove",
49
+ "onMouseOut",
50
+ "onMouseOver",
51
+ "onMouseUp",
52
+ "onNodeChange",
53
+ "onObjectResizeStart",
54
+ "onObjectResized",
55
+ "onObjectSelected",
56
+ "onPaste",
57
+ "onPostProcess",
58
+ "onPostRender",
59
+ "onPreProcess",
60
+ "onProgressState",
61
+ "onRedo",
62
+ "onRemove",
63
+ "onReset",
64
+ "onSaveContent",
65
+ "onSelectionChange",
66
+ "onSetAttrib",
67
+ "onSetContent",
68
+ "onShow",
69
+ "onSubmit",
70
+ "onUndo",
71
+ "onVisualAid"
72
+ ];
73
+ var isValidKey = function(key) {
74
+ return validEvents.map(function(event) {
75
+ return event.toLowerCase();
76
+ }).indexOf(key.toLowerCase()) !== -1;
77
+ };
78
+ var bindHandlers = function(initEvent, listeners, editor) {
79
+ Object.keys(listeners).filter(isValidKey).forEach(function(key) {
80
+ var handler = listeners[key];
81
+ if (typeof handler === "function") {
82
+ if (key === "onInit") {
83
+ handler(initEvent, editor);
84
+ } else {
85
+ editor.on(key.substring(2), function(e) {
86
+ return handler(e, editor);
87
+ });
88
+ }
89
+ }
90
+ });
91
+ };
92
+ var bindModelHandlers = function(props, ctx, editor, modelValue) {
93
+ var modelEvents = props.modelEvents ? props.modelEvents : null;
94
+ var normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(" ") : modelEvents;
95
+ vue.watch(modelValue, function(val, prevVal) {
96
+ if (editor && typeof val === "string" && val !== prevVal && val !== editor.getContent({ format: props.outputFormat })) {
97
+ editor.setContent(val);
98
+ }
99
+ });
100
+ editor.on(normalizedEvents ? normalizedEvents : "change input undo redo", function() {
101
+ ctx.emit("update:modelValue", editor.getContent({ format: props.outputFormat }));
102
+ });
103
+ };
104
+ var initEditor = function(initEvent, props, ctx, editor, modelValue, content) {
105
+ editor.setContent(content());
106
+ if (ctx.attrs["onUpdate:modelValue"]) {
107
+ bindModelHandlers(props, ctx, editor, modelValue);
108
+ }
109
+ bindHandlers(initEvent, ctx.attrs, editor);
110
+ };
111
+ var unique = 0;
112
+ var uuid = function(prefix) {
113
+ var time = Date.now();
114
+ var random = Math.floor(Math.random() * 1e9);
115
+ unique++;
116
+ return prefix + "_" + random + unique + String(time);
117
+ };
118
+ var isTextarea = function(element) {
119
+ return element !== null && element.tagName.toLowerCase() === "textarea";
120
+ };
121
+ var normalizePluginArray = function(plugins) {
122
+ if (typeof plugins === "undefined" || plugins === "") {
123
+ return [];
124
+ }
125
+ return Array.isArray(plugins) ? plugins : plugins.split(" ");
126
+ };
127
+ var mergePlugins = function(initPlugins, inputPlugins) {
128
+ return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
129
+ };
130
+ var isNullOrUndefined = function(value) {
131
+ return value === null || value === void 0;
132
+ };
133
+ var isDisabledOptionSupported = function(editor) {
134
+ var _a;
135
+ return typeof ((_a = editor.options) === null || _a === void 0 ? void 0 : _a.set) === "function" && editor.options.isRegistered("disabled");
136
+ };
137
+ exports.bindHandlers = bindHandlers;
138
+ exports.bindModelHandlers = bindModelHandlers;
139
+ exports.initEditor = initEditor;
140
+ exports.isDisabledOptionSupported = isDisabledOptionSupported;
141
+ exports.isNullOrUndefined = isNullOrUndefined;
142
+ exports.isTextarea = isTextarea;
143
+ exports.isValidKey = isValidKey;
144
+ exports.mergePlugins = mergePlugins;
145
+ exports.uuid = uuid;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ScriptLoader = require("../ScriptLoader.js");
4
+ const TinyMCE = require("../TinyMCE.js");
5
+ const Utils = require("../Utils.js");
6
+ const EditorPropTypes = require("./EditorPropTypes.js");
7
+ const vue = require("vue");
8
+ var __assign = function() {
9
+ __assign = Object.assign || function(t) {
10
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
11
+ s = arguments[i];
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13
+ t[p] = s[p];
14
+ }
15
+ return t;
16
+ };
17
+ return __assign.apply(this, arguments);
18
+ };
19
+ var renderInline = function(ce, id, elementRef, tagName) {
20
+ return ce(tagName ? tagName : "div", {
21
+ id,
22
+ ref: elementRef
23
+ });
24
+ };
25
+ var renderIframe = function(ce, id, elementRef) {
26
+ return ce("textarea", {
27
+ id,
28
+ visibility: "hidden",
29
+ ref: elementRef
30
+ });
31
+ };
32
+ var defaultInitValues = { selector: void 0, target: void 0 };
33
+ var setMode = function(editor, mode) {
34
+ var _a;
35
+ if (typeof ((_a = editor.mode) === null || _a === void 0 ? void 0 : _a.set) === "function") {
36
+ editor.mode.set(mode);
37
+ } else {
38
+ editor.setMode(mode);
39
+ }
40
+ };
41
+ var Editor = vue.defineComponent({
42
+ props: EditorPropTypes.editorProps,
43
+ setup: function(props, ctx) {
44
+ var conf = props.init ? __assign(__assign({}, props.init), defaultInitValues) : __assign({}, defaultInitValues);
45
+ var _a = vue.toRefs(props), disabled = _a.disabled, readonly = _a.readonly, modelValue = _a.modelValue, tagName = _a.tagName;
46
+ var element = vue.ref(null);
47
+ var vueEditor = null;
48
+ var elementId = props.id || Utils.uuid("tiny-vue");
49
+ var inlineEditor = props.init && props.init.inline || props.inline;
50
+ var modelBind = !!ctx.attrs["onUpdate:modelValue"];
51
+ var mounting = true;
52
+ var initialValue = props.initialValue ? props.initialValue : "";
53
+ var cache = "";
54
+ var getContent = function(isMounting) {
55
+ return modelBind ? function() {
56
+ return (modelValue === null || modelValue === void 0 ? void 0 : modelValue.value) ? modelValue.value : "";
57
+ } : function() {
58
+ return isMounting ? initialValue : cache;
59
+ };
60
+ };
61
+ var initWrapper = function() {
62
+ var content = getContent(mounting);
63
+ var finalInit = __assign(__assign({}, conf), { disabled: props.disabled, readonly: props.readonly, target: element.value, plugins: Utils.mergePlugins(conf.plugins, props.plugins), toolbar: props.toolbar || conf.toolbar, inline: inlineEditor, license_key: props.licenseKey, setup: function(editor) {
64
+ vueEditor = editor;
65
+ if (!Utils.isDisabledOptionSupported(vueEditor) && props.disabled === true) {
66
+ setMode(vueEditor, "readonly");
67
+ }
68
+ editor.on("init", function(e) {
69
+ return Utils.initEditor(e, props, ctx, editor, modelValue, content);
70
+ });
71
+ if (typeof conf.setup === "function") {
72
+ conf.setup(editor);
73
+ }
74
+ } });
75
+ if (Utils.isTextarea(element.value)) {
76
+ element.value.style.visibility = "";
77
+ }
78
+ TinyMCE.getTinymce().init(finalInit);
79
+ mounting = false;
80
+ };
81
+ vue.watch(readonly, function(isReadonly) {
82
+ if (vueEditor !== null) {
83
+ setMode(vueEditor, isReadonly ? "readonly" : "design");
84
+ }
85
+ });
86
+ vue.watch(disabled, function(isDisabled) {
87
+ if (vueEditor !== null) {
88
+ if (Utils.isDisabledOptionSupported(vueEditor)) {
89
+ vueEditor.options.set("disabled", isDisabled);
90
+ } else {
91
+ setMode(vueEditor, isDisabled ? "readonly" : "design");
92
+ }
93
+ }
94
+ });
95
+ vue.watch(tagName, function(_) {
96
+ var _a2;
97
+ if (vueEditor) {
98
+ if (!modelBind) {
99
+ cache = vueEditor.getContent();
100
+ }
101
+ (_a2 = TinyMCE.getTinymce()) === null || _a2 === void 0 ? void 0 : _a2.remove(vueEditor);
102
+ vue.nextTick(function() {
103
+ return initWrapper();
104
+ });
105
+ }
106
+ });
107
+ vue.onMounted(function() {
108
+ if (TinyMCE.getTinymce() !== null) {
109
+ initWrapper();
110
+ } else if (element.value && element.value.ownerDocument) {
111
+ var channel = props.cloudChannel ? props.cloudChannel : "8";
112
+ var apiKey = props.apiKey ? props.apiKey : "no-api-key";
113
+ var scriptSrc = Utils.isNullOrUndefined(props.tinymceScriptSrc) ? "https://cdn.tiny.cloud/1/".concat(apiKey, "/tinymce/").concat(channel, "/tinymce.min.js") : props.tinymceScriptSrc;
114
+ ScriptLoader.ScriptLoader.load(element.value.ownerDocument, scriptSrc, initWrapper);
115
+ }
116
+ });
117
+ vue.onBeforeUnmount(function() {
118
+ if (TinyMCE.getTinymce() !== null) {
119
+ TinyMCE.getTinymce().remove(vueEditor);
120
+ }
121
+ });
122
+ if (!inlineEditor) {
123
+ vue.onActivated(function() {
124
+ if (!mounting) {
125
+ initWrapper();
126
+ }
127
+ });
128
+ vue.onDeactivated(function() {
129
+ var _a2;
130
+ if (vueEditor) {
131
+ if (!modelBind) {
132
+ cache = vueEditor.getContent();
133
+ }
134
+ (_a2 = TinyMCE.getTinymce()) === null || _a2 === void 0 ? void 0 : _a2.remove(vueEditor);
135
+ }
136
+ });
137
+ }
138
+ var rerender = function(init) {
139
+ var _a2;
140
+ if (vueEditor) {
141
+ cache = vueEditor.getContent();
142
+ (_a2 = TinyMCE.getTinymce()) === null || _a2 === void 0 ? void 0 : _a2.remove(vueEditor);
143
+ conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);
144
+ vue.nextTick(function() {
145
+ return initWrapper();
146
+ });
147
+ }
148
+ };
149
+ ctx.expose({
150
+ rerender,
151
+ getEditor: function() {
152
+ return vueEditor;
153
+ }
154
+ });
155
+ return function() {
156
+ return inlineEditor ? renderInline(vue.h, elementId, element, props.tagName) : renderIframe(vue.h, elementId, element);
157
+ };
158
+ }
159
+ });
160
+ exports.Editor = Editor;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var editorProps = {
4
+ apiKey: String,
5
+ licenseKey: String,
6
+ cloudChannel: String,
7
+ id: String,
8
+ init: Object,
9
+ initialValue: String,
10
+ inline: Boolean,
11
+ modelEvents: [String, Array],
12
+ plugins: [String, Array],
13
+ tagName: String,
14
+ toolbar: [String, Array],
15
+ modelValue: String,
16
+ disabled: Boolean,
17
+ readonly: Boolean,
18
+ tinymceScriptSrc: String,
19
+ outputFormat: {
20
+ type: String,
21
+ validator: function(prop) {
22
+ return prop === "html" || prop === "text";
23
+ }
24
+ }
25
+ };
26
+ exports.editorProps = editorProps;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const Editor = require("./components/Editor.js");
4
+ exports.default = Editor.Editor;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "0.0.56";
3
+ const version = "0.0.60";
4
4
  exports.version = version;
@@ -2,9 +2,9 @@ import { TooltipTriggerType } from 'element-plus';
2
2
  import { Arrayable } from 'element-plus/es/utils';
3
3
  import { PageHeaderPopoverMenuItem, PageHeaderPopoverMenuProps } from './types';
4
4
  declare const _default: import('vue').DefineComponent<PageHeaderPopoverMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PageHeaderPopoverMenuProps> & Readonly<{}>, {
5
+ width: number;
5
6
  trigger: Arrayable<TooltipTriggerType>;
6
7
  placement: import('element-plus').Placement;
7
- width: number;
8
8
  menus: PageHeaderPopoverMenuItem[];
9
9
  highlightCurrent: boolean;
10
10
  buttonClass: string;