@vc-shell/framework 1.0.222 → 1.0.223
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/dist/framework.js +9890 -9899
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +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.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts +1 -1
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/composables/useToolbarReducer/index.d.ts +0 -1
- package/dist/shared/modules/dynamic/composables/useToolbarReducer/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +13 -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/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/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/components/fields/InputCurrency.ts +1 -4
- package/shared/modules/dynamic/components/fields/InputField.ts +1 -5
- package/shared/modules/dynamic/components/fields/MultivalueField.ts +1 -4
- package/shared/modules/dynamic/components/fields/SelectField.ts +1 -4
- package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +1 -1
- package/shared/modules/dynamic/composables/useToolbarReducer/index.ts +0 -14
- package/shared/modules/dynamic/factories/types/index.ts +19 -2
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +8 -0
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +16 -11
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +32 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.223",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/dompurify": "^3.0.5",
|
|
62
62
|
"@types/quill": "^2.0.14",
|
|
63
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
64
|
-
"@vc-shell/config-generator": "^1.0.
|
|
65
|
-
"@vc-shell/ts-config": "^1.0.
|
|
63
|
+
"@vc-shell/api-client-generator": "^1.0.223",
|
|
64
|
+
"@vc-shell/config-generator": "^1.0.223",
|
|
65
|
+
"@vc-shell/ts-config": "^1.0.223",
|
|
66
66
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
67
67
|
"sass": "^1.69.6",
|
|
68
68
|
"shx": "^0.3.4",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ExtractPropTypes,
|
|
1
|
+
import { Component, ExtractPropTypes, h, unref } from "vue";
|
|
2
2
|
import { InputCurrency } from "../factories";
|
|
3
3
|
import componentProps from "./props";
|
|
4
4
|
import ValidationField from "./ValidationField";
|
|
@@ -8,13 +8,11 @@ import { InputCurrencySchema } from "../../types";
|
|
|
8
8
|
import { unrefNested } from "../../helpers/unrefNested";
|
|
9
9
|
import { toValue } from "@vueuse/core";
|
|
10
10
|
import { safeIn } from "../../helpers/safeIn";
|
|
11
|
-
import { useI18n } from "vue-i18n";
|
|
12
11
|
|
|
13
12
|
export default {
|
|
14
13
|
name: "InputCurrency",
|
|
15
14
|
props: componentProps,
|
|
16
15
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: InputCurrencySchema }) {
|
|
17
|
-
const { t } = useI18n({ useScope: "global" });
|
|
18
16
|
return () => {
|
|
19
17
|
const options =
|
|
20
18
|
toValue(getModel(props.element.options, props.fieldContext ?? {})) ||
|
|
@@ -35,7 +33,6 @@ export default {
|
|
|
35
33
|
props: Object.assign(
|
|
36
34
|
{},
|
|
37
35
|
{
|
|
38
|
-
hint: props.element.hint ? toValue(computed(() => t(props.element.hint ?? ""))) : undefined,
|
|
39
36
|
option: toValue(scopedProperty ?? contextProperty),
|
|
40
37
|
optionLabel: props.element.optionLabel,
|
|
41
38
|
optionValue: props.element.optionValue,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ExtractPropTypes, h, VNode, Component
|
|
1
|
+
import { ExtractPropTypes, h, VNode, Component } from "vue";
|
|
2
2
|
import { InputField } from "../factories";
|
|
3
3
|
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
7
|
import { unrefNested } from "../../helpers/unrefNested";
|
|
8
|
-
import { useI18n } from "vue-i18n";
|
|
9
8
|
|
|
10
9
|
const slotsMap = {
|
|
11
10
|
append: "append",
|
|
@@ -18,14 +17,11 @@ export default {
|
|
|
18
17
|
name: "InputField",
|
|
19
18
|
props: componentProps,
|
|
20
19
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: InputSchema }) {
|
|
21
|
-
const { t } = useI18n({ useScope: "global" });
|
|
22
|
-
|
|
23
20
|
return () => {
|
|
24
21
|
const field = InputField({
|
|
25
22
|
props: Object.assign(
|
|
26
23
|
{},
|
|
27
24
|
{
|
|
28
|
-
hint: props.element.hint ? toValue(computed(() => t(props.element.hint ?? ""))) : undefined,
|
|
29
25
|
type: props.element.variant,
|
|
30
26
|
currentLanguage: props.currentLocale,
|
|
31
27
|
clearable: props.element.clearable || false,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ComponentSlots } from "../../../../utilities/vueUtils";
|
|
2
|
-
import { h, resolveComponent, ExtractPropTypes, Component, VNode
|
|
2
|
+
import { h, resolveComponent, ExtractPropTypes, Component, VNode } from "vue";
|
|
3
3
|
import { MultivalueField } from "../factories";
|
|
4
4
|
import componentProps from "./props";
|
|
5
5
|
import ValidationField from "./ValidationField";
|
|
6
6
|
import { MultivalueSchema } from "../../types";
|
|
7
7
|
import { VcMultivalue } from "../../../../../ui/components";
|
|
8
8
|
import { unrefNested } from "../../helpers/unrefNested";
|
|
9
|
-
import { useI18n } from "vue-i18n";
|
|
10
9
|
|
|
11
10
|
type TScope = Parameters<ComponentSlots<typeof VcMultivalue>["option"]>["0"] &
|
|
12
11
|
Parameters<ComponentSlots<typeof VcMultivalue>["selected-item"]>["0"];
|
|
@@ -15,13 +14,11 @@ export default {
|
|
|
15
14
|
name: "MultivalueField",
|
|
16
15
|
props: componentProps,
|
|
17
16
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: MultivalueSchema }) {
|
|
18
|
-
const { t } = useI18n({ useScope: "global" });
|
|
19
17
|
return () => {
|
|
20
18
|
const field = MultivalueField({
|
|
21
19
|
props: Object.assign(
|
|
22
20
|
{},
|
|
23
21
|
{
|
|
24
|
-
hint: props.element.hint ? toValue(computed(() => t(props.element.hint ?? ""))) : undefined,
|
|
25
22
|
multivalue: props.element.multivalue,
|
|
26
23
|
type: props.element.variant,
|
|
27
24
|
optionValue: props.element.optionValue,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ComponentSlots } from "../../../../utilities/vueUtils";
|
|
2
|
-
import { h, resolveComponent, ExtractPropTypes, Component, VNode
|
|
2
|
+
import { h, resolveComponent, ExtractPropTypes, Component, VNode } from "vue";
|
|
3
3
|
import { SelectField } from "../factories";
|
|
4
4
|
import componentProps from "./props";
|
|
5
5
|
import ValidationField from "./ValidationField";
|
|
6
6
|
import { SelectSchema } from "../../types";
|
|
7
7
|
import { VcSelect } from "../../../../../ui/components";
|
|
8
8
|
import { unrefNested } from "../../helpers/unrefNested";
|
|
9
|
-
import { useI18n } from "vue-i18n";
|
|
10
9
|
|
|
11
10
|
type TScope =
|
|
12
11
|
| Parameters<ComponentSlots<typeof VcSelect>["option"]>["0"]
|
|
@@ -16,13 +15,11 @@ export default {
|
|
|
16
15
|
name: "SelectField",
|
|
17
16
|
props: componentProps,
|
|
18
17
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: SelectSchema }) {
|
|
19
|
-
const { t } = useI18n({ useScope: "global" });
|
|
20
18
|
return () => {
|
|
21
19
|
const field = SelectField({
|
|
22
20
|
props: Object.assign(
|
|
23
21
|
{},
|
|
24
22
|
{
|
|
25
|
-
hint: props.element.hint ? toValue(computed(() => t(props.element.hint ?? ""))) : undefined,
|
|
26
23
|
optionValue: props.element.optionValue,
|
|
27
24
|
optionLabel: props.element.optionLabel,
|
|
28
25
|
emitValue: props.element.emitValue,
|
|
@@ -64,7 +64,7 @@ export default <Query>(args: {
|
|
|
64
64
|
data: FilterBase | undefined;
|
|
65
65
|
query: MaybeRef<Query>;
|
|
66
66
|
load: AsyncAction<Query>;
|
|
67
|
-
scope:
|
|
67
|
+
scope: Record<string, any> | undefined;
|
|
68
68
|
}): UseFilterBuilder => {
|
|
69
69
|
const _search = args.load;
|
|
70
70
|
const _data = args.data;
|
|
@@ -12,7 +12,6 @@ export const useToolbarReducer = (args: {
|
|
|
12
12
|
defaultToolbarBindings: BaseBladeScope["toolbarOverrides"];
|
|
13
13
|
customToolbarConfig: BaseBladeScope["toolbarOverrides"];
|
|
14
14
|
context: UnwrapNestedRefs<DetailsBladeContext> | UnwrapNestedRefs<ListBladeContext>;
|
|
15
|
-
scope: ComputedRef<BaseBladeScope> | undefined;
|
|
16
15
|
}): UnwrapNestedRefs<ComputedRef<(IBladeToolbar & ToolbarSchema)[] | IBladeToolbar[] | undefined>> | undefined => {
|
|
17
16
|
if (!args) return;
|
|
18
17
|
|
|
@@ -66,19 +65,6 @@ export const useToolbarReducer = (args: {
|
|
|
66
65
|
}, [] as IBladeToolbar[]);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
// TODO remove redundant code if not needed
|
|
70
|
-
// if (args.scope && toValue(toValue(args.scope)?.toolbarOverrides)) {
|
|
71
|
-
// const toolbarOverrides: BaseBladeScope["toolbarOverrides"] = toValue(toValue(args.scope)?.toolbarOverrides);
|
|
72
|
-
|
|
73
|
-
// if (Array.isArray(toolbarOverrides)) {
|
|
74
|
-
// return toolbarOverrides;
|
|
75
|
-
// } else if (typeof toolbarOverrides === "function") {
|
|
76
|
-
// return toolbarOverrides(args.context);
|
|
77
|
-
// } else if (typeof toolbarOverrides === "object") {
|
|
78
|
-
// return Object.values(toolbarOverrides);
|
|
79
|
-
// }
|
|
80
|
-
// }
|
|
81
|
-
|
|
82
68
|
return [];
|
|
83
69
|
});
|
|
84
70
|
};
|
|
@@ -6,6 +6,7 @@ import { AssetsHandler, IBladeToolbar, ICommonAsset } from "../../../../../core/
|
|
|
6
6
|
import { useBladeNavigation } from "../../../../components";
|
|
7
7
|
import { FormContext } from "vee-validate";
|
|
8
8
|
import { Breadcrumbs } from "../../../../../ui/types";
|
|
9
|
+
import { DynamicBladeForm, DynamicBladeList } from "../../pages";
|
|
9
10
|
|
|
10
11
|
export type ItemId = { id: string };
|
|
11
12
|
|
|
@@ -44,7 +45,7 @@ export interface UseDetails<Item, Scope extends DetailsBaseBladeScope = DetailsB
|
|
|
44
45
|
loading: ComputedRef<boolean>;
|
|
45
46
|
item: Ref<Item | undefined>;
|
|
46
47
|
validationState: ComputedRef<IValidationState<Item>>;
|
|
47
|
-
scope?:
|
|
48
|
+
scope?: Scope;
|
|
48
49
|
bladeTitle?: ComputedRef<string>;
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -64,7 +65,7 @@ export interface UseList<
|
|
|
64
65
|
}>;
|
|
65
66
|
load: AsyncAction<Query>;
|
|
66
67
|
remove?: AsyncAction<CustomQuery>;
|
|
67
|
-
scope?:
|
|
68
|
+
scope?: Scope;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
export interface BaseBladeScope {
|
|
@@ -150,3 +151,19 @@ export type ListBladeExposed<Scope extends ListBaseBladeScope> = BaseBladeExpose
|
|
|
150
151
|
export type DetailsBladeExposed<Scope extends DetailsBaseBladeScope> = BaseBladeExposed & {
|
|
151
152
|
readonly settings: SettingsDetails;
|
|
152
153
|
} & UnwrapNestedRefs<Scope>;
|
|
154
|
+
|
|
155
|
+
export type DetailsComposableArgs<
|
|
156
|
+
Props extends Omit<InstanceType<typeof DynamicBladeForm>["$props"], "composables"> = Record<string, any>,
|
|
157
|
+
> = {
|
|
158
|
+
props: InstanceType<typeof DynamicBladeForm>["$props"] & Props;
|
|
159
|
+
emit: InstanceType<typeof DynamicBladeForm>["$emit"];
|
|
160
|
+
mounted: Ref<boolean>;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type ListComposableArgs<
|
|
164
|
+
Props extends Omit<InstanceType<typeof DynamicBladeList>["$props"], "composables"> = Record<string, any>,
|
|
165
|
+
> = {
|
|
166
|
+
readonly props: InstanceType<typeof DynamicBladeList>["$props"] & Props;
|
|
167
|
+
readonly emit: InstanceType<typeof DynamicBladeList>["$emit"];
|
|
168
|
+
readonly mounted: Ref<boolean>;
|
|
169
|
+
};
|
|
@@ -74,6 +74,13 @@ function nodeBuilder<
|
|
|
74
74
|
? unref(unwrapInterpolation(controlSchema.label, internalContext))
|
|
75
75
|
: undefined;
|
|
76
76
|
|
|
77
|
+
const hint =
|
|
78
|
+
safeIn("hint", controlSchema) && controlSchema.hint
|
|
79
|
+
? unref(unwrapInterpolation(controlSchema.hint, internalContext)) ??
|
|
80
|
+
(bladeContext.scope && unref(unwrapInterpolation(controlSchema.hint, bladeContext.scope))) ??
|
|
81
|
+
undefined
|
|
82
|
+
: undefined;
|
|
83
|
+
|
|
77
84
|
const disabled =
|
|
78
85
|
(bladeContext.scope && safeIn("disabled", bladeContext.scope) && bladeContext.scope.disabled) ||
|
|
79
86
|
(safeIn("disabled", controlSchema) &&
|
|
@@ -109,6 +116,7 @@ function nodeBuilder<
|
|
|
109
116
|
const baseProps: IControlBaseProps = reactive({
|
|
110
117
|
key: `${parentId}`,
|
|
111
118
|
label: computed(() => (label ? t(label) : undefined)),
|
|
119
|
+
hint: computed(() => (hint ? t(hint) : undefined)),
|
|
112
120
|
disabled,
|
|
113
121
|
name,
|
|
114
122
|
rules,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
v-model="item"
|
|
38
38
|
:ui-schema="form.children"
|
|
39
39
|
:context="bladeContext"
|
|
40
|
-
:current-locale="
|
|
40
|
+
:current-locale="toValue(unreffedScope)?.multilanguage?.currentLocale"
|
|
41
41
|
></SchemaRender>
|
|
42
42
|
</VcForm>
|
|
43
43
|
</div>
|
|
@@ -158,6 +158,7 @@ const isReady = ref(false);
|
|
|
158
158
|
const activeWidgetExposed = ref<CoreBladeExposed>();
|
|
159
159
|
const isBladeEditable = computed(() => !toValue("disabled" in toValue(scope || {}) && toValue(scope || {}).disabled));
|
|
160
160
|
const settings = computed(() => props.model?.settings);
|
|
161
|
+
const unreffedScope = reactiveComputed(() => toValue(scope) ?? {});
|
|
161
162
|
|
|
162
163
|
const { moduleNotifications, markAsRead } = useNotifications(settings.value?.pushNotificationType);
|
|
163
164
|
|
|
@@ -220,24 +221,29 @@ const bladeStatus = computed(() => {
|
|
|
220
221
|
});
|
|
221
222
|
|
|
222
223
|
const bladeMultilanguage = reactiveComputed(() => {
|
|
223
|
-
if (
|
|
224
|
+
if (
|
|
225
|
+
scope &&
|
|
226
|
+
toValue(unreffedScope) &&
|
|
227
|
+
"multilanguage" in toValue(unreffedScope) &&
|
|
228
|
+
toValue(unreffedScope).multilanguage
|
|
229
|
+
) {
|
|
224
230
|
return {
|
|
225
231
|
component: () => {
|
|
226
232
|
return h(VcSelect as Component, {
|
|
227
233
|
name: "currentLocale",
|
|
228
|
-
modelValue: toValue(
|
|
229
|
-
options: toValue(
|
|
234
|
+
modelValue: toValue(unreffedScope).multilanguage?.currentLocale,
|
|
235
|
+
options: toValue(unreffedScope).multilanguage?.localesOptions,
|
|
230
236
|
optionValue: "value",
|
|
231
237
|
optionLabel: "label",
|
|
232
|
-
disabled: "disabled" in toValue(
|
|
238
|
+
disabled: "disabled" in toValue(unreffedScope) && toValue(unreffedScope).disabled,
|
|
233
239
|
required: true,
|
|
234
240
|
clearable: false,
|
|
235
241
|
"onUpdate:modelValue": (e: string) => {
|
|
236
|
-
toValue(
|
|
242
|
+
toValue(unreffedScope).multilanguage?.setLocale(e);
|
|
237
243
|
},
|
|
238
244
|
});
|
|
239
245
|
},
|
|
240
|
-
currentLocale: toValue(
|
|
246
|
+
currentLocale: toValue(unreffedScope).multilanguage?.currentLocale,
|
|
241
247
|
};
|
|
242
248
|
}
|
|
243
249
|
|
|
@@ -304,12 +310,11 @@ const toolbarComputed =
|
|
|
304
310
|
emit("close:blade");
|
|
305
311
|
}
|
|
306
312
|
},
|
|
307
|
-
disabled: computed(() => toValue(
|
|
313
|
+
disabled: computed(() => toValue(toValue(unreffedScope)?.disabled)),
|
|
308
314
|
},
|
|
309
315
|
},
|
|
310
|
-
customToolbarConfig: toValue(
|
|
316
|
+
customToolbarConfig: toValue(unreffedScope)?.toolbarOverrides,
|
|
311
317
|
context: bladeContext.value,
|
|
312
|
-
scope,
|
|
313
318
|
})) ??
|
|
314
319
|
[];
|
|
315
320
|
|
|
@@ -363,7 +368,7 @@ provide("isBladeEditable", isBladeEditable);
|
|
|
363
368
|
defineExpose({
|
|
364
369
|
title: bladeTitle ?? "",
|
|
365
370
|
updateActiveWidgetCount,
|
|
366
|
-
...toRefs(
|
|
371
|
+
...toRefs(toValue(unreffedScope) ?? {}),
|
|
367
372
|
settings: toValue(settings),
|
|
368
373
|
});
|
|
369
374
|
</script>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:class="{
|
|
11
11
|
'tw-flex tw-flex-auto': isWidgetView,
|
|
12
12
|
}"
|
|
13
|
-
:modified="
|
|
13
|
+
:modified="unreffedScope?.modified"
|
|
14
14
|
@close="$emit('close:blade')"
|
|
15
15
|
@expand="$emit('expand:blade')"
|
|
16
16
|
@collapse="$emit('collapse:blade')"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
'tw-p-4',
|
|
35
35
|
]"
|
|
36
36
|
>
|
|
37
|
-
<VcBreadcrumbs :items="scope?.breadcrumbs" />
|
|
37
|
+
<VcBreadcrumbs :items="toValue(scope?.breadcrumbs)" />
|
|
38
38
|
</div>
|
|
39
39
|
<VcTable
|
|
40
40
|
class="tw-grow tw-basis-0"
|
|
@@ -163,7 +163,6 @@ import {
|
|
|
163
163
|
toRefs,
|
|
164
164
|
provide,
|
|
165
165
|
isRef,
|
|
166
|
-
onMounted,
|
|
167
166
|
} from "vue";
|
|
168
167
|
import { useI18n } from "vue-i18n";
|
|
169
168
|
import { DynamicGridSchema, ListContentSchema, SettingsSchema } from "../types";
|
|
@@ -175,7 +174,7 @@ import { notification, useBladeNavigation, usePopup } from "../../../components"
|
|
|
175
174
|
import { ListBaseBladeScope, ListBladeContext, UseList } from "../factories/types";
|
|
176
175
|
import { IParentCallArgs } from "../../../index";
|
|
177
176
|
import * as _ from "lodash-es";
|
|
178
|
-
import { toReactive, useMounted } from "@vueuse/core";
|
|
177
|
+
import { reactiveComputed, toReactive, useMounted } from "@vueuse/core";
|
|
179
178
|
import { safeIn } from "../helpers/safeIn";
|
|
180
179
|
|
|
181
180
|
export interface Props {
|
|
@@ -289,6 +288,8 @@ if (props.isWidgetView) {
|
|
|
289
288
|
query.value.take = 5;
|
|
290
289
|
}
|
|
291
290
|
|
|
291
|
+
const unreffedScope = reactiveComputed(() => toValue(scope) ?? {});
|
|
292
|
+
|
|
292
293
|
const { tableTemplates } = useTableTemplates(tableData);
|
|
293
294
|
|
|
294
295
|
const calculateColumns = (columns: ListContentSchema["columns"]) => {
|
|
@@ -356,11 +357,11 @@ const toolbarComputed =
|
|
|
356
357
|
async clickHandler() {
|
|
357
358
|
if (
|
|
358
359
|
scope &&
|
|
359
|
-
"openDetailsBlade" in toValue(
|
|
360
|
-
toValue(
|
|
361
|
-
typeof toValue(
|
|
360
|
+
"openDetailsBlade" in toValue(unreffedScope) &&
|
|
361
|
+
toValue(unreffedScope).openDetailsBlade &&
|
|
362
|
+
typeof toValue(unreffedScope).openDetailsBlade === "function"
|
|
362
363
|
) {
|
|
363
|
-
toValue(
|
|
364
|
+
toValue(unreffedScope).openDetailsBlade?.();
|
|
364
365
|
} else throw new Error("openDetailsBlade method is not defined in scope");
|
|
365
366
|
},
|
|
366
367
|
},
|
|
@@ -377,9 +378,8 @@ const toolbarComputed =
|
|
|
377
378
|
// isVisible: computed(() => isDesktop.value),
|
|
378
379
|
},
|
|
379
380
|
},
|
|
380
|
-
customToolbarConfig: toValue(
|
|
381
|
+
customToolbarConfig: toValue(unreffedScope)?.toolbarOverrides,
|
|
381
382
|
context: bladeContext.value,
|
|
382
|
-
scope,
|
|
383
383
|
})) ??
|
|
384
384
|
[];
|
|
385
385
|
|
|
@@ -408,11 +408,11 @@ const openDetailsBlade = async () => {
|
|
|
408
408
|
if (!props.isWidgetView) {
|
|
409
409
|
if (
|
|
410
410
|
scope &&
|
|
411
|
-
"openDetailsBlade" in toValue(
|
|
412
|
-
toValue(
|
|
413
|
-
typeof toValue(
|
|
411
|
+
"openDetailsBlade" in toValue(unreffedScope) &&
|
|
412
|
+
toValue(unreffedScope).openDetailsBlade &&
|
|
413
|
+
typeof toValue(unreffedScope).openDetailsBlade === "function"
|
|
414
414
|
) {
|
|
415
|
-
await toValue(
|
|
415
|
+
await toValue(unreffedScope).openDetailsBlade?.();
|
|
416
416
|
}
|
|
417
417
|
} else {
|
|
418
418
|
emit("add");
|
|
@@ -422,8 +422,12 @@ const openDetailsBlade = async () => {
|
|
|
422
422
|
const onItemClick = (item: { [x: string]: any; id?: string }) => {
|
|
423
423
|
if (!props.isWidgetView) {
|
|
424
424
|
// TODO Add to docs
|
|
425
|
-
if (
|
|
426
|
-
|
|
425
|
+
if (
|
|
426
|
+
scope &&
|
|
427
|
+
safeIn("onListItemClick", toValue(unreffedScope)) &&
|
|
428
|
+
typeof toValue(unreffedScope).onListItemClick === "function"
|
|
429
|
+
) {
|
|
430
|
+
toValue(unreffedScope).onListItemClick?.({
|
|
427
431
|
item,
|
|
428
432
|
onOpen() {
|
|
429
433
|
selectedItemId.value = item.id;
|
|
@@ -434,10 +438,10 @@ const onItemClick = (item: { [x: string]: any; id?: string }) => {
|
|
|
434
438
|
});
|
|
435
439
|
} else if (
|
|
436
440
|
scope &&
|
|
437
|
-
safeIn("openDetailsBlade", toValue(
|
|
438
|
-
typeof toValue(
|
|
441
|
+
safeIn("openDetailsBlade", toValue(unreffedScope)) &&
|
|
442
|
+
typeof toValue(unreffedScope).openDetailsBlade === "function"
|
|
439
443
|
) {
|
|
440
|
-
toValue(
|
|
444
|
+
toValue(unreffedScope).openDetailsBlade?.({
|
|
441
445
|
param: item.id,
|
|
442
446
|
onOpen() {
|
|
443
447
|
selectedItemId.value = item.id;
|
|
@@ -511,10 +515,10 @@ const onPaginationClick = async (page: number) => {
|
|
|
511
515
|
if (query.value.take) {
|
|
512
516
|
if (
|
|
513
517
|
scope &&
|
|
514
|
-
safeIn("onPaginationClick", toValue(
|
|
515
|
-
typeof toValue(
|
|
518
|
+
safeIn("onPaginationClick", toValue(unreffedScope)) &&
|
|
519
|
+
typeof toValue(unreffedScope).onPaginationClick === "function"
|
|
516
520
|
) {
|
|
517
|
-
toValue(
|
|
521
|
+
toValue(unreffedScope).onPaginationClick?.({
|
|
518
522
|
...query.value,
|
|
519
523
|
skip: (page - 1) * query.value.take,
|
|
520
524
|
});
|
|
@@ -600,9 +604,10 @@ async function handleSelectAllItems(all: boolean) {
|
|
|
600
604
|
function disabledActionHandler(disabled: { method?: string } | boolean, item: (typeof items.value)[number]): boolean {
|
|
601
605
|
if (!disabled) return false;
|
|
602
606
|
if (typeof disabled === "boolean") return disabled;
|
|
603
|
-
else if (disabled.method && typeof toValue(
|
|
604
|
-
return toValue(
|
|
605
|
-
else if (disabled.method && toValue(
|
|
607
|
+
else if (disabled.method && typeof toValue(unreffedScope)?.[disabled.method] === "function")
|
|
608
|
+
return toValue(unreffedScope)?.[disabled.method]({ item });
|
|
609
|
+
else if (disabled.method && toValue(unreffedScope)?.[disabled.method])
|
|
610
|
+
return toValue(unreffedScope)?.[disabled.method];
|
|
606
611
|
return false;
|
|
607
612
|
}
|
|
608
613
|
|
|
@@ -627,7 +632,7 @@ function actionBuilder(item: (typeof items.value)[number]): IActionBuilderResult
|
|
|
627
632
|
if (toolbarItem) {
|
|
628
633
|
await toolbarItem.clickHandler?.();
|
|
629
634
|
} else {
|
|
630
|
-
await toValue(
|
|
635
|
+
await toValue(unreffedScope)?.[action.method]?.(itemVal);
|
|
631
636
|
}
|
|
632
637
|
selectedIds.value = [];
|
|
633
638
|
}
|
|
@@ -649,7 +654,7 @@ defineExpose({
|
|
|
649
654
|
reload,
|
|
650
655
|
title,
|
|
651
656
|
updateActiveWidgetCount,
|
|
652
|
-
...toRefs(
|
|
657
|
+
...toRefs(toValue(unreffedScope) ?? {}),
|
|
653
658
|
selectedIds,
|
|
654
659
|
settings: toValue(settings),
|
|
655
660
|
});
|