@alfadocs/ui-kit 1.130.2 → 1.132.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.
Files changed (100) hide show
  1. package/dist/_chunks/{address-autocomplete-D2uNpxcE.js → address-autocomplete-yDLqg43e.js} +2 -2
  2. package/dist/_chunks/{address-fields-BU65pA-V.js → address-fields-DvSWdeR0.js} +2 -2
  3. package/dist/_chunks/bill-line-table-DHKb_O7c.js +2000 -0
  4. package/dist/_chunks/{data-grid-C9xlUMLt.js → data-grid-B2oaI7Lt.js} +2345 -2328
  5. package/dist/_chunks/{default-tabs-BryvhiHv.js → default-tabs-DbebYO04.js} +3 -3
  6. package/dist/_chunks/{invoice-upload-list-868v1oDe.js → invoice-upload-list-B5aMffTy.js} +21 -21
  7. package/dist/_chunks/map-view-Cm69dCnY.js +1794 -0
  8. package/dist/_chunks/{maps-core-gate-DKx96CC_.js → maps-core-gate-CP8SEHH1.js} +97 -93
  9. package/dist/_chunks/{practice-results-M5A9-X9y.js → practice-results-DaxGw9_f.js} +762 -748
  10. package/dist/_chunks/{reserved.agent-BBuWWtYb.js → reserved.agent-W8mR179D.js} +2 -2
  11. package/dist/_chunks/{toolbar-BK6S9PhI.js → toolbar-CfdoJzMV.js} +2 -2
  12. package/dist/_chunks/{warehouse-load-summary-DkAKXcw0.js → warehouse-load-summary-CMMYzTDv.js} +75 -66
  13. package/dist/agent-catalog.json +34 -11
  14. package/dist/agent-i18n/en.json +6 -4
  15. package/dist/browser-support.js +1 -1
  16. package/dist/components/_shared/decimal.d.ts +2 -0
  17. package/dist/components/address-autocomplete/index.js +1 -1
  18. package/dist/components/address-fields/index.js +1 -1
  19. package/dist/components/bill-line-table/bill-line-table.columns.d.ts +4 -0
  20. package/dist/components/bill-line-table/bill-line-table.header.d.ts +6 -0
  21. package/dist/components/bill-line-table/bill-line-table.invoice-cell.d.ts +6 -0
  22. package/dist/components/bill-line-table/bill-line-table.model.d.ts +23 -10
  23. package/dist/components/bill-line-table/bill-line-table.scope.d.ts +56 -0
  24. package/dist/components/bill-line-table/bill-line-table.types.d.ts +90 -10
  25. package/dist/components/bill-line-table/bill-line-table.variants.d.ts +2 -0
  26. package/dist/components/bill-line-table/index.d.ts +3 -2
  27. package/dist/components/bill-line-table/index.js +20 -18
  28. package/dist/components/bill-table/index.js +1 -1
  29. package/dist/components/booking/index.js +1 -1
  30. package/dist/components/data-grid/index.js +2 -2
  31. package/dist/components/data-grid/types.d.ts +6 -0
  32. package/dist/components/invoice-upload-list/index.js +1 -1
  33. package/dist/components/map-view/index.d.ts +1 -1
  34. package/dist/components/map-view/index.js +1 -1
  35. package/dist/components/map-view/map-view.d.ts +42 -1
  36. package/dist/components/practice-results/index.js +1 -1
  37. package/dist/components/practice-results/practice-results.d.ts +12 -1
  38. package/dist/components/warehouse-load-summary/index.js +1 -1
  39. package/dist/core.css +1 -1
  40. package/dist/decimal/index.js +32 -28
  41. package/dist/host-compat.css +7 -1
  42. package/dist/i18n/locales/ar.d.ts +2 -0
  43. package/dist/i18n/locales/ar.js +3 -1
  44. package/dist/i18n/locales/de.d.ts +2 -0
  45. package/dist/i18n/locales/de.js +3 -1
  46. package/dist/i18n/locales/el.d.ts +2 -0
  47. package/dist/i18n/locales/el.js +3 -1
  48. package/dist/i18n/locales/en.d.ts +2 -0
  49. package/dist/i18n/locales/en.js +3 -1
  50. package/dist/i18n/locales/es.d.ts +2 -0
  51. package/dist/i18n/locales/es.js +3 -1
  52. package/dist/i18n/locales/fr.d.ts +2 -0
  53. package/dist/i18n/locales/fr.js +3 -1
  54. package/dist/i18n/locales/hi.d.ts +2 -0
  55. package/dist/i18n/locales/hi.js +3 -1
  56. package/dist/i18n/locales/it.d.ts +2 -0
  57. package/dist/i18n/locales/it.js +3 -1
  58. package/dist/i18n/locales/ja.d.ts +2 -0
  59. package/dist/i18n/locales/ja.js +3 -1
  60. package/dist/i18n/locales/nl.d.ts +2 -0
  61. package/dist/i18n/locales/nl.js +3 -1
  62. package/dist/i18n/locales/pl.d.ts +2 -0
  63. package/dist/i18n/locales/pl.js +3 -1
  64. package/dist/i18n/locales/pt.d.ts +2 -0
  65. package/dist/i18n/locales/pt.js +3 -1
  66. package/dist/i18n/locales/ro.d.ts +2 -0
  67. package/dist/i18n/locales/ro.js +3 -1
  68. package/dist/i18n/locales/ru.d.ts +2 -0
  69. package/dist/i18n/locales/ru.js +3 -1
  70. package/dist/i18n/locales/sq.d.ts +2 -0
  71. package/dist/i18n/locales/sq.js +3 -1
  72. package/dist/i18n/locales/sv.d.ts +2 -0
  73. package/dist/i18n/locales/sv.js +3 -1
  74. package/dist/i18n/locales/tr.d.ts +2 -0
  75. package/dist/i18n/locales/tr.js +3 -1
  76. package/dist/i18n/locales/zh.d.ts +2 -0
  77. package/dist/i18n/locales/zh.js +3 -1
  78. package/dist/index.js +1062 -1060
  79. package/dist/locales/ar.json +3 -1
  80. package/dist/locales/de.json +3 -1
  81. package/dist/locales/el.json +3 -1
  82. package/dist/locales/en.json +3 -1
  83. package/dist/locales/es.json +3 -1
  84. package/dist/locales/fr.json +3 -1
  85. package/dist/locales/hi.json +3 -1
  86. package/dist/locales/it.json +3 -1
  87. package/dist/locales/ja.json +3 -1
  88. package/dist/locales/nl.json +3 -1
  89. package/dist/locales/pl.json +3 -1
  90. package/dist/locales/pt.json +3 -1
  91. package/dist/locales/ro.json +3 -1
  92. package/dist/locales/ru.json +3 -1
  93. package/dist/locales/sq.json +3 -1
  94. package/dist/locales/sv.json +3 -1
  95. package/dist/locales/tr.json +3 -1
  96. package/dist/locales/zh.json +3 -1
  97. package/dist/tokens.css +1 -1
  98. package/package.json +1 -1
  99. package/dist/_chunks/bill-line-table-CzYzg-Qh.js +0 -1757
  100. package/dist/_chunks/map-view-DkL58SRp.js +0 -1613
@@ -1,5 +1,6 @@
1
1
  import { type DecimalString, type ScaledDecimal } from '../_shared/decimal';
2
- import type { BillDocumentKind, BillLine, BillLineInfo, BillLineItemChoice, BillLineItemOption, BillLineItemUpdateChange, BillLineLoadResult, BillLineMatchState, BillLineRow, BillLineSummary, BillLineValue, BillLineValues } from './bill-line-table.types';
2
+ import type { BillDocumentKind, BillLine, BillLineInfo, BillLineItemChoice, BillLineItemOption, BillLineItemUpdateChange, BillLineInvoiceLoadResult, BillLineLoadResult, BillLineMatchState, BillLineRow, BillLineSummary, BillLineValue, BillLineValues } from './bill-line-table.types';
3
+ import { type BillLineScope } from './bill-line-table.scope';
3
4
  /** Most fraction digits of a quantity: FatturaPA 2.2.1.5 `Quantita`
4
5
  * (`[0-9]{1,12}\.[0-9]{2,8}`, quoted in `Version20260608180319.php:38`). */
5
6
  export declare const BILL_LINE_QUANTITY_FRACTION_DIGITS = 8;
@@ -90,15 +91,16 @@ export declare function isBillInvoiceLoaded(lines: readonly BillLine[]): boolean
90
91
  * question Q3 on lab lines that name a patient). */
91
92
  export declare function getDefaultBillLineValue(line: BillLine): BillLineValue;
92
93
  export declare function getDefaultBillLineValues(lines: readonly BillLine[]): Record<string, BillLineValue>;
93
- /** Every line that can load and was not proposed as skip. None once the
94
- * invoice is loaded. */
95
- export declare function getDefaultBillLineSelection(lines: readonly BillLine[]): string[];
94
+ /** Every line that can load and was not proposed as skip. None of a loaded
95
+ * invoice. */
96
+ export declare function getDefaultBillLineSelection(lines: readonly BillLine[], scope?: BillLineScope): string[];
96
97
  /** Every current line's value, missing entries as their default; entries
97
98
  * for lines no longer in `lines` are dropped. */
98
99
  export declare function resolveBillLineValues(lines: readonly BillLine[], values: BillLineValues): Record<string, BillLineValue>;
99
100
  /** The ids that are ticked in effect: known, tickable lines only, unique,
100
- * in invoice order. */
101
- export declare function resolveBillLineSelection(lines: readonly BillLine[], selection: readonly string[]): string[];
101
+ * in invoice order. A line is not tickable when it, or any line of its
102
+ * invoice, is already loaded (D8). */
103
+ export declare function resolveBillLineSelection(lines: readonly BillLine[], selection: readonly string[], scope?: BillLineScope): string[];
102
104
  /** Same value whatever the scale ("2.50" equals "2.5"). */
103
105
  export declare function sameBillLineValue(a: BillLineValue, b: BillLineValue): boolean;
104
106
  /** What Confirm will do with the line (D3): the badge cannot disagree with
@@ -142,20 +144,28 @@ export interface BillLineDefaults {
142
144
  * is net plus VAT (D7, design section 4.1). A quantity edit changes none of
143
145
  * them.
144
146
  */
145
- export declare function summariseBillLines(lines: readonly BillLine[], values: BillLineValues, selection: readonly string[], defaults: BillLineDefaults, isItemKnown?: BillLineItemLookup): BillLineSummary;
147
+ export declare function summariseBillLines(lines: readonly BillLine[], values: BillLineValues, selection: readonly string[], defaults: BillLineDefaults, isItemKnown?: BillLineItemLookup, scope?: BillLineScope): BillLineSummary;
146
148
  /**
147
149
  * The HTP-7311 request body, or the ticked lines that block it. The only
148
150
  * place the credit-note sign is applied (D6): a credit note's quantities go
149
- * out negative. A loaded invoice gives no payload (D8).
151
+ * out negative. A loaded invoice gives no payload (D8). With several
152
+ * invoices `lineId` is the row key and each line has its own invoice's
153
+ * sign; `getBillLineLoadPayloadByInvoice` splits them.
150
154
  */
151
- export declare function getBillLineLoadPayload(lines: readonly BillLine[], values: BillLineValues, selection: readonly string[], documentKind: BillDocumentKind, isItemKnown?: BillLineItemLookup): BillLineLoadResult;
155
+ export declare function getBillLineLoadPayload(lines: readonly BillLine[], values: BillLineValues, selection: readonly string[], documentKind: BillDocumentKind, isItemKnown?: BillLineItemLookup, scope?: BillLineScope): BillLineLoadResult;
156
+ /** The same ticked lines split by invoice, in table order, with the host's
157
+ * own line ids. An invoice with no ticked line is left out. */
158
+ export declare function getBillLineLoadPayloadByInvoice(lines: readonly BillLine[], values: BillLineValues, selection: readonly string[], documentKind: BillDocumentKind, isItemKnown?: BillLineItemLookup, scope?: BillLineScope): BillLineInvoiceLoadResult;
152
159
  export interface BillLineRowContext {
153
- /** `isBillInvoiceLoaded(lines)`. */
160
+ /** `isBillInvoiceLoaded(lines)`. Used only when there is no `scope`. */
154
161
  invoiceLoaded: boolean;
155
162
  /** Ticked ids in effect (`resolveBillLineSelection`). */
156
163
  ticked: ReadonlySet<string>;
157
164
  /** The item behind an id, when the table knows it. */
158
165
  findItem: (itemId: string) => BillLineItemOption | undefined;
166
+ /** Which invoice a line is in and whether it is loaded. Default: one
167
+ * invoice, loaded as `invoiceLoaded` says. */
168
+ scope?: BillLineScope;
159
169
  }
160
170
  /** One line's view model. */
161
171
  export declare function buildBillLineRow(line: BillLine, value: BillLineValue, context: BillLineRowContext): BillLineRow;
@@ -167,6 +177,8 @@ export interface BillLineRowsInput {
167
177
  /** The rows of the last build, by line id: an unchanged line keeps its
168
178
  * object, so DataGrid re-renders only the lines that changed. */
169
179
  previous?: ReadonlyMap<string, BillLineRow>;
180
+ /** Default: the lines are one invoice. */
181
+ scope?: BillLineScope;
170
182
  }
171
183
  /** Every line's view model, in invoice order, with structural sharing. */
172
184
  export declare function buildBillLineRows(input: BillLineRowsInput): BillLineRow[];
@@ -174,6 +186,7 @@ export declare function buildBillLineRows(input: BillLineRowsInput): BillLineRow
174
186
  export declare function toBillLineInfo(row: BillLineRow, options: {
175
187
  tableReadOnly: boolean;
176
188
  documentKind: BillDocumentKind;
189
+ scope?: BillLineScope;
177
190
  }): BillLineInfo;
178
191
  /** A quantity a handle or agent write may set: unsigned, above 0, at most 8
179
192
  * fraction digits and at most `BILL_LINE_MAX_QUANTITY`. Returns the
@@ -0,0 +1,56 @@
1
+ import type { BillDocumentKind, BillLine, BillLineInvoice } from './bill-line-table.types';
2
+ /**
3
+ * The row key of a line in a table of several invoices. Line ids are only
4
+ * unique within an invoice, so the table works on `{length}:{invoiceId}:{id}`
5
+ * (unambiguous even when an id holds a colon). With no invoice id the key is
6
+ * the line id itself. A host builds the keys it passes to the handle, to
7
+ * `values` and to `selection` with this function.
8
+ */
9
+ export declare function billLineKey(invoiceId: string | undefined, lineId: string): string;
10
+ /** Where a working line came from. */
11
+ export interface BillLineSource {
12
+ invoiceId: string | undefined;
13
+ lineId: string;
14
+ }
15
+ export interface BillLineScope {
16
+ /** True when the table was given `invoices`. */
17
+ multi: boolean;
18
+ /** Every invoice that has at least one line is loaded (never true with no
19
+ * lines). */
20
+ allLoaded: boolean;
21
+ /** Invoices that have at least one line. */
22
+ invoiceCount: number;
23
+ /** Lines of an invoice that has a loaded line are locked; the others are
24
+ * not. */
25
+ isLoaded: (line: BillLine) => boolean;
26
+ kindOf: (line: BillLine) => BillDocumentKind;
27
+ /** The invoice of a line, or `null` in single mode and for a line whose
28
+ * invoice was not given. */
29
+ invoiceOf: (line: BillLine) => BillLineInvoice | null;
30
+ /** The invoice a line belongs to: `undefined` in single mode. */
31
+ groupOf: (line: BillLine) => string | undefined;
32
+ /** -1 for a credit-note line in several-invoices mode; always 1 in single
33
+ * mode, where totals stay unsigned. */
34
+ signOf: (line: BillLine) => 1 | -1;
35
+ /** The first line of every run of one invoice. Empty in single mode. */
36
+ invoiceStarts: ReadonlySet<string>;
37
+ /** `invoiceStarts` without the first line of the table. */
38
+ groupStarts: ReadonlySet<string>;
39
+ /** The host's own ids behind a working line id. */
40
+ sourceOf: (key: string) => BillLineSource;
41
+ }
42
+ /** The lines the table works on, with the sources of their keys. With no
43
+ * `invoices` the lines are the host's own. */
44
+ export declare function prepareBillLineLines(lines: readonly BillLine[], invoices: readonly BillLineInvoice[] | undefined): {
45
+ lines: readonly BillLine[];
46
+ sources: ReadonlyMap<string, BillLineSource>;
47
+ };
48
+ /** The scope of a table of one invoice (or of several, when `invoices` is
49
+ * given). `lines` are the working lines from `prepareBillLineLines`. */
50
+ export declare function buildBillLineScope(lines: readonly BillLine[], invoices: readonly BillLineInvoice[] | undefined, documentKind: BillDocumentKind, sources?: ReadonlyMap<string, BillLineSource>): BillLineScope;
51
+ /** The scope of one invoice, for the helpers a host calls without one. */
52
+ export declare function singleBillLineScope(lines: readonly BillLine[], documentKind?: BillDocumentKind): BillLineScope;
53
+ /** Problems with the lines and invoices of a several-invoices table, for
54
+ * the development warnings. Ids only, never line text. */
55
+ export declare function findBillLineInvoiceProblems(lines: readonly BillLine[], invoices: readonly BillLineInvoice[]): string[];
56
+ //# sourceMappingURL=bill-line-table.scope.d.ts.map
@@ -98,6 +98,16 @@ export interface BillLineInvoiceHeader {
98
98
  /** Shown as the "SDI" or "Upload" tag. */
99
99
  source: BillLineInvoiceSource;
100
100
  }
101
+ /** One invoice of a table that shows several. */
102
+ export interface BillLineInvoice {
103
+ /** Your own id, unique in `invoices`, with no white space. */
104
+ id: string;
105
+ /** Supplier, number and date, shown in the Invoice column. */
106
+ header: BillLineInvoiceHeader;
107
+ /** Default: the table's `documentKind`. A credit note is marked in
108
+ * words and its lines count against the totals. */
109
+ documentKind?: BillDocumentKind;
110
+ }
101
111
  /** A note about a line. Open-ended: the platform owns the codes and the
102
112
  * copy (HTP-5263/5264 prior art: missing reference data, discount as an
103
113
  * amount only, VAT rounded, duplicate line, matched by description only,
@@ -137,13 +147,20 @@ export interface BillLineWarning {
137
147
  */
138
148
  export interface BillLine {
139
149
  /** Opaque, stable line reference: the HTP-7309 invoice-line reference
140
- * (unique per archive; prior art: supplier VAT, year, invoice number,
150
+ * (unique per archive in a table of one invoice; in a table of several
151
+ * invoices it only has to be unique within its invoice, and `invoiceId`
152
+ * names the invoice, see `BillLineTableProps.invoices`; prior art: supplier VAT, year, invoice number,
141
153
  * `NumeroLinea`; the reverted `fatturapa_reference` VARCHAR(100),
142
154
  * `Version20260608180319.php:30`). The only line datum that reaches the
143
155
  * DOM. */
144
156
  id: string;
145
157
  /** 2.2.1.1 `NumeroLinea`. Shown to agents as the line's position. */
146
158
  lineNumber: number;
159
+ /** The invoice this line belongs to: `BillLineInvoice.id`. Needed only
160
+ * with `BillLineTableProps.invoices`; the lines of one invoice must sit
161
+ * next to each other. The platform's id for an invoice must hold no white
162
+ * space (it reaches `aria-describedby`). */
163
+ invoiceId?: string;
147
164
  /** 2.2.1.3 `CodiceArticolo/CodiceValore` (the supplier's item code), or
148
165
  * `null`. With several `CodiceArticolo` blocks the platform sends the one
149
166
  * HTP-7310 matches on. NOT `DoctorInventoryItem.number`. */
@@ -242,7 +259,8 @@ export interface BillLineValue {
242
259
  quantity: DecimalString | null;
243
260
  item: BillLineItemChoice;
244
261
  }
245
- /** Edits keyed by `BillLine.id`. A missing entry reads as its default
262
+ /** Edits keyed by `BillLine.id` (by `billLineKey(invoiceId, id)` in a table
263
+ * of several invoices). A missing entry reads as its default
246
264
  * (`getDefaultBillLineValue`). The maps the table reports
247
265
  * (`onValuesChange`, `getValues`) hold every current line. */
248
266
  export type BillLineValues = Readonly<Record<string, BillLineValue>>;
@@ -257,8 +275,13 @@ export interface BillLineValueChange {
257
275
  /** Totals and counts over the current values and ticks. Recomputed after
258
276
  * every change; also the source of the HTP-7311 analytics properties. */
259
277
  export interface BillLineSummary {
260
- /** Every line. */
278
+ /** Every line, of every invoice. */
261
279
  lineCount: number;
280
+ /** Invoices in the table: 1 for a table of one invoice (0 with no
281
+ * lines). */
282
+ invoiceCount: number;
283
+ /** Invoices with at least one ticked line. */
284
+ selectedInvoiceCount: number;
262
285
  /** Ticked lines. `warehouse_invoice_load_confirmed.lines_loaded`. */
263
286
  selectedCount: number;
264
287
  /** Ticked lines that load into an existing item. */
@@ -277,7 +300,9 @@ export interface BillLineSummary {
277
300
  warningLineCount: number;
278
301
  /** True when any line is already loaded: by HTP-7311 the invoice is then
279
302
  * loaded and cannot be loaded a second time, partial loads included, so
280
- * every line is read-only and none can be ticked (D8). */
303
+ * every line is read-only and none can be ticked (D8). With several
304
+ * invoices: true only when every invoice is loaded; the lines of a loaded
305
+ * invoice are locked either way, the others stay open. */
281
306
  invoiceLoaded: boolean;
282
307
  /** Ticked lines that cannot load: an empty, zero or negative quantity, an
283
308
  * `'error'` warning, an amount that cannot be read exactly, or an
@@ -285,12 +310,16 @@ export interface BillLineSummary {
285
310
  invalidCount: number;
286
311
  /** Sum of `lineTotal` (`PrezzoTotale`, the invoiced amount) over ticked
287
312
  * lines, rounded once to 2 decimals, half away from zero. Signed. A
288
- * quantity edit does not change it (D7). */
313
+ * quantity edit does not change it (D7). With several invoices the lines
314
+ * of a credit note count against the sum, whichever sign the host sent,
315
+ * so the figure can be negative. */
289
316
  net: DecimalString;
290
317
  /** VAT over ticked lines: per rate, the rate's net sum times the rate,
291
318
  * rounded to 2 decimals (as FatturaPA 2.2.2 `DatiRiepilogo`), then
292
319
  * added. Lines with no rate add nothing. A preview: the platform's
293
- * figures win at load. */
320
+ * figures win at load. With several invoices the rounding is per invoice
321
+ * and rate, so each document keeps its paper figure; a credit note's VAT
322
+ * is subtracted. */
294
323
  vat: DecimalString;
295
324
  /** `net` + `vat`, 2 decimals. */
296
325
  gross: DecimalString;
@@ -319,6 +348,24 @@ export type BillLineLoadResult = {
319
348
  ok: false;
320
349
  invalidLineIds: string[];
321
350
  };
351
+ /** The ticked lines of one invoice, ready for its own request. Line ids are
352
+ * the host's own (`BillLine.id`), not row keys. */
353
+ export interface BillLineInvoiceLoad {
354
+ /** `BillLineInvoice.id`; `null` for a table of one invoice. */
355
+ invoiceId: string | null;
356
+ documentKind: BillDocumentKind;
357
+ /** Quantities are signed as in `getLoadPayload()`: negative on a credit
358
+ * note. The server takes the size and applies the sign by document
359
+ * type. */
360
+ lines: BillLineLoadEntry[];
361
+ }
362
+ export type BillLineInvoiceLoadResult = {
363
+ ok: true;
364
+ invoices: BillLineInvoiceLoad[];
365
+ } | {
366
+ ok: false;
367
+ invalidLineIds: string[];
368
+ };
322
369
  /** A refused handle write throws an `Error` whose message starts with the
323
370
  * code (`"LINE_READ_ONLY: …"`), as BillTable's handle and every kit agent
324
371
  * adapter do, so the agent adapter passes it through unchanged. */
@@ -326,7 +373,13 @@ export type BillLineErrorCode = 'UNKNOWN_LINE' | 'LINE_READ_ONLY' | 'TABLE_READ_
326
373
  /** Structural, privacy-safe facts about one line: no description, no
327
374
  * supplier code, no item name, no new-item name, no warning text. */
328
375
  export interface BillLineInfo {
376
+ /** The row key. With `invoices` it is `billLineKey(invoiceId, id)`; else
377
+ * the line's own id. */
329
378
  id: string;
379
+ /** `BillLine.invoiceId`, or `null` for a table of one invoice. */
380
+ invoiceId: string | null;
381
+ /** The host's own `BillLine.id`. */
382
+ sourceLineId: string;
330
383
  /** `NumeroLinea`. */
331
384
  lineNumber: number;
332
385
  matchState: BillLineMatchState;
@@ -362,7 +415,7 @@ export interface BillLineTableChange {
362
415
  }
363
416
  export type BillLineFocusField = 'select' | 'quantity' | 'item';
364
417
  export interface BillLineTableHandle {
365
- /** Line ids in invoice order. */
418
+ /** Row keys in table order (the lines' own ids for one invoice). */
366
419
  getLineIds(): string[];
367
420
  getLine(id: string): BillLineInfo | null;
368
421
  getLines(): BillLineInfo[];
@@ -375,6 +428,11 @@ export interface BillLineTableHandle {
375
428
  getInvalidLineIds(): string[];
376
429
  /** The HTP-7311 payload, or the lines that block it. */
377
430
  getLoadPayload(): BillLineLoadResult;
431
+ /** The ticked lines split by invoice, in table order, with the host's own
432
+ * line ids: pass each group to your per-invoice request. Invoices with no
433
+ * ticked line are left out. Invalid ticked lines give `ok: false` with
434
+ * their row keys, which `focusLine` and `scrollToLine` take. */
435
+ getLoadPayloadByInvoice(): BillLineInvoiceLoadResult;
378
436
  /** Replaces the ticks. Throws `UNKNOWN_LINE` naming the first unknown id,
379
437
  * `TABLE_READ_ONLY` while the table is read-only, or `LINE_READ_ONLY`
380
438
  * naming the first line that cannot be ticked; nothing changes then. */
@@ -412,8 +470,22 @@ export interface BillLineTableProps extends Omit<HTMLAttributes<HTMLDivElement>,
412
470
  * The table also remembers every item it has been given, so an item the
413
471
  * user picked from a search keeps its name. */
414
472
  selectedItems?: readonly BillLineItemOption[];
415
- /** Default `'invoice'`. */
473
+ /** Default `'invoice'`. With `invoices`: the kind of an invoice that does
474
+ * not say its own. */
416
475
  documentKind?: BillDocumentKind;
476
+ /**
477
+ * Turns on the table of several invoices: one table, one Invoice column
478
+ * (supplier, number, date, and a "Credit note" mark), a stronger line
479
+ * between invoices, totals over all of them. Each line names its invoice
480
+ * with `invoiceId`; the lines of one invoice sit next to each other.
481
+ *
482
+ * Line ids then only have to be unique within an invoice. Inside the table
483
+ * every line is named by `billLineKey(invoiceId, id)`: `values`,
484
+ * `selection`, `onValuesChange`, `onSelectionChange` and every handle
485
+ * method that takes a line id use that key. `getLoadPayloadByInvoice()`
486
+ * gives the host's own ids back. `invoice` (the header block) is ignored.
487
+ */
488
+ invoices?: readonly BillLineInvoice[];
417
489
  /** ISO 4217 code of the bill: FatturaPA 2.1.1.2 `Divisa`. Default EUR. */
418
490
  currency?: string;
419
491
  /** `data-component-id` and the agent instance id (the same name as
@@ -421,7 +493,7 @@ export interface BillLineTableProps extends Omit<HTMLAttributes<HTMLDivElement>,
421
493
  * registers no agent and saves no column state. */
422
494
  gridId?: string;
423
495
  /** Optional header block above the table: supplier, number, date and the
424
- * SDI or Upload tag. */
496
+ * SDI or Upload tag. Not shown with `invoices`. */
425
497
  invoice?: BillLineInvoiceHeader;
426
498
  /** Table name for screen readers. Default "Invoice lines" or "Credit
427
499
  * note lines". */
@@ -487,13 +559,21 @@ export interface BillLineTableProps extends Omit<HTMLAttributes<HTMLDivElement>,
487
559
  * and a focused editor keeps focus (D13). */
488
560
  export interface BillLineRow {
489
561
  line: BillLine;
562
+ /** The line's invoice in a table of several; `null` otherwise. */
563
+ invoice: BillLineInvoice | null;
564
+ /** The kind of the line's document. */
565
+ documentKind: BillDocumentKind;
566
+ /** First line of its invoice (several-invoices mode only). */
567
+ invoiceStart: boolean;
568
+ /** `invoiceStart`, except on the first line of the table. */
569
+ groupStart: boolean;
490
570
  value: BillLineValue;
491
571
  /** Ticked (never for a line of a loaded invoice). */
492
572
  selected: boolean;
493
573
  matchState: BillLineMatchState;
494
574
  /** Ticked and cannot load (see `BillLineSummary.invalidCount`). */
495
575
  invalid: boolean;
496
- /** Every line of a loaded invoice (`BillLineSummary.invoiceLoaded`). */
576
+ /** Every line of a loaded invoice. */
497
577
  readOnly: boolean;
498
578
  /** See `BillLineInfo.quantityLocked`. */
499
579
  quantityLocked: boolean;
@@ -45,4 +45,6 @@ export declare const updateItemVariants: (props?: import("class-variance-authori
45
45
  export declare const headerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
46
46
  export declare const headerTermVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
47
47
  export declare const headerValueVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
48
+ /** The supplier's name on the first row of an invoice. */
49
+ export declare const supplierLineVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
48
50
  //# sourceMappingURL=bill-line-table.variants.d.ts.map
@@ -1,6 +1,7 @@
1
1
  export { BillLineTable } from './bill-line-table';
2
2
  export { billLineTableAgent } from './bill-line-table.agent';
3
- export { BILL_LINE_ITEM_NAME_MAX_LENGTH, BILL_LINE_MAX_QUANTITY, BILL_LINE_NEW_ITEM_VALUE, BILL_LINE_PERCENT_FRACTION_DIGITS, BILL_LINE_PRICE_FRACTION_DIGITS, BILL_LINE_QUANTITY_FRACTION_DIGITS, BILL_LINE_QUANTITY_TOO_LARGE, getBillLineLoadPayload, getBillLineMatchState, getDefaultBillLineSelection, getDefaultBillLineValue, getDefaultBillLineValues, hasBillLineItemUpdate, isBillInvoiceLoaded, isBillLineInvalid, isBillLineItemToUpdate, isBillLineQuantityEditable, netUnitCost, summariseBillLines, } from './bill-line-table.model';
3
+ export { BILL_LINE_ITEM_NAME_MAX_LENGTH, BILL_LINE_MAX_QUANTITY, BILL_LINE_NEW_ITEM_VALUE, BILL_LINE_PERCENT_FRACTION_DIGITS, BILL_LINE_PRICE_FRACTION_DIGITS, BILL_LINE_QUANTITY_FRACTION_DIGITS, BILL_LINE_QUANTITY_TOO_LARGE, getBillLineLoadPayload, getBillLineLoadPayloadByInvoice, getBillLineMatchState, getDefaultBillLineSelection, getDefaultBillLineValue, getDefaultBillLineValues, hasBillLineItemUpdate, isBillInvoiceLoaded, isBillLineInvalid, isBillLineItemToUpdate, isBillLineQuantityEditable, netUnitCost, summariseBillLines, } from './bill-line-table.model';
4
+ export { billLineKey } from './bill-line-table.scope';
4
5
  export type { BillLineDefaults, BillLineItemLookup, } from './bill-line-table.model';
5
- export type { BillDocumentKind, BillLine, BillLineAdjustment, BillLineChangeSource, BillLineErrorCode, BillLineFocusField, BillLineInfo, BillLineInvoiceHeader, BillLineInvoiceSource, BillLineItemChoice, BillLineItemOption, BillLineItemUpdate, BillLineItemUpdateChange, BillLineLoadEntry, BillLineLoadResult, BillLineMatchState, BillLineProposal, BillLineSummary, BillLineTableChange, BillLineTableChangeEvent, BillLineTableHandle, BillLineTableProps, BillLineValue, BillLineValueChange, BillLineValues, BillLineWarning, } from './bill-line-table.types';
6
+ export type { BillDocumentKind, BillLine, BillLineAdjustment, BillLineChangeSource, BillLineErrorCode, BillLineFocusField, BillLineInfo, BillLineInvoice, BillLineInvoiceHeader, BillLineInvoiceLoad, BillLineInvoiceLoadResult, BillLineInvoiceSource, BillLineItemChoice, BillLineItemOption, BillLineItemUpdate, BillLineItemUpdateChange, BillLineLoadEntry, BillLineLoadResult, BillLineMatchState, BillLineProposal, BillLineSummary, BillLineTableChange, BillLineTableChangeEvent, BillLineTableHandle, BillLineTableProps, BillLineValue, BillLineValueChange, BillLineValues, BillLineWarning, } from './bill-line-table.types';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,25 +1,27 @@
1
- import { B as l, a as L, b as i, c as I, d as s, e as _, f as t, g as n, h as B, i as T, j as E, k as N, l as A, m as o, n as d, o as g, p as u, q as U, r as m, s as C, t as D } from "../../_chunks/bill-line-table-CzYzg-Qh.js";
1
+ import { B as l, a as i, b as L, c as s, d as I, e as _, f as t, g as n, h as B, i as T, j as E, k as N, l as o, m as A, n as d, o as g, p as u, q as U, r as b, s as m, t as C, u as D, v as M } from "../../_chunks/bill-line-table-DHKb_O7c.js";
2
2
  export {
3
3
  l as BILL_LINE_ITEM_NAME_MAX_LENGTH,
4
- L as BILL_LINE_MAX_QUANTITY,
5
- i as BILL_LINE_NEW_ITEM_VALUE,
6
- I as BILL_LINE_PERCENT_FRACTION_DIGITS,
7
- s as BILL_LINE_PRICE_FRACTION_DIGITS,
4
+ i as BILL_LINE_MAX_QUANTITY,
5
+ L as BILL_LINE_NEW_ITEM_VALUE,
6
+ s as BILL_LINE_PERCENT_FRACTION_DIGITS,
7
+ I as BILL_LINE_PRICE_FRACTION_DIGITS,
8
8
  _ as BILL_LINE_QUANTITY_FRACTION_DIGITS,
9
9
  t as BILL_LINE_QUANTITY_TOO_LARGE,
10
10
  n as BillLineTable,
11
- B as billLineTableAgent,
12
- T as getBillLineLoadPayload,
13
- E as getBillLineMatchState,
14
- N as getDefaultBillLineSelection,
15
- A as getDefaultBillLineValue,
16
- o as getDefaultBillLineValues,
17
- d as hasBillLineItemUpdate,
18
- g as isBillInvoiceLoaded,
19
- u as isBillLineInvalid,
20
- U as isBillLineItemToUpdate,
21
- m as isBillLineQuantityEditable,
22
- C as netUnitCost,
23
- D as summariseBillLines
11
+ B as billLineKey,
12
+ T as billLineTableAgent,
13
+ E as getBillLineLoadPayload,
14
+ N as getBillLineLoadPayloadByInvoice,
15
+ o as getBillLineMatchState,
16
+ A as getDefaultBillLineSelection,
17
+ d as getDefaultBillLineValue,
18
+ g as getDefaultBillLineValues,
19
+ u as hasBillLineItemUpdate,
20
+ U as isBillInvoiceLoaded,
21
+ b as isBillLineInvalid,
22
+ m as isBillLineItemToUpdate,
23
+ C as isBillLineQuantityEditable,
24
+ D as netUnitCost,
25
+ M as summariseBillLines
24
26
  };
25
27
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { B as S, a as T, b as a, c as I, d as B, e as s, f as A, g as E, h as O, i as l, j as D, k as N, l as e, m as U, u as R } from "../../_chunks/default-tabs-BryvhiHv.js";
1
+ import { B as S, a as T, b as a, c as I, d as B, e as s, f as A, g as E, h as O, i as l, j as D, k as N, l as e, m as U, u as R } from "../../_chunks/default-tabs-DbebYO04.js";
2
2
  export {
3
3
  S as BILL_ACTION_DISABLED_REASONS,
4
4
  T as BILL_COUNTERPARTY_KINDS,
@@ -1,4 +1,4 @@
1
- import { B as s, a, C as R, O as g, b as n, c as A } from "../../_chunks/reserved.agent-BBuWWtYb.js";
1
+ import { B as s, a, C as R, O as g, b as n, c as A } from "../../_chunks/reserved.agent-W8mR179D.js";
2
2
  export {
3
3
  s as Booking,
4
4
  a as BookingReserved,
@@ -1,5 +1,5 @@
1
- import { D as _, a as D, b as r, c as E, d as I, e as T, f as G } from "../../_chunks/data-grid-C9xlUMLt.js";
2
- import { D as s, a as R } from "../../_chunks/toolbar-BK6S9PhI.js";
1
+ import { D as _, a as D, b as r, c as E, d as I, e as T, f as G } from "../../_chunks/data-grid-B2oaI7Lt.js";
2
+ import { D as s, a as R } from "../../_chunks/toolbar-CfdoJzMV.js";
3
3
  export {
4
4
  _ as DATA_GRID_DEFAULT_PAGE_SIZE,
5
5
  D as DATA_GRID_MAX_SORT_LEVELS,
@@ -647,6 +647,10 @@ export interface DataGridProps<TData> extends Omit<HTMLAttributes<HTMLDivElement
647
647
  expandMode?: 'single' | 'multiple';
648
648
  /** Rows that render `cell` instead of every editor (already-loaded lines). */
649
649
  isRowReadOnly?: (row: TData) => boolean;
650
+ /** True for the first row of a group of rows: the row gets a stronger line
651
+ * above it. Purely visual and not announced: put the group's name in a
652
+ * cell. Never set it on the first row of the table. */
653
+ getRowGroupStart?: (row: TData) => boolean;
650
654
  /**
651
655
  * The whole grid is read-only for a while ("a request is running"):
652
656
  * - every row renders `cell` instead of its editors (as `isRowReadOnly`);
@@ -1173,6 +1177,8 @@ export interface DataGridTableMeta {
1173
1177
  getRowLabel: (rowId: string) => string;
1174
1178
  getSelectability: (rowId: string) => DataGridResolvedSelectability;
1175
1179
  isRowReadOnly: (rowId: string) => boolean;
1180
+ /** Does a group of rows start at this row? */
1181
+ isRowGroupStart: (rowId: string) => boolean;
1176
1182
  /** Is this cell masked under privacy mode? */
1177
1183
  isMasked: (rowId: string, columnId: string) => boolean;
1178
1184
  /** Does privacy mode mask any cell of this row? Host text shown on such a
@@ -1,4 +1,4 @@
1
- import { I as O, a, b as L, c as N, d as s, i as S } from "../../_chunks/invoice-upload-list-868v1oDe.js";
1
+ import { I as O, a, b as L, c as N, d as s, i as S } from "../../_chunks/invoice-upload-list-B5aMffTy.js";
2
2
  export {
3
3
  O as INVOICE_DOCUMENT_KINDS,
4
4
  a as INVOICE_SUPPLIER_KINDS,
@@ -1,3 +1,3 @@
1
1
  export { MapView } from './map-view';
2
- export type { MapViewProps, MapViewHandle, MapMarker, MapLatLng, MapFitPoint, MapBounds, MapBoundsChangeDetails, MapViewStaticPreview, MapViewStaticPreviewSource, MapMarkerHoverSource, } from './map-view';
2
+ export type { MapViewProps, MapViewHandle, MapMarker, MapLatLng, MapFitPoint, MapBounds, MapBoundsChangeDetails, MapViewStaticPreview, MapViewStaticPreviewSource, MapMarkerHoverSource, MapViewLoadError, } from './map-view';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { M as o } from "../../_chunks/map-view-DkL58SRp.js";
1
+ import { M as o } from "../../_chunks/map-view-Cm69dCnY.js";
2
2
  export {
3
3
  o as MapView
4
4
  };
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes, type ReactNode } from 'react';
1
+ import { type HTMLAttributes, type RefObject, type ReactNode } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  export interface MapLatLng {
4
4
  lat: number;
@@ -70,6 +70,14 @@ export interface MapViewStaticPreviewSource {
70
70
  }
71
71
  /** What moved onto or off a pin: the pointer, or keyboard-style focus. */
72
72
  export type MapMarkerHoverSource = 'pointer' | 'focus';
73
+ /**
74
+ * Why the interactive map is not available (see `onLoadError`):
75
+ * - `script`: Google's script failed to load (blocked, offline, DNS).
76
+ * - `auth`: Google rejected the key or the page's referrer (`gm_authFailure`).
77
+ * - `import`: a library import or the map's first render threw.
78
+ * - `timeout`: no map after `loadTimeoutMs`.
79
+ */
80
+ export type MapViewLoadError = 'script' | 'auth' | 'import' | 'timeout';
73
81
  export interface MapViewHandle {
74
82
  /** Pan the map to a new centre without changing zoom. */
75
83
  panTo: (position: MapLatLng) => void;
@@ -99,6 +107,13 @@ export interface MapViewHandle {
99
107
  getSelectedMarkerId: () => string | null;
100
108
  /** Number of markers passed to the component. Count only, no ids. */
101
109
  getMarkerCount: () => number;
110
+ /**
111
+ * Why the interactive map is unavailable, or `null` while it is loading,
112
+ * loaded or not yet asked for. Never the error text.
113
+ */
114
+ getLoadError: () => MapViewLoadError | null;
115
+ /** Try loading the interactive map again. No-op unless `getLoadError` is set. */
116
+ retryLoad: () => void;
102
117
  }
103
118
  export interface MapViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>, VariantProps<typeof mapViewVariants> {
104
119
  /** Opaque instance id — emitted as `data-component-id`. */
@@ -161,6 +176,20 @@ export interface MapViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCl
161
176
  * loaded. Flip to `true` once the consumer has captured opt-in.
162
177
  */
163
178
  consentGranted?: boolean;
179
+ /**
180
+ * How long, in milliseconds, the interactive map may take to appear after
181
+ * consent before the "map is not available" state shows. Default 10000.
182
+ * `0` or `Infinity` turns the timer off; a script failure, an auth failure
183
+ * and an import failure still show it at once. Mainly for tests and hosts
184
+ * on slow links.
185
+ */
186
+ loadTimeoutMs?: number;
187
+ /**
188
+ * The interactive map could not be shown, and why. Fires once per failure,
189
+ * and again if a retry fails. For the host's own logging: the kit shows the
190
+ * message, the Retry button and the "Open in Google Maps" link itself.
191
+ */
192
+ onLoadError?: (reason: MapViewLoadError) => void;
164
193
  /** Fires when the consumer clicks the "Load map" CTA in the placeholder. */
165
194
  onConsentRequest?: () => void;
166
195
  /**
@@ -313,6 +342,18 @@ export declare function MapClusterMarker({ count }: {
313
342
  /** What the map area shows while Google's map library is on its way.
314
343
  * Exported for its story; not part of the public API. */
315
344
  export declare function MapViewLoading(): ReactNode;
345
+ interface MapUnavailableProps {
346
+ reason: MapViewLoadError;
347
+ preview: MapViewStaticPreview | undefined;
348
+ onPreviewError: () => void;
349
+ address: string | undefined;
350
+ contentLang: string | undefined;
351
+ openInGoogleMapsHref: string;
352
+ onRetry: () => void;
353
+ retryRef: RefObject<HTMLButtonElement | null>;
354
+ }
355
+ /** Exported for its stories; not part of the public API. */
356
+ export declare function MapUnavailable({ reason, preview, onPreviewError, address, contentLang, openInGoogleMapsHref, onRetry, retryRef, }: MapUnavailableProps): ReactNode;
316
357
  export declare const MapView: import("react").ForwardRefExoticComponent<MapViewProps & import("react").RefAttributes<MapViewHandle>>;
317
358
  export {};
318
359
  //# sourceMappingURL=map-view.d.ts.map
@@ -1,4 +1,4 @@
1
- import { P as t, p as a } from "../../_chunks/practice-results-M5A9-X9y.js";
1
+ import { P as t, p as a } from "../../_chunks/practice-results-DaxGw9_f.js";
2
2
  export {
3
3
  t as PracticeResults,
4
4
  a as practiceResultsAgent
@@ -1,6 +1,6 @@
1
1
  import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
- import { type MapViewStaticPreview } from '../map-view/map-view';
3
+ import { type MapViewLoadError, type MapViewStaticPreview } from '../map-view/map-view';
4
4
  import type { SlotGridDay, SlotGridSlot } from '../slot-grid';
5
5
  export type PracticeResultsVariant = 'split-list-map' | 'map-first' | 'rich-cards' | 'slot-cards';
6
6
  /** Heading levels the results title accepts. */
@@ -305,6 +305,17 @@ export interface PracticeResultsProps extends Omit<ComponentPropsWithoutRef<'div
305
305
  * before the patient chooses. Split-list-map and map-first only.
306
306
  */
307
307
  mapPreview?: MapViewStaticPreview;
308
+ /**
309
+ * How long the interactive map may take to appear before "map not
310
+ * available" shows, in milliseconds. Forwarded to every internal `<MapView>`
311
+ * as `loadTimeoutMs`. Default 10000; `0` or `Infinity` turns it off.
312
+ */
313
+ mapLoadTimeoutMs?: number;
314
+ /**
315
+ * The interactive map could not be shown, and why. Forwarded to every
316
+ * internal `<MapView>` as `onLoadError`; for the host's own logging.
317
+ */
318
+ onMapLoadError?: (reason: MapViewLoadError) => void;
308
319
  /**
309
320
  * Result ids the map camera fits to, for the initial view and every refit.
310
321
  * Use it to open on the same practices as your `mapPreview` image. Every
@@ -1,4 +1,4 @@
1
- import { W as o, w as r } from "../../_chunks/warehouse-load-summary-DkAKXcw0.js";
1
+ import { W as o, w as r } from "../../_chunks/warehouse-load-summary-CMMYzTDv.js";
2
2
  export {
3
3
  o as WarehouseLoadSummary,
4
4
  r as warehouseLoadSummaryAgent