@hub-kit/core 0.3.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/README.md +125 -0
- package/cli/hub-kit.mjs +112 -0
- package/dist/adapters/bank-reconciliation.d.ts +100 -0
- package/dist/adapters/bank-reconciliation.js +1 -0
- package/dist/adapters/bank-sync-log.d.ts +46 -0
- package/dist/adapters/bank-sync-log.js +1 -0
- package/dist/adapters/category-rules.d.ts +94 -0
- package/dist/adapters/category-rules.js +1 -0
- package/dist/adapters/companies.d.ts +85 -0
- package/dist/adapters/companies.js +3 -0
- package/dist/adapters/customers.d.ts +71 -0
- package/dist/adapters/customers.js +1 -0
- package/dist/adapters/exclusion-rules.d.ts +34 -0
- package/dist/adapters/exclusion-rules.js +15 -0
- package/dist/adapters/file-naming.d.ts +36 -0
- package/dist/adapters/file-naming.js +1 -0
- package/dist/adapters/index.d.ts +24 -0
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/invoice-detail.d.ts +126 -0
- package/dist/adapters/invoice-detail.js +1 -0
- package/dist/adapters/invoice-list.d.ts +63 -0
- package/dist/adapters/invoice-list.js +1 -0
- package/dist/adapters/invoice-upload.d.ts +26 -0
- package/dist/adapters/invoice-upload.js +1 -0
- package/dist/adapters/manual-bookings.d.ts +56 -0
- package/dist/adapters/manual-bookings.js +1 -0
- package/dist/adapters/notifications.d.ts +31 -0
- package/dist/adapters/notifications.js +1 -0
- package/dist/adapters/open-items.d.ts +42 -0
- package/dist/adapters/open-items.js +1 -0
- package/dist/adapters/opos-whitelist.d.ts +38 -0
- package/dist/adapters/opos-whitelist.js +1 -0
- package/dist/adapters/outgoing-invoices.d.ts +32 -0
- package/dist/adapters/outgoing-invoices.js +1 -0
- package/dist/adapters/overview.d.ts +68 -0
- package/dist/adapters/overview.js +1 -0
- package/dist/adapters/processing-log.d.ts +48 -0
- package/dist/adapters/processing-log.js +1 -0
- package/dist/adapters/properties.d.ts +87 -0
- package/dist/adapters/properties.js +1 -0
- package/dist/adapters/supplier-detail.d.ts +64 -0
- package/dist/adapters/supplier-detail.js +1 -0
- package/dist/adapters/supplier-list.d.ts +21 -0
- package/dist/adapters/supplier-list.js +1 -0
- package/dist/adapters/team.d.ts +79 -0
- package/dist/adapters/team.js +1 -0
- package/dist/adapters/trash.d.ts +26 -0
- package/dist/adapters/trash.js +1 -0
- package/dist/adapters/vat-rules.d.ts +83 -0
- package/dist/adapters/vat-rules.js +1 -0
- package/dist/components/access/index.d.ts +3 -0
- package/dist/components/access/index.js +3 -0
- package/dist/components/access/permission-checklist.d.ts +13 -0
- package/dist/components/access/permission-checklist.js +19 -0
- package/dist/components/access/permission-matrix.d.ts +12 -0
- package/dist/components/access/permission-matrix.js +18 -0
- package/dist/components/access/types.d.ts +15 -0
- package/dist/components/access/types.js +1 -0
- package/dist/components/dashboard/date-range-calendar.d.ts +19 -0
- package/dist/components/dashboard/date-range-calendar.js +97 -0
- package/dist/components/dashboard/index.d.ts +23 -0
- package/dist/components/dashboard/index.js +14 -0
- package/dist/components/dashboard/kpi-card.d.ts +13 -0
- package/dist/components/dashboard/kpi-card.js +7 -0
- package/dist/components/dashboard/money-cards-row.d.ts +29 -0
- package/dist/components/dashboard/money-cards-row.js +28 -0
- package/dist/components/dashboard/money-trend-chart.d.ts +13 -0
- package/dist/components/dashboard/money-trend-chart.js +16 -0
- package/dist/components/dashboard/panel.d.ts +9 -0
- package/dist/components/dashboard/panel.js +5 -0
- package/dist/components/dashboard/period-picker.d.ts +25 -0
- package/dist/components/dashboard/period-picker.js +82 -0
- package/dist/components/dashboard/periods.d.ts +13 -0
- package/dist/components/dashboard/periods.js +63 -0
- package/dist/components/dashboard/pipeline-stages-panel.d.ts +14 -0
- package/dist/components/dashboard/pipeline-stages-panel.js +12 -0
- package/dist/components/dashboard/processing-summary-panel.d.ts +34 -0
- package/dist/components/dashboard/processing-summary-panel.js +11 -0
- package/dist/components/dashboard/ranked-bars.d.ts +15 -0
- package/dist/components/dashboard/ranked-bars.js +16 -0
- package/dist/components/dashboard/ranked-list-panel.d.ts +14 -0
- package/dist/components/dashboard/ranked-list-panel.js +9 -0
- package/dist/components/dashboard/stage-tiles.d.ts +15 -0
- package/dist/components/dashboard/stage-tiles.js +6 -0
- package/dist/components/dashboard/stat-rows-panel.d.ts +25 -0
- package/dist/components/dashboard/stat-rows-panel.js +7 -0
- package/dist/components/dashboard/stat-tile.d.ts +20 -0
- package/dist/components/dashboard/stat-tile.js +9 -0
- package/dist/components/feedback/index.d.ts +4 -0
- package/dist/components/feedback/index.js +2 -0
- package/dist/components/feedback/query-states.d.ts +27 -0
- package/dist/components/feedback/query-states.js +38 -0
- package/dist/components/feedback/table-pagination.d.ts +20 -0
- package/dist/components/feedback/table-pagination.js +15 -0
- package/dist/components/invoice-queue/index.d.ts +5 -0
- package/dist/components/invoice-queue/index.js +3 -0
- package/dist/components/invoice-queue/next-action-cell.d.ts +5 -0
- package/dist/components/invoice-queue/next-action-cell.js +9 -0
- package/dist/components/invoice-queue/queue-kpi-card.d.ts +19 -0
- package/dist/components/invoice-queue/queue-kpi-card.js +31 -0
- package/dist/components/invoice-queue/queue-kpi-row.d.ts +22 -0
- package/dist/components/invoice-queue/queue-kpi-row.js +12 -0
- package/dist/components/notifications/alerts.d.ts +25 -0
- package/dist/components/notifications/alerts.js +66 -0
- package/dist/components/notifications/bell.d.ts +14 -0
- package/dist/components/notifications/bell.js +17 -0
- package/dist/components/notifications/highlight.d.ts +4 -0
- package/dist/components/notifications/highlight.js +7 -0
- package/dist/components/notifications/index.d.ts +7 -0
- package/dist/components/notifications/index.js +6 -0
- package/dist/components/notifications/reminder-dialog.d.ts +24 -0
- package/dist/components/notifications/reminder-dialog.js +54 -0
- package/dist/components/notifications/types.d.ts +27 -0
- package/dist/components/notifications/types.js +1 -0
- package/dist/components/notifications/use-notification-acks.d.ts +7 -0
- package/dist/components/notifications/use-notification-acks.js +37 -0
- package/dist/components/shell/breadcrumbs.d.ts +7 -0
- package/dist/components/shell/breadcrumbs.js +38 -0
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/index.js +3 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +110 -0
- package/dist/components/shell/types.d.ts +23 -0
- package/dist/components/shell/types.js +3 -0
- package/dist/components/tour/find-target.d.ts +1 -0
- package/dist/components/tour/find-target.js +3 -0
- package/dist/components/tour/index.d.ts +14 -0
- package/dist/components/tour/index.js +8 -0
- package/dist/components/tour/labels.d.ts +10 -0
- package/dist/components/tour/labels.js +9 -0
- package/dist/components/tour/seen-store.d.ts +3 -0
- package/dist/components/tour/seen-store.js +34 -0
- package/dist/components/tour/tour-blocks.d.ts +4 -0
- package/dist/components/tour/tour-blocks.js +27 -0
- package/dist/components/tour/tour-button.d.ts +4 -0
- package/dist/components/tour/tour-button.js +12 -0
- package/dist/components/tour/tour-card.d.ts +11 -0
- package/dist/components/tour/tour-card.js +7 -0
- package/dist/components/tour/tour-context.d.ts +16 -0
- package/dist/components/tour/tour-context.js +2 -0
- package/dist/components/tour/tour-overlay.d.ts +1 -0
- package/dist/components/tour/tour-overlay.js +165 -0
- package/dist/components/tour/tour-provider.d.ts +9 -0
- package/dist/components/tour/tour-provider.js +80 -0
- package/dist/components/tour/types.d.ts +44 -0
- package/dist/components/tour/types.js +1 -0
- package/dist/components/tour/use-tour.d.ts +3 -0
- package/dist/components/tour/use-tour.js +9 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +15 -0
- package/dist/lib/bank-import/classify.d.ts +8 -0
- package/dist/lib/bank-import/classify.js +89 -0
- package/dist/lib/bank-import/column-guess.d.ts +2 -0
- package/dist/lib/bank-import/column-guess.js +40 -0
- package/dist/lib/bank-import/csv.d.ts +3 -0
- package/dist/lib/bank-import/csv.js +20 -0
- package/dist/lib/bank-import/duplicates.d.ts +2 -0
- package/dist/lib/bank-import/duplicates.js +21 -0
- package/dist/lib/bank-import/index.d.ts +12 -0
- package/dist/lib/bank-import/index.js +9 -0
- package/dist/lib/bank-import/mapping-storage.d.ts +3 -0
- package/dist/lib/bank-import/mapping-storage.js +29 -0
- package/dist/lib/bank-import/normalize.d.ts +4 -0
- package/dist/lib/bank-import/normalize.js +82 -0
- package/dist/lib/bank-import/parse-file.d.ts +7 -0
- package/dist/lib/bank-import/parse-file.js +23 -0
- package/dist/lib/bank-import/types.d.ts +31 -0
- package/dist/lib/bank-import/types.js +1 -0
- package/dist/lib/bank-import/xlsx.d.ts +2 -0
- package/dist/lib/bank-import/xlsx.js +25 -0
- package/dist/lib/class-names.d.ts +2 -0
- package/dist/lib/class-names.js +5 -0
- package/dist/lib/download.d.ts +2 -0
- package/dist/lib/download.js +14 -0
- package/dist/lib/formatters.d.ts +6 -0
- package/dist/lib/formatters.js +24 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/opos-whitelist/index.d.ts +2 -0
- package/dist/lib/opos-whitelist/index.js +1 -0
- package/dist/lib/opos-whitelist/opos.d.ts +14 -0
- package/dist/lib/opos-whitelist/opos.js +49 -0
- package/dist/lib/query-result.d.ts +12 -0
- package/dist/lib/query-result.js +1 -0
- package/dist/lib/tour-placeholders/index.d.ts +2 -0
- package/dist/lib/tour-placeholders/index.js +1 -0
- package/dist/lib/tour-placeholders/overview.d.ts +12 -0
- package/dist/lib/tour-placeholders/overview.js +139 -0
- package/dist/pages/bank-accounts/BankAccountsPage.d.ts +7 -0
- package/dist/pages/bank-accounts/BankAccountsPage.js +21 -0
- package/dist/pages/bank-accounts/index.d.ts +4 -0
- package/dist/pages/bank-accounts/index.js +2 -0
- package/dist/pages/bank-accounts/labels.d.ts +15 -0
- package/dist/pages/bank-accounts/labels.js +14 -0
- package/dist/pages/bank-import/BankImportWizard.d.ts +9 -0
- package/dist/pages/bank-import/BankImportWizard.js +158 -0
- package/dist/pages/bank-import/index.d.ts +4 -0
- package/dist/pages/bank-import/index.js +2 -0
- package/dist/pages/bank-import/labels.d.ts +44 -0
- package/dist/pages/bank-import/labels.js +43 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.d.ts +7 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.js +77 -0
- package/dist/pages/bank-sync-log/index.d.ts +4 -0
- package/dist/pages/bank-sync-log/index.js +2 -0
- package/dist/pages/bank-sync-log/labels.d.ts +21 -0
- package/dist/pages/bank-sync-log/labels.js +20 -0
- package/dist/pages/bank-transactions/BankMatchPanel.d.ts +8 -0
- package/dist/pages/bank-transactions/BankMatchPanel.js +75 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.d.ts +7 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.js +59 -0
- package/dist/pages/bank-transactions/badges.d.ts +8 -0
- package/dist/pages/bank-transactions/badges.js +24 -0
- package/dist/pages/bank-transactions/index.d.ts +6 -0
- package/dist/pages/bank-transactions/index.js +4 -0
- package/dist/pages/bank-transactions/labels.d.ts +41 -0
- package/dist/pages/bank-transactions/labels.js +40 -0
- package/dist/pages/bank-transactions/sort-control.d.ts +17 -0
- package/dist/pages/bank-transactions/sort-control.js +8 -0
- package/dist/pages/bank-transactions/use-table-view.d.ts +23 -0
- package/dist/pages/bank-transactions/use-table-view.js +54 -0
- package/dist/pages/category-rules/CategoryRulesPage.d.ts +7 -0
- package/dist/pages/category-rules/CategoryRulesPage.js +160 -0
- package/dist/pages/category-rules/index.d.ts +4 -0
- package/dist/pages/category-rules/index.js +2 -0
- package/dist/pages/category-rules/labels.d.ts +66 -0
- package/dist/pages/category-rules/labels.js +72 -0
- package/dist/pages/companies/company-detail-page.d.ts +10 -0
- package/dist/pages/companies/company-detail-page.js +184 -0
- package/dist/pages/companies/company-form.d.ts +20 -0
- package/dist/pages/companies/company-form.js +23 -0
- package/dist/pages/companies/company-list-page.d.ts +9 -0
- package/dist/pages/companies/company-list-page.js +109 -0
- package/dist/pages/companies/known-spellings-card.d.ts +8 -0
- package/dist/pages/companies/known-spellings-card.js +65 -0
- package/dist/pages/companies/labels.d.ts +105 -0
- package/dist/pages/companies/labels.js +104 -0
- package/dist/pages/companies/sort-control.d.ts +17 -0
- package/dist/pages/companies/sort-control.js +8 -0
- package/dist/pages/companies/use-infinite-rows.d.ts +6 -0
- package/dist/pages/companies/use-infinite-rows.js +24 -0
- package/dist/pages/companies/use-table-view.d.ts +23 -0
- package/dist/pages/companies/use-table-view.js +56 -0
- package/dist/pages/customers/company-chip.d.ts +6 -0
- package/dist/pages/customers/company-chip.js +9 -0
- package/dist/pages/customers/copy-button.d.ts +6 -0
- package/dist/pages/customers/copy-button.js +31 -0
- package/dist/pages/customers/customer-detail-page.d.ts +10 -0
- package/dist/pages/customers/customer-detail-page.js +83 -0
- package/dist/pages/customers/customer-list-page.d.ts +9 -0
- package/dist/pages/customers/customer-list-page.js +65 -0
- package/dist/pages/customers/edit-customer-dialog.d.ts +9 -0
- package/dist/pages/customers/edit-customer-dialog.js +72 -0
- package/dist/pages/customers/form-hints.d.ts +6 -0
- package/dist/pages/customers/form-hints.js +9 -0
- package/dist/pages/customers/invoice-status-badge.d.ts +10 -0
- package/dist/pages/customers/invoice-status-badge.js +22 -0
- package/dist/pages/customers/labels.d.ts +116 -0
- package/dist/pages/customers/labels.js +117 -0
- package/dist/pages/customers/new-customer-dialog.d.ts +6 -0
- package/dist/pages/customers/new-customer-dialog.js +93 -0
- package/dist/pages/customers/sort-control.d.ts +14 -0
- package/dist/pages/customers/sort-control.js +9 -0
- package/dist/pages/customers/use-table-view.d.ts +23 -0
- package/dist/pages/customers/use-table-view.js +56 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.d.ts +7 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.js +114 -0
- package/dist/pages/exclusion-rules/labels.d.ts +53 -0
- package/dist/pages/exclusion-rules/labels.js +61 -0
- package/dist/pages/file-naming/build-filename.d.ts +3 -0
- package/dist/pages/file-naming/build-filename.js +82 -0
- package/dist/pages/file-naming/file-naming-page.d.ts +10 -0
- package/dist/pages/file-naming/file-naming-page.js +120 -0
- package/dist/pages/file-naming/labels.d.ts +44 -0
- package/dist/pages/file-naming/labels.js +44 -0
- package/dist/pages/index.d.ts +63 -0
- package/dist/pages/index.js +48 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.d.ts +11 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.js +292 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.d.ts +26 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.js +16 -0
- package/dist/pages/invoice-detail/ReviewBadge.d.ts +15 -0
- package/dist/pages/invoice-detail/ReviewBadge.js +23 -0
- package/dist/pages/invoice-detail/ReviewCard.d.ts +17 -0
- package/dist/pages/invoice-detail/ReviewCard.js +12 -0
- package/dist/pages/invoice-detail/SideBySide.d.ts +5 -0
- package/dist/pages/invoice-detail/SideBySide.js +5 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.d.ts +23 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.js +32 -0
- package/dist/pages/invoice-detail/WorkflowLadder.d.ts +20 -0
- package/dist/pages/invoice-detail/WorkflowLadder.js +16 -0
- package/dist/pages/invoice-detail/history.d.ts +23 -0
- package/dist/pages/invoice-detail/history.js +76 -0
- package/dist/pages/invoice-detail/index.d.ts +21 -0
- package/dist/pages/invoice-detail/index.js +11 -0
- package/dist/pages/invoice-detail/labels.d.ts +79 -0
- package/dist/pages/invoice-detail/labels.js +139 -0
- package/dist/pages/invoice-detail/pipeline-types.d.ts +58 -0
- package/dist/pages/invoice-detail/pipeline-types.js +1 -0
- package/dist/pages/invoice-detail/review-recheck.d.ts +8 -0
- package/dist/pages/invoice-detail/review-recheck.js +103 -0
- package/dist/pages/invoice-detail/review.d.ts +91 -0
- package/dist/pages/invoice-detail/review.js +310 -0
- package/dist/pages/invoice-list/badges.d.ts +23 -0
- package/dist/pages/invoice-list/badges.js +26 -0
- package/dist/pages/invoice-list/index.d.ts +5 -0
- package/dist/pages/invoice-list/index.js +3 -0
- package/dist/pages/invoice-list/invoice-list-page.d.ts +13 -0
- package/dist/pages/invoice-list/invoice-list-page.js +114 -0
- package/dist/pages/invoice-list/labels.d.ts +36 -0
- package/dist/pages/invoice-list/labels.js +29 -0
- package/dist/pages/invoice-list/sort-control.d.ts +17 -0
- package/dist/pages/invoice-list/sort-control.js +8 -0
- package/dist/pages/invoice-list/use-table-view.d.ts +23 -0
- package/dist/pages/invoice-list/use-table-view.js +54 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.d.ts +7 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.js +115 -0
- package/dist/pages/invoice-upload/index.d.ts +4 -0
- package/dist/pages/invoice-upload/index.js +2 -0
- package/dist/pages/invoice-upload/labels.d.ts +29 -0
- package/dist/pages/invoice-upload/labels.js +28 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.d.ts +7 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.js +161 -0
- package/dist/pages/manual-bookings/index.d.ts +4 -0
- package/dist/pages/manual-bookings/index.js +2 -0
- package/dist/pages/manual-bookings/labels.d.ts +53 -0
- package/dist/pages/manual-bookings/labels.js +52 -0
- package/dist/pages/notifications/labels.d.ts +22 -0
- package/dist/pages/notifications/labels.js +21 -0
- package/dist/pages/notifications/notifications-page.d.ts +14 -0
- package/dist/pages/notifications/notifications-page.js +81 -0
- package/dist/pages/open-items/OpenItemsPage.d.ts +11 -0
- package/dist/pages/open-items/OpenItemsPage.js +110 -0
- package/dist/pages/open-items/index.d.ts +6 -0
- package/dist/pages/open-items/index.js +3 -0
- package/dist/pages/open-items/labels.d.ts +37 -0
- package/dist/pages/open-items/labels.js +36 -0
- package/dist/pages/open-items/urgency.d.ts +8 -0
- package/dist/pages/open-items/urgency.js +27 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.d.ts +7 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.js +165 -0
- package/dist/pages/opos-whitelist/index.d.ts +4 -0
- package/dist/pages/opos-whitelist/index.js +2 -0
- package/dist/pages/opos-whitelist/labels.d.ts +56 -0
- package/dist/pages/opos-whitelist/labels.js +70 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.d.ts +7 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.js +169 -0
- package/dist/pages/outgoing-invoices/index.d.ts +4 -0
- package/dist/pages/outgoing-invoices/index.js +2 -0
- package/dist/pages/outgoing-invoices/labels.d.ts +43 -0
- package/dist/pages/outgoing-invoices/labels.js +42 -0
- package/dist/pages/outgoing-invoices/sort-control.d.ts +17 -0
- package/dist/pages/outgoing-invoices/sort-control.js +8 -0
- package/dist/pages/outgoing-invoices/use-table-view.d.ts +23 -0
- package/dist/pages/outgoing-invoices/use-table-view.js +54 -0
- package/dist/pages/overview/labels.d.ts +35 -0
- package/dist/pages/overview/labels.js +34 -0
- package/dist/pages/overview/overview-page.d.ts +22 -0
- package/dist/pages/overview/overview-page.js +127 -0
- package/dist/pages/processing-log/labels.d.ts +54 -0
- package/dist/pages/processing-log/labels.js +53 -0
- package/dist/pages/processing-log/mail-parsing.d.ts +21 -0
- package/dist/pages/processing-log/mail-parsing.js +52 -0
- package/dist/pages/processing-log/processing-log-page.d.ts +9 -0
- package/dist/pages/processing-log/processing-log-page.js +206 -0
- package/dist/pages/properties/badges.d.ts +20 -0
- package/dist/pages/properties/badges.js +45 -0
- package/dist/pages/properties/company-assignment-field.d.ts +11 -0
- package/dist/pages/properties/company-assignment-field.js +13 -0
- package/dist/pages/properties/form-field.d.ts +6 -0
- package/dist/pages/properties/form-field.js +9 -0
- package/dist/pages/properties/labels.d.ts +124 -0
- package/dist/pages/properties/labels.js +128 -0
- package/dist/pages/properties/name-variants-card.d.ts +7 -0
- package/dist/pages/properties/name-variants-card.js +60 -0
- package/dist/pages/properties/property-detail-page.d.ts +10 -0
- package/dist/pages/properties/property-detail-page.js +150 -0
- package/dist/pages/properties/property-list-page.d.ts +13 -0
- package/dist/pages/properties/property-list-page.js +201 -0
- package/dist/pages/properties/sort-control.d.ts +14 -0
- package/dist/pages/properties/sort-control.js +9 -0
- package/dist/pages/properties/use-infinite-rows.d.ts +6 -0
- package/dist/pages/properties/use-infinite-rows.js +26 -0
- package/dist/pages/properties/use-table-view.d.ts +23 -0
- package/dist/pages/properties/use-table-view.js +56 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.d.ts +10 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.js +157 -0
- package/dist/pages/supplier-detail/index.d.ts +4 -0
- package/dist/pages/supplier-detail/index.js +2 -0
- package/dist/pages/supplier-detail/labels.d.ts +46 -0
- package/dist/pages/supplier-detail/labels.js +45 -0
- package/dist/pages/supplier-list/SupplierListPage.d.ts +9 -0
- package/dist/pages/supplier-list/SupplierListPage.js +102 -0
- package/dist/pages/supplier-list/index.d.ts +4 -0
- package/dist/pages/supplier-list/index.js +2 -0
- package/dist/pages/supplier-list/labels.d.ts +33 -0
- package/dist/pages/supplier-list/labels.js +32 -0
- package/dist/pages/supplier-list/sort-control.d.ts +17 -0
- package/dist/pages/supplier-list/sort-control.js +8 -0
- package/dist/pages/supplier-list/use-table-view.d.ts +23 -0
- package/dist/pages/supplier-list/use-table-view.js +54 -0
- package/dist/pages/team/account-dialogs.d.ts +12 -0
- package/dist/pages/team/account-dialogs.js +49 -0
- package/dist/pages/team/employee-editor.d.ts +19 -0
- package/dist/pages/team/employee-editor.js +124 -0
- package/dist/pages/team/labels.d.ts +99 -0
- package/dist/pages/team/labels.js +98 -0
- package/dist/pages/team/new-employee.d.ts +8 -0
- package/dist/pages/team/new-employee.js +103 -0
- package/dist/pages/team/roles-tab.d.ts +6 -0
- package/dist/pages/team/roles-tab.js +46 -0
- package/dist/pages/team/team-page.d.ts +7 -0
- package/dist/pages/team/team-page.js +81 -0
- package/dist/pages/team/temp-password-dialog.d.ts +11 -0
- package/dist/pages/team/temp-password-dialog.js +23 -0
- package/dist/pages/trash/labels.d.ts +68 -0
- package/dist/pages/trash/labels.js +69 -0
- package/dist/pages/trash/trash-page.d.ts +9 -0
- package/dist/pages/trash/trash-page.js +259 -0
- package/dist/pages/vat-rules/labels.d.ts +110 -0
- package/dist/pages/vat-rules/labels.js +109 -0
- package/dist/pages/vat-rules/new-rule-dialog.d.ts +7 -0
- package/dist/pages/vat-rules/new-rule-dialog.js +134 -0
- package/dist/pages/vat-rules/rule-row.d.ts +20 -0
- package/dist/pages/vat-rules/rule-row.js +120 -0
- package/dist/pages/vat-rules/vat-rules-page.d.ts +9 -0
- package/dist/pages/vat-rules/vat-rules-page.js +61 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/alert-dialog.js +41 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +20 -0
- package/dist/ui/breadcrumb.d.ts +19 -0
- package/dist/ui/breadcrumb.js +23 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.js +33 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/chart.d.ts +62 -0
- package/dist/ui/chart.js +118 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +5 -0
- package/dist/ui/combobox.d.ts +24 -0
- package/dist/ui/combobox.js +55 -0
- package/dist/ui/command.d.ts +80 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/dialog.d.ts +19 -0
- package/dist/ui/dialog.js +58 -0
- package/dist/ui/dropdown-menu.d.ts +27 -0
- package/dist/ui/dropdown-menu.js +33 -0
- package/dist/ui/field-context.d.ts +4 -0
- package/dist/ui/field-context.js +6 -0
- package/dist/ui/field.d.ts +3 -0
- package/dist/ui/field.js +8 -0
- package/dist/ui/icon-action.d.ts +3 -0
- package/dist/ui/icon-action.js +8 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +11 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +15 -0
- package/dist/ui/multi-combobox.d.ts +18 -0
- package/dist/ui/multi-combobox.js +40 -0
- package/dist/ui/popover.d.ts +9 -0
- package/dist/ui/popover.js +12 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +9 -0
- package/dist/ui/scroll-shadow.d.ts +8 -0
- package/dist/ui/scroll-shadow.js +57 -0
- package/dist/ui/select.d.ts +13 -0
- package/dist/ui/select.js +31 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +40 -0
- package/dist/ui/sidebar.d.ts +65 -0
- package/dist/ui/sidebar.js +207 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.js +13 -0
- package/dist/ui/switch.d.ts +4 -0
- package/dist/ui/switch.js +7 -0
- package/dist/ui/table.d.ts +12 -0
- package/dist/ui/table.js +24 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +12 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +11 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +11 -0
- package/package.json +80 -0
- package/themes/TOKENS.md +57 -0
- package/themes/default.css +60 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
export const VALIDATION_GATES = [
|
|
2
|
+
"brutto_vorhanden",
|
|
3
|
+
"steller_vorhanden",
|
|
4
|
+
"datum_vorhanden",
|
|
5
|
+
"rechnungsnr_vorhanden",
|
|
6
|
+
"summe_ok",
|
|
7
|
+
"ust_satz_ok",
|
|
8
|
+
"iban_ok",
|
|
9
|
+
"datum_plausibel",
|
|
10
|
+
];
|
|
11
|
+
export const SEVERITY_INFORMATIONAL = "informational";
|
|
12
|
+
export const SEVERITY_ACTION_REQUIRED = "action_required";
|
|
13
|
+
export function reviewChecks(invoice) {
|
|
14
|
+
const raw = invoice.extracted?.review_checks;
|
|
15
|
+
return Array.isArray(raw) && raw.length > 0 ? raw : null;
|
|
16
|
+
}
|
|
17
|
+
export const VALIDATION_FIELD_REASON = {
|
|
18
|
+
gross_present: "brutto_fehlt",
|
|
19
|
+
issuer_present: "steller_fehlt",
|
|
20
|
+
sum_matches: "summe_stimmt_nicht",
|
|
21
|
+
vat_rate_valid: "ust_satz_ungueltig",
|
|
22
|
+
iban_checksum_valid: "iban_ungueltig",
|
|
23
|
+
date_not_future: "datum_zukunft",
|
|
24
|
+
invoice_number_present: "rechnungsnr_fehlt",
|
|
25
|
+
date_present: "datum_fehlt",
|
|
26
|
+
payable_iban_present: "iban_fehlt",
|
|
27
|
+
recipient_present: "empfaenger_fehlt",
|
|
28
|
+
iban_unambiguous: "iban_mehrere",
|
|
29
|
+
relevance_ok: "nicht_relevant",
|
|
30
|
+
assignment_resolved: "gesellschaft_fehlt",
|
|
31
|
+
brutto_vorhanden: "brutto_fehlt",
|
|
32
|
+
steller_vorhanden: "steller_fehlt",
|
|
33
|
+
summe_ok: "summe_stimmt_nicht",
|
|
34
|
+
ust_satz_ok: "ust_satz_ungueltig",
|
|
35
|
+
iban_ok: "iban_ungueltig",
|
|
36
|
+
datum_plausibel: "datum_zukunft",
|
|
37
|
+
rechnungsnr_vorhanden: "rechnungsnr_fehlt",
|
|
38
|
+
datum_vorhanden: "datum_fehlt",
|
|
39
|
+
iban_vorhanden: "iban_fehlt",
|
|
40
|
+
empfaenger_vorhanden: "empfaenger_fehlt",
|
|
41
|
+
};
|
|
42
|
+
export const REVIEW_CHECK_REASON = {
|
|
43
|
+
extraction_confidence: "konfidenz_unter_schwelle",
|
|
44
|
+
relevance: "nicht_relevant",
|
|
45
|
+
document_readable: "nicht_lesbar",
|
|
46
|
+
exclusion: "ausgeschlossen",
|
|
47
|
+
brutto_vorhanden: "brutto_fehlt",
|
|
48
|
+
steller_vorhanden: "steller_fehlt",
|
|
49
|
+
summe_ok: "summe_stimmt_nicht",
|
|
50
|
+
ust_satz_ok: "ust_satz_ungueltig",
|
|
51
|
+
iban_ok: "iban_ungueltig",
|
|
52
|
+
datum_plausibel: "datum_zukunft",
|
|
53
|
+
rechnungsnr_vorhanden: "rechnungsnr_fehlt",
|
|
54
|
+
datum_vorhanden: "datum_fehlt",
|
|
55
|
+
empfaenger_name: "empfaenger_fehlt",
|
|
56
|
+
assignment: "gesellschaft_fehlt",
|
|
57
|
+
safety_invariant_1: "keine_ueberweisung_belegt",
|
|
58
|
+
safety_invariant_2: "lastschrift_erkannt",
|
|
59
|
+
safety_invariant_3: "ocr_ohne_sichtpruefung",
|
|
60
|
+
safety_invariant_4a: "keine_rechnung_bestaetigt",
|
|
61
|
+
safety_invariant_4b: "konfidenz_unter_sicherheitsgrenze",
|
|
62
|
+
safety_invariant_5: "zahlungsnachweis_veraltet",
|
|
63
|
+
forced_review: "manuell_markiert",
|
|
64
|
+
};
|
|
65
|
+
function reasonForReviewCheck(check) {
|
|
66
|
+
if (check.field === "iban_anzahl") {
|
|
67
|
+
return Number(check.values?.iban_count ?? 0) > 1 ? "iban_mehrere" : "iban_fehlt";
|
|
68
|
+
}
|
|
69
|
+
return REVIEW_CHECK_REASON[check.field ?? ""] ?? null;
|
|
70
|
+
}
|
|
71
|
+
function reviewCheckCounts(check) {
|
|
72
|
+
return (check.severity ?? "").trim().toLowerCase() !== SEVERITY_INFORMATIONAL;
|
|
73
|
+
}
|
|
74
|
+
const VALIDATION_MODIFIER = new Set(["kleinbetrag", "is_small_amount"]);
|
|
75
|
+
function detailFailed(entry) {
|
|
76
|
+
const s = (entry?.status ?? "").trim().toLowerCase();
|
|
77
|
+
if (!s)
|
|
78
|
+
return false;
|
|
79
|
+
return s !== "ok" && s !== "not_applicable" && s !== "skipped";
|
|
80
|
+
}
|
|
81
|
+
function usableDetail(raw) {
|
|
82
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
83
|
+
return null;
|
|
84
|
+
const detail = raw;
|
|
85
|
+
return Object.keys(detail).length > 0 ? detail : null;
|
|
86
|
+
}
|
|
87
|
+
export const SOURCE_HUMAN = "human";
|
|
88
|
+
export function isManuallyCorrected(entry) {
|
|
89
|
+
return entry?.source === SOURCE_HUMAN;
|
|
90
|
+
}
|
|
91
|
+
const KEY_PIPELINE = "bookkeeping_edits";
|
|
92
|
+
const KEY_CORRECTION = "user_edits";
|
|
93
|
+
function half(raw, name) {
|
|
94
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
95
|
+
return null;
|
|
96
|
+
return usableDetail(raw[name]);
|
|
97
|
+
}
|
|
98
|
+
function isSplit(raw) {
|
|
99
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
100
|
+
return false;
|
|
101
|
+
return KEY_PIPELINE in raw;
|
|
102
|
+
}
|
|
103
|
+
function rawDetail(invoice) {
|
|
104
|
+
if (invoice.validation_detail && Object.keys(invoice.validation_detail).length > 0) {
|
|
105
|
+
return invoice.validation_detail;
|
|
106
|
+
}
|
|
107
|
+
return invoice.extracted?.validation_detail;
|
|
108
|
+
}
|
|
109
|
+
export function validationBase(invoice) {
|
|
110
|
+
const raw = rawDetail(invoice);
|
|
111
|
+
return isSplit(raw) ? half(raw, KEY_PIPELINE) : usableDetail(raw);
|
|
112
|
+
}
|
|
113
|
+
export function validationCorrections(invoice) {
|
|
114
|
+
return half(rawDetail(invoice), KEY_CORRECTION);
|
|
115
|
+
}
|
|
116
|
+
export function validationDetail(invoice) {
|
|
117
|
+
const base = validationBase(invoice);
|
|
118
|
+
const corrections = validationCorrections(invoice);
|
|
119
|
+
if (!corrections)
|
|
120
|
+
return base;
|
|
121
|
+
return { ...(base ?? {}), ...corrections };
|
|
122
|
+
}
|
|
123
|
+
export function writeValidationDetail(base, corrections) {
|
|
124
|
+
return {
|
|
125
|
+
[KEY_PIPELINE]: base ?? {},
|
|
126
|
+
[KEY_CORRECTION]: corrections ?? {},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export function validationFlat(invoice) {
|
|
130
|
+
const fromExtracted = invoice.extracted?.validation;
|
|
131
|
+
if (fromExtracted && typeof fromExtracted === "object")
|
|
132
|
+
return fromExtracted;
|
|
133
|
+
return (invoice.validation ?? {});
|
|
134
|
+
}
|
|
135
|
+
export function reviewReasonsDetail(invoice) {
|
|
136
|
+
const detail = validationDetail(invoice);
|
|
137
|
+
if (detail) {
|
|
138
|
+
const known = Object.keys(VALIDATION_FIELD_REASON);
|
|
139
|
+
const fields = [...known, ...Object.keys(detail).filter((f) => !known.includes(f))];
|
|
140
|
+
const out = [];
|
|
141
|
+
for (const field of fields) {
|
|
142
|
+
if (VALIDATION_MODIFIER.has(field))
|
|
143
|
+
continue;
|
|
144
|
+
const entry = detail[field];
|
|
145
|
+
if (!detailFailed(entry))
|
|
146
|
+
continue;
|
|
147
|
+
out.push({
|
|
148
|
+
id: VALIDATION_FIELD_REASON[field] ?? null,
|
|
149
|
+
field,
|
|
150
|
+
message: entry?.message?.trim() || undefined,
|
|
151
|
+
values: entry?.values,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
const checks = reviewChecks(invoice);
|
|
157
|
+
if (checks) {
|
|
158
|
+
return checks
|
|
159
|
+
.filter((c) => reviewCheckCounts(c) && detailFailed(c))
|
|
160
|
+
.map((c) => ({
|
|
161
|
+
id: reasonForReviewCheck(c),
|
|
162
|
+
field: c.field ?? "",
|
|
163
|
+
severity: c.severity,
|
|
164
|
+
message: c.message?.trim() || undefined,
|
|
165
|
+
values: c.values,
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
const flat = validationFlat(invoice);
|
|
169
|
+
const reasons = [];
|
|
170
|
+
const smallAmount = flat.kleinbetrag === true;
|
|
171
|
+
const push = (field) => reasons.push({ id: VALIDATION_FIELD_REASON[field], field });
|
|
172
|
+
if (flat.brutto_vorhanden === false)
|
|
173
|
+
push("brutto_vorhanden");
|
|
174
|
+
if (flat.steller_vorhanden === false)
|
|
175
|
+
push("steller_vorhanden");
|
|
176
|
+
if (flat.summe_ok === false)
|
|
177
|
+
push("summe_ok");
|
|
178
|
+
if (flat.ust_satz_ok === false)
|
|
179
|
+
push("ust_satz_ok");
|
|
180
|
+
if (flat.iban_ok === false)
|
|
181
|
+
push("iban_ok");
|
|
182
|
+
if (flat.datum_plausibel === false)
|
|
183
|
+
push("datum_plausibel");
|
|
184
|
+
if (!smallAmount && flat.rechnungsnr_vorhanden === false)
|
|
185
|
+
push("rechnungsnr_vorhanden");
|
|
186
|
+
if (!smallAmount && flat.datum_vorhanden === false)
|
|
187
|
+
push("datum_vorhanden");
|
|
188
|
+
return reasons;
|
|
189
|
+
}
|
|
190
|
+
export function reviewReasonNumbers(reason) {
|
|
191
|
+
if (reason.field !== "summe_ok")
|
|
192
|
+
return null;
|
|
193
|
+
const num = (v) => {
|
|
194
|
+
const n = typeof v === "string" ? Number(v) : v;
|
|
195
|
+
return typeof n === "number" && Number.isFinite(n) ? n : null;
|
|
196
|
+
};
|
|
197
|
+
const expected = num(reason.values?.expected);
|
|
198
|
+
const found = num(reason.values?.found);
|
|
199
|
+
if (expected == null || found == null)
|
|
200
|
+
return null;
|
|
201
|
+
return { expected, found };
|
|
202
|
+
}
|
|
203
|
+
function detailPassed(status) {
|
|
204
|
+
return (status ?? "").trim().toLowerCase() === "ok";
|
|
205
|
+
}
|
|
206
|
+
export function buildReviewSummary(invoice) {
|
|
207
|
+
const reasons = reviewReasonsDetail(invoice);
|
|
208
|
+
const detail = validationDetail(invoice);
|
|
209
|
+
if (detail) {
|
|
210
|
+
const known = Object.keys(VALIDATION_FIELD_REASON);
|
|
211
|
+
const fields = [...known, ...Object.keys(detail).filter((f) => !known.includes(f))];
|
|
212
|
+
const passed = fields
|
|
213
|
+
.filter((f) => !VALIDATION_MODIFIER.has(f) && detailPassed(detail[f]?.status))
|
|
214
|
+
.map((f) => ({ field: f, id: VALIDATION_FIELD_REASON[f] ?? null }));
|
|
215
|
+
return { reasons, passed };
|
|
216
|
+
}
|
|
217
|
+
const checks = reviewChecks(invoice);
|
|
218
|
+
if (checks) {
|
|
219
|
+
const passed = checks
|
|
220
|
+
.filter((c) => reviewCheckCounts(c) && detailPassed(c.status))
|
|
221
|
+
.map((c) => ({ field: c.field ?? "", id: reasonForReviewCheck(c) }));
|
|
222
|
+
return { reasons, passed };
|
|
223
|
+
}
|
|
224
|
+
const flat = validationFlat(invoice);
|
|
225
|
+
const passed = VALIDATION_GATES.filter((gate) => flat[gate] === true).map((gate) => ({
|
|
226
|
+
field: gate,
|
|
227
|
+
id: VALIDATION_FIELD_REASON[gate] ?? null,
|
|
228
|
+
}));
|
|
229
|
+
return { reasons, passed };
|
|
230
|
+
}
|
|
231
|
+
export function reviewReasonConfidence(reason) {
|
|
232
|
+
if (reason.field !== "extraction_confidence")
|
|
233
|
+
return null;
|
|
234
|
+
const share = (v) => {
|
|
235
|
+
const n = typeof v === "string" ? Number(v) : v;
|
|
236
|
+
return typeof n === "number" && Number.isFinite(n) ? Math.round(n * 100) : null;
|
|
237
|
+
};
|
|
238
|
+
const found = share(reason.values?.found);
|
|
239
|
+
const required = share(reason.values?.required);
|
|
240
|
+
if (found == null || required == null)
|
|
241
|
+
return null;
|
|
242
|
+
return { found, required };
|
|
243
|
+
}
|
|
244
|
+
export function reviewReasonIbanCount(reason) {
|
|
245
|
+
if (reason.field !== "iban_anzahl")
|
|
246
|
+
return null;
|
|
247
|
+
const n = Number(reason.values?.iban_count ?? 0);
|
|
248
|
+
return Number.isFinite(n) && n > 1 ? n : null;
|
|
249
|
+
}
|
|
250
|
+
export function reviewReasonIds(invoice) {
|
|
251
|
+
return reviewReasonsDetail(invoice)
|
|
252
|
+
.map((r) => r.id)
|
|
253
|
+
.filter((id) => id != null);
|
|
254
|
+
}
|
|
255
|
+
export function reviewScore(invoice) {
|
|
256
|
+
let score = reviewReasonIds(invoice).length * 10;
|
|
257
|
+
if (invoice.status === "zu_pruefen")
|
|
258
|
+
score += 5;
|
|
259
|
+
const confidence = invoice.extracted?.konfidenz;
|
|
260
|
+
if (confidence) {
|
|
261
|
+
const values = Object.values(confidence).filter((n) => typeof n === "number");
|
|
262
|
+
if (values.length > 0) {
|
|
263
|
+
const min = Math.min(...values);
|
|
264
|
+
if (min < 0.8)
|
|
265
|
+
score += 3;
|
|
266
|
+
else if (min < 0.95)
|
|
267
|
+
score += 1;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return score;
|
|
271
|
+
}
|
|
272
|
+
export function withoutEmDash(text) {
|
|
273
|
+
return text
|
|
274
|
+
.replace(/\s*[—–]\s*$/g, "")
|
|
275
|
+
.replace(/\s*[—–]\s*/g, ", ")
|
|
276
|
+
.replace(/\s+,/g, ",")
|
|
277
|
+
.trim();
|
|
278
|
+
}
|
|
279
|
+
export function reviewLines(reasons, labels, jumpTargets) {
|
|
280
|
+
return reasons.map((r) => {
|
|
281
|
+
const confidence = reviewReasonConfidence(r);
|
|
282
|
+
const ibanCount = reviewReasonIbanCount(r);
|
|
283
|
+
const numbers = reviewReasonNumbers(r);
|
|
284
|
+
const label = labels.gateLabel(r.field);
|
|
285
|
+
return {
|
|
286
|
+
field: r.field,
|
|
287
|
+
title: label || undefined,
|
|
288
|
+
text: r.field === "relevance_ok" && r.message
|
|
289
|
+
? withoutEmDash(r.message)
|
|
290
|
+
: r.id
|
|
291
|
+
? labels.reasonText(r.id, {
|
|
292
|
+
confidence: confidence ?? undefined,
|
|
293
|
+
ibanCount: ibanCount ?? undefined,
|
|
294
|
+
})
|
|
295
|
+
: r.message
|
|
296
|
+
? withoutEmDash(r.message)
|
|
297
|
+
: labels.gateHint(r.field),
|
|
298
|
+
numbers: numbers ? labels.sumComparison(labels.formatMoney(numbers.expected), labels.formatMoney(numbers.found)) : undefined,
|
|
299
|
+
severity: r.severity,
|
|
300
|
+
jumpTo: jumpTargets[r.field],
|
|
301
|
+
};
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
export function reviewCheckLabelDe(field, labelDe) {
|
|
305
|
+
return labelDe(field) ?? field;
|
|
306
|
+
}
|
|
307
|
+
export function hasNoReviewChecks(invoice) {
|
|
308
|
+
const summary = buildReviewSummary(invoice);
|
|
309
|
+
return summary.reasons.length === 0 && summary.passed.length === 0;
|
|
310
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function ConfidenceBadge({ score, label }: {
|
|
2
|
+
score: number | null;
|
|
3
|
+
label: (score: number | null) => string;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function VatBadge({ vatRate, label }: {
|
|
6
|
+
vatRate: number | null;
|
|
7
|
+
label: (vatRate: number) => string;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
9
|
+
export declare function PaymentBadge({ paidAt, paidLabel, openLabel }: {
|
|
10
|
+
paidAt: string | null;
|
|
11
|
+
paidLabel: string;
|
|
12
|
+
openLabel: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function CompanyChip({ code, placeholder }: {
|
|
15
|
+
code: string | null;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function BankMatchBadge({ hasConfirmed, hasSuggested, confirmedLabel, suggestedLabel, }: {
|
|
19
|
+
hasConfirmed?: boolean;
|
|
20
|
+
hasSuggested?: boolean;
|
|
21
|
+
confirmedLabel: string;
|
|
22
|
+
suggestedLabel: string;
|
|
23
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, Landmark } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/class-names.js";
|
|
4
|
+
export function ConfidenceBadge({ score, label }) {
|
|
5
|
+
if (score == null) {
|
|
6
|
+
return _jsx("span", { className: "text-xs text-muted-foreground", children: label(null) });
|
|
7
|
+
}
|
|
8
|
+
const tone = score >= 0.95 ? "bg-emerald-500" : score >= 0.8 ? "bg-amber-500" : "bg-red-500";
|
|
9
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground", children: [_jsx("span", { className: cn("size-2 shrink-0 rounded-full", tone) }), label(score)] }));
|
|
10
|
+
}
|
|
11
|
+
export function VatBadge({ vatRate, label }) {
|
|
12
|
+
if (!vatRate || vatRate <= 0)
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsx("span", { className: "inline-flex items-center rounded-md bg-teal-100 px-1.5 py-0.5 text-xs font-medium text-teal-800", children: label(vatRate) }));
|
|
15
|
+
}
|
|
16
|
+
export function PaymentBadge({ paidAt, paidLabel, openLabel }) {
|
|
17
|
+
return (_jsx("span", { className: cn("inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-medium", paidAt ? "bg-emerald-100 text-emerald-800" : "bg-muted text-muted-foreground"), children: paidAt ? paidLabel : openLabel }));
|
|
18
|
+
}
|
|
19
|
+
export function CompanyChip({ code, placeholder }) {
|
|
20
|
+
return (_jsx("span", { className: "inline-flex items-center rounded-md border border-border bg-muted/50 px-1.5 py-0.5 font-mono text-xs font-medium text-foreground", children: code ?? placeholder }));
|
|
21
|
+
}
|
|
22
|
+
export function BankMatchBadge({ hasConfirmed, hasSuggested, confirmedLabel, suggestedLabel, }) {
|
|
23
|
+
if (!hasConfirmed && !hasSuggested)
|
|
24
|
+
return null;
|
|
25
|
+
return (_jsxs("span", { className: cn("inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-xs font-medium", hasConfirmed ? "bg-emerald-100 text-emerald-800" : "bg-amber-100 text-amber-800"), children: [hasConfirmed ? _jsx(Check, { className: "size-3 shrink-0" }) : _jsx(Landmark, { className: "size-3 shrink-0" }), hasConfirmed ? confirmedLabel : suggestedLabel] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { InvoiceListPage, InvoiceListLoadingSkeleton } from "./invoice-list-page";
|
|
2
|
+
export type { InvoiceListPageProps } from "./invoice-list-page";
|
|
3
|
+
export { englishInvoiceListLabels } from "./labels";
|
|
4
|
+
export type { InvoiceListLabels } from "./labels";
|
|
5
|
+
export { ConfidenceBadge, VatBadge, PaymentBadge, CompanyChip, BankMatchBadge } from "./badges";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InvoiceListAdapter, InvoiceListConfig } from "../../adapters/invoice-list";
|
|
2
|
+
import { type OutgoingInvoiceLabels } from "../invoice-detail/OutgoingInvoiceFlag";
|
|
3
|
+
import { type ReviewBadgeLabels } from "../invoice-detail/ReviewBadge";
|
|
4
|
+
import { type InvoiceListLabels } from "./labels";
|
|
5
|
+
export interface InvoiceListPageProps {
|
|
6
|
+
adapter: InvoiceListAdapter;
|
|
7
|
+
config: InvoiceListConfig;
|
|
8
|
+
labels?: InvoiceListLabels;
|
|
9
|
+
reviewLabels?: ReviewBadgeLabels;
|
|
10
|
+
outgoingLabels?: OutgoingInvoiceLabels;
|
|
11
|
+
}
|
|
12
|
+
export declare function InvoiceListPage({ adapter, config, labels, reviewLabels, outgoingLabels, }: InvoiceListPageProps): import("react").JSX.Element;
|
|
13
|
+
export declare function InvoiceListLoadingSkeleton(): import("react").JSX.Element;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { Search } from "lucide-react";
|
|
4
|
+
import { Input } from "../../ui/input.js";
|
|
5
|
+
import { Combobox } from "../../ui/combobox.js";
|
|
6
|
+
import { Skeleton } from "../../ui/skeleton.js";
|
|
7
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../ui/table.js";
|
|
8
|
+
import { ErrorState, TableSkeleton } from "../../components/feedback/query-states.js";
|
|
9
|
+
import { TablePagination } from "../../components/feedback/table-pagination.js";
|
|
10
|
+
import { QueueKpiRow } from "../../components/invoice-queue/index.js";
|
|
11
|
+
import { cn } from "../../lib/class-names.js";
|
|
12
|
+
import { isOutgoingInvoice, OutgoingInvoiceBadge } from "../invoice-detail/OutgoingInvoiceFlag.js";
|
|
13
|
+
import { reviewReasonIds, hasNoReviewChecks } from "../invoice-detail/review.js";
|
|
14
|
+
import { ReviewBadge } from "../invoice-detail/ReviewBadge.js";
|
|
15
|
+
import { ConfidenceBadge, VatBadge, PaymentBadge, CompanyChip, BankMatchBadge } from "./badges.js";
|
|
16
|
+
import { SortControl } from "./sort-control.js";
|
|
17
|
+
import { useTableView } from "./use-table-view.js";
|
|
18
|
+
import { englishInvoiceListLabels } from "./labels.js";
|
|
19
|
+
const DEFAULT_REVIEW_LABELS = {
|
|
20
|
+
none: "Reviewed",
|
|
21
|
+
duplicate: "Duplicate",
|
|
22
|
+
excluded: "Excluded",
|
|
23
|
+
alreadyPaid: "Already paid",
|
|
24
|
+
needed: "Needs review",
|
|
25
|
+
};
|
|
26
|
+
const DEFAULT_OUTGOING_LABELS = {
|
|
27
|
+
banner: (issuer, recipient) => `Outgoing invoice: from ${issuer} to ${recipient}.`,
|
|
28
|
+
bannerShort: "Outgoing",
|
|
29
|
+
unknownIssuer: "unknown issuer",
|
|
30
|
+
unknownRecipient: "unknown recipient",
|
|
31
|
+
};
|
|
32
|
+
export function InvoiceListPage({ adapter, config, labels = englishInvoiceListLabels, reviewLabels = DEFAULT_REVIEW_LABELS, outgoingLabels = DEFAULT_OUTGOING_LABELS, }) {
|
|
33
|
+
const invoicesQuery = adapter.useInvoices();
|
|
34
|
+
const queueCardsQuery = adapter.useQueueCards?.();
|
|
35
|
+
const companyOptionsQuery = adapter.useCompanyOptions?.();
|
|
36
|
+
const [search, setSearch] = useState("");
|
|
37
|
+
const [company, setCompany] = useState("");
|
|
38
|
+
const [activeQueueCard, setActiveQueueCard] = useState(null);
|
|
39
|
+
const rows = useMemo(() => invoicesQuery.data ?? [], [invoicesQuery.data]);
|
|
40
|
+
const queueCards = useMemo(() => {
|
|
41
|
+
if (!config.queueCards || !queueCardsQuery?.data)
|
|
42
|
+
return [];
|
|
43
|
+
const counts = new Map(queueCardsQuery.data.map((c) => [c.key, c]));
|
|
44
|
+
return config.queueCards
|
|
45
|
+
.filter((spec) => counts.has(spec.key))
|
|
46
|
+
.map((spec) => {
|
|
47
|
+
const counted = counts.get(spec.key);
|
|
48
|
+
return {
|
|
49
|
+
key: spec.key,
|
|
50
|
+
label: spec.key,
|
|
51
|
+
description: "",
|
|
52
|
+
count: String(counted.count),
|
|
53
|
+
amount: adapter.formatMoney(counted.amount),
|
|
54
|
+
tone: spec.tone,
|
|
55
|
+
icon: spec.icon,
|
|
56
|
+
active: activeQueueCard === spec.key,
|
|
57
|
+
onSelect: () => setActiveQueueCard((prev) => (prev === spec.key ? null : spec.key)),
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
}, [config.queueCards, queueCardsQuery?.data, activeQueueCard, adapter]);
|
|
61
|
+
const filteredRows = useMemo(() => {
|
|
62
|
+
const term = search.trim().toLowerCase();
|
|
63
|
+
const activeCardSpec = config.queueCards?.find((c) => c.key === activeQueueCard);
|
|
64
|
+
return rows.filter((row) => {
|
|
65
|
+
if (company && row.companyCode !== company)
|
|
66
|
+
return false;
|
|
67
|
+
if (activeCardSpec && !activeCardSpec.filter(row))
|
|
68
|
+
return false;
|
|
69
|
+
if (!term)
|
|
70
|
+
return true;
|
|
71
|
+
return `${row.issuer ?? ""} ${row.invoiceNumber ?? ""}`.toLowerCase().includes(term);
|
|
72
|
+
});
|
|
73
|
+
}, [rows, search, company, activeQueueCard, config.queueCards]);
|
|
74
|
+
const view = useTableView(filteredRows, {
|
|
75
|
+
initialSort: "documentDate",
|
|
76
|
+
initialDirection: "desc",
|
|
77
|
+
resetKey: `${search}|${company}|${activeQueueCard}`,
|
|
78
|
+
sortValue: (row, key) => {
|
|
79
|
+
switch (key) {
|
|
80
|
+
case "issuer":
|
|
81
|
+
return row.issuer ?? "";
|
|
82
|
+
case "amount":
|
|
83
|
+
return row.amountGross ?? 0;
|
|
84
|
+
case "dueDate":
|
|
85
|
+
return row.dueDate ?? "";
|
|
86
|
+
default:
|
|
87
|
+
return row.documentDate ?? "";
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
const sortColumns = [
|
|
92
|
+
{ value: "issuer", label: labels.columnIssuer },
|
|
93
|
+
{ value: "amount", label: labels.columnAmount },
|
|
94
|
+
{ value: "documentDate", label: labels.columnDate },
|
|
95
|
+
{ value: "dueDate", label: labels.columnDueOn("") },
|
|
96
|
+
];
|
|
97
|
+
const companyOptions = companyOptionsQuery?.data ?? [];
|
|
98
|
+
const heading = config.direction === "incoming" ? labels.incoming : labels.outgoing;
|
|
99
|
+
const showBankMatch = config.showBankMatch ?? true;
|
|
100
|
+
const showConfidence = config.showConfidence ?? true;
|
|
101
|
+
return (_jsxs("div", { children: [_jsxs("div", { children: [_jsx("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: heading.title }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: heading.subtitle })] }), queueCards.length > 0 && _jsx(QueueKpiRow, { cards: queueCards, loading: queueCardsQuery?.loading, className: "mt-6" }), _jsxs("div", { className: "mt-6 flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "relative w-full max-w-sm", children: [_jsx(Search, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { value: search, onChange: (event) => setSearch(event.target.value), placeholder: labels.searchPlaceholder, className: "pl-9" })] }), companyOptions.length > 0 && (_jsx(Combobox, { value: company, onValueChange: setCompany, className: "w-full sm:w-48", options: [
|
|
102
|
+
{ value: "", label: labels.companyAll },
|
|
103
|
+
...companyOptions.map((c) => ({ value: c.code, label: `${c.code} — ${c.name}` })),
|
|
104
|
+
] })), _jsx(SortControl, { columns: sortColumns, sort: view.sort, direction: view.direction, onSort: view.setSort, onDirection: view.setDirection, labels: labels })] }), invoicesQuery.error ? (_jsx("div", { className: "mt-4", children: _jsx(ErrorState, { error: invoicesQuery.error, onRetry: () => { } }) })) : invoicesQuery.loading ? (_jsx("div", { className: "mt-4", children: _jsx(TableSkeleton, { rows: 8, columns: 7 }) })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-4 hidden overflow-hidden overflow-x-auto rounded-xl border border-border bg-card sm:block", children: _jsxs(Table, { className: "min-w-[1100px]", children: [_jsx(TableHeader, { children: _jsxs(TableRow, { className: "bg-muted/40", children: [_jsx(TableHead, { children: labels.columnIssuer }), _jsx(TableHead, { children: labels.columnCompany }), _jsx(TableHead, { className: "text-right", children: labels.columnAmount }), _jsx(TableHead, { children: labels.columnDate }), showConfidence && _jsx(TableHead, { children: labels.columnConfidence }), _jsx(TableHead, { children: labels.columnReview }), _jsx(TableHead, { children: labels.columnPayment }), showBankMatch && _jsx(TableHead, { children: labels.columnBankMatch })] }) }), _jsxs(TableBody, { children: [view.pageRows.map((row) => (_jsx(InvoiceRow, { row: row, adapter: adapter, labels: labels, reviewLabels: reviewLabels, outgoingLabels: outgoingLabels, showBankMatch: showBankMatch, showConfidence: showConfidence }, row.id))), view.total === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 8, className: "py-12 text-center text-muted-foreground", children: labels.empty }) }))] })] }) }), _jsx("div", { className: "mt-4 space-y-3 sm:hidden", children: view.total === 0 ? (_jsx("p", { className: "rounded-xl border border-border bg-card px-4 py-12 text-center text-sm text-muted-foreground", children: labels.empty })) : (view.pageRows.map((row) => (_jsx(InvoiceCard, { row: row, adapter: adapter, labels: labels, outgoingLabels: outgoingLabels }, row.id)))) })] })), !invoicesQuery.error && !invoicesQuery.loading && view.total > 0 && (_jsx(TablePagination, { page: view.page, totalPages: view.totalPages, pageSize: view.pageSize, total: view.total, from: view.from, to: view.to, onPage: view.setPage, onPageSize: view.setPageSize }))] }));
|
|
105
|
+
}
|
|
106
|
+
function InvoiceRow({ row, adapter, labels, reviewLabels, outgoingLabels, showBankMatch, showConfidence, }) {
|
|
107
|
+
return (_jsxs(TableRow, { className: "cursor-pointer", onClick: () => adapter.openInvoice(row.id), children: [_jsxs(TableCell, { className: "max-w-[280px]", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("div", { className: "truncate font-medium text-foreground", title: row.issuer ?? "", children: row.issuer ?? "—" }), _jsx(OutgoingInvoiceBadge, { invoice: { extracted: row.extracted, issuer: row.issuer, recipient_name: null }, labels: outgoingLabels })] }), _jsxs("div", { className: "truncate text-xs text-muted-foreground", children: [row.invoiceNumber ? labels.invoiceNumber(row.invoiceNumber) : labels.noInvoiceNumber, row.costCategory ? ` · ${row.costCategory}` : ""] })] }), _jsx(TableCell, { children: _jsx(CompanyChip, { code: row.companyCode, placeholder: "\u2014" }) }), _jsxs(TableCell, { className: "text-right tabular-nums", children: [_jsx("span", { className: "block font-medium", children: adapter.formatMoney(row.amountGross) }), _jsx("span", { className: "mt-0.5 block", children: _jsx(VatBadge, { vatRate: row.vatRate, label: labels.vat }) })] }), _jsxs(TableCell, { className: "whitespace-nowrap text-sm text-muted-foreground tabular-nums", children: [_jsx("span", { className: "block", children: adapter.formatDate(row.documentDate) }), row.dueDate && !row.paidAt && (_jsx("span", { className: cn("block text-xs", new Date(row.dueDate) < new Date() && "text-destructive"), children: labels.columnDueOn(adapter.formatDate(row.dueDate)) }))] }), showConfidence && (_jsx(TableCell, { children: _jsx(ConfidenceBadge, { score: row.confidenceScore, label: (score) => (score == null ? labels.confidenceUnknown : labels.confidenceScore(Math.round(score * 100))) }) })), _jsx(TableCell, { children: _jsx(ReviewBadge, { reasonCount: reviewReasonIds(row).length, unchecked: hasNoReviewChecks(row), status: row.status, alreadyPaid: !!row.paidAt, labels: reviewLabels }) }), _jsx(TableCell, { children: _jsx(PaymentBadge, { paidAt: row.paidAt, paidLabel: labels.paid, openLabel: labels.open }) }), showBankMatch && (_jsx(TableCell, { children: _jsx(BankMatchBadge, { hasConfirmed: row.hasConfirmedBankMatch, hasSuggested: row.hasSuggestedBankMatch, confirmedLabel: labels.bankMatchConfirmed, suggestedLabel: labels.bankMatchSuggested }) }))] }));
|
|
108
|
+
}
|
|
109
|
+
function InvoiceCard({ row, adapter, labels, outgoingLabels, }) {
|
|
110
|
+
return (_jsxs("div", { className: "cursor-pointer rounded-xl border border-border bg-card p-4", onClick: () => adapter.openInvoice(row.id), children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("div", { className: "truncate font-medium text-foreground", children: row.issuer ?? "—" }), isOutgoingInvoice(row) && (_jsx(OutgoingInvoiceBadge, { invoice: { extracted: row.extracted, issuer: row.issuer, recipient_name: null }, labels: outgoingLabels }))] }), _jsx("div", { className: "mt-0.5 text-sm text-muted-foreground", children: row.invoiceNumber ? labels.invoiceNumber(row.invoiceNumber) : labels.noInvoiceNumber })] }), _jsxs("div", { className: "shrink-0 text-right", children: [_jsx("div", { className: "font-medium tabular-nums text-foreground", children: adapter.formatMoney(row.amountGross) }), _jsx("div", { className: "text-xs text-muted-foreground", children: adapter.formatDate(row.documentDate) })] })] }), _jsxs("div", { className: "mt-3 flex items-center justify-between border-t border-border pt-2 text-xs text-muted-foreground", children: [_jsx(CompanyChip, { code: row.companyCode, placeholder: "\u2014" }), _jsx(PaymentBadge, { paidAt: row.paidAt, paidLabel: labels.paid, openLabel: labels.open })] })] }));
|
|
111
|
+
}
|
|
112
|
+
export function InvoiceListLoadingSkeleton() {
|
|
113
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Skeleton, { className: "h-8 w-64" }), _jsx(Skeleton, { className: "h-24 w-full rounded-xl" }), _jsx(TableSkeleton, { rows: 8, columns: 7 })] }));
|
|
114
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface InvoiceListLabels {
|
|
2
|
+
incoming: {
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle: string;
|
|
5
|
+
};
|
|
6
|
+
outgoing: {
|
|
7
|
+
title: string;
|
|
8
|
+
subtitle: string;
|
|
9
|
+
};
|
|
10
|
+
searchPlaceholder: string;
|
|
11
|
+
companyAll: string;
|
|
12
|
+
companyPlaceholder: string;
|
|
13
|
+
columnIssuer: string;
|
|
14
|
+
columnCompany: string;
|
|
15
|
+
columnAmount: string;
|
|
16
|
+
columnDate: string;
|
|
17
|
+
columnDueOn: (date: string) => string;
|
|
18
|
+
columnConfidence: string;
|
|
19
|
+
columnReview: string;
|
|
20
|
+
columnPayment: string;
|
|
21
|
+
columnBankMatch: string;
|
|
22
|
+
invoiceNumber: (nr: string) => string;
|
|
23
|
+
noInvoiceNumber: string;
|
|
24
|
+
confidenceUnknown: string;
|
|
25
|
+
confidenceScore: (percent: number) => string;
|
|
26
|
+
vat: (rate: number) => string;
|
|
27
|
+
paid: string;
|
|
28
|
+
open: string;
|
|
29
|
+
bankMatchConfirmed: string;
|
|
30
|
+
bankMatchSuggested: string;
|
|
31
|
+
empty: string;
|
|
32
|
+
sortLabel: string;
|
|
33
|
+
sortAscending: string;
|
|
34
|
+
sortDescending: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const englishInvoiceListLabels: InvoiceListLabels;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const englishInvoiceListLabels = {
|
|
2
|
+
incoming: { title: "Incoming invoices", subtitle: "Invoices billed to you, from your suppliers." },
|
|
3
|
+
outgoing: { title: "Outgoing invoices", subtitle: "Invoices you issued to your customers." },
|
|
4
|
+
searchPlaceholder: "Search issuer or invoice number",
|
|
5
|
+
companyAll: "All companies",
|
|
6
|
+
companyPlaceholder: "Company",
|
|
7
|
+
columnIssuer: "Issuer",
|
|
8
|
+
columnCompany: "Company",
|
|
9
|
+
columnAmount: "Amount",
|
|
10
|
+
columnDate: "Date",
|
|
11
|
+
columnDueOn: (date) => `Due ${date}`,
|
|
12
|
+
columnConfidence: "Confidence",
|
|
13
|
+
columnReview: "Review",
|
|
14
|
+
columnPayment: "Payment",
|
|
15
|
+
columnBankMatch: "Bank match",
|
|
16
|
+
invoiceNumber: (nr) => `No. ${nr}`,
|
|
17
|
+
noInvoiceNumber: "No invoice number",
|
|
18
|
+
confidenceUnknown: "Unknown",
|
|
19
|
+
confidenceScore: (percent) => `${percent}%`,
|
|
20
|
+
vat: (rate) => `VAT ${rate}%`,
|
|
21
|
+
paid: "Paid",
|
|
22
|
+
open: "Open",
|
|
23
|
+
bankMatchConfirmed: "Matched",
|
|
24
|
+
bankMatchSuggested: "Suggested match",
|
|
25
|
+
empty: "No invoices found.",
|
|
26
|
+
sortLabel: "Sort by",
|
|
27
|
+
sortAscending: "Ascending",
|
|
28
|
+
sortDescending: "Descending",
|
|
29
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SortDirection } from "./use-table-view";
|
|
2
|
+
export interface SortColumn {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function SortControl({ columns, sort, direction, onSort, onDirection, labels, }: {
|
|
7
|
+
columns: SortColumn[];
|
|
8
|
+
sort: string;
|
|
9
|
+
direction: SortDirection;
|
|
10
|
+
onSort: (key: string) => void;
|
|
11
|
+
onDirection: (direction: SortDirection) => void;
|
|
12
|
+
labels: {
|
|
13
|
+
sortLabel: string;
|
|
14
|
+
sortAscending: string;
|
|
15
|
+
sortDescending: string;
|
|
16
|
+
};
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Combobox } from "../../ui/combobox.js";
|
|
3
|
+
export function SortControl({ columns, sort, direction, onSort, onDirection, labels, }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex w-full flex-wrap items-center gap-2 sm:w-auto", children: [_jsx("span", { className: "hidden shrink-0 text-sm text-muted-foreground sm:inline", children: labels.sortLabel }), _jsx(Combobox, { value: sort, onValueChange: onSort, className: "w-full sm:w-48", options: columns }), _jsx(Combobox, { value: direction, onValueChange: (value) => onDirection(value), className: "w-full sm:w-40", options: [
|
|
5
|
+
{ value: "asc", label: labels.sortAscending },
|
|
6
|
+
{ value: "desc", label: labels.sortDescending },
|
|
7
|
+
] })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type SortDirection = "asc" | "desc";
|
|
2
|
+
export interface TableView<Row> {
|
|
3
|
+
pageRows: Row[];
|
|
4
|
+
sort: string;
|
|
5
|
+
direction: SortDirection;
|
|
6
|
+
setSort: (key: string) => void;
|
|
7
|
+
setDirection: (direction: SortDirection) => void;
|
|
8
|
+
page: number;
|
|
9
|
+
setPage: (page: number) => void;
|
|
10
|
+
pageSize: number;
|
|
11
|
+
setPageSize: (size: number) => void;
|
|
12
|
+
total: number;
|
|
13
|
+
totalPages: number;
|
|
14
|
+
from: number;
|
|
15
|
+
to: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function useTableView<Row>(rows: Row[], options: {
|
|
18
|
+
sortValue: (row: Row, key: string) => string | number;
|
|
19
|
+
initialSort: string;
|
|
20
|
+
initialDirection?: SortDirection;
|
|
21
|
+
initialPageSize?: number;
|
|
22
|
+
resetKey?: string;
|
|
23
|
+
}): TableView<Row>;
|