@ariakit/core 0.3.7 → 0.3.8
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/CHANGELOG.md +6 -0
- package/cjs/__chunks/{GZDVJEID.cjs → 2LS4JJ4S.cjs} +2 -2
- package/cjs/__chunks/{46BH65MC.cjs → 2UK5WUJX.cjs} +15 -7
- package/cjs/__chunks/{GXIZMD53.cjs → 3J44Z7YH.cjs} +4 -4
- package/cjs/__chunks/{PD7XZBXC.cjs → 5SIVMOID.cjs} +4 -4
- package/cjs/__chunks/{7ZUFMSXJ.cjs → EFIT5L4X.cjs} +7 -7
- package/cjs/__chunks/{MEHGRTJ3.cjs → GJFZ5ZPP.cjs} +11 -11
- package/cjs/__chunks/{6WBY3ZZM.cjs → QAZ4PF7S.cjs} +6 -6
- package/cjs/__chunks/{JLC5A6WF.cjs → ZQTYFYRS.cjs} +18 -9
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox-store.d.cts +9 -9
- package/cjs/checkbox/checkbox-store.d.ts +9 -9
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/collection/collection-store.d.cts +16 -12
- package/cjs/collection/collection-store.d.ts +16 -12
- package/cjs/combobox/combobox-store.cjs +20 -20
- package/cjs/combobox/combobox-store.d.cts +12 -14
- package/cjs/combobox/combobox-store.d.ts +12 -14
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-overflow-store.d.cts +13 -7
- package/cjs/composite/composite-overflow-store.d.ts +13 -7
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/composite/composite-store.d.cts +22 -12
- package/cjs/composite/composite-store.d.ts +22 -12
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog-store.d.cts +12 -6
- package/cjs/dialog/dialog-store.d.ts +12 -6
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.cts +4 -2
- package/cjs/disclosure/disclosure-store.d.ts +4 -2
- package/cjs/form/form-store.cjs +7 -7
- package/cjs/form/form-store.d.cts +15 -15
- package/cjs/form/form-store.d.ts +15 -15
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard-store.d.cts +5 -3
- package/cjs/hovercard/hovercard-store.d.ts +5 -3
- package/cjs/menu/menu-bar-store.cjs +5 -5
- package/cjs/menu/menu-bar-store.d.cts +12 -6
- package/cjs/menu/menu-bar-store.d.ts +12 -6
- package/cjs/menu/menu-store.cjs +18 -18
- package/cjs/menu/menu-store.d.cts +8 -8
- package/cjs/menu/menu-store.d.ts +8 -8
- package/cjs/menubar/menubar-store.cjs +5 -5
- package/cjs/menubar/menubar-store.d.cts +1 -1
- package/cjs/menubar/menubar-store.d.ts +1 -1
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover-store.d.cts +5 -3
- package/cjs/popover/popover-store.d.ts +5 -3
- package/cjs/radio/radio-store.cjs +5 -5
- package/cjs/radio/radio-store.d.cts +5 -3
- package/cjs/radio/radio-store.d.ts +5 -3
- package/cjs/select/select-store.cjs +18 -18
- package/cjs/select/select-store.d.cts +14 -16
- package/cjs/select/select-store.d.ts +14 -16
- package/cjs/tab/tab-store.cjs +15 -15
- package/cjs/tab/tab-store.d.cts +15 -16
- package/cjs/tab/tab-store.d.ts +15 -16
- package/cjs/toolbar/toolbar-store.cjs +4 -4
- package/cjs/toolbar/toolbar-store.d.cts +9 -6
- package/cjs/toolbar/toolbar-store.d.ts +9 -6
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tooltip/tooltip-store.d.cts +5 -3
- package/cjs/tooltip/tooltip-store.d.ts +5 -3
- package/cjs/utils/store.cjs +2 -2
- package/esm/__chunks/{ANO6WJO4.js → A2AGSVJO.js} +2 -2
- package/esm/__chunks/{E7OQVGGY.js → A2J4XZ5T.js} +15 -7
- package/esm/__chunks/{OGMLJYDV.js → CTZ2GQIZ.js} +2 -2
- package/esm/__chunks/{CCU5UHQ2.js → HMQYEBKF.js} +15 -6
- package/esm/__chunks/{WY3EMTH6.js → J6JIOWCS.js} +2 -2
- package/esm/__chunks/{CL47ZAPY.js → LT2OYWRD.js} +1 -1
- package/esm/__chunks/{DYD4YNLE.js → NKLTHWCR.js} +1 -1
- package/esm/__chunks/{BXH3I7ML.js → T3DVYGXI.js} +2 -2
- package/esm/checkbox/checkbox-store.d.ts +9 -9
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +16 -12
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-store.d.ts +12 -14
- package/esm/combobox/combobox-store.js +6 -6
- package/esm/composite/composite-overflow-store.d.ts +13 -7
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +22 -12
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.d.ts +12 -6
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +4 -2
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.d.ts +15 -15
- package/esm/form/form-store.js +2 -2
- package/esm/hovercard/hovercard-store.d.ts +5 -3
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.d.ts +12 -6
- package/esm/menu/menu-bar-store.js +4 -4
- package/esm/menu/menu-store.d.ts +8 -8
- package/esm/menu/menu-store.js +7 -7
- package/esm/menubar/menubar-store.d.ts +1 -1
- package/esm/menubar/menubar-store.js +4 -4
- package/esm/popover/popover-store.d.ts +5 -3
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.d.ts +5 -3
- package/esm/radio/radio-store.js +3 -3
- package/esm/select/select-store.d.ts +14 -16
- package/esm/select/select-store.js +6 -6
- package/esm/tab/tab-store.d.ts +15 -16
- package/esm/tab/tab-store.js +3 -3
- package/esm/toolbar/toolbar-store.d.ts +9 -6
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.d.ts +5 -3
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/store.js +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
|
|
5
|
+
require('../__chunks/2LS4JJ4S.cjs');
|
|
6
|
+
require('../__chunks/GJFZ5ZPP.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
|
|
10
|
+
require('../__chunks/ZQTYFYRS.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
@@ -33,7 +33,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
33
33
|
var isSafariOnMobile = _YIUPKKEKcjs.isSafari.call(void 0, ) && _YIUPKKEKcjs.isTouchDevice.call(void 0, );
|
|
34
34
|
function createComboboxStore(props = {}) {
|
|
35
35
|
var _a;
|
|
36
|
-
|
|
36
|
+
_2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
37
37
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
38
38
|
const activeId = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
39
39
|
props.activeId,
|
|
@@ -41,7 +41,7 @@ function createComboboxStore(props = {}) {
|
|
|
41
41
|
props.defaultActiveId,
|
|
42
42
|
null
|
|
43
43
|
);
|
|
44
|
-
const composite =
|
|
44
|
+
const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
45
45
|
activeId,
|
|
46
46
|
includesBaseElement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
47
47
|
props.includesBaseElement,
|
|
@@ -61,7 +61,7 @@ function createComboboxStore(props = {}) {
|
|
|
61
61
|
!isSafariOnMobile
|
|
62
62
|
)
|
|
63
63
|
}));
|
|
64
|
-
const popover =
|
|
64
|
+
const popover = _EFIT5L4Xcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
65
65
|
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
66
66
|
props.placement,
|
|
67
67
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -96,10 +96,10 @@ function createComboboxStore(props = {}) {
|
|
|
96
96
|
),
|
|
97
97
|
activeValue: syncState == null ? void 0 : syncState.activeValue
|
|
98
98
|
});
|
|
99
|
-
const combobox =
|
|
100
|
-
|
|
99
|
+
const combobox = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, popover, props.store);
|
|
100
|
+
_2UK5WUJXcjs.setup.call(void 0,
|
|
101
101
|
combobox,
|
|
102
|
-
() =>
|
|
102
|
+
() => _2UK5WUJXcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
103
103
|
if (!state.resetValueOnHide)
|
|
104
104
|
return;
|
|
105
105
|
if (state.mounted)
|
|
@@ -107,34 +107,34 @@ function createComboboxStore(props = {}) {
|
|
|
107
107
|
combobox.setState("value", value);
|
|
108
108
|
})
|
|
109
109
|
);
|
|
110
|
-
|
|
110
|
+
_2UK5WUJXcjs.setup.call(void 0,
|
|
111
111
|
combobox,
|
|
112
|
-
() =>
|
|
112
|
+
() => _2UK5WUJXcjs.sync.call(void 0, combobox, ["resetValueOnSelect", "selectedValue"], (state) => {
|
|
113
113
|
if (!state.resetValueOnSelect)
|
|
114
114
|
return;
|
|
115
115
|
combobox.setState("value", value);
|
|
116
116
|
})
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
_2UK5WUJXcjs.setup.call(void 0,
|
|
119
119
|
combobox,
|
|
120
|
-
() =>
|
|
120
|
+
() => _2UK5WUJXcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
|
|
121
121
|
if (state.mounted)
|
|
122
122
|
return;
|
|
123
123
|
combobox.setState("activeId", activeId);
|
|
124
124
|
combobox.setState("moves", 0);
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
|
-
|
|
127
|
+
_2UK5WUJXcjs.setup.call(void 0,
|
|
128
128
|
combobox,
|
|
129
|
-
() =>
|
|
129
|
+
() => _2UK5WUJXcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
130
130
|
if (state.moves === prevState.moves) {
|
|
131
131
|
combobox.setState("activeValue", void 0);
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
);
|
|
135
|
-
|
|
135
|
+
_2UK5WUJXcjs.setup.call(void 0,
|
|
136
136
|
combobox,
|
|
137
|
-
() =>
|
|
137
|
+
() => _2UK5WUJXcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
138
138
|
if (state.moves === prev.moves)
|
|
139
139
|
return;
|
|
140
140
|
const { activeId: activeId2 } = combobox.getState();
|
|
@@ -2,19 +2,17 @@ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions
|
|
|
2
2
|
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
|
|
3
3
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
4
4
|
import type { PickRequired, SetState } from "../utils/types.js";
|
|
5
|
-
type
|
|
6
|
-
type MutableValue<T extends Value = Value> = T extends string ? string : T;
|
|
7
|
-
interface Item extends CompositeStoreItem {
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
5
|
+
type MutableValue<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> = T extends string ? string : T;
|
|
10
6
|
/**
|
|
11
7
|
* Creates a combobox store.
|
|
12
8
|
*/
|
|
13
|
-
export declare function createComboboxStore<T extends
|
|
9
|
+
export declare function createComboboxStore<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue>(props: PickRequired<ComboboxStoreProps<T>, "selectedValue" | "defaultSelectedValue">): ComboboxStore<T>;
|
|
14
10
|
export declare function createComboboxStore(props?: ComboboxStoreProps): ComboboxStore;
|
|
15
|
-
export type
|
|
16
|
-
export
|
|
17
|
-
|
|
11
|
+
export type ComboboxStoreSelectedValue = string | string[];
|
|
12
|
+
export interface ComboboxStoreItem extends CompositeStoreItem {
|
|
13
|
+
value?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreState<ComboboxStoreItem>, PopoverStoreState {
|
|
18
16
|
/**
|
|
19
17
|
* @default true
|
|
20
18
|
*/
|
|
@@ -78,7 +76,7 @@ export interface ComboboxStoreState<T extends Value = Value> extends CompositeSt
|
|
|
78
76
|
*/
|
|
79
77
|
resetValueOnSelect: boolean;
|
|
80
78
|
}
|
|
81
|
-
export interface ComboboxStoreFunctions<T extends
|
|
79
|
+
export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
|
|
82
80
|
/**
|
|
83
81
|
* Sets the [`value`](https://ariakit.org/reference/combobox-provider#value)
|
|
84
82
|
* state.
|
|
@@ -98,11 +96,11 @@ export interface ComboboxStoreFunctions<T extends Value = Value> extends Composi
|
|
|
98
96
|
*/
|
|
99
97
|
setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
|
|
100
98
|
}
|
|
101
|
-
export interface ComboboxStoreOptions<T extends
|
|
99
|
+
export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions, StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect"> {
|
|
102
100
|
/**
|
|
103
101
|
* @default null
|
|
104
102
|
*/
|
|
105
|
-
defaultActiveId?: CompositeStoreOptions<
|
|
103
|
+
defaultActiveId?: CompositeStoreOptions<ComboboxStoreItem>["activeId"];
|
|
106
104
|
/**
|
|
107
105
|
* The initial value of the combobox input.
|
|
108
106
|
* @default ""
|
|
@@ -118,8 +116,8 @@ export interface ComboboxStoreOptions<T extends Value = Value> extends StoreOpti
|
|
|
118
116
|
*/
|
|
119
117
|
defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
|
|
120
118
|
}
|
|
121
|
-
export interface ComboboxStoreProps<T extends
|
|
119
|
+
export interface ComboboxStoreProps<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends ComboboxStoreOptions<T>, StoreProps<ComboboxStoreState<T>> {
|
|
122
120
|
}
|
|
123
|
-
export interface ComboboxStore<T extends
|
|
121
|
+
export interface ComboboxStore<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends ComboboxStoreFunctions<T>, Store<ComboboxStoreState<T>> {
|
|
124
122
|
}
|
|
125
123
|
export {};
|
|
@@ -2,19 +2,17 @@ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions
|
|
|
2
2
|
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
|
|
3
3
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
4
4
|
import type { PickRequired, SetState } from "../utils/types.js";
|
|
5
|
-
type
|
|
6
|
-
type MutableValue<T extends Value = Value> = T extends string ? string : T;
|
|
7
|
-
interface Item extends CompositeStoreItem {
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
5
|
+
type MutableValue<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> = T extends string ? string : T;
|
|
10
6
|
/**
|
|
11
7
|
* Creates a combobox store.
|
|
12
8
|
*/
|
|
13
|
-
export declare function createComboboxStore<T extends
|
|
9
|
+
export declare function createComboboxStore<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue>(props: PickRequired<ComboboxStoreProps<T>, "selectedValue" | "defaultSelectedValue">): ComboboxStore<T>;
|
|
14
10
|
export declare function createComboboxStore(props?: ComboboxStoreProps): ComboboxStore;
|
|
15
|
-
export type
|
|
16
|
-
export
|
|
17
|
-
|
|
11
|
+
export type ComboboxStoreSelectedValue = string | string[];
|
|
12
|
+
export interface ComboboxStoreItem extends CompositeStoreItem {
|
|
13
|
+
value?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreState<ComboboxStoreItem>, PopoverStoreState {
|
|
18
16
|
/**
|
|
19
17
|
* @default true
|
|
20
18
|
*/
|
|
@@ -78,7 +76,7 @@ export interface ComboboxStoreState<T extends Value = Value> extends CompositeSt
|
|
|
78
76
|
*/
|
|
79
77
|
resetValueOnSelect: boolean;
|
|
80
78
|
}
|
|
81
|
-
export interface ComboboxStoreFunctions<T extends
|
|
79
|
+
export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
|
|
82
80
|
/**
|
|
83
81
|
* Sets the [`value`](https://ariakit.org/reference/combobox-provider#value)
|
|
84
82
|
* state.
|
|
@@ -98,11 +96,11 @@ export interface ComboboxStoreFunctions<T extends Value = Value> extends Composi
|
|
|
98
96
|
*/
|
|
99
97
|
setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
|
|
100
98
|
}
|
|
101
|
-
export interface ComboboxStoreOptions<T extends
|
|
99
|
+
export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions, StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect"> {
|
|
102
100
|
/**
|
|
103
101
|
* @default null
|
|
104
102
|
*/
|
|
105
|
-
defaultActiveId?: CompositeStoreOptions<
|
|
103
|
+
defaultActiveId?: CompositeStoreOptions<ComboboxStoreItem>["activeId"];
|
|
106
104
|
/**
|
|
107
105
|
* The initial value of the combobox input.
|
|
108
106
|
* @default ""
|
|
@@ -118,8 +116,8 @@ export interface ComboboxStoreOptions<T extends Value = Value> extends StoreOpti
|
|
|
118
116
|
*/
|
|
119
117
|
defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
|
|
120
118
|
}
|
|
121
|
-
export interface ComboboxStoreProps<T extends
|
|
119
|
+
export interface ComboboxStoreProps<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends ComboboxStoreOptions<T>, StoreProps<ComboboxStoreState<T>> {
|
|
122
120
|
}
|
|
123
|
-
export interface ComboboxStore<T extends
|
|
121
|
+
export interface ComboboxStore<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends ComboboxStoreFunctions<T>, Store<ComboboxStoreState<T>> {
|
|
124
122
|
}
|
|
125
123
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
|
|
5
|
+
require('../__chunks/2LS4JJ4S.cjs');
|
|
6
|
+
require('../__chunks/GJFZ5ZPP.cjs');
|
|
7
|
+
require('../__chunks/2UK5WUJX.cjs');
|
|
8
8
|
require('../__chunks/3UT5FE6K.cjs');
|
|
9
9
|
require('../__chunks/AV6KTKLE.cjs');
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|
|
12
12
|
function createCompositeOverflowStore(props = {}) {
|
|
13
|
-
return
|
|
13
|
+
return _EFIT5L4Xcjs.createPopoverStore.call(void 0, props);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.js";
|
|
2
3
|
/**
|
|
3
|
-
* Creates a
|
|
4
|
+
* Creates a compositeOverflow store.
|
|
4
5
|
*/
|
|
5
6
|
export declare function createCompositeOverflowStore(props?: CompositeOverflowStoreProps): CompositeOverflowStore;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
export interface CompositeOverflowStoreState extends PopoverStoreState {
|
|
8
|
+
}
|
|
9
|
+
export interface CompositeOverflowStoreFunctions extends PopoverStoreFunctions {
|
|
10
|
+
}
|
|
11
|
+
export interface CompositeOverflowStoreOptions extends PopoverStoreOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface CompositeOverflowStoreProps extends CompositeOverflowStoreOptions, StoreProps<CompositeOverflowStoreState> {
|
|
14
|
+
}
|
|
15
|
+
export interface CompositeOverflowStore extends CompositeOverflowStoreFunctions, Store<CompositeOverflowStoreState> {
|
|
16
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.js";
|
|
2
3
|
/**
|
|
3
|
-
* Creates a
|
|
4
|
+
* Creates a compositeOverflow store.
|
|
4
5
|
*/
|
|
5
6
|
export declare function createCompositeOverflowStore(props?: CompositeOverflowStoreProps): CompositeOverflowStore;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
export interface CompositeOverflowStoreState extends PopoverStoreState {
|
|
8
|
+
}
|
|
9
|
+
export interface CompositeOverflowStoreFunctions extends PopoverStoreFunctions {
|
|
10
|
+
}
|
|
11
|
+
export interface CompositeOverflowStoreOptions extends PopoverStoreOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface CompositeOverflowStoreProps extends CompositeOverflowStoreOptions, StoreProps<CompositeOverflowStoreState> {
|
|
14
|
+
}
|
|
15
|
+
export interface CompositeOverflowStore extends CompositeOverflowStoreFunctions, Store<CompositeOverflowStoreState> {
|
|
16
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
|
|
5
|
+
require('../__chunks/ZQTYFYRS.cjs');
|
|
6
|
+
require('../__chunks/2UK5WUJX.cjs');
|
|
7
7
|
require('../__chunks/3UT5FE6K.cjs');
|
|
8
8
|
require('../__chunks/5F4DVUNS.cjs');
|
|
9
9
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createCompositeStore =
|
|
13
|
+
exports.createCompositeStore = _QAZ4PF7Scjs.createCompositeStore;
|
|
@@ -2,18 +2,28 @@ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOpti
|
|
|
2
2
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
3
3
|
import type { SetState } from "../utils/types.js";
|
|
4
4
|
type Orientation = "horizontal" | "vertical" | "both";
|
|
5
|
-
interface Item extends CollectionStoreItem {
|
|
6
|
-
rowId?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
children?: string;
|
|
9
|
-
}
|
|
10
5
|
/**
|
|
11
6
|
* Creates a composite store.
|
|
12
7
|
*/
|
|
13
|
-
export declare function createCompositeStore<T extends
|
|
8
|
+
export declare function createCompositeStore<T extends CompositeStoreItem = CompositeStoreItem>(props?: CompositeStoreProps<T>): CompositeStore<T>;
|
|
14
9
|
export type CompositeStoreOrientation = Orientation;
|
|
15
|
-
export
|
|
16
|
-
|
|
10
|
+
export interface CompositeStoreItem extends CollectionStoreItem {
|
|
11
|
+
/**
|
|
12
|
+
* The row id of the item. This is only used on two-dimensional composites
|
|
13
|
+
* (when using `CompositeRow`).
|
|
14
|
+
*/
|
|
15
|
+
rowId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* If enabled, the item will be disabled and users won't be able to focus it
|
|
18
|
+
* using arrow keys.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The item children. This can be used for typeahead purposes.
|
|
23
|
+
*/
|
|
24
|
+
children?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CompositeStoreState<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreState<T> {
|
|
17
27
|
/**
|
|
18
28
|
* The composite element.
|
|
19
29
|
*/
|
|
@@ -117,7 +127,7 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
117
127
|
*/
|
|
118
128
|
activeId: string | null | undefined;
|
|
119
129
|
}
|
|
120
|
-
export interface CompositeStoreFunctions<T extends
|
|
130
|
+
export interface CompositeStoreFunctions<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreFunctions<T> {
|
|
121
131
|
/**
|
|
122
132
|
* Sets the `baseElement`.
|
|
123
133
|
*/
|
|
@@ -188,7 +198,7 @@ export interface CompositeStoreFunctions<T extends Item = Item> extends Collecti
|
|
|
188
198
|
*/
|
|
189
199
|
last: () => string | null | undefined;
|
|
190
200
|
}
|
|
191
|
-
export interface CompositeStoreOptions<T extends
|
|
201
|
+
export interface CompositeStoreOptions<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreOptions<T>, StoreOptions<CompositeStoreState<T>, "virtualFocus" | "orientation" | "rtl" | "focusLoop" | "focusWrap" | "focusShift" | "includesBaseElement" | "activeId"> {
|
|
192
202
|
/**
|
|
193
203
|
* The composite item id that should be active by default when the composite
|
|
194
204
|
* widget is rendered. If `null`, the composite element itself will have focus
|
|
@@ -197,8 +207,8 @@ export interface CompositeStoreOptions<T extends Item = Item> extends StoreOptio
|
|
|
197
207
|
*/
|
|
198
208
|
defaultActiveId?: CompositeStoreState<T>["activeId"];
|
|
199
209
|
}
|
|
200
|
-
export interface CompositeStoreProps<T extends
|
|
210
|
+
export interface CompositeStoreProps<T extends CompositeStoreItem = CompositeStoreItem> extends CompositeStoreOptions<T>, StoreProps<CompositeStoreState<T>> {
|
|
201
211
|
}
|
|
202
|
-
export interface CompositeStore<T extends
|
|
212
|
+
export interface CompositeStore<T extends CompositeStoreItem = CompositeStoreItem> extends CompositeStoreFunctions<T>, Store<CompositeStoreState<T>> {
|
|
203
213
|
}
|
|
204
214
|
export {};
|
|
@@ -2,18 +2,28 @@ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOpti
|
|
|
2
2
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
3
3
|
import type { SetState } from "../utils/types.js";
|
|
4
4
|
type Orientation = "horizontal" | "vertical" | "both";
|
|
5
|
-
interface Item extends CollectionStoreItem {
|
|
6
|
-
rowId?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
children?: string;
|
|
9
|
-
}
|
|
10
5
|
/**
|
|
11
6
|
* Creates a composite store.
|
|
12
7
|
*/
|
|
13
|
-
export declare function createCompositeStore<T extends
|
|
8
|
+
export declare function createCompositeStore<T extends CompositeStoreItem = CompositeStoreItem>(props?: CompositeStoreProps<T>): CompositeStore<T>;
|
|
14
9
|
export type CompositeStoreOrientation = Orientation;
|
|
15
|
-
export
|
|
16
|
-
|
|
10
|
+
export interface CompositeStoreItem extends CollectionStoreItem {
|
|
11
|
+
/**
|
|
12
|
+
* The row id of the item. This is only used on two-dimensional composites
|
|
13
|
+
* (when using `CompositeRow`).
|
|
14
|
+
*/
|
|
15
|
+
rowId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* If enabled, the item will be disabled and users won't be able to focus it
|
|
18
|
+
* using arrow keys.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The item children. This can be used for typeahead purposes.
|
|
23
|
+
*/
|
|
24
|
+
children?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CompositeStoreState<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreState<T> {
|
|
17
27
|
/**
|
|
18
28
|
* The composite element.
|
|
19
29
|
*/
|
|
@@ -117,7 +127,7 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
117
127
|
*/
|
|
118
128
|
activeId: string | null | undefined;
|
|
119
129
|
}
|
|
120
|
-
export interface CompositeStoreFunctions<T extends
|
|
130
|
+
export interface CompositeStoreFunctions<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreFunctions<T> {
|
|
121
131
|
/**
|
|
122
132
|
* Sets the `baseElement`.
|
|
123
133
|
*/
|
|
@@ -188,7 +198,7 @@ export interface CompositeStoreFunctions<T extends Item = Item> extends Collecti
|
|
|
188
198
|
*/
|
|
189
199
|
last: () => string | null | undefined;
|
|
190
200
|
}
|
|
191
|
-
export interface CompositeStoreOptions<T extends
|
|
201
|
+
export interface CompositeStoreOptions<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreOptions<T>, StoreOptions<CompositeStoreState<T>, "virtualFocus" | "orientation" | "rtl" | "focusLoop" | "focusWrap" | "focusShift" | "includesBaseElement" | "activeId"> {
|
|
192
202
|
/**
|
|
193
203
|
* The composite item id that should be active by default when the composite
|
|
194
204
|
* widget is rendered. If `null`, the composite element itself will have focus
|
|
@@ -197,8 +207,8 @@ export interface CompositeStoreOptions<T extends Item = Item> extends StoreOptio
|
|
|
197
207
|
*/
|
|
198
208
|
defaultActiveId?: CompositeStoreState<T>["activeId"];
|
|
199
209
|
}
|
|
200
|
-
export interface CompositeStoreProps<T extends
|
|
210
|
+
export interface CompositeStoreProps<T extends CompositeStoreItem = CompositeStoreItem> extends CompositeStoreOptions<T>, StoreProps<CompositeStoreState<T>> {
|
|
201
211
|
}
|
|
202
|
-
export interface CompositeStore<T extends
|
|
212
|
+
export interface CompositeStore<T extends CompositeStoreItem = CompositeStoreItem> extends CompositeStoreFunctions<T>, Store<CompositeStoreState<T>> {
|
|
203
213
|
}
|
|
204
214
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _2LS4JJ4Scjs = require('../__chunks/2LS4JJ4S.cjs');
|
|
5
|
+
require('../__chunks/GJFZ5ZPP.cjs');
|
|
6
|
+
require('../__chunks/2UK5WUJX.cjs');
|
|
7
7
|
require('../__chunks/3UT5FE6K.cjs');
|
|
8
8
|
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createDialogStore =
|
|
11
|
+
exports.createDialogStore = _2LS4JJ4Scjs.createDialogStore;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.js";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates a dialog store.
|
|
4
5
|
*/
|
|
5
6
|
export declare function createDialogStore(props?: DialogStoreProps): DialogStore;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
export interface DialogStoreState extends DisclosureStoreState {
|
|
8
|
+
}
|
|
9
|
+
export interface DialogStoreFunctions extends DisclosureStoreFunctions {
|
|
10
|
+
}
|
|
11
|
+
export interface DialogStoreOptions extends DisclosureStoreOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface DialogStoreProps extends DialogStoreOptions, StoreProps<DialogStoreState> {
|
|
14
|
+
}
|
|
15
|
+
export interface DialogStore extends DialogStoreFunctions, Store<DialogStoreState> {
|
|
16
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.js";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates a dialog store.
|
|
4
5
|
*/
|
|
5
6
|
export declare function createDialogStore(props?: DialogStoreProps): DialogStore;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
export interface DialogStoreState extends DisclosureStoreState {
|
|
8
|
+
}
|
|
9
|
+
export interface DialogStoreFunctions extends DisclosureStoreFunctions {
|
|
10
|
+
}
|
|
11
|
+
export interface DialogStoreOptions extends DisclosureStoreOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface DialogStoreProps extends DialogStoreOptions, StoreProps<DialogStoreState> {
|
|
14
|
+
}
|
|
15
|
+
export interface DialogStore extends DialogStoreFunctions, Store<DialogStoreState> {
|
|
16
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _GJFZ5ZPPcjs = require('../__chunks/GJFZ5ZPP.cjs');
|
|
5
|
+
require('../__chunks/2UK5WUJX.cjs');
|
|
6
6
|
require('../__chunks/3UT5FE6K.cjs');
|
|
7
7
|
require('../__chunks/AV6KTKLE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDisclosureStore =
|
|
10
|
+
exports.createDisclosureStore = _GJFZ5ZPPcjs.createDisclosureStore;
|
|
@@ -123,5 +123,7 @@ export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreStat
|
|
|
123
123
|
*/
|
|
124
124
|
disclosure?: DisclosureStore | null;
|
|
125
125
|
}
|
|
126
|
-
export
|
|
127
|
-
|
|
126
|
+
export interface DisclosureStoreProps extends DisclosureStoreOptions, StoreProps<DisclosureStoreState> {
|
|
127
|
+
}
|
|
128
|
+
export interface DisclosureStore extends DisclosureStoreFunctions, Store<DisclosureStoreState> {
|
|
129
|
+
}
|
|
@@ -123,5 +123,7 @@ export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreStat
|
|
|
123
123
|
*/
|
|
124
124
|
disclosure?: DisclosureStore | null;
|
|
125
125
|
}
|
|
126
|
-
export
|
|
127
|
-
|
|
126
|
+
export interface DisclosureStoreProps extends DisclosureStoreOptions, StoreProps<DisclosureStoreState> {
|
|
127
|
+
}
|
|
128
|
+
export interface DisclosureStore extends DisclosureStoreFunctions, Store<DisclosureStoreState> {
|
|
129
|
+
}
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _ZQTYFYRScjs = require('../__chunks/ZQTYFYRS.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -114,9 +114,9 @@ function createNames() {
|
|
|
114
114
|
}
|
|
115
115
|
function createFormStore(props = {}) {
|
|
116
116
|
var _a;
|
|
117
|
-
|
|
117
|
+
_2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
118
118
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
119
|
-
const collection =
|
|
119
|
+
const collection = _ZQTYFYRScjs.createCollectionStore.call(void 0, props);
|
|
120
120
|
const values = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
121
121
|
props.values,
|
|
122
122
|
syncState == null ? void 0 : syncState.values,
|
|
@@ -145,15 +145,15 @@ function createFormStore(props = {}) {
|
|
|
145
145
|
submitFailed: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
146
146
|
valid: !hasMessages(errors)
|
|
147
147
|
});
|
|
148
|
-
const form =
|
|
148
|
+
const form = _2UK5WUJXcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
149
149
|
const syncCallbacks = getStoreCallbacks(props.store);
|
|
150
150
|
const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
|
|
151
151
|
const callbacksInitialState = {
|
|
152
152
|
validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
|
|
153
153
|
submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
|
|
154
154
|
};
|
|
155
|
-
const callbacks =
|
|
156
|
-
|
|
155
|
+
const callbacks = _2UK5WUJXcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
156
|
+
_2UK5WUJXcjs.setup.call(void 0, form, () => _2UK5WUJXcjs.init.call(void 0, callbacks));
|
|
157
157
|
const validate = async () => {
|
|
158
158
|
form.setState("validating", true);
|
|
159
159
|
form.setState("errors", {});
|