@vc-shell/framework 1.0.210 → 1.0.212

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../shared/components/blade-navigation/composables/useBladeNavigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,SAAS,EAA0B,WAAW,EAAS,MAAM,KAAK,CAAC;AAIxH,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,eAAe,EACf,WAAW,EAGZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,UAAU,EACV,WAAW,EACX,eAAe,EACf,wBAAwB,EAGzB,MAAM,aAAa,CAAC;AAIrB,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAG9C,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACpF,SAAS,EAAE,CAAC,KAAK,SAAS,SAAS,EACjC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,EAC9D,WAAW,CAAC,EAAE,OAAO,KAClB,OAAO,CAAC,IAAI,GAAG,iBAAiB,CAAC,CAAC;IACvC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,YAAY,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACzF,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IAChE,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,wBAAwB,CAAC;IAC/D,aAAa,EAAE,CAAC,EAAE,EAAE,uBAAuB,KACvC,OAAO,CACH;QACE,IAAI,EAAE,eAAe,GAAG,SAAS,CAAC;QAClC,MAAM,EAAE,WAAW,CAAC;KACrB,GACD,SAAS,CACZ,GACD,SAAS,CAAC;IACd,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACrE,kBAAkB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;CACvE;AAiND,wBAAgB,kBAAkB,IAAI,mBAAmB,CAqUxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../shared/components/blade-navigation/composables/useBladeNavigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EAIT,WAAW,EAGZ,MAAM,KAAK,CAAC;AAIb,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,eAAe,EACf,WAAW,EAGZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,UAAU,EACV,WAAW,EACX,eAAe,EACf,wBAAwB,EAGzB,MAAM,aAAa,CAAC;AAIrB,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAG9C,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACpF,SAAS,EAAE,CAAC,KAAK,SAAS,SAAS,EACjC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,EAC9D,WAAW,CAAC,EAAE,OAAO,KAClB,OAAO,CAAC,IAAI,GAAG,iBAAiB,CAAC,CAAC;IACvC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,YAAY,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACzF,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IAChE,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,wBAAwB,CAAC;IAC/D,aAAa,EAAE,CAAC,EAAE,EAAE,uBAAuB,KACvC,OAAO,CACH;QACE,IAAI,EAAE,eAAe,GAAG,SAAS,CAAC;QAClC,MAAM,EAAE,WAAW,CAAC;KACrB,GACD,SAAS,CACZ,GACD,SAAS,CAAC;IACd,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACrE,kBAAkB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;CACvE;AAiND,wBAAgB,kBAAkB,IAAI,mBAAmB,CAgVxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/framework",
3
- "version": "1.0.210",
3
+ "version": "1.0.212",
4
4
  "type": "module",
5
5
  "main": "./dist/framework.js",
6
6
  "types": "./dist/index.d.ts",
@@ -59,9 +59,9 @@
59
59
  "devDependencies": {
60
60
  "@types/dompurify": "^3.0.5",
61
61
  "@types/quill": "^2.0.14",
62
- "@vc-shell/api-client-generator": "^1.0.210",
63
- "@vc-shell/config-generator": "^1.0.210",
64
- "@vc-shell/ts-config": "^1.0.210",
62
+ "@vc-shell/api-client-generator": "^1.0.212",
63
+ "@vc-shell/config-generator": "^1.0.212",
64
+ "@vc-shell/ts-config": "^1.0.212",
65
65
  "@vitejs/plugin-vue": "^5.0.3",
66
66
  "sass": "^1.69.6",
67
67
  "shx": "^0.3.4",
@@ -1,6 +1,18 @@
1
- import { computed, getCurrentInstance, inject, warn, Component, isVNode, h, shallowRef, ComputedRef, watch } from "vue";
1
+ import {
2
+ computed,
3
+ getCurrentInstance,
4
+ inject,
5
+ warn,
6
+ Component,
7
+ isVNode,
8
+ h,
9
+ shallowRef,
10
+ ComputedRef,
11
+ watch,
12
+ reactive,
13
+ } from "vue";
2
14
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { createSharedComposable, reactiveComputed, watchDebounced } from "@vueuse/core";
15
+ import { createSharedComposable, reactifyObject, reactiveComputed, toValue, watchDebounced } from "@vueuse/core";
4
16
  import * as _ from "lodash-es";
5
17
  import {
6
18
  RouteLocationNormalized,
@@ -276,13 +288,24 @@ export function useBladeNavigation(): IUseBladeNavigation {
276
288
  query: LocationQuery | undefined = undefined,
277
289
  params: RouteParams = {},
278
290
  ) {
279
- const createdComponent = h(blade, {
280
- param,
281
- options,
282
- navigation: {
283
- idx: 0,
284
- },
285
- }) as BladeVNode;
291
+ const createdComponent = h(
292
+ blade,
293
+ reactifyObject({
294
+ param: computed(() => {
295
+ const isChildWithSameParamOpened = navigationInstance.blades.value.some(
296
+ (x) => x.props?.param === toValue(param),
297
+ );
298
+ if (isChildWithSameParamOpened) {
299
+ return toValue(param);
300
+ }
301
+ return undefined;
302
+ }) as unknown as string,
303
+ options,
304
+ navigation: {
305
+ idx: 0,
306
+ },
307
+ }),
308
+ ) as BladeVNode;
286
309
 
287
310
  try {
288
311
  // Close all blades except the first one cause it will be overwritten
@@ -483,7 +506,7 @@ export function useBladeNavigation(): IUseBladeNavigation {
483
506
  // Open the workspace component with param or workspace route.
484
507
  if (registeredWorkspaceComponent) {
485
508
  await openWorkspace(
486
- {
509
+ reactifyObject({
487
510
  blade: registeredWorkspaceComponent as unknown as BladeInstanceConstructor,
488
511
  param: computed(() => {
489
512
  if (
@@ -494,7 +517,7 @@ export function useBladeNavigation(): IUseBladeNavigation {
494
517
  }
495
518
  return undefined;
496
519
  }) as unknown as string,
497
- },
520
+ }),
498
521
  getURLQuery().obj,
499
522
  params,
500
523
  );
@@ -272,7 +272,7 @@ const toolbarComputed =
272
272
  method: "updateActiveWidgetCount",
273
273
  });
274
274
 
275
- if (!props.param) {
275
+ if (!unref(props.param)) {
276
276
  emit("close:blade");
277
277
  }
278
278
  }
@@ -287,7 +287,7 @@ const toolbarComputed =
287
287
  )
288
288
  ) {
289
289
  if (props.param) {
290
- await remove?.({ id: props.param });
290
+ await remove?.({ id: unref(props.param) });
291
291
  emit("parent:call", {
292
292
  method: "reload",
293
293
  });
@@ -329,8 +329,8 @@ async function updateActiveWidgetCount() {
329
329
  }
330
330
 
331
331
  async function init() {
332
- if (props.param) {
333
- await load({ id: props.param });
332
+ if (props.param && unref(props.param)) {
333
+ await load({ id: unref(props.param) });
334
334
  }
335
335
 
336
336
  await nextTick(() => {
@@ -392,7 +392,7 @@ onBeforeMount(async () => {
392
392
  watch(
393
393
  () => props.param,
394
394
  async (newVal) => {
395
- selectedItemId.value = newVal;
395
+ selectedItemId.value = unref(newVal);
396
396
  },
397
397
  { immediate: true },
398
398
  );