@vc-shell/framework 1.0.157 → 1.0.159
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/core/types/index.ts +1 -2
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +7145 -7079
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts.map +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 +4 -25
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/CustomComponent.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/CustomComponent.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/RatingField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/RatingField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SwitchField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/SwitchField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Table.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/Table.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +4 -25
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/props.d.ts +5 -26
- package/dist/shared/modules/dynamic/components/fields/props.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts +3 -17
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/getters.d.ts +1 -1
- package/dist/shared/modules/dynamic/helpers/getters.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +5 -4
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/setters.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/unrefNested.d.ts +2 -1
- package/dist/shared/modules/dynamic/helpers/unrefNested.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/unwrapInterpolation.d.ts +1 -1
- package/dist/shared/modules/dynamic/helpers/unwrapInterpolation.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +3 -4
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/models.d.ts +0 -1
- 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/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +1 -6
- package/shared/components/blade-navigation/types/index.ts +1 -1
- package/shared/modules/dynamic/components/SchemaRender.ts +21 -16
- package/shared/modules/dynamic/components/factories.ts +0 -2
- package/shared/modules/dynamic/components/fields/Button.ts +13 -9
- package/shared/modules/dynamic/components/fields/Card.ts +29 -15
- package/shared/modules/dynamic/components/fields/Checkbox.ts +14 -7
- package/shared/modules/dynamic/components/fields/ContentField.ts +10 -6
- package/shared/modules/dynamic/components/fields/DynamicProperty.ts +2 -2
- package/shared/modules/dynamic/components/fields/EditorField.ts +9 -5
- package/shared/modules/dynamic/components/fields/GalleryField.ts +16 -13
- package/shared/modules/dynamic/components/fields/ImageField.ts +14 -10
- package/shared/modules/dynamic/components/fields/InputCurrency.ts +20 -15
- package/shared/modules/dynamic/components/fields/InputField.ts +10 -6
- package/shared/modules/dynamic/components/fields/MultivalueField.ts +13 -9
- package/shared/modules/dynamic/components/fields/RatingField.ts +8 -4
- package/shared/modules/dynamic/components/fields/SelectField.ts +14 -10
- package/shared/modules/dynamic/components/fields/StatusField.ts +9 -6
- package/shared/modules/dynamic/components/fields/SwitchField.ts +9 -5
- package/shared/modules/dynamic/components/fields/Table.ts +15 -11
- package/shared/modules/dynamic/components/fields/TextareaField.ts +9 -5
- package/shared/modules/dynamic/components/fields/VideoField.ts +9 -5
- package/shared/modules/dynamic/components/fields/props.ts +5 -13
- package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +88 -85
- package/shared/modules/dynamic/helpers/getters.ts +2 -3
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +26 -20
- package/shared/modules/dynamic/helpers/setters.ts +2 -1
- package/shared/modules/dynamic/helpers/unrefNested.ts +4 -4
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +0 -3
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +1 -0
- package/shared/modules/dynamic/types/index.ts +3 -1
- package/shared/modules/dynamic/types/models.ts +0 -1
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +0 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +2 -2
- package/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue +1 -1
- package/ui/components/organisms/vc-table/vc-table.vue +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-multivalue.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-multivalue/vc-multivalue.vue.ts"],"names":[],"mappings":"
|
|
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,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;;;;;;;;;;;;;;;;;;;;;;;;WAsfM,GAAG;;;;cAvdqB,GAAG;uBACjB,GAAG,KAAK,GAAG;;;;cADG,GAAG;uBACjB,GAAG,KAAK,GAAG;;;yCAqdZ,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,KAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;oBAAzC,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;cAvdqB,GAAG;uBACjB,GAAG,KAAK,GAAG;;;;cADG,GAAG;uBACjB,GAAG,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqdZ,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;eAClD,GAAG;;;;kBAvdqB,GAAG;2BACjB,GAAG,KAAK,GAAG;;;;kBADG,GAAG;2BACjB,GAAG,KAAK,GAAG;;;;;AA7B5B,wBAwf2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-table-cell.vue.d.ts","sourceRoot":"","sources":["../../../../../../../ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;;
|
|
1
|
+
{"version":3,"file":"vc-table-cell.vue.d.ts","sourceRoot":"","sources":["../../../../../../../ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;;AA2UD,wBAMG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.159",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"whatwg-fetch": "^3.6.19"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
57
|
-
"@vc-shell/config-generator": "^1.0.
|
|
58
|
-
"@vc-shell/ts-config": "^1.0.
|
|
56
|
+
"@vc-shell/api-client-generator": "^1.0.159",
|
|
57
|
+
"@vc-shell/config-generator": "^1.0.159",
|
|
58
|
+
"@vc-shell/ts-config": "^1.0.159",
|
|
59
59
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
60
60
|
"sass": "^1.69.6",
|
|
61
61
|
"typescript": "^5.3.3",
|
package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
-
import { Ref, computed, inject, withDirectives, h, vShow
|
|
8
|
+
import { Ref, computed, inject, withDirectives, h, vShow } from "vue";
|
|
9
9
|
import { RouterView } from "vue-router";
|
|
10
10
|
import { BladeVNode, IParentCallArgs, useBladeNavigation } from "./../../../../../shared";
|
|
11
11
|
import { ErrorInterceptor } from "./../../../error-interceptor";
|
|
@@ -44,11 +44,6 @@ const render = () => {
|
|
|
44
44
|
closable: index >= 1,
|
|
45
45
|
expandable: quantity.value > 1,
|
|
46
46
|
expanded: index === quantity.value - 1,
|
|
47
|
-
"onUpdate:expanded": (value: boolean) => {
|
|
48
|
-
if (value) {
|
|
49
|
-
closeBlade(index + 1);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
47
|
"onClose:blade": () => closeBlade(index),
|
|
53
48
|
"onParent:call": (args: IParentCallArgs) => {
|
|
54
49
|
const instance = blades.value?.[index - 1]?.props?.navigation?.instance.value;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PropType,
|
|
4
|
+
ToRefs,
|
|
5
|
+
toRefs,
|
|
6
|
+
watch,
|
|
7
|
+
ExtractPropTypes,
|
|
8
|
+
h,
|
|
9
|
+
VNode,
|
|
10
|
+
defineComponent,
|
|
11
|
+
UnwrapNestedRefs,
|
|
12
|
+
reactive,
|
|
13
|
+
} from "vue";
|
|
3
14
|
import { ControlSchema } from "../types";
|
|
4
15
|
import * as _ from "lodash-es";
|
|
5
16
|
import { DetailsBladeContext } from "../factories/types";
|
|
@@ -7,6 +18,7 @@ import { nodeBuilder } from "../helpers/nodeBuilder";
|
|
|
7
18
|
import { visibilityHandler } from "../helpers/visibilityHandler";
|
|
8
19
|
import { toValue } from "@vueuse/core";
|
|
9
20
|
import { safeIn } from "../helpers/safeIn";
|
|
21
|
+
import { unrefNested } from "../helpers/unrefNested";
|
|
10
22
|
|
|
11
23
|
const schemeRenderProps = {
|
|
12
24
|
context: {
|
|
@@ -35,30 +47,22 @@ export default defineComponent({
|
|
|
35
47
|
emits: ["update:modelValue"],
|
|
36
48
|
setup(props: ExtractPropTypes<typeof schemeRenderProps>, ctx) {
|
|
37
49
|
const { currentLocale } = toRefs(props);
|
|
38
|
-
const internalFormData =
|
|
50
|
+
const internalFormData = reactive({});
|
|
39
51
|
|
|
40
52
|
watch(
|
|
41
53
|
() => props.modelValue,
|
|
42
54
|
(newVal) => {
|
|
43
|
-
if (!_.isEqual(internalFormData
|
|
44
|
-
internalFormData
|
|
55
|
+
if (!_.isEqual(internalFormData, newVal)) {
|
|
56
|
+
Object.assign(internalFormData, toRefs(newVal));
|
|
45
57
|
}
|
|
46
58
|
},
|
|
47
59
|
{ deep: true, immediate: true },
|
|
48
60
|
);
|
|
49
61
|
|
|
50
|
-
|
|
51
|
-
internalFormData
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
emitChange(newVal);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{ deep: true },
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
function emitChange(newVal: unknown) {
|
|
61
|
-
ctx.emit("update:modelValue", newVal);
|
|
62
|
+
function updateFormData(newVal: ToRefs<unknown>) {
|
|
63
|
+
if (!_.isEqual(newVal, internalFormData)) {
|
|
64
|
+
ctx.emit("update:modelValue", unrefNested(newVal));
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
return () =>
|
|
@@ -83,6 +87,7 @@ export default defineComponent({
|
|
|
83
87
|
bladeContext: props.context,
|
|
84
88
|
currentLocale: currentLocale,
|
|
85
89
|
formData: internalFormData,
|
|
90
|
+
updateFormData,
|
|
86
91
|
}),
|
|
87
92
|
];
|
|
88
93
|
}, [] as VNode[]),
|
|
@@ -50,7 +50,6 @@ export const ControlBaseProps = ({
|
|
|
50
50
|
disabled = false,
|
|
51
51
|
required = false,
|
|
52
52
|
name = undefined,
|
|
53
|
-
classNames = undefined,
|
|
54
53
|
tooltip = undefined,
|
|
55
54
|
key = undefined,
|
|
56
55
|
...rest
|
|
@@ -62,7 +61,6 @@ export const ControlBaseProps = ({
|
|
|
62
61
|
disabled,
|
|
63
62
|
required,
|
|
64
63
|
name,
|
|
65
|
-
classNames,
|
|
66
64
|
tooltip,
|
|
67
65
|
...rest,
|
|
68
66
|
});
|
|
@@ -3,6 +3,7 @@ import { Button } from "../factories";
|
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import { ButtonSchema } from "../../types";
|
|
5
5
|
import { useI18n } from "vue-i18n";
|
|
6
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
name: "ButtonEl",
|
|
@@ -11,16 +12,19 @@ export default {
|
|
|
11
12
|
const { t } = useI18n({ useScope: "global" });
|
|
12
13
|
return () => {
|
|
13
14
|
const field = Button({
|
|
14
|
-
props:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
props: Object.assign(
|
|
16
|
+
{},
|
|
17
|
+
{
|
|
18
|
+
small: props.element.small,
|
|
19
|
+
icon: props.element?.icon,
|
|
20
|
+
iconSize: props.element?.iconSize,
|
|
21
|
+
text: props.element?.text,
|
|
22
|
+
onClick: () => {
|
|
23
|
+
unref(props.bladeContext.scope)?.[props.element.method]();
|
|
24
|
+
},
|
|
22
25
|
},
|
|
23
|
-
|
|
26
|
+
unrefNested(props.baseProps),
|
|
27
|
+
),
|
|
24
28
|
slots: {
|
|
25
29
|
default: () => unref(computed(() => t(props.element.content))),
|
|
26
30
|
},
|
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ExtractPropTypes,
|
|
3
|
+
h,
|
|
4
|
+
toValue,
|
|
5
|
+
VNodeChild,
|
|
6
|
+
VNodeNormalizedChildren,
|
|
7
|
+
Component,
|
|
8
|
+
ref,
|
|
9
|
+
onMounted,
|
|
10
|
+
onUpdated,
|
|
11
|
+
} from "vue";
|
|
2
12
|
import { CardCollection } from "../factories";
|
|
3
13
|
import componentProps from "./props";
|
|
4
14
|
import { CardSchema } from "../../types";
|
|
5
15
|
import { nodeBuilder } from "../../helpers/nodeBuilder";
|
|
6
|
-
import { useMounted } from "@vueuse/core";
|
|
7
16
|
import * as _ from "lodash-es";
|
|
17
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
8
18
|
|
|
9
19
|
export default {
|
|
10
20
|
name: "CardEl",
|
|
11
21
|
props: componentProps,
|
|
12
22
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: CardSchema }) {
|
|
13
|
-
const isMounted = useMounted();
|
|
14
23
|
const hasNoComment = ref(true);
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
onMounted(() => {
|
|
26
|
+
hasNoComment.value = hasNoCommentNodes(toValue(props.fields));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
onUpdated(() => {
|
|
30
|
+
hasNoComment.value = hasNoCommentNodes(toValue(props.fields));
|
|
20
31
|
});
|
|
21
32
|
|
|
22
33
|
const hasNoCommentNodes = (components: (VNodeChild | VNodeNormalizedChildren)[]): boolean => {
|
|
@@ -43,13 +54,16 @@ export default {
|
|
|
43
54
|
|
|
44
55
|
return () => {
|
|
45
56
|
const field = CardCollection({
|
|
46
|
-
props:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
props: Object.assign(
|
|
58
|
+
{},
|
|
59
|
+
{
|
|
60
|
+
header: toValue(props.baseProps.label),
|
|
61
|
+
isCollapsable: props.element.collapsible,
|
|
62
|
+
isCollapsed: restoreCollapsed(props.element.id),
|
|
63
|
+
"onState:collapsed": (e: boolean) => handleCollapsed(props.element.id, e),
|
|
64
|
+
},
|
|
65
|
+
unrefNested(props.baseProps),
|
|
66
|
+
),
|
|
53
67
|
|
|
54
68
|
slots: {
|
|
55
69
|
default: () =>
|
|
@@ -59,7 +73,7 @@ export default {
|
|
|
59
73
|
class: {
|
|
60
74
|
"tw-flex": true,
|
|
61
75
|
"tw-flex-col": true,
|
|
62
|
-
"tw-p-4":
|
|
76
|
+
"tw-p-4": !props.element.removePadding,
|
|
63
77
|
"tw-gap-4": true,
|
|
64
78
|
},
|
|
65
79
|
},
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import { ExtractPropTypes, h, Component, unref } from "vue";
|
|
1
|
+
import { ExtractPropTypes, h, Component, unref, computed } from "vue";
|
|
2
2
|
import { Checkbox } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import ValidationField from "./ValidationField";
|
|
5
5
|
import { CheckboxSchema } from "../../types";
|
|
6
6
|
import { unwrapInterpolation } from "../../helpers/unwrapInterpolation";
|
|
7
7
|
import { toValue } from "@vueuse/core";
|
|
8
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
9
|
+
import { useI18n } from "vue-i18n";
|
|
8
10
|
|
|
9
11
|
export default {
|
|
10
12
|
name: "Checkbox",
|
|
11
13
|
props: componentProps,
|
|
12
14
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: CheckboxSchema }) {
|
|
15
|
+
const { t } = useI18n({ useScope: "global" });
|
|
13
16
|
return () => {
|
|
14
17
|
const field = Checkbox({
|
|
15
|
-
props:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
props: Object.assign(
|
|
19
|
+
{},
|
|
20
|
+
{
|
|
21
|
+
trueValue: props.element.trueValue,
|
|
22
|
+
falseValue: props.element.falseValue,
|
|
23
|
+
},
|
|
24
|
+
unrefNested(props.baseProps),
|
|
25
|
+
),
|
|
20
26
|
slots: {
|
|
21
|
-
default: () =>
|
|
27
|
+
default: () =>
|
|
28
|
+
unref(computed(() => t(unwrapInterpolation(props.element.content, toValue(props.fieldContext!))))),
|
|
22
29
|
},
|
|
23
30
|
});
|
|
24
31
|
|
|
@@ -2,6 +2,7 @@ import { ExtractPropTypes, h, Component } from "vue";
|
|
|
2
2
|
import { ContentField } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import { FieldSchema } from "../../types";
|
|
5
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
name: "ContentField",
|
|
@@ -9,12 +10,15 @@ export default {
|
|
|
9
10
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: FieldSchema }) {
|
|
10
11
|
return () => {
|
|
11
12
|
const field = ContentField({
|
|
12
|
-
props:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
props: Object.assign(
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
type: props.element.variant,
|
|
17
|
+
copyable: props.element.copyable || false,
|
|
18
|
+
orientation: props.element.orientation,
|
|
19
|
+
},
|
|
20
|
+
unrefNested(props.baseProps),
|
|
21
|
+
),
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
const render = h(field.component as Component, field.props);
|
|
@@ -46,8 +46,8 @@ export default {
|
|
|
46
46
|
watch(
|
|
47
47
|
() => props.baseProps?.modelValue,
|
|
48
48
|
(newVal) => {
|
|
49
|
-
if (!_.isEqual(newVal, internalModel.value)) {
|
|
50
|
-
internalModel.value = _.cloneDeep(newVal);
|
|
49
|
+
if (!_.isEqual(toValue(newVal), internalModel.value)) {
|
|
50
|
+
internalModel.value = _.cloneDeep(toValue(newVal));
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
{ deep: true, immediate: true },
|
|
@@ -2,6 +2,7 @@ import { h, ExtractPropTypes, Component, unref } from "vue";
|
|
|
2
2
|
import { EditorField } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import ValidationField from "./ValidationField";
|
|
5
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
name: "EditorField",
|
|
@@ -9,11 +10,14 @@ export default {
|
|
|
9
10
|
setup(props: ExtractPropTypes<typeof componentProps>) {
|
|
10
11
|
return () => {
|
|
11
12
|
const field = EditorField({
|
|
12
|
-
props:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
props: Object.assign(
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
currentLanguage: props.currentLocale,
|
|
17
|
+
assetsFolder: unref(props.formData).id || unref(props.formData).categoryId,
|
|
18
|
+
},
|
|
19
|
+
unrefNested(props.baseProps),
|
|
20
|
+
),
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
const render = h(field.component as Component, field.props);
|
|
@@ -119,19 +119,22 @@ export default {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
const field = Gallery({
|
|
122
|
-
props:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
122
|
+
props: Object.assign(
|
|
123
|
+
{},
|
|
124
|
+
{
|
|
125
|
+
loading: imageHandlers.loading,
|
|
126
|
+
images: props.baseProps.modelValue,
|
|
127
|
+
multiple: props.element.multiple,
|
|
128
|
+
variant: props.element.variant,
|
|
129
|
+
itemActions: props.element.actions,
|
|
130
|
+
onUpload: imageHandlers.upload,
|
|
131
|
+
onRemove: imageHandlers.remove,
|
|
132
|
+
onEdit: onGalleryItemEdit,
|
|
133
|
+
onSort: editImages,
|
|
134
|
+
hideAfterUpload: props.element.hideAfterUpload,
|
|
135
|
+
},
|
|
136
|
+
unrefNested(props.baseProps),
|
|
137
|
+
),
|
|
135
138
|
});
|
|
136
139
|
|
|
137
140
|
return h(field.component as Component, unrefNested(field.props));
|
|
@@ -2,6 +2,7 @@ import { ExtractPropTypes, h, Component } from "vue";
|
|
|
2
2
|
import { ImageField } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import { ImageSchema } from "../../types";
|
|
5
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
name: "ImageField",
|
|
@@ -9,16 +10,19 @@ export default {
|
|
|
9
10
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: ImageSchema }) {
|
|
10
11
|
return () => {
|
|
11
12
|
const field = ImageField({
|
|
12
|
-
props:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
props: Object.assign(
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
src: props.baseProps.modelValue,
|
|
17
|
+
aspect: props.element.aspect,
|
|
18
|
+
rounded: props.element.rounded,
|
|
19
|
+
bordered: props.element.bordered,
|
|
20
|
+
clickable: props.element.clickable,
|
|
21
|
+
size: props.element.size,
|
|
22
|
+
background: props.element.background,
|
|
23
|
+
},
|
|
24
|
+
unrefNested(props.baseProps),
|
|
25
|
+
),
|
|
22
26
|
});
|
|
23
27
|
|
|
24
28
|
const render = h(field.component as Component, field.props);
|
|
@@ -5,6 +5,8 @@ import ValidationField from "./ValidationField";
|
|
|
5
5
|
import { getModel } from "../../helpers/getters";
|
|
6
6
|
import { setModel } from "../../helpers/setters";
|
|
7
7
|
import { InputCurrencySchema } from "../../types";
|
|
8
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
9
|
+
import { toValue } from "@vueuse/core";
|
|
8
10
|
|
|
9
11
|
// TODO fix disabling when blades is disabled
|
|
10
12
|
export default {
|
|
@@ -13,22 +15,25 @@ export default {
|
|
|
13
15
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: InputCurrencySchema }) {
|
|
14
16
|
return () => {
|
|
15
17
|
const field = InputCurrency({
|
|
16
|
-
props:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
props: Object.assign(
|
|
19
|
+
{},
|
|
20
|
+
{
|
|
21
|
+
option: toValue(getModel(props.element.optionProperty, props.fieldContext ?? {})),
|
|
22
|
+
optionLabel: props.element.optionLabel,
|
|
23
|
+
optionValue: props.element.optionValue,
|
|
24
|
+
options: unref(props.bladeContext.scope)?.["currencies"],
|
|
25
|
+
"onUpdate:option": (e: string | number | Record<string, unknown>) => {
|
|
26
|
+
setModel({
|
|
27
|
+
value: e,
|
|
28
|
+
property: props.element.optionProperty,
|
|
29
|
+
context: props.fieldContext ?? {},
|
|
30
|
+
scope: props.bladeContext.scope,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
clearable: props.element.clearable || false,
|
|
29
34
|
},
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
unrefNested(props.baseProps),
|
|
36
|
+
),
|
|
32
37
|
});
|
|
33
38
|
const render = h(field.component as Component, field.props);
|
|
34
39
|
|
|
@@ -4,6 +4,7 @@ import componentProps from "./props";
|
|
|
4
4
|
import ValidationField from "./ValidationField";
|
|
5
5
|
import { InputSchema, ControlSchema } from "../../types";
|
|
6
6
|
import { nodeBuilder } from "../../helpers/nodeBuilder";
|
|
7
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
7
8
|
|
|
8
9
|
const slotsMap = {
|
|
9
10
|
append: "append",
|
|
@@ -18,12 +19,15 @@ export default {
|
|
|
18
19
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: InputSchema }) {
|
|
19
20
|
return () => {
|
|
20
21
|
const field = InputField({
|
|
21
|
-
props:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
props: Object.assign(
|
|
23
|
+
{},
|
|
24
|
+
{
|
|
25
|
+
type: props.element.variant,
|
|
26
|
+
currentLanguage: props.currentLocale,
|
|
27
|
+
clearable: props.element.clearable || false,
|
|
28
|
+
},
|
|
29
|
+
unrefNested(props.baseProps),
|
|
30
|
+
),
|
|
27
31
|
slots: Object.entries(slotsMap).reduce(
|
|
28
32
|
(acc, [key, value]) => {
|
|
29
33
|
if (props.element[key as keyof InputSchema]) {
|
|
@@ -5,6 +5,7 @@ import componentProps from "./props";
|
|
|
5
5
|
import ValidationField from "./ValidationField";
|
|
6
6
|
import { MultivalueSchema } from "../../types";
|
|
7
7
|
import { VcMultivalue } from "../../../../../ui/components";
|
|
8
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
8
9
|
|
|
9
10
|
type TScope = Parameters<ComponentSlots<typeof VcMultivalue>["item"]>["0"];
|
|
10
11
|
|
|
@@ -14,15 +15,18 @@ export default {
|
|
|
14
15
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: MultivalueSchema }) {
|
|
15
16
|
return () => {
|
|
16
17
|
const field = MultivalueField({
|
|
17
|
-
props:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
props: Object.assign(
|
|
19
|
+
{},
|
|
20
|
+
{
|
|
21
|
+
multivalue: props.element.multivalue,
|
|
22
|
+
type: props.element.variant,
|
|
23
|
+
optionValue: props.element.optionValue,
|
|
24
|
+
optionLabel: props.element.optionLabel,
|
|
25
|
+
options: props.element.options ? props.bladeContext.scope?.[props.element.options] : undefined,
|
|
26
|
+
currentLanguage: props.currentLocale,
|
|
27
|
+
},
|
|
28
|
+
unrefNested(props.baseProps),
|
|
29
|
+
),
|
|
26
30
|
|
|
27
31
|
slots:
|
|
28
32
|
props.element.customTemplate &&
|
|
@@ -2,6 +2,7 @@ import { Component, ExtractPropTypes, h } from "vue";
|
|
|
2
2
|
import { Rating } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import { RatingSchema } from "../../types";
|
|
5
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
name: "RatingEl",
|
|
@@ -9,10 +10,13 @@ export default {
|
|
|
9
10
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: RatingSchema }) {
|
|
10
11
|
return () => {
|
|
11
12
|
const field = Rating({
|
|
12
|
-
props:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
props: Object.assign(
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
variant: props.element.type,
|
|
17
|
+
},
|
|
18
|
+
unrefNested(props.baseProps),
|
|
19
|
+
),
|
|
16
20
|
});
|
|
17
21
|
|
|
18
22
|
return h(field.component as Component, field.props);
|
|
@@ -5,6 +5,7 @@ import componentProps from "./props";
|
|
|
5
5
|
import ValidationField from "./ValidationField";
|
|
6
6
|
import { SelectSchema } from "../../types";
|
|
7
7
|
import { VcSelect } from "../../../../../ui/components";
|
|
8
|
+
import { unrefNested } from "../../helpers/unrefNested";
|
|
8
9
|
|
|
9
10
|
type TScope =
|
|
10
11
|
| Parameters<ComponentSlots<typeof VcSelect>["option"]>["0"]
|
|
@@ -16,16 +17,19 @@ export default {
|
|
|
16
17
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: SelectSchema }) {
|
|
17
18
|
return () => {
|
|
18
19
|
const field = SelectField({
|
|
19
|
-
props:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
props: Object.assign(
|
|
21
|
+
{},
|
|
22
|
+
{
|
|
23
|
+
optionValue: props.element.optionValue,
|
|
24
|
+
optionLabel: props.element.optionLabel,
|
|
25
|
+
emitValue: props.element.emitValue,
|
|
26
|
+
options: props.bladeContext.scope?.[props.element.optionsMethod],
|
|
27
|
+
currentLanguage: props.currentLocale,
|
|
28
|
+
clearable: props.element.clearable || false,
|
|
29
|
+
searchable: props.element.searchable || false,
|
|
30
|
+
},
|
|
31
|
+
unrefNested(props.baseProps),
|
|
32
|
+
),
|
|
29
33
|
|
|
30
34
|
slots:
|
|
31
35
|
props.element.customTemplate &&
|