@alfadocs/ui-kit-debug 1.118.0 → 1.119.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/_chunks/bill-line-table-DUMEHnQ4.js +1754 -0
- package/dist/_chunks/bill-line-table-DUMEHnQ4.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-BEmBcb61.js → calendar-appointment-editor-dialog-rw02sXGw.js} +4 -4
- package/dist/_chunks/{calendar-appointment-editor-dialog-BEmBcb61.js.map → calendar-appointment-editor-dialog-rw02sXGw.js.map} +1 -1
- package/dist/_chunks/{compact-editor-fields-6sTWRLtf.js → compact-editor-fields-cP6yh7xv.js} +3 -3
- package/dist/_chunks/{compact-editor-fields-6sTWRLtf.js.map → compact-editor-fields-cP6yh7xv.js.map} +1 -1
- package/dist/_chunks/counts-BXtzNv_G.js +92 -0
- package/dist/_chunks/counts-BXtzNv_G.js.map +1 -0
- package/dist/_chunks/{data-grid-DiBSbN2Y.js → data-grid-Bbf8t4z3.js} +2 -2
- package/dist/_chunks/{data-grid-DiBSbN2Y.js.map → data-grid-Bbf8t4z3.js.map} +1 -1
- package/dist/_chunks/{default-tabs-CD285u0C.js → default-tabs-Cxkw1Ws0.js} +332 -368
- package/dist/_chunks/default-tabs-Cxkw1Ws0.js.map +1 -0
- package/dist/_chunks/{document-scanner-5p-Uu8dy.js → document-scanner-CETscDea.js} +2 -2
- package/dist/_chunks/{document-scanner-5p-Uu8dy.js.map → document-scanner-CETscDea.js.map} +1 -1
- package/dist/_chunks/file-code-Cf-_gSzd.js +23 -0
- package/dist/_chunks/file-code-Cf-_gSzd.js.map +1 -0
- package/dist/_chunks/{file-manager-CV1_GtjC.js → file-manager-DNq-sEsy.js} +2 -2
- package/dist/_chunks/{file-manager-CV1_GtjC.js.map → file-manager-DNq-sEsy.js.map} +1 -1
- package/dist/_chunks/{file-upload-CxjCs7TX.js → file-upload-DQc0LsBM.js} +385 -311
- package/dist/_chunks/file-upload-DQc0LsBM.js.map +1 -0
- package/dist/_chunks/invoice-upload-list-CsFsRgbt.js +952 -0
- package/dist/_chunks/invoice-upload-list-CsFsRgbt.js.map +1 -0
- package/dist/_chunks/maps-MpMxTBov.js +63 -0
- package/dist/_chunks/maps-MpMxTBov.js.map +1 -0
- package/dist/_chunks/{notes-panel-CHR-Jv6N.js → notes-panel-BOwlTz2-.js} +2 -2
- package/dist/_chunks/{notes-panel-CHR-Jv6N.js.map → notes-panel-BOwlTz2-.js.map} +1 -1
- package/dist/_chunks/package-plus-CTecQK3x.js +25 -0
- package/dist/_chunks/package-plus-CTecQK3x.js.map +1 -0
- package/dist/_chunks/{public-footer-CB7ruuLI.js → public-footer-C8UIzqLJ.js} +326 -243
- package/dist/_chunks/public-footer-C8UIzqLJ.js.map +1 -0
- package/dist/_chunks/{radiograph-panel.agent-9jwXlOXB.js → radiograph-panel.agent-Dcv16n7u.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-9jwXlOXB.js.map → radiograph-panel.agent-Dcv16n7u.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-CMPA5Wgy.js → rich-text-editor-BLEdXJ0l.js} +2 -2
- package/dist/_chunks/{rich-text-editor-CMPA5Wgy.js.map → rich-text-editor-BLEdXJ0l.js.map} +1 -1
- package/dist/_chunks/{signed-out-frame-bh7fn_Px.js → signed-out-frame-fUf7tqs3.js} +2 -2
- package/dist/_chunks/{signed-out-frame-bh7fn_Px.js.map → signed-out-frame-fUf7tqs3.js.map} +1 -1
- package/dist/_chunks/{task-editor-WdDCqbIL.js → task-editor-Czcx9B-3.js} +2 -2
- package/dist/_chunks/{task-editor-WdDCqbIL.js.map → task-editor-Czcx9B-3.js.map} +1 -1
- package/dist/_chunks/{toolbar-z8vXnpXz.js → toolbar-DoKcoE2q.js} +2 -2
- package/dist/_chunks/{toolbar-z8vXnpXz.js.map → toolbar-DoKcoE2q.js.map} +1 -1
- package/dist/_chunks/types-BrJRsnSG.js +291 -0
- package/dist/_chunks/types-BrJRsnSG.js.map +1 -0
- package/dist/_chunks/warehouse-load-summary-D88M4Ii7.js +255 -0
- package/dist/_chunks/warehouse-load-summary-D88M4Ii7.js.map +1 -0
- package/dist/agent-catalog.json +360 -14
- package/dist/agent-i18n/en.json +31 -2
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/warehouse-load/counts.d.ts +82 -0
- package/dist/components/_shared/warehouse-load/counts.d.ts.map +1 -0
- package/dist/components/_shared/warehouse-load/index.d.ts +4 -0
- package/dist/components/_shared/warehouse-load/index.d.ts.map +1 -0
- package/dist/components/_shared/warehouse-load/maps.d.ts +67 -0
- package/dist/components/_shared/warehouse-load/maps.d.ts.map +1 -0
- package/dist/components/_shared/warehouse-load/types.d.ts +18 -0
- package/dist/components/_shared/warehouse-load/types.d.ts.map +1 -0
- package/dist/components/bill-line-table/bill-line-table.columns.d.ts +2 -0
- package/dist/components/bill-line-table/bill-line-table.columns.d.ts.map +1 -1
- package/dist/components/bill-line-table/bill-line-table.d.ts.map +1 -1
- package/dist/components/bill-line-table/bill-line-table.header.d.ts +7 -0
- package/dist/components/bill-line-table/bill-line-table.header.d.ts.map +1 -0
- package/dist/components/bill-line-table/bill-line-table.model.d.ts +10 -1
- package/dist/components/bill-line-table/bill-line-table.model.d.ts.map +1 -1
- package/dist/components/bill-line-table/bill-line-table.types.d.ts +66 -1
- package/dist/components/bill-line-table/bill-line-table.types.d.ts.map +1 -1
- package/dist/components/bill-line-table/bill-line-table.variants.d.ts +12 -0
- package/dist/components/bill-line-table/bill-line-table.variants.d.ts.map +1 -1
- package/dist/components/bill-line-table/index.d.ts +2 -2
- package/dist/components/bill-line-table/index.d.ts.map +1 -1
- package/dist/components/bill-line-table/index.js +10 -8
- package/dist/components/bill-table/index.js +1 -1
- package/dist/components/data-grid/data-grid.variants.d.ts +1 -1
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +30 -1
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/flag/flag-view.d.ts +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/invoice-upload/index.d.ts +5 -0
- package/dist/components/invoice-upload/index.d.ts.map +1 -0
- package/dist/components/invoice-upload/index.js +7 -0
- package/dist/components/invoice-upload/index.js.map +1 -0
- package/dist/components/invoice-upload/invoice-upload.agent.d.ts +4 -0
- package/dist/components/invoice-upload/invoice-upload.agent.d.ts.map +1 -0
- package/dist/components/invoice-upload/invoice-upload.d.ts +3 -0
- package/dist/components/invoice-upload/invoice-upload.d.ts.map +1 -0
- package/dist/components/invoice-upload/types.d.ts +72 -0
- package/dist/components/invoice-upload/types.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/cells.d.ts +36 -0
- package/dist/components/invoice-upload-list/cells.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/columns.d.ts +14 -0
- package/dist/components/invoice-upload-list/columns.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/handle.d.ts +18 -0
- package/dist/components/invoice-upload-list/handle.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/index.d.ts +5 -0
- package/dist/components/invoice-upload-list/index.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/index.js +10 -0
- package/dist/components/invoice-upload-list/index.js.map +1 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.agent.d.ts +4 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.agent.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.d.ts +10 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.variants.d.ts +28 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.variants.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/model.d.ts +40 -0
- package/dist/components/invoice-upload-list/model.d.ts.map +1 -0
- package/dist/components/invoice-upload-list/types.d.ts +154 -0
- package/dist/components/invoice-upload-list/types.d.ts.map +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-footer/public-footer.d.ts +24 -0
- package/dist/components/public-footer/public-footer.d.ts.map +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/warehouse-load-summary/index.d.ts +4 -0
- package/dist/components/warehouse-load-summary/index.d.ts.map +1 -0
- package/dist/components/warehouse-load-summary/index.js +6 -0
- package/dist/components/warehouse-load-summary/index.js.map +1 -0
- package/dist/components/warehouse-load-summary/model.d.ts +8 -0
- package/dist/components/warehouse-load-summary/model.d.ts.map +1 -0
- package/dist/components/warehouse-load-summary/types.d.ts +50 -0
- package/dist/components/warehouse-load-summary/types.d.ts.map +1 -0
- package/dist/components/warehouse-load-summary/warehouse-load-summary.agent.d.ts +4 -0
- package/dist/components/warehouse-load-summary/warehouse-load-summary.agent.d.ts.map +1 -0
- package/dist/components/warehouse-load-summary/warehouse-load-summary.d.ts +7 -0
- package/dist/components/warehouse-load-summary/warehouse-load-summary.d.ts.map +1 -0
- package/dist/core.css +1 -1
- package/dist/i18n/locales/ar.d.ts +203 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +197 -4
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +203 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +201 -4
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +203 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +201 -4
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +203 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +203 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +203 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +199 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +203 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +199 -4
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +203 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +197 -4
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +203 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +197 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +203 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +197 -4
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +203 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +197 -4
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +203 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +197 -4
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +203 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +199 -4
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +203 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +197 -4
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +203 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +197 -4
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +203 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +199 -4
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +203 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +197 -4
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +203 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +197 -4
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +203 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +197 -4
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1189 -1173
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +207 -4
- package/dist/locales/de.json +207 -4
- package/dist/locales/el.json +207 -4
- package/dist/locales/en.json +203 -0
- package/dist/locales/es.json +207 -4
- package/dist/locales/fr.json +207 -4
- package/dist/locales/hi.json +207 -4
- package/dist/locales/it.json +207 -4
- package/dist/locales/ja.json +207 -4
- package/dist/locales/nl.json +207 -4
- package/dist/locales/pl.json +207 -4
- package/dist/locales/pt.json +207 -4
- package/dist/locales/ro.json +207 -4
- package/dist/locales/ru.json +207 -4
- package/dist/locales/sq.json +207 -4
- package/dist/locales/sv.json +207 -4
- package/dist/locales/tr.json +207 -4
- package/dist/locales/zh.json +207 -4
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/signed-out-frame/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +13 -1
- package/dist/_chunks/bill-line-table-vCnVo7_a.js +0 -1565
- package/dist/_chunks/bill-line-table-vCnVo7_a.js.map +0 -1
- package/dist/_chunks/default-tabs-CD285u0C.js.map +0 -1
- package/dist/_chunks/file-upload-CxjCs7TX.js.map +0 -1
- package/dist/_chunks/public-footer-CB7ruuLI.js.map +0 -1
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
import { jsx as a, jsxs as h, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as S, createElement as Oe, forwardRef as ke, useRef as R, useId as Ee, useState as X, useImperativeHandle as De, useEffect as xe } from "react";
|
|
3
|
+
import { useTranslation as L } from "react-i18next";
|
|
4
|
+
import { u as Ve } from "./registry-DvAUVLHh.js";
|
|
5
|
+
import { B as Be } from "./button-DohK_Ak_.js";
|
|
6
|
+
import { V as x } from "./visually-hidden-BHxEUGyT.js";
|
|
7
|
+
import { e as Me } from "./data-grid-Bbf8t4z3.js";
|
|
8
|
+
import { D as g } from "./toolbar-DoKcoE2q.js";
|
|
9
|
+
import { a as se } from "./format-number-DdzqwMs1.js";
|
|
10
|
+
import { c as v } from "./index-D2ZczOXr.js";
|
|
11
|
+
import { R as Fe } from "./row-actions-Dpf9CrCP.js";
|
|
12
|
+
import { B as Ke } from "./badge-BUk4RjTS.js";
|
|
13
|
+
import { M as ze } from "./money-OE6_oDPH.js";
|
|
14
|
+
import { S as Pe } from "./spinner-CoflYlEx.js";
|
|
15
|
+
import { parseDecimal as We, FATTURAPA_VALUE as He, decimalToNumber as $e } from "../decimal/index.js";
|
|
16
|
+
import { f as qe } from "./intl-locale-FWh-Y5_3.js";
|
|
17
|
+
import { c as je, a as Ge } from "./counts-BXtzNv_G.js";
|
|
18
|
+
import { b as B, c as V } from "./maps-MpMxTBov.js";
|
|
19
|
+
import { C as Ye } from "./check-DrFSN__t.js";
|
|
20
|
+
import { c as Qe } from "./createLucideIcon-DhHxpK9K.js";
|
|
21
|
+
import { P as ee } from "./package-plus-CTecQK3x.js";
|
|
22
|
+
/**
|
|
23
|
+
* @license lucide-react v1.22.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
const Ze = [
|
|
29
|
+
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
|
|
30
|
+
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
|
|
31
|
+
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
|
|
32
|
+
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
|
|
33
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
|
|
34
|
+
["path", { d: "m16 16-1.9-1.9", key: "1dq9hf" }]
|
|
35
|
+
], Je = Qe("scan-search", Ze), Xe = [
|
|
36
|
+
"fileName",
|
|
37
|
+
"supplier",
|
|
38
|
+
"invoiceNumber",
|
|
39
|
+
"date",
|
|
40
|
+
"lineCount",
|
|
41
|
+
"total",
|
|
42
|
+
"status"
|
|
43
|
+
];
|
|
44
|
+
function T(e, i) {
|
|
45
|
+
throw new Error(`${e}: ${i}`);
|
|
46
|
+
}
|
|
47
|
+
function te(e, i) {
|
|
48
|
+
e.hasRow(i) || T("UNKNOWN_ROW", `no invoice "${i}" in the list.`);
|
|
49
|
+
}
|
|
50
|
+
const ie = {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: { id: { type: "string", description: "An invoice id (rows)." } },
|
|
53
|
+
required: ["id"],
|
|
54
|
+
additionalProperties: !1
|
|
55
|
+
}, et = {
|
|
56
|
+
id: "invoice-upload-list",
|
|
57
|
+
capabilities: [
|
|
58
|
+
"select_multiple",
|
|
59
|
+
"sort",
|
|
60
|
+
"scroll",
|
|
61
|
+
// review opens the host's review dialog (`open`: a Dialog).
|
|
62
|
+
"open",
|
|
63
|
+
// load_all_ready and load_selected commit invoices to the warehouse.
|
|
64
|
+
"submit"
|
|
65
|
+
],
|
|
66
|
+
state: {
|
|
67
|
+
features: {
|
|
68
|
+
type: "{ privacyMode, status, selectable, readyCount }",
|
|
69
|
+
descriptionKey: "ui.agent.invoiceUploadList.state.features",
|
|
70
|
+
description: "What the list can do now: privacy mode, loading status, whether rows can be selected, and how many invoices are ready to load.",
|
|
71
|
+
read: (e) => e.getFeatures()
|
|
72
|
+
},
|
|
73
|
+
rows: {
|
|
74
|
+
type: "Array<{ id, fileId, fileName, status, supplierKind, supplierName?, invoiceNumber, date, lineCount, loading, hasError, selectable, review }>",
|
|
75
|
+
descriptionKey: "ui.agent.invoiceUploadList.state.rows",
|
|
76
|
+
description: "The uploaded invoices. A supplier name is given only when it is not hidden; a person is never named under privacy mode. An error row reads hasError, not its message.",
|
|
77
|
+
read: (e) => e.getRowSummaries()
|
|
78
|
+
},
|
|
79
|
+
counts: {
|
|
80
|
+
type: "Record<status, number>",
|
|
81
|
+
descriptionKey: "ui.agent.invoiceUploadList.state.counts",
|
|
82
|
+
description: "How many invoices have each status: readyToLoad, toReview, alreadyLoaded, loaded and error.",
|
|
83
|
+
read: (e) => e.getCounts()
|
|
84
|
+
},
|
|
85
|
+
selection: {
|
|
86
|
+
type: "string[]",
|
|
87
|
+
descriptionKey: "ui.agent.invoiceUploadList.state.selection",
|
|
88
|
+
description: "Ids of the selected invoices.",
|
|
89
|
+
read: (e) => e.getSelection()
|
|
90
|
+
},
|
|
91
|
+
sort: {
|
|
92
|
+
type: "Array<{ colId, sort }>",
|
|
93
|
+
descriptionKey: "ui.agent.invoiceUploadList.state.sort",
|
|
94
|
+
description: "The active sort.",
|
|
95
|
+
read: (e) => e.getSort()
|
|
96
|
+
},
|
|
97
|
+
columns: {
|
|
98
|
+
type: "Array<{ id, label, visible, canHide, sortable, masked }>",
|
|
99
|
+
descriptionKey: "ui.agent.invoiceUploadList.state.columns",
|
|
100
|
+
description: "The columns, in display order.",
|
|
101
|
+
read: (e) => e.getColumns()
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
actions: {
|
|
105
|
+
select_ready: {
|
|
106
|
+
safety: "read",
|
|
107
|
+
returns: "string[]",
|
|
108
|
+
idempotent: !0,
|
|
109
|
+
errors: ["SELECTION_DISABLED: the list has no selection."],
|
|
110
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.selectReady",
|
|
111
|
+
description: "Select every invoice that is ready to load and not being loaded. Nothing loads until load_selected.",
|
|
112
|
+
invoke: (e) => (e.getFeatures().selectable || T("SELECTION_DISABLED", "this list has no selection."), e.selectReady())
|
|
113
|
+
},
|
|
114
|
+
select_rows: {
|
|
115
|
+
safety: "read",
|
|
116
|
+
argsType: "{ ids: string[] }",
|
|
117
|
+
argsSchema: {
|
|
118
|
+
type: "object",
|
|
119
|
+
properties: { ids: { type: "array", items: { type: "string" } } },
|
|
120
|
+
required: ["ids"],
|
|
121
|
+
additionalProperties: !1
|
|
122
|
+
},
|
|
123
|
+
returns: "string[]",
|
|
124
|
+
idempotent: !0,
|
|
125
|
+
errors: ["SELECTION_DISABLED: the list has no selection."],
|
|
126
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.selectRows",
|
|
127
|
+
description: "Replace the selection with the given invoice ids. Only invoices that are ready to load can be selected; others are ignored.",
|
|
128
|
+
invoke: (e, i) => (e.getFeatures().selectable || T("SELECTION_DISABLED", "this list has no selection."), e.setSelection(i.ids), e.getSelection())
|
|
129
|
+
},
|
|
130
|
+
clear_selection: {
|
|
131
|
+
safety: "read",
|
|
132
|
+
idempotent: !0,
|
|
133
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.clearSelection",
|
|
134
|
+
description: "Clear the selection.",
|
|
135
|
+
invoke: (e) => e.clearSelection()
|
|
136
|
+
},
|
|
137
|
+
sort_by: {
|
|
138
|
+
safety: "read",
|
|
139
|
+
argsType: '{ colId: "fileName" | "supplier" | "invoiceNumber" | "date" | "lineCount" | "total" | "status", sort: "asc" | "desc" }',
|
|
140
|
+
argsSchema: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
colId: { enum: [...Xe] },
|
|
144
|
+
sort: { enum: ["asc", "desc"] }
|
|
145
|
+
},
|
|
146
|
+
required: ["colId", "sort"],
|
|
147
|
+
additionalProperties: !1
|
|
148
|
+
},
|
|
149
|
+
idempotent: !0,
|
|
150
|
+
errors: [
|
|
151
|
+
"COLUMN_MASKED: supplier cannot be sorted while privacy mode is on."
|
|
152
|
+
],
|
|
153
|
+
examples: [{ args: { colId: "status", sort: "asc" } }],
|
|
154
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.sortBy",
|
|
155
|
+
description: "Sort the invoices by one column. The selection is kept.",
|
|
156
|
+
invoke: (e, i) => {
|
|
157
|
+
const n = e.getColumns().find((s) => s.id === i.colId);
|
|
158
|
+
n != null && n.masked && T("COLUMN_MASKED", `"${i.colId}" is hidden by privacy mode.`), e.setSort([{ colId: i.colId, sort: i.sort }]);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
scroll_to_row: {
|
|
162
|
+
safety: "read",
|
|
163
|
+
argsType: "{ id: string }",
|
|
164
|
+
argsSchema: ie,
|
|
165
|
+
idempotent: !0,
|
|
166
|
+
errors: [
|
|
167
|
+
"UNKNOWN_ROW: the id is not in the list.",
|
|
168
|
+
"ROW_FILTERED_OUT: the search or a filter hides the invoice."
|
|
169
|
+
],
|
|
170
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.scrollToRow",
|
|
171
|
+
description: "Scroll one invoice into view.",
|
|
172
|
+
invoke: (e, i) => {
|
|
173
|
+
te(e, i.id), e.scrollToRow(i.id);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
open_review: {
|
|
177
|
+
safety: "read",
|
|
178
|
+
openWorld: !0,
|
|
179
|
+
argsType: "{ id: string }",
|
|
180
|
+
argsSchema: ie,
|
|
181
|
+
errors: [
|
|
182
|
+
"UNKNOWN_ROW: the id is not in the list.",
|
|
183
|
+
"ACTION_UNAVAILABLE: the list offers no review.",
|
|
184
|
+
"ACTION_DISABLED: error, the file could not be read."
|
|
185
|
+
],
|
|
186
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.openReview",
|
|
187
|
+
description: "Open one invoice for review. The host shows its lines. Nothing loads until the user confirms there.",
|
|
188
|
+
invoke: (e, i) => {
|
|
189
|
+
te(e, i.id), e.review(i.id);
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
load_all_ready: {
|
|
193
|
+
safety: "write",
|
|
194
|
+
openWorld: !0,
|
|
195
|
+
returns: "string[]",
|
|
196
|
+
errors: [
|
|
197
|
+
'ACTION_UNAVAILABLE: the list offers no "load all ready".',
|
|
198
|
+
"ACTION_DISABLED: noReadyInvoices."
|
|
199
|
+
],
|
|
200
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.loadAllReady",
|
|
201
|
+
description: "Hand every invoice that is ready to load to the host, which loads it into the warehouse. Returns the ids sent.",
|
|
202
|
+
invoke: (e) => e.loadAllReady()
|
|
203
|
+
},
|
|
204
|
+
load_selected: {
|
|
205
|
+
safety: "write",
|
|
206
|
+
openWorld: !0,
|
|
207
|
+
returns: "string[]",
|
|
208
|
+
errors: [
|
|
209
|
+
"ACTION_UNAVAILABLE: the list offers no bulk load.",
|
|
210
|
+
"ACTION_DISABLED: emptySelection."
|
|
211
|
+
],
|
|
212
|
+
descriptionKey: "ui.agent.invoiceUploadList.actions.loadSelected",
|
|
213
|
+
description: "Hand the selected invoices to the host, which loads them into the warehouse. Returns the ids sent.",
|
|
214
|
+
invoke: (e) => e.loadSelected()
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
domHooks: {
|
|
218
|
+
root: {
|
|
219
|
+
attr: "data-component",
|
|
220
|
+
value: "invoice-upload-list",
|
|
221
|
+
description: "Marks the element as a kit InvoiceUploadList."
|
|
222
|
+
},
|
|
223
|
+
instanceId: {
|
|
224
|
+
attr: "data-component-id",
|
|
225
|
+
sourceProp: "id",
|
|
226
|
+
description: "Sourced from id (default warehouse-invoice-upload-list)."
|
|
227
|
+
},
|
|
228
|
+
item: {
|
|
229
|
+
attr: "data-row-id",
|
|
230
|
+
description: "Opaque invoice id on each row (DataGrid). Act through the handle, not the DOM."
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}, tt = v("ds:w-full ds:min-w-0", {
|
|
234
|
+
variants: {
|
|
235
|
+
height: {
|
|
236
|
+
auto: "ds:block",
|
|
237
|
+
fill: "ds:flex ds:min-h-0 ds:flex-auto ds:flex-col"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
defaultVariants: { height: "auto" }
|
|
241
|
+
}), ae = v(
|
|
242
|
+
"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
243
|
+
{
|
|
244
|
+
variants: {
|
|
245
|
+
align: { start: "ds:items-start", end: "ds:items-end" }
|
|
246
|
+
},
|
|
247
|
+
defaultVariants: { align: "start" }
|
|
248
|
+
}
|
|
249
|
+
), re = v(
|
|
250
|
+
"type-meta ds:text-[color:var(--muted-foreground)]"
|
|
251
|
+
), it = v(
|
|
252
|
+
"type-meta ds:text-[color:var(--destructive)] ds:[overflow-wrap:anywhere]"
|
|
253
|
+
), le = v(
|
|
254
|
+
"ds:block ds:min-w-0 ds:max-w-full ds:truncate"
|
|
255
|
+
), ot = v(
|
|
256
|
+
"ds:block ds:min-w-0 ds:max-w-full ds:truncate ds:font-medium"
|
|
257
|
+
), ce = v("ds:tabular-nums"), nt = v(
|
|
258
|
+
"ds:inline-flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-xs)]"
|
|
259
|
+
), st = v("ds:inline-flex ds:shrink-0"), at = v(
|
|
260
|
+
"type-meta ds:m-0 ds:px-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:text-[color:var(--muted-foreground)]"
|
|
261
|
+
), rt = [
|
|
262
|
+
"fileName",
|
|
263
|
+
"supplier",
|
|
264
|
+
"invoiceNumber",
|
|
265
|
+
"date",
|
|
266
|
+
"lineCount",
|
|
267
|
+
"total",
|
|
268
|
+
"status",
|
|
269
|
+
"actions"
|
|
270
|
+
], lt = [
|
|
271
|
+
"fileName",
|
|
272
|
+
"supplier",
|
|
273
|
+
"invoiceNumber",
|
|
274
|
+
"date",
|
|
275
|
+
"lineCount",
|
|
276
|
+
"total",
|
|
277
|
+
"status"
|
|
278
|
+
], ei = ["company", "person"], ti = ["invoice", "creditNote"], ct = "warehouse-invoice-upload-list", oe = {
|
|
279
|
+
readyToLoad: 0,
|
|
280
|
+
toReview: 1,
|
|
281
|
+
error: 2,
|
|
282
|
+
alreadyLoaded: 3,
|
|
283
|
+
loaded: 4
|
|
284
|
+
};
|
|
285
|
+
function de(e) {
|
|
286
|
+
if (e === null) return null;
|
|
287
|
+
const i = We(e, He.lineTotal);
|
|
288
|
+
return i.ok ? i.value : null;
|
|
289
|
+
}
|
|
290
|
+
function dt(e, i) {
|
|
291
|
+
var n;
|
|
292
|
+
return i && ((n = e.supplier) == null ? void 0 : n.kind) === "person";
|
|
293
|
+
}
|
|
294
|
+
function ue(e) {
|
|
295
|
+
var i;
|
|
296
|
+
return ((i = e.supplier) == null ? void 0 : i.kind) === "person";
|
|
297
|
+
}
|
|
298
|
+
function M(e, i) {
|
|
299
|
+
return e.status === "readyToLoad" && !i.has(e.id);
|
|
300
|
+
}
|
|
301
|
+
function pe(e, i) {
|
|
302
|
+
return e.filter((n) => M(n, i)).map((n) => n.id);
|
|
303
|
+
}
|
|
304
|
+
function me(e) {
|
|
305
|
+
return je(e);
|
|
306
|
+
}
|
|
307
|
+
function ut(e) {
|
|
308
|
+
return e.invoiceNumber ? `${e.fileName} · ${e.invoiceNumber}` : e.fileName;
|
|
309
|
+
}
|
|
310
|
+
function pt(e, i, n, s) {
|
|
311
|
+
var c;
|
|
312
|
+
const l = dt(e, i), u = {
|
|
313
|
+
id: e.id,
|
|
314
|
+
fileId: e.fileId,
|
|
315
|
+
fileName: e.fileName,
|
|
316
|
+
status: e.status,
|
|
317
|
+
supplierKind: ((c = e.supplier) == null ? void 0 : c.kind) ?? null,
|
|
318
|
+
invoiceNumber: e.invoiceNumber,
|
|
319
|
+
date: e.date,
|
|
320
|
+
lineCount: e.lineCount,
|
|
321
|
+
loading: n.has(e.id),
|
|
322
|
+
hasError: e.status === "error",
|
|
323
|
+
selectable: M(e, n),
|
|
324
|
+
review: s ? e.status === "error" ? { disabled: "error" } : "enabled" : null
|
|
325
|
+
};
|
|
326
|
+
return e.supplier && !l && (u.supplierName = e.supplier.name), u;
|
|
327
|
+
}
|
|
328
|
+
const ne = /* @__PURE__ */ new Map(), mt = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
329
|
+
function ft(e, i) {
|
|
330
|
+
const n = mt.exec(e);
|
|
331
|
+
if (!n) return e;
|
|
332
|
+
const [, s, l, u] = n, c = new Date(
|
|
333
|
+
Date.UTC(Number(s), Number(l) - 1, Number(u))
|
|
334
|
+
);
|
|
335
|
+
if (Number.isNaN(c.getTime())) return e;
|
|
336
|
+
const o = qe(i);
|
|
337
|
+
let t = ne.get(o);
|
|
338
|
+
return t || (t = new Intl.DateTimeFormat(o, {
|
|
339
|
+
dateStyle: "medium",
|
|
340
|
+
timeZone: "UTC"
|
|
341
|
+
}), ne.set(o, t)), t.format(c);
|
|
342
|
+
}
|
|
343
|
+
const ht = new Set(
|
|
344
|
+
lt
|
|
345
|
+
);
|
|
346
|
+
function fe(e) {
|
|
347
|
+
return ht.has(e);
|
|
348
|
+
}
|
|
349
|
+
function vt(e) {
|
|
350
|
+
const i = [];
|
|
351
|
+
for (const n of e)
|
|
352
|
+
fe(n.colId) && i.push({ colId: n.colId, sort: n.sort });
|
|
353
|
+
return i;
|
|
354
|
+
}
|
|
355
|
+
function yt({ invoice: e }) {
|
|
356
|
+
return /* @__PURE__ */ a("span", { dir: "auto", className: ot(), children: e.fileName });
|
|
357
|
+
}
|
|
358
|
+
function A() {
|
|
359
|
+
const { t: e } = L("ui");
|
|
360
|
+
return /* @__PURE__ */ a("span", { className: re(), children: e("invoiceUploadList.cell.notFound", "Not found") });
|
|
361
|
+
}
|
|
362
|
+
function gt({ invoice: e }) {
|
|
363
|
+
return e.supplier === null ? /* @__PURE__ */ a(A, {}) : /* @__PURE__ */ a("span", { dir: "auto", className: le(), children: e.supplier.name });
|
|
364
|
+
}
|
|
365
|
+
function bt({ invoice: e }) {
|
|
366
|
+
const { t: i } = L("ui");
|
|
367
|
+
return e.invoiceNumber === null ? /* @__PURE__ */ a(A, {}) : /* @__PURE__ */ h("span", { className: ae(), children: [
|
|
368
|
+
/* @__PURE__ */ a("span", { dir: "auto", className: le(), children: e.invoiceNumber }),
|
|
369
|
+
e.documentKind === "creditNote" ? /* @__PURE__ */ a("span", { className: re(), children: i("invoiceUploadList.documentKind.creditNote", "Credit note") }) : null
|
|
370
|
+
] });
|
|
371
|
+
}
|
|
372
|
+
function Lt({ invoice: e }) {
|
|
373
|
+
const { i18n: i } = L("ui");
|
|
374
|
+
return e.date === null ? /* @__PURE__ */ a(A, {}) : /* @__PURE__ */ a(D, { children: ft(e.date, i.language) });
|
|
375
|
+
}
|
|
376
|
+
function Nt({ invoice: e }) {
|
|
377
|
+
const { i18n: i } = L("ui");
|
|
378
|
+
return e.lineCount === null ? /* @__PURE__ */ a(A, {}) : /* @__PURE__ */ a("span", { className: ce(), children: se(e.lineCount, i.language) });
|
|
379
|
+
}
|
|
380
|
+
function St({ invoice: e }) {
|
|
381
|
+
if (e.total === null) return /* @__PURE__ */ a(A, {});
|
|
382
|
+
const i = de(e.total);
|
|
383
|
+
return i ? /* @__PURE__ */ a(
|
|
384
|
+
ze,
|
|
385
|
+
{
|
|
386
|
+
size: "sm",
|
|
387
|
+
value: i.units,
|
|
388
|
+
scale: i.scale,
|
|
389
|
+
currency: e.currency,
|
|
390
|
+
minimumFractionDigits: Math.min(2, i.scale),
|
|
391
|
+
maximumFractionDigits: Math.max(2, i.scale)
|
|
392
|
+
}
|
|
393
|
+
) : /* @__PURE__ */ a("span", { dir: "ltr", className: ce(), children: e.total.trim() });
|
|
394
|
+
}
|
|
395
|
+
function It({ invoice: e, loading: i, privacyMode: n }) {
|
|
396
|
+
const { t: s } = L("ui");
|
|
397
|
+
if (i) {
|
|
398
|
+
const c = s("invoiceUploadList.loading", "Loading");
|
|
399
|
+
return /* @__PURE__ */ h("span", { className: nt(), children: [
|
|
400
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: st(), children: /* @__PURE__ */ a(Pe, { size: "sm", label: c }) }),
|
|
401
|
+
/* @__PURE__ */ a("span", { children: c })
|
|
402
|
+
] });
|
|
403
|
+
}
|
|
404
|
+
const l = B[e.status];
|
|
405
|
+
let u = null;
|
|
406
|
+
return e.status === "error" && (u = n && ue(e) ? s(
|
|
407
|
+
"invoiceUploadList.errorHidden",
|
|
408
|
+
"This file could not be read (details hidden in privacy mode)"
|
|
409
|
+
) : e.error ?? null), /* @__PURE__ */ h("span", { className: ae(), children: [
|
|
410
|
+
/* @__PURE__ */ a(
|
|
411
|
+
Ke,
|
|
412
|
+
{
|
|
413
|
+
size: "sm",
|
|
414
|
+
variant: l.variant,
|
|
415
|
+
withDot: !l.check,
|
|
416
|
+
leading: l.check ? /* @__PURE__ */ a(Ye, { "aria-hidden": "true" }) : void 0,
|
|
417
|
+
children: s(l.key, l.en)
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
u ? /* @__PURE__ */ a("span", { dir: "auto", className: it(), children: u }) : null
|
|
421
|
+
] });
|
|
422
|
+
}
|
|
423
|
+
function wt(e, i) {
|
|
424
|
+
const { t: n } = L("ui");
|
|
425
|
+
return S(() => i ? [
|
|
426
|
+
{
|
|
427
|
+
// Developer constant: React key and `data-action-id`.
|
|
428
|
+
id: "review",
|
|
429
|
+
icon: Oe(Je, { "aria-hidden": !0 }),
|
|
430
|
+
label: n("invoiceUploadList.action.review", "Review"),
|
|
431
|
+
onClick: (s) => {
|
|
432
|
+
var l, u;
|
|
433
|
+
return (u = (l = e.current).onReview) == null ? void 0 : u.call(l, s);
|
|
434
|
+
},
|
|
435
|
+
disabled: (s) => s.status === "error",
|
|
436
|
+
disabledReason: (s) => s.status === "error" ? n(
|
|
437
|
+
"invoiceUploadList.action.reviewDisabledError",
|
|
438
|
+
"This file has an error, so there is nothing to review"
|
|
439
|
+
) : void 0
|
|
440
|
+
}
|
|
441
|
+
] : [], [n, e, i]);
|
|
442
|
+
}
|
|
443
|
+
function Rt({
|
|
444
|
+
privacyMode: e,
|
|
445
|
+
loadingIds: i,
|
|
446
|
+
rowActions: n
|
|
447
|
+
}) {
|
|
448
|
+
const { t: s } = L("ui");
|
|
449
|
+
return S(() => {
|
|
450
|
+
const l = (t) => {
|
|
451
|
+
const r = B[t];
|
|
452
|
+
return s(r.key, r.en);
|
|
453
|
+
}, u = V.map(
|
|
454
|
+
(t) => ({ value: t, label: l(t) })
|
|
455
|
+
), c = s("dataTable.actions", "Actions");
|
|
456
|
+
return [
|
|
457
|
+
{
|
|
458
|
+
id: "fileName",
|
|
459
|
+
header: s("invoiceUploadList.column.fileName", "File"),
|
|
460
|
+
rowHeader: !0,
|
|
461
|
+
pin: "start",
|
|
462
|
+
hideable: !1,
|
|
463
|
+
reorderable: !1,
|
|
464
|
+
pinnable: !1,
|
|
465
|
+
size: 240,
|
|
466
|
+
minSize: 160,
|
|
467
|
+
value: (t) => t.fileName,
|
|
468
|
+
exportValue: (t) => t.fileName,
|
|
469
|
+
sort: "text",
|
|
470
|
+
cell: (t) => /* @__PURE__ */ a(yt, { invoice: t })
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: "supplier",
|
|
474
|
+
header: s("invoiceUploadList.column.supplier", "Supplier"),
|
|
475
|
+
size: 240,
|
|
476
|
+
minSize: 160,
|
|
477
|
+
value: (t) => {
|
|
478
|
+
var r;
|
|
479
|
+
return ((r = t.supplier) == null ? void 0 : r.name) ?? null;
|
|
480
|
+
},
|
|
481
|
+
// Off while privacy mode is on: the whole column leaves sorting.
|
|
482
|
+
sort: "text",
|
|
483
|
+
// People are masked; companies stay visible.
|
|
484
|
+
privacy: { mode: "mask", appliesTo: ue },
|
|
485
|
+
cell: (t) => /* @__PURE__ */ a(gt, { invoice: t })
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
id: "invoiceNumber",
|
|
489
|
+
header: s("invoiceUploadList.column.invoiceNumber", "Invoice number"),
|
|
490
|
+
size: 160,
|
|
491
|
+
responsiveTier: 1,
|
|
492
|
+
value: (t) => t.invoiceNumber,
|
|
493
|
+
exportValue: (t) => t.invoiceNumber,
|
|
494
|
+
sort: "text",
|
|
495
|
+
cell: (t) => /* @__PURE__ */ a(bt, { invoice: t })
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: "date",
|
|
499
|
+
header: s("invoiceUploadList.column.date", "Date"),
|
|
500
|
+
size: 128,
|
|
501
|
+
responsiveTier: 1,
|
|
502
|
+
// A calendar day `YYYY-MM-DD`; DataGrid formats it for export.
|
|
503
|
+
value: (t) => t.date,
|
|
504
|
+
sort: "date",
|
|
505
|
+
sortDescFirst: !0,
|
|
506
|
+
search: !1,
|
|
507
|
+
cell: (t) => /* @__PURE__ */ a(Lt, { invoice: t })
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
id: "lineCount",
|
|
511
|
+
header: s("invoiceUploadList.column.lineCount", "Lines"),
|
|
512
|
+
align: "end",
|
|
513
|
+
size: 96,
|
|
514
|
+
responsiveTier: 2,
|
|
515
|
+
value: (t) => t.lineCount,
|
|
516
|
+
sort: "number",
|
|
517
|
+
sortDescFirst: !0,
|
|
518
|
+
search: !1,
|
|
519
|
+
cell: (t) => /* @__PURE__ */ a(Nt, { invoice: t })
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
id: "total",
|
|
523
|
+
header: s("invoiceUploadList.column.total", "Total"),
|
|
524
|
+
align: "end",
|
|
525
|
+
size: 136,
|
|
526
|
+
responsiveTier: 1,
|
|
527
|
+
value: (t) => {
|
|
528
|
+
const r = de(t.total);
|
|
529
|
+
return r ? $e(r) : null;
|
|
530
|
+
},
|
|
531
|
+
exportValue: (t) => t.total,
|
|
532
|
+
sort: "number",
|
|
533
|
+
sortDescFirst: !0,
|
|
534
|
+
search: !1,
|
|
535
|
+
cell: (t) => /* @__PURE__ */ a(St, { invoice: t })
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
id: "status",
|
|
539
|
+
header: s("invoiceUploadList.column.status", "Status"),
|
|
540
|
+
size: 224,
|
|
541
|
+
minSize: 160,
|
|
542
|
+
wrap: !0,
|
|
543
|
+
value: (t) => t.status,
|
|
544
|
+
exportValue: (t) => l(t.status),
|
|
545
|
+
// Work to do first: ready, to review, error, then the rest.
|
|
546
|
+
sort: (t, r) => oe[t.status] - oe[r.status],
|
|
547
|
+
filter: { kind: "select", options: u },
|
|
548
|
+
search: !1,
|
|
549
|
+
cell: (t) => /* @__PURE__ */ a(
|
|
550
|
+
It,
|
|
551
|
+
{
|
|
552
|
+
invoice: t,
|
|
553
|
+
loading: i.has(t.id),
|
|
554
|
+
privacyMode: e
|
|
555
|
+
}
|
|
556
|
+
)
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
id: "actions",
|
|
560
|
+
header: /* @__PURE__ */ a(x, { children: c }),
|
|
561
|
+
headerLabel: c,
|
|
562
|
+
pin: "end",
|
|
563
|
+
size: 120,
|
|
564
|
+
hideable: !1,
|
|
565
|
+
reorderable: !1,
|
|
566
|
+
pinnable: !1,
|
|
567
|
+
resizable: !1,
|
|
568
|
+
exportable: !1,
|
|
569
|
+
printable: !1,
|
|
570
|
+
search: !1,
|
|
571
|
+
// Kit RowActions, named by reference ("Actions, invoice.xml"),
|
|
572
|
+
// never by row data in an attribute.
|
|
573
|
+
cell: (t, r) => /* @__PURE__ */ a(
|
|
574
|
+
Fe,
|
|
575
|
+
{
|
|
576
|
+
row: t,
|
|
577
|
+
actions: n,
|
|
578
|
+
"aria-labelledby": r.inputLabelledBy
|
|
579
|
+
}
|
|
580
|
+
)
|
|
581
|
+
}
|
|
582
|
+
];
|
|
583
|
+
}, [s, e, i, n]);
|
|
584
|
+
}
|
|
585
|
+
function b(e, i) {
|
|
586
|
+
throw new Error(`${e}: ${i}`);
|
|
587
|
+
}
|
|
588
|
+
const At = new Set(rt);
|
|
589
|
+
function Tt(e) {
|
|
590
|
+
return At.has(e);
|
|
591
|
+
}
|
|
592
|
+
function Ut(e, i) {
|
|
593
|
+
const n = () => e.current, s = () => i.current;
|
|
594
|
+
function l(o) {
|
|
595
|
+
return s().invoices.find((r) => r.id === o) ?? b("UNKNOWN_ROW", `no invoice "${o}" in the list.`);
|
|
596
|
+
}
|
|
597
|
+
function u(o) {
|
|
598
|
+
var d;
|
|
599
|
+
const t = l(o), r = (d = n()) == null ? void 0 : d.getRowIds();
|
|
600
|
+
return r && !r.includes(o) && b(
|
|
601
|
+
"ROW_FILTERED_OUT",
|
|
602
|
+
`invoice "${o}" is hidden by the search or a filter.`
|
|
603
|
+
), t;
|
|
604
|
+
}
|
|
605
|
+
function c() {
|
|
606
|
+
const { invoices: o, loadingIds: t } = s();
|
|
607
|
+
return pe(o, t);
|
|
608
|
+
}
|
|
609
|
+
return {
|
|
610
|
+
getFeatures() {
|
|
611
|
+
const { privacyMode: o, status: t, selectable: r } = s();
|
|
612
|
+
return { privacyMode: o, status: t, selectable: r, readyCount: c().length };
|
|
613
|
+
},
|
|
614
|
+
getRowIds() {
|
|
615
|
+
var o;
|
|
616
|
+
return ((o = n()) == null ? void 0 : o.getRowIds()) ?? s().invoices.map((t) => t.id);
|
|
617
|
+
},
|
|
618
|
+
getRowSummaries() {
|
|
619
|
+
const { invoices: o, privacyMode: t, loadingIds: r, callbacks: d } = s(), I = !!d.onReview;
|
|
620
|
+
return o.map(
|
|
621
|
+
(N) => pt(N, t, r, I)
|
|
622
|
+
);
|
|
623
|
+
},
|
|
624
|
+
getCounts() {
|
|
625
|
+
return me(s().invoices);
|
|
626
|
+
},
|
|
627
|
+
getSelection() {
|
|
628
|
+
var o;
|
|
629
|
+
return ((o = n()) == null ? void 0 : o.getSelection()) ?? [];
|
|
630
|
+
},
|
|
631
|
+
setSelection(o) {
|
|
632
|
+
var t;
|
|
633
|
+
(t = n()) == null || t.setSelection(o);
|
|
634
|
+
},
|
|
635
|
+
selectReady() {
|
|
636
|
+
const o = n();
|
|
637
|
+
return o ? (o.setSelection(c()), o.getSelection()) : [];
|
|
638
|
+
},
|
|
639
|
+
clearSelection() {
|
|
640
|
+
var o;
|
|
641
|
+
(o = n()) == null || o.clearSelection();
|
|
642
|
+
},
|
|
643
|
+
getSort() {
|
|
644
|
+
var o;
|
|
645
|
+
return vt(((o = n()) == null ? void 0 : o.getSort()) ?? []);
|
|
646
|
+
},
|
|
647
|
+
setSort(o) {
|
|
648
|
+
const t = n();
|
|
649
|
+
if (!t) return;
|
|
650
|
+
const r = new Set(
|
|
651
|
+
t.getColumns().filter((d) => d.masked === !0).map((d) => d.id)
|
|
652
|
+
);
|
|
653
|
+
for (const d of o)
|
|
654
|
+
if (!fe(d.colId) || r.has(d.colId))
|
|
655
|
+
return;
|
|
656
|
+
t.setSort(o);
|
|
657
|
+
},
|
|
658
|
+
getColumns() {
|
|
659
|
+
const o = n();
|
|
660
|
+
if (!o) return [];
|
|
661
|
+
const { privacyMode: t } = s(), r = [];
|
|
662
|
+
for (const d of o.getColumns())
|
|
663
|
+
Tt(d.id) && r.push({
|
|
664
|
+
id: d.id,
|
|
665
|
+
label: d.label,
|
|
666
|
+
visible: d.visible,
|
|
667
|
+
canHide: d.canHide,
|
|
668
|
+
sortable: d.sortable,
|
|
669
|
+
masked: d.masked ?? (t && d.id === "supplier")
|
|
670
|
+
});
|
|
671
|
+
return r;
|
|
672
|
+
},
|
|
673
|
+
hasRow(o) {
|
|
674
|
+
return s().invoices.some((t) => t.id === o);
|
|
675
|
+
},
|
|
676
|
+
scrollToRow(o) {
|
|
677
|
+
var t;
|
|
678
|
+
u(o), (t = n()) == null || t.scrollToRow(o);
|
|
679
|
+
},
|
|
680
|
+
focusRow(o) {
|
|
681
|
+
var t;
|
|
682
|
+
u(o), (t = n()) == null || t.focusRow(o, "fileName");
|
|
683
|
+
},
|
|
684
|
+
review(o) {
|
|
685
|
+
const t = l(o), { callbacks: r } = s();
|
|
686
|
+
r.onReview || b("ACTION_UNAVAILABLE", "this list offers no review."), t.status === "error" && b("ACTION_DISABLED", "error"), r.onReview(t);
|
|
687
|
+
},
|
|
688
|
+
loadAllReady() {
|
|
689
|
+
const { callbacks: o } = s();
|
|
690
|
+
o.onLoadAllReady || b("ACTION_UNAVAILABLE", 'this list offers no "load all ready".');
|
|
691
|
+
const t = c();
|
|
692
|
+
return t.length === 0 && b("ACTION_DISABLED", "noReadyInvoices"), o.onLoadAllReady(t), t;
|
|
693
|
+
},
|
|
694
|
+
loadSelected() {
|
|
695
|
+
var r;
|
|
696
|
+
const { callbacks: o } = s();
|
|
697
|
+
o.onLoadSelected || b("ACTION_UNAVAILABLE", "this list offers no bulk load.");
|
|
698
|
+
const t = ((r = n()) == null ? void 0 : r.getSelection()) ?? [];
|
|
699
|
+
return t.length === 0 && b("ACTION_DISABLED", "emptySelection"), o.onLoadSelected(t), t;
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
const Ct = [], _t = (e) => e.id, Ot = (e) => ut(e), kt = ke(function(i, n) {
|
|
704
|
+
const {
|
|
705
|
+
id: s = ct,
|
|
706
|
+
invoices: l,
|
|
707
|
+
status: u = "ready",
|
|
708
|
+
error: c,
|
|
709
|
+
selection: o,
|
|
710
|
+
defaultSelection: t,
|
|
711
|
+
onSelectionChange: r,
|
|
712
|
+
onReview: d,
|
|
713
|
+
onLoadAllReady: I,
|
|
714
|
+
onLoadSelected: N,
|
|
715
|
+
loadingIds: F = Ct,
|
|
716
|
+
privacyMode: U = !1,
|
|
717
|
+
caption: he,
|
|
718
|
+
density: ve = "default",
|
|
719
|
+
height: K = "auto",
|
|
720
|
+
persistColumnState: ye = !0,
|
|
721
|
+
className: ge,
|
|
722
|
+
"aria-label": be,
|
|
723
|
+
"aria-labelledby": Le,
|
|
724
|
+
"aria-describedby": Ne,
|
|
725
|
+
...Se
|
|
726
|
+
} = i, { t: p, i18n: z } = L("ui"), C = R(null), y = S(() => new Set(F), [F]), P = !!N || o !== void 0 || t !== void 0 || r !== void 0, W = Ee(), _ = {
|
|
727
|
+
onReview: d,
|
|
728
|
+
onLoadAllReady: I,
|
|
729
|
+
onLoadSelected: N
|
|
730
|
+
}, H = R(_);
|
|
731
|
+
H.current = _;
|
|
732
|
+
const $ = {
|
|
733
|
+
invoices: l,
|
|
734
|
+
callbacks: _,
|
|
735
|
+
loadingIds: y,
|
|
736
|
+
privacyMode: U,
|
|
737
|
+
status: u,
|
|
738
|
+
selectable: P
|
|
739
|
+
}, q = R($);
|
|
740
|
+
q.current = $;
|
|
741
|
+
const [O] = X(
|
|
742
|
+
() => Ut(C, q)
|
|
743
|
+
);
|
|
744
|
+
De(n, () => O, [O]), Ve(et, O, s);
|
|
745
|
+
const w = S(
|
|
746
|
+
() => pe(l, y),
|
|
747
|
+
[l, y]
|
|
748
|
+
), j = S(() => me(l), [l]), Ie = wt(H, !!d), we = Rt({
|
|
749
|
+
privacyMode: U,
|
|
750
|
+
loadingIds: y,
|
|
751
|
+
rowActions: Ie
|
|
752
|
+
}), Re = S(
|
|
753
|
+
() => (m) => {
|
|
754
|
+
if (M(m, y)) return "selectable";
|
|
755
|
+
if (y.has(m.id))
|
|
756
|
+
return {
|
|
757
|
+
state: "none",
|
|
758
|
+
reason: p(
|
|
759
|
+
"invoiceUploadList.selection.loadingReason",
|
|
760
|
+
"This invoice is being loaded"
|
|
761
|
+
)
|
|
762
|
+
};
|
|
763
|
+
const f = {
|
|
764
|
+
toReview: p(
|
|
765
|
+
"invoiceUploadList.selection.toReviewReason",
|
|
766
|
+
"Review this invoice before you load it"
|
|
767
|
+
),
|
|
768
|
+
alreadyLoaded: p(
|
|
769
|
+
"invoiceUploadList.selection.alreadyLoadedReason",
|
|
770
|
+
"This invoice is already in the warehouse"
|
|
771
|
+
),
|
|
772
|
+
loaded: p(
|
|
773
|
+
"invoiceUploadList.selection.loadedReason",
|
|
774
|
+
"This invoice is loaded"
|
|
775
|
+
),
|
|
776
|
+
error: p(
|
|
777
|
+
"invoiceUploadList.selection.errorReason",
|
|
778
|
+
"This file has an error"
|
|
779
|
+
)
|
|
780
|
+
};
|
|
781
|
+
return {
|
|
782
|
+
state: "none",
|
|
783
|
+
reason: m.status === "readyToLoad" ? f.toReview : f[m.status]
|
|
784
|
+
};
|
|
785
|
+
},
|
|
786
|
+
[y, p]
|
|
787
|
+
), Ae = (m) => {
|
|
788
|
+
m && requestAnimationFrame(() => {
|
|
789
|
+
var J;
|
|
790
|
+
const f = document.activeElement;
|
|
791
|
+
(!f || f === document.body) && ((J = C.current) == null || J.focusRow(m, "fileName"));
|
|
792
|
+
});
|
|
793
|
+
}, Te = V.map((m) => {
|
|
794
|
+
const f = B[m];
|
|
795
|
+
return { value: m, label: p(f.key, f.en) };
|
|
796
|
+
}), Ue = /* @__PURE__ */ h(g, { children: [
|
|
797
|
+
/* @__PURE__ */ h(g.FilterBar, { children: [
|
|
798
|
+
/* @__PURE__ */ a(
|
|
799
|
+
g.QuickSearch,
|
|
800
|
+
{
|
|
801
|
+
placeholder: p(
|
|
802
|
+
"invoiceUploadList.search.placeholder",
|
|
803
|
+
"Search by file, supplier or invoice number"
|
|
804
|
+
)
|
|
805
|
+
}
|
|
806
|
+
),
|
|
807
|
+
/* @__PURE__ */ a(
|
|
808
|
+
g.FacetFilter,
|
|
809
|
+
{
|
|
810
|
+
field: "status",
|
|
811
|
+
label: p("invoiceUploadList.column.status", "Status"),
|
|
812
|
+
options: [
|
|
813
|
+
{ value: null, label: p("dataTable.selectFilter.all", "All") },
|
|
814
|
+
...Te
|
|
815
|
+
]
|
|
816
|
+
}
|
|
817
|
+
),
|
|
818
|
+
/* @__PURE__ */ a(g.FilterChips, {})
|
|
819
|
+
] }),
|
|
820
|
+
/* @__PURE__ */ h(g.Actions, { children: [
|
|
821
|
+
N ? /* @__PURE__ */ a(
|
|
822
|
+
g.BulkAction,
|
|
823
|
+
{
|
|
824
|
+
label: p("invoiceUploadList.bulk.loadSelected", "Load selected"),
|
|
825
|
+
icon: /* @__PURE__ */ a(ee, { "aria-hidden": "true" }),
|
|
826
|
+
onAction: ({ selectedRowIds: m }) => {
|
|
827
|
+
const f = [...m];
|
|
828
|
+
N(f), Ae(f[0]);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
) : null,
|
|
832
|
+
I ? /* @__PURE__ */ h(D, { children: [
|
|
833
|
+
/* @__PURE__ */ a(
|
|
834
|
+
Be,
|
|
835
|
+
{
|
|
836
|
+
intent: "primary",
|
|
837
|
+
size: "sm",
|
|
838
|
+
startIcon: /* @__PURE__ */ a(ee, { "aria-hidden": "true" }),
|
|
839
|
+
"aria-disabled": w.length === 0 ? !0 : void 0,
|
|
840
|
+
"aria-describedby": w.length === 0 ? W : void 0,
|
|
841
|
+
onClick: () => {
|
|
842
|
+
w.length !== 0 && I(w);
|
|
843
|
+
},
|
|
844
|
+
children: p(
|
|
845
|
+
"invoiceUploadList.loadAllReady",
|
|
846
|
+
"Load all ready ({{countText}})",
|
|
847
|
+
{
|
|
848
|
+
countText: se(w.length, z.language)
|
|
849
|
+
}
|
|
850
|
+
)
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
/* @__PURE__ */ a(x, { id: W, children: p(
|
|
854
|
+
"invoiceUploadList.loadAllReadyNone",
|
|
855
|
+
"No invoice is ready to load"
|
|
856
|
+
) })
|
|
857
|
+
] }) : null,
|
|
858
|
+
/* @__PURE__ */ a(g.ColumnToggle, {})
|
|
859
|
+
] })
|
|
860
|
+
] }), G = V.filter(
|
|
861
|
+
(m) => j[m] > 0
|
|
862
|
+
), k = G.map(
|
|
863
|
+
(m) => Ge(p, z.language, m, j[m])
|
|
864
|
+
), [Ce, _e] = X(""), Y = R(!1), Q = k.join(", "), Z = R(Q);
|
|
865
|
+
Z.current = Q;
|
|
866
|
+
const E = y.size > 0;
|
|
867
|
+
return xe(() => {
|
|
868
|
+
Y.current && !E && _e(Z.current), Y.current = E;
|
|
869
|
+
}, [E]), /* @__PURE__ */ h(
|
|
870
|
+
"div",
|
|
871
|
+
{
|
|
872
|
+
"data-component": "invoice-upload-list",
|
|
873
|
+
"data-component-id": s,
|
|
874
|
+
className: tt({ height: K, className: ge }),
|
|
875
|
+
...Se,
|
|
876
|
+
children: [
|
|
877
|
+
/* @__PURE__ */ a(
|
|
878
|
+
Me,
|
|
879
|
+
{
|
|
880
|
+
ref: C,
|
|
881
|
+
columns: we,
|
|
882
|
+
rows: l,
|
|
883
|
+
getRowId: _t,
|
|
884
|
+
caption: he ?? p("invoiceUploadList.caption", "Uploaded invoices"),
|
|
885
|
+
"aria-label": be,
|
|
886
|
+
"aria-labelledby": Le,
|
|
887
|
+
"aria-describedby": Ne,
|
|
888
|
+
gridId: s,
|
|
889
|
+
registerAgent: !1,
|
|
890
|
+
persistColumnState: ye,
|
|
891
|
+
dataMode: "client",
|
|
892
|
+
selectionMode: P ? "multiple" : "none",
|
|
893
|
+
rowSelection: o,
|
|
894
|
+
defaultRowSelection: t,
|
|
895
|
+
onRowSelectionChange: r,
|
|
896
|
+
getRowSelectability: Re,
|
|
897
|
+
selectAllScope: "all",
|
|
898
|
+
rangeSelection: !0,
|
|
899
|
+
columnResizing: !0,
|
|
900
|
+
responsiveColumns: !0,
|
|
901
|
+
getRowLabel: Ot,
|
|
902
|
+
rowLabelPrivacySafe: !0,
|
|
903
|
+
status: u,
|
|
904
|
+
error: {
|
|
905
|
+
title: (c == null ? void 0 : c.title) ?? p(
|
|
906
|
+
"invoiceUploadList.error.title",
|
|
907
|
+
"The uploaded invoices could not be shown"
|
|
908
|
+
),
|
|
909
|
+
description: c == null ? void 0 : c.description,
|
|
910
|
+
onRetry: c == null ? void 0 : c.onRetry
|
|
911
|
+
},
|
|
912
|
+
empty: {
|
|
913
|
+
title: p("invoiceUploadList.empty.title", "No invoices uploaded yet"),
|
|
914
|
+
description: p(
|
|
915
|
+
"invoiceUploadList.empty.description",
|
|
916
|
+
"Invoices from the files you upload appear here."
|
|
917
|
+
),
|
|
918
|
+
noResultsTitle: p(
|
|
919
|
+
"invoiceUploadList.empty.noResultsTitle",
|
|
920
|
+
"No invoices match your search"
|
|
921
|
+
)
|
|
922
|
+
},
|
|
923
|
+
toolbar: Ue,
|
|
924
|
+
density: ve,
|
|
925
|
+
height: K,
|
|
926
|
+
privacyMode: U,
|
|
927
|
+
hostTextPrivacySafe: !0
|
|
928
|
+
}
|
|
929
|
+
),
|
|
930
|
+
k.length > 0 ? /* @__PURE__ */ a("p", { className: at(), children: k.map((m, f) => /* @__PURE__ */ h("span", { children: [
|
|
931
|
+
f > 0 ? /* @__PURE__ */ h(D, { children: [
|
|
932
|
+
" ",
|
|
933
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: "·" }),
|
|
934
|
+
" "
|
|
935
|
+
] }) : null,
|
|
936
|
+
m
|
|
937
|
+
] }, G[f])) }) : null,
|
|
938
|
+
/* @__PURE__ */ a(x, { role: "status", "aria-atomic": "true", children: Ce })
|
|
939
|
+
]
|
|
940
|
+
}
|
|
941
|
+
);
|
|
942
|
+
});
|
|
943
|
+
kt.displayName = "InvoiceUploadList";
|
|
944
|
+
export {
|
|
945
|
+
ti as I,
|
|
946
|
+
ei as a,
|
|
947
|
+
rt as b,
|
|
948
|
+
lt as c,
|
|
949
|
+
kt as d,
|
|
950
|
+
et as i
|
|
951
|
+
};
|
|
952
|
+
//# sourceMappingURL=invoice-upload-list-CsFsRgbt.js.map
|