@vc-shell/framework 1.0.93 → 1.0.95
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 +14 -1
- package/core/utilities/camelize.ts +5 -0
- package/core/utilities/generateId.ts +3 -0
- package/core/utilities/index.ts +2 -0
- package/core/utilities/kebabToCamel.ts +1 -1
- package/dist/core/utilities/camelize.d.ts +2 -0
- package/dist/core/utilities/camelize.d.ts.map +1 -0
- package/dist/core/utilities/generateId.d.ts +2 -0
- package/dist/core/utilities/generateId.d.ts.map +1 -0
- package/dist/core/utilities/index.d.ts +2 -0
- package/dist/core/utilities/index.d.ts.map +1 -1
- package/dist/core/utilities/kebabToCamel.d.ts +1 -0
- package/dist/core/utilities/kebabToCamel.d.ts.map +1 -1
- package/dist/framework.mjs +9353 -9100
- package/dist/index.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/index.d.ts +1 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/index.d.ts +10 -0
- package/dist/ui/components/molecules/vc-editor/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +1 -0
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/index.d.ts +20 -0
- package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +8 -0
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts +44 -0
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +70 -0
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts +8 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +8 -0
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/index.d.ts +20 -0
- package/dist/ui/components/molecules/vc-textarea/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +2 -0
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/index.d.ts +27 -12
- package/dist/ui/components/organisms/vc-dynamic-property/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +27 -12
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/ui/types/index.d.ts +1 -0
- package/dist/ui/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/ui/components/molecules/index.ts +1 -0
- package/ui/components/molecules/vc-editor/vc-editor.vue +3 -9
- package/ui/components/molecules/vc-input/vc-input.vue +10 -0
- package/ui/components/molecules/vc-multivalue/index.ts +3 -0
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +406 -0
- package/ui/components/molecules/vc-select/vc-select.vue +4 -0
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +4 -0
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +47 -23
- package/ui/types/index.ts +1 -0
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
:error-message="errorMessage"
|
|
15
15
|
:label="computedProperty.displayName"
|
|
16
16
|
:required="computedProperty.required"
|
|
17
|
-
:placeholder="computedProperty.
|
|
17
|
+
:placeholder="computedProperty.placeholder"
|
|
18
18
|
:options="items"
|
|
19
19
|
:option-value="computedProperty.optionValue"
|
|
20
20
|
:option-label="computedProperty.optionLabel"
|
|
21
21
|
:disabled="disabled"
|
|
22
22
|
searchable
|
|
23
|
+
:multilanguage="multilanguage"
|
|
24
|
+
:current-language="currentLanguage"
|
|
23
25
|
@search="onSearch"
|
|
24
26
|
@close="onClose"
|
|
25
27
|
></VcSelect>
|
|
@@ -44,6 +46,8 @@
|
|
|
44
46
|
:required="computedProperty.required"
|
|
45
47
|
placeholder="Add value"
|
|
46
48
|
:disabled="disabled"
|
|
49
|
+
:multilanguage="multilanguage"
|
|
50
|
+
:current-language="currentLanguage"
|
|
47
51
|
></VcMultivalue>
|
|
48
52
|
</Field>
|
|
49
53
|
|
|
@@ -64,10 +68,13 @@
|
|
|
64
68
|
:required="computedProperty.required"
|
|
65
69
|
placeholder="Add value"
|
|
66
70
|
:disabled="disabled"
|
|
71
|
+
:multilanguage="multilanguage"
|
|
72
|
+
:current-language="currentLanguage"
|
|
67
73
|
:options="items"
|
|
68
|
-
option-label="alias"
|
|
74
|
+
:option-label="multilanguage ? 'value' : 'alias'"
|
|
69
75
|
option-value="id"
|
|
70
76
|
:multivalue="computedProperty.multivalue"
|
|
77
|
+
:emit-label="multilanguage ? 'value' : 'alias'"
|
|
71
78
|
@search="onSearch"
|
|
72
79
|
@close="onClose"
|
|
73
80
|
></VcMultivalue>
|
|
@@ -91,6 +98,8 @@
|
|
|
91
98
|
:required="computedProperty.required"
|
|
92
99
|
:placeholder="computedProperty.displayName || 'Add value'"
|
|
93
100
|
:disabled="disabled"
|
|
101
|
+
:multilanguage="multilanguage"
|
|
102
|
+
:current-language="currentLanguage"
|
|
94
103
|
></VcInput>
|
|
95
104
|
</Field>
|
|
96
105
|
|
|
@@ -155,7 +164,7 @@
|
|
|
155
164
|
clearable
|
|
156
165
|
type="number"
|
|
157
166
|
:required="computedProperty.required"
|
|
158
|
-
:placeholder="computedProperty.
|
|
167
|
+
:placeholder="computedProperty.placeholder"
|
|
159
168
|
:disabled="disabled"
|
|
160
169
|
></VcInput>
|
|
161
170
|
</Field>
|
|
@@ -178,7 +187,7 @@
|
|
|
178
187
|
type="number"
|
|
179
188
|
step="1"
|
|
180
189
|
:required="computedProperty.required"
|
|
181
|
-
:placeholder="computedProperty.
|
|
190
|
+
:placeholder="computedProperty.placeholder"
|
|
182
191
|
:disabled="disabled"
|
|
183
192
|
></VcInput>
|
|
184
193
|
</Field>
|
|
@@ -199,7 +208,7 @@
|
|
|
199
208
|
:label="computedProperty.displayName"
|
|
200
209
|
type="datetime-local"
|
|
201
210
|
:required="computedProperty.required"
|
|
202
|
-
:placeholder="computedProperty.
|
|
211
|
+
:placeholder="computedProperty.placeholder"
|
|
203
212
|
:disabled="disabled"
|
|
204
213
|
></VcInput>
|
|
205
214
|
</Field>
|
|
@@ -218,8 +227,10 @@
|
|
|
218
227
|
:error-message="errorMessage"
|
|
219
228
|
:label="computedProperty.displayName"
|
|
220
229
|
:required="computedProperty.required"
|
|
221
|
-
:placeholder="computedProperty.
|
|
230
|
+
:placeholder="computedProperty.placeholder"
|
|
222
231
|
:disabled="disabled"
|
|
232
|
+
:multilanguage="multilanguage"
|
|
233
|
+
:current-language="currentLanguage"
|
|
223
234
|
></VcTextarea>
|
|
224
235
|
</Field>
|
|
225
236
|
|
|
@@ -261,11 +272,13 @@ const props = withDefaults(
|
|
|
261
272
|
defineProps<{
|
|
262
273
|
property: T;
|
|
263
274
|
modelValue: any;
|
|
264
|
-
optionsGetter: (property: T, keyword?: string) => Promise<unknown[]
|
|
275
|
+
optionsGetter: (property: T, keyword?: string, locale?: string) => Promise<unknown[]> | unknown[];
|
|
265
276
|
required: boolean;
|
|
266
|
-
multivalue
|
|
277
|
+
multivalue?: boolean;
|
|
278
|
+
multilanguage?: boolean;
|
|
279
|
+
currentLanguage?: string;
|
|
267
280
|
valueType: string;
|
|
268
|
-
dictionary
|
|
281
|
+
dictionary?: boolean;
|
|
269
282
|
name: string;
|
|
270
283
|
optionsValue?: string;
|
|
271
284
|
optionsLabel?: string;
|
|
@@ -279,16 +292,19 @@ const props = withDefaults(
|
|
|
279
292
|
regex: string;
|
|
280
293
|
};
|
|
281
294
|
disabled?: boolean;
|
|
295
|
+
placeholder?: string;
|
|
282
296
|
}>(),
|
|
283
297
|
{
|
|
284
298
|
optionsValue: "id",
|
|
285
|
-
optionsLabel: "
|
|
299
|
+
optionsLabel: "value",
|
|
286
300
|
disabled: false,
|
|
287
301
|
}
|
|
288
302
|
);
|
|
289
303
|
|
|
290
304
|
const emit = defineEmits<{
|
|
291
|
-
"update:model-value": [
|
|
305
|
+
"update:model-value": [
|
|
306
|
+
data: { readonly property: T; readonly value: any; readonly dictionary?: any[]; readonly locale?: string }
|
|
307
|
+
];
|
|
292
308
|
}>();
|
|
293
309
|
|
|
294
310
|
const { locale, te, t } = useI18n({ useScope: "global" });
|
|
@@ -300,34 +316,37 @@ const computedProperty = computed(() => {
|
|
|
300
316
|
if (props.required) {
|
|
301
317
|
rules["required"] = true;
|
|
302
318
|
}
|
|
303
|
-
if (props.rules
|
|
319
|
+
if (props.rules?.min) {
|
|
304
320
|
rules["min"] = Number(props.rules.min);
|
|
305
321
|
}
|
|
306
|
-
if (props.rules
|
|
322
|
+
if (props.rules?.max) {
|
|
307
323
|
rules["max"] = Number(props.rules.max);
|
|
308
324
|
}
|
|
309
|
-
if (props.rules
|
|
325
|
+
if (props.rules?.regex) {
|
|
310
326
|
rules["regex"] = new RegExp(props.rules.regex);
|
|
311
327
|
}
|
|
312
328
|
|
|
313
|
-
const propertyDisplayName =
|
|
314
|
-
displayName.languageCode?.startsWith(locale.value as string)
|
|
315
|
-
|
|
329
|
+
const propertyDisplayName =
|
|
330
|
+
props.displayNames?.find((displayName) => displayName.languageCode?.startsWith(locale.value as string))?.name ||
|
|
331
|
+
props.name;
|
|
316
332
|
const propertyDisplayNameLocalized =
|
|
317
333
|
propertyDisplayName && te(propertyDisplayName.toUpperCase())
|
|
318
334
|
? t(propertyDisplayName.toUpperCase())
|
|
319
335
|
: propertyDisplayName;
|
|
320
336
|
|
|
337
|
+
const optionLabelField = props.multilanguage ? "value" : "alias";
|
|
338
|
+
|
|
321
339
|
return {
|
|
322
340
|
rules,
|
|
323
341
|
valueType: props.valueType,
|
|
324
342
|
dictionary: props.dictionary || false,
|
|
325
343
|
multivalue: props.multivalue || false,
|
|
326
344
|
name: props.name,
|
|
327
|
-
displayName: propertyDisplayNameLocalized
|
|
345
|
+
displayName: propertyDisplayNameLocalized, //|| setting?.displayName || setting?.defaultValue,
|
|
328
346
|
optionValue: props.optionsValue,
|
|
329
|
-
optionLabel:
|
|
347
|
+
optionLabel: optionLabelField,
|
|
330
348
|
required: props.required,
|
|
349
|
+
placeholder: props.placeholder || propertyDisplayNameLocalized,
|
|
331
350
|
};
|
|
332
351
|
});
|
|
333
352
|
|
|
@@ -336,25 +355,30 @@ const value = computed({
|
|
|
336
355
|
return props.modelValue;
|
|
337
356
|
},
|
|
338
357
|
set(newValue) {
|
|
339
|
-
emit("update:model-value", {
|
|
358
|
+
emit("update:model-value", {
|
|
359
|
+
property: props.property,
|
|
360
|
+
value: newValue,
|
|
361
|
+
dictionary: items.value,
|
|
362
|
+
locale: props.currentLanguage,
|
|
363
|
+
});
|
|
340
364
|
},
|
|
341
365
|
});
|
|
342
366
|
|
|
343
367
|
onMounted(async () => {
|
|
344
368
|
if (props.optionsGetter) {
|
|
345
|
-
items.value = await props.optionsGetter(props.property);
|
|
369
|
+
items.value = await props.optionsGetter(props.property, null, props.currentLanguage);
|
|
346
370
|
}
|
|
347
371
|
});
|
|
348
372
|
|
|
349
373
|
async function onSearch(keyword: string) {
|
|
350
374
|
if (props.optionsGetter) {
|
|
351
|
-
items.value = await props.optionsGetter(props.property, keyword);
|
|
375
|
+
items.value = await props.optionsGetter(props.property, keyword, props.currentLanguage);
|
|
352
376
|
}
|
|
353
377
|
}
|
|
354
378
|
|
|
355
379
|
async function onClose() {
|
|
356
380
|
if (props.optionsGetter) {
|
|
357
|
-
items.value = await props.optionsGetter(props.property);
|
|
381
|
+
items.value = await props.optionsGetter(props.property, null, props.currentLanguage);
|
|
358
382
|
}
|
|
359
383
|
}
|
|
360
384
|
</script>
|
package/ui/types/index.ts
CHANGED
|
@@ -38,6 +38,7 @@ declare module "@vue/runtime-core" {
|
|
|
38
38
|
VcSelect: (typeof VcShellComponents)["VcSelect"];
|
|
39
39
|
VcSlider: (typeof VcShellComponents)["VcSlider"];
|
|
40
40
|
VcTextarea: (typeof VcShellComponents)["VcTextarea"];
|
|
41
|
+
VcMultivalue: (typeof VcShellComponents)["VcMultivalue"];
|
|
41
42
|
|
|
42
43
|
// organisms
|
|
43
44
|
VcApp: (typeof VcShellComponents)["VcApp"];
|