@retalia/pos-components 0.0.8 → 0.0.9
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/README.md +67 -7
- package/fesm2022/retalia-pos-components.mjs +267 -106
- package/fesm2022/retalia-pos-components.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/styles.css +1 -0
- package/styles/tokens.css +21 -15
- package/types/retalia-pos-components.d.ts +95 -23
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ Add the package stylesheet once in the host app (e.g. `angular.json` `styles`):
|
|
|
53
53
|
node_modules/@retalia/pos-components/styles/styles.css
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Theme via CSS custom properties (`--pos-*`) defined in that file. Override tokens in the host to rebrand; values not exposed as tokens are not overridable without a library change.
|
|
56
|
+
Theme via CSS custom properties (`--pos-*`) defined in that file. Override tokens in the host to rebrand; values not exposed as tokens are not overridable without a library change. Brand wordmarks use `--pos-letter-spacing-brand`, tight titles use `--pos-letter-spacing-tight`, keypad keys use `--pos-shadow-key`, and menus use `--pos-shadow-overlay`. The masked PIN keeps `--pos-letter-spacing-display`.
|
|
57
57
|
|
|
58
58
|
Use `<pos-tokens>` (Storybook: **Theme / Tokens**, or an internal theme lab page) to see every token in action. Click a sample or token to edit values as **live overrides** — this does not change the package defaults in `styles.css`. Export a complete `:root` CSS file for the consuming POS, and import that file back into the lab later.
|
|
59
59
|
|
|
@@ -87,7 +87,7 @@ src/styles/pos-theme.css
|
|
|
87
87
|
|
|
88
88
|
## Login
|
|
89
89
|
|
|
90
|
-
Keypad login UI — presentational only. It does not call auth services.
|
|
90
|
+
Keypad login UI — presentational only. It does not call auth services.
|
|
91
91
|
|
|
92
92
|
The host envelope holds login/session state and passes it in. If the host uses a package `AuthService`, it calls that on `login.submit`, then updates `[session]` / `[errorMessage]`. The component never injects the service.
|
|
93
93
|
|
|
@@ -131,11 +131,16 @@ export class App {
|
|
|
131
131
|
| Selector | `pos-login` |
|
|
132
132
|
| Input `session` | Display-only login/session state: `signedOut` \| `busy` \| `signedIn`, optional `displayName` |
|
|
133
133
|
| Input `errorMessage` | Optional error text |
|
|
134
|
+
| Input `showAside` | Shop context beside the keypad. Default `true`. Set `false` for the keypad alone |
|
|
135
|
+
| Input `bordered` | Frame around the login shell. Default `false` |
|
|
136
|
+
| Input `showBrandImage`, `brandImage`, `brandLabel` | Same brand rules as the header. `brandLabel` defaults to `RETALIA`. Empty hides the word. Empty `brandImage` uses the built-in mark |
|
|
137
|
+
| Input `locationName`, `terminalLine`, `shopName`, `posNumber` | Defaults `Address1`, `Address2`, `shop 1`, and `001`. Empty hides that line or tile |
|
|
138
|
+
| Date | Always the PC's local date. `dateLabel` is the caption only |
|
|
134
139
|
| Output `action` | Typed intents: `login.key`, `login.next`, `login.submit`, `login.back`, … |
|
|
135
140
|
|
|
136
141
|
## Basket
|
|
137
142
|
|
|
138
|
-
Presentational sale basket — renders `basket.lines[]` and `totals` exactly as the host envelope provides them. It does not price, tax, or discount. Quantity
|
|
143
|
+
Presentational sale basket — renders `basket.lines[]` and `totals` exactly as the host envelope provides them. It does not price, tax, or discount. Quantity and void only emit intents; the host (or server) updates the envelope. Clearing the sale is a transaction action bar control, not a basket button. The host still dispatches `basket.clear`.
|
|
139
144
|
|
|
140
145
|
```ts
|
|
141
146
|
import { Component, signal } from '@angular/core';
|
|
@@ -172,7 +177,7 @@ export class Sale {
|
|
|
172
177
|
// Host envelope binding maps:
|
|
173
178
|
// basket.changeQuantity → change-quantity
|
|
174
179
|
// basket.voidLine → void-line
|
|
175
|
-
//
|
|
180
|
+
// Clear sale (`basket.clear`) is dispatched from the transaction action bar.
|
|
176
181
|
}
|
|
177
182
|
}
|
|
178
183
|
```
|
|
@@ -183,7 +188,54 @@ export class Sale {
|
|
|
183
188
|
| Input `lines` | Envelope `basket.lines[]` as given (`lineId`, `sku`, `name`, `qty`, `unitPrice`, `lineTotal`, `vat`, `struckThrough`) |
|
|
184
189
|
| Input `totals` | Envelope `totals` as given (`gross`, `net`, `vat`, `discount`, `due`, `currency`) |
|
|
185
190
|
| Input `disabled` | Optional lock while the host is busy |
|
|
186
|
-
|
|
|
191
|
+
| Input `bordered` | Panel frame. Default `false` |
|
|
192
|
+
| Output `action` | Typed intents: `basket.changeQuantity`, `basket.voidLine`. `basket.clear` remains a host intent for the action bar |
|
|
193
|
+
|
|
194
|
+
## Header
|
|
195
|
+
|
|
196
|
+
Placeable sale chrome. The host passes the title, shop or other context, and clerk name. The menu beside the clerk initial currently offers sign out only. That click emits an intent; the host clears the session and navigates. The component does not know where it sits in the layout.
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<pos-header
|
|
200
|
+
[clerkName]="clerkName()"
|
|
201
|
+
[clerkRole]="clerkRole()"
|
|
202
|
+
[disabled]="busy()"
|
|
203
|
+
(action)="onHeader($event)"
|
|
204
|
+
/>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
| | |
|
|
208
|
+
|---|---|
|
|
209
|
+
| Selector | `pos-header` |
|
|
210
|
+
| Input `showBrandImage` | Shows an image before the wordmark. Defaults to true. False hides the image, including the built-in mark |
|
|
211
|
+
| Input `brandImage` | Image URL. Empty, while the image is shown, uses the built-in Retalia mark |
|
|
212
|
+
| Input `brandLabel` | Text after the image. Empty shows no text |
|
|
213
|
+
| Input `title` | Screen title. Omitted from the bar when empty |
|
|
214
|
+
| Input `context` | Secondary label, such as the shop name |
|
|
215
|
+
| Input `clerkName` | Signed-in clerk. The bar shows an initial and the name, and hides the block when empty |
|
|
216
|
+
| Input `clerkRole` | Role label under the name, such as Clerk or Manager. Shown in lowercase |
|
|
217
|
+
| Input `signOutLabel` | Menu item label. Defaults to `Portal Logout` |
|
|
218
|
+
| Input `menuLabel` | Accessible name for the menu button. Defaults to `Menu` |
|
|
219
|
+
| Input `canSignOut` | Hides the menu button when false |
|
|
220
|
+
| Input `disabled` | Disables sign out while the host is busy |
|
|
221
|
+
| Output `action` | `header.signOut` |
|
|
222
|
+
|
|
223
|
+
## Transaction action bar
|
|
224
|
+
|
|
225
|
+
Layout container for sale commands. It does not render buttons or emit intents. The host projects the controls and decides what each one does, including mapping Cancel to `basket.clear`.
|
|
226
|
+
|
|
227
|
+
```html
|
|
228
|
+
<pos-transaction-action-bar>
|
|
229
|
+
<button type="button" (click)="onCancel()">Cancel</button>
|
|
230
|
+
<button type="button" (click)="onCash()">Cash</button>
|
|
231
|
+
</pos-transaction-action-bar>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
| | |
|
|
235
|
+
|---|---|
|
|
236
|
+
| Selector | `pos-transaction-action-bar` |
|
|
237
|
+
| Content | Projected controls. The bar lays them out in a wrapping row |
|
|
238
|
+
| Output | None. Clicks stay on the projected controls |
|
|
187
239
|
|
|
188
240
|
## Item entry
|
|
189
241
|
|
|
@@ -219,13 +271,20 @@ export class Sale {
|
|
|
219
271
|
|---|---|
|
|
220
272
|
| Selector | `pos-item-entry` |
|
|
221
273
|
| Input `disabled` | Optional lock while the host is busy (e.g. AddItem in flight) |
|
|
274
|
+
| Input `bordered` | Panel frame. Default `false` |
|
|
222
275
|
| Input `errorMessage` | Optional host-provided error text (lookup failures belong to the host) |
|
|
276
|
+
| Input `label` | Accessible name for the field. Default `Item`. Not shown on the bar |
|
|
223
277
|
| Input `autofocus` | Focus the field on render so a scanner can type immediately (default `true`) |
|
|
278
|
+
| Input `placeholder` | Field hint. Default `Scan barcode, search products` |
|
|
279
|
+
| Input `scannerStatus` | Status in the chip at the right of the field. Default `scanner ready` |
|
|
280
|
+
| Input `focusHotkey` | Key that focuses the field, shown beside the chip. Default `F2`. Empty hides the hint and the shortcut |
|
|
224
281
|
| Output `action` | Typed intent: `itemEntry.submit` with `reference` |
|
|
225
282
|
|
|
283
|
+
Enter in the field submits the reference. `F2` moves focus back to the field from anywhere else on the page, matching the POS proof of concept. The label is the accessible name and is not shown on the bar.
|
|
284
|
+
|
|
226
285
|
## Tender
|
|
227
286
|
|
|
228
|
-
Presentational cash tender —
|
|
287
|
+
Presentational cash tender — coins, notes, and quick amounts build the amount given. Pay Now emits `tender.cash`. Cancel emits `tender.cancel`. The host envelope sends the cash intent and passes back `changeDue`. The component never calculates change or takes payment. Card / electronic tender is out of scope.
|
|
229
288
|
|
|
230
289
|
```ts
|
|
231
290
|
import { Component, signal } from '@angular/core';
|
|
@@ -272,7 +331,7 @@ export class Tender {
|
|
|
272
331
|
| Input `currency` | ISO currency code used only for display formatting |
|
|
273
332
|
| Input `disabled` | Optional lock while the host is busy |
|
|
274
333
|
| Input `errorMessage` | Optional error text |
|
|
275
|
-
| Output `action` |
|
|
334
|
+
| Output `action` | `tender.cash` with the amount given, or `tender.cancel` |
|
|
276
335
|
|
|
277
336
|
## Receipt
|
|
278
337
|
|
|
@@ -335,4 +394,5 @@ export class Receipt {
|
|
|
335
394
|
| Input `payments` | Envelope `payments[]` as given (`tender`, `amount`, `tendered`, `change`, `state`) |
|
|
336
395
|
| Input `document` | Envelope `document` as given (`number`, `receiptReady`) |
|
|
337
396
|
| Input `disabled` | Optional lock while the host is busy |
|
|
397
|
+
| Input `bordered` | Panel frame. Default `false` |
|
|
338
398
|
| Output `action` | Typed intent: `receipt.newSale` |
|