@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,52 +1,96 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { createContext, useContext, useMemo, useState } from "react";
|
|
3
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
3
4
|
const Context = createContext(null);
|
|
4
|
-
export function ListViewProvider(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
5
|
+
export function ListViewProvider(t0) {
|
|
6
|
+
const $ = _c(21);
|
|
7
|
+
const {
|
|
8
|
+
name,
|
|
9
|
+
description,
|
|
10
|
+
items,
|
|
11
|
+
isLoading: t1,
|
|
12
|
+
hasError: t2,
|
|
13
|
+
errorMessage,
|
|
14
|
+
readonly: t3,
|
|
15
|
+
onRefresh,
|
|
16
|
+
onRetry,
|
|
17
|
+
onPressItem,
|
|
18
|
+
onDeleteItem,
|
|
19
|
+
onSearch,
|
|
20
|
+
onBack,
|
|
21
|
+
onLoadMore,
|
|
22
|
+
loadingMore: t4,
|
|
23
|
+
hasMore: t5,
|
|
24
|
+
children
|
|
25
|
+
} = t0;
|
|
26
|
+
const isLoading = t1 === undefined ? false : t1;
|
|
27
|
+
const hasError = t2 === undefined ? false : t2;
|
|
28
|
+
const readonly = t3 === undefined ? false : t3;
|
|
29
|
+
const loadingMore = t4 === undefined ? false : t4;
|
|
30
|
+
const hasMore = t5 === undefined ? true : t5;
|
|
31
|
+
const [showRefreshing, setShowRefreshing] = useState(false);
|
|
32
|
+
let t6;
|
|
33
|
+
if ($[0] !== description || $[1] !== errorMessage || $[2] !== hasError || $[3] !== hasMore || $[4] !== isLoading || $[5] !== items || $[6] !== loadingMore || $[7] !== name || $[8] !== onBack || $[9] !== onDeleteItem || $[10] !== onLoadMore || $[11] !== onPressItem || $[12] !== onRefresh || $[13] !== onRetry || $[14] !== onSearch || $[15] !== readonly || $[16] !== showRefreshing) {
|
|
34
|
+
t6 = {
|
|
35
|
+
name,
|
|
36
|
+
description,
|
|
37
|
+
items,
|
|
38
|
+
isLoading,
|
|
39
|
+
hasError,
|
|
40
|
+
errorMessage,
|
|
41
|
+
readonly,
|
|
42
|
+
showRefreshing,
|
|
43
|
+
setShowRefreshing,
|
|
44
|
+
onRefresh,
|
|
45
|
+
onRetry,
|
|
46
|
+
onPressItem,
|
|
47
|
+
onDeleteItem,
|
|
48
|
+
onSearch,
|
|
49
|
+
onBack,
|
|
50
|
+
onLoadMore,
|
|
51
|
+
loadingMore,
|
|
52
|
+
hasMore
|
|
53
|
+
};
|
|
54
|
+
$[0] = description;
|
|
55
|
+
$[1] = errorMessage;
|
|
56
|
+
$[2] = hasError;
|
|
57
|
+
$[3] = hasMore;
|
|
58
|
+
$[4] = isLoading;
|
|
59
|
+
$[5] = items;
|
|
60
|
+
$[6] = loadingMore;
|
|
61
|
+
$[7] = name;
|
|
62
|
+
$[8] = onBack;
|
|
63
|
+
$[9] = onDeleteItem;
|
|
64
|
+
$[10] = onLoadMore;
|
|
65
|
+
$[11] = onPressItem;
|
|
66
|
+
$[12] = onRefresh;
|
|
67
|
+
$[13] = onRetry;
|
|
68
|
+
$[14] = onSearch;
|
|
69
|
+
$[15] = readonly;
|
|
70
|
+
$[16] = showRefreshing;
|
|
71
|
+
$[17] = t6;
|
|
72
|
+
} else {
|
|
73
|
+
t6 = $[17];
|
|
74
|
+
}
|
|
75
|
+
const value = t6;
|
|
76
|
+
let t7;
|
|
77
|
+
if ($[18] !== children || $[19] !== value) {
|
|
78
|
+
t7 = _jsx(Context.Provider, {
|
|
79
|
+
value: value,
|
|
80
|
+
children: children
|
|
81
|
+
});
|
|
82
|
+
$[18] = children;
|
|
83
|
+
$[19] = value;
|
|
84
|
+
$[20] = t7;
|
|
85
|
+
} else {
|
|
86
|
+
t7 = $[20];
|
|
87
|
+
}
|
|
88
|
+
return t7;
|
|
45
89
|
}
|
|
46
90
|
export function useListView() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
91
|
+
const context = useContext(Context);
|
|
92
|
+
if (!context) {
|
|
93
|
+
throw new Error("useListView must be used within ListViewV2");
|
|
94
|
+
}
|
|
95
|
+
return context;
|
|
52
96
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterChip } from "../Actions/Actions.FilterButton.js";
|
|
2
2
|
import { type SearchHistoryProps } from "../Display/Display.SearchHistory.js";
|
|
3
|
+
import type { SafeAreaEdge } from "../layouts/edges.js";
|
|
3
4
|
import type { AppBarBackground } from "../Navigation/Navigation.AppBar.js";
|
|
5
|
+
import type { SearchBarProps } from "../Navigation/Navigation.SearchBar.js";
|
|
4
6
|
import { type SegmentedControlProps } from "../Navigation/Navigation.SegmentedControl.js";
|
|
5
7
|
import { type IRowItem } from "./types/IListView.js";
|
|
6
|
-
import
|
|
8
|
+
import { ReactNode, type Ref } from "react";
|
|
7
9
|
import { type ScrollViewProps, StyleProp, ViewStyle } from "react-native";
|
|
8
|
-
import type { Edge } from "react-native-safe-area-context";
|
|
9
10
|
interface ListViewProps<T> {
|
|
10
11
|
name: string;
|
|
11
12
|
description?: string;
|
|
@@ -28,11 +29,11 @@ interface ListViewProps<T> {
|
|
|
28
29
|
hasMore?: boolean;
|
|
29
30
|
backgroundColor?: string;
|
|
30
31
|
withContainer?: boolean;
|
|
31
|
-
edges?:
|
|
32
|
+
edges?: SafeAreaEdge[];
|
|
32
33
|
children: ReactNode;
|
|
33
34
|
}
|
|
34
35
|
export declare function refreshListData(onRefresh: (() => Promise<void>) | undefined, onRefreshError: ((error: unknown) => void) | undefined, setShowRefreshing: (value: boolean) => void): Promise<void>;
|
|
35
|
-
declare function ListViewRoot<T>({ name, description, items, isLoading, hasError, errorMessage, readonly, onRefresh, onRefreshError, onRetry, onPressItem, onDeleteItem, onSearch, onBack, onLoadMore, loadingMore, hasMore, backgroundColor, withContainer, edges, children, }: ListViewProps<T>):
|
|
36
|
+
declare function ListViewRoot<T>({ name, description, items, isLoading, hasError, errorMessage, readonly, onRefresh, onRefreshError, onRetry, onPressItem, onDeleteItem, onSearch, onBack, onLoadMore, loadingMore, hasMore, backgroundColor, withContainer, edges, children, }: ListViewProps<T>): import("react").JSX.Element;
|
|
36
37
|
interface HeaderProps {
|
|
37
38
|
/** Reserve the top inset; disable when the host already handles it. */
|
|
38
39
|
safeArea?: boolean;
|
|
@@ -55,60 +56,96 @@ interface HeaderProps {
|
|
|
55
56
|
*/
|
|
56
57
|
topSpacing?: number;
|
|
57
58
|
}
|
|
58
|
-
declare function Header({ safeArea, variant, tone, actions, children, background, topSpacing, }: HeaderProps):
|
|
59
|
-
declare function HeaderSearch({ searchQuery }: {
|
|
59
|
+
declare function Header({ safeArea, variant, tone, actions, children, background, topSpacing, }: HeaderProps): import("react").JSX.Element;
|
|
60
|
+
declare function HeaderSearch({ searchQuery, textVariant, }: {
|
|
60
61
|
searchQuery?: string;
|
|
61
|
-
|
|
62
|
+
/** Typography variant of the query; see `Navigation.SearchBar` (defaults to 17). */
|
|
63
|
+
textVariant?: SearchBarProps["textVariant"];
|
|
64
|
+
}): import("react").JSX.Element | null;
|
|
62
65
|
declare function HeaderActions({ children }: {
|
|
63
66
|
children: ReactNode;
|
|
64
|
-
}):
|
|
67
|
+
}): import("react").JSX.Element;
|
|
65
68
|
/** Secondary action bar docked below the AppBar — use for Save/Cancel, filter chips, etc. */
|
|
66
69
|
declare function HeaderActionsBar({ children }: {
|
|
67
70
|
children: ReactNode;
|
|
68
|
-
}):
|
|
71
|
+
}): import("react").JSX.Element;
|
|
69
72
|
/**
|
|
70
73
|
* Tab-like segmented switch for the header subheader (e.g. "Activos" / "Archivados").
|
|
71
74
|
* Use as a child of `<ListViewV2.Header>` — it lands in the AppBar subheader slot.
|
|
72
75
|
*/
|
|
73
|
-
declare function HeaderSegmented<T extends string>(props: SegmentedControlProps<T>):
|
|
76
|
+
declare function HeaderSegmented<T extends string>(props: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
74
77
|
/**
|
|
75
78
|
* Recent-searches list. Render as a SIBLING of the Header (like Filters/ActionsBar) —
|
|
76
79
|
* typically while the search query is empty. Delegates to `Display.SearchHistory`.
|
|
77
80
|
*/
|
|
78
|
-
declare function HeaderSearchHistory(props: SearchHistoryProps):
|
|
81
|
+
declare function HeaderSearchHistory(props: SearchHistoryProps): import("react").JSX.Element;
|
|
79
82
|
declare function HeaderFilters({ children }: {
|
|
80
83
|
children: ReactNode;
|
|
81
|
-
}):
|
|
82
|
-
interface FilterChipProps {
|
|
83
|
-
label: string;
|
|
84
|
-
active?: boolean;
|
|
85
|
-
onPress: () => void;
|
|
86
|
-
}
|
|
87
|
-
declare function FilterChip({ label, active, onPress }: FilterChipProps): React.JSX.Element;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
88
85
|
declare function FilterChips({ children }: {
|
|
89
86
|
children: ReactNode;
|
|
90
|
-
}):
|
|
87
|
+
}): import("react").JSX.Element;
|
|
91
88
|
type ListScrollProps = Pick<ScrollViewProps, "keyboardShouldPersistTaps" | "keyboardDismissMode" | "testID">;
|
|
92
|
-
|
|
93
|
-
interface
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
89
|
+
/** A row on screen, as the screen knows it: the original item and its position. */
|
|
90
|
+
export interface ListViewVisibleRow<T> {
|
|
91
|
+
item: T;
|
|
92
|
+
index: number;
|
|
97
93
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Recycling and viewport options in the DS vocabulary. The engine behind them
|
|
96
|
+
* (FlashList v2 today) can change without touching a screen.
|
|
97
|
+
*/
|
|
98
|
+
export interface ListViewTuning<T> {
|
|
99
|
+
/** Pixels rendered ahead of the viewport. Raise it only if fast flings show blank rows. */
|
|
100
|
+
drawDistance?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Rows with different layouts (header row, card, compact) return different types so
|
|
103
|
+
* the engine recycles each one into a view with the same shape.
|
|
104
|
+
*/
|
|
105
|
+
rowType?: (item: T, index: number) => string | number;
|
|
106
|
+
/** A value outside `items` that changes how rows look (selection, mode). */
|
|
107
|
+
extraData?: unknown;
|
|
108
|
+
/** Row the list opens at. */
|
|
109
|
+
initialIndex?: number;
|
|
110
|
+
/** Distance to the end, in viewport heights, that triggers `onLoadMore`. Default 0.5. */
|
|
111
|
+
loadMoreThreshold?: number;
|
|
112
|
+
/** Keep the rows on screen in place when items are added above them (chat, timeline). */
|
|
113
|
+
keepVisiblePosition?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Rows that became visible, with the original items. Pass it from the first render:
|
|
116
|
+
* the engine wires viewability once.
|
|
117
|
+
*/
|
|
118
|
+
onVisibleRowsChange?: (rows: ListViewVisibleRow<T>[]) => void;
|
|
119
|
+
/** Percent of a row that must be on screen to count as visible. */
|
|
120
|
+
visiblePercent?: number;
|
|
121
|
+
}
|
|
122
|
+
export interface ListViewScrollOptions {
|
|
123
|
+
/** Default true. */
|
|
124
|
+
animated?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** Imperative scroll for `ListViewV2.Content ref`. Calls are ignored while no list is shown. */
|
|
127
|
+
export interface ListViewHandle {
|
|
128
|
+
scrollToIndex(index: number, options?: ListViewScrollOptions & {
|
|
129
|
+
position?: "start" | "center" | "end";
|
|
130
|
+
}): Promise<void>;
|
|
131
|
+
scrollToTop(options?: ListViewScrollOptions): void;
|
|
132
|
+
scrollToEnd(options?: ListViewScrollOptions): void;
|
|
133
|
+
}
|
|
134
|
+
interface ContentProps<T> extends ListScrollProps {
|
|
135
|
+
/** Custom row renderer. Keep it stable with `useCallback`; rows go in `memo`. */
|
|
103
136
|
children?: (item: T, row: IRowItem<T>) => ReactNode;
|
|
104
137
|
withMargin?: boolean;
|
|
105
|
-
|
|
138
|
+
tuning?: ListViewTuning<T>;
|
|
139
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
140
|
+
ref?: Ref<ListViewHandle>;
|
|
141
|
+
}
|
|
142
|
+
declare function Content<T = unknown>({ children, withMargin, keyboardShouldPersistTaps, keyboardDismissMode, testID, tuning, contentContainerStyle, ref, }: ContentProps<T>): import("react").JSX.Element;
|
|
106
143
|
declare function Footer({ children }: {
|
|
107
144
|
children: ReactNode;
|
|
108
|
-
}):
|
|
145
|
+
}): import("react").JSX.Element | null;
|
|
109
146
|
declare function FloatingButton({ children }: {
|
|
110
147
|
children: ReactNode;
|
|
111
|
-
}):
|
|
148
|
+
}): import("react").JSX.Element;
|
|
112
149
|
interface RowRootProps {
|
|
113
150
|
children: ReactNode;
|
|
114
151
|
onPress?: () => void;
|
|
@@ -117,45 +154,49 @@ interface RowRootProps {
|
|
|
117
154
|
style?: StyleProp<ViewStyle>;
|
|
118
155
|
backgroundColor?: string;
|
|
119
156
|
}
|
|
120
|
-
declare function RowRoot({ children, onPress, onLongPress, showDivider, style, backgroundColor, }: RowRootProps):
|
|
157
|
+
declare function RowRoot({ children, onPress, onLongPress, showDivider, style, backgroundColor, }: RowRootProps): import("react").JSX.Element;
|
|
121
158
|
interface RowAvatarProps {
|
|
122
159
|
children: ReactNode;
|
|
123
160
|
style?: StyleProp<ViewStyle>;
|
|
124
161
|
}
|
|
125
|
-
declare function RowAvatar({ children, style }: RowAvatarProps):
|
|
162
|
+
declare function RowAvatar({ children, style }: RowAvatarProps): import("react").JSX.Element;
|
|
126
163
|
interface RowContentProps {
|
|
127
164
|
children: ReactNode;
|
|
128
165
|
style?: StyleProp<ViewStyle>;
|
|
129
166
|
}
|
|
130
|
-
declare function RowContent({ children, style }: RowContentProps):
|
|
167
|
+
declare function RowContent({ children, style }: RowContentProps): import("react").JSX.Element;
|
|
131
168
|
interface RowTitleProps {
|
|
132
169
|
children: ReactNode;
|
|
133
170
|
badge?: ReactNode;
|
|
134
171
|
rightComponent?: ReactNode;
|
|
135
172
|
numberOfLines?: number;
|
|
136
173
|
}
|
|
137
|
-
declare function RowTitle({ children, badge, rightComponent, numberOfLines }: RowTitleProps):
|
|
174
|
+
declare function RowTitle({ children, badge, rightComponent, numberOfLines }: RowTitleProps): import("react").JSX.Element;
|
|
138
175
|
interface RowSubtitleProps {
|
|
139
176
|
children: ReactNode;
|
|
140
177
|
className?: string;
|
|
141
178
|
}
|
|
142
|
-
declare function RowSubtitle({ children, className }: RowSubtitleProps):
|
|
179
|
+
declare function RowSubtitle({ children, className }: RowSubtitleProps): import("react").JSX.Element;
|
|
143
180
|
interface RowFooterProps {
|
|
144
181
|
left?: ReactNode;
|
|
145
182
|
right?: ReactNode;
|
|
146
183
|
children?: ReactNode;
|
|
147
184
|
}
|
|
148
|
-
declare function RowFooter({ left, right, children }: RowFooterProps):
|
|
185
|
+
declare function RowFooter({ left, right, children }: RowFooterProps): import("react").JSX.Element;
|
|
149
186
|
interface RowActionsProps {
|
|
150
187
|
children: ReactNode;
|
|
151
188
|
style?: StyleProp<ViewStyle>;
|
|
152
189
|
}
|
|
153
|
-
declare function RowActions({ children, style }: RowActionsProps):
|
|
190
|
+
declare function RowActions({ children, style }: RowActionsProps): import("react").JSX.Element;
|
|
154
191
|
interface RowActionButtonProps {
|
|
155
192
|
icon: ReactNode;
|
|
156
193
|
onPress?: () => void;
|
|
194
|
+
/** What the action does, read by screen readers, e.g. "Más opciones". */
|
|
195
|
+
accessibilityLabel?: string;
|
|
196
|
+
testID?: string;
|
|
157
197
|
}
|
|
158
|
-
|
|
198
|
+
/** Compact icon action inside a row. */
|
|
199
|
+
declare function RowActionButton({ icon, onPress, accessibilityLabel, testID, }: RowActionButtonProps): import("react").JSX.Element;
|
|
159
200
|
/**
|
|
160
201
|
* Screen container for a collection (list / index / search results).
|
|
161
202
|
* Owns safe-area, the FlashList (pagination + pull-to-refresh), record count, and the
|
|
@@ -169,7 +210,8 @@ declare function RowActionButton({ icon, onPress }: RowActionButtonProps): React
|
|
|
169
210
|
* .Header.Segmented — tab-like switch in the subheader (Activos / Archivados)
|
|
170
211
|
* .Header.Filters(.Chips/.Chip) — horizontal filter pills (SIBLING below the header)
|
|
171
212
|
* .Header.ActionsBar — SIBLING bar below the header (bulk select, etc.)
|
|
172
|
-
* ListViewV2.Content —
|
|
213
|
+
* ListViewV2.Content — virtualized body; `children` is an optional custom row renderer,
|
|
214
|
+
* `tuning` the recycling options, `ref` a `ListViewHandle`
|
|
173
215
|
* .Content.Row(.Avatar/.Content/.Title/.Subtitle/.Footer/.Actions/.ActionButton)
|
|
174
216
|
* ListViewV2.Footer — pinned footer (hidden when empty)
|
|
175
217
|
* ListViewV2.FloatingButton — absolute FAB overlay
|
|
@@ -188,7 +230,6 @@ export declare const ListViewV2: {
|
|
|
188
230
|
};
|
|
189
231
|
};
|
|
190
232
|
Content: typeof Content & {
|
|
191
|
-
List: typeof ContentList;
|
|
192
233
|
Row: typeof RowRoot & {
|
|
193
234
|
Avatar: typeof RowAvatar;
|
|
194
235
|
Content: typeof RowContent;
|