@vc-shell/framework 1.0.123 → 1.0.125
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/CHANGELOG.md +18 -0
- package/dist/framework.mjs +3125 -3080
- package/dist/shared/modules/dynamic/components/FIELD_MAP.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/factories.d.ts +2 -1
- package/dist/shared/modules/dynamic/components/factories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts +128 -0
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/types/index.d.ts +57 -4
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/models.d.ts +7 -2
- package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts +1 -107
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +21 -21
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +6 -6
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/components/FIELD_MAP.ts +2 -0
- package/shared/modules/dynamic/components/factories.ts +31 -19
- package/shared/modules/dynamic/components/fields/MultivalueField.ts +62 -0
- package/shared/modules/dynamic/types/index.ts +68 -4
- package/shared/modules/dynamic/types/models.ts +9 -1
- package/ui/components/molecules/vc-multivalue/index.ts +1 -3
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +5 -1
- package/ui/components/molecules/vc-select/vc-select.vue +6 -1
|
@@ -1,108 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
id?: string | undefined;
|
|
3
|
-
alias?: string | undefined;
|
|
4
|
-
languageCode?: string | undefined;
|
|
5
|
-
value?: string | undefined;
|
|
6
|
-
}>(__VLS_props: {
|
|
7
|
-
disabled?: boolean | undefined;
|
|
8
|
-
type?: "number" | "text" | undefined;
|
|
9
|
-
label?: string | undefined;
|
|
10
|
-
name?: string | undefined;
|
|
11
|
-
modelValue?: T[] | undefined;
|
|
12
|
-
required?: boolean | undefined;
|
|
13
|
-
errorMessage?: string | undefined;
|
|
14
|
-
tooltip?: string | undefined;
|
|
15
|
-
multilanguage?: boolean | undefined;
|
|
16
|
-
currentLanguage?: string | undefined;
|
|
17
|
-
error?: boolean | undefined;
|
|
18
|
-
placeholder?: string | undefined;
|
|
19
|
-
options?: T[] | undefined;
|
|
20
|
-
onClose?: (() => any) | undefined;
|
|
21
|
-
onSearch?: ((value: string) => any) | undefined;
|
|
22
|
-
optionValue?: string | undefined;
|
|
23
|
-
optionLabel?: string | undefined;
|
|
24
|
-
emitValue?: string | undefined;
|
|
25
|
-
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
26
|
-
multivalue?: boolean | undefined;
|
|
27
|
-
emitLabel?: string | undefined;
|
|
28
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
|
29
|
-
attrs: any;
|
|
30
|
-
slots: {
|
|
31
|
-
item?(_: {
|
|
32
|
-
item: T;
|
|
33
|
-
}): any;
|
|
34
|
-
error?(_: {}): any;
|
|
35
|
-
};
|
|
36
|
-
emit: import("./vc-multivalue.vue").Emits<T>;
|
|
37
|
-
} | undefined, __VLS_expose?: ((exposed: import("vue").ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
38
|
-
props: {
|
|
39
|
-
disabled?: boolean | undefined;
|
|
40
|
-
type?: "number" | "text" | undefined;
|
|
41
|
-
label?: string | undefined;
|
|
42
|
-
name?: string | undefined;
|
|
43
|
-
modelValue?: T[] | undefined;
|
|
44
|
-
required?: boolean | undefined;
|
|
45
|
-
errorMessage?: string | undefined;
|
|
46
|
-
tooltip?: string | undefined;
|
|
47
|
-
multilanguage?: boolean | undefined;
|
|
48
|
-
currentLanguage?: string | undefined;
|
|
49
|
-
error?: boolean | undefined;
|
|
50
|
-
placeholder?: string | undefined;
|
|
51
|
-
options?: T[] | undefined;
|
|
52
|
-
onClose?: (() => any) | undefined;
|
|
53
|
-
onSearch?: ((value: string) => any) | undefined;
|
|
54
|
-
optionValue?: string | undefined;
|
|
55
|
-
optionLabel?: string | undefined;
|
|
56
|
-
emitValue?: string | undefined;
|
|
57
|
-
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
58
|
-
multivalue?: boolean | undefined;
|
|
59
|
-
emitLabel?: string | undefined;
|
|
60
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
61
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
62
|
-
attrs: any;
|
|
63
|
-
slots: {
|
|
64
|
-
item?(_: {
|
|
65
|
-
item: T;
|
|
66
|
-
}): any;
|
|
67
|
-
error?(_: {}): any;
|
|
68
|
-
};
|
|
69
|
-
emit: import("./vc-multivalue.vue").Emits<T>;
|
|
70
|
-
}>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
}> & {
|
|
73
|
-
__ctx?: {
|
|
74
|
-
props: {
|
|
75
|
-
disabled?: boolean | undefined;
|
|
76
|
-
type?: "number" | "text" | undefined;
|
|
77
|
-
label?: string | undefined;
|
|
78
|
-
name?: string | undefined;
|
|
79
|
-
modelValue?: T[] | undefined;
|
|
80
|
-
required?: boolean | undefined;
|
|
81
|
-
errorMessage?: string | undefined;
|
|
82
|
-
tooltip?: string | undefined;
|
|
83
|
-
multilanguage?: boolean | undefined;
|
|
84
|
-
currentLanguage?: string | undefined;
|
|
85
|
-
error?: boolean | undefined;
|
|
86
|
-
placeholder?: string | undefined;
|
|
87
|
-
options?: T[] | undefined;
|
|
88
|
-
onClose?: (() => any) | undefined;
|
|
89
|
-
onSearch?: ((value: string) => any) | undefined;
|
|
90
|
-
optionValue?: string | undefined;
|
|
91
|
-
optionLabel?: string | undefined;
|
|
92
|
-
emitValue?: string | undefined;
|
|
93
|
-
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
94
|
-
multivalue?: boolean | undefined;
|
|
95
|
-
emitLabel?: string | undefined;
|
|
96
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
97
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
98
|
-
attrs: any;
|
|
99
|
-
slots: {
|
|
100
|
-
item?(_: {
|
|
101
|
-
item: T;
|
|
102
|
-
}): any;
|
|
103
|
-
error?(_: {}): any;
|
|
104
|
-
};
|
|
105
|
-
emit: import("./vc-multivalue.vue").Emits<T>;
|
|
106
|
-
} | undefined;
|
|
107
|
-
};
|
|
1
|
+
export { default as VcMultivalue } from "./vc-multivalue.vue";
|
|
108
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-multivalue/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-multivalue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -44,20 +44,20 @@ declare const _default: <T extends {
|
|
|
44
44
|
options?: T[] | undefined;
|
|
45
45
|
onClose?: (() => any) | undefined;
|
|
46
46
|
onSearch?: ((value: string) => any) | undefined;
|
|
47
|
+
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
47
48
|
optionValue?: string | undefined;
|
|
48
49
|
optionLabel?: string | undefined;
|
|
49
50
|
emitValue?: string | undefined;
|
|
50
|
-
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
51
|
-
multivalue?: boolean | undefined;
|
|
52
51
|
emitLabel?: string | undefined;
|
|
52
|
+
multivalue?: boolean | undefined;
|
|
53
53
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
|
54
54
|
attrs: any;
|
|
55
|
-
slots: {
|
|
56
|
-
item
|
|
55
|
+
slots: Readonly<{
|
|
56
|
+
item: (args: {
|
|
57
57
|
item: T;
|
|
58
|
-
})
|
|
59
|
-
error
|
|
60
|
-
}
|
|
58
|
+
}) => any;
|
|
59
|
+
error: (props: any) => any;
|
|
60
|
+
}>;
|
|
61
61
|
emit: Emits<T>;
|
|
62
62
|
} | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
63
63
|
props: {
|
|
@@ -76,21 +76,21 @@ declare const _default: <T extends {
|
|
|
76
76
|
options?: T[] | undefined;
|
|
77
77
|
onClose?: (() => any) | undefined;
|
|
78
78
|
onSearch?: ((value: string) => any) | undefined;
|
|
79
|
+
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
79
80
|
optionValue?: string | undefined;
|
|
80
81
|
optionLabel?: string | undefined;
|
|
81
82
|
emitValue?: string | undefined;
|
|
82
|
-
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
83
|
-
multivalue?: boolean | undefined;
|
|
84
83
|
emitLabel?: string | undefined;
|
|
84
|
+
multivalue?: boolean | undefined;
|
|
85
85
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
86
86
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
87
87
|
attrs: any;
|
|
88
|
-
slots: {
|
|
89
|
-
item
|
|
88
|
+
slots: Readonly<{
|
|
89
|
+
item: (args: {
|
|
90
90
|
item: T;
|
|
91
|
-
})
|
|
92
|
-
error
|
|
93
|
-
}
|
|
91
|
+
}) => any;
|
|
92
|
+
error: (props: any) => any;
|
|
93
|
+
}>;
|
|
94
94
|
emit: Emits<T>;
|
|
95
95
|
}>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
96
96
|
[key: string]: any;
|
|
@@ -112,21 +112,21 @@ declare const _default: <T extends {
|
|
|
112
112
|
options?: T[] | undefined;
|
|
113
113
|
onClose?: (() => any) | undefined;
|
|
114
114
|
onSearch?: ((value: string) => any) | undefined;
|
|
115
|
+
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
115
116
|
optionValue?: string | undefined;
|
|
116
117
|
optionLabel?: string | undefined;
|
|
117
118
|
emitValue?: string | undefined;
|
|
118
|
-
"onUpdate:model-value"?: ((value: T[]) => any) | undefined;
|
|
119
|
-
multivalue?: boolean | undefined;
|
|
120
119
|
emitLabel?: string | undefined;
|
|
120
|
+
multivalue?: boolean | undefined;
|
|
121
121
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
122
122
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
123
123
|
attrs: any;
|
|
124
|
-
slots: {
|
|
125
|
-
item
|
|
124
|
+
slots: Readonly<{
|
|
125
|
+
item: (args: {
|
|
126
126
|
item: T;
|
|
127
|
-
})
|
|
128
|
-
error
|
|
129
|
-
}
|
|
127
|
+
}) => any;
|
|
128
|
+
error: (props: any) => any;
|
|
129
|
+
}>;
|
|
130
130
|
emit: Emits<T>;
|
|
131
131
|
} | undefined;
|
|
132
132
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-multivalue.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-multivalue/vc-multivalue.vue.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IAChD,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA8fM,GAAG;;;;
|
|
1
|
+
{"version":3,"file":"vc-multivalue.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-multivalue/vc-multivalue.vue.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IAChD,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA8fM,GAAG;;;;cA7dqB,GAAG;uBACjB,GAAG,KAAK,GAAG;;;yCA2dZ,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,KAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;oBAAzC,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;cA7dqB,GAAG;uBACjB,GAAG,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2dZ,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;eAClD,GAAG;;;;kBA7dqB,GAAG;2BACjB,GAAG,KAAK,GAAG;;;;;AA/B5B,wBAggB2E"}
|
|
@@ -25,10 +25,10 @@ declare const _default: <T, P extends {
|
|
|
25
25
|
debounce?: string | number | undefined;
|
|
26
26
|
multiple?: boolean | undefined;
|
|
27
27
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
28
|
-
mapOptions?: boolean | undefined;
|
|
29
28
|
optionValue?: OptionProp<T & P["results"][number]>;
|
|
30
29
|
optionLabel?: OptionProp<T & P["results"][number]>;
|
|
31
30
|
emitValue?: boolean | undefined;
|
|
31
|
+
mapOptions?: boolean | undefined;
|
|
32
32
|
searchable?: boolean | undefined;
|
|
33
33
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
|
34
34
|
attrs: any;
|
|
@@ -140,10 +140,10 @@ declare const _default: <T, P extends {
|
|
|
140
140
|
debounce?: string | number | undefined;
|
|
141
141
|
multiple?: boolean | undefined;
|
|
142
142
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
143
|
-
mapOptions?: boolean | undefined;
|
|
144
143
|
optionValue?: OptionProp<T & P["results"][number]>;
|
|
145
144
|
optionLabel?: OptionProp<T & P["results"][number]>;
|
|
146
145
|
emitValue?: boolean | undefined;
|
|
146
|
+
mapOptions?: boolean | undefined;
|
|
147
147
|
searchable?: boolean | undefined;
|
|
148
148
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
149
149
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
@@ -259,10 +259,10 @@ declare const _default: <T, P extends {
|
|
|
259
259
|
debounce?: string | number | undefined;
|
|
260
260
|
multiple?: boolean | undefined;
|
|
261
261
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
262
|
-
mapOptions?: boolean | undefined;
|
|
263
262
|
optionValue?: OptionProp<T & P["results"][number]>;
|
|
264
263
|
optionLabel?: OptionProp<T & P["results"][number]>;
|
|
265
264
|
emitValue?: boolean | undefined;
|
|
265
|
+
mapOptions?: boolean | undefined;
|
|
266
266
|
searchable?: boolean | undefined;
|
|
267
267
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
268
268
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-select.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-select/vc-select.vue.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;;;gBAEhB,MAAM;;;;;
|
|
1
|
+
{"version":3,"file":"vc-select.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-select/vc-select.vue.ts"],"names":[],"mappings":"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"}
|
|
@@ -19,15 +19,15 @@ declare const _default: <T extends {
|
|
|
19
19
|
max?: number | undefined;
|
|
20
20
|
regex?: string | undefined;
|
|
21
21
|
} | undefined;
|
|
22
|
-
property: T;
|
|
23
22
|
"onUpdate:model-value"?: ((data: {
|
|
24
23
|
readonly property: T;
|
|
25
24
|
readonly value: any;
|
|
26
25
|
readonly dictionary?: any[] | undefined;
|
|
27
26
|
readonly locale?: string | undefined;
|
|
28
27
|
}) => any) | undefined;
|
|
29
|
-
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<any[]> | any[];
|
|
30
28
|
multivalue?: boolean | undefined;
|
|
29
|
+
property: T;
|
|
30
|
+
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<any[]> | any[];
|
|
31
31
|
dictionary?: boolean | undefined;
|
|
32
32
|
optionsValue?: string | undefined;
|
|
33
33
|
optionsLabel?: string | undefined;
|
|
@@ -59,15 +59,15 @@ declare const _default: <T extends {
|
|
|
59
59
|
max?: number | undefined;
|
|
60
60
|
regex?: string | undefined;
|
|
61
61
|
} | undefined;
|
|
62
|
-
property: T;
|
|
63
62
|
"onUpdate:model-value"?: ((data: {
|
|
64
63
|
readonly property: T;
|
|
65
64
|
readonly value: any;
|
|
66
65
|
readonly dictionary?: any[] | undefined;
|
|
67
66
|
readonly locale?: string | undefined;
|
|
68
67
|
}) => any) | undefined;
|
|
69
|
-
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<any[]> | any[];
|
|
70
68
|
multivalue?: boolean | undefined;
|
|
69
|
+
property: T;
|
|
70
|
+
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<any[]> | any[];
|
|
71
71
|
dictionary?: boolean | undefined;
|
|
72
72
|
optionsValue?: string | undefined;
|
|
73
73
|
optionsLabel?: string | undefined;
|
|
@@ -103,15 +103,15 @@ declare const _default: <T extends {
|
|
|
103
103
|
max?: number | undefined;
|
|
104
104
|
regex?: string | undefined;
|
|
105
105
|
} | undefined;
|
|
106
|
-
property: T;
|
|
107
106
|
"onUpdate:model-value"?: ((data: {
|
|
108
107
|
readonly property: T;
|
|
109
108
|
readonly value: any;
|
|
110
109
|
readonly dictionary?: any[] | undefined;
|
|
111
110
|
readonly locale?: string | undefined;
|
|
112
111
|
}) => any) | undefined;
|
|
113
|
-
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<any[]> | any[];
|
|
114
112
|
multivalue?: boolean | undefined;
|
|
113
|
+
property: T;
|
|
114
|
+
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<any[]> | any[];
|
|
115
115
|
dictionary?: boolean | undefined;
|
|
116
116
|
optionsValue?: string | undefined;
|
|
117
117
|
optionsLabel?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-dynamic-property.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.ts"],"names":[],"mappings":";;;;;UAyZU,MAAM;gBARA,GAAG;cAEL,OAAO;;;;eAIN,MAAM
|
|
1
|
+
{"version":3,"file":"vc-dynamic-property.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.ts"],"names":[],"mappings":";;;;;UAyZU,MAAM;gBARA,GAAG;cAEL,OAAO;;;;eAIN,MAAM;;;;;;;;;;;;wBA/V6B,GAAG;;;;;;2CA0VV,MAAM,WAAW,MAAM,KAAK,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE;;;;;WA4BtF,GAAG;;;;wBAtXwC,GAAG;;;;yCAqXrC,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,KAAG,IAAI;;;cApB/C,MAAM;oBARA,GAAG;kBAEL,OAAO;;;;mBAIN,MAAM;;;;;;;;;;;;4BA/V6B,GAAG;;;;;;+CA0VV,MAAM,WAAW,MAAM,KAAK,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE;;;;;oBA2B7E,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;wBAtXwC,GAAG;;;;;;;;;;kBAiW3C,MAAM;wBARA,GAAG;sBAEL,OAAO;;;;uBAIN,MAAM;;;;;;;;;;;;gCA/V6B,GAAG;;;;;;mDA0VV,MAAM,WAAW,MAAM,KAAK,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE;;;;;wBA2B7E,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;eAClD,GAAG;;;;4BAtXwC,GAAG;;;;;;AAhDrD,wBA2a2E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.125",
|
|
4
4
|
"main": "./dist/framework.mjs",
|
|
5
5
|
"module": "./dist/framework.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"whatwg-fetch": "^3.6.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
61
|
-
"@vc-shell/config-generator": "^1.0.
|
|
62
|
-
"@vc-shell/ts-config": "^1.0.
|
|
60
|
+
"@vc-shell/api-client-generator": "^1.0.125",
|
|
61
|
+
"@vc-shell/config-generator": "^1.0.125",
|
|
62
|
+
"@vc-shell/ts-config": "^1.0.125",
|
|
63
63
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
64
64
|
"sass": "^1.62.1",
|
|
65
65
|
"typescript": "^5.2.2",
|
|
@@ -13,6 +13,7 @@ import ContentField from "./fields/ContentField";
|
|
|
13
13
|
import VideoField from "./fields/VideoField";
|
|
14
14
|
import ImageField from "./fields/ImageField";
|
|
15
15
|
import TextareaField from "./fields/TextareaField";
|
|
16
|
+
import MultivalueField from "./fields/MultivalueField";
|
|
16
17
|
|
|
17
18
|
import { ControlSchema } from "../types";
|
|
18
19
|
|
|
@@ -36,6 +37,7 @@ const FIELD_MAP: TFieldMap = {
|
|
|
36
37
|
"vc-video": VideoField,
|
|
37
38
|
"vc-image": ImageField,
|
|
38
39
|
"vc-textarea": TextareaField,
|
|
40
|
+
"vc-multivalue": MultivalueField,
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
export default FIELD_MAP;
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { markRaw } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
VcButton,
|
|
5
|
-
VcCard,
|
|
6
|
-
VcCheckbox,
|
|
7
|
-
VcDynamicProperty,
|
|
8
|
-
VcEditor,
|
|
9
|
-
VcField,
|
|
10
|
-
VcGallery,
|
|
11
|
-
VcImage,
|
|
12
|
-
VcInput,
|
|
13
|
-
VcInputCurrency,
|
|
14
|
-
VcSelect,
|
|
15
|
-
VcStatus,
|
|
16
|
-
VcVideo,
|
|
17
|
-
VcTextarea,
|
|
18
|
-
} from "../../../../ui/components";
|
|
19
1
|
import {
|
|
2
|
+
IMultivalueField,
|
|
20
3
|
IControlBaseProps,
|
|
21
4
|
ISelectField,
|
|
22
5
|
IInputField,
|
|
@@ -34,7 +17,26 @@ import {
|
|
|
34
17
|
IVideoField,
|
|
35
18
|
IImageField,
|
|
36
19
|
ITextareaField,
|
|
37
|
-
} from "
|
|
20
|
+
} from "./../types/models";
|
|
21
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
22
|
+
import { markRaw } from "vue";
|
|
23
|
+
import {
|
|
24
|
+
VcButton,
|
|
25
|
+
VcCard,
|
|
26
|
+
VcCheckbox,
|
|
27
|
+
VcDynamicProperty,
|
|
28
|
+
VcEditor,
|
|
29
|
+
VcField,
|
|
30
|
+
VcGallery,
|
|
31
|
+
VcImage,
|
|
32
|
+
VcInput,
|
|
33
|
+
VcInputCurrency,
|
|
34
|
+
VcSelect,
|
|
35
|
+
VcStatus,
|
|
36
|
+
VcVideo,
|
|
37
|
+
VcTextarea,
|
|
38
|
+
VcMultivalue,
|
|
39
|
+
} from "../../../../ui/components";
|
|
38
40
|
|
|
39
41
|
export const ControlBase = ({ visibility = undefined }: IControlBaseOptions): IControlBaseOptions => ({
|
|
40
42
|
visibility,
|
|
@@ -64,6 +66,16 @@ export const ControlBaseProps = ({
|
|
|
64
66
|
...rest,
|
|
65
67
|
});
|
|
66
68
|
|
|
69
|
+
export const MultivalueField = ({ props, slots, options }: IMultivalueField): IMultivalueField => ({
|
|
70
|
+
component: markRaw(VcMultivalue),
|
|
71
|
+
props: {
|
|
72
|
+
...ControlBaseProps(props),
|
|
73
|
+
...props,
|
|
74
|
+
},
|
|
75
|
+
options: ControlBase(options),
|
|
76
|
+
slots,
|
|
77
|
+
});
|
|
78
|
+
|
|
67
79
|
export const SelectField = ({ props, slots, options }: ISelectField): ISelectField => ({
|
|
68
80
|
component: markRaw(VcSelect) as any,
|
|
69
81
|
props: {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ComponentSlots } from "../../../../utilities/vueUtils";
|
|
2
|
+
import { h, resolveComponent, ExtractPropTypes, Component, VNode } from "vue";
|
|
3
|
+
import { MultivalueField } from "../factories";
|
|
4
|
+
import componentProps from "./props";
|
|
5
|
+
import ValidationField from "./ValidationField";
|
|
6
|
+
import { MultivalueSchema } from "../../types";
|
|
7
|
+
import { VcMultivalue } from "../../../../../ui/components";
|
|
8
|
+
|
|
9
|
+
type TScope = Parameters<ComponentSlots<typeof VcMultivalue>["item"]>["0"];
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: "MultivalueField",
|
|
13
|
+
props: componentProps,
|
|
14
|
+
setup(props: ExtractPropTypes<typeof componentProps> & { element: MultivalueSchema }) {
|
|
15
|
+
return () => {
|
|
16
|
+
const field = MultivalueField({
|
|
17
|
+
props: {
|
|
18
|
+
...props.baseProps,
|
|
19
|
+
multivalue: props.element.multivalue,
|
|
20
|
+
type: props.element.variant,
|
|
21
|
+
optionValue: props.element.optionValue,
|
|
22
|
+
optionLabel: props.element.optionLabel,
|
|
23
|
+
emitValue: props.element.emitValue,
|
|
24
|
+
emitLabel: props.element.emitLabel,
|
|
25
|
+
options: props.element.options ? props.bladeContext.scope?.[props.element.options] : undefined,
|
|
26
|
+
currentLanguage: props.currentLocale,
|
|
27
|
+
},
|
|
28
|
+
options: props.baseOptions,
|
|
29
|
+
|
|
30
|
+
slots:
|
|
31
|
+
props.element.customTemplate &&
|
|
32
|
+
["item"].reduce((obj, slot) => {
|
|
33
|
+
obj[slot] = (scope: TScope) =>
|
|
34
|
+
h(resolveComponent(props.element.customTemplate?.component as string), {
|
|
35
|
+
context: scope,
|
|
36
|
+
slotName: slot,
|
|
37
|
+
});
|
|
38
|
+
return obj;
|
|
39
|
+
}, {} as Record<string, (scope: TScope) => VNode>),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const render = h(field.component as unknown as Component, field.props, field.slots);
|
|
43
|
+
|
|
44
|
+
if (field.props.rules) {
|
|
45
|
+
return props.baseOptions.visibility
|
|
46
|
+
? h(
|
|
47
|
+
ValidationField,
|
|
48
|
+
{
|
|
49
|
+
props: field.props,
|
|
50
|
+
index: props.elIndex,
|
|
51
|
+
rows: props.rows,
|
|
52
|
+
key: `${String(field.props.key)}_validation`,
|
|
53
|
+
},
|
|
54
|
+
() => render
|
|
55
|
+
)
|
|
56
|
+
: null;
|
|
57
|
+
} else {
|
|
58
|
+
return props.baseOptions.visibility ? render : null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
VcField,
|
|
3
|
+
VcGallery,
|
|
4
|
+
VcIcon,
|
|
5
|
+
VcImage,
|
|
6
|
+
VcInput,
|
|
7
|
+
VcMultivalue,
|
|
8
|
+
VcStatus,
|
|
9
|
+
VcVideo,
|
|
10
|
+
} from "./../../../../ui/components";
|
|
2
11
|
import { ITableColumns, IValidationRules } from "../../../../core/types";
|
|
3
12
|
import type { ComponentProps } from "./../../../utilities/vueUtils";
|
|
4
13
|
|
|
@@ -203,13 +212,13 @@ export interface SelectSchema extends SchemaBase {
|
|
|
203
212
|
*/
|
|
204
213
|
component: "vc-select";
|
|
205
214
|
/**
|
|
206
|
-
* Property
|
|
215
|
+
* Property which holds the `value`
|
|
207
216
|
* @default id
|
|
208
217
|
* @type {string}
|
|
209
218
|
*/
|
|
210
219
|
optionValue: string;
|
|
211
220
|
/**
|
|
212
|
-
* Property
|
|
221
|
+
* Property which holds the `label`
|
|
213
222
|
* @default title
|
|
214
223
|
* @type {string}
|
|
215
224
|
*/
|
|
@@ -253,6 +262,60 @@ export interface SelectSchema extends SchemaBase {
|
|
|
253
262
|
searchable?: boolean;
|
|
254
263
|
}
|
|
255
264
|
|
|
265
|
+
export interface MultivalueSchema extends SchemaBase {
|
|
266
|
+
/**
|
|
267
|
+
* Component type for multivalue.
|
|
268
|
+
* @type {"vc-multivalue"}
|
|
269
|
+
*/
|
|
270
|
+
component: "vc-multivalue";
|
|
271
|
+
/**
|
|
272
|
+
* Property which holds the `value`
|
|
273
|
+
* @default id
|
|
274
|
+
* @type {string}
|
|
275
|
+
*/
|
|
276
|
+
optionValue: string;
|
|
277
|
+
/**
|
|
278
|
+
* Property which holds the `label`
|
|
279
|
+
* @default title
|
|
280
|
+
* @type {string}
|
|
281
|
+
*/
|
|
282
|
+
optionLabel: string;
|
|
283
|
+
/**
|
|
284
|
+
* Array with multivalue dictionary.
|
|
285
|
+
* @description Array should be defined in the blade `scope`.
|
|
286
|
+
* @type {string}
|
|
287
|
+
*/
|
|
288
|
+
options?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Key of emmited object on select from dictionary.
|
|
291
|
+
* @default `valueId`
|
|
292
|
+
*/
|
|
293
|
+
emitValue?: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Key of emmited object on input.
|
|
296
|
+
* @default `value`
|
|
297
|
+
*/
|
|
298
|
+
emitLabel?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Whether the select is multivalue or not.
|
|
301
|
+
* @type {boolean}
|
|
302
|
+
*/
|
|
303
|
+
multivalue?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Multivalue type
|
|
306
|
+
* @default `text`
|
|
307
|
+
*/
|
|
308
|
+
variant?: ComponentProps<typeof VcMultivalue>["type"];
|
|
309
|
+
/**
|
|
310
|
+
* Name of custom template to display dictionary data in multivalue.
|
|
311
|
+
* Component should be registered globally.
|
|
312
|
+
* @type {{component: string}}
|
|
313
|
+
*/
|
|
314
|
+
customTemplate?: {
|
|
315
|
+
component: string;
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
|
|
256
319
|
export interface TextareaSchema extends SchemaBase {
|
|
257
320
|
/**
|
|
258
321
|
* Component type for textarea.
|
|
@@ -687,7 +750,8 @@ export type ControlSchema =
|
|
|
687
750
|
| FieldSchema
|
|
688
751
|
| VideoSchema
|
|
689
752
|
| ImageSchema
|
|
690
|
-
| TextareaSchema
|
|
753
|
+
| TextareaSchema
|
|
754
|
+
| MultivalueSchema;
|
|
691
755
|
|
|
692
756
|
export interface FilterBase {
|
|
693
757
|
columns: {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
VcStatus,
|
|
16
16
|
VcVideo,
|
|
17
17
|
VcTextarea,
|
|
18
|
+
VcMultivalue,
|
|
18
19
|
} from "../../../../ui/components";
|
|
19
20
|
import type { ComponentProps, ComponentEmit, ComponentSlots } from "vue-component-type-helpers";
|
|
20
21
|
|
|
@@ -52,7 +53,8 @@ export type ControlType =
|
|
|
52
53
|
| IContentField
|
|
53
54
|
| IImageField
|
|
54
55
|
| ITextareaField
|
|
55
|
-
| IVideoField
|
|
56
|
+
| IVideoField
|
|
57
|
+
| IMultivalueField;
|
|
56
58
|
|
|
57
59
|
export type ControlTypeWithSlots = Extract<
|
|
58
60
|
ControlType,
|
|
@@ -83,6 +85,12 @@ export interface IControlBaseOptions {
|
|
|
83
85
|
visibility?: ComputedRef<boolean | undefined>;
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
export type IMultivalueField = {
|
|
89
|
+
props: ComponentProps<typeof VcMultivalue> | IControlBaseProps;
|
|
90
|
+
slots?: Partial<ComponentSlots<typeof VcMultivalue>>;
|
|
91
|
+
options: IControlBaseOptions;
|
|
92
|
+
} & FieldOpts<typeof VcMultivalue>;
|
|
93
|
+
|
|
86
94
|
export type ISelectField = {
|
|
87
95
|
props: ComponentProps<typeof VcSelect> | IControlBaseProps;
|
|
88
96
|
slots?: Partial<ComponentSlots<typeof VcSelect>>;
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
</slot>
|
|
118
118
|
</div>
|
|
119
119
|
</template>
|
|
120
|
-
|
|
120
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
121
121
|
<script lang="ts" setup generic="T extends {id?: string; alias?: string, languageCode?: string, value?: string}">
|
|
122
122
|
import { unref, nextTick, ref, computed } from "vue";
|
|
123
123
|
import { vOnClickOutside } from "@vueuse/components";
|
|
@@ -174,6 +174,10 @@ const props = withDefaults(defineProps<Props<T>>(), {
|
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
const emit = defineEmits<Emits<T>>();
|
|
177
|
+
defineSlots<{
|
|
178
|
+
item: (args: { item: T }) => any;
|
|
179
|
+
error: (props: any) => any;
|
|
180
|
+
}>();
|
|
177
181
|
|
|
178
182
|
const dropdownToggleRef = ref();
|
|
179
183
|
const dropdownRef = ref();
|
|
@@ -570,7 +570,12 @@ watch(
|
|
|
570
570
|
undefined,
|
|
571
571
|
Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue]
|
|
572
572
|
);
|
|
573
|
-
|
|
573
|
+
|
|
574
|
+
if (typeof data === "object" && !Array.isArray(data) && "results" in data) {
|
|
575
|
+
defaultValue.value = data.results?.filter((x) => x[props.optionValue as keyof T] === props.modelValue);
|
|
576
|
+
} else if (Array.isArray(data)) {
|
|
577
|
+
defaultValue.value = data?.filter((x) => x[props.optionValue as keyof T] === props.modelValue);
|
|
578
|
+
}
|
|
574
579
|
} else if (props.options && Array.isArray(props.options)) {
|
|
575
580
|
defaultValue.value = props.options.filter((x) => x[props.optionValue as keyof T] === props.modelValue);
|
|
576
581
|
}
|