@vc-shell/create-vc-app 1.0.113 → 1.0.115

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.
Files changed (110) hide show
  1. package/CHANGELOG.md +307 -5
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +100 -90
  5. package/dist/index.js.map +1 -0
  6. package/dist/templates/base/.env +4 -0
  7. package/dist/{template → templates}/base/.eslintrc.js +1 -2
  8. package/dist/templates/base/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -0
  9. package/dist/templates/base/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
  10. package/dist/templates/base/.yarn/releases/yarn-3.6.4.cjs +874 -0
  11. package/dist/{template/base/index.html.ejs → templates/base/index.html} +1 -1
  12. package/dist/{template/base/package.json.ejs → templates/base/package.json} +7 -7
  13. package/dist/templates/base/public/assets/1.jpeg +0 -0
  14. package/dist/templates/base/public/assets/2.jpg +0 -0
  15. package/dist/templates/base/public/assets/3.jpg +0 -0
  16. package/dist/{template/code/commonPages → templates/base}/src/composables/useLogin/index.ts +1 -0
  17. package/dist/{template/base/src/router/index.ts.ejs → templates/base/src/router/index.ts} +4 -18
  18. package/dist/{template → templates}/base/tsconfig.json +1 -1
  19. package/dist/{template/base/vite.config.ts.ejs → templates/base/vite.config.ts} +5 -2
  20. package/dist/templates/variants/both/src/main.ts +45 -0
  21. package/dist/templates/variants/both/src/modules/classic-module/composables/index.ts +2 -0
  22. package/dist/templates/variants/both/src/modules/classic-module/composables/useDetails/index.ts +52 -0
  23. package/dist/templates/variants/both/src/modules/classic-module/composables/useList/index.ts +51 -0
  24. package/dist/{template/code/blade/src/modules/default/locales/en.json.ejs → templates/variants/both/src/modules/classic-module/locales/en.json} +6 -3
  25. package/dist/templates/variants/both/src/modules/classic-module/pages/details.vue +83 -0
  26. package/dist/templates/variants/both/src/modules/classic-module/pages/index.ts +2 -0
  27. package/dist/{template/code/blade/src/modules/default/pages/default-list.vue.ejs → templates/variants/both/src/modules/classic-module/pages/list.vue} +93 -30
  28. package/dist/templates/variants/both/src/modules/dynamic-module/components/DynamicItemsMobileGridView.vue +39 -0
  29. package/dist/templates/variants/both/src/modules/dynamic-module/components/index.ts +3 -0
  30. package/dist/templates/variants/both/src/modules/dynamic-module/composables/index.ts +2 -0
  31. package/dist/templates/variants/both/src/modules/dynamic-module/composables/useDetails/index.ts +92 -0
  32. package/dist/templates/variants/both/src/modules/dynamic-module/composables/useList/index.ts +70 -0
  33. package/dist/templates/variants/both/src/modules/dynamic-module/index.ts +9 -0
  34. package/dist/templates/variants/both/src/modules/dynamic-module/locales/en.json +46 -0
  35. package/dist/templates/variants/both/src/modules/dynamic-module/locales/index.ts +2 -0
  36. package/dist/templates/variants/both/src/modules/dynamic-module/pages/details.ts +40 -0
  37. package/dist/templates/variants/both/src/modules/dynamic-module/pages/index.ts +4 -0
  38. package/dist/templates/variants/both/src/modules/dynamic-module/pages/list.ts +50 -0
  39. package/dist/{template/base/src/pages/App.vue.ejs → templates/variants/both/src/pages/App.vue} +24 -28
  40. package/dist/{template/base/src/main.ts.ejs → templates/variants/classic/src/main.ts} +6 -12
  41. package/dist/templates/variants/classic/src/modules/classic-module/components/index.ts +1 -0
  42. package/dist/templates/variants/classic/src/modules/classic-module/composables/index.ts +2 -0
  43. package/dist/templates/variants/classic/src/modules/classic-module/composables/useDetails/index.ts +52 -0
  44. package/dist/templates/variants/classic/src/modules/classic-module/composables/useList/index.ts +51 -0
  45. package/dist/templates/variants/classic/src/modules/classic-module/index.ts +9 -0
  46. package/dist/templates/variants/classic/src/modules/classic-module/locales/en.json +43 -0
  47. package/dist/templates/variants/classic/src/modules/classic-module/locales/index.ts +2 -0
  48. package/dist/templates/variants/classic/src/modules/classic-module/pages/details.vue +83 -0
  49. package/dist/templates/variants/classic/src/modules/classic-module/pages/index.ts +2 -0
  50. package/dist/templates/variants/classic/src/modules/classic-module/pages/list.vue +260 -0
  51. package/dist/templates/variants/classic/src/pages/App.vue +362 -0
  52. package/dist/templates/variants/dynamic/src/main.ts +42 -0
  53. package/dist/templates/variants/dynamic/src/modules/dynamic-module/components/DynamicItemsMobileGridView.vue +39 -0
  54. package/dist/templates/variants/dynamic/src/modules/dynamic-module/components/index.ts +3 -0
  55. package/dist/templates/variants/dynamic/src/modules/dynamic-module/composables/index.ts +2 -0
  56. package/dist/templates/variants/dynamic/src/modules/dynamic-module/composables/useDetails/index.ts +92 -0
  57. package/dist/templates/variants/dynamic/src/modules/dynamic-module/composables/useList/index.ts +70 -0
  58. package/dist/templates/variants/dynamic/src/modules/dynamic-module/index.ts +9 -0
  59. package/dist/templates/variants/dynamic/src/modules/dynamic-module/locales/en.json +46 -0
  60. package/dist/templates/variants/dynamic/src/modules/dynamic-module/locales/index.ts +2 -0
  61. package/dist/templates/variants/dynamic/src/modules/dynamic-module/pages/details.ts +40 -0
  62. package/dist/templates/variants/dynamic/src/modules/dynamic-module/pages/index.ts +4 -0
  63. package/dist/templates/variants/dynamic/src/modules/dynamic-module/pages/list.ts +50 -0
  64. package/dist/templates/variants/dynamic/src/pages/App.vue +362 -0
  65. package/dist/tsconfig.tsbuildinfo +1 -1
  66. package/package.json +9 -8
  67. package/dist/template/base/.env.ejs +0 -6
  68. package/dist/template/code/blade/src/modules/default/composables/index.ts +0 -1
  69. package/dist/template/code/blade/src/modules/default/composables/useDefault/index.ts +0 -9
  70. package/dist/template/code/blade/src/modules/default/pages/index.ts +0 -1
  71. /package/dist/{template → templates}/base/.browserslistrc +0 -0
  72. /package/dist/{template → templates}/base/.commitlintrc.json +0 -0
  73. /package/dist/{template → templates}/base/.editorconfig +0 -0
  74. /package/dist/{template → templates}/base/.eslintignore +0 -0
  75. /package/dist/{template → templates}/base/.husky/commit-msg +0 -0
  76. /package/dist/{template → templates}/base/.husky/pre-commit +0 -0
  77. /package/dist/{template → templates}/base/.prettierignore +0 -0
  78. /package/dist/{template → templates}/base/.prettierrc +0 -0
  79. /package/dist/{template → templates}/base/.vscode/extensions.json +0 -0
  80. /package/dist/{template → templates}/base/.vscode/settings.json +0 -0
  81. /package/dist/{template → templates}/base/LICENSE +0 -0
  82. /package/dist/{template → templates}/base/README.md +0 -0
  83. /package/dist/{template → templates}/base/postcss.config.js +0 -0
  84. /package/dist/{template → templates}/base/public/assets/app-select.svg +0 -0
  85. /package/dist/{template → templates}/base/public/assets/avatar.jpg +0 -0
  86. /package/dist/{template → templates}/base/public/assets/background.jpg +0 -0
  87. /package/dist/{template → templates}/base/public/assets/empty.png +0 -0
  88. /package/dist/{template → templates}/base/public/assets/logo-white.svg +0 -0
  89. /package/dist/{template → templates}/base/public/assets/logo.svg +0 -0
  90. /package/dist/{template → templates}/base/public/img/icons/apple-touch-icon.png +0 -0
  91. /package/dist/{template → templates}/base/public/img/icons/favicon-16x16.png +0 -0
  92. /package/dist/{template → templates}/base/public/img/icons/favicon-32x32.png +0 -0
  93. /package/dist/{template → templates}/base/public/img/icons/favicon.ico +0 -0
  94. /package/dist/{template → templates}/base/public/img/icons/mstile-150x150.png +0 -0
  95. /package/dist/{template → templates}/base/public/img/icons/pwa-192x192.png +0 -0
  96. /package/dist/{template → templates}/base/public/img/icons/pwa-512x512.png +0 -0
  97. /package/dist/{template → templates}/base/public/img/icons/safari-pinned-tab.svg +0 -0
  98. /package/dist/{template → templates}/base/src/api_client/README.md +0 -0
  99. /package/dist/{template/code/commonPages → templates/base}/src/composables/index.ts +0 -0
  100. /package/dist/{template → templates}/base/src/env.d.ts +0 -0
  101. /package/dist/{template → templates}/base/src/locales/en.json +0 -0
  102. /package/dist/{template → templates}/base/src/locales/index.ts +0 -0
  103. /package/dist/{template/code/dashboard → templates/base}/src/pages/Dashboard.vue +0 -0
  104. /package/dist/{template → templates}/base/src/shims-vue.d.ts +0 -0
  105. /package/dist/{template → templates}/base/src/styles/index.scss +0 -0
  106. /package/dist/{template → templates}/base/src/types/index.ts +0 -0
  107. /package/dist/{template → templates}/base/tailwind.config.js +0 -0
  108. /package/dist/{template/code/blade/src/modules/default → templates/variants/both/src/modules/classic-module}/components/index.ts +0 -0
  109. /package/dist/{template/code/blade/src/modules/default → templates/variants/both/src/modules/classic-module}/index.ts +0 -0
  110. /package/dist/{template/code/blade/src/modules/default → templates/variants/both/src/modules/classic-module}/locales/index.ts +0 -0
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="tw-border-b tw-border-solid tw-border-b-[#e3e7ec] tw-py-3 tw-px-4">
3
+ <div class="tw-w-full tw-flex tw-justify-evenly tw-mb-2">
4
+ <VcImage
5
+ class="tw-shrink-0"
6
+ aspect="1x1"
7
+ size="s"
8
+ :bordered="true"
9
+ :src="context.item.imgSrc"
10
+ ></VcImage>
11
+ <div class="tw-grow tw-basis-0 tw-ml-3">
12
+ <div class="tw-font-bold tw-text-lg">
13
+ {{ context.item.name }}
14
+ </div>
15
+ </div>
16
+ </div>
17
+ <div class="tw-truncate tw-grow-[2] tw-basis-0">
18
+ <VcHint>{{ $t("DYNAMICMODULE.PAGES.LIST.MOBILE.CREATED") }}</VcHint>
19
+ <div class="tw-truncate tw-mt-1">
20
+ {{ context.item.createdDate }}
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ export interface Props {
28
+ context: {
29
+ item: {
30
+ imgSrc: string;
31
+ name: string;
32
+ createdDate: Date;
33
+ id: string;
34
+ };
35
+ };
36
+ }
37
+
38
+ defineProps<Props>();
39
+ </script>
@@ -0,0 +1,3 @@
1
+ import DynamicItemsMobileGridView from "./DynamicItemsMobileGridView.vue";
2
+
3
+ export { DynamicItemsMobileGridView };
@@ -0,0 +1,2 @@
1
+ export { default as useList } from "./useList";
2
+ export { default as useDetails } from "./useDetails";
@@ -0,0 +1,92 @@
1
+ /* eslint-disable import/no-unresolved */
2
+ import { computed, ref } from "vue";
3
+ import img1 from "/assets/1.jpeg";
4
+ import img2 from "/assets/2.jpg";
5
+ import img3 from "/assets/3.jpg";
6
+ import {
7
+ DetailsBaseBladeScope,
8
+ DynamicBladeForm,
9
+ IBladeToolbar,
10
+ useDetailsFactory,
11
+ } from "@vc-shell/framework";
12
+
13
+ export interface DynamicItemScope extends DetailsBaseBladeScope {
14
+ toolbarOverrides: {
15
+ refresh: IBladeToolbar;
16
+ };
17
+ }
18
+
19
+ export default (args: {
20
+ props: InstanceType<typeof DynamicBladeForm>["$props"];
21
+ emit: InstanceType<typeof DynamicBladeForm>["$emit"];
22
+ }) => {
23
+ const factory = useDetailsFactory<{ imgSrc: string; name: string; createdDate: Date; id: string }>({
24
+ load: async (payload) => {
25
+ return await new Promise((resolve) => {
26
+ setTimeout(() => {
27
+ const findMockedItem = [
28
+ {
29
+ imgSrc: img1,
30
+ name: "Item 1",
31
+ createdDate: new Date(),
32
+ id: "item-id-1",
33
+ },
34
+ {
35
+ imgSrc: img2,
36
+ name: "Item 2",
37
+ createdDate: new Date(),
38
+ id: "item-id-2",
39
+ },
40
+ {
41
+ imgSrc: img3,
42
+ name: "Item 3",
43
+ createdDate: new Date(),
44
+ id: "item-id-3",
45
+ },
46
+ ].find((x) => x.id === payload.id);
47
+ resolve(findMockedItem);
48
+ }, 1000);
49
+ });
50
+ },
51
+ saveChanges: () => {
52
+ throw new Error("Function not implemented.");
53
+ },
54
+ remove: () => {
55
+ throw new Error("Function not implemented.");
56
+ },
57
+ });
58
+
59
+ const { load, saveChanges, remove, loading, item, validationState } = factory();
60
+
61
+ // const item = ref({
62
+ // imgSrc: undefined,
63
+ // name: undefined,
64
+ // createdDate: undefined,
65
+ // id: undefined,
66
+ // });
67
+
68
+ const scope = ref<DynamicItemScope>({
69
+ toolbarOverrides: {
70
+ refresh: {
71
+ async clickHandler() {
72
+ await load({ id: args.props.param });
73
+ },
74
+ },
75
+ },
76
+ });
77
+
78
+ const bladeTitle = computed(() => {
79
+ return args.props.param ? item.value?.name : "Dynamic item details";
80
+ });
81
+
82
+ return {
83
+ load,
84
+ saveChanges,
85
+ remove,
86
+ loading,
87
+ item,
88
+ validationState,
89
+ bladeTitle,
90
+ scope: computed(() => scope.value),
91
+ };
92
+ };
@@ -0,0 +1,70 @@
1
+ /* eslint-disable import/no-unresolved */
2
+ import { computed, ref } from "vue";
3
+ import img1 from "/assets/1.jpeg";
4
+ import img2 from "/assets/2.jpg";
5
+ import img3 from "/assets/3.jpg";
6
+ import { DynamicBladeList, ListBaseBladeScope, useBladeNavigation, useListFactory } from "@vc-shell/framework";
7
+
8
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
9
+ export interface DynamicItemsScope extends ListBaseBladeScope {}
10
+
11
+ export default (args: {
12
+ props: InstanceType<typeof DynamicBladeList>["$props"];
13
+ emit: InstanceType<typeof DynamicBladeList>["$emit"];
14
+ }) => {
15
+ const factory = useListFactory({
16
+ load: async () => {
17
+ return await new Promise((resolve) => {
18
+ setTimeout(
19
+ () =>
20
+ resolve([
21
+ {
22
+ imgSrc: img1,
23
+ name: "Item 1",
24
+ createdDate: new Date(),
25
+ id: "item-id-1",
26
+ },
27
+ {
28
+ imgSrc: img2,
29
+ name: "Item 2",
30
+ createdDate: new Date(),
31
+ id: "item-id-2",
32
+ },
33
+ {
34
+ imgSrc: img3,
35
+ name: "Item 3",
36
+ createdDate: new Date(),
37
+ id: "item-id-3",
38
+ },
39
+ ]),
40
+ 1000
41
+ );
42
+ }).then((res: any[]) => {
43
+ return { results: res, totalCount: res.length };
44
+ });
45
+ },
46
+ });
47
+
48
+ const { load, items, pagination, loading, query } = factory();
49
+ const { openBlade, resolveBladeByName } = useBladeNavigation();
50
+
51
+ function openDetailsBlade(data?: Omit<Parameters<typeof openBlade>["0"], "blade">) {
52
+ openBlade({
53
+ blade: resolveBladeByName("DynamicItem"),
54
+ ...data,
55
+ });
56
+ }
57
+
58
+ const scope = ref<DynamicItemsScope>({
59
+ openDetailsBlade,
60
+ });
61
+
62
+ return {
63
+ items,
64
+ load,
65
+ loading,
66
+ pagination,
67
+ query,
68
+ scope: computed(() => scope.value),
69
+ };
70
+ };
@@ -0,0 +1,9 @@
1
+ import * as schema from "./pages";
2
+ import * as locales from "./locales";
3
+ import * as composables from "./composables";
4
+ import * as components from "./components";
5
+ import { createDynamicAppModule } from "@vc-shell/framework";
6
+
7
+ export default createDynamicAppModule({ schema, locales, composables, moduleComponents: components });
8
+
9
+ export { schema, composables, locales, components };
@@ -0,0 +1,46 @@
1
+ {
2
+ "DYNAMICMODULE": {
3
+ "MENU": {
4
+ "TITLE": "Dynamic Module"
5
+ },
6
+ "PAGES": {
7
+ "LIST": {
8
+ "TITLE": "Module blade",
9
+ "TOOLBAR": {
10
+ "REFRESH": "Refresh",
11
+ "ADD": "Add",
12
+ "DELETE": "Delete selected"
13
+ },
14
+ "SEARCH": {
15
+ "PLACEHOLDER": "Search keywords"
16
+ },
17
+ "TABLE": {
18
+ "TOTALS": "Count:",
19
+ "HEADER": {
20
+ "PRODUCT_IMAGE": "Pic",
21
+ "PRODUCT_NAME": "Name",
22
+ "CREATED_DATE": "Created"
23
+ },
24
+ "EMPTY": {
25
+ "TITLE": "There are no content yet",
26
+ "ACTION": "Add content"
27
+ },
28
+ "NOT_FOUND": {
29
+ "TITLE": "No content found.",
30
+ "ACTION": "Reset search"
31
+ },
32
+ "ACTIONS": {
33
+ "UNPUBLISH": "Unpublish",
34
+ "PUBLISH": "Publish"
35
+ }
36
+ },
37
+ "MOBILE": {
38
+ "CREATED": "Created"
39
+ },
40
+ "EMPTY": {
41
+ "NO_ITEMS": "There are no items yet"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,2 @@
1
+ import * as en from "./en.json";
2
+ export { en };
@@ -0,0 +1,40 @@
1
+ import { DynamicDetailsSchema } from "@vc-shell/framework";
2
+
3
+ export const details: DynamicDetailsSchema = {
4
+ settings: {
5
+ url: "/dynamic-module-details",
6
+ id: "DynamicItem",
7
+ localizationPrefix: "DynamicModule",
8
+ titleTemplate: "Dynamic module details",
9
+ composable: "useDetails",
10
+ component: "DynamicBladeForm",
11
+ toolbar: [
12
+ {
13
+ id: "refresh",
14
+ icon: "fas fa-sync-alt",
15
+ title: "Refresh",
16
+ method: "refresh",
17
+ },
18
+ ],
19
+ },
20
+ content: [
21
+ {
22
+ id: "dynamicItemForm",
23
+ component: "vc-form",
24
+ children: [
25
+ {
26
+ id: "itemName",
27
+ component: "vc-input",
28
+ label: "Name",
29
+ property: "name",
30
+ },
31
+ {
32
+ id: "itemCreatedDate",
33
+ component: "vc-input",
34
+ label: "Created date",
35
+ property: "createdDate",
36
+ },
37
+ ],
38
+ },
39
+ ],
40
+ };
@@ -0,0 +1,4 @@
1
+ import { grid as itemsList } from "./list";
2
+ import { details as itemDetails } from "./details";
3
+
4
+ export { itemsList, itemDetails };
@@ -0,0 +1,50 @@
1
+ import { DynamicGridSchema } from "@vc-shell/framework";
2
+
3
+ export const grid: DynamicGridSchema = {
4
+ settings: {
5
+ url: "/dynamic-module-list",
6
+ id: "DynamicItems",
7
+ titleTemplate: "Dynamic module blade",
8
+ localizationPrefix: "DynamicModule",
9
+ isWorkspace: true,
10
+ composable: "useList",
11
+ component: "DynamicBladeList",
12
+ toolbar: [
13
+ {
14
+ id: "refresh",
15
+ icon: "fas fa-sync-alt",
16
+ title: "Refresh",
17
+ method: "refresh",
18
+ },
19
+ ],
20
+ },
21
+ content: [
22
+ {
23
+ id: "itemsGrid",
24
+ component: "vc-table",
25
+ mobileTemplate: {
26
+ component: "DynamicItemsMobileGridView",
27
+ },
28
+ multiselect: true,
29
+ columns: [
30
+ {
31
+ id: "imgSrc",
32
+ title: "Pic",
33
+ type: "image",
34
+ alwaysVisible: true,
35
+ },
36
+ {
37
+ id: "name",
38
+ title: "Name",
39
+ alwaysVisible: true,
40
+ },
41
+ {
42
+ id: "createdDate",
43
+ title: "Created date",
44
+ sortable: true,
45
+ type: "date-ago",
46
+ },
47
+ ],
48
+ },
49
+ ],
50
+ };
@@ -7,9 +7,7 @@
7
7
  <VcApp
8
8
  v-else
9
9
  :menu-items="menuItems"
10
- <% if(commonPages === true) { -%>
11
10
  :mobile-menu-items="mobileMenuItems"
12
- <% } -%>
13
11
  :toolbar-items="toolbarItems"
14
12
  :is-ready="isReady"
15
13
  :is-authorized="isAuthorized"
@@ -20,9 +18,7 @@
20
18
  :blades-refs="bladesRefs"
21
19
  @backlink:click="closeBlade($event)"
22
20
  @close="closeBlade($event)"
23
- <% if(dashboard === true) { -%>
24
21
  @logo:click="openDashboard"
25
- <% } -%>
26
22
  >
27
23
  <!-- App Switcher -->
28
24
  <template
@@ -69,21 +65,16 @@ import {
69
65
  ChangePassword,
70
66
  LanguageSelector,
71
67
  UserDropdownButton,
72
- BladePageComponent
68
+ BladePageComponent,
73
69
  } from "@vc-shell/framework";
74
- import { computed, inject, onMounted, reactive, ref, Ref, markRaw, watch, defineComponent } from "vue";
70
+ import { computed, inject, onMounted, reactive, ref, Ref, markRaw, watch, defineComponent, provide } from "vue";
75
71
  import { useRoute, useRouter } from "vue-router";
76
72
  // eslint-disable-next-line import/no-unresolved
77
73
  import avatarImage from "/assets/avatar.jpg";
78
74
  // eslint-disable-next-line import/no-unresolved
79
75
  import logoImage from "/assets/logo.svg";
80
- <% if(dashboard === true) { -%>
81
- import Dashboard from "./Dashboard.vue";
82
- <% } -%>
83
76
  import { useI18n } from "vue-i18n";
84
- <% if(bladeModuleStarter === true) { -%>
85
- import { DefaultList } from "./../modules/default";
86
- <% } -%>
77
+ import { List } from "./../modules/classic-module";
87
78
 
88
79
  const { open } = usePopup({
89
80
  component: ChangePassword,
@@ -92,7 +83,16 @@ const { open } = usePopup({
92
83
  const { t, locale: currentLocale, availableLocales, getLocaleMessage } = useI18n({ useScope: "global" });
93
84
  const { user, signOut } = useUser();
94
85
  const { getUiCustomizationSettings, uiSettings, applySettings } = useSettings();
95
- const { blades, bladesRefs, workspaceOptions, workspaceParam, closeBlade, onParentCall, resolveLastBlade } = useBladeNavigation();
86
+ const {
87
+ blades,
88
+ bladesRefs,
89
+ workspaceOptions,
90
+ workspaceParam,
91
+ closeBlade,
92
+ onParentCall,
93
+ resolveLastBlade,
94
+ resolveBladeByName,
95
+ } = useBladeNavigation();
96
96
  const { navigationMenuComposer, toolbarComposer } = useMenuComposer();
97
97
  const { appsList, switchApp, getApps } = useAppSwitcher();
98
98
 
@@ -106,6 +106,8 @@ const isDesktop = inject<Ref<boolean>>("isDesktop");
106
106
  const isMobile = inject<Ref<boolean>>("isMobile");
107
107
  const version = import.meta.env.PACKAGE_VERSION;
108
108
  const bladeNavigationRefs = ref();
109
+ const internalRoutes = inject("bladeRoutes");
110
+ provide("internalRoutes", internalRoutes);
109
111
 
110
112
  onMounted(async () => {
111
113
  try {
@@ -162,7 +164,6 @@ const toolbarItems = computed(() =>
162
164
  },
163
165
  },
164
166
  },
165
- <% if(commonPages === true) { -%>
166
167
  {
167
168
  component: markRaw(UserDropdownButton),
168
169
  options: {
@@ -190,11 +191,9 @@ const toolbarItems = computed(() =>
190
191
  },
191
192
  isVisible: isDesktop.value,
192
193
  },
193
- <% } -%>
194
194
  ])
195
195
  );
196
196
 
197
- <% if(commonPages === true) { -%>
198
197
  const mobileMenuItems = computed(() =>
199
198
  toolbarComposer([
200
199
  {
@@ -208,11 +207,9 @@ const mobileMenuItems = computed(() =>
208
207
  },
209
208
  ])
210
209
  );
211
- <% } -%>
212
210
 
213
211
  const menuItems = reactive(
214
212
  navigationMenuComposer([
215
- <% if(dashboard === true) { -%>
216
213
  {
217
214
  title: computed(() => t("SHELL.MENU.DASHBOARD")),
218
215
  icon: "fas fa-home",
@@ -224,7 +221,6 @@ const menuItems = reactive(
224
221
  openDashboard();
225
222
  },
226
223
  },
227
- <% } -%>
228
224
  {
229
225
  title: computed(() => t("SHELL.ACCOUNT.CHANGE_PASSWORD")),
230
226
  icon: "fas fa-key",
@@ -233,15 +229,18 @@ const menuItems = reactive(
233
229
  open();
234
230
  },
235
231
  },
236
- <% if(bladeModuleStarter === true) { -%>
237
232
  {
238
- title: computed(() => t("<%= bladeModuleName.toUpperCase() %>.MENU.TITLE")),
233
+ title: computed(() => t("MODULE.MENU.TITLE")),
239
234
  icon: "fas fa-file-alt",
240
235
  isVisible: true,
241
- component: markRaw(DefaultList),
236
+ component: markRaw(List),
237
+ },
238
+ {
239
+ title: computed(() => t("DYNAMICMODULE.MENU.TITLE")),
240
+ icon: "fas fa-file-alt",
241
+ isVisible: true,
242
+ component: resolveBladeByName("DynamicItems"),
242
243
  },
243
- <% } -%>
244
- <% if(commonPages === true) { -%>
245
244
  {
246
245
  title: computed(() => t("SHELL.ACCOUNT.LOGOUT")),
247
246
  icon: "fas fa-sign-out-alt",
@@ -254,7 +253,6 @@ const menuItems = reactive(
254
253
  }
255
254
  },
256
255
  },
257
- <% } -%>
258
256
  ])
259
257
  );
260
258
 
@@ -267,16 +265,14 @@ function langInit() {
267
265
  currentLocale.value = "en";
268
266
  }
269
267
  }
270
- <% if(dashboard === true) { -%>
271
268
  const openDashboard = async () => {
272
269
  console.debug(`openDashboard() called.`);
273
270
 
274
- // Close all opened pages with onBeforeClose callback
271
+ // Close all opened pages with onBeforeClose callback
275
272
  const isPrevented = await closeBlade(0);
276
273
 
277
274
  !isPrevented && router.push("/");
278
275
  };
279
- <% } -%>
280
276
 
281
277
  async function customizationHandler() {
282
278
  await getUiCustomizationSettings();
@@ -3,12 +3,7 @@ import { createApp } from "vue";
3
3
  import { router } from "./router";
4
4
  import * as locales from "./locales";
5
5
  import { RouterView } from "vue-router";
6
- <% if(commonPages === true) { -%>
7
- import { useLogin } from "./composables";
8
- <% } -%>
9
- <% if(bladeModuleStarter === true) { -%>
10
- import Default from "./modules/default";
11
- <% } -%>
6
+ import ClassicModule from "./modules/classic-module";
12
7
 
13
8
  // Load required CSS
14
9
  import "./styles/index.scss";
@@ -22,11 +17,10 @@ async function startApp() {
22
17
  await loadUser();
23
18
 
24
19
  const app = createApp(RouterView)
25
- .use(VirtoShellFramework)
26
- <% if(bladeModuleStarter === true) { -%>
27
- .use(Default, { router })
28
- <% } -%>
29
- .use(router)
20
+ .use(VirtoShellFramework)
21
+ // Classic module based on composables, pages and components
22
+ .use(ClassicModule, { router })
23
+ .use(router);
30
24
 
31
25
  Object.entries(locales).forEach(([key, message]) => {
32
26
  app.config.globalProperties.$mergeLocaleMessage(key, message);
@@ -45,4 +39,4 @@ async function startApp() {
45
39
  app.mount("#app");
46
40
  }
47
41
 
48
- startApp()
42
+ startApp();
@@ -0,0 +1,2 @@
1
+ export { default as useList } from "./useList";
2
+ export { default as useDetails } from "./useDetails";
@@ -0,0 +1,52 @@
1
+ /* eslint-disable import/no-unresolved */
2
+ import { computed, ref } from "vue";
3
+ import img1 from "/assets/1.jpeg";
4
+ import img2 from "/assets/2.jpg";
5
+ import img3 from "/assets/3.jpg";
6
+ import { useAsync, useLoading } from "@vc-shell/framework";
7
+
8
+ export default () => {
9
+ const item = ref({
10
+ imgSrc: undefined,
11
+ name: undefined,
12
+ createdDate: undefined,
13
+ id: undefined,
14
+ });
15
+
16
+ // Example mocked method for 'fetching' list data
17
+ const { loading: itemLoading, action: getItem } = useAsync<{ id: string }>(async (payload) => {
18
+ item.value = await new Promise((resolve) => {
19
+ setTimeout(() => {
20
+ const findMockedItem = [
21
+ {
22
+ imgSrc: img1,
23
+ name: "Item 1",
24
+ createdDate: new Date(),
25
+ id: "item-id-1",
26
+ },
27
+ {
28
+ imgSrc: img2,
29
+ name: "Item 2",
30
+ createdDate: new Date(),
31
+ id: "item-id-2",
32
+ },
33
+ {
34
+ imgSrc: img3,
35
+ name: "Item 3",
36
+ createdDate: new Date(),
37
+ id: "item-id-3",
38
+ },
39
+ ].find((x) => x.id === payload.id);
40
+ resolve(findMockedItem);
41
+ }, 1000);
42
+ });
43
+ });
44
+
45
+ const loading = useLoading(itemLoading);
46
+
47
+ return {
48
+ item: computed(() => item.value),
49
+ loading: computed(() => loading.value),
50
+ getItem,
51
+ };
52
+ };
@@ -0,0 +1,51 @@
1
+ /* eslint-disable import/no-unresolved */
2
+ import { computed, ref } from "vue";
3
+ import img1 from "/assets/1.jpeg";
4
+ import img2 from "/assets/2.jpg";
5
+ import img3 from "/assets/3.jpg";
6
+ import { useAsync, useLoading } from "@vc-shell/framework";
7
+
8
+ export default () => {
9
+ const data = ref([]);
10
+
11
+ // Example mocked method for 'fetching' list data
12
+ const { loading: itemLoading, action: getItems } = useAsync(async (payload) => {
13
+ data.value = await new Promise((resolve) => {
14
+ setTimeout(
15
+ () =>
16
+ resolve([
17
+ {
18
+ imgSrc: img1,
19
+ name: "Item 1",
20
+ createdDate: new Date(),
21
+ id: "item-id-1",
22
+ },
23
+ {
24
+ imgSrc: img2,
25
+ name: "Item 2",
26
+ createdDate: new Date(),
27
+ id: "item-id-2",
28
+ },
29
+ {
30
+ imgSrc: img3,
31
+ name: "Item 3",
32
+ createdDate: new Date(),
33
+ id: "item-id-3",
34
+ },
35
+ ]),
36
+ 1000
37
+ );
38
+ });
39
+ });
40
+
41
+ const loading = useLoading(itemLoading);
42
+
43
+ return {
44
+ data: computed(() => data.value),
45
+ loading: computed(() => loading.value),
46
+ totalCount: computed(() => data.value.length),
47
+ pages: computed(() => Math.ceil(data.value.length / 20)),
48
+ currentPage: 0 / Math.max(1, 20) + 1,
49
+ getItems,
50
+ };
51
+ };
@@ -0,0 +1,9 @@
1
+ import * as pages from "./pages";
2
+ import * as locales from "./locales";
3
+ import { createAppModule } from "@vc-shell/framework";
4
+
5
+ export default createAppModule(pages, locales);
6
+
7
+ export * from "./pages";
8
+ export * from "./composables";
9
+ // export * from "./components";