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,160 @@
1
+ import { ScriptLoader } from "../ScriptLoader.js";
2
+ import { getTinymce } from "../TinyMCE.js";
3
+ import { uuid, isNullOrUndefined, isDisabledOptionSupported, initEditor, mergePlugins, isTextarea } from "../Utils.js";
4
+ import { editorProps } from "./EditorPropTypes.js";
5
+ import { defineComponent, toRefs, ref, watch, onMounted, onBeforeUnmount, onActivated, onDeactivated, h, nextTick } from "vue";
6
+ var __assign = function() {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var renderInline = function(ce, id, elementRef, tagName) {
18
+ return ce(tagName ? tagName : "div", {
19
+ id,
20
+ ref: elementRef
21
+ });
22
+ };
23
+ var renderIframe = function(ce, id, elementRef) {
24
+ return ce("textarea", {
25
+ id,
26
+ visibility: "hidden",
27
+ ref: elementRef
28
+ });
29
+ };
30
+ var defaultInitValues = { selector: void 0, target: void 0 };
31
+ var setMode = function(editor, mode) {
32
+ var _a;
33
+ if (typeof ((_a = editor.mode) === null || _a === void 0 ? void 0 : _a.set) === "function") {
34
+ editor.mode.set(mode);
35
+ } else {
36
+ editor.setMode(mode);
37
+ }
38
+ };
39
+ var Editor = defineComponent({
40
+ props: editorProps,
41
+ setup: function(props, ctx) {
42
+ var conf = props.init ? __assign(__assign({}, props.init), defaultInitValues) : __assign({}, defaultInitValues);
43
+ var _a = toRefs(props), disabled = _a.disabled, readonly = _a.readonly, modelValue = _a.modelValue, tagName = _a.tagName;
44
+ var element = ref(null);
45
+ var vueEditor = null;
46
+ var elementId = props.id || uuid("tiny-vue");
47
+ var inlineEditor = props.init && props.init.inline || props.inline;
48
+ var modelBind = !!ctx.attrs["onUpdate:modelValue"];
49
+ var mounting = true;
50
+ var initialValue = props.initialValue ? props.initialValue : "";
51
+ var cache = "";
52
+ var getContent = function(isMounting) {
53
+ return modelBind ? function() {
54
+ return (modelValue === null || modelValue === void 0 ? void 0 : modelValue.value) ? modelValue.value : "";
55
+ } : function() {
56
+ return isMounting ? initialValue : cache;
57
+ };
58
+ };
59
+ var initWrapper = function() {
60
+ var content = getContent(mounting);
61
+ var finalInit = __assign(__assign({}, conf), { disabled: props.disabled, readonly: props.readonly, target: element.value, plugins: mergePlugins(conf.plugins, props.plugins), toolbar: props.toolbar || conf.toolbar, inline: inlineEditor, license_key: props.licenseKey, setup: function(editor) {
62
+ vueEditor = editor;
63
+ if (!isDisabledOptionSupported(vueEditor) && props.disabled === true) {
64
+ setMode(vueEditor, "readonly");
65
+ }
66
+ editor.on("init", function(e) {
67
+ return initEditor(e, props, ctx, editor, modelValue, content);
68
+ });
69
+ if (typeof conf.setup === "function") {
70
+ conf.setup(editor);
71
+ }
72
+ } });
73
+ if (isTextarea(element.value)) {
74
+ element.value.style.visibility = "";
75
+ }
76
+ getTinymce().init(finalInit);
77
+ mounting = false;
78
+ };
79
+ watch(readonly, function(isReadonly) {
80
+ if (vueEditor !== null) {
81
+ setMode(vueEditor, isReadonly ? "readonly" : "design");
82
+ }
83
+ });
84
+ watch(disabled, function(isDisabled) {
85
+ if (vueEditor !== null) {
86
+ if (isDisabledOptionSupported(vueEditor)) {
87
+ vueEditor.options.set("disabled", isDisabled);
88
+ } else {
89
+ setMode(vueEditor, isDisabled ? "readonly" : "design");
90
+ }
91
+ }
92
+ });
93
+ watch(tagName, function(_) {
94
+ var _a2;
95
+ if (vueEditor) {
96
+ if (!modelBind) {
97
+ cache = vueEditor.getContent();
98
+ }
99
+ (_a2 = getTinymce()) === null || _a2 === void 0 ? void 0 : _a2.remove(vueEditor);
100
+ nextTick(function() {
101
+ return initWrapper();
102
+ });
103
+ }
104
+ });
105
+ onMounted(function() {
106
+ if (getTinymce() !== null) {
107
+ initWrapper();
108
+ } else if (element.value && element.value.ownerDocument) {
109
+ var channel = props.cloudChannel ? props.cloudChannel : "8";
110
+ var apiKey = props.apiKey ? props.apiKey : "no-api-key";
111
+ var scriptSrc = isNullOrUndefined(props.tinymceScriptSrc) ? "https://cdn.tiny.cloud/1/".concat(apiKey, "/tinymce/").concat(channel, "/tinymce.min.js") : props.tinymceScriptSrc;
112
+ ScriptLoader.load(element.value.ownerDocument, scriptSrc, initWrapper);
113
+ }
114
+ });
115
+ onBeforeUnmount(function() {
116
+ if (getTinymce() !== null) {
117
+ getTinymce().remove(vueEditor);
118
+ }
119
+ });
120
+ if (!inlineEditor) {
121
+ onActivated(function() {
122
+ if (!mounting) {
123
+ initWrapper();
124
+ }
125
+ });
126
+ onDeactivated(function() {
127
+ var _a2;
128
+ if (vueEditor) {
129
+ if (!modelBind) {
130
+ cache = vueEditor.getContent();
131
+ }
132
+ (_a2 = getTinymce()) === null || _a2 === void 0 ? void 0 : _a2.remove(vueEditor);
133
+ }
134
+ });
135
+ }
136
+ var rerender = function(init) {
137
+ var _a2;
138
+ if (vueEditor) {
139
+ cache = vueEditor.getContent();
140
+ (_a2 = getTinymce()) === null || _a2 === void 0 ? void 0 : _a2.remove(vueEditor);
141
+ conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);
142
+ nextTick(function() {
143
+ return initWrapper();
144
+ });
145
+ }
146
+ };
147
+ ctx.expose({
148
+ rerender,
149
+ getEditor: function() {
150
+ return vueEditor;
151
+ }
152
+ });
153
+ return function() {
154
+ return inlineEditor ? renderInline(h, elementId, element, props.tagName) : renderIframe(h, elementId, element);
155
+ };
156
+ }
157
+ });
158
+ export {
159
+ Editor
160
+ };
@@ -0,0 +1,26 @@
1
+ var editorProps = {
2
+ apiKey: String,
3
+ licenseKey: String,
4
+ cloudChannel: String,
5
+ id: String,
6
+ init: Object,
7
+ initialValue: String,
8
+ inline: Boolean,
9
+ modelEvents: [String, Array],
10
+ plugins: [String, Array],
11
+ tagName: String,
12
+ toolbar: [String, Array],
13
+ modelValue: String,
14
+ disabled: Boolean,
15
+ readonly: Boolean,
16
+ tinymceScriptSrc: String,
17
+ outputFormat: {
18
+ type: String,
19
+ validator: function(prop) {
20
+ return prop === "html" || prop === "text";
21
+ }
22
+ }
23
+ };
24
+ export {
25
+ editorProps
26
+ };
@@ -0,0 +1,4 @@
1
+ import { Editor } from "./components/Editor.js";
2
+ export {
3
+ Editor as default
4
+ };
@@ -1,4 +1,4 @@
1
- const version = "0.0.56";
1
+ const version = "0.0.60";
2
2
  export {
3
3
  version
4
4
  };
@@ -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;