@vc-shell/framework 1.0.126 → 1.0.128
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/composables/useUser/index.ts +62 -47
- package/core/plugins/signalR/index.ts +2 -2
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/framework.mjs +7585 -7563
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/index.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 +4 -1
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/dist/utils/isInDemoMode.d.ts +2 -0
- package/dist/utils/isInDemoMode.d.ts.map +1 -0
- package/package.json +4 -4
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +1 -1
- package/shared/modules/dynamic/index.ts +9 -7
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +31 -10
- package/shared/modules/dynamic/types/index.ts +6 -1
- package/ui/components/organisms/vc-table/vc-table.vue +10 -2
|
@@ -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,EAET,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,WAA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MAAM;;;oBAQJ,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;2CAn+D2B,GAAG,KAAK,GAAG;;;kBACG,aAAa;cAAO,GAAG;wBAJxD,GAAG,KAAK,GAAG;wBACX;YAAE,UAAU,EAAE,MAAM,IAAI,CAAA;SAAE,KAAK,GAAG;;;cACZ,GAAG;0BAGvB,GAAG,KAAK,GAAG;uBACd,GAAG,KAAK,GAAG;wBACV,GAAG,KAAK,GAAG;;;mBAmEQ,MAAM;mBAAa,MAAM;;;;;;;;;;;;;;;;;;qBA43DjD,aAAa,EAAE;;;;;;;2BA53DS,MAAM;2BAAa,MAAM;;;;8CA83DzB,oBAAoB,EAAE;;;;;;;;;;;;;;sBAqB7C,MAAM;;;wBAQJ,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;eAClD,GAAG;;+CAn+D2B,GAAG,KAAK,GAAG;;;sBACG,aAAa;kBAAO,GAAG;4BAJxD,GAAG,KAAK,GAAG;4BACX;gBAAE,UAAU,EAAE,MAAM,IAAI,CAAA;aAAE,KAAK,GAAG;;;kBACZ,GAAG;8BAGvB,GAAG,KAAK,GAAG;2BACd,GAAG,KAAK,GAAG;4BACV,GAAG,KAAK,GAAG;;;uBAmEQ,MAAM;uBAAa,MAAM;;;;;AAjF9D,wBAk/D2E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isInDemoMode.d.ts","sourceRoot":"","sources":["../../utils/isInDemoMode.ts"],"names":[],"mappings":"AACA,QAAA,MAAe,aAAa,kGAAW,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.128",
|
|
4
4
|
"main": "./dist/framework.mjs",
|
|
5
5
|
"module": "./dist/framework.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"whatwg-fetch": "^3.6.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
61
|
-
"@vc-shell/config-generator": "^1.0.
|
|
62
|
-
"@vc-shell/ts-config": "^1.0.
|
|
60
|
+
"@vc-shell/api-client-generator": "^1.0.128",
|
|
61
|
+
"@vc-shell/config-generator": "^1.0.128",
|
|
62
|
+
"@vc-shell/ts-config": "^1.0.128",
|
|
63
63
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
64
64
|
"sass": "^1.62.1",
|
|
65
65
|
"typescript": "^5.2.2",
|
|
@@ -32,7 +32,7 @@ export function useAppSwitcher(): IUseAppSwitcher {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function switchApp(app: AppDescriptor) {
|
|
35
|
-
if (
|
|
35
|
+
if (hasAccess(app.permission)) {
|
|
36
36
|
if (app.relativeUrl) {
|
|
37
37
|
window.location.href = window.location.origin + app.relativeUrl;
|
|
38
38
|
}
|
|
@@ -70,17 +70,19 @@ const register = (
|
|
|
70
70
|
|
|
71
71
|
const BladeInstanceConstructor = defineComponent({
|
|
72
72
|
...bladeComponent,
|
|
73
|
-
name: bladeName,
|
|
74
73
|
isWorkspace: "isWorkspace" in json.settings && json.settings.isWorkspace,
|
|
75
74
|
setup: (props: ComponentProps<typeof bladeComponent>, ctx) =>
|
|
76
75
|
(bladeComponent?.setup &&
|
|
77
76
|
bladeComponent.setup(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
Object.assign(
|
|
78
|
+
{},
|
|
79
|
+
reactiveComputed(() => props),
|
|
80
|
+
{
|
|
81
|
+
model: json,
|
|
82
|
+
composables: args.composables,
|
|
83
|
+
} as any
|
|
84
|
+
),
|
|
85
|
+
ctx
|
|
84
86
|
)) ??
|
|
85
87
|
{},
|
|
86
88
|
});
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
class="tw-grow tw-basis-0"
|
|
28
28
|
:loading="loading"
|
|
29
29
|
:expanded="expanded"
|
|
30
|
-
:columns="(
|
|
30
|
+
:columns="(table?.columns as ITableColumns[])"
|
|
31
31
|
:state-key="stateKey"
|
|
32
32
|
:items="(itemsProxy as Record<string, any>[])"
|
|
33
33
|
:multiselect="isWidgetView ? false : tableData?.multiselect"
|
|
@@ -156,6 +156,7 @@ import { ListBaseBladeScope, ListBladeContext, UseList } from "../factories/type
|
|
|
156
156
|
import { IParentCallArgs } from "../../../index";
|
|
157
157
|
import * as _ from "lodash-es";
|
|
158
158
|
import { useMounted } from "@vueuse/core";
|
|
159
|
+
import { safeIn } from "../helpers/safeIn";
|
|
159
160
|
|
|
160
161
|
export interface Props {
|
|
161
162
|
expanded?: boolean;
|
|
@@ -205,6 +206,13 @@ const itemsProxy = ref<Record<string, any>[]>();
|
|
|
205
206
|
const modified = ref(false);
|
|
206
207
|
|
|
207
208
|
const { moduleNotifications, markAsRead } = useNotifications(settings.value?.pushNotificationType);
|
|
209
|
+
const { load, remove, items, loading, pagination, query, scope } = props.composables?.[
|
|
210
|
+
props.model?.settings?.composable ?? ""
|
|
211
|
+
]({
|
|
212
|
+
emit,
|
|
213
|
+
props,
|
|
214
|
+
mounted: useMounted(),
|
|
215
|
+
}) as UseList<Record<string, any>[], Record<string, any>, ListBaseBladeScope>;
|
|
208
216
|
|
|
209
217
|
watch(
|
|
210
218
|
moduleNotifications,
|
|
@@ -230,9 +238,30 @@ const stateKey = computed(() => {
|
|
|
230
238
|
|
|
231
239
|
throw new Error('Table id is not defined. Please provide "id" property in table schema');
|
|
232
240
|
});
|
|
241
|
+
|
|
242
|
+
const calculateColumns = (columns: ListContentSchema["columns"]) => {
|
|
243
|
+
const result = columns?.map((column) => {
|
|
244
|
+
if (typeof column.visible !== "boolean" && column.visible?.method) {
|
|
245
|
+
const result =
|
|
246
|
+
typeof scope?.value[column.visible?.method] === "function"
|
|
247
|
+
? scope?.value[column.visible?.method]()
|
|
248
|
+
: scope?.value[column.visible?.method];
|
|
249
|
+
|
|
250
|
+
console.log("result", result);
|
|
251
|
+
|
|
252
|
+
column.visible = result;
|
|
253
|
+
}
|
|
254
|
+
return column;
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
console.log(result);
|
|
258
|
+
|
|
259
|
+
return result;
|
|
260
|
+
};
|
|
261
|
+
|
|
233
262
|
const table = computed(() => {
|
|
234
263
|
const tableScope = {
|
|
235
|
-
columns: tableData.value?.columns,
|
|
264
|
+
columns: calculateColumns(tableData.value?.columns),
|
|
236
265
|
};
|
|
237
266
|
|
|
238
267
|
return tableScope;
|
|
@@ -247,14 +276,6 @@ const bladeOptions = reactive({
|
|
|
247
276
|
empty: resolveTemplateComponent("emptyTemplate"),
|
|
248
277
|
});
|
|
249
278
|
|
|
250
|
-
const { load, remove, items, loading, pagination, query, scope } = props.composables?.[
|
|
251
|
-
props.model?.settings?.composable ?? ""
|
|
252
|
-
]({
|
|
253
|
-
emit,
|
|
254
|
-
props,
|
|
255
|
-
mounted: useMounted(),
|
|
256
|
-
}) as UseList<Record<string, any>[], Record<string, any>, ListBaseBladeScope>;
|
|
257
|
-
|
|
258
279
|
if (props.isWidgetView) {
|
|
259
280
|
query.value.take = 5;
|
|
260
281
|
}
|
|
@@ -114,13 +114,18 @@ export interface ListContentSchema {
|
|
|
114
114
|
filter?: FilterSchema;
|
|
115
115
|
multiselect?: boolean;
|
|
116
116
|
header?: boolean;
|
|
117
|
-
columns?: (ITableColumns & {
|
|
117
|
+
columns?: (Omit<ITableColumns, "visible"> & {
|
|
118
118
|
id: string;
|
|
119
119
|
title: string;
|
|
120
120
|
sortable?: boolean;
|
|
121
121
|
alwaysVisible?: boolean;
|
|
122
122
|
type?: string;
|
|
123
123
|
customTemplate?: GridTemplateOverride;
|
|
124
|
+
visible?:
|
|
125
|
+
| boolean
|
|
126
|
+
| {
|
|
127
|
+
method: string;
|
|
128
|
+
};
|
|
124
129
|
})[];
|
|
125
130
|
reorderableRows?: boolean;
|
|
126
131
|
mobileTemplate?: {
|
|
@@ -643,9 +643,13 @@ const headerCheckbox = computed({
|
|
|
643
643
|
|
|
644
644
|
const filteredCols = computed(() => {
|
|
645
645
|
return defaultColumns.value.filter((x) => {
|
|
646
|
-
if (
|
|
647
|
-
return
|
|
646
|
+
if (x.visible === false) {
|
|
647
|
+
return false;
|
|
648
648
|
}
|
|
649
|
+
if (!props.expanded) {
|
|
650
|
+
return x.alwaysVisible;
|
|
651
|
+
}
|
|
652
|
+
return x;
|
|
649
653
|
});
|
|
650
654
|
});
|
|
651
655
|
|
|
@@ -1039,6 +1043,10 @@ function restoreState() {
|
|
|
1039
1043
|
return {
|
|
1040
1044
|
...item,
|
|
1041
1045
|
title: column.title,
|
|
1046
|
+
visible: column.visible,
|
|
1047
|
+
sortable: column.sortable,
|
|
1048
|
+
alwaysVisible: column.alwaysVisible,
|
|
1049
|
+
type: column.type,
|
|
1042
1050
|
};
|
|
1043
1051
|
}
|
|
1044
1052
|
return item;
|