@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,54 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
export function useTableView(rows, options) {
|
|
3
|
+
const { sortValue, initialSort, initialDirection = "asc", initialPageSize = 25, resetKey, } = options;
|
|
4
|
+
const [sort, setSortState] = useState(initialSort);
|
|
5
|
+
const [direction, setDirectionState] = useState(initialDirection);
|
|
6
|
+
const [page, setPage] = useState(1);
|
|
7
|
+
const [pageSize, setPageSize] = useState(initialPageSize);
|
|
8
|
+
const [seenResetKey, setSeenResetKey] = useState(resetKey);
|
|
9
|
+
if (resetKey !== seenResetKey) {
|
|
10
|
+
setSeenResetKey(resetKey);
|
|
11
|
+
setPage(1);
|
|
12
|
+
}
|
|
13
|
+
const sortedRows = useMemo(() => {
|
|
14
|
+
const copy = [...rows];
|
|
15
|
+
copy.sort((first, second) => {
|
|
16
|
+
const firstValue = sortValue(first, sort);
|
|
17
|
+
const secondValue = sortValue(second, sort);
|
|
18
|
+
const comparison = typeof firstValue === "number" && typeof secondValue === "number"
|
|
19
|
+
? firstValue - secondValue
|
|
20
|
+
: String(firstValue).localeCompare(String(secondValue));
|
|
21
|
+
return direction === "asc" ? comparison : -comparison;
|
|
22
|
+
});
|
|
23
|
+
return copy;
|
|
24
|
+
}, [rows, sort, direction, sortValue]);
|
|
25
|
+
const total = sortedRows.length;
|
|
26
|
+
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
27
|
+
const safePage = Math.min(page, totalPages);
|
|
28
|
+
const from = total === 0 ? 0 : (safePage - 1) * pageSize + 1;
|
|
29
|
+
const to = Math.min(safePage * pageSize, total);
|
|
30
|
+
const pageRows = sortedRows.slice((safePage - 1) * pageSize, safePage * pageSize);
|
|
31
|
+
function setSort(key) {
|
|
32
|
+
setSortState(key);
|
|
33
|
+
setPage(1);
|
|
34
|
+
}
|
|
35
|
+
function setDirection(next) {
|
|
36
|
+
setDirectionState(next);
|
|
37
|
+
setPage(1);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
pageRows,
|
|
41
|
+
sort,
|
|
42
|
+
direction,
|
|
43
|
+
setSort,
|
|
44
|
+
setDirection,
|
|
45
|
+
page: safePage,
|
|
46
|
+
setPage,
|
|
47
|
+
pageSize,
|
|
48
|
+
setPageSize,
|
|
49
|
+
total,
|
|
50
|
+
totalPages,
|
|
51
|
+
from,
|
|
52
|
+
to,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InvoiceUploadAdapter } from "../../adapters/invoice-upload";
|
|
2
|
+
import { type InvoiceUploadLabels } from "./labels";
|
|
3
|
+
export interface InvoiceUploadPageProps {
|
|
4
|
+
adapter: InvoiceUploadAdapter;
|
|
5
|
+
labels?: InvoiceUploadLabels;
|
|
6
|
+
}
|
|
7
|
+
export declare function InvoiceUploadPage({ adapter, labels }: InvoiceUploadPageProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { ArrowLeft, FileCheck2, FileText, Loader2, Trash2, UploadCloud } from "lucide-react";
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { Button } from "../../ui/button.js";
|
|
6
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "../../ui/alert-dialog.js";
|
|
7
|
+
import { readableErrorMessage } from "../../components/feedback/query-states.js";
|
|
8
|
+
import { cn } from "../../lib/class-names.js";
|
|
9
|
+
import { englishInvoiceUploadLabels } from "./labels.js";
|
|
10
|
+
function formatSize(bytes) {
|
|
11
|
+
if (bytes < 1024)
|
|
12
|
+
return `${bytes} B`;
|
|
13
|
+
if (bytes < 1024 * 1024)
|
|
14
|
+
return `${(bytes / 1024).toFixed(0)} KB`;
|
|
15
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
16
|
+
}
|
|
17
|
+
function newId() {
|
|
18
|
+
return `f-${Math.random().toString(36).slice(2, 9)}`;
|
|
19
|
+
}
|
|
20
|
+
function isAccepted(name, extensions) {
|
|
21
|
+
const lower = name.toLowerCase();
|
|
22
|
+
return extensions.some((ext) => lower.endsWith(ext));
|
|
23
|
+
}
|
|
24
|
+
export function InvoiceUploadPage({ adapter, labels = englishInvoiceUploadLabels }) {
|
|
25
|
+
const inputRef = useRef(null);
|
|
26
|
+
const [dragOver, setDragOver] = useState(false);
|
|
27
|
+
const [files, setFiles] = useState([]);
|
|
28
|
+
const [uploading, setUploading] = useState(false);
|
|
29
|
+
const controllers = useRef(new Map());
|
|
30
|
+
function addFiles(list) {
|
|
31
|
+
const array = Array.from(list);
|
|
32
|
+
const tooBig = array.filter((f) => f.size > adapter.maxFileSizeBytes);
|
|
33
|
+
const accepted = array.filter((f) => isAccepted(f.name, adapter.acceptedExtensions) && f.size <= adapter.maxFileSizeBytes);
|
|
34
|
+
const rejected = array.length - accepted.length;
|
|
35
|
+
if (tooBig.length > 0)
|
|
36
|
+
toast.error(labels.toastTooBig(tooBig.length, formatSize(adapter.maxFileSizeBytes)));
|
|
37
|
+
else if (rejected > 0)
|
|
38
|
+
toast.error(labels.toastIgnored(rejected));
|
|
39
|
+
if (accepted.length === 0)
|
|
40
|
+
return;
|
|
41
|
+
setFiles((prev) => [
|
|
42
|
+
...prev,
|
|
43
|
+
...accepted.map((f) => ({ id: newId(), file: f, name: f.name, size: f.size, phase: "queued", progress: 0 })),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
function removeFile(id) {
|
|
47
|
+
controllers.current.get(id)?.abort();
|
|
48
|
+
setFiles((prev) => prev.filter((f) => f.id !== id));
|
|
49
|
+
}
|
|
50
|
+
function cancelFile(id) {
|
|
51
|
+
controllers.current.get(id)?.abort();
|
|
52
|
+
}
|
|
53
|
+
async function upload() {
|
|
54
|
+
const queued = files.filter((f) => f.phase === "queued");
|
|
55
|
+
if (queued.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
setUploading(true);
|
|
58
|
+
try {
|
|
59
|
+
const inputs = [];
|
|
60
|
+
for (const f of queued) {
|
|
61
|
+
const invoiceId = crypto.randomUUID();
|
|
62
|
+
setFiles((prev) => prev.map((x) => (x.id === f.id ? { ...x, phase: "uploading", progress: 0 } : x)));
|
|
63
|
+
const controller = new AbortController();
|
|
64
|
+
controllers.current.set(f.id, controller);
|
|
65
|
+
let result;
|
|
66
|
+
try {
|
|
67
|
+
result = await adapter.uploadFile(f.file, {
|
|
68
|
+
signal: controller.signal,
|
|
69
|
+
onProgress: (percent) => setFiles((prev) => prev.map((x) => (x.id === f.id ? { ...x, progress: percent } : x))),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
setFiles((prev) => prev.map((x) => (x.id === f.id ? { ...x, phase: "queued", progress: 0 } : x)));
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
controllers.current.delete(f.id);
|
|
78
|
+
}
|
|
79
|
+
inputs.push({
|
|
80
|
+
invoiceId,
|
|
81
|
+
filename: f.name,
|
|
82
|
+
mime: result.mime,
|
|
83
|
+
size: result.sizeBytes,
|
|
84
|
+
storageBucket: result.storageBucket,
|
|
85
|
+
storagePath: result.storagePath,
|
|
86
|
+
checksumSha256: result.checksumSha256,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
await adapter.createInvoices(inputs);
|
|
90
|
+
setFiles((prev) => prev.map((f) => (f.phase === "uploading" ? { ...f, phase: "done" } : f)));
|
|
91
|
+
toast.success(labels.toastSaved(queued.length));
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
toast.error(labels.toastFailed(readableErrorMessage(error, "")));
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
setUploading(false);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const queuedCount = files.filter((f) => f.phase === "queued").length;
|
|
101
|
+
const hasDone = files.some((f) => f.phase === "done");
|
|
102
|
+
return (_jsxs("div", { className: "mx-auto max-w-3xl", children: [_jsxs("button", { type: "button", onClick: adapter.openInvoiceList, className: "inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground", children: [_jsx(ArrowLeft, { className: "size-4" }), " ", labels.back] }), _jsxs("div", { className: "mt-2", children: [_jsx("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: labels.title }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: labels.subtitle })] }), _jsxs("div", { onDragOver: (event) => {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
setDragOver(true);
|
|
105
|
+
}, onDragLeave: () => setDragOver(false), onDrop: (event) => {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
setDragOver(false);
|
|
108
|
+
if (event.dataTransfer.files?.length)
|
|
109
|
+
addFiles(event.dataTransfer.files);
|
|
110
|
+
}, className: cn("mt-6 flex flex-col items-center justify-center gap-3 rounded-2xl border-2 border-dashed px-6 py-14 text-center transition-colors", dragOver ? "border-brand bg-brand-wash" : "border-border bg-muted/30 hover:border-brand-soft"), children: [_jsx("span", { className: cn("grid size-14 place-items-center rounded-full transition-colors", dragOver ? "bg-brand text-primary-foreground" : "bg-brand-wash text-brand-dark"), children: _jsx(UploadCloud, { className: "size-7" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: dragOver ? labels.dropRelease : labels.dropHint }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: labels.fileTypes })] }), _jsx(Button, { variant: "outline", className: "mt-1", onClick: () => inputRef.current?.click(), children: labels.chooseFiles }), _jsx("input", { ref: inputRef, type: "file", multiple: true, accept: adapter.acceptedExtensions.join(","), className: "hidden", onChange: (event) => {
|
|
111
|
+
if (event.target.files?.length)
|
|
112
|
+
addFiles(event.target.files);
|
|
113
|
+
event.target.value = "";
|
|
114
|
+
} })] }), files.length > 0 && (_jsxs("div", { className: "mt-6 overflow-hidden rounded-xl border border-border bg-card", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-4 py-3", children: [_jsx("span", { className: "text-sm font-medium text-foreground", children: labels.selectedCount(files.length) }), _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "text-xs font-medium text-muted-foreground underline-offset-4 hover:text-foreground hover:underline", children: labels.removeAll }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: labels.removeAllTitle }), _jsx(AlertDialogDescription, { children: labels.removeAllDescription })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: labels.removeAllCancel }), _jsx(AlertDialogAction, { onClick: () => setFiles([]), className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: labels.removeAllConfirm })] })] })] })] }), _jsx("ul", { className: "divide-y divide-border", children: files.map((f) => (_jsxs("li", { className: "flex items-center gap-3 px-4 py-3", children: [_jsx("span", { className: "grid size-9 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground", children: f.phase === "done" ? _jsx(FileCheck2, { className: "size-4 text-brand" }) : _jsx(FileText, { className: "size-4" }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium text-foreground", children: f.name }), _jsxs("div", { className: "text-xs text-muted-foreground", children: [formatSize(f.size), f.phase === "done" && _jsx("span", { className: "ml-1 text-brand-dark", children: labels.savedTag }), f.phase === "uploading" && _jsxs("span", { className: "ml-1 tabular-nums", children: [f.progress, "%"] })] }), f.phase === "uploading" && (_jsx("div", { className: "mt-1.5 h-1 overflow-hidden rounded-full bg-muted", children: _jsx("div", { className: "h-full rounded-full bg-primary transition-[width]", style: { width: `${f.progress}%` } }) }))] }), f.phase === "uploading" && (_jsx("button", { type: "button", onClick: () => cancelFile(f.id), className: "rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground", children: labels.cancelFile })), f.phase === "queued" && (_jsx("button", { type: "button", onClick: () => removeFile(f.id), "aria-label": labels.removeFile, className: "grid size-8 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground", children: _jsx(Trash2, { className: "size-4" }) }))] }, f.id))) })] })), _jsxs("div", { className: "mt-6 flex flex-wrap items-center justify-end gap-3", children: [_jsx(Button, { variant: "outline", onClick: adapter.openInvoiceList, children: hasDone ? labels.toOverview : labels.cancel }), _jsx(Button, { className: "gap-2", onClick: upload, disabled: queuedCount === 0 || uploading, children: uploading ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "size-4 animate-spin" }), " ", labels.uploading] })) : (_jsxs(_Fragment, { children: [_jsx(UploadCloud, { className: "size-4" }), " ", queuedCount > 0 ? labels.uploadCount(queuedCount) : labels.uploadGeneric] })) })] }), _jsx("p", { className: "mt-4 text-xs text-muted-foreground", children: labels.footer })] }));
|
|
115
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface InvoiceUploadLabels {
|
|
2
|
+
back: string;
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle: string;
|
|
5
|
+
dropHint: string;
|
|
6
|
+
dropRelease: string;
|
|
7
|
+
fileTypes: string;
|
|
8
|
+
chooseFiles: string;
|
|
9
|
+
selectedCount: (count: number) => string;
|
|
10
|
+
removeAll: string;
|
|
11
|
+
removeAllTitle: string;
|
|
12
|
+
removeAllDescription: string;
|
|
13
|
+
removeAllCancel: string;
|
|
14
|
+
removeAllConfirm: string;
|
|
15
|
+
savedTag: string;
|
|
16
|
+
cancelFile: string;
|
|
17
|
+
removeFile: string;
|
|
18
|
+
toOverview: string;
|
|
19
|
+
cancel: string;
|
|
20
|
+
uploading: string;
|
|
21
|
+
uploadCount: (count: number) => string;
|
|
22
|
+
uploadGeneric: string;
|
|
23
|
+
footer: string;
|
|
24
|
+
toastTooBig: (count: number, limit: string) => string;
|
|
25
|
+
toastIgnored: (count: number) => string;
|
|
26
|
+
toastSaved: (count: number) => string;
|
|
27
|
+
toastFailed: (error: string) => string;
|
|
28
|
+
}
|
|
29
|
+
export declare const englishInvoiceUploadLabels: InvoiceUploadLabels;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const englishInvoiceUploadLabels = {
|
|
2
|
+
back: "Back",
|
|
3
|
+
title: "Upload invoices",
|
|
4
|
+
subtitle: "Add invoices by hand instead of waiting for the pipeline to pick them up.",
|
|
5
|
+
dropHint: "Drag files here",
|
|
6
|
+
dropRelease: "Release to add",
|
|
7
|
+
fileTypes: "PDF, JPG, PNG, XML",
|
|
8
|
+
chooseFiles: "Choose files",
|
|
9
|
+
selectedCount: (count) => `${count} file${count === 1 ? "" : "s"} selected`,
|
|
10
|
+
removeAll: "Remove all",
|
|
11
|
+
removeAllTitle: "Remove all files?",
|
|
12
|
+
removeAllDescription: "This clears the list. Nothing has been uploaded yet.",
|
|
13
|
+
removeAllCancel: "Cancel",
|
|
14
|
+
removeAllConfirm: "Remove all",
|
|
15
|
+
savedTag: "Saved",
|
|
16
|
+
cancelFile: "Cancel",
|
|
17
|
+
removeFile: "Remove",
|
|
18
|
+
toOverview: "Back to invoices",
|
|
19
|
+
cancel: "Cancel",
|
|
20
|
+
uploading: "Uploading…",
|
|
21
|
+
uploadCount: (count) => `Upload ${count}`,
|
|
22
|
+
uploadGeneric: "Upload",
|
|
23
|
+
footer: "Files are queued here first; nothing is saved until you press Upload.",
|
|
24
|
+
toastTooBig: (count, limit) => `${count} file${count === 1 ? " is" : "s are"} larger than ${limit} and were skipped.`,
|
|
25
|
+
toastIgnored: (count) => `${count} file${count === 1 ? " was" : "s were"} an unsupported type and were skipped.`,
|
|
26
|
+
toastSaved: (count) => `${count} file${count === 1 ? "" : "s"} uploaded.`,
|
|
27
|
+
toastFailed: (error) => `Upload failed: ${error}`,
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ManualBookingsAdapter } from "../../adapters/manual-bookings";
|
|
2
|
+
import { type ManualBookingsLabels } from "./labels";
|
|
3
|
+
export interface ManualBookingsPageProps {
|
|
4
|
+
adapter: ManualBookingsAdapter;
|
|
5
|
+
labels?: ManualBookingsLabels;
|
|
6
|
+
}
|
|
7
|
+
export declare function ManualBookingsPage({ adapter, labels }: ManualBookingsPageProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { Plus, Repeat, Search, Trash2 } from "lucide-react";
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { Button } from "../../ui/button.js";
|
|
6
|
+
import { Input } from "../../ui/input.js";
|
|
7
|
+
import { Label } from "../../ui/label.js";
|
|
8
|
+
import { Textarea } from "../../ui/textarea.js";
|
|
9
|
+
import { Switch } from "../../ui/switch.js";
|
|
10
|
+
import { Badge } from "../../ui/badge.js";
|
|
11
|
+
import { Combobox } from "../../ui/combobox.js";
|
|
12
|
+
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from "../../ui/dialog.js";
|
|
13
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "../../ui/alert-dialog.js";
|
|
14
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../ui/table.js";
|
|
15
|
+
import { ErrorState, TableSkeleton, readableErrorMessage } from "../../components/feedback/query-states.js";
|
|
16
|
+
import { cn } from "../../lib/class-names.js";
|
|
17
|
+
import { englishManualBookingsLabels } from "./labels.js";
|
|
18
|
+
const ALL = "__all";
|
|
19
|
+
const NONE = "__none";
|
|
20
|
+
const YEAR_MIN = 1900;
|
|
21
|
+
const YEAR_MAX = 2999;
|
|
22
|
+
function isValidYear(raw) {
|
|
23
|
+
const n = Number(raw);
|
|
24
|
+
return /^\d{4}$/.test(raw) && n >= YEAR_MIN && n <= YEAR_MAX;
|
|
25
|
+
}
|
|
26
|
+
function periodOf(month, year) {
|
|
27
|
+
return `${year}-${String(month).padStart(2, "0")}-01`;
|
|
28
|
+
}
|
|
29
|
+
export function ManualBookingsPage({ adapter, labels = englishManualBookingsLabels }) {
|
|
30
|
+
const companyOptionsQuery = adapter.useCompanyOptions();
|
|
31
|
+
const categoryOptionsQuery = adapter.useCategoryOptions();
|
|
32
|
+
const propertyOptionsQuery = adapter.usePropertyOptions();
|
|
33
|
+
const [companyId, setCompanyId] = useState(ALL);
|
|
34
|
+
const [year, setYear] = useState(new Date().getFullYear());
|
|
35
|
+
const [yearInput, setYearInput] = useState(String(new Date().getFullYear()));
|
|
36
|
+
const [search, setSearch] = useState("");
|
|
37
|
+
const [sort, setSort] = useState("periodAsc");
|
|
38
|
+
const [dialogState, setDialogState] = useState(null);
|
|
39
|
+
const from = `${year}-01-01`;
|
|
40
|
+
const to = `${year}-12-01`;
|
|
41
|
+
const bookingsQuery = adapter.useBookings(companyId === ALL ? null : companyId, from, to);
|
|
42
|
+
const companyById = useMemo(() => new Map(companyOptionsQuery.data.map((c) => [c.id, c])), [companyOptionsQuery.data]);
|
|
43
|
+
const categoryById = useMemo(() => new Map(categoryOptionsQuery.data.map((c) => [c.id, c])), [categoryOptionsQuery.data]);
|
|
44
|
+
const propertyById = useMemo(() => new Map(propertyOptionsQuery.data.map((p) => [p.id, p])), [propertyOptionsQuery.data]);
|
|
45
|
+
function monthLabel(period) {
|
|
46
|
+
const m = Number(period.slice(5, 7));
|
|
47
|
+
return `${adapter.monthLabels[m - 1] ?? m} ${period.slice(0, 4)}`;
|
|
48
|
+
}
|
|
49
|
+
const rows = useMemo(() => {
|
|
50
|
+
const term = search.trim().toLowerCase();
|
|
51
|
+
const filtered = bookingsQuery.data.filter((row) => {
|
|
52
|
+
if (!term)
|
|
53
|
+
return true;
|
|
54
|
+
const category = categoryById.get(row.categoryId)?.label ?? "";
|
|
55
|
+
const property = row.propertyId ? (propertyById.get(row.propertyId)?.code ?? "") : "";
|
|
56
|
+
const company = companyById.get(row.companyId)?.code ?? "";
|
|
57
|
+
return [row.note ?? "", category, property, company, monthLabel(row.period)].join(" ").toLowerCase().includes(term);
|
|
58
|
+
});
|
|
59
|
+
const sorted = [...filtered];
|
|
60
|
+
sorted.sort((a, b) => {
|
|
61
|
+
if (sort === "amountDesc")
|
|
62
|
+
return Math.abs(b.amount) - Math.abs(a.amount);
|
|
63
|
+
if (sort === "amountAsc")
|
|
64
|
+
return Math.abs(a.amount) - Math.abs(b.amount);
|
|
65
|
+
if (sort === "category")
|
|
66
|
+
return (categoryById.get(a.categoryId)?.label ?? "").localeCompare(categoryById.get(b.categoryId)?.label ?? "");
|
|
67
|
+
if (sort === "periodDesc")
|
|
68
|
+
return b.period.localeCompare(a.period);
|
|
69
|
+
return a.period.localeCompare(b.period);
|
|
70
|
+
});
|
|
71
|
+
return sorted;
|
|
72
|
+
}, [bookingsQuery.data, search, sort, categoryById, propertyById, companyById]);
|
|
73
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-4", children: [_jsxs("div", { children: [_jsx("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: labels.title }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: labels.subtitle })] }), _jsxs("div", { className: "flex w-full flex-wrap items-end gap-3 sm:w-auto", children: [_jsxs("div", { className: "w-full space-y-1.5 sm:w-[220px]", children: [_jsx(Label, { children: labels.companyLabel }), _jsx(Combobox, { value: companyId, onValueChange: setCompanyId, options: [{ value: ALL, label: labels.companyAll }, ...companyOptionsQuery.data.map((c) => ({ value: c.id, label: `${c.code} · ${c.name}` }))] })] }), _jsxs("div", { className: "w-[100px] space-y-1.5", children: [_jsx(Label, { children: labels.yearLabel }), _jsx(Input, { type: "number", inputMode: "numeric", value: yearInput, onChange: (event) => {
|
|
74
|
+
const raw = event.target.value;
|
|
75
|
+
setYearInput(raw);
|
|
76
|
+
if (isValidYear(raw))
|
|
77
|
+
setYear(Number(raw));
|
|
78
|
+
}, onBlur: () => setYearInput(String(year)), "aria-invalid": !isValidYear(yearInput) }), !isValidYear(yearInput) && _jsx("p", { className: "text-xs text-amber-700", children: labels.yearInvalid(YEAR_MIN, YEAR_MAX, year) })] }), _jsxs(Button, { className: "gap-2", onClick: () => setDialogState("new"), children: [_jsx(Plus, { className: "size-4" }), " ", labels.newBookingButton] })] })] }), _jsx("p", { className: "mt-4 max-w-3xl rounded-lg border border-border bg-muted/40 p-3 text-xs text-muted-foreground", children: labels.hint }), _jsxs("div", { className: "mt-4 flex flex-wrap items-center gap-3", children: [_jsxs("div", { className: "relative w-full flex-1 sm:w-auto sm:min-w-[240px]", 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" })] }), _jsx(Combobox, { value: sort, onValueChange: (v) => setSort(v), className: "w-full sm:w-[220px]", options: [
|
|
79
|
+
{ value: "periodAsc", label: labels.sortPeriodAsc },
|
|
80
|
+
{ value: "periodDesc", label: labels.sortPeriodDesc },
|
|
81
|
+
{ value: "amountDesc", label: labels.sortAmountDesc },
|
|
82
|
+
{ value: "amountAsc", label: labels.sortAmountAsc },
|
|
83
|
+
{ value: "category", label: labels.sortCategory },
|
|
84
|
+
] })] }), bookingsQuery.error ? (_jsx("div", { className: "mt-6", children: _jsx(ErrorState, { error: bookingsQuery.error, onRetry: () => { } }) })) : bookingsQuery.loading ? (_jsx("div", { className: "mt-6", children: _jsx(TableSkeleton, { rows: 5, columns: companyId === ALL ? 7 : 6 }) })) : (_jsx("div", { className: "mt-6 overflow-hidden overflow-x-auto rounded-xl border border-border bg-card", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { className: "bg-muted/40", children: [companyId === ALL && _jsx(TableHead, { children: labels.columnCompany }), _jsx(TableHead, { children: labels.columnPeriod }), _jsx(TableHead, { children: labels.columnCategory }), _jsx(TableHead, { children: labels.columnProperty }), _jsx(TableHead, { children: labels.columnNote }), _jsx(TableHead, { className: "text-right", children: labels.columnAmount }), _jsx(TableHead, { className: "text-right", children: labels.columnActions })] }) }), _jsxs(TableBody, { children: [rows.map((row) => (_jsxs(TableRow, { children: [companyId === ALL && _jsx(TableCell, { className: "text-muted-foreground", children: companyById.get(row.companyId)?.code ?? "—" }), _jsx(TableCell, { className: "font-medium text-foreground", children: monthLabel(row.period) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { children: categoryById.get(row.categoryId)?.label ?? "—" }), row.isRecurring && (_jsxs(Badge, { variant: "outline", className: "gap-1 text-[10px]", children: [_jsx(Repeat, { className: "size-3" }), " ", labels.recurringBadge] }))] }) }), _jsx(TableCell, { className: "text-muted-foreground", children: row.propertyId ? (propertyById.get(row.propertyId)?.code ?? "—") : "—" }), _jsx(TableCell, { className: "max-w-xs truncate text-muted-foreground", children: row.note ?? "—" }), _jsx(TableCell, { className: cn("text-right font-medium tabular-nums", row.amount < 0 && "text-destructive"), children: adapter.formatMoney(row.amount) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex justify-end gap-1", children: [_jsx("button", { type: "button", className: "text-xs font-medium text-muted-foreground hover:text-foreground", onClick: () => setDialogState(row), children: labels.editButton }), _jsx(DeleteBookingButton, { booking: row, adapter: adapter, labels: labels })] }) })] }, row.id))), rows.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: companyId === ALL ? 7 : 6, className: "py-8 text-center text-muted-foreground", children: labels.empty }) }))] })] }) })), dialogState && (_jsx(BookingDialog, { booking: dialogState === "new" ? null : dialogState, defaultCompanyId: companyId === ALL ? undefined : companyId, adapter: adapter, labels: labels, onClose: () => setDialogState(null) }))] }));
|
|
85
|
+
}
|
|
86
|
+
function DeleteBookingButton({ booking, adapter, labels }) {
|
|
87
|
+
const [open, setOpen] = useState(false);
|
|
88
|
+
async function confirm() {
|
|
89
|
+
try {
|
|
90
|
+
await adapter.deleteBooking(booking.id);
|
|
91
|
+
toast.success(labels.deletedToast);
|
|
92
|
+
setOpen(false);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
toast.error(readableErrorMessage(error, ""));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return (_jsxs(AlertDialog, { open: open, onOpenChange: setOpen, children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx("button", { type: "button", title: labels.deleteButton, className: "flex size-6 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive", children: _jsx(Trash2, { className: "size-3.5" }) }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: labels.deleteDialogTitle }), _jsx(AlertDialogDescription, { children: labels.deleteDialogDescription })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: labels.deleteCancel }), _jsx(AlertDialogAction, { onClick: confirm, className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: labels.deleteConfirm })] })] })] }));
|
|
99
|
+
}
|
|
100
|
+
function BookingDialog({ booking, defaultCompanyId, adapter, labels, onClose, }) {
|
|
101
|
+
const companyOptionsQuery = adapter.useCompanyOptions();
|
|
102
|
+
const categoryOptionsQuery = adapter.useCategoryOptions();
|
|
103
|
+
const propertyOptionsQuery = adapter.usePropertyOptions();
|
|
104
|
+
const now = new Date();
|
|
105
|
+
const [companyId, setCompanyId] = useState(booking?.companyId ?? defaultCompanyId ?? "");
|
|
106
|
+
const [categoryId, setCategoryId] = useState(booking?.categoryId ?? "");
|
|
107
|
+
const [propertyId, setPropertyId] = useState(booking?.propertyId ?? NONE);
|
|
108
|
+
const [month, setMonth] = useState(booking ? Number(booking.period.slice(5, 7)) : now.getMonth() + 1);
|
|
109
|
+
const [year, setYear] = useState(booking ? Number(booking.period.slice(0, 4)) : now.getFullYear());
|
|
110
|
+
const [amount, setAmount] = useState(booking ? String(booking.amount) : "");
|
|
111
|
+
const [note, setNote] = useState(booking?.note ?? "");
|
|
112
|
+
const [recurring, setRecurring] = useState(booking?.isRecurring ?? false);
|
|
113
|
+
const [endMonth, setEndMonth] = useState(booking?.recurrenceUntil ? Number(booking.recurrenceUntil.slice(5, 7)) : null);
|
|
114
|
+
const [endYear, setEndYear] = useState(booking?.recurrenceUntil ? Number(booking.recurrenceUntil.slice(0, 4)) : null);
|
|
115
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
116
|
+
const [error, setError] = useState("");
|
|
117
|
+
const amountNum = Number(amount.replace(",", "."));
|
|
118
|
+
const endMonthWithoutYear = recurring && !!endMonth && !endYear;
|
|
119
|
+
const endBeforeStart = recurring && !!endMonth && !!endYear && periodOf(endMonth, endYear) < periodOf(month, year);
|
|
120
|
+
const invalid = !companyId || !categoryId || !amount.trim() || !Number.isFinite(amountNum) || amountNum === 0 || endMonthWithoutYear || endBeforeStart || !isValidYear(String(year));
|
|
121
|
+
async function save() {
|
|
122
|
+
if (endMonthWithoutYear) {
|
|
123
|
+
setError(labels.endMonthNeedsYear);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (endBeforeStart) {
|
|
127
|
+
setError(labels.endBeforeStart);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (invalid)
|
|
131
|
+
return;
|
|
132
|
+
setError("");
|
|
133
|
+
const input = {
|
|
134
|
+
companyId,
|
|
135
|
+
categoryId,
|
|
136
|
+
propertyId: propertyId === NONE ? null : propertyId,
|
|
137
|
+
period: periodOf(month, year),
|
|
138
|
+
amount: amountNum,
|
|
139
|
+
note: note.trim() === "" ? null : note.trim(),
|
|
140
|
+
isRecurring: recurring,
|
|
141
|
+
recurrenceUntil: recurring && endMonth && endYear ? periodOf(endMonth, endYear) : null,
|
|
142
|
+
};
|
|
143
|
+
setIsSaving(true);
|
|
144
|
+
try {
|
|
145
|
+
if (booking)
|
|
146
|
+
await adapter.updateBooking(booking.id, input);
|
|
147
|
+
else
|
|
148
|
+
await adapter.createBooking(input);
|
|
149
|
+
toast.success(labels.savedToast);
|
|
150
|
+
onClose();
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
toast.error(labels.saveFailed(readableErrorMessage(e, "")));
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
setIsSaving(false);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const monthOptions = adapter.monthLabels.map((label, i) => ({ value: String(i + 1), label }));
|
|
160
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (next) => !next && onClose(), children: _jsxs(DialogContent, { className: "max-w-lg", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: booking ? labels.editDialogTitle : labels.newDialogTitle }) }), _jsxs("div", { className: "grid gap-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldCompany }), _jsx(Combobox, { value: companyId, onValueChange: setCompanyId, options: companyOptionsQuery.data.map((c) => ({ value: c.id, label: `${c.code} · ${c.name}` })) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldCategory }), _jsx(Combobox, { value: categoryId, onValueChange: setCategoryId, options: categoryOptionsQuery.data.map((c) => ({ value: c.id, label: c.label })) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldProperty }), _jsx(Combobox, { value: propertyId, onValueChange: setPropertyId, options: [{ value: NONE, label: labels.propertyNone }, ...propertyOptionsQuery.data.map((p) => ({ value: p.id, label: p.name ? `${p.code} · ${p.name}` : p.code }))] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldMonth }), _jsx(Combobox, { value: String(month), onValueChange: (v) => setMonth(Number(v)), options: monthOptions })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldYear }), _jsx(Input, { type: "number", value: year, onChange: (event) => setYear(Number(event.target.value) || year) })] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldAmount }), _jsx(Input, { value: amount, onChange: (event) => setAmount(event.target.value) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldNote }), _jsx(Textarea, { value: note, onChange: (event) => setNote(event.target.value), rows: 2 })] }), _jsxs("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [_jsx(Switch, { checked: recurring, onCheckedChange: setRecurring }), labels.fieldRecurring] }), recurring && (_jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: labels.fieldRecurringUntil }), _jsx(Combobox, { value: endMonth ? String(endMonth) : "", onValueChange: (v) => setEndMonth(v ? Number(v) : null), options: [{ value: "", label: labels.recurringUntilNone }, ...monthOptions] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: "\u00A0" }), _jsx(Input, { type: "number", value: endYear ?? "", onChange: (event) => setEndYear(event.target.value ? Number(event.target.value) : null) })] })] })), error && _jsx("p", { className: "text-xs text-destructive", children: error })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: onClose, children: labels.cancel }), _jsx(Button, { onClick: save, disabled: invalid || isSaving, children: isSaving ? labels.saving : labels.save })] })] }) }));
|
|
161
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface ManualBookingsLabels {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle: string;
|
|
4
|
+
hint: string;
|
|
5
|
+
companyLabel: string;
|
|
6
|
+
companyAll: string;
|
|
7
|
+
yearLabel: string;
|
|
8
|
+
yearInvalid: (min: number, max: number, fallback: number) => string;
|
|
9
|
+
newBookingButton: string;
|
|
10
|
+
searchPlaceholder: string;
|
|
11
|
+
sortPeriodAsc: string;
|
|
12
|
+
sortPeriodDesc: string;
|
|
13
|
+
sortAmountDesc: string;
|
|
14
|
+
sortAmountAsc: string;
|
|
15
|
+
sortCategory: string;
|
|
16
|
+
columnCompany: string;
|
|
17
|
+
columnPeriod: string;
|
|
18
|
+
columnCategory: string;
|
|
19
|
+
columnProperty: string;
|
|
20
|
+
columnNote: string;
|
|
21
|
+
columnAmount: string;
|
|
22
|
+
columnActions: string;
|
|
23
|
+
recurringBadge: string;
|
|
24
|
+
empty: string;
|
|
25
|
+
editButton: string;
|
|
26
|
+
deleteButton: string;
|
|
27
|
+
deleteDialogTitle: string;
|
|
28
|
+
deleteDialogDescription: string;
|
|
29
|
+
deleteCancel: string;
|
|
30
|
+
deleteConfirm: string;
|
|
31
|
+
deletedToast: string;
|
|
32
|
+
editDialogTitle: string;
|
|
33
|
+
newDialogTitle: string;
|
|
34
|
+
fieldCompany: string;
|
|
35
|
+
fieldCategory: string;
|
|
36
|
+
fieldProperty: string;
|
|
37
|
+
propertyNone: string;
|
|
38
|
+
fieldMonth: string;
|
|
39
|
+
fieldYear: string;
|
|
40
|
+
fieldAmount: string;
|
|
41
|
+
fieldNote: string;
|
|
42
|
+
fieldRecurring: string;
|
|
43
|
+
fieldRecurringUntil: string;
|
|
44
|
+
recurringUntilNone: string;
|
|
45
|
+
cancel: string;
|
|
46
|
+
save: string;
|
|
47
|
+
saving: string;
|
|
48
|
+
saveFailed: (error: string) => string;
|
|
49
|
+
savedToast: string;
|
|
50
|
+
endBeforeStart: string;
|
|
51
|
+
endMonthNeedsYear: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const englishManualBookingsLabels: ManualBookingsLabels;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export const englishManualBookingsLabels = {
|
|
2
|
+
title: "Manual bookings",
|
|
3
|
+
subtitle: "Cost-side entries that have no invoice or bank transaction behind them.",
|
|
4
|
+
hint: "Manual bookings flow into the evaluation on the same footing as receipts, in the category you pick.",
|
|
5
|
+
companyLabel: "Company",
|
|
6
|
+
companyAll: "All companies",
|
|
7
|
+
yearLabel: "Year",
|
|
8
|
+
yearInvalid: (min, max, fallback) => `Enter a year between ${min} and ${max}. Showing ${fallback}.`,
|
|
9
|
+
newBookingButton: "New booking",
|
|
10
|
+
searchPlaceholder: "Search note, category, property…",
|
|
11
|
+
sortPeriodAsc: "Period, earliest first",
|
|
12
|
+
sortPeriodDesc: "Period, latest first",
|
|
13
|
+
sortAmountDesc: "Amount, highest first",
|
|
14
|
+
sortAmountAsc: "Amount, lowest first",
|
|
15
|
+
sortCategory: "Category",
|
|
16
|
+
columnCompany: "Company",
|
|
17
|
+
columnPeriod: "Period",
|
|
18
|
+
columnCategory: "Category",
|
|
19
|
+
columnProperty: "Property",
|
|
20
|
+
columnNote: "Note",
|
|
21
|
+
columnAmount: "Amount",
|
|
22
|
+
columnActions: "Actions",
|
|
23
|
+
recurringBadge: "Recurring",
|
|
24
|
+
empty: "No manual bookings for this year.",
|
|
25
|
+
editButton: "Edit",
|
|
26
|
+
deleteButton: "Delete",
|
|
27
|
+
deleteDialogTitle: "Delete this booking?",
|
|
28
|
+
deleteDialogDescription: "This cannot be undone.",
|
|
29
|
+
deleteCancel: "Cancel",
|
|
30
|
+
deleteConfirm: "Delete",
|
|
31
|
+
deletedToast: "Booking deleted.",
|
|
32
|
+
editDialogTitle: "Edit booking",
|
|
33
|
+
newDialogTitle: "New booking",
|
|
34
|
+
fieldCompany: "Company",
|
|
35
|
+
fieldCategory: "Category",
|
|
36
|
+
fieldProperty: "Property",
|
|
37
|
+
propertyNone: "No property",
|
|
38
|
+
fieldMonth: "Month",
|
|
39
|
+
fieldYear: "Year",
|
|
40
|
+
fieldAmount: "Amount",
|
|
41
|
+
fieldNote: "Note",
|
|
42
|
+
fieldRecurring: "Repeats every month",
|
|
43
|
+
fieldRecurringUntil: "Until",
|
|
44
|
+
recurringUntilNone: "No end date",
|
|
45
|
+
cancel: "Cancel",
|
|
46
|
+
save: "Save",
|
|
47
|
+
saving: "Saving…",
|
|
48
|
+
saveFailed: (error) => `Could not save: ${error}`,
|
|
49
|
+
savedToast: "Booking saved.",
|
|
50
|
+
endBeforeStart: "The end period can't be before the start.",
|
|
51
|
+
endMonthNeedsYear: "Pick a year for the end month too.",
|
|
52
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface NotificationsPageLabels {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle: string;
|
|
4
|
+
alertsTab: string;
|
|
5
|
+
settingsTab: string;
|
|
6
|
+
empty: string;
|
|
7
|
+
readSectionTitle: string;
|
|
8
|
+
anyTime: string;
|
|
9
|
+
today: string;
|
|
10
|
+
lastSevenDays: string;
|
|
11
|
+
lastThirtyDays: string;
|
|
12
|
+
remindButton: string;
|
|
13
|
+
bellCardTitle: string;
|
|
14
|
+
bellCardDescription: string;
|
|
15
|
+
groupLabel: (groupKey: string) => string;
|
|
16
|
+
eventLabel: (eventKey: string) => string;
|
|
17
|
+
save: string;
|
|
18
|
+
cancel: string;
|
|
19
|
+
saved: string;
|
|
20
|
+
saveFailed: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const englishNotificationsPageLabels: NotificationsPageLabels;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const englishNotificationsPageLabels = {
|
|
2
|
+
title: "Notifications",
|
|
3
|
+
subtitle: "Everything that needs your attention, and the reminders people sent you.",
|
|
4
|
+
alertsTab: "Alerts",
|
|
5
|
+
settingsTab: "Settings",
|
|
6
|
+
empty: "Nothing new. Everything is up to date.",
|
|
7
|
+
readSectionTitle: "Read",
|
|
8
|
+
anyTime: "Any time",
|
|
9
|
+
today: "Today",
|
|
10
|
+
lastSevenDays: "Last 7 days",
|
|
11
|
+
lastThirtyDays: "Last 30 days",
|
|
12
|
+
remindButton: "Remind a person",
|
|
13
|
+
bellCardTitle: "Bell in the Hub",
|
|
14
|
+
bellCardDescription: "Which items the bell in the top right shows.",
|
|
15
|
+
groupLabel: (groupKey) => groupKey,
|
|
16
|
+
eventLabel: (eventKey) => eventKey,
|
|
17
|
+
save: "Save",
|
|
18
|
+
cancel: "Cancel",
|
|
19
|
+
saved: "Saved.",
|
|
20
|
+
saveFailed: "Saving failed.",
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ReminderDialogLabels } from "../../components/notifications/reminder-dialog";
|
|
3
|
+
import type { NotificationsAdapter } from "../../adapters/notifications";
|
|
4
|
+
import { type NotificationsPageLabels } from "./labels";
|
|
5
|
+
export interface NotificationsPageProps {
|
|
6
|
+
adapter: NotificationsAdapter;
|
|
7
|
+
/** Whether the reader may see the settings tab. Without it only the alerts tab renders. */
|
|
8
|
+
canOpenSettings?: boolean;
|
|
9
|
+
/** Project-specific settings cards (channels, digest, Slack) rendered after the bell card. */
|
|
10
|
+
extraSettingsCards?: ReactNode;
|
|
11
|
+
labels?: NotificationsPageLabels;
|
|
12
|
+
reminderLabels?: ReminderDialogLabels;
|
|
13
|
+
}
|
|
14
|
+
export declare function NotificationsPage({ adapter, canOpenSettings, extraSettingsCards, labels, reminderLabels, }: NotificationsPageProps): import("react").JSX.Element;
|