@ariakit/core 0.2.7 → 0.2.9
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 +14 -0
- package/cjs/__chunks/{ZXPKRPGY.cjs → DPHJ32KR.cjs} +8 -7
- package/cjs/__chunks/{SXMUYOXB.cjs → F5DMXFQ2.cjs} +30 -31
- package/cjs/__chunks/{5AWPMH4S.cjs → FS2K2N7U.cjs} +72 -25
- package/cjs/__chunks/{NVEPU4WA.cjs → MCCIH6SG.cjs} +4 -4
- package/cjs/__chunks/{PR7FUI5D.cjs → OQIG5VE3.cjs} +16 -16
- package/cjs/__chunks/{K2LZWNNX.cjs → PIEJYPN7.cjs} +2 -2
- package/cjs/__chunks/{RS4LBZRZ.cjs → V7OHZPBO.cjs} +28 -32
- package/cjs/checkbox/checkbox-store.cjs +2 -2
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-store.cjs +53 -56
- package/cjs/combobox/combobox-store.d.ts +1 -1
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/form/form-store.cjs +4 -4
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.cjs +4 -4
- package/cjs/menu/menu-store.cjs +23 -22
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/radio/radio-store.cjs +5 -5
- package/cjs/select/select-store.cjs +65 -67
- package/cjs/tab/tab-store.cjs +55 -56
- package/cjs/toolbar/toolbar-store.cjs +4 -4
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/events.cjs +5 -11
- package/cjs/utils/events.d.ts +0 -3
- package/cjs/utils/store.cjs +16 -2
- package/cjs/utils/store.d.ts +19 -59
- package/esm/__chunks/{SHUO6V52.js → A7IMXABC.js} +29 -30
- package/esm/__chunks/{XJGRXN57.js → COUCUJML.js} +2 -2
- package/esm/__chunks/{UWW2ZP3K.js → LNMWV6UV.js} +1 -1
- package/esm/__chunks/{FQL4TRMX.js → OGOHEUXI.js} +71 -24
- package/esm/__chunks/{NRXA5QTV.js → ROY5BBHL.js} +15 -15
- package/esm/__chunks/{LM4QG55U.js → SOCHV2LZ.js} +6 -5
- package/esm/__chunks/{L5RO76KW.js → WSKDP2MG.js} +27 -31
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-store.d.ts +1 -1
- package/esm/combobox/combobox-store.js +50 -53
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.js +2 -2
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +3 -3
- package/esm/menu/menu-store.js +20 -19
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +3 -3
- package/esm/select/select-store.js +62 -64
- package/esm/tab/tab-store.js +53 -54
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/events.d.ts +0 -3
- package/esm/utils/events.js +5 -11
- package/esm/utils/store.d.ts +19 -59
- package/esm/utils/store.js +17 -3
- package/package.json +1 -1
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPopoverStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/SOCHV2LZ.js";
|
|
4
|
+
import "../__chunks/LNMWV6UV.js";
|
|
5
|
+
import "../__chunks/WSKDP2MG.js";
|
|
6
6
|
import {
|
|
7
7
|
createCompositeStore
|
|
8
|
-
} from "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
8
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
9
|
+
import "../__chunks/A7IMXABC.js";
|
|
10
10
|
import {
|
|
11
|
+
batch,
|
|
11
12
|
createStore,
|
|
12
|
-
mergeStore
|
|
13
|
-
|
|
13
|
+
mergeStore,
|
|
14
|
+
omit,
|
|
15
|
+
setup,
|
|
16
|
+
sync
|
|
17
|
+
} from "../__chunks/OGOHEUXI.js";
|
|
14
18
|
import {
|
|
15
19
|
defaultValue
|
|
16
20
|
} from "../__chunks/WVTCK5PV.js";
|
|
@@ -38,15 +42,16 @@ function createComboboxStore(_a = {}) {
|
|
|
38
42
|
]);
|
|
39
43
|
const store = mergeStore(
|
|
40
44
|
props.store,
|
|
41
|
-
menu
|
|
45
|
+
omit(menu, [
|
|
42
46
|
"baseElement",
|
|
43
47
|
"arrowElement",
|
|
44
48
|
"anchorElement",
|
|
45
49
|
"contentElement",
|
|
46
50
|
"popoverElement",
|
|
47
|
-
"disclosureElement"
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
"disclosureElement",
|
|
52
|
+
"anchorElement"
|
|
53
|
+
]),
|
|
54
|
+
omit(select, [
|
|
50
55
|
"value",
|
|
51
56
|
"items",
|
|
52
57
|
"renderedItems",
|
|
@@ -56,7 +61,7 @@ function createComboboxStore(_a = {}) {
|
|
|
56
61
|
"contentElement",
|
|
57
62
|
"popoverElement",
|
|
58
63
|
"disclosureElement"
|
|
59
|
-
)
|
|
64
|
+
])
|
|
60
65
|
);
|
|
61
66
|
const syncState = store.getState();
|
|
62
67
|
const activeId = defaultValue(
|
|
@@ -110,50 +115,42 @@ function createComboboxStore(_a = {}) {
|
|
|
110
115
|
activeValue: syncState.activeValue
|
|
111
116
|
});
|
|
112
117
|
const combobox = createStore(initialState, composite, popover, store);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
["resetValueOnHide", "mounted"]
|
|
123
|
-
)
|
|
118
|
+
setup(
|
|
119
|
+
combobox,
|
|
120
|
+
() => sync(combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
121
|
+
if (!state.resetValueOnHide)
|
|
122
|
+
return;
|
|
123
|
+
if (state.mounted)
|
|
124
|
+
return;
|
|
125
|
+
combobox.setState("value", initialValue);
|
|
126
|
+
})
|
|
124
127
|
);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
["mounted"]
|
|
134
|
-
)
|
|
128
|
+
setup(
|
|
129
|
+
combobox,
|
|
130
|
+
() => batch(combobox, ["mounted"], (state) => {
|
|
131
|
+
if (state.mounted)
|
|
132
|
+
return;
|
|
133
|
+
combobox.setState("activeId", activeId);
|
|
134
|
+
combobox.setState("moves", 0);
|
|
135
|
+
})
|
|
135
136
|
);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
["moves", "activeId"]
|
|
144
|
-
)
|
|
137
|
+
setup(
|
|
138
|
+
combobox,
|
|
139
|
+
() => sync(combobox, ["moves", "activeId"], (state, prevState) => {
|
|
140
|
+
if (state.moves === prevState.moves) {
|
|
141
|
+
combobox.setState("activeValue", void 0);
|
|
142
|
+
}
|
|
143
|
+
})
|
|
145
144
|
);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
["moves", "renderedItems"]
|
|
156
|
-
)
|
|
145
|
+
setup(
|
|
146
|
+
combobox,
|
|
147
|
+
() => batch(combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
148
|
+
if (state.moves === prev.moves)
|
|
149
|
+
return;
|
|
150
|
+
const { activeId: activeId2 } = combobox.getState();
|
|
151
|
+
const activeItem = composite.item(activeId2);
|
|
152
|
+
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
|
|
153
|
+
})
|
|
157
154
|
);
|
|
158
155
|
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, popover), composite), combobox), {
|
|
159
156
|
setValue: (value) => combobox.setState("value", value)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPopoverStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/SOCHV2LZ.js";
|
|
4
|
+
import "../__chunks/LNMWV6UV.js";
|
|
5
|
+
import "../__chunks/WSKDP2MG.js";
|
|
6
|
+
import "../__chunks/OGOHEUXI.js";
|
|
7
7
|
import "../__chunks/WVTCK5PV.js";
|
|
8
8
|
import "../__chunks/PNRLI7OV.js";
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
4
|
+
import "../__chunks/A7IMXABC.js";
|
|
5
|
+
import "../__chunks/OGOHEUXI.js";
|
|
6
6
|
import "../__chunks/WVTCK5PV.js";
|
|
7
7
|
import "../__chunks/O35LWD4W.js";
|
|
8
8
|
import "../__chunks/5XEKIOCW.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/LNMWV6UV.js";
|
|
4
|
+
import "../__chunks/WSKDP2MG.js";
|
|
5
|
+
import "../__chunks/OGOHEUXI.js";
|
|
6
6
|
import "../__chunks/WVTCK5PV.js";
|
|
7
7
|
import "../__chunks/PNRLI7OV.js";
|
|
8
8
|
export {
|
package/esm/form/form-store.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHovercardStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/COUCUJML.js";
|
|
4
|
+
import "../__chunks/SOCHV2LZ.js";
|
|
5
|
+
import "../__chunks/LNMWV6UV.js";
|
|
6
|
+
import "../__chunks/WSKDP2MG.js";
|
|
7
|
+
import "../__chunks/OGOHEUXI.js";
|
|
8
8
|
import "../__chunks/WVTCK5PV.js";
|
|
9
9
|
import "../__chunks/PNRLI7OV.js";
|
|
10
10
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
4
|
+
import "../__chunks/A7IMXABC.js";
|
|
5
|
+
import "../__chunks/OGOHEUXI.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
8
|
} from "../__chunks/WVTCK5PV.js";
|
package/esm/menu/menu-store.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHovercardStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/COUCUJML.js";
|
|
4
|
+
import "../__chunks/SOCHV2LZ.js";
|
|
5
|
+
import "../__chunks/LNMWV6UV.js";
|
|
6
|
+
import "../__chunks/WSKDP2MG.js";
|
|
7
7
|
import {
|
|
8
8
|
createCompositeStore
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
10
|
+
import "../__chunks/A7IMXABC.js";
|
|
11
11
|
import {
|
|
12
12
|
createStore,
|
|
13
|
-
mergeStore
|
|
14
|
-
|
|
13
|
+
mergeStore,
|
|
14
|
+
omit,
|
|
15
|
+
setup,
|
|
16
|
+
sync
|
|
17
|
+
} from "../__chunks/OGOHEUXI.js";
|
|
15
18
|
import {
|
|
16
19
|
applyState,
|
|
17
20
|
defaultValue
|
|
@@ -33,13 +36,13 @@ function createMenuStore(_a = {}) {
|
|
|
33
36
|
]);
|
|
34
37
|
const store = mergeStore(
|
|
35
38
|
props.store,
|
|
36
|
-
combobox
|
|
39
|
+
omit(combobox, [
|
|
37
40
|
"arrowElement",
|
|
38
41
|
"anchorElement",
|
|
39
42
|
"contentElement",
|
|
40
43
|
"popoverElement",
|
|
41
44
|
"disclosureElement"
|
|
42
|
-
)
|
|
45
|
+
])
|
|
43
46
|
);
|
|
44
47
|
const syncState = store.getState();
|
|
45
48
|
const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
|
|
@@ -69,15 +72,13 @@ function createMenuStore(_a = {}) {
|
|
|
69
72
|
)
|
|
70
73
|
});
|
|
71
74
|
const menu = createStore(initialState, composite, hovercard, store);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
["mounted"]
|
|
80
|
-
)
|
|
75
|
+
setup(
|
|
76
|
+
menu,
|
|
77
|
+
() => sync(menu, ["mounted"], (state) => {
|
|
78
|
+
if (state.mounted)
|
|
79
|
+
return;
|
|
80
|
+
menu.setState("activeId", null);
|
|
81
|
+
})
|
|
81
82
|
);
|
|
82
83
|
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, composite), hovercard), menu), {
|
|
83
84
|
setInitialFocus: (value) => menu.setState("initialFocus", value),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPopoverStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/SOCHV2LZ.js";
|
|
4
|
+
import "../__chunks/LNMWV6UV.js";
|
|
5
|
+
import "../__chunks/WSKDP2MG.js";
|
|
6
|
+
import "../__chunks/OGOHEUXI.js";
|
|
7
7
|
import "../__chunks/WVTCK5PV.js";
|
|
8
8
|
import "../__chunks/PNRLI7OV.js";
|
|
9
9
|
export {
|
package/esm/radio/radio-store.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
4
|
+
import "../__chunks/A7IMXABC.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "../__chunks/
|
|
7
|
+
} from "../__chunks/OGOHEUXI.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
10
|
} from "../__chunks/WVTCK5PV.js";
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPopoverStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/SOCHV2LZ.js";
|
|
4
|
+
import "../__chunks/LNMWV6UV.js";
|
|
5
|
+
import "../__chunks/WSKDP2MG.js";
|
|
6
6
|
import {
|
|
7
7
|
createCompositeStore
|
|
8
|
-
} from "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
8
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
9
|
+
import "../__chunks/A7IMXABC.js";
|
|
10
10
|
import {
|
|
11
|
+
batch,
|
|
11
12
|
createStore,
|
|
12
|
-
mergeStore
|
|
13
|
-
|
|
13
|
+
mergeStore,
|
|
14
|
+
omit,
|
|
15
|
+
setup,
|
|
16
|
+
sync
|
|
17
|
+
} from "../__chunks/OGOHEUXI.js";
|
|
14
18
|
import {
|
|
15
19
|
defaultValue
|
|
16
20
|
} from "../__chunks/WVTCK5PV.js";
|
|
@@ -33,7 +37,7 @@ function createSelectStore(_a = {}) {
|
|
|
33
37
|
]);
|
|
34
38
|
const store = mergeStore(
|
|
35
39
|
props.store,
|
|
36
|
-
combobox
|
|
40
|
+
omit(combobox, [
|
|
37
41
|
"value",
|
|
38
42
|
"items",
|
|
39
43
|
"renderedItems",
|
|
@@ -43,7 +47,7 @@ function createSelectStore(_a = {}) {
|
|
|
43
47
|
"contentElement",
|
|
44
48
|
"popoverElement",
|
|
45
49
|
"disclosureElement"
|
|
46
|
-
)
|
|
50
|
+
])
|
|
47
51
|
);
|
|
48
52
|
const syncState = store.getState();
|
|
49
53
|
const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
|
|
@@ -96,63 +100,57 @@ function createSelectStore(_a = {}) {
|
|
|
96
100
|
labelElement: defaultValue(syncState.labelElement, null)
|
|
97
101
|
});
|
|
98
102
|
const select = createStore(initialState, composite, popover, store);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
["value", "items"]
|
|
114
|
-
)
|
|
103
|
+
setup(
|
|
104
|
+
select,
|
|
105
|
+
() => sync(select, ["value", "items"], (state) => {
|
|
106
|
+
if (state.value !== initialValue)
|
|
107
|
+
return;
|
|
108
|
+
if (!state.items.length)
|
|
109
|
+
return;
|
|
110
|
+
const item = state.items.find(
|
|
111
|
+
(item2) => !item2.disabled && item2.value != null
|
|
112
|
+
);
|
|
113
|
+
if ((item == null ? void 0 : item.value) == null)
|
|
114
|
+
return;
|
|
115
|
+
select.setState("value", item.value);
|
|
116
|
+
})
|
|
115
117
|
);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
["mounted", "items", "value"]
|
|
135
|
-
)
|
|
118
|
+
setup(
|
|
119
|
+
select,
|
|
120
|
+
() => sync(select, ["mounted", "items", "value"], (state) => {
|
|
121
|
+
if (combobox)
|
|
122
|
+
return;
|
|
123
|
+
if (state.mounted)
|
|
124
|
+
return;
|
|
125
|
+
const values = toArray(state.value);
|
|
126
|
+
const lastValue = values[values.length - 1];
|
|
127
|
+
if (lastValue == null)
|
|
128
|
+
return;
|
|
129
|
+
const item = state.items.find(
|
|
130
|
+
(item2) => !item2.disabled && item2.value === lastValue
|
|
131
|
+
);
|
|
132
|
+
if (!item)
|
|
133
|
+
return;
|
|
134
|
+
select.setState("activeId", item.id);
|
|
135
|
+
})
|
|
136
136
|
);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
["setValueOnMove", "moves"]
|
|
155
|
-
)
|
|
137
|
+
setup(
|
|
138
|
+
select,
|
|
139
|
+
() => batch(select, ["setValueOnMove", "moves"], (state) => {
|
|
140
|
+
const { mounted, value, activeId } = select.getState();
|
|
141
|
+
if (!state.setValueOnMove && mounted)
|
|
142
|
+
return;
|
|
143
|
+
if (Array.isArray(value))
|
|
144
|
+
return;
|
|
145
|
+
if (!state.moves)
|
|
146
|
+
return;
|
|
147
|
+
if (!activeId)
|
|
148
|
+
return;
|
|
149
|
+
const item = composite.item(activeId);
|
|
150
|
+
if (!item || item.disabled || item.value == null)
|
|
151
|
+
return;
|
|
152
|
+
select.setState("value", item.value);
|
|
153
|
+
})
|
|
156
154
|
);
|
|
157
155
|
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, composite), popover), select), {
|
|
158
156
|
setValue: (value) => select.setState("value", value),
|
package/esm/tab/tab-store.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
3
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
4
4
|
import {
|
|
5
5
|
createCollectionStore
|
|
6
|
-
} from "../__chunks/
|
|
6
|
+
} from "../__chunks/A7IMXABC.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
batch,
|
|
9
|
+
createStore,
|
|
10
|
+
setup,
|
|
11
|
+
sync
|
|
12
|
+
} from "../__chunks/OGOHEUXI.js";
|
|
10
13
|
import {
|
|
11
14
|
defaultValue
|
|
12
15
|
} from "../__chunks/WVTCK5PV.js";
|
|
@@ -44,8 +47,9 @@ function createTabStore(props = {}) {
|
|
|
44
47
|
)
|
|
45
48
|
});
|
|
46
49
|
const tab = createStore(initialState, composite, props.store);
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
setup(
|
|
51
|
+
tab,
|
|
52
|
+
() => sync(tab, ["moves"], () => {
|
|
49
53
|
const { activeId, selectOnMove } = tab.getState();
|
|
50
54
|
if (!selectOnMove)
|
|
51
55
|
return;
|
|
@@ -59,59 +63,54 @@ function createTabStore(props = {}) {
|
|
|
59
63
|
if (tabItem.disabled)
|
|
60
64
|
return;
|
|
61
65
|
tab.setState("selectedId", tabItem.id);
|
|
62
|
-
}
|
|
66
|
+
})
|
|
63
67
|
);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
setup(
|
|
69
|
+
tab,
|
|
70
|
+
() => batch(
|
|
71
|
+
tab,
|
|
72
|
+
["selectedId"],
|
|
73
|
+
(state) => tab.setState("activeId", state.selectedId)
|
|
68
74
|
)
|
|
69
75
|
);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
["selectedId", "renderedItems"]
|
|
87
|
-
)
|
|
76
|
+
setup(
|
|
77
|
+
tab,
|
|
78
|
+
() => sync(tab, ["selectedId", "renderedItems"], (state) => {
|
|
79
|
+
if (state.selectedId !== void 0)
|
|
80
|
+
return;
|
|
81
|
+
const { activeId, renderedItems } = tab.getState();
|
|
82
|
+
const tabItem = composite.item(activeId);
|
|
83
|
+
if (tabItem && !tabItem.disabled && !tabItem.dimmed) {
|
|
84
|
+
tab.setState("selectedId", tabItem.id);
|
|
85
|
+
} else {
|
|
86
|
+
const tabItem2 = renderedItems.find(
|
|
87
|
+
(item) => !item.disabled && !item.dimmed
|
|
88
|
+
);
|
|
89
|
+
tab.setState("selectedId", tabItem2 == null ? void 0 : tabItem2.id);
|
|
90
|
+
}
|
|
91
|
+
})
|
|
88
92
|
);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
setup(
|
|
94
|
+
tab,
|
|
95
|
+
() => sync(tab, ["renderedItems"], (state) => {
|
|
96
|
+
const tabs = state.renderedItems;
|
|
97
|
+
if (!tabs.length)
|
|
98
|
+
return;
|
|
99
|
+
return sync(panels, ["renderedItems"], (state2) => {
|
|
100
|
+
const items = state2.renderedItems;
|
|
101
|
+
const hasOrphanPanels = items.some((panel) => !panel.tabId);
|
|
102
|
+
if (!hasOrphanPanels)
|
|
94
103
|
return;
|
|
95
|
-
|
|
96
|
-
(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (!tabItem)
|
|
106
|
-
return;
|
|
107
|
-
panels.renderItem(__spreadProps(__spreadValues({}, panel), { tabId: tabItem.id }));
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
["renderedItems"]
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
["renderedItems"]
|
|
114
|
-
)
|
|
104
|
+
items.forEach((panel, i) => {
|
|
105
|
+
if (panel.tabId)
|
|
106
|
+
return;
|
|
107
|
+
const tabItem = tabs[i];
|
|
108
|
+
if (!tabItem)
|
|
109
|
+
return;
|
|
110
|
+
panels.renderItem(__spreadProps(__spreadValues({}, panel), { tabId: tabItem.id }));
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
})
|
|
115
114
|
);
|
|
116
115
|
return __spreadProps(__spreadValues(__spreadValues({}, composite), tab), {
|
|
117
116
|
panels,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompositeStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/ROY5BBHL.js";
|
|
4
|
+
import "../__chunks/A7IMXABC.js";
|
|
5
|
+
import "../__chunks/OGOHEUXI.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
8
|
} from "../__chunks/WVTCK5PV.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHovercardStore
|
|
3
|
-
} from "../__chunks/
|
|
4
|
-
import "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
3
|
+
} from "../__chunks/COUCUJML.js";
|
|
4
|
+
import "../__chunks/SOCHV2LZ.js";
|
|
5
|
+
import "../__chunks/LNMWV6UV.js";
|
|
6
|
+
import "../__chunks/WSKDP2MG.js";
|
|
7
7
|
import {
|
|
8
8
|
createStore
|
|
9
|
-
} from "../__chunks/
|
|
9
|
+
} from "../__chunks/OGOHEUXI.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
12
|
} from "../__chunks/WVTCK5PV.js";
|