@tallyui/components 3.20.0 → 4.0.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/index.d.ts +1114 -90
- package/dist/index.js +8077 -3352
- package/package.json +10 -11
- package/src/cart/cart-charge-line.tsx +58 -0
- package/src/cart/cart-columns-form.tsx +98 -0
- package/src/cart/cart-columns.tsx +49 -18
- package/src/cart/cart-foot.tsx +7 -2
- package/src/cart/cart-line-strip.tsx +59 -0
- package/src/cart/cart-line.tsx +20 -8
- package/src/cart/cart-note-row.tsx +30 -0
- package/src/cart/cart-panel.tsx +9 -1
- package/src/cart/cart-row-motion.tsx +125 -0
- package/src/cart/cart-total.tsx +44 -15
- package/src/cart/index.ts +2 -1
- package/src/checkout/cash-tendered.tsx +8 -7
- package/src/checkout/change-display.tsx +2 -1
- package/src/checkout/index.ts +1 -1
- package/src/checkout/payment-selector.tsx +6 -2
- package/src/checkout/payment-types.test-d.ts +28 -0
- package/src/customer/address-editor.tsx +87 -0
- package/src/customer/address-fields.tsx +120 -0
- package/src/customer/customer-dropdown.tsx +200 -0
- package/src/customer/customer-editor.tsx +99 -0
- package/src/customer/customer-form.tsx +39 -5
- package/src/customer/customer-picker.tsx +38 -14
- package/src/customer/customers-list.tsx +83 -0
- package/src/customer/index.ts +5 -0
- package/src/filter/filter-pills.tsx +63 -0
- package/src/i18n/locales/en/components.json +85 -0
- package/src/index.ts +40 -2
- package/src/input/decimal-entry.ts +21 -0
- package/src/layout/checkout-layout.tsx +1 -1
- package/src/layout/live-tab-screen.tsx +1 -1
- package/src/layout/pos-layout.tsx +80 -4
- package/src/layout/settings-layout.tsx +1 -1
- package/src/layout/store-settings-choice-screen.tsx +1 -1
- package/src/lib/current-row.ts +13 -0
- package/src/lib/money-input.ts +16 -0
- package/src/lib/motion.ts +22 -0
- package/src/lib/use-reduced-motion.ts +20 -0
- package/src/order/index.ts +1 -1
- package/src/order/order-detail.tsx +123 -5
- package/src/order/order-filter-bar.tsx +7 -57
- package/src/order/order-status-badge.tsx +42 -19
- package/src/order/refund-form.tsx +7 -5
- package/src/product/camera-scan-button.tsx +2 -0
- package/src/product/category-nav.tsx +8 -0
- package/src/product/category-tile.tsx +65 -15
- package/src/product/in-cart-badge.tsx +55 -6
- package/src/product/index.ts +1 -0
- package/src/product/press-veil.tsx +7 -0
- package/src/product/product-card.tsx +5 -1
- package/src/product/product-grid.tsx +5 -0
- package/src/product/product-price.tsx +6 -3
- package/src/product/product-stock-badge.tsx +3 -2
- package/src/product/product-table.tsx +96 -8
- package/src/product/products-screen-columns.tsx +74 -0
- package/src/product/variant-tile.tsx +68 -0
- package/src/product/variation-picker.tsx +3 -3
- package/src/product/view-toggle.tsx +33 -4
- package/src/register/cashier-sheet.tsx +195 -0
- package/src/register/closure-sheet.tsx +54 -3
- package/src/register/handover-slip.tsx +2 -1
- package/src/register/index.ts +2 -1
- package/src/register/movement-sheet.tsx +66 -7
- package/src/register/open-register-card.tsx +11 -11
- package/src/register/register-bar.helpers.ts +17 -4
- package/src/register/register-bar.tsx +26 -5
- package/src/register/register-count.tsx +158 -24
- package/src/register/register-panel.tsx +16 -5
- package/src/register/register-side-sheet.tsx +32 -8
- package/src/register/switch-confirm.tsx +2 -2
- package/src/reports/card-panel.tsx +131 -0
- package/src/reports/cards.tsx +53 -36
- package/src/reports/hero.tsx +2 -1
- package/src/reports/index.ts +1 -0
- package/src/reports/sales-room.tsx +4 -2
- package/src/sale/breadcrumb.tsx +48 -0
- package/src/sale/cart-bar.tsx +2 -1
- package/src/sale/cart.tsx +127 -38
- package/src/sale/catalogue-settings-form.tsx +92 -0
- package/src/sale/catalogue.tsx +304 -42
- package/src/sale/category-browse.tsx +27 -0
- package/src/sale/charge-form.tsx +85 -21
- package/src/sale/customer-display-screen.tsx +22 -6
- package/src/sale/discount-form.tsx +132 -28
- package/src/sale/index.ts +6 -3
- package/src/sale/line-popover.tsx +72 -36
- package/src/sale/offered-methods.ts +16 -0
- package/src/sale/open-sale-tabs.tsx +58 -10
- package/src/sale/order-note-sheet.tsx +37 -0
- package/src/sale/order-reference.ts +3 -0
- package/src/sale/orders-list.tsx +76 -37
- package/src/sale/parked-sales.tsx +2 -1
- package/src/sale/price-form.tsx +7 -5
- package/src/sale/product-filter-bar.tsx +38 -5
- package/src/sale/receipt-sheet.tsx +243 -0
- package/src/sale/receipt.tsx +19 -9
- package/src/sale/sync-status.tsx +10 -0
- package/src/sale/tender-ledger.tsx +92 -0
- package/src/sale/tender-pane.tsx +159 -73
- package/src/sale/tender.tsx +10 -7
- package/src/sale/use-tender.ts +63 -0
- package/src/scale/min-target.tsx +36 -0
- package/src/settings/barcode-scanning-settings.tsx +164 -0
- package/src/settings/connector-status.tsx +1 -1
- package/src/settings/customer-display-settings.tsx +12 -25
- package/src/settings/index.ts +5 -0
- package/src/settings/printer-form.tsx +161 -0
- package/src/settings/printing-settings.tsx +268 -0
- package/src/settings/settings-group.tsx +2 -1
- package/src/settings/tax-calculation-settings.tsx +1 -1
- package/src/shell/added-to-cart-toast.tsx +61 -0
- package/src/shell/app-shell.tsx +5 -1
- package/src/shell/connectivity-toast.tsx +70 -0
- package/src/shell/index.ts +2 -0
- package/src/shell/nav-drawer.tsx +5 -2
- package/src/shell/nav-item.tsx +7 -4
- package/src/shell/nav-rail.tsx +9 -2
- package/src/ui/accordion/index.tsx +86 -8
- package/src/ui/alert-dialog/index.tsx +19 -5
- package/src/ui/combobox/index.tsx +21 -2
- package/src/ui/confirm-dialog/index.tsx +53 -0
- package/src/ui/dialog/index.tsx +68 -14
- package/src/ui/dialog/motion.ts +54 -0
- package/src/ui/icon/activity-heartbeat-icon.tsx +7 -0
- package/src/ui/icon/alert-circle-icon.tsx +5 -0
- package/src/ui/icon/alert-triangle-icon.tsx +7 -0
- package/src/ui/icon/banknote-icon.tsx +11 -0
- package/src/ui/icon/cash-register-icon.tsx +10 -0
- package/src/ui/icon/category-icon.tsx +7 -0
- package/src/ui/icon/chart-line-icon.tsx +5 -0
- package/src/ui/icon/check-icon.tsx +5 -0
- package/src/ui/icon/chevron-left-icon.tsx +4 -0
- package/src/ui/icon/chevron-right-icon.tsx +4 -0
- package/src/ui/icon/credit-card-icon.tsx +10 -0
- package/src/ui/icon/discount-icon.tsx +11 -0
- package/src/ui/icon/gift-icon.tsx +10 -0
- package/src/ui/icon/info-circle-icon.tsx +10 -0
- package/src/ui/icon/map-pin-icon.tsx +10 -0
- package/src/ui/icon/message-question-icon.tsx +7 -0
- package/src/ui/icon/pencil-icon.tsx +10 -0
- package/src/ui/icon/plus-icon.tsx +9 -0
- package/src/ui/icon/printer-icon.tsx +10 -0
- package/src/ui/icon/receipt-icon.tsx +7 -0
- package/src/ui/icon/settings-icon.tsx +10 -0
- package/src/ui/icon/sticky-note-icon.tsx +10 -0
- package/src/ui/icon/user-icon.tsx +4 -0
- package/src/ui/icon/users-icon.tsx +7 -0
- package/src/ui/icon/view-grid-icon.tsx +7 -0
- package/src/ui/icon/view-list-icon.tsx +7 -0
- package/src/ui/index.ts +24 -1
- package/src/ui/list-row/index.tsx +93 -0
- package/src/ui/notice/index.tsx +65 -0
- package/src/ui/select/index.tsx +2 -0
- package/src/ui/skeleton/index.tsx +37 -0
- package/src/ui/status-badge/index.tsx +43 -0
- package/src/ui/switch/index.tsx +1 -1
- package/src/ui/tabs/index.tsx +11 -2
- package/src/ui/toggle-group/index.tsx +3 -1
- package/src/ui/tone-disc/index.tsx +41 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
|
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { JSX, ReactNode, ComponentType } from 'react';
|
|
5
5
|
import * as react_native from 'react-native';
|
|
6
|
-
import { Text as Text$1, ViewProps, View, PressableProps, TextProps as TextProps$1, TextInputProps, TextInput, Pressable, StyleProp, ImageStyle } from 'react-native';
|
|
6
|
+
import { Text as Text$1, ViewProps, View, PressableProps, Role, TextProps as TextProps$1, TextInputProps, TextInput, ScrollView, Pressable, StyleProp, ImageStyle } from 'react-native';
|
|
7
7
|
import { VariantProps } from 'class-variance-authority';
|
|
8
8
|
import { SvgProps } from 'react-native-svg';
|
|
9
9
|
import { Separator as Separator$1, Label as Label$1, Tabs as Tabs$1, Dialog as Dialog$1, AlertDialog as AlertDialog$1, Select as Select$1, Combobox as Combobox$1, DropdownMenu as DropdownMenu$1, ContextMenu as ContextMenu$1, Popover as Popover$1, Tooltip as Tooltip$1, HoverCard as HoverCard$1, Accordion as Accordion$1, Collapsible as Collapsible$1, Checkbox as Checkbox$1, Switch as Switch$1, RadioGroup as RadioGroup$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Progress as Progress$1, Slider as Slider$1, Image } from '@tallyui/primitives';
|
|
10
10
|
export { TextClassContext } from '@tallyui/primitives';
|
|
11
|
-
import { StoreDay, DayRange, CatalogueView, ProductSortValue, ProductSort, ViewfinderStatus, CameraDecoder, RefundableOrderLine, EarlierRefund, OrderFilterValue, useRegisterSession, RegisterSession, MovementType, ApprovalNeeded, SwitchKind, SwitchWarnings, HandoverSlipData, AppSettings, useAppSettings, PairingPhase, PairingError, TillDisplayStatus, TillDisplayEntry, TaxDerivation, useSale, TenderState, TenderAction, AppliedDiscount, Discount, CatalogueEntry, CatalogueViewState, CartQuantityLine, SentOrder, PosOrder, ReceiptData, OutboxState, ParkedOrderSummary, OpenSale, DisplayState, DisplayClientPhase, SalesFigures, DatePreset } from '@tallyui/pos';
|
|
11
|
+
import { StoreDay, DayRange, CatalogueView, ProductSortValue, ProductSort, ViewfinderStatus, CameraDecoder, RefundableOrderLine, EarlierRefund, OrderFilterValue, useRegisterSession, RegisterSession, MovementType, ApprovalNeeded, SwitchKind, SwitchWarnings, HandoverSlipData, AppSettings, useAppSettings, PairingPhase, PairingError, TillDisplayStatus, TillDisplayEntry, PrinterProfile, TraceAnalysis, TaxDerivation, useSale, TenderState, TenderAction, AppliedDiscount, Discount, CatalogueEntry, CatalogueViewState, CartQuantityLine, TileFields, CatalogueGridColumns, SentOrder, PosOrder, ReceiptData, OutboxState, ParkedOrderSummary, OpenSale, DisplayState, DisplayClientPhase, SalesFigures, DatePreset } from '@tallyui/pos';
|
|
12
12
|
import { ScaleOverride, ScaleVariables, ScaleStep, Pointer, TypeSetId, ThemeFontFamily, ThemeType } from '@tallyui/theme';
|
|
13
|
-
import { ProductTraits, TraitContext, VariantOptionGroup, VariantSummary, Money, CustomerTraits, Customer, CustomerInput, OrderRefundPayload, OrderFilterField, woocommerceTax, PaymentMethodDescriptor, ProductCategory, SyncNotice, StoreSettingsChoices, StoreSettingsChoice } from '@tallyui/core';
|
|
13
|
+
import { ProductTraits, TraitContext, VariantOptionGroup, VariantSummary, Money, CustomerTraits, CustomerAddress, Customer, CustomerInput, CustomerPatch, OrderRefundPayload, OrderFilterField, PaymentKind, woocommerceTax, ReceiptTemplate, PaymentMethodDescriptor, MoneyFormat, ProductCategory, SyncNotice, StoreSettingsChoices, StoreSettingsChoice, ConnectivityState } from '@tallyui/core';
|
|
14
14
|
import { TFunction } from 'i18next';
|
|
15
15
|
|
|
16
16
|
declare const textVariants: (props?: ({
|
|
@@ -67,6 +67,11 @@ declare const SearchIcon: {
|
|
|
67
67
|
displayName: string;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
declare const UserIcon: {
|
|
71
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
displayName: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
70
75
|
declare const ShoppingCartIcon: {
|
|
71
76
|
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
72
77
|
displayName: string;
|
|
@@ -94,12 +99,102 @@ declare const ChevronDownIcon: {
|
|
|
94
99
|
displayName: string;
|
|
95
100
|
};
|
|
96
101
|
|
|
102
|
+
declare const ChevronRightIcon: {
|
|
103
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
104
|
+
displayName: string;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare const PlusIcon: {
|
|
108
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
displayName: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
declare const CashRegisterIcon: {
|
|
113
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
114
|
+
displayName: string;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
declare const GiftIcon: {
|
|
118
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
119
|
+
displayName: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare const ReceiptIcon: {
|
|
123
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
124
|
+
displayName: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
declare const PrinterIcon: {
|
|
128
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
129
|
+
displayName: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare const DiscountIcon: {
|
|
133
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
134
|
+
displayName: string;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
declare const UsersIcon: {
|
|
138
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
displayName: string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare const ChartLineIcon: {
|
|
143
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
144
|
+
displayName: string;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
declare const ActivityHeartbeatIcon: {
|
|
148
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
displayName: string;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
declare const SettingsIcon: {
|
|
153
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
154
|
+
displayName: string;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
declare const MessageQuestionIcon: {
|
|
158
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
159
|
+
displayName: string;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
declare const CheckIcon: {
|
|
163
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
displayName: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
declare const AlertTriangleIcon: {
|
|
168
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
169
|
+
displayName: string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
declare const AlertCircleIcon: {
|
|
173
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
174
|
+
displayName: string;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
declare const InfoCircleIcon: {
|
|
178
|
+
({ size, color, strokeWidth, accessibilityLabel, ...props }: SvgIconProps): react_jsx_runtime.JSX.Element;
|
|
179
|
+
displayName: string;
|
|
180
|
+
};
|
|
181
|
+
|
|
97
182
|
declare const loaderVariants: (props?: ({
|
|
98
183
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
99
184
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
100
185
|
type LoaderProps = Omit<ViewProps, 'children'> & VariantProps<typeof loaderVariants>;
|
|
101
186
|
declare function Loader({ className, size, ...props }: LoaderProps): react_jsx_runtime.JSX.Element;
|
|
102
187
|
|
|
188
|
+
type SkeletonProps = ViewProps & {
|
|
189
|
+
shape?: 'block' | 'line' | 'row' | 'tile' | 'chip';
|
|
190
|
+
className?: string;
|
|
191
|
+
};
|
|
192
|
+
/** WCPOS v2's Skeleton: a still, muted placeholder in the shape of what is coming. No pulse, no animation. */
|
|
193
|
+
declare function Skeleton({ shape, className, style, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
194
|
+
declare const SKELETON_MAX_ROWS = 12;
|
|
195
|
+
/** How many skeleton rows fill `extent` at `rowHeight` each: at least 1, at most SKELETON_MAX_ROWS (v2). */
|
|
196
|
+
declare function skeletonCount(extent: number, rowHeight: number): number;
|
|
197
|
+
|
|
103
198
|
declare const badgeVariants: (props?: ({
|
|
104
199
|
variant?: "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "info" | null | undefined;
|
|
105
200
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -111,6 +206,46 @@ type BadgeProps = ViewProps & VariantProps<typeof badgeVariants> & {
|
|
|
111
206
|
};
|
|
112
207
|
declare function Badge({ className, variant, label, children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
113
208
|
|
|
209
|
+
declare const statusDotVariants: (props?: ({
|
|
210
|
+
size?: "caption" | "default" | null | undefined;
|
|
211
|
+
variant?: "default" | "warning" | "info" | "ok" | "bad" | "muted" | null | undefined;
|
|
212
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
213
|
+
type StatusBadgeProps = ViewProps & VariantProps<typeof statusDotVariants> & {
|
|
214
|
+
/** The word naming the state; it keeps the foreground colour. */
|
|
215
|
+
label: string;
|
|
216
|
+
};
|
|
217
|
+
declare function StatusBadge({ label, variant, size, className, ...props }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
|
|
219
|
+
type Tone = 'ok' | 'warning' | 'bad' | 'info' | 'muted';
|
|
220
|
+
type ToneDiscProps = {
|
|
221
|
+
tone: Tone;
|
|
222
|
+
/** Overrides the tone's glyph; any `createSvgIcon` glyph. */
|
|
223
|
+
icon?: React$1.ComponentType<SvgIconProps>;
|
|
224
|
+
size?: 'sm' | 'default' | 'lg';
|
|
225
|
+
testID?: string;
|
|
226
|
+
};
|
|
227
|
+
declare function ToneDisc({ tone: name, icon, size: sizeName, testID }: ToneDiscProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
|
|
229
|
+
type NoticeAction = {
|
|
230
|
+
label: string;
|
|
231
|
+
onPress: () => void;
|
|
232
|
+
testID?: string;
|
|
233
|
+
primary?: boolean;
|
|
234
|
+
};
|
|
235
|
+
type NoticeProps = {
|
|
236
|
+
tone: 'bad' | 'warning' | 'info';
|
|
237
|
+
title: string;
|
|
238
|
+
children?: React$1.ReactNode;
|
|
239
|
+
actions?: readonly [NoticeAction] | readonly [NoticeAction, NoticeAction];
|
|
240
|
+
/** The tone's glyph by default; `null` draws none. */
|
|
241
|
+
icon?: React$1.ComponentType<SvgIconProps> | null;
|
|
242
|
+
/** `false` makes a plain group, not a live region, for a band that holds controls. */
|
|
243
|
+
live?: boolean;
|
|
244
|
+
testID?: string;
|
|
245
|
+
className?: string;
|
|
246
|
+
};
|
|
247
|
+
declare function Notice({ tone, title, children, actions, icon, live, testID, className }: NoticeProps): react_jsx_runtime.JSX.Element;
|
|
248
|
+
|
|
114
249
|
declare const avatarVariants: (props?: ({
|
|
115
250
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
116
251
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -160,6 +295,35 @@ declare const IconButton: React$1.ForwardRefExoticComponent<PressableProps & Var
|
|
|
160
295
|
asChild?: boolean;
|
|
161
296
|
} & React$1.RefAttributes<react_native.View>>;
|
|
162
297
|
|
|
298
|
+
type ListRowSize = 'default' | 'sm';
|
|
299
|
+
type ListRowProps = Omit<PressableProps, 'children' | 'role'> & {
|
|
300
|
+
/** Unset, a row with an action is a `button`; one without is no control at all. */
|
|
301
|
+
role?: Role;
|
|
302
|
+
/**
|
|
303
|
+
* Set on a list whose rows can be the current one (open orders, a short choice). `true`
|
|
304
|
+
* paints the row `bg-muted` with the primary bar on its left edge; `false` keeps the bar's
|
|
305
|
+
* room, so the rows' content lines up either way. Unset: a plain list, no bar.
|
|
306
|
+
*/
|
|
307
|
+
selected?: boolean;
|
|
308
|
+
/** Before the body: an avatar, a thumb, a check. */
|
|
309
|
+
leading?: React$1.ReactNode;
|
|
310
|
+
/** After the body: an amount, a badge, a chevron. */
|
|
311
|
+
trailing?: React$1.ReactNode;
|
|
312
|
+
/** `default` (56) for a two-line data row; `sm` (44) for a one-line row or a dense list. */
|
|
313
|
+
size?: ListRowSize;
|
|
314
|
+
className?: string;
|
|
315
|
+
/** The body column's own layout (a `gap-1` between its lines). */
|
|
316
|
+
bodyClassName?: string;
|
|
317
|
+
children?: React$1.ReactNode;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* WCPOS v2's ListRow: one flush row of a list, a hairline under it, `leading`, body and `trailing`.
|
|
321
|
+
* A later slice adds v2's shared pressable surface.
|
|
322
|
+
* TallyUI difference: `sm` is a `minHeight` style number (the `--spacing-row` token, floored at the pointer
|
|
323
|
+
* floor, as v2's own figure) rather than v2's `min-h-row` class, because `scale.css` is opt-in.
|
|
324
|
+
*/
|
|
325
|
+
declare function ListRow({ role, accessibilityRole, selected, leading, trailing, size, className, bodyClassName, children, disabled, style, ...props }: ListRowProps): react_jsx_runtime.JSX.Element;
|
|
326
|
+
|
|
163
327
|
declare const Card: React$1.ForwardRefExoticComponent<ViewProps & React$1.RefAttributes<View>>;
|
|
164
328
|
declare const CardHeader: React$1.ForwardRefExoticComponent<ViewProps & React$1.RefAttributes<View>>;
|
|
165
329
|
declare const CardTitle: React$1.ForwardRefExoticComponent<TextProps$1 & React$1.RefAttributes<Text$1>>;
|
|
@@ -207,16 +371,24 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<Omit<Dialog$1.Tri
|
|
|
207
371
|
declare const DialogPortal: typeof Dialog$1.Portal;
|
|
208
372
|
declare const DialogClose: React$1.ForwardRefExoticComponent<Omit<Dialog$1.CloseProps, "ref"> & React$1.RefAttributes<View>>;
|
|
209
373
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<Omit<Dialog$1.OverlayProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
210
|
-
/** Where the content sits: centred (the default), or a full-height sheet on the right edge, full width on a phone. */
|
|
374
|
+
/** Where the content sits: centred (the default), or a full-height sheet on the left or right edge, full width on a phone. */
|
|
211
375
|
declare const SIDE_CLASS: {
|
|
212
376
|
readonly center: "fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-border bg-background p-6 shadow-lg";
|
|
377
|
+
readonly left: "fixed left-0 top-0 bottom-0 z-50 h-full w-full max-w-lg gap-4 rounded-none border-r border-border bg-background p-6 shadow-lg";
|
|
213
378
|
readonly right: "fixed right-0 top-0 bottom-0 z-50 h-full w-full max-w-lg gap-4 rounded-none border-l border-border bg-background p-6 shadow-lg";
|
|
214
379
|
};
|
|
215
380
|
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<Omit<Dialog$1.ContentProps, "ref"> & React$1.RefAttributes<View>, "ref"> & {
|
|
216
381
|
side?: keyof typeof SIDE_CLASS;
|
|
382
|
+
/** v2's dialog chrome: a close X in the top-right corner; opt-in so existing dialogs are unchanged (desk ruling 18 Nov). */
|
|
383
|
+
showClose?: boolean;
|
|
384
|
+
/** v2's dialog chrome: the close X's accessible name; opt-in so existing dialogs are unchanged (desk ruling 18 Nov). */
|
|
385
|
+
closeLabel?: string;
|
|
217
386
|
} & React$1.RefAttributes<View>>;
|
|
218
387
|
declare function DialogHeader({ className, ...props }: React$1.ComponentPropsWithoutRef<typeof View>): react_jsx_runtime.JSX.Element;
|
|
219
|
-
declare function DialogFooter({ className, ...props }: React$1.ComponentPropsWithoutRef<typeof View>
|
|
388
|
+
declare function DialogFooter({ className, bordered, ...props }: React$1.ComponentPropsWithoutRef<typeof View> & {
|
|
389
|
+
/** v2's dialog chrome: a top divider above the actions; opt-in so existing dialogs are unchanged (desk ruling 18 Nov). */
|
|
390
|
+
bordered?: boolean;
|
|
391
|
+
}): react_jsx_runtime.JSX.Element;
|
|
220
392
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<Omit<Dialog$1.TitleProps, "ref"> & React$1.RefAttributes<Text$1>, "ref"> & React$1.RefAttributes<Text$1>>;
|
|
221
393
|
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<Omit<Dialog$1.DescriptionProps, "ref"> & React$1.RefAttributes<Text$1>, "ref"> & React$1.RefAttributes<Text$1>>;
|
|
222
394
|
|
|
@@ -232,6 +404,28 @@ declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<Omi
|
|
|
232
404
|
declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<AlertDialog$1.ActionProps, "ref"> & React$1.RefAttributes<View>>;
|
|
233
405
|
declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<AlertDialog$1.CancelProps, "ref"> & React$1.RefAttributes<View>>;
|
|
234
406
|
|
|
407
|
+
interface ConfirmDialogProps {
|
|
408
|
+
title: string;
|
|
409
|
+
description?: string;
|
|
410
|
+
/** Default "Cancel". */
|
|
411
|
+
cancelLabel?: string;
|
|
412
|
+
confirmLabel: string;
|
|
413
|
+
/** Default 'destructive'. */
|
|
414
|
+
tone?: 'destructive' | 'default';
|
|
415
|
+
/** Called on the confirm button; the dialog then closes. */
|
|
416
|
+
onConfirm: () => void;
|
|
417
|
+
/** Cancel is `${testID}-cancel` and confirm `${testID}-confirm` unless `cancelTestID` / `confirmTestID` say otherwise. */
|
|
418
|
+
testID: string;
|
|
419
|
+
cancelTestID?: string;
|
|
420
|
+
confirmTestID?: string;
|
|
421
|
+
/** The element that opens the dialog, rendered with `AlertDialogTrigger asChild`. Leave it out when the caller controls `open`. */
|
|
422
|
+
trigger?: React$1.ReactElement;
|
|
423
|
+
open?: boolean;
|
|
424
|
+
onOpenChange?: (open: boolean) => void;
|
|
425
|
+
}
|
|
426
|
+
/** Inventory C9: the one confirm dialog in TallyUI. */
|
|
427
|
+
declare function ConfirmDialog({ title, description, cancelLabel, confirmLabel, tone, onConfirm, testID, cancelTestID, confirmTestID, trigger, open, onOpenChange, }: ConfirmDialogProps): React$1.JSX.Element;
|
|
428
|
+
|
|
235
429
|
declare const Select: typeof Select$1.Root;
|
|
236
430
|
declare const SelectGroup: React$1.ForwardRefExoticComponent<Omit<Select$1.GroupProps, "ref"> & React$1.RefAttributes<View>>;
|
|
237
431
|
declare const SelectValue: React$1.ForwardRefExoticComponent<Omit<Select$1.ValueProps, "ref"> & React$1.RefAttributes<react_native.Text>>;
|
|
@@ -251,6 +445,7 @@ declare const Combobox: typeof Combobox$1.Root;
|
|
|
251
445
|
declare const ComboboxTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<Combobox$1.TriggerProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
252
446
|
declare const ComboboxInput: React$1.ForwardRefExoticComponent<Omit<Omit<Combobox$1.InputProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
253
447
|
declare const ComboboxContent: React$1.ForwardRefExoticComponent<Omit<Omit<Combobox$1.ContentProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
448
|
+
declare const ComboboxList: React$1.ForwardRefExoticComponent<react_native.ScrollViewProps & React$1.RefAttributes<ScrollView>>;
|
|
254
449
|
declare const ComboboxItem: React$1.ForwardRefExoticComponent<Omit<Omit<Combobox$1.ItemProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
255
450
|
declare const ComboboxEmpty: React$1.ForwardRefExoticComponent<react_native.ViewProps & React$1.RefAttributes<View>>;
|
|
256
451
|
|
|
@@ -364,7 +559,12 @@ declare const HoverCardContent: React$1.ForwardRefExoticComponent<Omit<Omit<Hove
|
|
|
364
559
|
|
|
365
560
|
declare const Accordion: React$1.ForwardRefExoticComponent<(Omit<Accordion$1.SingleRootProps, "ref"> | Omit<Accordion$1.MultipleRootProps, "ref">) & React$1.RefAttributes<View>>;
|
|
366
561
|
declare const AccordionItem: React$1.ForwardRefExoticComponent<Omit<Omit<Accordion$1.ItemProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
367
|
-
declare const AccordionTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<Accordion$1.TriggerProps, "ref"> & React$1.RefAttributes<View>, "ref"> &
|
|
562
|
+
declare const AccordionTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<Accordion$1.TriggerProps, "ref"> & React$1.RefAttributes<View>, "ref"> & {
|
|
563
|
+
/** Which side of the label the chevron sits on, as in v2; defaults to the right. */
|
|
564
|
+
chevronPosition?: "left" | "right";
|
|
565
|
+
/** Classes for the outer AccordionPrimitive.Header wrapper, merged after `flex` (useful for flex sizing). */
|
|
566
|
+
headerClassName?: string;
|
|
567
|
+
} & React$1.RefAttributes<View>>;
|
|
368
568
|
declare const AccordionContent: React$1.ForwardRefExoticComponent<Omit<Omit<Accordion$1.ContentProps, "ref"> & React$1.RefAttributes<View>, "ref"> & React$1.RefAttributes<View>>;
|
|
369
569
|
|
|
370
570
|
declare const Collapsible: React$1.ForwardRefExoticComponent<Omit<Collapsible$1.RootProps, "ref"> & React$1.RefAttributes<react_native.View>>;
|
|
@@ -511,6 +711,8 @@ interface ProductPriceProps extends Omit<TextProps, 'children'> {
|
|
|
511
711
|
* `` (price) => `from ${price}` ``. Wins over `fromLabel` when both are given.
|
|
512
712
|
*/
|
|
513
713
|
formatFrom?: (price: string) => string;
|
|
714
|
+
/** Show the price a sale replaces, struck through. Default true. False renders an on-sale price like a regular one. */
|
|
715
|
+
showWas?: boolean;
|
|
514
716
|
className?: string;
|
|
515
717
|
}
|
|
516
718
|
/**
|
|
@@ -524,7 +726,7 @@ interface ProductPriceProps extends Omit<TextProps, 'children'> {
|
|
|
524
726
|
* <ProductPrice doc={productDocument} currency="EUR" />
|
|
525
727
|
* ```
|
|
526
728
|
*/
|
|
527
|
-
declare function ProductPrice({ doc, currency, locale, currencySymbol, className, showFromPrice, fromLabel, formatFrom, ...textProps }: ProductPriceProps): react_jsx_runtime.JSX.Element;
|
|
729
|
+
declare function ProductPrice({ doc, currency, locale, currencySymbol, className, showFromPrice, fromLabel, formatFrom, showWas, ...textProps }: ProductPriceProps): react_jsx_runtime.JSX.Element;
|
|
528
730
|
|
|
529
731
|
interface ProductImageProps extends Omit<React.ComponentPropsWithoutRef<typeof Image.Root>, 'source'> {
|
|
530
732
|
/** The raw RxDB product document */
|
|
@@ -622,6 +824,8 @@ interface ProductGridProps extends Omit<VStackProps, 'children'> {
|
|
|
622
824
|
* unless `showUnsellable`.
|
|
623
825
|
*/
|
|
624
826
|
showUnsellable?: boolean;
|
|
827
|
+
/** Rendered after the last tile, inside the list (for example a paging spinner); not shown with `emptyState`. */
|
|
828
|
+
footerSlot?: ReactNode;
|
|
625
829
|
className?: string;
|
|
626
830
|
}
|
|
627
831
|
/**
|
|
@@ -638,19 +842,23 @@ interface ProductGridProps extends Omit<VStackProps, 'children'> {
|
|
|
638
842
|
* />
|
|
639
843
|
* ```
|
|
640
844
|
*/
|
|
641
|
-
declare function ProductGrid({ items, renderItem, numColumns, searchSlot, filterSlot, emptyState, showUnsellable, className, ...viewProps }: ProductGridProps): react_jsx_runtime.JSX.Element;
|
|
845
|
+
declare function ProductGrid({ items, renderItem, numColumns, searchSlot, filterSlot, emptyState, showUnsellable, footerSlot, className, ...viewProps }: ProductGridProps): react_jsx_runtime.JSX.Element;
|
|
642
846
|
|
|
643
847
|
interface ViewToggleProps extends Omit<ViewProps, 'children'> {
|
|
644
848
|
value: CatalogueView;
|
|
645
849
|
onChange: (view: CatalogueView) => void;
|
|
646
|
-
/** Default { grid: 'Grid', table: 'Table' }.
|
|
850
|
+
/** Default { grid: 'Grid', table: 'Table' }. In the icon form the label names the view a press switches to,
|
|
851
|
+
* default "Switch to grid view" / "Switch to table view". */
|
|
647
852
|
labels?: {
|
|
648
853
|
grid?: string;
|
|
649
854
|
table?: string;
|
|
650
855
|
};
|
|
651
856
|
className?: string;
|
|
857
|
+
/** 'segments' (default): the Grid/Table radio pair. 'icon': v2's single view-mode button
|
|
858
|
+
* (pos/products/view-mode-toggle.tsx), one press switches to the other view. */
|
|
859
|
+
variant?: 'segments' | 'icon';
|
|
652
860
|
}
|
|
653
|
-
declare function ViewToggle({ value, onChange, labels, className, ...viewProps }: ViewToggleProps): JSX.Element;
|
|
861
|
+
declare function ViewToggle({ value, onChange, labels, className, variant, ...viewProps }: ViewToggleProps): JSX.Element;
|
|
654
862
|
|
|
655
863
|
interface ProductTableColumn<Doc = any> {
|
|
656
864
|
/** Stable id; the default columns use PRODUCT_SORT_FIELDS. */
|
|
@@ -667,6 +875,8 @@ interface ProductTableColumn<Doc = any> {
|
|
|
667
875
|
/** Flex weight of the column; default 1. */
|
|
668
876
|
flex?: number;
|
|
669
877
|
}
|
|
878
|
+
/** A row's doc: an item of `items` (the table is not generic, so this is that item's type). */
|
|
879
|
+
type ProductTableRowDoc = ProductTableProps['items'][number];
|
|
670
880
|
interface ProductTableProps extends Omit<ViewProps, 'children'> {
|
|
671
881
|
items: any[];
|
|
672
882
|
/** Default: trait columns with a ConnectorProvider, else none. */
|
|
@@ -685,6 +895,26 @@ interface ProductTableProps extends Omit<ViewProps, 'children'> {
|
|
|
685
895
|
showUnsellable?: boolean;
|
|
686
896
|
/** Passed to the default price column's ProductPrice. */
|
|
687
897
|
currencySymbol?: string;
|
|
898
|
+
/** Lead each row with the product's thumbnail, as v2's image column: 40 px, 56 px under a coarse pointer, an
|
|
899
|
+
* initial tile when there is no image. Needs a ConnectorProvider. Default false. */
|
|
900
|
+
showThumbnail?: boolean;
|
|
901
|
+
/** End each row with v2's add control, which calls onSelect(item) exactly as a row press does: a + labelled
|
|
902
|
+
* "Add to cart", or a > labelled "Variations" for a product with more than one variant. Needs onSelect. Default false. */
|
|
903
|
+
showAddButton?: boolean;
|
|
904
|
+
/** v2's in-cart count: how many of the product the cart holds (e.g. from cartQuantities). In the add column
|
|
905
|
+
* (showAddButton), a count above 0 shows in place of the +, labelled "In cart: N", and pressing it calls onSelect
|
|
906
|
+
* as the + does; a product with variants keeps its >. Default: no count. */
|
|
907
|
+
cartQuantity?: (doc: any) => number;
|
|
908
|
+
/** v2's expanding variable row: whether the row's expanded block shows. Used only with onToggleExpand and
|
|
909
|
+
* renderExpanded. Pass a new function when the expanded set changes (an inline arrow does). */
|
|
910
|
+
isExpanded?: (doc: ProductTableRowDoc) => boolean;
|
|
911
|
+
/** With renderExpanded and showThumbnail, a product with more than one variant has its thumbnail toggle its
|
|
912
|
+
* expanded block: a button labelled "Show variations" with aria-expanded. A press calls this, never onSelect. */
|
|
913
|
+
onToggleExpand?: (doc: ProductTableRowDoc) => void;
|
|
914
|
+
/** The block drawn under an expanded row (e.g. its variant rows), indented by the thumbnail column. */
|
|
915
|
+
renderExpanded?: (doc: ProductTableRowDoc) => ReactNode;
|
|
916
|
+
/** With no items, draw the header and skeleton rows instead of emptyState, as WCPOS v2's DataTableSkeleton. */
|
|
917
|
+
loading?: boolean;
|
|
688
918
|
className?: string;
|
|
689
919
|
}
|
|
690
920
|
declare function defaultProductColumns(traits: ProductTraits, context?: TraitContext, options?: {
|
|
@@ -693,7 +923,19 @@ declare function defaultProductColumns(traits: ProductTraits, context?: TraitCon
|
|
|
693
923
|
declare function useDefaultProductColumns(options?: {
|
|
694
924
|
currencySymbol?: string;
|
|
695
925
|
}): ProductTableColumn[];
|
|
696
|
-
declare function ProductTable({ items, columns, sort, defaultSort, onSortChange, sortItems, onSelect, searchSlot, filterSlot, emptyState, showUnsellable, currencySymbol, className, ...viewProps }: ProductTableProps): JSX.Element;
|
|
926
|
+
declare function ProductTable({ items, columns, sort, defaultSort, onSortChange, sortItems, onSelect, searchSlot, filterSlot, emptyState, showUnsellable, currencySymbol, showThumbnail, showAddButton, cartQuantity, isExpanded, onToggleExpand, renderExpanded, loading, className, ...viewProps }: ProductTableProps): JSX.Element;
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* WCPOS v2's Products screen read columns: image, product (with its variation count), stock with the Manage switch,
|
|
930
|
+
* stock status, categories and price. Pass them to `ProductTable columns={...}`.
|
|
931
|
+
*/
|
|
932
|
+
declare function productsScreenColumns(traits: ProductTraits, context?: TraitContext, options?: {
|
|
933
|
+
currencySymbol?: string;
|
|
934
|
+
}): ProductTableColumn[];
|
|
935
|
+
/** `productsScreenColumns` from the ConnectorProvider's traits, memoised; requires a ConnectorProvider. */
|
|
936
|
+
declare function useProductsScreenColumns(options?: {
|
|
937
|
+
currencySymbol?: string;
|
|
938
|
+
}): ProductTableColumn[];
|
|
697
939
|
|
|
698
940
|
interface ProductListProps extends Omit<ViewProps, 'children'> {
|
|
699
941
|
items: any[];
|
|
@@ -736,14 +978,15 @@ interface InCartBadgeProps {
|
|
|
736
978
|
/** Placement, e.g. `absolute right-2 top-2` for a tile's top-right corner. */
|
|
737
979
|
className?: string;
|
|
738
980
|
testID?: string;
|
|
981
|
+
identity?: string;
|
|
739
982
|
}
|
|
740
983
|
/**
|
|
741
984
|
* How many of a product are in the cart: a primary circle with the count, hidden while there are none.
|
|
742
985
|
*
|
|
743
986
|
* Ported from WCPOS v2 `InCartCount`, packages/core/src/screens/main/pos/products/rows/in-cart-count.tsx
|
|
744
|
-
* (MIT, WCPOS),
|
|
987
|
+
* (MIT, WCPOS), with v2's count beat from packages/components/src/badge/count-beat.tsx.
|
|
745
988
|
*/
|
|
746
|
-
declare function InCartBadge({ count, className, testID }: InCartBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
989
|
+
declare function InCartBadge({ count, className, testID, identity }: InCartBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
747
990
|
|
|
748
991
|
interface VariationPickerProps {
|
|
749
992
|
/** The product name. */
|
|
@@ -765,10 +1008,21 @@ declare function VariationPicker({ title, groups, variants, currency, onAdd, pre
|
|
|
765
1008
|
|
|
766
1009
|
interface CategoryTileProps {
|
|
767
1010
|
name: string;
|
|
768
|
-
/**
|
|
1011
|
+
/**
|
|
1012
|
+
* The category's photo; without one, or when it fails to load, the tile shows the name's initial on a tint.
|
|
1013
|
+
* A new URL gets its own chance to load.
|
|
1014
|
+
*/
|
|
769
1015
|
imageUrl?: string;
|
|
770
1016
|
/** Products in the category, shown under the name when above 0. */
|
|
771
1017
|
count?: number;
|
|
1018
|
+
/** Draws two cards behind the tile, as v2's poster tile does (default false). */
|
|
1019
|
+
stacked?: boolean;
|
|
1020
|
+
/** The corner mark: `folder` for a category, `all` (a grid) for the All products tile. Decoration only. */
|
|
1021
|
+
mark?: 'folder' | 'all';
|
|
1022
|
+
/** Draws v2's back badge, a left chevron top-right in the mark's circle, as on a level's first tile. Decoration only (default false). */
|
|
1023
|
+
back?: boolean;
|
|
1024
|
+
/** The tile's accessible label (default `name`). */
|
|
1025
|
+
accessibilityLabel?: string;
|
|
772
1026
|
onPress?: () => void;
|
|
773
1027
|
testID?: string;
|
|
774
1028
|
className?: string;
|
|
@@ -779,9 +1033,9 @@ interface CategoryTileProps {
|
|
|
779
1033
|
*
|
|
780
1034
|
* Ported from WCPOS v2 `TermTile`, packages/core/src/screens/main/pos/products/browse/term-tile.tsx
|
|
781
1035
|
* (MIT, WCPOS): the picture fills the square (`contentFit="cover"`), else a tint; the name bold over two
|
|
782
|
-
* lines with the count under it.
|
|
1036
|
+
* lines with the count under it. The stack and the mark follow v2's `PosterTile` (poster-tile/index.tsx).
|
|
783
1037
|
*/
|
|
784
|
-
declare function CategoryTile({ name, imageUrl, count, onPress, testID, className }: CategoryTileProps): react_jsx_runtime.JSX.Element;
|
|
1038
|
+
declare function CategoryTile({ name, imageUrl, count, stacked, mark, back, accessibilityLabel, onPress, testID, className }: CategoryTileProps): react_jsx_runtime.JSX.Element;
|
|
785
1039
|
|
|
786
1040
|
interface CameraScanButtonProps {
|
|
787
1041
|
/** The camera scanner is showing: the button then closes it. */
|
|
@@ -835,8 +1089,9 @@ interface CameraScannerPanelProps {
|
|
|
835
1089
|
declare function CameraScannerPanel({ onClose, height: heightProp, onHeightChange, permission, viewfinder: Viewfinder, decoder, readiness, onDetected, onOpen, scanCount }: CameraScannerPanelProps): react_jsx_runtime.JSX.Element;
|
|
836
1090
|
|
|
837
1091
|
/**
|
|
838
|
-
* v2's Cart Settings › Columns: each column's `show` switch
|
|
839
|
-
* defaults are today's look and v2's: Qty, Item, Price and Total show
|
|
1092
|
+
* v2's Cart Settings › Columns: each column's `show` switch, display options and order. Every field is optional; the
|
|
1093
|
+
* defaults are today's look and v2's: Qty, Item, Price and Total show, in v2's order (Qty, Image, Item, SKU, Price,
|
|
1094
|
+
* Regular Price, Total), with `price.onSale` on; Image, SKU, Regular Price, `quantity.split` and `name.sku` are off.
|
|
840
1095
|
*/
|
|
841
1096
|
interface CartColumnSettings {
|
|
842
1097
|
/** `split`: a Split link under a quantity above 1. */
|
|
@@ -856,16 +1111,25 @@ interface CartColumnSettings {
|
|
|
856
1111
|
sku?: {
|
|
857
1112
|
show?: boolean;
|
|
858
1113
|
};
|
|
859
|
-
/** Still folds on a narrow cart or a phone (`showPrice`).
|
|
1114
|
+
/** Still folds on a narrow cart or a phone (`showPrice`). `onSale` (default true): the regular price struck through
|
|
1115
|
+
* above a lower price (v2's `on_sale`). */
|
|
860
1116
|
price?: {
|
|
861
1117
|
show?: boolean;
|
|
1118
|
+
onSale?: boolean;
|
|
1119
|
+
};
|
|
1120
|
+
/** The regular unit price, read-only (v2's Regular Price column); off by default. */
|
|
1121
|
+
regularPrice?: {
|
|
1122
|
+
show?: boolean;
|
|
862
1123
|
};
|
|
863
1124
|
total?: {
|
|
864
1125
|
show?: boolean;
|
|
865
1126
|
};
|
|
1127
|
+
/** The column order (v2's drag order). Listed ids come first, in this order; ids not listed follow in the default
|
|
1128
|
+
* order; unknown and repeated ids are ignored. */
|
|
1129
|
+
order?: readonly CartColumnId[];
|
|
866
1130
|
}
|
|
867
|
-
type CartColumnId = 'quantity' | 'image' | 'name' | 'sku' | 'price' | 'total';
|
|
868
|
-
/** The visible columns, in
|
|
1131
|
+
type CartColumnId = 'quantity' | 'image' | 'name' | 'sku' | 'price' | 'regularPrice' | 'total';
|
|
1132
|
+
/** The visible columns, in order; the heads and every line use it, so they cannot disagree. */
|
|
869
1133
|
declare function cartColumnIds(columns?: CartColumnSettings, { showPrice }?: {
|
|
870
1134
|
showPrice?: boolean;
|
|
871
1135
|
}): CartColumnId[];
|
|
@@ -874,6 +1138,8 @@ interface CartColumnHeadsProps extends Omit<ViewProps, 'children'> {
|
|
|
874
1138
|
showPrice?: boolean;
|
|
875
1139
|
/** Which columns show (v2's Cart Settings › Columns); pass the same value as each CartLine's `columns`. */
|
|
876
1140
|
columns?: CartColumnSettings;
|
|
1141
|
+
/** Cart's `picker` is on: the quantity column heads v2's split-by-item bill, "This payment" (default false). */
|
|
1142
|
+
picking?: boolean;
|
|
877
1143
|
className?: string;
|
|
878
1144
|
}
|
|
879
1145
|
/**
|
|
@@ -883,7 +1149,7 @@ interface CartColumnHeadsProps extends Omit<ViewProps, 'children'> {
|
|
|
883
1149
|
* <CartColumnHeads showPrice={showPrice} />
|
|
884
1150
|
* ```
|
|
885
1151
|
*/
|
|
886
|
-
declare function CartColumnHeads({ showPrice, columns, className, ...props }: CartColumnHeadsProps): JSX.Element;
|
|
1152
|
+
declare function CartColumnHeads({ showPrice, columns, picking, className, ...props }: CartColumnHeadsProps): JSX.Element;
|
|
887
1153
|
|
|
888
1154
|
interface CartLineProps extends Omit<HStackProps, 'children'> {
|
|
889
1155
|
name: string;
|
|
@@ -891,7 +1157,8 @@ interface CartLineProps extends Omit<HStackProps, 'children'> {
|
|
|
891
1157
|
attributes?: Record<string, string>;
|
|
892
1158
|
quantity: number;
|
|
893
1159
|
unitPrice: Money;
|
|
894
|
-
/** The regular unit price; shown struck through above unitPrice only when it is above unitPrice
|
|
1160
|
+
/** The regular unit price; shown struck through above unitPrice only when it is above unitPrice (and
|
|
1161
|
+
* `columns.price.onSale` is not false), and in the Regular Price column. */
|
|
895
1162
|
regularUnitPrice?: Money;
|
|
896
1163
|
lineTotal: Money;
|
|
897
1164
|
/** Show the Price column (default true); the Cart passes false on a narrow cart or a phone, as CartColumnHeads does. */
|
|
@@ -908,6 +1175,8 @@ interface CartLineProps extends Omit<HStackProps, 'children'> {
|
|
|
908
1175
|
imageUrl?: string;
|
|
909
1176
|
/** With `columns.quantity.split` and a quantity above 1, a Split link under the quantity calls this. */
|
|
910
1177
|
onSplit?: () => void;
|
|
1178
|
+
/** As CartColumnHeads' `picking`: the quantity column takes its wider picking width (default false). */
|
|
1179
|
+
picking?: boolean;
|
|
911
1180
|
locale?: string;
|
|
912
1181
|
className?: string;
|
|
913
1182
|
}
|
|
@@ -919,7 +1188,26 @@ interface CartLineProps extends Omit<HStackProps, 'children'> {
|
|
|
919
1188
|
* <CartLine name="Coffee" quantity={2} unitPrice={unitPrice} lineTotal={lineTotal} />
|
|
920
1189
|
* ```
|
|
921
1190
|
*/
|
|
922
|
-
declare function CartLine({ name, attributes, quantity, unitPrice, regularUnitPrice, lineTotal, showPrice, quantitySlot, priceSlot, columns, sku, imageUrl, onSplit, locale, className, ...props }: CartLineProps): react_jsx_runtime.JSX.Element;
|
|
1191
|
+
declare function CartLine({ name, attributes, quantity, unitPrice, regularUnitPrice, lineTotal, showPrice, quantitySlot, priceSlot, columns, sku, imageUrl, onSplit, picking, locale, className, ...props }: CartLineProps): react_jsx_runtime.JSX.Element;
|
|
1192
|
+
|
|
1193
|
+
interface CartColumnsFormProps extends Omit<ViewProps, 'children'> {
|
|
1194
|
+
/** The saved columns (default `{}`, today's look). */
|
|
1195
|
+
value?: CartColumnSettings;
|
|
1196
|
+
/** Called with a fresh value on every change; the form stores nothing. */
|
|
1197
|
+
onChange: (next: CartColumnSettings) => void;
|
|
1198
|
+
/** Draw a Restore Default Settings button that emits `{}` (default false; v2 keeps it in the dialog footer). */
|
|
1199
|
+
showReset?: boolean;
|
|
1200
|
+
className?: string;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* v2's Cart Settings › Columns: a Show switch per column, the nested Split, SKU and On Sale switches, and Move up and
|
|
1204
|
+
* Move down buttons for the order. It emits a value for `Cart`'s `columns`.
|
|
1205
|
+
*
|
|
1206
|
+
* ```tsx
|
|
1207
|
+
* <CartColumnsForm value={settings['cart.columns']} onChange={(next) => setSetting('cart.columns', next)} />
|
|
1208
|
+
* ```
|
|
1209
|
+
*/
|
|
1210
|
+
declare function CartColumnsForm({ value, onChange, showReset, className, ...viewProps }: CartColumnsFormProps): JSX.Element;
|
|
923
1211
|
|
|
924
1212
|
interface CartTotalProps extends Omit<VStackProps, 'children'> {
|
|
925
1213
|
subtotal: Money;
|
|
@@ -928,8 +1216,12 @@ interface CartTotalProps extends Omit<VStackProps, 'children'> {
|
|
|
928
1216
|
amount: Money;
|
|
929
1217
|
}>;
|
|
930
1218
|
discount?: Money;
|
|
1219
|
+
/** The fee lines' sum in the display tax mode; a "Fees" row shows when it is not 0, as WCPOS v2. */
|
|
1220
|
+
fees?: Money;
|
|
1221
|
+
/** The shipping lines' sum in the display tax mode; a "Shipping" row shows when it is not 0, as WCPOS v2. */
|
|
1222
|
+
shipping?: Money;
|
|
931
1223
|
total: Money;
|
|
932
|
-
/** The tax is already in the subtotal
|
|
1224
|
+
/** The display tax mode: true tags each tax row "Including tax" (the tax is already in the subtotal), false "Excluding tax", as WCPOS v2; absent draws no tag. */
|
|
933
1225
|
taxInclusive?: boolean;
|
|
934
1226
|
locale?: string;
|
|
935
1227
|
className?: string;
|
|
@@ -939,13 +1231,14 @@ interface CartTotalProps extends Omit<VStackProps, 'children'> {
|
|
|
939
1231
|
showTotal?: boolean;
|
|
940
1232
|
}
|
|
941
1233
|
/**
|
|
942
|
-
* Displays a cart summary: subtotal, optional discount, optional tax, and an optional Total row, in the
|
|
1234
|
+
* Displays a cart summary: subtotal, optional discount, fees and shipping, optional tax, and an optional Total row, in the
|
|
1235
|
+
* receipt's order.
|
|
943
1236
|
*
|
|
944
1237
|
* ```tsx
|
|
945
1238
|
* <CartTotal subtotal={subtotal} discount={discount} taxLines={taxLines} total={total} />
|
|
946
1239
|
* ```
|
|
947
1240
|
*/
|
|
948
|
-
declare function CartTotal({ subtotal, taxLines, discount, total, taxInclusive, locale, className, afterSubtotal, showTotal, ...props }: CartTotalProps): react_jsx_runtime.JSX.Element;
|
|
1241
|
+
declare function CartTotal({ subtotal, taxLines, discount, fees, shipping, total, taxInclusive, locale, className, afterSubtotal, showTotal, ...props }: CartTotalProps): react_jsx_runtime.JSX.Element;
|
|
949
1242
|
|
|
950
1243
|
interface CartPanelProps<T> extends Omit<VStackProps, 'children'> {
|
|
951
1244
|
/** Cart line items to render */
|
|
@@ -964,9 +1257,13 @@ interface CartPanelProps<T> extends Omit<VStackProps, 'children'> {
|
|
|
964
1257
|
footerClassName?: string;
|
|
965
1258
|
/** Content shown when items is empty */
|
|
966
1259
|
emptyState?: ReactNode;
|
|
1260
|
+
/** A value per row whose change pulses it (e.g. the quantity); with it, rows pulse when added and tint and collapse when removed, as in WCPOS v2. Without it, nothing animates. */
|
|
1261
|
+
pulseKey?: (item: T) => string | number;
|
|
1262
|
+
/** What the rows belong to (e.g. the order id): a change rebaselines without a pulse. */
|
|
1263
|
+
identity?: string;
|
|
967
1264
|
className?: string;
|
|
968
1265
|
}
|
|
969
|
-
declare function CartPanel<T>({ items, renderItem, keyExtractor, header, afterItems, footer, footerClassName, emptyState, className, ...props }: CartPanelProps<T>): JSX.Element;
|
|
1266
|
+
declare function CartPanel<T>({ items, renderItem, keyExtractor, header, afterItems, footer, footerClassName, emptyState, pulseKey, identity, className, ...props }: CartPanelProps<T>): JSX.Element;
|
|
970
1267
|
|
|
971
1268
|
interface DiscountBadgeProps extends Omit<ViewProps, 'children'> {
|
|
972
1269
|
label: string;
|
|
@@ -1013,6 +1310,11 @@ interface CartFootProps {
|
|
|
1013
1310
|
onCheckout: () => void;
|
|
1014
1311
|
/** The ⋮ menu's items; the ⋮ is left out when there are none. */
|
|
1015
1312
|
actions?: readonly CartFootAction[];
|
|
1313
|
+
/** v2's note row above the buttons: hidden when the text is empty; pressing it calls onPress (the app opens its note editor). */
|
|
1314
|
+
note?: {
|
|
1315
|
+
text: string;
|
|
1316
|
+
onPress: () => void;
|
|
1317
|
+
};
|
|
1016
1318
|
/** Disables Checkout only; the menu stays usable. */
|
|
1017
1319
|
disabled?: boolean;
|
|
1018
1320
|
locale?: string;
|
|
@@ -1026,7 +1328,7 @@ interface CartFootProps {
|
|
|
1026
1328
|
* <CartFoot total={total} onCheckout={startCheckout} actions={[{ label: 'Void', onPress: voidSale, destructive: true }]} />
|
|
1027
1329
|
* ```
|
|
1028
1330
|
*/
|
|
1029
|
-
declare function CartFoot({ total, onCheckout, actions, disabled, locale, className }: CartFootProps): react_jsx_runtime.JSX.Element;
|
|
1331
|
+
declare function CartFoot({ total, onCheckout, actions, note, disabled, locale, className }: CartFootProps): react_jsx_runtime.JSX.Element;
|
|
1030
1332
|
|
|
1031
1333
|
interface SearchInputProps extends Omit<TextInputProps, 'value' | 'onChangeText'> {
|
|
1032
1334
|
value: string;
|
|
@@ -1144,12 +1446,67 @@ interface CustomerSelectProps<Doc = any> extends Omit<VStackProps, 'children'> {
|
|
|
1144
1446
|
*/
|
|
1145
1447
|
declare function CustomerSelect<Doc>(props: CustomerSelectProps<Doc>): react_jsx_runtime.JSX.Element;
|
|
1146
1448
|
|
|
1449
|
+
interface AddressFieldsProps {
|
|
1450
|
+
value: CustomerAddress;
|
|
1451
|
+
onChange: (next: CustomerAddress) => void;
|
|
1452
|
+
/** Country options (ISO alpha-2 value, display label). Absent: Country is a text input. */
|
|
1453
|
+
countries?: readonly {
|
|
1454
|
+
value: string;
|
|
1455
|
+
label: string;
|
|
1456
|
+
}[];
|
|
1457
|
+
/** A country's state options. Absent, or undefined/empty for that country: State is a text input. */
|
|
1458
|
+
statesFor?: (country: string) => readonly {
|
|
1459
|
+
value: string;
|
|
1460
|
+
label: string;
|
|
1461
|
+
}[] | undefined;
|
|
1462
|
+
/** Show the Email part (billing only; v2's shipping has no email, address.tsx:30-33). Default false. */
|
|
1463
|
+
showEmail?: boolean;
|
|
1464
|
+
/** Prefix for every testID. Default 'address-fields'. */
|
|
1465
|
+
testID?: string;
|
|
1466
|
+
}
|
|
1467
|
+
/** A controlled CustomerAddress form, one column. Country and State are pickers when the app passes their options. */
|
|
1468
|
+
declare function AddressFields({ value, onChange, countries, statesFor, showEmail, testID }: AddressFieldsProps): react_jsx_runtime.JSX.Element;
|
|
1469
|
+
interface ShippingAddressFieldsProps {
|
|
1470
|
+
billing: CustomerAddress | undefined;
|
|
1471
|
+
value: CustomerAddress | undefined;
|
|
1472
|
+
/** `undefined` is "Same as billing": shipping folds back to billing. */
|
|
1473
|
+
onChange: (next: CustomerAddress | undefined) => void;
|
|
1474
|
+
countries?: AddressFieldsProps['countries'];
|
|
1475
|
+
statesFor?: AddressFieldsProps['statesFor'];
|
|
1476
|
+
/** Default 'shipping-address'. */
|
|
1477
|
+
testID?: string;
|
|
1478
|
+
}
|
|
1479
|
+
/** Shipping reads "Same as billing" until the cashier uses a different address. The link is read once, at mount, so a copy of
|
|
1480
|
+
* billing stays open: key the component by order to read it again, as v2 keys its form by the order's uuid (pos/cart/customer.tsx:59). */
|
|
1481
|
+
declare function ShippingAddressFields({ billing, value, onChange, countries, statesFor, testID }: ShippingAddressFieldsProps): react_jsx_runtime.JSX.Element;
|
|
1482
|
+
|
|
1483
|
+
/** An order's billing and shipping as WCPOS v2's address rows (`components/customer/address-rows.tsx:100-140`, MIT, WCPOS):
|
|
1484
|
+
* an add button until the address is present, then a row with a summary, Edit and Remove, the parts opening beneath it. */
|
|
1485
|
+
|
|
1486
|
+
interface AddressEditorValue {
|
|
1487
|
+
billing?: CustomerAddress;
|
|
1488
|
+
shipping?: CustomerAddress;
|
|
1489
|
+
}
|
|
1490
|
+
interface AddressEditorProps {
|
|
1491
|
+
value: AddressEditorValue;
|
|
1492
|
+
onChange: (next: AddressEditorValue) => void;
|
|
1493
|
+
countries?: AddressFieldsProps['countries'];
|
|
1494
|
+
statesFor?: AddressFieldsProps['statesFor'];
|
|
1495
|
+
/** The store's country: a new address starts with it (v2 address-rows.tsx:115-119). */
|
|
1496
|
+
defaultCountry?: string;
|
|
1497
|
+
/** Prefix for every testID. Default 'address-editor'. */
|
|
1498
|
+
testID?: string;
|
|
1499
|
+
}
|
|
1500
|
+
/** A controlled editor for an order's billing and shipping. No dialog: the app places it in its own. */
|
|
1501
|
+
declare function AddressEditor({ value, onChange, countries, statesFor, defaultCountry, testID }: AddressEditorProps): JSX.Element;
|
|
1502
|
+
|
|
1147
1503
|
interface CustomerFormValues {
|
|
1148
1504
|
firstName: string;
|
|
1149
1505
|
lastName: string;
|
|
1150
1506
|
email: string;
|
|
1151
1507
|
phone: string;
|
|
1152
1508
|
address: string;
|
|
1509
|
+
company?: string;
|
|
1153
1510
|
}
|
|
1154
1511
|
interface CustomerFormProps extends Omit<ViewProps, 'children'> {
|
|
1155
1512
|
values: CustomerFormValues;
|
|
@@ -1157,9 +1514,44 @@ interface CustomerFormProps extends Omit<ViewProps, 'children'> {
|
|
|
1157
1514
|
onSubmit?: () => void;
|
|
1158
1515
|
submitLabel?: string;
|
|
1159
1516
|
showAddress?: boolean;
|
|
1517
|
+
/** Billing and shipping. With `onChangeAddresses` too, an `AddressEditor` replaces the free-text Address field. */
|
|
1518
|
+
addresses?: AddressEditorValue;
|
|
1519
|
+
/** Receives the next billing and shipping; the `AddressEditor` shows only when this and `addresses` are both set. */
|
|
1520
|
+
onChangeAddresses?: (next: AddressEditorValue) => void;
|
|
1521
|
+
/** Passed through to `AddressEditor`. */
|
|
1522
|
+
countries?: AddressEditorProps['countries'];
|
|
1523
|
+
/** Passed through to `AddressEditor`. */
|
|
1524
|
+
statesFor?: AddressEditorProps['statesFor'];
|
|
1525
|
+
/** Passed through to `AddressEditor`: a new address starts in this country. */
|
|
1526
|
+
defaultCountry?: AddressEditorProps['defaultCountry'];
|
|
1527
|
+
/** A Company field after Email and Phone (v2 customer-form.tsx:171-172). Default false. */
|
|
1528
|
+
showCompany?: boolean;
|
|
1529
|
+
/** Shown as an alert under the Email field. The form does not validate; the caller decides. */
|
|
1530
|
+
emailError?: string;
|
|
1531
|
+
className?: string;
|
|
1532
|
+
}
|
|
1533
|
+
declare function CustomerForm({ values, onChangeField, onSubmit, submitLabel, showAddress, addresses, onChangeAddresses, countries, statesFor, defaultCountry, showCompany, emailError, className, ...viewProps }: CustomerFormProps): react_jsx_runtime.JSX.Element;
|
|
1534
|
+
|
|
1535
|
+
interface CustomerEditorProps {
|
|
1536
|
+
/** Edit this customer; absent means add a new one. */
|
|
1537
|
+
customer?: Customer;
|
|
1538
|
+
/** Add mode's store call. */
|
|
1539
|
+
create?: (input: CustomerInput) => Promise<Customer>;
|
|
1540
|
+
/** Edit mode's store call. */
|
|
1541
|
+
update?: (id: string, patch: CustomerPatch) => Promise<Customer>;
|
|
1542
|
+
/** Called with the store's customer after a save, or with `customer` when an edit changed nothing. */
|
|
1543
|
+
onSaved: (customer: Customer) => void;
|
|
1544
|
+
onCancel: () => void;
|
|
1545
|
+
/** Save is disabled while offline (desk ruling: online-only Save). */
|
|
1546
|
+
online: boolean;
|
|
1547
|
+
countries?: CustomerFormProps['countries'];
|
|
1548
|
+
statesFor?: CustomerFormProps['statesFor'];
|
|
1549
|
+
defaultCountry?: CustomerFormProps['defaultCountry'];
|
|
1160
1550
|
className?: string;
|
|
1551
|
+
/** Default 'customer-editor'. */
|
|
1552
|
+
testID?: string;
|
|
1161
1553
|
}
|
|
1162
|
-
declare function
|
|
1554
|
+
declare function CustomerEditor({ customer, create, update, onSaved, onCancel, online, countries, statesFor, defaultCountry, className, testID }: CustomerEditorProps): react_jsx_runtime.JSX.Element;
|
|
1163
1555
|
|
|
1164
1556
|
interface CustomerOrderHistoryProps extends Omit<ViewProps, 'children'> {
|
|
1165
1557
|
orders: any[];
|
|
@@ -1185,8 +1577,62 @@ interface CustomerPickerProps {
|
|
|
1185
1577
|
className?: string;
|
|
1186
1578
|
/** testID of the search field, for e2e tests. Default `customer-picker-search`. */
|
|
1187
1579
|
testID?: string;
|
|
1580
|
+
/** Draws v2's initials avatar on each result row (the selected customer's card above stays without one). Default `false`. */
|
|
1581
|
+
showAvatar?: boolean;
|
|
1582
|
+
/** Draws a Guest row above the results, as v2's `withGuest`; pressing it calls `onSelect(null)`. Default `false`. */
|
|
1583
|
+
withGuest?: boolean;
|
|
1188
1584
|
}
|
|
1189
|
-
declare function CustomerPicker({ search, create, selected, onSelect, onError, online, debounceMs, className, testID }: CustomerPickerProps): react_jsx_runtime.JSX.Element;
|
|
1585
|
+
declare function CustomerPicker({ search, create, selected, onSelect, onError, online, debounceMs, className, testID, showAvatar, withGuest }: CustomerPickerProps): react_jsx_runtime.JSX.Element;
|
|
1586
|
+
|
|
1587
|
+
interface CustomerDropdownProps {
|
|
1588
|
+
/** The connector's searchCustomers, bound to its context by the app. `page` (1-based) asks for the next 50 when the cashier reaches the end of the list; absent means the first page. */
|
|
1589
|
+
search: (query: string, page?: number) => Promise<Customer[]>;
|
|
1590
|
+
/** The first customers to list for an empty query (v2's customer browse, e.g. the first 50 by last name). Absent: an empty query lists Guest alone. `page` (1-based) asks for the next 50 when the cashier reaches the end of the list; absent means the first page. */
|
|
1591
|
+
browse?: (page?: number) => Promise<Customer[]>;
|
|
1592
|
+
selected: Customer | null;
|
|
1593
|
+
/** A customer, or null for Guest. */
|
|
1594
|
+
onSelect: (customer: Customer | null) => void;
|
|
1595
|
+
/** Called for errors the dropdown can't explain to the cashier, including `ConnectorUnauthorizedError`: sign in again only when its `code` is `'unauthorized'` (401). `'forbidden'` (403) means signed in but not allowed; never sign out for it. */
|
|
1596
|
+
onError?: (error: unknown) => void;
|
|
1597
|
+
/** false disables search; Guest stays selectable. */
|
|
1598
|
+
online: boolean;
|
|
1599
|
+
/** Debounce before a search, ms. Default 250. */
|
|
1600
|
+
debounceMs?: number;
|
|
1601
|
+
className?: string;
|
|
1602
|
+
/** testID of the chip. Default `customer-dropdown-chip`. */
|
|
1603
|
+
testID?: string;
|
|
1604
|
+
/** Opens the app's editor for the sale's addresses (v2's split pin beside the chip). Absent: no pin. */
|
|
1605
|
+
onEditAddress?: () => void;
|
|
1606
|
+
/** Default `false`; false greys the pin until the sale's billing has an address, as in v2. */
|
|
1607
|
+
hasAddress?: boolean;
|
|
1608
|
+
}
|
|
1609
|
+
/** v2's cart-header customer chip (the sale's customer, or Guest); it opens a search panel anchored under it, Guest first. */
|
|
1610
|
+
declare function CustomerDropdown({ search, browse, selected, onSelect, onError, online, debounceMs, className, testID, onEditAddress, hasAddress }: CustomerDropdownProps): react_jsx_runtime.JSX.Element;
|
|
1611
|
+
|
|
1612
|
+
interface CustomersListProps {
|
|
1613
|
+
/** The rows, in the order the app's search returned them. */
|
|
1614
|
+
customers: Customer[];
|
|
1615
|
+
/** The search field's text. */
|
|
1616
|
+
query: string;
|
|
1617
|
+
/** Every edit of the search field, and `''` from Clear search. */
|
|
1618
|
+
onQueryChange: (query: string) => void;
|
|
1619
|
+
/** Absent: rows are not pressable and show no chevron (v2 without canEditCustomers). */
|
|
1620
|
+
onOpen?: (customer: Customer) => void;
|
|
1621
|
+
/** Called when the list scrolls within a tenth of its visible height of the end, as CustomerDropdown does. */
|
|
1622
|
+
onEndReached?: () => void;
|
|
1623
|
+
/** A search or page is in flight: a loading row under the rows. */
|
|
1624
|
+
loading?: boolean;
|
|
1625
|
+
/** A sentence the app wants shown above the rows (a failed search). */
|
|
1626
|
+
error?: string;
|
|
1627
|
+
/** Before the search field, e.g. an Add button the app gates. */
|
|
1628
|
+
actions?: React$1.ReactNode;
|
|
1629
|
+
className?: string;
|
|
1630
|
+
/** Default `customers-list`; rows are `${testID}-row-${id}`. */
|
|
1631
|
+
testID?: string;
|
|
1632
|
+
}
|
|
1633
|
+
/** v2's Customers screen list: a search field, then one row per customer, drawn from props. The app owns the search,
|
|
1634
|
+
* paging, the route and the editor. */
|
|
1635
|
+
declare function CustomersList({ customers, query, onQueryChange, onOpen, onEndReached, loading, error, actions, className, testID }: CustomersListProps): react_jsx_runtime.JSX.Element;
|
|
1190
1636
|
|
|
1191
1637
|
interface PaymentMethodCardProps extends Omit<PressableProps, 'children'> {
|
|
1192
1638
|
label: string;
|
|
@@ -1205,14 +1651,17 @@ interface OrderSummaryLineProps extends Omit<HStackProps, 'children'> {
|
|
|
1205
1651
|
}
|
|
1206
1652
|
declare function OrderSummaryLine({ label, amount, bold, className, ...props }: OrderSummaryLineProps): react_jsx_runtime.JSX.Element;
|
|
1207
1653
|
|
|
1208
|
-
|
|
1654
|
+
/** One method the selector offers. */
|
|
1655
|
+
interface PaymentSelectorMethod {
|
|
1209
1656
|
id: string;
|
|
1210
1657
|
label: string;
|
|
1211
1658
|
icon?: ReactNode;
|
|
1212
1659
|
}
|
|
1660
|
+
/** @deprecated Use `PaymentSelectorMethod`; `@tallyui/pos` exports a different `PaymentMethod`. */
|
|
1661
|
+
type PaymentMethod = PaymentSelectorMethod;
|
|
1213
1662
|
interface PaymentSelectorProps extends Omit<VStackProps, 'children'> {
|
|
1214
1663
|
/** Available payment methods */
|
|
1215
|
-
methods:
|
|
1664
|
+
methods: PaymentSelectorMethod[];
|
|
1216
1665
|
/** ID of the currently selected method */
|
|
1217
1666
|
selected: string;
|
|
1218
1667
|
/** Called when a method is selected */
|
|
@@ -1313,7 +1762,7 @@ interface ReceiptPreviewProps extends Omit<ViewProps, 'children'> {
|
|
|
1313
1762
|
}
|
|
1314
1763
|
declare function ReceiptPreview({ items, subtotal, tax, total, payments, headerSlot, footerSlot, className, ...viewProps }: ReceiptPreviewProps): react_jsx_runtime.JSX.Element;
|
|
1315
1764
|
|
|
1316
|
-
type OrderStatus = 'pending' | 'processing' | 'completed' | 'refunded' | 'cancelled';
|
|
1765
|
+
type OrderStatus = 'pending' | 'processing' | 'completed' | 'refunded' | 'cancelled' | 'canceled' | 'on-hold' | 'failed' | 'pos-open' | 'pos-partial' | 'trash' | 'checkout-draft';
|
|
1317
1766
|
interface OrderStatusBadgeProps extends Omit<ViewProps, 'children'> {
|
|
1318
1767
|
status: OrderStatus;
|
|
1319
1768
|
className?: string;
|
|
@@ -1345,6 +1794,11 @@ interface OrderDetailLineItem {
|
|
|
1345
1794
|
quantity: number;
|
|
1346
1795
|
total: string;
|
|
1347
1796
|
}
|
|
1797
|
+
/** One tax rate's share, drawn indented under the Tax row (v2: "US 10% $9.20"). */
|
|
1798
|
+
interface OrderDetailTaxLine {
|
|
1799
|
+
label: string;
|
|
1800
|
+
amount: string;
|
|
1801
|
+
}
|
|
1348
1802
|
interface OrderDetailProps extends Omit<ViewProps, 'children'> {
|
|
1349
1803
|
orderNumber: string;
|
|
1350
1804
|
status: OrderStatus;
|
|
@@ -1352,12 +1806,38 @@ interface OrderDetailProps extends Omit<ViewProps, 'children'> {
|
|
|
1352
1806
|
subtotal: string;
|
|
1353
1807
|
tax: string;
|
|
1354
1808
|
total: string;
|
|
1809
|
+
/** The line under the header, v2's "when · store · cashier"; empty parts are dropped. */
|
|
1810
|
+
meta?: string[];
|
|
1811
|
+
/** Formatted discount, shown as given (pass the negative, e.g. "-$2.00"). Omit to hide the row. */
|
|
1812
|
+
discount?: string;
|
|
1813
|
+
/** Coupon codes, already joined (v2 joins with ", "), in a chip beside "Discount". */
|
|
1814
|
+
couponCodes?: string;
|
|
1815
|
+
/** Formatted shipping total. Omit to hide the row. */
|
|
1816
|
+
shipping?: string;
|
|
1817
|
+
/** Shipping method title, shown beside "Shipping" as "· <title>". */
|
|
1818
|
+
shippingMethod?: string;
|
|
1819
|
+
/** Formatted fees total. Omit to hide the row. */
|
|
1820
|
+
fees?: string;
|
|
1821
|
+
/** Per-rate tax breakdown, indented under the Tax row. */
|
|
1822
|
+
taxLines?: OrderDetailTaxLine[];
|
|
1355
1823
|
customerSlot?: ReactNode;
|
|
1356
1824
|
paymentSlot?: ReactNode;
|
|
1357
1825
|
footerSlot?: ReactNode;
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1826
|
+
/** Re-open the order; draws the Re-open button in the pinned actions row. */
|
|
1827
|
+
onReopen?: () => void;
|
|
1828
|
+
/** Sync the order with the server; draws the Sync button. */
|
|
1829
|
+
onSync?: () => void;
|
|
1830
|
+
/** Show the order's receipt; draws the Receipt button. */
|
|
1831
|
+
onReceipt?: () => void;
|
|
1832
|
+
/** Refund the order; draws Refund in the actions row's destructive group. */
|
|
1833
|
+
onRefund?: () => void;
|
|
1834
|
+
/** Delete the order; draws Delete, which asks for confirmation and calls this only on confirm. */
|
|
1835
|
+
onDelete?: () => void;
|
|
1836
|
+
/** Disables Re-open, e.g. while it runs or while storage is degraded. Default `false`. */
|
|
1837
|
+
reopenDisabled?: boolean;
|
|
1838
|
+
className?: string;
|
|
1839
|
+
}
|
|
1840
|
+
declare function OrderDetail({ orderNumber, status, lineItems, subtotal, tax, total, meta, discount, couponCodes, shipping, shippingMethod, fees, taxLines, customerSlot, paymentSlot, footerSlot, onReopen, onSync, onReceipt, onRefund, onDelete, reopenDisabled, className, ...viewProps }: OrderDetailProps): react_jsx_runtime.JSX.Element;
|
|
1361
1841
|
|
|
1362
1842
|
/** What the form hands back: the order.refund v1 payload minus the ids, session and clock the caller adds. */
|
|
1363
1843
|
type RefundFormValue = Pick<OrderRefundPayload, 'lines' | 'shippingMinor' | 'adjustmentMinor' | 'totalMinor' | 'destination' | 'reason'>;
|
|
@@ -1402,6 +1882,11 @@ interface RefundModalProps extends Omit<RefundFormProps, 'onCancel'> {
|
|
|
1402
1882
|
/** Ports WCPOS v2 modal.tsx: a bounded panel around the refund form. */
|
|
1403
1883
|
declare function RefundModal({ open, onOpenChange, ...formProps }: RefundModalProps): JSX.Element;
|
|
1404
1884
|
|
|
1885
|
+
interface FilterOption {
|
|
1886
|
+
value: string;
|
|
1887
|
+
label: string;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1405
1890
|
/**
|
|
1406
1891
|
* The Orders screen's filter pills, in WCPOS v2's order: Status, Payment Method, Customer, Cashier, Store / Created
|
|
1407
1892
|
* via, Register and Date range, with Clear all. Port of v2 `screens/main/orders/filter-bar.tsx` and its
|
|
@@ -1409,11 +1894,9 @@ declare function RefundModal({ open, onOpenChange, ...formProps }: RefundModalPr
|
|
|
1409
1894
|
* the connector's `orderFilters` and every option list, so no platform's words live here.
|
|
1410
1895
|
*/
|
|
1411
1896
|
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
}
|
|
1416
|
-
type PaymentMethodKind = 'cash' | 'card' | 'stored_value' | 'bank_transfer' | 'other';
|
|
1897
|
+
type OrderFilterOption = FilterOption;
|
|
1898
|
+
/** @deprecated Use `PaymentKind` from `@tallyui/core`; in core, `PaymentMethodKind` is the order's wire method. */
|
|
1899
|
+
type PaymentMethodKind = PaymentKind;
|
|
1417
1900
|
interface OrderFilterBarProps {
|
|
1418
1901
|
value: OrderFilterValue;
|
|
1419
1902
|
onChange(next: OrderFilterValue): void;
|
|
@@ -1425,7 +1908,7 @@ interface OrderFilterBarProps {
|
|
|
1425
1908
|
status?: OrderFilterOption[];
|
|
1426
1909
|
/** Grouped by kind in this order, with a separator between groups: cash, card, stored_value, bank_transfer, other. */
|
|
1427
1910
|
paymentMethod?: (OrderFilterOption & {
|
|
1428
|
-
kind?:
|
|
1911
|
+
kind?: PaymentKind;
|
|
1429
1912
|
})[];
|
|
1430
1913
|
customer?: OrderFilterOption[];
|
|
1431
1914
|
cashier?: OrderFilterOption[];
|
|
@@ -1529,6 +2012,8 @@ interface RegisterBarProps {
|
|
|
1529
2012
|
registerId: string | null;
|
|
1530
2013
|
/** `false` when the store, or the app itself, can't be reached — reads to the cashier as offline. */
|
|
1531
2014
|
online: boolean;
|
|
2015
|
+
/** Sales taken that the store has still to hear: "Offline · N sales to send" offline, "N sales awaiting store" online when no other pill shows (v2). */
|
|
2016
|
+
awaitingStore?: number;
|
|
1532
2017
|
/** Hidden when `multiRegister` is `false`: a single-register store doesn't need to name it. */
|
|
1533
2018
|
registerName?: string;
|
|
1534
2019
|
multiRegister: boolean;
|
|
@@ -1558,7 +2043,7 @@ interface RegisterBarProps {
|
|
|
1558
2043
|
* Dropped for this neutral port: the user sheet, switch-store, the notification bell and the
|
|
1559
2044
|
* WooCommerce OAuth-return rehosting — all app/backend concerns `useRegisterSession` never carries.
|
|
1560
2045
|
*/
|
|
1561
|
-
declare function RegisterBar({ register, registerId, online, registerName, multiRegister, onOpenPanel, onPressPill, storeName, cashier, syncStatus, onOpenMenu, className, }: RegisterBarProps): react_jsx_runtime.JSX.Element;
|
|
2046
|
+
declare function RegisterBar({ register, registerId, online, awaitingStore, registerName, multiRegister, onOpenPanel, onPressPill, storeName, cashier, syncStatus, onOpenMenu, className, }: RegisterBarProps): react_jsx_runtime.JSX.Element;
|
|
1562
2047
|
|
|
1563
2048
|
/**
|
|
1564
2049
|
* The register bar's status pill: one pill, one place. Port provenance (ADR-032 amendment 1):
|
|
@@ -1573,17 +2058,20 @@ declare function RegisterBar({ register, registerId, online, registerName, multi
|
|
|
1573
2058
|
* Copy is plain English (no i18n keys, ADR-064's neutral-copy rule).
|
|
1574
2059
|
*/
|
|
1575
2060
|
|
|
1576
|
-
type RegisterBarPill = 'Choose a register' | 'Close not finished' | 'Offline' | 'Approval needed' | 'Counting' | 'Overdue' | 'Register closed';
|
|
2061
|
+
type RegisterBarPill = 'Choose a register' | 'Close not finished' | 'Offline' | `Offline · ${number} sale to send` | `Offline · ${number} sales to send` | `${number} sale awaiting store` | `${number} sales awaiting store` | 'Approval needed' | 'Counting' | 'Overdue' | 'Register closed';
|
|
1577
2062
|
/**
|
|
1578
2063
|
* Priority, matching WCPOS's ordering: choosing a register outranks everything (LEDGER 48);
|
|
1579
2064
|
* then a closed session whose close isn't in flight (TallyUI: it blocks selling until Finish
|
|
1580
|
-
* closing); then an unreachable store reads as offline,
|
|
1581
|
-
* outranks plain counting; an open, overdue session outranks a
|
|
2065
|
+
* closing); then an unreachable store reads as offline, counting sales still to send, ahead of any
|
|
2066
|
+
* session state; approval needed outranks plain counting; an open, overdue session outranks a
|
|
2067
|
+
* session-less "closed" pill; online sales awaiting the store rank last.
|
|
1582
2068
|
*/
|
|
1583
|
-
declare function describeRegisterBarPill({ registerId, online, sessionStatus, overdue, approvalRequired, sessionsOn, closing, }: {
|
|
2069
|
+
declare function describeRegisterBarPill({ registerId, online, awaitingStore, sessionStatus, overdue, approvalRequired, sessionsOn, closing, }: {
|
|
1584
2070
|
/** The register this till is bound to, or `null` when it isn't bound yet. */
|
|
1585
2071
|
registerId: string | null;
|
|
1586
2072
|
online: boolean;
|
|
2073
|
+
/** Sales taken that the store has still to hear (v2's useAwaitingStoreCount); 0 or omitted counts nothing. */
|
|
2074
|
+
awaitingStore?: number;
|
|
1587
2075
|
/** `conflict` and `superseded` (ADR-078 decision 9) get no pill of their own yet; step 3b decides theirs. */
|
|
1588
2076
|
sessionStatus?: RegisterSession['status'] | null;
|
|
1589
2077
|
overdue?: boolean;
|
|
@@ -1605,6 +2093,8 @@ interface MovementSheetProps {
|
|
|
1605
2093
|
onOpenChange: (open: boolean) => void;
|
|
1606
2094
|
/** A no-sale opens the drawer once recorded (LEDGER 66); there is nothing to open otherwise. */
|
|
1607
2095
|
onOpenDrawer?: () => void;
|
|
2096
|
+
/** Replaces the default reason chips for this type; `[]` shows only "Other…". */
|
|
2097
|
+
reasons?: readonly string[];
|
|
1608
2098
|
}
|
|
1609
2099
|
/**
|
|
1610
2100
|
* Records a paid-in, paid-out or no-sale cash movement. Port provenance (ADR-032 amendment 1):
|
|
@@ -1614,7 +2104,7 @@ interface MovementSheetProps {
|
|
|
1614
2104
|
* after: a refusal afterwards would mean cash already moved with no record of it. A no-sale
|
|
1615
2105
|
* hides the amount field, always records zero, and opens the drawer once the row is written.
|
|
1616
2106
|
*/
|
|
1617
|
-
declare function MovementSheet({ register, type, currency, onDone, onOpenChange, onOpenDrawer }: MovementSheetProps): react_jsx_runtime.JSX.Element;
|
|
2107
|
+
declare function MovementSheet({ register, type, currency, onDone, onOpenChange, onOpenDrawer, reasons }: MovementSheetProps): react_jsx_runtime.JSX.Element;
|
|
1618
2108
|
|
|
1619
2109
|
interface RegisterPanelProps {
|
|
1620
2110
|
/** `useRegisterSession`'s return value: movements, `expected`, `blind`, and every action used here. */
|
|
@@ -1647,6 +2137,17 @@ interface RegisterPanelProps {
|
|
|
1647
2137
|
onPrintXReport?: () => void | Promise<void>;
|
|
1648
2138
|
/** `'side'`: the clock for the session's age; defaults to `new Date()`. */
|
|
1649
2139
|
now?: () => Date;
|
|
2140
|
+
/**
|
|
2141
|
+
* `'side'`: who opened the session (WCPOS v2's opener: its display name and avatar URL). Its name
|
|
2142
|
+
* ends the header line in place of "Cashier", and v2's "opened HH:MM by" line with its avatar (or
|
|
2143
|
+
* initials) sits under the drawer figure. Without it, the header reads "Cashier" and there is no line.
|
|
2144
|
+
*/
|
|
2145
|
+
openedBy?: {
|
|
2146
|
+
name: string;
|
|
2147
|
+
avatar?: string;
|
|
2148
|
+
};
|
|
2149
|
+
/** Replaces MovementSheet's default reason chips per movement type (`MovementSheet.reasons`); a type left out keeps v2's defaults. */
|
|
2150
|
+
movementReasons?: Partial<Record<MovementType, readonly string[]>>;
|
|
1650
2151
|
}
|
|
1651
2152
|
/**
|
|
1652
2153
|
* The register's drawer panel: expected figures, cash movements with Undo, and Close register.
|
|
@@ -1657,7 +2158,7 @@ interface RegisterPanelProps {
|
|
|
1657
2158
|
* note): refused-movement Retry and "Unsynced" (no outbox here to refuse a movement), the
|
|
1658
2159
|
* Z, reprint and the print sheet, the last-closure badge, and the Reports deep link.
|
|
1659
2160
|
*/
|
|
1660
|
-
declare function RegisterPanel({ register, currency, registerName, open, onOpenChange, reapprove, className, presentation, storeName, onPrintXReport, now, }: RegisterPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
2161
|
+
declare function RegisterPanel({ register, currency, registerName, open, onOpenChange, reapprove, className, presentation, storeName, onPrintXReport, now, openedBy, movementReasons, }: RegisterPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
1661
2162
|
|
|
1662
2163
|
interface RegisterColumnProps {
|
|
1663
2164
|
/** `useRegisterSession`'s return value: decides the picker/open/counting/selling swap. */
|
|
@@ -1690,6 +2191,9 @@ declare function RegisterColumn({ register, registerId, registers, onPick, curre
|
|
|
1690
2191
|
|
|
1691
2192
|
/** The exact refusal shown when Close is over `varianceThreshold` and the host gives no `approve` (the Front desk, 2026-09-28). */
|
|
1692
2193
|
declare const APPROVAL_REQUIRED_TEXT = "Manager approval needed. Ask a manager to approve, or count again.";
|
|
2194
|
+
/** Plain-English label for a tender method key: `external` is the till's card tender ('Card');
|
|
2195
|
+
* other keys are title-cased. Shared with `ClosureSheet` and `RegisterPanel`. */
|
|
2196
|
+
declare const tenderLabel: (method: string) => string;
|
|
1693
2197
|
interface RegisterCountProps {
|
|
1694
2198
|
/** `useRegisterSession`'s return value: `expected`, `blind`, `varianceThreshold`, and `backToSelling`/`closeSession`. */
|
|
1695
2199
|
register: ReturnType<typeof useRegisterSession>;
|
|
@@ -1712,17 +2216,23 @@ interface RegisterCountProps {
|
|
|
1712
2216
|
approval?: string;
|
|
1713
2217
|
approvedVariance?: Record<string, number>;
|
|
1714
2218
|
} | null>;
|
|
2219
|
+
/** The host's Z-report print, as `ClosureSheet`'s: given, Close reads "Close & print" and awaits it after a successful close; a print failure is the host's to show. */
|
|
2220
|
+
onPrint?: () => void | Promise<void>;
|
|
2221
|
+
/** Shown instead of the store's message when closing the register or going back to selling fails; the host's `approve` and `onPrint` failures, and the approval-required and sale-in-progress refusals, keep their own text. */
|
|
2222
|
+
failureText?: string;
|
|
1715
2223
|
className?: string;
|
|
1716
2224
|
}
|
|
1717
2225
|
/**
|
|
1718
|
-
* Counts the drawer at close
|
|
1719
|
-
*
|
|
2226
|
+
* Counts the drawer at close, keypad first as v2: the cash amount typed by its keypad (which folds
|
|
2227
|
+
* away once a valid amount loses focus) or by notes and coins (a section closed by default), other
|
|
2228
|
+
* tenders kept as typed, a live variance line, and Close (gated by `approve` over threshold, then
|
|
2229
|
+
* `onPrint` when given) or Back to selling. Keypad and fold: WCPOS v2 (monorepo main) `register-count.tsx`.
|
|
1720
2230
|
* Port provenance (ADR-032 amendment 1): WCPOS `next` `3b5331b5c` `register-count.tsx` (LEDGER
|
|
1721
2231
|
* 59, 60, 65, 67). Leaves out WCPOS's ApproveSheet and server-demanded `approval_required`
|
|
1722
2232
|
* (registers c2) — `approve` is the host's own gate, and it runs regardless of `blind`: dropping
|
|
1723
2233
|
* the server flag would otherwise leave a blind count with no gate at all over threshold.
|
|
1724
2234
|
*/
|
|
1725
|
-
declare function RegisterCount({ register, currency, approve, className }: RegisterCountProps): react_jsx_runtime.JSX.Element | null;
|
|
2235
|
+
declare function RegisterCount({ register, currency, approve, onPrint, failureText, className }: RegisterCountProps): react_jsx_runtime.JSX.Element | null;
|
|
1726
2236
|
|
|
1727
2237
|
interface ClosureSheetProps {
|
|
1728
2238
|
/** `useRegisterSession`'s return value: reads `lastClosure` and `blind`. */
|
|
@@ -1782,6 +2292,88 @@ interface HandoverSlipProps {
|
|
|
1782
2292
|
*/
|
|
1783
2293
|
declare function HandoverSlip({ slip, currency }: HandoverSlipProps): react_jsx_runtime.JSX.Element;
|
|
1784
2294
|
|
|
2295
|
+
type CashierSheetDrawer = {
|
|
2296
|
+
/** The door was pressed: the app opens its register panel. */ onOpen: () => void;
|
|
2297
|
+
/** v2's `busy` (a payment in progress, a busy switch): the door cannot be pressed. */ disabled?: boolean;
|
|
2298
|
+
} & ({
|
|
2299
|
+
state: 'closed'; /** The last closure's number, the store's own when acknowledged. Default "—". */
|
|
2300
|
+
lastClosure?: string | number;
|
|
2301
|
+
} | {
|
|
2302
|
+
state: 'open' | 'counting';
|
|
2303
|
+
/** Expected cash in integer minor units, a blind count's number of sales, or pending figures. */
|
|
2304
|
+
figure: {
|
|
2305
|
+
kind: 'cash';
|
|
2306
|
+
amountMinor: number;
|
|
2307
|
+
currency: string;
|
|
2308
|
+
} | {
|
|
2309
|
+
kind: 'blind';
|
|
2310
|
+
salesCount: number;
|
|
2311
|
+
} | {
|
|
2312
|
+
kind: 'pending';
|
|
2313
|
+
};
|
|
2314
|
+
/** The open time, already formatted ("HH:mm" in the store's zone). */
|
|
2315
|
+
openedAt: string;
|
|
2316
|
+
opener: {
|
|
2317
|
+
name: string;
|
|
2318
|
+
avatar?: string;
|
|
2319
|
+
};
|
|
2320
|
+
/** Only when there is more than one register (v2 :182-185). */ registerName?: string;
|
|
2321
|
+
/** state "counting" only: when the count began, already formatted. Default "—". */ countingSince?: string;
|
|
2322
|
+
});
|
|
2323
|
+
interface CashierSheetCashier {
|
|
2324
|
+
id: string;
|
|
2325
|
+
name: string;
|
|
2326
|
+
avatar?: string;
|
|
2327
|
+
/** This cashier's open carts on this register; the line is hidden at 0 or undefined. */ openCarts?: number;
|
|
2328
|
+
}
|
|
2329
|
+
interface CashierSheetHandTo {
|
|
2330
|
+
/** The other cashiers (the app leaves out the one signed in, as v2's UserRows does). */ cashiers: CashierSheetCashier[];
|
|
2331
|
+
/** A row was pressed: the app shows its `SwitchConfirm kind="cashier"`. The sheet stays open. */ onHandTo: (id: string) => void;
|
|
2332
|
+
/** v2's `busy` (a busy switch): every row is disabled. */ disabled?: boolean;
|
|
2333
|
+
/** v2's `countingHere`: a count is open on this register; rows are disabled and the header says why. */ counting?: boolean;
|
|
2334
|
+
}
|
|
2335
|
+
interface CashierSheetPlace {
|
|
2336
|
+
/** The current store's or register's name. */ name: string;
|
|
2337
|
+
/** "Switch" was pressed: the app opens its own picker (`RegisterPicker` for registers). Absent hides the verb (v2 shows it with two or more). */ onSwitch?: () => void;
|
|
2338
|
+
/** Why Switch is held (v2: "Needs the store to switch" offline; the open-sale reason for registers). Drawn under the row unless `paying`, and disables Switch. */ heldReason?: string;
|
|
2339
|
+
/** v2's `busy`: Switch is disabled, with no line. */ disabled?: boolean;
|
|
2340
|
+
}
|
|
2341
|
+
interface CashierSheetProps {
|
|
2342
|
+
cashier: {
|
|
2343
|
+
name: string;
|
|
2344
|
+
avatar?: string;
|
|
2345
|
+
};
|
|
2346
|
+
/** The header line, already joined: store · register (when there are several) · "since HH:mm". Hidden when absent. */
|
|
2347
|
+
description?: string;
|
|
2348
|
+
/** "Your sales today", in integer minor units. Hidden when absent. */
|
|
2349
|
+
salesToday?: {
|
|
2350
|
+
amountMinor: number;
|
|
2351
|
+
currency: string;
|
|
2352
|
+
};
|
|
2353
|
+
/** Sign out pressed. The sheet stays open; the app decides, after its `SwitchConfirm`. */
|
|
2354
|
+
onSignOut: () => void;
|
|
2355
|
+
/** v2's holds (a payment in progress, a busy switch): Sign out is disabled. */
|
|
2356
|
+
signOutDisabled?: boolean;
|
|
2357
|
+
onOpenChange: (open: boolean) => void;
|
|
2358
|
+
/** v2's drawer door under "Your sales today": the app's figures; pressing it opens the app's register panel. Hidden when absent. */
|
|
2359
|
+
drawer?: CashierSheetDrawer;
|
|
2360
|
+
/** v2's "Hand the till to": the other cashiers; pressing a row calls `onHandTo(id)`. Hidden when absent or empty. */ handTo?: CashierSheetHandTo;
|
|
2361
|
+
/** v2's `paying` hold: shows "Finish the payment first" and disables the hand-to rows (Sign out keeps `signOutDisabled`). */ paying?: boolean;
|
|
2362
|
+
/** The sales the store has still to hear; the notice is hidden at 0 or undefined. */ awaitingStore?: number;
|
|
2363
|
+
/** v2's Store row; hidden when absent. */ store?: CashierSheetPlace;
|
|
2364
|
+
/** v2's Register row; hidden when absent. The app passes it only when bound with two or more registers, as v2 does. */ register?: CashierSheetPlace;
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* The cashier's sheet on the right edge: the header, "Your sales today", the drawer door, the awaiting-store and payment hold
|
|
2368
|
+
* notices, "Hand the till to", the Store and Register rows and Sign out (v2 parity S9a-S9d). The app
|
|
2369
|
+
* mounts it while open, as `SwitchConfirm` and `MovementSheet` are mounted. Port provenance: WCPOS v2 monorepo
|
|
2370
|
+
* `main` ec022c989 `packages/core/src/screens/main/pos/cart/user-sheet.tsx` (:632 the container, :654-676 the
|
|
2371
|
+
* header, :680-687 the sales row, :688-691 the drawer door from :120-165 and :180-229, :693-723 the notices and "Hand the
|
|
2372
|
+
* till to" from :231-289, :724-753 the Store and Register rows with `StoreRow` from :436-475, :800-821 Sign out), with its English copy (`core.json` `register.*`). Literal
|
|
2373
|
+
* English, as the other register components carry it. Not here: v2's in-sheet store and register panes (the app opens its own picker) and the Woo footer.
|
|
2374
|
+
*/
|
|
2375
|
+
declare function CashierSheet({ cashier, description, salesToday, onSignOut, signOutDisabled, onOpenChange, drawer, handTo, paying, awaitingStore, store, register }: CashierSheetProps): react_jsx_runtime.JSX.Element;
|
|
2376
|
+
|
|
1785
2377
|
interface SettingsRowProps extends Omit<ViewProps, 'children'> {
|
|
1786
2378
|
label: string;
|
|
1787
2379
|
description?: string;
|
|
@@ -1851,6 +2443,7 @@ interface CustomerDisplaySettingsProps {
|
|
|
1851
2443
|
displays: {
|
|
1852
2444
|
status: TillDisplayStatus;
|
|
1853
2445
|
displays: readonly TillDisplayEntry[];
|
|
2446
|
+
pauseReason?: 'signed_out' | 'forbidden' | 'device_refused' | null;
|
|
1854
2447
|
};
|
|
1855
2448
|
onStartPairing: () => void;
|
|
1856
2449
|
onConfirm: (claimId: string) => void;
|
|
@@ -1863,6 +2456,78 @@ interface CustomerDisplaySettingsProps {
|
|
|
1863
2456
|
}
|
|
1864
2457
|
declare function CustomerDisplaySettings({ pairing, displays, onStartPairing, onConfirm, onDecline, onCancelPairing, onForget, formatTime, className, }: CustomerDisplaySettingsProps): JSX.Element;
|
|
1865
2458
|
|
|
2459
|
+
/**
|
|
2460
|
+
* Settings › Printing, the Printers section and template routing: ported from WCPOS v2
|
|
2461
|
+
* `packages/core/src/screens/main/settings/printing/` (`index.tsx`, `printer-row.tsx`, `template-row.tsx`). Props only;
|
|
2462
|
+
* the app passes the printers and wires every callback, and opens its own add/edit dialog from `onAdd` / `onEdit` and
|
|
2463
|
+
* shows the result of `onTest`. The setup report and docs link are optional (`onCopySetupReport`, `onOpenHelp`);
|
|
2464
|
+
* the app does the copying, the toast and opening the docs. Left out (a later row): the test-print toast.
|
|
2465
|
+
*/
|
|
2466
|
+
|
|
2467
|
+
type RoutedTemplate = Pick<ReceiptTemplate, 'id' | 'kind' | 'title' | 'engine' | 'paper'>;
|
|
2468
|
+
interface PrintingSettingsProps {
|
|
2469
|
+
printers: readonly PrinterProfile[];
|
|
2470
|
+
/** v2's isLoading: the section shows its title only. Default false. */
|
|
2471
|
+
loading?: boolean;
|
|
2472
|
+
/** Ids of printers whose test print is running; their Test Print button shows its loading state. */
|
|
2473
|
+
testingIds?: ReadonlySet<string>;
|
|
2474
|
+
onTest: (printer: PrinterProfile) => void;
|
|
2475
|
+
onEdit: (printer: PrinterProfile) => void;
|
|
2476
|
+
onSetDefault: (id: string) => void;
|
|
2477
|
+
/** Called after the cashier confirms the delete dialog. */
|
|
2478
|
+
onDelete: (id: string) => void;
|
|
2479
|
+
onAdd: () => void;
|
|
2480
|
+
/** The store's templates, in its order. When absent, no routing sections are drawn. */
|
|
2481
|
+
templates?: readonly RoutedTemplate[];
|
|
2482
|
+
/** Template id -> printer profile id: this device's overrides. Default `{}`. */
|
|
2483
|
+
routing?: Readonly<Record<string, string>>;
|
|
2484
|
+
/** A template's printer was chosen; `null` means Auto (clear the override). */
|
|
2485
|
+
onRoutingChange?: (templateId: string, printerId: string | null) => void;
|
|
2486
|
+
/** v2's "Copy setup report": adds that item, first in each printer row's menu, and makes the menu show for every row. The app builds
|
|
2487
|
+
* and copies the report (clipboard or share sheet) and shows any toast; the component only calls this. */
|
|
2488
|
+
onCopySetupReport?: (printer: PrinterProfile) => void;
|
|
2489
|
+
/** v2's "Having trouble?" link under the printer list; pressing it calls this (the app opens its printer docs). Absent: no link. */
|
|
2490
|
+
onOpenHelp?: () => void;
|
|
2491
|
+
className?: string;
|
|
2492
|
+
}
|
|
2493
|
+
declare function PrintingSettings({ printers, loading, testingIds, onTest, onEdit, onSetDefault, onDelete, onAdd, templates, routing, onRoutingChange, onCopySetupReport, onOpenHelp, className, }: PrintingSettingsProps): JSX.Element;
|
|
2494
|
+
|
|
2495
|
+
/** What Save and Test Print hand over; the app assigns or keeps the id. */
|
|
2496
|
+
type PrinterFormDraft = Omit<PrinterProfile, 'id'>;
|
|
2497
|
+
interface PrinterFormProps {
|
|
2498
|
+
/** Given, edits this printer; absent, adds a new one. */
|
|
2499
|
+
printer?: PrinterProfile;
|
|
2500
|
+
/** Returns an inline refusal, or null once saved. A promise disables Save while pending. */
|
|
2501
|
+
onSave: (draft: PrinterFormDraft) => string | null | Promise<string | null>;
|
|
2502
|
+
onCancel: () => void;
|
|
2503
|
+
/** Given, a Test Print button passes the current draft. */
|
|
2504
|
+
onTest?: (draft: PrinterFormDraft) => void;
|
|
2505
|
+
className?: string;
|
|
2506
|
+
}
|
|
2507
|
+
declare function PrinterForm({ printer, onSave, onCancel, onTest, className }: PrinterFormProps): JSX.Element;
|
|
2508
|
+
|
|
2509
|
+
interface BarcodeScanningValues {
|
|
2510
|
+
/** Average gap between keys, in ms, below which a burst is a scan (v2 default 24). */
|
|
2511
|
+
threshold: number;
|
|
2512
|
+
/** Shortest code accepted as a scan (v2 default 8). */
|
|
2513
|
+
minChars: number;
|
|
2514
|
+
prefix: string;
|
|
2515
|
+
suffix: string;
|
|
2516
|
+
}
|
|
2517
|
+
interface BarcodeScanningSettingsProps {
|
|
2518
|
+
values: BarcodeScanningValues;
|
|
2519
|
+
/** Called with only the field that changed, as soon as it holds a valid value. */
|
|
2520
|
+
onChange: (patch: Partial<BarcodeScanningValues>) => void;
|
|
2521
|
+
className?: string;
|
|
2522
|
+
/** v2's Barcode Scanning Test: drawn only when given. The app captures the keys and runs `analyzeScanTrace` with the
|
|
2523
|
+
* current values; `analysis` is null before the first test scan. `capture` is the app's own capture field, drawn first. */
|
|
2524
|
+
test?: {
|
|
2525
|
+
analysis: TraceAnalysis | null;
|
|
2526
|
+
capture?: React.ReactNode;
|
|
2527
|
+
};
|
|
2528
|
+
}
|
|
2529
|
+
declare function BarcodeScanningSettings({ values, onChange, className, test }: BarcodeScanningSettingsProps): react_jsx_runtime.JSX.Element;
|
|
2530
|
+
|
|
1866
2531
|
interface TaxBasedOnProps {
|
|
1867
2532
|
derivation: TaxDerivation;
|
|
1868
2533
|
/** "Change in Settings › Tax"; the link shows only when given. */
|
|
@@ -1881,7 +2546,7 @@ interface TaxBasedOnProps {
|
|
|
1881
2546
|
declare function TaxBasedOn({ derivation, onChangeSetting, onViewAllRates, countryName, className }: TaxBasedOnProps): react_jsx_runtime.JSX.Element;
|
|
1882
2547
|
|
|
1883
2548
|
/** `taxLabel` names each tax row; VAT isn't universal, so a platform passes its own (medusapos passes `VAT ${rate}%`). */
|
|
1884
|
-
declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscounts, taxClasses, afterSubtotal, showTotal, couponDiscountMinor, orderActions, checkout, lineEditor, columns, emptyIcon, emptyText }: {
|
|
2549
|
+
declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscounts, taxClasses, afterSubtotal, showTotal, couponDiscountMinor, orderActions, orderDiscountChips, checkout, noteSheet, tenderLedger, picker, lineEditor, lineCommit, columns, chargeTaxSwitch, emptyIcon, emptyText }: {
|
|
1885
2550
|
sale: ReturnType<typeof useSale>;
|
|
1886
2551
|
taxLabel?: (ratePpm: number) => string;
|
|
1887
2552
|
taxClasses?: ReadonlyArray<{
|
|
@@ -1903,27 +2568,67 @@ declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscou
|
|
|
1903
2568
|
afterSubtotal?: ReactNode;
|
|
1904
2569
|
/** Draws the totals' Total row. Pass `false` for v2's cart, where the total is on the Checkout button (`checkout`). Default `true`. */
|
|
1905
2570
|
showTotal?: boolean;
|
|
1906
|
-
/** The coupon amount the app itemises in `afterSubtotal` (e.g. Σ `order.display.coupons`
|
|
2571
|
+
/** The coupon amount the app itemises in `afterSubtotal` (e.g. Σ `order.display.coupons` and, with
|
|
2572
|
+
* `orderDiscountChips={false}`, `order.display.orderDiscountMinor`), in integer minor units of
|
|
1907
2573
|
* the order's currency, in the display mode. When given, the Discount row shows the other discounts only (the
|
|
1908
2574
|
* totals' discount minus this) and is hidden when they come to 0. Absent: the Discount row is the whole discount. */
|
|
1909
2575
|
couponDiscountMinor?: number;
|
|
1910
2576
|
/** Cart's own Order discount and Add charge controls; pass `false` when the app hosts them in its own menu (v2's
|
|
1911
2577
|
* cart "+" menu). Applied discounts and charges still show and can be removed. */
|
|
1912
2578
|
orderActions?: boolean;
|
|
2579
|
+
/** Draws the applied order discounts as removable chips under the lines. Pass `false` when the app draws them itself,
|
|
2580
|
+
* e.g. as a removable Discount row in `afterSubtotal`; add their amount (`order.display.orderDiscountMinor`) to
|
|
2581
|
+
* `couponDiscountMinor` so the Discount row does not count them twice. Default `true`. */
|
|
2582
|
+
orderDiscountChips?: boolean;
|
|
1913
2583
|
/** Swaps the Cash and Card terminal row for v2's foot, `CartFoot`: "Checkout {total}" calls `onCheckout`, and the
|
|
1914
|
-
* ⋮ menu lists `actions
|
|
2584
|
+
* ⋮ menu lists `actions`, with `note` above the buttons. Absent: the Cash and Card terminal row. */
|
|
1915
2585
|
checkout?: {
|
|
1916
2586
|
onCheckout: () => void;
|
|
1917
2587
|
actions?: readonly CartFootAction[];
|
|
2588
|
+
note?: {
|
|
2589
|
+
text: string;
|
|
2590
|
+
onPress: () => void;
|
|
2591
|
+
};
|
|
2592
|
+
};
|
|
2593
|
+
/** v2's note editing, owned by the Cart: the ⋮ menu gains "Order details" (first), which opens `OrderNoteSheet`
|
|
2594
|
+
* on `sale.order.note`, and the note row above the buttons shows that note and opens the sheet too. `label`
|
|
2595
|
+
* names the note (default "Customer note"; a platform whose note the customer never sees passes its own, e.g.
|
|
2596
|
+
* "Order note"). Needs `checkout`; when given, it replaces `checkout.note`. */
|
|
2597
|
+
noteSheet?: {
|
|
2598
|
+
label?: string;
|
|
2599
|
+
};
|
|
2600
|
+
/** v2's checkout cart (stilled-cart.tsx): while `sale.stage` is tender, the payments ledger (each leg with its status and Cancel payment, then Total, Paid and Remaining) sits under the totals in place of the foot. `methods` names the legs, as on Tender. Pair it with `<Tender ledger={false} />`. `confirmVoid` asks v2's "Cancel this payment?" before a leg is voided (default `false`). */
|
|
2601
|
+
tenderLedger?: {
|
|
2602
|
+
methods?: PaymentMethodDescriptor[];
|
|
2603
|
+
confirmVoid?: boolean;
|
|
2604
|
+
};
|
|
2605
|
+
/** WCPOS v2's split-by-item bill (stilled-cart.tsx): the cart is read-only, and each line whose quantity is a positive
|
|
2606
|
+
* whole number, whose total is not negative and that has units left unpaid shows this payment's `− n of unpaid +`
|
|
2607
|
+
* stepper in its quantity cell, with what the picked units add under it. `picked`: this payment's units per line id;
|
|
2608
|
+
* `paid`: the units earlier live payments took per line id; `unitMinor(lineId, units)`: the minor units `units` more
|
|
2609
|
+
* of that line add after the paid ones; `onPick(lineId, units)` sets this payment's units. */
|
|
2610
|
+
picker?: {
|
|
2611
|
+
picked: Readonly<Record<string, number>>;
|
|
2612
|
+
paid: Readonly<Record<string, number>>;
|
|
2613
|
+
unitMinor: (lineId: string, units: number) => number;
|
|
2614
|
+
onPick: (lineId: string, units: number) => void;
|
|
1918
2615
|
};
|
|
1919
2616
|
/** `popover`: tapping a line's quantity or price opens v2's keypad (WCPOS cart cells/quantity-keypad.tsx and
|
|
1920
2617
|
* cells/price.tsx), the price one with the quick-discount keys and the struck regular price. Popover mode draws no
|
|
1921
2618
|
* button row under the line: Discount, Price (narrow cart) and Remove are in the quantity popover, Discount in the
|
|
1922
2619
|
* price popover. Default `inline`: the − / + buttons and Price form. */
|
|
1923
2620
|
lineEditor?: 'inline' | 'popover';
|
|
2621
|
+
/** With `lineEditor="popover"`, `close` gives both popovers v2's grow keypad (LinePopover's `commit="close"`): Done;
|
|
2622
|
+
* Escape closes without writing, any other close writes what was typed, and a refused price on that close shows under
|
|
2623
|
+
* the line. The quantity one adds − / + steppers that write at once, − turning into Remove at 1 (in place of the
|
|
2624
|
+
* Remove action). Default `apply`. */
|
|
2625
|
+
lineCommit?: 'apply' | 'close';
|
|
1924
2626
|
/** v2's Cart Settings › Columns: which columns show, a Split link under a quantity above 1 (`quantity.split`) and the
|
|
1925
2627
|
* SKU under the name (`name.sku`). The defaults are today's cart: Qty, Item, Price (folding as before) and Total. */
|
|
1926
2628
|
columns?: CartColumnSettings;
|
|
2629
|
+
/** Shows ChargeForm's "Amount Includes Tax" switch on fees and shipping. Pass `false` to hide it, so a new charge takes
|
|
2630
|
+
* the store's tax mode; an existing charge keeps the flag it already has. Default `true`. */
|
|
2631
|
+
chargeTaxSwitch?: boolean;
|
|
1927
2632
|
/** The empty cart's icon, centred above `emptyText` and hidden from screen readers. Default: v2's cart icon in the
|
|
1928
2633
|
* muted colour. Pass `null` for no icon. */
|
|
1929
2634
|
emptyIcon?: ReactNode;
|
|
@@ -1931,27 +2636,62 @@ declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscou
|
|
|
1931
2636
|
emptyText?: string;
|
|
1932
2637
|
}): react_jsx_runtime.JSX.Element;
|
|
1933
2638
|
|
|
2639
|
+
interface OrderNoteSheetProps {
|
|
2640
|
+
/** The note as it stands; the sheet edits it live, as v2's autosaved field does. */
|
|
2641
|
+
value: string;
|
|
2642
|
+
onChangeText: (text: string) => void;
|
|
2643
|
+
onOpenChange: (open: boolean) => void;
|
|
2644
|
+
/** The note's name: the field's label and accessible name, and "Add <label lower-cased>" as its placeholder.
|
|
2645
|
+
* Default "Customer note" (WooCommerce's customer_note, which the customer sees). */
|
|
2646
|
+
label?: string;
|
|
2647
|
+
}
|
|
2648
|
+
declare function OrderNoteSheet({ value, onChangeText, onOpenChange, label }: OrderNoteSheetProps): JSX.Element;
|
|
2649
|
+
|
|
1934
2650
|
/** Phone mode's cart summary (medusapos ADR 0009): the whole bar is one button; the total is the cart's own Total row. */
|
|
1935
2651
|
declare function CartBar({ sale, onOpen }: {
|
|
1936
2652
|
sale: ReturnType<typeof useSale>;
|
|
1937
2653
|
onOpen: () => void;
|
|
1938
2654
|
}): react_jsx_runtime.JSX.Element;
|
|
1939
2655
|
|
|
2656
|
+
type Sale$2 = ReturnType<typeof useSale>;
|
|
2657
|
+
type TenderPicker = {
|
|
2658
|
+
picked: Readonly<Record<string, number>>;
|
|
2659
|
+
paid: Readonly<Record<string, number>>;
|
|
2660
|
+
unitMinor: (lineId: string, units: number) => number;
|
|
2661
|
+
onPick: (lineId: string, units: number) => void;
|
|
2662
|
+
};
|
|
2663
|
+
/** The picks that still stand on the order (unknown lines dropped, each clamped to unpaid) and their money; `null` when none. Never throws. */
|
|
2664
|
+
declare function pickFigure(order: Sale$2['order'], picked: Readonly<Record<string, number>>): {
|
|
2665
|
+
picks: Record<string, number>;
|
|
2666
|
+
minor: number;
|
|
2667
|
+
} | null;
|
|
2668
|
+
/** One tender reducer above both columns, so Cart's `picker` and Tender share this payment's picks. */
|
|
2669
|
+
declare function useTender(sale: Sale$2, methods?: PaymentMethodDescriptor[]): {
|
|
2670
|
+
state: TenderState;
|
|
2671
|
+
dispatch: (action: TenderAction) => void;
|
|
2672
|
+
picker: TenderPicker | undefined;
|
|
2673
|
+
};
|
|
2674
|
+
|
|
1940
2675
|
type Sale$1 = ReturnType<typeof useSale>;
|
|
1941
2676
|
type TenderProps = {
|
|
1942
2677
|
sale: Sale$1;
|
|
1943
|
-
methods?: PaymentMethodDescriptor[];
|
|
2678
|
+
methods?: PaymentMethodDescriptor[]; /** Passed to TenderPane: `false` leaves the ledger to Cart's `tenderLedger`. Default `true`. */
|
|
2679
|
+
ledger?: boolean; /** Passed to TenderPane: `false` hides Back (v2's phone checkout). Default `true`. */
|
|
2680
|
+
back?: boolean;
|
|
2681
|
+
/** Passed to TenderPane's ledger: v2's "Cancel this payment?" before a leg is voided. Default `false`. */ confirmVoid?: boolean;
|
|
2682
|
+
/** One reducer shared with Cart's `picker` (useTender). Without it, Tender keeps its own reducer, as before. */ tender?: ReturnType<typeof useTender>;
|
|
1944
2683
|
};
|
|
1945
2684
|
/** The tender pane with its own reducer, opened on the method `startTender` chose. Renders nothing outside the tender stage. */
|
|
1946
|
-
declare function Tender({ sale, methods }: TenderProps): JSX.Element | null;
|
|
2685
|
+
declare function Tender({ sale, methods, ledger, back, confirmVoid, tender }: TenderProps): JSX.Element | null;
|
|
1947
2686
|
/** @deprecated Use Tender: the pane now handles split payments. */
|
|
1948
2687
|
declare function SplitTender(props: TenderProps): JSX.Element;
|
|
1949
2688
|
|
|
1950
2689
|
/**
|
|
1951
2690
|
* The tender pane, laid out as WCPOS v2's (monorepo main, packages/core/src/screens/main/pos/checkout/tender/):
|
|
1952
|
-
* BalanceHeadline
|
|
2691
|
+
* BalanceHeadline from ledger-pane.tsx, LedgerLegs (now tender-ledger.tsx's TenderLedger), then the method tiles, entry, quick-cash chips,
|
|
1953
2692
|
* keypad and commit from tender-pane.tsx's TenderKeypad. Copy is read with useT, under v2's catalogue keys. Every figure
|
|
1954
2693
|
* comes from pos (useSale's captured-only totals, tenderRounding, quickTenderedAmounts, planLegs).
|
|
2694
|
+
* The caption row and the hero figure follow tender-pane.tsx's caption row and AmountFigure (v2 :390-459).
|
|
1955
2695
|
*/
|
|
1956
2696
|
|
|
1957
2697
|
type Sale = ReturnType<typeof useSale>;
|
|
@@ -1960,21 +2700,41 @@ interface TenderPaneProps {
|
|
|
1960
2700
|
/** The tender reducer's state (`tenderReducer` in @tallyui/pos); the host owns the reducer. */
|
|
1961
2701
|
state: TenderState;
|
|
1962
2702
|
dispatch: (action: TenderAction) => void;
|
|
1963
|
-
/** Defaults to `defaultPaymentMethods()
|
|
2703
|
+
/** Defaults to `defaultPaymentMethods()`. Each manual-capture method is offered, recorded as its wire method (`wireMethodOf`) plus its own id. */
|
|
1964
2704
|
methods?: PaymentMethodDescriptor[];
|
|
2705
|
+
/** Draws the payments ledger in the pane. Pass `false` when the host shows it in the cart column, as v2 does (Cart's `tenderLedger`). Default `true`. */
|
|
2706
|
+
ledger?: boolean;
|
|
2707
|
+
/** Draws the Back button (`sale.cancelTender`). Pass `false` when the host leaves the tender stage itself, as v2's phone checkout does. Default `true`. */ back?: boolean;
|
|
2708
|
+
/** Passed to the ledger: v2's "Cancel this payment?" before a leg is voided. Default `false`: Cancel payment voids at once. */
|
|
2709
|
+
confirmVoid?: boolean;
|
|
1965
2710
|
}
|
|
1966
|
-
declare function TenderPane({ sale, state, dispatch, methods }: TenderPaneProps): JSX.Element | null;
|
|
2711
|
+
declare function TenderPane({ sale, state, dispatch, methods, ledger, back, confirmVoid }: TenderPaneProps): JSX.Element | null;
|
|
1967
2712
|
|
|
1968
2713
|
/** The cashier's entry as a TallyUI Discount (a percent, or integer minor units), or the inline error to show. */
|
|
1969
|
-
declare function parseDiscount(type: Discount['type'], text: string, currency: string): Discount | string;
|
|
2714
|
+
declare function parseDiscount(type: Discount['type'], text: string, currency: string, format?: MoneyFormat): Discount | string;
|
|
1970
2715
|
/** "10%", or a fixed discount's amount as it actually comes off (amountMinor), never the amount requested. */
|
|
1971
|
-
declare const discountLabel: (discount: AppliedDiscount, currency: string) => string;
|
|
1972
|
-
/**
|
|
1973
|
-
|
|
1974
|
-
|
|
2716
|
+
declare const discountLabel: (discount: AppliedDiscount, currency: string, format?: (money: Money) => string | undefined) => string;
|
|
2717
|
+
/** One of the store's coupons, already formatted by the app (v2 add-coupon.tsx:233-286). */
|
|
2718
|
+
type DiscountCoupon = {
|
|
2719
|
+
code: string;
|
|
2720
|
+
detail?: string;
|
|
2721
|
+
amountLabel?: string;
|
|
2722
|
+
};
|
|
2723
|
+
/** `onApply` returns a refusal to show inline (the capability gate), or null once applied. `layout="dialog"`: v2's Add Discount body. */
|
|
2724
|
+
declare function DiscountForm({ title, currency, onApply, onClose, layout, onApplyCoupon, coupons, onNewCoupon, newCouponDisabledReason }: {
|
|
2725
|
+
title?: string;
|
|
1975
2726
|
currency: string;
|
|
1976
2727
|
onApply: (discount: Discount) => string | null;
|
|
1977
2728
|
onClose: () => void;
|
|
2729
|
+
layout?: 'inline' | 'dialog';
|
|
2730
|
+
/** layout="dialog" only: with this, the dialog shows v2's Quick discount / Coupon tabs. Resolve a refusal to show, or null once applied (e.g. sale.applyCoupon). */
|
|
2731
|
+
onApplyCoupon?: (code: string) => Promise<string | null>;
|
|
2732
|
+
/** The coupons the Coupon tab lists (the app's data). Default []. */
|
|
2733
|
+
coupons?: readonly DiscountCoupon[];
|
|
2734
|
+
/** With this, the Coupon tab shows v2's "New coupon" (+) button; creating the coupon is the app's job. */
|
|
2735
|
+
onNewCoupon?: () => void;
|
|
2736
|
+
/** Already-translated reason the New coupon button is disabled (e.g. offline); shown as its tooltip and accessibility hint. */
|
|
2737
|
+
newCouponDisabledReason?: string;
|
|
1978
2738
|
}): react_jsx_runtime.JSX.Element;
|
|
1979
2739
|
/** Applied discounts as badges; pressing one removes it through TallyUI's builder. */
|
|
1980
2740
|
/** `prefix` names a chip that would otherwise read like a fee, e.g. "Order discount −€0.50". */
|
|
@@ -1991,7 +2751,7 @@ declare function DiscountChips({ discounts, currency, onRemove, prefix, amounts
|
|
|
1991
2751
|
}): react_jsx_runtime.JSX.Element | null;
|
|
1992
2752
|
|
|
1993
2753
|
/** The cashier's entry as integer minor units of `currency` (0 allowed), or the inline error to show. */
|
|
1994
|
-
declare function parsePrice(text: string, currency: string): number | string;
|
|
2754
|
+
declare function parsePrice(text: string, currency: string, format?: MoneyFormat): number | string;
|
|
1995
2755
|
/** `onApply` returns a refusal to show inline, or null once applied. */
|
|
1996
2756
|
declare function PriceForm({ lineName, currency, currentMinor, onApply, onClose, quickDiscounts }: {
|
|
1997
2757
|
lineName: string;
|
|
@@ -2027,12 +2787,21 @@ interface LinePopoverProps {
|
|
|
2027
2787
|
onPress: () => void;
|
|
2028
2788
|
destructive?: boolean;
|
|
2029
2789
|
}>;
|
|
2790
|
+
/** `apply` (default): today's Apply / Cancel. `close`: v2's grow keypad. There is no Apply or Cancel, and a full-width
|
|
2791
|
+
* Done writes what was typed. Escape closes without writing, and any other close (a press outside, the overlay) writes
|
|
2792
|
+
* it; a refusal on that path goes to `onCloseRefused`, as the popover is already closing. A quantity also gets v2's − / +
|
|
2793
|
+
* steppers, which write at once. */
|
|
2794
|
+
commit?: 'apply' | 'close';
|
|
2795
|
+
/** `commit="close"` only: called with the refusal when the write on a close other than Done is refused; the popover is already closing, so the host shows it. */
|
|
2796
|
+
onCloseRefused?: (message: string) => void;
|
|
2797
|
+
/** Quantity with `commit="close"` only: − becomes Remove at a shown quantity of 1 or less, closes without writing and calls this. */
|
|
2798
|
+
onRemove?: () => void;
|
|
2030
2799
|
}
|
|
2031
2800
|
/**
|
|
2032
2801
|
* A cart line's quantity or price that opens v2's keypad: the cashier types (or picks a quick discount),
|
|
2033
|
-
* Apply writes through `onApply`, and Cancel, Escape or a press outside close without writing.
|
|
2802
|
+
* Apply writes through `onApply`, and Cancel, Escape or a press outside close without writing (`commit="close"` differs).
|
|
2034
2803
|
*/
|
|
2035
|
-
declare function LinePopover({ kind, lineName, currency, value, onApply, quickDiscounts, textClassName, regularValue, actions }: LinePopoverProps): react_jsx_runtime.JSX.Element;
|
|
2804
|
+
declare function LinePopover({ kind, lineName, currency, value, onApply, quickDiscounts, textClassName, regularValue, actions, commit, onRemove, onCloseRefused }: LinePopoverProps): react_jsx_runtime.JSX.Element;
|
|
2036
2805
|
|
|
2037
2806
|
interface ChargeFormProps {
|
|
2038
2807
|
currency: string;
|
|
@@ -2045,20 +2814,39 @@ interface ChargeFormProps {
|
|
|
2045
2814
|
label: string;
|
|
2046
2815
|
}>;
|
|
2047
2816
|
shippingTaxFromStore?: boolean;
|
|
2817
|
+
/** With `shippingTaxFromStore`, the shipping kind also shows the No tax switch, as v2's Add Shipping Tax control (#1115);
|
|
2818
|
+
* the class stays the store's shipping tax class. */
|
|
2819
|
+
shippingNoTax?: boolean;
|
|
2048
2820
|
/** Given, the form is that kind only and the kind row is not shown (v2's separate Add Fee / Add Shipping /
|
|
2049
2821
|
* Add Miscellaneous Product entries); absent, the form opens on Fee with the row. */
|
|
2050
2822
|
kind?: 'fee' | 'shipping' | 'custom';
|
|
2823
|
+
/** Given, the form edits that charge: prefilled, titled `Edit <name>` as v2's record dialog. */
|
|
2824
|
+
initial?: {
|
|
2825
|
+
name: string;
|
|
2826
|
+
amountMinor: number;
|
|
2827
|
+
taxStatus?: 'taxable' | 'none';
|
|
2828
|
+
taxClass?: string;
|
|
2829
|
+
percent?: number;
|
|
2830
|
+
amountIncludesTax?: boolean;
|
|
2831
|
+
};
|
|
2832
|
+
/** Shows the amount-unit toggle (currency symbol or %) on the fee kind, as v2's AmountUnitToggle. */
|
|
2833
|
+
allowPercent?: boolean;
|
|
2834
|
+
/** The store's tax mode. Given, the fee and shipping kinds show the "Amount Includes Tax" switch (not on a percent fee), which starts at this
|
|
2835
|
+
* value (Desk Q4: default = store tax mode, ADR-075). */
|
|
2836
|
+
pricesIncludeTax?: boolean;
|
|
2051
2837
|
onApply: (charge: {
|
|
2052
2838
|
kind: 'fee' | 'shipping' | 'custom';
|
|
2053
2839
|
name: string;
|
|
2054
2840
|
amountMinor: number;
|
|
2055
2841
|
taxStatus?: 'none';
|
|
2056
2842
|
taxClass?: string;
|
|
2843
|
+
percent?: number;
|
|
2844
|
+
amountIncludesTax?: boolean;
|
|
2057
2845
|
}) => string | null;
|
|
2058
2846
|
onClose: () => void;
|
|
2059
2847
|
}
|
|
2060
2848
|
/** `onApply` returns a refusal to show inline, or null once applied. */
|
|
2061
|
-
declare function ChargeForm({ currency, lineTax, taxClasses, shippingTaxFromStore, kind: fixedKind, onApply, onClose }: ChargeFormProps): react_jsx_runtime.JSX.Element;
|
|
2849
|
+
declare function ChargeForm({ currency, lineTax, taxClasses, shippingTaxFromStore, shippingNoTax, kind: fixedKind, initial, allowPercent, pricesIncludeTax, onApply, onClose }: ChargeFormProps): react_jsx_runtime.JSX.Element;
|
|
2062
2850
|
|
|
2063
2851
|
type ProductFilterChip = 'inStock' | 'featured' | 'onSale' | 'category' | 'tag' | 'brand';
|
|
2064
2852
|
type TermChip = 'category' | 'tag' | 'brand';
|
|
@@ -2070,24 +2858,44 @@ interface ProductFilters {
|
|
|
2070
2858
|
/** In Stock starts on, as v2's `stock_status: 'instock'` does while "show out-of-stock products" is off (its default). */
|
|
2071
2859
|
declare const DEFAULT_PRODUCT_FILTERS: ProductFilters;
|
|
2072
2860
|
declare const PRODUCT_FILTER_CHIPS: readonly ProductFilterChip[];
|
|
2861
|
+
interface ProductTermFilter {
|
|
2862
|
+
/** The app's terms for this taxonomy. */
|
|
2863
|
+
options: readonly FilterOption[];
|
|
2864
|
+
/** The picked term's value; undefined when none is picked. */
|
|
2865
|
+
value?: string;
|
|
2866
|
+
onChange: (next: string | undefined) => void;
|
|
2867
|
+
/** Search the app's terms server-side; without it the pill filters `options` by label. */
|
|
2868
|
+
onSearch?: (text: string) => void;
|
|
2869
|
+
}
|
|
2073
2870
|
interface ProductFilterBarProps {
|
|
2074
2871
|
value: ProductFilters;
|
|
2075
2872
|
onChange: (next: ProductFilters) => void;
|
|
2076
2873
|
/** Which chips to show, in this order. Default PRODUCT_FILTER_CHIPS. */
|
|
2077
2874
|
chips?: readonly ProductFilterChip[];
|
|
2078
|
-
/**
|
|
2875
|
+
/** Picker pills for Category, Tag and Brand (v2 filter-bar/*-pill.tsx). A chip with an entry here opens its own
|
|
2876
|
+
* picker. A chip without one falls back to `onTermPress`, and is hidden when neither is given. */
|
|
2877
|
+
terms?: Partial<Record<TermChip, ProductTermFilter>>;
|
|
2878
|
+
/** Extra term pills after the built-in chips, one per group, in this order (e.g. one per Vendure facet). Each is a
|
|
2879
|
+
* single-select searchable picker like a `terms` entry; `searchPlaceholder` defaults to `Search <label>`. */
|
|
2880
|
+
termGroups?: readonly (ProductTermFilter & {
|
|
2881
|
+
id: string;
|
|
2882
|
+
label: string;
|
|
2883
|
+
searchPlaceholder?: string;
|
|
2884
|
+
})[];
|
|
2885
|
+
/** Opens the app's term picker for a term chip that has no entry in `terms`. */
|
|
2079
2886
|
onTermPress?: (chip: TermChip) => void;
|
|
2080
2887
|
className?: string;
|
|
2081
2888
|
}
|
|
2082
2889
|
/**
|
|
2083
2890
|
* v2's always-on filter chips above the product grid: In Stock, Featured and On Sale toggle; Category, Tag
|
|
2084
|
-
* and Brand open the app's
|
|
2085
|
-
* packages/core/src/screens/main/pos/products/filter-bar/filter-bar.tsx (MIT, WCPOS).
|
|
2891
|
+
* and Brand open a term picker, the bar's own (`terms`) or the app's (`onTermPress`). Ported from WCPOS v2
|
|
2892
|
+
* `FilterBar`, packages/core/src/screens/main/pos/products/filter-bar/filter-bar.tsx (MIT, WCPOS).
|
|
2893
|
+
* `termGroups` adds a pill per extra term group (TallyUI's extension; v2's set is fixed).
|
|
2086
2894
|
*/
|
|
2087
|
-
declare function ProductFilterBar({ value, onChange, chips, onTermPress, className }: ProductFilterBarProps): react_jsx_runtime.JSX.Element;
|
|
2895
|
+
declare function ProductFilterBar({ value, onChange, chips, terms, termGroups, onTermPress, className }: ProductFilterBarProps): react_jsx_runtime.JSX.Element;
|
|
2088
2896
|
|
|
2089
2897
|
declare function formatStockSyncTime(time: Date, locale?: string, hour12?: boolean, now?: Date): string;
|
|
2090
|
-
declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusText, statusAccessory, lastSyncedAt, loading, pullError, lastStockCheckAt, hour12, minCodeLength, viewState, defaultViewState, loadViewState, saveViewState, onViewStateError, onStateChange, showViewToggle, items, onQueryChange, showCategoryNav, categories, pickAnyOptions, cartLines, showFilterBar, filterChips, filters: filtersProp, onFiltersChange, variationsStyle, cameraScan, cameraScanner }: {
|
|
2898
|
+
declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusText, statusAccessory, searchAccessory, lastSyncedAt, loading, pullError, lastStockCheckAt, hour12, minCodeLength, viewState, defaultViewState, loadViewState, saveViewState, onViewStateError, onStateChange, showViewToggle, items, onQueryChange, showCategoryNav, categoryBrowse, categories, pickAnyOptions, cartLines, showFilterBar, filterChips, inStockKeepsBackorder, termPills, filters: filtersProp, onFiltersChange, variationsStyle, cameraScan, cameraScanner, tableRow, rowsSlot, tileFields }: {
|
|
2091
2899
|
products: Doc[];
|
|
2092
2900
|
traits: ProductTraits<Doc>;
|
|
2093
2901
|
currency: string;
|
|
@@ -2096,6 +2904,9 @@ declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusTe
|
|
|
2096
2904
|
statusText?: string;
|
|
2097
2905
|
/** Rendered at the end of the status line, e.g. a register control at phone width; the row renders even without `statusText`. */
|
|
2098
2906
|
statusAccessory?: ReactNode;
|
|
2907
|
+
/** v2's own controls beside the search field (its PageBar children, e.g. the Product settings button): rendered
|
|
2908
|
+
* at the end of the search row, after the camera scan button and the view toggle. Default none. */
|
|
2909
|
+
searchAccessory?: ReactNode;
|
|
2099
2910
|
lastSyncedAt: Date | null;
|
|
2100
2911
|
/** The catalogue's first pull is still running, so an empty grid says "Loading products…" rather than "No products yet.". Defaults to lastSyncedAt === null with no pullError; pass false
|
|
2101
2912
|
* when a null lastSyncedAt doesn't mean a pull is running (e.g. offline on first start). */
|
|
@@ -2125,10 +2936,14 @@ declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusTe
|
|
|
2125
2936
|
onViewStateError?: (error: unknown) => void;
|
|
2126
2937
|
/** Loaded state or a cashier's next state (requested state when controlled). */
|
|
2127
2938
|
onStateChange?: (state: CatalogueViewState) => void;
|
|
2128
|
-
/** Show
|
|
2939
|
+
/** Show v2's single view-mode icon button (grid/table) in the search row, beside the search field as in v2. Default false. */
|
|
2129
2940
|
showViewToggle?: boolean;
|
|
2130
2941
|
/** Show the category nav in the header. Default false. */
|
|
2131
2942
|
showCategoryNav?: boolean;
|
|
2943
|
+
/** How the categories show when showCategoryNav is set: 'chips' (default) is the CategoryNav row; 'tiles' is v2's
|
|
2944
|
+
* browse root, the categories as poster tiles with their product counts, opening one under a "Categories › name"
|
|
2945
|
+
* breadcrumb. A search typed at the root searches every product. */
|
|
2946
|
+
categoryBrowse?: 'chips' | 'tiles';
|
|
2132
2947
|
/** Replaces the categories derived from the listed products. */
|
|
2133
2948
|
categories?: ProductCategory[];
|
|
2134
2949
|
/** App-filtered, sorted list shown as given; products still drives scanning and variant choices. */
|
|
@@ -2137,19 +2952,29 @@ declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusTe
|
|
|
2137
2952
|
onQueryChange?: (query: string) => void;
|
|
2138
2953
|
/** Ask for a value for each of a variant's local "Any" option groups before onSelect (#495); set it only when the store accepts order.create version 6. */
|
|
2139
2954
|
pickAnyOptions?: boolean;
|
|
2140
|
-
/** The open sale's lines (e.g. useSale's order.lineItems); each grid tile shows its product's summed quantity.
|
|
2141
|
-
|
|
2955
|
+
/** The open sale's lines (e.g. useSale's order.lineItems); each grid tile shows its product's summed quantity.
|
|
2956
|
+
* A line's optional `variantId`, which a sale line has, lets the drill count each variant. */
|
|
2957
|
+
cartLines?: readonly (CartQuantityLine & {
|
|
2958
|
+
variantId?: string;
|
|
2959
|
+
})[];
|
|
2142
2960
|
/** Show v2's filter chips under the search box. Default false. */
|
|
2143
2961
|
showFilterBar?: boolean;
|
|
2144
2962
|
/** Which chips the bar shows. Default ['inStock'], the one Catalogue applies itself. */
|
|
2145
2963
|
filterChips?: readonly ProductFilterChip[];
|
|
2964
|
+
/** With the In Stock pill on, keep 'backorder' products in the grid (only 'out_of_stock' is dropped). Default false: WCPOS v2's pill is stock_status 'instock' and drops backorders too. */
|
|
2965
|
+
inStockKeepsBackorder?: boolean;
|
|
2966
|
+
/** With showFilterBar, a term pill per term group (traits.getTerms) after the chips: `true` for every group the listed
|
|
2967
|
+
* products carry, in listTermGroups order, or the group ids to show, in this order (a group with no terms is not drawn).
|
|
2968
|
+
* Single select per group; groups AND together; local only, never persisted. Not drawn with `items`. Default off. */
|
|
2969
|
+
termPills?: boolean | readonly string[];
|
|
2146
2970
|
/** Controlled filters; changes are reported through onFiltersChange. */
|
|
2147
2971
|
filters?: ProductFilters;
|
|
2148
2972
|
/** The cashier's next filters (requested filters when controlled). */
|
|
2149
2973
|
onFiltersChange?: (filters: ProductFilters) => void;
|
|
2150
2974
|
/** v2's Product settings › Variations. 'list' (default) opens the variant list chooser; 'popover' opens a grid tile's
|
|
2151
|
-
* VariationPicker in a popover for a product with option groups
|
|
2152
|
-
|
|
2975
|
+
* VariationPicker in a popover for a product with option groups; 'drill' swaps the grid for the product's variant
|
|
2976
|
+
* tiles, with the product's tile first as Back, as v2's "Open in place". The table view keeps the list chooser. */
|
|
2977
|
+
variationsStyle?: 'list' | 'popover' | 'drill';
|
|
2153
2978
|
/** Show v2's camera scan button beside the search box; it opens an inline CameraScannerPanel. Default false.
|
|
2154
2979
|
* The button shows only when cameraScanner is passed too. */
|
|
2155
2980
|
cameraScan?: boolean;
|
|
@@ -2157,10 +2982,50 @@ declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusTe
|
|
|
2157
2982
|
* here, { onDetected: camera.offer, onOpen: camera.reset, scanCount: camera.scanCount }, plus height, permission,
|
|
2158
2983
|
* viewfinder, decoder and readiness; its useBarcodeScanner then handles camera scans like device scans. */
|
|
2159
2984
|
cameraScanner?: Omit<CameraScannerPanelProps, 'onClose'>;
|
|
2985
|
+
/** v2's table row extras in table view: thumbnail leads the row, addButton ends it with the + (> for a product
|
|
2986
|
+
* with variants) that does what a row press does. With expand and thumbnail, a product with more than one variant
|
|
2987
|
+
* has its thumbnail show or hide its variants as rows under it: option chips, price, stock and a + that adds that
|
|
2988
|
+
* variant as the list chooser does. Default: none. */
|
|
2989
|
+
tableRow?: {
|
|
2990
|
+
thumbnail?: boolean;
|
|
2991
|
+
addButton?: boolean;
|
|
2992
|
+
expand?: boolean;
|
|
2993
|
+
};
|
|
2994
|
+
/** v2's rows between the chips and the products (its ListColumn `rows`): notices such as "Price check only until
|
|
2995
|
+
* the register is open.", rendered under the header and above the grid, table or category tiles. Default none. */
|
|
2996
|
+
rowsSlot?: ReactNode;
|
|
2997
|
+
/** v2's Product settings › Tile Fields: which words a grid tile shows. Merged over DEFAULT_TILE_FIELDS (today's tile:
|
|
2998
|
+
* name, price with its on-sale strike, stock status). Apps feed it from the `catalogue.tileFields` app setting. The grid
|
|
2999
|
+
* tiles, the drill's variant tiles and the loading skeleton follow it; the table does not. */
|
|
3000
|
+
tileFields?: Partial<TileFields>;
|
|
2160
3001
|
}): react_jsx_runtime.JSX.Element;
|
|
2161
3002
|
|
|
3003
|
+
interface CatalogueSettingsFormProps extends Omit<ViewProps, 'children'> {
|
|
3004
|
+
/** The products-per-row setting (default `'auto'`), from the app's CatalogueViewState. */
|
|
3005
|
+
gridColumns?: CatalogueGridColumns;
|
|
3006
|
+
onGridColumnsChange: (next: CatalogueGridColumns) => void;
|
|
3007
|
+
/** The saved tile fields, merged over DEFAULT_TILE_FIELDS (default: today's tile). */
|
|
3008
|
+
tileFields?: Partial<TileFields>;
|
|
3009
|
+
/** Called with a fresh, full TileFields on every switch; the form stores nothing. */
|
|
3010
|
+
onTileFieldsChange: (next: TileFields) => void;
|
|
3011
|
+
/** Draw Restore Default Settings, which emits 'auto' and DEFAULT_TILE_FIELDS (default false). */
|
|
3012
|
+
showReset?: boolean;
|
|
3013
|
+
className?: string;
|
|
3014
|
+
/** Default `catalogue-settings`. */
|
|
3015
|
+
testID?: string;
|
|
3016
|
+
}
|
|
3017
|
+
/**
|
|
3018
|
+
* v2's product settings: Tile Size (an Auto switch, then a 2 to 8 slider) and a Tile Fields switch per tile word.
|
|
3019
|
+
* It emits `gridColumns` for the catalogue view state and a `TileFields` for `Catalogue`'s `tileFields`.
|
|
3020
|
+
*
|
|
3021
|
+
* ```tsx
|
|
3022
|
+
* <CatalogueSettingsForm gridColumns={view.gridColumns} onGridColumnsChange={setColumns}
|
|
3023
|
+
* tileFields={settings['catalogue.tileFields']} onTileFieldsChange={(next) => setSetting('catalogue.tileFields', next)} />
|
|
3024
|
+
* ```
|
|
3025
|
+
*/
|
|
3026
|
+
declare function CatalogueSettingsForm({ gridColumns, onGridColumnsChange, tileFields, onTileFieldsChange, showReset, className, testID, ...viewProps }: CatalogueSettingsFormProps): JSX.Element;
|
|
3027
|
+
|
|
2162
3028
|
type ReceiptProps = {
|
|
2163
|
-
newSale: () => void;
|
|
2164
3029
|
taxLabel?: (ratePpm: number) => string;
|
|
2165
3030
|
topInset?: number;
|
|
2166
3031
|
formatDate?: (iso: string) => string;
|
|
@@ -2168,6 +3033,8 @@ type ReceiptProps = {
|
|
|
2168
3033
|
footerSlot?: ReactNode;
|
|
2169
3034
|
/** The second button's text; default `New sale`. */
|
|
2170
3035
|
doneLabel?: string;
|
|
3036
|
+
/** The app's own record that this receipt was printed; Print reads 'Print again' (as `ReceiptSheet`, v2's `printedTo`). Ignored when `actions` replaces the buttons. */
|
|
3037
|
+
printed?: boolean;
|
|
2171
3038
|
} & ({
|
|
2172
3039
|
order: SentOrder;
|
|
2173
3040
|
store: {
|
|
@@ -2192,11 +3059,84 @@ type ReceiptProps = {
|
|
|
2192
3059
|
cashier?: never;
|
|
2193
3060
|
registerId?: never;
|
|
2194
3061
|
registerName?: never;
|
|
3062
|
+
}) & ({
|
|
3063
|
+
newSale: () => void;
|
|
3064
|
+
actions?: undefined;
|
|
3065
|
+
} | {
|
|
3066
|
+
newSale?: () => void;
|
|
3067
|
+
/** Replaces Print receipt and New sale (never printed), e.g. a host footer as in v2's receipt stage; `false` draws no buttons. */
|
|
3068
|
+
actions: ReactNode | false;
|
|
2195
3069
|
});
|
|
2196
3070
|
/** `store`/`taxLabel`/`topInset`/`formatDate` replace the app's Medusa settings, hard-coded VAT (default matches
|
|
2197
3071
|
* TV6a's `Cart`), outbox strip and date util, so `Receipt` stays platform-neutral (ADR-052). */
|
|
2198
3072
|
declare function Receipt(props: ReceiptProps): react_jsx_runtime.JSX.Element;
|
|
2199
3073
|
|
|
3074
|
+
/**
|
|
3075
|
+
* The receipt print sheet: template choice, printer, the preview, and Close / Email Receipt / Print.
|
|
3076
|
+
* Layout of WCPOS v2, MIT, WCPOS: packages/core/src/screens/main/receipt/receipt.tsx, print-sheet.tsx,
|
|
3077
|
+
* receipt-body.tsx, template-switcher.tsx, printer-switcher.tsx and receipt-actions.tsx; the strings are v2's English ones from core.json;
|
|
3078
|
+
* after a send the sheet shows v2's 'Email sent' / 'Receipt email queued' as a line, not a toast.
|
|
3079
|
+
* Props-only: the sheet renders no receipt and prints nothing itself.
|
|
3080
|
+
*/
|
|
3081
|
+
|
|
3082
|
+
interface ReceiptSheetTemplate {
|
|
3083
|
+
id: string;
|
|
3084
|
+
title: string;
|
|
3085
|
+
/** Shown but not choosable (v2: offline and not offline-capable). */
|
|
3086
|
+
disabled?: boolean;
|
|
3087
|
+
}
|
|
3088
|
+
interface ReceiptSheetEmail {
|
|
3089
|
+
/** Prefills "Email Address" (v2: the order's billing email). */
|
|
3090
|
+
defaultAddress?: string;
|
|
3091
|
+
/** Draws v2's offline notice; Send reads "Send when online". */
|
|
3092
|
+
offline?: boolean;
|
|
3093
|
+
/** Draws "Save email to the customer" (default off). */
|
|
3094
|
+
saveToCustomer?: boolean;
|
|
3095
|
+
/** Sends or queues the receipt. Returns a refusal to show, or null once sent or queued; the form then closes. */
|
|
3096
|
+
onSend: (input: {
|
|
3097
|
+
address: string;
|
|
3098
|
+
saveToCustomer: boolean;
|
|
3099
|
+
}) => Promise<string | null> | string | null;
|
|
3100
|
+
}
|
|
3101
|
+
interface ReceiptSheetProps {
|
|
3102
|
+
open: boolean;
|
|
3103
|
+
onOpenChange: (open: boolean) => void;
|
|
3104
|
+
/** Default "Receipt". */
|
|
3105
|
+
title?: string;
|
|
3106
|
+
templates: readonly ReceiptSheetTemplate[];
|
|
3107
|
+
templateId?: string;
|
|
3108
|
+
onTemplateChange?: (id: string) => void;
|
|
3109
|
+
/** The Printer row's text. Default "Browser print dialog". */
|
|
3110
|
+
printerLabel?: string;
|
|
3111
|
+
/** v2's printer switcher. The app keeps the pick, for this print only, and resets it when the template changes, as v2 does. */
|
|
3112
|
+
printers?: readonly {
|
|
3113
|
+
id: string;
|
|
3114
|
+
name?: string;
|
|
3115
|
+
}[];
|
|
3116
|
+
/** The cashier's pick for this print; null or undefined is Auto. */
|
|
3117
|
+
printerId?: string | null;
|
|
3118
|
+
/** The name Auto resolves to, worked out by the app (for example with `resolvePrinter` from `@tallyui/pos`). */
|
|
3119
|
+
autoPrinterName?: string;
|
|
3120
|
+
/** Called with the picked printer's id, or null for Auto. */
|
|
3121
|
+
onPrinterChange?: (id: string | null) => void;
|
|
3122
|
+
onPrint: () => void;
|
|
3123
|
+
/** Print shows its loading state and cannot be pressed. */
|
|
3124
|
+
printing?: boolean;
|
|
3125
|
+
/** Print reads "Print again". */
|
|
3126
|
+
printed?: boolean;
|
|
3127
|
+
/** "Email Receipt" is drawn only when given. */
|
|
3128
|
+
onEmail?: () => void;
|
|
3129
|
+
/** v2's email form: "Email Receipt" opens it inside the sheet. When given, it takes the place of `onEmail`. */
|
|
3130
|
+
email?: ReceiptSheetEmail;
|
|
3131
|
+
/** v2's "Download PDF": drawn only when given, between Email Receipt and Print. The app makes and saves the PDF. */
|
|
3132
|
+
onDownloadPdf?: () => void;
|
|
3133
|
+
/** Download PDF shows its loading state and cannot be pressed. */
|
|
3134
|
+
downloadingPdf?: boolean;
|
|
3135
|
+
/** The preview. */
|
|
3136
|
+
children: ReactNode;
|
|
3137
|
+
}
|
|
3138
|
+
declare function ReceiptSheet({ open, onOpenChange, title, templates, templateId, onTemplateChange, printerLabel, printers, printerId, autoPrinterName, onPrinterChange, onPrint, printing, printed, onEmail, email, onDownloadPdf, downloadingPdf, children }: ReceiptSheetProps): JSX.Element;
|
|
3139
|
+
|
|
2200
3140
|
/** The order reference a visitor sees on the receipt and in Orders (front desk ruling, 2026-10-06): the finalized
|
|
2201
3141
|
* PosOrder id's last 8 characters, then the backend's display id once the store has one. */
|
|
2202
3142
|
declare function orderReference(order: {
|
|
@@ -2208,6 +3148,15 @@ declare function orderReference(order: {
|
|
|
2208
3148
|
|
|
2209
3149
|
declare function injectPrintStyle(): void;
|
|
2210
3150
|
|
|
3151
|
+
/**
|
|
3152
|
+
* True when `SyncStatus` with these props would show only "Sales are up to date.": no pull notice, nothing waiting,
|
|
3153
|
+
* no refused sales and no missing backend. An app can hide the status line then.
|
|
3154
|
+
*/
|
|
3155
|
+
declare function syncStatusQuiet({ state, registerState, pullNotice }: {
|
|
3156
|
+
state: OutboxState;
|
|
3157
|
+
registerState?: OutboxState;
|
|
3158
|
+
pullNotice?: SyncNotice;
|
|
3159
|
+
}): boolean;
|
|
2211
3160
|
/**
|
|
2212
3161
|
* `pluginName` names the store's plugin in the detail, as its owners know it; `registerState` counts till updates.
|
|
2213
3162
|
* `pullNotice` (a stopped product pull) shows as its own line and detail, above the outbox line.
|
|
@@ -2230,6 +3179,15 @@ type OrderHistoryRow = {
|
|
|
2230
3179
|
itemCount: number;
|
|
2231
3180
|
stateLabel: string;
|
|
2232
3181
|
};
|
|
3182
|
+
type OrderSyncNoticesProps = {
|
|
3183
|
+
order: PosOrder;
|
|
3184
|
+
/** The outbox's `state.stuck`, as OrdersList takes it. */
|
|
3185
|
+
stuck?: OutboxState['stuck'];
|
|
3186
|
+
/** Rendered between the notes (note not sent) and the store's warnings: OrdersList's Retry goes here. */
|
|
3187
|
+
children?: ReactNode;
|
|
3188
|
+
};
|
|
3189
|
+
/** The per-sale sync notices OrdersList shows under each order, for an app's own order screen. */
|
|
3190
|
+
declare function OrderSyncNotices({ order, stuck, children }: OrderSyncNoticesProps): react_jsx_runtime.JSX.Element;
|
|
2233
3191
|
/** The "Needs attention" (when not empty) and "Recent" orders, lifted from medusapos/app's orders screen (ADR-052).
|
|
2234
3192
|
* `onRetry` is the outbox's `requeue`; `formatDate` replaces the app's date util; `footer` is the app's own content
|
|
2235
3193
|
* (medusapos: the feedback link). The router and session redirect stay in the app. `stuck` is the outbox's
|
|
@@ -2266,12 +3224,14 @@ interface OpenSaleTabsProps {
|
|
|
2266
3224
|
currency: string;
|
|
2267
3225
|
onSelect: (id: string) => void;
|
|
2268
3226
|
onNew: () => void;
|
|
3227
|
+
/** Merged onto the bar's root, after its own classes, so an app can restyle it (for example `border-t-0 border-b` at the top). */
|
|
3228
|
+
className?: string;
|
|
2269
3229
|
}
|
|
2270
3230
|
/**
|
|
2271
3231
|
* The open sales as cart tabs (v2 cart/tabs.tsx): who, then the Partly paid chip or else the total. The open sale's
|
|
2272
3232
|
* tab is underlined even when it is the only one; a blank cart has no tab, the + cell is its tab and reads "New".
|
|
2273
3233
|
*/
|
|
2274
|
-
declare function OpenSaleTabs({ sales, currency, onSelect, onNew }: OpenSaleTabsProps): JSX.Element;
|
|
3234
|
+
declare function OpenSaleTabs({ sales, currency, onSelect, onNew, className }: OpenSaleTabsProps): JSX.Element;
|
|
2275
3235
|
|
|
2276
3236
|
/**
|
|
2277
3237
|
* What the customer sees on the second screen, laid out as WCPOS v2's default "Ledger" display
|
|
@@ -2309,8 +3269,22 @@ interface POSLayoutProps extends Omit<ViewProps, 'children'> {
|
|
|
2309
3269
|
layout?: 'split' | 'stacked';
|
|
2310
3270
|
breakpoint?: number;
|
|
2311
3271
|
className?: string;
|
|
2312
|
-
|
|
2313
|
-
|
|
3272
|
+
/** Where the stacked layout's tabs sit. 'bottom' is v2's phone tab bar (Products / Cart, icons, both panes kept
|
|
3273
|
+
* mounted). Default 'top', today's tabs. */
|
|
3274
|
+
tabBar?: 'top' | 'bottom';
|
|
3275
|
+
/** The cart's item count, shown over the Cart tab's icon in the bottom bar; hidden at 0 or undefined. */
|
|
3276
|
+
cartCount?: number;
|
|
3277
|
+
/** v2's checkout column (pos-columns.tsx:118-162). When given, its result takes the browse column's place and the
|
|
3278
|
+
* browse slot is not rendered: in 'split' the cart column stays beside it (as the ledger); in 'stacked' it is the
|
|
3279
|
+
* whole body, with no tabs or tab bar. It is called with the layout in force, so the app can give the pane its own
|
|
3280
|
+
* ledger when the cart is not on screen. */
|
|
3281
|
+
renderCheckout?: (layout: 'split' | 'stacked') => ReactNode;
|
|
3282
|
+
/** v2 keys its checkout column by what it shows (pos-columns.tsx receipt:<uuid> / checkout / cart): a new key in
|
|
3283
|
+
* split layout fades the column in as opening checkout does, e.g. `receipt:<order id>` when tender gives way to
|
|
3284
|
+
* the receipt. Default: none, so only opening or closing checkout fades. */
|
|
3285
|
+
columnKey?: string;
|
|
3286
|
+
}
|
|
3287
|
+
declare function POSLayout({ browseSlot, cartSlot, headerSlot, layout: layoutProp, breakpoint, className, tabBar, cartCount, renderCheckout, columnKey, ...viewProps }: POSLayoutProps): react_jsx_runtime.JSX.Element;
|
|
2314
3288
|
|
|
2315
3289
|
interface CheckoutLayoutProps extends Omit<ViewProps, 'children'> {
|
|
2316
3290
|
summarySlot: ReactNode;
|
|
@@ -2398,17 +3372,21 @@ interface AppShellProps {
|
|
|
2398
3372
|
onNavigate: (id: string) => void;
|
|
2399
3373
|
/** Drawn above the page (a `RegisterBar`); its menu button opens the drawer on phones. */
|
|
2400
3374
|
registerBar?: React$1.ReactNode;
|
|
3375
|
+
/** Drawn at the foot of the rail on wide windows and of the drawer on phones (a version line). */
|
|
3376
|
+
navFooter?: React$1.ReactNode;
|
|
2401
3377
|
children?: React$1.ReactNode;
|
|
2402
3378
|
className?: string;
|
|
2403
3379
|
testID?: string;
|
|
2404
3380
|
}
|
|
2405
3381
|
/** The POS frame: the nav rail beside the page on wide windows, a slide-over drawer on phones. */
|
|
2406
|
-
declare function AppShell({ navItems, activeId, onNavigate, registerBar, children, className, testID, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
3382
|
+
declare function AppShell({ navItems, activeId, onNavigate, registerBar, navFooter, children, className, testID, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
2407
3383
|
|
|
2408
3384
|
interface NavRailProps {
|
|
2409
3385
|
items: ShellNavItem[];
|
|
2410
3386
|
activeId?: string;
|
|
2411
3387
|
onNavigate: (id: string) => void;
|
|
3388
|
+
/** Drawn at the foot of the rail, under the bottom items (a version line). */
|
|
3389
|
+
footer?: React$1.ReactNode;
|
|
2412
3390
|
className?: string;
|
|
2413
3391
|
testID?: string;
|
|
2414
3392
|
}
|
|
@@ -2417,7 +3395,7 @@ interface NavRailProps {
|
|
|
2417
3395
|
* plus 2 units each side (64 at Regular), so it follows the scale step as v2's does. Icon-only:
|
|
2418
3396
|
* the label shows to the right on hover or keyboard focus, v2's web tooltip.
|
|
2419
3397
|
*/
|
|
2420
|
-
declare function NavRail({ items, activeId, onNavigate, className, testID }: NavRailProps): react_jsx_runtime.JSX.Element;
|
|
3398
|
+
declare function NavRail({ items, activeId, onNavigate, footer, className, testID }: NavRailProps): react_jsx_runtime.JSX.Element;
|
|
2421
3399
|
|
|
2422
3400
|
interface NavDrawerProps {
|
|
2423
3401
|
open: boolean;
|
|
@@ -2427,13 +3405,35 @@ interface NavDrawerProps {
|
|
|
2427
3405
|
onNavigate: (id: string) => void;
|
|
2428
3406
|
/** Drawn above the items (a store name or logo). */
|
|
2429
3407
|
header?: React$1.ReactNode;
|
|
3408
|
+
/** Drawn at the foot of the panel, under the items (a version line). */
|
|
3409
|
+
footer?: React$1.ReactNode;
|
|
2430
3410
|
testID?: string;
|
|
2431
3411
|
}
|
|
2432
3412
|
/**
|
|
2433
3413
|
* The phone's navigation: a 200-wide panel that slides over the screen from the left, v2's
|
|
2434
3414
|
* `drawerType: 'front'`, with a backdrop that closes it. Pressing the current page only closes it.
|
|
2435
3415
|
*/
|
|
2436
|
-
declare function NavDrawer({ open, onOpenChange, items, activeId, onNavigate, header, testID }: NavDrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
3416
|
+
declare function NavDrawer({ open, onOpenChange, items, activeId, onNavigate, header, footer, testID }: NavDrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
3417
|
+
|
|
3418
|
+
interface ConnectivityToastProps {
|
|
3419
|
+
/** The till's connectivity verdict, e.g. a `@tallyui/database` connectivity tracker's `state`. */
|
|
3420
|
+
state: ConnectivityState;
|
|
3421
|
+
testID?: string;
|
|
3422
|
+
}
|
|
3423
|
+
declare function ConnectivityToast({ state, testID }: ConnectivityToastProps): react_jsx_runtime.JSX.Element | null;
|
|
3424
|
+
|
|
3425
|
+
interface AddedToCartEvent {
|
|
3426
|
+
/** A new value for each add, e.g. a counter; the same key twice is one add. */
|
|
3427
|
+
key: number | string;
|
|
3428
|
+
/** The product's name; the first add names it. */
|
|
3429
|
+
name?: string;
|
|
3430
|
+
}
|
|
3431
|
+
interface AddedToCartToastProps {
|
|
3432
|
+
/** The latest add, or null before any. The app sets it where it adds a line, unless the add is silent. */
|
|
3433
|
+
added: AddedToCartEvent | null;
|
|
3434
|
+
testID?: string;
|
|
3435
|
+
}
|
|
3436
|
+
declare function AddedToCartToast({ added, testID }: AddedToCartToastProps): react_jsx_runtime.JSX.Element | null;
|
|
2437
3437
|
|
|
2438
3438
|
/**
|
|
2439
3439
|
* The Sales room's cards over unit 10's figures. Port of WCPOS v2 `screens/main/reports/cards/`
|
|
@@ -2448,8 +3448,10 @@ interface SalesCardsProps {
|
|
|
2448
3448
|
currency: string;
|
|
2449
3449
|
/** Opens the card's panel. */
|
|
2450
3450
|
onOpenCard?: (card: SalesCardId) => void;
|
|
3451
|
+
/** Cards to leave out, e.g. one the backend's report cannot fill; the rest keep their order. Default: all six. */
|
|
3452
|
+
hide?: SalesCardId[];
|
|
2451
3453
|
}
|
|
2452
|
-
declare function SalesCards({ figures, currency, onOpenCard }: SalesCardsProps): JSX.Element;
|
|
3454
|
+
declare function SalesCards({ figures, currency, onOpenCard, hide }: SalesCardsProps): JSX.Element;
|
|
2453
3455
|
|
|
2454
3456
|
/**
|
|
2455
3457
|
* The Reports period menu: the date presets beside a range calendar, for a custom range. Port of
|
|
@@ -2522,8 +3524,10 @@ interface SalesRoomProps extends SalesFiltersBarProps {
|
|
|
2522
3524
|
currency: string;
|
|
2523
3525
|
/** Opens a card's panel. */
|
|
2524
3526
|
onOpenCard?: (card: SalesCardId) => void;
|
|
3527
|
+
/** Forwarded to SalesCards as `hide`. */
|
|
3528
|
+
hideCards?: SalesCardId[];
|
|
2525
3529
|
}
|
|
2526
|
-
declare function SalesRoom({ figures, filters, onFiltersChange, currency, onOpenCard, ...bar }: SalesRoomProps): JSX.Element;
|
|
3530
|
+
declare function SalesRoom({ figures, filters, onFiltersChange, currency, onOpenCard, hideCards, ...bar }: SalesRoomProps): JSX.Element;
|
|
2527
3531
|
|
|
2528
3532
|
/**
|
|
2529
3533
|
* The Sales room's hero: the period's gross, its change against the comparison period and a
|
|
@@ -2540,6 +3544,26 @@ interface SalesHeroProps {
|
|
|
2540
3544
|
}
|
|
2541
3545
|
declare function SalesHero({ figures, filters, onFiltersChange, currency }: SalesHeroProps): JSX.Element;
|
|
2542
3546
|
|
|
3547
|
+
/**
|
|
3548
|
+
* A Sales room card's figure in full: the side panel its head opens. Port of WCPOS v2
|
|
3549
|
+
* `screens/main/reports/panels/` (`panel.tsx`, `specs.ts`, `export-csv.ts`); copy is v2's
|
|
3550
|
+
* English. An unknown cost or margin shows `—`, never 0, as on the cards.
|
|
3551
|
+
*/
|
|
3552
|
+
|
|
3553
|
+
type SalesPanelId = 'payments' | 'products' | 'categories' | 'taxes';
|
|
3554
|
+
interface SalesCardPanelProps {
|
|
3555
|
+
/** The open card; null = closed. */
|
|
3556
|
+
card: SalesPanelId | null;
|
|
3557
|
+
figures: SalesFigures;
|
|
3558
|
+
currency: string;
|
|
3559
|
+
/** The scope line under the title, e.g. "Today · Front counter"; the app words it. */
|
|
3560
|
+
scope?: string;
|
|
3561
|
+
onClose: () => void;
|
|
3562
|
+
/** Export CSV shows only when given; receives the CSV text and v2's file name. */
|
|
3563
|
+
onExportCsv?: (csv: string, filename: string) => void;
|
|
3564
|
+
}
|
|
3565
|
+
declare function SalesCardPanel({ card, figures, currency, scope, onClose, onExportCsv }: SalesCardPanelProps): JSX.Element;
|
|
3566
|
+
|
|
2543
3567
|
type FontStatus = 'loading' | 'loaded' | 'failed';
|
|
2544
3568
|
interface FontState {
|
|
2545
3569
|
setId: TypeSetId;
|
|
@@ -2581,4 +3605,4 @@ declare function I18nProvider({ locale, resources, children }: I18nProviderProps
|
|
|
2581
3605
|
/** The components' `t`, read from the nearest `I18nProvider`, else English. Interpolation is `{name}`. */
|
|
2582
3606
|
declare function useT(): TFunction;
|
|
2583
3607
|
|
|
2584
|
-
export { APPROVAL_REQUIRED_TEXT, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, CameraScanButton, type CameraScanButtonProps, CameraScannerPanel, type CameraScannerPanelProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cart, type CartAction, CartBar, CartColumnHeads, type CartColumnHeadsProps, type CartColumnSettings, CartFoot, type CartFootAction, type CartFootProps, CartLine, CartLineActions, type CartLineActionsProps, type CartLineProps, CartNoteInput, type CartNoteInputProps, CartPanel, type CartPanelProps, CartTotal, type CartTotalProps, CashCountInput, type CashCountInputProps, CashTendered, type CashTenderedProps, Catalogue, type Catalogues, type CategoryItem, CategoryNav, type CategoryNavProps, CategoryTile, type CategoryTileProps, ChangeDisplay, type ChangeDisplayProps, ChargeForm, type ChargeFormProps, Checkbox, CheckoutLayout, type CheckoutLayoutProps, ChevronDownIcon, type ChipItem, ClosureSheet, type ClosureSheetProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxTrigger, type ConnectionStatus, ConnectorStatus, type ConnectorStatusProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CustomerCard, type CustomerCardProps, CustomerDisplayPairing, type CustomerDisplayPairingProps, CustomerDisplayScreen, CustomerDisplaySettings, type CustomerDisplaySettingsProps, CustomerForm, type CustomerFormProps, type CustomerFormValues, CustomerOrderHistory, type CustomerOrderHistoryProps, CustomerPicker, type CustomerPickerProps, CustomerSelect, type CustomerSelectProps, DEFAULT_PRODUCT_FILTERS, DIGIT_ROWS, DateRangeMenu, type DateRangeMenuProps, type Denomination, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiscountBadge, type DiscountBadgeProps, DiscountChips, DiscountForm, DisplaySettings, type DisplaySettingsProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FLASH_DURATION_MS, FilterChip, FilterChipGroup, type FilterChipGroupProps, type FilterChipProps, FontProvider, type FontProviderProps, type FontState, type FontStatus, type GridDay, GripIcon, HStack, type HStackProps, HandoverSlip, type HandoverSlipProps, HoverCard, HoverCardContent, HoverCardTrigger, I18nProvider, type I18nProviderProps, Icon, IconButton, type IconButtonProps, type IconProps, InCartBadge, type InCartBadgeProps, Input, InputField, InputRoot, type InputRootProps, InputSlot, Keypad, type KeypadKey, type KeypadProps, Label, type LabelProps, LinePopover, type LinePopoverProps, LiveTabScreen, type LiveTabScreenProps, type LiveTabScreenState, Loader, type LoaderProps, type Month, MovementSheet, type MovementSheetProps, NavDrawer, type NavDrawerProps, NavRail, type NavRailProps, OpenRegisterCard, type OpenRegisterCardProps, OpenSaleTabs, type OpenSaleTabsProps, OrderCard, type OrderCardProps, OrderDetail, type OrderDetailLineItem, type OrderDetailProps, OrderFilterBar, type OrderFilterBarProps, type OrderFilterOption, type OrderHistoryRow, OrderList, type OrderListProps, type OrderStatus, OrderStatusBadge, type OrderStatusBadgeProps, OrderSummary, OrderSummaryLine, type OrderSummaryLineProps, type OrderSummaryPayment, type OrderSummaryProps, OrdersList, POSLayout, type POSLayoutProps, PRODUCT_FILTER_CHIPS, ParkedSales, type ParkedSalesProps, type PaymentMethod, PaymentMethodCard, type PaymentMethodCardProps, type PaymentMethodKind, PaymentSelector, type PaymentSelectorProps, Popover, PopoverContent, PopoverTrigger, PriceForm, ProductCard, type ProductCardProps, ProductFilterBar, type ProductFilterBarProps, type ProductFilterChip, type ProductFilters, ProductGrid, type ProductGridProps, ProductImage, type ProductImageProps, ProductList, type ProductListProps, ProductPrice, type ProductPriceProps, ProductSku, type ProductSkuProps, ProductStockBadge, type ProductStockBadgeProps, ProductTable, type ProductTableColumn, type ProductTableProps, ProductTitle, type ProductTitleProps, ProductVariantPicker, type ProductVariantPickerProps, Progress, type ProgressProps, QuantityStepper, type QuantityStepperProps, RadioGroup, RadioGroupItem, Receipt, type ReceiptItem, ReceiptPreview, type ReceiptPreviewProps, RefundForm, type RefundFormProps, type RefundFormValue, RefundModal, type RefundModalProps, RegisterBar, type RegisterBarPill, type RegisterBarProps, RegisterColumn, type RegisterColumnProps, RegisterCount, type RegisterCountProps, RegisterOpenClose, type RegisterOpenCloseProps, RegisterPanel, type RegisterPanelProps, RegisterPicker, type RegisterPickerProps, type RegisterPickerRegister, RegisterSummary, type RegisterSummaryProps, SCANNER_DEFAULT_HEIGHT, SCANNER_MAX_HEIGHT, SCANNER_MIN_HEIGHT, type SalesCardId, SalesCards, type SalesCardsProps, type SalesFilters, SalesFiltersBar, type SalesFiltersBarProps, SalesHero, type SalesHeroProps, type SalesOption, SalesRoom, type SalesRoomProps, ScaleProvider, type ScaleProviderProps, type ScaleScopeProps, type ScaleState, ScanIcon, ScannerViewfinder, SearchIcon, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, SettingsGroup, type SettingsGroupProps, SettingsLayout, type SettingsLayoutProps, SettingsRow, type SettingsRowProps, type ShellNavItem, ShoppingCartIcon, Slider, type SliderProps, SplitTender, StoreSettingsChoiceScreen, type StoreSettingsChoiceScreenProps, type SvgIconProps, Switch, SwitchConfirm, type SwitchConfirmProps, SyncStatus, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TaxBasedOn, type TaxBasedOnProps, TaxCalculationSettings, type TaxCalculationSettingsProps, Tender, TenderPane, type TenderPaneProps, Text, type TextProps, Textarea, type TextareaProps, Toast, ToastClose, ToastDescription, type ToastProps, ToastTitle, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipContent, TooltipTrigger, type TransactionSummary, VStack, type VStackProps, type VariantOption, VariationPicker, type VariationPickerProps, ViewToggle, type ViewToggleProps, type ViewfinderProps, type WeekDay, XIcon, addMonths, avatarInitials, avatarVariants, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, cartColumnIds, compareDays, createSvgIcon, defaultProductColumns, describeRegisterBarPill, discountLabel, formatStockSyncTime, hstackVariants, iconButtonVariants, iconVariants, injectPrintStyle, loaderVariants, monthGrid, monthOf, orderReference, parseDiscount, parsePrice, pressRangeDay, textVariants, toastVariants, toggleTextVariants, toggleVariants, useDefaultProductColumns, useFontType, useInputContext, usePointer, useScale, useT, vstackVariants };
|
|
3608
|
+
export { APPROVAL_REQUIRED_TEXT, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityHeartbeatIcon, type AddedToCartEvent, AddedToCartToast, type AddedToCartToastProps, AddressEditor, type AddressEditorProps, type AddressEditorValue, AddressFields, type AddressFieldsProps, AlertCircleIcon, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTriangleIcon, AppShell, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, BarcodeScanningSettings, type BarcodeScanningSettingsProps, type BarcodeScanningValues, Button, type ButtonProps, Calendar, type CalendarProps, CameraScanButton, type CameraScanButtonProps, CameraScannerPanel, type CameraScannerPanelProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cart, type CartAction, CartBar, CartColumnHeads, type CartColumnHeadsProps, type CartColumnId, type CartColumnSettings, CartColumnsForm, type CartColumnsFormProps, CartFoot, type CartFootAction, type CartFootProps, CartLine, CartLineActions, type CartLineActionsProps, type CartLineProps, CartNoteInput, type CartNoteInputProps, CartPanel, type CartPanelProps, CartTotal, type CartTotalProps, CashCountInput, type CashCountInputProps, CashRegisterIcon, CashTendered, type CashTenderedProps, CashierSheet, type CashierSheetCashier, type CashierSheetDrawer, type CashierSheetHandTo, type CashierSheetPlace, type CashierSheetProps, Catalogue, CatalogueSettingsForm, type CatalogueSettingsFormProps, type Catalogues, type CategoryItem, CategoryNav, type CategoryNavProps, CategoryTile, type CategoryTileProps, ChangeDisplay, type ChangeDisplayProps, ChargeForm, type ChargeFormProps, ChartLineIcon, CheckIcon, Checkbox, CheckoutLayout, type CheckoutLayoutProps, ChevronDownIcon, ChevronRightIcon, type ChipItem, ClosureSheet, type ClosureSheetProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxTrigger, ConfirmDialog, type ConfirmDialogProps, type ConnectionStatus, ConnectivityToast, type ConnectivityToastProps, ConnectorStatus, type ConnectorStatusProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CustomerCard, type CustomerCardProps, CustomerDisplayPairing, type CustomerDisplayPairingProps, CustomerDisplayScreen, CustomerDisplaySettings, type CustomerDisplaySettingsProps, CustomerDropdown, type CustomerDropdownProps, CustomerEditor, type CustomerEditorProps, CustomerForm, type CustomerFormProps, type CustomerFormValues, CustomerOrderHistory, type CustomerOrderHistoryProps, CustomerPicker, type CustomerPickerProps, CustomerSelect, type CustomerSelectProps, CustomersList, type CustomersListProps, DEFAULT_PRODUCT_FILTERS, DIGIT_ROWS, DateRangeMenu, type DateRangeMenuProps, type Denomination, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiscountBadge, type DiscountBadgeProps, DiscountChips, type DiscountCoupon, DiscountForm, DiscountIcon, DisplaySettings, type DisplaySettingsProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FLASH_DURATION_MS, FilterChip, FilterChipGroup, type FilterChipGroupProps, type FilterChipProps, type FilterOption, FontProvider, type FontProviderProps, type FontState, type FontStatus, GiftIcon, type GridDay, GripIcon, HStack, type HStackProps, HandoverSlip, type HandoverSlipProps, HoverCard, HoverCardContent, HoverCardTrigger, I18nProvider, type I18nProviderProps, Icon, IconButton, type IconButtonProps, type IconProps, InCartBadge, type InCartBadgeProps, InfoCircleIcon, Input, InputField, InputRoot, type InputRootProps, InputSlot, Keypad, type KeypadKey, type KeypadProps, Label, type LabelProps, LinePopover, type LinePopoverProps, ListRow, type ListRowProps, type ListRowSize, LiveTabScreen, type LiveTabScreenProps, type LiveTabScreenState, Loader, type LoaderProps, MessageQuestionIcon, type Month, MovementSheet, type MovementSheetProps, NavDrawer, type NavDrawerProps, NavRail, type NavRailProps, Notice, type NoticeAction, type NoticeProps, OpenRegisterCard, type OpenRegisterCardProps, OpenSaleTabs, type OpenSaleTabsProps, OrderCard, type OrderCardProps, OrderDetail, type OrderDetailLineItem, type OrderDetailProps, type OrderDetailTaxLine, OrderFilterBar, type OrderFilterBarProps, type OrderFilterOption, type OrderHistoryRow, OrderList, type OrderListProps, OrderNoteSheet, type OrderNoteSheetProps, type OrderStatus, OrderStatusBadge, type OrderStatusBadgeProps, OrderSummary, OrderSummaryLine, type OrderSummaryLineProps, type OrderSummaryPayment, type OrderSummaryProps, OrderSyncNotices, type OrderSyncNoticesProps, OrdersList, POSLayout, type POSLayoutProps, PRODUCT_FILTER_CHIPS, ParkedSales, type ParkedSalesProps, type PaymentMethod, PaymentMethodCard, type PaymentMethodCardProps, type PaymentMethodKind, PaymentSelector, type PaymentSelectorMethod, type PaymentSelectorProps, PlusIcon, Popover, PopoverContent, PopoverTrigger, PriceForm, PrinterForm, type PrinterFormDraft, type PrinterFormProps, PrinterIcon, PrintingSettings, type PrintingSettingsProps, ProductCard, type ProductCardProps, ProductFilterBar, type ProductFilterBarProps, type ProductFilterChip, type ProductFilters, ProductGrid, type ProductGridProps, ProductImage, type ProductImageProps, ProductList, type ProductListProps, ProductPrice, type ProductPriceProps, ProductSku, type ProductSkuProps, ProductStockBadge, type ProductStockBadgeProps, ProductTable, type ProductTableColumn, type ProductTableProps, type ProductTermFilter, ProductTitle, type ProductTitleProps, ProductVariantPicker, type ProductVariantPickerProps, Progress, type ProgressProps, QuantityStepper, type QuantityStepperProps, RadioGroup, RadioGroupItem, Receipt, ReceiptIcon, type ReceiptItem, ReceiptPreview, type ReceiptPreviewProps, ReceiptSheet, type ReceiptSheetEmail, type ReceiptSheetProps, type ReceiptSheetTemplate, RefundForm, type RefundFormProps, type RefundFormValue, RefundModal, type RefundModalProps, RegisterBar, type RegisterBarPill, type RegisterBarProps, RegisterColumn, type RegisterColumnProps, RegisterCount, type RegisterCountProps, RegisterOpenClose, type RegisterOpenCloseProps, RegisterPanel, type RegisterPanelProps, RegisterPicker, type RegisterPickerProps, type RegisterPickerRegister, RegisterSummary, type RegisterSummaryProps, SCANNER_DEFAULT_HEIGHT, SCANNER_MAX_HEIGHT, SCANNER_MIN_HEIGHT, SKELETON_MAX_ROWS, type SalesCardId, SalesCardPanel, type SalesCardPanelProps, SalesCards, type SalesCardsProps, type SalesFilters, SalesFiltersBar, type SalesFiltersBarProps, SalesHero, type SalesHeroProps, type SalesOption, type SalesPanelId, SalesRoom, type SalesRoomProps, ScaleProvider, type ScaleProviderProps, type ScaleScopeProps, type ScaleState, ScanIcon, ScannerViewfinder, SearchIcon, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, SettingsGroup, type SettingsGroupProps, SettingsIcon, SettingsLayout, type SettingsLayoutProps, SettingsRow, type SettingsRowProps, type ShellNavItem, ShippingAddressFields, type ShippingAddressFieldsProps, ShoppingCartIcon, Skeleton, type SkeletonProps, Slider, type SliderProps, SplitTender, StatusBadge, type StatusBadgeProps, StoreSettingsChoiceScreen, type StoreSettingsChoiceScreenProps, type SvgIconProps, Switch, SwitchConfirm, type SwitchConfirmProps, SyncStatus, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TaxBasedOn, type TaxBasedOnProps, TaxCalculationSettings, type TaxCalculationSettingsProps, Tender, TenderPane, type TenderPaneProps, type TenderPicker, Text, type TextProps, Textarea, type TextareaProps, Toast, ToastClose, ToastDescription, type ToastProps, ToastTitle, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, ToneDisc, type ToneDiscProps, type Tone as ToneDiscTone, Tooltip, TooltipContent, TooltipTrigger, type TransactionSummary, UserIcon, UsersIcon, VStack, type VStackProps, type VariantOption, VariationPicker, type VariationPickerProps, ViewToggle, type ViewToggleProps, type ViewfinderProps, type WeekDay, XIcon, addMonths, avatarInitials, avatarVariants, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, cartColumnIds, compareDays, createSvgIcon, defaultProductColumns, describeRegisterBarPill, discountLabel, formatStockSyncTime, hstackVariants, iconButtonVariants, iconVariants, injectPrintStyle, loaderVariants, monthGrid, monthOf, orderReference, parseDiscount, parsePrice, pickFigure, pressRangeDay, productsScreenColumns, skeletonCount, statusDotVariants, syncStatusQuiet, tenderLabel, textVariants, toastVariants, toggleTextVariants, toggleVariants, useDefaultProductColumns, useFontType, useInputContext, usePointer, useProductsScreenColumns, useScale, useT, useTender, vstackVariants };
|