@react-stately/data 3.15.1 → 3.16.0

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.
@@ -1,290 +0,0 @@
1
- var $fbc1d750f520c94e$exports = require("./useListData.main.js");
2
- var $9f61J$react = require("react");
3
-
4
-
5
- function $parcel$export(e, n, v, s) {
6
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
- }
8
-
9
- $parcel$export(module.exports, "useAsyncList", () => $1cb48366e5c5533f$export$bc3384a35de93d66);
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
- function $1cb48366e5c5533f$var$reducer(data, action) {
23
- let selectedKeys;
24
- switch(data.state){
25
- case 'idle':
26
- case 'error':
27
- switch(action.type){
28
- case 'loading':
29
- case 'loadingMore':
30
- case 'sorting':
31
- case 'filtering':
32
- var _action_filterText, _action_sortDescriptor;
33
- return {
34
- ...data,
35
- filterText: (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText,
36
- state: action.type,
37
- // Reset items to an empty list if loading, but not when sorting.
38
- items: action.type === 'loading' ? [] : data.items,
39
- sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
40
- abortController: action.abortController
41
- };
42
- case 'update':
43
- var _action_updater;
44
- return {
45
- ...data,
46
- ...(_action_updater = action.updater) === null || _action_updater === void 0 ? void 0 : _action_updater.call(action, data)
47
- };
48
- case 'success':
49
- case 'error':
50
- return data;
51
- default:
52
- throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
53
- }
54
- case 'loading':
55
- case 'sorting':
56
- case 'filtering':
57
- switch(action.type){
58
- case 'success':
59
- // Ignore if there is a newer abortcontroller in state.
60
- // This means that multiple requests were going at once.
61
- // We want to take only the latest result.
62
- if (action.abortController !== data.abortController) return data;
63
- var _action_selectedKeys;
64
- selectedKeys = (_action_selectedKeys = action.selectedKeys) !== null && _action_selectedKeys !== void 0 ? _action_selectedKeys : data.selectedKeys;
65
- var _action_filterText1, _action_items, _action_sortDescriptor1;
66
- return {
67
- ...data,
68
- filterText: (_action_filterText1 = action.filterText) !== null && _action_filterText1 !== void 0 ? _action_filterText1 : data.filterText,
69
- state: 'idle',
70
- items: [
71
- ...(_action_items = action.items) !== null && _action_items !== void 0 ? _action_items : []
72
- ],
73
- selectedKeys: selectedKeys === 'all' ? 'all' : new Set(selectedKeys),
74
- sortDescriptor: (_action_sortDescriptor1 = action.sortDescriptor) !== null && _action_sortDescriptor1 !== void 0 ? _action_sortDescriptor1 : data.sortDescriptor,
75
- abortController: undefined,
76
- cursor: action.cursor
77
- };
78
- case 'error':
79
- if (action.abortController !== data.abortController) return data;
80
- return {
81
- ...data,
82
- state: 'error',
83
- error: action.error,
84
- abortController: undefined
85
- };
86
- case 'loading':
87
- case 'loadingMore':
88
- case 'sorting':
89
- case 'filtering':
90
- var // We're already loading, and another load was triggered at the same time.
91
- // We need to abort the previous load and start a new one.
92
- _data_abortController;
93
- (_data_abortController = data.abortController) === null || _data_abortController === void 0 ? void 0 : _data_abortController.abort('aborting current load and starting new one');
94
- var _action_filterText2;
95
- return {
96
- ...data,
97
- filterText: (_action_filterText2 = action.filterText) !== null && _action_filterText2 !== void 0 ? _action_filterText2 : data.filterText,
98
- state: action.type,
99
- // Reset items to an empty list if loading, but not when sorting.
100
- items: action.type === 'loading' ? [] : data.items,
101
- abortController: action.abortController
102
- };
103
- case 'update':
104
- var _action_updater1;
105
- // We're already loading, and an update happened at the same time (e.g. selectedKey changed).
106
- // Update data but don't abort previous load.
107
- return {
108
- ...data,
109
- ...(_action_updater1 = action.updater) === null || _action_updater1 === void 0 ? void 0 : _action_updater1.call(action, data)
110
- };
111
- default:
112
- throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
113
- }
114
- case 'loadingMore':
115
- switch(action.type){
116
- case 'success':
117
- var _action_selectedKeys1;
118
- selectedKeys = data.selectedKeys === 'all' || action.selectedKeys === 'all' ? 'all' : new Set([
119
- ...data.selectedKeys,
120
- ...(_action_selectedKeys1 = action.selectedKeys) !== null && _action_selectedKeys1 !== void 0 ? _action_selectedKeys1 : []
121
- ]);
122
- var _action_items1, _action_sortDescriptor2;
123
- // Append the new items
124
- return {
125
- ...data,
126
- state: 'idle',
127
- items: [
128
- ...data.items,
129
- ...(_action_items1 = action.items) !== null && _action_items1 !== void 0 ? _action_items1 : []
130
- ],
131
- selectedKeys: selectedKeys,
132
- sortDescriptor: (_action_sortDescriptor2 = action.sortDescriptor) !== null && _action_sortDescriptor2 !== void 0 ? _action_sortDescriptor2 : data.sortDescriptor,
133
- abortController: undefined,
134
- cursor: action.cursor
135
- };
136
- case 'error':
137
- if (action.abortController !== data.abortController) return data;
138
- return {
139
- ...data,
140
- state: 'error',
141
- error: action.error
142
- };
143
- case 'loading':
144
- case 'sorting':
145
- case 'filtering':
146
- var // We're already loading more, and another load was triggered at the same time.
147
- // We need to abort the previous load more and start a new one.
148
- _data_abortController1;
149
- (_data_abortController1 = data.abortController) === null || _data_abortController1 === void 0 ? void 0 : _data_abortController1.abort();
150
- var _action_filterText3;
151
- return {
152
- ...data,
153
- filterText: (_action_filterText3 = action.filterText) !== null && _action_filterText3 !== void 0 ? _action_filterText3 : data.filterText,
154
- state: action.type,
155
- // Reset items to an empty list if loading, but not when sorting.
156
- items: action.type === 'loading' ? [] : data.items,
157
- abortController: action.abortController
158
- };
159
- case 'loadingMore':
160
- var // If already loading more and another loading more is triggered, abort the new load more since
161
- // it is a duplicate request since the cursor hasn't been updated.
162
- // Do not overwrite the data.abortController
163
- _action_abortController;
164
- (_action_abortController = action.abortController) === null || _action_abortController === void 0 ? void 0 : _action_abortController.abort();
165
- return data;
166
- case 'update':
167
- var _action_updater2;
168
- // We're already loading, and an update happened at the same time (e.g. selectedKey changed).
169
- // Update data but don't abort previous load.
170
- return {
171
- ...data,
172
- ...(_action_updater2 = action.updater) === null || _action_updater2 === void 0 ? void 0 : _action_updater2.call(action, data)
173
- };
174
- default:
175
- throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
176
- }
177
- default:
178
- throw new Error(`Invalid state "${data.state}"`);
179
- }
180
- }
181
- function $1cb48366e5c5533f$export$bc3384a35de93d66(options) {
182
- const { load: load, sort: sort, initialSelectedKeys: initialSelectedKeys, initialSortDescriptor: initialSortDescriptor, getKey: getKey = (item)=>item.id || item.key, initialFilterText: initialFilterText = '' } = options;
183
- let [data, dispatch] = (0, $9f61J$react.useReducer)($1cb48366e5c5533f$var$reducer, {
184
- state: 'idle',
185
- error: undefined,
186
- items: [],
187
- selectedKeys: initialSelectedKeys === 'all' ? 'all' : new Set(initialSelectedKeys),
188
- sortDescriptor: initialSortDescriptor,
189
- filterText: initialFilterText
190
- });
191
- const dispatchFetch = async (action, fn)=>{
192
- let abortController = new AbortController();
193
- try {
194
- dispatch({
195
- ...action,
196
- abortController: abortController
197
- });
198
- var _action_filterText;
199
- let previousFilterText = (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText;
200
- var _action_sortDescriptor;
201
- let response = await fn({
202
- items: data.items.slice(),
203
- selectedKeys: data.selectedKeys,
204
- sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
205
- signal: abortController.signal,
206
- cursor: action.type === 'loadingMore' ? data.cursor : undefined,
207
- filterText: previousFilterText,
208
- loadingState: data.state
209
- });
210
- var _response_filterText;
211
- let filterText = (_response_filterText = response.filterText) !== null && _response_filterText !== void 0 ? _response_filterText : previousFilterText;
212
- dispatch({
213
- type: 'success',
214
- ...response,
215
- abortController: abortController
216
- });
217
- // Fetch a new filtered list if filterText is updated via `load` response func rather than list.setFilterText
218
- // Only do this if not aborted (e.g. user triggers another filter action before load completes)
219
- if (filterText && filterText !== previousFilterText && !abortController.signal.aborted) dispatchFetch({
220
- type: 'filtering',
221
- filterText: filterText
222
- }, load);
223
- } catch (e) {
224
- dispatch({
225
- type: 'error',
226
- error: e,
227
- abortController: abortController
228
- });
229
- }
230
- };
231
- let didDispatchInitialFetch = (0, $9f61J$react.useRef)(false);
232
- (0, $9f61J$react.useEffect)(()=>{
233
- if (!didDispatchInitialFetch.current) {
234
- dispatchFetch({
235
- type: 'loading'
236
- }, load);
237
- didDispatchInitialFetch.current = true;
238
- }
239
- // eslint-disable-next-line react-hooks/exhaustive-deps
240
- }, []);
241
- return {
242
- items: data.items,
243
- selectedKeys: data.selectedKeys,
244
- sortDescriptor: data.sortDescriptor,
245
- isLoading: data.state === 'loading' || data.state === 'loadingMore' || data.state === 'sorting' || data.state === 'filtering',
246
- loadingState: data.state,
247
- error: data.error,
248
- filterText: data.filterText,
249
- getItem (key) {
250
- return data.items.find((item)=>getKey(item) === key);
251
- },
252
- reload () {
253
- dispatchFetch({
254
- type: 'loading'
255
- }, load);
256
- },
257
- loadMore () {
258
- // Ignore if already loading more or if performing server side filtering.
259
- if (data.state === 'loading' || data.state === 'loadingMore' || data.state === 'filtering' || data.cursor == null) return;
260
- dispatchFetch({
261
- type: 'loadingMore'
262
- }, load);
263
- },
264
- sort (sortDescriptor) {
265
- dispatchFetch({
266
- type: 'sorting',
267
- sortDescriptor: sortDescriptor
268
- }, sort || load);
269
- },
270
- ...(0, $fbc1d750f520c94e$exports.createListActions)({
271
- ...options,
272
- getKey: getKey,
273
- cursor: data.cursor
274
- }, (fn)=>{
275
- dispatch({
276
- type: 'update',
277
- updater: fn
278
- });
279
- }),
280
- setFilterText (filterText) {
281
- dispatchFetch({
282
- type: 'filtering',
283
- filterText: filterText
284
- }, load);
285
- }
286
- };
287
- }
288
-
289
-
290
- //# sourceMappingURL=useAsyncList.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAuGD,SAAS,8BAAc,IAA0B,EAAE,MAAoB;IACrE,IAAI;IACJ,OAAQ,KAAK,KAAK;QAChB,KAAK;QACL,KAAK;YACH,OAAQ,OAAO,IAAI;gBACjB,KAAK;gBACL,KAAK;gBACL,KAAK;gBACL,KAAK;wBAGW,oBAII;oBANlB,OAAO;wBACL,GAAG,IAAI;wBACP,YAAY,CAAA,qBAAA,OAAO,UAAU,cAAjB,gCAAA,qBAAqB,KAAK,UAAU;wBAChD,OAAO,OAAO,IAAI;wBAClB,iEAAiE;wBACjE,OAAO,OAAO,IAAI,KAAK,YAAY,EAAE,GAAG,KAAK,KAAK;wBAClD,gBAAgB,CAAA,yBAAA,OAAO,cAAc,cAArB,oCAAA,yBAAyB,KAAK,cAAc;wBAC5D,iBAAiB,OAAO,eAAe;oBACzC;gBACF,KAAK;wBAGE;oBAFL,OAAO;wBACL,GAAG,IAAI;4BACJ,kBAAA,OAAO,OAAO,cAAd,sCAAA,qBAAA,QAAiB,KAApB;oBACF;gBACF,KAAK;gBACL,KAAK;oBACH,OAAO;gBACT;oBACE,MAAM,IAAI,MAAM,CAAC,gBAAgB,EAAE,OAAO,IAAI,CAAC,YAAY,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC;YAC9E;QACF,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAQ,OAAO,IAAI;gBACjB,KAAK;oBACH,uDAAuD;oBACvD,wDAAwD;oBACxD,0CAA0C;oBAC1C,IAAI,OAAO,eAAe,KAAK,KAAK,eAAe,EACjD,OAAO;wBAGM;oBAAf,eAAe,CAAA,uBAAA,OAAO,YAAY,cAAnB,kCAAA,uBAAuB,KAAK,YAAY;wBAGzC,qBAEA,eAEI;oBANlB,OAAO;wB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MAAM;QAAA,GAAG,CAAA;YAC9D,SAAS;gBAAC,MAAM;gBAAU,SAAS;YAAE;QACvC,EAAE;QACF,eAAc,UAAkB;YAC9B,cAAc;gBAAC,MAAM;4BAAa;YAAU,GAAG;QACjD;IACF;AACF","sources":["packages/@react-stately/data/src/useAsyncList.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {createListActions, ListData, ListState} from './useListData';\nimport {Key, LoadingState, Selection, SortDescriptor} from '@react-types/shared';\nimport {useEffect, useReducer, useRef} from 'react';\n\nexport interface AsyncListOptions<T, C> {\n /** The keys for the initially selected items. */\n initialSelectedKeys?: Iterable<Key>,\n /** The initial sort descriptor. */\n initialSortDescriptor?: SortDescriptor,\n /** The initial filter text. */\n initialFilterText?: string,\n /** A function that returns a unique key for an item object. */\n getKey?: (item: T) => Key,\n /** A function that loads the data for the items in the list. */\n load: AsyncListLoadFunction<T, C>,\n /**\n * An optional function that performs sorting. If not provided,\n * then `sortDescriptor` is passed to the `load` function.\n */\n sort?: AsyncListLoadFunction<T, C, AsyncListLoadOptions<T, C> & {sortDescriptor: SortDescriptor}>\n}\n\ntype AsyncListLoadFunction<T, C, S extends AsyncListLoadOptions<T, C> = AsyncListLoadOptions<T, C>> = (state: S) => AsyncListStateUpdate<T, C> | Promise<AsyncListStateUpdate<T, C>>;\n\ninterface AsyncListLoadOptions<T, C> {\n /** The items currently in the list. */\n items: T[],\n /** The keys of the currently selected items in the list. */\n selectedKeys: Selection,\n /** The current sort descriptor for the list. */\n sortDescriptor?: SortDescriptor,\n /** An abort signal used to notify the load function that the request has been aborted. */\n signal: AbortSignal,\n /** The pagination cursor returned from the last page load. */\n cursor?: C,\n /** The current filter text used to perform server side filtering. */\n filterText?: string,\n /** The current loading state of the list. */\n loadingState?: LoadingState\n}\n\ninterface AsyncListStateUpdate<T, C> {\n /** The new items to append to the list. */\n items: Iterable<T>,\n /** The keys to add to the selection. */\n selectedKeys?: Iterable<Key>,\n /** The sort descriptor to set. */\n sortDescriptor?: SortDescriptor,\n /** The pagination cursor to be used for the next page load. */\n cursor?: C,\n /** The updated filter text for the list. */\n filterText?: string\n}\n\ninterface AsyncListState<T, C> extends ListState<T> {\n state: LoadingState,\n items: T[],\n // disabledKeys?: Iterable<Key>,\n selectedKeys: Selection,\n // selectedKey?: Key,\n // expandedKeys?: Iterable<Key>,\n sortDescriptor?: SortDescriptor,\n error?: Error,\n abortController?: AbortController,\n cursor?: C\n}\n\ntype ActionType = 'success' | 'error' | 'loading' | 'loadingMore' | 'sorting' | 'update' | 'filtering';\ninterface Action<T, C> {\n type: ActionType,\n items?: Iterable<T>,\n selectedKeys?: Iterable<Key>,\n sortDescriptor?: SortDescriptor,\n error?: Error,\n abortController?: AbortController,\n updater?: (state: ListState<T>) => ListState<T>,\n cursor?: C,\n filterText?: string\n}\n\nexport interface AsyncListData<T> extends ListData<T> {\n /** Whether data is currently being loaded. */\n isLoading: boolean,\n /** If loading data failed, then this contains the error that occurred. */\n error?: Error,\n // disabledKeys?: Set<Key>,\n // selectedKey?: Key,\n // expandedKeys?: Set<Key>,\n /** The current sort descriptor for the list. */\n sortDescriptor?: SortDescriptor,\n\n /** Reloads the data in the list. */\n reload(): void,\n /** Loads the next page of data in the list. */\n loadMore(): void,\n /** Triggers sorting for the list. */\n sort(descriptor: SortDescriptor): void,\n /** The current loading state for the list. */\n loadingState: LoadingState\n}\n\nfunction reducer<T, C>(data: AsyncListState<T, C>, action: Action<T, C>): AsyncListState<T, C> {\n let selectedKeys;\n switch (data.state) {\n case 'idle':\n case 'error':\n switch (action.type) {\n case 'loading':\n case 'loadingMore':\n case 'sorting':\n case 'filtering':\n return {\n ...data,\n filterText: action.filterText ?? data.filterText,\n state: action.type,\n // Reset items to an empty list if loading, but not when sorting.\n items: action.type === 'loading' ? [] : data.items,\n sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,\n abortController: action.abortController\n };\n case 'update':\n return {\n ...data,\n ...action.updater?.(data)\n };\n case 'success':\n case 'error':\n return data;\n default:\n throw new Error(`Invalid action \"${action.type}\" in state \"${data.state}\"`);\n }\n case 'loading':\n case 'sorting':\n case 'filtering':\n switch (action.type) {\n case 'success':\n // Ignore if there is a newer abortcontroller in state.\n // This means that multiple requests were going at once.\n // We want to take only the latest result.\n if (action.abortController !== data.abortController) {\n return data;\n }\n\n selectedKeys = action.selectedKeys ?? data.selectedKeys;\n return {\n ...data,\n filterText: action.filterText ?? data.filterText,\n state: 'idle',\n items: [...(action.items) ?? []],\n selectedKeys: selectedKeys === 'all' ? 'all' : new Set(selectedKeys),\n sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,\n abortController: undefined,\n cursor: action.cursor\n };\n case 'error':\n if (action.abortController !== data.abortController) {\n return data;\n }\n\n return {\n ...data,\n state: 'error',\n error: action.error,\n abortController: undefined\n };\n case 'loading':\n case 'loadingMore':\n case 'sorting':\n case 'filtering':\n // We're already loading, and another load was triggered at the same time.\n // We need to abort the previous load and start a new one.\n data.abortController?.abort('aborting current load and starting new one');\n return {\n ...data,\n filterText: action.filterText ?? data.filterText,\n state: action.type,\n // Reset items to an empty list if loading, but not when sorting.\n items: action.type === 'loading' ? [] : data.items,\n abortController: action.abortController\n };\n case 'update':\n // We're already loading, and an update happened at the same time (e.g. selectedKey changed).\n // Update data but don't abort previous load.\n return {\n ...data,\n ...action.updater?.(data)\n };\n default:\n throw new Error(`Invalid action \"${action.type}\" in state \"${data.state}\"`);\n }\n case 'loadingMore':\n switch (action.type) {\n case 'success':\n selectedKeys = (data.selectedKeys === 'all' || action.selectedKeys === 'all')\n ? 'all'\n : new Set([...data.selectedKeys, ...(action.selectedKeys ?? [])]);\n // Append the new items\n return {\n ...data,\n state: 'idle',\n items: [...data.items, ...(action.items ?? [])],\n selectedKeys,\n sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,\n abortController: undefined,\n cursor: action.cursor\n };\n case 'error':\n if (action.abortController !== data.abortController) {\n return data;\n }\n\n return {\n ...data,\n state: 'error',\n error: action.error\n };\n case 'loading':\n case 'sorting':\n case 'filtering':\n // We're already loading more, and another load was triggered at the same time.\n // We need to abort the previous load more and start a new one.\n data.abortController?.abort();\n return {\n ...data,\n filterText: action.filterText ?? data.filterText,\n state: action.type,\n // Reset items to an empty list if loading, but not when sorting.\n items: action.type === 'loading' ? [] : data.items,\n abortController: action.abortController\n };\n case 'loadingMore':\n // If already loading more and another loading more is triggered, abort the new load more since\n // it is a duplicate request since the cursor hasn't been updated.\n // Do not overwrite the data.abortController\n action.abortController?.abort();\n\n return data;\n case 'update':\n // We're already loading, and an update happened at the same time (e.g. selectedKey changed).\n // Update data but don't abort previous load.\n return {\n ...data,\n ...action.updater?.(data)\n };\n default:\n throw new Error(`Invalid action \"${action.type}\" in state \"${data.state}\"`);\n }\n default:\n throw new Error(`Invalid state \"${data.state}\"`);\n }\n}\n\n/**\n * Manages state for an immutable async loaded list data structure, and provides convenience methods to\n * update the data over time. Manages loading and error states, pagination, and sorting.\n */\nexport function useAsyncList<T, C = string>(options: AsyncListOptions<T, C>): AsyncListData<T> {\n const {\n load,\n sort,\n initialSelectedKeys,\n initialSortDescriptor,\n getKey = (item: any) => item.id || item.key,\n initialFilterText = ''\n } = options;\n\n let [data, dispatch] = useReducer<AsyncListState<T, C>, [Action<T, C>]>(reducer, {\n state: 'idle',\n error: undefined,\n items: [],\n selectedKeys: initialSelectedKeys === 'all' ? 'all' : new Set(initialSelectedKeys),\n sortDescriptor: initialSortDescriptor,\n filterText: initialFilterText\n });\n\n const dispatchFetch = async (action: Action<T, C>, fn: AsyncListLoadFunction<T, C>) => {\n let abortController = new AbortController();\n try {\n dispatch({...action, abortController});\n let previousFilterText = action.filterText ?? data.filterText;\n\n let response = await fn({\n items: data.items.slice(),\n selectedKeys: data.selectedKeys,\n sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,\n signal: abortController.signal,\n cursor: action.type === 'loadingMore' ? data.cursor : undefined,\n filterText: previousFilterText,\n loadingState: data.state\n });\n\n let filterText = response.filterText ?? previousFilterText;\n dispatch({type: 'success', ...response, abortController});\n\n // Fetch a new filtered list if filterText is updated via `load` response func rather than list.setFilterText\n // Only do this if not aborted (e.g. user triggers another filter action before load completes)\n if (filterText && (filterText !== previousFilterText) && !abortController.signal.aborted) {\n dispatchFetch({type: 'filtering', filterText}, load);\n }\n } catch (e) {\n dispatch({type: 'error', error: e as Error, abortController});\n }\n };\n\n let didDispatchInitialFetch = useRef(false);\n useEffect(() => {\n if (!didDispatchInitialFetch.current) {\n dispatchFetch({type: 'loading'}, load);\n didDispatchInitialFetch.current = true;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return {\n items: data.items,\n selectedKeys: data.selectedKeys,\n sortDescriptor: data.sortDescriptor,\n isLoading: data.state === 'loading' || data.state === 'loadingMore' || data.state === 'sorting' || data.state === 'filtering',\n loadingState: data.state,\n error: data.error,\n filterText: data.filterText,\n getItem(key: Key) {\n return data.items.find(item => getKey(item) === key);\n },\n reload() {\n dispatchFetch({type: 'loading'}, load);\n },\n loadMore() {\n // Ignore if already loading more or if performing server side filtering.\n if (data.state === 'loading' || data.state === 'loadingMore' || data.state === 'filtering' || data.cursor == null) {\n return;\n }\n\n dispatchFetch({type: 'loadingMore'}, load);\n },\n sort(sortDescriptor: SortDescriptor) {\n dispatchFetch({type: 'sorting', sortDescriptor}, (sort || load) as AsyncListLoadFunction<T, C>);\n },\n ...createListActions({...options, getKey, cursor: data.cursor}, fn => {\n dispatch({type: 'update', updater: fn});\n }),\n setFilterText(filterText: string) {\n dispatchFetch({type: 'filtering', filterText}, load);\n }\n };\n}\n"],"names":[],"version":3,"file":"useAsyncList.main.js.map"}
@@ -1,285 +0,0 @@
1
- import {createListActions as $0d86e9c8f07f9a7b$export$79c0c687a5963b0a} from "./useListData.mjs";
2
- import {useReducer as $fh1mr$useReducer, useRef as $fh1mr$useRef, useEffect as $fh1mr$useEffect} from "react";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- function $f86e6c1ec7da6ebb$var$reducer(data, action) {
17
- let selectedKeys;
18
- switch(data.state){
19
- case 'idle':
20
- case 'error':
21
- switch(action.type){
22
- case 'loading':
23
- case 'loadingMore':
24
- case 'sorting':
25
- case 'filtering':
26
- var _action_filterText, _action_sortDescriptor;
27
- return {
28
- ...data,
29
- filterText: (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText,
30
- state: action.type,
31
- // Reset items to an empty list if loading, but not when sorting.
32
- items: action.type === 'loading' ? [] : data.items,
33
- sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
34
- abortController: action.abortController
35
- };
36
- case 'update':
37
- var _action_updater;
38
- return {
39
- ...data,
40
- ...(_action_updater = action.updater) === null || _action_updater === void 0 ? void 0 : _action_updater.call(action, data)
41
- };
42
- case 'success':
43
- case 'error':
44
- return data;
45
- default:
46
- throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
47
- }
48
- case 'loading':
49
- case 'sorting':
50
- case 'filtering':
51
- switch(action.type){
52
- case 'success':
53
- // Ignore if there is a newer abortcontroller in state.
54
- // This means that multiple requests were going at once.
55
- // We want to take only the latest result.
56
- if (action.abortController !== data.abortController) return data;
57
- var _action_selectedKeys;
58
- selectedKeys = (_action_selectedKeys = action.selectedKeys) !== null && _action_selectedKeys !== void 0 ? _action_selectedKeys : data.selectedKeys;
59
- var _action_filterText1, _action_items, _action_sortDescriptor1;
60
- return {
61
- ...data,
62
- filterText: (_action_filterText1 = action.filterText) !== null && _action_filterText1 !== void 0 ? _action_filterText1 : data.filterText,
63
- state: 'idle',
64
- items: [
65
- ...(_action_items = action.items) !== null && _action_items !== void 0 ? _action_items : []
66
- ],
67
- selectedKeys: selectedKeys === 'all' ? 'all' : new Set(selectedKeys),
68
- sortDescriptor: (_action_sortDescriptor1 = action.sortDescriptor) !== null && _action_sortDescriptor1 !== void 0 ? _action_sortDescriptor1 : data.sortDescriptor,
69
- abortController: undefined,
70
- cursor: action.cursor
71
- };
72
- case 'error':
73
- if (action.abortController !== data.abortController) return data;
74
- return {
75
- ...data,
76
- state: 'error',
77
- error: action.error,
78
- abortController: undefined
79
- };
80
- case 'loading':
81
- case 'loadingMore':
82
- case 'sorting':
83
- case 'filtering':
84
- var // We're already loading, and another load was triggered at the same time.
85
- // We need to abort the previous load and start a new one.
86
- _data_abortController;
87
- (_data_abortController = data.abortController) === null || _data_abortController === void 0 ? void 0 : _data_abortController.abort('aborting current load and starting new one');
88
- var _action_filterText2;
89
- return {
90
- ...data,
91
- filterText: (_action_filterText2 = action.filterText) !== null && _action_filterText2 !== void 0 ? _action_filterText2 : data.filterText,
92
- state: action.type,
93
- // Reset items to an empty list if loading, but not when sorting.
94
- items: action.type === 'loading' ? [] : data.items,
95
- abortController: action.abortController
96
- };
97
- case 'update':
98
- var _action_updater1;
99
- // We're already loading, and an update happened at the same time (e.g. selectedKey changed).
100
- // Update data but don't abort previous load.
101
- return {
102
- ...data,
103
- ...(_action_updater1 = action.updater) === null || _action_updater1 === void 0 ? void 0 : _action_updater1.call(action, data)
104
- };
105
- default:
106
- throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
107
- }
108
- case 'loadingMore':
109
- switch(action.type){
110
- case 'success':
111
- var _action_selectedKeys1;
112
- selectedKeys = data.selectedKeys === 'all' || action.selectedKeys === 'all' ? 'all' : new Set([
113
- ...data.selectedKeys,
114
- ...(_action_selectedKeys1 = action.selectedKeys) !== null && _action_selectedKeys1 !== void 0 ? _action_selectedKeys1 : []
115
- ]);
116
- var _action_items1, _action_sortDescriptor2;
117
- // Append the new items
118
- return {
119
- ...data,
120
- state: 'idle',
121
- items: [
122
- ...data.items,
123
- ...(_action_items1 = action.items) !== null && _action_items1 !== void 0 ? _action_items1 : []
124
- ],
125
- selectedKeys: selectedKeys,
126
- sortDescriptor: (_action_sortDescriptor2 = action.sortDescriptor) !== null && _action_sortDescriptor2 !== void 0 ? _action_sortDescriptor2 : data.sortDescriptor,
127
- abortController: undefined,
128
- cursor: action.cursor
129
- };
130
- case 'error':
131
- if (action.abortController !== data.abortController) return data;
132
- return {
133
- ...data,
134
- state: 'error',
135
- error: action.error
136
- };
137
- case 'loading':
138
- case 'sorting':
139
- case 'filtering':
140
- var // We're already loading more, and another load was triggered at the same time.
141
- // We need to abort the previous load more and start a new one.
142
- _data_abortController1;
143
- (_data_abortController1 = data.abortController) === null || _data_abortController1 === void 0 ? void 0 : _data_abortController1.abort();
144
- var _action_filterText3;
145
- return {
146
- ...data,
147
- filterText: (_action_filterText3 = action.filterText) !== null && _action_filterText3 !== void 0 ? _action_filterText3 : data.filterText,
148
- state: action.type,
149
- // Reset items to an empty list if loading, but not when sorting.
150
- items: action.type === 'loading' ? [] : data.items,
151
- abortController: action.abortController
152
- };
153
- case 'loadingMore':
154
- var // If already loading more and another loading more is triggered, abort the new load more since
155
- // it is a duplicate request since the cursor hasn't been updated.
156
- // Do not overwrite the data.abortController
157
- _action_abortController;
158
- (_action_abortController = action.abortController) === null || _action_abortController === void 0 ? void 0 : _action_abortController.abort();
159
- return data;
160
- case 'update':
161
- var _action_updater2;
162
- // We're already loading, and an update happened at the same time (e.g. selectedKey changed).
163
- // Update data but don't abort previous load.
164
- return {
165
- ...data,
166
- ...(_action_updater2 = action.updater) === null || _action_updater2 === void 0 ? void 0 : _action_updater2.call(action, data)
167
- };
168
- default:
169
- throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
170
- }
171
- default:
172
- throw new Error(`Invalid state "${data.state}"`);
173
- }
174
- }
175
- function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
176
- const { load: load, sort: sort, initialSelectedKeys: initialSelectedKeys, initialSortDescriptor: initialSortDescriptor, getKey: getKey = (item)=>item.id || item.key, initialFilterText: initialFilterText = '' } = options;
177
- let [data, dispatch] = (0, $fh1mr$useReducer)($f86e6c1ec7da6ebb$var$reducer, {
178
- state: 'idle',
179
- error: undefined,
180
- items: [],
181
- selectedKeys: initialSelectedKeys === 'all' ? 'all' : new Set(initialSelectedKeys),
182
- sortDescriptor: initialSortDescriptor,
183
- filterText: initialFilterText
184
- });
185
- const dispatchFetch = async (action, fn)=>{
186
- let abortController = new AbortController();
187
- try {
188
- dispatch({
189
- ...action,
190
- abortController: abortController
191
- });
192
- var _action_filterText;
193
- let previousFilterText = (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText;
194
- var _action_sortDescriptor;
195
- let response = await fn({
196
- items: data.items.slice(),
197
- selectedKeys: data.selectedKeys,
198
- sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
199
- signal: abortController.signal,
200
- cursor: action.type === 'loadingMore' ? data.cursor : undefined,
201
- filterText: previousFilterText,
202
- loadingState: data.state
203
- });
204
- var _response_filterText;
205
- let filterText = (_response_filterText = response.filterText) !== null && _response_filterText !== void 0 ? _response_filterText : previousFilterText;
206
- dispatch({
207
- type: 'success',
208
- ...response,
209
- abortController: abortController
210
- });
211
- // Fetch a new filtered list if filterText is updated via `load` response func rather than list.setFilterText
212
- // Only do this if not aborted (e.g. user triggers another filter action before load completes)
213
- if (filterText && filterText !== previousFilterText && !abortController.signal.aborted) dispatchFetch({
214
- type: 'filtering',
215
- filterText: filterText
216
- }, load);
217
- } catch (e) {
218
- dispatch({
219
- type: 'error',
220
- error: e,
221
- abortController: abortController
222
- });
223
- }
224
- };
225
- let didDispatchInitialFetch = (0, $fh1mr$useRef)(false);
226
- (0, $fh1mr$useEffect)(()=>{
227
- if (!didDispatchInitialFetch.current) {
228
- dispatchFetch({
229
- type: 'loading'
230
- }, load);
231
- didDispatchInitialFetch.current = true;
232
- }
233
- // eslint-disable-next-line react-hooks/exhaustive-deps
234
- }, []);
235
- return {
236
- items: data.items,
237
- selectedKeys: data.selectedKeys,
238
- sortDescriptor: data.sortDescriptor,
239
- isLoading: data.state === 'loading' || data.state === 'loadingMore' || data.state === 'sorting' || data.state === 'filtering',
240
- loadingState: data.state,
241
- error: data.error,
242
- filterText: data.filterText,
243
- getItem (key) {
244
- return data.items.find((item)=>getKey(item) === key);
245
- },
246
- reload () {
247
- dispatchFetch({
248
- type: 'loading'
249
- }, load);
250
- },
251
- loadMore () {
252
- // Ignore if already loading more or if performing server side filtering.
253
- if (data.state === 'loading' || data.state === 'loadingMore' || data.state === 'filtering' || data.cursor == null) return;
254
- dispatchFetch({
255
- type: 'loadingMore'
256
- }, load);
257
- },
258
- sort (sortDescriptor) {
259
- dispatchFetch({
260
- type: 'sorting',
261
- sortDescriptor: sortDescriptor
262
- }, sort || load);
263
- },
264
- ...(0, $0d86e9c8f07f9a7b$export$79c0c687a5963b0a)({
265
- ...options,
266
- getKey: getKey,
267
- cursor: data.cursor
268
- }, (fn)=>{
269
- dispatch({
270
- type: 'update',
271
- updater: fn
272
- });
273
- }),
274
- setFilterText (filterText) {
275
- dispatchFetch({
276
- type: 'filtering',
277
- filterText: filterText
278
- }, load);
279
- }
280
- };
281
- }
282
-
283
-
284
- export {$f86e6c1ec7da6ebb$export$bc3384a35de93d66 as useAsyncList};
285
- //# sourceMappingURL=useAsyncList.module.js.map