@fayz-ai/pos 0.20.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/LICENSE +21 -0
- package/README.md +44 -0
- package/dist/app/config.d.ts +238 -0
- package/dist/app/config.d.ts.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2638 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard/index.d.ts +3 -0
- package/dist/keyboard/index.d.ts.map +1 -0
- package/dist/lib/haptics.d.ts +3 -0
- package/dist/lib/haptics.d.ts.map +1 -0
- package/dist/lib/useSwipeAway.d.ts +18 -0
- package/dist/lib/useSwipeAway.d.ts.map +1 -0
- package/dist/screen/DeliveryBoard.d.ts +12 -0
- package/dist/screen/DeliveryBoard.d.ts.map +1 -0
- package/dist/screen/DispatchRail.d.ts +13 -0
- package/dist/screen/DispatchRail.d.ts.map +1 -0
- package/dist/screen/IdentitySheet.d.ts +7 -0
- package/dist/screen/IdentitySheet.d.ts.map +1 -0
- package/dist/screen/ModifierSheet.d.ts +13 -0
- package/dist/screen/ModifierSheet.d.ts.map +1 -0
- package/dist/screen/Notice.d.ts +21 -0
- package/dist/screen/Notice.d.ts.map +1 -0
- package/dist/screen/OpenTableSheet.d.ts +13 -0
- package/dist/screen/OpenTableSheet.d.ts.map +1 -0
- package/dist/screen/PinSheet.d.ts +9 -0
- package/dist/screen/PinSheet.d.ts.map +1 -0
- package/dist/screen/PosScreen.d.ts +96 -0
- package/dist/screen/PosScreen.d.ts.map +1 -0
- package/dist/screen/ReservationsView.d.ts +11 -0
- package/dist/screen/ReservationsView.d.ts.map +1 -0
- package/dist/screen/ShortcutsOverlay.d.ts +6 -0
- package/dist/screen/ShortcutsOverlay.d.ts.map +1 -0
- package/dist/screen/SplitSheet.d.ts +9 -0
- package/dist/screen/SplitSheet.d.ts.map +1 -0
- package/dist/screen/TicketRail.d.ts +36 -0
- package/dist/screen/TicketRail.d.ts.map +1 -0
- package/dist/screen/money.d.ts +11 -0
- package/dist/screen/money.d.ts.map +1 -0
- package/dist/screen/session.d.ts +105 -0
- package/dist/screen/session.d.ts.map +1 -0
- package/dist/screen/views.d.ts +51 -0
- package/dist/screen/views.d.ts.map +1 -0
- package/dist/styles.css +1664 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +53 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/tokens.d.ts +62 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keyboard/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACzF,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.d.ts","sourceRoot":"","sources":["../../src/lib/haptics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AACrE,YAAY,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Where the row rests once the trash is revealed. */
|
|
2
|
+
export declare const REVEAL_PX = 88;
|
|
3
|
+
export declare function useSwipeAway(onRemove: () => void): {
|
|
4
|
+
offset: number;
|
|
5
|
+
/** The row is parked showing its trash. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
removing: boolean;
|
|
8
|
+
close: () => void;
|
|
9
|
+
/** Tapping the revealed trash is the deliberate path to the same place. */
|
|
10
|
+
remove: () => void;
|
|
11
|
+
handlers: {
|
|
12
|
+
onPointerDown: (event: React.PointerEvent) => void;
|
|
13
|
+
onPointerMove: (event: React.PointerEvent) => void;
|
|
14
|
+
onPointerUp: () => void;
|
|
15
|
+
onPointerCancel: () => void;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useSwipeAway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSwipeAway.d.ts","sourceRoot":"","sources":["../../src/lib/useSwipeAway.ts"],"names":[],"mappings":"AAiBA,sDAAsD;AACtD,eAAO,MAAM,SAAS,KAAK,CAAA;AAI3B,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;;IAyD7C,2CAA2C;;;;IAI3C,2EAA2E;;;+BA9CnC,KAAK,CAAC,YAAY;+BAQlB,KAAK,CAAC,YAAY;;;;EA0C7D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DispatchStatus, PosPosition } from '../app/config';
|
|
2
|
+
export declare function DeliveryBoard({ orders, activeId, onSelect, now }: {
|
|
3
|
+
orders: PosPosition[];
|
|
4
|
+
activeId?: string;
|
|
5
|
+
onSelect: (p: PosPosition) => void;
|
|
6
|
+
now: number;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare const DISPATCH_LABEL: Record<DispatchStatus, string>;
|
|
9
|
+
/** The next step, and only the next one: a board where every card offers every
|
|
10
|
+
* status is a board where the operator picks the wrong one. */
|
|
11
|
+
export declare function nextDispatch(current: DispatchStatus): DispatchStatus | undefined;
|
|
12
|
+
//# sourceMappingURL=DeliveryBoard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeliveryBoard.d.ts","sourceRoot":"","sources":["../../src/screen/DeliveryBoard.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAqBhE,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;IACjE,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAClC,GAAG,EAAE,MAAM,CAAA;CACZ,+BAuGA;AAQD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAOzD,CAAA;AAED;gEACgE;AAChE,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS,CAIhF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PosPosition } from '../app/config';
|
|
2
|
+
import type { Ticket, TicketTotals } from './session';
|
|
3
|
+
export declare function DispatchRail({ order, ticket, totals, onAdvance, onCancel, now, open, containerRef, }: {
|
|
4
|
+
order: PosPosition;
|
|
5
|
+
ticket: Ticket;
|
|
6
|
+
totals: TicketTotals;
|
|
7
|
+
onAdvance: (to: NonNullable<PosPosition['dispatch']>) => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
now: number;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
containerRef?: React.Ref<HTMLElement>;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=DispatchRail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DispatchRail.d.ts","sourceRoot":"","sources":["../../src/screen/DispatchRail.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GACpE,EAAE;IACD,KAAK,EAAE,WAAW,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,KAAK,IAAI,CAAA;IAC7D,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CACtC,+BAkGA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PosPosition } from '../app/config';
|
|
2
|
+
export declare function IdentitySheet({ position, onCancel, onSave }: {
|
|
3
|
+
position: PosPosition;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
onSave: (alias: string, phone: string) => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=IdentitySheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentitySheet.d.ts","sourceRoot":"","sources":["../../src/screen/IdentitySheet.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAC5D,QAAQ,EAAE,WAAW,CAAA;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/C,+BAwEA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PickedModifier, PosItem } from '../app/config';
|
|
2
|
+
export declare function ModifierSheet({ item, onCancel, onConfirm, initial, mode }: {
|
|
3
|
+
item: PosItem;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
onConfirm: (picked: PickedModifier[], note: string) => void;
|
|
6
|
+
/** Prefills the sheet when reopening a line that is already on the ticket. */
|
|
7
|
+
initial?: {
|
|
8
|
+
modifiers?: PickedModifier[];
|
|
9
|
+
note?: string;
|
|
10
|
+
};
|
|
11
|
+
mode?: 'add' | 'edit';
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ModifierSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModifierSheet.d.ts","sourceRoot":"","sources":["../../src/screen/ModifierSheet.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5D,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAY,EAAE,EAAE;IAClF,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D,8EAA8E;IAC9E,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACzD,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACtB,+BAyIA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type NoticeTone = 'info' | 'ok' | 'warn';
|
|
2
|
+
/** One confirmation, shown once. A new object shows again even with the same
|
|
3
|
+
* text — repeating an action has to repeat the confirmation. */
|
|
4
|
+
export interface PosNotice {
|
|
5
|
+
text: string;
|
|
6
|
+
tone?: NoticeTone;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Confirmations land over the strip of open tables, not in a corner.
|
|
10
|
+
*
|
|
11
|
+
* The strip is the one band the operator is not reading while ringing, so
|
|
12
|
+
* covering it costs nothing — and it is a band, not a floating card, so the
|
|
13
|
+
* message arrives in the place the eye already returns to between taps.
|
|
14
|
+
* Blurring rather than hiding keeps the chips legible as shape, which is what
|
|
15
|
+
* says "this is passing" without any dismiss affordance to hunt for.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Notice({ notice, onDone }: {
|
|
18
|
+
notice?: PosNotice;
|
|
19
|
+
onDone: () => void;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
21
|
+
//# sourceMappingURL=Notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notice.d.ts","sourceRoot":"","sources":["../../src/screen/Notice.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAA;AAE/C;iEACiE;AACjE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAID;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,sCAqBpF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PosPosition, PosStaff, PosVocabulary } from '../app/config';
|
|
2
|
+
export declare function OpenTableSheet({ position, vocabulary, staff, defaultSeats, seatingName, onCancel, onConfirm, }: {
|
|
3
|
+
position: PosPosition;
|
|
4
|
+
vocabulary: PosVocabulary;
|
|
5
|
+
staff: PosStaff[];
|
|
6
|
+
defaultSeats?: number;
|
|
7
|
+
/** Set when a reservation is being seated — this sheet is then the CONFIRM
|
|
8
|
+
* step of that flow, and has to say whose party it is about to seat. */
|
|
9
|
+
seatingName?: string;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
onConfirm: (guests: number, attendantId?: string) => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=OpenTableSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenTableSheet.d.ts","sourceRoot":"","sources":["../../src/screen/OpenTableSheet.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEzE,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,GAC5E,EAAE;IACD,QAAQ,EAAE,WAAW,CAAA;IACrB,UAAU,EAAE,aAAa,CAAA;IACzB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;6EACyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1D,+BA+GA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PosStaff } from '../app/config';
|
|
2
|
+
export declare function PinSheet({ actionLabel, onCancel, onVerify, onGranted }: {
|
|
3
|
+
actionLabel: string;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
/** Returns the person who authorised, or null when the PIN is wrong. */
|
|
6
|
+
onVerify: (pin: string) => PosStaff | null | Promise<PosStaff | null>;
|
|
7
|
+
onGranted: (by: PosStaff) => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=PinSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinSheet.d.ts","sourceRoot":"","sources":["../../src/screen/PinSheet.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAI7C,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,wEAAwE;IACxE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IACrE,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,IAAI,CAAA;CAClC,+BAyFA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { DispatchStatus, PosAppConfig, PosCategory, PosItem, PosPosition, PosReservation, PosStaff } from '../app/config';
|
|
3
|
+
import { type Ticket, type TicketLine, type TicketTotals } from './session';
|
|
4
|
+
import { type PosNotice } from './Notice';
|
|
5
|
+
/**
|
|
6
|
+
* A bill at the moment the operator confirms it. Everything the app needs to
|
|
7
|
+
* settle it is here, so the handler never has to reach back into the screen.
|
|
8
|
+
*/
|
|
9
|
+
export interface PosBill {
|
|
10
|
+
ticket: Ticket;
|
|
11
|
+
totals: TicketTotals;
|
|
12
|
+
/** Which of `config.paymentMethods` was chosen. Never guessed. */
|
|
13
|
+
paymentMethodId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PosScreenProps {
|
|
16
|
+
config: PosAppConfig;
|
|
17
|
+
categories: PosCategory[];
|
|
18
|
+
items: PosItem[];
|
|
19
|
+
positions: PosPosition[];
|
|
20
|
+
staff?: PosStaff[];
|
|
21
|
+
reservations?: PosReservation[];
|
|
22
|
+
terminalName?: string;
|
|
23
|
+
operatorName?: string;
|
|
24
|
+
connection?: 'online' | 'reconnecting' | 'offline';
|
|
25
|
+
onAction?: (actionId: string) => void;
|
|
26
|
+
/** Fired when the operator opens a position, so the app can persist it. */
|
|
27
|
+
onOpenPosition?: (positionId: string, guests: number, attendantId?: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* The lines that just left the operator's hands for the kitchen. `sent` is
|
|
30
|
+
* only what moved on this press — a second fire must not print the first
|
|
31
|
+
* round again — while `ticket` is the whole comanda after it, which is what
|
|
32
|
+
* a header total has to be computed from.
|
|
33
|
+
*/
|
|
34
|
+
onFire?: (positionId: string, sent: TicketLine[], ticket: Ticket) => void | Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* The bill is being settled. Return `false` (or throw) and the ticket stays
|
|
37
|
+
* exactly where it is: a write that never reached the pool must not clear a
|
|
38
|
+
* table, because the next thing that happens is the guests walking out.
|
|
39
|
+
*/
|
|
40
|
+
onCloseBill?: (positionId: string, bill: PosBill) => boolean | void | Promise<boolean | void>;
|
|
41
|
+
/** A delivery order moved down the board. */
|
|
42
|
+
onDispatch?: (positionId: string, to: DispatchStatus) => void | Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Checks a PIN for an action that demands one. This package deliberately does
|
|
45
|
+
* NOT hash: a hand-rolled digest here would look like security and be
|
|
46
|
+
* theatre. Return the person who authorised, or null.
|
|
47
|
+
*/
|
|
48
|
+
verifyPin?: (pin: string, actionId: string) => PosStaff | null | Promise<PosStaff | null>;
|
|
49
|
+
/** Called after a gated action is authorised, with who released it. */
|
|
50
|
+
onAuthorised?: (actionId: string, by: PosStaff) => void;
|
|
51
|
+
/** Orders already open when the screen mounts, keyed by position id. */
|
|
52
|
+
initialTickets?: Record<string, TicketLine[]>;
|
|
53
|
+
/**
|
|
54
|
+
* A confirmation to show over the strip of open tables. Pass a NEW object to
|
|
55
|
+
* show it — the screen raises its own for what it does itself, and this is
|
|
56
|
+
* for what only the app knows (a write that reached the pool, or, for now,
|
|
57
|
+
* one that did not).
|
|
58
|
+
*/
|
|
59
|
+
notice?: PosNotice;
|
|
60
|
+
/**
|
|
61
|
+
* The product's own mark, in the operator plate.
|
|
62
|
+
*
|
|
63
|
+
* Without it the plate shows the first letter of `config.name` — right for a
|
|
64
|
+
* terminal that belongs to nobody's brand, wrong the moment the POS is opened
|
|
65
|
+
* from inside a product the operator was just looking at. `className` below
|
|
66
|
+
* is the other half: the host repaints the surface, this names it.
|
|
67
|
+
*/
|
|
68
|
+
brandMark?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Host chrome at the head of the POS's own rail, under the operator plate.
|
|
71
|
+
*
|
|
72
|
+
* For the control that says where this screen SITS — the counter opened from
|
|
73
|
+
* a back office puts its Balcão ⇄ Retaguarda switch here, in the column the
|
|
74
|
+
* host's menu occupied a second ago. A dedicated terminal passes nothing and
|
|
75
|
+
* the rail starts at "Operação", as before. Hidden on a narrow rail, where
|
|
76
|
+
* the labels would be crushed: there the way out is the host's own corner.
|
|
77
|
+
*/
|
|
78
|
+
railTop?: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* The wordmark beside the mark. Plain `config.name` unless the host has a
|
|
81
|
+
* lockup of its own — a product whose name carries two weights ("**Chef**
|
|
82
|
+
* Control") loses the distinction if the rail restates it in one.
|
|
83
|
+
*/
|
|
84
|
+
brandName?: ReactNode;
|
|
85
|
+
/**
|
|
86
|
+
* Added to the `.pos` root, so a host can restate the palette in its own
|
|
87
|
+
* colours by redeclaring the `--pos-*` variables under its class. It is the
|
|
88
|
+
* only theming seam: the POS keeps ONE design system and lets it be recoloured
|
|
89
|
+
* — it never accepts a second one.
|
|
90
|
+
*/
|
|
91
|
+
className?: string;
|
|
92
|
+
/** Injected in tests so elapsed times are not wall-clock dependent. */
|
|
93
|
+
now?: number;
|
|
94
|
+
}
|
|
95
|
+
export declare function PosScreen({ config, categories, items, positions, staff, reservations, terminalName, operatorName, connection, onAction, onOpenPosition, onFire, onCloseBill, onDispatch, verifyPin, onAuthorised, initialTickets, notice: appNotice, brandMark, brandName, className, railTop, now, }: PosScreenProps): import("react").JSX.Element;
|
|
96
|
+
//# sourceMappingURL=PosScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PosScreen.d.ts","sourceRoot":"","sources":["../../src/screen/PosScreen.tsx"],"names":[],"mappings":"AAWA,OAAO,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AS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EACpG,GAAgB,GACjB,EAAE,cAAc,+BAgrBhB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PosPosition, PosReservation } from '../app/config';
|
|
2
|
+
export declare function ReservationsView({ reservations, positions, now, onSeat, onMarkArrived, onOpenPosition, }: {
|
|
3
|
+
reservations: PosReservation[];
|
|
4
|
+
/** Used only to name the table a booking ended up at. */
|
|
5
|
+
positions: PosPosition[];
|
|
6
|
+
now: number;
|
|
7
|
+
onSeat: (reservation: PosReservation) => void;
|
|
8
|
+
onMarkArrived: (id: string) => void;
|
|
9
|
+
onOpenPosition: (positionId: string) => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=ReservationsView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReservationsView.d.ts","sourceRoot":"","sources":["../../src/screen/ReservationsView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAA;AAYnF,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,GACpE,EAAE;IACD,YAAY,EAAE,cAAc,EAAE,CAAA;IAC9B,yDAAyD;IACzD,SAAS,EAAE,WAAW,EAAE,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,CAAC,WAAW,EAAE,cAAc,KAAK,IAAI,CAAA;IAC7C,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7C,+BAuBA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortcutsOverlay.d.ts","sourceRoot":"","sources":["../../src/screen/ShortcutsOverlay.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAW9C,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IACrD,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,+BAsDA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Ticket, TicketTotals } from './session';
|
|
2
|
+
export declare function SplitSheet({ ticket, totals, guests, onCancel, onConfirm }: {
|
|
3
|
+
ticket: Ticket;
|
|
4
|
+
totals: TicketTotals;
|
|
5
|
+
guests?: number;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onConfirm: (parts: number[]) => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=SplitSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitSheet.d.ts","sourceRoot":"","sources":["../../src/screen/SplitSheet.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIrD,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAC1E,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACrC,+BA6IA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PosPaymentMethod, PosPositionStatus, PosVocabulary } from '../app/config';
|
|
2
|
+
import type { Ticket, TicketTotals } from './session';
|
|
3
|
+
export declare function TicketRail({ ticket, totals, vocabulary, paymentMethods, selectedPaymentId, onSelectPayment, onChangeQuantity, selectedLineId, onSelectLine, onClose, closeShortcut, guests, status, open, zoneLabel, request, now, containerRef, onBrowseCatalog, onEditLine, onEditIdentity, alias, customerPhone, onFire, fireShortcut, }: {
|
|
4
|
+
ticket: Ticket;
|
|
5
|
+
totals: TicketTotals;
|
|
6
|
+
vocabulary: PosVocabulary;
|
|
7
|
+
paymentMethods: PosPaymentMethod[];
|
|
8
|
+
selectedPaymentId?: string;
|
|
9
|
+
onSelectPayment: (id: string) => void;
|
|
10
|
+
onChangeQuantity: (lineId: string, delta: number) => void;
|
|
11
|
+
selectedLineId?: string;
|
|
12
|
+
onSelectLine: (lineId: string) => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
closeShortcut?: string;
|
|
15
|
+
guests?: number;
|
|
16
|
+
status?: PosPositionStatus;
|
|
17
|
+
zoneLabel?: string;
|
|
18
|
+
request?: string;
|
|
19
|
+
now?: number;
|
|
20
|
+
/** Small screens slide this rail in; wide ones ignore it. */
|
|
21
|
+
open?: boolean;
|
|
22
|
+
/** Lets the screen scope arrow navigation to this column. */
|
|
23
|
+
containerRef?: React.Ref<HTMLDivElement>;
|
|
24
|
+
/** An empty ticket's only useful action is going where the items are. */
|
|
25
|
+
onBrowseCatalog?: () => void;
|
|
26
|
+
/** Reopens a line for its options and note. */
|
|
27
|
+
onEditLine?: (lineId: string) => void;
|
|
28
|
+
/** Names the ticket and takes the customer's phone. */
|
|
29
|
+
onEditIdentity?: () => void;
|
|
30
|
+
alias?: string;
|
|
31
|
+
customerPhone?: string;
|
|
32
|
+
/** Sends the pending lines to the kitchen. */
|
|
33
|
+
onFire?: () => void;
|
|
34
|
+
fireShortcut?: string;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=TicketRail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TicketRail.d.ts","sourceRoot":"","sources":["../../src/screen/TicketRail.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,gBAAgB,EAA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AAG,CAAC,cAAc,CAAC,CAAA;IACxC,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,+CAA+C;IAC/C,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,+BAkPA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function formatCents(cents: number, currency?: string, locale?: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Split a total N ways without losing or inventing a centavo.
|
|
4
|
+
*
|
|
5
|
+
* 100,00 / 3 is 33,33 three times and one centavo left over. That centavo has
|
|
6
|
+
* to land somewhere and be seen to land somewhere: the remainder goes to the
|
|
7
|
+
* first shares, one each, so the parts always sum back to the whole.
|
|
8
|
+
*/
|
|
9
|
+
export declare function splitEvenly(totalCents: number, ways: number): number[];
|
|
10
|
+
export declare function serviceChargeCents(subtotalCents: number, percent: number): number;
|
|
11
|
+
//# sourceMappingURL=money.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../src/screen/money.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAQ,EAAE,MAAM,SAAU,GAAG,MAAM,CAErF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKtE;AAED,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjF"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { PickedModifier, PosItem } from '../app/config';
|
|
2
|
+
/**
|
|
3
|
+
* Where a line is in its life.
|
|
4
|
+
*
|
|
5
|
+
* `pending` is still on the operator's screen and can be changed freely.
|
|
6
|
+
* `fired` has been sent to the kitchen — changing it now means someone walks
|
|
7
|
+
* back there, which is why cancelling a fired line is a manager's PIN and not
|
|
8
|
+
* a minus button. `delivered` is on the table.
|
|
9
|
+
*/
|
|
10
|
+
export type LineState = 'pending' | 'fired' | 'delivered';
|
|
11
|
+
export interface TicketLine {
|
|
12
|
+
/** Client-generated so the line exists before any server round-trip. */
|
|
13
|
+
id: string;
|
|
14
|
+
itemId: string;
|
|
15
|
+
name: string;
|
|
16
|
+
/** What one of this line costs WITH its modifiers — frozen at add time. */
|
|
17
|
+
unitPriceCents: number;
|
|
18
|
+
/** The menu price before modifiers, kept so the bill can show the breakdown. */
|
|
19
|
+
basePriceCents?: number;
|
|
20
|
+
quantity: number;
|
|
21
|
+
note?: string;
|
|
22
|
+
modifiers?: PickedModifier[];
|
|
23
|
+
/** Defaults to 'pending' — a line nobody fired yet. */
|
|
24
|
+
state?: LineState;
|
|
25
|
+
/** When the kitchen got it. Drives the elapsed clock the expeditor reads. */
|
|
26
|
+
firedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Ticket {
|
|
29
|
+
id: string;
|
|
30
|
+
/** When the guests sat. Different from the first item, and both matter: a
|
|
31
|
+
* table seated 40 minutes ago with nothing fired is a table being ignored. */
|
|
32
|
+
seatedAt?: string;
|
|
33
|
+
positionId?: string;
|
|
34
|
+
positionLabel?: string;
|
|
35
|
+
attendantName?: string;
|
|
36
|
+
guests?: number;
|
|
37
|
+
lines: TicketLine[];
|
|
38
|
+
openedAt: string;
|
|
39
|
+
}
|
|
40
|
+
export interface TicketTotals {
|
|
41
|
+
subtotalCents: number;
|
|
42
|
+
serviceCents: number;
|
|
43
|
+
discountCents: number;
|
|
44
|
+
totalCents: number;
|
|
45
|
+
}
|
|
46
|
+
export type TicketAction = {
|
|
47
|
+
type: 'add_item';
|
|
48
|
+
item: PosItem;
|
|
49
|
+
lineId: string;
|
|
50
|
+
quantity?: number;
|
|
51
|
+
modifiers?: PickedModifier[];
|
|
52
|
+
note?: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'change_quantity';
|
|
55
|
+
lineId: string;
|
|
56
|
+
delta: number;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'remove_line';
|
|
59
|
+
lineId: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'set_note';
|
|
62
|
+
lineId: string;
|
|
63
|
+
note: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'edit_line';
|
|
66
|
+
lineId: string;
|
|
67
|
+
modifiers: PickedModifier[];
|
|
68
|
+
note?: string;
|
|
69
|
+
/** Base price, so the unit price can be recomputed from scratch. */
|
|
70
|
+
basePriceCents: number;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'remove_one_of';
|
|
73
|
+
itemId: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'fire';
|
|
76
|
+
at: string;
|
|
77
|
+
} | {
|
|
78
|
+
type: 'set_line_state';
|
|
79
|
+
lineId: string;
|
|
80
|
+
state: LineState;
|
|
81
|
+
} | {
|
|
82
|
+
type: 'clear';
|
|
83
|
+
};
|
|
84
|
+
export declare function ticketReducer(ticket: Ticket, action: TicketAction): Ticket;
|
|
85
|
+
export declare function totalsOf(ticket: Ticket, options?: {
|
|
86
|
+
serviceChargePercent?: number;
|
|
87
|
+
discountCents?: number;
|
|
88
|
+
}): TicketTotals;
|
|
89
|
+
export declare function emptyTicket(id: string, openedAt: string): Ticket;
|
|
90
|
+
/** Slot for a sale with no position — counter service, walk-up, takeaway. */
|
|
91
|
+
export declare const COUNTER_KEY = "__counter";
|
|
92
|
+
export type TicketBook = Record<string, Ticket>;
|
|
93
|
+
export type BookAction = {
|
|
94
|
+
type: 'at';
|
|
95
|
+
positionId: string;
|
|
96
|
+
action: TicketAction;
|
|
97
|
+
} | {
|
|
98
|
+
type: 'drop';
|
|
99
|
+
positionId: string;
|
|
100
|
+
};
|
|
101
|
+
export declare function bookReducer(book: TicketBook, action: BookAction): TicketBook;
|
|
102
|
+
export declare function ticketAt(book: TicketBook, positionId: string | undefined): Ticket;
|
|
103
|
+
/** Item counts per position — what the floor and the dock read at a glance. */
|
|
104
|
+
export declare function countsOf(book: TicketBook): Record<string, number>;
|
|
105
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/screen/session.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5D;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAA;AAEzD,MAAM,WAAW,UAAU;IACzB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAA;IACtB,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,cAAc,EAAE,CAAA;IAC5B,uDAAuD;IACvD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAA;IACV;mFAC+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,C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A;CAAE,CAAA;AAErB,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CA4G1E;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACtE,YAAY,CAYd;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAWD,6EAA6E;AAC7E,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE/C,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAExC,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAc5E;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGjF;AAED,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMjE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Search } from 'lucide-react';
|
|
2
|
+
import type { PosCategory, PosItem, PosPosition, PosPositionConfig, PosPositionStatus, PosStaff } from '../app/config';
|
|
3
|
+
/** Colour never carries the meaning alone: icon and word ride along. */
|
|
4
|
+
export declare function StatusBadge({ status }: {
|
|
5
|
+
status: PosPositionStatus;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function elapsed(openedAt?: string, now?: number): string | undefined;
|
|
8
|
+
export declare function EmptyState({ title, hint, Icon, action }: {
|
|
9
|
+
title: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
Icon?: typeof Search;
|
|
12
|
+
/** An empty state that only apologises wastes the space it takes. */
|
|
13
|
+
action?: {
|
|
14
|
+
label: string;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
};
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function FloorView({ positions, config, activeId, onSelect, now, picking }: {
|
|
19
|
+
positions: PosPosition[];
|
|
20
|
+
config: PosPositionConfig;
|
|
21
|
+
activeId?: string;
|
|
22
|
+
onSelect: (p: PosPosition) => void;
|
|
23
|
+
now: number;
|
|
24
|
+
/** A party is waiting: only the free tables are answers to the question. */
|
|
25
|
+
picking?: boolean;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
/** Two letters is what fits on a table at plan scale, and it is what a floor
|
|
28
|
+
* manager already reads on a printed roster. */
|
|
29
|
+
export declare function initialsOf(name: string): string;
|
|
30
|
+
export declare function CatalogView({ categories, items, activeCategoryId, onCategoryChange, quantities, onAdd, onRemove, query, }: {
|
|
31
|
+
categories: PosCategory[];
|
|
32
|
+
items: PosItem[];
|
|
33
|
+
activeCategoryId?: string;
|
|
34
|
+
onCategoryChange: (id: string) => void;
|
|
35
|
+
quantities: Record<string, number>;
|
|
36
|
+
onAdd: (item: PosItem) => void;
|
|
37
|
+
onRemove: (item: PosItem) => void;
|
|
38
|
+
query: string;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
export declare function ListView({ positions, activeId, onSelect, now, emptyLabel }: {
|
|
41
|
+
positions: PosPosition[];
|
|
42
|
+
activeId?: string;
|
|
43
|
+
onSelect: (p: PosPosition) => void;
|
|
44
|
+
now: number;
|
|
45
|
+
emptyLabel: string;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
47
|
+
export declare function ShiftView({ positions, staff }: {
|
|
48
|
+
positions: PosPosition[];
|
|
49
|
+
staff: PosStaff[];
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../src/screen/views.tsx"],"names":[],"mappings":"AAOA,OAAO,EACqD,MAAM,EACjE,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EACV,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,QAAQ,EAClF,MAAM,eAAe,CAAA;AAWtB,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,iBAAiB,CAAA;CAAE,+BAQpE;AAED,wBAAgB,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,MAAM,GAAG,SAAS,CAK/E;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAa,EAAE,MAAM,EAAE,EAAE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,MAAM,CAAA;IACpB,qEAAqE;IACrE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;CAChD,+BAaA;AAMD,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IACjF,SAAS,EAAE,WAAW,EAAE,CAAA;IACxB,MAAM,EAAE,iBAAiB,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAClC,GAAG,EAAE,MAAM,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