@vc-shell/framework 1.0.118 → 1.0.120
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 +23 -5770
- package/dist/framework.mjs +11063 -10935
- package/dist/index.css +1 -1
- package/dist/shared/modules/dynamic/components/factories.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/factories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +13 -9
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +8 -4
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/props.d.ts +9 -5
- package/dist/shared/modules/dynamic/components/fields/props.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +120 -19
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/models.d.ts +1 -0
- package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts +13 -0
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts +1 -0
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/index.d.ts +1 -80
- package/dist/ui/components/atoms/vc-col/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts +3 -3
- package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-row/index.d.ts +1 -52
- package/dist/ui/components/atoms/vc-row/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts +3 -3
- package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts +3 -3
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +3 -3
- 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/molecules/vc-textarea/index.d.ts +13 -13
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +3 -3
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/index.d.ts +6 -6
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts +3 -14
- package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/components/factories.ts +2 -1
- package/shared/modules/dynamic/components/fields/EditorField.ts +3 -6
- package/shared/modules/dynamic/components/fields/Fieldset.ts +12 -5
- package/shared/modules/dynamic/components/fields/GalleryField.ts +8 -5
- package/shared/modules/dynamic/components/fields/InputField.ts +25 -3
- package/shared/modules/dynamic/components/fields/props.ts +5 -5
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +75 -34
- package/shared/modules/dynamic/types/index.ts +120 -19
- package/shared/modules/dynamic/types/models.ts +1 -0
- package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +6 -0
- package/ui/components/atoms/vc-col/index.ts +1 -10
- package/ui/components/atoms/vc-col/vc-col.vue +10 -5
- package/ui/components/atoms/vc-image/vc-image.vue +1 -1
- package/ui/components/atoms/vc-label/vc-label.vue +1 -1
- package/ui/components/atoms/vc-row/index.ts +1 -10
- package/ui/components/atoms/vc-row/vc-row.vue +8 -1
- package/ui/components/molecules/vc-field/vc-field.vue +15 -15
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +1 -1
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +24 -20
- package/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue +2 -4
- package/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue +1 -1
- package/ui/components/organisms/vc-popup/vc-popup.vue +5 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +7 -5
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +11 -16
- package/ui/components/organisms/vc-table/vc-table.vue +33 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-table-mobile-item.vue.d.ts","sourceRoot":"","sources":["../../../../../../../ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,MAAM,WAAW,KAAK;IACpB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB;AACD,MAAM,WAAW,SAAS;IAExB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;CAClC;;;;
|
|
1
|
+
{"version":3,"file":"vc-table-mobile-item.vue.d.ts","sourceRoot":"","sources":["../../../../../../../ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,MAAM,WAAW,KAAK;IACpB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB;AACD,MAAM,WAAW,SAAS;IAExB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;CAClC;;;;iCA0gB8B,oBAAoB,EAAE;;kBACrC,MAAM;;;yBA7BQ,GAAG;;WAqC1B,GAAG;;4BADM,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,KAAG,IAAI;;;;qCAR1B,oBAAoB,EAAE;;sBACrC,MAAM;;oBAON,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;yBArCoB,GAAG;;;;;;;;;;yCA4BF,oBAAoB,EAAE;;0BACrC,MAAM;;wBAON,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;eAClD,GAAG;;6BArCoB,GAAG;;;;;AA3ejC,wBAqhB2E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-table.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-table/vc-table.vue.ts"],"names":[],"mappings":"AAEA,OAAO,EAWL,QAAQ,EACT,MAAM,KAAK,CAAC;AAOb,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK/E,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;CAClC;;
|
|
1
|
+
{"version":3,"file":"vc-table.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-table/vc-table.vue.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.120",
|
|
4
4
|
"main": "./dist/framework.mjs",
|
|
5
5
|
"module": "./dist/framework.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"whatwg-fetch": "^3.6.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
60
|
-
"@vc-shell/config-generator": "^1.0.
|
|
61
|
-
"@vc-shell/ts-config": "^1.0.
|
|
59
|
+
"@vc-shell/api-client-generator": "^1.0.120",
|
|
60
|
+
"@vc-shell/config-generator": "^1.0.120",
|
|
61
|
+
"@vc-shell/ts-config": "^1.0.120",
|
|
62
62
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
63
63
|
"sass": "^1.62.1",
|
|
64
64
|
"typescript": "^5.2.2",
|
|
@@ -82,13 +82,14 @@ export const StatusField = ({ props, slots, options }: Partial<IStatusField>): I
|
|
|
82
82
|
slots,
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
export const InputField = ({ props, options }: Partial<IInputField>): IInputField => ({
|
|
85
|
+
export const InputField = ({ props, options, slots }: Partial<IInputField>): IInputField => ({
|
|
86
86
|
component: markRaw(VcInput),
|
|
87
87
|
props: {
|
|
88
88
|
...ControlBaseProps(props),
|
|
89
89
|
...props,
|
|
90
90
|
},
|
|
91
91
|
options: ControlBase(options),
|
|
92
|
+
slots,
|
|
92
93
|
});
|
|
93
94
|
|
|
94
95
|
export const ContentField = ({ props, options }: Partial<IContentField>): IContentField => ({
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { h, ExtractPropTypes } from "vue";
|
|
1
|
+
import { h, ExtractPropTypes, Component, unref } from "vue";
|
|
3
2
|
import { EditorField } from "../factories";
|
|
4
3
|
import componentProps from "./props";
|
|
5
4
|
import ValidationField from "./ValidationField";
|
|
6
|
-
import { unrefNested } from "../../helpers/unrefNested";
|
|
7
|
-
import { getModel } from "../../helpers/getters";
|
|
8
5
|
|
|
9
6
|
export default {
|
|
10
7
|
name: "EditorField",
|
|
@@ -15,12 +12,12 @@ export default {
|
|
|
15
12
|
props: {
|
|
16
13
|
...props.baseProps,
|
|
17
14
|
currentLanguage: props.currentLocale,
|
|
18
|
-
assetsFolder: props.formData.id || props.formData.categoryId,
|
|
15
|
+
assetsFolder: unref(props.formData).id || unref(props.formData).categoryId,
|
|
19
16
|
},
|
|
20
17
|
options: props.baseOptions,
|
|
21
18
|
});
|
|
22
19
|
|
|
23
|
-
const render = h(field.component as
|
|
20
|
+
const render = h(field.component as Component, field.props);
|
|
24
21
|
|
|
25
22
|
if (field.props.rules) {
|
|
26
23
|
return props.baseOptions.visibility
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ref, h, inject, nextTick, toRefs, ExtractPropTypes } from "vue";
|
|
1
|
+
import { Ref, h, inject, nextTick, toRefs, ExtractPropTypes, toValue } from "vue";
|
|
2
2
|
import componentProps from "./props";
|
|
3
3
|
import * as _ from "lodash-es";
|
|
4
4
|
import { VcButton, VcCol, VcRow } from "../../../../../ui/components";
|
|
@@ -14,23 +14,28 @@ export default {
|
|
|
14
14
|
|
|
15
15
|
return () =>
|
|
16
16
|
props.baseOptions.visibility
|
|
17
|
-
? fieldsetFields.value.map((fields, index, arr) => {
|
|
17
|
+
? toValue(fieldsetFields.value).map((fields, index, arr) => {
|
|
18
18
|
const divideByCols = Array.isArray(fields) && _.chunk(fields, props.element.columns || 1);
|
|
19
19
|
|
|
20
20
|
return h(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
class: "tw-flex tw-row tw-relative",
|
|
23
|
+
class: "tw-flex tw-row tw-relative test ",
|
|
24
24
|
key: `fieldset-${index}`,
|
|
25
25
|
},
|
|
26
26
|
[
|
|
27
|
-
h("div", { class: "tw-flex-1 tw-gap-4 tw-flex tw-flex-col" }, [
|
|
27
|
+
h("div", { class: "tw-flex-1 tw-gap-4 tw-flex tw-flex-col tw-min-w-0" }, [
|
|
28
28
|
divideByCols.map((itemsArr, colIndex) => {
|
|
29
29
|
return h(
|
|
30
30
|
VcRow,
|
|
31
31
|
{
|
|
32
32
|
key: `col-${colIndex}-${index}`,
|
|
33
|
-
class:
|
|
33
|
+
class: {
|
|
34
|
+
"tw-relative": true,
|
|
35
|
+
"tw-gap-4": true,
|
|
36
|
+
"!tw-flex-wrap": true,
|
|
37
|
+
"!tw-flex !tw-flex-row": !!props.element.aspectRatio,
|
|
38
|
+
},
|
|
34
39
|
},
|
|
35
40
|
() => [
|
|
36
41
|
...itemsArr.map((item, itemIndex) => {
|
|
@@ -38,6 +43,8 @@ export default {
|
|
|
38
43
|
VcCol,
|
|
39
44
|
{
|
|
40
45
|
key: `col-${itemIndex}-${colIndex}-${index}`,
|
|
46
|
+
size:
|
|
47
|
+
"aspectRatio" in props.element ? props.element.aspectRatio[itemIndex].toString() : "1",
|
|
41
48
|
},
|
|
42
49
|
() => {
|
|
43
50
|
if (typeof item === "object") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtractPropTypes, computed, h, markRaw, reactive, ref, toRefs, toValue, watch } from "vue";
|
|
1
|
+
import { ExtractPropTypes, computed, h, markRaw, reactive, ref, toRefs, toValue, unref, watch } from "vue";
|
|
2
2
|
import { Gallery } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import { IImage } from "../../../../../core/types";
|
|
@@ -45,14 +45,17 @@ export default {
|
|
|
45
45
|
const imageHandlers = {
|
|
46
46
|
loading,
|
|
47
47
|
async edit(image: IImage) {
|
|
48
|
-
internalModel.value[props.element.property] = await edit.value(
|
|
48
|
+
internalModel.value[props.element.property] = await edit.value(
|
|
49
|
+
unref(props.formData)[props.element.property] as IImage[],
|
|
50
|
+
image
|
|
51
|
+
);
|
|
49
52
|
await editImages(internalModel.value[props.element.property]);
|
|
50
53
|
},
|
|
51
54
|
async upload(files: FileList) {
|
|
52
55
|
internalModel.value[props.element.property] = await upload.value(
|
|
53
56
|
files,
|
|
54
|
-
props.formData[props.element.property],
|
|
55
|
-
props.formData.id || props.formData.categoryId,
|
|
57
|
+
unref(props.formData)[props.element.property] as IImage[],
|
|
58
|
+
(unref(props.formData).id as string) || (unref(props.formData).categoryId as string),
|
|
56
59
|
props.element.uploadFolder
|
|
57
60
|
);
|
|
58
61
|
|
|
@@ -75,7 +78,7 @@ export default {
|
|
|
75
78
|
)
|
|
76
79
|
) {
|
|
77
80
|
internalModel.value[props.element.property] = await remove.value(
|
|
78
|
-
props.formData[props.element.property],
|
|
81
|
+
unref(props.formData)[props.element.property] as IImage[],
|
|
79
82
|
image
|
|
80
83
|
);
|
|
81
84
|
await editImages(internalModel.value[props.element.property]);
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { ExtractPropTypes, h } from "vue";
|
|
1
|
+
import { ExtractPropTypes, h, VNode } from "vue";
|
|
2
2
|
import { InputField } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import ValidationField from "./ValidationField";
|
|
5
|
-
import { InputSchema } from "../../types";
|
|
5
|
+
import { InputSchema, ControlSchema } from "../../types";
|
|
6
|
+
import { nodeBuilder } from "../../helpers/nodeBuilder";
|
|
7
|
+
|
|
8
|
+
const slotsMap = {
|
|
9
|
+
append: "append",
|
|
10
|
+
prepend: "prepend",
|
|
11
|
+
appendInner: "append-inner",
|
|
12
|
+
prependInner: "prepend-inner",
|
|
13
|
+
};
|
|
6
14
|
|
|
7
15
|
export default {
|
|
8
16
|
name: "InputField",
|
|
@@ -17,9 +25,23 @@ export default {
|
|
|
17
25
|
clearable: props.element.clearable || false,
|
|
18
26
|
},
|
|
19
27
|
options: props.baseOptions,
|
|
28
|
+
slots: Object.entries(slotsMap).reduce((acc, [key, value]: [keyof InputSchema, keyof InputSchema]) => {
|
|
29
|
+
if (props.element[key]) {
|
|
30
|
+
acc[value] = () =>
|
|
31
|
+
nodeBuilder({
|
|
32
|
+
controlSchema: props.element[key] as ControlSchema,
|
|
33
|
+
parentId: `${(props.element[key] as ControlSchema).id}`,
|
|
34
|
+
internalContext: props.fieldContext,
|
|
35
|
+
bladeContext: props.bladeContext,
|
|
36
|
+
currentLocale: props.currentLocale,
|
|
37
|
+
formData: props.formData,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return acc;
|
|
41
|
+
}, {} as Record<keyof InputSchema, () => VNode | false>),
|
|
20
42
|
});
|
|
21
43
|
|
|
22
|
-
const render = h(field.component, field.props);
|
|
44
|
+
const render = h(field.component, field.props, field.slots);
|
|
23
45
|
|
|
24
46
|
if (field.props.rules) {
|
|
25
47
|
return props.baseOptions.visibility
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, PropType, UnwrapNestedRefs, VNodeArrayChildren } from "vue";
|
|
1
|
+
import { ComputedRef, MaybeRef, PropType, UnwrapNestedRefs, VNode, VNodeArrayChildren } from "vue";
|
|
2
2
|
import { DetailsBladeContext } from "../../factories";
|
|
3
3
|
import { IControlBaseOptions, IControlBaseProps } from "../../types/models";
|
|
4
4
|
import { ControlSchema } from "../../types";
|
|
@@ -21,12 +21,12 @@ export default {
|
|
|
21
21
|
default: () => ({} as DetailsBladeContext),
|
|
22
22
|
},
|
|
23
23
|
fields: {
|
|
24
|
-
type: Object as PropType<ComputedRef<
|
|
25
|
-
default: () => ({} as ComputedRef<
|
|
24
|
+
type: Object as PropType<ComputedRef<VNode[][]>>,
|
|
25
|
+
default: () => ({} as ComputedRef<VNode[][]>),
|
|
26
26
|
},
|
|
27
27
|
formData: {
|
|
28
|
-
type: Object,
|
|
29
|
-
default: () => ({}),
|
|
28
|
+
type: Object as PropType<MaybeRef<Record<string, unknown>>>,
|
|
29
|
+
default: () => ({} as MaybeRef<Record<string, unknown>>),
|
|
30
30
|
},
|
|
31
31
|
fieldContext: {
|
|
32
32
|
type: Object,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref, computed, toValue, h, UnwrapNestedRefs, MaybeRef, reactive,
|
|
1
|
+
import { unref, computed, toValue, h, UnwrapNestedRefs, MaybeRef, reactive, VNode } from "vue";
|
|
2
2
|
import FIELD_MAP from "../components/FIELD_MAP";
|
|
3
3
|
import { ControlSchema } from "../types";
|
|
4
4
|
import { IControlBaseProps, IControlBaseOptions } from "../types/models";
|
|
@@ -7,7 +7,6 @@ import { setModel } from "./setters";
|
|
|
7
7
|
import { unwrapInterpolation } from "./unwrapInterpolation";
|
|
8
8
|
import { DetailsBladeContext } from "../factories";
|
|
9
9
|
import * as _ from "lodash-es";
|
|
10
|
-
import { unrefNested } from "./unrefNested";
|
|
11
10
|
|
|
12
11
|
function disabledHandler(
|
|
13
12
|
disabled: { method?: string } | boolean,
|
|
@@ -20,7 +19,25 @@ function disabledHandler(
|
|
|
20
19
|
return false;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
type AllKeys<T> = T extends unknown ? keyof T : never;
|
|
23
|
+
type FilterByKnownKey<T, K extends PropertyKey> = T extends unknown ? (K extends keyof T ? T : never) : never;
|
|
24
|
+
|
|
25
|
+
function safeIn<K extends AllKeys<T>, T extends object>(key: K, obj: T): obj is FilterByKnownKey<T, K> {
|
|
26
|
+
return key in obj ?? undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function nodeBuilder<
|
|
30
|
+
Context extends Record<string, unknown>,
|
|
31
|
+
BContext extends UnwrapNestedRefs<DetailsBladeContext>,
|
|
32
|
+
FormData
|
|
33
|
+
>({
|
|
34
|
+
controlSchema,
|
|
35
|
+
parentId,
|
|
36
|
+
internalContext,
|
|
37
|
+
bladeContext,
|
|
38
|
+
currentLocale,
|
|
39
|
+
formData,
|
|
40
|
+
}: {
|
|
24
41
|
controlSchema: ControlSchema;
|
|
25
42
|
parentId: string | number;
|
|
26
43
|
internalContext: MaybeRef<Context>;
|
|
@@ -28,37 +45,57 @@ function nodeBuilder<Context, BContext extends UnwrapNestedRefs<DetailsBladeCont
|
|
|
28
45
|
currentLocale: MaybeRef<string>;
|
|
29
46
|
formData: FormData;
|
|
30
47
|
}): VNode | false {
|
|
31
|
-
const { controlSchema, parentId, internalContext, bladeContext, currentLocale, formData } = args;
|
|
32
48
|
if (!controlSchema) return false;
|
|
33
49
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
const name = controlSchema.id;
|
|
51
|
+
const rules = (safeIn("rules", controlSchema) && controlSchema.rules) || undefined;
|
|
52
|
+
const placeholder = (safeIn("placeholder", controlSchema) && controlSchema.placeholder) || undefined;
|
|
53
|
+
const required = safeIn("rules", controlSchema) && controlSchema.rules?.required;
|
|
54
|
+
const modelValue =
|
|
55
|
+
(safeIn("property", controlSchema) && getModel(controlSchema.property, toValue(internalContext))) || undefined;
|
|
56
|
+
const tooltip = (safeIn("tooltip", controlSchema) && controlSchema.tooltip) || undefined;
|
|
57
|
+
const multilanguage = safeIn("multilanguage", controlSchema) && controlSchema.multilanguage;
|
|
58
|
+
|
|
59
|
+
const label = safeIn("label", controlSchema)
|
|
60
|
+
? unref(unwrapInterpolation(controlSchema.label, toValue(internalContext)))
|
|
61
|
+
: undefined;
|
|
62
|
+
|
|
63
|
+
const disabled =
|
|
64
|
+
(safeIn("disabled", bladeContext.scope) && bladeContext.scope.disabled) ||
|
|
65
|
+
disabledHandler("disabled" in controlSchema && controlSchema.disabled, bladeContext);
|
|
66
|
+
|
|
67
|
+
const onUpdateModelValue = (e: unknown) => {
|
|
68
|
+
if (safeIn("property", controlSchema)) {
|
|
46
69
|
setModel({ property: controlSchema.property, value: e, context: toValue(internalContext) });
|
|
47
70
|
|
|
48
71
|
if (_.has(controlSchema, "update.method")) {
|
|
49
|
-
controlSchema.update.method
|
|
50
|
-
typeof bladeContext.scope[
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
const updateMethod = safeIn("update", controlSchema) && controlSchema.update.method;
|
|
73
|
+
if (safeIn(updateMethod, bladeContext.scope) && typeof bladeContext.scope[updateMethod] === "function") {
|
|
74
|
+
bladeContext.scope[updateMethod](e, controlSchema.property, toValue(internalContext));
|
|
75
|
+
}
|
|
53
76
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const baseProps: IControlBaseProps = reactive({
|
|
81
|
+
key: `${parentId}`,
|
|
82
|
+
label,
|
|
83
|
+
disabled,
|
|
84
|
+
name,
|
|
85
|
+
rules,
|
|
86
|
+
placeholder,
|
|
87
|
+
required,
|
|
88
|
+
modelValue,
|
|
89
|
+
"onUpdate:modelValue": onUpdateModelValue,
|
|
90
|
+
tooltip,
|
|
91
|
+
multilanguage,
|
|
57
92
|
});
|
|
58
93
|
|
|
59
|
-
const baseOptions = reactive
|
|
94
|
+
const baseOptions: IControlBaseOptions = reactive({
|
|
60
95
|
visibility: computed(() =>
|
|
61
|
-
|
|
96
|
+
safeIn("visibility", controlSchema) && controlSchema.visibility?.method
|
|
97
|
+
? bladeContext.scope[controlSchema.visibility?.method]
|
|
98
|
+
: true
|
|
62
99
|
),
|
|
63
100
|
});
|
|
64
101
|
|
|
@@ -66,15 +103,18 @@ function nodeBuilder<Context, BContext extends UnwrapNestedRefs<DetailsBladeCont
|
|
|
66
103
|
|
|
67
104
|
const fieldsHandler = computed(() => {
|
|
68
105
|
if (!("fields" in controlSchema)) return null;
|
|
69
|
-
const fieldsModel = getModel(controlSchema.property, toValue(internalContext));
|
|
70
106
|
|
|
71
|
-
|
|
72
|
-
|
|
107
|
+
const fieldsModel = safeIn("property", controlSchema) && getModel(controlSchema.property, toValue(internalContext));
|
|
108
|
+
|
|
109
|
+
const model = toValue(fieldsModel);
|
|
110
|
+
|
|
111
|
+
if (model && Array.isArray(model)) {
|
|
112
|
+
return model.map((modelItem: { [x: string]: unknown; id: string }) =>
|
|
73
113
|
controlSchema.fields.map((fieldItem) =>
|
|
74
114
|
nodeBuilder({
|
|
75
115
|
controlSchema: fieldItem,
|
|
76
|
-
parentId: `fieldset-${fieldItem.id}-${
|
|
77
|
-
internalContext:
|
|
116
|
+
parentId: `fieldset-${fieldItem.id}-${modelItem.id}`,
|
|
117
|
+
internalContext: modelItem,
|
|
78
118
|
bladeContext,
|
|
79
119
|
currentLocale,
|
|
80
120
|
formData,
|
|
@@ -82,12 +122,13 @@ function nodeBuilder<Context, BContext extends UnwrapNestedRefs<DetailsBladeCont
|
|
|
82
122
|
)
|
|
83
123
|
);
|
|
84
124
|
}
|
|
125
|
+
|
|
85
126
|
return [
|
|
86
127
|
controlSchema.fields.map((field) =>
|
|
87
128
|
nodeBuilder({
|
|
88
129
|
controlSchema: field,
|
|
89
130
|
parentId: `fieldset-${parentId}-${field.id}`,
|
|
90
|
-
internalContext,
|
|
131
|
+
internalContext: reactive(unref(internalContext)),
|
|
91
132
|
bladeContext,
|
|
92
133
|
currentLocale,
|
|
93
134
|
formData,
|
|
@@ -101,13 +142,13 @@ function nodeBuilder<Context, BContext extends UnwrapNestedRefs<DetailsBladeCont
|
|
|
101
142
|
baseOptions,
|
|
102
143
|
bladeContext,
|
|
103
144
|
element: controlSchema,
|
|
104
|
-
currentLocale,
|
|
145
|
+
currentLocale: unref(currentLocale),
|
|
105
146
|
fields: fieldsHandler,
|
|
106
147
|
formData,
|
|
107
|
-
fieldContext: internalContext,
|
|
148
|
+
fieldContext: reactive(unref(internalContext)),
|
|
108
149
|
};
|
|
109
150
|
|
|
110
|
-
return h(component,
|
|
151
|
+
return h(component, elProps);
|
|
111
152
|
}
|
|
112
153
|
|
|
113
154
|
export { nodeBuilder };
|
|
@@ -7,6 +7,8 @@ export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
7
7
|
export type Composable<T> = T[keyof T];
|
|
8
8
|
|
|
9
9
|
export type DynamicSchema = DynamicGridSchema | DynamicDetailsSchema;
|
|
10
|
+
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
11
|
+
type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
10
12
|
|
|
11
13
|
export interface DynamicGridSchema {
|
|
12
14
|
/**
|
|
@@ -82,7 +84,8 @@ export interface SettingsBase {
|
|
|
82
84
|
pushNotificationType?: string | string[];
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
export interface ListContentSchema
|
|
87
|
+
export interface ListContentSchema {
|
|
88
|
+
id: string;
|
|
86
89
|
component: "vc-table";
|
|
87
90
|
filter?: FilterSchema;
|
|
88
91
|
multiselect?: boolean;
|
|
@@ -107,7 +110,8 @@ export interface ListContentSchema extends SchemaBase {
|
|
|
107
110
|
};
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
export interface FormContentSchema
|
|
113
|
+
export interface FormContentSchema {
|
|
114
|
+
id: string;
|
|
111
115
|
component: "vc-form";
|
|
112
116
|
children: ControlSchema[];
|
|
113
117
|
}
|
|
@@ -116,19 +120,58 @@ export interface GridTemplateOverride {
|
|
|
116
120
|
component?: string;
|
|
117
121
|
}
|
|
118
122
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Base component schema interface.
|
|
125
|
+
*/
|
|
122
126
|
export interface SchemaBase {
|
|
127
|
+
/** Unique identifier for component.
|
|
128
|
+
* @type {string}
|
|
129
|
+
*/
|
|
123
130
|
id: string;
|
|
131
|
+
/** Control label.
|
|
132
|
+
* @type {string}
|
|
133
|
+
*/
|
|
124
134
|
label?: string;
|
|
125
|
-
|
|
135
|
+
/** Property name to populate the component with data.
|
|
136
|
+
* @type {string}
|
|
137
|
+
*/
|
|
138
|
+
property: string;
|
|
139
|
+
/** Vee-validate and custom validation rules for the schema.
|
|
140
|
+
*
|
|
141
|
+
* Available rules - {@link IValidationRules}
|
|
142
|
+
* @type {IValidationRules}
|
|
143
|
+
*/
|
|
126
144
|
rules?: IValidationRules;
|
|
145
|
+
/** Placeholder text for component.
|
|
146
|
+
* @type {string}
|
|
147
|
+
*/
|
|
127
148
|
placeholder?: string;
|
|
149
|
+
/** Disabled state for component.
|
|
150
|
+
* @description Method should be defined in the blade `scope`.
|
|
151
|
+
* Method should return boolean value.
|
|
152
|
+
* @type {{ method: string }}
|
|
153
|
+
*/
|
|
128
154
|
disabled?: { method: string };
|
|
155
|
+
/** Tooltip text for component.
|
|
156
|
+
* @type {string}
|
|
157
|
+
*/
|
|
129
158
|
tooltip?: string;
|
|
130
|
-
|
|
159
|
+
/** Visibility options for component.
|
|
160
|
+
* @description Method should be defined in the blade `scope`.
|
|
161
|
+
* Method should return boolean value.
|
|
162
|
+
* @type {{ method: string }}
|
|
163
|
+
*/
|
|
164
|
+
visibility?: {
|
|
165
|
+
method: string;
|
|
166
|
+
};
|
|
167
|
+
/** Flag to indicate if the component supports multilanguage.
|
|
168
|
+
* @type {boolean}
|
|
169
|
+
*/
|
|
131
170
|
multilanguage?: boolean;
|
|
171
|
+
/** Additional method that is called when the modelValue of the component changes
|
|
172
|
+
* @description Method should be defined in the blade `scope`.
|
|
173
|
+
* @type {{ method: string }}
|
|
174
|
+
*/
|
|
132
175
|
update?: { method: string };
|
|
133
176
|
}
|
|
134
177
|
|
|
@@ -149,9 +192,14 @@ export interface InputSchema extends SchemaBase {
|
|
|
149
192
|
component: "vc-input";
|
|
150
193
|
variant?: ComponentProps<typeof VcInput>["type"];
|
|
151
194
|
clearable?: boolean;
|
|
195
|
+
prepend?: ControlSchema;
|
|
196
|
+
append?: ControlSchema;
|
|
197
|
+
appendInner?: ControlSchema;
|
|
198
|
+
prependInner?: ControlSchema;
|
|
152
199
|
}
|
|
153
200
|
|
|
154
|
-
export interface VideoSchema
|
|
201
|
+
export interface VideoSchema
|
|
202
|
+
extends Pick<SchemaBase, "id" | "property" | "label" | "visibility" | "tooltip" | "update"> {
|
|
155
203
|
component: "vc-video";
|
|
156
204
|
size?: ComponentProps<typeof VcVideo>["size"];
|
|
157
205
|
rounded?: boolean;
|
|
@@ -159,13 +207,13 @@ export interface VideoSchema extends SchemaBase {
|
|
|
159
207
|
clickable?: boolean;
|
|
160
208
|
}
|
|
161
209
|
|
|
162
|
-
export interface FieldSchema extends SchemaBase {
|
|
210
|
+
export interface FieldSchema extends Pick<SchemaBase, "id" | "property" | "label" | "visibility" | "tooltip"> {
|
|
163
211
|
component: "vc-field";
|
|
164
212
|
variant?: ComponentProps<typeof VcField>["type"];
|
|
165
213
|
copyable?: boolean;
|
|
166
214
|
}
|
|
167
215
|
|
|
168
|
-
export interface ImageSchema extends SchemaBase {
|
|
216
|
+
export interface ImageSchema extends Pick<SchemaBase, "id" | "property" | "visibility" | "update"> {
|
|
169
217
|
component: "vc-image";
|
|
170
218
|
aspect?: ComponentProps<typeof VcImage>["aspect"];
|
|
171
219
|
size?: ComponentProps<typeof VcImage>["size"];
|
|
@@ -175,7 +223,7 @@ export interface ImageSchema extends SchemaBase {
|
|
|
175
223
|
clickable?: boolean;
|
|
176
224
|
}
|
|
177
225
|
|
|
178
|
-
export interface StatusSchema extends SchemaBase {
|
|
226
|
+
export interface StatusSchema extends Pick<SchemaBase, "id" | "visibility"> {
|
|
179
227
|
component: "vc-status";
|
|
180
228
|
outline?: boolean;
|
|
181
229
|
extend?: boolean;
|
|
@@ -189,7 +237,7 @@ export interface StatusSchema extends SchemaBase {
|
|
|
189
237
|
};
|
|
190
238
|
}
|
|
191
239
|
|
|
192
|
-
export interface InputCurrencySchema extends SchemaBase {
|
|
240
|
+
export interface InputCurrencySchema extends Omit<SchemaBase, "multilanguage"> {
|
|
193
241
|
component: "vc-input-currency";
|
|
194
242
|
optionProperty: string;
|
|
195
243
|
optionValue?: string;
|
|
@@ -201,52 +249,105 @@ export interface EditorSchema extends SchemaBase {
|
|
|
201
249
|
component: "vc-editor";
|
|
202
250
|
}
|
|
203
251
|
|
|
204
|
-
export interface DynamicPropertiesSchema extends SchemaBase {
|
|
252
|
+
export interface DynamicPropertiesSchema extends Omit<SchemaBase, "rules" | "placeholder"> {
|
|
205
253
|
component: "vc-dynamic-properties";
|
|
206
254
|
exclude?: string[];
|
|
207
255
|
include?: string[];
|
|
208
256
|
}
|
|
209
257
|
|
|
210
|
-
export interface GallerySchema extends SchemaBase {
|
|
258
|
+
export interface GallerySchema extends Omit<SchemaBase, "placeholder" | "multilanguage"> {
|
|
211
259
|
component: "vc-gallery";
|
|
212
260
|
uploadFolder: string;
|
|
213
261
|
}
|
|
214
262
|
|
|
215
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Interface for a card schema.
|
|
265
|
+
* @interface
|
|
266
|
+
*/
|
|
267
|
+
export interface CardSchema extends RequiredBy<Pick<SchemaBase, "id" | "label" | "visibility">, "label"> {
|
|
268
|
+
/**
|
|
269
|
+
* Component type for the card.
|
|
270
|
+
* @type {"vc-card"}
|
|
271
|
+
*/
|
|
216
272
|
component: "vc-card";
|
|
273
|
+
/**
|
|
274
|
+
* Array of control schemas for the fields in the card.
|
|
275
|
+
* @type {ControlSchema[]}
|
|
276
|
+
*/
|
|
217
277
|
fields: ControlSchema[];
|
|
278
|
+
/**
|
|
279
|
+
* Button schema for the action button in the card, along with the action method to use.
|
|
280
|
+
* @type {ButtonSchema & { method: string }}
|
|
281
|
+
*/
|
|
218
282
|
action?: ButtonSchema & { method: string };
|
|
283
|
+
/**
|
|
284
|
+
* Whether the card is collapsible or not.
|
|
285
|
+
* @type {boolean}
|
|
286
|
+
*/
|
|
219
287
|
collapsible?: boolean;
|
|
220
288
|
}
|
|
221
289
|
|
|
222
|
-
export interface WidgetsSchema extends SchemaBase {
|
|
290
|
+
export interface WidgetsSchema extends Pick<SchemaBase, "id"> {
|
|
223
291
|
component: "vc-widgets";
|
|
224
292
|
children: string[];
|
|
225
293
|
}
|
|
226
294
|
|
|
227
|
-
export interface CheckboxSchema extends SchemaBase {
|
|
295
|
+
export interface CheckboxSchema extends Omit<SchemaBase, "multilanguage"> {
|
|
228
296
|
component: "vc-checkbox";
|
|
229
297
|
content: string;
|
|
230
298
|
trueValue?: boolean;
|
|
231
299
|
falseValue?: boolean;
|
|
232
300
|
}
|
|
233
301
|
|
|
234
|
-
export interface FieldsetSchema extends SchemaBase {
|
|
302
|
+
export interface FieldsetSchema extends PartialBy<Pick<SchemaBase, "id" | "property" | "visibility">, "property"> {
|
|
235
303
|
component: "vc-fieldset";
|
|
236
304
|
columns?: number;
|
|
305
|
+
aspectRatio?: number[];
|
|
237
306
|
fields: Exclude<ControlSchema[], FieldsetSchema>;
|
|
238
307
|
remove?: {
|
|
239
308
|
method: string;
|
|
240
309
|
};
|
|
241
310
|
}
|
|
242
311
|
|
|
243
|
-
|
|
312
|
+
/**
|
|
313
|
+
* Button schema interface.
|
|
314
|
+
*/
|
|
315
|
+
export interface ButtonSchema extends Pick<SchemaBase, "id" | "disabled" | "visibility"> {
|
|
316
|
+
/**
|
|
317
|
+
* Component type.
|
|
318
|
+
* @type {"vc-button"}
|
|
319
|
+
*/
|
|
244
320
|
component: "vc-button";
|
|
321
|
+
/**
|
|
322
|
+
* Button inner text.
|
|
323
|
+
* @type {string}
|
|
324
|
+
*/
|
|
245
325
|
content: string;
|
|
326
|
+
/**
|
|
327
|
+
* Small sized button.
|
|
328
|
+
* @type {boolean}
|
|
329
|
+
*/
|
|
246
330
|
small?: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Button icon.
|
|
333
|
+
* @type {string}
|
|
334
|
+
*/
|
|
247
335
|
icon?: string;
|
|
336
|
+
/**
|
|
337
|
+
* Size of the button icon.
|
|
338
|
+
* @type {ComponentProps<typeof VcIcon>["size"]}
|
|
339
|
+
*/
|
|
248
340
|
iconSize?: ComponentProps<typeof VcIcon>["size"];
|
|
341
|
+
/**
|
|
342
|
+
* Button as text without overlay.
|
|
343
|
+
* @type {boolean}
|
|
344
|
+
*/
|
|
249
345
|
text?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Method to be called when the button is clicked.
|
|
348
|
+
* @description Method should be defined in the blade `scope`.
|
|
349
|
+
* @type {string}
|
|
350
|
+
*/
|
|
250
351
|
method?: string;
|
|
251
352
|
}
|
|
252
353
|
|