@ariakit/core 0.4.5 → 0.4.6
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 +8 -0
- package/cjs/__chunks/{KL74MAHB.cjs → 3HYNC3XA.cjs} +2 -2
- package/cjs/__chunks/{QD2A4YF6.cjs → 4W3OYRR3.cjs} +2 -2
- package/cjs/__chunks/{MHZQJPY3.cjs → B4AKUC4S.cjs} +2 -2
- package/cjs/__chunks/{2D5LEVE7.cjs → D7M2PCAQ.cjs} +6 -6
- package/cjs/__chunks/{IMYW2UAC.cjs → Q2WCPTYS.cjs} +4 -22
- package/cjs/checkbox/checkbox-store.d.cts +2 -2
- package/cjs/checkbox/checkbox-store.d.ts +2 -2
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/collection/collection-store.d.cts +2 -2
- package/cjs/collection/collection-store.d.ts +2 -2
- package/cjs/combobox/combobox-store.cjs +16 -7
- package/cjs/combobox/combobox-store.d.cts +5 -5
- package/cjs/combobox/combobox-store.d.ts +5 -5
- package/cjs/composite/composite-overflow-store.d.cts +2 -2
- package/cjs/composite/composite-overflow-store.d.ts +2 -2
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/composite/composite-store.d.cts +3 -3
- package/cjs/composite/composite-store.d.ts +3 -3
- package/cjs/dialog/dialog-store.d.cts +2 -2
- package/cjs/dialog/dialog-store.d.ts +2 -2
- package/cjs/disclosure/disclosure-store.d.cts +2 -2
- package/cjs/disclosure/disclosure-store.d.ts +2 -2
- package/cjs/form/form-store.cjs +3 -3
- package/cjs/form/form-store.d.cts +4 -4
- package/cjs/form/form-store.d.ts +4 -4
- package/cjs/form/types.d.cts +3 -3
- package/cjs/form/types.d.ts +3 -3
- package/cjs/hovercard/hovercard-store.d.cts +3 -3
- package/cjs/hovercard/hovercard-store.d.ts +3 -3
- package/cjs/menu/menu-bar-store.cjs +5 -5
- package/cjs/menu/menu-bar-store.d.cts +2 -2
- package/cjs/menu/menu-bar-store.d.ts +2 -2
- package/cjs/menu/menu-store.cjs +4 -4
- package/cjs/menu/menu-store.d.cts +6 -6
- package/cjs/menu/menu-store.d.ts +6 -6
- package/cjs/menubar/menubar-store.cjs +5 -5
- package/cjs/menubar/menubar-store.d.cts +2 -2
- package/cjs/menubar/menubar-store.d.ts +2 -2
- package/cjs/popover/popover-store.d.cts +3 -3
- package/cjs/popover/popover-store.d.ts +3 -3
- package/cjs/radio/radio-store.cjs +4 -4
- package/cjs/radio/radio-store.d.cts +3 -3
- package/cjs/radio/radio-store.d.ts +3 -3
- package/cjs/select/select-store.cjs +16 -6
- package/cjs/select/select-store.d.cts +17 -9
- package/cjs/select/select-store.d.ts +17 -9
- package/cjs/tab/tab-store.cjs +45 -12
- package/cjs/tab/tab-store.d.cts +7 -6
- package/cjs/tab/tab-store.d.ts +7 -6
- package/cjs/tag/tag-store.cjs +4 -4
- package/cjs/tag/tag-store.d.cts +3 -3
- package/cjs/tag/tag-store.d.ts +3 -3
- package/cjs/toolbar/toolbar-store.cjs +4 -4
- package/cjs/toolbar/toolbar-store.d.cts +2 -2
- package/cjs/toolbar/toolbar-store.d.ts +2 -2
- package/cjs/tooltip/tooltip-store.d.cts +2 -2
- package/cjs/tooltip/tooltip-store.d.ts +2 -2
- package/cjs/utils/dom.cjs +2 -6
- package/cjs/utils/dom.d.cts +1 -17
- package/cjs/utils/dom.d.ts +1 -17
- package/cjs/utils/events.cjs +20 -15
- package/cjs/utils/events.d.cts +1 -1
- package/cjs/utils/events.d.ts +1 -1
- package/cjs/utils/focus.cjs +13 -15
- package/cjs/utils/focus.d.cts +1 -1
- package/cjs/utils/focus.d.ts +1 -1
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.d.cts +3 -3
- package/cjs/utils/store.d.ts +3 -3
- package/esm/__chunks/{QAI5BPCY.js → CLSHHUGK.js} +1 -1
- package/esm/__chunks/{ABMC67JW.js → EQPTKGFA.js} +1 -1
- package/esm/__chunks/{IUORCTET.js → I2NJJ3XW.js} +3 -21
- package/esm/__chunks/{K7A7LTR3.js → P3MTNH46.js} +1 -1
- package/esm/__chunks/{YVUNPQHS.js → PBSSD2DM.js} +1 -1
- package/esm/checkbox/checkbox-store.d.ts +2 -2
- package/esm/collection/collection-store.d.ts +2 -2
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-store.d.ts +5 -5
- package/esm/combobox/combobox-store.js +16 -7
- package/esm/composite/composite-overflow-store.d.ts +2 -2
- package/esm/composite/composite-store.d.ts +3 -3
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.d.ts +2 -2
- package/esm/disclosure/disclosure-store.d.ts +2 -2
- package/esm/form/form-store.d.ts +4 -4
- package/esm/form/form-store.js +2 -2
- package/esm/form/types.d.ts +3 -3
- package/esm/hovercard/hovercard-store.d.ts +3 -3
- package/esm/menu/menu-bar-store.d.ts +2 -2
- package/esm/menu/menu-bar-store.js +4 -4
- package/esm/menu/menu-store.d.ts +6 -6
- package/esm/menu/menu-store.js +3 -3
- package/esm/menubar/menubar-store.d.ts +2 -2
- package/esm/menubar/menubar-store.js +4 -4
- package/esm/popover/popover-store.d.ts +3 -3
- package/esm/radio/radio-store.d.ts +3 -3
- package/esm/radio/radio-store.js +3 -3
- package/esm/select/select-store.d.ts +17 -9
- package/esm/select/select-store.js +15 -5
- package/esm/tab/tab-store.d.ts +7 -6
- package/esm/tab/tab-store.js +43 -10
- package/esm/tag/tag-store.d.ts +3 -3
- package/esm/tag/tag-store.js +3 -3
- package/esm/toolbar/toolbar-store.d.ts +2 -2
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.d.ts +2 -2
- package/esm/utils/dom.d.ts +1 -17
- package/esm/utils/dom.js +1 -5
- package/esm/utils/events.d.ts +1 -1
- package/esm/utils/events.js +17 -12
- package/esm/utils/focus.d.ts +1 -1
- package/esm/utils/focus.js +5 -7
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _B4AKUC4Scjs = require('../__chunks/B4AKUC4S.cjs');
|
|
5
|
+
require('../__chunks/3HYNC3XA.cjs');
|
|
6
|
+
require('../__chunks/4W3OYRR3.cjs');
|
|
7
7
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
8
8
|
require('../__chunks/B4LYZ4EM.cjs');
|
|
9
9
|
require('../__chunks/EEDWPDM2.cjs');
|
|
10
|
-
require('../__chunks/
|
|
10
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
11
11
|
require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.createMenubarStore =
|
|
14
|
+
exports.createMenubarStore = _B4AKUC4Scjs.createMenubarStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreProps } from "../utils/store.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a menubar store.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreProps } from "../utils/store.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a menubar store.
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
type BasePlacement = "top" | "bottom" | "left" | "right";
|
|
5
5
|
type Placement = BasePlacement | `${BasePlacement}-start` | `${BasePlacement}-end`;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
type BasePlacement = "top" | "bottom" | "left" | "right";
|
|
5
5
|
type Placement = BasePlacement | `${BasePlacement}-start` | `${BasePlacement}-end`;
|
|
6
6
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
|
|
5
|
+
require('../__chunks/4W3OYRR3.cjs');
|
|
6
6
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
13
|
-
require('../__chunks/
|
|
13
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ function createRadioStore(_a = {}) {
|
|
|
22
22
|
var props = _AV6KTKLEcjs.__objRest.call(void 0, _a, []);
|
|
23
23
|
var _a2;
|
|
24
24
|
const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
|
|
25
|
-
const composite =
|
|
25
|
+
const composite = _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
26
26
|
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
27
|
}));
|
|
28
28
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a radio store.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a radio store.
|
|
6
6
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
|
|
5
|
+
require('../__chunks/4W3OYRR3.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
|
|
@@ -23,7 +23,7 @@ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
26
|
-
require('../__chunks/
|
|
26
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -53,7 +53,7 @@ function createSelectStore(_a = {}) {
|
|
|
53
53
|
);
|
|
54
54
|
_B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
55
55
|
const syncState = store.getState();
|
|
56
|
-
const composite =
|
|
56
|
+
const composite = _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
57
57
|
store,
|
|
58
58
|
virtualFocus: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
59
59
|
props.virtualFocus,
|
|
@@ -98,8 +98,9 @@ function createSelectStore(_a = {}) {
|
|
|
98
98
|
syncState.setValueOnMove,
|
|
99
99
|
false
|
|
100
100
|
),
|
|
101
|
+
labelElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.labelElement, null),
|
|
101
102
|
selectElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.selectElement, null),
|
|
102
|
-
|
|
103
|
+
listElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.listElement, null)
|
|
103
104
|
});
|
|
104
105
|
const select = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
105
106
|
_B4LYZ4EMcjs.setup.call(void 0,
|
|
@@ -117,6 +118,14 @@ function createSelectStore(_a = {}) {
|
|
|
117
118
|
select.setState("value", item.value);
|
|
118
119
|
})
|
|
119
120
|
);
|
|
121
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
122
|
+
select,
|
|
123
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, select, ["mounted"], (state) => {
|
|
124
|
+
if (state.mounted)
|
|
125
|
+
return;
|
|
126
|
+
select.setState("activeId", initialState.activeId);
|
|
127
|
+
})
|
|
128
|
+
);
|
|
120
129
|
_B4LYZ4EMcjs.setup.call(void 0,
|
|
121
130
|
select,
|
|
122
131
|
() => _B4LYZ4EMcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
|
|
@@ -157,8 +166,9 @@ function createSelectStore(_a = {}) {
|
|
|
157
166
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), popover), select), {
|
|
158
167
|
combobox,
|
|
159
168
|
setValue: (value) => select.setState("value", value),
|
|
169
|
+
setLabelElement: (element) => select.setState("labelElement", element),
|
|
160
170
|
setSelectElement: (element) => select.setState("selectElement", element),
|
|
161
|
-
|
|
171
|
+
setListElement: (element) => select.setState("listElement", element)
|
|
162
172
|
});
|
|
163
173
|
}
|
|
164
174
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
3
|
-
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.
|
|
4
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
5
|
-
import type { PickRequired, SetState } from "../utils/types.
|
|
1
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
2
|
+
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
3
|
+
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
|
|
4
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
5
|
+
import type { PickRequired, SetState } from "../utils/types.ts";
|
|
6
6
|
type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
|
|
7
7
|
export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
8
8
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
@@ -46,6 +46,10 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
46
46
|
* @default false
|
|
47
47
|
*/
|
|
48
48
|
setValueOnMove: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The select label element.
|
|
51
|
+
*/
|
|
52
|
+
labelElement: HTMLElement | null;
|
|
49
53
|
/**
|
|
50
54
|
* The select button element.
|
|
51
55
|
*
|
|
@@ -54,9 +58,9 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
54
58
|
*/
|
|
55
59
|
selectElement: HTMLElement | null;
|
|
56
60
|
/**
|
|
57
|
-
* The select
|
|
61
|
+
* The select list element.
|
|
58
62
|
*/
|
|
59
|
-
|
|
63
|
+
listElement: HTMLElement | null;
|
|
60
64
|
}
|
|
61
65
|
export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
|
|
62
66
|
/**
|
|
@@ -68,14 +72,18 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
|
|
|
68
72
|
* store.setValue((value) => value === "Apple" ? "Banana" : "Apple"));
|
|
69
73
|
*/
|
|
70
74
|
setValue: SetState<SelectStoreState<T>["value"]>;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the `labelElement` state.
|
|
77
|
+
*/
|
|
78
|
+
setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
|
|
71
79
|
/**
|
|
72
80
|
* Sets the `selectElement` state.
|
|
73
81
|
*/
|
|
74
82
|
setSelectElement: SetState<SelectStoreState<T>["selectElement"]>;
|
|
75
83
|
/**
|
|
76
|
-
* Sets the `
|
|
84
|
+
* Sets the `listElement` state.
|
|
77
85
|
*/
|
|
78
|
-
|
|
86
|
+
setListElement: SetState<SelectStoreState<T>["listElement"]>;
|
|
79
87
|
}
|
|
80
88
|
export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
|
|
81
89
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
3
|
-
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.
|
|
4
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
5
|
-
import type { PickRequired, SetState } from "../utils/types.
|
|
1
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
2
|
+
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
3
|
+
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
|
|
4
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
5
|
+
import type { PickRequired, SetState } from "../utils/types.ts";
|
|
6
6
|
type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
|
|
7
7
|
export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
8
8
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
@@ -46,6 +46,10 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
46
46
|
* @default false
|
|
47
47
|
*/
|
|
48
48
|
setValueOnMove: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The select label element.
|
|
51
|
+
*/
|
|
52
|
+
labelElement: HTMLElement | null;
|
|
49
53
|
/**
|
|
50
54
|
* The select button element.
|
|
51
55
|
*
|
|
@@ -54,9 +58,9 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
54
58
|
*/
|
|
55
59
|
selectElement: HTMLElement | null;
|
|
56
60
|
/**
|
|
57
|
-
* The select
|
|
61
|
+
* The select list element.
|
|
58
62
|
*/
|
|
59
|
-
|
|
63
|
+
listElement: HTMLElement | null;
|
|
60
64
|
}
|
|
61
65
|
export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
|
|
62
66
|
/**
|
|
@@ -68,14 +72,18 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
|
|
|
68
72
|
* store.setValue((value) => value === "Apple" ? "Banana" : "Apple"));
|
|
69
73
|
*/
|
|
70
74
|
setValue: SetState<SelectStoreState<T>["value"]>;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the `labelElement` state.
|
|
77
|
+
*/
|
|
78
|
+
setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
|
|
71
79
|
/**
|
|
72
80
|
* Sets the `selectElement` state.
|
|
73
81
|
*/
|
|
74
82
|
setSelectElement: SetState<SelectStoreState<T>["selectElement"]>;
|
|
75
83
|
/**
|
|
76
|
-
* Sets the `
|
|
84
|
+
* Sets the `listElement` state.
|
|
77
85
|
*/
|
|
78
|
-
|
|
86
|
+
setListElement: SetState<SelectStoreState<T>["listElement"]>;
|
|
79
87
|
}
|
|
80
88
|
export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
|
|
81
89
|
/**
|
package/cjs/tab/tab-store.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _4W3OYRR3cjs = require('../__chunks/4W3OYRR3.cjs');
|
|
8
8
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -16,8 +16,9 @@ require('../__chunks/ULSPM3Y3.cjs');
|
|
|
16
16
|
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
20
|
-
require('../__chunks/
|
|
21
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
|
|
@@ -38,6 +39,8 @@ function createTabStore(_a = {}) {
|
|
|
38
39
|
"renderedItems",
|
|
39
40
|
"moves",
|
|
40
41
|
"orientation",
|
|
42
|
+
"virtualFocus",
|
|
43
|
+
"includesBaseElement",
|
|
41
44
|
"baseElement",
|
|
42
45
|
"focusLoop",
|
|
43
46
|
"focusShift",
|
|
@@ -49,7 +52,17 @@ function createTabStore(_a = {}) {
|
|
|
49
52
|
_B4LYZ4EMcjs.omit.call(void 0, combobox, independentKeys)
|
|
50
53
|
);
|
|
51
54
|
const syncState = store == null ? void 0 : store.getState();
|
|
52
|
-
const composite =
|
|
55
|
+
const composite = _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
56
|
+
store,
|
|
57
|
+
// We need to explicitly set the default value of `includesBaseElement` to
|
|
58
|
+
// `false` since we don't want the composite store to default it to `true`
|
|
59
|
+
// when the activeId state is null, which could be the case when rendering
|
|
60
|
+
// combobox with tab.
|
|
61
|
+
includesBaseElement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
62
|
+
props.includesBaseElement,
|
|
63
|
+
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
64
|
+
false
|
|
65
|
+
),
|
|
53
66
|
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
54
67
|
props.orientation,
|
|
55
68
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -57,13 +70,12 @@ function createTabStore(_a = {}) {
|
|
|
57
70
|
),
|
|
58
71
|
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
59
72
|
}));
|
|
60
|
-
const panels =
|
|
73
|
+
const panels = _4W3OYRR3cjs.createCollectionStore.call(void 0, );
|
|
61
74
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
62
75
|
selectedId: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
63
76
|
props.selectedId,
|
|
64
77
|
syncState == null ? void 0 : syncState.selectedId,
|
|
65
|
-
props.defaultSelectedId
|
|
66
|
-
void 0
|
|
78
|
+
props.defaultSelectedId
|
|
67
79
|
),
|
|
68
80
|
selectOnMove: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
69
81
|
props.selectOnMove,
|
|
@@ -92,11 +104,11 @@ function createTabStore(_a = {}) {
|
|
|
92
104
|
);
|
|
93
105
|
_B4LYZ4EMcjs.setup.call(void 0,
|
|
94
106
|
tab,
|
|
95
|
-
() => _B4LYZ4EMcjs.batch.call(void 0,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
107
|
+
() => _B4LYZ4EMcjs.batch.call(void 0, tab, ["selectedId"], (state, prev) => {
|
|
108
|
+
if (parentComposite && state.selectedId === prev.selectedId)
|
|
109
|
+
return;
|
|
110
|
+
tab.setState("activeId", state.selectedId);
|
|
111
|
+
})
|
|
100
112
|
);
|
|
101
113
|
_B4LYZ4EMcjs.setup.call(void 0,
|
|
102
114
|
tab,
|
|
@@ -137,6 +149,27 @@ function createTabStore(_a = {}) {
|
|
|
137
149
|
});
|
|
138
150
|
})
|
|
139
151
|
);
|
|
152
|
+
let selectedIdFromSelectedValue = null;
|
|
153
|
+
_B4LYZ4EMcjs.setup.call(void 0, tab, () => {
|
|
154
|
+
const backupSelectedId = () => {
|
|
155
|
+
selectedIdFromSelectedValue = tab.getState().selectedId;
|
|
156
|
+
};
|
|
157
|
+
const restoreSelectedId = () => {
|
|
158
|
+
tab.setState("selectedId", selectedIdFromSelectedValue);
|
|
159
|
+
};
|
|
160
|
+
if (parentComposite && "setSelectElement" in parentComposite) {
|
|
161
|
+
return _EEDWPDM2cjs.chain.call(void 0,
|
|
162
|
+
_B4LYZ4EMcjs.sync.call(void 0, parentComposite, ["value"], backupSelectedId),
|
|
163
|
+
_B4LYZ4EMcjs.sync.call(void 0, parentComposite, ["open"], restoreSelectedId)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
if (!combobox)
|
|
167
|
+
return;
|
|
168
|
+
return _EEDWPDM2cjs.chain.call(void 0,
|
|
169
|
+
_B4LYZ4EMcjs.sync.call(void 0, combobox, ["selectedValue"], backupSelectedId),
|
|
170
|
+
_B4LYZ4EMcjs.sync.call(void 0, combobox, ["open"], restoreSelectedId)
|
|
171
|
+
);
|
|
172
|
+
});
|
|
140
173
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), tab), {
|
|
141
174
|
panels,
|
|
142
175
|
setSelectedId: (id) => tab.setState("selectedId", id),
|
package/cjs/tab/tab-store.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.
|
|
2
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
3
|
-
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
1
|
+
import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.ts";
|
|
2
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
3
|
+
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
4
|
+
import type { SelectStore } from "../select/select-store.ts";
|
|
5
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
6
|
+
import type { SetState } from "../utils/types.ts";
|
|
6
7
|
export declare function createTabStore({ composite: parentComposite, combobox, ...props }?: TabStoreProps): TabStore;
|
|
7
8
|
export interface TabStoreItem extends CompositeStoreItem {
|
|
8
9
|
dimmed?: boolean;
|
|
@@ -85,7 +86,7 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
85
86
|
* [Select](https://ariakit.org/components/select). The stores will share the
|
|
86
87
|
* same state.
|
|
87
88
|
*/
|
|
88
|
-
composite?: CompositeStore | null;
|
|
89
|
+
composite?: CompositeStore | SelectStore | null;
|
|
89
90
|
/**
|
|
90
91
|
* A reference to a [combobox
|
|
91
92
|
* store](https://ariakit.org/reference/use-combobox-store). This is used when
|
package/cjs/tab/tab-store.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.
|
|
2
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
3
|
-
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
1
|
+
import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.ts";
|
|
2
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
3
|
+
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
4
|
+
import type { SelectStore } from "../select/select-store.ts";
|
|
5
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
6
|
+
import type { SetState } from "../utils/types.ts";
|
|
6
7
|
export declare function createTabStore({ composite: parentComposite, combobox, ...props }?: TabStoreProps): TabStore;
|
|
7
8
|
export interface TabStoreItem extends CompositeStoreItem {
|
|
8
9
|
dimmed?: boolean;
|
|
@@ -85,7 +86,7 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
85
86
|
* [Select](https://ariakit.org/components/select). The stores will share the
|
|
86
87
|
* same state.
|
|
87
88
|
*/
|
|
88
|
-
composite?: CompositeStore | null;
|
|
89
|
+
composite?: CompositeStore | SelectStore | null;
|
|
89
90
|
/**
|
|
90
91
|
* A reference to a [combobox
|
|
91
92
|
* store](https://ariakit.org/reference/use-combobox-store). This is used when
|
package/cjs/tag/tag-store.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
|
|
5
|
+
require('../__chunks/4W3OYRR3.cjs');
|
|
6
6
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
19
|
-
require('../__chunks/
|
|
19
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
26
26
|
function createTagStore(props = {}) {
|
|
27
27
|
var _a;
|
|
28
28
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
29
|
-
const composite =
|
|
29
|
+
const composite = _3HYNC3XAcjs.createCompositeStore.call(void 0, props);
|
|
30
30
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
31
31
|
inputElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.inputElement, null),
|
|
32
32
|
labelElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.labelElement, null),
|
package/cjs/tag/tag-store.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a tag store.
|
|
6
6
|
*/
|
package/cjs/tag/tag-store.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a tag store.
|
|
6
6
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
|
|
5
|
+
require('../__chunks/4W3OYRR3.cjs');
|
|
6
6
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
7
7
|
require('../__chunks/B4LYZ4EM.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
11
|
-
require('../__chunks/
|
|
11
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
18
18
|
function createToolbarStore(props = {}) {
|
|
19
19
|
var _a;
|
|
20
20
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
21
|
-
return
|
|
21
|
+
return _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
22
|
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
23
23
|
props.orientation,
|
|
24
24
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a toolbar store.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a toolbar store.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
1
|
+
import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a tooltip store.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
1
|
+
import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a tooltip store.
|
|
5
5
|
*/
|
package/cjs/utils/dom.cjs
CHANGED
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var _IMYW2UACcjs = require('../__chunks/IMYW2UAC.cjs');
|
|
21
|
+
var _Q2WCPTYScjs = require('../__chunks/Q2WCPTYS.cjs');
|
|
24
22
|
require('../__chunks/AV6KTKLE.cjs');
|
|
25
23
|
|
|
26
24
|
|
|
@@ -41,6 +39,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
41
39
|
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
exports.canUseDOM = _IMYW2UACcjs.canUseDOM; exports.closest = _IMYW2UACcjs.closest; exports.contains = _IMYW2UACcjs.contains; exports.getActiveElement = _IMYW2UACcjs.getActiveElement; exports.getDocument = _IMYW2UACcjs.getDocument; exports.getPopupItemRole = _IMYW2UACcjs.getPopupItemRole; exports.getPopupRole = _IMYW2UACcjs.getPopupRole; exports.getScrollingElement = _IMYW2UACcjs.getScrollingElement; exports.getTextboxSelection = _IMYW2UACcjs.getTextboxSelection; exports.getTextboxValue = _IMYW2UACcjs.getTextboxValue; exports.getWindow = _IMYW2UACcjs.getWindow; exports.isButton = _IMYW2UACcjs.isButton; exports.isFrame = _IMYW2UACcjs.isFrame; exports.isPartiallyHidden = _IMYW2UACcjs.isPartiallyHidden; exports.isTextField = _IMYW2UACcjs.isTextField; exports.isTextbox = _IMYW2UACcjs.isTextbox; exports.isVisible = _IMYW2UACcjs.isVisible; exports.matches = _IMYW2UACcjs.matches; exports.scrollIntoViewIfNeeded = _IMYW2UACcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _IMYW2UACcjs.setSelectionRange;
|
|
42
|
+
exports.canUseDOM = _Q2WCPTYScjs.canUseDOM; exports.contains = _Q2WCPTYScjs.contains; exports.getActiveElement = _Q2WCPTYScjs.getActiveElement; exports.getDocument = _Q2WCPTYScjs.getDocument; exports.getPopupItemRole = _Q2WCPTYScjs.getPopupItemRole; exports.getPopupRole = _Q2WCPTYScjs.getPopupRole; exports.getScrollingElement = _Q2WCPTYScjs.getScrollingElement; exports.getTextboxSelection = _Q2WCPTYScjs.getTextboxSelection; exports.getTextboxValue = _Q2WCPTYScjs.getTextboxValue; exports.getWindow = _Q2WCPTYScjs.getWindow; exports.isButton = _Q2WCPTYScjs.isButton; exports.isFrame = _Q2WCPTYScjs.isFrame; exports.isPartiallyHidden = _Q2WCPTYScjs.isPartiallyHidden; exports.isTextField = _Q2WCPTYScjs.isTextField; exports.isTextbox = _Q2WCPTYScjs.isTextbox; exports.isVisible = _Q2WCPTYScjs.isVisible; exports.scrollIntoViewIfNeeded = _Q2WCPTYScjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _Q2WCPTYScjs.setSelectionRange;
|
package/cjs/utils/dom.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AriaHasPopup, AriaRole } from "./types.
|
|
1
|
+
import type { AriaHasPopup, AriaRole } from "./types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* It's `true` if it is running in a browser environment or `false` if it is not
|
|
4
4
|
* (SSR).
|
|
@@ -45,26 +45,10 @@ export declare function isButton(element: {
|
|
|
45
45
|
tagName: string;
|
|
46
46
|
type?: string;
|
|
47
47
|
}): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Ponyfill for `Element.prototype.matches`
|
|
50
|
-
*
|
|
51
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
52
|
-
*/
|
|
53
|
-
export declare function matches(element: Element, selectors: string): boolean;
|
|
54
48
|
/**
|
|
55
49
|
* Checks if the element is visible or not.
|
|
56
50
|
*/
|
|
57
51
|
export declare function isVisible(element: Element): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Ponyfill for `Element.prototype.closest`
|
|
60
|
-
* @example
|
|
61
|
-
* closest(document.getElementById("id"), "div");
|
|
62
|
-
* // same as
|
|
63
|
-
* document.getElementById("id").closest("div");
|
|
64
|
-
*/
|
|
65
|
-
export declare function closest<K extends keyof HTMLElementTagNameMap>(element: Element, selectors: K): HTMLElementTagNameMap[K];
|
|
66
|
-
export declare function closest<K extends keyof SVGElementTagNameMap>(element: Element, selectors: K): SVGElementTagNameMap[K];
|
|
67
|
-
export declare function closest<T extends Element = Element>(element: Element, selectors: string): T | null;
|
|
68
52
|
/**
|
|
69
53
|
* Check whether the given element is a text field, where text field is defined
|
|
70
54
|
* by the ability to select within the input.
|