@ariakit/core 0.1.4 → 0.2.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/CHANGELOG.md +66 -0
- package/cjs/__chunks/{QYB6XH64.cjs → 27ZAGOYG.cjs} +17 -13
- package/cjs/__chunks/6455U47T.cjs +37 -0
- package/cjs/__chunks/{ZPOXPO2L.cjs → 6SPJEESB.cjs} +33 -21
- package/cjs/__chunks/CNODBYSG.cjs +58 -0
- package/cjs/__chunks/{2YFRPUZP.cjs → DBHIHK7C.cjs} +6 -6
- package/cjs/__chunks/{W5IHD6VG.cjs → EUJ6NNA6.cjs} +56 -43
- package/cjs/__chunks/{4DQ3OTE7.cjs → FXEBKN6G.cjs} +22 -17
- package/cjs/__chunks/{ZJEEK57E.cjs → HEFJPUYD.cjs} +2 -2
- package/cjs/__chunks/{QNEPGQLL.cjs → M6ZA7XUP.cjs} +6 -2
- package/cjs/__chunks/RD3S4VKY.cjs +60 -0
- package/cjs/__chunks/{OFNGELMA.cjs → ZNW4LSWU.cjs} +8 -6
- package/cjs/checkbox/checkbox-store.cjs +14 -10
- package/cjs/collection/collection-store.cjs +6 -5
- package/cjs/combobox/combobox-store.cjs +49 -48
- package/cjs/composite/composite-overflow-store.cjs +7 -6
- package/cjs/composite/composite-store.cjs +7 -6
- package/cjs/dialog/dialog-store.cjs +6 -5
- package/cjs/disclosure/disclosure-store.cjs +5 -4
- package/cjs/disclosure/disclosure-store.d.ts +8 -0
- package/cjs/form/form-store.cjs +38 -35
- package/cjs/hovercard/hovercard-store.cjs +8 -7
- package/cjs/hovercard/hovercard-store.d.ts +3 -2
- package/cjs/index.cjs +3 -1
- package/cjs/menu/menu-bar-store.cjs +17 -13
- package/cjs/menu/menu-store.cjs +41 -43
- package/cjs/popover/popover-store.cjs +7 -6
- package/cjs/popover/popover-store.d.ts +8 -89
- package/cjs/radio/radio-store.cjs +25 -24
- package/cjs/select/select-store.cjs +42 -42
- package/cjs/tab/tab-store.cjs +29 -28
- package/cjs/tab/tab-store.d.ts +9 -0
- package/cjs/toolbar/toolbar-store.cjs +17 -13
- package/cjs/tooltip/tooltip-store.cjs +31 -79
- package/cjs/tooltip/tooltip-store.d.ts +20 -15
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/array.cjs +1 -0
- package/cjs/utils/dom.cjs +3 -2
- package/cjs/utils/events.cjs +14 -9
- package/cjs/utils/focus.cjs +24 -14
- package/cjs/utils/misc.cjs +3 -2
- package/cjs/utils/platform.cjs +4 -3
- package/cjs/utils/store.cjs +4 -3
- package/esm/__chunks/3BAGFTL5.js +58 -0
- package/esm/__chunks/4BKCJXBM.js +37 -0
- package/esm/__chunks/{NA5BK7DD.js → BOKMNDR7.js} +22 -10
- package/esm/__chunks/{WFGVC6LE.js → EWHSN7GO.js} +17 -12
- package/esm/__chunks/{4T5RHRE5.js → MNNKHNLW.js} +1 -1
- package/esm/__chunks/{UVCATTRC.js → N6JW4ITM.js} +7 -5
- package/esm/__chunks/{RMD7SNCC.js → NWU4GBZ6.js} +5 -1
- package/esm/__chunks/{X7MJ3FB5.js → R6VHFWTV.js} +49 -36
- package/esm/__chunks/{DXA3K2FY.js → TFBCK4JB.js} +1 -1
- package/esm/__chunks/Z5IDQSMV.js +60 -0
- package/esm/__chunks/{IOAGNCXX.js → ZV2GEGPL.js} +14 -10
- package/esm/checkbox/checkbox-store.js +11 -7
- package/esm/collection/collection-store.js +5 -4
- package/esm/combobox/combobox-store.js +34 -33
- package/esm/composite/composite-overflow-store.js +6 -5
- package/esm/composite/composite-store.js +6 -5
- package/esm/dialog/dialog-store.js +5 -4
- package/esm/disclosure/disclosure-store.d.ts +8 -0
- package/esm/disclosure/disclosure-store.js +4 -3
- package/esm/form/form-store.js +24 -21
- package/esm/hovercard/hovercard-store.d.ts +3 -2
- package/esm/hovercard/hovercard-store.js +7 -6
- package/esm/index.js +2 -0
- package/esm/menu/menu-bar-store.js +15 -11
- package/esm/menu/menu-store.js +31 -33
- package/esm/popover/popover-store.d.ts +8 -89
- package/esm/popover/popover-store.js +6 -5
- package/esm/radio/radio-store.js +22 -21
- package/esm/select/select-store.js +29 -29
- package/esm/tab/tab-store.d.ts +9 -0
- package/esm/tab/tab-store.js +23 -22
- package/esm/toolbar/toolbar-store.js +15 -11
- package/esm/tooltip/tooltip-store.d.ts +20 -15
- package/esm/tooltip/tooltip-store.js +32 -80
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/array.js +1 -0
- package/esm/utils/dom.js +2 -1
- package/esm/utils/events.js +10 -5
- package/esm/utils/focus.js +14 -4
- package/esm/utils/misc.js +2 -1
- package/esm/utils/platform.js +3 -2
- package/esm/utils/store.js +3 -2
- package/package.json +1 -1
- package/cjs/__chunks/DQHU5K4Q.cjs +0 -57
- package/cjs/__chunks/HLVPXX7H.cjs +0 -1491
- package/esm/__chunks/6HMPWUDT.js +0 -57
- package/esm/__chunks/6PEWNRTN.js +0 -1491
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCollectionStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/EWHSN7GO.js";
|
|
4
|
+
import "../__chunks/BOKMNDR7.js";
|
|
5
|
+
import "../__chunks/NWU4GBZ6.js";
|
|
6
|
+
import "../__chunks/N6JW4ITM.js";
|
|
7
|
+
import "../__chunks/4BKCJXBM.js";
|
|
7
8
|
export {
|
|
8
9
|
createCollectionStore
|
|
9
10
|
};
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPopoverStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/Z5IDQSMV.js";
|
|
4
|
+
import "../__chunks/MNNKHNLW.js";
|
|
5
|
+
import "../__chunks/ZV2GEGPL.js";
|
|
6
6
|
import {
|
|
7
7
|
createCompositeStore
|
|
8
|
-
} from "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
8
|
+
} from "../__chunks/R6VHFWTV.js";
|
|
9
|
+
import "../__chunks/EWHSN7GO.js";
|
|
10
10
|
import {
|
|
11
11
|
createStore,
|
|
12
12
|
mergeStore
|
|
13
|
-
} from "../__chunks/
|
|
13
|
+
} from "../__chunks/BOKMNDR7.js";
|
|
14
14
|
import {
|
|
15
15
|
defaultValue
|
|
16
|
-
} from "../__chunks/
|
|
16
|
+
} from "../__chunks/NWU4GBZ6.js";
|
|
17
17
|
import {
|
|
18
18
|
isSafari,
|
|
19
19
|
isTouchDevice
|
|
20
|
-
} from "../__chunks/
|
|
21
|
-
import "../__chunks/
|
|
20
|
+
} from "../__chunks/TFBCK4JB.js";
|
|
21
|
+
import "../__chunks/N6JW4ITM.js";
|
|
22
22
|
import "../__chunks/5XEKIOCW.js";
|
|
23
|
+
import {
|
|
24
|
+
__objRest,
|
|
25
|
+
__spreadProps,
|
|
26
|
+
__spreadValues
|
|
27
|
+
} from "../__chunks/4BKCJXBM.js";
|
|
23
28
|
|
|
24
29
|
// src/combobox/combobox-store.ts
|
|
25
30
|
var isSafariOnMobile = isSafari() && isTouchDevice();
|
|
26
|
-
function createComboboxStore({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} =
|
|
31
|
+
function createComboboxStore(_a = {}) {
|
|
32
|
+
var _b = _a, {
|
|
33
|
+
menu,
|
|
34
|
+
select
|
|
35
|
+
} = _b, props = __objRest(_b, [
|
|
36
|
+
"menu",
|
|
37
|
+
"select"
|
|
38
|
+
]);
|
|
31
39
|
const store = mergeStore(
|
|
32
40
|
props.store,
|
|
33
|
-
menu
|
|
41
|
+
menu == null ? void 0 : menu.omit(
|
|
34
42
|
"baseElement",
|
|
35
43
|
"arrowElement",
|
|
36
44
|
"anchorElement",
|
|
@@ -38,7 +46,7 @@ function createComboboxStore({
|
|
|
38
46
|
"popoverElement",
|
|
39
47
|
"disclosureElement"
|
|
40
48
|
),
|
|
41
|
-
select
|
|
49
|
+
select == null ? void 0 : select.omit(
|
|
42
50
|
"value",
|
|
43
51
|
"items",
|
|
44
52
|
"renderedItems",
|
|
@@ -57,8 +65,7 @@ function createComboboxStore({
|
|
|
57
65
|
props.defaultActiveId,
|
|
58
66
|
null
|
|
59
67
|
);
|
|
60
|
-
const composite = createCompositeStore({
|
|
61
|
-
...props,
|
|
68
|
+
const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
|
|
62
69
|
store,
|
|
63
70
|
activeId,
|
|
64
71
|
includesBaseElement: defaultValue(
|
|
@@ -75,28 +82,25 @@ function createComboboxStore({
|
|
|
75
82
|
focusWrap: defaultValue(props.focusWrap, syncState.focusWrap, true),
|
|
76
83
|
virtualFocus: defaultValue(
|
|
77
84
|
props.virtualFocus,
|
|
78
|
-
syncState
|
|
85
|
+
syncState == null ? void 0 : syncState.virtualFocus,
|
|
79
86
|
!isSafariOnMobile
|
|
80
87
|
)
|
|
81
|
-
});
|
|
82
|
-
const popover = createPopoverStore({
|
|
83
|
-
...props,
|
|
88
|
+
}));
|
|
89
|
+
const popover = createPopoverStore(__spreadProps(__spreadValues({}, props), {
|
|
84
90
|
store,
|
|
85
91
|
placement: defaultValue(
|
|
86
92
|
props.placement,
|
|
87
93
|
syncState.placement,
|
|
88
94
|
"bottom-start"
|
|
89
95
|
)
|
|
90
|
-
});
|
|
96
|
+
}));
|
|
91
97
|
const initialValue = defaultValue(
|
|
92
98
|
props.value,
|
|
93
99
|
syncState.value,
|
|
94
100
|
props.defaultValue,
|
|
95
101
|
""
|
|
96
102
|
);
|
|
97
|
-
const initialState = {
|
|
98
|
-
...composite.getState(),
|
|
99
|
-
...popover.getState(),
|
|
103
|
+
const initialState = __spreadProps(__spreadValues(__spreadValues({}, composite.getState()), popover.getState()), {
|
|
100
104
|
value: initialValue,
|
|
101
105
|
resetValueOnHide: defaultValue(
|
|
102
106
|
props.resetValueOnHide,
|
|
@@ -104,7 +108,7 @@ function createComboboxStore({
|
|
|
104
108
|
false
|
|
105
109
|
),
|
|
106
110
|
activeValue: syncState.activeValue
|
|
107
|
-
};
|
|
111
|
+
});
|
|
108
112
|
const combobox = createStore(initialState, composite, popover, store);
|
|
109
113
|
combobox.setup(
|
|
110
114
|
() => combobox.sync(
|
|
@@ -146,17 +150,14 @@ function createComboboxStore({
|
|
|
146
150
|
return;
|
|
147
151
|
const { activeId: activeId2 } = combobox.getState();
|
|
148
152
|
const activeItem = composite.item(activeId2);
|
|
149
|
-
combobox.setState("activeValue", activeItem
|
|
153
|
+
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
|
|
150
154
|
},
|
|
151
155
|
["moves", "renderedItems"]
|
|
152
156
|
)
|
|
153
157
|
);
|
|
154
|
-
return {
|
|
155
|
-
...popover,
|
|
156
|
-
...composite,
|
|
157
|
-
...combobox,
|
|
158
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, popover), composite), combobox), {
|
|
158
159
|
setValue: (value) => combobox.setState("value", value)
|
|
159
|
-
};
|
|
160
|
+
});
|
|
160
161
|
}
|
|
161
162
|
export {
|
|
162
163
|
createComboboxStore
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPopoverStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/Z5IDQSMV.js";
|
|
4
|
+
import "../__chunks/MNNKHNLW.js";
|
|
5
|
+
import "../__chunks/ZV2GEGPL.js";
|
|
6
|
+
import "../__chunks/BOKMNDR7.js";
|
|
7
|
+
import "../__chunks/NWU4GBZ6.js";
|
|
8
|
+
import "../__chunks/4BKCJXBM.js";
|
|
8
9
|
|
|
9
10
|
// src/composite/composite-overflow-store.ts
|
|
10
11
|
function createCompositeOverflowStore(props = {}) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/R6VHFWTV.js";
|
|
4
|
+
import "../__chunks/EWHSN7GO.js";
|
|
5
|
+
import "../__chunks/BOKMNDR7.js";
|
|
6
|
+
import "../__chunks/NWU4GBZ6.js";
|
|
7
|
+
import "../__chunks/N6JW4ITM.js";
|
|
8
8
|
import "../__chunks/5XEKIOCW.js";
|
|
9
|
+
import "../__chunks/4BKCJXBM.js";
|
|
9
10
|
export {
|
|
10
11
|
createCompositeStore
|
|
11
12
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/MNNKHNLW.js";
|
|
4
|
+
import "../__chunks/ZV2GEGPL.js";
|
|
5
|
+
import "../__chunks/BOKMNDR7.js";
|
|
6
|
+
import "../__chunks/NWU4GBZ6.js";
|
|
7
|
+
import "../__chunks/4BKCJXBM.js";
|
|
7
8
|
export {
|
|
8
9
|
createDialogStore
|
|
9
10
|
};
|
|
@@ -7,6 +7,10 @@ export declare function createDisclosureStore(props?: DisclosureStoreProps): Dis
|
|
|
7
7
|
export interface DisclosureStoreState {
|
|
8
8
|
/**
|
|
9
9
|
* The visibility state of the content.
|
|
10
|
+
*
|
|
11
|
+
* Live examples:
|
|
12
|
+
* - [Dialog with React
|
|
13
|
+
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
10
14
|
* @default false
|
|
11
15
|
*/
|
|
12
16
|
open: boolean;
|
|
@@ -58,6 +62,8 @@ export interface DisclosureStoreFunctions {
|
|
|
58
62
|
* Live examples:
|
|
59
63
|
* - [Textarea with inline
|
|
60
64
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
65
|
+
* - [Dialog with React
|
|
66
|
+
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
61
67
|
* @example
|
|
62
68
|
* store.setOpen(true);
|
|
63
69
|
* store.setOpen((open) => !open);
|
|
@@ -77,6 +83,8 @@ export interface DisclosureStoreFunctions {
|
|
|
77
83
|
* Live examples:
|
|
78
84
|
* - [Textarea with inline
|
|
79
85
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
86
|
+
* - [Dialog with React
|
|
87
|
+
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
80
88
|
*/
|
|
81
89
|
hide: () => void;
|
|
82
90
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDisclosureStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/ZV2GEGPL.js";
|
|
4
|
+
import "../__chunks/BOKMNDR7.js";
|
|
5
|
+
import "../__chunks/NWU4GBZ6.js";
|
|
6
|
+
import "../__chunks/4BKCJXBM.js";
|
|
6
7
|
export {
|
|
7
8
|
createDisclosureStore
|
|
8
9
|
};
|
package/esm/form/form-store.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCollectionStore
|
|
3
|
-
} from "../__chunks/
|
|
3
|
+
} from "../__chunks/EWHSN7GO.js";
|
|
4
4
|
import {
|
|
5
5
|
createStore
|
|
6
|
-
} from "../__chunks/
|
|
6
|
+
} from "../__chunks/BOKMNDR7.js";
|
|
7
7
|
import {
|
|
8
8
|
applyState,
|
|
9
9
|
defaultValue,
|
|
10
10
|
isInteger,
|
|
11
11
|
isObject
|
|
12
|
-
} from "../__chunks/
|
|
13
|
-
import "../__chunks/
|
|
12
|
+
} from "../__chunks/NWU4GBZ6.js";
|
|
13
|
+
import "../__chunks/N6JW4ITM.js";
|
|
14
|
+
import {
|
|
15
|
+
__spreadProps,
|
|
16
|
+
__spreadValues
|
|
17
|
+
} from "../__chunks/4BKCJXBM.js";
|
|
14
18
|
|
|
15
19
|
// src/form/form-store.ts
|
|
16
20
|
function nextFrame() {
|
|
@@ -25,12 +29,13 @@ function hasMessages(object) {
|
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
function get(values, path, defaultValue2) {
|
|
32
|
+
var _a;
|
|
28
33
|
const [key, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
|
|
29
34
|
if (key == null || !values) {
|
|
30
35
|
return defaultValue2;
|
|
31
36
|
}
|
|
32
37
|
if (!rest.length) {
|
|
33
|
-
return values[key]
|
|
38
|
+
return (_a = values[key]) != null ? _a : defaultValue2;
|
|
34
39
|
}
|
|
35
40
|
return get(values[key], rest, defaultValue2);
|
|
36
41
|
}
|
|
@@ -56,7 +61,7 @@ function set(values, path, value) {
|
|
|
56
61
|
nextValues2[index] = result;
|
|
57
62
|
return nextValues2;
|
|
58
63
|
}
|
|
59
|
-
return {
|
|
64
|
+
return __spreadProps(__spreadValues({}, values), { [key]: result });
|
|
60
65
|
}
|
|
61
66
|
function setAll(values, value) {
|
|
62
67
|
const result = {};
|
|
@@ -101,37 +106,37 @@ function createNames() {
|
|
|
101
106
|
return new Proxy(/* @__PURE__ */ Object.create(null), getNameHandler(cache));
|
|
102
107
|
}
|
|
103
108
|
function createFormStore(props = {}) {
|
|
104
|
-
|
|
109
|
+
var _a;
|
|
110
|
+
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
105
111
|
const collection = createCollectionStore(props);
|
|
106
112
|
const values = defaultValue(
|
|
107
113
|
props.values,
|
|
108
|
-
syncState
|
|
114
|
+
syncState == null ? void 0 : syncState.values,
|
|
109
115
|
props.defaultValues,
|
|
110
116
|
{}
|
|
111
117
|
);
|
|
112
118
|
const errors = defaultValue(
|
|
113
119
|
props.errors,
|
|
114
|
-
syncState
|
|
120
|
+
syncState == null ? void 0 : syncState.errors,
|
|
115
121
|
props.defaultErrors,
|
|
116
122
|
{}
|
|
117
123
|
);
|
|
118
124
|
const touched = defaultValue(
|
|
119
125
|
props.touched,
|
|
120
|
-
syncState
|
|
126
|
+
syncState == null ? void 0 : syncState.touched,
|
|
121
127
|
props.defaultTouched,
|
|
122
128
|
{}
|
|
123
129
|
);
|
|
124
|
-
const initialState = {
|
|
125
|
-
...collection.getState(),
|
|
130
|
+
const initialState = __spreadProps(__spreadValues({}, collection.getState()), {
|
|
126
131
|
values,
|
|
127
132
|
errors,
|
|
128
133
|
touched,
|
|
129
|
-
validating: defaultValue(syncState
|
|
130
|
-
submitting: defaultValue(syncState
|
|
131
|
-
submitSucceed: defaultValue(syncState
|
|
132
|
-
submitFailed: defaultValue(syncState
|
|
134
|
+
validating: defaultValue(syncState == null ? void 0 : syncState.validating, false),
|
|
135
|
+
submitting: defaultValue(syncState == null ? void 0 : syncState.submitting, false),
|
|
136
|
+
submitSucceed: defaultValue(syncState == null ? void 0 : syncState.submitSucceed, 0),
|
|
137
|
+
submitFailed: defaultValue(syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
133
138
|
valid: !hasMessages(errors)
|
|
134
|
-
};
|
|
139
|
+
});
|
|
135
140
|
const form = createStore(initialState, collection, props.store);
|
|
136
141
|
const validateCallbacks = /* @__PURE__ */ new Set();
|
|
137
142
|
const submitCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -148,9 +153,7 @@ function createFormStore(props = {}) {
|
|
|
148
153
|
form.setState("validating", false);
|
|
149
154
|
}
|
|
150
155
|
};
|
|
151
|
-
return {
|
|
152
|
-
...collection,
|
|
153
|
-
...form,
|
|
156
|
+
return __spreadProps(__spreadValues(__spreadValues({}, collection), form), {
|
|
154
157
|
names: createNames(),
|
|
155
158
|
setValues: (values2) => form.setState("values", values2),
|
|
156
159
|
getValue: (name) => get(form.getState().values, name),
|
|
@@ -232,7 +235,7 @@ function createFormStore(props = {}) {
|
|
|
232
235
|
form.setState("submitSucceed", 0);
|
|
233
236
|
form.setState("submitFailed", 0);
|
|
234
237
|
}
|
|
235
|
-
};
|
|
238
|
+
});
|
|
236
239
|
}
|
|
237
240
|
export {
|
|
238
241
|
createFormStore,
|
|
@@ -11,8 +11,9 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
11
11
|
*/
|
|
12
12
|
placement: PopoverStoreState["placement"];
|
|
13
13
|
/**
|
|
14
|
-
* The amount of time in milliseconds to wait before showing
|
|
15
|
-
* popover.
|
|
14
|
+
* The amount of time in milliseconds to wait before showing and hiding the
|
|
15
|
+
* popover. To control the delay for showing and hiding separately, use
|
|
16
|
+
* `showTimeout` and `hideTimeout`.
|
|
16
17
|
* @default 500
|
|
17
18
|
*/
|
|
18
19
|
timeout: number;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHovercardStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/3BAGFTL5.js";
|
|
4
|
+
import "../__chunks/Z5IDQSMV.js";
|
|
5
|
+
import "../__chunks/MNNKHNLW.js";
|
|
6
|
+
import "../__chunks/ZV2GEGPL.js";
|
|
7
|
+
import "../__chunks/BOKMNDR7.js";
|
|
8
|
+
import "../__chunks/NWU4GBZ6.js";
|
|
9
|
+
import "../__chunks/4BKCJXBM.js";
|
|
9
10
|
export {
|
|
10
11
|
createHovercardStore
|
|
11
12
|
};
|
package/esm/index.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/R6VHFWTV.js";
|
|
4
|
+
import "../__chunks/EWHSN7GO.js";
|
|
5
|
+
import "../__chunks/BOKMNDR7.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
|
-
} from "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
8
|
+
} from "../__chunks/NWU4GBZ6.js";
|
|
9
|
+
import "../__chunks/N6JW4ITM.js";
|
|
10
10
|
import "../__chunks/5XEKIOCW.js";
|
|
11
|
+
import {
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "../__chunks/4BKCJXBM.js";
|
|
11
15
|
|
|
12
16
|
// src/menu/menu-bar-store.ts
|
|
13
17
|
function createMenuBarStore(props = {}) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
var _a;
|
|
19
|
+
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
+
return createCompositeStore(__spreadProps(__spreadValues({}, props), {
|
|
17
21
|
orientation: defaultValue(
|
|
18
22
|
props.orientation,
|
|
19
|
-
syncState
|
|
23
|
+
syncState == null ? void 0 : syncState.orientation,
|
|
20
24
|
"horizontal"
|
|
21
25
|
),
|
|
22
|
-
focusLoop: defaultValue(props.focusLoop, syncState
|
|
23
|
-
});
|
|
26
|
+
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
|
+
}));
|
|
24
28
|
}
|
|
25
29
|
export {
|
|
26
30
|
createMenuBarStore
|
package/esm/menu/menu-store.js
CHANGED
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHovercardStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/3BAGFTL5.js";
|
|
4
|
+
import "../__chunks/Z5IDQSMV.js";
|
|
5
|
+
import "../__chunks/MNNKHNLW.js";
|
|
6
|
+
import "../__chunks/ZV2GEGPL.js";
|
|
7
7
|
import {
|
|
8
8
|
createCompositeStore
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/R6VHFWTV.js";
|
|
10
|
+
import "../__chunks/EWHSN7GO.js";
|
|
11
11
|
import {
|
|
12
12
|
createStore,
|
|
13
13
|
mergeStore
|
|
14
|
-
} from "../__chunks/
|
|
14
|
+
} from "../__chunks/BOKMNDR7.js";
|
|
15
15
|
import {
|
|
16
16
|
applyState,
|
|
17
17
|
defaultValue
|
|
18
|
-
} from "../__chunks/
|
|
19
|
-
import "../__chunks/
|
|
18
|
+
} from "../__chunks/NWU4GBZ6.js";
|
|
19
|
+
import "../__chunks/N6JW4ITM.js";
|
|
20
20
|
import "../__chunks/5XEKIOCW.js";
|
|
21
|
+
import {
|
|
22
|
+
__objRest,
|
|
23
|
+
__spreadProps,
|
|
24
|
+
__spreadValues
|
|
25
|
+
} from "../__chunks/4BKCJXBM.js";
|
|
21
26
|
|
|
22
27
|
// src/menu/menu-store.ts
|
|
23
|
-
function createMenuStore({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} =
|
|
28
|
+
function createMenuStore(_a = {}) {
|
|
29
|
+
var _b = _a, {
|
|
30
|
+
combobox
|
|
31
|
+
} = _b, props = __objRest(_b, [
|
|
32
|
+
"combobox"
|
|
33
|
+
]);
|
|
27
34
|
const store = mergeStore(
|
|
28
35
|
props.store,
|
|
29
|
-
combobox
|
|
30
|
-
"baseElement",
|
|
36
|
+
combobox == null ? void 0 : combobox.omit(
|
|
31
37
|
"arrowElement",
|
|
32
38
|
"anchorElement",
|
|
33
39
|
"contentElement",
|
|
@@ -36,17 +42,15 @@ function createMenuStore({
|
|
|
36
42
|
)
|
|
37
43
|
);
|
|
38
44
|
const syncState = store.getState();
|
|
39
|
-
const composite = createCompositeStore({
|
|
40
|
-
...props,
|
|
45
|
+
const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
|
|
41
46
|
store,
|
|
42
47
|
orientation: defaultValue(
|
|
43
48
|
props.orientation,
|
|
44
49
|
syncState.orientation,
|
|
45
50
|
"vertical"
|
|
46
51
|
)
|
|
47
|
-
});
|
|
48
|
-
const hovercard = createHovercardStore({
|
|
49
|
-
...props,
|
|
52
|
+
}));
|
|
53
|
+
const hovercard = createHovercardStore(__spreadProps(__spreadValues({}, props), {
|
|
50
54
|
store,
|
|
51
55
|
placement: defaultValue(
|
|
52
56
|
props.placement,
|
|
@@ -54,10 +58,8 @@ function createMenuStore({
|
|
|
54
58
|
"bottom-start"
|
|
55
59
|
),
|
|
56
60
|
hideTimeout: defaultValue(props.hideTimeout, syncState.hideTimeout, 0)
|
|
57
|
-
});
|
|
58
|
-
const initialState = {
|
|
59
|
-
...composite.getState(),
|
|
60
|
-
...hovercard.getState(),
|
|
61
|
+
}));
|
|
62
|
+
const initialState = __spreadProps(__spreadValues(__spreadValues({}, composite.getState()), hovercard.getState()), {
|
|
61
63
|
initialFocus: defaultValue(syncState.initialFocus, "container"),
|
|
62
64
|
values: defaultValue(
|
|
63
65
|
props.values,
|
|
@@ -65,7 +67,7 @@ function createMenuStore({
|
|
|
65
67
|
props.defaultValues,
|
|
66
68
|
{}
|
|
67
69
|
)
|
|
68
|
-
};
|
|
70
|
+
});
|
|
69
71
|
const menu = createStore(initialState, composite, hovercard, store);
|
|
70
72
|
menu.setup(
|
|
71
73
|
() => menu.sync(
|
|
@@ -77,10 +79,7 @@ function createMenuStore({
|
|
|
77
79
|
["mounted"]
|
|
78
80
|
)
|
|
79
81
|
);
|
|
80
|
-
return {
|
|
81
|
-
...composite,
|
|
82
|
-
...hovercard,
|
|
83
|
-
...menu,
|
|
82
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, composite), hovercard), menu), {
|
|
84
83
|
setInitialFocus: (value) => menu.setState("initialFocus", value),
|
|
85
84
|
setValues: (values) => menu.setState("values", values),
|
|
86
85
|
setValue: (name, value) => {
|
|
@@ -95,13 +94,12 @@ function createMenuStore({
|
|
|
95
94
|
const nextValue = applyState(value, prevValue);
|
|
96
95
|
if (nextValue === prevValue)
|
|
97
96
|
return values;
|
|
98
|
-
return {
|
|
99
|
-
...values,
|
|
97
|
+
return __spreadProps(__spreadValues({}, values), {
|
|
100
98
|
[name]: nextValue !== void 0 && nextValue
|
|
101
|
-
};
|
|
99
|
+
});
|
|
102
100
|
});
|
|
103
101
|
}
|
|
104
|
-
};
|
|
102
|
+
});
|
|
105
103
|
}
|
|
106
104
|
export {
|
|
107
105
|
createMenuStore
|