@iris-ui-kit/vue 0.1.0
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/LICENSE +21 -0
- package/dist/admin.cjs +1869 -0
- package/dist/admin.cjs.map +1 -0
- package/dist/admin.d.cts +376 -0
- package/dist/admin.d.ts +376 -0
- package/dist/admin.js +10 -0
- package/dist/admin.js.map +1 -0
- package/dist/async.cjs +76 -0
- package/dist/async.cjs.map +1 -0
- package/dist/async.d.cts +59 -0
- package/dist/async.d.ts +59 -0
- package/dist/async.js +3 -0
- package/dist/async.js.map +1 -0
- package/dist/behaviors.cjs +659 -0
- package/dist/behaviors.cjs.map +1 -0
- package/dist/behaviors.d.cts +441 -0
- package/dist/behaviors.d.ts +441 -0
- package/dist/behaviors.js +3 -0
- package/dist/behaviors.js.map +1 -0
- package/dist/chunk-3FJUCHCC.js +146 -0
- package/dist/chunk-3FJUCHCC.js.map +1 -0
- package/dist/chunk-3R3QDLJC.js +172 -0
- package/dist/chunk-3R3QDLJC.js.map +1 -0
- package/dist/chunk-4FLIW67H.js +137 -0
- package/dist/chunk-4FLIW67H.js.map +1 -0
- package/dist/chunk-4FQ7XF52.js +3 -0
- package/dist/chunk-4FQ7XF52.js.map +1 -0
- package/dist/chunk-72PZMU6R.js +99 -0
- package/dist/chunk-72PZMU6R.js.map +1 -0
- package/dist/chunk-75GSYEJS.js +17 -0
- package/dist/chunk-75GSYEJS.js.map +1 -0
- package/dist/chunk-7IOJADZC.js +38 -0
- package/dist/chunk-7IOJADZC.js.map +1 -0
- package/dist/chunk-CIZGSGXN.js +651 -0
- package/dist/chunk-CIZGSGXN.js.map +1 -0
- package/dist/chunk-F77KIPOH.js +103 -0
- package/dist/chunk-F77KIPOH.js.map +1 -0
- package/dist/chunk-FJBYAIL4.js +1318 -0
- package/dist/chunk-FJBYAIL4.js.map +1 -0
- package/dist/chunk-H7HVVPYR.js +66 -0
- package/dist/chunk-H7HVVPYR.js.map +1 -0
- package/dist/chunk-I6D5VXQK.js +167 -0
- package/dist/chunk-I6D5VXQK.js.map +1 -0
- package/dist/chunk-PPYNXNGZ.js +73 -0
- package/dist/chunk-PPYNXNGZ.js.map +1 -0
- package/dist/chunk-QLUIKEMJ.js +1197 -0
- package/dist/chunk-QLUIKEMJ.js.map +1 -0
- package/dist/chunk-ROJV6RON.js +3 -0
- package/dist/chunk-ROJV6RON.js.map +1 -0
- package/dist/chunk-S43IHHBU.js +82 -0
- package/dist/chunk-S43IHHBU.js.map +1 -0
- package/dist/chunk-TCAXRWT6.js +108 -0
- package/dist/chunk-TCAXRWT6.js.map +1 -0
- package/dist/chunk-TQB5LVOH.js +17 -0
- package/dist/chunk-TQB5LVOH.js.map +1 -0
- package/dist/chunk-VM2CXEUA.js +46 -0
- package/dist/chunk-VM2CXEUA.js.map +1 -0
- package/dist/chunk-W2JVHGFR.js +103 -0
- package/dist/chunk-W2JVHGFR.js.map +1 -0
- package/dist/chunk-WL67XCH5.js +59 -0
- package/dist/chunk-WL67XCH5.js.map +1 -0
- package/dist/chunk-XCNCIG2I.js +165 -0
- package/dist/chunk-XCNCIG2I.js.map +1 -0
- package/dist/chunk-XSLBANUV.js +16 -0
- package/dist/chunk-XSLBANUV.js.map +1 -0
- package/dist/chunk-ZY4NLITM.js +73 -0
- package/dist/chunk-ZY4NLITM.js.map +1 -0
- package/dist/data.cjs +59 -0
- package/dist/data.cjs.map +1 -0
- package/dist/data.d.cts +46 -0
- package/dist/data.d.ts +46 -0
- package/dist/data.js +4 -0
- package/dist/data.js.map +1 -0
- package/dist/error-boundary.cjs +115 -0
- package/dist/error-boundary.cjs.map +1 -0
- package/dist/error-boundary.d.cts +60 -0
- package/dist/error-boundary.d.ts +60 -0
- package/dist/error-boundary.js +4 -0
- package/dist/error-boundary.js.map +1 -0
- package/dist/floating.cjs +149 -0
- package/dist/floating.cjs.map +1 -0
- package/dist/floating.d.cts +106 -0
- package/dist/floating.d.ts +106 -0
- package/dist/floating.js +4 -0
- package/dist/floating.js.map +1 -0
- package/dist/form.cjs +144 -0
- package/dist/form.cjs.map +1 -0
- package/dist/form.d.cts +128 -0
- package/dist/form.d.ts +128 -0
- package/dist/form.js +3 -0
- package/dist/form.js.map +1 -0
- package/dist/i18n.cjs +112 -0
- package/dist/i18n.cjs.map +1 -0
- package/dist/i18n.d.cts +99 -0
- package/dist/i18n.d.ts +99 -0
- package/dist/i18n.js +3 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.cjs +18673 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8087 -0
- package/dist/index.d.ts +8087 -0
- package/dist/index.js +13525 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts.cjs +392 -0
- package/dist/layouts.cjs.map +1 -0
- package/dist/layouts.d.cts +406 -0
- package/dist/layouts.d.ts +406 -0
- package/dist/layouts.js +5 -0
- package/dist/layouts.js.map +1 -0
- package/dist/machine.cjs +19 -0
- package/dist/machine.cjs.map +1 -0
- package/dist/machine.d.cts +18 -0
- package/dist/machine.d.ts +18 -0
- package/dist/machine.js +4 -0
- package/dist/machine.js.map +1 -0
- package/dist/modal-utils.cjs +170 -0
- package/dist/modal-utils.cjs.map +1 -0
- package/dist/modal-utils.d.cts +43 -0
- package/dist/modal-utils.d.ts +43 -0
- package/dist/modal-utils.js +3 -0
- package/dist/modal-utils.js.map +1 -0
- package/dist/motion.cjs +88 -0
- package/dist/motion.cjs.map +1 -0
- package/dist/motion.d.cts +43 -0
- package/dist/motion.d.ts +43 -0
- package/dist/motion.js +3 -0
- package/dist/motion.js.map +1 -0
- package/dist/provider.cjs +272 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.cts +130 -0
- package/dist/provider.d.ts +130 -0
- package/dist/provider.js +6 -0
- package/dist/provider.js.map +1 -0
- package/dist/resource.cjs +25 -0
- package/dist/resource.cjs.map +1 -0
- package/dist/resource.d.cts +17 -0
- package/dist/resource.d.ts +17 -0
- package/dist/resource.js +3 -0
- package/dist/resource.js.map +1 -0
- package/dist/skeletons.cjs +1659 -0
- package/dist/skeletons.cjs.map +1 -0
- package/dist/skeletons.d.cts +179 -0
- package/dist/skeletons.d.ts +179 -0
- package/dist/skeletons.js +7 -0
- package/dist/skeletons.js.map +1 -0
- package/dist/skins.cjs +138 -0
- package/dist/skins.cjs.map +1 -0
- package/dist/skins.d.cts +67 -0
- package/dist/skins.d.ts +67 -0
- package/dist/skins.js +3 -0
- package/dist/skins.js.map +1 -0
- package/dist/theme.cjs +106 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +103 -0
- package/dist/theme.d.ts +103 -0
- package/dist/theme.js +3 -0
- package/dist/theme.js.map +1 -0
- package/dist/undo.cjs +51 -0
- package/dist/undo.cjs.map +1 -0
- package/dist/undo.d.cts +48 -0
- package/dist/undo.d.ts +48 -0
- package/dist/undo.js +3 -0
- package/dist/undo.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType, VNode, InjectionKey } from 'vue';
|
|
3
|
+
import { IrisPlugin } from '@iris-ui-kit/core';
|
|
4
|
+
import { ThemeStore } from '@iris-ui-kit/theme';
|
|
5
|
+
import { SkinEngine } from '@iris-ui-kit/skins';
|
|
6
|
+
|
|
7
|
+
/** Public prop surface of {@link IrisProvider}. */
|
|
8
|
+
interface IrisProviderProps {
|
|
9
|
+
/** Theme store; when present the inner `ThemeProvider` wraps the subtree. */
|
|
10
|
+
theme?: ThemeStore;
|
|
11
|
+
/** Skin engine; when present the inner `SkinProvider` wraps the subtree. */
|
|
12
|
+
skin?: SkinEngine;
|
|
13
|
+
/** Writing direction, forwarded to `ThemeProvider` when a theme is given. */
|
|
14
|
+
dir?: 'ltr' | 'rtl';
|
|
15
|
+
/** Active BCP-47 locale; defaults to `'en-US'`. */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** User messages — merged OVER plugin-registered messages (user wins). */
|
|
18
|
+
messages?: Record<string, string>;
|
|
19
|
+
/** Plugins to install; their tokens / messages / stores are collected once. */
|
|
20
|
+
plugins?: IrisPlugin[];
|
|
21
|
+
/** Element receiving the plugin token layer; defaults to `documentElement`. */
|
|
22
|
+
target?: HTMLElement | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The single unified Iris entry point. Runs `plugins` through the core
|
|
26
|
+
* `runPlugins` collector and wires the result into the theme (tokens), i18n
|
|
27
|
+
* (messages) and a plugin-store context, composing the existing per-framework
|
|
28
|
+
* providers. A thin bridge — the real logic lives in `@iris-ui-kit/core`.
|
|
29
|
+
*
|
|
30
|
+
* Render order when present: Theme → Skin → I18n → PluginContext → children.
|
|
31
|
+
*/
|
|
32
|
+
declare const IrisProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
33
|
+
theme: {
|
|
34
|
+
type: PropType<ThemeStore>;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
skin: {
|
|
38
|
+
type: PropType<SkinEngine>;
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
dir: {
|
|
42
|
+
type: PropType<"ltr" | "rtl">;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
locale: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
messages: {
|
|
50
|
+
type: PropType<Record<string, string>>;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
plugins: {
|
|
54
|
+
type: PropType<IrisPlugin[]>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
target: {
|
|
58
|
+
type: PropType<HTMLElement | null>;
|
|
59
|
+
default: null;
|
|
60
|
+
};
|
|
61
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
64
|
+
theme: {
|
|
65
|
+
type: PropType<ThemeStore>;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
skin: {
|
|
69
|
+
type: PropType<SkinEngine>;
|
|
70
|
+
default: undefined;
|
|
71
|
+
};
|
|
72
|
+
dir: {
|
|
73
|
+
type: PropType<"ltr" | "rtl">;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
locale: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
messages: {
|
|
81
|
+
type: PropType<Record<string, string>>;
|
|
82
|
+
default: undefined;
|
|
83
|
+
};
|
|
84
|
+
plugins: {
|
|
85
|
+
type: PropType<IrisPlugin[]>;
|
|
86
|
+
default: undefined;
|
|
87
|
+
};
|
|
88
|
+
target: {
|
|
89
|
+
type: PropType<HTMLElement | null>;
|
|
90
|
+
default: null;
|
|
91
|
+
};
|
|
92
|
+
}>> & Readonly<{}>, {
|
|
93
|
+
target: HTMLElement | null;
|
|
94
|
+
dir: "ltr" | "rtl";
|
|
95
|
+
theme: ThemeStore;
|
|
96
|
+
locale: string;
|
|
97
|
+
messages: Record<string, string>;
|
|
98
|
+
skin: SkinEngine;
|
|
99
|
+
plugins: IrisPlugin[];
|
|
100
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
101
|
+
|
|
102
|
+
/** Whether the named plugin is installed by the nearest `<IrisProvider>`. */
|
|
103
|
+
declare function usePlugin(name: string): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Read a plugin-registered store by `key` (backward-compatible single-arg form).
|
|
106
|
+
* Throws a clear error when used outside an `<IrisProvider>`.
|
|
107
|
+
*/
|
|
108
|
+
declare function usePluginStore<T>(key: string): T;
|
|
109
|
+
/**
|
|
110
|
+
* Read a plugin-registered store by `namespace` + `key`.
|
|
111
|
+
*/
|
|
112
|
+
declare function usePluginStore<T>(namespace: string, key: string): T;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Shape carried by the plugin-store context: the live store instances collected
|
|
116
|
+
* from every installed plugin, plus the set of installed plugin names. Surfaced
|
|
117
|
+
* to descendants through `usePluginStore` / `usePlugin`.
|
|
118
|
+
*/
|
|
119
|
+
interface PluginStoreContext {
|
|
120
|
+
stores: Map<string, unknown>;
|
|
121
|
+
installed: Set<string>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Injection key for the {@link PluginStoreContext}. The name ends in `Key` (and
|
|
125
|
+
* the type in `Context`) so the manifest's discover step never mistakes it for a
|
|
126
|
+
* component export.
|
|
127
|
+
*/
|
|
128
|
+
declare const PluginStoreContextKey: InjectionKey<PluginStoreContext>;
|
|
129
|
+
|
|
130
|
+
export { IrisProvider, type IrisProviderProps, type PluginStoreContext, PluginStoreContextKey, usePlugin, usePluginStore };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType, VNode, InjectionKey } from 'vue';
|
|
3
|
+
import { IrisPlugin } from '@iris-ui-kit/core';
|
|
4
|
+
import { ThemeStore } from '@iris-ui-kit/theme';
|
|
5
|
+
import { SkinEngine } from '@iris-ui-kit/skins';
|
|
6
|
+
|
|
7
|
+
/** Public prop surface of {@link IrisProvider}. */
|
|
8
|
+
interface IrisProviderProps {
|
|
9
|
+
/** Theme store; when present the inner `ThemeProvider` wraps the subtree. */
|
|
10
|
+
theme?: ThemeStore;
|
|
11
|
+
/** Skin engine; when present the inner `SkinProvider` wraps the subtree. */
|
|
12
|
+
skin?: SkinEngine;
|
|
13
|
+
/** Writing direction, forwarded to `ThemeProvider` when a theme is given. */
|
|
14
|
+
dir?: 'ltr' | 'rtl';
|
|
15
|
+
/** Active BCP-47 locale; defaults to `'en-US'`. */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** User messages — merged OVER plugin-registered messages (user wins). */
|
|
18
|
+
messages?: Record<string, string>;
|
|
19
|
+
/** Plugins to install; their tokens / messages / stores are collected once. */
|
|
20
|
+
plugins?: IrisPlugin[];
|
|
21
|
+
/** Element receiving the plugin token layer; defaults to `documentElement`. */
|
|
22
|
+
target?: HTMLElement | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The single unified Iris entry point. Runs `plugins` through the core
|
|
26
|
+
* `runPlugins` collector and wires the result into the theme (tokens), i18n
|
|
27
|
+
* (messages) and a plugin-store context, composing the existing per-framework
|
|
28
|
+
* providers. A thin bridge — the real logic lives in `@iris-ui-kit/core`.
|
|
29
|
+
*
|
|
30
|
+
* Render order when present: Theme → Skin → I18n → PluginContext → children.
|
|
31
|
+
*/
|
|
32
|
+
declare const IrisProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
33
|
+
theme: {
|
|
34
|
+
type: PropType<ThemeStore>;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
skin: {
|
|
38
|
+
type: PropType<SkinEngine>;
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
dir: {
|
|
42
|
+
type: PropType<"ltr" | "rtl">;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
locale: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
messages: {
|
|
50
|
+
type: PropType<Record<string, string>>;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
plugins: {
|
|
54
|
+
type: PropType<IrisPlugin[]>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
target: {
|
|
58
|
+
type: PropType<HTMLElement | null>;
|
|
59
|
+
default: null;
|
|
60
|
+
};
|
|
61
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
64
|
+
theme: {
|
|
65
|
+
type: PropType<ThemeStore>;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
skin: {
|
|
69
|
+
type: PropType<SkinEngine>;
|
|
70
|
+
default: undefined;
|
|
71
|
+
};
|
|
72
|
+
dir: {
|
|
73
|
+
type: PropType<"ltr" | "rtl">;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
locale: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
messages: {
|
|
81
|
+
type: PropType<Record<string, string>>;
|
|
82
|
+
default: undefined;
|
|
83
|
+
};
|
|
84
|
+
plugins: {
|
|
85
|
+
type: PropType<IrisPlugin[]>;
|
|
86
|
+
default: undefined;
|
|
87
|
+
};
|
|
88
|
+
target: {
|
|
89
|
+
type: PropType<HTMLElement | null>;
|
|
90
|
+
default: null;
|
|
91
|
+
};
|
|
92
|
+
}>> & Readonly<{}>, {
|
|
93
|
+
target: HTMLElement | null;
|
|
94
|
+
dir: "ltr" | "rtl";
|
|
95
|
+
theme: ThemeStore;
|
|
96
|
+
locale: string;
|
|
97
|
+
messages: Record<string, string>;
|
|
98
|
+
skin: SkinEngine;
|
|
99
|
+
plugins: IrisPlugin[];
|
|
100
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
101
|
+
|
|
102
|
+
/** Whether the named plugin is installed by the nearest `<IrisProvider>`. */
|
|
103
|
+
declare function usePlugin(name: string): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Read a plugin-registered store by `key` (backward-compatible single-arg form).
|
|
106
|
+
* Throws a clear error when used outside an `<IrisProvider>`.
|
|
107
|
+
*/
|
|
108
|
+
declare function usePluginStore<T>(key: string): T;
|
|
109
|
+
/**
|
|
110
|
+
* Read a plugin-registered store by `namespace` + `key`.
|
|
111
|
+
*/
|
|
112
|
+
declare function usePluginStore<T>(namespace: string, key: string): T;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Shape carried by the plugin-store context: the live store instances collected
|
|
116
|
+
* from every installed plugin, plus the set of installed plugin names. Surfaced
|
|
117
|
+
* to descendants through `usePluginStore` / `usePlugin`.
|
|
118
|
+
*/
|
|
119
|
+
interface PluginStoreContext {
|
|
120
|
+
stores: Map<string, unknown>;
|
|
121
|
+
installed: Set<string>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Injection key for the {@link PluginStoreContext}. The name ends in `Key` (and
|
|
125
|
+
* the type in `Context`) so the manifest's discover step never mistakes it for a
|
|
126
|
+
* component export.
|
|
127
|
+
*/
|
|
128
|
+
declare const PluginStoreContextKey: InjectionKey<PluginStoreContext>;
|
|
129
|
+
|
|
130
|
+
export { IrisProvider, type IrisProviderProps, type PluginStoreContext, PluginStoreContextKey, usePlugin, usePluginStore };
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { IrisProvider, PluginStoreContextKey, usePlugin, usePluginStore } from './chunk-W2JVHGFR.js';
|
|
2
|
+
import './chunk-H7HVVPYR.js';
|
|
3
|
+
import './chunk-72PZMU6R.js';
|
|
4
|
+
import './chunk-TCAXRWT6.js';
|
|
5
|
+
//# sourceMappingURL=provider.js.map
|
|
6
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"provider.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var core = require('@iris-ui-kit/core');
|
|
5
|
+
|
|
6
|
+
// src/resource/useResourceController.ts
|
|
7
|
+
function useResourceController(config) {
|
|
8
|
+
const controller = core.createResourceController(config);
|
|
9
|
+
const state = vue.shallowRef(controller.getState());
|
|
10
|
+
vue.onBeforeUnmount(controller.subscribe((next) => state.value = next));
|
|
11
|
+
vue.onBeforeUnmount(() => controller.destroy());
|
|
12
|
+
return { ...controller, state };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, "createClientFetcher", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return core.createClientFetcher; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "createResourceController", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return core.createResourceController; }
|
|
22
|
+
});
|
|
23
|
+
exports.useResourceController = useResourceController;
|
|
24
|
+
//# sourceMappingURL=resource.cjs.map
|
|
25
|
+
//# sourceMappingURL=resource.cjs.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { ResourceController, ResourceState, ResourceControllerConfig } from '@iris-ui-kit/core';
|
|
3
|
+
export { DataViewColumn, MutateOptions, ResourceController, ResourceControllerConfig, ResourceQuery, ResourceState, createClientFetcher, createResourceController } from '@iris-ui-kit/core';
|
|
4
|
+
|
|
5
|
+
interface UseResourceController<T> extends ResourceController<T> {
|
|
6
|
+
/** The live resource state as a reactive ref (rows, total, page, loading, selectedKeys). */
|
|
7
|
+
state: ShallowRef<ResourceState<T>>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Vue bridge over the framework-agnostic {@link createResourceController} (L4
|
|
11
|
+
* CRUD list composite). Creates the controller once in `setup()`, mirrors its
|
|
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`.
|
|
14
|
+
*/
|
|
15
|
+
declare function useResourceController<T>(config: ResourceControllerConfig<T>): UseResourceController<T>;
|
|
16
|
+
|
|
17
|
+
export { type UseResourceController, useResourceController };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { ResourceController, ResourceState, ResourceControllerConfig } from '@iris-ui-kit/core';
|
|
3
|
+
export { DataViewColumn, MutateOptions, ResourceController, ResourceControllerConfig, ResourceQuery, ResourceState, createClientFetcher, createResourceController } from '@iris-ui-kit/core';
|
|
4
|
+
|
|
5
|
+
interface UseResourceController<T> extends ResourceController<T> {
|
|
6
|
+
/** The live resource state as a reactive ref (rows, total, page, loading, selectedKeys). */
|
|
7
|
+
state: ShallowRef<ResourceState<T>>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Vue bridge over the framework-agnostic {@link createResourceController} (L4
|
|
11
|
+
* CRUD list composite). Creates the controller once in `setup()`, mirrors its
|
|
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`.
|
|
14
|
+
*/
|
|
15
|
+
declare function useResourceController<T>(config: ResourceControllerConfig<T>): UseResourceController<T>;
|
|
16
|
+
|
|
17
|
+
export { type UseResourceController, useResourceController };
|
package/dist/resource.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"resource.js"}
|