@sincpro/mobile-ui 3.1.0 → 3.2.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/Dialog/Dialog.EditValue.js +6 -19
- package/dist/Dialog/Dialog.Sheet.js +48 -12
- package/dist/Dialog/OverlayHost.d.ts +2 -1
- package/dist/Dialog/OverlayHost.js +36 -2
- package/dist/Dialog/SheetSurface.d.ts +19 -0
- package/dist/Dialog/SheetSurface.js +279 -225
- package/dist/Display/Display.SwipeableRow.js +30 -23
- package/dist/Display/icon-map.d.ts +10 -10
- package/dist/Display/icon-map.js +14 -10
- package/dist/Form/Form.DatePicker.js +2 -0
- package/dist/Form/Form.Input.d.ts +1 -1
- package/dist/Form/Form.Input.js +234 -215
- package/dist/Form/Form.KeyboardToolbarHost.js +78 -37
- package/dist/Form/Form.PickerField.js +133 -156
- package/dist/Form/Form.RadioButton.d.ts +1 -0
- package/dist/Form/Form.RadioButton.js +11 -122
- package/dist/Form/Form.Select.d.ts +2 -1
- package/dist/Form/Form.Select.js +183 -286
- package/dist/Form/choice-row.d.ts +15 -0
- package/dist/Form/choice-row.js +236 -0
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +13 -0
- package/dist/theme/useTheme.d.ts +4 -0
- package/dist/theme/useTheme.js +7 -12
- package/package.json +1 -1
package/dist/Form/Form.Select.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { Host, Picker } from "@expo/ui";
|
|
3
|
-
import { Actions } from "../Actions/index.js";
|
|
4
2
|
import Sheet from "../Dialog/Dialog.Sheet.js";
|
|
5
3
|
import Icon from "../Display/Display.Icon.js";
|
|
4
|
+
import { ChoiceRow } from "./choice-row.js";
|
|
6
5
|
import Pressable from "../primitives/Pressable.js";
|
|
7
|
-
import {
|
|
6
|
+
import { useTheme } from "../theme/index.js";
|
|
8
7
|
import { cn } from "../theme/tw.js";
|
|
9
8
|
import { Typography } from "../Typography/index.js";
|
|
10
9
|
import { attempt, errorMessage } from "../utils/async.js";
|
|
11
10
|
import { useRef, useState } from "react";
|
|
12
|
-
import { ActivityIndicator,
|
|
11
|
+
import { ActivityIndicator, View } from "react-native";
|
|
13
12
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
14
13
|
function SelectOptions(t0) {
|
|
15
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(12);
|
|
16
15
|
const {
|
|
17
16
|
options,
|
|
18
17
|
value,
|
|
19
18
|
blocked,
|
|
20
19
|
onSelect
|
|
21
20
|
} = t0;
|
|
22
|
-
const theme = useTheme();
|
|
23
21
|
if (!options.length) {
|
|
24
22
|
let t1;
|
|
25
23
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -33,67 +31,46 @@ function SelectOptions(t0) {
|
|
|
33
31
|
return t1;
|
|
34
32
|
}
|
|
35
33
|
let t1;
|
|
36
|
-
if ($[1] !== blocked || $[2] !== onSelect || $[3] !== options || $[4] !==
|
|
34
|
+
if ($[1] !== blocked || $[2] !== onSelect || $[3] !== options || $[4] !== value) {
|
|
37
35
|
let t2;
|
|
38
|
-
if ($[
|
|
39
|
-
t2 = (option, index) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
disabled: blocked,
|
|
50
|
-
onPress: () => onSelect(option.value),
|
|
51
|
-
style: {
|
|
52
|
-
minHeight: 48
|
|
53
|
-
},
|
|
54
|
-
children: [_jsx(Typography.Text, {
|
|
55
|
-
className: "flex-1 text-text-primary",
|
|
56
|
-
children: option.label
|
|
57
|
-
}), selected ? _jsx(Icon, {
|
|
58
|
-
color: theme.primary,
|
|
59
|
-
name: "check",
|
|
60
|
-
size: 18
|
|
61
|
-
}) : null]
|
|
62
|
-
}, `${index}:${String(option.value)}`);
|
|
63
|
-
};
|
|
64
|
-
$[7] = blocked;
|
|
65
|
-
$[8] = onSelect;
|
|
66
|
-
$[9] = theme;
|
|
67
|
-
$[10] = value;
|
|
68
|
-
$[11] = t2;
|
|
36
|
+
if ($[6] !== blocked || $[7] !== onSelect || $[8] !== value) {
|
|
37
|
+
t2 = (option, index) => _jsx(ChoiceRow, {
|
|
38
|
+
disabled: blocked,
|
|
39
|
+
label: option.label,
|
|
40
|
+
onPress: () => onSelect(option.value),
|
|
41
|
+
selected: option.value === value
|
|
42
|
+
}, `${index}:${String(option.value)}`);
|
|
43
|
+
$[6] = blocked;
|
|
44
|
+
$[7] = onSelect;
|
|
45
|
+
$[8] = value;
|
|
46
|
+
$[9] = t2;
|
|
69
47
|
} else {
|
|
70
|
-
t2 = $[
|
|
48
|
+
t2 = $[9];
|
|
71
49
|
}
|
|
72
50
|
t1 = options.map(t2);
|
|
73
51
|
$[1] = blocked;
|
|
74
52
|
$[2] = onSelect;
|
|
75
53
|
$[3] = options;
|
|
76
|
-
$[4] =
|
|
77
|
-
$[5] =
|
|
78
|
-
$[6] = t1;
|
|
54
|
+
$[4] = value;
|
|
55
|
+
$[5] = t1;
|
|
79
56
|
} else {
|
|
80
|
-
t1 = $[
|
|
57
|
+
t1 = $[5];
|
|
81
58
|
}
|
|
82
59
|
let t2;
|
|
83
|
-
if ($[
|
|
60
|
+
if ($[10] !== t1) {
|
|
84
61
|
t2 = _jsx(View, {
|
|
85
62
|
className: "gap-2",
|
|
86
63
|
children: t1
|
|
87
64
|
});
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
65
|
+
$[10] = t1;
|
|
66
|
+
$[11] = t2;
|
|
90
67
|
} else {
|
|
91
|
-
t2 = $[
|
|
68
|
+
t2 = $[11];
|
|
92
69
|
}
|
|
93
70
|
return t2;
|
|
94
71
|
}
|
|
95
72
|
function Select(t0) {
|
|
96
|
-
const $ = _c(
|
|
73
|
+
const $ = _c(71);
|
|
97
74
|
const {
|
|
98
75
|
options,
|
|
99
76
|
value,
|
|
@@ -102,58 +79,54 @@ function Select(t0) {
|
|
|
102
79
|
label,
|
|
103
80
|
placeholder: t1,
|
|
104
81
|
title,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
loading: t5,
|
|
82
|
+
disabled: t2,
|
|
83
|
+
readOnly: t3,
|
|
84
|
+
loading: t4,
|
|
109
85
|
error,
|
|
110
86
|
className,
|
|
111
87
|
testID
|
|
112
88
|
} = t0;
|
|
113
89
|
const placeholder = t1 === undefined ? "Seleccionar\u2026" : t1;
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const loading = t5 === undefined ? false : t5;
|
|
90
|
+
const disabled = t2 === undefined ? false : t2;
|
|
91
|
+
const readOnly = t3 === undefined ? false : t3;
|
|
92
|
+
const loading = t4 === undefined ? false : t4;
|
|
118
93
|
const theme = useTheme();
|
|
119
|
-
const appearance = relativeLuminance(theme.bg.card) < 0.179 ? "dark" : "light";
|
|
120
94
|
const saving = useRef(false);
|
|
121
95
|
const [open, setOpen] = useState(false);
|
|
122
96
|
const [draftValue, setDraftValue] = useState(null);
|
|
123
97
|
const [pending, setPending] = useState(false);
|
|
124
98
|
const [failure, setFailure] = useState();
|
|
125
|
-
let
|
|
99
|
+
let t5;
|
|
126
100
|
if ($[0] !== options || $[1] !== value) {
|
|
127
|
-
let
|
|
101
|
+
let t6;
|
|
128
102
|
if ($[3] !== value) {
|
|
129
|
-
|
|
103
|
+
t6 = option => option.value === value;
|
|
130
104
|
$[3] = value;
|
|
131
|
-
$[4] =
|
|
105
|
+
$[4] = t6;
|
|
132
106
|
} else {
|
|
133
|
-
|
|
107
|
+
t6 = $[4];
|
|
134
108
|
}
|
|
135
|
-
|
|
109
|
+
t5 = options.find(t6);
|
|
136
110
|
$[0] = options;
|
|
137
111
|
$[1] = value;
|
|
138
|
-
$[2] =
|
|
112
|
+
$[2] = t5;
|
|
139
113
|
} else {
|
|
140
|
-
|
|
114
|
+
t5 = $[2];
|
|
141
115
|
}
|
|
142
|
-
const selected =
|
|
143
|
-
let
|
|
116
|
+
const selected = t5;
|
|
117
|
+
let t6;
|
|
144
118
|
if ($[5] !== draftValue) {
|
|
145
|
-
|
|
119
|
+
t6 = option_0 => option_0.value === draftValue;
|
|
146
120
|
$[5] = draftValue;
|
|
147
|
-
$[6] =
|
|
121
|
+
$[6] = t6;
|
|
148
122
|
} else {
|
|
149
|
-
|
|
123
|
+
t6 = $[6];
|
|
150
124
|
}
|
|
151
|
-
const draftIndex = options.findIndex(
|
|
125
|
+
const draftIndex = options.findIndex(t6);
|
|
152
126
|
const blocked = disabled || readOnly || loading || pending;
|
|
153
|
-
|
|
154
|
-
let t8;
|
|
127
|
+
let t7;
|
|
155
128
|
if ($[7] !== onBlur) {
|
|
156
|
-
|
|
129
|
+
t7 = () => {
|
|
157
130
|
if (saving.current) {
|
|
158
131
|
return;
|
|
159
132
|
}
|
|
@@ -161,14 +134,14 @@ function Select(t0) {
|
|
|
161
134
|
onBlur?.();
|
|
162
135
|
};
|
|
163
136
|
$[7] = onBlur;
|
|
164
|
-
$[8] =
|
|
137
|
+
$[8] = t7;
|
|
165
138
|
} else {
|
|
166
|
-
|
|
139
|
+
t7 = $[8];
|
|
167
140
|
}
|
|
168
|
-
const close =
|
|
169
|
-
let
|
|
141
|
+
const close = t7;
|
|
142
|
+
let t8;
|
|
170
143
|
if ($[9] !== blocked || $[10] !== onBlur || $[11] !== onChange) {
|
|
171
|
-
|
|
144
|
+
t8 = async next => {
|
|
172
145
|
if (next === null || blocked || saving.current) {
|
|
173
146
|
return;
|
|
174
147
|
}
|
|
@@ -189,105 +162,105 @@ function Select(t0) {
|
|
|
189
162
|
$[9] = blocked;
|
|
190
163
|
$[10] = onBlur;
|
|
191
164
|
$[11] = onChange;
|
|
192
|
-
$[12] =
|
|
165
|
+
$[12] = t8;
|
|
193
166
|
} else {
|
|
194
|
-
|
|
167
|
+
t8 = $[12];
|
|
195
168
|
}
|
|
196
|
-
const commit =
|
|
197
|
-
let
|
|
169
|
+
const commit = t8;
|
|
170
|
+
let t9;
|
|
198
171
|
if ($[13] !== className) {
|
|
199
|
-
|
|
172
|
+
t9 = cn("gap-1", className);
|
|
200
173
|
$[13] = className;
|
|
201
|
-
$[14] =
|
|
174
|
+
$[14] = t9;
|
|
202
175
|
} else {
|
|
203
|
-
|
|
176
|
+
t9 = $[14];
|
|
204
177
|
}
|
|
205
|
-
let
|
|
178
|
+
let t10;
|
|
206
179
|
if ($[15] !== label) {
|
|
207
|
-
|
|
180
|
+
t10 = label ? _jsx(Typography.Text, {
|
|
208
181
|
className: "text-text-primary",
|
|
209
182
|
semibold: true,
|
|
210
183
|
variant: "bodySmall",
|
|
211
184
|
children: label
|
|
212
185
|
}) : null;
|
|
213
186
|
$[15] = label;
|
|
214
|
-
$[16] =
|
|
187
|
+
$[16] = t10;
|
|
215
188
|
} else {
|
|
216
|
-
|
|
189
|
+
t10 = $[16];
|
|
217
190
|
}
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
let
|
|
221
|
-
if ($[17] !== blocked || $[18] !== open || $[19] !==
|
|
222
|
-
|
|
191
|
+
const t11 = label ? `${label}: ${selected?.label ?? placeholder}` : selected?.label ?? placeholder;
|
|
192
|
+
const t12 = loading || pending;
|
|
193
|
+
let t13;
|
|
194
|
+
if ($[17] !== blocked || $[18] !== open || $[19] !== t12) {
|
|
195
|
+
t13 = {
|
|
223
196
|
disabled: blocked,
|
|
224
197
|
expanded: open,
|
|
225
|
-
busy:
|
|
198
|
+
busy: t12
|
|
226
199
|
};
|
|
227
200
|
$[17] = blocked;
|
|
228
201
|
$[18] = open;
|
|
229
|
-
$[19] =
|
|
230
|
-
$[20] =
|
|
202
|
+
$[19] = t12;
|
|
203
|
+
$[20] = t13;
|
|
231
204
|
} else {
|
|
232
|
-
|
|
205
|
+
t13 = $[20];
|
|
233
206
|
}
|
|
234
|
-
let
|
|
207
|
+
let t14;
|
|
235
208
|
if ($[21] !== selected?.value) {
|
|
236
|
-
|
|
209
|
+
t14 = () => {
|
|
237
210
|
setDraftValue(selected?.value ?? null);
|
|
238
211
|
setFailure(undefined);
|
|
239
212
|
setOpen(true);
|
|
240
213
|
};
|
|
241
214
|
$[21] = selected?.value;
|
|
242
|
-
$[22] =
|
|
215
|
+
$[22] = t14;
|
|
243
216
|
} else {
|
|
244
|
-
|
|
217
|
+
t14 = $[22];
|
|
245
218
|
}
|
|
246
|
-
let
|
|
219
|
+
let t15;
|
|
247
220
|
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
248
|
-
|
|
221
|
+
t15 = {
|
|
249
222
|
minHeight: 48,
|
|
250
223
|
minWidth: 48
|
|
251
224
|
};
|
|
252
|
-
$[23] =
|
|
225
|
+
$[23] = t15;
|
|
253
226
|
} else {
|
|
254
|
-
|
|
227
|
+
t15 = $[23];
|
|
255
228
|
}
|
|
256
|
-
const
|
|
257
|
-
let
|
|
258
|
-
if ($[24] !==
|
|
259
|
-
|
|
260
|
-
$[24] =
|
|
261
|
-
$[25] =
|
|
229
|
+
const t16 = selected ? "text-text-primary" : "text-text-tertiary";
|
|
230
|
+
let t17;
|
|
231
|
+
if ($[24] !== t16) {
|
|
232
|
+
t17 = cn("flex-1", t16);
|
|
233
|
+
$[24] = t16;
|
|
234
|
+
$[25] = t17;
|
|
262
235
|
} else {
|
|
263
|
-
|
|
236
|
+
t17 = $[25];
|
|
264
237
|
}
|
|
265
|
-
let
|
|
238
|
+
let t18;
|
|
266
239
|
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
267
|
-
|
|
240
|
+
t18 = {
|
|
268
241
|
paddingVertical: 12
|
|
269
242
|
};
|
|
270
|
-
$[26] =
|
|
243
|
+
$[26] = t18;
|
|
271
244
|
} else {
|
|
272
|
-
|
|
245
|
+
t18 = $[26];
|
|
273
246
|
}
|
|
274
|
-
const
|
|
275
|
-
let
|
|
276
|
-
if ($[27] !==
|
|
277
|
-
|
|
278
|
-
className:
|
|
279
|
-
style:
|
|
280
|
-
children:
|
|
247
|
+
const t19 = selected?.label ?? placeholder;
|
|
248
|
+
let t20;
|
|
249
|
+
if ($[27] !== t17 || $[28] !== t19) {
|
|
250
|
+
t20 = _jsx(Typography.Text, {
|
|
251
|
+
className: t17,
|
|
252
|
+
style: t18,
|
|
253
|
+
children: t19
|
|
281
254
|
});
|
|
282
|
-
$[27] =
|
|
283
|
-
$[28] =
|
|
284
|
-
$[29] =
|
|
255
|
+
$[27] = t17;
|
|
256
|
+
$[28] = t19;
|
|
257
|
+
$[29] = t20;
|
|
285
258
|
} else {
|
|
286
|
-
|
|
259
|
+
t20 = $[29];
|
|
287
260
|
}
|
|
288
|
-
let
|
|
261
|
+
let t21;
|
|
289
262
|
if ($[30] !== loading || $[31] !== pending || $[32] !== theme.icon || $[33] !== theme.primary) {
|
|
290
|
-
|
|
263
|
+
t21 = loading || pending ? _jsx(ActivityIndicator, {
|
|
291
264
|
color: theme.primary
|
|
292
265
|
}) : _jsx(Icon, {
|
|
293
266
|
color: theme.icon.secondary,
|
|
@@ -298,208 +271,132 @@ function Select(t0) {
|
|
|
298
271
|
$[31] = pending;
|
|
299
272
|
$[32] = theme.icon;
|
|
300
273
|
$[33] = theme.primary;
|
|
301
|
-
$[34] =
|
|
274
|
+
$[34] = t21;
|
|
302
275
|
} else {
|
|
303
|
-
|
|
276
|
+
t21 = $[34];
|
|
304
277
|
}
|
|
305
|
-
let
|
|
306
|
-
if ($[35] !== blocked || $[36] !==
|
|
307
|
-
|
|
278
|
+
let t22;
|
|
279
|
+
if ($[35] !== blocked || $[36] !== t11 || $[37] !== t13 || $[38] !== t14 || $[39] !== t20 || $[40] !== t21) {
|
|
280
|
+
t22 = _jsxs(Pressable, {
|
|
308
281
|
accessibilityHint: "Abre el selector de opciones",
|
|
309
|
-
accessibilityLabel:
|
|
282
|
+
accessibilityLabel: t11,
|
|
310
283
|
accessibilityRole: "button",
|
|
311
|
-
accessibilityState:
|
|
284
|
+
accessibilityState: t13,
|
|
312
285
|
className: "flex-row items-center gap-3 rounded-lg border border-input bg-bg-card px-3",
|
|
313
286
|
disabled: blocked,
|
|
314
|
-
onPress:
|
|
315
|
-
style:
|
|
316
|
-
children: [
|
|
287
|
+
onPress: t14,
|
|
288
|
+
style: t15,
|
|
289
|
+
children: [t20, t21]
|
|
317
290
|
});
|
|
318
291
|
$[35] = blocked;
|
|
319
|
-
$[36] =
|
|
320
|
-
$[37] =
|
|
321
|
-
$[38] =
|
|
322
|
-
$[39] =
|
|
323
|
-
$[40] =
|
|
324
|
-
$[41] =
|
|
292
|
+
$[36] = t11;
|
|
293
|
+
$[37] = t13;
|
|
294
|
+
$[38] = t14;
|
|
295
|
+
$[39] = t20;
|
|
296
|
+
$[40] = t21;
|
|
297
|
+
$[41] = t22;
|
|
325
298
|
} else {
|
|
326
|
-
|
|
299
|
+
t22 = $[41];
|
|
327
300
|
}
|
|
328
|
-
let
|
|
301
|
+
let t23;
|
|
329
302
|
if ($[42] !== error) {
|
|
330
|
-
|
|
303
|
+
t23 = error ? _jsx(Typography.Text, {
|
|
331
304
|
accessibilityLiveRegion: "polite",
|
|
332
305
|
className: "text-danger",
|
|
333
306
|
children: error
|
|
334
307
|
}) : null;
|
|
335
308
|
$[42] = error;
|
|
336
|
-
$[43] =
|
|
309
|
+
$[43] = t23;
|
|
337
310
|
} else {
|
|
338
|
-
|
|
311
|
+
t23 = $[43];
|
|
339
312
|
}
|
|
340
|
-
const
|
|
313
|
+
const t24 = !pending;
|
|
314
|
+
const t25 = title ?? label ?? "Seleccionar";
|
|
341
315
|
let t26;
|
|
342
|
-
if ($[44] !== blocked || $[45] !== commit || $[46] !==
|
|
343
|
-
t26 =
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
316
|
+
if ($[44] !== blocked || $[45] !== commit || $[46] !== draftValue || $[47] !== open || $[48] !== options || $[49] !== value) {
|
|
317
|
+
t26 = open ? _jsx(SelectOptions, {
|
|
318
|
+
blocked: blocked,
|
|
319
|
+
onSelect: next_0 => {
|
|
320
|
+
setDraftValue(next_0);
|
|
321
|
+
commit(next_0);
|
|
322
|
+
},
|
|
323
|
+
options: options,
|
|
324
|
+
value: draftValue ?? value
|
|
325
|
+
}) : null;
|
|
349
326
|
$[44] = blocked;
|
|
350
327
|
$[45] = commit;
|
|
351
|
-
$[46] =
|
|
352
|
-
$[47] =
|
|
353
|
-
$[48] =
|
|
354
|
-
$[49] =
|
|
328
|
+
$[46] = draftValue;
|
|
329
|
+
$[47] = open;
|
|
330
|
+
$[48] = options;
|
|
331
|
+
$[49] = value;
|
|
355
332
|
$[50] = t26;
|
|
356
333
|
} else {
|
|
357
334
|
t26 = $[50];
|
|
358
335
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
t28 = open && android ? _jsx(SelectOptions, {
|
|
363
|
-
blocked: blocked,
|
|
364
|
-
onSelect: next_0 => void commit(next_0),
|
|
365
|
-
options: options,
|
|
366
|
-
value: value
|
|
367
|
-
}) : null;
|
|
368
|
-
$[51] = blocked;
|
|
369
|
-
$[52] = commit;
|
|
370
|
-
$[53] = open;
|
|
371
|
-
$[54] = options;
|
|
372
|
-
$[55] = value;
|
|
373
|
-
$[56] = t28;
|
|
374
|
-
} else {
|
|
375
|
-
t28 = $[56];
|
|
376
|
-
}
|
|
377
|
-
let t29;
|
|
378
|
-
if ($[57] !== appearance || $[58] !== blocked || $[59] !== draftIndex || $[60] !== open || $[61] !== options || $[62] !== placeholder || $[63] !== testID || $[64] !== theme.primary) {
|
|
379
|
-
t29 = open && !android ? _jsx(Host, {
|
|
380
|
-
colorScheme: appearance,
|
|
381
|
-
matchContents: {
|
|
382
|
-
vertical: true
|
|
383
|
-
},
|
|
384
|
-
seedColor: theme.primary,
|
|
385
|
-
style: {
|
|
386
|
-
minHeight: 48
|
|
387
|
-
},
|
|
388
|
-
children: _jsxs(Picker, {
|
|
389
|
-
appearance: "wheel",
|
|
390
|
-
enabled: !blocked && options.length > 0,
|
|
391
|
-
onValueChange: index => {
|
|
392
|
-
if (blocked || saving.current) {
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
setDraftValue(options.find((_, itemIndex) => String(itemIndex) === index)?.value ?? null);
|
|
396
|
-
setFailure(undefined);
|
|
397
|
-
},
|
|
398
|
-
selectedValue: draftIndex < 0 ? "" : String(draftIndex),
|
|
399
|
-
testID: testID ? `${testID}-picker` : undefined,
|
|
400
|
-
children: [_jsx(Picker.Item, {
|
|
401
|
-
label: placeholder,
|
|
402
|
-
value: ""
|
|
403
|
-
}), options.map(_temp)]
|
|
404
|
-
})
|
|
405
|
-
}) : null;
|
|
406
|
-
$[57] = appearance;
|
|
407
|
-
$[58] = blocked;
|
|
408
|
-
$[59] = draftIndex;
|
|
409
|
-
$[60] = open;
|
|
410
|
-
$[61] = options;
|
|
411
|
-
$[62] = placeholder;
|
|
412
|
-
$[63] = testID;
|
|
413
|
-
$[64] = theme.primary;
|
|
414
|
-
$[65] = t29;
|
|
415
|
-
} else {
|
|
416
|
-
t29 = $[65];
|
|
417
|
-
}
|
|
418
|
-
let t30;
|
|
419
|
-
if ($[66] !== open || $[67] !== options.length) {
|
|
420
|
-
t30 = open && !android && !options.length ? _jsx(Typography.Text, {
|
|
421
|
-
children: "No hay opciones disponibles."
|
|
422
|
-
}) : null;
|
|
423
|
-
$[66] = open;
|
|
424
|
-
$[67] = options.length;
|
|
425
|
-
$[68] = t30;
|
|
426
|
-
} else {
|
|
427
|
-
t30 = $[68];
|
|
428
|
-
}
|
|
429
|
-
let t31;
|
|
430
|
-
if ($[69] !== draftIndex || $[70] !== draftValue) {
|
|
431
|
-
t31 = draftValue !== null && draftIndex < 0 ? _jsx(Typography.Text, {
|
|
336
|
+
let t27;
|
|
337
|
+
if ($[51] !== draftIndex || $[52] !== draftValue) {
|
|
338
|
+
t27 = draftValue !== null && draftIndex < 0 ? _jsx(Typography.Text, {
|
|
432
339
|
accessibilityRole: "alert",
|
|
433
340
|
className: "text-danger",
|
|
434
341
|
children: "La opci\xF3n ya no est\xE1 disponible. Selecciona otra."
|
|
435
342
|
}) : null;
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
343
|
+
$[51] = draftIndex;
|
|
344
|
+
$[52] = draftValue;
|
|
345
|
+
$[53] = t27;
|
|
439
346
|
} else {
|
|
440
|
-
|
|
347
|
+
t27 = $[53];
|
|
441
348
|
}
|
|
442
|
-
let
|
|
443
|
-
if ($[
|
|
444
|
-
|
|
349
|
+
let t28;
|
|
350
|
+
if ($[54] !== failure) {
|
|
351
|
+
t28 = failure ? _jsx(Typography.Text, {
|
|
445
352
|
accessibilityLiveRegion: "polite",
|
|
446
353
|
accessibilityRole: "alert",
|
|
447
354
|
className: "pt-3 text-danger",
|
|
448
355
|
selectable: true,
|
|
449
356
|
children: failure
|
|
450
357
|
}) : null;
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
358
|
+
$[54] = failure;
|
|
359
|
+
$[55] = t28;
|
|
453
360
|
} else {
|
|
454
|
-
|
|
361
|
+
t28 = $[55];
|
|
455
362
|
}
|
|
456
|
-
let
|
|
457
|
-
if ($[
|
|
458
|
-
|
|
459
|
-
dismissible:
|
|
460
|
-
footer: t26,
|
|
363
|
+
let t29;
|
|
364
|
+
if ($[56] !== close || $[57] !== open || $[58] !== t24 || $[59] !== t25 || $[60] !== t26 || $[61] !== t27 || $[62] !== t28) {
|
|
365
|
+
t29 = _jsxs(Sheet, {
|
|
366
|
+
dismissible: t24,
|
|
461
367
|
onClose: close,
|
|
462
|
-
title:
|
|
368
|
+
title: t25,
|
|
463
369
|
visible: open,
|
|
464
|
-
children: [
|
|
370
|
+
children: [t26, t27, t28]
|
|
465
371
|
});
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[82] = t31;
|
|
475
|
-
$[83] = t32;
|
|
476
|
-
$[84] = t33;
|
|
372
|
+
$[56] = close;
|
|
373
|
+
$[57] = open;
|
|
374
|
+
$[58] = t24;
|
|
375
|
+
$[59] = t25;
|
|
376
|
+
$[60] = t26;
|
|
377
|
+
$[61] = t27;
|
|
378
|
+
$[62] = t28;
|
|
379
|
+
$[63] = t29;
|
|
477
380
|
} else {
|
|
478
|
-
|
|
381
|
+
t29 = $[63];
|
|
479
382
|
}
|
|
480
|
-
let
|
|
481
|
-
if ($[
|
|
482
|
-
|
|
483
|
-
className:
|
|
383
|
+
let t30;
|
|
384
|
+
if ($[64] !== t10 || $[65] !== t22 || $[66] !== t23 || $[67] !== t29 || $[68] !== t9 || $[69] !== testID) {
|
|
385
|
+
t30 = _jsxs(View, {
|
|
386
|
+
className: t9,
|
|
484
387
|
testID: testID,
|
|
485
|
-
children: [
|
|
388
|
+
children: [t10, t22, t23, t29]
|
|
486
389
|
});
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
390
|
+
$[64] = t10;
|
|
391
|
+
$[65] = t22;
|
|
392
|
+
$[66] = t23;
|
|
393
|
+
$[67] = t29;
|
|
394
|
+
$[68] = t9;
|
|
395
|
+
$[69] = testID;
|
|
396
|
+
$[70] = t30;
|
|
494
397
|
} else {
|
|
495
|
-
|
|
398
|
+
t30 = $[70];
|
|
496
399
|
}
|
|
497
|
-
return
|
|
498
|
-
}
|
|
499
|
-
function _temp(option_1, index_0) {
|
|
500
|
-
return _jsx(Picker.Item, {
|
|
501
|
-
label: option_1.label,
|
|
502
|
-
value: String(index_0)
|
|
503
|
-
}, String(index_0));
|
|
400
|
+
return t30;
|
|
504
401
|
}
|
|
505
402
|
export default Select;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ChoiceRowProps {
|
|
2
|
+
label: string;
|
|
3
|
+
/** Secondary line, e.g. a client's document number. */
|
|
4
|
+
description?: string;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
look?: "card" | "list";
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The single-choice row of the DS: the same radio mark, 48-point target, wrapping label and
|
|
13
|
+
* `radio` semantics on Android and iOS, whether it lists two options or two thousand.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ChoiceRow({ label, description, selected, onPress, disabled, look, testID, }: ChoiceRowProps): import("react").JSX.Element;
|