@sincpro/mobile-ui 3.0.1 → 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/Actions/Actions.Button.d.ts +6 -6
- package/dist/Actions/Actions.Button.js +650 -180
- package/dist/Actions/Actions.Dock.d.ts +1 -1
- package/dist/Actions/Actions.Dock.js +297 -18
- package/dist/Actions/Actions.FAB.js +100 -12
- package/dist/Actions/Actions.FilterButton.d.ts +17 -0
- package/dist/Actions/Actions.FilterButton.js +263 -33
- package/dist/Actions/Actions.IconButton.d.ts +1 -0
- package/dist/Actions/Actions.IconButton.js +196 -33
- package/dist/Actions/index.js +13 -13
- package/dist/Dialog/Confirmation.context.js +82 -16
- package/dist/Dialog/Dialog.ActionSheet.js +200 -41
- package/dist/Dialog/Dialog.Confirmation.js +168 -31
- package/dist/Dialog/Dialog.EditValue.js +437 -62
- package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
- package/dist/Dialog/Dialog.Sheet.js +267 -15
- package/dist/Dialog/OverlayHost.d.ts +24 -0
- package/dist/Dialog/OverlayHost.js +230 -0
- package/dist/Dialog/SheetSurface.d.ts +43 -0
- package/dist/Dialog/SheetSurface.js +495 -0
- package/dist/Dialog/dialog-actions.d.ts +17 -0
- package/dist/Dialog/dialog-actions.js +59 -0
- package/dist/Dialog/index.d.ts +4 -1
- package/dist/Dialog/index.js +8 -7
- package/dist/Dialog/overlay.store.d.ts +24 -0
- package/dist/Dialog/overlay.store.js +59 -0
- package/dist/Dialog/requestConfirmation.js +20 -10
- package/dist/Display/Display.Accordion.js +185 -13
- package/dist/Display/Display.AmountSummary.js +206 -15
- package/dist/Display/Display.Avatar.js +93 -31
- package/dist/Display/Display.AvatarGroup.js +132 -17
- package/dist/Display/Display.Badge.d.ts +18 -2
- package/dist/Display/Display.Badge.js +117 -49
- package/dist/Display/Display.Card.js +163 -26
- package/dist/Display/Display.Carousel.js +459 -105
- package/dist/Display/Display.Chip.d.ts +4 -1
- package/dist/Display/Display.Chip.js +165 -31
- package/dist/Display/Display.CircleButton.d.ts +1 -0
- package/dist/Display/Display.CircleButton.js +86 -27
- package/dist/Display/Display.CopyableText.js +289 -66
- package/dist/Display/Display.CountRecords.js +60 -3
- package/dist/Display/Display.DataTable.js +123 -13
- package/dist/Display/Display.Date.js +243 -33
- package/dist/Display/Display.Divider.d.ts +10 -10
- package/dist/Display/Display.Divider.js +67 -20
- package/dist/Display/Display.ExpoImage.js +97 -8
- package/dist/Display/Display.GradientSurface.d.ts +9 -4
- package/dist/Display/Display.GradientSurface.js +196 -46
- package/dist/Display/Display.Icon.js +129 -15
- package/dist/Display/Display.IconBadge.js +95 -25
- package/dist/Display/Display.Image.d.ts +7 -1
- package/dist/Display/Display.Image.js +344 -39
- package/dist/Display/Display.KeyValue.js +90 -5
- package/dist/Display/Display.ListGroup.js +181 -9
- package/dist/Display/Display.ListItem.js +324 -28
- package/dist/Display/Display.Logo.js +84 -29
- package/dist/Display/Display.MediaCard.js +125 -4
- package/dist/Display/Display.MediaEmbed.d.ts +0 -5
- package/dist/Display/Display.MediaEmbed.js +170 -26
- package/dist/Display/Display.MenuButton.d.ts +2 -2
- package/dist/Display/Display.MenuButton.js +380 -94
- package/dist/Display/Display.MenuCard.js +122 -18
- package/dist/Display/Display.MenuGrid.js +43 -3
- package/dist/Display/Display.Monetary.js +90 -5
- package/dist/Display/Display.Pattern.js +306 -47
- package/dist/Display/Display.PriceTag.js +117 -14
- package/dist/Display/Display.ProductCard.js +154 -4
- package/dist/Display/Display.Rating.js +92 -11
- package/dist/Display/Display.SearchHistory.js +132 -6
- package/dist/Display/Display.SectionHeader.d.ts +5 -1
- package/dist/Display/Display.SectionHeader.js +125 -12
- package/dist/Display/Display.Stat.js +62 -3
- package/dist/Display/Display.StatCard.js +131 -7
- package/dist/Display/Display.StatusBadge.d.ts +29 -0
- package/dist/Display/Display.StatusBadge.js +68 -0
- package/dist/Display/Display.StatusDot.js +93 -18
- package/dist/Display/Display.Story.js +285 -35
- package/dist/Display/Display.StoryTray.js +354 -34
- package/dist/Display/Display.StoryViewer.js +571 -72
- package/dist/Display/Display.SwipeableRow.js +148 -20
- package/dist/Display/Display.Tag.d.ts +4 -1
- package/dist/Display/Display.Tag.js +66 -4
- package/dist/Display/Display.Timeline.js +102 -13
- package/dist/Display/Display.Tooltip.js +122 -26
- package/dist/Display/chevron.d.ts +6 -0
- package/dist/Display/chevron.js +32 -0
- package/dist/Display/count-badge.d.ts +21 -0
- package/dist/Display/count-badge.js +124 -0
- package/dist/Display/group-title.d.ts +10 -0
- package/dist/Display/group-title.js +53 -0
- package/dist/Display/icon-font.d.ts +3 -0
- package/dist/Display/icon-font.ios.d.ts +3 -0
- package/dist/Display/icon-font.ios.js +4 -0
- package/dist/Display/icon-font.js +7 -0
- package/dist/Display/icon-glyphs.d.ts +2 -0
- package/dist/Display/icon-glyphs.js +87 -0
- package/dist/Display/icon-map.d.ts +15 -11
- package/dist/Display/icon-map.js +344 -84
- package/dist/Display/icon-registry.d.ts +21 -0
- package/dist/Display/icon-registry.js +21 -0
- package/dist/Display/index.d.ts +6 -1
- package/dist/Display/index.js +53 -48
- package/dist/Display/pill.d.ts +16 -0
- package/dist/Display/pill.js +47 -0
- package/dist/Feedback/ErrorBoundary.js +35 -23
- package/dist/Feedback/Feedback.Banner.js +202 -24
- package/dist/Feedback/Feedback.DomainSplashScreen.js +246 -70
- package/dist/Feedback/Feedback.Empty.js +54 -3
- package/dist/Feedback/Feedback.EmptyState.js +114 -5
- package/dist/Feedback/Feedback.Error.d.ts +1 -1
- package/dist/Feedback/Feedback.Error.js +130 -5
- package/dist/Feedback/Feedback.Loading.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.js +70 -3
- package/dist/Feedback/Feedback.PermissionCard.js +161 -5
- package/dist/Feedback/Feedback.Progress.js +199 -41
- package/dist/Feedback/Feedback.ProgressCircle.js +184 -12
- package/dist/Feedback/Feedback.Skeleton.js +149 -36
- package/dist/Feedback/Feedback.Spinner.js +407 -79
- package/dist/Feedback/Feedback.Splash.js +240 -33
- package/dist/Feedback/Feedback.State.d.ts +17 -0
- package/dist/Feedback/Feedback.State.js +104 -0
- package/dist/Feedback/Toast.context.js +883 -167
- package/dist/Feedback/index.d.ts +3 -0
- package/dist/Feedback/index.js +15 -13
- package/dist/Form/Form.Checkbox.js +212 -22
- package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
- package/dist/Form/Form.ControlledCheckbox.js +46 -4
- package/dist/Form/Form.ControlledDropdown.d.ts +1 -1
- package/dist/Form/Form.ControlledDropdown.js +62 -4
- package/dist/Form/Form.ControlledInput.d.ts +4 -3
- package/dist/Form/Form.ControlledInput.js +72 -4
- package/dist/Form/Form.ControlledMonetaryInput.d.ts +6 -3
- package/dist/Form/Form.ControlledMonetaryInput.js +50 -4
- package/dist/Form/Form.ControlledRadioButton.d.ts +2 -2
- package/dist/Form/Form.ControlledRadioButton.js +45 -4
- package/dist/Form/Form.DatePicker.js +507 -107
- package/dist/Form/Form.Dropdown.js +303 -52
- package/dist/Form/Form.ErrorSummary.js +236 -44
- package/dist/Form/Form.Field.d.ts +24 -0
- package/dist/Form/Form.Field.js +55 -0
- package/dist/Form/Form.FractionalQuantityInput.js +508 -96
- package/dist/Form/Form.Input.d.ts +17 -3
- package/dist/Form/Form.Input.js +497 -29
- package/dist/Form/Form.KeyboardForm.d.ts +22 -8
- package/dist/Form/Form.KeyboardForm.js +83 -8
- package/dist/Form/Form.KeyboardToolbarHost.d.ts +14 -0
- package/dist/Form/Form.KeyboardToolbarHost.js +223 -0
- package/dist/Form/Form.MonetaryInput.js +164 -17
- package/dist/Form/Form.PickerField.d.ts +31 -0
- package/dist/Form/Form.PickerField.js +539 -0
- package/dist/Form/Form.PinInput.js +150 -15
- package/dist/Form/Form.QuantitySelector.js +229 -25
- package/dist/Form/Form.RadioButton.d.ts +1 -0
- package/dist/Form/Form.RadioButton.js +26 -29
- package/dist/Form/Form.Select.d.ts +2 -1
- package/dist/Form/Form.Select.js +388 -60
- package/dist/Form/Form.Slider.js +133 -10
- package/dist/Form/Form.Switch.js +99 -4
- package/dist/Form/choice-row.d.ts +15 -0
- package/dist/Form/choice-row.js +236 -0
- package/dist/Form/index.d.ts +11 -6
- package/dist/Form/index.js +26 -27
- package/dist/Form/input-text.d.ts +7 -0
- package/dist/Form/input-text.js +18 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
- package/dist/Navigation/Navigation.AppBar.js +535 -99
- package/dist/Navigation/Navigation.BottomNav.js +363 -98
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
- package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
- package/dist/Navigation/Navigation.FloatingBar.js +71 -11
- package/dist/Navigation/Navigation.Menu.js +309 -95
- package/dist/Navigation/Navigation.MenuSection.js +80 -11
- package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
- package/dist/Navigation/Navigation.RowItem.js +93 -8
- package/dist/Navigation/Navigation.Search.js +241 -27
- package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
- package/dist/Navigation/Navigation.SearchBar.js +218 -29
- package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
- package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
- package/dist/Navigation/Navigation.Steps.js +105 -11
- package/dist/Navigation/Navigation.Tabs.js +449 -41
- package/dist/Navigation/index.d.ts +9 -4
- package/dist/Navigation/index.js +13 -13
- package/dist/Typography/Typography.Heading.js +33 -3
- package/dist/Typography/Typography.SelectableText.js +95 -7
- package/dist/Typography/Typography.Text.d.ts +4 -2
- package/dist/Typography/Typography.Text.js +217 -7
- package/dist/Typography/index.js +3 -3
- package/dist/branding.js +29 -13
- package/dist/icons/AddItemIcon.js +76 -2
- package/dist/icons/ArrangeCircle.js +82 -2
- package/dist/icons/ArrowDownIcon.js +63 -3
- package/dist/icons/ArrowUpIcon.js +63 -3
- package/dist/icons/BoxIcon.js +64 -2
- package/dist/icons/BoxTimeIcon.js +63 -2
- package/dist/icons/CalendarIcon.js +145 -2
- package/dist/icons/CardIcon.js +80 -2
- package/dist/icons/CashierIcon.js +39 -2
- package/dist/icons/CreditIcon.js +76 -3
- package/dist/icons/DuoIcon.js +75 -2
- package/dist/icons/HomeIcon.js +39 -2
- package/dist/icons/HomeIconOutlined.js +53 -2
- package/dist/icons/LogoIcon.js +87 -2
- package/dist/icons/MoneyReceiveIcon.js +86 -2
- package/dist/icons/PinIcon.js +39 -2
- package/dist/icons/ProfileIcon.js +47 -2
- package/dist/icons/SettingsIcon.js +114 -2
- package/dist/icons/SinpeIcon.js +60 -2
- package/dist/icons/ToggleOffIcon.js +53 -2
- package/dist/icons/WalletMoneyIcon.js +81 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -2
- package/dist/layouts/AuthContainer.d.ts +4 -5
- package/dist/layouts/AuthContainer.js +231 -7
- package/dist/layouts/BottomInset.js +4 -1
- package/dist/layouts/Container.d.ts +2 -2
- package/dist/layouts/Container.js +45 -3
- package/dist/layouts/GradientContainer.js +37 -5
- package/dist/layouts/PlainLayout.js +19 -3
- package/dist/layouts/ScrollContainer.d.ts +14 -9
- package/dist/layouts/ScrollContainer.js +125 -4
- package/dist/layouts/edges.d.ts +2 -0
- package/dist/layouts/edges.js +1 -0
- package/dist/primitives/AspectRatio.js +75 -3
- package/dist/primitives/Box.js +45 -3
- package/dist/primitives/Pressable.js +95 -5
- package/dist/primitives/Row.js +84 -13
- package/dist/primitives/Spacer.js +42 -5
- package/dist/primitives/Stack.js +66 -7
- package/dist/primitives/index.js +1 -1
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +33 -18
- package/dist/theme/build.js +118 -87
- package/dist/theme/color.js +87 -87
- package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
- package/dist/theme/components/ThemedActivityIndicator.js +35 -3
- package/dist/theme/components/index.js +1 -0
- package/dist/theme/contrast.js +32 -33
- package/dist/theme/css-vars.js +71 -75
- package/dist/theme/dark.js +116 -97
- package/dist/theme/default.js +116 -97
- package/dist/theme/define.js +16 -12
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +7 -6
- package/dist/theme/on-dark-surface.d.ts +12 -0
- package/dist/theme/on-dark-surface.js +13 -0
- package/dist/theme/theme.js +1 -0
- package/dist/theme/tw.js +3 -1
- package/dist/theme/types.js +0 -18
- package/dist/theme/typography.d.ts +1 -1
- package/dist/theme/typography.js +337 -303
- package/dist/theme/useTheme.d.ts +4 -0
- package/dist/theme/useTheme.js +7 -3
- package/dist/theme/useThemeVars.d.ts +9 -0
- package/dist/theme/useThemeVars.js +23 -0
- package/dist/theme/validate.js +175 -166
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/motion.js +30 -13
- package/dist/utils/async.d.ts +14 -0
- package/dist/utils/async.js +22 -0
- package/dist/utils/criteria.js +66 -85
- package/dist/utils/date.d.ts +8 -2
- package/dist/utils/date.js +63 -50
- package/dist/utils/image.js +8 -8
- package/dist/utils/intl.d.ts +1 -0
- package/dist/utils/intl.js +13 -0
- package/dist/utils/keys.js +3 -5
- package/dist/utils/monetary.d.ts +1 -0
- package/dist/utils/monetary.js +28 -24
- package/dist/utils/progress.js +2 -3
- package/dist/utils/quantity.js +25 -26
- package/dist/utils/reorder.js +11 -20
- package/dist/utils/search.d.ts +4 -0
- package/dist/utils/search.js +12 -0
- package/dist/utils/serializer.js +38 -38
- package/dist/utils/useReducedMotion.js +32 -30
- package/dist/views/AppSplashView.js +117 -3
- package/dist/views/AuthFormView.d.ts +4 -5
- package/dist/views/AuthFormView.js +119 -11
- package/dist/views/FormViewV2.context.js +75 -23
- package/dist/views/FormViewV2.d.ts +4 -5
- package/dist/views/FormViewV2.js +658 -92
- package/dist/views/ListViewV2.context.js +91 -47
- package/dist/views/ListViewV2.d.ts +84 -43
- package/dist/views/ListViewV2.js +1350 -200
- package/dist/views/Wizard/Wizard.context.js +248 -84
- package/dist/views/Wizard/Wizard.js +260 -67
- package/dist/views/types/IListView.js +34 -31
- package/dist/widgets/CollectionOptions.js +557 -138
- package/dist/widgets/FilterBar.js +159 -7
- package/dist/widgets/FilterBuilder.js +375 -102
- package/dist/widgets/JSONViewer.js +275 -129
- package/dist/widgets/PromoBanner.js +336 -42
- package/dist/widgets/PromoModal.d.ts +2 -2
- package/dist/widgets/PromoModal.js +389 -62
- package/dist/widgets/QueryChoice.js +150 -8
- package/dist/widgets/QuickActions.js +120 -31
- package/dist/widgets/ReorderableList.js +399 -128
- package/dist/widgets/TimeZoneSelectorModal.js +458 -51
- package/dist/widgets/index.js +3 -3
- package/package.json +6 -1
- package/tailwind.preset.js +7 -5
- package/dist/Form/Form.InputField.d.ts +0 -10
- package/dist/Form/Form.InputField.js +0 -38
- package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
- package/dist/Form/Form.KeyboardToolbar.js +0 -66
- package/dist/Form/Form.PasswordInput.d.ts +0 -9
- package/dist/Form/Form.PasswordInput.js +0 -17
- package/dist/Form/Form.TextInput.d.ts +0 -8
- package/dist/Form/Form.TextInput.js +0 -8
- package/dist/primitives/BaseButton.d.ts +0 -150
- package/dist/primitives/BaseButton.js +0 -229
- package/dist/utils/useSheetTranslation.d.ts +0 -5
- package/dist/utils/useSheetTranslation.js +0 -23
|
@@ -1,54 +1,213 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import Button from "../Actions/Actions.Button.js";
|
|
2
3
|
import Sheet from "./Dialog.Sheet.js";
|
|
3
4
|
import Icon from "../Display/Display.Icon.js";
|
|
4
5
|
import Pressable from "../primitives/Pressable.js";
|
|
5
6
|
import { useTheme } from "../theme/index.js";
|
|
6
7
|
import { cn } from "../theme/tw.js";
|
|
7
8
|
import { Typography } from "../Typography/index.js";
|
|
9
|
+
import { attempt, errorMessage } from "../utils/async.js";
|
|
8
10
|
import { useRef, useState } from "react";
|
|
9
11
|
import { ActivityIndicator, View } from "react-native";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
13
|
+
function ActionSheet(t0) {
|
|
14
|
+
const $ = _c(43);
|
|
15
|
+
const {
|
|
16
|
+
visible,
|
|
17
|
+
onClose,
|
|
18
|
+
actions,
|
|
19
|
+
title,
|
|
20
|
+
message,
|
|
21
|
+
cancelLabel: t1,
|
|
22
|
+
testID
|
|
23
|
+
} = t0;
|
|
24
|
+
const cancelLabel = t1 === undefined ? "Cancelar" : t1;
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
const saving = useRef(false);
|
|
27
|
+
const [pending, setPending] = useState();
|
|
28
|
+
const [error, setError] = useState();
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] !== onClose) {
|
|
31
|
+
t2 = () => {
|
|
32
|
+
if (saving.current) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
setError(undefined);
|
|
36
|
+
onClose();
|
|
20
37
|
};
|
|
38
|
+
$[0] = onClose;
|
|
39
|
+
$[1] = t2;
|
|
40
|
+
} else {
|
|
41
|
+
t2 = $[1];
|
|
42
|
+
}
|
|
43
|
+
const close = t2;
|
|
44
|
+
let T0;
|
|
45
|
+
let t10;
|
|
46
|
+
let t3;
|
|
47
|
+
let t4;
|
|
48
|
+
let t5;
|
|
49
|
+
let t6;
|
|
50
|
+
let t7;
|
|
51
|
+
let t8;
|
|
52
|
+
let t9;
|
|
53
|
+
if ($[2] !== actions || $[3] !== cancelLabel || $[4] !== close || $[5] !== message || $[6] !== onClose || $[7] !== pending || $[8] !== testID || $[9] !== theme || $[10] !== title || $[11] !== visible) {
|
|
21
54
|
const choose = async (action, index) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
saving.current = false;
|
|
38
|
-
setPending(undefined);
|
|
39
|
-
}
|
|
55
|
+
if (action.disabled || saving.current) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
saving.current = true;
|
|
59
|
+
setPending(index);
|
|
60
|
+
setError(undefined);
|
|
61
|
+
const result = await attempt(async () => {
|
|
62
|
+
await action.onPress();
|
|
63
|
+
onClose();
|
|
64
|
+
});
|
|
65
|
+
saving.current = false;
|
|
66
|
+
setPending(undefined);
|
|
67
|
+
if (!result.ok) {
|
|
68
|
+
setError(errorMessage(result.error, "No se pudo completar la acci\xF3n. Vuelve a intentarlo."));
|
|
69
|
+
}
|
|
40
70
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
71
|
+
T0 = Sheet;
|
|
72
|
+
t3 = pending === undefined;
|
|
73
|
+
const t11 = pending !== undefined;
|
|
74
|
+
if ($[21] !== cancelLabel || $[22] !== close || $[23] !== t11) {
|
|
75
|
+
t4 = _jsx(Button, {
|
|
76
|
+
className: "self-center",
|
|
77
|
+
disabled: t11,
|
|
78
|
+
onPress: close,
|
|
79
|
+
title: cancelLabel,
|
|
80
|
+
variant: "link"
|
|
81
|
+
});
|
|
82
|
+
$[21] = cancelLabel;
|
|
83
|
+
$[22] = close;
|
|
84
|
+
$[23] = t11;
|
|
85
|
+
$[24] = t4;
|
|
86
|
+
} else {
|
|
87
|
+
t4 = $[24];
|
|
88
|
+
}
|
|
89
|
+
t5 = close;
|
|
90
|
+
t6 = testID;
|
|
91
|
+
t7 = title;
|
|
92
|
+
t8 = visible;
|
|
93
|
+
if ($[25] !== message) {
|
|
94
|
+
t9 = message ? _jsx(Typography.Text, {
|
|
95
|
+
className: "pb-3 text-text-secondary",
|
|
96
|
+
children: message
|
|
97
|
+
}) : null;
|
|
98
|
+
$[25] = message;
|
|
99
|
+
$[26] = t9;
|
|
100
|
+
} else {
|
|
101
|
+
t9 = $[26];
|
|
102
|
+
}
|
|
103
|
+
t10 = actions.map((action_0, index_0) => _jsxs(Pressable, {
|
|
104
|
+
accessibilityLabel: action_0.label,
|
|
105
|
+
accessibilityRole: "button",
|
|
106
|
+
accessibilityState: {
|
|
107
|
+
disabled: !!action_0.disabled || pending !== undefined,
|
|
108
|
+
busy: pending === index_0
|
|
109
|
+
},
|
|
110
|
+
className: cn("flex-row items-center gap-3 py-3", index_0 < actions.length - 1 && "border-b border-border-light"),
|
|
111
|
+
disabled: action_0.disabled || pending !== undefined,
|
|
112
|
+
onPress: () => void choose(action_0, index_0),
|
|
113
|
+
style: {
|
|
114
|
+
minHeight: 48
|
|
115
|
+
},
|
|
116
|
+
children: [action_0.icon ? _jsx(Icon, {
|
|
117
|
+
color: action_0.disabled ? theme.icon.disabled : action_0.destructive ? theme.danger : theme.icon.primary,
|
|
118
|
+
name: action_0.icon,
|
|
119
|
+
size: 20
|
|
120
|
+
}) : null, _jsx(Typography.Text, {
|
|
121
|
+
className: cn("flex-1", action_0.disabled ? "text-text-disabled" : action_0.destructive ? "text-danger" : "text-text-primary"),
|
|
122
|
+
semibold: true,
|
|
123
|
+
children: action_0.label
|
|
124
|
+
}), pending === index_0 ? _jsx(ActivityIndicator, {
|
|
125
|
+
color: theme.primary
|
|
126
|
+
}) : null]
|
|
127
|
+
}, `${action_0.label}-${index_0}`));
|
|
128
|
+
$[2] = actions;
|
|
129
|
+
$[3] = cancelLabel;
|
|
130
|
+
$[4] = close;
|
|
131
|
+
$[5] = message;
|
|
132
|
+
$[6] = onClose;
|
|
133
|
+
$[7] = pending;
|
|
134
|
+
$[8] = testID;
|
|
135
|
+
$[9] = theme;
|
|
136
|
+
$[10] = title;
|
|
137
|
+
$[11] = visible;
|
|
138
|
+
$[12] = T0;
|
|
139
|
+
$[13] = t10;
|
|
140
|
+
$[14] = t3;
|
|
141
|
+
$[15] = t4;
|
|
142
|
+
$[16] = t5;
|
|
143
|
+
$[17] = t6;
|
|
144
|
+
$[18] = t7;
|
|
145
|
+
$[19] = t8;
|
|
146
|
+
$[20] = t9;
|
|
147
|
+
} else {
|
|
148
|
+
T0 = $[12];
|
|
149
|
+
t10 = $[13];
|
|
150
|
+
t3 = $[14];
|
|
151
|
+
t4 = $[15];
|
|
152
|
+
t5 = $[16];
|
|
153
|
+
t6 = $[17];
|
|
154
|
+
t7 = $[18];
|
|
155
|
+
t8 = $[19];
|
|
156
|
+
t9 = $[20];
|
|
157
|
+
}
|
|
158
|
+
let t11;
|
|
159
|
+
if ($[27] !== actions.length) {
|
|
160
|
+
t11 = !actions.length ? _jsx(Typography.Text, {
|
|
161
|
+
children: "No hay acciones disponibles."
|
|
162
|
+
}) : null;
|
|
163
|
+
$[27] = actions.length;
|
|
164
|
+
$[28] = t11;
|
|
165
|
+
} else {
|
|
166
|
+
t11 = $[28];
|
|
167
|
+
}
|
|
168
|
+
let t12;
|
|
169
|
+
if ($[29] !== error) {
|
|
170
|
+
t12 = error ? _jsx(View, {
|
|
171
|
+
className: "pt-3",
|
|
172
|
+
children: _jsx(Typography.Text, {
|
|
173
|
+
accessibilityLiveRegion: "polite",
|
|
174
|
+
accessibilityRole: "alert",
|
|
175
|
+
className: "text-danger",
|
|
176
|
+
selectable: true,
|
|
177
|
+
children: error
|
|
178
|
+
})
|
|
179
|
+
}) : null;
|
|
180
|
+
$[29] = error;
|
|
181
|
+
$[30] = t12;
|
|
182
|
+
} else {
|
|
183
|
+
t12 = $[30];
|
|
184
|
+
}
|
|
185
|
+
let t13;
|
|
186
|
+
if ($[31] !== T0 || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t3 || $[36] !== t4 || $[37] !== t5 || $[38] !== t6 || $[39] !== t7 || $[40] !== t8 || $[41] !== t9) {
|
|
187
|
+
t13 = _jsxs(T0, {
|
|
188
|
+
dismissible: t3,
|
|
189
|
+
footer: t4,
|
|
190
|
+
onClose: t5,
|
|
191
|
+
testID: t6,
|
|
192
|
+
title: t7,
|
|
193
|
+
visible: t8,
|
|
194
|
+
children: [t9, t10, t11, t12]
|
|
195
|
+
});
|
|
196
|
+
$[31] = T0;
|
|
197
|
+
$[32] = t10;
|
|
198
|
+
$[33] = t11;
|
|
199
|
+
$[34] = t12;
|
|
200
|
+
$[35] = t3;
|
|
201
|
+
$[36] = t4;
|
|
202
|
+
$[37] = t5;
|
|
203
|
+
$[38] = t6;
|
|
204
|
+
$[39] = t7;
|
|
205
|
+
$[40] = t8;
|
|
206
|
+
$[41] = t9;
|
|
207
|
+
$[42] = t13;
|
|
208
|
+
} else {
|
|
209
|
+
t13 = $[42];
|
|
210
|
+
}
|
|
211
|
+
return t13;
|
|
53
212
|
}
|
|
54
213
|
export default ActionSheet;
|
|
@@ -1,39 +1,176 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Actions } from "../Actions/index.js";
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
2
|
import Sheet from "./Dialog.Sheet.js";
|
|
3
|
+
import { DialogActions } from "./dialog-actions.js";
|
|
4
4
|
import { Typography } from "../Typography/index.js";
|
|
5
|
+
import { attempt, errorMessage } from "../utils/async.js";
|
|
5
6
|
import { useRef, useState } from "react";
|
|
6
|
-
import {
|
|
7
|
-
function Confirmation(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
8
|
+
function Confirmation(t0) {
|
|
9
|
+
const $ = _c(33);
|
|
10
|
+
const {
|
|
11
|
+
visible,
|
|
12
|
+
onClose,
|
|
13
|
+
onConfirm,
|
|
14
|
+
title: t1,
|
|
15
|
+
message: t2,
|
|
16
|
+
confirmText: t3,
|
|
17
|
+
cancelText: t4,
|
|
18
|
+
destructive: t5,
|
|
19
|
+
children,
|
|
20
|
+
testID
|
|
21
|
+
} = t0;
|
|
22
|
+
const title = t1 === undefined ? "Descartar cambios" : t1;
|
|
23
|
+
const message = t2 === undefined ? "\xBFQuieres descartar los cambios realizados?" : t2;
|
|
24
|
+
const confirmText = t3 === undefined ? "Descartar cambios" : t3;
|
|
25
|
+
const cancelText = t4 === undefined ? "Seguir editando" : t4;
|
|
26
|
+
const destructive = t5 === undefined ? true : t5;
|
|
27
|
+
const saving = useRef(false);
|
|
28
|
+
const [pending, setPending] = useState(false);
|
|
29
|
+
const [error, setError] = useState();
|
|
30
|
+
let t6;
|
|
31
|
+
if ($[0] !== onClose) {
|
|
32
|
+
t6 = () => {
|
|
33
|
+
if (saving.current) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
setError(undefined);
|
|
37
|
+
onClose();
|
|
38
|
+
};
|
|
39
|
+
$[0] = onClose;
|
|
40
|
+
$[1] = t6;
|
|
41
|
+
} else {
|
|
42
|
+
t6 = $[1];
|
|
43
|
+
}
|
|
44
|
+
const close = t6;
|
|
45
|
+
let t7;
|
|
46
|
+
if ($[2] !== onClose || $[3] !== onConfirm) {
|
|
47
|
+
t7 = async () => {
|
|
48
|
+
if (saving.current) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
saving.current = true;
|
|
52
|
+
setPending(true);
|
|
53
|
+
setError(undefined);
|
|
54
|
+
const result = await attempt(async () => {
|
|
55
|
+
await onConfirm();
|
|
15
56
|
onClose();
|
|
57
|
+
});
|
|
58
|
+
saving.current = false;
|
|
59
|
+
setPending(false);
|
|
60
|
+
if (!result.ok) {
|
|
61
|
+
setError(errorMessage(result.error, "No se pudo completar la operaci\xF3n. Vuelve a intentarlo."));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
$[2] = onClose;
|
|
65
|
+
$[3] = onConfirm;
|
|
66
|
+
$[4] = t7;
|
|
67
|
+
} else {
|
|
68
|
+
t7 = $[4];
|
|
69
|
+
}
|
|
70
|
+
const confirm = t7;
|
|
71
|
+
const t8 = !pending;
|
|
72
|
+
let t9;
|
|
73
|
+
if ($[5] !== cancelText || $[6] !== close || $[7] !== pending) {
|
|
74
|
+
t9 = {
|
|
75
|
+
disabled: pending,
|
|
76
|
+
onPress: close,
|
|
77
|
+
title: cancelText
|
|
16
78
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
79
|
+
$[5] = cancelText;
|
|
80
|
+
$[6] = close;
|
|
81
|
+
$[7] = pending;
|
|
82
|
+
$[8] = t9;
|
|
83
|
+
} else {
|
|
84
|
+
t9 = $[8];
|
|
85
|
+
}
|
|
86
|
+
let t10;
|
|
87
|
+
if ($[9] !== confirm) {
|
|
88
|
+
t10 = () => void confirm();
|
|
89
|
+
$[9] = confirm;
|
|
90
|
+
$[10] = t10;
|
|
91
|
+
} else {
|
|
92
|
+
t10 = $[10];
|
|
93
|
+
}
|
|
94
|
+
let t11;
|
|
95
|
+
if ($[11] !== confirmText || $[12] !== pending || $[13] !== t10) {
|
|
96
|
+
t11 = {
|
|
97
|
+
disabled: pending,
|
|
98
|
+
loading: pending,
|
|
99
|
+
onPress: t10,
|
|
100
|
+
title: confirmText
|
|
36
101
|
};
|
|
37
|
-
|
|
102
|
+
$[11] = confirmText;
|
|
103
|
+
$[12] = pending;
|
|
104
|
+
$[13] = t10;
|
|
105
|
+
$[14] = t11;
|
|
106
|
+
} else {
|
|
107
|
+
t11 = $[14];
|
|
108
|
+
}
|
|
109
|
+
const t12 = destructive ? "outlineDanger" : "primary";
|
|
110
|
+
let t13;
|
|
111
|
+
if ($[15] !== t11 || $[16] !== t12 || $[17] !== t9) {
|
|
112
|
+
t13 = _jsx(DialogActions, {
|
|
113
|
+
cancel: t9,
|
|
114
|
+
confirm: t11,
|
|
115
|
+
confirmVariant: t12
|
|
116
|
+
});
|
|
117
|
+
$[15] = t11;
|
|
118
|
+
$[16] = t12;
|
|
119
|
+
$[17] = t9;
|
|
120
|
+
$[18] = t13;
|
|
121
|
+
} else {
|
|
122
|
+
t13 = $[18];
|
|
123
|
+
}
|
|
124
|
+
let t14;
|
|
125
|
+
if ($[19] !== message) {
|
|
126
|
+
t14 = _jsx(Typography.Text, {
|
|
127
|
+
className: "text-text-secondary",
|
|
128
|
+
selectable: true,
|
|
129
|
+
children: message
|
|
130
|
+
});
|
|
131
|
+
$[19] = message;
|
|
132
|
+
$[20] = t14;
|
|
133
|
+
} else {
|
|
134
|
+
t14 = $[20];
|
|
135
|
+
}
|
|
136
|
+
let t15;
|
|
137
|
+
if ($[21] !== error) {
|
|
138
|
+
t15 = error ? _jsx(Typography.Text, {
|
|
139
|
+
accessibilityLiveRegion: "polite",
|
|
140
|
+
accessibilityRole: "alert",
|
|
141
|
+
className: "pt-3 text-danger",
|
|
142
|
+
selectable: true,
|
|
143
|
+
children: error
|
|
144
|
+
}) : null;
|
|
145
|
+
$[21] = error;
|
|
146
|
+
$[22] = t15;
|
|
147
|
+
} else {
|
|
148
|
+
t15 = $[22];
|
|
149
|
+
}
|
|
150
|
+
let t16;
|
|
151
|
+
if ($[23] !== children || $[24] !== close || $[25] !== t13 || $[26] !== t14 || $[27] !== t15 || $[28] !== t8 || $[29] !== testID || $[30] !== title || $[31] !== visible) {
|
|
152
|
+
t16 = _jsxs(Sheet, {
|
|
153
|
+
dismissible: t8,
|
|
154
|
+
footer: t13,
|
|
155
|
+
onClose: close,
|
|
156
|
+
testID: testID,
|
|
157
|
+
title: title,
|
|
158
|
+
visible: visible,
|
|
159
|
+
children: [t14, children, t15]
|
|
160
|
+
});
|
|
161
|
+
$[23] = children;
|
|
162
|
+
$[24] = close;
|
|
163
|
+
$[25] = t13;
|
|
164
|
+
$[26] = t14;
|
|
165
|
+
$[27] = t15;
|
|
166
|
+
$[28] = t8;
|
|
167
|
+
$[29] = testID;
|
|
168
|
+
$[30] = title;
|
|
169
|
+
$[31] = visible;
|
|
170
|
+
$[32] = t16;
|
|
171
|
+
} else {
|
|
172
|
+
t16 = $[32];
|
|
173
|
+
}
|
|
174
|
+
return t16;
|
|
38
175
|
}
|
|
39
176
|
export default Confirmation;
|