cnhis-design-vue 3.1.17-beta.2 → 3.1.17-beta.3
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/es/packages/big-table/src/components/separate.js +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +2 -2
- package/es/packages/form-config/index.d.ts +115 -1
- package/es/packages/form-config/src/FormConfig.js +11 -17
- package/es/packages/form-config/src/FormConfig.vue.d.ts +115 -1
- package/es/packages/form-config/src/components/CloseButton.js +45 -0
- package/es/packages/form-config/src/components/CloseButton.vue.d.ts +1499 -0
- package/es/packages/form-config/src/components/ComplexNode.js +45 -0
- package/es/packages/form-config/src/components/ComplexNode.vue.d.ts +1661 -0
- package/es/packages/form-config/src/components/DefaultNode.js +54 -0
- package/es/packages/form-config/src/components/DefaultNode.vue.d.ts +1543 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +3 -3
- package/es/packages/form-config/src/components/FormConfigDragDisplay.js +43 -0
- package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +114 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -1
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +2 -0
- package/es/packages/form-config/src/constants/index.d.ts +2 -0
- package/es/packages/form-config/src/constants/index.js +5 -2
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -2
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +6 -84
- package/es/packages/form-config/src/hooks/useSortable.js +3 -7
- package/es/packages/form-config/src/types/index.d.ts +2 -1
- package/es/packages/form-config/src/utils/index.d.ts +8 -1
- package/es/packages/form-config/src/utils/index.js +23 -9
- package/es/packages/form-config/style/index.css +26 -5
- package/es/packages/index.css +26 -5
- package/global.d.ts +8 -8
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { useSeparateMap } from '../../../../packages/big-table/src/hooks/useSepa
|
|
|
3
3
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { class: "big-table__separate" };
|
|
6
|
-
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" },
|
|
6
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" }, /* @__PURE__ */ toDisplayString(` `), -1);
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "separate",
|
|
9
9
|
props: {
|
|
@@ -89,7 +89,7 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
89
89
|
separateDataMap.value.set(row, {
|
|
90
90
|
row,
|
|
91
91
|
rawRow: rawData[dataIndex],
|
|
92
|
-
index,
|
|
92
|
+
index: dataIndex,
|
|
93
93
|
separateData
|
|
94
94
|
});
|
|
95
95
|
row.$__SEPARATE_DATA = [separateData];
|
|
@@ -99,7 +99,7 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
99
99
|
separateDataMap.value.set(data2, {
|
|
100
100
|
row: data2,
|
|
101
101
|
rawRow: rawData[dataIndex],
|
|
102
|
-
index,
|
|
102
|
+
index: dataIndex,
|
|
103
103
|
separateData
|
|
104
104
|
});
|
|
105
105
|
row.$__SEPARATE_DATA.push(separateData);
|
|
@@ -42,6 +42,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
42
42
|
notes?: string | undefined;
|
|
43
43
|
desc?: string | undefined;
|
|
44
44
|
children?: any[] | undefined;
|
|
45
|
+
__new?: boolean | undefined;
|
|
45
46
|
}[]>;
|
|
46
47
|
materialListRef: import("vue").Ref<{
|
|
47
48
|
key: string;
|
|
@@ -57,9 +58,10 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
57
58
|
notes?: string | undefined;
|
|
58
59
|
desc?: string | undefined;
|
|
59
60
|
children?: any[] | undefined;
|
|
61
|
+
__new?: boolean | undefined;
|
|
60
62
|
}[]>;
|
|
61
63
|
addItem: (fieldItem: import("./src/types").FormConfigItem) => void;
|
|
62
|
-
|
|
64
|
+
parsedTextFormatter: import("./src/types").FormConfigTextFormatter;
|
|
63
65
|
getRenderer: (fieldItem: import("./src/types").FormConfigItem) => import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>;
|
|
64
66
|
currentEditField: import("vue").Ref<import("./src/types").FormConfigItem | undefined>;
|
|
65
67
|
formConfigEditRef: import("vue").Ref<{
|
|
@@ -138,6 +140,116 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
138
140
|
modelValue: unknown[];
|
|
139
141
|
componentData: Record<string, any>;
|
|
140
142
|
}>;
|
|
143
|
+
FormConfigDragDisplay: import("vue").DefineComponent<{
|
|
144
|
+
fieldItem: {
|
|
145
|
+
type: import("vue").PropType<import("./src/types").FormConfigItem>;
|
|
146
|
+
};
|
|
147
|
+
getRenderer: {
|
|
148
|
+
type: import("../../../es/src/types").Func<any[], any>;
|
|
149
|
+
require: boolean;
|
|
150
|
+
};
|
|
151
|
+
textFormatter: {
|
|
152
|
+
type: import("vue").PropType<import("./src/types").FormConfigTextFormatter>;
|
|
153
|
+
required: true;
|
|
154
|
+
};
|
|
155
|
+
}, {
|
|
156
|
+
getItemColumnStyle: (fieldItem?: import("./src/types").FormConfigItem | undefined) => {
|
|
157
|
+
'--item-column': number;
|
|
158
|
+
};
|
|
159
|
+
commonConfig: {
|
|
160
|
+
onMove: ({ to, from }: import("sortablejs").SortableEvent) => void;
|
|
161
|
+
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
162
|
+
onUnchoose: ({ from, to, target, item }: import("sortablejs").SortableEvent) => void;
|
|
163
|
+
tag: string;
|
|
164
|
+
animation: string;
|
|
165
|
+
'item-key': string;
|
|
166
|
+
};
|
|
167
|
+
Draggable: import("vue").DefineComponent<{
|
|
168
|
+
list: {
|
|
169
|
+
type: ArrayConstructor;
|
|
170
|
+
required: boolean;
|
|
171
|
+
default: any;
|
|
172
|
+
};
|
|
173
|
+
modelValue: {
|
|
174
|
+
type: ArrayConstructor;
|
|
175
|
+
required: boolean;
|
|
176
|
+
default: any;
|
|
177
|
+
};
|
|
178
|
+
itemKey: {
|
|
179
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
180
|
+
required: boolean;
|
|
181
|
+
};
|
|
182
|
+
clone: {
|
|
183
|
+
type: FunctionConstructor;
|
|
184
|
+
default: (original: any) => any;
|
|
185
|
+
};
|
|
186
|
+
tag: {
|
|
187
|
+
type: StringConstructor;
|
|
188
|
+
default: string;
|
|
189
|
+
};
|
|
190
|
+
move: {
|
|
191
|
+
type: FunctionConstructor;
|
|
192
|
+
default: any;
|
|
193
|
+
};
|
|
194
|
+
componentData: {
|
|
195
|
+
type: ObjectConstructor;
|
|
196
|
+
required: boolean;
|
|
197
|
+
default: any;
|
|
198
|
+
};
|
|
199
|
+
}, unknown, {
|
|
200
|
+
error: boolean;
|
|
201
|
+
}, {
|
|
202
|
+
realList(): any;
|
|
203
|
+
getKey(): any;
|
|
204
|
+
}, {
|
|
205
|
+
getUnderlyingVm(domElement: any): any;
|
|
206
|
+
getUnderlyingPotencialDraggableComponent(htmElement: any): any;
|
|
207
|
+
emitChanges(evt: any): void;
|
|
208
|
+
alterList(onList: any): void;
|
|
209
|
+
spliceList(): void;
|
|
210
|
+
updatePosition(oldIndex: any, newIndex: any): void;
|
|
211
|
+
getRelatedContextFromMoveEvent({ to, related }: {
|
|
212
|
+
to: any;
|
|
213
|
+
related: any;
|
|
214
|
+
}): any;
|
|
215
|
+
getVmIndexFromDomIndex(domIndex: any): any;
|
|
216
|
+
onDragStart(evt: any): void;
|
|
217
|
+
onDragAdd(evt: any): void;
|
|
218
|
+
onDragRemove(evt: any): void;
|
|
219
|
+
onDragUpdate(evt: any): void;
|
|
220
|
+
computeFutureIndex(relatedContext: any, evt: any): any;
|
|
221
|
+
onDragMove(evt: any, originalEvent: any): any;
|
|
222
|
+
onDragEnd(): void;
|
|
223
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], any, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
224
|
+
move: Function;
|
|
225
|
+
tag: string;
|
|
226
|
+
clone: Function;
|
|
227
|
+
list: unknown[];
|
|
228
|
+
modelValue: unknown[];
|
|
229
|
+
componentData: Record<string, any>;
|
|
230
|
+
} & {
|
|
231
|
+
itemKey?: string | Function | undefined;
|
|
232
|
+
}>, {
|
|
233
|
+
move: Function;
|
|
234
|
+
tag: string;
|
|
235
|
+
clone: Function;
|
|
236
|
+
list: unknown[];
|
|
237
|
+
modelValue: unknown[];
|
|
238
|
+
componentData: Record<string, any>;
|
|
239
|
+
}>;
|
|
240
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
241
|
+
fieldItem: {
|
|
242
|
+
type: import("vue").PropType<import("./src/types").FormConfigItem>;
|
|
243
|
+
};
|
|
244
|
+
getRenderer: {
|
|
245
|
+
type: import("../../../es/src/types").Func<any[], any>;
|
|
246
|
+
require: boolean;
|
|
247
|
+
};
|
|
248
|
+
textFormatter: {
|
|
249
|
+
type: import("vue").PropType<import("./src/types").FormConfigTextFormatter>;
|
|
250
|
+
required: true;
|
|
251
|
+
};
|
|
252
|
+
}>>, {}>;
|
|
141
253
|
layoutWidthEnum2Column: typeof import("./src/utils").layoutWidthEnum2Column;
|
|
142
254
|
FormConfigEdit: import("vue").DefineComponent<{}, {
|
|
143
255
|
key: import("vue").Ref<number>;
|
|
@@ -1824,7 +1936,9 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1824
1936
|
notes?: string | undefined;
|
|
1825
1937
|
desc?: string | undefined;
|
|
1826
1938
|
children?: any[] | undefined;
|
|
1939
|
+
__new?: boolean | undefined;
|
|
1827
1940
|
}[] | undefined;
|
|
1941
|
+
__new?: boolean | undefined;
|
|
1828
1942
|
}>;
|
|
1829
1943
|
generateFieldListByFieldItem: (fieldItem: import("./src/types").FormConfigItem) => import("..").FieldItem[];
|
|
1830
1944
|
showModal: import("vue").Ref<boolean>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, toRaw, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, unref, mergeProps, withCtx, toDisplayString,
|
|
1
|
+
import { defineComponent, ref, provide, toRaw, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, unref, mergeProps, withCtx, toDisplayString, createTextVNode } from 'vue';
|
|
2
2
|
import { cloneDeep, isFunction } from 'lodash-es';
|
|
3
3
|
import Draggable from 'vuedraggable';
|
|
4
|
+
import FormConfigDragDisplay from '../../../packages/form-config/src/components/FormConfigDragDisplay';
|
|
4
5
|
import { layoutWidthEnum2Column } from '../../../packages/form-config/src/utils';
|
|
5
6
|
import FormConfigEdit from './components/FormConfigEdit.js';
|
|
6
7
|
import FormConfigCreator from './components/FormConfigCreator.js';
|
|
7
|
-
import { InjectionActiveFieldItem } from '../../../packages/form-config/src/constants';
|
|
8
|
+
import { InjectionFieldList, InjectionMaterialList, InjectionActiveFieldItem } from '../../../packages/form-config/src/constants';
|
|
8
9
|
import { useSortable, usePresetRenderer } from '../../../packages/form-config/src/hooks';
|
|
9
10
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
10
11
|
|
|
@@ -27,17 +28,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
28
|
const { commonConfig } = useSortable();
|
|
28
29
|
const fieldListRef = ref([]);
|
|
29
30
|
const materialListRef = ref([]);
|
|
31
|
+
provide(InjectionFieldList, fieldListRef);
|
|
32
|
+
provide(InjectionMaterialList, materialListRef);
|
|
30
33
|
function addItem(fieldItem) {
|
|
31
34
|
if (fieldListRef.value.some((field) => field.key === fieldItem.key))
|
|
32
35
|
return;
|
|
33
36
|
fieldListRef.value.push(fieldItem);
|
|
34
37
|
}
|
|
35
|
-
const
|
|
38
|
+
const parsedTextFormatter = (fieldItem, parsedText) => {
|
|
36
39
|
if (!isFunction(props.textFormatter))
|
|
37
40
|
return parsedText;
|
|
38
41
|
return props.textFormatter(fieldItem, parsedText);
|
|
39
42
|
};
|
|
40
|
-
const { getRenderer } = usePresetRenderer(
|
|
43
|
+
const { getRenderer } = usePresetRenderer();
|
|
41
44
|
const currentEditField = ref();
|
|
42
45
|
provide(InjectionActiveFieldItem, currentEditField);
|
|
43
46
|
const formConfigEditRef = ref();
|
|
@@ -86,22 +89,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
89
|
_hoisted_5,
|
|
87
90
|
createVNode(FormConfigCreator, { onSubmit: addItem })
|
|
88
91
|
]),
|
|
89
|
-
createVNode(
|
|
90
|
-
group: "__display",
|
|
92
|
+
createVNode(FormConfigDragDisplay, {
|
|
91
93
|
class: "form-config__displayContent",
|
|
94
|
+
"text-formatter": parsedTextFormatter,
|
|
95
|
+
"get-renderer": unref(getRenderer),
|
|
92
96
|
modelValue: fieldListRef.value,
|
|
93
97
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => fieldListRef.value = $event)
|
|
94
|
-
}
|
|
95
|
-
item: withCtx(({ element }) => [
|
|
96
|
-
createElementVNode("section", {
|
|
97
|
-
class: "form-config__displayContentItem",
|
|
98
|
-
style: normalizeStyle({ "--item-column": unref(layoutWidthEnum2Column)(element.layoutWidthEnum) })
|
|
99
|
-
}, [
|
|
100
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(getRenderer)(element)), { fieldItem: element }, null, 8, ["fieldItem"]))
|
|
101
|
-
], 4)
|
|
102
|
-
]),
|
|
103
|
-
_: 1
|
|
104
|
-
}, 16, ["modelValue"])
|
|
98
|
+
}, null, 8, ["get-renderer", "modelValue"])
|
|
105
99
|
]),
|
|
106
100
|
createElementVNode("section", _hoisted_6, [
|
|
107
101
|
_hoisted_7,
|
|
@@ -44,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
notes?: string | undefined;
|
|
45
45
|
desc?: string | undefined;
|
|
46
46
|
children?: any[] | undefined;
|
|
47
|
+
__new?: boolean | undefined;
|
|
47
48
|
}[]>;
|
|
48
49
|
materialListRef: import("vue").Ref<{
|
|
49
50
|
key: string;
|
|
@@ -59,9 +60,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
60
|
notes?: string | undefined;
|
|
60
61
|
desc?: string | undefined;
|
|
61
62
|
children?: any[] | undefined;
|
|
63
|
+
__new?: boolean | undefined;
|
|
62
64
|
}[]>;
|
|
63
65
|
addItem: (fieldItem: FormConfigItem) => void;
|
|
64
|
-
|
|
66
|
+
parsedTextFormatter: FormConfigTextFormatter;
|
|
65
67
|
getRenderer: (fieldItem: FormConfigItem) => import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>;
|
|
66
68
|
currentEditField: import("vue").Ref<FormConfigItem | undefined>;
|
|
67
69
|
formConfigEditRef: import("vue").Ref<{
|
|
@@ -140,6 +142,116 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
142
|
modelValue: unknown[];
|
|
141
143
|
componentData: Record<string, any>;
|
|
142
144
|
}>;
|
|
145
|
+
FormConfigDragDisplay: import("vue").DefineComponent<{
|
|
146
|
+
fieldItem: {
|
|
147
|
+
type: PropType<FormConfigItem>;
|
|
148
|
+
};
|
|
149
|
+
getRenderer: {
|
|
150
|
+
type: Func<any[], any>;
|
|
151
|
+
require: boolean;
|
|
152
|
+
};
|
|
153
|
+
textFormatter: {
|
|
154
|
+
type: PropType<FormConfigTextFormatter>;
|
|
155
|
+
required: true;
|
|
156
|
+
};
|
|
157
|
+
}, {
|
|
158
|
+
getItemColumnStyle: (fieldItem?: FormConfigItem | undefined) => {
|
|
159
|
+
'--item-column': number;
|
|
160
|
+
};
|
|
161
|
+
commonConfig: {
|
|
162
|
+
onMove: ({ to, from }: import("sortablejs").SortableEvent) => void;
|
|
163
|
+
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
164
|
+
onUnchoose: ({ from, to, target, item }: import("sortablejs").SortableEvent) => void;
|
|
165
|
+
tag: string;
|
|
166
|
+
animation: string;
|
|
167
|
+
'item-key': string;
|
|
168
|
+
};
|
|
169
|
+
Draggable: import("vue").DefineComponent<{
|
|
170
|
+
list: {
|
|
171
|
+
type: ArrayConstructor;
|
|
172
|
+
required: boolean;
|
|
173
|
+
default: any;
|
|
174
|
+
};
|
|
175
|
+
modelValue: {
|
|
176
|
+
type: ArrayConstructor;
|
|
177
|
+
required: boolean;
|
|
178
|
+
default: any;
|
|
179
|
+
};
|
|
180
|
+
itemKey: {
|
|
181
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
182
|
+
required: boolean;
|
|
183
|
+
};
|
|
184
|
+
clone: {
|
|
185
|
+
type: FunctionConstructor;
|
|
186
|
+
default: (original: any) => any;
|
|
187
|
+
};
|
|
188
|
+
tag: {
|
|
189
|
+
type: StringConstructor;
|
|
190
|
+
default: string;
|
|
191
|
+
};
|
|
192
|
+
move: {
|
|
193
|
+
type: FunctionConstructor;
|
|
194
|
+
default: any;
|
|
195
|
+
};
|
|
196
|
+
componentData: {
|
|
197
|
+
type: ObjectConstructor;
|
|
198
|
+
required: boolean;
|
|
199
|
+
default: any;
|
|
200
|
+
};
|
|
201
|
+
}, unknown, {
|
|
202
|
+
error: boolean;
|
|
203
|
+
}, {
|
|
204
|
+
realList(): any;
|
|
205
|
+
getKey(): any;
|
|
206
|
+
}, {
|
|
207
|
+
getUnderlyingVm(domElement: any): any;
|
|
208
|
+
getUnderlyingPotencialDraggableComponent(htmElement: any): any;
|
|
209
|
+
emitChanges(evt: any): void;
|
|
210
|
+
alterList(onList: any): void;
|
|
211
|
+
spliceList(): void;
|
|
212
|
+
updatePosition(oldIndex: any, newIndex: any): void;
|
|
213
|
+
getRelatedContextFromMoveEvent({ to, related }: {
|
|
214
|
+
to: any;
|
|
215
|
+
related: any;
|
|
216
|
+
}): any;
|
|
217
|
+
getVmIndexFromDomIndex(domIndex: any): any;
|
|
218
|
+
onDragStart(evt: any): void;
|
|
219
|
+
onDragAdd(evt: any): void;
|
|
220
|
+
onDragRemove(evt: any): void;
|
|
221
|
+
onDragUpdate(evt: any): void;
|
|
222
|
+
computeFutureIndex(relatedContext: any, evt: any): any;
|
|
223
|
+
onDragMove(evt: any, originalEvent: any): any;
|
|
224
|
+
onDragEnd(): void;
|
|
225
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], any, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
226
|
+
move: Function;
|
|
227
|
+
tag: string;
|
|
228
|
+
clone: Function;
|
|
229
|
+
list: unknown[];
|
|
230
|
+
modelValue: unknown[];
|
|
231
|
+
componentData: Record<string, any>;
|
|
232
|
+
} & {
|
|
233
|
+
itemKey?: string | Function | undefined;
|
|
234
|
+
}>, {
|
|
235
|
+
move: Function;
|
|
236
|
+
tag: string;
|
|
237
|
+
clone: Function;
|
|
238
|
+
list: unknown[];
|
|
239
|
+
modelValue: unknown[];
|
|
240
|
+
componentData: Record<string, any>;
|
|
241
|
+
}>;
|
|
242
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
243
|
+
fieldItem: {
|
|
244
|
+
type: PropType<FormConfigItem>;
|
|
245
|
+
};
|
|
246
|
+
getRenderer: {
|
|
247
|
+
type: Func<any[], any>;
|
|
248
|
+
require: boolean;
|
|
249
|
+
};
|
|
250
|
+
textFormatter: {
|
|
251
|
+
type: PropType<FormConfigTextFormatter>;
|
|
252
|
+
required: true;
|
|
253
|
+
};
|
|
254
|
+
}>>, {}>;
|
|
143
255
|
layoutWidthEnum2Column: typeof layoutWidthEnum2Column;
|
|
144
256
|
FormConfigEdit: import("vue").DefineComponent<{}, {
|
|
145
257
|
key: import("vue").Ref<number>;
|
|
@@ -1826,7 +1938,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1826
1938
|
notes?: string | undefined;
|
|
1827
1939
|
desc?: string | undefined;
|
|
1828
1940
|
children?: any[] | undefined;
|
|
1941
|
+
__new?: boolean | undefined;
|
|
1829
1942
|
}[] | undefined;
|
|
1943
|
+
__new?: boolean | undefined;
|
|
1830
1944
|
}>;
|
|
1831
1945
|
generateFieldListByFieldItem: (fieldItem: FormConfigItem) => import("../..").FieldItem[];
|
|
1832
1946
|
showModal: import("vue").Ref<boolean>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent, inject, openBlock, createBlock, unref, withModifiers, withCtx, createVNode } from 'vue';
|
|
2
|
+
import { CloseCircle } from '@vicons/ionicons5';
|
|
3
|
+
import { isArray } from 'lodash-es';
|
|
4
|
+
import { NButton, NIcon } from 'naive-ui';
|
|
5
|
+
import { InjectionFieldList, InjectionMaterialList } from '../../../../packages/form-config/src/constants';
|
|
6
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
7
|
+
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "CloseButton",
|
|
10
|
+
props: {
|
|
11
|
+
fieldItem: { type: Object, required: true }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const fieldList = inject(InjectionFieldList);
|
|
16
|
+
const materialList = inject(InjectionMaterialList);
|
|
17
|
+
const remove = () => {
|
|
18
|
+
traverse(fieldList.value);
|
|
19
|
+
function traverse(_fieldItem) {
|
|
20
|
+
return isArray(_fieldItem) && _fieldItem.some((_fieldItem2, idx, arr) => {
|
|
21
|
+
if (_fieldItem2 !== props.fieldItem)
|
|
22
|
+
return traverse(_fieldItem2.children);
|
|
23
|
+
!_fieldItem2.__new && materialList.value.push(_fieldItem2);
|
|
24
|
+
return arr.splice(idx, 1);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createBlock(unref(NButton), {
|
|
30
|
+
text: "",
|
|
31
|
+
class: "form-config__renderer--closeButton",
|
|
32
|
+
"text-color": "#a5a5a5",
|
|
33
|
+
onClick: withModifiers(remove, ["stop"])
|
|
34
|
+
}, {
|
|
35
|
+
icon: withCtx(() => [
|
|
36
|
+
createVNode(unref(NIcon), { component: unref(CloseCircle) }, null, 8, ["component"])
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["onClick"]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
var CloseButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "CloseButton.vue"]]);
|
|
44
|
+
|
|
45
|
+
export { CloseButton as default };
|