@vc-shell/create-vc-app 2.0.0-alpha.11 → 2.0.0-alpha.13
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 +10 -0
- package/dist/index.js +1 -1
- package/dist/templates/dynamic-module/_package.json.ejs +3 -3
- package/dist/templates/host-app/_package.json.ejs +4 -4
- package/dist/templates/module/pages/details.vue.ejs +85 -111
- package/dist/templates/module/pages/list.vue.ejs +90 -117
- package/dist/templates/sample-module/pages/details.vue +12 -43
- package/dist/templates/sample-module/pages/list.vue +4 -35
- package/dist/templates/standalone/_package.json.ejs +4 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
# [2.0.0-alpha.13](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.12...v2.0.0-alpha.13) (2026-03-20)
|
|
2
|
+
|
|
3
|
+
**Note:** Version bump only for package @vc-shell/create-vc-app
|
|
4
|
+
|
|
5
|
+
# [2.0.0-alpha.12](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2026-03-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **create-vc-app:** update blade templates to use useBlade() without boilerplate ([5d1f148](https://github.com/VirtoCommerce/vc-shell/commit/5d1f148720f15512e2db0768d320a70ba417dc3e))
|
|
1
11
|
# [2.0.0-alpha.11](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2026-03-13)
|
|
2
12
|
|
|
3
13
|
**Note:** Version bump only for package @vc-shell/create-vc-app
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/node": "^20.10.5",
|
|
13
|
-
"@vc-shell/ts-config": "^2.0.0-alpha.
|
|
13
|
+
"@vc-shell/ts-config": "^2.0.0-alpha.13",
|
|
14
14
|
"cross-env": "^7.0.3",
|
|
15
15
|
"sass": "^1.87.0",
|
|
16
16
|
"typescript": "^5.8.3",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"vue-tsc": "^2.2.10"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@vc-shell/config-generator": "^2.0.0-alpha.
|
|
22
|
-
"@vc-shell/framework": "^2.0.0-alpha.
|
|
21
|
+
"@vc-shell/config-generator": "^2.0.0-alpha.13",
|
|
22
|
+
"@vc-shell/framework": "^2.0.0-alpha.13",
|
|
23
23
|
"vue": "^3.5.13",
|
|
24
24
|
"vue-router": "^4.2.5"
|
|
25
25
|
}
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@types/node": "^20.10.5",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
24
24
|
"@typescript-eslint/parser": "^7.4.0",
|
|
25
|
-
"@vc-shell/api-client-generator": "^2.0.0-alpha.
|
|
26
|
-
"@vc-shell/ts-config": "^2.0.0-alpha.
|
|
25
|
+
"@vc-shell/api-client-generator": "^2.0.0-alpha.13",
|
|
26
|
+
"@vc-shell/ts-config": "^2.0.0-alpha.13",
|
|
27
27
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
28
28
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
29
29
|
"@vue/eslint-config-typescript": "^13.0.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"vue-tsc": "^2.2.10"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vc-shell/config-generator": "^2.0.0-alpha.
|
|
55
|
-
"@vc-shell/framework": "^2.0.0-alpha.
|
|
54
|
+
"@vc-shell/config-generator": "^2.0.0-alpha.13",
|
|
55
|
+
"@vc-shell/framework": "^2.0.0-alpha.13",
|
|
56
56
|
"@vueuse/core": "^10.7.1",
|
|
57
57
|
"@vueuse/integrations": "^10.7.1",
|
|
58
58
|
"cross-spawn": "^7.0.3",
|
|
@@ -1,111 +1,85 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<VcBlade
|
|
3
|
-
:title="title"
|
|
4
|
-
:toolbar-items="bladeToolbar"
|
|
5
|
-
:loading="loading"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
async clickHandler() {
|
|
87
|
-
await saveItem();
|
|
88
|
-
resetModificationState();
|
|
89
|
-
emit("parent:call", { method: "reload" });
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
]);
|
|
93
|
-
|
|
94
|
-
onMounted(async () => {
|
|
95
|
-
if (props.param) {
|
|
96
|
-
await getItem(props.param);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
onBeforeClose(async () => {
|
|
101
|
-
if (isModified.value) {
|
|
102
|
-
return await showConfirmation("You have unsaved changes. Are you sure you want to close?");
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
useBeforeUnload(computed(() => isModified.value));
|
|
107
|
-
|
|
108
|
-
defineExpose({
|
|
109
|
-
title,
|
|
110
|
-
});
|
|
111
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<VcBlade
|
|
3
|
+
:title="title"
|
|
4
|
+
:toolbar-items="bladeToolbar"
|
|
5
|
+
:loading="loading"
|
|
6
|
+
width="70%"
|
|
7
|
+
>
|
|
8
|
+
<VcContainer>
|
|
9
|
+
<VcForm>
|
|
10
|
+
<!-- Add your form fields here -->
|
|
11
|
+
<VcInput
|
|
12
|
+
v-model="item.name"
|
|
13
|
+
:label="'Name'"
|
|
14
|
+
required
|
|
15
|
+
/>
|
|
16
|
+
</VcForm>
|
|
17
|
+
</VcContainer>
|
|
18
|
+
</VcBlade>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import {
|
|
23
|
+
VcBlade,
|
|
24
|
+
VcContainer,
|
|
25
|
+
VcForm,
|
|
26
|
+
VcInput,
|
|
27
|
+
useBlade,
|
|
28
|
+
useModificationTracker,
|
|
29
|
+
usePopup,
|
|
30
|
+
useBeforeUnload,
|
|
31
|
+
type IBladeToolbar,
|
|
32
|
+
} from "@vc-shell/framework";
|
|
33
|
+
import { ref, computed, onMounted } from "vue";
|
|
34
|
+
import use<%- ModuleNamePascalCase %>Details from "../composables/useDetails";
|
|
35
|
+
|
|
36
|
+
defineOptions({
|
|
37
|
+
url: "/<%- ModuleName %>-details",
|
|
38
|
+
name: "<%- ModuleNamePascalCase %>Details",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const { param, closeSelf, callParent, onBeforeClose } = useBlade();
|
|
42
|
+
|
|
43
|
+
const { showConfirmation } = usePopup();
|
|
44
|
+
|
|
45
|
+
const { item, loading, getItem, saveItem } = use<%- ModuleNamePascalCase %>Details();
|
|
46
|
+
const { isModified, resetModificationState } = useModificationTracker(item);
|
|
47
|
+
|
|
48
|
+
const title = computed(() => {
|
|
49
|
+
return param.value
|
|
50
|
+
? String(item.value?.name || "<%- ModuleNameSentenceCase %> Details")
|
|
51
|
+
: "New <%- ModuleNameSentenceCase %>";
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const bladeToolbar = ref<IBladeToolbar[]>([
|
|
55
|
+
{
|
|
56
|
+
id: "save",
|
|
57
|
+
title: "Save",
|
|
58
|
+
icon: "lucide-save",
|
|
59
|
+
disabled: computed(() => !isModified.value),
|
|
60
|
+
async clickHandler() {
|
|
61
|
+
await saveItem();
|
|
62
|
+
resetModificationState();
|
|
63
|
+
callParent("reload");
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
onMounted(async () => {
|
|
69
|
+
if (param.value) {
|
|
70
|
+
await getItem(param.value);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
onBeforeClose(async () => {
|
|
75
|
+
if (isModified.value) {
|
|
76
|
+
return await showConfirmation("You have unsaved changes. Are you sure you want to close?");
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
useBeforeUnload(computed(() => isModified.value));
|
|
81
|
+
|
|
82
|
+
defineExpose({
|
|
83
|
+
title,
|
|
84
|
+
});
|
|
85
|
+
</script>
|
|
@@ -1,117 +1,90 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<VcBlade
|
|
3
|
-
:title="$t('<%- ModuleNameScreamingSnake %>.PAGES.LIST.TITLE')"
|
|
4
|
-
:toolbar-items="bladeToolbar"
|
|
5
|
-
:loading="loading"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
title: "
|
|
63
|
-
icon: "lucide-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
clickHandler: () => getItems(),
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "add",
|
|
95
|
-
title: "Add",
|
|
96
|
-
icon: "lucide-plus",
|
|
97
|
-
clickHandler: () => openDetails(),
|
|
98
|
-
},
|
|
99
|
-
]);
|
|
100
|
-
|
|
101
|
-
function openDetails(item?: { id?: string }) {
|
|
102
|
-
openBlade({
|
|
103
|
-
blade: markRaw(Details),
|
|
104
|
-
param: item?.id,
|
|
105
|
-
onClose() {
|
|
106
|
-
getItems();
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
getItems();
|
|
112
|
-
|
|
113
|
-
defineExpose({
|
|
114
|
-
title: computed(() => "<%- ModuleNameSentenceCase %>"),
|
|
115
|
-
reload: getItems,
|
|
116
|
-
});
|
|
117
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<VcBlade
|
|
3
|
+
:title="$t('<%- ModuleNameScreamingSnake %>.PAGES.LIST.TITLE')"
|
|
4
|
+
:toolbar-items="bladeToolbar"
|
|
5
|
+
:loading="loading"
|
|
6
|
+
width="50%"
|
|
7
|
+
>
|
|
8
|
+
<VcDataTable
|
|
9
|
+
:items="data"
|
|
10
|
+
:total-count="totalCount"
|
|
11
|
+
:current-page="currentPage"
|
|
12
|
+
:search-value="searchQuery"
|
|
13
|
+
:state-key="'<%- ModuleNameScreamingSnake %>'"
|
|
14
|
+
@search:change="(val: string) => { searchQuery = val; getItems(); }"
|
|
15
|
+
@item-click="openDetails"
|
|
16
|
+
@pagination-click="(page: number) => { currentPage = page; getItems(); }"
|
|
17
|
+
>
|
|
18
|
+
<!-- Add your columns here -->
|
|
19
|
+
<VcColumn id="name" :header="'Name'" sortable />
|
|
20
|
+
<VcColumn id="createdDate" :header="'Created'" type="datetime" sortable />
|
|
21
|
+
</VcDataTable>
|
|
22
|
+
</VcBlade>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import {
|
|
27
|
+
VcBlade,
|
|
28
|
+
VcDataTable,
|
|
29
|
+
VcColumn,
|
|
30
|
+
useBlade,
|
|
31
|
+
type IBladeToolbar,
|
|
32
|
+
} from "@vc-shell/framework";
|
|
33
|
+
import { ref, computed, markRaw } from "vue";
|
|
34
|
+
import use<%- ModuleNamePascalCase %>List from "../composables/useList";
|
|
35
|
+
import Details from "./details.vue";
|
|
36
|
+
|
|
37
|
+
defineOptions({
|
|
38
|
+
url: "/<%- ModuleName %>",
|
|
39
|
+
name: "<%- ModuleNamePascalCase %>List",
|
|
40
|
+
isWorkspace: true,
|
|
41
|
+
menuItem: {
|
|
42
|
+
title: "<%- ModuleNameScreamingSnake %>.MENU.TITLE",
|
|
43
|
+
icon: "lucide-box",
|
|
44
|
+
priority: 10,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const { openBlade } = useBlade();
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
data,
|
|
52
|
+
loading,
|
|
53
|
+
totalCount,
|
|
54
|
+
currentPage,
|
|
55
|
+
searchQuery,
|
|
56
|
+
getItems,
|
|
57
|
+
} = use<%- ModuleNamePascalCase %>List();
|
|
58
|
+
|
|
59
|
+
const bladeToolbar = ref<IBladeToolbar[]>([
|
|
60
|
+
{
|
|
61
|
+
id: "refresh",
|
|
62
|
+
title: "Refresh",
|
|
63
|
+
icon: "lucide-refresh-cw",
|
|
64
|
+
clickHandler: () => getItems(),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "add",
|
|
68
|
+
title: "Add",
|
|
69
|
+
icon: "lucide-plus",
|
|
70
|
+
clickHandler: () => openDetails(),
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
|
+
|
|
74
|
+
function openDetails(item?: { id?: string }) {
|
|
75
|
+
openBlade({
|
|
76
|
+
blade: markRaw(Details),
|
|
77
|
+
param: item?.id,
|
|
78
|
+
onClose() {
|
|
79
|
+
getItems();
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
getItems();
|
|
85
|
+
|
|
86
|
+
defineExpose({
|
|
87
|
+
title: computed(() => "<%- ModuleNameSentenceCase %>"),
|
|
88
|
+
reload: getItems,
|
|
89
|
+
});
|
|
90
|
+
</script>
|
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
<VcBlade
|
|
3
3
|
:loading="loading"
|
|
4
4
|
:title="title"
|
|
5
|
-
:expanded="expanded"
|
|
6
|
-
:closable="closable"
|
|
7
5
|
width="70%"
|
|
8
6
|
:toolbar-items="bladeToolbar"
|
|
9
|
-
@close="$emit('close:blade')"
|
|
10
|
-
@expand="$emit('expand:blade')"
|
|
11
|
-
@collapse="$emit('collapse:blade')"
|
|
12
7
|
>
|
|
13
8
|
<VcContainer class="tw-p-2">
|
|
14
9
|
<VcForm class="tw-space-y-4">
|
|
@@ -130,42 +125,22 @@
|
|
|
130
125
|
</template>
|
|
131
126
|
|
|
132
127
|
<script lang="ts" setup>
|
|
133
|
-
import { IBladeToolbar,
|
|
128
|
+
import { IBladeToolbar, useBlade, useBeforeUnload, usePopup } from "@vc-shell/framework";
|
|
134
129
|
import { useDetails } from "./../composables";
|
|
135
130
|
import { computed, onMounted, ref } from "vue";
|
|
136
131
|
import { Field, useForm } from "vee-validate";
|
|
137
132
|
import { useI18n } from "vue-i18n";
|
|
138
133
|
import * as _ from "lodash-es";
|
|
139
134
|
|
|
140
|
-
export interface Props {
|
|
141
|
-
expanded?: boolean;
|
|
142
|
-
closable?: boolean;
|
|
143
|
-
param?: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export interface Emits {
|
|
147
|
-
(event: "parent:call", args: IParentCallArgs): void;
|
|
148
|
-
(event: "collapse:blade"): void;
|
|
149
|
-
(event: "expand:blade"): void;
|
|
150
|
-
(event: "close:blade"): void;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
135
|
defineOptions({
|
|
154
136
|
url: "/sample-details",
|
|
155
137
|
name: "SampleDetails",
|
|
156
138
|
});
|
|
157
139
|
|
|
158
|
-
const
|
|
159
|
-
expanded: true,
|
|
160
|
-
closable: true,
|
|
161
|
-
param: undefined,
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
const emit = defineEmits<Emits>();
|
|
140
|
+
const { param, closeSelf, callParent, onBeforeClose } = useBlade();
|
|
165
141
|
|
|
166
142
|
const { loading, getItem, saveItem, removeItem, item, currencyOptions, isModified } = useDetails();
|
|
167
143
|
const { showConfirmation } = usePopup();
|
|
168
|
-
const { onBeforeClose } = useBladeNavigation();
|
|
169
144
|
const { t } = useI18n({ useScope: "global" });
|
|
170
145
|
|
|
171
146
|
const { meta } = useForm({
|
|
@@ -177,7 +152,7 @@ const isDisabled = computed(() => {
|
|
|
177
152
|
});
|
|
178
153
|
|
|
179
154
|
const title = computed(() => {
|
|
180
|
-
return
|
|
155
|
+
return param.value
|
|
181
156
|
? item.value?.name
|
|
182
157
|
? item.value?.name + t("SAMPLE_APP.PAGES.DETAILS.TITLE.DETAILS")
|
|
183
158
|
: t("SAMPLE_APP.PAGES.DETAILS.TITLE.LOADING")
|
|
@@ -192,10 +167,8 @@ const bladeToolbar = ref<IBladeToolbar[]>([
|
|
|
192
167
|
async clickHandler() {
|
|
193
168
|
await saveItem(item.value);
|
|
194
169
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
});
|
|
198
|
-
emit("close:blade");
|
|
170
|
+
callParent("reload");
|
|
171
|
+
closeSelf();
|
|
199
172
|
},
|
|
200
173
|
disabled: computed(() => !(isModified.value && !isDisabled.value)),
|
|
201
174
|
},
|
|
@@ -205,13 +178,11 @@ const bladeToolbar = ref<IBladeToolbar[]>([
|
|
|
205
178
|
title: "Delete",
|
|
206
179
|
async clickHandler() {
|
|
207
180
|
if (await showConfirmation(t(`SAMPLE_APP.PAGES.ALERTS.DELETE`))) {
|
|
208
|
-
if (
|
|
209
|
-
await removeItem({ id:
|
|
210
|
-
|
|
211
|
-
method: "reload",
|
|
212
|
-
});
|
|
181
|
+
if (param.value) {
|
|
182
|
+
await removeItem({ id: param.value });
|
|
183
|
+
callParent("reload");
|
|
213
184
|
|
|
214
|
-
|
|
185
|
+
closeSelf();
|
|
215
186
|
}
|
|
216
187
|
}
|
|
217
188
|
},
|
|
@@ -219,8 +190,8 @@ const bladeToolbar = ref<IBladeToolbar[]>([
|
|
|
219
190
|
]);
|
|
220
191
|
|
|
221
192
|
onMounted(async () => {
|
|
222
|
-
if (
|
|
223
|
-
await getItem({ id:
|
|
193
|
+
if (param.value) {
|
|
194
|
+
await getItem({ id: param.value });
|
|
224
195
|
}
|
|
225
196
|
});
|
|
226
197
|
|
|
@@ -232,7 +203,5 @@ onBeforeClose(async () => {
|
|
|
232
203
|
|
|
233
204
|
useBeforeUnload(computed(() => !isDisabled.value && isModified.value));
|
|
234
205
|
|
|
235
|
-
|
|
236
|
-
title,
|
|
237
|
-
});
|
|
206
|
+
|
|
238
207
|
</script>
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
<VcBlade
|
|
3
3
|
:title="title"
|
|
4
4
|
width="50%"
|
|
5
|
-
:expanded="expanded"
|
|
6
|
-
:closable="closable"
|
|
7
5
|
:toolbar-items="bladeToolbar"
|
|
8
|
-
@close="$emit('close:blade')"
|
|
9
|
-
@expand="$emit('expand:blade')"
|
|
10
|
-
@collapse="$emit('collapse:blade')"
|
|
11
6
|
>
|
|
12
7
|
<!-- Blade contents -->
|
|
13
8
|
<!-- @vue-generic {MockedItem} -->
|
|
14
9
|
<VcTable
|
|
15
|
-
:expanded="expanded"
|
|
16
10
|
class="tw-grow tw-basis-0"
|
|
17
11
|
multiselect
|
|
18
12
|
:loading="loading"
|
|
@@ -46,9 +40,8 @@ import { computed, ref, markRaw, onMounted, watch } from "vue";
|
|
|
46
40
|
import {
|
|
47
41
|
IActionBuilderResult,
|
|
48
42
|
IBladeToolbar,
|
|
49
|
-
IParentCallArgs,
|
|
50
43
|
ITableColumns,
|
|
51
|
-
|
|
44
|
+
useBlade,
|
|
52
45
|
usePopup,
|
|
53
46
|
useTableSort,
|
|
54
47
|
useFunctions,
|
|
@@ -58,20 +51,6 @@ import { useList } from "./../composables";
|
|
|
58
51
|
import Details from "./details.vue";
|
|
59
52
|
import { MockedItem } from "./../composables/useList";
|
|
60
53
|
|
|
61
|
-
export interface Props {
|
|
62
|
-
expanded?: boolean;
|
|
63
|
-
closable?: boolean;
|
|
64
|
-
param?: string;
|
|
65
|
-
options?: Record<string, unknown>;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface Emits {
|
|
69
|
-
(event: "parent:call", args: IParentCallArgs): void;
|
|
70
|
-
(event: "collapse:blade"): void;
|
|
71
|
-
(event: "expand:blade"): void;
|
|
72
|
-
(event: "close:blade"): void;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
54
|
defineOptions({
|
|
76
55
|
url: "/sample-list",
|
|
77
56
|
name: "SampleList",
|
|
@@ -83,15 +62,8 @@ defineOptions({
|
|
|
83
62
|
},
|
|
84
63
|
});
|
|
85
64
|
|
|
86
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
87
|
-
expanded: true,
|
|
88
|
-
closable: true,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
defineEmits<Emits>();
|
|
92
|
-
|
|
93
65
|
const { t } = useI18n({ useScope: "global" });
|
|
94
|
-
const { openBlade } =
|
|
66
|
+
const { param, openBlade, exposeToChildren } = useBlade();
|
|
95
67
|
const { showConfirmation } = usePopup();
|
|
96
68
|
const { debounce } = useFunctions();
|
|
97
69
|
|
|
@@ -132,7 +104,7 @@ const notfound = {
|
|
|
132
104
|
};
|
|
133
105
|
|
|
134
106
|
watch(
|
|
135
|
-
|
|
107
|
+
param,
|
|
136
108
|
(newVal) => {
|
|
137
109
|
selectedItemId.value = newVal;
|
|
138
110
|
},
|
|
@@ -293,8 +265,5 @@ watch(
|
|
|
293
265
|
},
|
|
294
266
|
);
|
|
295
267
|
|
|
296
|
-
|
|
297
|
-
title,
|
|
298
|
-
reload,
|
|
299
|
-
});
|
|
268
|
+
exposeToChildren({ reload });
|
|
300
269
|
</script>
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@types/node": "^20.10.5",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
24
24
|
"@typescript-eslint/parser": "^7.4.0",
|
|
25
|
-
"@vc-shell/api-client-generator": "^2.0.0-alpha.
|
|
26
|
-
"@vc-shell/ts-config": "^2.0.0-alpha.
|
|
25
|
+
"@vc-shell/api-client-generator": "^2.0.0-alpha.13",
|
|
26
|
+
"@vc-shell/ts-config": "^2.0.0-alpha.13",
|
|
27
27
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
28
28
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
29
29
|
"@vue/eslint-config-typescript": "^13.0.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"vue-tsc": "^2.2.10"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vc-shell/config-generator": "^2.0.0-alpha.
|
|
55
|
-
"@vc-shell/framework": "^2.0.0-alpha.
|
|
54
|
+
"@vc-shell/config-generator": "^2.0.0-alpha.13",
|
|
55
|
+
"@vc-shell/framework": "^2.0.0-alpha.13",
|
|
56
56
|
"@vueuse/core": "^10.7.1",
|
|
57
57
|
"@vueuse/integrations": "^10.7.1",
|
|
58
58
|
"cross-spawn": "^7.0.3",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/create-vc-app",
|
|
3
3
|
"description": "Application scaffolding",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.13",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/ejs": "^3.1.5",
|
|
17
17
|
"@types/prompts": "^2.4.4",
|
|
18
|
-
"@vc-shell/ts-config": "2.0.0-alpha.
|
|
18
|
+
"@vc-shell/ts-config": "2.0.0-alpha.13",
|
|
19
19
|
"copyfiles": "^2.4.1",
|
|
20
20
|
"cross-env": "^7.0.3",
|
|
21
21
|
"shx": "^0.3.4",
|