@iris-ui-kit/vue 0.2.21 → 0.2.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 (70) hide show
  1. package/dist/admin.cjs +14 -5
  2. package/dist/admin.cjs.map +1 -1
  3. package/dist/admin.js +2 -2
  4. package/dist/async.cjs +48 -2
  5. package/dist/async.cjs.map +1 -1
  6. package/dist/async.d.cts +27 -3
  7. package/dist/async.d.ts +27 -3
  8. package/dist/async.js +1 -1
  9. package/dist/behaviors.cjs +87 -48
  10. package/dist/behaviors.cjs.map +1 -1
  11. package/dist/behaviors.d.cts +2 -2
  12. package/dist/behaviors.d.ts +2 -2
  13. package/dist/behaviors.js +1 -1
  14. package/dist/chunk-25NYWSXP.js +20 -0
  15. package/dist/chunk-25NYWSXP.js.map +1 -0
  16. package/dist/{chunk-CWXH44OF.js → chunk-3IH7IJ5S.js} +90 -51
  17. package/dist/chunk-3IH7IJ5S.js.map +1 -0
  18. package/dist/{chunk-ENKE2BPC.js → chunk-BEPH6PPL.js} +23 -5
  19. package/dist/chunk-BEPH6PPL.js.map +1 -0
  20. package/dist/{chunk-FG5USQSY.js → chunk-I7PR4ILF.js} +8 -3
  21. package/dist/chunk-I7PR4ILF.js.map +1 -0
  22. package/dist/{chunk-4FLIW67H.js → chunk-IAG64CHL.js} +21 -28
  23. package/dist/chunk-IAG64CHL.js.map +1 -0
  24. package/dist/chunk-NNOF7KUH.js +24 -0
  25. package/dist/chunk-NNOF7KUH.js.map +1 -0
  26. package/dist/{chunk-4WQOZ2OV.js → chunk-QQ25RKOO.js} +6 -4
  27. package/dist/chunk-QQ25RKOO.js.map +1 -0
  28. package/dist/chunk-SJB5DIIY.js +119 -0
  29. package/dist/chunk-SJB5DIIY.js.map +1 -0
  30. package/dist/form.cjs +28 -23
  31. package/dist/form.cjs.map +1 -1
  32. package/dist/form.d.cts +3 -2
  33. package/dist/form.d.ts +3 -2
  34. package/dist/form.js +2 -1
  35. package/dist/index.cjs +216 -91
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.js +29 -18
  38. package/dist/index.js.map +1 -1
  39. package/dist/machine.cjs +11 -4
  40. package/dist/machine.cjs.map +1 -1
  41. package/dist/machine.d.cts +12 -3
  42. package/dist/machine.d.ts +12 -3
  43. package/dist/machine.js +1 -1
  44. package/dist/resource.cjs +7 -3
  45. package/dist/resource.cjs.map +1 -1
  46. package/dist/resource.d.cts +10 -1
  47. package/dist/resource.d.ts +10 -1
  48. package/dist/resource.js +1 -1
  49. package/dist/skeletons.cjs +21 -3
  50. package/dist/skeletons.cjs.map +1 -1
  51. package/dist/skeletons.d.cts +21 -0
  52. package/dist/skeletons.d.ts +21 -0
  53. package/dist/skeletons.js +1 -1
  54. package/dist/undo.cjs +6 -1
  55. package/dist/undo.cjs.map +1 -1
  56. package/dist/undo.d.cts +5 -0
  57. package/dist/undo.d.ts +5 -0
  58. package/dist/undo.js +1 -1
  59. package/package.json +1 -1
  60. package/dist/chunk-4FLIW67H.js.map +0 -1
  61. package/dist/chunk-4WQOZ2OV.js.map +0 -1
  62. package/dist/chunk-CWXH44OF.js.map +0 -1
  63. package/dist/chunk-ENKE2BPC.js.map +0 -1
  64. package/dist/chunk-FG5USQSY.js.map +0 -1
  65. package/dist/chunk-TQB5LVOH.js +0 -17
  66. package/dist/chunk-TQB5LVOH.js.map +0 -1
  67. package/dist/chunk-XSLBANUV.js +0 -16
  68. package/dist/chunk-XSLBANUV.js.map +0 -1
  69. package/dist/chunk-ZY4NLITM.js +0 -73
  70. package/dist/chunk-ZY4NLITM.js.map +0 -1
package/dist/machine.cjs CHANGED
@@ -3,14 +3,21 @@
3
3
  var vue = require('vue');
4
4
 
5
5
  // src/machine/useMachine.ts
6
- function useMachine(machine) {
6
+ function useMachine(machine, options = {}) {
7
7
  const state = vue.ref(machine.store.getState());
8
8
  const unsubscribe = machine.store.subscribe((next) => {
9
9
  state.value = next;
10
10
  });
11
- vue.onBeforeUnmount(() => {
12
- unsubscribe();
13
- });
11
+ vue.onScopeDispose(
12
+ () => {
13
+ unsubscribe();
14
+ if (options.stopOnUnmount !== false) machine.stop();
15
+ },
16
+ // failSilently: outside any effect scope there is nothing to dispose —
17
+ // registering is a no-op and must not emit the "no active effect scope"
18
+ // dev warning. Within a component/effectScope this arg changes nothing.
19
+ true
20
+ );
14
21
  return { state, send: machine.send };
15
22
  }
16
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/machine/useMachine.ts"],"names":["ref","onBeforeUnmount"],"mappings":";;;;;AAYO,SAAS,WACd,OAAA,EAIA;AACA,EAAA,MAAM,KAAA,GAAQA,OAAA,CAAI,OAAA,CAAQ,KAAA,CAAM,UAAU,CAAA;AAC1C,EAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,CAAM,SAAA,CAAU,CAAC,IAAA,KAAS;AACpD,IAAA,KAAA,CAAM,KAAA,GAAQ,IAAA;AAAA,EAChB,CAAC,CAAA;AACD,EAAAC,mBAAA,CAAgB,MAAM;AACpB,IAAA,WAAA,EAAY;AAAA,EACd,CAAC,CAAA;AACD,EAAA,OAAO,EAAE,KAAA,EAAO,IAAA,EAAM,OAAA,CAAQ,IAAA,EAAK;AACrC","file":"machine.cjs","sourcesContent":["import { onBeforeUnmount, ref, type Ref } from 'vue'\nimport type { Machine, MachineEvent, MachineState } from '@iris-ui-kit/core'\n\n/**\n * Bridge a framework-agnostic `Machine` into Vue reactivity.\n *\n * Returns a reactive ref of the current `{ value, context }` state and a\n * stable `send` function. Subscription is created eagerly and cleaned up on\n * unmount, so this hook is safe to call from any component's `setup()`.\n *\n * No primitive consumes this yet (Phase 0 ships the bridge for Phase 1).\n */\nexport function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(\n machine: Machine<TState, TContext, TEvent>,\n): {\n state: Ref<MachineState<TState, TContext>>\n send: (event: TEvent) => void\n} {\n const state = ref(machine.store.getState()) as Ref<MachineState<TState, TContext>>\n const unsubscribe = machine.store.subscribe((next) => {\n state.value = next\n })\n onBeforeUnmount(() => {\n unsubscribe()\n })\n return { state, send: machine.send }\n}\n"]}
1
+ {"version":3,"sources":["../src/machine/useMachine.ts"],"names":["ref","onScopeDispose"],"mappings":";;;;;AAmBO,SAAS,UAAA,CACd,OAAA,EACA,OAAA,GAAuC,EAAC,EAIxC;AACA,EAAA,MAAM,KAAA,GAAQA,OAAA,CAAI,OAAA,CAAQ,KAAA,CAAM,UAAU,CAAA;AAC1C,EAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,CAAM,SAAA,CAAU,CAAC,IAAA,KAAS;AACpD,IAAA,KAAA,CAAM,KAAA,GAAQ,IAAA;AAAA,EAChB,CAAC,CAAA;AACD,EAAAC,kBAAA;AAAA,IACE,MAAM;AAEJ,MAAA,WAAA,EAAY;AACZ,MAAA,IAAI,OAAA,CAAQ,aAAA,KAAkB,KAAA,EAAO,OAAA,CAAQ,IAAA,EAAK;AAAA,IACpD,CAAA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,GACF;AACA,EAAA,OAAO,EAAE,KAAA,EAAO,IAAA,EAAM,OAAA,CAAQ,IAAA,EAAK;AACrC","file":"machine.cjs","sourcesContent":["import { onScopeDispose, ref, type Ref } from 'vue'\nimport type { Machine, MachineEvent, MachineState } from '@iris-ui-kit/core'\n\n/**\n * Bridge a framework-agnostic `Machine` into Vue reactivity.\n *\n * Returns a reactive ref of the current `{ value, context }` state and a\n * stable `send` function. Subscription is created eagerly and cleaned up on\n * scope dispose, so this hook is safe to call from any component's `setup()`.\n *\n * Teardown semantics: when the owning scope is disposed (component unmount,\n * `effectScope().stop()`, end of SSR render), the store subscription is\n * detached AND — by default — `machine.stop()` is called: pending `after`\n * timers are cancelled and further `send` calls become no-ops, so a delayed\n * transition can never fire into a disposed consumer (see the core `Machine`\n * contract). Pass `{ stopOnUnmount: false }` only when the machine is shared\n * with other consumers that outlive this scope — the subscription is still\n * detached, the machine keeps running.\n */\nexport function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(\n machine: Machine<TState, TContext, TEvent>,\n options: { stopOnUnmount?: boolean } = {},\n): {\n state: Ref<MachineState<TState, TContext>>\n send: (event: TEvent) => void\n} {\n const state = ref(machine.store.getState()) as Ref<MachineState<TState, TContext>>\n const unsubscribe = machine.store.subscribe((next) => {\n state.value = next\n })\n onScopeDispose(\n () => {\n // Detach the bridge first (conservative order), then stop the machine.\n unsubscribe()\n if (options.stopOnUnmount !== false) machine.stop()\n },\n // failSilently: outside any effect scope there is nothing to dispose —\n // registering is a no-op and must not emit the \"no active effect scope\"\n // dev warning. Within a component/effectScope this arg changes nothing.\n true,\n )\n return { state, send: machine.send }\n}\n"]}
@@ -6,11 +6,20 @@ import { MachineEvent, Machine, MachineState } from '@iris-ui-kit/core';
6
6
  *
7
7
  * Returns a reactive ref of the current `{ value, context }` state and a
8
8
  * stable `send` function. Subscription is created eagerly and cleaned up on
9
- * unmount, so this hook is safe to call from any component's `setup()`.
9
+ * scope dispose, so this hook is safe to call from any component's `setup()`.
10
10
  *
11
- * No primitive consumes this yet (Phase 0 ships the bridge for Phase 1).
11
+ * Teardown semantics: when the owning scope is disposed (component unmount,
12
+ * `effectScope().stop()`, end of SSR render), the store subscription is
13
+ * detached AND — by default — `machine.stop()` is called: pending `after`
14
+ * timers are cancelled and further `send` calls become no-ops, so a delayed
15
+ * transition can never fire into a disposed consumer (see the core `Machine`
16
+ * contract). Pass `{ stopOnUnmount: false }` only when the machine is shared
17
+ * with other consumers that outlive this scope — the subscription is still
18
+ * detached, the machine keeps running.
12
19
  */
13
- declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent>): {
20
+ declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent>, options?: {
21
+ stopOnUnmount?: boolean;
22
+ }): {
14
23
  state: Ref<MachineState<TState, TContext>>;
15
24
  send: (event: TEvent) => void;
16
25
  };
package/dist/machine.d.ts CHANGED
@@ -6,11 +6,20 @@ import { MachineEvent, Machine, MachineState } from '@iris-ui-kit/core';
6
6
  *
7
7
  * Returns a reactive ref of the current `{ value, context }` state and a
8
8
  * stable `send` function. Subscription is created eagerly and cleaned up on
9
- * unmount, so this hook is safe to call from any component's `setup()`.
9
+ * scope dispose, so this hook is safe to call from any component's `setup()`.
10
10
  *
11
- * No primitive consumes this yet (Phase 0 ships the bridge for Phase 1).
11
+ * Teardown semantics: when the owning scope is disposed (component unmount,
12
+ * `effectScope().stop()`, end of SSR render), the store subscription is
13
+ * detached AND — by default — `machine.stop()` is called: pending `after`
14
+ * timers are cancelled and further `send` calls become no-ops, so a delayed
15
+ * transition can never fire into a disposed consumer (see the core `Machine`
16
+ * contract). Pass `{ stopOnUnmount: false }` only when the machine is shared
17
+ * with other consumers that outlive this scope — the subscription is still
18
+ * detached, the machine keeps running.
12
19
  */
13
- declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent>): {
20
+ declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent>, options?: {
21
+ stopOnUnmount?: boolean;
22
+ }): {
14
23
  state: Ref<MachineState<TState, TContext>>;
15
24
  send: (event: TEvent) => void;
16
25
  };
package/dist/machine.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import './chunk-4FQ7XF52.js';
2
- export { useMachine } from './chunk-TQB5LVOH.js';
2
+ export { useMachine } from './chunk-NNOF7KUH.js';
3
3
  //# sourceMappingURL=machine.js.map
4
4
  //# sourceMappingURL=machine.js.map
package/dist/resource.cjs CHANGED
@@ -5,10 +5,14 @@ var core = require('@iris-ui-kit/core');
5
5
 
6
6
  // src/resource/useResourceController.ts
7
7
  function useResourceController(config) {
8
- const controller = core.createResourceController(config);
8
+ const controller = core.createResourceController({ ...config, immediate: false });
9
+ const immediate = config.immediate !== false;
10
+ if (immediate) {
11
+ vue.onMounted(() => void controller.load());
12
+ }
13
+ vue.onScopeDispose(() => controller.destroy());
9
14
  const state = vue.shallowRef(controller.getState());
10
- vue.onBeforeUnmount(controller.subscribe((next) => state.value = next));
11
- vue.onBeforeUnmount(() => controller.destroy());
15
+ vue.onScopeDispose(controller.subscribe((next) => state.value = next));
12
16
  return { ...controller, state };
13
17
  }
14
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resource/useResourceController.ts"],"names":["createResourceController","shallowRef","onBeforeUnmount"],"mappings":";;;;;;AAmBO,SAAS,sBACd,MAAA,EAC0B;AAC1B,EAAA,MAAM,UAAA,GAAaA,8BAAyB,MAAM,CAAA;AAClD,EAAA,MAAM,KAAA,GAAQC,cAAA,CAAW,UAAA,CAAW,QAAA,EAAU,CAAA;AAC9C,EAAAC,mBAAA,CAAgB,WAAW,SAAA,CAAU,CAAC,SAAU,KAAA,CAAM,KAAA,GAAQ,IAAK,CAAC,CAAA;AAGpE,EAAAA,mBAAA,CAAgB,MAAM,UAAA,CAAW,OAAA,EAAS,CAAA;AAC1C,EAAA,OAAO,EAAE,GAAG,UAAA,EAAY,KAAA,EAAM;AAChC","file":"resource.cjs","sourcesContent":["import { onBeforeUnmount, shallowRef, type ShallowRef } from 'vue'\nimport {\n createResourceController,\n type ResourceController,\n type ResourceControllerConfig,\n type ResourceState,\n} from '@iris-ui-kit/core'\n\nexport interface UseResourceController<T> extends ResourceController<T> {\n /** The live resource state as a reactive ref (rows, total, page, loading, selectedKeys). */\n state: ShallowRef<ResourceState<T>>\n}\n\n/**\n * Vue bridge over the framework-agnostic {@link createResourceController} (L4\n * CRUD list composite). Creates the controller once in `setup()`, mirrors its\n * store into a `shallowRef`, and returns the controller plus that live `state`.\n * A ~15-line thin bridge — all logic lives in `@iris-ui-kit/core`.\n */\nexport function useResourceController<T>(\n config: ResourceControllerConfig<T>,\n): UseResourceController<T> {\n const controller = createResourceController(config)\n const state = shallowRef(controller.getState())\n onBeforeUnmount(controller.subscribe((next) => (state.value = next)))\n // Abort any in-flight fetch + detach the controller's internal subscriptions\n // on unmount (a late response must not write back to a torn-down instance).\n onBeforeUnmount(() => controller.destroy())\n return { ...controller, state }\n}\n"]}
1
+ {"version":3,"sources":["../src/resource/useResourceController.ts"],"names":["createResourceController","onMounted","onScopeDispose","shallowRef"],"mappings":";;;;;;AA4BO,SAAS,sBACd,MAAA,EAC0B;AAC1B,EAAA,MAAM,aAAaA,6BAAA,CAAyB,EAAE,GAAG,MAAA,EAAQ,SAAA,EAAW,OAAO,CAAA;AAC3E,EAAA,MAAM,SAAA,GAAY,OAAO,SAAA,KAAc,KAAA;AAEvC,EAAA,IAAI,SAAA,EAAW;AACb,IAAAC,aAAA,CAAU,MAAM,KAAK,UAAA,CAAW,IAAA,EAAM,CAAA;AAAA,EACxC;AAKA,EAAAC,kBAAA,CAAe,MAAM,UAAA,CAAW,OAAA,EAAS,CAAA;AAEzC,EAAA,MAAM,KAAA,GAAQC,cAAA,CAAW,UAAA,CAAW,QAAA,EAAU,CAAA;AAC9C,EAAAD,kBAAA,CAAe,WAAW,SAAA,CAAU,CAAC,SAAU,KAAA,CAAM,KAAA,GAAQ,IAAK,CAAC,CAAA;AACnE,EAAA,OAAO,EAAE,GAAG,UAAA,EAAY,KAAA,EAAM;AAChC","file":"resource.cjs","sourcesContent":["import { onMounted, onScopeDispose, shallowRef, type ShallowRef } from 'vue'\nimport {\n createResourceController,\n type ResourceController,\n type ResourceControllerConfig,\n type ResourceState,\n} from '@iris-ui-kit/core'\n\nexport interface UseResourceController<T> extends ResourceController<T> {\n /** The live resource state as a reactive ref (rows, total, page, loading, selectedKeys). */\n state: ShallowRef<ResourceState<T>>\n}\n\n/**\n * Vue bridge over the framework-agnostic {@link createResourceController} (L4\n * CRUD list composite). Creates the controller once in `setup()`, mirrors its\n * store into a `shallowRef`, and returns the controller plus that live `state`.\n * A thin bridge — all logic lives in `@iris-ui-kit/core`.\n *\n * Constructed with `immediate: false` so no fetch fires during `setup()`\n * (SSR-safe: server rendering never runs `onMounted`); the initial load is\n * kicked from `onMounted` when the caller's config says `immediate !== false`.\n * The `onMounted` registration is conditional on that flag — inside a bare\n * `effectScope` there is no component instance and Vue would warn on an\n * unconditional registration. The controller is torn down on scope dispose\n * (aborting any in-flight request and detaching the state mirror), so a late\n * response never writes back to a torn-down instance.\n */\nexport function useResourceController<T>(\n config: ResourceControllerConfig<T>,\n): UseResourceController<T> {\n const controller = createResourceController({ ...config, immediate: false })\n const immediate = config.immediate !== false\n\n if (immediate) {\n onMounted(() => void controller.load())\n }\n // Abort any in-flight fetch + detach the controller's internal subscriptions\n // on scope dispose (a late response must not write back to a torn-down\n // instance). Fires on unmount inside a component scope and on `scope.stop()`\n // inside a bare effectScope.\n onScopeDispose(() => controller.destroy())\n\n const state = shallowRef(controller.getState())\n onScopeDispose(controller.subscribe((next) => (state.value = next)))\n return { ...controller, state }\n}\n"]}
@@ -10,7 +10,16 @@ interface UseResourceController<T> extends ResourceController<T> {
10
10
  * Vue bridge over the framework-agnostic {@link createResourceController} (L4
11
11
  * CRUD list composite). Creates the controller once in `setup()`, mirrors its
12
12
  * store into a `shallowRef`, and returns the controller plus that live `state`.
13
- * A ~15-line thin bridge — all logic lives in `@iris-ui-kit/core`.
13
+ * A thin bridge — all logic lives in `@iris-ui-kit/core`.
14
+ *
15
+ * Constructed with `immediate: false` so no fetch fires during `setup()`
16
+ * (SSR-safe: server rendering never runs `onMounted`); the initial load is
17
+ * kicked from `onMounted` when the caller's config says `immediate !== false`.
18
+ * The `onMounted` registration is conditional on that flag — inside a bare
19
+ * `effectScope` there is no component instance and Vue would warn on an
20
+ * unconditional registration. The controller is torn down on scope dispose
21
+ * (aborting any in-flight request and detaching the state mirror), so a late
22
+ * response never writes back to a torn-down instance.
14
23
  */
15
24
  declare function useResourceController<T>(config: ResourceControllerConfig<T>): UseResourceController<T>;
16
25
 
@@ -10,7 +10,16 @@ interface UseResourceController<T> extends ResourceController<T> {
10
10
  * Vue bridge over the framework-agnostic {@link createResourceController} (L4
11
11
  * CRUD list composite). Creates the controller once in `setup()`, mirrors its
12
12
  * store into a `shallowRef`, and returns the controller plus that live `state`.
13
- * A ~15-line thin bridge — all logic lives in `@iris-ui-kit/core`.
13
+ * A thin bridge — all logic lives in `@iris-ui-kit/core`.
14
+ *
15
+ * Constructed with `immediate: false` so no fetch fires during `setup()`
16
+ * (SSR-safe: server rendering never runs `onMounted`); the initial load is
17
+ * kicked from `onMounted` when the caller's config says `immediate !== false`.
18
+ * The `onMounted` registration is conditional on that flag — inside a bare
19
+ * `effectScope` there is no component instance and Vue would warn on an
20
+ * unconditional registration. The controller is torn down on scope dispose
21
+ * (aborting any in-flight request and detaching the state mirror), so a late
22
+ * response never writes back to a torn-down instance.
14
23
  */
15
24
  declare function useResourceController<T>(config: ResourceControllerConfig<T>): UseResourceController<T>;
16
25
 
package/dist/resource.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createClientFetcher, createResourceController, useResourceController } from './chunk-XSLBANUV.js';
1
+ export { createClientFetcher, createResourceController, useResourceController } from './chunk-25NYWSXP.js';
2
2
  //# sourceMappingURL=resource.js.map
3
3
  //# sourceMappingURL=resource.js.map
@@ -1483,14 +1483,32 @@ var IrisDashboardTemplate = vue.defineComponent({
1483
1483
  activeId: { type: String, default: "" },
1484
1484
  /** Cards to render in the main grid. Skip to use the `default` slot only. */
1485
1485
  cards: { type: Array, default: () => [] },
1486
- defaultCollapsed: { type: Boolean, default: false }
1486
+ defaultCollapsed: { type: Boolean, default: false },
1487
+ /**
1488
+ * Controlled collapsed state. When unset (`undefined`), the component
1489
+ * manages its own state seeded from `defaultCollapsed`; when set, this
1490
+ * value takes precedence and changes are re-emitted via
1491
+ * `update:collapsed` (`v-model:collapsed`).
1492
+ */
1493
+ collapsed: { type: Boolean, default: void 0 }
1487
1494
  },
1488
1495
  emits: {
1489
1496
  "update:activeId": (_id) => true,
1490
1497
  "update:collapsed": (_value) => true
1491
1498
  },
1492
1499
  setup(props, { attrs, slots, emit }) {
1493
- const collapsed = vue.ref(props.defaultCollapsed);
1500
+ const isControlled = vue.computed(() => props.collapsed !== void 0);
1501
+ const internalCollapsed = vue.ref(props.defaultCollapsed);
1502
+ const collapsed = vue.computed(
1503
+ () => isControlled.value ? Boolean(props.collapsed) : internalCollapsed.value
1504
+ );
1505
+ vue.watch(
1506
+ () => props.collapsed,
1507
+ (value) => {
1508
+ if (value !== void 0) internalCollapsed.value = value;
1509
+ },
1510
+ { immediate: true }
1511
+ );
1494
1512
  const onSelectNav = (id) => {
1495
1513
  emit("update:activeId", id);
1496
1514
  };
@@ -1512,7 +1530,7 @@ var IrisDashboardTemplate = vue.defineComponent({
1512
1530
  {
1513
1531
  collapsed: collapsed.value,
1514
1532
  "onUpdate:collapsed": (v) => {
1515
- collapsed.value = v;
1533
+ if (!isControlled.value) internalCollapsed.value = v;
1516
1534
  emit("update:collapsed", v);
1517
1535
  },
1518
1536
  width: 240,