@vunk/form 1.2.2 → 1.3.0

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 (176) hide show
  1. package/components/download-plus/index.cjs +4 -4
  2. package/components/download-plus/index.mjs +4 -4
  3. package/components/form-item/index.cjs +3 -4
  4. package/components/form-item/index.mjs +3 -4
  5. package/components/input/index.cjs +2 -2
  6. package/components/input/index.mjs +2 -2
  7. package/components/monaco-editor/index.cjs +83 -0
  8. package/components/monaco-editor/index.css +3 -0
  9. package/components/monaco-editor/index.mjs +77 -0
  10. package/components/slider/index.cjs +3 -3
  11. package/components/slider/index.mjs +3 -3
  12. package/components/templates-default/index.cjs +41 -26
  13. package/components/templates-default/index.mjs +41 -26
  14. package/components/upload/index.cjs +2 -2
  15. package/components/upload/index.mjs +2 -2
  16. package/components/upload-plus/index.cjs +19 -20
  17. package/components/upload-plus/index.mjs +19 -20
  18. package/components/vditor/index.cjs +43 -408
  19. package/components/vditor/index.mjs +44 -409
  20. package/composables/useSourceManager.d.ts +1 -1
  21. package/index.css +4 -13
  22. package/package.json +9 -4
  23. package/shared/element-plus/ctx.d.ts +3 -3
  24. package/shared/element-plus/instances.d.ts +2 -2
  25. package/components/button/index.d.ts +0 -4
  26. package/components/button/src/ctx.d.ts +0 -96
  27. package/components/button/src/index.vue.d.ts +0 -219
  28. package/components/button/src/types.d.ts +0 -13
  29. package/components/cascader/index.d.ts +0 -6
  30. package/components/cascader/src/ctx.d.ts +0 -120
  31. package/components/cascader/src/index.vue.d.ts +0 -291
  32. package/components/cascader/src/types.d.ts +0 -7
  33. package/components/cascader/src/use.d.ts +0 -5
  34. package/components/checkbox/index.d.ts +0 -5
  35. package/components/checkbox/src/ctx.d.ts +0 -89
  36. package/components/checkbox/src/index.vue.d.ts +0 -203
  37. package/components/checkbox/src/types.d.ts +0 -8
  38. package/components/color-picker/index.d.ts +0 -4
  39. package/components/color-picker/src/ctx.d.ts +0 -80
  40. package/components/color-picker/src/index.vue.d.ts +0 -192
  41. package/components/color-picker/src/types.d.ts +0 -7
  42. package/components/date-picker/index.d.ts +0 -5
  43. package/components/date-picker/src/ctx.d.ts +0 -158
  44. package/components/date-picker/src/index.vue.d.ts +0 -376
  45. package/components/date-picker/src/types.d.ts +0 -20
  46. package/components/date-picker-range/index.d.ts +0 -4
  47. package/components/date-picker-range/src/ctx.d.ts +0 -177
  48. package/components/date-picker-range/src/index.vue.d.ts +0 -398
  49. package/components/date-picker-range/src/types.d.ts +0 -12
  50. package/components/download-plus/index.d.ts +0 -4
  51. package/components/download-plus/src/api.d.ts +0 -13
  52. package/components/download-plus/src/const.d.ts +0 -9
  53. package/components/download-plus/src/ctx.d.ts +0 -84
  54. package/components/download-plus/src/index.vue.d.ts +0 -206
  55. package/components/download-plus/src/types.d.ts +0 -17
  56. package/components/esri-input-geojson/index.d.ts +0 -6
  57. package/components/esri-input-geojson/src/append.vue.d.ts +0 -32
  58. package/components/esri-input-geojson/src/const.d.ts +0 -12
  59. package/components/esri-input-geojson/src/ctx.d.ts +0 -223
  60. package/components/esri-input-geojson/src/default-view.vue.d.ts +0 -133
  61. package/components/esri-input-geojson/src/index.vue.d.ts +0 -549
  62. package/components/esri-input-geojson/src/types.d.ts +0 -22
  63. package/components/esri-input-geojson/src/viewer.vue.d.ts +0 -296
  64. package/components/form/index.d.ts +0 -5
  65. package/components/form/src/ctx.d.ts +0 -84
  66. package/components/form/src/index.vue.d.ts +0 -455
  67. package/components/form/src/types.d.ts +0 -12
  68. package/components/form/src/utils.d.ts +0 -15
  69. package/components/form-item/index.d.ts +0 -5
  70. package/components/form-item/src/ctx.d.ts +0 -62
  71. package/components/form-item/src/index.vue.d.ts +0 -140
  72. package/components/form-item/src/types.d.ts +0 -6
  73. package/components/form-item-renderer/index.d.ts +0 -5
  74. package/components/form-item-renderer/src/ctx.d.ts +0 -16
  75. package/components/form-item-renderer/src/index.vue.d.ts +0 -38
  76. package/components/form-item-renderer/src/symbols.d.ts +0 -2
  77. package/components/form-item-renderer/src/types.d.ts +0 -7
  78. package/components/form-item-renderer-template/index.d.ts +0 -4
  79. package/components/form-item-renderer-template/src/ctx.d.ts +0 -7
  80. package/components/form-item-renderer-template/src/index.vue.d.ts +0 -16
  81. package/components/form-item-renderer-template/src/types.d.ts +0 -1
  82. package/components/geoinput/index.d.ts +0 -4
  83. package/components/geoinput/src/ctx.d.ts +0 -228
  84. package/components/geoinput/src/index.vue.d.ts +0 -496
  85. package/components/geoinput/src/types.d.ts +0 -12
  86. package/components/geoinput-read/index.d.ts +0 -5
  87. package/components/geoinput-read/src/append.vue.d.ts +0 -6
  88. package/components/geoinput-read/src/core.vue.d.ts +0 -482
  89. package/components/geoinput-read/src/ctx.d.ts +0 -199
  90. package/components/geoinput-read/src/index.vue.d.ts +0 -441
  91. package/components/geoinput-read/src/types.d.ts +0 -3
  92. package/components/geoinput-update/index.d.ts +0 -5
  93. package/components/geoinput-update/src/append.vue.d.ts +0 -20
  94. package/components/geoinput-update/src/ctx.d.ts +0 -207
  95. package/components/geoinput-update/src/index.vue.d.ts +0 -508
  96. package/components/geoinput-update/src/types.d.ts +0 -6
  97. package/components/input/index.d.ts +0 -5
  98. package/components/input/src/ctx.d.ts +0 -148
  99. package/components/input/src/index.vue.d.ts +0 -343
  100. package/components/input/src/types.d.ts +0 -13
  101. package/components/input-link/index.d.ts +0 -4
  102. package/components/input-link/src/ctx.d.ts +0 -179
  103. package/components/input-link/src/index.vue.d.ts +0 -373
  104. package/components/input-link/src/types.d.ts +0 -7
  105. package/components/input-number/index.d.ts +0 -4
  106. package/components/input-number/src/ctx.d.ts +0 -90
  107. package/components/input-number/src/index.vue.d.ts +0 -216
  108. package/components/input-number/src/types.d.ts +0 -8
  109. package/components/radio/index.d.ts +0 -4
  110. package/components/radio/src/ctx.d.ts +0 -82
  111. package/components/radio/src/index.vue.d.ts +0 -195
  112. package/components/radio/src/types.d.ts +0 -8
  113. package/components/select/index.d.ts +0 -4
  114. package/components/select/src/ctx.d.ts +0 -156
  115. package/components/select/src/index.vue.d.ts +0 -492
  116. package/components/select/src/types.d.ts +0 -11
  117. package/components/slider/index.d.ts +0 -4
  118. package/components/slider/src/ctx.d.ts +0 -127
  119. package/components/slider/src/index.vue.d.ts +0 -328
  120. package/components/slider/src/types.d.ts +0 -7
  121. package/components/switch/index.d.ts +0 -4
  122. package/components/switch/src/ctx.d.ts +0 -114
  123. package/components/switch/src/index.vue.d.ts +0 -273
  124. package/components/switch/src/types.d.ts +0 -8
  125. package/components/templates-default/index.d.ts +0 -4
  126. package/components/templates-default/src/ctx.d.ts +0 -19
  127. package/components/templates-default/src/index.vue.d.ts +0 -43
  128. package/components/templates-default/src/types.d.ts +0 -53
  129. package/components/templates-element-plus/index.d.ts +0 -4
  130. package/components/templates-element-plus/src/ctx.d.ts +0 -9
  131. package/components/templates-element-plus/src/index.vue.d.ts +0 -19
  132. package/components/templates-element-plus/src/types.d.ts +0 -13
  133. package/components/templates-esri/index.d.ts +0 -4
  134. package/components/templates-esri/src/ctx.d.ts +0 -11
  135. package/components/templates-esri/src/index.vue.d.ts +0 -20
  136. package/components/templates-esri/src/types.d.ts +0 -2
  137. package/components/templates-layout/index.d.ts +0 -4
  138. package/components/templates-layout/src/ctx.d.ts +0 -9
  139. package/components/templates-layout/src/index.vue.d.ts +0 -19
  140. package/components/templates-layout/src/types.d.ts +0 -32
  141. package/components/templates-mapbox/index.d.ts +0 -4
  142. package/components/templates-mapbox/src/ctx.d.ts +0 -11
  143. package/components/templates-mapbox/src/index.vue.d.ts +0 -20
  144. package/components/templates-mapbox/src/types.d.ts +0 -3
  145. package/components/templates-variant/index.d.ts +0 -4
  146. package/components/templates-variant/src/ctx.d.ts +0 -11
  147. package/components/templates-variant/src/index.vue.d.ts +0 -20
  148. package/components/templates-variant/src/types.d.ts +0 -2
  149. package/components/upload/index.d.ts +0 -5
  150. package/components/upload/src/ctx.d.ts +0 -180
  151. package/components/upload/src/file.vue.d.ts +0 -106
  152. package/components/upload/src/index.vue.d.ts +0 -427
  153. package/components/upload/src/types.d.ts +0 -7
  154. package/components/upload-plus/index.d.ts +0 -6
  155. package/components/upload-plus/src/api.d.ts +0 -38
  156. package/components/upload-plus/src/const.d.ts +0 -9
  157. package/components/upload-plus/src/ctx.d.ts +0 -103
  158. package/components/upload-plus/src/index.vue.d.ts +0 -215
  159. package/components/upload-plus/src/types.d.ts +0 -32
  160. package/components/van-cascader/index.d.ts +0 -4
  161. package/components/van-cascader/src/ctx.d.ts +0 -118
  162. package/components/van-cascader/src/index.vue.d.ts +0 -275
  163. package/components/van-cascader/src/types.d.ts +0 -1
  164. package/components/var-datetime-picker/index.d.ts +0 -4
  165. package/components/var-datetime-picker/src/const.d.ts +0 -10
  166. package/components/var-datetime-picker/src/ctx.d.ts +0 -67
  167. package/components/var-datetime-picker/src/index.vue.d.ts +0 -157
  168. package/components/var-datetime-picker/src/types.d.ts +0 -22
  169. package/components/vditor/index.css +0 -12
  170. package/components/vditor/index.d.ts +0 -4
  171. package/components/vditor/src/ctx.d.ts +0 -31
  172. package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
  173. package/components/vditor/src/handle-value.vue.d.ts +0 -18
  174. package/components/vditor/src/index.vue.d.ts +0 -66
  175. package/components/vditor/src/types.d.ts +0 -9
  176. package/components/vditor/src/use.d.ts +0 -4
@@ -2,438 +2,73 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Vditor = require('vditor');
6
5
  var vue = require('vue');
6
+ var vditor = require('@vunk/plus/components/vditor');
7
+ var formItem = require('@vunk/form/components/form-item');
8
+ var composables = require('@vunk/form/composables');
7
9
  var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
8
- var core = require('@vunk/core');
9
10
 
10
11
  const props = {
11
- modelValue: {
12
- type: String,
13
- default: ""
14
- },
15
- defaultOptions: {
16
- type: Object,
17
- default: () => ({})
18
- },
19
- placeholder: {
20
- type: String,
21
- default: "\u95EE\u6211\u4EFB\u4F55\u95EE\u9898...(Crtl + Enter \u53D1\u9001)"
22
- },
23
- toolbar: {
24
- type: Array,
25
- default: () => [
26
- "headings",
27
- "bold",
28
- "italic",
29
- "strike",
30
- "link",
31
- "|",
32
- "list",
33
- "ordered-list",
34
- "outdent",
35
- "indent",
36
- "|",
37
- "line",
38
- "code",
39
- "inline-code",
40
- "insert-before",
41
- "insert-after",
42
- "|",
43
- "table",
44
- "|",
45
- "undo",
46
- "redo",
47
- "|",
48
- "fullscreen",
49
- "outline",
50
- "export",
51
- "|"
52
- ]
53
- },
54
- fullscreen: {
12
+ ...formItem._VkfFormItemCtx.props,
13
+ ...vditor._VkVditorCtx.props,
14
+ readonly: {
55
15
  type: Boolean,
56
- default: false
16
+ default: void 0
57
17
  }
58
18
  };
59
19
  const emits = {
60
- load: (e) => e,
61
- "update:modelValue": (e) => e,
62
- ctrlEnter: (e) => e,
63
- "update:fullscreen": (e) => e
20
+ ...vditor._VkVditorCtx.emits
64
21
  };
65
22
 
66
- function mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e);});}}}
67
-
68
- const useVditor = () => {
69
- const core = vue.inject("vkfVditorRef", null);
70
- if (!core) {
71
- throw new Error("useVditor must be used after VditorProvider");
72
- }
73
- return vue.unref(core);
74
- };
75
- const useVditorMitter = () => {
76
- const core = vue.inject("vkfVditorMitter", null);
77
- if (!core) {
78
- throw new Error("useVditorMitter must be used after VditorProvider");
79
- }
80
- return core;
81
- };
82
-
83
- var _a;
84
- const isClient = typeof window !== "undefined";
85
- isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
86
-
87
- function createFilterWrapper(filter, fn) {
88
- function wrapper(...args) {
89
- filter(() => fn.apply(this, args), { fn, thisArg: this, args });
90
- }
91
- return wrapper;
92
- }
93
- const bypassFilter = (invoke) => {
94
- return invoke();
95
- };
96
- function pausableFilter(extendFilter = bypassFilter) {
97
- const isActive = vue.ref(true);
98
- function pause() {
99
- isActive.value = false;
100
- }
101
- function resume() {
102
- isActive.value = true;
103
- }
104
- const eventFilter = (...args) => {
105
- if (isActive.value)
106
- extendFilter(...args);
107
- };
108
- return { isActive, pause, resume, eventFilter };
109
- }
110
-
111
- function tryOnScopeDispose(fn) {
112
- if (vue.getCurrentScope()) {
113
- vue.onScopeDispose(fn);
114
- return true;
115
- }
116
- return false;
117
- }
118
-
119
- var __getOwnPropSymbols$6$1 = Object.getOwnPropertySymbols;
120
- var __hasOwnProp$6$1 = Object.prototype.hasOwnProperty;
121
- var __propIsEnum$6$1 = Object.prototype.propertyIsEnumerable;
122
- var __objRest$5 = (source, exclude) => {
123
- var target = {};
124
- for (var prop in source)
125
- if (__hasOwnProp$6$1.call(source, prop) && exclude.indexOf(prop) < 0)
126
- target[prop] = source[prop];
127
- if (source != null && __getOwnPropSymbols$6$1)
128
- for (var prop of __getOwnPropSymbols$6$1(source)) {
129
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6$1.call(source, prop))
130
- target[prop] = source[prop];
131
- }
132
- return target;
133
- };
134
- function watchWithFilter(source, cb, options = {}) {
135
- const _a = options, {
136
- eventFilter = bypassFilter
137
- } = _a, watchOptions = __objRest$5(_a, [
138
- "eventFilter"
139
- ]);
140
- return vue.watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
141
- }
142
-
143
- var __defProp$2 = Object.defineProperty;
144
- var __defProps$2 = Object.defineProperties;
145
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
146
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
147
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
148
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
149
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
150
- var __spreadValues$2 = (a, b) => {
151
- for (var prop in b || (b = {}))
152
- if (__hasOwnProp$2.call(b, prop))
153
- __defNormalProp$2(a, prop, b[prop]);
154
- if (__getOwnPropSymbols$2)
155
- for (var prop of __getOwnPropSymbols$2(b)) {
156
- if (__propIsEnum$2.call(b, prop))
157
- __defNormalProp$2(a, prop, b[prop]);
158
- }
159
- return a;
160
- };
161
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
162
- var __objRest$1$1 = (source, exclude) => {
163
- var target = {};
164
- for (var prop in source)
165
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
166
- target[prop] = source[prop];
167
- if (source != null && __getOwnPropSymbols$2)
168
- for (var prop of __getOwnPropSymbols$2(source)) {
169
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
170
- target[prop] = source[prop];
171
- }
172
- return target;
173
- };
174
- function watchPausable(source, cb, options = {}) {
175
- const _a = options, {
176
- eventFilter: filter
177
- } = _a, watchOptions = __objRest$1$1(_a, [
178
- "eventFilter"
179
- ]);
180
- const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
181
- const stop = watchWithFilter(source, cb, __spreadProps$2(__spreadValues$2({}, watchOptions), {
182
- eventFilter
183
- }));
184
- return { stop, pause, resume, isActive };
185
- }
186
-
187
- function unrefElement(elRef) {
188
- var _a;
189
- const plain = vue.unref(elRef);
190
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
191
- }
192
-
193
- const defaultWindow = isClient ? window : void 0;
194
-
195
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
196
- const globalKey = "__vueuse_ssr_handlers__";
197
- _global[globalKey] = _global[globalKey] || {};
198
-
199
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
200
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
201
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
202
- var __objRest$1 = (source, exclude) => {
203
- var target = {};
204
- for (var prop in source)
205
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
206
- target[prop] = source[prop];
207
- if (source != null && __getOwnPropSymbols$6)
208
- for (var prop of __getOwnPropSymbols$6(source)) {
209
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
210
- target[prop] = source[prop];
211
- }
212
- return target;
213
- };
214
- function useMutationObserver(target, callback, options = {}) {
215
- const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest$1(_a, ["window"]);
216
- let observer;
217
- const isSupported = window && "MutationObserver" in window;
218
- const cleanup = () => {
219
- if (observer) {
220
- observer.disconnect();
221
- observer = void 0;
222
- }
223
- };
224
- const stopWatch = vue.watch(() => unrefElement(target), (el) => {
225
- cleanup();
226
- if (isSupported && window && el) {
227
- observer = new MutationObserver(callback);
228
- observer.observe(el, mutationOptions);
229
- }
230
- }, { immediate: true });
231
- const stop = () => {
232
- cleanup();
233
- stopWatch();
234
- };
235
- tryOnScopeDispose(stop);
236
- return {
237
- isSupported,
238
- stop
239
- };
240
- }
241
-
242
- var SwipeDirection;
243
- (function(SwipeDirection2) {
244
- SwipeDirection2["UP"] = "UP";
245
- SwipeDirection2["RIGHT"] = "RIGHT";
246
- SwipeDirection2["DOWN"] = "DOWN";
247
- SwipeDirection2["LEFT"] = "LEFT";
248
- SwipeDirection2["NONE"] = "NONE";
249
- })(SwipeDirection || (SwipeDirection = {}));
250
-
251
- var _sfc_main$2 = vue.defineComponent({
252
- props: {
253
- modelValue: {
254
- type: String,
255
- default: ""
256
- }
257
- },
258
- emits: {
259
- "update:modelValue": null
260
- },
261
- setup(props, { emit }) {
262
- const vditor = useVditor();
263
- const mitter = useVditorMitter();
264
- if (props.modelValue) {
265
- vditor.setValue(props.modelValue, true);
266
- }
267
- const { pause, resume } = watchPausable(() => props.modelValue, (value) => {
268
- vditor.setValue(value, true);
269
- });
270
- mitter.on("input", (value) => {
271
- pause();
272
- emit("update:modelValue", value);
273
- vue.nextTick(resume);
274
- });
275
- return () => null;
276
- }
277
- });
278
-
279
- var HandleValue = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/handle-value.vue"]]);
280
-
281
- var _sfc_main$1 = vue.defineComponent({
282
- props: {
283
- fullscreen: {
284
- type: Boolean,
285
- default: false
286
- }
287
- },
288
- emits: {
289
- "update:fullscreen": null
290
- },
291
- setup(props, { emit }) {
292
- const vditor = useVditor();
293
- const el = vditor.vditor.element;
294
- const domFullscreen = vue.ref(false);
295
- useMutationObserver(el, () => {
296
- if (el.classList.contains("vditor--fullscreen")) {
297
- domFullscreen.value = true;
298
- } else {
299
- domFullscreen.value = false;
300
- }
301
- }, {
302
- attributes: true
303
- });
304
- vue.watch(() => props.fullscreen, (value) => {
305
- if (value !== domFullscreen.value) {
306
- const ir = vditor.vditor.ir?.element;
307
- if (!ir) return;
308
- ir.dispatchEvent(new KeyboardEvent("keydown", {
309
- key: "'",
310
- ctrlKey: true
311
- }));
312
- }
313
- }, { immediate: true });
314
- vue.watch(() => domFullscreen.value, (value) => {
315
- emit("update:fullscreen", value);
316
- });
317
- return () => null;
318
- }
319
- });
320
-
321
- var HandleFullscreen = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/handle-fullscreen.vue"]]);
322
-
323
23
  var _sfc_main = vue.defineComponent({
324
24
  name: "VkfVditor",
325
25
  components: {
326
- HandleValue,
327
- HandleFullscreen,
328
- VkAsyncTeleport: core.VkAsyncTeleport
26
+ VkfFormItem: formItem.VkfFormItem,
27
+ VkVditor: vditor.VkVditor
329
28
  },
330
29
  props,
331
30
  emits,
332
31
  setup(props2, { emit }) {
333
- const vditorNode = vue.ref();
334
- const ready = vue.ref(false);
335
- const mitter = mitt();
336
- const vditorRef = vue.shallowRef();
337
- const isTextareaFocus = vue.ref(false);
338
- vue.provide("vkfVditorMitter", mitter);
339
- vue.provide("vkfVditorRef", vditorRef);
340
- vue.onMounted(() => {
341
- const vditor = new Vditor(vditorNode.value, {
342
- ...props2.defaultOptions,
343
- placeholder: props2.placeholder,
344
- cache: {
345
- enable: true,
346
- id: "VkfVditorCache",
347
- ...props2.defaultOptions.cache || {}
348
- },
349
- after() {
350
- vditorRef.value = vditor;
351
- ready.value = true;
352
- emit("load", vditor);
353
- props2.defaultOptions.after?.();
354
- },
355
- input(value) {
356
- mitter.emit("input", value);
357
- props2.defaultOptions.input?.(value);
358
- },
359
- ctrlEnter(value) {
360
- emit("update:modelValue", value);
361
- emit("ctrlEnter", value);
362
- },
363
- focus(v) {
364
- isTextareaFocus.value = true;
365
- props2.defaultOptions.focus?.(v);
366
- },
367
- blur(v) {
368
- isTextareaFocus.value = false;
369
- props2.defaultOptions.blur?.(v);
370
- },
371
- toolbar: props2.toolbar
372
- });
373
- });
32
+ const coreProps = vditor._VkVditorCtx.createBindProps(props2);
33
+ const coreEmits = vditor._VkVditorCtx.createOnEmits(emit);
34
+ const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props2);
35
+ const readonly = composables.useComputedReadonly(props2);
374
36
  return {
375
- vditorNode,
376
- isTextareaFocus,
377
- ready
37
+ formItemBindProps,
38
+ coreProps,
39
+ coreEmits,
40
+ readonly
378
41
  };
379
42
  }
380
43
  });
381
44
 
382
- const _hoisted_1 = {
383
- ref: "vditorNode",
384
- class: "vkf-vditor"
385
- };
386
45
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
387
- const _component_VkAsyncTeleport = vue.resolveComponent("VkAsyncTeleport");
388
- const _component_HandleValue = vue.resolveComponent("HandleValue");
389
- const _component_HandleFullscreen = vue.resolveComponent("HandleFullscreen");
390
- return vue.openBlock(), vue.createElementBlock(
391
- vue.Fragment,
392
- null,
393
- [
394
- vue.createElementVNode(
395
- "div",
396
- _hoisted_1,
397
- null,
398
- 512
399
- /* NEED_PATCH */
400
- ),
401
- _ctx.ready ? (vue.openBlock(), vue.createBlock(_component_VkAsyncTeleport, {
402
- key: 0,
403
- to: _ctx.vditorNode
404
- }, {
405
- default: vue.withCtx(() => [
406
- vue.createElementVNode(
407
- "div",
408
- {
409
- class: vue.normalizeClass(["vkf-vditor-footer", {
410
- "is-textarea-focus": _ctx.isTextareaFocus
411
- }])
412
- },
413
- [
46
+ const _component_VkVditor = vue.resolveComponent("VkVditor");
47
+ const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
48
+ return vue.openBlock(), vue.createBlock(
49
+ _component_VkfFormItem,
50
+ vue.normalizeProps(vue.guardReactiveProps(_ctx.formItemBindProps)),
51
+ {
52
+ default: vue.withCtx(() => [
53
+ vue.createVNode(
54
+ _component_VkVditor,
55
+ vue.mergeProps(_ctx.coreProps, vue.toHandlers(_ctx.coreEmits)),
56
+ {
57
+ footer: vue.withCtx(() => [
414
58
  vue.renderSlot(_ctx.$slots, "footer")
415
- ],
416
- 2
417
- /* CLASS */
418
- )
419
- ]),
420
- _: 3
421
- /* FORWARDED */
422
- }, 8, ["to"])) : vue.createCommentVNode("v-if", true),
423
- _ctx.ready ? (vue.openBlock(), vue.createBlock(_component_HandleValue, {
424
- key: 1,
425
- "model-value": _ctx.modelValue,
426
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event))
427
- }, null, 8, ["model-value"])) : vue.createCommentVNode("v-if", true),
428
- _ctx.ready ? (vue.openBlock(), vue.createBlock(_component_HandleFullscreen, {
429
- key: 2,
430
- fullscreen: _ctx.fullscreen,
431
- "onUpdate:fullscreen": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:fullscreen", $event))
432
- }, null, 8, ["fullscreen"])) : vue.createCommentVNode("v-if", true),
433
- _ctx.ready ? vue.renderSlot(_ctx.$slots, "default", { key: 3 }) : vue.createCommentVNode("v-if", true)
434
- ],
435
- 64
436
- /* STABLE_FRAGMENT */
59
+ ]),
60
+ _: 3
61
+ /* FORWARDED */
62
+ },
63
+ 16
64
+ /* FULL_PROPS */
65
+ )
66
+ ]),
67
+ _: 3
68
+ /* FORWARDED */
69
+ },
70
+ 16
71
+ /* FULL_PROPS */
437
72
  );
438
73
  }
439
74
  var VkfVditor = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/index.vue"]]);