@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.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.
- package/dist/autocomplete/index.js +39 -0
- package/dist/autocomplete/index.js.map +1 -0
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js +35 -2
- package/dist/button/index.js.map +1 -1
- package/dist/button/pending.js +1 -1
- package/dist/button/slots.d.ts +2 -0
- package/dist/button/slots.js.map +1 -1
- package/dist/chip/index.js +1 -1
- package/dist/components/autocomplete/index.d.ts +49 -0
- package/dist/components/autocomplete/index.js +87 -0
- package/dist/components/autocomplete/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +196 -150
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +106 -193
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip-group/index.d.ts +1 -1
- package/dist/components/chip-group/index.js +1 -1
- package/dist/components/copy-field/index.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/currency/index.d.ts +1 -1
- package/dist/components/currency/index.js +1 -1
- package/dist/components/dialog/index.d.ts +3 -2
- package/dist/components/dialog/index.js +105 -242
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/icon-button/index.js +205 -159
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list/index.d.ts +216 -0
- package/dist/components/list/index.js +1118 -0
- package/dist/components/list/index.js.map +1 -0
- package/dist/components/list-item/index.d.ts +63 -0
- package/dist/components/list-item/index.js +275 -0
- package/dist/components/list-item/index.js.map +1 -0
- package/dist/components/menu/index.d.ts +309 -0
- package/dist/components/menu/index.js +1283 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/meter/index.d.ts +1 -1
- package/dist/components/meter/index.js +1 -1
- package/dist/components/number-field/index.d.ts +1 -1
- package/dist/components/number-field/index.js +2 -2
- package/dist/components/popover/index.d.ts +140 -0
- package/dist/components/popover/index.js +704 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/product-icon/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/radio-group/index.d.ts +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/search-field/index.d.ts +12 -4
- package/dist/components/search-field/index.js +64 -58
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js +1 -1
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.d.ts +137 -0
- package/dist/components/sheet/index.js +1091 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/snackbar/index.d.ts +1 -1
- package/dist/components/snackbar/index.js +1 -1
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text-field/index.d.ts +1 -1
- package/dist/components/text-field/index.js +1 -1
- package/dist/control/checkbox-box.js +137 -0
- package/dist/control/checkbox-box.js.map +1 -0
- package/dist/control/index.js +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/glyphs/index.js +21 -2
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +16 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +374 -34
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +8 -2
- package/dist/indicator/index.d.ts +1 -1
- package/dist/indicator/index.js +2 -2
- package/dist/mark/index.d.ts +1 -1
- package/dist/mark/index.js +1 -1
- package/dist/modal/index.d.ts +16 -0
- package/dist/modal/index.js +277 -0
- package/dist/modal/index.js.map +1 -0
- package/dist/overlay/anchored.d.ts +2 -0
- package/dist/overlay/anchored.js +182 -0
- package/dist/overlay/anchored.js.map +1 -0
- package/dist/overlay/host.d.ts +2 -0
- package/dist/overlay/host.js +1 -1
- package/dist/overlay/index.d.ts +4 -0
- package/dist/overlay/panel.js +215 -0
- package/dist/overlay/panel.js.map +1 -0
- package/dist/overlay/placement.d.ts +8 -0
- package/dist/overlay/placement.js +87 -0
- package/dist/overlay/placement.js.map +1 -0
- package/dist/press/index.js +1 -1
- package/dist/ref/index.js +15 -0
- package/dist/ref/index.js.map +1 -0
- package/dist/router/index.js +1 -1
- package/dist/row/index.js +158 -0
- package/dist/row/index.js.map +1 -0
- package/dist/row/styles.js +51 -0
- package/dist/row/styles.js.map +1 -0
- package/dist/theme/scope.js +1 -1
- package/dist/theme-scope.d.ts +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/typography/fonts.js +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,1118 @@
|
|
|
1
|
+
import { AutocompleteContext } from "../../autocomplete/index.js";
|
|
2
|
+
import { useTheme } from "../../theme/scope.js";
|
|
3
|
+
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
4
|
+
import { useTypeRole } from "../../typography/roles.js";
|
|
5
|
+
import { toggleState } from "../../button/index.js";
|
|
6
|
+
import { ProgressIndicator } from "../progress-indicator/index.js";
|
|
7
|
+
import { messagesFor, resultsFor } from "../../i18n/index.js";
|
|
8
|
+
import { hitSlop, usePressFeedback } from "../../press/index.js";
|
|
9
|
+
import { CheckboxBox } from "../../control/checkbox-box.js";
|
|
10
|
+
import { rowContentColor, rowStyles } from "../../row/styles.js";
|
|
11
|
+
import { RowContent, hasContent, rowStyleOf } from "../../row/index.js";
|
|
12
|
+
import { c } from "react/compiler-runtime";
|
|
13
|
+
import { Children, createContext, use, useEffect, useRef } from "react";
|
|
14
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { AccessibilityInfo, FlatList, Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
16
|
+
import { useListState } from "react-stately/useListState";
|
|
17
|
+
//#region src/components/list/index.tsx
|
|
18
|
+
const BOX_SLOT = 24;
|
|
19
|
+
const LOADING_DIAMETER = "24px";
|
|
20
|
+
const LOAD_OFFSET = 1;
|
|
21
|
+
const IDLE = {};
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
box: {
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
height: BOX_SLOT,
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
width: BOX_SLOT
|
|
28
|
+
},
|
|
29
|
+
idle: { height: 0 },
|
|
30
|
+
status: {
|
|
31
|
+
height: 1,
|
|
32
|
+
overflow: "hidden",
|
|
33
|
+
pointerEvents: "none",
|
|
34
|
+
position: "absolute",
|
|
35
|
+
width: 1
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const stylesOf = themedStyles(({ colors, sizing, spacing }) => StyleSheet.create({
|
|
39
|
+
content: { paddingVertical: spacing.sm },
|
|
40
|
+
empty: { color: colors.onSurfaceVariant },
|
|
41
|
+
header: {
|
|
42
|
+
color: colors.onSurfaceVariant,
|
|
43
|
+
paddingBottom: spacing.xxs,
|
|
44
|
+
paddingHorizontal: spacing.lg,
|
|
45
|
+
paddingTop: spacing.lg
|
|
46
|
+
},
|
|
47
|
+
lead: {
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
flexDirection: "row",
|
|
50
|
+
gap: spacing.lg
|
|
51
|
+
},
|
|
52
|
+
list: { backgroundColor: colors.surface },
|
|
53
|
+
loading: {
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: "center",
|
|
56
|
+
minHeight: sizing.rowSm
|
|
57
|
+
},
|
|
58
|
+
status: { color: colors.onSurface }
|
|
59
|
+
}));
|
|
60
|
+
const ListContext = createContext(null);
|
|
61
|
+
/**
|
|
62
|
+
* A list of rows, one or more of which can be selected. Selection is React
|
|
63
|
+
* Stately's, as web's is React Aria's: set `selectionMode` to `single` or
|
|
64
|
+
* `multiple`, and pass `selectedKeys` with `onSelectionChange` to control
|
|
65
|
+
* it or `defaultSelectedKeys` to let it keep its own. A list whose rows do
|
|
66
|
+
* something takes `onAction`, or an `onAction` on each row.
|
|
67
|
+
*
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <List aria-label="Label" selectionMode="multiple">
|
|
70
|
+
* <List.Item id="first" supporting="Supporting line">First item</List.Item>
|
|
71
|
+
* </List>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* ListItem is the row on its own; this is the collection that draws the
|
|
75
|
+
* same row and adds selection, sections and a row that loads more. Composed
|
|
76
|
+
* from parts, `List.Item`, `List.Section` and `List.LoadMore`, which the
|
|
77
|
+
* list draws from their props, so none of them renders anything on its
|
|
78
|
+
* own. Name the list with `aria-label`. It scrolls by itself, so it wants a
|
|
79
|
+
* height to fill: a short list on a page that scrolls takes
|
|
80
|
+
* `scrollEnabled={false}` and is laid out at its full length. `style` and
|
|
81
|
+
* `ref` land on the `FlatList`.
|
|
82
|
+
*
|
|
83
|
+
* Inside an `Autocomplete`, the list shows the rows the search keeps and
|
|
84
|
+
* says how many there are to a screen reader, and a tap on a row reaches it
|
|
85
|
+
* while the keyboard is up.
|
|
86
|
+
*/
|
|
87
|
+
function List(t0) {
|
|
88
|
+
const $ = c(66);
|
|
89
|
+
let children;
|
|
90
|
+
let contentContainerStyle;
|
|
91
|
+
let defaultSelectedKeys;
|
|
92
|
+
let disabledKeys;
|
|
93
|
+
let disallowEmptySelection;
|
|
94
|
+
let items;
|
|
95
|
+
let keyboardShouldPersistTaps;
|
|
96
|
+
let onAction;
|
|
97
|
+
let onSelectionChange;
|
|
98
|
+
let props;
|
|
99
|
+
let ref;
|
|
100
|
+
let selectLabel;
|
|
101
|
+
let selectedKeys;
|
|
102
|
+
let style;
|
|
103
|
+
let t1;
|
|
104
|
+
let t2;
|
|
105
|
+
if ($[0] !== t0) {
|
|
106
|
+
({children, contentContainerStyle, defaultSelectedKeys, disabledKeys, disallowEmptySelection, items, keyboardShouldPersistTaps, onAction, onSelectionChange, ref, renderEmptyState: t1, selectedKeys, selectionMode: t2, selectLabel, style, ...props} = t0);
|
|
107
|
+
$[0] = t0;
|
|
108
|
+
$[1] = children;
|
|
109
|
+
$[2] = contentContainerStyle;
|
|
110
|
+
$[3] = defaultSelectedKeys;
|
|
111
|
+
$[4] = disabledKeys;
|
|
112
|
+
$[5] = disallowEmptySelection;
|
|
113
|
+
$[6] = items;
|
|
114
|
+
$[7] = keyboardShouldPersistTaps;
|
|
115
|
+
$[8] = onAction;
|
|
116
|
+
$[9] = onSelectionChange;
|
|
117
|
+
$[10] = props;
|
|
118
|
+
$[11] = ref;
|
|
119
|
+
$[12] = selectLabel;
|
|
120
|
+
$[13] = selectedKeys;
|
|
121
|
+
$[14] = style;
|
|
122
|
+
$[15] = t1;
|
|
123
|
+
$[16] = t2;
|
|
124
|
+
} else {
|
|
125
|
+
children = $[1];
|
|
126
|
+
contentContainerStyle = $[2];
|
|
127
|
+
defaultSelectedKeys = $[3];
|
|
128
|
+
disabledKeys = $[4];
|
|
129
|
+
disallowEmptySelection = $[5];
|
|
130
|
+
items = $[6];
|
|
131
|
+
keyboardShouldPersistTaps = $[7];
|
|
132
|
+
onAction = $[8];
|
|
133
|
+
onSelectionChange = $[9];
|
|
134
|
+
props = $[10];
|
|
135
|
+
ref = $[11];
|
|
136
|
+
selectLabel = $[12];
|
|
137
|
+
selectedKeys = $[13];
|
|
138
|
+
style = $[14];
|
|
139
|
+
t1 = $[15];
|
|
140
|
+
t2 = $[16];
|
|
141
|
+
}
|
|
142
|
+
const renderEmptyState = t1 === void 0 ? emptyState : t1;
|
|
143
|
+
const selectionMode = t2 === void 0 ? "none" : t2;
|
|
144
|
+
const theme = useTheme();
|
|
145
|
+
const own = stylesOf(theme);
|
|
146
|
+
const autocomplete = use(AutocompleteContext);
|
|
147
|
+
const matches = autocomplete?.matches;
|
|
148
|
+
let t3;
|
|
149
|
+
if ($[17] !== matches) {
|
|
150
|
+
t3 = matches === void 0 ? void 0 : filterOf(matches);
|
|
151
|
+
$[17] = matches;
|
|
152
|
+
$[18] = t3;
|
|
153
|
+
} else t3 = $[18];
|
|
154
|
+
const filter = t3;
|
|
155
|
+
const t4 = children;
|
|
156
|
+
let t5;
|
|
157
|
+
if ($[19] !== defaultSelectedKeys || $[20] !== disabledKeys || $[21] !== disallowEmptySelection || $[22] !== filter || $[23] !== items || $[24] !== onSelectionChange || $[25] !== selectedKeys || $[26] !== selectionMode || $[27] !== t4) {
|
|
158
|
+
t5 = {
|
|
159
|
+
children: t4,
|
|
160
|
+
defaultSelectedKeys,
|
|
161
|
+
disabledKeys,
|
|
162
|
+
disallowEmptySelection,
|
|
163
|
+
filter,
|
|
164
|
+
items,
|
|
165
|
+
onSelectionChange,
|
|
166
|
+
selectedKeys,
|
|
167
|
+
selectionMode
|
|
168
|
+
};
|
|
169
|
+
$[19] = defaultSelectedKeys;
|
|
170
|
+
$[20] = disabledKeys;
|
|
171
|
+
$[21] = disallowEmptySelection;
|
|
172
|
+
$[22] = filter;
|
|
173
|
+
$[23] = items;
|
|
174
|
+
$[24] = onSelectionChange;
|
|
175
|
+
$[25] = selectedKeys;
|
|
176
|
+
$[26] = selectionMode;
|
|
177
|
+
$[27] = t4;
|
|
178
|
+
$[28] = t5;
|
|
179
|
+
} else t5 = $[28];
|
|
180
|
+
const state = useListState(t5);
|
|
181
|
+
let t6;
|
|
182
|
+
if ($[29] !== state) {
|
|
183
|
+
t6 = entriesOf(state);
|
|
184
|
+
$[29] = state;
|
|
185
|
+
$[30] = t6;
|
|
186
|
+
} else t6 = $[30];
|
|
187
|
+
const { entries, loader, rows, sticky } = t6;
|
|
188
|
+
const listStyle = composeStyles(own.list, style);
|
|
189
|
+
const loadMore = loader?.props;
|
|
190
|
+
const isLoading = loadMore?.isLoading ?? false;
|
|
191
|
+
let t7;
|
|
192
|
+
if ($[31] !== style || $[32] !== theme) {
|
|
193
|
+
t7 = StyleSheet.flatten(style)?.backgroundColor ?? theme.colors.surface;
|
|
194
|
+
$[31] = style;
|
|
195
|
+
$[32] = theme;
|
|
196
|
+
$[33] = t7;
|
|
197
|
+
} else t7 = $[33];
|
|
198
|
+
const ground = t7;
|
|
199
|
+
let t8;
|
|
200
|
+
if ($[34] !== selectLabel) {
|
|
201
|
+
t8 = selectLabel ?? messagesFor().select;
|
|
202
|
+
$[34] = selectLabel;
|
|
203
|
+
$[35] = t8;
|
|
204
|
+
} else t8 = $[35];
|
|
205
|
+
let t9;
|
|
206
|
+
if ($[36] !== ground || $[37] !== loadMore || $[38] !== onAction || $[39] !== renderEmptyState || $[40] !== state || $[41] !== t8) {
|
|
207
|
+
t9 = {
|
|
208
|
+
ground,
|
|
209
|
+
loadMore,
|
|
210
|
+
onAction,
|
|
211
|
+
renderEmptyState,
|
|
212
|
+
selectLabel: t8,
|
|
213
|
+
state
|
|
214
|
+
};
|
|
215
|
+
$[36] = ground;
|
|
216
|
+
$[37] = loadMore;
|
|
217
|
+
$[38] = onAction;
|
|
218
|
+
$[39] = renderEmptyState;
|
|
219
|
+
$[40] = state;
|
|
220
|
+
$[41] = t8;
|
|
221
|
+
$[42] = t9;
|
|
222
|
+
} else t9 = $[42];
|
|
223
|
+
const value = t9;
|
|
224
|
+
const T0 = ListContext;
|
|
225
|
+
const T1 = FlatList;
|
|
226
|
+
const t10 = composeStyles(own.content, contentContainerStyle);
|
|
227
|
+
const t11 = keyboardShouldPersistTaps ?? (autocomplete === null ? void 0 : "handled");
|
|
228
|
+
const t12 = isLoading ? void 0 : EmptyState;
|
|
229
|
+
const t13 = loadMore === void 0 ? void 0 : LoaderRow;
|
|
230
|
+
let t14;
|
|
231
|
+
if ($[43] !== loadMore) {
|
|
232
|
+
t14 = loadMore === void 0 ? void 0 : loadMoreOf(loadMore);
|
|
233
|
+
$[43] = loadMore;
|
|
234
|
+
$[44] = t14;
|
|
235
|
+
} else t14 = $[44];
|
|
236
|
+
const t15 = loadMore?.scrollOffset ?? LOAD_OFFSET;
|
|
237
|
+
let t16;
|
|
238
|
+
if ($[45] !== T1 || $[46] !== entries || $[47] !== listStyle || $[48] !== props || $[49] !== ref || $[50] !== sticky || $[51] !== t10 || $[52] !== t11 || $[53] !== t12 || $[54] !== t13 || $[55] !== t14 || $[56] !== t15) {
|
|
239
|
+
t16 = /* @__PURE__ */ jsx(T1, {
|
|
240
|
+
...props,
|
|
241
|
+
contentContainerStyle: t10,
|
|
242
|
+
data: entries,
|
|
243
|
+
keyboardShouldPersistTaps: t11,
|
|
244
|
+
keyExtractor: keyOf,
|
|
245
|
+
ListEmptyComponent: t12,
|
|
246
|
+
ListFooterComponent: t13,
|
|
247
|
+
onEndReached: t14,
|
|
248
|
+
onEndReachedThreshold: t15,
|
|
249
|
+
ref,
|
|
250
|
+
renderItem: renderEntry,
|
|
251
|
+
stickyHeaderIndices: sticky,
|
|
252
|
+
style: listStyle
|
|
253
|
+
});
|
|
254
|
+
$[45] = T1;
|
|
255
|
+
$[46] = entries;
|
|
256
|
+
$[47] = listStyle;
|
|
257
|
+
$[48] = props;
|
|
258
|
+
$[49] = ref;
|
|
259
|
+
$[50] = sticky;
|
|
260
|
+
$[51] = t10;
|
|
261
|
+
$[52] = t11;
|
|
262
|
+
$[53] = t12;
|
|
263
|
+
$[54] = t13;
|
|
264
|
+
$[55] = t14;
|
|
265
|
+
$[56] = t15;
|
|
266
|
+
$[57] = t16;
|
|
267
|
+
} else t16 = $[57];
|
|
268
|
+
let t17;
|
|
269
|
+
if ($[58] !== autocomplete || $[59] !== rows) {
|
|
270
|
+
t17 = autocomplete === null ? null : /* @__PURE__ */ jsx(ResultsStatus, { count: rows });
|
|
271
|
+
$[58] = autocomplete;
|
|
272
|
+
$[59] = rows;
|
|
273
|
+
$[60] = t17;
|
|
274
|
+
} else t17 = $[60];
|
|
275
|
+
let t18;
|
|
276
|
+
if ($[61] !== T0 || $[62] !== t16 || $[63] !== t17 || $[64] !== value) {
|
|
277
|
+
t18 = /* @__PURE__ */ jsxs(T0, {
|
|
278
|
+
value,
|
|
279
|
+
children: [t16, t17]
|
|
280
|
+
});
|
|
281
|
+
$[61] = T0;
|
|
282
|
+
$[62] = t16;
|
|
283
|
+
$[63] = t17;
|
|
284
|
+
$[64] = value;
|
|
285
|
+
$[65] = t18;
|
|
286
|
+
} else t18 = $[65];
|
|
287
|
+
return t18;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* The row shown while more items are being fetched. `onLoadMore` is called
|
|
291
|
+
* as the reader nears the end of the list, and the ring is drawn only while
|
|
292
|
+
* `isLoading`, in a live region, so a screen reader hears it arrive. It
|
|
293
|
+
* goes last, after the rows it loads more of.
|
|
294
|
+
*/
|
|
295
|
+
function ListLoadMore(_props) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
ListLoadMore.getCollectionNode = function* getCollectionNode(props) {
|
|
299
|
+
yield {
|
|
300
|
+
hasChildNodes: false,
|
|
301
|
+
props,
|
|
302
|
+
rendered: null,
|
|
303
|
+
type: "loader"
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* One row. Its slots are ListItem's: `leading`, the headline as children,
|
|
308
|
+
* `overline` above it, `supporting` under it, and `trailing`. Give every
|
|
309
|
+
* row an `id`, which is the key selection is reported by. A list that
|
|
310
|
+
* selects draws a checkbox before whatever `leading` holds.
|
|
311
|
+
*
|
|
312
|
+
* The list draws it from its entry in the collection, so it renders nothing
|
|
313
|
+
* on its own. `style`, `ref` and `testID` land on the row.
|
|
314
|
+
*/
|
|
315
|
+
function ListRow(_props) {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
ListRow.getCollectionNode = function* getCollectionNode(props) {
|
|
319
|
+
yield {
|
|
320
|
+
"aria-label": props["aria-label"],
|
|
321
|
+
hasChildNodes: false,
|
|
322
|
+
key: props.id,
|
|
323
|
+
props,
|
|
324
|
+
rendered: props.children,
|
|
325
|
+
textValue: props.textValue ?? (typeof props.children === "string" ? props.children : ""),
|
|
326
|
+
type: "item"
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* A group of rows under a heading, which stays at the top of the list while
|
|
331
|
+
* the group's rows scroll under it.
|
|
332
|
+
*/
|
|
333
|
+
function ListSection(_props) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
ListSection.getCollectionNode = function* getCollectionNode(props) {
|
|
337
|
+
const children = [];
|
|
338
|
+
Children.forEach(props.children, (child) => {
|
|
339
|
+
if (child !== null && child !== void 0 && child !== false) children.push(child);
|
|
340
|
+
});
|
|
341
|
+
yield {
|
|
342
|
+
*childNodes() {
|
|
343
|
+
for (const element of children) yield { element };
|
|
344
|
+
},
|
|
345
|
+
hasChildNodes: true,
|
|
346
|
+
key: props.id,
|
|
347
|
+
props,
|
|
348
|
+
rendered: props.header,
|
|
349
|
+
type: "section"
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* The muted row a list shows when nothing is in it: a row's box and
|
|
354
|
+
* headline in on surface variant, with no press of its own.
|
|
355
|
+
*/
|
|
356
|
+
function EmptyRow() {
|
|
357
|
+
const $ = c(10);
|
|
358
|
+
const theme = useTheme();
|
|
359
|
+
const own = stylesOf(theme);
|
|
360
|
+
const headline = useTypeRole("bodyLarge");
|
|
361
|
+
const T0 = View;
|
|
362
|
+
let t0;
|
|
363
|
+
if ($[0] !== theme) {
|
|
364
|
+
t0 = rowStyleOf(theme, {});
|
|
365
|
+
$[0] = theme;
|
|
366
|
+
$[1] = t0;
|
|
367
|
+
} else t0 = $[1];
|
|
368
|
+
const T1 = Text;
|
|
369
|
+
const t1 = composeStyles(headline, own.empty);
|
|
370
|
+
let t2;
|
|
371
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
372
|
+
t2 = messagesFor();
|
|
373
|
+
$[2] = t2;
|
|
374
|
+
} else t2 = $[2];
|
|
375
|
+
let t3;
|
|
376
|
+
if ($[3] !== T1 || $[4] !== t1) {
|
|
377
|
+
t3 = /* @__PURE__ */ jsx(T1, {
|
|
378
|
+
style: t1,
|
|
379
|
+
children: t2.noResults
|
|
380
|
+
});
|
|
381
|
+
$[3] = T1;
|
|
382
|
+
$[4] = t1;
|
|
383
|
+
$[5] = t3;
|
|
384
|
+
} else t3 = $[5];
|
|
385
|
+
let t4;
|
|
386
|
+
if ($[6] !== T0 || $[7] !== t0 || $[8] !== t3) {
|
|
387
|
+
t4 = /* @__PURE__ */ jsx(T0, {
|
|
388
|
+
style: t0,
|
|
389
|
+
children: t3
|
|
390
|
+
});
|
|
391
|
+
$[6] = T0;
|
|
392
|
+
$[7] = t0;
|
|
393
|
+
$[8] = t3;
|
|
394
|
+
$[9] = t4;
|
|
395
|
+
} else t4 = $[9];
|
|
396
|
+
return t4;
|
|
397
|
+
}
|
|
398
|
+
function emptyState() {
|
|
399
|
+
return /* @__PURE__ */ jsx(EmptyRow, {});
|
|
400
|
+
}
|
|
401
|
+
function EmptyState() {
|
|
402
|
+
const $ = c(4);
|
|
403
|
+
const t0 = useList();
|
|
404
|
+
let t1;
|
|
405
|
+
if ($[0] !== t0) {
|
|
406
|
+
t1 = t0.renderEmptyState();
|
|
407
|
+
$[0] = t0;
|
|
408
|
+
$[1] = t1;
|
|
409
|
+
} else t1 = $[1];
|
|
410
|
+
let t2;
|
|
411
|
+
if ($[2] !== t1) {
|
|
412
|
+
t2 = /* @__PURE__ */ jsx(Fragment$1, { children: t1 });
|
|
413
|
+
$[2] = t1;
|
|
414
|
+
$[3] = t2;
|
|
415
|
+
} else t2 = $[3];
|
|
416
|
+
return t2;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The cells the `FlatList` draws, in order, where the headers among them
|
|
420
|
+
* are, and how many rows there are: the rows outside any section, and each
|
|
421
|
+
* section's header followed by its rows. The row that loads more is drawn
|
|
422
|
+
* after them all.
|
|
423
|
+
*/
|
|
424
|
+
function entriesOf(state) {
|
|
425
|
+
const entries = [];
|
|
426
|
+
const sticky = [];
|
|
427
|
+
let loader;
|
|
428
|
+
let rows = 0;
|
|
429
|
+
for (const node of state.collection) if (node.type === "loader") loader = node;
|
|
430
|
+
else if (node.type === "section") {
|
|
431
|
+
if (hasContent(node.rendered)) {
|
|
432
|
+
sticky.push(entries.length);
|
|
433
|
+
entries.push({
|
|
434
|
+
kind: "header",
|
|
435
|
+
node
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
const children = state.collection.getChildren?.(node.key) ?? node.childNodes;
|
|
439
|
+
for (const row of children) {
|
|
440
|
+
entries.push({
|
|
441
|
+
kind: "item",
|
|
442
|
+
node: row
|
|
443
|
+
});
|
|
444
|
+
rows++;
|
|
445
|
+
}
|
|
446
|
+
} else {
|
|
447
|
+
entries.push({
|
|
448
|
+
kind: "item",
|
|
449
|
+
node
|
|
450
|
+
});
|
|
451
|
+
rows++;
|
|
452
|
+
}
|
|
453
|
+
return {
|
|
454
|
+
entries,
|
|
455
|
+
loader,
|
|
456
|
+
rows,
|
|
457
|
+
sticky
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* What a list inside an Autocomplete builds its collection from: the rows
|
|
462
|
+
* the search keeps, each section with a row left in it, and the row that
|
|
463
|
+
* loads more. Each node is copied rather than handed on, as React Stately's
|
|
464
|
+
* ComboBox copies its own, since a collection numbers the nodes it holds.
|
|
465
|
+
*/
|
|
466
|
+
function filterOf(matches) {
|
|
467
|
+
return (nodes) => keptOf(nodes, matches);
|
|
468
|
+
}
|
|
469
|
+
function keptOf(nodes, matches) {
|
|
470
|
+
const kept = [];
|
|
471
|
+
for (const node of nodes) if (node.type === "section") {
|
|
472
|
+
const rows = keptOf(node.childNodes, matches);
|
|
473
|
+
if (rows.some((row) => row.type === "item")) kept.push({
|
|
474
|
+
...node,
|
|
475
|
+
childNodes: rows
|
|
476
|
+
});
|
|
477
|
+
} else if (node.type !== "item" || matches(node.textValue, node)) kept.push({ ...node });
|
|
478
|
+
return kept;
|
|
479
|
+
}
|
|
480
|
+
function keyOf({ kind, node }) {
|
|
481
|
+
return `${kind}:${String(node.key)}`;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* A row: the state layer, the ripple and the focus ring over the checkbox,
|
|
485
|
+
* the leading slot, the lines and the trailing slot, on primary container
|
|
486
|
+
* while selected. A row with nothing to do on a press, in a list that
|
|
487
|
+
* neither selects nor acts, is a `View` that only presents.
|
|
488
|
+
*/
|
|
489
|
+
function ListRowNode(t0) {
|
|
490
|
+
const $ = c(117);
|
|
491
|
+
const { node } = t0;
|
|
492
|
+
const theme = useTheme();
|
|
493
|
+
const own = stylesOf(theme);
|
|
494
|
+
const list = useList();
|
|
495
|
+
let children;
|
|
496
|
+
let leading;
|
|
497
|
+
let onAction;
|
|
498
|
+
let onBlur;
|
|
499
|
+
let onFocus;
|
|
500
|
+
let onHoverIn;
|
|
501
|
+
let onHoverOut;
|
|
502
|
+
let onLongPress;
|
|
503
|
+
let onPress;
|
|
504
|
+
let onPressIn;
|
|
505
|
+
let onPressOut;
|
|
506
|
+
let overline;
|
|
507
|
+
let props;
|
|
508
|
+
let ref;
|
|
509
|
+
let style;
|
|
510
|
+
let supporting;
|
|
511
|
+
let trailing;
|
|
512
|
+
if ($[0] !== node.props) {
|
|
513
|
+
const { children: t1, id: _id, isDisabled: _isDisabled, leading: t2, onAction: t3, onBlur: t4, onFocus: t5, onHoverIn: t6, onHoverOut: t7, onLongPress: t8, onPress: t9, onPressIn: t10, onPressOut: t11, overline: t12, ref: t13, style: t14, supporting: t15, textValue: _textValue, trailing: t16, ...t17 } = node.props;
|
|
514
|
+
children = t1;
|
|
515
|
+
leading = t2;
|
|
516
|
+
onAction = t3;
|
|
517
|
+
onBlur = t4;
|
|
518
|
+
onFocus = t5;
|
|
519
|
+
onHoverIn = t6;
|
|
520
|
+
onHoverOut = t7;
|
|
521
|
+
onLongPress = t8;
|
|
522
|
+
onPress = t9;
|
|
523
|
+
onPressIn = t10;
|
|
524
|
+
onPressOut = t11;
|
|
525
|
+
overline = t12;
|
|
526
|
+
ref = t13;
|
|
527
|
+
style = t14;
|
|
528
|
+
supporting = t15;
|
|
529
|
+
trailing = t16;
|
|
530
|
+
props = t17;
|
|
531
|
+
$[0] = node.props;
|
|
532
|
+
$[1] = children;
|
|
533
|
+
$[2] = leading;
|
|
534
|
+
$[3] = onAction;
|
|
535
|
+
$[4] = onBlur;
|
|
536
|
+
$[5] = onFocus;
|
|
537
|
+
$[6] = onHoverIn;
|
|
538
|
+
$[7] = onHoverOut;
|
|
539
|
+
$[8] = onLongPress;
|
|
540
|
+
$[9] = onPress;
|
|
541
|
+
$[10] = onPressIn;
|
|
542
|
+
$[11] = onPressOut;
|
|
543
|
+
$[12] = overline;
|
|
544
|
+
$[13] = props;
|
|
545
|
+
$[14] = ref;
|
|
546
|
+
$[15] = style;
|
|
547
|
+
$[16] = supporting;
|
|
548
|
+
$[17] = trailing;
|
|
549
|
+
} else {
|
|
550
|
+
children = $[1];
|
|
551
|
+
leading = $[2];
|
|
552
|
+
onAction = $[3];
|
|
553
|
+
onBlur = $[4];
|
|
554
|
+
onFocus = $[5];
|
|
555
|
+
onHoverIn = $[6];
|
|
556
|
+
onHoverOut = $[7];
|
|
557
|
+
onLongPress = $[8];
|
|
558
|
+
onPress = $[9];
|
|
559
|
+
onPressIn = $[10];
|
|
560
|
+
onPressOut = $[11];
|
|
561
|
+
overline = $[12];
|
|
562
|
+
props = $[13];
|
|
563
|
+
ref = $[14];
|
|
564
|
+
style = $[15];
|
|
565
|
+
supporting = $[16];
|
|
566
|
+
trailing = $[17];
|
|
567
|
+
}
|
|
568
|
+
const { selectionManager } = list.state;
|
|
569
|
+
const { key } = node;
|
|
570
|
+
let action;
|
|
571
|
+
let acts;
|
|
572
|
+
let checks;
|
|
573
|
+
let disabled;
|
|
574
|
+
let select;
|
|
575
|
+
let selectable;
|
|
576
|
+
let selected;
|
|
577
|
+
let t1;
|
|
578
|
+
if ($[18] !== key || $[19] !== list.onAction || $[20] !== onAction || $[21] !== selectionManager || $[22] !== theme) {
|
|
579
|
+
disabled = selectionManager.isDisabled(key);
|
|
580
|
+
checks = selectionManager.selectionMode !== "none";
|
|
581
|
+
let t2;
|
|
582
|
+
if ($[31] !== key || $[32] !== selectionManager) {
|
|
583
|
+
t2 = selectionManager.canSelectItem(key);
|
|
584
|
+
$[31] = key;
|
|
585
|
+
$[32] = selectionManager;
|
|
586
|
+
$[33] = t2;
|
|
587
|
+
} else t2 = $[33];
|
|
588
|
+
selectable = t2;
|
|
589
|
+
selected = checks && selectionManager.isSelected(key);
|
|
590
|
+
const listAction = list.onAction;
|
|
591
|
+
let t3;
|
|
592
|
+
if ($[34] !== key || $[35] !== listAction || $[36] !== onAction) {
|
|
593
|
+
t3 = onAction ?? (listAction === void 0 ? void 0 : () => {
|
|
594
|
+
listAction(key);
|
|
595
|
+
});
|
|
596
|
+
$[34] = key;
|
|
597
|
+
$[35] = listAction;
|
|
598
|
+
$[36] = onAction;
|
|
599
|
+
$[37] = t3;
|
|
600
|
+
} else t3 = $[37];
|
|
601
|
+
action = t3;
|
|
602
|
+
acts = action !== void 0 && (!selectable || selectionManager.isEmpty);
|
|
603
|
+
let t4;
|
|
604
|
+
if ($[38] !== key || $[39] !== selectionManager) {
|
|
605
|
+
t4 = () => {
|
|
606
|
+
selectionManager.select(key);
|
|
607
|
+
};
|
|
608
|
+
$[38] = key;
|
|
609
|
+
$[39] = selectionManager;
|
|
610
|
+
$[40] = t4;
|
|
611
|
+
} else t4 = $[40];
|
|
612
|
+
select = t4;
|
|
613
|
+
t1 = rowContentColor(theme, {
|
|
614
|
+
isDisabled: disabled,
|
|
615
|
+
isSelected: selected
|
|
616
|
+
});
|
|
617
|
+
$[18] = key;
|
|
618
|
+
$[19] = list.onAction;
|
|
619
|
+
$[20] = onAction;
|
|
620
|
+
$[21] = selectionManager;
|
|
621
|
+
$[22] = theme;
|
|
622
|
+
$[23] = action;
|
|
623
|
+
$[24] = acts;
|
|
624
|
+
$[25] = checks;
|
|
625
|
+
$[26] = disabled;
|
|
626
|
+
$[27] = select;
|
|
627
|
+
$[28] = selectable;
|
|
628
|
+
$[29] = selected;
|
|
629
|
+
$[30] = t1;
|
|
630
|
+
} else {
|
|
631
|
+
action = $[23];
|
|
632
|
+
acts = $[24];
|
|
633
|
+
checks = $[25];
|
|
634
|
+
disabled = $[26];
|
|
635
|
+
select = $[27];
|
|
636
|
+
selectable = $[28];
|
|
637
|
+
selected = $[29];
|
|
638
|
+
t1 = $[30];
|
|
639
|
+
}
|
|
640
|
+
const content = t1;
|
|
641
|
+
let t2;
|
|
642
|
+
if ($[41] !== content || $[42] !== disabled || $[43] !== onBlur || $[44] !== onFocus || $[45] !== onHoverIn || $[46] !== onHoverOut || $[47] !== onPressIn || $[48] !== onPressOut) {
|
|
643
|
+
t2 = {
|
|
644
|
+
color: content,
|
|
645
|
+
disabled,
|
|
646
|
+
onBlur,
|
|
647
|
+
onFocus,
|
|
648
|
+
onHoverIn,
|
|
649
|
+
onHoverOut,
|
|
650
|
+
onPressIn,
|
|
651
|
+
onPressOut
|
|
652
|
+
};
|
|
653
|
+
$[41] = content;
|
|
654
|
+
$[42] = disabled;
|
|
655
|
+
$[43] = onBlur;
|
|
656
|
+
$[44] = onFocus;
|
|
657
|
+
$[45] = onHoverIn;
|
|
658
|
+
$[46] = onHoverOut;
|
|
659
|
+
$[47] = onPressIn;
|
|
660
|
+
$[48] = onPressOut;
|
|
661
|
+
$[49] = t2;
|
|
662
|
+
} else t2 = $[49];
|
|
663
|
+
const feedback = usePressFeedback(t2);
|
|
664
|
+
const lead = checks ? withBox(/* @__PURE__ */ jsx(SelectBox, {
|
|
665
|
+
isDisabled: disabled,
|
|
666
|
+
isSelected: selected,
|
|
667
|
+
onPress: acts && selectable ? select : void 0
|
|
668
|
+
}), leading, own.lead) : leading;
|
|
669
|
+
let t3;
|
|
670
|
+
if ($[50] !== children || $[51] !== disabled || $[52] !== lead || $[53] !== overline || $[54] !== selected || $[55] !== supporting || $[56] !== trailing) {
|
|
671
|
+
t3 = /* @__PURE__ */ jsx(RowContent, {
|
|
672
|
+
isDisabled: disabled,
|
|
673
|
+
isSelected: selected,
|
|
674
|
+
leading: lead,
|
|
675
|
+
overline,
|
|
676
|
+
supporting,
|
|
677
|
+
trailing,
|
|
678
|
+
children
|
|
679
|
+
});
|
|
680
|
+
$[50] = children;
|
|
681
|
+
$[51] = disabled;
|
|
682
|
+
$[52] = lead;
|
|
683
|
+
$[53] = overline;
|
|
684
|
+
$[54] = selected;
|
|
685
|
+
$[55] = supporting;
|
|
686
|
+
$[56] = trailing;
|
|
687
|
+
$[57] = t3;
|
|
688
|
+
} else t3 = $[57];
|
|
689
|
+
const lines = t3;
|
|
690
|
+
let T0;
|
|
691
|
+
let t10;
|
|
692
|
+
let t11;
|
|
693
|
+
let t12;
|
|
694
|
+
let t13;
|
|
695
|
+
let t14;
|
|
696
|
+
let t4;
|
|
697
|
+
let t5;
|
|
698
|
+
let t6;
|
|
699
|
+
let t7;
|
|
700
|
+
let t8;
|
|
701
|
+
let t9;
|
|
702
|
+
if ($[58] !== action || $[59] !== acts || $[60] !== checks || $[61] !== disabled || $[62] !== feedback || $[63] !== lines || $[64] !== list.selectLabel || $[65] !== onLongPress || $[66] !== onPress || $[67] !== overline || $[68] !== props || $[69] !== ref || $[70] !== select || $[71] !== selectable || $[72] !== selected || $[73] !== style || $[74] !== supporting || $[75] !== theme) {
|
|
703
|
+
t14 = Symbol.for("react.early_return_sentinel");
|
|
704
|
+
bb0: {
|
|
705
|
+
const rowStyle = rowStyleOf(theme, {
|
|
706
|
+
isSelected: selected,
|
|
707
|
+
overline,
|
|
708
|
+
supporting
|
|
709
|
+
});
|
|
710
|
+
if (!checks && action === void 0 && onPress === void 0) {
|
|
711
|
+
t14 = /* @__PURE__ */ jsx(View, {
|
|
712
|
+
"aria-disabled": disabled || void 0,
|
|
713
|
+
ref,
|
|
714
|
+
style: composeStyles(rowStyle, style),
|
|
715
|
+
testID: props.testID,
|
|
716
|
+
children: lines
|
|
717
|
+
});
|
|
718
|
+
break bb0;
|
|
719
|
+
}
|
|
720
|
+
T0 = Pressable;
|
|
721
|
+
t4 = "button";
|
|
722
|
+
t5 = props;
|
|
723
|
+
if ($[88] !== checks || $[89] !== selected) {
|
|
724
|
+
t6 = checks ? toggleState(selected) : void 0;
|
|
725
|
+
$[88] = checks;
|
|
726
|
+
$[89] = selected;
|
|
727
|
+
$[90] = t6;
|
|
728
|
+
} else t6 = $[90];
|
|
729
|
+
if ($[91] !== list.selectLabel || $[92] !== select || $[93] !== selectable) {
|
|
730
|
+
t7 = selectable ? {
|
|
731
|
+
accessibilityActions: [{
|
|
732
|
+
label: list.selectLabel,
|
|
733
|
+
name: "select"
|
|
734
|
+
}],
|
|
735
|
+
onAccessibilityAction: selectionActionOf(select)
|
|
736
|
+
} : void 0;
|
|
737
|
+
$[91] = list.selectLabel;
|
|
738
|
+
$[92] = select;
|
|
739
|
+
$[93] = selectable;
|
|
740
|
+
$[94] = t7;
|
|
741
|
+
} else t7 = $[94];
|
|
742
|
+
t8 = feedback.handlers;
|
|
743
|
+
t9 = disabled;
|
|
744
|
+
if ($[95] !== action || $[96] !== onLongPress || $[97] !== select || $[98] !== selectable) {
|
|
745
|
+
t10 = action !== void 0 && selectable ? pressThen(onLongPress, select) : onLongPress;
|
|
746
|
+
$[95] = action;
|
|
747
|
+
$[96] = onLongPress;
|
|
748
|
+
$[97] = select;
|
|
749
|
+
$[98] = selectable;
|
|
750
|
+
$[99] = t10;
|
|
751
|
+
} else t10 = $[99];
|
|
752
|
+
const t15 = acts ? action : selectable ? select : noop;
|
|
753
|
+
if ($[100] !== onPress || $[101] !== t15) {
|
|
754
|
+
t11 = pressThen(onPress, t15);
|
|
755
|
+
$[100] = onPress;
|
|
756
|
+
$[101] = t15;
|
|
757
|
+
$[102] = t11;
|
|
758
|
+
} else t11 = $[102];
|
|
759
|
+
t12 = ref;
|
|
760
|
+
t13 = composeStyles(rowStyle, feedback.ring, feedback.ring === void 0 ? void 0 : rowStyles.ring, style);
|
|
761
|
+
}
|
|
762
|
+
$[58] = action;
|
|
763
|
+
$[59] = acts;
|
|
764
|
+
$[60] = checks;
|
|
765
|
+
$[61] = disabled;
|
|
766
|
+
$[62] = feedback;
|
|
767
|
+
$[63] = lines;
|
|
768
|
+
$[64] = list.selectLabel;
|
|
769
|
+
$[65] = onLongPress;
|
|
770
|
+
$[66] = onPress;
|
|
771
|
+
$[67] = overline;
|
|
772
|
+
$[68] = props;
|
|
773
|
+
$[69] = ref;
|
|
774
|
+
$[70] = select;
|
|
775
|
+
$[71] = selectable;
|
|
776
|
+
$[72] = selected;
|
|
777
|
+
$[73] = style;
|
|
778
|
+
$[74] = supporting;
|
|
779
|
+
$[75] = theme;
|
|
780
|
+
$[76] = T0;
|
|
781
|
+
$[77] = t10;
|
|
782
|
+
$[78] = t11;
|
|
783
|
+
$[79] = t12;
|
|
784
|
+
$[80] = t13;
|
|
785
|
+
$[81] = t14;
|
|
786
|
+
$[82] = t4;
|
|
787
|
+
$[83] = t5;
|
|
788
|
+
$[84] = t6;
|
|
789
|
+
$[85] = t7;
|
|
790
|
+
$[86] = t8;
|
|
791
|
+
$[87] = t9;
|
|
792
|
+
} else {
|
|
793
|
+
T0 = $[76];
|
|
794
|
+
t10 = $[77];
|
|
795
|
+
t11 = $[78];
|
|
796
|
+
t12 = $[79];
|
|
797
|
+
t13 = $[80];
|
|
798
|
+
t14 = $[81];
|
|
799
|
+
t4 = $[82];
|
|
800
|
+
t5 = $[83];
|
|
801
|
+
t6 = $[84];
|
|
802
|
+
t7 = $[85];
|
|
803
|
+
t8 = $[86];
|
|
804
|
+
t9 = $[87];
|
|
805
|
+
}
|
|
806
|
+
if (t14 !== Symbol.for("react.early_return_sentinel")) return t14;
|
|
807
|
+
let t15;
|
|
808
|
+
if ($[103] !== T0 || $[104] !== feedback.layer || $[105] !== lines || $[106] !== t10 || $[107] !== t11 || $[108] !== t12 || $[109] !== t13 || $[110] !== t4 || $[111] !== t5 || $[112] !== t6 || $[113] !== t7 || $[114] !== t8 || $[115] !== t9) {
|
|
809
|
+
t15 = /* @__PURE__ */ jsxs(T0, {
|
|
810
|
+
role: t4,
|
|
811
|
+
...t5,
|
|
812
|
+
...t6,
|
|
813
|
+
...t7,
|
|
814
|
+
...t8,
|
|
815
|
+
disabled: t9,
|
|
816
|
+
onLongPress: t10,
|
|
817
|
+
onPress: t11,
|
|
818
|
+
ref: t12,
|
|
819
|
+
style: t13,
|
|
820
|
+
children: [feedback.layer, lines]
|
|
821
|
+
});
|
|
822
|
+
$[103] = T0;
|
|
823
|
+
$[104] = feedback.layer;
|
|
824
|
+
$[105] = lines;
|
|
825
|
+
$[106] = t10;
|
|
826
|
+
$[107] = t11;
|
|
827
|
+
$[108] = t12;
|
|
828
|
+
$[109] = t13;
|
|
829
|
+
$[110] = t4;
|
|
830
|
+
$[111] = t5;
|
|
831
|
+
$[112] = t6;
|
|
832
|
+
$[113] = t7;
|
|
833
|
+
$[114] = t8;
|
|
834
|
+
$[115] = t9;
|
|
835
|
+
$[116] = t15;
|
|
836
|
+
} else t15 = $[116];
|
|
837
|
+
return t15;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* The row `List.LoadMore` draws: a live region, empty while idle and
|
|
841
|
+
* holding the ring while loading. Android and React Native Web say what
|
|
842
|
+
* arrives in it; iOS has no live regions, so the ring's name is said there
|
|
843
|
+
* as it appears.
|
|
844
|
+
*/
|
|
845
|
+
function LoaderRow() {
|
|
846
|
+
const $ = c(10);
|
|
847
|
+
const own = stylesOf(useTheme());
|
|
848
|
+
const { isLoading: t0, label, style, testID } = useList().loadMore ?? IDLE;
|
|
849
|
+
const isLoading = t0 === void 0 ? false : t0;
|
|
850
|
+
let t1;
|
|
851
|
+
if ($[0] !== label) {
|
|
852
|
+
t1 = label ?? messagesFor().loadingMore;
|
|
853
|
+
$[0] = label;
|
|
854
|
+
$[1] = t1;
|
|
855
|
+
} else t1 = $[1];
|
|
856
|
+
const name = t1;
|
|
857
|
+
useLoadingAnnouncement(isLoading, name);
|
|
858
|
+
const T0 = View;
|
|
859
|
+
const t2 = "polite";
|
|
860
|
+
const t3 = composeStyles(isLoading ? own.loading : styles.idle, style);
|
|
861
|
+
let t4;
|
|
862
|
+
if ($[2] !== isLoading || $[3] !== name) {
|
|
863
|
+
t4 = isLoading ? /* @__PURE__ */ jsx(ProgressIndicator, {
|
|
864
|
+
"aria-label": name,
|
|
865
|
+
diameter: LOADING_DIAMETER,
|
|
866
|
+
isIndeterminate: true,
|
|
867
|
+
variant: "circular"
|
|
868
|
+
}) : null;
|
|
869
|
+
$[2] = isLoading;
|
|
870
|
+
$[3] = name;
|
|
871
|
+
$[4] = t4;
|
|
872
|
+
} else t4 = $[4];
|
|
873
|
+
let t5;
|
|
874
|
+
if ($[5] !== T0 || $[6] !== t3 || $[7] !== t4 || $[8] !== testID) {
|
|
875
|
+
t5 = /* @__PURE__ */ jsx(T0, {
|
|
876
|
+
"aria-live": t2,
|
|
877
|
+
style: t3,
|
|
878
|
+
testID,
|
|
879
|
+
children: t4
|
|
880
|
+
});
|
|
881
|
+
$[5] = T0;
|
|
882
|
+
$[6] = t3;
|
|
883
|
+
$[7] = t4;
|
|
884
|
+
$[8] = testID;
|
|
885
|
+
$[9] = t5;
|
|
886
|
+
} else t5 = $[9];
|
|
887
|
+
return t5;
|
|
888
|
+
}
|
|
889
|
+
function loadMoreOf({ isLoading = false, onLoadMore }) {
|
|
890
|
+
return () => {
|
|
891
|
+
if (!isLoading) onLoadMore?.();
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
function noop() {}
|
|
895
|
+
/**
|
|
896
|
+
* The press handler of a row: the call site's own handler, then the row's.
|
|
897
|
+
* Built by a call rather than written inline at the prop, which is what
|
|
898
|
+
* react-perf's no-new-function-as-prop is after.
|
|
899
|
+
*/
|
|
900
|
+
function pressThen(onPress, then) {
|
|
901
|
+
return (event) => {
|
|
902
|
+
onPress?.(event);
|
|
903
|
+
then?.();
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
function renderEntry({ item }) {
|
|
907
|
+
return item.kind === "header" ? /* @__PURE__ */ jsx(SectionHeader, { node: item.node }) : /* @__PURE__ */ jsx(ListRowNode, { node: item.node });
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* How many rows a search leaves, said to a screen reader as it changes and
|
|
911
|
+
* never drawn: in a polite live region on Android and under React Native
|
|
912
|
+
* Web, and through `AccessibilityInfo` on iOS, which has no live regions,
|
|
913
|
+
* so nothing is drawn there at all.
|
|
914
|
+
*/
|
|
915
|
+
function ResultsStatus(t0) {
|
|
916
|
+
const $ = c(7);
|
|
917
|
+
const { count } = t0;
|
|
918
|
+
const t1 = useTheme();
|
|
919
|
+
let t2;
|
|
920
|
+
if ($[0] !== t1) {
|
|
921
|
+
t2 = stylesOf(t1);
|
|
922
|
+
$[0] = t1;
|
|
923
|
+
$[1] = t2;
|
|
924
|
+
} else t2 = $[1];
|
|
925
|
+
const own = t2;
|
|
926
|
+
let t3;
|
|
927
|
+
if ($[2] !== count) {
|
|
928
|
+
t3 = resultsFor(count);
|
|
929
|
+
$[2] = count;
|
|
930
|
+
$[3] = t3;
|
|
931
|
+
} else t3 = $[3];
|
|
932
|
+
const message = t3;
|
|
933
|
+
useResultsAnnouncement(message);
|
|
934
|
+
if (Platform.OS === "ios") return null;
|
|
935
|
+
let t4;
|
|
936
|
+
if ($[4] !== message || $[5] !== own.status) {
|
|
937
|
+
t4 = /* @__PURE__ */ jsx(View, {
|
|
938
|
+
"aria-live": "polite",
|
|
939
|
+
style: styles.status,
|
|
940
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
941
|
+
style: own.status,
|
|
942
|
+
children: message
|
|
943
|
+
})
|
|
944
|
+
});
|
|
945
|
+
$[4] = message;
|
|
946
|
+
$[5] = own.status;
|
|
947
|
+
$[6] = t4;
|
|
948
|
+
} else t4 = $[6];
|
|
949
|
+
return t4;
|
|
950
|
+
}
|
|
951
|
+
/** A section's heading, on the list's ground so the rows pass under it. */
|
|
952
|
+
function SectionHeader(t0) {
|
|
953
|
+
const $ = c(10);
|
|
954
|
+
const { node } = t0;
|
|
955
|
+
const own = stylesOf(useTheme());
|
|
956
|
+
const title = useTypeRole("titleSmall");
|
|
957
|
+
const { ground } = useList();
|
|
958
|
+
const T0 = View;
|
|
959
|
+
let t1;
|
|
960
|
+
if ($[0] !== ground) {
|
|
961
|
+
t1 = composeStyles({ backgroundColor: ground });
|
|
962
|
+
$[0] = ground;
|
|
963
|
+
$[1] = t1;
|
|
964
|
+
} else t1 = $[1];
|
|
965
|
+
const T1 = Text;
|
|
966
|
+
const t2 = "heading";
|
|
967
|
+
const t3 = composeStyles(title, own.header);
|
|
968
|
+
let t4;
|
|
969
|
+
if ($[2] !== T1 || $[3] !== node.rendered || $[4] !== t3) {
|
|
970
|
+
t4 = /* @__PURE__ */ jsx(T1, {
|
|
971
|
+
role: t2,
|
|
972
|
+
style: t3,
|
|
973
|
+
children: node.rendered
|
|
974
|
+
});
|
|
975
|
+
$[2] = T1;
|
|
976
|
+
$[3] = node.rendered;
|
|
977
|
+
$[4] = t3;
|
|
978
|
+
$[5] = t4;
|
|
979
|
+
} else t4 = $[5];
|
|
980
|
+
let t5;
|
|
981
|
+
if ($[6] !== T0 || $[7] !== t1 || $[8] !== t4) {
|
|
982
|
+
t5 = /* @__PURE__ */ jsx(T0, {
|
|
983
|
+
style: t1,
|
|
984
|
+
children: t4
|
|
985
|
+
});
|
|
986
|
+
$[6] = T0;
|
|
987
|
+
$[7] = t1;
|
|
988
|
+
$[8] = t4;
|
|
989
|
+
$[9] = t5;
|
|
990
|
+
} else t5 = $[9];
|
|
991
|
+
return t5;
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* The checkbox a selecting row draws, for the eye alone: the row is what a
|
|
995
|
+
* screen reader hears and presses. On a row whose press runs an action, a
|
|
996
|
+
* touch on the box selects instead, through a press of its own the size of
|
|
997
|
+
* a 48dp target, hidden from the reader as the box is.
|
|
998
|
+
*/
|
|
999
|
+
function SelectBox(t0) {
|
|
1000
|
+
const $ = c(10);
|
|
1001
|
+
const { isDisabled, isSelected, onPress } = t0;
|
|
1002
|
+
let t1;
|
|
1003
|
+
if ($[0] !== isDisabled || $[1] !== isSelected) {
|
|
1004
|
+
t1 = /* @__PURE__ */ jsx(CheckboxBox, {
|
|
1005
|
+
isDisabled,
|
|
1006
|
+
isSelected,
|
|
1007
|
+
within: BOX_SLOT
|
|
1008
|
+
});
|
|
1009
|
+
$[0] = isDisabled;
|
|
1010
|
+
$[1] = isSelected;
|
|
1011
|
+
$[2] = t1;
|
|
1012
|
+
} else t1 = $[2];
|
|
1013
|
+
const drawn = t1;
|
|
1014
|
+
if (onPress === void 0) {
|
|
1015
|
+
let t2;
|
|
1016
|
+
if ($[3] !== drawn) {
|
|
1017
|
+
t2 = /* @__PURE__ */ jsx(View, {
|
|
1018
|
+
style: styles.box,
|
|
1019
|
+
children: drawn
|
|
1020
|
+
});
|
|
1021
|
+
$[3] = drawn;
|
|
1022
|
+
$[4] = t2;
|
|
1023
|
+
} else t2 = $[4];
|
|
1024
|
+
return t2;
|
|
1025
|
+
}
|
|
1026
|
+
let t2;
|
|
1027
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1028
|
+
t2 = hitSlop(BOX_SLOT, BOX_SLOT);
|
|
1029
|
+
$[5] = t2;
|
|
1030
|
+
} else t2 = $[5];
|
|
1031
|
+
let t3;
|
|
1032
|
+
if ($[6] !== drawn || $[7] !== isDisabled || $[8] !== onPress) {
|
|
1033
|
+
t3 = /* @__PURE__ */ jsx(Pressable, {
|
|
1034
|
+
accessible: false,
|
|
1035
|
+
"aria-hidden": true,
|
|
1036
|
+
disabled: isDisabled,
|
|
1037
|
+
focusable: false,
|
|
1038
|
+
hitSlop: t2,
|
|
1039
|
+
onPress,
|
|
1040
|
+
style: styles.box,
|
|
1041
|
+
tabIndex: -1,
|
|
1042
|
+
children: drawn
|
|
1043
|
+
});
|
|
1044
|
+
$[6] = drawn;
|
|
1045
|
+
$[7] = isDisabled;
|
|
1046
|
+
$[8] = onPress;
|
|
1047
|
+
$[9] = t3;
|
|
1048
|
+
} else t3 = $[9];
|
|
1049
|
+
return t3;
|
|
1050
|
+
}
|
|
1051
|
+
function selectionActionOf(select) {
|
|
1052
|
+
return (event) => {
|
|
1053
|
+
if (event.nativeEvent.actionName === "select") select();
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
function useList() {
|
|
1057
|
+
const list = use(ListContext);
|
|
1058
|
+
if (list === null) throw new Error("A List part is drawn by the List it is in.");
|
|
1059
|
+
return list;
|
|
1060
|
+
}
|
|
1061
|
+
function useLoadingAnnouncement(isLoading, label) {
|
|
1062
|
+
const $ = c(4);
|
|
1063
|
+
const was = useRef(isLoading);
|
|
1064
|
+
let t0;
|
|
1065
|
+
let t1;
|
|
1066
|
+
if ($[0] !== isLoading || $[1] !== label) {
|
|
1067
|
+
t0 = () => {
|
|
1068
|
+
if (isLoading && !was.current && Platform.OS === "ios") AccessibilityInfo.announceForAccessibility(label);
|
|
1069
|
+
was.current = isLoading;
|
|
1070
|
+
};
|
|
1071
|
+
t1 = [isLoading, label];
|
|
1072
|
+
$[0] = isLoading;
|
|
1073
|
+
$[1] = label;
|
|
1074
|
+
$[2] = t0;
|
|
1075
|
+
$[3] = t1;
|
|
1076
|
+
} else {
|
|
1077
|
+
t0 = $[2];
|
|
1078
|
+
t1 = $[3];
|
|
1079
|
+
}
|
|
1080
|
+
useEffect(t0, t1);
|
|
1081
|
+
}
|
|
1082
|
+
function useResultsAnnouncement(message) {
|
|
1083
|
+
const $ = c(3);
|
|
1084
|
+
const was = useRef(message);
|
|
1085
|
+
let t0;
|
|
1086
|
+
let t1;
|
|
1087
|
+
if ($[0] !== message) {
|
|
1088
|
+
t0 = () => {
|
|
1089
|
+
if (message !== was.current && Platform.OS === "ios") AccessibilityInfo.announceForAccessibility(message);
|
|
1090
|
+
was.current = message;
|
|
1091
|
+
};
|
|
1092
|
+
t1 = [message];
|
|
1093
|
+
$[0] = message;
|
|
1094
|
+
$[1] = t0;
|
|
1095
|
+
$[2] = t1;
|
|
1096
|
+
} else {
|
|
1097
|
+
t0 = $[1];
|
|
1098
|
+
t1 = $[2];
|
|
1099
|
+
}
|
|
1100
|
+
useEffect(t0, t1);
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* The leading slot of a row that selects: the checkbox, then whatever the
|
|
1104
|
+
* row was given, in a row of their own so the two sit side by side.
|
|
1105
|
+
*/
|
|
1106
|
+
function withBox(box, leading, style) {
|
|
1107
|
+
return hasContent(leading) ? /* @__PURE__ */ jsxs(View, {
|
|
1108
|
+
style,
|
|
1109
|
+
children: [box, leading]
|
|
1110
|
+
}) : box;
|
|
1111
|
+
}
|
|
1112
|
+
List.Item = ListRow;
|
|
1113
|
+
List.LoadMore = ListLoadMore;
|
|
1114
|
+
List.Section = ListSection;
|
|
1115
|
+
//#endregion
|
|
1116
|
+
export { List, ListLoadMore, ListRow, ListSection };
|
|
1117
|
+
|
|
1118
|
+
//# sourceMappingURL=index.js.map
|