@vc-shell/framework 1.0.131 → 1.0.132
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 -0
- package/core/composables/useAssets/index.ts +0 -1
- package/core/composables/useAsync/index.ts +1 -1
- package/core/composables/useNotifications/index.ts +0 -1
- package/core/plugins/modularity/index.ts +1 -3
- package/core/plugins/moment/humanize.ts +8 -7
- package/core/plugins/validation/rules.ts +1 -1
- package/core/types/index.ts +1 -1
- package/dist/core/composables/useAssets/index.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/plugins/moment/humanize.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +1957 -1945
- package/dist/index.css +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +2 -2
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/components/popup-handler/types/index.d.ts +3 -3
- package/dist/shared/components/popup-handler/types/index.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts +3 -3
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/ValidationField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/props.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/props.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts +1 -1
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +2 -2
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/index.d.ts +1 -1
- package/dist/shared/modules/dynamic/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-label/index.d.ts +4 -4
- package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts +4 -4
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +12 -12
- package/dist/ui/components/molecules/vc-input-currency/index.d.ts +12 -12
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +9 -9
- package/dist/ui/components/molecules/vc-pagination/index.d.ts +6 -6
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +37 -37
- package/dist/ui/components/molecules/vc-slider/index.d.ts +12 -12
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +67 -3
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- 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-table/vc-table.vue.d.ts +18 -18
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +1 -1
- package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +1 -1
- package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +2 -15
- package/shared/components/popup-handler/types/index.ts +4 -7
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +0 -2
- package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +1 -1
- package/shared/modules/dynamic/components/SchemaRender.ts +5 -5
- package/shared/modules/dynamic/components/fields/Checkbox.ts +1 -1
- package/shared/modules/dynamic/components/fields/DynamicProperty.ts +12 -11
- package/shared/modules/dynamic/components/fields/EditorField.ts +1 -1
- package/shared/modules/dynamic/components/fields/Fieldset.ts +4 -4
- package/shared/modules/dynamic/components/fields/InputField.ts +18 -15
- package/shared/modules/dynamic/components/fields/MultivalueField.ts +12 -9
- package/shared/modules/dynamic/components/fields/SelectField.ts +12 -9
- package/shared/modules/dynamic/components/fields/TextareaField.ts +1 -1
- package/shared/modules/dynamic/components/fields/ValidationField.ts +6 -5
- package/shared/modules/dynamic/components/fields/props.ts +7 -7
- package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +4 -4
- package/shared/modules/dynamic/factories/base/useListFactory.ts +1 -1
- package/shared/modules/dynamic/factories/types/index.ts +5 -2
- package/shared/modules/dynamic/helpers/getters.ts +1 -1
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +7 -8
- package/shared/modules/dynamic/helpers/override.ts +1 -1
- package/shared/modules/dynamic/helpers/toolbarReducer.ts +1 -1
- package/shared/modules/dynamic/index.ts +33 -37
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +1 -1
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +0 -1
- package/shared/modules/dynamic/types/models.ts +1 -1
- package/shared/pages/LoginPage/components/login/Login.vue +1 -1
- package/ui/components/atoms/vc-label/vc-label.vue +2 -2
- package/ui/components/atoms/vc-progress/vc-progress.vue +8 -4
- package/ui/components/molecules/vc-editor/vc-editor.vue +0 -1
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +1 -1
- package/ui/components/molecules/vc-input/vc-input.vue +5 -3
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +0 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +2 -2
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +1 -1
- package/ui/components/molecules/vc-select/vc-select.vue +15 -15
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -1
- package/ui/components/organisms/vc-app/vc-app.vue +6 -3
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +1 -1
- package/ui/components/organisms/vc-blade/vc-blade.vue +1 -1
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +3 -3
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +1 -1
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +2 -2
- 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-filter/vc-table-filter.vue +1 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +3 -3
|
@@ -30,14 +30,17 @@ export default {
|
|
|
30
30
|
|
|
31
31
|
slots:
|
|
32
32
|
props.element.customTemplate &&
|
|
33
|
-
["selected-item", "option"].reduce(
|
|
34
|
-
obj
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
["selected-item", "option"].reduce(
|
|
34
|
+
(obj, slot) => {
|
|
35
|
+
obj[slot] = (scope: TScope) =>
|
|
36
|
+
h(resolveComponent(props.element.customTemplate?.component as string), {
|
|
37
|
+
context: scope,
|
|
38
|
+
slotName: slot,
|
|
39
|
+
});
|
|
40
|
+
return obj;
|
|
41
|
+
},
|
|
42
|
+
{} as Record<string, (scope: TScope) => VNode>,
|
|
43
|
+
),
|
|
41
44
|
});
|
|
42
45
|
|
|
43
46
|
const render = h(field.component as unknown as Component, field.props, field.slots);
|
|
@@ -52,7 +55,7 @@ export default {
|
|
|
52
55
|
rows: props.rows,
|
|
53
56
|
key: `${String(field.props.key)}_validation`,
|
|
54
57
|
},
|
|
55
|
-
() => render
|
|
58
|
+
() => render,
|
|
56
59
|
)
|
|
57
60
|
: null;
|
|
58
61
|
} else {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { computed, h, unref, useSlots, defineComponent, ComputedRef } from "vue";
|
|
2
|
-
import { unrefNested } from "../../helpers/unrefNested";
|
|
3
2
|
import { Field } from "vee-validate";
|
|
4
3
|
import { reactify } from "@vueuse/core";
|
|
5
4
|
|
|
@@ -17,7 +16,7 @@ export default defineComponent({
|
|
|
17
16
|
const fieldKey = computed(() =>
|
|
18
17
|
unref(props.props)?.multilanguage
|
|
19
18
|
? `${String(props.props?.key)}_${unref(props.props?.currentLanguage)}`
|
|
20
|
-
: String(props.props?.key)
|
|
19
|
+
: String(props.props?.key),
|
|
21
20
|
);
|
|
22
21
|
|
|
23
22
|
const fieldNameLang = reactify((name: string) => {
|
|
@@ -33,7 +32,9 @@ export default defineComponent({
|
|
|
33
32
|
label: props.props?.label,
|
|
34
33
|
key: fieldKey.value,
|
|
35
34
|
name: fieldNameLang(
|
|
36
|
-
(props.rows ?? 1) > 1 && (props.index ?? 0) >= 0
|
|
35
|
+
(props.rows ?? 1) > 1 && (props.index ?? 0) >= 0
|
|
36
|
+
? props.props?.name + "_" + props.index
|
|
37
|
+
: props.props?.name,
|
|
37
38
|
).value,
|
|
38
39
|
},
|
|
39
40
|
{
|
|
@@ -44,10 +45,10 @@ export default defineComponent({
|
|
|
44
45
|
error: !!errors.length,
|
|
45
46
|
errorMessage,
|
|
46
47
|
key: fieldKey.value + "_control",
|
|
47
|
-
})
|
|
48
|
+
}),
|
|
48
49
|
);
|
|
49
50
|
},
|
|
50
|
-
}
|
|
51
|
+
},
|
|
51
52
|
);
|
|
52
53
|
},
|
|
53
54
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, MaybeRef, PropType, UnwrapNestedRefs, VNode
|
|
1
|
+
import { ComputedRef, MaybeRef, PropType, UnwrapNestedRefs, VNode } from "vue";
|
|
2
2
|
import { DetailsBladeContext } from "../../factories";
|
|
3
3
|
import { IControlBaseOptions, IControlBaseProps } from "../../types/models";
|
|
4
4
|
import { ControlSchema } from "../../types";
|
|
@@ -6,27 +6,27 @@ import { ControlSchema } from "../../types";
|
|
|
6
6
|
export default {
|
|
7
7
|
baseProps: {
|
|
8
8
|
type: Object as PropType<UnwrapNestedRefs<IControlBaseProps>>,
|
|
9
|
-
default: () => ({} as IControlBaseProps
|
|
9
|
+
default: () => ({}) as IControlBaseProps,
|
|
10
10
|
},
|
|
11
11
|
baseOptions: {
|
|
12
12
|
type: Object as PropType<IControlBaseOptions>,
|
|
13
|
-
default: () => ({} as IControlBaseOptions
|
|
13
|
+
default: () => ({}) as IControlBaseOptions,
|
|
14
14
|
},
|
|
15
15
|
element: {
|
|
16
16
|
type: Object as PropType<ControlSchema>,
|
|
17
|
-
default: () => ({} as ControlSchema
|
|
17
|
+
default: () => ({}) as ControlSchema,
|
|
18
18
|
},
|
|
19
19
|
bladeContext: {
|
|
20
20
|
type: Object as PropType<UnwrapNestedRefs<DetailsBladeContext>>,
|
|
21
|
-
default: () => ({} as DetailsBladeContext
|
|
21
|
+
default: () => ({}) as DetailsBladeContext,
|
|
22
22
|
},
|
|
23
23
|
fields: {
|
|
24
24
|
type: Object as PropType<ComputedRef<VNode[][]>>,
|
|
25
|
-
default: () => ({} as ComputedRef<VNode[][]
|
|
25
|
+
default: () => ({}) as ComputedRef<VNode[][]>,
|
|
26
26
|
},
|
|
27
27
|
formData: {
|
|
28
28
|
type: Object as PropType<MaybeRef<Record<string, unknown>>>,
|
|
29
|
-
default: () => ({} as 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 { computed, ref, watch } from "vue";
|
|
1
|
+
import { ComputedRef, MaybeRef, computed, ref, watch } from "vue";
|
|
2
2
|
import * as _ from "lodash-es";
|
|
3
3
|
import { useForm, useIsFormDirty, useIsFormValid } from "vee-validate";
|
|
4
4
|
import { useAsync, useLoading } from "../../../../../core/composables";
|
|
@@ -6,7 +6,7 @@ import type { ItemId, IValidationState, UseDetails } from "../types";
|
|
|
6
6
|
import { createUnrefFn } from "@vueuse/core";
|
|
7
7
|
|
|
8
8
|
export interface UseDetailsFactoryParams<Item> {
|
|
9
|
-
load: (args?: ItemId) => Promise<Item>;
|
|
9
|
+
load: (args?: ItemId) => Promise<Item | undefined>;
|
|
10
10
|
saveChanges: (details: Item) => Promise<Item | void>;
|
|
11
11
|
remove?: (args: ItemId) => Promise<void>;
|
|
12
12
|
}
|
|
@@ -25,7 +25,7 @@ export const useDetailsFactory = <Item>(factoryParams: UseDetailsFactoryParams<I
|
|
|
25
25
|
|
|
26
26
|
const { loading: itemLoading, action: load } = useAsync<ItemId>(async (args?: ItemId) => {
|
|
27
27
|
item.value = await factoryParams.load(args);
|
|
28
|
-
resetModified(item.value);
|
|
28
|
+
item.value && resetModified(item.value);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const { loading: manageLoading, action: saveChanges } = useAsync<Item>(async (item) => {
|
|
@@ -72,7 +72,7 @@ export const useDetailsFactory = <Item>(factoryParams: UseDetailsFactoryParams<I
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
itemTemp.value = _.cloneDeep(data);
|
|
75
|
-
});
|
|
75
|
+
}) as (data: MaybeRef<Item | undefined> | ComputedRef<Item | undefined>, updateInitial?: MaybeRef<boolean>) => void;
|
|
76
76
|
|
|
77
77
|
return {
|
|
78
78
|
load,
|
|
@@ -26,7 +26,7 @@ export interface IUseListOptions extends Pick<IQuery, "sort"> {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const useListFactory = <Items extends Record<string, any>[], Query extends IQuery>(
|
|
29
|
-
factoryParams: UseListFactoryParams<Items, Query
|
|
29
|
+
factoryParams: UseListFactoryParams<Items, Query>,
|
|
30
30
|
) => {
|
|
31
31
|
return function useList(options?: IUseListOptions): UseList<Items, Query> {
|
|
32
32
|
const pageSize = options?.pageSize || 20;
|
|
@@ -26,7 +26,10 @@ export interface IValidationState<Item> {
|
|
|
26
26
|
setFieldValue: FormContext["setFieldValue"];
|
|
27
27
|
setValues: FormContext["setValues"];
|
|
28
28
|
setErrors: FormContext["setErrors"];
|
|
29
|
-
resetModified: (
|
|
29
|
+
resetModified: (
|
|
30
|
+
data: MaybeRef<Item | undefined> | ComputedRef<Item | undefined>,
|
|
31
|
+
updateInitial?: MaybeRef<boolean>,
|
|
32
|
+
) => void;
|
|
30
33
|
validate: FormContext["validate"];
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -85,7 +88,7 @@ export interface DetailsBaseBladeScope extends BaseBladeScope {
|
|
|
85
88
|
property: Record<string, any>,
|
|
86
89
|
keyword?: string,
|
|
87
90
|
locale?: string,
|
|
88
|
-
) => Promise<Record<string, any>[]>;
|
|
91
|
+
) => Promise<Record<string, any>[] | undefined>;
|
|
89
92
|
getPropertyValue: (property: Record<string, any>, locale: string) => any;
|
|
90
93
|
setPropertyValue: (data: {
|
|
91
94
|
property: Record<string, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { reactify } from "@vueuse/core";
|
|
2
|
-
import { toValue } from "vue";
|
|
3
2
|
import * as _ from "lodash-es";
|
|
4
3
|
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
5
|
export const getModel = reactify((property: string, context: Record<string, any>) => {
|
|
6
6
|
if (property && context) {
|
|
7
7
|
return _.get(context, property);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref, computed, toValue, h, UnwrapNestedRefs, MaybeRef, reactive, VNode
|
|
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";
|
|
@@ -6,12 +6,11 @@ import { getModel } from "./getters";
|
|
|
6
6
|
import { setModel } from "./setters";
|
|
7
7
|
import { unwrapInterpolation } from "./unwrapInterpolation";
|
|
8
8
|
import { DetailsBladeContext } from "../factories";
|
|
9
|
-
import * as _ from "lodash-es";
|
|
10
9
|
import { safeIn } from "./safeIn";
|
|
11
10
|
|
|
12
11
|
function disabledHandler(
|
|
13
12
|
disabled: { method?: string } | boolean,
|
|
14
|
-
context: UnwrapNestedRefs<DetailsBladeContext
|
|
13
|
+
context: UnwrapNestedRefs<DetailsBladeContext>,
|
|
15
14
|
): boolean {
|
|
16
15
|
if (!disabled) return false;
|
|
17
16
|
if (typeof disabled === "boolean") return disabled;
|
|
@@ -24,7 +23,7 @@ function disabledHandler(
|
|
|
24
23
|
function nodeBuilder<
|
|
25
24
|
Context extends Record<string, unknown>,
|
|
26
25
|
BContext extends UnwrapNestedRefs<DetailsBladeContext>,
|
|
27
|
-
FormData
|
|
26
|
+
FormData,
|
|
28
27
|
>({
|
|
29
28
|
controlSchema,
|
|
30
29
|
parentId,
|
|
@@ -116,7 +115,7 @@ function nodeBuilder<
|
|
|
116
115
|
visibility: computed(() =>
|
|
117
116
|
safeIn("visibility", controlSchema) && controlSchema.visibility?.method
|
|
118
117
|
? bladeContext.scope?.[controlSchema.visibility?.method]
|
|
119
|
-
: true
|
|
118
|
+
: true,
|
|
120
119
|
),
|
|
121
120
|
});
|
|
122
121
|
|
|
@@ -142,8 +141,8 @@ function nodeBuilder<
|
|
|
142
141
|
bladeContext,
|
|
143
142
|
currentLocale,
|
|
144
143
|
formData,
|
|
145
|
-
})
|
|
146
|
-
)
|
|
144
|
+
}),
|
|
145
|
+
),
|
|
147
146
|
);
|
|
148
147
|
}
|
|
149
148
|
|
|
@@ -156,7 +155,7 @@ function nodeBuilder<
|
|
|
156
155
|
bladeContext,
|
|
157
156
|
currentLocale,
|
|
158
157
|
formData,
|
|
159
|
-
})
|
|
158
|
+
}),
|
|
160
159
|
),
|
|
161
160
|
];
|
|
162
161
|
});
|
|
@@ -29,7 +29,7 @@ const upsertHelper = (overrides: OverridesSchema, schemaCopy: { [key: string]: D
|
|
|
29
29
|
if (Array.isArray(valueByPath) && valueByPath.length && typeof args.value === "object" && "index" in args) {
|
|
30
30
|
const findIndex = _.findIndex(valueByPath, { id: args.value.id });
|
|
31
31
|
|
|
32
|
-
const spliced = valueByPath /* @ts-
|
|
32
|
+
const spliced = valueByPath /* @ts-expect-error - toSpliced is not parsed correctly by ts */
|
|
33
33
|
.toSpliced(findIndex >= 0 ? findIndex : args.index, findIndex >= 0 ? 1 : 0, args.value);
|
|
34
34
|
_.set(clonedSchema, args.path, spliced);
|
|
35
35
|
} else {
|
|
@@ -8,7 +8,6 @@ import { reactiveComputed } from "@vueuse/core";
|
|
|
8
8
|
import { kebabToPascal } from "../../../core/utilities";
|
|
9
9
|
import { BladeInstanceConstructor } from "../../index";
|
|
10
10
|
import { createAppModule } from "../../../core/plugins";
|
|
11
|
-
import { BladeMenu } from "../../../core/types";
|
|
12
11
|
import { ComponentProps } from "./../../utilities/vueUtils";
|
|
13
12
|
|
|
14
13
|
interface Registered {
|
|
@@ -70,6 +69,7 @@ const register = (
|
|
|
70
69
|
|
|
71
70
|
const BladeInstanceConstructor = defineComponent({
|
|
72
71
|
...bladeComponent,
|
|
72
|
+
name: bladeName,
|
|
73
73
|
isWorkspace: "isWorkspace" in json.settings && json.settings.isWorkspace,
|
|
74
74
|
menuItem: ("menuItem" in json.settings && json.settings.menuItem) ?? undefined,
|
|
75
75
|
setup: (props: ComponentProps<typeof bladeComponent>, ctx) =>
|
|
@@ -104,7 +104,7 @@ const register = (
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
const handleError = (errorKey: string, schema: { [key: string]: DynamicSchema }, text?: string) => {
|
|
107
|
-
console.error(
|
|
107
|
+
return console.error(
|
|
108
108
|
`Module initialization aborted. '${errorKey}' key not found in files: ${Object.keys(schema).join(
|
|
109
109
|
", ",
|
|
110
110
|
)}. '${errorKey}' key ${text}`,
|
|
@@ -130,42 +130,38 @@ export const createDynamicAppModule = (args: {
|
|
|
130
130
|
"must be included in one of this files to initialize module workspace blade",
|
|
131
131
|
);
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
schemaCopy = handleOverrides(args.overrides, schemaCopy);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
install(app: App, options: { router: any }) {
|
|
142
|
-
const bladePages = { ...pages };
|
|
143
|
-
const appModuleContent = {
|
|
144
|
-
locales: args?.locales,
|
|
145
|
-
notificationTemplates: args?.notificationTemplates,
|
|
146
|
-
moduleComponents: args?.moduleComponents,
|
|
147
|
-
};
|
|
148
|
-
Object.entries(schemaCopy).forEach(([, JsonSchema], index) => {
|
|
149
|
-
const blade = register(
|
|
150
|
-
{
|
|
151
|
-
app,
|
|
152
|
-
component: bladePages[
|
|
153
|
-
JsonSchema.settings.component as keyof typeof bladePages
|
|
154
|
-
] as BladeInstanceConstructor,
|
|
155
|
-
composables: { ...args.composables },
|
|
156
|
-
json: JsonSchema,
|
|
157
|
-
options,
|
|
158
|
-
},
|
|
159
|
-
index === 0 ? appModuleContent : undefined,
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
if (!blade) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
};
|
|
133
|
+
let schemaCopy = _.cloneDeep({ ...args.schema });
|
|
134
|
+
|
|
135
|
+
if (args.overrides) {
|
|
136
|
+
schemaCopy = handleOverrides(args.overrides, schemaCopy);
|
|
168
137
|
}
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
install(app: App, options: { router: any }) {
|
|
141
|
+
const bladePages = { ...pages };
|
|
142
|
+
const appModuleContent = {
|
|
143
|
+
locales: args?.locales,
|
|
144
|
+
notificationTemplates: args?.notificationTemplates,
|
|
145
|
+
moduleComponents: args?.moduleComponents,
|
|
146
|
+
};
|
|
147
|
+
Object.entries(schemaCopy).forEach(([, JsonSchema], index) => {
|
|
148
|
+
const blade = register(
|
|
149
|
+
{
|
|
150
|
+
app,
|
|
151
|
+
component: bladePages[JsonSchema.settings.component as keyof typeof bladePages] as BladeInstanceConstructor,
|
|
152
|
+
composables: { ...args.composables },
|
|
153
|
+
json: JsonSchema,
|
|
154
|
+
options,
|
|
155
|
+
},
|
|
156
|
+
index === 0 ? appModuleContent : undefined,
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
if (!blade) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
};
|
|
169
165
|
};
|
|
170
166
|
|
|
171
167
|
export * from "./pages";
|
|
@@ -278,7 +278,7 @@ onBeforeMount(async () => {
|
|
|
278
278
|
if (props.composables) await init();
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
onBeforeRouteLeave(async (to
|
|
281
|
+
onBeforeRouteLeave(async (to) => {
|
|
282
282
|
if (
|
|
283
283
|
currentBladeNavigationData.value?.fullPath &&
|
|
284
284
|
!to.path.includes(currentBladeNavigationData.value?.fullPath) &&
|
|
@@ -205,7 +205,7 @@ let useLogin;
|
|
|
205
205
|
const signInResult = ref({ succeeded: true }) as Ref<SignInResult & { status?: number; error?: any }>;
|
|
206
206
|
const requestPassResult = ref<RequestPasswordResult>({ succeeded: true });
|
|
207
207
|
const forgotPasswordRequestSent = ref(false);
|
|
208
|
-
const { signIn, loading, externalSignIn, getExternalLoginProviders
|
|
208
|
+
const { signIn, loading, externalSignIn, getExternalLoginProviders } = useUser();
|
|
209
209
|
const isLogin = ref(true);
|
|
210
210
|
const isValid = useIsFormValid();
|
|
211
211
|
const isDirty = useIsFormDirty();
|
|
@@ -36,18 +36,22 @@ withDefaults(defineProps<Props>(), {
|
|
|
36
36
|
|
|
37
37
|
@keyframes change {
|
|
38
38
|
from {
|
|
39
|
-
background-position:
|
|
39
|
+
background-position:
|
|
40
|
+
0 0,
|
|
41
|
+
left;
|
|
40
42
|
}
|
|
41
43
|
to {
|
|
42
|
-
background-position:
|
|
44
|
+
background-position:
|
|
45
|
+
30px 0,
|
|
46
|
+
left;
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
.vc-progress {
|
|
47
51
|
&.striped {
|
|
48
52
|
.vc-progress__value {
|
|
49
|
-
background:
|
|
50
|
-
|
|
53
|
+
background:
|
|
54
|
+
linear-gradient(45deg, transparent 50%, #acd2f2 50%, #acd2f2 75%, transparent 75%) left/30px 30px repeat-x,
|
|
51
55
|
#e1f0fe;
|
|
52
56
|
animation: change 1s linear infinite;
|
|
53
57
|
}
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
<script lang="ts" setup>
|
|
53
53
|
import { QuillEditor } from "@vueup/vue-quill";
|
|
54
54
|
import "@vueup/vue-quill/dist/vue-quill.snow.css";
|
|
55
|
-
import { useUser } from "./../../../../core/composables";
|
|
56
55
|
import { ref, unref, watch, onMounted } from "vue";
|
|
57
56
|
import ImageUploader from "quill-image-uploader";
|
|
58
57
|
import { VcLabel, VcHint } from "./../../";
|
|
@@ -90,7 +90,7 @@ const isDragging = ref(false);
|
|
|
90
90
|
// Prepare field-level validation
|
|
91
91
|
const { errorMessage, handleChange, validate } = useField(
|
|
92
92
|
`${props.name === "Gallery" ? instance?.uid : props.name}`,
|
|
93
|
-
internalRules
|
|
93
|
+
internalRules,
|
|
94
94
|
);
|
|
95
95
|
|
|
96
96
|
const uploader = ref();
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
</template>
|
|
171
171
|
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
172
172
|
<script lang="ts" setup>
|
|
173
|
-
import { computed, ref, unref, watch
|
|
173
|
+
import { computed, ref, unref, watch } from "vue";
|
|
174
174
|
import { VcLabel, VcIcon, VcHint } from "./../../";
|
|
175
175
|
import moment from "moment";
|
|
176
176
|
|
|
@@ -358,7 +358,7 @@ watch(
|
|
|
358
358
|
temp.value = mutatedModel.value;
|
|
359
359
|
}
|
|
360
360
|
},
|
|
361
|
-
{ immediate: true }
|
|
361
|
+
{ immediate: true },
|
|
362
362
|
);
|
|
363
363
|
|
|
364
364
|
// Handle input event and emit changes
|
|
@@ -444,7 +444,9 @@ function onReset() {
|
|
|
444
444
|
&__input {
|
|
445
445
|
&:-webkit-autofill,
|
|
446
446
|
&:-webkit-autofill:focus {
|
|
447
|
-
transition:
|
|
447
|
+
transition:
|
|
448
|
+
background-color 600000s 0s,
|
|
449
|
+
color 600000s 0s;
|
|
448
450
|
}
|
|
449
451
|
&[data-autocompleted] {
|
|
450
452
|
background-color: transparent !important;
|
|
@@ -175,7 +175,7 @@ const { inputRef, setOptions, numberValue } = useCurrencyInput(
|
|
|
175
175
|
currencyDisplay: CurrencyDisplay.hidden,
|
|
176
176
|
hideGroupingSeparatorOnFocus: false,
|
|
177
177
|
},
|
|
178
|
-
false
|
|
178
|
+
false,
|
|
179
179
|
);
|
|
180
180
|
|
|
181
181
|
// Change currency settings
|
|
@@ -189,7 +189,7 @@ watch(
|
|
|
189
189
|
currencyDisplay: CurrencyDisplay.hidden,
|
|
190
190
|
hideGroupingSeparatorOnFocus: false,
|
|
191
191
|
});
|
|
192
|
-
}
|
|
192
|
+
},
|
|
193
193
|
);
|
|
194
194
|
|
|
195
195
|
watch(numberValue, (value) => {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
</div>
|
|
119
119
|
</template>
|
|
120
120
|
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
121
|
-
<script lang="ts" setup generic="T extends {id?: string; alias?: string
|
|
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";
|
|
124
124
|
import { useFloating, UseFloatingReturn, offset, flip, shift, autoUpdate, MiddlewareState } from "@floating-ui/vue";
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
</template>
|
|
258
258
|
|
|
259
259
|
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
260
|
-
<script lang="ts" setup generic="T, P extends { results?: T[]
|
|
260
|
+
<script lang="ts" setup generic="T, P extends { results?: T[]; totalCount?: number }">
|
|
261
261
|
import { ref, computed, watch, nextTick, Ref, toRefs } from "vue";
|
|
262
262
|
import { vOnClickOutside } from "@vueuse/components";
|
|
263
263
|
import * as _ from "lodash-es";
|
|
@@ -278,8 +278,8 @@ type FloatingInstanceType = UseFloatingReturn & {
|
|
|
278
278
|
};
|
|
279
279
|
};
|
|
280
280
|
};
|
|
281
|
-
|
|
282
|
-
type Option = T & P["results"]
|
|
281
|
+
type ArrayElementType<T> = T extends Array<infer U> ? U : never;
|
|
282
|
+
type Option = T & ArrayElementType<Required<P>["results"]>;
|
|
283
283
|
|
|
284
284
|
defineSlots<{
|
|
285
285
|
/**
|
|
@@ -484,11 +484,7 @@ const emit = defineEmits<{
|
|
|
484
484
|
* Emitted when the component needs to change the model; Is also used by v-model
|
|
485
485
|
*/
|
|
486
486
|
|
|
487
|
-
"update:modelValue": [
|
|
488
|
-
inputValue: MaybeArray<
|
|
489
|
-
string | Option | (T & P["results"][number] & object)[keyof T | keyof P["results"][number]]
|
|
490
|
-
> | null,
|
|
491
|
-
];
|
|
487
|
+
"update:modelValue": [inputValue: MaybeArray<string | Option> | null];
|
|
492
488
|
/**
|
|
493
489
|
* Emitted when user wants to filter a value
|
|
494
490
|
*/
|
|
@@ -572,12 +568,16 @@ watch(
|
|
|
572
568
|
);
|
|
573
569
|
|
|
574
570
|
if (typeof data === "object" && !Array.isArray(data) && "results" in data) {
|
|
575
|
-
defaultValue.value = data.results?.filter(
|
|
571
|
+
defaultValue.value = data.results?.filter(
|
|
572
|
+
(x) => x[props.optionValue as keyof T] === props.modelValue,
|
|
573
|
+
) as Option[];
|
|
576
574
|
} else if (Array.isArray(data)) {
|
|
577
575
|
defaultValue.value = data?.filter((x) => x[props.optionValue as keyof T] === props.modelValue);
|
|
578
576
|
}
|
|
579
577
|
} else if (props.options && Array.isArray(props.options)) {
|
|
580
|
-
defaultValue.value = props.options.filter(
|
|
578
|
+
defaultValue.value = props.options.filter(
|
|
579
|
+
(x) => x[props.optionValue as keyof T] === props.modelValue,
|
|
580
|
+
) as Option[];
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
}
|
|
@@ -592,13 +592,13 @@ watch(
|
|
|
592
592
|
try {
|
|
593
593
|
listLoading.value = true;
|
|
594
594
|
const data = await props.options();
|
|
595
|
-
optionsList.value = data.results;
|
|
595
|
+
optionsList.value = data.results as Option[];
|
|
596
596
|
totalItems.value = data.totalCount;
|
|
597
597
|
} finally {
|
|
598
598
|
listLoading.value = false;
|
|
599
599
|
}
|
|
600
600
|
} else if (props.options && Array.isArray(props.options)) {
|
|
601
|
-
optionsList.value = props.options;
|
|
601
|
+
optionsList.value = props.options as Option[];
|
|
602
602
|
}
|
|
603
603
|
},
|
|
604
604
|
{ immediate: true },
|
|
@@ -626,7 +626,7 @@ async function onLoadMore() {
|
|
|
626
626
|
try {
|
|
627
627
|
listLoading.value = true;
|
|
628
628
|
const data = await props.options(filterString.value, optionsList.value.length);
|
|
629
|
-
optionsList.value.push(...data.results);
|
|
629
|
+
optionsList.value.push(...(data.results as Option[]));
|
|
630
630
|
} finally {
|
|
631
631
|
listLoading.value = false;
|
|
632
632
|
}
|
|
@@ -820,7 +820,7 @@ function toggleOption(opt: Option) {
|
|
|
820
820
|
return;
|
|
821
821
|
}
|
|
822
822
|
|
|
823
|
-
const optValue = getOptionValue.value(opt);
|
|
823
|
+
const optValue = getOptionValue.value(opt) as Option[];
|
|
824
824
|
|
|
825
825
|
if (props.multiple !== true) {
|
|
826
826
|
if (innerValue.value.length === 0 || _.isEqual(getOptionValue.value(innerValue.value[0]), optValue) !== true) {
|
|
@@ -832,7 +832,7 @@ function toggleOption(opt: Option) {
|
|
|
832
832
|
|
|
833
833
|
if (innerValue.value.length === 0) {
|
|
834
834
|
const val = props.emitValue === true ? optValue : opt;
|
|
835
|
-
emit("update:modelValue", props.multiple === true ? [val] : val);
|
|
835
|
+
emit("update:modelValue", props.multiple === true ? ([val] as Option[]) : (val as Option));
|
|
836
836
|
return;
|
|
837
837
|
}
|
|
838
838
|
|