@box/combobox-with-api 1.42.33 → 1.42.34
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/dist/chunks/combobox-with-api-error.js +18 -0
- package/dist/chunks/combobox-with-api-pagination.js +168 -0
- package/dist/chunks/combobox-with-api-pagination2.js +229 -0
- package/dist/chunks/combobox-with-api-tree-view.js +423 -0
- package/dist/chunks/dynamic-loading-tree.js +299 -326
- package/dist/chunks/treeReducer.js +60 -78
- package/dist/esm/index.js +6 -16
- package/dist/esm/lib/components/combobox-with-api/combobox-with-api-container.js +47 -52
- package/dist/esm/lib/components/combobox-with-api/combobox-with-api-error.js +2 -26
- package/dist/esm/lib/components/combobox-with-api/combobox-with-api.js +16 -36
- package/dist/esm/lib/components/combobox-with-api/messages.js +6 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +2 -214
- package/dist/esm/lib/components/combobox-with-api-pagination/index.js +3 -205
- package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +31 -33
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +4 -6
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +113 -128
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +8 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +32 -34
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +72 -82
- package/dist/esm/lib/components/combobox-with-api-tree-view/combobox-with-api-tree-view.js +133 -174
- package/dist/esm/lib/components/combobox-with-api-tree-view/dynamic-loading-tree.js +2 -10
- package/dist/esm/lib/components/combobox-with-api-tree-view/index.js +3 -464
- package/dist/esm/lib/components/combobox-with-api-tree-view/tree-utils.js +17 -26
- package/dist/esm/lib/components/combobox-with-api-tree-view/treeReducer.js +2 -6
- package/dist/styles/combobox-with-api-error.css +1 -1
- package/dist/styles/combobox-with-api-pagination.css +1 -1
- package/dist/styles/dynamic-loading-tree.css +1 -1
- package/package.json +7 -7
|
@@ -1,205 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
marker: a.marker,
|
|
5
|
-
options: a.options.map(({
|
|
6
|
-
value: e,
|
|
7
|
-
displayValue: l
|
|
8
|
-
}) => l ? {
|
|
9
|
-
displayValue: l,
|
|
10
|
-
value: e
|
|
11
|
-
} : {
|
|
12
|
-
value: e
|
|
13
|
-
})
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
const r = [{
|
|
17
|
-
value: "0",
|
|
18
|
-
displayValue: "Alabama"
|
|
19
|
-
}, {
|
|
20
|
-
value: "1",
|
|
21
|
-
displayValue: "Alaska"
|
|
22
|
-
}, {
|
|
23
|
-
value: "2",
|
|
24
|
-
displayValue: "Arizona"
|
|
25
|
-
}, {
|
|
26
|
-
value: "3",
|
|
27
|
-
displayValue: "Arkansas"
|
|
28
|
-
}, {
|
|
29
|
-
value: "4",
|
|
30
|
-
displayValue: "California"
|
|
31
|
-
}, {
|
|
32
|
-
value: "5",
|
|
33
|
-
displayValue: "Colorado"
|
|
34
|
-
}, {
|
|
35
|
-
value: "6",
|
|
36
|
-
displayValue: "Connecticut"
|
|
37
|
-
}, {
|
|
38
|
-
value: "7",
|
|
39
|
-
displayValue: "Delaware"
|
|
40
|
-
}, {
|
|
41
|
-
value: "8",
|
|
42
|
-
displayValue: "Florida"
|
|
43
|
-
}, {
|
|
44
|
-
value: "9",
|
|
45
|
-
displayValue: "Georgia"
|
|
46
|
-
}, {
|
|
47
|
-
value: "10",
|
|
48
|
-
displayValue: "Hawaii"
|
|
49
|
-
}, {
|
|
50
|
-
value: "11",
|
|
51
|
-
displayValue: "Idaho"
|
|
52
|
-
}, {
|
|
53
|
-
value: "12",
|
|
54
|
-
displayValue: "Illinois"
|
|
55
|
-
}, {
|
|
56
|
-
value: "13",
|
|
57
|
-
displayValue: "Indiana"
|
|
58
|
-
}, {
|
|
59
|
-
value: "14",
|
|
60
|
-
displayValue: "Iowa"
|
|
61
|
-
}, {
|
|
62
|
-
value: "15",
|
|
63
|
-
displayValue: "Kansas"
|
|
64
|
-
}, {
|
|
65
|
-
value: "16",
|
|
66
|
-
displayValue: "Kentucky"
|
|
67
|
-
}, {
|
|
68
|
-
value: "17",
|
|
69
|
-
displayValue: "Louisiana"
|
|
70
|
-
}, {
|
|
71
|
-
value: "18",
|
|
72
|
-
displayValue: "Maine"
|
|
73
|
-
}, {
|
|
74
|
-
value: "19",
|
|
75
|
-
displayValue: "Maryland"
|
|
76
|
-
}, {
|
|
77
|
-
value: "20",
|
|
78
|
-
displayValue: "Massachusetts"
|
|
79
|
-
}, {
|
|
80
|
-
value: "21",
|
|
81
|
-
displayValue: "Michigan"
|
|
82
|
-
}, {
|
|
83
|
-
value: "22",
|
|
84
|
-
displayValue: "Minnesota"
|
|
85
|
-
}, {
|
|
86
|
-
value: "23",
|
|
87
|
-
displayValue: "Mississippi"
|
|
88
|
-
}, {
|
|
89
|
-
value: "24",
|
|
90
|
-
displayValue: "Missouri"
|
|
91
|
-
}, {
|
|
92
|
-
value: "25",
|
|
93
|
-
displayValue: "Montana"
|
|
94
|
-
}, {
|
|
95
|
-
value: "26",
|
|
96
|
-
displayValue: "Nebraska"
|
|
97
|
-
}, {
|
|
98
|
-
value: "27",
|
|
99
|
-
displayValue: "Nevada"
|
|
100
|
-
}, {
|
|
101
|
-
value: "28",
|
|
102
|
-
displayValue: "New Hampshire"
|
|
103
|
-
}, {
|
|
104
|
-
value: "29",
|
|
105
|
-
displayValue: "New Jersey"
|
|
106
|
-
}, {
|
|
107
|
-
value: "30",
|
|
108
|
-
displayValue: "New Mexico"
|
|
109
|
-
}, {
|
|
110
|
-
value: "31",
|
|
111
|
-
displayValue: "New York"
|
|
112
|
-
}, {
|
|
113
|
-
value: "32",
|
|
114
|
-
displayValue: "North Carolina"
|
|
115
|
-
}, {
|
|
116
|
-
value: "33",
|
|
117
|
-
displayValue: "North Dakota"
|
|
118
|
-
}, {
|
|
119
|
-
value: "34",
|
|
120
|
-
displayValue: "Ohio"
|
|
121
|
-
}, {
|
|
122
|
-
value: "35",
|
|
123
|
-
displayValue: "Oklahoma"
|
|
124
|
-
}, {
|
|
125
|
-
value: "36",
|
|
126
|
-
displayValue: "Oregon"
|
|
127
|
-
}, {
|
|
128
|
-
value: "37",
|
|
129
|
-
displayValue: "Pennsylvania"
|
|
130
|
-
}, {
|
|
131
|
-
value: "38",
|
|
132
|
-
displayValue: "Rhode Island"
|
|
133
|
-
}, {
|
|
134
|
-
value: "39",
|
|
135
|
-
displayValue: "South Carolina"
|
|
136
|
-
}, {
|
|
137
|
-
value: "40",
|
|
138
|
-
displayValue: "South Dakota"
|
|
139
|
-
}, {
|
|
140
|
-
value: "41",
|
|
141
|
-
displayValue: "Tennessee"
|
|
142
|
-
}, {
|
|
143
|
-
value: "42",
|
|
144
|
-
displayValue: "Texas"
|
|
145
|
-
}, {
|
|
146
|
-
value: "43",
|
|
147
|
-
displayValue: "Utah"
|
|
148
|
-
}, {
|
|
149
|
-
value: "44",
|
|
150
|
-
displayValue: "Vermont"
|
|
151
|
-
}, {
|
|
152
|
-
value: "45",
|
|
153
|
-
displayValue: "Virginia"
|
|
154
|
-
}, {
|
|
155
|
-
value: "46",
|
|
156
|
-
displayValue: "Washington"
|
|
157
|
-
}, {
|
|
158
|
-
value: "47",
|
|
159
|
-
displayValue: "West Virginia"
|
|
160
|
-
}, {
|
|
161
|
-
value: "48",
|
|
162
|
-
displayValue: "Wisconsin"
|
|
163
|
-
}, {
|
|
164
|
-
value: "49",
|
|
165
|
-
displayValue: "Wyoming"
|
|
166
|
-
}], h = (a) => r.find((e) => e.displayValue === a), n = 10, c = (a, e) => {
|
|
167
|
-
const l = (parseInt(a, 10) || 0) * n, u = l + n;
|
|
168
|
-
return e.slice(l, u).map(({
|
|
169
|
-
displayValue: i,
|
|
170
|
-
value: t
|
|
171
|
-
}) => ({
|
|
172
|
-
displayValue: i,
|
|
173
|
-
value: t
|
|
174
|
-
}));
|
|
175
|
-
}, m = (a, e) => (parseInt(a, 10) || 0) * n + n < e.length ? ((parseInt(a, 10) || 0) + 1).toString() : void 0, w = /* @__PURE__ */ (() => {
|
|
176
|
-
let a = 0;
|
|
177
|
-
return async ({
|
|
178
|
-
delay: e,
|
|
179
|
-
signal: l,
|
|
180
|
-
searchInput: u,
|
|
181
|
-
marker: i,
|
|
182
|
-
failOnLoadMore: t,
|
|
183
|
-
failOnLoadMoreTimes: d = Number.MAX_SAFE_INTEGER,
|
|
184
|
-
options: p = r
|
|
185
|
-
}) => {
|
|
186
|
-
if (e && await new Promise((s) => setTimeout(s, e)), l.aborted)
|
|
187
|
-
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
188
|
-
if (t && i != null && a < d)
|
|
189
|
-
return a += 1, Promise.reject();
|
|
190
|
-
const o = p.filter(({
|
|
191
|
-
displayValue: s,
|
|
192
|
-
value: v
|
|
193
|
-
}) => s ? s.toLowerCase().includes(u.toLowerCase()) : v.toLowerCase().includes(u.toLowerCase())), y = Promise.resolve({
|
|
194
|
-
marker: m(i, o),
|
|
195
|
-
options: c(i, o)
|
|
196
|
-
});
|
|
197
|
-
return V(await y);
|
|
198
|
-
};
|
|
199
|
-
})();
|
|
200
|
-
export {
|
|
201
|
-
x as ComboboxWithApiPagination,
|
|
202
|
-
h as findState,
|
|
203
|
-
w as mockFetcher,
|
|
204
|
-
r as states
|
|
205
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/combobox-with-api-pagination.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "../../../../chunks/combobox-with-api-pagination2.js";
|
|
3
|
+
export { e as ComboboxWithApiPagination, r as findState, t as mockFetcher, n as states };
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import { defineMessages as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
var t = e({
|
|
3
|
+
loadingResultsErrorAction: {
|
|
4
|
+
id: "comboboxWithApiPagination.errorAction",
|
|
5
|
+
defaultMessage: "Reload"
|
|
6
|
+
},
|
|
7
|
+
loadingResultsErrorMessage: {
|
|
8
|
+
id: "comboboxWithApiPagination.errorMessage",
|
|
9
|
+
defaultMessage: "Failed to load options"
|
|
10
|
+
},
|
|
11
|
+
loadingResultsErrorIconLabel: {
|
|
12
|
+
id: "comboboxWithApiPagination.errorIconLabel",
|
|
13
|
+
defaultMessage: "Error"
|
|
14
|
+
},
|
|
15
|
+
loadingAriaLabel: {
|
|
16
|
+
id: "comboboxWithApiPagination.loadingAriaLabel",
|
|
17
|
+
defaultMessage: "Loading..."
|
|
18
|
+
},
|
|
19
|
+
loadingMoreAriaLabel: {
|
|
20
|
+
id: "comboboxWithApiPagination.loadingMoreAriaLabel",
|
|
21
|
+
defaultMessage: "Loading more..."
|
|
22
|
+
},
|
|
23
|
+
noResults: {
|
|
24
|
+
id: "comboboxWithApiPagination.noResults",
|
|
25
|
+
defaultMessage: "No results found"
|
|
26
|
+
},
|
|
27
|
+
clearButtonAriaLabel: {
|
|
28
|
+
id: "comboboxWithApiPagination.clearButtonAriaLabel",
|
|
29
|
+
defaultMessage: "Clear input and selection"
|
|
30
|
+
}
|
|
31
31
|
});
|
|
32
|
-
export {
|
|
33
|
-
e as default
|
|
34
|
-
};
|
|
32
|
+
export { t as default };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
export {
|
|
5
|
-
C as RequestStates
|
|
6
|
-
};
|
|
1
|
+
var e = /* @__PURE__ */ function(e) {
|
|
2
|
+
return e.NOT_STARTED = "NOT_STARTED", e.IN_PROGRESS = "IN_PROGRESS", e.ERROR = "ERROR", e.SUCCESS = "SUCCESS", e.CANCELLED = "CANCELLED", e;
|
|
3
|
+
}({});
|
|
4
|
+
export { e as RequestStates };
|
|
@@ -1,136 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
requestState: u.IN_PROGRESS,
|
|
50
|
-
abortController: e.abortController
|
|
51
|
-
};
|
|
52
|
-
default:
|
|
53
|
-
throw new Error(`Invalid action type "${e.type}"`);
|
|
54
|
-
}
|
|
1
|
+
import { RequestStates as e } from "./request.js";
|
|
2
|
+
import { isAbortError as t } from "./utils/is-abort-error.js";
|
|
3
|
+
import { useReducer as n } from "react";
|
|
4
|
+
var r = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.LOAD_MORE = "LOAD_MORE", e.RELOAD = "RELOAD", e.SEARCH = "SEARCH", e.SET_ERROR = "SET_ERROR", e.SET_LOADING = "SET_LOADING", e;
|
|
6
|
+
}(r || {});
|
|
7
|
+
function i(t, n) {
|
|
8
|
+
switch (n.type) {
|
|
9
|
+
case r.LOAD_MORE: return {
|
|
10
|
+
...t,
|
|
11
|
+
abortController: n.abortController,
|
|
12
|
+
error: null,
|
|
13
|
+
items: [...t.items, ...n.items],
|
|
14
|
+
marker: n.marker,
|
|
15
|
+
requestState: e.SUCCESS
|
|
16
|
+
};
|
|
17
|
+
case r.RELOAD: return n.abortController === t.abortController ? {
|
|
18
|
+
...t,
|
|
19
|
+
abortController: null,
|
|
20
|
+
error: null,
|
|
21
|
+
items: [...n.items],
|
|
22
|
+
marker: n.marker,
|
|
23
|
+
requestState: e.SUCCESS,
|
|
24
|
+
searchInput: ""
|
|
25
|
+
} : t;
|
|
26
|
+
case r.SEARCH: return {
|
|
27
|
+
...t,
|
|
28
|
+
abortController: n.abortController,
|
|
29
|
+
error: null,
|
|
30
|
+
items: [...n.items],
|
|
31
|
+
marker: n.marker,
|
|
32
|
+
requestState: e.SUCCESS,
|
|
33
|
+
searchInput: n.searchInput ?? t.searchInput
|
|
34
|
+
};
|
|
35
|
+
case r.SET_ERROR: return {
|
|
36
|
+
...t,
|
|
37
|
+
items: r.LOAD_MORE ? t.items : [],
|
|
38
|
+
error: n.error,
|
|
39
|
+
requestState: e.ERROR
|
|
40
|
+
};
|
|
41
|
+
case r.SET_LOADING: return {
|
|
42
|
+
...t,
|
|
43
|
+
requestInitiator: n.requestInitiator,
|
|
44
|
+
requestState: e.IN_PROGRESS,
|
|
45
|
+
abortController: n.abortController
|
|
46
|
+
};
|
|
47
|
+
default: throw Error(`Invalid action type "${n.type}"`);
|
|
48
|
+
}
|
|
55
49
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
50
|
+
function a(t, n) {
|
|
51
|
+
return t.type === r.SEARCH && n.requestState === e.IN_PROGRESS;
|
|
58
52
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
53
|
+
function o(t, n) {
|
|
54
|
+
return n.requestInitiator === r.LOAD_MORE && n.requestState === e.IN_PROGRESS && t.type === r.LOAD_MORE;
|
|
61
55
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
56
|
+
function s(e, t) {
|
|
57
|
+
return a(e, t) || o(e, t);
|
|
64
58
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
59
|
+
function c(e, t) {
|
|
60
|
+
a(e, t) && t.abortController.abort(), o(e, t) && e.abortController?.abort();
|
|
67
61
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
62
|
+
function l(e, t) {
|
|
63
|
+
return o(e, t);
|
|
70
64
|
}
|
|
71
|
-
async function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
65
|
+
async function u(e, n, i, a) {
|
|
66
|
+
let o = new AbortController();
|
|
67
|
+
if (s(e, i) && c(e, i), !l(e, i)) {
|
|
68
|
+
a({
|
|
69
|
+
type: r.SET_LOADING,
|
|
70
|
+
requestInitiator: e.type,
|
|
71
|
+
abortController: o
|
|
72
|
+
});
|
|
73
|
+
try {
|
|
74
|
+
let t = await n({
|
|
75
|
+
items: i.items.slice(),
|
|
76
|
+
signal: o.signal,
|
|
77
|
+
marker: e.type === r.LOAD_MORE ? i.marker : null,
|
|
78
|
+
searchInput: e.searchInput ?? i.searchInput
|
|
79
|
+
}), s = t.searchInput ?? e.searchInput ?? i.searchInput;
|
|
80
|
+
a({
|
|
81
|
+
type: e.type,
|
|
82
|
+
...t,
|
|
83
|
+
searchInput: s,
|
|
84
|
+
abortController: o
|
|
85
|
+
});
|
|
86
|
+
} catch (e) {
|
|
87
|
+
if (t(e)) return;
|
|
88
|
+
a({
|
|
89
|
+
type: r.SET_ERROR,
|
|
90
|
+
error: e,
|
|
91
|
+
abortController: o
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
102
95
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
searchInput: t.searchInput,
|
|
128
|
-
search: (o) => R({
|
|
129
|
-
type: s.SEARCH,
|
|
130
|
-
searchInput: o
|
|
131
|
-
}, e, t, n)
|
|
132
|
-
};
|
|
96
|
+
function d(t) {
|
|
97
|
+
let { load: a } = t, [o, s] = n(i, {
|
|
98
|
+
error: null,
|
|
99
|
+
items: [],
|
|
100
|
+
requestInitiator: null,
|
|
101
|
+
requestState: e.NOT_STARTED,
|
|
102
|
+
searchInput: ""
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
hasError: o.requestState === e.ERROR,
|
|
106
|
+
hasNextPage: o.requestState === e.ERROR ? !1 : o.marker != null,
|
|
107
|
+
isEmpty: o.items.length === 0,
|
|
108
|
+
isLoading: o.requestState === e.IN_PROGRESS,
|
|
109
|
+
isReloading: o.requestState === e.IN_PROGRESS && (o.requestInitiator === r.RELOAD || o.requestInitiator === r.SEARCH),
|
|
110
|
+
items: o.items,
|
|
111
|
+
loadMore: () => u({ type: r.LOAD_MORE }, a, o, s),
|
|
112
|
+
reload: () => u({ type: r.RELOAD }, a, o, s),
|
|
113
|
+
requestInitiator: o.requestInitiator,
|
|
114
|
+
searchInput: o.searchInput,
|
|
115
|
+
search: (e) => u({
|
|
116
|
+
type: r.SEARCH,
|
|
117
|
+
searchInput: e
|
|
118
|
+
}, a, o, s)
|
|
119
|
+
};
|
|
133
120
|
}
|
|
134
|
-
export {
|
|
135
|
-
_ as useAsyncList
|
|
136
|
-
};
|
|
121
|
+
export { d as useAsyncList };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
function t(
|
|
3
|
-
|
|
1
|
+
var e = "AbortError";
|
|
2
|
+
function t(e) {
|
|
3
|
+
return !!(e && e.__CANCEL__);
|
|
4
4
|
}
|
|
5
|
-
function n(
|
|
6
|
-
|
|
5
|
+
function n(t) {
|
|
6
|
+
return !!(t && typeof t == "object" && t.name === e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function r(e) {
|
|
9
|
+
return t(e) || n(e);
|
|
10
10
|
}
|
|
11
|
-
export {
|
|
12
|
-
c as isAbortError
|
|
13
|
-
};
|
|
11
|
+
export { r as isAbortError };
|
package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
function t(t) {
|
|
3
|
+
let n = e.useRef(t);
|
|
4
|
+
return e.useEffect(() => {
|
|
5
|
+
n.current = t;
|
|
6
|
+
}), e.useMemo(() => ((...e) => n.current?.(...e)), []);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return [i, d];
|
|
8
|
+
function n({ prop: n, defaultProp: i, onChange: a = () => {} }) {
|
|
9
|
+
let [o, s] = r({
|
|
10
|
+
defaultProp: i,
|
|
11
|
+
onChange: a
|
|
12
|
+
}), c = n !== void 0, l = c ? n : o, u = t(a);
|
|
13
|
+
return [l, e.useCallback((e) => {
|
|
14
|
+
if (c) {
|
|
15
|
+
let t = typeof e == "function" ? e(n) : e;
|
|
16
|
+
t !== n && u(t);
|
|
17
|
+
} else s(e);
|
|
18
|
+
}, [
|
|
19
|
+
c,
|
|
20
|
+
n,
|
|
21
|
+
s,
|
|
22
|
+
u
|
|
23
|
+
])];
|
|
25
24
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
function r({ defaultProp: n, onChange: r }) {
|
|
26
|
+
let i = e.useState(n), [a] = i, o = e.useRef(a), s = t(r);
|
|
27
|
+
return e.useEffect(() => {
|
|
28
|
+
o.current !== a && (s(a), o.current = a);
|
|
29
|
+
}, [
|
|
30
|
+
a,
|
|
31
|
+
o,
|
|
32
|
+
s
|
|
33
|
+
]), i;
|
|
34
34
|
}
|
|
35
|
-
export {
|
|
36
|
-
v as useControllableState
|
|
37
|
-
};
|
|
35
|
+
export { n as useControllableState };
|