@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.
- package/dist/admin.cjs +14 -5
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +2 -2
- package/dist/async.cjs +48 -2
- package/dist/async.cjs.map +1 -1
- package/dist/async.d.cts +27 -3
- package/dist/async.d.ts +27 -3
- package/dist/async.js +1 -1
- package/dist/behaviors.cjs +87 -48
- package/dist/behaviors.cjs.map +1 -1
- package/dist/behaviors.d.cts +2 -2
- package/dist/behaviors.d.ts +2 -2
- package/dist/behaviors.js +1 -1
- package/dist/chunk-25NYWSXP.js +20 -0
- package/dist/chunk-25NYWSXP.js.map +1 -0
- package/dist/{chunk-CWXH44OF.js → chunk-3IH7IJ5S.js} +90 -51
- package/dist/chunk-3IH7IJ5S.js.map +1 -0
- package/dist/{chunk-ENKE2BPC.js → chunk-BEPH6PPL.js} +23 -5
- package/dist/chunk-BEPH6PPL.js.map +1 -0
- package/dist/{chunk-FG5USQSY.js → chunk-I7PR4ILF.js} +8 -3
- package/dist/chunk-I7PR4ILF.js.map +1 -0
- package/dist/{chunk-4FLIW67H.js → chunk-IAG64CHL.js} +21 -28
- package/dist/chunk-IAG64CHL.js.map +1 -0
- package/dist/chunk-NNOF7KUH.js +24 -0
- package/dist/chunk-NNOF7KUH.js.map +1 -0
- package/dist/{chunk-4WQOZ2OV.js → chunk-QQ25RKOO.js} +6 -4
- package/dist/chunk-QQ25RKOO.js.map +1 -0
- package/dist/chunk-SJB5DIIY.js +119 -0
- package/dist/chunk-SJB5DIIY.js.map +1 -0
- package/dist/form.cjs +28 -23
- package/dist/form.cjs.map +1 -1
- package/dist/form.d.cts +3 -2
- package/dist/form.d.ts +3 -2
- package/dist/form.js +2 -1
- package/dist/index.cjs +216 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -18
- package/dist/index.js.map +1 -1
- package/dist/machine.cjs +11 -4
- package/dist/machine.cjs.map +1 -1
- package/dist/machine.d.cts +12 -3
- package/dist/machine.d.ts +12 -3
- package/dist/machine.js +1 -1
- package/dist/resource.cjs +7 -3
- package/dist/resource.cjs.map +1 -1
- package/dist/resource.d.cts +10 -1
- package/dist/resource.d.ts +10 -1
- package/dist/resource.js +1 -1
- package/dist/skeletons.cjs +21 -3
- package/dist/skeletons.cjs.map +1 -1
- package/dist/skeletons.d.cts +21 -0
- package/dist/skeletons.d.ts +21 -0
- package/dist/skeletons.js +1 -1
- package/dist/undo.cjs +6 -1
- package/dist/undo.cjs.map +1 -1
- package/dist/undo.d.cts +5 -0
- package/dist/undo.d.ts +5 -0
- package/dist/undo.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4FLIW67H.js.map +0 -1
- package/dist/chunk-4WQOZ2OV.js.map +0 -1
- package/dist/chunk-CWXH44OF.js.map +0 -1
- package/dist/chunk-ENKE2BPC.js.map +0 -1
- package/dist/chunk-FG5USQSY.js.map +0 -1
- package/dist/chunk-TQB5LVOH.js +0 -17
- package/dist/chunk-TQB5LVOH.js.map +0 -1
- package/dist/chunk-XSLBANUV.js +0 -16
- package/dist/chunk-XSLBANUV.js.map +0 -1
- package/dist/chunk-ZY4NLITM.js +0 -73
- 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.
|
|
12
|
-
|
|
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
|
|
package/dist/machine.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/machine/useMachine.ts"],"names":["ref","
|
|
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"]}
|
package/dist/machine.d.cts
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
|
-
*
|
|
9
|
+
* scope dispose, so this hook is safe to call from any component's `setup()`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
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
|
-
*
|
|
9
|
+
* scope dispose, so this hook is safe to call from any component's `setup()`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
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
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.
|
|
11
|
-
vue.onBeforeUnmount(() => controller.destroy());
|
|
15
|
+
vue.onScopeDispose(controller.subscribe((next) => state.value = next));
|
|
12
16
|
return { ...controller, state };
|
|
13
17
|
}
|
|
14
18
|
|
package/dist/resource.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/useResourceController.ts"],"names":["createResourceController","
|
|
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"]}
|
package/dist/resource.d.cts
CHANGED
|
@@ -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
|
|
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.d.ts
CHANGED
|
@@ -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
|
|
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-
|
|
1
|
+
export { createClientFetcher, createResourceController, useResourceController } from './chunk-25NYWSXP.js';
|
|
2
2
|
//# sourceMappingURL=resource.js.map
|
|
3
3
|
//# sourceMappingURL=resource.js.map
|
package/dist/skeletons.cjs
CHANGED
|
@@ -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
|
|
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
|
-
|
|
1533
|
+
if (!isControlled.value) internalCollapsed.value = v;
|
|
1516
1534
|
emit("update:collapsed", v);
|
|
1517
1535
|
},
|
|
1518
1536
|
width: 240,
|