@vunk/form 1.1.83 → 1.1.85

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 (40) hide show
  1. package/components/_plugin-vue_export-helper.cjs +11 -0
  2. package/components/button/index.cjs +112 -0
  3. package/components/cascader/index.cjs +130 -0
  4. package/components/checkbox/index.cjs +153 -0
  5. package/components/color-picker/index.cjs +80 -0
  6. package/components/date-picker/index.cjs +120 -0
  7. package/components/date-picker-range/index.cjs +170 -0
  8. package/components/download-plus/index.cjs +445 -0
  9. package/components/esri-input-geojson/index.cjs +1120 -0
  10. package/components/form/index.cjs +220 -0
  11. package/components/form-item/index.cjs +162 -0
  12. package/components/form-item-renderer/index.cjs +103 -0
  13. package/components/form-item-renderer-template/index.cjs +47 -0
  14. package/components/geoinput/index.cjs +95 -0
  15. package/components/geoinput-read/index.cjs +304 -0
  16. package/components/geoinput-update/index.cjs +406 -0
  17. package/components/index.cjs +13 -0
  18. package/components/index2.cjs +323 -0
  19. package/components/index3.cjs +486 -0
  20. package/components/input/index.cjs +119 -0
  21. package/components/input-link/index.cjs +157 -0
  22. package/components/input-number/index.cjs +100 -0
  23. package/components/radio/index.cjs +142 -0
  24. package/components/select/index.cjs +165 -0
  25. package/components/slider/index.cjs +89 -0
  26. package/components/switch/index.cjs +92 -0
  27. package/components/templates-default/index.cjs +308 -0
  28. package/components/templates-element-plus/index.cjs +112 -0
  29. package/components/templates-esri/index.cjs +65 -0
  30. package/components/templates-layout/index.cjs +137 -0
  31. package/components/templates-mapbox/index.cjs +65 -0
  32. package/components/templates-variant/index.cjs +70 -0
  33. package/components/upload/index.cjs +508 -0
  34. package/components/upload-plus/index.cjs +18658 -0
  35. package/components/van-cascader/index.cjs +128 -0
  36. package/components/var-datetime-picker/index.cjs +330 -0
  37. package/components/vditor/index.cjs +451 -0
  38. package/components/vditor/index.css +2 -2
  39. package/index.css +2 -2
  40. package/package.json +69 -35
@@ -0,0 +1,451 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Vditor = require('vditor');
6
+ var vue = require('vue');
7
+ var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
8
+ var core = require('@vunk/core');
9
+
10
+ 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: {
55
+ type: Boolean,
56
+ default: false
57
+ }
58
+ };
59
+ const emits = {
60
+ load: (e) => e,
61
+ "update:modelValue": (e) => e,
62
+ ctrlEnter: (e) => e,
63
+ "update:fullscreen": (e) => e
64
+ };
65
+
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
+ var _sfc_main = vue.defineComponent({
324
+ name: "VkfVditor",
325
+ components: {
326
+ HandleValue,
327
+ HandleFullscreen,
328
+ VkAsyncTeleport: core.VkAsyncTeleport
329
+ },
330
+ props,
331
+ emits,
332
+ 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
+ });
374
+ return {
375
+ vditorNode,
376
+ isTextareaFocus,
377
+ ready
378
+ };
379
+ }
380
+ });
381
+
382
+ const _hoisted_1 = {
383
+ ref: "vditorNode",
384
+ class: "vkf-vditor"
385
+ };
386
+ 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
+ [
414
+ 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 */
437
+ );
438
+ }
439
+ 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"]]);
440
+
441
+ var types = /*#__PURE__*/Object.freeze({
442
+ __proto__: null
443
+ });
444
+
445
+ VkfVditor.install = (app) => {
446
+ app.component(VkfVditor.name || "VkfVditor", VkfVditor);
447
+ };
448
+
449
+ exports.VkfVditor = VkfVditor;
450
+ exports.__VkfVditor = types;
451
+ exports.default = VkfVditor;
@@ -1,7 +1,7 @@
1
- .vkf-vditor ul,li {
1
+ .vkf-vditor ul li {
2
2
  list-style: initial;
3
3
  }
4
- .vkf-vditor ol,li {
4
+ .vkf-vditor ol li {
5
5
  list-style: decimal;
6
6
  }
7
7
  .vkf-vditor.vditor{
package/index.css CHANGED
@@ -440,10 +440,10 @@
440
440
  padding-right: var(--date-picker-title-padding);
441
441
  }
442
442
 
443
- .vkf-vditor ul,li {
443
+ .vkf-vditor ul li {
444
444
  list-style: initial;
445
445
  }
446
- .vkf-vditor ol,li {
446
+ .vkf-vditor ol li {
447
447
  list-style: decimal;
448
448
  }
449
449
  .vkf-vditor.vditor{