@vunk/form 2.0.2 → 2.2.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.
- package/components/card-input-collection/index.cjs +256 -0
- package/components/card-input-collection/index.css +21 -0
- package/components/card-input-collection/index.d.ts +4 -0
- package/components/card-input-collection/index.mjs +250 -0
- package/components/card-input-collection/src/ctx.d.ts +82 -0
- package/components/card-input-collection/src/index.vue.d.ts +542 -0
- package/components/card-input-collection/src/types.d.ts +1 -0
- package/components/cascader/src/ctx.d.ts +1 -1
- package/components/cascader/src/index.vue.d.ts +1 -1
- package/components/checkbox/src/ctx.d.ts +1 -1
- package/components/checkbox/src/index.vue.d.ts +2 -2
- package/components/cloneDeep.cjs +2029 -0
- package/components/cloneDeep.mjs +2027 -0
- package/components/date-picker/src/ctx.d.ts +1 -1
- package/components/date-picker/src/index.vue.d.ts +2 -2
- package/components/esri-input-geojson/index.cjs +484 -2
- package/components/esri-input-geojson/index.mjs +483 -1
- package/components/esri-input-geojson/src/ctx.d.ts +1 -1
- package/components/esri-input-geojson/src/index.vue.d.ts +2 -2
- package/components/form/src/ctx.d.ts +1 -1
- package/components/form/src/index.vue.d.ts +1 -1
- package/components/index2.cjs +0 -19
- package/components/index2.mjs +1 -19
- package/components/input/src/ctx.d.ts +1 -1
- package/components/input/src/index.vue.d.ts +2 -2
- package/components/input-collection/index.cjs +4 -2029
- package/components/input-collection/index.mjs +4 -2029
- package/components/input-collection/src/index.vue.d.ts +1 -1
- package/components/input-link/src/index.vue.d.ts +1 -1
- package/components/input-number/src/ctx.d.ts +1 -1
- package/components/input-number/src/index.vue.d.ts +3 -3
- package/components/radio/src/index.vue.d.ts +1 -1
- package/components/select/index.cjs +12 -0
- package/components/select/index.d.ts +1 -0
- package/components/select/index.mjs +12 -1
- package/components/select/src/ctx.d.ts +2 -0
- package/components/select/src/index.vue.d.ts +2 -2
- package/components/slider/src/index.vue.d.ts +1 -1
- package/components/switch/src/index.vue.d.ts +1 -1
- package/components/tables-select/index.cjs +225 -0
- package/components/tables-select/index.css +3 -0
- package/components/tables-select/index.d.ts +4 -0
- package/components/tables-select/index.mjs +219 -0
- package/components/tables-select/src/ctx.d.ts +338 -0
- package/components/tables-select/src/index.vue.d.ts +4953 -0
- package/components/tables-select/src/types.d.ts +1 -0
- package/components/upload/index.mjs +1 -1
- package/components/upload-plus/index.mjs +1 -1
- package/components/vditor/src/index.vue.d.ts +1 -1
- package/index.css +26 -41
- package/package.json +17 -9
- package/shared/element-plus/ctx.d.ts +1 -1
- package/components/geoinput-update/index.cjs +0 -406
- package/components/geoinput-update/index.css +0 -40
- package/components/geoinput-update/index.d.ts +0 -5
- package/components/geoinput-update/index.mjs +0 -399
- package/components/geoinput-update/src/append.vue.d.ts +0 -815
- package/components/geoinput-update/src/ctx.d.ts +0 -219
- package/components/geoinput-update/src/index.vue.d.ts +0 -1143
- package/components/geoinput-update/src/types.d.ts +0 -6
- package/components/index3.cjs +0 -486
- package/components/index3.mjs +0 -484
|
@@ -171,9 +171,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
171
171
|
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
172
172
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
173
173
|
modelValue: NormalObject[];
|
|
174
|
+
splicable: boolean;
|
|
174
175
|
inheritTemplates: boolean;
|
|
175
176
|
columns: import("./types").Column<any>[];
|
|
176
|
-
splicable: boolean;
|
|
177
177
|
}, {}, {
|
|
178
178
|
ElTable: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
179
179
|
data: {
|
|
@@ -379,10 +379,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
379
379
|
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
380
380
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
381
381
|
id: string;
|
|
382
|
+
modelValue: string;
|
|
382
383
|
placeholder: string;
|
|
383
384
|
clearable: boolean;
|
|
384
385
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
385
|
-
modelValue: string;
|
|
386
386
|
tabindex: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
387
387
|
autosize: false;
|
|
388
388
|
autocomplete: string;
|
|
@@ -91,7 +91,7 @@ export declare const props: {
|
|
|
91
91
|
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
92
92
|
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
93
93
|
};
|
|
94
|
-
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"disabled", keyof T2> | Extract<"required", keyof T2> | Extract<"name", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"min", keyof T2> | Extract<"max", keyof T2> | Extract<"id", keyof T2> | Extract<"
|
|
94
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"disabled", keyof T2> | Extract<"required", keyof T2> | Extract<"name", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"min", keyof T2> | Extract<"max", keyof T2> | Extract<"id", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"valueOnClear", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"ariaLabel", keyof T2> | Extract<"step", keyof T2> | Extract<"stepStrictly", keyof T2> | Extract<"controls", keyof T2> | Extract<"controlsPosition", keyof T2> | Extract<"precision", keyof T2> | Extract<"unit", keyof T2> | Extract<"inputNumberSlots", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "modelValue" | "valueOnClear" | "placeholder" | "validateEvent" | "ariaLabel" | "step" | "stepStrictly" | "controls" | "controlsPosition" | "precision" | "unit" | "inputNumberSlots", keyof T2>, KE> : Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "modelValue" | "valueOnClear" | "placeholder" | "validateEvent" | "ariaLabel" | "step" | "stepStrictly" | "controls" | "controlsPosition" | "precision" | "unit" | "inputNumberSlots", keyof T2>]: { [k in Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "modelValue" | "valueOnClear" | "placeholder" | "validateEvent" | "ariaLabel" | "step" | "stepStrictly" | "controls" | "controlsPosition" | "precision" | "unit" | "inputNumberSlots", keyof T2>]: T2[k]; }[P]; }>;
|
|
95
95
|
export declare const emits: {
|
|
96
96
|
change: (cur: number | undefined, prev: number | undefined) => boolean;
|
|
97
97
|
blur: (e: FocusEvent) => boolean;
|
|
@@ -96,14 +96,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
96
96
|
min: number;
|
|
97
97
|
max: number;
|
|
98
98
|
id: string;
|
|
99
|
+
modelValue: number;
|
|
99
100
|
valueOnClear: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor, null], unknown, unknown>;
|
|
100
101
|
placeholder: string;
|
|
101
102
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
102
|
-
modelValue: number;
|
|
103
103
|
ariaLabel: string;
|
|
104
|
-
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
105
104
|
step: number;
|
|
106
105
|
stepStrictly: boolean;
|
|
106
|
+
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
107
107
|
controlsPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "right", unknown>;
|
|
108
108
|
precision: number;
|
|
109
109
|
}>;
|
|
@@ -231,9 +231,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
231
231
|
id: string;
|
|
232
232
|
valueOnClear: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor, null], unknown, unknown>;
|
|
233
233
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
234
|
-
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
235
234
|
step: number;
|
|
236
235
|
stepStrictly: boolean;
|
|
236
|
+
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
237
237
|
controlsPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "right", unknown>;
|
|
238
238
|
unit: string;
|
|
239
239
|
inputNumberSlots: import("./types").InputNumberSlots;
|
|
@@ -87,8 +87,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
87
87
|
name: string;
|
|
88
88
|
fill: string;
|
|
89
89
|
id: string;
|
|
90
|
-
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
91
90
|
modelValue: string | number;
|
|
91
|
+
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
92
92
|
ariaLabel: string;
|
|
93
93
|
textColor: string;
|
|
94
94
|
}>;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var formItem = require('@vunk/form/components/form-item');
|
|
6
6
|
var elementPlus = require('@vunk/form/shared/element-plus');
|
|
7
|
+
var utilsVue = require('@vunk/core/shared/utils-vue');
|
|
7
8
|
var vue = require('vue');
|
|
8
9
|
var elementPlus$1 = require('element-plus');
|
|
9
10
|
var utilsObject = require('@vunk/core/shared/utils-object');
|
|
@@ -34,9 +35,19 @@ const props = {
|
|
|
34
35
|
default: false
|
|
35
36
|
}
|
|
36
37
|
};
|
|
38
|
+
const createBindProps = utilsVue.bindPropsFactory(props);
|
|
37
39
|
const emits = {
|
|
38
40
|
...elementPlus.selectEmits
|
|
39
41
|
};
|
|
42
|
+
const createOnEmits = utilsVue.onEmitsFactory(emits);
|
|
43
|
+
|
|
44
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
45
|
+
__proto__: null,
|
|
46
|
+
createBindProps: createBindProps,
|
|
47
|
+
createOnEmits: createOnEmits,
|
|
48
|
+
emits: emits,
|
|
49
|
+
props: props
|
|
50
|
+
});
|
|
40
51
|
|
|
41
52
|
var _sfc_main = vue.defineComponent({
|
|
42
53
|
name: "VkfSelect",
|
|
@@ -194,5 +205,6 @@ VkfSelect.install = (app) => {
|
|
|
194
205
|
};
|
|
195
206
|
|
|
196
207
|
exports.VkfSelect = VkfSelect;
|
|
208
|
+
exports._VkfSelectCtx = ctx;
|
|
197
209
|
exports.__VkfSelect = types;
|
|
198
210
|
exports.default = VkfSelect;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
2
|
import { selectProps, selectEmits, createSelectBindProps, createSelectOnEmits } from '@vunk/form/shared/element-plus';
|
|
3
|
+
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
3
4
|
import { defineComponent, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps, toHandlers, createSlots, createElementBlock, Fragment, renderList, resolveDynamicComponent, createCommentVNode, renderSlot } from 'vue';
|
|
4
5
|
import { ElSelect, ElOption } from 'element-plus';
|
|
5
6
|
import { isNotEmptyObject, isPlainObject } from '@vunk/core/shared/utils-object';
|
|
@@ -30,9 +31,19 @@ const props = {
|
|
|
30
31
|
default: false
|
|
31
32
|
}
|
|
32
33
|
};
|
|
34
|
+
const createBindProps = bindPropsFactory(props);
|
|
33
35
|
const emits = {
|
|
34
36
|
...selectEmits
|
|
35
37
|
};
|
|
38
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
39
|
+
|
|
40
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
41
|
+
__proto__: null,
|
|
42
|
+
createBindProps: createBindProps,
|
|
43
|
+
createOnEmits: createOnEmits,
|
|
44
|
+
emits: emits,
|
|
45
|
+
props: props
|
|
46
|
+
});
|
|
36
47
|
|
|
37
48
|
var _sfc_main = defineComponent({
|
|
38
49
|
name: "VkfSelect",
|
|
@@ -189,4 +200,4 @@ VkfSelect.install = (app) => {
|
|
|
189
200
|
app.component(VkfSelect.name, VkfSelect);
|
|
190
201
|
};
|
|
191
202
|
|
|
192
|
-
export { VkfSelect, types as __VkfSelect, VkfSelect as default };
|
|
203
|
+
export { VkfSelect, ctx as _VkfSelectCtx, types as __VkfSelect, VkfSelect as default };
|
|
@@ -158,6 +158,7 @@ export declare const props: {
|
|
|
158
158
|
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
159
159
|
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
160
160
|
};
|
|
161
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"disabled", keyof T2> | Extract<"loading", keyof T2> | Extract<"required", keyof T2> | Extract<"name", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"options", keyof T2> | Extract<"id", keyof T2> | Extract<"multiple", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"clearable", keyof T2> | Extract<"filterable", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"teleported", keyof T2> | Extract<"tagType", keyof T2> | Extract<"persistent", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"effect", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"stringify", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "disabled" | "loading" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "options" | "id" | "multiple" | "modelValue" | "placeholder" | "clearable" | "filterable" | "filterMethod" | "collapseTags" | "collapseTagsTooltip" | "popperClass" | "teleported" | "tagType" | "persistent" | "optionsUrl" | "defaultModelValue" | "clearIcon" | "autocomplete" | "suffixIcon" | "effect" | "automaticDropdown" | "allowCreate" | "remote" | "loadingText" | "noMatchText" | "noDataText" | "remoteMethod" | "multipleLimit" | "defaultFirstOption" | "reserveKeyword" | "valueKey" | "fitInputWidth" | "selectSlots" | "stringify", keyof T2>, KE> : Extract<"size" | "disabled" | "loading" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "options" | "id" | "multiple" | "modelValue" | "placeholder" | "clearable" | "filterable" | "filterMethod" | "collapseTags" | "collapseTagsTooltip" | "popperClass" | "teleported" | "tagType" | "persistent" | "optionsUrl" | "defaultModelValue" | "clearIcon" | "autocomplete" | "suffixIcon" | "effect" | "automaticDropdown" | "allowCreate" | "remote" | "loadingText" | "noMatchText" | "noDataText" | "remoteMethod" | "multipleLimit" | "defaultFirstOption" | "reserveKeyword" | "valueKey" | "fitInputWidth" | "selectSlots" | "stringify", keyof T2>]: { [k in Extract<"size" | "disabled" | "loading" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "options" | "id" | "multiple" | "modelValue" | "placeholder" | "clearable" | "filterable" | "filterMethod" | "collapseTags" | "collapseTagsTooltip" | "popperClass" | "teleported" | "tagType" | "persistent" | "optionsUrl" | "defaultModelValue" | "clearIcon" | "autocomplete" | "suffixIcon" | "effect" | "automaticDropdown" | "allowCreate" | "remote" | "loadingText" | "noMatchText" | "noDataText" | "remoteMethod" | "multipleLimit" | "defaultFirstOption" | "reserveKeyword" | "valueKey" | "fitInputWidth" | "selectSlots" | "stringify", keyof T2>]: T2[k]; }[P]; }>;
|
|
161
162
|
export declare const emits: {
|
|
162
163
|
'update:modelValue': any;
|
|
163
164
|
change: any;
|
|
@@ -167,3 +168,4 @@ export declare const emits: {
|
|
|
167
168
|
focus: any;
|
|
168
169
|
blur: any;
|
|
169
170
|
};
|
|
171
|
+
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("clear" | "update:modelValue" | "change" | "focus" | "blur" | "visible-change" | "remove-tag")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"clear" | "update:modelValue" | "change" | "focus" | "blur" | "visible-change" | "remove-tag", KE> : "clear" | "update:modelValue" | "change" | "focus" | "blur" | "visible-change" | "remove-tag"]: { [k in "clear" | "update:modelValue" | "change" | "focus" | "blur" | "visible-change" | "remove-tag"]: (...e: import("@vunk/core").RestParameters<T2>) => void; }[P]; };
|
|
@@ -157,8 +157,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
157
157
|
size: "" | "small" | "default" | "large";
|
|
158
158
|
loading: boolean;
|
|
159
159
|
name: string;
|
|
160
|
-
multiple: boolean;
|
|
161
160
|
id: string;
|
|
161
|
+
multiple: boolean;
|
|
162
162
|
placeholder: string;
|
|
163
163
|
clearable: boolean;
|
|
164
164
|
filterable: boolean;
|
|
@@ -495,6 +495,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
495
495
|
created: boolean;
|
|
496
496
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>>[];
|
|
497
497
|
multiple: boolean;
|
|
498
|
+
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
498
499
|
clearable: boolean;
|
|
499
500
|
filterable: boolean;
|
|
500
501
|
collapseTags: boolean;
|
|
@@ -503,7 +504,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
503
504
|
teleported: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
504
505
|
tagType: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>;
|
|
505
506
|
persistent: boolean;
|
|
506
|
-
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
507
507
|
optionsUrl: string;
|
|
508
508
|
defaultModelValue: any;
|
|
509
509
|
clearIcon: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -322,9 +322,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
322
322
|
vertical: boolean;
|
|
323
323
|
placement: import("element-plus/es/utils").EpPropMergeType<StringConstructor, import("element-plus").Placement, unknown>;
|
|
324
324
|
id: string;
|
|
325
|
+
modelValue: any;
|
|
325
326
|
debounce: number;
|
|
326
327
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
327
|
-
modelValue: any;
|
|
328
328
|
defaultModelValue: any;
|
|
329
329
|
step: number;
|
|
330
330
|
showInput: boolean;
|
|
@@ -274,8 +274,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
274
274
|
labelPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "top" | "left" | "right", unknown>;
|
|
275
275
|
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
276
276
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
277
|
-
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
278
277
|
modelValue: any;
|
|
278
|
+
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
279
279
|
defaultModelValue: boolean;
|
|
280
280
|
width: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
281
281
|
inlinePrompt: boolean;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tablesV1Checkbox = require('@vunk/plus/components/tables-v1-checkbox');
|
|
6
|
+
var formItem = require('@vunk/form/components/form-item');
|
|
7
|
+
var vue = require('vue');
|
|
8
|
+
var select = require('@vunk/form/components/select');
|
|
9
|
+
var elementPlus = require('element-plus');
|
|
10
|
+
var array = require('@vunk/shared/array');
|
|
11
|
+
var object = require('@vunk/shared/object');
|
|
12
|
+
var composables = require('@vunk/form/composables');
|
|
13
|
+
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
14
|
+
|
|
15
|
+
const props = {
|
|
16
|
+
...formItem._VkfFormItemCtx.props,
|
|
17
|
+
...tablesV1Checkbox._VkTablesV1CheckboxCtx.props,
|
|
18
|
+
/**
|
|
19
|
+
* @description v-model 绑定值
|
|
20
|
+
*/
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: [Array, String],
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
labelField: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "label"
|
|
28
|
+
},
|
|
29
|
+
clearable: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true
|
|
32
|
+
},
|
|
33
|
+
multiple: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @description 获取完整数据
|
|
39
|
+
*/
|
|
40
|
+
getRows: {
|
|
41
|
+
type: Function,
|
|
42
|
+
default: () => []
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* @description 是否在补全 Rows 后更新 modelValue
|
|
46
|
+
*/
|
|
47
|
+
updateWhenCompleted: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* @description 是否将选中的数据 join 为字符串
|
|
53
|
+
*/
|
|
54
|
+
stringify: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* @description 是否只读
|
|
60
|
+
*/
|
|
61
|
+
readonly: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: void 0
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const emits = {
|
|
67
|
+
...tablesV1Checkbox._VkTablesV1CheckboxCtx.emits
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var _sfc_main = vue.defineComponent({
|
|
71
|
+
name: "VkfTablesSelect",
|
|
72
|
+
components: {
|
|
73
|
+
VkfSelect: select.VkfSelect,
|
|
74
|
+
VkTablesV1Checkbox: tablesV1Checkbox.VkTablesV1Checkbox,
|
|
75
|
+
ElDialog: elementPlus.ElDialog
|
|
76
|
+
},
|
|
77
|
+
props,
|
|
78
|
+
emits,
|
|
79
|
+
setup(props2, { emit }) {
|
|
80
|
+
const formItemProps = formItem._VkfFormItemCtx.createBindProps(props2);
|
|
81
|
+
const tablesProps = tablesV1Checkbox._VkTablesV1CheckboxCtx.createBindProps(props2, ["modelValue"]);
|
|
82
|
+
const tablesEmits = tablesV1Checkbox._VkTablesV1CheckboxCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
83
|
+
const readonly = composables.useComputedReadonly(props2);
|
|
84
|
+
const dialogVisible = vue.ref(false);
|
|
85
|
+
const backupRowMap = vue.ref(/* @__PURE__ */ new Map());
|
|
86
|
+
const theModelValue = vue.computed({
|
|
87
|
+
get: () => {
|
|
88
|
+
if (props2.stringify && typeof props2.modelValue === "string") {
|
|
89
|
+
return props2.modelValue ? props2.modelValue.split(",").map((v) => ({ [props2.oidField]: v })) : [];
|
|
90
|
+
}
|
|
91
|
+
return props2.modelValue;
|
|
92
|
+
},
|
|
93
|
+
set: (modelValue) => {
|
|
94
|
+
if (!Array.isArray(modelValue)) {
|
|
95
|
+
modelValue = modelValue ? [modelValue] : [];
|
|
96
|
+
}
|
|
97
|
+
if (props2.stringify) {
|
|
98
|
+
const value = modelValue.reduce((a, v) => {
|
|
99
|
+
if (object.isNotEmptyObject(v) && v[props2.oidField] !== void 0) {
|
|
100
|
+
a.push(v[props2.oidField]);
|
|
101
|
+
}
|
|
102
|
+
return a;
|
|
103
|
+
}, []).join(",");
|
|
104
|
+
emit("update:modelValue", value);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
emit("update:modelValue", modelValue);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const selectOptions = vue.computed(() => {
|
|
111
|
+
return theModelValue.value.map((item) => {
|
|
112
|
+
const backupRow = backupRowMap.value.get(item[props2.oidField]);
|
|
113
|
+
return {
|
|
114
|
+
label: item[props2.labelField] || backupRow?.[props2.labelField],
|
|
115
|
+
value: item
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
const selectValue = vue.computed(() => {
|
|
120
|
+
return props2.multiple ? theModelValue.value : theModelValue.value[0];
|
|
121
|
+
});
|
|
122
|
+
vue.watch(
|
|
123
|
+
() => selectOptions.value.filter((v) => !v.label),
|
|
124
|
+
(rows) => {
|
|
125
|
+
if (!rows.length) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
readItems(rows.map((v) => v.value[props2.oidField])).then(() => {
|
|
129
|
+
if (props2.stringify) return;
|
|
130
|
+
if (!props2.updateWhenCompleted) return;
|
|
131
|
+
const newModelValue = theModelValue.value.reduce((a, v) => {
|
|
132
|
+
const backupRow = backupRowMap.value.get(v[props2.oidField]);
|
|
133
|
+
backupRow ? a.push(backupRow) : a.push(v);
|
|
134
|
+
return a;
|
|
135
|
+
}, []);
|
|
136
|
+
theModelValue.value = newModelValue;
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
{ immediate: true }
|
|
140
|
+
);
|
|
141
|
+
async function readItems(ids) {
|
|
142
|
+
const idRows = ids.filter((v) => !backupRowMap.value.has(v)).map((id) => ({ [props2.oidField]: id }));
|
|
143
|
+
if (!idRows.length) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const { updateRows, addMap } = array.compareArray(props2.data, idRows, props2.oidField);
|
|
147
|
+
updateRows.forEach((row) => {
|
|
148
|
+
backupRowMap.value.set(row[props2.oidField], row);
|
|
149
|
+
});
|
|
150
|
+
if (!addMap.size) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const oids = Array.from(addMap.keys());
|
|
154
|
+
const rows = await props2.getRows(oids);
|
|
155
|
+
rows.forEach((row) => {
|
|
156
|
+
backupRowMap.value.set(row[props2.oidField], row);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
formItemProps,
|
|
161
|
+
selectOptions,
|
|
162
|
+
tablesProps,
|
|
163
|
+
tablesEmits,
|
|
164
|
+
dialogVisible,
|
|
165
|
+
selectValue,
|
|
166
|
+
theModelValue,
|
|
167
|
+
readonly
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
173
|
+
const _component_VkfSelect = vue.resolveComponent("VkfSelect");
|
|
174
|
+
const _component_VkTablesV1Checkbox = vue.resolveComponent("VkTablesV1Checkbox");
|
|
175
|
+
const _component_ElDialog = vue.resolveComponent("ElDialog");
|
|
176
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
177
|
+
vue.Fragment,
|
|
178
|
+
null,
|
|
179
|
+
[
|
|
180
|
+
vue.createVNode(_component_VkfSelect, vue.mergeProps(_ctx.formItemProps, {
|
|
181
|
+
multiple: _ctx.multiple,
|
|
182
|
+
options: _ctx.selectOptions,
|
|
183
|
+
"model-value": _ctx.selectValue,
|
|
184
|
+
clearable: _ctx.clearable,
|
|
185
|
+
"popper-class": "vkf-tables-select__popper",
|
|
186
|
+
"value-key": _ctx.oidField,
|
|
187
|
+
readonly: _ctx.readonly,
|
|
188
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.theModelValue = $event),
|
|
189
|
+
onVisibleChange: _cache[1] || (_cache[1] = ($event) => !_ctx.readonly && (_ctx.dialogVisible = true))
|
|
190
|
+
}), null, 16, ["multiple", "options", "model-value", "clearable", "value-key", "readonly"]),
|
|
191
|
+
vue.createVNode(_component_ElDialog, {
|
|
192
|
+
modelValue: _ctx.dialogVisible,
|
|
193
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.dialogVisible = $event),
|
|
194
|
+
title: _ctx.label ?? "\u8BF7\u9009\u62E9",
|
|
195
|
+
"append-to-body": "",
|
|
196
|
+
"model-class": "vkf-tables-select__model",
|
|
197
|
+
class: "vkf-tables-select__dialog"
|
|
198
|
+
}, {
|
|
199
|
+
default: vue.withCtx(() => [
|
|
200
|
+
vue.createVNode(_component_VkTablesV1Checkbox, vue.mergeProps(_ctx.tablesProps, {
|
|
201
|
+
modelValue: _ctx.theModelValue,
|
|
202
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.theModelValue = $event)
|
|
203
|
+
}, vue.toHandlers(_ctx.tablesEmits)), null, 16, ["modelValue"])
|
|
204
|
+
]),
|
|
205
|
+
_: 1
|
|
206
|
+
/* STABLE */
|
|
207
|
+
}, 8, ["modelValue", "title"])
|
|
208
|
+
],
|
|
209
|
+
64
|
|
210
|
+
/* STABLE_FRAGMENT */
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
var VkfTablesSelect = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/tables-select/src/index.vue"]]);
|
|
214
|
+
|
|
215
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
216
|
+
__proto__: null
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
VkfTablesSelect.install = (app) => {
|
|
220
|
+
app.component(VkfTablesSelect.name || "VkfTablesSelect", VkfTablesSelect);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
exports.VkfTablesSelect = VkfTablesSelect;
|
|
224
|
+
exports.__VkfTablesSelect = types;
|
|
225
|
+
exports.default = VkfTablesSelect;
|