@vc-shell/framework 1.1.22 → 1.1.23

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 (220) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/core/composables/useAppInsights/index.ts +11 -1
  3. package/core/composables/useBladeRegistry/index.ts +176 -0
  4. package/core/composables/useDynamicProperties/index.ts +380 -255
  5. package/core/composables/useErrorHandler/index.ts +2 -3
  6. package/core/composables/useLanguages/index.ts +78 -78
  7. package/core/plugins/modularity/index.ts +17 -6
  8. package/core/services/global-search-service/index.ts +36 -0
  9. package/dist/core/composables/useAppInsights/index.d.ts +5 -2
  10. package/dist/core/composables/useAppInsights/index.d.ts.map +1 -1
  11. package/dist/core/composables/useBladeRegistry/index.d.ts +48 -0
  12. package/dist/core/composables/useBladeRegistry/index.d.ts.map +1 -0
  13. package/dist/core/composables/useDynamicProperties/index.d.ts +12 -9
  14. package/dist/core/composables/useDynamicProperties/index.d.ts.map +1 -1
  15. package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -1
  16. package/dist/core/plugins/modularity/index.d.ts.map +1 -1
  17. package/dist/core/services/global-search-service/index.d.ts +10 -0
  18. package/dist/core/services/global-search-service/index.d.ts.map +1 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts +7 -12
  21. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
  22. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeActions.d.ts +15 -0
  23. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeActions.d.ts.map +1 -0
  24. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts +11 -0
  25. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -0
  26. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeState.d.ts +15 -0
  27. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeState.d.ts.map +1 -0
  28. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeWatchers.d.ts +6 -0
  29. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeWatchers.d.ts.map +1 -0
  30. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/routerUtils.d.ts +28 -0
  31. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/routerUtils.d.ts.map +1 -0
  32. package/dist/shared/components/blade-navigation/plugin.d.ts.map +1 -1
  33. package/dist/shared/components/blade-navigation/types/index.d.ts +5 -5
  34. package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
  35. package/dist/shared/components/notification-template/notification-template.vue.d.ts +2 -2
  36. package/dist/shared/components/notification-template/notification-template.vue.d.ts.map +1 -1
  37. package/dist/shared/components/notifications/components/notification-container/index.d.ts +6 -6
  38. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
  39. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +2 -2
  40. package/dist/shared/modules/dynamic/index.d.ts.map +1 -1
  41. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -2
  42. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts +1 -1
  43. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  44. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts +1 -1
  45. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +1 -1
  48. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
  49. package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +2 -2
  50. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +1 -1
  51. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  52. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +1 -1
  53. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  54. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +1 -1
  55. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
  56. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +2 -2
  57. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +2 -2
  58. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
  59. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +2 -2
  60. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
  61. package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts +2 -0
  62. package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts.map +1 -1
  63. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts +1 -1
  64. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  65. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +1 -1
  66. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
  67. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +1 -1
  68. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
  69. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  70. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts +1 -1
  71. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +1 -1
  72. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
  73. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts +1 -1
  74. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +1 -1
  75. package/dist/ui/components/organisms/vc-blade/vc-blade.backupsb.d.ts +3 -3
  76. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -1
  77. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  78. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
  79. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  80. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +1 -1
  81. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
  82. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +3 -3
  83. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  84. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
  85. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  86. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +1 -1
  87. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
  88. package/package.json +4 -4
  89. package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +199 -597
  90. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeActions.ts +151 -0
  91. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +243 -0
  92. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeState.ts +93 -0
  93. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeWatchers.ts +90 -0
  94. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/routerUtils.ts +150 -0
  95. package/shared/components/blade-navigation/plugin.ts +17 -12
  96. package/shared/components/blade-navigation/types/index.ts +2 -4
  97. package/shared/components/notification-template/notification-template.vue +2 -2
  98. package/shared/modules/dynamic/index.ts +2 -8
  99. package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue +4 -0
  100. package/ui/components/organisms/vc-app/vc-app.vue +11 -6
  101. package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +10 -1
  102. package/dist/apl-B2DGVGxc.js +0 -76
  103. package/dist/asciiarmor-2LVJmxlE.js +0 -34
  104. package/dist/asn1-jKiBa2Ya.js +0 -95
  105. package/dist/asterisk-DS281yxp.js +0 -271
  106. package/dist/brainfuck-C_p9pTT8.js +0 -34
  107. package/dist/clike-DGTaUp48.js +0 -620
  108. package/dist/clojure-CCKyeQKf.js +0 -800
  109. package/dist/cmake-CuaCgAKt.js +0 -28
  110. package/dist/cobol-BlTKFDRj.js +0 -72
  111. package/dist/coffeescript-BVCvwO8I.js +0 -179
  112. package/dist/commonlisp-D_kxz07b.js +0 -75
  113. package/dist/crystal-D309uH6_.js +0 -217
  114. package/dist/css-BkF-NPzE.js +0 -1553
  115. package/dist/cypher-BMq4Fwjl.js +0 -68
  116. package/dist/d-BZcgY6La.js +0 -127
  117. package/dist/diff-Cg9d_RX2.js +0 -18
  118. package/dist/dockerfile-DIy8NleC.js +0 -194
  119. package/dist/dtd-CtLokQ-U.js +0 -84
  120. package/dist/dylan-QYeExnWK.js +0 -234
  121. package/dist/ebnf-DUPDuY4r.js +0 -78
  122. package/dist/ecl-CiXN-g_D.js +0 -121
  123. package/dist/eiffel-yQhjl4T1.js +0 -110
  124. package/dist/elm-CNT9vbN0.js +0 -108
  125. package/dist/erlang-CFOYdy9e.js +0 -487
  126. package/dist/factor-DDOC7X6P.js +0 -65
  127. package/dist/fcl-CPC2WYrI.js +0 -103
  128. package/dist/forth-BmxRyE9S.js +0 -60
  129. package/dist/fortran-9bvPyrOW.js +0 -442
  130. package/dist/framework.js +0 -290
  131. package/dist/gas-cpmYfFX2.js +0 -183
  132. package/dist/gherkin-CJuwpceU.js +0 -34
  133. package/dist/groovy-DZeT_VM-.js +0 -146
  134. package/dist/haskell-Bvt3Qq1t.js +0 -375
  135. package/dist/haxe-70NVW1pR.js +0 -359
  136. package/dist/http-D9LttvKF.js +0 -44
  137. package/dist/idl-B6TRFYjl.js +0 -947
  138. package/dist/index--F0eI_oT.js +0 -75
  139. package/dist/index--KQZx7Nr.js +0 -341
  140. package/dist/index-BAngL0ix.js +0 -299
  141. package/dist/index-BQtOyLub.js +0 -58
  142. package/dist/index-Bf4s6An9.js +0 -308
  143. package/dist/index-BxrA7EzT.js +0 -288
  144. package/dist/index-C-y5H4_R.js +0 -147509
  145. package/dist/index-C_zSZ2pX.js +0 -611
  146. package/dist/index-DFdFt54f.js +0 -71
  147. package/dist/index-DI3UVoln.js +0 -93
  148. package/dist/index-DL0-yUXC.js +0 -538
  149. package/dist/index-DoHQrH4a.js +0 -98
  150. package/dist/index-DqDgL4W3.js +0 -156
  151. package/dist/index-DwjKpYAo.js +0 -137
  152. package/dist/index-d16x5dY_.js +0 -268
  153. package/dist/index-wjw1DwqR.js +0 -134
  154. package/dist/index-xCbUzsUb.js +0 -249
  155. package/dist/index.css +0 -9
  156. package/dist/javascript-C2yteZeJ.js +0 -691
  157. package/dist/jinja2-DnB6dQmV.js +0 -154
  158. package/dist/julia-DpvXAuO6.js +0 -241
  159. package/dist/livescript-CanGTf8u.js +0 -272
  160. package/dist/lua-XplVlWi_.js +0 -217
  161. package/dist/mathematica-jaRHnSxC.js +0 -35
  162. package/dist/mbox-BctzC1hL.js +0 -76
  163. package/dist/mirc-CFBPAOaF.js +0 -72
  164. package/dist/mllike-BSnXJBGA.js +0 -272
  165. package/dist/modelica-vUgVs--1.js +0 -93
  166. package/dist/mscgen-Cpl0NYLN.js +0 -104
  167. package/dist/mumps-CQoS1kWX.js +0 -25
  168. package/dist/nginx-zDPm3Z74.js +0 -89
  169. package/dist/nsis-fePjrhq7.js +0 -62
  170. package/dist/ntriples-CsNjv2QF.js +0 -79
  171. package/dist/octave-C8PmmSRH.js +0 -143
  172. package/dist/oz-Ce8aN8oE.js +0 -151
  173. package/dist/pascal-De0D6mP7.js +0 -77
  174. package/dist/perl-B4bSCe1C.js +0 -915
  175. package/dist/pig-D24Z8EXi.js +0 -54
  176. package/dist/powershell-DkYVfTzP.js +0 -249
  177. package/dist/properties-Dn9wna3M.js +0 -26
  178. package/dist/protobuf-BPIjwpzm.js +0 -49
  179. package/dist/pug-CwAQJzGR.js +0 -248
  180. package/dist/puppet-nyd4dhjf.js +0 -45
  181. package/dist/python-BkR3uSy8.js +0 -313
  182. package/dist/q-DXjKs-tC.js +0 -83
  183. package/dist/r-LKEuhEGI.js +0 -104
  184. package/dist/rpm-IznJm2Xc.js +0 -57
  185. package/dist/ruby-CcYfvIk6.js +0 -228
  186. package/dist/sas-7E8yHoCW.js +0 -105
  187. package/dist/scheme-DjibxsNh.js +0 -124
  188. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -110
  189. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
  190. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +0 -147
  191. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +0 -1
  192. package/dist/shell-C0C2sNA_.js +0 -182
  193. package/dist/sieve-Bwz7vjP5.js +0 -72
  194. package/dist/simple-mode-B0dvCdAA.js +0 -89
  195. package/dist/smalltalk-Bhddl2pB.js +0 -48
  196. package/dist/solr-BNlsLglM.js +0 -41
  197. package/dist/sparql-FarWu_Gb.js +0 -197
  198. package/dist/spreadsheet-C-cy4P5N.js +0 -49
  199. package/dist/sql-CfG5lQ3l.js +0 -282
  200. package/dist/stex-Du4h4KAU.js +0 -129
  201. package/dist/stylus-CAdqWld3.js +0 -250
  202. package/dist/swift-DSxqR9R6.js +0 -230
  203. package/dist/tcl-xfoLljhY.js +0 -81
  204. package/dist/textile-D1AWE-pc.js +0 -295
  205. package/dist/tiddlywiki-5wqsXtSk.js +0 -155
  206. package/dist/tiki-__Kn3CeS.js +0 -181
  207. package/dist/toml-BHiuTcfn.js +0 -49
  208. package/dist/troff-D2UO-fKf.js +0 -35
  209. package/dist/ttcn-Bsa4sfRm.js +0 -123
  210. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
  211. package/dist/turtle-xwJUxoPV.js +0 -80
  212. package/dist/vb-c2kQGd6-.js +0 -74
  213. package/dist/vbscript-1f_Dhg5H.js +0 -324
  214. package/dist/velocity-DJd0pTTC.js +0 -96
  215. package/dist/verilog-CiS1jyi5.js +0 -262
  216. package/dist/vhdl-T9HkrbI2.js +0 -106
  217. package/dist/webidl-CjfDENEo.js +0 -155
  218. package/dist/xquery-BUQdORAS.js +0 -422
  219. package/dist/yacas-C0absKBh.js +0 -73
  220. package/dist/z80-Pki2zAjW.js +0 -61
@@ -0,0 +1,150 @@
1
+ import { computed, shallowRef, Ref, markRaw, watch } from "vue";
2
+ import { RouteLocationNormalized, Router, LocationQuery, RouteRecordNameGeneric, RouteParamsGeneric } from "vue-router";
3
+ import type { BladeVNode } from "../../../types";
4
+
5
+ const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
6
+
7
+ // --- Router and URL Utilities Module ---
8
+ export function _createRouterUtils(router: Router, route: RouteLocationNormalized) {
9
+ const mainRouteBaseParamURL: Ref<string | undefined> = shallowRef<string>();
10
+ const routes = markRaw(router.getRoutes());
11
+
12
+ function _updateMainRouteBaseParamURL() {
13
+ const firstParamValue = Object.values(route.params)?.[0] ?? "";
14
+ mainRouteBaseParamURL.value = "/" + firstParamValue;
15
+ }
16
+ // Initial calculation
17
+ _updateMainRouteBaseParamURL();
18
+ // Update when route params change, as this might affect the base URL
19
+ watch(() => route.params, _updateMainRouteBaseParamURL, { deep: true });
20
+
21
+ function parseUrlParams(
22
+ url: string,
23
+ currentRouteParams: RouteParamsGeneric,
24
+ ): { workspace?: string; blade?: string; param?: string } | undefined {
25
+ let pathSegments = url.split("/").filter(Boolean);
26
+
27
+ const firstParamFromCurrentRoute = Object.values(currentRouteParams)?.[0];
28
+ let basePathFromCurrentRoute: string | undefined;
29
+
30
+ if (typeof firstParamFromCurrentRoute === "string" && firstParamFromCurrentRoute) {
31
+ basePathFromCurrentRoute = "/" + firstParamFromCurrentRoute;
32
+ }
33
+
34
+ // If the URL starts with the determined base path (like a UUID tenant ID from currentRouteParams),
35
+ // we should parse the segments *after* it for workspace, blade, param.
36
+ if (basePathFromCurrentRoute && basePathFromCurrentRoute !== "/" && url.startsWith(basePathFromCurrentRoute)) {
37
+ const baseSegmentsCount = basePathFromCurrentRoute.split("/").filter(Boolean).length;
38
+ pathSegments = pathSegments.slice(baseSegmentsCount);
39
+ }
40
+ // Now, pathSegments should contain parts of the URL after the base parameter,
41
+ // e.g., ["workspace-name", "blade-name", "item-id"] or ["workspace-name"], etc.
42
+
43
+ if (pathSegments.length === 0) {
44
+ // This means the path was likely just the base parameter itself (e.g., "/some-uuid/")
45
+ // or an empty path "/".
46
+ // parseUrlParams returns undefined for workspace, blade, param in this case.
47
+ // routeResolver will handle this, typically by navigating to a default workspace or root.
48
+ return { workspace: undefined, blade: undefined, param: undefined };
49
+ }
50
+
51
+ // The first segment after the base is potentially the workspace.
52
+ // The second is potentially the blade.
53
+ // The third is potentially the param.
54
+ // Validation of these segments against actual components happens later in routeResolver.
55
+ const workspace = pathSegments[0];
56
+ const blade = pathSegments[1];
57
+ const param = pathSegments[2];
58
+
59
+ return { workspace, blade, param };
60
+ }
61
+
62
+ function parseWorkspaceUrlPath(path: string): string {
63
+ _updateMainRouteBaseParamURL(); // Ensure base URL is current
64
+ const pathWithoutBase = path.startsWith(mainRouteBaseParamURL.value || "###") // Use unlikely string if base is undefined
65
+ ? path.slice((mainRouteBaseParamURL.value || "").length)
66
+ : path;
67
+ const segments = pathWithoutBase.split("/").filter(Boolean);
68
+ const workspaceUrl = segments.slice(0, 1).join("/");
69
+ return "/" + workspaceUrl;
70
+ }
71
+
72
+ function getURLQuery(): { params: string; obj: LocationQuery } {
73
+ if (route.query && Object.keys(route.query).length) {
74
+ return {
75
+ params: new URLSearchParams(route.query as Record<string, string>).toString(),
76
+ obj: route.query,
77
+ };
78
+ }
79
+ // Fallback for scenarios where route.query might not be populated (e.g., initial load before router is fully ready)
80
+ const hash = window.location.hash || "#";
81
+ const queryPart = hash.split("?")[1] || "";
82
+ const params = new URLSearchParams(queryPart).toString();
83
+ return { params, obj: Object.fromEntries(new URLSearchParams(queryPart)) };
84
+ }
85
+
86
+ function constructBladePath(workspace: BladeVNode, lastBlade?: BladeVNode): string | undefined {
87
+ const wsBladeUrl = workspace?.type.url;
88
+
89
+ if (!wsBladeUrl) {
90
+ return undefined;
91
+ }
92
+
93
+ // Normalize workspace URL (e.g., "products" -> "/products")
94
+ // Ensure basePath starts with a slash and does not end with one (unless it's just "/")
95
+ let basePath = wsBladeUrl.startsWith("/") ? wsBladeUrl : "/" + wsBladeUrl;
96
+ if (basePath.endsWith("/") && basePath.length > 1) {
97
+ basePath = basePath.slice(0, -1);
98
+ }
99
+
100
+ if (lastBlade && lastBlade.type.url && lastBlade.type.url !== wsBladeUrl) {
101
+ // This is a child blade different from the workspace
102
+ let childPathSegment = lastBlade.type.url;
103
+ const param = lastBlade.props?.param;
104
+
105
+ // Normalize childPathSegment (e.g., "details" -> "/details")
106
+ if (!childPathSegment.startsWith("/")) {
107
+ childPathSegment = "/" + childPathSegment;
108
+ }
109
+
110
+ let fullPath = basePath + childPathSegment;
111
+
112
+ if (param) {
113
+ fullPath += "/" + String(param);
114
+ }
115
+ return fullPath;
116
+ } else {
117
+ // This is just the workspace, or lastBlade is the workspace itself, or lastBlade has no distinct URL.
118
+ // The param should be taken from lastBlade if it's the one defining the current end of the path,
119
+ // otherwise from the workspace's own props.
120
+ const param = lastBlade ? lastBlade.props?.param : workspace.props?.param;
121
+ if (param) {
122
+ return basePath + "/" + String(param);
123
+ }
124
+ return basePath;
125
+ }
126
+ }
127
+
128
+ function getResolvedRouteComponent(path: string): BladeVNode | undefined {
129
+ return router.resolve({ path })?.matched?.[1]?.components?.default as BladeVNode | undefined;
130
+ }
131
+
132
+ return {
133
+ mainRouteBaseParamURL: computed(() => mainRouteBaseParamURL.value),
134
+ parseUrlParams,
135
+ parseWorkspaceUrlPath,
136
+ getURLQuery,
137
+ constructBladePath,
138
+ getResolvedRouteComponent,
139
+ allRoutes: routes,
140
+ goToRoot: () => {
141
+ const mainRoute = routes.find((r) => r.meta?.root);
142
+ const mainRouteAlias = routes.find((r) => r.aliasOf?.path === mainRoute?.path) || mainRoute;
143
+ if (mainRouteAlias?.name) {
144
+ return { name: mainRouteAlias.name as RouteRecordNameGeneric, params: route.params as RouteParamsGeneric };
145
+ }
146
+ console.error("goToRoot: Main route or its alias with a name not found!");
147
+ return { path: "/" };
148
+ },
149
+ };
150
+ }
@@ -1,7 +1,7 @@
1
1
  import { Router } from "vue-router";
2
- import { App, inject, ref } from "vue";
2
+ import { App, ref } from "vue";
3
3
  import * as components from "./components";
4
- import { BladeNavigationPlugin, BladeRoutesRecord } from "./types";
4
+ import { BladeNavigationPlugin } from "./types";
5
5
 
6
6
  // Declare globally
7
7
  declare module "@vue/runtime-core" {
@@ -14,22 +14,27 @@ export let bladeNavigationInstance: BladeNavigationPlugin;
14
14
 
15
15
  export const VcBladeNavigationComponent = {
16
16
  install(app: App, args: { router: Router }) {
17
- // Register components
17
+ // Register framework's own blade UI components like VcBladeNavigation
18
18
  Object.entries(components).forEach(([componentName, component]) => {
19
19
  app.component(componentName, component);
20
20
  });
21
21
 
22
- const internalRoutes = app.runWithContext(() => inject("bladeRoutes")) as BladeRoutesRecord[];
23
-
24
- // Plugin
25
- const bladeNavigationPlugin: BladeNavigationPlugin = {
22
+ // The plugin instance primarily provides the router.
23
+ // Blade resolution is now handled by useBladeNavigation via useBladeRegistry.
24
+ const bladeNavigationPluginData: BladeNavigationPlugin = {
26
25
  router: args.router,
27
- internalRoutes,
28
- blades: ref([]),
26
+ // blades: ref([]), // This state was for useBladeNavigation, it should manage its own state internally or via its singleton.
27
+ // If blades ref is truly global and shared, it needs careful consideration.
28
+ // For now, assuming blade state management is within useBladeNavigationSingleton.
29
29
  };
30
30
 
31
- app.config.globalProperties.$bladeNavigationPlugin = bladeNavigationPlugin;
32
- bladeNavigationInstance = bladeNavigationPlugin;
33
- app.provide("bladeNavigationPlugin", bladeNavigationPlugin);
31
+ // This global instance is used as a fallback in useBladeNavigation.
32
+ // It should contain at least what useBladeNavigation might try to access from it.
33
+ // Primarily, the router.
34
+ bladeNavigationInstance = bladeNavigationPluginData;
35
+
36
+ // Provide the plugin instance (mainly for the router) for useBladeNavigation to inject.
37
+ // useBladeNavigation can then also useBladeRegistry() independently.
38
+ app.provide("bladeNavigationPlugin", bladeNavigationPluginData);
34
39
  },
35
40
  };
@@ -80,7 +80,7 @@ export type BladeInstanceConstructor<T extends Component = Component> = Extracto
80
80
  CoreBladeAdditionalSettings;
81
81
 
82
82
  export interface IBladeEvent<T extends Component = Component> {
83
- blade: BladeInstanceConstructor<T>;
83
+ blade: BladeInstanceConstructor<T> | { name: string } | undefined;
84
84
  options?: ExtractedBladeOptions<InstanceType<BladeInstanceConstructor<T>>["$props"], "options">;
85
85
  param?: string;
86
86
  onOpen?: () => void;
@@ -90,12 +90,10 @@ export interface IBladeEvent<T extends Component = Component> {
90
90
 
91
91
  export interface BladeNavigationPlugin {
92
92
  router: Router;
93
- internalRoutes: BladeRoutesRecord[];
94
- blades: Ref<BladeVNode[]>;
95
93
  }
96
94
 
97
95
  export interface BladeRoutesRecord {
98
- component: BladeVNode;
96
+ component: BladeInstanceConstructor;
99
97
  name: string;
100
98
  isWorkspace: boolean;
101
99
  route: string;
@@ -30,13 +30,13 @@
30
30
  <script setup lang="ts">
31
31
  import { computed } from "vue";
32
32
  import moment from "moment";
33
- import { PushNotification } from "../../../core/api/platform";
33
+ import { IPushNotification } from "../../../core/api/platform";
34
34
 
35
35
  export interface Props {
36
36
  color?: string;
37
37
  icon?: string;
38
38
  title: string;
39
- notification: PushNotification;
39
+ notification: IPushNotification;
40
40
  }
41
41
 
42
42
  const props = defineProps<Props>();
@@ -55,18 +55,12 @@ const createBladeInstanceConstructor = (
55
55
  existingComposables?: { [key: string]: (...args: any[]) => any },
56
56
  existingMixins?: ((...args: any[]) => any)[],
57
57
  ) => {
58
- if (json.settings.url) {
59
- const rawUrl = json.settings.url as `/${string}`;
60
- bladeComponent.url = rawUrl;
61
- }
62
-
63
- if (json.settings.permissions) {
64
- bladeComponent.permissions = json.settings.permissions;
65
- }
66
58
 
67
59
  return defineComponent({
68
60
  ...bladeComponent,
69
61
  name: bladeName,
62
+ url: json.settings.url ? (json.settings.url as `/${string}`) : undefined,
63
+ permissions: json.settings.permissions,
70
64
  isWorkspace: "isWorkspace" in json.settings && json.settings.isWorkspace,
71
65
  menuItem: ("menuItem" in json.settings && json.settings.menuItem) ?? undefined,
72
66
  moduleUid: args.moduleUid,
@@ -11,6 +11,8 @@
11
11
  :required="required"
12
12
  :model-value="option"
13
13
  :tooltip="tooltip"
14
+ :multilanguage="multilanguage"
15
+ :current-language="currentLanguage"
14
16
  @update:model-value="$emit('update:option', $event)"
15
17
  >
16
18
  <template #option="scope">
@@ -202,6 +204,8 @@ export interface Props {
202
204
  * Default: text
203
205
  */
204
206
  inputType?: "text" | "password" | "email" | "tel" | "number" | "integer" | "url" | "time" | "date" | "datetime-local";
207
+ multilanguage?: boolean;
208
+ currentLanguage?: string;
205
209
  }
206
210
 
207
211
  export interface Emits {
@@ -192,12 +192,17 @@ const onMenuItemClick = function (item: MenuItem) {
192
192
  console.debug(`vc-app#onMenuItemClick() called.`);
193
193
 
194
194
  if (item.routeId) {
195
- openBlade(
196
- {
197
- blade: resolveBladeByName(item.routeId),
198
- },
199
- true,
200
- );
195
+ const bladeComponent = resolveBladeByName(item.routeId);
196
+ if (bladeComponent) {
197
+ openBlade(
198
+ {
199
+ blade: bladeComponent,
200
+ },
201
+ true,
202
+ );
203
+ } else {
204
+ console.error(`Blade component with routeId '${item.routeId}' not found.`);
205
+ }
201
206
  } else if (!item.routeId && item.url) {
202
207
  const menuRoute = routes.find((r) => {
203
208
  return "/" + r.path.split("/").filter((part) => part !== "")[1] === item.url || r.path === item.url;
@@ -199,6 +199,8 @@
199
199
  option-label="displayName"
200
200
  option-value="id"
201
201
  input-type="number"
202
+ :multilanguage="multilanguage"
203
+ :current-language="currentLanguage"
202
204
  :label="computedProperty.displayName"
203
205
  :placeholder="computedProperty.placeholder"
204
206
  :required="computedProperty.required"
@@ -213,7 +215,7 @@
213
215
  @keydown.enter.stop.prevent="scope.toggleHandler"
214
216
  @keydown.space.stop.prevent="scope.toggleHandler"
215
217
  >
216
- {{ measurementOptions?.find((e) => e.id === measureUnit)?.displaySymbol }}
218
+ {{ measurementSymbol }}
217
219
  </button>
218
220
  </template>
219
221
  </VcInputDropdown>
@@ -318,6 +320,13 @@ watch(
318
320
  },
319
321
  );
320
322
 
323
+ const measurementSymbol = computed(() => {
324
+ const option = measurementOptions.value.find((x) => x.id === measureUnit.value);
325
+ const displaySymbol = option?.displaySymbol;
326
+ const localizedSymbol = option?.localizedSymbol.values[props.currentLanguage as string];
327
+ return localizedSymbol ? localizedSymbol : displaySymbol;
328
+ });
329
+
321
330
  const computedProperty = computed(() => {
322
331
  const rules: IValidationRules = {};
323
332
  if (props.required) {
@@ -1,76 +0,0 @@
1
- var l = {
2
- "+": ["conjugate", "add"],
3
- "−": ["negate", "subtract"],
4
- "×": ["signOf", "multiply"],
5
- "÷": ["reciprocal", "divide"],
6
- "⌈": ["ceiling", "greaterOf"],
7
- "⌊": ["floor", "lesserOf"],
8
- "∣": ["absolute", "residue"],
9
- "⍳": ["indexGenerate", "indexOf"],
10
- "?": ["roll", "deal"],
11
- "⋆": ["exponentiate", "toThePowerOf"],
12
- "⍟": ["naturalLog", "logToTheBase"],
13
- "○": ["piTimes", "circularFuncs"],
14
- "!": ["factorial", "binomial"],
15
- "⌹": ["matrixInverse", "matrixDivide"],
16
- "<": [null, "lessThan"],
17
- "≤": [null, "lessThanOrEqual"],
18
- "=": [null, "equals"],
19
- ">": [null, "greaterThan"],
20
- "≥": [null, "greaterThanOrEqual"],
21
- "≠": [null, "notEqual"],
22
- "≡": ["depth", "match"],
23
- "≢": [null, "notMatch"],
24
- "∈": ["enlist", "membership"],
25
- "⍷": [null, "find"],
26
- "∪": ["unique", "union"],
27
- "∩": [null, "intersection"],
28
- "∼": ["not", "without"],
29
- "∨": [null, "or"],
30
- "∧": [null, "and"],
31
- "⍱": [null, "nor"],
32
- "⍲": [null, "nand"],
33
- "⍴": ["shapeOf", "reshape"],
34
- ",": ["ravel", "catenate"],
35
- "⍪": [null, "firstAxisCatenate"],
36
- "⌽": ["reverse", "rotate"],
37
- "⊖": ["axis1Reverse", "axis1Rotate"],
38
- "⍉": ["transpose", null],
39
- "↑": ["first", "take"],
40
- "↓": [null, "drop"],
41
- "⊂": ["enclose", "partitionWithAxis"],
42
- "⊃": ["diclose", "pick"],
43
- "⌷": [null, "index"],
44
- "⍋": ["gradeUp", null],
45
- "⍒": ["gradeDown", null],
46
- "⊤": ["encode", null],
47
- "⊥": ["decode", null],
48
- "⍕": ["format", "formatByExample"],
49
- "⍎": ["execute", null],
50
- "⊣": ["stop", "left"],
51
- "⊢": ["pass", "right"]
52
- }, t = /[\.\/⌿⍀¨⍣]/, a = /⍬/, i = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/, u = /←/, o = /[⍝#].*$/, s = function(r) {
53
- var n;
54
- return n = !1, function(e) {
55
- return n = e, e === r ? n === "\\" : !0;
56
- };
57
- };
58
- const f = {
59
- name: "apl",
60
- startState: function() {
61
- return {
62
- prev: !1,
63
- func: !1,
64
- op: !1,
65
- string: !1,
66
- escape: !1
67
- };
68
- },
69
- token: function(r, n) {
70
- var e;
71
- return r.eatSpace() ? null : (e = r.next(), e === '"' || e === "'" ? (r.eatWhile(s(e)), r.next(), n.prev = !0, "string") : /[\[{\(]/.test(e) ? (n.prev = !1, null) : /[\]}\)]/.test(e) ? (n.prev = !0, null) : a.test(e) ? (n.prev = !1, "atom") : /[¯\d]/.test(e) ? (n.func ? (n.func = !1, n.prev = !1) : n.prev = !0, r.eatWhile(/[\w\.]/), "number") : t.test(e) || u.test(e) ? "operator" : i.test(e) ? (n.func = !0, n.prev = !1, l[e] ? "variableName.function.standard" : "variableName.function") : o.test(e) ? (r.skipToEnd(), "comment") : e === "∘" && r.peek() === "." ? (r.next(), "variableName.function") : (r.eatWhile(/[\w\$_]/), n.prev = !0, "keyword"));
72
- }
73
- };
74
- export {
75
- f as apl
76
- };
@@ -1,34 +0,0 @@
1
- function t(e) {
2
- var r = e.match(/^\s*\S/);
3
- return e.skipToEnd(), r ? "error" : null;
4
- }
5
- const i = {
6
- name: "asciiarmor",
7
- token: function(e, r) {
8
- var n;
9
- if (r.state == "top")
10
- return e.sol() && (n = e.match(/^-----BEGIN (.*)?-----\s*$/)) ? (r.state = "headers", r.type = n[1], "tag") : t(e);
11
- if (r.state == "headers") {
12
- if (e.sol() && e.match(/^\w+:/))
13
- return r.state = "header", "atom";
14
- var o = t(e);
15
- return o && (r.state = "body"), o;
16
- } else {
17
- if (r.state == "header")
18
- return e.skipToEnd(), r.state = "headers", "string";
19
- if (r.state == "body")
20
- return e.sol() && (n = e.match(/^-----END (.*)?-----\s*$/)) ? n[1] != r.type ? "error" : (r.state = "end", "tag") : e.eatWhile(/[A-Za-z0-9+\/=]/) ? null : (e.next(), "error");
21
- if (r.state == "end")
22
- return t(e);
23
- }
24
- },
25
- blankLine: function(e) {
26
- e.state == "headers" && (e.state = "body");
27
- },
28
- startState: function() {
29
- return { state: "top", type: null };
30
- }
31
- };
32
- export {
33
- i as asciiArmor
34
- };
@@ -1,95 +0,0 @@
1
- function u(i) {
2
- for (var s = {}, c = i.split(" "), T = 0; T < c.length; ++T) s[c[T]] = !0;
3
- return s;
4
- }
5
- const o = {
6
- keywords: u("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS"),
7
- cmipVerbs: u("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
8
- compareTypes: u("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION"),
9
- status: u("current deprecated mandatory obsolete"),
10
- tags: u("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL"),
11
- storage: u("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminString TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
12
- modifier: u("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED"),
13
- accessTypes: u("not-accessible accessible-for-notify read-only read-create read-write"),
14
- multiLineStrings: !0
15
- };
16
- function g(i) {
17
- var s = i.keywords || o.keywords, c = i.cmipVerbs || o.cmipVerbs, T = i.compareTypes || o.compareTypes, N = i.status || o.status, d = i.tags || o.tags, f = i.storage || o.storage, m = i.modifier || o.modifier, C = i.accessTypes || o.accessTypes;
18
- i.multiLineStrings || o.multiLineStrings;
19
- var R = i.indentStatements !== !1, A = /[\|\^]/, E;
20
- function y(e, n) {
21
- var t = e.next();
22
- if (t == '"' || t == "'")
23
- return n.tokenize = D(t), n.tokenize(e, n);
24
- if (/[\[\]\(\){}:=,;]/.test(t))
25
- return E = t, "punctuation";
26
- if (t == "-" && e.eat("-"))
27
- return e.skipToEnd(), "comment";
28
- if (/\d/.test(t))
29
- return e.eatWhile(/[\w\.]/), "number";
30
- if (A.test(t))
31
- return e.eatWhile(A), "operator";
32
- e.eatWhile(/[\w\-]/);
33
- var r = e.current();
34
- return s.propertyIsEnumerable(r) ? "keyword" : c.propertyIsEnumerable(r) ? "variableName" : T.propertyIsEnumerable(r) ? "atom" : N.propertyIsEnumerable(r) ? "comment" : d.propertyIsEnumerable(r) ? "typeName" : f.propertyIsEnumerable(r) || m.propertyIsEnumerable(r) || C.propertyIsEnumerable(r) ? "modifier" : "variableName";
35
- }
36
- function D(e) {
37
- return function(n, t) {
38
- for (var r = !1, S, O = !1; (S = n.next()) != null; ) {
39
- if (S == e && !r) {
40
- var I = n.peek();
41
- I && (I = I.toLowerCase(), (I == "b" || I == "h" || I == "o") && n.next()), O = !0;
42
- break;
43
- }
44
- r = !r && S == "\\";
45
- }
46
- return O && (t.tokenize = null), "string";
47
- };
48
- }
49
- function p(e, n, t, r, S) {
50
- this.indented = e, this.column = n, this.type = t, this.align = r, this.prev = S;
51
- }
52
- function a(e, n, t) {
53
- var r = e.indented;
54
- return e.context && e.context.type == "statement" && (r = e.context.indented), e.context = new p(r, n, t, null, e.context);
55
- }
56
- function l(e) {
57
- var n = e.context.type;
58
- return (n == ")" || n == "]" || n == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
59
- }
60
- return {
61
- name: "asn1",
62
- startState: function() {
63
- return {
64
- tokenize: null,
65
- context: new p(-2, 0, "top", !1),
66
- indented: 0,
67
- startOfLine: !0
68
- };
69
- },
70
- token: function(e, n) {
71
- var t = n.context;
72
- if (e.sol() && (t.align == null && (t.align = !1), n.indented = e.indentation(), n.startOfLine = !0), e.eatSpace()) return null;
73
- E = null;
74
- var r = (n.tokenize || y)(e, n);
75
- if (r == "comment") return r;
76
- if (t.align == null && (t.align = !0), (E == ";" || E == ":" || E == ",") && t.type == "statement")
77
- l(n);
78
- else if (E == "{") a(n, e.column(), "}");
79
- else if (E == "[") a(n, e.column(), "]");
80
- else if (E == "(") a(n, e.column(), ")");
81
- else if (E == "}") {
82
- for (; t.type == "statement"; ) t = l(n);
83
- for (t.type == "}" && (t = l(n)); t.type == "statement"; ) t = l(n);
84
- } else E == t.type ? l(n) : R && ((t.type == "}" || t.type == "top") && E != ";" || t.type == "statement" && E == "newstatement") && a(n, e.column(), "statement");
85
- return n.startOfLine = !1, r;
86
- },
87
- languageData: {
88
- indentOnInput: /^\s*[{}]$/,
89
- commentTokens: { line: "--" }
90
- }
91
- };
92
- }
93
- export {
94
- g as asn1
95
- };