@ariakit/core 0.2.6 → 0.2.7
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/{5LY57557.cjs → 5AWPMH4S.cjs} +14 -14
- package/cjs/__chunks/{7JIMFSGQ.cjs → K2LZWNNX.cjs} +2 -2
- package/cjs/__chunks/NVEPU4WA.cjs +41 -0
- package/cjs/__chunks/{WUNFMQBI.cjs → PR7FUI5D.cjs} +19 -19
- package/cjs/__chunks/{M6ZA7XUP.cjs → RCYVACJO.cjs} +2 -2
- package/cjs/__chunks/{IRBRPEUG.cjs → RS4LBZRZ.cjs} +10 -10
- package/cjs/__chunks/{O7U3LRFL.cjs → SXMUYOXB.cjs} +13 -13
- package/cjs/__chunks/{4Q3ZC7KF.cjs → ZXPKRPGY.cjs} +14 -14
- package/cjs/checkbox/checkbox-store.cjs +6 -6
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/combobox/combobox-store.cjs +24 -24
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +24 -24
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -8
- package/cjs/menu/menu-store.cjs +23 -23
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +12 -12
- package/cjs/select/select-store.cjs +25 -25
- package/cjs/tab/tab-store.cjs +15 -15
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +1 -1
- package/cjs/utils/events.cjs +3 -3
- package/cjs/utils/focus.cjs +2 -2
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/platform.cjs +1 -1
- package/cjs/utils/store.cjs +4 -4
- package/cjs/utils/types.d.ts +4 -0
- package/esm/__chunks/{LK6LFO7X.js → FQL4TRMX.js} +2 -2
- package/esm/__chunks/{3HOKSVPG.js → L5RO76KW.js} +3 -3
- package/esm/__chunks/{U5NFQJHX.js → LM4QG55U.js} +4 -4
- package/esm/__chunks/{WFO54Y6U.js → NRXA5QTV.js} +4 -4
- package/esm/__chunks/{QEFBF7I4.js → SHUO6V52.js} +6 -6
- package/esm/__chunks/{4F3NSHNZ.js → UWW2ZP3K.js} +1 -1
- package/esm/__chunks/{NWU4GBZ6.js → WVTCK5PV.js} +1 -1
- package/esm/__chunks/{TBCDDKVT.js → XJGRXN57.js} +4 -4
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.js +8 -8
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +4 -4
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.js +9 -9
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.js +8 -8
- package/esm/tab/tab-store.js +5 -5
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +1 -1
- package/esm/utils/focus.js +1 -1
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +1 -1
- package/esm/utils/store.js +3 -3
- package/esm/utils/types.d.ts +4 -0
- package/package.json +1 -1
- package/cjs/__chunks/XBF2IZLR.cjs +0 -41
- /package/cjs/__chunks/{6455U47T.cjs → 72I2GWXF.cjs} +0 -0
- /package/esm/__chunks/{4BKCJXBM.js → PNRLI7OV.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
14
14
|
|
|
15
15
|
// src/utils/store.ts
|
|
16
16
|
function createStore(initialState, ...stores) {
|
|
@@ -30,18 +30,18 @@ function createStore(initialState, ...stores) {
|
|
|
30
30
|
};
|
|
31
31
|
const init = () => {
|
|
32
32
|
if (initialized)
|
|
33
|
-
return
|
|
33
|
+
return _RCYVACJOcjs.noop;
|
|
34
34
|
if (!stores.length)
|
|
35
|
-
return
|
|
35
|
+
return _RCYVACJOcjs.noop;
|
|
36
36
|
initialized = true;
|
|
37
|
-
const desyncs =
|
|
38
|
-
(key) =>
|
|
37
|
+
const desyncs = _RCYVACJOcjs.getKeys.call(void 0, state).map(
|
|
38
|
+
(key) => _RCYVACJOcjs.chain.call(void 0,
|
|
39
39
|
...stores.map((store) => {
|
|
40
40
|
var _a, _b;
|
|
41
41
|
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
|
|
42
42
|
if (!storeState)
|
|
43
43
|
return;
|
|
44
|
-
if (!
|
|
44
|
+
if (!_RCYVACJOcjs.hasOwnProperty.call(void 0, storeState, key))
|
|
45
45
|
return;
|
|
46
46
|
return (_b = store == null ? void 0 : store.sync) == null ? void 0 : _b.call(store, (state2) => setState(key, state2[key]), [key]);
|
|
47
47
|
})
|
|
@@ -53,7 +53,7 @@ function createStore(initialState, ...stores) {
|
|
|
53
53
|
var _a;
|
|
54
54
|
return (_a = store == null ? void 0 : store.init) == null ? void 0 : _a.call(store);
|
|
55
55
|
});
|
|
56
|
-
return
|
|
56
|
+
return _RCYVACJOcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups, () => {
|
|
57
57
|
initialized = false;
|
|
58
58
|
});
|
|
59
59
|
};
|
|
@@ -80,9 +80,9 @@ function createStore(initialState, ...stores) {
|
|
|
80
80
|
};
|
|
81
81
|
const getState = () => state;
|
|
82
82
|
const setState = (key, value) => {
|
|
83
|
-
if (!
|
|
83
|
+
if (!_RCYVACJOcjs.hasOwnProperty.call(void 0, state, key))
|
|
84
84
|
return;
|
|
85
|
-
const nextValue =
|
|
85
|
+
const nextValue = _RCYVACJOcjs.applyState.call(void 0, value, state[key]);
|
|
86
86
|
if (nextValue === state[key])
|
|
87
87
|
return;
|
|
88
88
|
stores.forEach((store) => {
|
|
@@ -90,7 +90,7 @@ function createStore(initialState, ...stores) {
|
|
|
90
90
|
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
|
|
91
91
|
});
|
|
92
92
|
const prevState = state;
|
|
93
|
-
state =
|
|
93
|
+
state = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
|
|
94
94
|
const thisUpdate = Symbol();
|
|
95
95
|
lastUpdate = thisUpdate;
|
|
96
96
|
updatedKeys.add(key);
|
|
@@ -115,8 +115,8 @@ function createStore(initialState, ...stores) {
|
|
|
115
115
|
updatedKeys.clear();
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
-
const pick2 = (...keys) => createStore(
|
|
119
|
-
const omit2 = (...keys) => createStore(
|
|
118
|
+
const pick2 = (...keys) => createStore(_RCYVACJOcjs.pick.call(void 0, state, keys), finalStore);
|
|
119
|
+
const omit2 = (...keys) => createStore(_RCYVACJOcjs.omit.call(void 0, state, keys), finalStore);
|
|
120
120
|
const finalStore = {
|
|
121
121
|
setup,
|
|
122
122
|
init,
|
|
@@ -136,7 +136,7 @@ function mergeStore(...stores) {
|
|
|
136
136
|
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
|
|
137
137
|
if (!nextState)
|
|
138
138
|
return state;
|
|
139
|
-
return
|
|
139
|
+
return _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, state), nextState);
|
|
140
140
|
}, {});
|
|
141
141
|
const store = createStore(initialState, ...stores);
|
|
142
142
|
return store;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _RS4LBZRZcjs = require('./RS4LBZRZ.cjs');
|
|
4
4
|
|
|
5
5
|
// src/dialog/dialog-store.ts
|
|
6
6
|
function createDialogStore(props = {}) {
|
|
7
|
-
return
|
|
7
|
+
return _RS4LBZRZcjs.createDisclosureStore.call(void 0, props);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _ZXPKRPGYcjs = require('./ZXPKRPGY.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _5AWPMH4Scjs = require('./5AWPMH4S.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
14
|
+
|
|
15
|
+
// src/hovercard/hovercard-store.ts
|
|
16
|
+
function createHovercardStore(props = {}) {
|
|
17
|
+
var _a;
|
|
18
|
+
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
|
+
const popover = _ZXPKRPGYcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
20
|
+
placement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
21
|
+
props.placement,
|
|
22
|
+
syncState == null ? void 0 : syncState.placement,
|
|
23
|
+
"bottom"
|
|
24
|
+
)
|
|
25
|
+
}));
|
|
26
|
+
const timeout = _RCYVACJOcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
|
|
27
|
+
const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover.getState()), {
|
|
28
|
+
timeout,
|
|
29
|
+
showTimeout: _RCYVACJOcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
|
|
30
|
+
hideTimeout: _RCYVACJOcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
31
|
+
autoFocusOnShow: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
32
|
+
});
|
|
33
|
+
const hovercard = _5AWPMH4Scjs.createStore.call(void 0, initialState, popover, props.store);
|
|
34
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
35
|
+
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
exports.createHovercardStore = createHovercardStore;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _SXMUYOXBcjs = require('./SXMUYOXB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _5AWPMH4Scjs = require('./5AWPMH4S.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
18
18
|
|
|
19
19
|
// src/composite/composite-store.ts
|
|
20
20
|
var NULL_ITEM = { id: null };
|
|
@@ -105,7 +105,7 @@ function verticalizeItems(items) {
|
|
|
105
105
|
for (const row of rows) {
|
|
106
106
|
const item = row[i];
|
|
107
107
|
if (item) {
|
|
108
|
-
verticalized.push(
|
|
108
|
+
verticalized.push(_72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, item), {
|
|
109
109
|
// If there's no rowId, it means that it's not a grid composite, but
|
|
110
110
|
// a single row instead. So, instead of verticalizing it, that is,
|
|
111
111
|
// assigning a different rowId based on the column index, we keep it
|
|
@@ -121,37 +121,37 @@ function verticalizeItems(items) {
|
|
|
121
121
|
function createCompositeStore(props = {}) {
|
|
122
122
|
var _a;
|
|
123
123
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
124
|
-
const collection =
|
|
125
|
-
const activeId =
|
|
124
|
+
const collection = _SXMUYOXBcjs.createCollectionStore.call(void 0, props);
|
|
125
|
+
const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
126
126
|
props.activeId,
|
|
127
127
|
syncState == null ? void 0 : syncState.activeId,
|
|
128
128
|
props.defaultActiveId
|
|
129
129
|
);
|
|
130
|
-
const initialState =
|
|
130
|
+
const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, collection.getState()), {
|
|
131
131
|
activeId,
|
|
132
|
-
baseElement:
|
|
133
|
-
includesBaseElement:
|
|
132
|
+
baseElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
|
|
133
|
+
includesBaseElement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
134
134
|
props.includesBaseElement,
|
|
135
135
|
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
136
136
|
activeId === null
|
|
137
137
|
),
|
|
138
|
-
moves:
|
|
139
|
-
orientation:
|
|
138
|
+
moves: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
|
|
139
|
+
orientation: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
140
140
|
props.orientation,
|
|
141
141
|
syncState == null ? void 0 : syncState.orientation,
|
|
142
142
|
"both"
|
|
143
143
|
),
|
|
144
|
-
rtl:
|
|
145
|
-
virtualFocus:
|
|
144
|
+
rtl: _RCYVACJOcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
|
|
145
|
+
virtualFocus: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
146
146
|
props.virtualFocus,
|
|
147
147
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
148
148
|
false
|
|
149
149
|
),
|
|
150
|
-
focusLoop:
|
|
151
|
-
focusWrap:
|
|
152
|
-
focusShift:
|
|
150
|
+
focusLoop: _RCYVACJOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
|
|
151
|
+
focusWrap: _RCYVACJOcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
152
|
+
focusShift: _RCYVACJOcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
153
153
|
});
|
|
154
|
-
const composite =
|
|
154
|
+
const composite = _5AWPMH4Scjs.createStore.call(void 0, initialState, collection, props.store);
|
|
155
155
|
composite.setup(
|
|
156
156
|
() => composite.sync(
|
|
157
157
|
(state) => {
|
|
@@ -223,7 +223,7 @@ function createCompositeStore(props = {}) {
|
|
|
223
223
|
}
|
|
224
224
|
return nextItem == null ? void 0 : nextItem.id;
|
|
225
225
|
};
|
|
226
|
-
return
|
|
226
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, collection), composite), {
|
|
227
227
|
setBaseElement: (element) => composite.setState("baseElement", element),
|
|
228
228
|
setActiveId: (id) => composite.setState("activeId", id),
|
|
229
229
|
move: (id) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
4
4
|
|
|
5
5
|
// src/utils/misc.ts
|
|
6
6
|
function noop(..._) {
|
|
@@ -80,7 +80,7 @@ function normalizeString(str) {
|
|
|
80
80
|
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
81
81
|
}
|
|
82
82
|
function omit(object, keys) {
|
|
83
|
-
const result =
|
|
83
|
+
const result = _72I2GWXFcjs.__spreadValues.call(void 0, {}, object);
|
|
84
84
|
for (const key of keys) {
|
|
85
85
|
if (hasOwnProperty(result, key)) {
|
|
86
86
|
delete result[key];
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _5AWPMH4Scjs = require('./5AWPMH4S.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
12
12
|
|
|
13
13
|
// src/disclosure/disclosure-store.ts
|
|
14
14
|
function createDisclosureStore(props = {}) {
|
|
15
15
|
var _a;
|
|
16
|
-
const store =
|
|
16
|
+
const store = _5AWPMH4Scjs.mergeStore.call(void 0,
|
|
17
17
|
props.store,
|
|
18
18
|
(_a = props.disclosure) == null ? void 0 : _a.omit("contentElement", "disclosureElement")
|
|
19
19
|
);
|
|
20
20
|
const syncState = store == null ? void 0 : store.getState();
|
|
21
|
-
const open =
|
|
21
|
+
const open = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
22
22
|
props.open,
|
|
23
23
|
syncState == null ? void 0 : syncState.open,
|
|
24
24
|
props.defaultOpen,
|
|
25
25
|
false
|
|
26
26
|
);
|
|
27
|
-
const animated =
|
|
27
|
+
const animated = _RCYVACJOcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
|
|
28
28
|
const initialState = {
|
|
29
29
|
open,
|
|
30
30
|
animated,
|
|
31
31
|
animating: !!animated && open,
|
|
32
32
|
mounted: open,
|
|
33
|
-
contentElement:
|
|
34
|
-
disclosureElement:
|
|
33
|
+
contentElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
34
|
+
disclosureElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
35
35
|
};
|
|
36
|
-
const disclosure =
|
|
36
|
+
const disclosure = _5AWPMH4Scjs.createStore.call(void 0, initialState, store);
|
|
37
37
|
disclosure.setup(
|
|
38
38
|
() => disclosure.sync(
|
|
39
39
|
(state) => {
|
|
@@ -64,7 +64,7 @@ function createDisclosureStore(props = {}) {
|
|
|
64
64
|
["open", "animating"]
|
|
65
65
|
)
|
|
66
66
|
);
|
|
67
|
-
return
|
|
67
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, disclosure), {
|
|
68
68
|
setOpen: (value) => disclosure.setState("open", value),
|
|
69
69
|
show: () => disclosure.setState("open", true),
|
|
70
70
|
hide: () => disclosure.setState("open", false),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _5AWPMH4Scjs = require('./5AWPMH4S.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _EXM2AW52cjs = require('./EXM2AW52.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
15
15
|
|
|
16
16
|
// src/collection/collection-store.ts
|
|
17
17
|
function isElementPreceding(a, b) {
|
|
@@ -62,7 +62,7 @@ function getCommonParent(items) {
|
|
|
62
62
|
function createCollectionStore(props = {}) {
|
|
63
63
|
var _a;
|
|
64
64
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
65
|
-
const items =
|
|
65
|
+
const items = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
66
66
|
props.items,
|
|
67
67
|
syncState == null ? void 0 : syncState.items,
|
|
68
68
|
props.defaultItems,
|
|
@@ -71,12 +71,12 @@ function createCollectionStore(props = {}) {
|
|
|
71
71
|
const itemsMap = new Map(items.map((item) => [item.id, item]));
|
|
72
72
|
const initialState = {
|
|
73
73
|
items,
|
|
74
|
-
renderedItems:
|
|
74
|
+
renderedItems: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
75
75
|
};
|
|
76
|
-
const privateStore =
|
|
76
|
+
const privateStore = _5AWPMH4Scjs.createStore.call(void 0, {
|
|
77
77
|
renderedItems: initialState.renderedItems
|
|
78
78
|
});
|
|
79
|
-
const collection =
|
|
79
|
+
const collection = _5AWPMH4Scjs.createStore.call(void 0, initialState, props.store);
|
|
80
80
|
const sortItems = () => {
|
|
81
81
|
const state = privateStore.getState();
|
|
82
82
|
const renderedItems = sortBasedOnDOMPosition(state.renderedItems);
|
|
@@ -101,9 +101,9 @@ function createCollectionStore(props = {}) {
|
|
|
101
101
|
const root = getCommonParent(state.renderedItems);
|
|
102
102
|
const observer = new IntersectionObserver(callback, { root });
|
|
103
103
|
state.renderedItems.forEach((item) => {
|
|
104
|
-
if (item.element)
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
if (!item.element)
|
|
105
|
+
return;
|
|
106
|
+
observer.observe(item.element);
|
|
107
107
|
});
|
|
108
108
|
return () => {
|
|
109
109
|
cancelAnimationFrame(raf);
|
|
@@ -120,7 +120,7 @@ function createCollectionStore(props = {}) {
|
|
|
120
120
|
const nextItems = items2.slice();
|
|
121
121
|
if (index !== -1) {
|
|
122
122
|
prevItem = items2[index];
|
|
123
|
-
const nextItem =
|
|
123
|
+
const nextItem = _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, prevItem), item);
|
|
124
124
|
nextItems[index] = nextItem;
|
|
125
125
|
itemsMap.set(item.id, nextItem);
|
|
126
126
|
} else {
|
|
@@ -149,9 +149,9 @@ function createCollectionStore(props = {}) {
|
|
|
149
149
|
return unmergeItem;
|
|
150
150
|
};
|
|
151
151
|
const registerItem = (item) => mergeItem(item, (getItems) => collection.setState("items", getItems), true);
|
|
152
|
-
return
|
|
152
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, collection), {
|
|
153
153
|
registerItem,
|
|
154
|
-
renderItem: (item) =>
|
|
154
|
+
renderItem: (item) => _RCYVACJOcjs.chain.call(void 0,
|
|
155
155
|
registerItem(item),
|
|
156
156
|
mergeItem(
|
|
157
157
|
item,
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _K2LZWNNXcjs = require('./K2LZWNNX.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _5AWPMH4Scjs = require('./5AWPMH4S.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
16
16
|
|
|
17
17
|
// src/popover/popover-store.ts
|
|
18
18
|
function createPopoverStore(_a = {}) {
|
|
19
19
|
var _b = _a, {
|
|
20
20
|
popover: otherPopover
|
|
21
|
-
} = _b, props =
|
|
21
|
+
} = _b, props = _72I2GWXFcjs.__objRest.call(void 0, _b, [
|
|
22
22
|
"popover"
|
|
23
23
|
]);
|
|
24
|
-
const store =
|
|
24
|
+
const store = _5AWPMH4Scjs.mergeStore.call(void 0,
|
|
25
25
|
props.store,
|
|
26
26
|
otherPopover == null ? void 0 : otherPopover.omit(
|
|
27
27
|
"arrowElement",
|
|
@@ -32,22 +32,22 @@ function createPopoverStore(_a = {}) {
|
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
const syncState = store == null ? void 0 : store.getState();
|
|
35
|
-
const dialog =
|
|
36
|
-
const placement =
|
|
35
|
+
const dialog = _K2LZWNNXcjs.createDialogStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
36
|
+
const placement = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
37
37
|
props.placement,
|
|
38
38
|
syncState == null ? void 0 : syncState.placement,
|
|
39
39
|
"bottom"
|
|
40
40
|
);
|
|
41
|
-
const initialState =
|
|
41
|
+
const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, dialog.getState()), {
|
|
42
42
|
placement,
|
|
43
43
|
currentPlacement: placement,
|
|
44
|
-
anchorElement:
|
|
45
|
-
popoverElement:
|
|
46
|
-
arrowElement:
|
|
44
|
+
anchorElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
|
|
45
|
+
popoverElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
|
|
46
|
+
arrowElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
47
47
|
rendered: Symbol("rendered")
|
|
48
48
|
});
|
|
49
|
-
const popover =
|
|
50
|
-
return
|
|
49
|
+
const popover = _5AWPMH4Scjs.createStore.call(void 0, initialState, dialog, store);
|
|
50
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, dialog), popover), {
|
|
51
51
|
setAnchorElement: (element) => popover.setState("anchorElement", element),
|
|
52
52
|
setPopoverElement: (element) => popover.setState("popoverElement", element),
|
|
53
53
|
setArrowElement: (element) => popover.setState("arrowElement", element),
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _5AWPMH4Scjs = require('../__chunks/5AWPMH4S.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/checkbox/checkbox-store.ts
|
|
13
13
|
function createCheckboxStore(props = {}) {
|
|
14
14
|
var _a;
|
|
15
15
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
16
16
|
const initialState = {
|
|
17
|
-
value:
|
|
17
|
+
value: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
18
18
|
props.value,
|
|
19
19
|
syncState == null ? void 0 : syncState.value,
|
|
20
20
|
props.defaultValue,
|
|
21
21
|
false
|
|
22
22
|
)
|
|
23
23
|
};
|
|
24
|
-
const checkbox =
|
|
25
|
-
return
|
|
24
|
+
const checkbox = _5AWPMH4Scjs.createStore.call(void 0, initialState, props.store);
|
|
25
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
26
26
|
setValue: (value) => checkbox.setState("value", value)
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _SXMUYOXBcjs = require('../__chunks/SXMUYOXB.cjs');
|
|
4
|
+
require('../__chunks/5AWPMH4S.cjs');
|
|
5
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
6
6
|
require('../__chunks/EXM2AW52.cjs');
|
|
7
|
-
require('../__chunks/
|
|
7
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createCollectionStore =
|
|
10
|
+
exports.createCollectionStore = _SXMUYOXBcjs.createCollectionStore;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _ZXPKRPGYcjs = require('../__chunks/ZXPKRPGY.cjs');
|
|
4
|
+
require('../__chunks/K2LZWNNX.cjs');
|
|
5
|
+
require('../__chunks/RS4LBZRZ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
var _PR7FUI5Dcjs = require('../__chunks/PR7FUI5D.cjs');
|
|
9
|
+
require('../__chunks/SXMUYOXB.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _5AWPMH4Scjs = require('../__chunks/5AWPMH4S.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ require('../__chunks/GDZQUFNP.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
28
28
|
|
|
29
29
|
// src/combobox/combobox-store.ts
|
|
30
30
|
var isSafariOnMobile = _EIRIJC7Tcjs.isSafari.call(void 0, ) && _EIRIJC7Tcjs.isTouchDevice.call(void 0, );
|
|
@@ -32,11 +32,11 @@ function createComboboxStore(_a = {}) {
|
|
|
32
32
|
var _b = _a, {
|
|
33
33
|
menu,
|
|
34
34
|
select
|
|
35
|
-
} = _b, props =
|
|
35
|
+
} = _b, props = _72I2GWXFcjs.__objRest.call(void 0, _b, [
|
|
36
36
|
"menu",
|
|
37
37
|
"select"
|
|
38
38
|
]);
|
|
39
|
-
const store =
|
|
39
|
+
const store = _5AWPMH4Scjs.mergeStore.call(void 0,
|
|
40
40
|
props.store,
|
|
41
41
|
menu == null ? void 0 : menu.omit(
|
|
42
42
|
"baseElement",
|
|
@@ -59,57 +59,57 @@ function createComboboxStore(_a = {}) {
|
|
|
59
59
|
)
|
|
60
60
|
);
|
|
61
61
|
const syncState = store.getState();
|
|
62
|
-
const activeId =
|
|
62
|
+
const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
63
63
|
props.activeId,
|
|
64
64
|
syncState.activeId,
|
|
65
65
|
props.defaultActiveId,
|
|
66
66
|
null
|
|
67
67
|
);
|
|
68
|
-
const composite =
|
|
68
|
+
const composite = _PR7FUI5Dcjs.createCompositeStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
69
69
|
store,
|
|
70
70
|
activeId,
|
|
71
|
-
includesBaseElement:
|
|
71
|
+
includesBaseElement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
72
72
|
props.includesBaseElement,
|
|
73
73
|
syncState.includesBaseElement,
|
|
74
74
|
true
|
|
75
75
|
),
|
|
76
|
-
orientation:
|
|
76
|
+
orientation: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
77
77
|
props.orientation,
|
|
78
78
|
syncState.orientation,
|
|
79
79
|
"vertical"
|
|
80
80
|
),
|
|
81
|
-
focusLoop:
|
|
82
|
-
focusWrap:
|
|
83
|
-
virtualFocus:
|
|
81
|
+
focusLoop: _RCYVACJOcjs.defaultValue.call(void 0, props.focusLoop, syncState.focusLoop, true),
|
|
82
|
+
focusWrap: _RCYVACJOcjs.defaultValue.call(void 0, props.focusWrap, syncState.focusWrap, true),
|
|
83
|
+
virtualFocus: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
84
84
|
props.virtualFocus,
|
|
85
85
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
86
86
|
!isSafariOnMobile
|
|
87
87
|
)
|
|
88
88
|
}));
|
|
89
|
-
const popover =
|
|
89
|
+
const popover = _ZXPKRPGYcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
90
90
|
store,
|
|
91
|
-
placement:
|
|
91
|
+
placement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
92
92
|
props.placement,
|
|
93
93
|
syncState.placement,
|
|
94
94
|
"bottom-start"
|
|
95
95
|
)
|
|
96
96
|
}));
|
|
97
|
-
const initialValue =
|
|
97
|
+
const initialValue = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
98
98
|
props.value,
|
|
99
99
|
syncState.value,
|
|
100
100
|
props.defaultValue,
|
|
101
101
|
""
|
|
102
102
|
);
|
|
103
|
-
const initialState =
|
|
103
|
+
const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
|
|
104
104
|
value: initialValue,
|
|
105
|
-
resetValueOnHide:
|
|
105
|
+
resetValueOnHide: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
106
106
|
props.resetValueOnHide,
|
|
107
107
|
syncState.resetValueOnHide,
|
|
108
108
|
false
|
|
109
109
|
),
|
|
110
110
|
activeValue: syncState.activeValue
|
|
111
111
|
});
|
|
112
|
-
const combobox =
|
|
112
|
+
const combobox = _5AWPMH4Scjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
113
113
|
combobox.setup(
|
|
114
114
|
() => combobox.sync(
|
|
115
115
|
(state) => {
|
|
@@ -155,7 +155,7 @@ function createComboboxStore(_a = {}) {
|
|
|
155
155
|
["moves", "renderedItems"]
|
|
156
156
|
)
|
|
157
157
|
);
|
|
158
|
-
return
|
|
158
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
|
|
159
159
|
setValue: (value) => combobox.setState("value", value)
|
|
160
160
|
});
|
|
161
161
|
}
|