@tallyui/components 3.12.0 → 3.14.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 +466 -28
- package/dist/index.js +3194 -1574
- package/package.json +9 -9
- package/src/cart/cart-columns.tsx +57 -0
- package/src/cart/cart-line.tsx +32 -17
- package/src/cart/index.ts +1 -0
- package/src/checkout/cash-tendered.tsx +5 -7
- package/src/fonts/font-provider.tsx +65 -0
- package/src/fonts/index.ts +1 -0
- package/src/index.ts +40 -2
- package/src/lib/error-text.ts +5 -0
- package/src/order/index.ts +2 -0
- package/src/order/refund-form.tsx +205 -0
- package/src/order/refund-modal.tsx +32 -0
- package/src/product/category-tile.tsx +43 -0
- package/src/product/in-cart-badge.tsx +26 -0
- package/src/product/index.ts +2 -0
- package/src/register/closure-sheet.tsx +13 -2
- package/src/register/handover-slip.tsx +46 -0
- package/src/register/index.ts +2 -0
- package/src/register/movement-sheet.tsx +2 -1
- package/src/register/open-register-card.tsx +2 -1
- package/src/register/register-bar.tsx +57 -11
- package/src/register/register-column.tsx +2 -1
- package/src/register/register-count.tsx +30 -11
- package/src/register/register-panel.tsx +45 -4
- package/src/register/switch-confirm.tsx +102 -0
- package/src/reports/cards.tsx +197 -0
- package/src/reports/filters-bar.tsx +95 -0
- package/src/reports/hero.tsx +111 -0
- package/src/reports/index.ts +4 -0
- package/src/reports/sales-room.tsx +28 -0
- package/src/sale/cart.tsx +37 -21
- package/src/sale/catalogue.tsx +34 -5
- package/src/sale/customer-display-screen.tsx +92 -0
- package/src/sale/index.ts +5 -2
- package/src/sale/open-sale-tabs.tsx +67 -0
- package/src/sale/order-reference.ts +3 -0
- package/src/sale/orders-list.tsx +4 -2
- package/src/sale/parked-sales.tsx +2 -1
- package/src/sale/price-form.tsx +28 -4
- package/src/sale/product-filter-bar.tsx +58 -0
- package/src/sale/receipt.tsx +8 -2
- package/src/sale/tender-pane.tsx +179 -0
- package/src/sale/tender.tsx +20 -35
- package/src/scale/index.ts +3 -0
- package/src/scale/scale-provider.tsx +70 -0
- package/src/scale/use-pointer.ts +23 -0
- package/src/settings/display-settings.tsx +122 -0
- package/src/settings/index.ts +1 -0
- package/src/shell/app-shell.tsx +71 -0
- package/src/shell/index.ts +4 -0
- package/src/shell/nav-drawer.tsx +130 -0
- package/src/shell/nav-item.tsx +70 -0
- package/src/shell/nav-rail.tsx +58 -0
- package/src/shell/shell-context.ts +18 -0
- package/src/ui/icon/menu-icon.tsx +10 -0
- package/src/ui/text/font-text.tsx +25 -0
- package/src/ui/text/index.tsx +5 -4
- package/src/sale/split-tender.tsx +0 -81
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ 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 {
|
|
12
|
-
import {
|
|
11
|
+
import { ScaleOverride, ScaleVariables, ScaleStep, Pointer, TypeSetId, ThemeFontFamily, ThemeType } from '@tallyui/theme';
|
|
12
|
+
import { CatalogueView, ProductSortValue, ProductSort, RefundableOrderLine, EarlierRefund, useRegisterSession, RegisterSession, MovementType, ApprovalNeeded, SwitchKind, SwitchWarnings, HandoverSlipData, AppSettings, useAppSettings, useSale, TenderState, TenderAction, AppliedDiscount, Discount, CatalogueEntry, CatalogueViewState, CartQuantityLine, SentOrder, PosOrder, ReceiptData, OutboxState, ParkedOrderSummary, OpenSale, DisplayState, SalesFigures, DatePreset, DayRange } from '@tallyui/pos';
|
|
13
|
+
import { ProductTraits, TraitContext, Money, CustomerTraits, Customer, CustomerInput, OrderRefundPayload, PaymentMethodDescriptor, ProductCategory, SyncNotice, StoreSettingsChoices, StoreSettingsChoice } from '@tallyui/core';
|
|
13
14
|
|
|
14
15
|
declare const textVariants: (props?: ({
|
|
15
16
|
variant?: "link" | "default" | null | undefined;
|
|
@@ -17,7 +18,7 @@ declare const textVariants: (props?: ({
|
|
|
17
18
|
type TextProps = React$1.ComponentPropsWithoutRef<typeof Text$1> & VariantProps<typeof textVariants> & {
|
|
18
19
|
asChild?: boolean;
|
|
19
20
|
};
|
|
20
|
-
declare function Text({ className, variant, asChild, children, ...props }: TextProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function Text({ className, variant, asChild, children, maxFontSizeMultiplier, ...props }: TextProps): react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
declare const hstackVariants: (props?: ({
|
|
23
24
|
space?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
@@ -325,6 +326,33 @@ declare const TableRow: React$1.ForwardRefExoticComponent<ViewProps & React$1.Re
|
|
|
325
326
|
declare const TableHead: React$1.ForwardRefExoticComponent<ViewProps & React$1.RefAttributes<View>>;
|
|
326
327
|
declare const TableCell: React$1.ForwardRefExoticComponent<ViewProps & React$1.RefAttributes<View>>;
|
|
327
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Port of WCPOS v2 `packages/core/src/contexts/scale/index.tsx` and
|
|
331
|
+
* `packages/components/src/lib/device.ts`.
|
|
332
|
+
* The native scope is a prop so components do not depend on Uniwind's ScopedVariables.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
interface ScaleScopeProps {
|
|
336
|
+
variables: ScaleVariables;
|
|
337
|
+
children?: React$1.ReactNode;
|
|
338
|
+
}
|
|
339
|
+
interface ScaleState {
|
|
340
|
+
step: ScaleStep;
|
|
341
|
+
pointer: Pointer;
|
|
342
|
+
variables: ScaleVariables;
|
|
343
|
+
}
|
|
344
|
+
interface ScaleProviderProps {
|
|
345
|
+
/** The app's stored `ui.scale` setting (from `useAppSettings` in `@tallyui/pos`); missing or unknown means Auto. */
|
|
346
|
+
scale?: ScaleOverride | null;
|
|
347
|
+
/** Scopes the variables below it on native, e.g. Uniwind's ScopedVariables. Optional: the web root mirror covers the web. */
|
|
348
|
+
scope?: React$1.ComponentType<ScaleScopeProps>;
|
|
349
|
+
children?: React$1.ReactNode;
|
|
350
|
+
}
|
|
351
|
+
declare function ScaleProvider({ scale, scope: Scope, children }: ScaleProviderProps): React$1.JSX.Element;
|
|
352
|
+
declare function useScale(): ScaleState;
|
|
353
|
+
|
|
354
|
+
declare function usePointer(): Pointer;
|
|
355
|
+
|
|
328
356
|
interface ProductTitleProps extends Omit<TextProps, 'children'> {
|
|
329
357
|
/** The raw RxDB product document (connector-specific shape) */
|
|
330
358
|
doc: any;
|
|
@@ -587,24 +615,78 @@ interface ProductVariantPickerProps extends Omit<ViewProps, 'children'> {
|
|
|
587
615
|
}
|
|
588
616
|
declare function ProductVariantPicker({ options, selected, onSelect, className, ...viewProps }: ProductVariantPickerProps): react_jsx_runtime.JSX.Element;
|
|
589
617
|
|
|
618
|
+
interface InCartBadgeProps {
|
|
619
|
+
/** How many of the product the cart holds (e.g. from `cartQuantities`); nothing renders at 0. */
|
|
620
|
+
count: number;
|
|
621
|
+
/** Placement, e.g. `absolute right-2 top-2` for a tile's top-right corner. */
|
|
622
|
+
className?: string;
|
|
623
|
+
testID?: string;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* How many of a product are in the cart: a primary circle with the count, hidden while there are none.
|
|
627
|
+
*
|
|
628
|
+
* Ported from WCPOS v2 `InCartCount`, packages/core/src/screens/main/pos/products/rows/in-cart-count.tsx
|
|
629
|
+
* (MIT, WCPOS), without its count beat.
|
|
630
|
+
*/
|
|
631
|
+
declare function InCartBadge({ count, className, testID }: InCartBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
632
|
+
|
|
633
|
+
interface CategoryTileProps {
|
|
634
|
+
name: string;
|
|
635
|
+
/** The category's photo; without one the tile shows the name's initial on a tint. */
|
|
636
|
+
imageUrl?: string;
|
|
637
|
+
/** Products in the category, shown under the name when above 0. */
|
|
638
|
+
count?: number;
|
|
639
|
+
onPress?: () => void;
|
|
640
|
+
testID?: string;
|
|
641
|
+
className?: string;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* A category as a square tile: its photo full-bleed with the name over the foot, or the name's initial on a
|
|
645
|
+
* tint when there is no photo.
|
|
646
|
+
*
|
|
647
|
+
* Ported from WCPOS v2 `TermTile`, packages/core/src/screens/main/pos/products/browse/term-tile.tsx
|
|
648
|
+
* (MIT, WCPOS): the picture fills the square (`contentFit="cover"`), else a tint; the name bold over two
|
|
649
|
+
* lines with the count under it.
|
|
650
|
+
*/
|
|
651
|
+
declare function CategoryTile({ name, imageUrl, count, onPress, testID, className }: CategoryTileProps): react_jsx_runtime.JSX.Element;
|
|
652
|
+
|
|
590
653
|
interface CartLineProps extends Omit<HStackProps, 'children'> {
|
|
591
654
|
name: string;
|
|
592
|
-
/** The variant's chosen options, one "Name: Value"
|
|
655
|
+
/** The variant's chosen options, shown as one "Name: Value · Name: Value" line under the name. */
|
|
593
656
|
attributes?: Record<string, string>;
|
|
594
657
|
quantity: number;
|
|
595
658
|
unitPrice: Money;
|
|
659
|
+
/** The regular unit price; shown struck through above unitPrice only when it is above unitPrice. */
|
|
660
|
+
regularUnitPrice?: Money;
|
|
596
661
|
lineTotal: Money;
|
|
662
|
+
/** Show the Price column (default true); the Cart passes false on a narrow cart or a phone, as CartColumnHeads does. */
|
|
663
|
+
showPrice?: boolean;
|
|
597
664
|
locale?: string;
|
|
598
665
|
className?: string;
|
|
599
666
|
}
|
|
600
667
|
/**
|
|
601
|
-
*
|
|
668
|
+
* A single cart line in the columns of CartColumnHeads: quantity, the name with its attributes, the unit price
|
|
669
|
+
* (with the regular price struck through when it is higher) and the line total.
|
|
602
670
|
*
|
|
603
671
|
* ```tsx
|
|
604
672
|
* <CartLine name="Coffee" quantity={2} unitPrice={unitPrice} lineTotal={lineTotal} />
|
|
605
673
|
* ```
|
|
606
674
|
*/
|
|
607
|
-
declare function CartLine({ name, attributes, quantity, unitPrice, lineTotal, locale, className, ...props }: CartLineProps): react_jsx_runtime.JSX.Element;
|
|
675
|
+
declare function CartLine({ name, attributes, quantity, unitPrice, regularUnitPrice, lineTotal, showPrice, locale, className, ...props }: CartLineProps): react_jsx_runtime.JSX.Element;
|
|
676
|
+
|
|
677
|
+
interface CartColumnHeadsProps extends Omit<ViewProps, 'children'> {
|
|
678
|
+
/** Show the Price head (default true); pass the same value as each CartLine's `showPrice`. */
|
|
679
|
+
showPrice?: boolean;
|
|
680
|
+
className?: string;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* The cart's header row, Qty, Item, Price and Total, over lines laid out by CartLine in the same columns.
|
|
684
|
+
*
|
|
685
|
+
* ```tsx
|
|
686
|
+
* <CartColumnHeads showPrice={showPrice} />
|
|
687
|
+
* ```
|
|
688
|
+
*/
|
|
689
|
+
declare function CartColumnHeads({ showPrice, className, ...props }: CartColumnHeadsProps): JSX.Element;
|
|
608
690
|
|
|
609
691
|
interface CartTotalProps extends Omit<VStackProps, 'children'> {
|
|
610
692
|
subtotal: Money;
|
|
@@ -982,6 +1064,49 @@ interface OrderDetailProps extends Omit<ViewProps, 'children'> {
|
|
|
982
1064
|
}
|
|
983
1065
|
declare function OrderDetail({ orderNumber, status, lineItems, subtotal, tax, total, customerSlot, paymentSlot, footerSlot, className, ...viewProps }: OrderDetailProps): react_jsx_runtime.JSX.Element;
|
|
984
1066
|
|
|
1067
|
+
/** What the form hands back: the order.refund v1 payload minus the ids, session and clock the caller adds. */
|
|
1068
|
+
type RefundFormValue = Pick<OrderRefundPayload, 'lines' | 'shippingMinor' | 'adjustmentMinor' | 'totalMinor' | 'destination' | 'reason'>;
|
|
1069
|
+
interface RefundFormProps {
|
|
1070
|
+
/** The order's lines; a StoreOrderLine fits. */
|
|
1071
|
+
lines: ReadonlyArray<RefundableOrderLine & {
|
|
1072
|
+
name: string;
|
|
1073
|
+
}>;
|
|
1074
|
+
/** Earlier refunds' lines, subtracted by order line id. */
|
|
1075
|
+
refunds: readonly EarlierRefund[];
|
|
1076
|
+
currency: string;
|
|
1077
|
+
/** The order number the store shows, for the confirmation. */
|
|
1078
|
+
orderReference: string;
|
|
1079
|
+
/** The order total with tax. */
|
|
1080
|
+
orderTotalMinor: number;
|
|
1081
|
+
/** Money already refunded on the order, positive; default 0. */
|
|
1082
|
+
refundedMinor?: number;
|
|
1083
|
+
/** Shipping still refundable, with tax; 0 or absent hides the shipping field. */
|
|
1084
|
+
refundableShippingMinor?: number;
|
|
1085
|
+
/** The sale's payment method; omit for a cash sale, which always refunds in cash. */
|
|
1086
|
+
originalMethod?: {
|
|
1087
|
+
title: string;
|
|
1088
|
+
available: boolean;
|
|
1089
|
+
};
|
|
1090
|
+
/** Each line's restock starting value; default true. */
|
|
1091
|
+
defaultRestock?: boolean;
|
|
1092
|
+
/** Refunds are online only (ADR-080); false disables confirming. Default true. */
|
|
1093
|
+
online?: boolean;
|
|
1094
|
+
/** A refusal from the caller's last attempt, shown above the actions. */
|
|
1095
|
+
error?: string;
|
|
1096
|
+
/** Called once per confirmation; the form stays busy until a returned promise settles. */
|
|
1097
|
+
onConfirm: (refund: RefundFormValue) => void | Promise<unknown>;
|
|
1098
|
+
onCancel: () => void;
|
|
1099
|
+
}
|
|
1100
|
+
/** Ports WCPOS v2 form.tsx, monorepo main 5ac185b0e; the till never prices lines itself (priceRefund). */
|
|
1101
|
+
declare function RefundForm({ lines, refunds, currency, orderReference, orderTotalMinor, refundedMinor, refundableShippingMinor, originalMethod, defaultRestock, online, error, onConfirm, onCancel, }: RefundFormProps): JSX.Element;
|
|
1102
|
+
|
|
1103
|
+
interface RefundModalProps extends Omit<RefundFormProps, 'onCancel'> {
|
|
1104
|
+
open: boolean;
|
|
1105
|
+
onOpenChange: (open: boolean) => void;
|
|
1106
|
+
}
|
|
1107
|
+
/** Ports WCPOS v2 modal.tsx: a bounded panel around the refund form. */
|
|
1108
|
+
declare function RefundModal({ open, onOpenChange, ...formProps }: RefundModalProps): JSX.Element;
|
|
1109
|
+
|
|
985
1110
|
interface Denomination {
|
|
986
1111
|
label: string;
|
|
987
1112
|
value: number;
|
|
@@ -1074,18 +1199,30 @@ interface RegisterBarProps {
|
|
|
1074
1199
|
onOpenPanel: () => void;
|
|
1075
1200
|
/** Turns the pill into a button (opens the gate/picker or the panel) when given; the plain badge otherwise. */
|
|
1076
1201
|
onPressPill?: () => void;
|
|
1202
|
+
/** The store's name. With `multiRegister` and a bound register the bar reads "Store · Register". */
|
|
1203
|
+
storeName?: string;
|
|
1204
|
+
/** The signed-in cashier: an initials avatar, pressable when `onPress` is given. */
|
|
1205
|
+
cashier?: {
|
|
1206
|
+
name: string;
|
|
1207
|
+
onPress?: () => void;
|
|
1208
|
+
};
|
|
1209
|
+
/** The app's sync state (a badge or a line), drawn before the cashier. */
|
|
1210
|
+
syncStatus?: ReactNode;
|
|
1211
|
+
/** Opens the navigation; inside a phone `AppShell` the shell supplies it. Hidden when neither. */
|
|
1212
|
+
onOpenMenu?: () => void;
|
|
1077
1213
|
className?: string;
|
|
1078
1214
|
}
|
|
1079
1215
|
/**
|
|
1080
|
-
* The till's one status bar:
|
|
1081
|
-
* (LEDGER 48),
|
|
1082
|
-
* 1): WCPOS `next` `3b5331b5c`
|
|
1216
|
+
* The till's one status bar: the menu (phones), the place (the store, and the register for
|
|
1217
|
+
* multi-register stores), one status pill (LEDGER 48), the sync state, the button that opens the
|
|
1218
|
+
* register panel, and the cashier. Port provenance (ADR-032 amendment 1): WCPOS `next` `3b5331b5c`
|
|
1219
|
+
* `register-bar.tsx`; the menu, the place and the cashier from v2 `main` `51e7c4351`
|
|
1220
|
+
* `packages/core/src/screens/main/pos/cart/register-bar.tsx` and `components/bar-controls`, MIT, WCPOS.
|
|
1083
1221
|
*
|
|
1084
|
-
* Dropped for this neutral port: the user
|
|
1085
|
-
* WooCommerce OAuth-return rehosting — all app/backend concerns `useRegisterSession` never
|
|
1086
|
-
* carries. The drawer/menu button is gone too: TallyUI has no fixed navigation shell to open.
|
|
1222
|
+
* Dropped for this neutral port: the user sheet, switch-store, the notification bell and the
|
|
1223
|
+
* WooCommerce OAuth-return rehosting — all app/backend concerns `useRegisterSession` never carries.
|
|
1087
1224
|
*/
|
|
1088
|
-
declare function RegisterBar({ register, registerId, online, registerName, multiRegister, onOpenPanel, onPressPill, className, }: RegisterBarProps): react_jsx_runtime.JSX.Element;
|
|
1225
|
+
declare function RegisterBar({ register, registerId, online, registerName, multiRegister, onOpenPanel, onPressPill, storeName, cashier, syncStatus, onOpenMenu, className, }: RegisterBarProps): react_jsx_runtime.JSX.Element;
|
|
1089
1226
|
|
|
1090
1227
|
/**
|
|
1091
1228
|
* The register bar's status pill: one pill, one place. Port provenance (ADR-032 amendment 1):
|
|
@@ -1152,6 +1289,15 @@ interface RegisterPanelProps {
|
|
|
1152
1289
|
registerName?: string;
|
|
1153
1290
|
open: boolean;
|
|
1154
1291
|
onOpenChange: (open: boolean) => void;
|
|
1292
|
+
/**
|
|
1293
|
+
* The host's gate for a closure the store refused (`register.approvalNeeded`, ADR-082 d7): it
|
|
1294
|
+
* gets the refusal, including `liveAtStore`, and returns a new proof and approver, or `null`
|
|
1295
|
+
* to leave it. Its result goes to `actions.reapproveClosure`. Without it, the card has no button.
|
|
1296
|
+
*/
|
|
1297
|
+
reapprove?: (needed: ApprovalNeeded) => Promise<{
|
|
1298
|
+
approvedBy: string;
|
|
1299
|
+
approval: string;
|
|
1300
|
+
} | null>;
|
|
1155
1301
|
className?: string;
|
|
1156
1302
|
}
|
|
1157
1303
|
/**
|
|
@@ -1163,7 +1309,7 @@ interface RegisterPanelProps {
|
|
|
1163
1309
|
* note): refused-movement Retry and "Unsynced" (no outbox here to refuse a movement), the
|
|
1164
1310
|
* X-report, Z and print/reprint, and the Reports deep link.
|
|
1165
1311
|
*/
|
|
1166
|
-
declare function RegisterPanel({ register, currency, registerName, open, onOpenChange, className }: RegisterPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
1312
|
+
declare function RegisterPanel({ register, currency, registerName, open, onOpenChange, reapprove, className }: RegisterPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
1167
1313
|
|
|
1168
1314
|
interface RegisterColumnProps {
|
|
1169
1315
|
/** `useRegisterSession`'s return value: decides the picker/open/counting/selling swap. */
|
|
@@ -1202,13 +1348,21 @@ interface RegisterCountProps {
|
|
|
1202
1348
|
/** ISO 4217 code: denomination faces, parsing and display. */
|
|
1203
1349
|
currency: string;
|
|
1204
1350
|
/**
|
|
1205
|
-
* Above `register.varianceThreshold`, Close asks for this first
|
|
1206
|
-
* stays; without it, Close refuses outright with
|
|
1207
|
-
*
|
|
1351
|
+
* Above `register.varianceThreshold`, Close asks for this first, with the count it would close
|
|
1352
|
+
* on. `null` refuses and the count stays; without it, Close refuses outright with
|
|
1353
|
+
* `APPROVAL_REQUIRED_TEXT`. Its `approvedBy`, `approvedByName`, `approval` (the store's opaque
|
|
1354
|
+
* proof, ADR-082) and `approvedVariance` (from `actions.closureVariance`) go to `closeSession`,
|
|
1355
|
+
* which enforces the same gate and puts the approver on the Z. A count edited while this is
|
|
1356
|
+
* pending, or a variance that moved since (the hook's gate), asks again on the next Close.
|
|
1357
|
+
* A zero-argument function still fits.
|
|
1208
1358
|
*/
|
|
1209
|
-
approve?: (
|
|
1359
|
+
approve?: (input: {
|
|
1360
|
+
counted: Record<string, number>;
|
|
1361
|
+
}) => Promise<{
|
|
1210
1362
|
approvedBy: string;
|
|
1211
1363
|
approvedByName?: string;
|
|
1364
|
+
approval?: string;
|
|
1365
|
+
approvedVariance?: Record<string, number>;
|
|
1212
1366
|
} | null>;
|
|
1213
1367
|
className?: string;
|
|
1214
1368
|
}
|
|
@@ -1242,6 +1396,44 @@ interface ClosureSheetProps {
|
|
|
1242
1396
|
*/
|
|
1243
1397
|
declare function ClosureSheet({ register, currency, onPrint, onDone }: ClosureSheetProps): react_jsx_runtime.JSX.Element | null;
|
|
1244
1398
|
|
|
1399
|
+
interface SwitchConfirmProps {
|
|
1400
|
+
kind: SwitchKind;
|
|
1401
|
+
warnings: SwitchWarnings;
|
|
1402
|
+
/** The cashier or register switched to; unused for `signOut`. */
|
|
1403
|
+
targetName?: string;
|
|
1404
|
+
/** The bound register's name, for the descriptions and the sign-out title. */
|
|
1405
|
+
registerName?: string;
|
|
1406
|
+
/** A formatted expected cash amount for the sign-out title; omit while blind. */
|
|
1407
|
+
amount?: string;
|
|
1408
|
+
onConfirm: () => void;
|
|
1409
|
+
onCancel: () => void;
|
|
1410
|
+
/** Sign-out with an open session: renders "Close register", which calls this. */
|
|
1411
|
+
onCloseRegister?: () => void;
|
|
1412
|
+
/** Cashier switch: renders "Print hand-over slip", which calls this. */
|
|
1413
|
+
onPrintHandover?: () => void;
|
|
1414
|
+
}
|
|
1415
|
+
/**
|
|
1416
|
+
* Confirms a cashier switch, a register switch or a sign-out, naming what it leaves behind (v2 parity A12). Port
|
|
1417
|
+
* provenance: WCPOS v2 monorepo `main` 51e7c4351 `packages/core/src/screens/main/pos/cart/switch-confirm.tsx`, with
|
|
1418
|
+
* its English copy (`locales/en/core.json`, `register.*`). Not ported: the store switch and its drawer carry, and
|
|
1419
|
+
* v2's "The POS reloads as …" lines (a TallyUI app's switch is its platform's own). New here: unsent sales add
|
|
1420
|
+
* "anyway" to the confirm, and till updates, parked sales and a partly paid sale are listed too.
|
|
1421
|
+
*/
|
|
1422
|
+
declare function SwitchConfirm({ kind, warnings, targetName, registerName, amount, onConfirm, onCancel, onCloseRegister, onPrintHandover, }: SwitchConfirmProps): react_jsx_runtime.JSX.Element;
|
|
1423
|
+
|
|
1424
|
+
interface HandoverSlipProps {
|
|
1425
|
+
/** `handoverSlip(...)`'s result; `document` is not read here (it is what prints). */
|
|
1426
|
+
slip: Omit<HandoverSlipData, 'document'>;
|
|
1427
|
+
/** ISO 4217 code, for the expected figures. */
|
|
1428
|
+
currency: string;
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* The hand-over slip on screen: what a closing cashier hands the next one (v2's "Hand-over slip", the open session's
|
|
1432
|
+
* X report naming the cashier; WCPOS v2 monorepo `main` 51e7c4351 `switch-confirm.tsx` and `use-session-report.ts`).
|
|
1433
|
+
* No dialog: the host places it, for example in a print preview. No expected figures while blind.
|
|
1434
|
+
*/
|
|
1435
|
+
declare function HandoverSlip({ slip, currency }: HandoverSlipProps): react_jsx_runtime.JSX.Element;
|
|
1436
|
+
|
|
1245
1437
|
interface SettingsRowProps extends Omit<ViewProps, 'children'> {
|
|
1246
1438
|
label: string;
|
|
1247
1439
|
description?: string;
|
|
@@ -1274,8 +1466,16 @@ interface ConnectorStatusProps extends Omit<ViewProps, 'children'> {
|
|
|
1274
1466
|
}
|
|
1275
1467
|
declare function ConnectorStatus({ name, status, lastSync, error, className, unsoldCount, unsoldStale, formatUnsold, ...viewProps }: ConnectorStatusProps): react_jsx_runtime.JSX.Element;
|
|
1276
1468
|
|
|
1469
|
+
interface DisplaySettingsProps {
|
|
1470
|
+
/** The hook's settings: `<DisplaySettings {...useAppSettings(db.app_settings)} />`. */
|
|
1471
|
+
settings: Pick<AppSettings, 'ui.theme' | 'ui.scale' | 'ui.font'>;
|
|
1472
|
+
setSetting: ReturnType<typeof useAppSettings>['setSetting'];
|
|
1473
|
+
className?: string;
|
|
1474
|
+
}
|
|
1475
|
+
declare function DisplaySettings({ settings, setSetting, className }: DisplaySettingsProps): JSX.Element;
|
|
1476
|
+
|
|
1277
1477
|
/** `taxLabel` names each tax row; VAT isn't universal, so a platform passes its own (medusapos passes `VAT ${rate}%`). */
|
|
1278
|
-
declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, taxClasses, afterSubtotal, couponDiscountMinor }: {
|
|
1478
|
+
declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscounts, taxClasses, afterSubtotal, couponDiscountMinor, orderActions }: {
|
|
1279
1479
|
sale: ReturnType<typeof useSale>;
|
|
1280
1480
|
taxLabel?: (ratePpm: number) => string;
|
|
1281
1481
|
taxClasses?: ReadonlyArray<{
|
|
@@ -1291,12 +1491,17 @@ declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, taxClasses,
|
|
|
1291
1491
|
toMinor: number;
|
|
1292
1492
|
reason?: string;
|
|
1293
1493
|
}) => void;
|
|
1494
|
+
/** v2's quick-discount keys on each line's Price form (e.g. the app's `cart.quickDiscounts` setting); needs `canEditPrice`. */
|
|
1495
|
+
quickDiscounts?: readonly number[];
|
|
1294
1496
|
/** Rows under the totals' Subtotal, e.g. the platform's coupon chips (passed to CartTotal). */
|
|
1295
1497
|
afterSubtotal?: ReactNode;
|
|
1296
1498
|
/** The coupon amount the app itemises in `afterSubtotal` (e.g. Σ `order.display.coupons`), in integer minor units of
|
|
1297
1499
|
* the order's currency, in the display mode. When given, the Discount row shows the other discounts only (the
|
|
1298
1500
|
* totals' discount minus this) and is hidden when they come to 0. Absent: the Discount row is the whole discount. */
|
|
1299
1501
|
couponDiscountMinor?: number;
|
|
1502
|
+
/** Cart's own Order discount and Add charge controls; pass `false` when the app hosts them in its own menu (v2's
|
|
1503
|
+
* cart "+" menu). Applied discounts and charges still show and can be removed. */
|
|
1504
|
+
orderActions?: boolean;
|
|
1300
1505
|
}): react_jsx_runtime.JSX.Element;
|
|
1301
1506
|
|
|
1302
1507
|
/** Phone mode's cart summary (medusapos ADR 0009): the whole bar is one button; the total is the cart's own Total row. */
|
|
@@ -1305,13 +1510,33 @@ declare function CartBar({ sale, onOpen }: {
|
|
|
1305
1510
|
onOpen: () => void;
|
|
1306
1511
|
}): react_jsx_runtime.JSX.Element;
|
|
1307
1512
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1513
|
+
type Sale$1 = ReturnType<typeof useSale>;
|
|
1514
|
+
type TenderProps = {
|
|
1515
|
+
sale: Sale$1;
|
|
1516
|
+
methods?: PaymentMethodDescriptor[];
|
|
1517
|
+
};
|
|
1518
|
+
/** The tender pane with its own reducer, opened on the method `startTender` chose. Renders nothing outside the tender stage. */
|
|
1519
|
+
declare function Tender({ sale, methods }: TenderProps): JSX.Element | null;
|
|
1520
|
+
/** @deprecated Use Tender: the pane now handles split payments. */
|
|
1521
|
+
declare function SplitTender(props: TenderProps): JSX.Element;
|
|
1311
1522
|
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1523
|
+
/**
|
|
1524
|
+
* The tender pane, laid out as WCPOS v2's (monorepo main, packages/core/src/screens/main/pos/checkout/tender/):
|
|
1525
|
+
* BalanceHeadline and LedgerLegs from ledger-pane.tsx, then the method tiles, entry, quick-cash chips,
|
|
1526
|
+
* keypad and commit from tender-pane.tsx's TenderKeypad. Copy is v2's English catalogue. Every figure
|
|
1527
|
+
* comes from pos (useSale's captured-only totals, tenderRounding, quickTenderedAmounts, planLegs).
|
|
1528
|
+
*/
|
|
1529
|
+
|
|
1530
|
+
type Sale = ReturnType<typeof useSale>;
|
|
1531
|
+
interface TenderPaneProps {
|
|
1532
|
+
sale: Sale;
|
|
1533
|
+
/** The tender reducer's state (`tenderReducer` in @tallyui/pos); the host owns the reducer. */
|
|
1534
|
+
state: TenderState;
|
|
1535
|
+
dispatch: (action: TenderAction) => void;
|
|
1536
|
+
/** Defaults to `defaultPaymentMethods()`; only `cash` and `external`, the order.create methods, are offered. */
|
|
1537
|
+
methods?: PaymentMethodDescriptor[];
|
|
1538
|
+
}
|
|
1539
|
+
declare function TenderPane({ sale, state, dispatch, methods }: TenderPaneProps): JSX.Element | null;
|
|
1315
1540
|
|
|
1316
1541
|
/** The cashier's entry as a TallyUI Discount (a percent, or integer minor units), or the inline error to show. */
|
|
1317
1542
|
declare function parseDiscount(type: Discount['type'], text: string, currency: string): Discount | string;
|
|
@@ -1341,12 +1566,14 @@ declare function DiscountChips({ discounts, currency, onRemove, prefix, amounts
|
|
|
1341
1566
|
/** The cashier's entry as integer minor units of `currency` (0 allowed), or the inline error to show. */
|
|
1342
1567
|
declare function parsePrice(text: string, currency: string): number | string;
|
|
1343
1568
|
/** `onApply` returns a refusal to show inline, or null once applied. */
|
|
1344
|
-
declare function PriceForm({ lineName, currency, currentMinor, onApply, onClose }: {
|
|
1569
|
+
declare function PriceForm({ lineName, currency, currentMinor, onApply, onClose, quickDiscounts }: {
|
|
1345
1570
|
lineName: string;
|
|
1346
1571
|
currency: string;
|
|
1347
1572
|
currentMinor: number;
|
|
1348
1573
|
onApply: (amountMinor: number, reason?: string) => string | null;
|
|
1349
1574
|
onClose: () => void;
|
|
1575
|
+
/** Percentages off the current price, as v2's price-keypad keys; the first three valid ones (0 < n ≤ 100) are drawn. */
|
|
1576
|
+
quickDiscounts?: readonly number[];
|
|
1350
1577
|
}): JSX.Element;
|
|
1351
1578
|
|
|
1352
1579
|
interface ChargeFormProps {
|
|
@@ -1372,8 +1599,34 @@ interface ChargeFormProps {
|
|
|
1372
1599
|
/** `onApply` returns a refusal to show inline, or null once applied. */
|
|
1373
1600
|
declare function ChargeForm({ currency, lineTax, taxClasses, shippingTaxFromStore, onApply, onClose }: ChargeFormProps): react_jsx_runtime.JSX.Element;
|
|
1374
1601
|
|
|
1602
|
+
type ProductFilterChip = 'inStock' | 'featured' | 'onSale' | 'category' | 'tag' | 'brand';
|
|
1603
|
+
type TermChip = 'category' | 'tag' | 'brand';
|
|
1604
|
+
interface ProductFilters {
|
|
1605
|
+
inStock: boolean;
|
|
1606
|
+
featured: boolean;
|
|
1607
|
+
onSale: boolean;
|
|
1608
|
+
}
|
|
1609
|
+
/** In Stock starts on, as v2's `stock_status: 'instock'` does while "show out-of-stock products" is off (its default). */
|
|
1610
|
+
declare const DEFAULT_PRODUCT_FILTERS: ProductFilters;
|
|
1611
|
+
declare const PRODUCT_FILTER_CHIPS: readonly ProductFilterChip[];
|
|
1612
|
+
interface ProductFilterBarProps {
|
|
1613
|
+
value: ProductFilters;
|
|
1614
|
+
onChange: (next: ProductFilters) => void;
|
|
1615
|
+
/** Which chips to show, in this order. Default PRODUCT_FILTER_CHIPS. */
|
|
1616
|
+
chips?: readonly ProductFilterChip[];
|
|
1617
|
+
/** Opens the app's term picker; the category, tag and brand chips render only when it is given. */
|
|
1618
|
+
onTermPress?: (chip: TermChip) => void;
|
|
1619
|
+
className?: string;
|
|
1620
|
+
}
|
|
1621
|
+
/**
|
|
1622
|
+
* v2's always-on filter chips above the product grid: In Stock, Featured and On Sale toggle; Category, Tag
|
|
1623
|
+
* and Brand open the app's term picker. Ported from WCPOS v2 `FilterBar`,
|
|
1624
|
+
* packages/core/src/screens/main/pos/products/filter-bar/filter-bar.tsx (MIT, WCPOS).
|
|
1625
|
+
*/
|
|
1626
|
+
declare function ProductFilterBar({ value, onChange, chips, onTermPress, className }: ProductFilterBarProps): react_jsx_runtime.JSX.Element;
|
|
1627
|
+
|
|
1375
1628
|
declare function formatStockSyncTime(time: Date, locale?: string, hour12?: boolean, now?: Date): string;
|
|
1376
|
-
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 }: {
|
|
1629
|
+
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 }: {
|
|
1377
1630
|
products: Doc[];
|
|
1378
1631
|
traits: ProductTraits<Doc>;
|
|
1379
1632
|
currency: string;
|
|
@@ -1423,6 +1676,16 @@ declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusTe
|
|
|
1423
1676
|
onQueryChange?: (query: string) => void;
|
|
1424
1677
|
/** 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. */
|
|
1425
1678
|
pickAnyOptions?: boolean;
|
|
1679
|
+
/** The open sale's lines (e.g. useSale's order.lineItems); each grid tile shows its product's summed quantity. */
|
|
1680
|
+
cartLines?: readonly CartQuantityLine[];
|
|
1681
|
+
/** Show v2's filter chips under the search box. Default false. */
|
|
1682
|
+
showFilterBar?: boolean;
|
|
1683
|
+
/** Which chips the bar shows. Default ['inStock'], the one Catalogue applies itself. */
|
|
1684
|
+
filterChips?: readonly ProductFilterChip[];
|
|
1685
|
+
/** Controlled filters; changes are reported through onFiltersChange. */
|
|
1686
|
+
filters?: ProductFilters;
|
|
1687
|
+
/** The cashier's next filters (requested filters when controlled). */
|
|
1688
|
+
onFiltersChange?: (filters: ProductFilters) => void;
|
|
1426
1689
|
}): react_jsx_runtime.JSX.Element;
|
|
1427
1690
|
|
|
1428
1691
|
type ReceiptProps = {
|
|
@@ -1526,6 +1789,28 @@ interface ParkedSalesProps {
|
|
|
1526
1789
|
}
|
|
1527
1790
|
declare function ParkedSales({ sale, parked, onDiscard, onPark, onResume, currency, open, onOpenChange, hour12 }: ParkedSalesProps): JSX.Element;
|
|
1528
1791
|
|
|
1792
|
+
/** Pass `openSales(sale.order, useParkedSales(drafts).parked)`; `onSelect` and `onNew` call `sale.switchSale(id)` and `sale.switchSale(null)`. */
|
|
1793
|
+
interface OpenSaleTabsProps {
|
|
1794
|
+
sales: OpenSale[];
|
|
1795
|
+
currency: string;
|
|
1796
|
+
onSelect: (id: string) => void;
|
|
1797
|
+
onNew: () => void;
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* The open sales as cart tabs (v2 cart/tabs.tsx): who, then the Partly paid chip or else the total. The open sale's
|
|
1801
|
+
* tab is underlined even when it is the only one; a blank cart has no tab, the + cell is its tab and reads "New".
|
|
1802
|
+
*/
|
|
1803
|
+
declare function OpenSaleTabs({ sales, currency, onSelect, onNew }: OpenSaleTabsProps): JSX.Element;
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* What the customer sees on the second screen, laid out as WCPOS v2's default "Ledger" display
|
|
1807
|
+
* (Pro templates/display.html): idle shows the store; cart and payment show the items on the left and a panel on the
|
|
1808
|
+
* right with the totals, or the payment card.
|
|
1809
|
+
*/
|
|
1810
|
+
declare function CustomerDisplayScreen({ state }: {
|
|
1811
|
+
state: DisplayState;
|
|
1812
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1813
|
+
|
|
1529
1814
|
interface POSLayoutProps extends Omit<ViewProps, 'children'> {
|
|
1530
1815
|
browseSlot: ReactNode;
|
|
1531
1816
|
cartSlot: ReactNode;
|
|
@@ -1604,4 +1889,157 @@ interface StoreSettingsChoiceScreenProps extends Omit<ViewProps, 'children'> {
|
|
|
1604
1889
|
*/
|
|
1605
1890
|
declare function StoreSettingsChoiceScreen({ choices, initial, onSubmit, countryName, locale, title, body, regionLabel, countryLabel, channelLabel, submitLabel, className, ...viewProps }: StoreSettingsChoiceScreenProps): react_jsx_runtime.JSX.Element;
|
|
1606
1891
|
|
|
1607
|
-
|
|
1892
|
+
interface ShellNavItem {
|
|
1893
|
+
id: string;
|
|
1894
|
+
label: string;
|
|
1895
|
+
/** An icon element drawn in currentColor (`createSvgIcon`), 24 px. */
|
|
1896
|
+
icon: React$1.ReactNode;
|
|
1897
|
+
/** A count or short text on the icon's shoulder; nothing when undefined, 0 or ''. */
|
|
1898
|
+
badge?: number | string;
|
|
1899
|
+
/** `bottom` items sit in the group pinned to the end of the rail or drawer (v2's `marginTop: 'auto'`). */
|
|
1900
|
+
group?: 'top' | 'bottom';
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
interface AppShellProps {
|
|
1904
|
+
navItems: ShellNavItem[];
|
|
1905
|
+
activeId?: string;
|
|
1906
|
+
/** Routing is the app's: it maps the pressed item's id to its own route. */
|
|
1907
|
+
onNavigate: (id: string) => void;
|
|
1908
|
+
/** Drawn above the page (a `RegisterBar`); its menu button opens the drawer on phones. */
|
|
1909
|
+
registerBar?: React$1.ReactNode;
|
|
1910
|
+
children?: React$1.ReactNode;
|
|
1911
|
+
className?: string;
|
|
1912
|
+
testID?: string;
|
|
1913
|
+
}
|
|
1914
|
+
/** The POS frame: the nav rail beside the page on wide windows, a slide-over drawer on phones. */
|
|
1915
|
+
declare function AppShell({ navItems, activeId, onNavigate, registerBar, children, className, testID, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
1916
|
+
|
|
1917
|
+
interface NavRailProps {
|
|
1918
|
+
items: ShellNavItem[];
|
|
1919
|
+
activeId?: string;
|
|
1920
|
+
onNavigate: (id: string) => void;
|
|
1921
|
+
className?: string;
|
|
1922
|
+
testID?: string;
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* The wide layout's permanent icon column. Its width is 16 spacing units, the `h-12 w-12` item
|
|
1926
|
+
* plus 2 units each side (64 at Regular), so it follows the scale step as v2's does. Icon-only:
|
|
1927
|
+
* the label shows to the right on hover or keyboard focus, v2's web tooltip.
|
|
1928
|
+
*/
|
|
1929
|
+
declare function NavRail({ items, activeId, onNavigate, className, testID }: NavRailProps): react_jsx_runtime.JSX.Element;
|
|
1930
|
+
|
|
1931
|
+
interface NavDrawerProps {
|
|
1932
|
+
open: boolean;
|
|
1933
|
+
onOpenChange: (open: boolean) => void;
|
|
1934
|
+
items: ShellNavItem[];
|
|
1935
|
+
activeId?: string;
|
|
1936
|
+
onNavigate: (id: string) => void;
|
|
1937
|
+
/** Drawn above the items (a store name or logo). */
|
|
1938
|
+
header?: React$1.ReactNode;
|
|
1939
|
+
testID?: string;
|
|
1940
|
+
}
|
|
1941
|
+
/**
|
|
1942
|
+
* The phone's navigation: a 200-wide panel that slides over the screen from the left, v2's
|
|
1943
|
+
* `drawerType: 'front'`, with a backdrop that closes it. Pressing the current page only closes it.
|
|
1944
|
+
*/
|
|
1945
|
+
declare function NavDrawer({ open, onOpenChange, items, activeId, onNavigate, header, testID }: NavDrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
1946
|
+
|
|
1947
|
+
/**
|
|
1948
|
+
* The Sales room's cards over unit 10's figures. Port of WCPOS v2 `screens/main/reports/cards/`
|
|
1949
|
+
* (`card.tsx`, `primitives.tsx`, `orders.tsx`, `payments.tsx`, `top-products.tsx`,
|
|
1950
|
+
* `categories.tsx`, `taxes.tsx`, `refunds.tsx`); copy is v2's English (`core.json`). An unknown
|
|
1951
|
+
* figure (margin with no costed line, kept share of no sales) shows `—`, never 0.
|
|
1952
|
+
*/
|
|
1953
|
+
|
|
1954
|
+
type SalesCardId = 'orders' | 'payments' | 'products' | 'categories' | 'taxes' | 'refunds';
|
|
1955
|
+
interface SalesCardsProps {
|
|
1956
|
+
figures: SalesFigures;
|
|
1957
|
+
currency: string;
|
|
1958
|
+
/** Opens the card's panel. */
|
|
1959
|
+
onOpenCard?: (card: SalesCardId) => void;
|
|
1960
|
+
}
|
|
1961
|
+
declare function SalesCards({ figures, currency, onOpenCard }: SalesCardsProps): JSX.Element;
|
|
1962
|
+
|
|
1963
|
+
/**
|
|
1964
|
+
* The Sales room's filters: the period presets (worked out in store time by pos `presetRange`),
|
|
1965
|
+
* status, cashier and register. Port of WCPOS v2 `screens/main/reports/date-button.tsx` and the
|
|
1966
|
+
* filter choices in its `LEDGER.md`; copy is v2's English (`core.json`).
|
|
1967
|
+
*/
|
|
1968
|
+
|
|
1969
|
+
interface SalesOption {
|
|
1970
|
+
value: string;
|
|
1971
|
+
label: string;
|
|
1972
|
+
}
|
|
1973
|
+
interface SalesFilters {
|
|
1974
|
+
preset: DatePreset;
|
|
1975
|
+
range: DayRange;
|
|
1976
|
+
/** A single day's comparison: the day before or the same weekday last week. */
|
|
1977
|
+
compare: 'previous' | 'week';
|
|
1978
|
+
status: string;
|
|
1979
|
+
cashierId: string | null;
|
|
1980
|
+
registerId: string | null;
|
|
1981
|
+
}
|
|
1982
|
+
interface SalesFiltersBarProps {
|
|
1983
|
+
filters: SalesFilters;
|
|
1984
|
+
onFiltersChange: (next: SalesFilters) => void;
|
|
1985
|
+
/** IANA zone of the store, or 'device'. */
|
|
1986
|
+
timezone: string;
|
|
1987
|
+
/** The clock presets are worked out from; defaults to the time of the press. */
|
|
1988
|
+
now?: () => Date;
|
|
1989
|
+
statusOptions: SalesOption[];
|
|
1990
|
+
cashierOptions: SalesOption[];
|
|
1991
|
+
registerOptions: SalesOption[];
|
|
1992
|
+
}
|
|
1993
|
+
declare function SalesFiltersBar({ filters, onFiltersChange, timezone, now, statusOptions, cashierOptions, registerOptions, }: SalesFiltersBarProps): JSX.Element;
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* The Reports screen's Sales room: filters, hero and cards over one `SalesFigures` result.
|
|
1997
|
+
* Port of the WCPOS v2 Sales room layout (`screens/main/reports/`, `LEDGER.md`). It takes the
|
|
1998
|
+
* figures and the filter state as props; the screen works the figures out and owns the state.
|
|
1999
|
+
*/
|
|
2000
|
+
|
|
2001
|
+
interface SalesRoomProps extends SalesFiltersBarProps {
|
|
2002
|
+
figures: SalesFigures;
|
|
2003
|
+
currency: string;
|
|
2004
|
+
/** Opens a card's panel. */
|
|
2005
|
+
onOpenCard?: (card: SalesCardId) => void;
|
|
2006
|
+
}
|
|
2007
|
+
declare function SalesRoom({ figures, filters, onFiltersChange, currency, onOpenCard, ...bar }: SalesRoomProps): JSX.Element;
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* The Sales room's hero: the period's gross, its change against the comparison period and a
|
|
2011
|
+
* daily chart of both. Port of WCPOS v2 `screens/main/reports/hero/index.tsx` (`Difference`, the
|
|
2012
|
+
* companions Orders · Average order · Items) and the comparison labels of its `LEDGER.md`.
|
|
2013
|
+
* The bars are Views with theme token classes, so the chart takes its colours from the theme.
|
|
2014
|
+
*/
|
|
2015
|
+
|
|
2016
|
+
interface SalesHeroProps {
|
|
2017
|
+
figures: SalesFigures;
|
|
2018
|
+
filters: SalesFilters;
|
|
2019
|
+
onFiltersChange: (next: SalesFilters) => void;
|
|
2020
|
+
currency: string;
|
|
2021
|
+
}
|
|
2022
|
+
declare function SalesHero({ figures, filters, onFiltersChange, currency }: SalesHeroProps): JSX.Element;
|
|
2023
|
+
|
|
2024
|
+
type FontStatus = 'loading' | 'loaded' | 'failed';
|
|
2025
|
+
interface FontState {
|
|
2026
|
+
setId: TypeSetId;
|
|
2027
|
+
type: ThemeType;
|
|
2028
|
+
status: FontStatus;
|
|
2029
|
+
}
|
|
2030
|
+
interface FontProviderProps {
|
|
2031
|
+
/** The app's stored `ui.font` setting (from `useAppSettings` in `@tallyui/pos`); missing or unknown means Auto. */
|
|
2032
|
+
font?: string | null;
|
|
2033
|
+
/** The set Auto resolves to. Default `'system'`: TallyUI themes carry no type set. */
|
|
2034
|
+
autoTypeSet?: TypeSetId;
|
|
2035
|
+
/**
|
|
2036
|
+
* Registers the bundled faces of these families, e.g. with expo-font `loadAsync`. The app owns
|
|
2037
|
+
* the OFL files. Without a loader the faces are taken as already registered (e.g. web @font-face).
|
|
2038
|
+
*/
|
|
2039
|
+
loadFonts?: (families: ThemeFontFamily[]) => Promise<void>;
|
|
2040
|
+
children?: React$1.ReactNode;
|
|
2041
|
+
}
|
|
2042
|
+
declare function FontProvider({ font, autoTypeSet, loadFonts, children }: FontProviderProps): React$1.JSX.Element;
|
|
2043
|
+
declare function useFontType(): FontState;
|
|
2044
|
+
|
|
2045
|
+
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, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cart, type CartAction, CartBar, CartColumnHeads, type CartColumnHeadsProps, CartLine, CartLineActions, type CartLineActionsProps, type CartLineProps, CartNoteInput, type CartNoteInputProps, CartPanel, type CartPanelProps, CartTotal, type CartTotalProps, CashCountInput, type CashCountInputProps, CashTendered, type CashTenderedProps, Catalogue, type CategoryItem, CategoryNav, type CategoryNavProps, CategoryTile, type CategoryTileProps, ChangeDisplay, type ChangeDisplayProps, ChargeForm, type ChargeFormProps, Checkbox, CheckoutLayout, type CheckoutLayoutProps, 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, CustomerDisplayScreen, CustomerForm, type CustomerFormProps, type CustomerFormValues, CustomerOrderHistory, type CustomerOrderHistoryProps, CustomerPicker, type CustomerPickerProps, CustomerSelect, type CustomerSelectProps, DEFAULT_PRODUCT_FILTERS, 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, FilterChip, FilterChipGroup, type FilterChipGroupProps, type FilterChipProps, FontProvider, type FontProviderProps, type FontState, type FontStatus, HStack, type HStackProps, HandoverSlip, type HandoverSlipProps, HoverCard, HoverCardContent, HoverCardTrigger, Icon, IconButton, type IconButtonProps, type IconProps, InCartBadge, type InCartBadgeProps, Input, InputField, InputRoot, type InputRootProps, InputSlot, Label, type LabelProps, LiveTabScreen, type LiveTabScreenProps, type LiveTabScreenState, Loader, type LoaderProps, MovementSheet, type MovementSheetProps, NavDrawer, type NavDrawerProps, NavRail, type NavRailProps, OpenRegisterCard, type OpenRegisterCardProps, OpenSaleTabs, type OpenSaleTabsProps, OrderCard, type OrderCardProps, OrderDetail, type OrderDetailLineItem, type OrderDetailProps, 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, 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, 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, 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, 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, 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, ViewToggle, type ViewToggleProps, XIcon, avatarVariants, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, createSvgIcon, defaultProductColumns, describeRegisterBarPill, discountLabel, formatStockSyncTime, hstackVariants, iconButtonVariants, iconVariants, injectPrintStyle, loaderVariants, orderReference, parseDiscount, parsePrice, textVariants, toastVariants, toggleTextVariants, toggleVariants, useDefaultProductColumns, useFontType, useInputContext, usePointer, useScale, vstackVariants };
|