@vunk/form 2.0.1 → 2.1.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 (53) hide show
  1. package/components/esri-input-geojson/index.cjs +484 -2
  2. package/components/esri-input-geojson/index.mjs +483 -1
  3. package/components/esri-input-geojson/src/ctx.d.ts +1 -1
  4. package/components/esri-input-geojson/src/index.vue.d.ts +1 -1
  5. package/components/index2.cjs +0 -19
  6. package/components/index2.mjs +1 -19
  7. package/components/input-collection/index.mjs +1 -1
  8. package/components/input-number/src/ctx.d.ts +1 -1
  9. package/components/input-number/src/index.vue.d.ts +2 -2
  10. package/components/select/index.cjs +12 -0
  11. package/components/select/index.d.ts +1 -0
  12. package/components/select/index.mjs +12 -1
  13. package/components/select/src/ctx.d.ts +2 -0
  14. package/components/select/src/index.vue.d.ts +1 -1
  15. package/components/tables-select/index.cjs +225 -0
  16. package/components/tables-select/index.css +3 -0
  17. package/components/tables-select/index.d.ts +4 -0
  18. package/components/tables-select/index.mjs +219 -0
  19. package/components/tables-select/src/ctx.d.ts +338 -0
  20. package/components/tables-select/src/index.vue.d.ts +4953 -0
  21. package/components/tables-select/src/types.d.ts +1 -0
  22. package/components/upload/index.mjs +1 -1
  23. package/components/upload-plus/index.mjs +1 -1
  24. package/index.css +4 -41
  25. package/package.json +9 -9
  26. package/shared/const/index.d.ts +4 -0
  27. package/shared/element-plus/ctx.d.ts +26 -0
  28. package/shared/element-plus/index.d.ts +3 -0
  29. package/shared/element-plus/instances.d.ts +202 -0
  30. package/shared/element-plus/version.d.ts +1 -0
  31. package/shared/form/index.d.ts +18 -0
  32. package/shared/helper/index.d.ts +3 -0
  33. package/shared/index.d.ts +2 -0
  34. package/shared/infer-prop/index.d.ts +17 -0
  35. package/shared/progress-it/index.d.ts +16 -0
  36. package/shared/rules/index.d.ts +35 -0
  37. package/shared/types/form/checkbox.d.ts +13 -0
  38. package/shared/types/form/index.d.ts +2 -0
  39. package/shared/types/form/radio.d.ts +8 -0
  40. package/shared/types/index.d.ts +12 -0
  41. package/shared/types/source/index.d.ts +20 -0
  42. package/shared/types/source-manager/index.d.ts +6 -0
  43. package/shared/upload/index.d.ts +7 -0
  44. package/components/geoinput-update/index.cjs +0 -406
  45. package/components/geoinput-update/index.css +0 -40
  46. package/components/geoinput-update/index.d.ts +0 -5
  47. package/components/geoinput-update/index.mjs +0 -399
  48. package/components/geoinput-update/src/append.vue.d.ts +0 -815
  49. package/components/geoinput-update/src/ctx.d.ts +0 -219
  50. package/components/geoinput-update/src/index.vue.d.ts +0 -1143
  51. package/components/geoinput-update/src/types.d.ts +0 -6
  52. package/components/index3.cjs +0 -486
  53. package/components/index3.mjs +0 -484
@@ -0,0 +1,20 @@
1
+ import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default';
2
+ import { __VkfTemplatesLayout } from '@vunk/form/components/templates-layout';
3
+ import { __VkfTemplatesElementPlus } from '@vunk/form/components/templates-element-plus';
4
+ import { __VkfTemplatesEsri } from '@vunk/form/components/templates-esri';
5
+ import { NormalObject } from '@vunk/core';
6
+ import { __VkfTemplatesVariant } from '@vunk/form/components/templates-variant';
7
+ export interface BasicSource {
8
+ templateIf?: ((data?: NormalObject) => boolean) | string | boolean;
9
+ templateType?: string;
10
+ class?: any;
11
+ prop?: any;
12
+ }
13
+ /**
14
+ * @deprecated use __VkfTemplatesDefault.Source<P>
15
+ * ```ts
16
+ * import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default'
17
+ * ```
18
+ */
19
+ export type FormItemRendererSource<P extends string = string> = __VkfTemplatesDefault.Source<P>;
20
+ export type AllTemplatesSource<P extends string = string> = __VkfTemplatesDefault.Source<P> | __VkfTemplatesEsri.Source<P> | __VkfTemplatesLayout.ElRowSource<AllTemplatesSource<P>> | __VkfTemplatesLayout.ElColSource<AllTemplatesSource<P>> | __VkfTemplatesLayout.VkfFlexSource<AllTemplatesSource<P>> | __VkfTemplatesElementPlus.Source | __VkfTemplatesVariant.Source<P>;
@@ -0,0 +1,6 @@
1
+ export interface ManagerInfo<I> {
2
+ source: I;
3
+ key: (string | number)[];
4
+ nextKey: (string | number)[];
5
+ prop: string;
6
+ }
@@ -0,0 +1,7 @@
1
+ export declare function createFileChunk(file: File, size: number): Blob[];
2
+ /**
3
+ * 文件抽样算hash
4
+ * @param file
5
+ * @returns
6
+ */
7
+ export declare function calculateFileHashSample(file: File): Promise<string>;
@@ -1,406 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var vue = require('vue');
6
- var input = require('@vunk/form/components/input');
7
- var _static = require('@vumap/core/shared/static');
8
- var utilsVue = require('@vunk/core/shared/utils-vue');
9
- var elementPlus = require('element-plus');
10
- var index = require('../index2.cjs');
11
- var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
12
- var core = require('@vumap/core');
13
- var tdtLayers = require('@vumap/core/components/tdt-layers');
14
- var controlDraw = require('@vumap/core/components/control-draw');
15
- var utilsPromise = require('@vunk/core/shared/utils-promise');
16
- var index$1 = require('../index3.cjs');
17
- var core$1 = require('@vunk/core');
18
- var controlDrawUi = require('@vumap/core/components/control-draw-ui');
19
-
20
- const props = {
21
- ...input._VkfInputCtx.props,
22
- showMap: {
23
- type: Boolean,
24
- default: false
25
- },
26
- dialogEdit: {
27
- type: Boolean,
28
- default: true
29
- },
30
- dialogEditFullscreen: {
31
- type: Boolean,
32
- default: true
33
- },
34
- dialogEditTitle: {
35
- type: String,
36
- default: "\u7ED8\u5236\u56FE\u6591"
37
- },
38
- modelValue: {
39
- type: Object,
40
- default: () => _static.EMPTY_FEATURE_COLLECTION
41
- },
42
- editControls: {
43
- type: Array,
44
- default: () => ["trash"]
45
- },
46
- editTypes: {
47
- type: [Array, String],
48
- default: () => "polygon"
49
- },
50
- multiple: {
51
- type: Boolean,
52
- default: true
53
- },
54
- mapTo: {
55
- type: [Object, String],
56
- default: void 0
57
- },
58
- mapCenter: {
59
- type: [Object, Array],
60
- default: [120, 30]
61
- },
62
- editStyles: {
63
- type: Array,
64
- default: () => []
65
- },
66
- slots: {
67
- type: Object,
68
- default: () => ({})
69
- },
70
- spikSave: {
71
- type: Boolean,
72
- default: false
73
- }
74
- };
75
- const createBindProps = utilsVue.bindPropsFactory(props);
76
- const emits = {
77
- ...input._VkfInputCtx.emits,
78
- "update:modelValue": (e) => e,
79
- "editUpdate": (e) => e
80
- };
81
- const createOnEmits = utilsVue.onEmitsFactory(emits);
82
-
83
- var ctx = /*#__PURE__*/Object.freeze({
84
- __proto__: null,
85
- createBindProps: createBindProps,
86
- createOnEmits: createOnEmits,
87
- emits: emits,
88
- props: props
89
- });
90
-
91
- var _sfc_main$1 = vue.defineComponent({
92
- components: {
93
- ElButton: elementPlus.ElButton,
94
- ElIcon: elementPlus.ElIcon,
95
- ElButtonGroup: elementPlus.ElButtonGroup,
96
- Upload: index.upload_default,
97
- Edit: index.edit_default,
98
- ElUpload: elementPlus.ElUpload
99
- },
100
- props: {
101
- disabled: Boolean,
102
- dialog: Boolean
103
- },
104
- emits: {
105
- upload: (e) => e,
106
- edit: null
107
- },
108
- methods: {
109
- getFile(file) {
110
- this.$emit("upload", file);
111
- }
112
- }
113
- });
114
-
115
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
116
- const _component_Upload = vue.resolveComponent("Upload");
117
- const _component_ElIcon = vue.resolveComponent("ElIcon");
118
- const _component_ElUpload = vue.resolveComponent("ElUpload");
119
- const _component_ElButton = vue.resolveComponent("ElButton");
120
- const _component_Edit = vue.resolveComponent("Edit");
121
- const _component_ElButtonGroup = vue.resolveComponent("ElButtonGroup");
122
- return vue.openBlock(), vue.createBlock(_component_ElButtonGroup, null, {
123
- default: vue.withCtx(() => [
124
- vue.createVNode(_component_ElButton, { class: "vk-geoinput-upload-x" }, {
125
- default: vue.withCtx(() => [
126
- vue.createVNode(_component_ElUpload, {
127
- class: vue.normalizeClass("vk-geoinput-upload"),
128
- action: "",
129
- accept: "file",
130
- multiple: false,
131
- "show-file-list": false,
132
- "auto-upload": false,
133
- "on-change": _ctx.getFile,
134
- disabled: _ctx.disabled
135
- }, {
136
- default: vue.withCtx(() => [
137
- vue.createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
138
- default: vue.withCtx(() => [
139
- vue.createVNode(_component_Upload)
140
- ]),
141
- _: 1
142
- /* STABLE */
143
- })
144
- ]),
145
- _: 1
146
- /* STABLE */
147
- }, 8, ["on-change", "disabled"])
148
- ]),
149
- _: 1
150
- /* STABLE */
151
- }),
152
- _ctx.dialog ? (vue.openBlock(), vue.createBlock(_component_ElButton, {
153
- key: 0,
154
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit")),
155
- disabled: _ctx.disabled
156
- }, {
157
- default: vue.withCtx(() => [
158
- vue.createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
159
- default: vue.withCtx(() => [
160
- vue.createVNode(_component_Edit)
161
- ]),
162
- _: 1
163
- /* STABLE */
164
- })
165
- ]),
166
- _: 1
167
- /* STABLE */
168
- }, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
169
- ]),
170
- _: 1
171
- /* STABLE */
172
- });
173
- }
174
- var AppendVue = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/geoinput-update/src/append.vue"]]);
175
-
176
- var _sfc_main = /* @__PURE__ */ vue.defineComponent({
177
- name: "VkfGeoinputUpdate",
178
- components: {
179
- VkfInput: input.VkfInput,
180
- ElDialog: elementPlus.ElDialog,
181
- VmMap: core.VmMap,
182
- VmTdtLayers: tdtLayers.VmTdtLayers,
183
- VmControlDraw: controlDraw.VmControlDraw,
184
- VkAsyncTeleport: core$1.VkAsyncTeleport,
185
- VmControlDrawUi: controlDrawUi.VmControlDrawUi,
186
- ElIcon: elementPlus.ElIcon,
187
- Checked: index.checked_default
188
- },
189
- emits,
190
- props,
191
- setup(props2, {
192
- emit
193
- }) {
194
- const inputBindProps = input._VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue"]);
195
- const inputOnEmits = input._VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
196
- const mapOptions = vue.computed(() => {
197
- return {
198
- center: props2.mapCenter
199
- };
200
- });
201
- const geoInputMapDialogNode = vue.shallowRef();
202
- const geoInputMapXNode = vue.shallowRef();
203
- const editPlayground = vue.ref(geoInputMapXNode.value);
204
- vue.onMounted(() => {
205
- editPlayground.value = geoInputMapXNode.value;
206
- });
207
- const mapTo = vue.computed(() => {
208
- return editPlayground.value === geoInputMapDialogNode.value ? geoInputMapDialogNode.value : props2.mapTo ?? editPlayground.value;
209
- });
210
- const mapControls = vue.computed(() => {
211
- return props2.readonly ? [] : typeof props2.editTypes === "string" ? [props2.editTypes, ...props2.editControls] : [...props2.editTypes, ...props2.editControls];
212
- });
213
- const currentDrawCacheValue = vue.ref(props2.modelValue);
214
- const currentDrawValue = vue.computed(() => {
215
- return props2.spikSave ? props2.modelValue : currentDrawCacheValue.value;
216
- });
217
- const setCurrentDrawValue = value => {
218
- if (props2.spikSave) {
219
- emit("update:modelValue", value);
220
- } else {
221
- currentDrawCacheValue.value = value;
222
- }
223
- };
224
- const doSave = () => {
225
- emit("update:modelValue", currentDrawCacheValue.value);
226
- elementPlus.ElMessage({
227
- message: "\u4FDD\u5B58\u6210\u529F",
228
- type: "success"
229
- });
230
- dialogShow.value = false;
231
- };
232
- const dialogShow = vue.ref(false);
233
- const mapDef = new utilsPromise.Deferred();
234
- const dialogOnOpen = async () => {
235
- await vue.nextTick();
236
- editPlayground.value = geoInputMapDialogNode.value;
237
- await vue.nextTick();
238
- const map = await mapDef.promise;
239
- currentDrawCacheValue.value = props2.modelValue;
240
- map.resize();
241
- };
242
- const dialogOnClose = async () => {
243
- editPlayground.value = geoInputMapXNode.value;
244
- const map = await mapDef.promise;
245
- map.resize();
246
- };
247
- const append = () => vue.createVNode(AppendVue, {
248
- "dialog": props2.dialogEdit,
249
- "disabled": props2.disabled,
250
- "onUpload": onUpload,
251
- "onEdit": onEdit
252
- }, null);
253
- async function onUpload(e) {
254
- if (!e.raw) return;
255
- index$1.toGeojson(e.raw).then(res => {
256
- emit("update:modelValue", res);
257
- });
258
- }
259
- function onEdit() {
260
- dialogShow.value = true;
261
- }
262
- return {
263
- inputBindProps,
264
- inputOnEmits,
265
- append,
266
- dialogShow,
267
- mapDef,
268
- dialogOnOpen,
269
- dialogOnClose,
270
- mapOptions,
271
- geoInputMapDialogNode,
272
- geoInputMapXNode,
273
- mapTo,
274
- mapControls,
275
- doSave,
276
- currentDrawValue,
277
- setCurrentDrawValue
278
- };
279
- }
280
- });
281
-
282
- const _hoisted_1 = { class: "vkf-form-item" };
283
- const _hoisted_2 = {
284
- class: "geoinput-map-dialog",
285
- ref: "geoInputMapDialogNode"
286
- };
287
- const _hoisted_3 = {
288
- class: "geoinput-map-x",
289
- ref: "geoInputMapXNode"
290
- };
291
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
292
- const _component_VkfInput = vue.resolveComponent("VkfInput");
293
- const _component_VmTdtLayers = vue.resolveComponent("VmTdtLayers");
294
- const _component_Checked = vue.resolveComponent("Checked");
295
- const _component_ElIcon = vue.resolveComponent("ElIcon");
296
- const _component_VmControlDrawUi = vue.resolveComponent("VmControlDrawUi");
297
- const _component_VmControlDraw = vue.resolveComponent("VmControlDraw");
298
- const _component_VmMap = vue.resolveComponent("VmMap");
299
- const _component_VkAsyncTeleport = vue.resolveComponent("VkAsyncTeleport");
300
- const _component_ElDialog = vue.resolveComponent("ElDialog");
301
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
302
- vue.createVNode(_component_VkfInput, vue.mergeProps({
303
- readonly: true,
304
- modelValue: JSON.stringify(_ctx.modelValue)
305
- }, _ctx.inputBindProps, vue.toHandlers(_ctx.inputOnEmits), {
306
- inputSlots: _ctx.readonly ? {} : {
307
- append: _ctx.append
308
- }
309
- }), null, 16, ["modelValue", "inputSlots"]),
310
- vue.createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
311
- default: vue.withCtx(() => [
312
- vue.createVNode(_component_VmMap, {
313
- defaultOptions: _ctx.mapOptions,
314
- class: "vk-geoinput-edit-map",
315
- onLoad: _cache[1] || (_cache[1] = ($event) => _ctx.mapDef.resolve($event.map))
316
- }, {
317
- default: vue.withCtx(() => [
318
- vue.createVNode(_component_VmTdtLayers),
319
- vue.createVNode(_component_VmControlDraw, {
320
- styles: _ctx.editStyles,
321
- modelValue: _ctx.currentDrawValue,
322
- "onUpdate:modelValue": _ctx.setCurrentDrawValue,
323
- onUpdate: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("editUpdate", $event)),
324
- controls: _ctx.mapControls,
325
- multiple: _ctx.multiple
326
- }, {
327
- default: vue.withCtx(() => [
328
- !_ctx.spikSave ? (vue.openBlock(), vue.createBlock(_component_VmControlDrawUi, {
329
- key: 0,
330
- onClick: vue.withModifiers(_ctx.doSave, ["prevent"])
331
- }, {
332
- default: vue.withCtx(() => [
333
- vue.createVNode(_component_ElIcon, null, {
334
- default: vue.withCtx(() => [
335
- vue.createVNode(_component_Checked)
336
- ]),
337
- _: 1
338
- /* STABLE */
339
- })
340
- ]),
341
- _: 1
342
- /* STABLE */
343
- }, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
344
- ]),
345
- _: 1
346
- /* STABLE */
347
- }, 8, ["styles", "modelValue", "onUpdate:modelValue", "controls", "multiple"]),
348
- vue.renderSlot(_ctx.$slots, "map"),
349
- _ctx.slots.map ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(typeof _ctx.slots.map === "function" ? _ctx.slots.map() : _ctx.slots.map), { key: 0 })) : vue.createCommentVNode("v-if", true)
350
- ]),
351
- _: 3
352
- /* FORWARDED */
353
- }, 8, ["defaultOptions"])
354
- ]),
355
- _: 3
356
- /* FORWARDED */
357
- }, 8, ["to"]),
358
- vue.createVNode(_component_ElDialog, {
359
- modelValue: _ctx.dialogShow,
360
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.dialogShow = $event),
361
- title: _ctx.dialogEditTitle,
362
- fullscreen: _ctx.dialogEditFullscreen,
363
- modalClass: "vk-geoinput-edit-dialog-x",
364
- appendToBody: true,
365
- onOpen: _ctx.dialogOnOpen,
366
- onClose: _ctx.dialogOnClose,
367
- closeOnClickModal: false,
368
- draggable: true
369
- }, {
370
- default: vue.withCtx(() => [
371
- vue.createElementVNode(
372
- "div",
373
- _hoisted_2,
374
- null,
375
- 512
376
- /* NEED_PATCH */
377
- )
378
- ]),
379
- _: 1
380
- /* STABLE */
381
- }, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"]),
382
- vue.withDirectives(vue.createElementVNode(
383
- "div",
384
- _hoisted_3,
385
- null,
386
- 512
387
- /* NEED_PATCH */
388
- ), [
389
- [vue.vShow, _ctx.showMap]
390
- ])
391
- ]);
392
- }
393
- var VkfGeoinputUpdate = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/geoinput-update/src/index.vue"]]);
394
-
395
- var types = /*#__PURE__*/Object.freeze({
396
- __proto__: null
397
- });
398
-
399
- VkfGeoinputUpdate.install = (app) => {
400
- app.component(VkfGeoinputUpdate.name, VkfGeoinputUpdate);
401
- };
402
-
403
- exports.VkfGeoinputUpdate = VkfGeoinputUpdate;
404
- exports._VkfGeoinputUpdateCtx = ctx;
405
- exports.__VkfGeoinputUpdate = types;
406
- exports.default = VkfGeoinputUpdate;
@@ -1,40 +0,0 @@
1
- .vk-geoinput-upload-x.vk-geoinput-upload-x{
2
- padding: 0;
3
- }
4
- .vk-geoinput-upload .el-upload{
5
- padding: 8px 15px;
6
- }
7
- .geoinput-map-x{
8
- margin-bottom: 18px;
9
- height: 300px;
10
- }
11
- .geoinput-map-dialog{
12
- flex: 1;
13
- overflow: hidden;
14
- display: flex;
15
- flex-direction: column;
16
- }
17
- .vk-geoinput-edit-map{
18
- height: 100%;
19
- }
20
- /* #vkGeoInputMap .vk-geoinput-edit-map{
21
- height: 100%;
22
- } */
23
- .vk-geoinput-edit-dialog-x .el-dialog.is-fullscreen{
24
- height: 100%;
25
- }
26
- .vk-geoinput-edit-dialog-x .el-dialog{
27
- display: flex;
28
- flex-direction: column;
29
- min-height: 50%;
30
- }
31
- .vk-geoinput-edit-dialog-x .el-dialog__body{
32
- display: flex;
33
- flex-direction: column;
34
- flex: 1;
35
- overflow: hidden;
36
- padding: 0;
37
- }
38
- .vk-geoinput-edit-map{
39
- flex: 1;
40
- }
@@ -1,5 +0,0 @@
1
- import VkfGeoinputUpdate from './src/index.vue';
2
- export * as __VkfGeoinputUpdate from './src/types';
3
- export * as _VkfGeoinputUpdateCtx from './src/ctx';
4
- export { VkfGeoinputUpdate, };
5
- export default VkfGeoinputUpdate;