@ariakit/core 0.1.1 → 0.1.3
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 +16 -0
- package/cjs/__chunks/{NX5OHIMM.cjs → 4DQ3OTE7.cjs} +8 -9
- package/cjs/__chunks/{EIDN2CWH.cjs → DQHU5K4Q.cjs} +10 -10
- package/cjs/__chunks/{3KP2MDG6.cjs → HLVPXX7H.cjs} +21 -21
- package/cjs/__chunks/{5D5Y5EI4.cjs → QNEPGQLL.cjs} +8 -1
- package/cjs/__chunks/{7ZXWQTAY.cjs → QYB6XH64.cjs} +7 -7
- package/cjs/__chunks/{AZVDLKO3.cjs → W5IHD6VG.cjs} +15 -15
- package/cjs/__chunks/{EFEGT32M.cjs → ZJEEK57E.cjs} +2 -2
- package/cjs/__chunks/{3BBA3Z5G.cjs → ZPOXPO2L.cjs} +11 -11
- package/cjs/checkbox/checkbox-store.cjs +4 -4
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/combobox/combobox-store.cjs +20 -20
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/form/form-store.cjs +28 -28
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/menu/menu-bar-store.cjs +7 -7
- package/cjs/menu/menu-store.cjs +18 -18
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/radio/radio-store.cjs +8 -8
- package/cjs/select/select-store.cjs +20 -20
- package/cjs/tab/tab-store.cjs +11 -11
- package/cjs/toolbar/toolbar-store.cjs +7 -7
- package/cjs/tooltip/tooltip-store.cjs +13 -13
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/focus.cjs +29 -1
- package/cjs/utils/focus.d.ts +1 -1
- package/cjs/utils/misc.cjs +4 -2
- package/cjs/utils/misc.d.ts +6 -0
- package/cjs/utils/store.cjs +3 -3
- package/cjs/utils/store.d.ts +7 -0
- package/esm/__chunks/{ADRUFBEO.js → 4T5RHRE5.js} +1 -1
- package/esm/__chunks/{RX3ZUQ6U.js → 6HMPWUDT.js} +3 -3
- package/esm/__chunks/{6UPCMUXT.js → 6PEWNRTN.js} +3 -3
- package/esm/__chunks/{HCKYJLMC.js → IOAGNCXX.js} +2 -2
- package/esm/__chunks/{UOJSZ35L.js → NA5BK7DD.js} +1 -1
- package/esm/__chunks/{KLKI3AIB.js → RMD7SNCC.js} +7 -0
- package/esm/__chunks/{L7KN5AYP.js → WFGVC6LE.js} +3 -4
- package/esm/__chunks/{6U25WEDX.js → X7MJ3FB5.js} +3 -3
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.js +7 -7
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.js +11 -11
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +4 -4
- package/esm/menu/menu-store.js +8 -8
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.js +7 -7
- package/esm/tab/tab-store.js +4 -4
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/focus.d.ts +1 -1
- package/esm/utils/focus.js +29 -1
- package/esm/utils/misc.d.ts +6 -0
- package/esm/utils/misc.js +3 -1
- package/esm/utils/store.d.ts +7 -0
- package/esm/utils/store.js +2 -2
- package/package.json +1 -1
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _4DQ3OTE7cjs = require('../__chunks/4DQ3OTE7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _ZPOXPO2Lcjs = require('../__chunks/ZPOXPO2L.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
13
13
|
require('../__chunks/OFNGELMA.cjs');
|
|
14
14
|
|
|
15
15
|
// src/form/form-store.ts
|
|
@@ -18,7 +18,7 @@ function nextFrame() {
|
|
|
18
18
|
}
|
|
19
19
|
function hasMessages(object) {
|
|
20
20
|
return Object.keys(object).some((key) => {
|
|
21
|
-
if (
|
|
21
|
+
if (_QNEPGQLLcjs.isObject.call(void 0, object[key])) {
|
|
22
22
|
return hasMessages(object[key]);
|
|
23
23
|
}
|
|
24
24
|
return !!object[key];
|
|
@@ -39,10 +39,10 @@ function set(values, path, value) {
|
|
|
39
39
|
if (k == null)
|
|
40
40
|
return values;
|
|
41
41
|
const key = k;
|
|
42
|
-
const isIntegerKey =
|
|
42
|
+
const isIntegerKey = _QNEPGQLLcjs.isInteger.call(void 0, key);
|
|
43
43
|
const nextValues = isIntegerKey ? values || [] : values || {};
|
|
44
44
|
const nestedValues = nextValues[key];
|
|
45
|
-
const result = rest.length && (Array.isArray(nestedValues) ||
|
|
45
|
+
const result = rest.length && (Array.isArray(nestedValues) || _QNEPGQLLcjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
|
|
46
46
|
if (isIntegerKey) {
|
|
47
47
|
const index = Number(key);
|
|
48
48
|
if (values) {
|
|
@@ -65,12 +65,12 @@ function setAll(values, value) {
|
|
|
65
65
|
const currentValue = values[key];
|
|
66
66
|
if (Array.isArray(currentValue)) {
|
|
67
67
|
result[key] = currentValue.map((v) => {
|
|
68
|
-
if (
|
|
68
|
+
if (_QNEPGQLLcjs.isObject.call(void 0, v)) {
|
|
69
69
|
return setAll(v, value);
|
|
70
70
|
}
|
|
71
71
|
return value;
|
|
72
72
|
});
|
|
73
|
-
} else if (
|
|
73
|
+
} else if (_QNEPGQLLcjs.isObject.call(void 0, currentValue)) {
|
|
74
74
|
result[key] = setAll(currentValue, value);
|
|
75
75
|
} else {
|
|
76
76
|
result[key] = value;
|
|
@@ -102,20 +102,20 @@ function createNames() {
|
|
|
102
102
|
}
|
|
103
103
|
function createFormStore(props = {}) {
|
|
104
104
|
const syncState = _optionalChain([props, 'access', _ => _.store, 'optionalAccess', _2 => _2.getState, 'call', _3 => _3()]);
|
|
105
|
-
const collection =
|
|
106
|
-
const values =
|
|
105
|
+
const collection = _4DQ3OTE7cjs.createCollectionStore.call(void 0, props);
|
|
106
|
+
const values = _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
107
107
|
props.values,
|
|
108
108
|
_optionalChain([syncState, 'optionalAccess', _4 => _4.values]),
|
|
109
109
|
props.defaultValues,
|
|
110
110
|
{}
|
|
111
111
|
);
|
|
112
|
-
const errors =
|
|
112
|
+
const errors = _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
113
113
|
props.errors,
|
|
114
114
|
_optionalChain([syncState, 'optionalAccess', _5 => _5.errors]),
|
|
115
115
|
props.defaultErrors,
|
|
116
116
|
{}
|
|
117
117
|
);
|
|
118
|
-
const touched =
|
|
118
|
+
const touched = _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
119
119
|
props.touched,
|
|
120
120
|
_optionalChain([syncState, 'optionalAccess', _6 => _6.touched]),
|
|
121
121
|
props.defaultTouched,
|
|
@@ -126,22 +126,23 @@ function createFormStore(props = {}) {
|
|
|
126
126
|
values,
|
|
127
127
|
errors,
|
|
128
128
|
touched,
|
|
129
|
-
validating:
|
|
130
|
-
submitting:
|
|
131
|
-
submitSucceed:
|
|
132
|
-
submitFailed:
|
|
129
|
+
validating: _QNEPGQLLcjs.defaultValue.call(void 0, _optionalChain([syncState, 'optionalAccess', _7 => _7.validating]), false),
|
|
130
|
+
submitting: _QNEPGQLLcjs.defaultValue.call(void 0, _optionalChain([syncState, 'optionalAccess', _8 => _8.submitting]), false),
|
|
131
|
+
submitSucceed: _QNEPGQLLcjs.defaultValue.call(void 0, _optionalChain([syncState, 'optionalAccess', _9 => _9.submitSucceed]), 0),
|
|
132
|
+
submitFailed: _QNEPGQLLcjs.defaultValue.call(void 0, _optionalChain([syncState, 'optionalAccess', _10 => _10.submitFailed]), 0),
|
|
133
133
|
valid: !hasMessages(errors)
|
|
134
134
|
};
|
|
135
|
-
const form =
|
|
135
|
+
const form = _ZPOXPO2Lcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
136
136
|
const validateCallbacks = /* @__PURE__ */ new Set();
|
|
137
137
|
const submitCallbacks = /* @__PURE__ */ new Set();
|
|
138
138
|
const validate = async () => {
|
|
139
139
|
form.setState("validating", true);
|
|
140
140
|
form.setState("errors", {});
|
|
141
141
|
try {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
for (const callback of validateCallbacks) {
|
|
143
|
+
await callback(form.getState());
|
|
144
|
+
}
|
|
145
|
+
await nextFrame();
|
|
145
146
|
return !hasMessages(form.getState().errors);
|
|
146
147
|
} finally {
|
|
147
148
|
form.setState("validating", false);
|
|
@@ -155,7 +156,7 @@ function createFormStore(props = {}) {
|
|
|
155
156
|
getValue: (name) => get(form.getState().values, name),
|
|
156
157
|
setValue: (name, value) => form.setState("values", (values2) => {
|
|
157
158
|
const prevValue = get(values2, name);
|
|
158
|
-
const nextValue =
|
|
159
|
+
const nextValue = _QNEPGQLLcjs.applyState.call(void 0, value, prevValue);
|
|
159
160
|
if (nextValue === prevValue)
|
|
160
161
|
return values2;
|
|
161
162
|
return set(values2, name, nextValue);
|
|
@@ -176,7 +177,7 @@ function createFormStore(props = {}) {
|
|
|
176
177
|
getError: (name) => get(form.getState().errors, name),
|
|
177
178
|
setError: (name, error) => form.setState("errors", (errors2) => {
|
|
178
179
|
const prevError = get(errors2, name);
|
|
179
|
-
const nextError =
|
|
180
|
+
const nextError = _QNEPGQLLcjs.applyState.call(void 0, error, prevError);
|
|
180
181
|
if (nextError === prevError)
|
|
181
182
|
return errors2;
|
|
182
183
|
return set(errors2, name, nextError);
|
|
@@ -185,7 +186,7 @@ function createFormStore(props = {}) {
|
|
|
185
186
|
getFieldTouched: (name) => !!get(form.getState().touched, name),
|
|
186
187
|
setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
|
|
187
188
|
const prevValue = get(touched2, name);
|
|
188
|
-
const nextValue =
|
|
189
|
+
const nextValue = _QNEPGQLLcjs.applyState.call(void 0, value, prevValue);
|
|
189
190
|
if (nextValue === prevValue)
|
|
190
191
|
return touched2;
|
|
191
192
|
return set(touched2, name, nextValue);
|
|
@@ -204,11 +205,10 @@ function createFormStore(props = {}) {
|
|
|
204
205
|
form.setState("touched", setAll(form.getState().values, true));
|
|
205
206
|
try {
|
|
206
207
|
if (await validate()) {
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
);
|
|
211
|
-
await Promise.all(results).then(nextFrame);
|
|
208
|
+
for (const callback of submitCallbacks) {
|
|
209
|
+
await callback(form.getState());
|
|
210
|
+
}
|
|
211
|
+
await nextFrame();
|
|
212
212
|
if (!hasMessages(form.getState().errors)) {
|
|
213
213
|
form.setState("submitSucceed", (count) => count + 1);
|
|
214
214
|
return true;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
3
|
+
var _DQHU5K4Qcjs = require('../__chunks/DQHU5K4Q.cjs');
|
|
4
|
+
require('../__chunks/HLVPXX7H.cjs');
|
|
5
|
+
require('../__chunks/ZJEEK57E.cjs');
|
|
6
|
+
require('../__chunks/QYB6XH64.cjs');
|
|
7
|
+
require('../__chunks/ZPOXPO2L.cjs');
|
|
8
|
+
require('../__chunks/QNEPGQLL.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createHovercardStore =
|
|
11
|
+
exports.createHovercardStore = _DQHU5K4Qcjs.createHovercardStore;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _W5IHD6VGcjs = require('../__chunks/W5IHD6VG.cjs');
|
|
4
|
+
require('../__chunks/4DQ3OTE7.cjs');
|
|
5
|
+
require('../__chunks/ZPOXPO2L.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
9
9
|
require('../__chunks/OFNGELMA.cjs');
|
|
10
10
|
require('../__chunks/GDZQUFNP.cjs');
|
|
11
11
|
|
|
12
12
|
// src/menu/menu-bar-store.ts
|
|
13
13
|
function createMenuBarStore(props = {}) {
|
|
14
14
|
const syncState = _optionalChain([props, 'access', _ => _.store, 'optionalAccess', _2 => _2.getState, 'call', _3 => _3()]);
|
|
15
|
-
return
|
|
15
|
+
return _W5IHD6VGcjs.createCompositeStore.call(void 0, {
|
|
16
16
|
...props,
|
|
17
|
-
orientation:
|
|
17
|
+
orientation: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
18
18
|
props.orientation,
|
|
19
19
|
_optionalChain([syncState, 'optionalAccess', _4 => _4.orientation]),
|
|
20
20
|
"horizontal"
|
|
21
21
|
),
|
|
22
|
-
focusLoop:
|
|
22
|
+
focusLoop: _QNEPGQLLcjs.defaultValue.call(void 0, props.focusLoop, _optionalChain([syncState, 'optionalAccess', _5 => _5.focusLoop]), true)
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
|
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
3
|
+
var _DQHU5K4Qcjs = require('../__chunks/DQHU5K4Q.cjs');
|
|
4
|
+
require('../__chunks/HLVPXX7H.cjs');
|
|
5
|
+
require('../__chunks/ZJEEK57E.cjs');
|
|
6
|
+
require('../__chunks/QYB6XH64.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _W5IHD6VGcjs = require('../__chunks/W5IHD6VG.cjs');
|
|
10
|
+
require('../__chunks/4DQ3OTE7.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _ZPOXPO2Lcjs = require('../__chunks/ZPOXPO2L.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
19
19
|
require('../__chunks/OFNGELMA.cjs');
|
|
20
20
|
require('../__chunks/GDZQUFNP.cjs');
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ function createMenuStore({
|
|
|
24
24
|
combobox,
|
|
25
25
|
...props
|
|
26
26
|
} = {}) {
|
|
27
|
-
const store =
|
|
27
|
+
const store = _ZPOXPO2Lcjs.mergeStore.call(void 0,
|
|
28
28
|
props.store,
|
|
29
29
|
_optionalChain([combobox, 'optionalAccess', _ => _.omit, 'call', _2 => _2(
|
|
30
30
|
"baseElement",
|
|
@@ -36,37 +36,37 @@ function createMenuStore({
|
|
|
36
36
|
)])
|
|
37
37
|
);
|
|
38
38
|
const syncState = store.getState();
|
|
39
|
-
const composite =
|
|
39
|
+
const composite = _W5IHD6VGcjs.createCompositeStore.call(void 0, {
|
|
40
40
|
...props,
|
|
41
41
|
store,
|
|
42
|
-
orientation:
|
|
42
|
+
orientation: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
43
43
|
props.orientation,
|
|
44
44
|
syncState.orientation,
|
|
45
45
|
"vertical"
|
|
46
46
|
)
|
|
47
47
|
});
|
|
48
|
-
const hovercard =
|
|
48
|
+
const hovercard = _DQHU5K4Qcjs.createHovercardStore.call(void 0, {
|
|
49
49
|
...props,
|
|
50
50
|
store,
|
|
51
|
-
placement:
|
|
51
|
+
placement: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
52
52
|
props.placement,
|
|
53
53
|
syncState.placement,
|
|
54
54
|
"bottom-start"
|
|
55
55
|
),
|
|
56
|
-
hideTimeout:
|
|
56
|
+
hideTimeout: _QNEPGQLLcjs.defaultValue.call(void 0, props.hideTimeout, syncState.hideTimeout, 0)
|
|
57
57
|
});
|
|
58
58
|
const initialState = {
|
|
59
59
|
...composite.getState(),
|
|
60
60
|
...hovercard.getState(),
|
|
61
|
-
initialFocus:
|
|
62
|
-
values:
|
|
61
|
+
initialFocus: _QNEPGQLLcjs.defaultValue.call(void 0, syncState.initialFocus, "container"),
|
|
62
|
+
values: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
63
63
|
props.values,
|
|
64
64
|
syncState.values,
|
|
65
65
|
props.defaultValues,
|
|
66
66
|
{}
|
|
67
67
|
)
|
|
68
68
|
};
|
|
69
|
-
const menu =
|
|
69
|
+
const menu = _ZPOXPO2Lcjs.createStore.call(void 0, initialState, composite, hovercard, store);
|
|
70
70
|
menu.setup(
|
|
71
71
|
() => menu.sync(
|
|
72
72
|
(state) => {
|
|
@@ -92,7 +92,7 @@ function createMenuStore({
|
|
|
92
92
|
return;
|
|
93
93
|
menu.setState("values", (values) => {
|
|
94
94
|
const prevValue = values[name];
|
|
95
|
-
const nextValue =
|
|
95
|
+
const nextValue = _QNEPGQLLcjs.applyState.call(void 0, value, prevValue);
|
|
96
96
|
if (nextValue === prevValue)
|
|
97
97
|
return values;
|
|
98
98
|
return {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
3
|
+
var _HLVPXX7Hcjs = require('../__chunks/HLVPXX7H.cjs');
|
|
4
|
+
require('../__chunks/ZJEEK57E.cjs');
|
|
5
|
+
require('../__chunks/QYB6XH64.cjs');
|
|
6
|
+
require('../__chunks/ZPOXPO2L.cjs');
|
|
7
|
+
require('../__chunks/QNEPGQLL.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createPopoverStore =
|
|
10
|
+
exports.createPopoverStore = _HLVPXX7Hcjs.createPopoverStore;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _W5IHD6VGcjs = require('../__chunks/W5IHD6VG.cjs');
|
|
4
|
+
require('../__chunks/4DQ3OTE7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _ZPOXPO2Lcjs = require('../__chunks/ZPOXPO2L.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
11
11
|
require('../__chunks/OFNGELMA.cjs');
|
|
12
12
|
require('../__chunks/GDZQUFNP.cjs');
|
|
13
13
|
|
|
@@ -16,20 +16,20 @@ function createRadioStore({
|
|
|
16
16
|
...props
|
|
17
17
|
} = {}) {
|
|
18
18
|
const syncState = _optionalChain([props, 'access', _ => _.store, 'optionalAccess', _2 => _2.getState, 'call', _3 => _3()]);
|
|
19
|
-
const composite =
|
|
19
|
+
const composite = _W5IHD6VGcjs.createCompositeStore.call(void 0, {
|
|
20
20
|
...props,
|
|
21
|
-
focusLoop:
|
|
21
|
+
focusLoop: _QNEPGQLLcjs.defaultValue.call(void 0, props.focusLoop, _optionalChain([syncState, 'optionalAccess', _4 => _4.focusLoop]), true)
|
|
22
22
|
});
|
|
23
23
|
const initialState = {
|
|
24
24
|
...composite.getState(),
|
|
25
|
-
value:
|
|
25
|
+
value: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
26
26
|
props.value,
|
|
27
27
|
_optionalChain([syncState, 'optionalAccess', _5 => _5.value]),
|
|
28
28
|
props.defaultValue,
|
|
29
29
|
null
|
|
30
30
|
)
|
|
31
31
|
};
|
|
32
|
-
const radio =
|
|
32
|
+
const radio = _ZPOXPO2Lcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
33
33
|
return {
|
|
34
34
|
...composite,
|
|
35
35
|
...radio,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _HLVPXX7Hcjs = require('../__chunks/HLVPXX7H.cjs');
|
|
4
|
+
require('../__chunks/ZJEEK57E.cjs');
|
|
5
|
+
require('../__chunks/QYB6XH64.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
var _W5IHD6VGcjs = require('../__chunks/W5IHD6VG.cjs');
|
|
9
|
+
require('../__chunks/4DQ3OTE7.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _ZPOXPO2Lcjs = require('../__chunks/ZPOXPO2L.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
17
17
|
require('../__chunks/OFNGELMA.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ function createSelectStore({
|
|
|
24
24
|
combobox,
|
|
25
25
|
...props
|
|
26
26
|
} = {}) {
|
|
27
|
-
const store =
|
|
27
|
+
const store = _ZPOXPO2Lcjs.mergeStore.call(void 0,
|
|
28
28
|
props.store,
|
|
29
29
|
_optionalChain([combobox, 'optionalAccess', _ => _.omit, 'call', _2 => _2(
|
|
30
30
|
"value",
|
|
@@ -39,35 +39,35 @@ function createSelectStore({
|
|
|
39
39
|
)])
|
|
40
40
|
);
|
|
41
41
|
const syncState = store.getState();
|
|
42
|
-
const composite =
|
|
42
|
+
const composite = _W5IHD6VGcjs.createCompositeStore.call(void 0, {
|
|
43
43
|
...props,
|
|
44
44
|
store,
|
|
45
|
-
virtualFocus:
|
|
45
|
+
virtualFocus: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
46
46
|
props.virtualFocus,
|
|
47
47
|
syncState.virtualFocus,
|
|
48
48
|
true
|
|
49
49
|
),
|
|
50
|
-
includesBaseElement:
|
|
50
|
+
includesBaseElement: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
51
51
|
props.includesBaseElement,
|
|
52
52
|
syncState.includesBaseElement,
|
|
53
53
|
false
|
|
54
54
|
),
|
|
55
|
-
activeId:
|
|
55
|
+
activeId: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
56
56
|
props.activeId,
|
|
57
57
|
syncState.activeId,
|
|
58
58
|
props.defaultActiveId,
|
|
59
59
|
null
|
|
60
60
|
),
|
|
61
|
-
orientation:
|
|
61
|
+
orientation: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
62
62
|
props.orientation,
|
|
63
63
|
syncState.orientation,
|
|
64
64
|
"vertical"
|
|
65
65
|
)
|
|
66
66
|
});
|
|
67
|
-
const popover =
|
|
67
|
+
const popover = _HLVPXX7Hcjs.createPopoverStore.call(void 0, {
|
|
68
68
|
...props,
|
|
69
69
|
store,
|
|
70
|
-
placement:
|
|
70
|
+
placement: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
71
71
|
props.placement,
|
|
72
72
|
syncState.placement,
|
|
73
73
|
"bottom-start"
|
|
@@ -77,21 +77,21 @@ function createSelectStore({
|
|
|
77
77
|
const initialState = {
|
|
78
78
|
...composite.getState(),
|
|
79
79
|
...popover.getState(),
|
|
80
|
-
value:
|
|
80
|
+
value: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
81
81
|
props.value,
|
|
82
82
|
syncState.value,
|
|
83
83
|
props.defaultValue,
|
|
84
84
|
initialValue
|
|
85
85
|
),
|
|
86
|
-
setValueOnMove:
|
|
86
|
+
setValueOnMove: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
87
87
|
props.setValueOnMove,
|
|
88
88
|
syncState.setValueOnMove,
|
|
89
89
|
false
|
|
90
90
|
),
|
|
91
|
-
selectElement:
|
|
92
|
-
labelElement:
|
|
91
|
+
selectElement: _QNEPGQLLcjs.defaultValue.call(void 0, syncState.selectElement, null),
|
|
92
|
+
labelElement: _QNEPGQLLcjs.defaultValue.call(void 0, syncState.labelElement, null)
|
|
93
93
|
};
|
|
94
|
-
const select =
|
|
94
|
+
const select = _ZPOXPO2Lcjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
95
95
|
select.setup(
|
|
96
96
|
() => select.sync(
|
|
97
97
|
(state) => {
|
package/cjs/tab/tab-store.cjs
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _W5IHD6VGcjs = require('../__chunks/W5IHD6VG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _4DQ3OTE7cjs = require('../__chunks/4DQ3OTE7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _ZPOXPO2Lcjs = require('../__chunks/ZPOXPO2L.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
13
13
|
require('../__chunks/OFNGELMA.cjs');
|
|
14
14
|
require('../__chunks/GDZQUFNP.cjs');
|
|
15
15
|
|
|
16
16
|
// src/tab/tab-store.ts
|
|
17
17
|
function createTabStore(props = {}) {
|
|
18
18
|
const syncState = _optionalChain([props, 'access', _ => _.store, 'optionalAccess', _2 => _2.getState, 'call', _3 => _3()]);
|
|
19
|
-
const composite =
|
|
19
|
+
const composite = _W5IHD6VGcjs.createCompositeStore.call(void 0, {
|
|
20
20
|
...props,
|
|
21
|
-
orientation:
|
|
21
|
+
orientation: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
22
22
|
props.orientation,
|
|
23
23
|
_optionalChain([syncState, 'optionalAccess', _4 => _4.orientation]),
|
|
24
24
|
"horizontal"
|
|
25
25
|
),
|
|
26
|
-
focusLoop:
|
|
26
|
+
focusLoop: _QNEPGQLLcjs.defaultValue.call(void 0, props.focusLoop, _optionalChain([syncState, 'optionalAccess', _5 => _5.focusLoop]), true)
|
|
27
27
|
});
|
|
28
|
-
const panels =
|
|
28
|
+
const panels = _4DQ3OTE7cjs.createCollectionStore.call(void 0, );
|
|
29
29
|
const initialState = {
|
|
30
30
|
...composite.getState(),
|
|
31
|
-
selectedId:
|
|
31
|
+
selectedId: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
32
32
|
props.selectedId,
|
|
33
33
|
_optionalChain([syncState, 'optionalAccess', _6 => _6.selectedId]),
|
|
34
34
|
props.defaultSelectedId,
|
|
35
35
|
void 0
|
|
36
36
|
),
|
|
37
|
-
selectOnMove:
|
|
37
|
+
selectOnMove: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
38
38
|
props.selectOnMove,
|
|
39
39
|
_optionalChain([syncState, 'optionalAccess', _7 => _7.selectOnMove]),
|
|
40
40
|
true
|
|
41
41
|
)
|
|
42
42
|
};
|
|
43
|
-
const tab =
|
|
43
|
+
const tab = _ZPOXPO2Lcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
44
44
|
tab.setup(
|
|
45
45
|
() => tab.sync(() => {
|
|
46
46
|
const { activeId, selectOnMove } = tab.getState();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _W5IHD6VGcjs = require('../__chunks/W5IHD6VG.cjs');
|
|
4
|
+
require('../__chunks/4DQ3OTE7.cjs');
|
|
5
|
+
require('../__chunks/ZPOXPO2L.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
9
9
|
require('../__chunks/OFNGELMA.cjs');
|
|
10
10
|
require('../__chunks/GDZQUFNP.cjs');
|
|
11
11
|
|
|
12
12
|
// src/toolbar/toolbar-store.ts
|
|
13
13
|
function createToolbarStore(props = {}) {
|
|
14
14
|
const syncState = _optionalChain([props, 'access', _ => _.store, 'optionalAccess', _2 => _2.getState, 'call', _3 => _3()]);
|
|
15
|
-
return
|
|
15
|
+
return _W5IHD6VGcjs.createCompositeStore.call(void 0, {
|
|
16
16
|
...props,
|
|
17
|
-
orientation:
|
|
17
|
+
orientation: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
18
18
|
props.orientation,
|
|
19
19
|
_optionalChain([syncState, 'optionalAccess', _4 => _4.orientation]),
|
|
20
20
|
"horizontal"
|
|
21
21
|
),
|
|
22
|
-
focusLoop:
|
|
22
|
+
focusLoop: _QNEPGQLLcjs.defaultValue.call(void 0, props.focusLoop, _optionalChain([syncState, 'optionalAccess', _5 => _5.focusLoop]), true)
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _HLVPXX7Hcjs = require('../__chunks/HLVPXX7H.cjs');
|
|
4
|
+
require('../__chunks/ZJEEK57E.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _QYB6XH64cjs = require('../__chunks/QYB6XH64.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _ZPOXPO2Lcjs = require('../__chunks/ZPOXPO2L.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _QNEPGQLLcjs = require('../__chunks/QNEPGQLL.cjs');
|
|
14
14
|
|
|
15
15
|
// src/tooltip/tooltip-store.ts
|
|
16
|
-
var tooltips =
|
|
16
|
+
var tooltips = _ZPOXPO2Lcjs.createStore.call(void 0, { activeRef: null });
|
|
17
17
|
function afterTimeout(timeoutMs, cb) {
|
|
18
18
|
const timeoutId = setTimeout(cb, timeoutMs);
|
|
19
19
|
return () => clearTimeout(timeoutId);
|
|
20
20
|
}
|
|
21
21
|
function createTooltipStore(props = {}) {
|
|
22
22
|
const syncState = _optionalChain([props, 'access', _ => _.store, 'optionalAccess', _2 => _2.getState, 'call', _3 => _3()]);
|
|
23
|
-
const open =
|
|
24
|
-
const disclosure =
|
|
25
|
-
const popover =
|
|
23
|
+
const open = _QNEPGQLLcjs.defaultValue.call(void 0, props.open, _optionalChain([syncState, 'optionalAccess', _4 => _4.open]), false);
|
|
24
|
+
const disclosure = _QYB6XH64cjs.createDisclosureStore.call(void 0, { ...props, open });
|
|
25
|
+
const popover = _HLVPXX7Hcjs.createPopoverStore.call(void 0, {
|
|
26
26
|
...props,
|
|
27
27
|
open,
|
|
28
|
-
placement:
|
|
28
|
+
placement: _QNEPGQLLcjs.defaultValue.call(void 0,
|
|
29
29
|
props.placement,
|
|
30
30
|
_optionalChain([syncState, 'optionalAccess', _5 => _5.placement]),
|
|
31
31
|
"top"
|
|
32
32
|
),
|
|
33
|
-
gutter:
|
|
33
|
+
gutter: _QNEPGQLLcjs.defaultValue.call(void 0, props.gutter, _optionalChain([syncState, 'optionalAccess', _6 => _6.gutter]), 8)
|
|
34
34
|
});
|
|
35
35
|
const initialState = {
|
|
36
36
|
...popover.getState(),
|
|
37
|
-
timeout:
|
|
37
|
+
timeout: _QNEPGQLLcjs.defaultValue.call(void 0, props.timeout, _optionalChain([syncState, 'optionalAccess', _7 => _7.timeout]), 0)
|
|
38
38
|
};
|
|
39
|
-
const tooltip =
|
|
39
|
+
const tooltip = _ZPOXPO2Lcjs.createStore.call(void 0,
|
|
40
40
|
initialState,
|
|
41
41
|
popover,
|
|
42
42
|
disclosure.omit("open", "mounted"),
|