@retalia/pos-components 0.0.15 → 0.0.17
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
CHANGED
|
@@ -101,6 +101,85 @@ export class App {
|
|
|
101
101
|
| Input `locationName`, `terminalLine`, `shopName`, `posNumber` | Defaults `Address1`, `Address2`, `shop 1`, and `001`. Empty hides that line or tile |
|
|
102
102
|
| Date | Always the PC's local date. `dateLabel` is the caption only |
|
|
103
103
|
| Output `action` | Typed intents: `login.key`, `login.next`, `login.submit`, `login.back`, … |
|
|
104
|
+
| Slot `[posLoginAside]` | Partner content in the shop column, after the date and POS number. Hidden when empty. Import `PosLoginAside` |
|
|
105
|
+
| Slot `[posLoginPanel]` | Partner content under the keypad. Hidden when empty. Import `PosLoginPanel` |
|
|
106
|
+
|
|
107
|
+
Connectors, settings, and other partner tools are not built into the keypad. Project them into the slots. A partner who does not use connectors leaves both slots empty.
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<pos-login>
|
|
111
|
+
<pos-till-devices
|
|
112
|
+
posLoginAside
|
|
113
|
+
variant="summary"
|
|
114
|
+
[devices]="paymentDevices()"
|
|
115
|
+
[selectedId]="selectedDeviceId()"
|
|
116
|
+
(action)="onTillDevices($event)"
|
|
117
|
+
/>
|
|
118
|
+
<pos-till-devices
|
|
119
|
+
posLoginPanel
|
|
120
|
+
variant="link"
|
|
121
|
+
[devices]="paymentDevices()"
|
|
122
|
+
[selectedId]="selectedDeviceId()"
|
|
123
|
+
(action)="onTillDevices($event)"
|
|
124
|
+
/>
|
|
125
|
+
</pos-login>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The same slots accept any partner content, including a `pos-workspace` when that column should be arranged like the selling screen.
|
|
129
|
+
|
|
130
|
+
## Till devices
|
|
131
|
+
|
|
132
|
+
Connector picker for the till. The host passes the connectors — usually the `paymentDevices` entries from POS config — and stores the id the clerk confirms. The component does not read config or call the SDK.
|
|
133
|
+
|
|
134
|
+
`summary` is the shop-column tile. `link` is the control under the keypad (`Select connector` until one is chosen, then `Till devices`). Either opens the same popup. `dialog` is the popup on its own, for a host that already has a trigger.
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { Component, signal } from '@angular/core';
|
|
138
|
+
import {
|
|
139
|
+
PosTillDevices,
|
|
140
|
+
posTillDeviceKey,
|
|
141
|
+
type PosTillDevice,
|
|
142
|
+
type PosTillDevicesIntent,
|
|
143
|
+
} from '@retalia/pos-components';
|
|
144
|
+
|
|
145
|
+
@Component({
|
|
146
|
+
selector: 'app-till-devices',
|
|
147
|
+
imports: [PosTillDevices],
|
|
148
|
+
template: `
|
|
149
|
+
<pos-till-devices
|
|
150
|
+
[devices]="devices()"
|
|
151
|
+
[selectedId]="selectedId()"
|
|
152
|
+
(action)="onTillDevices($event)"
|
|
153
|
+
/>
|
|
154
|
+
`,
|
|
155
|
+
})
|
|
156
|
+
export class TillDevices {
|
|
157
|
+
readonly devices = signal<readonly PosTillDevice[]>([]);
|
|
158
|
+
readonly selectedId = signal('');
|
|
159
|
+
|
|
160
|
+
onTillDevices(intent: PosTillDevicesIntent): void {
|
|
161
|
+
if (intent.type === 'tillDevices.confirm') {
|
|
162
|
+
this.selectedId.set(intent.deviceId);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
A config entry can be passed through as-is. `selectedId` is `deviceId` when that field is set, otherwise `String(id)` (`posTillDeviceKey`).
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
const selected = posTillDeviceKey(paymentDevices[0]);
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| | |
|
|
175
|
+
| --- | --- |
|
|
176
|
+
| Selector | `pos-till-devices` |
|
|
177
|
+
| Input `devices` | Connectors to show. `terminalType` `0` reads as no payment device. `isVirtual` reads as a virtual connector. Optional `printerLabel`, `paymentLabel`, `kind`, and `online` fill the card when the host has them |
|
|
178
|
+
| Input `selectedId` | Connector already stored for this till. Empty shows the setup state on `summary` and `link` |
|
|
179
|
+
| Input `variant` | `dialog` (default), `summary`, or `link` |
|
|
180
|
+
| Input `icon` | `plug` draws the link as a button with the connector icon. Default `none` |
|
|
181
|
+
| Input `disabled` | Locks the trigger and the cards |
|
|
182
|
+
| Output `action` | `tillDevices.open`, `tillDevices.select`, `tillDevices.confirm`, `tillDevices.dismiss` |
|
|
104
183
|
|
|
105
184
|
## Basket
|
|
106
185
|
|