indas-ui 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/auth/ProtectedRoute.js +48 -0
- package/dist/cjs/components/auth/UnauthorizedPage.js +19 -0
- package/dist/cjs/components/auth/index.js +9 -0
- package/dist/cjs/components/chat/ai-messages.js +271 -0
- package/dist/cjs/components/chat/chat-prompt-navigator.js +110 -0
- package/dist/cjs/components/chat/chat.js +1032 -0
- package/dist/cjs/components/chat/multimodal-input.js +117 -0
- package/dist/cjs/components/dashboard/DrillDownModal.js +36 -0
- package/dist/cjs/components/dashboard/FilterBar.js +434 -0
- package/dist/cjs/components/dashboard/Tooltip.js +86 -0
- package/dist/cjs/components/dashboard/charts/Area.js +127 -0
- package/dist/cjs/components/dashboard/charts/Bar.js +111 -0
- package/dist/cjs/components/dashboard/charts/BoxPlot.js +118 -0
- package/dist/cjs/components/dashboard/charts/Bubble.js +102 -0
- package/dist/cjs/components/dashboard/charts/DashboardCard.js +12 -0
- package/dist/cjs/components/dashboard/charts/Donut.js +130 -0
- package/dist/cjs/components/dashboard/charts/FlowMap.js +238 -0
- package/dist/cjs/components/dashboard/charts/Funnel.js +38 -0
- package/dist/cjs/components/dashboard/charts/Gantt.js +271 -0
- package/dist/cjs/components/dashboard/charts/Gauge.js +143 -0
- package/dist/cjs/components/dashboard/charts/GeoMap.js +164 -0
- package/dist/cjs/components/dashboard/charts/Heatmap.js +116 -0
- package/dist/cjs/components/dashboard/charts/Line.js +75 -0
- package/dist/cjs/components/dashboard/charts/Pareto.js +110 -0
- package/dist/cjs/components/dashboard/charts/Radar.js +94 -0
- package/dist/cjs/components/dashboard/charts/Sankey.js +92 -0
- package/dist/cjs/components/dashboard/charts/Scatter.js +128 -0
- package/dist/cjs/components/dashboard/charts/Sparkline.js +134 -0
- package/dist/cjs/components/dashboard/charts/Treemap.js +104 -0
- package/dist/cjs/components/dashboard/charts/index.js +45 -0
- package/dist/cjs/components/dashboard/charts/india-map.js +464 -0
- package/dist/cjs/components/dashboard/charts/theme.js +132 -0
- package/dist/cjs/components/dashboard/config.js +118 -0
- package/dist/cjs/components/dashboard/index.js +39 -0
- package/dist/cjs/components/dashboard/kpi/KpiBeforeAfter.js +16 -0
- package/dist/cjs/components/dashboard/kpi/KpiBreakdown.js +42 -0
- package/dist/cjs/components/dashboard/kpi/KpiComparison.js +41 -0
- package/dist/cjs/components/dashboard/kpi/KpiQuickStats.js +41 -0
- package/dist/cjs/components/dashboard/kpi/KpiRating.js +38 -0
- package/dist/cjs/components/dashboard/kpi/KpiScroll.js +83 -0
- package/dist/cjs/components/dashboard/kpi/KpiTrend.js +37 -0
- package/dist/cjs/components/dashboard/kpi/index.js +22 -0
- package/dist/cjs/components/dashboard/kpi/kpi-shell.js +113 -0
- package/dist/cjs/components/dashboard/time-range.js +126 -0
- package/dist/cjs/components/datagrid/DataGrid.js +1613 -0
- package/dist/cjs/components/datagrid/cells/BooleanCell.js +42 -0
- package/dist/cjs/components/datagrid/cells/CellRenderer.js +142 -0
- package/dist/cjs/components/datagrid/cells/EditableCell.js +217 -0
- package/dist/cjs/components/datagrid/cells/SelectionCell.js +60 -0
- package/dist/cjs/components/datagrid/cells/index.js +6 -0
- package/dist/cjs/components/datagrid/columns/ActionsColumn.js +485 -0
- package/dist/cjs/components/datagrid/columns/ColumnContextMenu.js +341 -0
- package/dist/cjs/components/datagrid/columns/DraggableColumnHeader.js +150 -0
- package/dist/cjs/components/datagrid/controls/AutoResizeButton.js +10 -0
- package/dist/cjs/components/datagrid/controls/PaginationControls.js +38 -0
- package/dist/cjs/components/datagrid/controls/SummaryControls.js +30 -0
- package/dist/cjs/components/datagrid/controls/menu/ActionsMenu.js +16 -0
- package/dist/cjs/components/datagrid/controls/menu/column/ColumnChooserModal.js +25 -0
- package/dist/cjs/components/datagrid/controls/menu/column/ColumnSection.js +10 -0
- package/dist/cjs/components/datagrid/controls/menu/export/ExportSection.js +19 -0
- package/dist/cjs/components/datagrid/controls/menu/export/export.js +227 -0
- package/dist/cjs/components/datagrid/controls/menu/filter/AdvancedFilterModal.js +405 -0
- package/dist/cjs/components/datagrid/controls/menu/filter/FilterSection.js +9 -0
- package/dist/cjs/components/datagrid/controls/menu/grouping/GroupingSection.js +23 -0
- package/dist/cjs/components/datagrid/controls/menu/grouping/index.js +6 -0
- package/dist/cjs/components/datagrid/controls/menu/import/ImportSection.js +75 -0
- package/dist/cjs/components/datagrid/controls/menu/import/import.js +232 -0
- package/dist/cjs/components/datagrid/controls/menu/index.js +24 -0
- package/dist/cjs/components/datagrid/controls/menu/view/CardView.js +176 -0
- package/dist/cjs/components/datagrid/controls/menu/view/ChartView.js +401 -0
- package/dist/cjs/components/datagrid/controls/menu/view/ViewSection.js +12 -0
- package/dist/cjs/components/datagrid/hooks/useCellRangeSelection.js +127 -0
- package/dist/cjs/components/datagrid/hooks/useClipboard.js +154 -0
- package/dist/cjs/components/datagrid/hooks/useDataGridState.js +115 -0
- package/dist/cjs/components/datagrid/hooks/useKeyboardNavigation.js +120 -0
- package/dist/cjs/components/datagrid/index.js +90 -0
- package/dist/cjs/components/datagrid/rows/DraggableRow.js +34 -0
- package/dist/cjs/components/datagrid/rows/ExpandableRow.js +184 -0
- package/dist/cjs/components/datagrid/rows/FilterRow.js +188 -0
- package/dist/cjs/components/datagrid/rows/SelectColumn.js +34 -0
- package/dist/cjs/components/datagrid/rows/SummaryRow.js +34 -0
- package/dist/cjs/components/datagrid/rows/summary.js +67 -0
- package/dist/cjs/components/datagrid/search/InlineSearchCell.js +99 -0
- package/dist/cjs/components/datagrid/search/SearchHighlighter.js +133 -0
- package/dist/cjs/components/datagrid/search/SearchNavigator.js +185 -0
- package/dist/cjs/components/datagrid/search/SearchNewModal.js +238 -0
- package/dist/cjs/components/datagrid/search/advancedSearch.js +112 -0
- package/dist/cjs/components/datagrid/utils/grid-helpers.js +102 -0
- package/dist/cjs/components/datagrid/utils/grid-types.js +3 -0
- package/dist/cjs/components/draft/AutoSaveIndicator.js +70 -0
- package/dist/cjs/components/draft/DraftModal.js +220 -0
- package/dist/cjs/components/forms/date-picker/CalendarView.js +82 -0
- package/dist/cjs/components/forms/date-picker/DatePicker.js +748 -0
- package/dist/cjs/components/forms/date-picker/DateTimePicker.js +174 -0
- package/dist/cjs/components/forms/date-picker/index.js +21 -0
- package/dist/cjs/components/forms/date-picker/shared-utils.js +24 -0
- package/dist/cjs/components/forms/dropdown/Dropdown.js +427 -0
- package/dist/cjs/components/forms/dropdown/MultiSelect.js +136 -0
- package/dist/cjs/components/forms/dropdown/SingleSelect.js +254 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownCreate.js +88 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownFiltering.js +87 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownState.js +63 -0
- package/dist/cjs/components/forms/dropdown/index.js +6 -0
- package/dist/cjs/components/forms/dropdown/types.js +3 -0
- package/dist/cjs/components/forms/file-attachment/EmailPreview.js +419 -0
- package/dist/cjs/components/forms/file-attachment/FileAttachment.js +966 -0
- package/dist/cjs/components/forms/file-attachment/index.js +6 -0
- package/dist/cjs/components/forms/index.js +16 -0
- package/dist/cjs/components/forms/quantity-input-popup.js +135 -0
- package/dist/cjs/components/forms/remark-input/RemarkInput.js +263 -0
- package/dist/cjs/components/forms/remark-input/index.js +8 -0
- package/dist/cjs/components/forms/unified-currency-dropdown.js +202 -0
- package/dist/cjs/components/index.js +41 -0
- package/dist/cjs/components/layout/SidebarContextMenu.js +179 -0
- package/dist/cjs/components/layout/app-shell.js +81 -0
- package/dist/cjs/components/layout/bottom-nav.js +262 -0
- package/dist/cjs/components/layout/floating-action-button.js +77 -0
- package/dist/cjs/components/layout/footer.js +60 -0
- package/dist/cjs/components/layout/index.js +16 -0
- package/dist/cjs/components/layout/mobile-menu-sheet.js +195 -0
- package/dist/cjs/components/layout/side-panel.js +118 -0
- package/dist/cjs/components/layout/sidebar.js +581 -0
- package/dist/cjs/components/layout/top-header.js +270 -0
- package/dist/cjs/components/layout/userprofile-dropdown.js +100 -0
- package/dist/cjs/components/master/editable-cells/EditableCell.js +106 -0
- package/dist/cjs/components/master/editable-cells/index.js +17 -0
- package/dist/cjs/components/master/index.js +9 -0
- package/dist/cjs/components/messaging/conversation-list.js +109 -0
- package/dist/cjs/components/messaging/create-conversation-modal.js +112 -0
- package/dist/cjs/components/messaging/message-bubble.js +69 -0
- package/dist/cjs/components/messaging/message-input.js +154 -0
- package/dist/cjs/components/messaging/message-thread.js +124 -0
- package/dist/cjs/components/messaging/messaging-panel-content.js +69 -0
- package/dist/cjs/components/messaging/thread-panel.js +50 -0
- package/dist/cjs/components/modals/3DModal.js +35 -0
- package/dist/cjs/components/modals/ImageModal.js +587 -0
- package/dist/cjs/components/modals/Modal.js +311 -0
- package/dist/cjs/components/modals/StandardModal.js +28 -0
- package/dist/cjs/components/modals/api-config-modal.js +120 -0
- package/dist/cjs/components/modals/global-api-config-modal.js +127 -0
- package/dist/cjs/components/modals/index.js +17 -0
- package/dist/cjs/components/modals/logout-modal.js +45 -0
- package/dist/cjs/components/modals/modal-alert.js +295 -0
- package/dist/cjs/components/modals/password-reset-modal.js +112 -0
- package/dist/cjs/components/modals/session-expiry-warning.js +18 -0
- package/dist/cjs/components/providers/api-provider.js +19 -0
- package/dist/cjs/components/providers/query-provider.js +29 -0
- package/dist/cjs/components/providers/session-provider.js +119 -0
- package/dist/cjs/components/theme/ThemeCustomizer.js +184 -0
- package/dist/cjs/components/ui/buttons/button.js +264 -0
- package/dist/cjs/components/ui/card.js +58 -0
- package/dist/cjs/components/ui/chart.js +160 -0
- package/dist/cjs/components/ui/display/boolean-badge.js +29 -0
- package/dist/cjs/components/ui/display/card.js +20 -0
- package/dist/cjs/components/ui/display/collapsible.js +44 -0
- package/dist/cjs/components/ui/display/separator.js +44 -0
- package/dist/cjs/components/ui/display/stats-card.js +29 -0
- package/dist/cjs/components/ui/display/text.js +94 -0
- package/dist/cjs/components/ui/feedback/alert.js +61 -0
- package/dist/cjs/components/ui/feedback/badge.js +93 -0
- package/dist/cjs/components/ui/feedback/progress.js +44 -0
- package/dist/cjs/components/ui/feedback/reminder-button.js +111 -0
- package/dist/cjs/components/ui/feedback/skeleton-table.js +20 -0
- package/dist/cjs/components/ui/feedback/skeleton.js +53 -0
- package/dist/cjs/components/ui/feedback/tooltip.js +54 -0
- package/dist/cjs/components/ui/form-toggle.js +47 -0
- package/dist/cjs/components/ui/forms/checkbox.js +24 -0
- package/dist/cjs/components/ui/forms/input.js +111 -0
- package/dist/cjs/components/ui/forms/label.js +10 -0
- package/dist/cjs/components/ui/forms/switch.js +58 -0
- package/dist/cjs/components/ui/forms/textarea.js +49 -0
- package/dist/cjs/components/ui/index.js +157 -0
- package/dist/cjs/components/ui/navigation/dropdown-menu.js +84 -0
- package/dist/cjs/components/ui/navigation/header-steps.js +51 -0
- package/dist/cjs/components/ui/navigation/tabs.js +97 -0
- package/dist/cjs/components/ui/overlays/loading.js +169 -0
- package/dist/cjs/components/ui/select.js +72 -0
- package/dist/cjs/config/api.js +65 -0
- package/dist/cjs/contexts/AppConfigContext.js +37 -0
- package/dist/cjs/contexts/CurrencyContext.js +336 -0
- package/dist/cjs/contexts/DeviceContext.js +106 -0
- package/dist/cjs/contexts/EmailContext.js +727 -0
- package/dist/cjs/contexts/GlobalAlertContext.js +232 -0
- package/dist/cjs/contexts/ImpactAnalysisContext.js +60 -0
- package/dist/cjs/contexts/LanguageContext.js +104 -0
- package/dist/cjs/contexts/MessagingContext.js +726 -0
- package/dist/cjs/contexts/ModuleAuthContext.js +316 -0
- package/dist/cjs/contexts/NavigationContext.js +182 -0
- package/dist/cjs/contexts/NetworkStatusContext.js +95 -0
- package/dist/cjs/contexts/NotificationContext.js +169 -0
- package/dist/cjs/contexts/PageTitleContext.js +28 -0
- package/dist/cjs/contexts/SearchPreferencesContext.js +42 -0
- package/dist/cjs/contexts/SessionAdapterContext.js +24 -0
- package/dist/cjs/contexts/SidebarPreferencesContext.js +116 -0
- package/dist/cjs/contexts/ThemeContext.js +193 -0
- package/dist/cjs/hooks/index.js +50 -0
- package/dist/cjs/hooks/useApproval.js +250 -0
- package/dist/cjs/hooks/useBacchaSearch.js +257 -0
- package/dist/cjs/hooks/useBusinessAudit.js +54 -0
- package/dist/cjs/hooks/useColumnFreezing.js +204 -0
- package/dist/cjs/hooks/useColumnMetadata.js +48 -0
- package/dist/cjs/hooks/useConditionalFormatting.js +197 -0
- package/dist/cjs/hooks/useDebounce.js +49 -0
- package/dist/cjs/hooks/useDraft.js +181 -0
- package/dist/cjs/hooks/useFormValidation.js +68 -0
- package/dist/cjs/hooks/useGridSettings.js +85 -0
- package/dist/cjs/hooks/useGridTheme.js +204 -0
- package/dist/cjs/hooks/useId.js +21 -0
- package/dist/cjs/hooks/useIntelligentColumnSizing.js +315 -0
- package/dist/cjs/hooks/useKeyboardNavigation.js +192 -0
- package/dist/cjs/hooks/useNotifications.js +63 -0
- package/dist/cjs/hooks/usePrevious.js +20 -0
- package/dist/cjs/hooks/useRowSelection.js +150 -0
- package/dist/cjs/hooks/useSignalR.js +53 -0
- package/dist/cjs/hooks/useTheme.js +268 -0
- package/dist/cjs/hooks/useTranslation.js +20 -0
- package/dist/cjs/hooks/useUnsavedChanges.js +88 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/lib/api/activity/audit/audit.js +51 -0
- package/dist/cjs/lib/api/activity/audit/index.js +29 -0
- package/dist/cjs/lib/api/activity/audit/send.js +434 -0
- package/dist/cjs/lib/api/activity/email/client.js +467 -0
- package/dist/cjs/lib/api/activity/email/index.js +31 -0
- package/dist/cjs/lib/api/activity/email/password-reset.js +58 -0
- package/dist/cjs/lib/api/activity/email/templates.js +537 -0
- package/dist/cjs/lib/api/activity/email/types.js +24 -0
- package/dist/cjs/lib/api/activity/index.js +48 -0
- package/dist/cjs/lib/api/activity/messaging/messaging.js +254 -0
- package/dist/cjs/lib/api/activity/notifications/index.js +43 -0
- package/dist/cjs/lib/api/activity/notifications/notifications.js +224 -0
- package/dist/cjs/lib/api/activity/notifications/reminders.js +30 -0
- package/dist/cjs/lib/api/activity/notifications/send.js +267 -0
- package/dist/cjs/lib/api/activity/notifications/types.js +66 -0
- package/dist/cjs/lib/api/activity/notify-and-log.js +63 -0
- package/dist/cjs/lib/api/activity/remarks/index.js +6 -0
- package/dist/cjs/lib/api/activity/remarks/remarks.js +186 -0
- package/dist/cjs/lib/api/activity/storage.js +83 -0
- package/dist/cjs/lib/api/ai/chat.js +227 -0
- package/dist/cjs/lib/api/ai/types.js +6 -0
- package/dist/cjs/lib/api/approval/approvals.js +210 -0
- package/dist/cjs/lib/api/approval/index.js +13 -0
- package/dist/cjs/lib/api/auth/auth.js +154 -0
- package/dist/cjs/lib/api/auth/index.js +11 -0
- package/dist/cjs/lib/api/auth/password-reset-otp.js +192 -0
- package/dist/cjs/lib/api/auth/two-factor-auth.js +94 -0
- package/dist/cjs/lib/api/auth/two-factor.js +186 -0
- package/dist/cjs/lib/api/core/auth-helpers.js +141 -0
- package/dist/cjs/lib/api/core/client.js +305 -0
- package/dist/cjs/lib/api/core/config.js +248 -0
- package/dist/cjs/lib/api/core/index.js +43 -0
- package/dist/cjs/lib/api/core/session-validator.js +98 -0
- package/dist/cjs/lib/api/core/types.js +4 -0
- package/dist/cjs/lib/api/core/utils.js +70 -0
- package/dist/cjs/lib/api/dashboard/costing.js +15 -0
- package/dist/cjs/lib/api/dashboard/management.js +11 -0
- package/dist/cjs/lib/api/dashboard/sales.js +11 -0
- package/dist/cjs/lib/api/draft/drafts.js +279 -0
- package/dist/cjs/lib/api/draft/index.js +13 -0
- package/dist/cjs/lib/api/enquiry/enquiry.js +624 -0
- package/dist/cjs/lib/api/enquiry/index.js +20 -0
- package/dist/cjs/lib/api/enquiry/rate-enquiry.js +78 -0
- package/dist/cjs/lib/api/estimation/categories.js +113 -0
- package/dist/cjs/lib/api/estimation/category-defaults.js +47 -0
- package/dist/cjs/lib/api/estimation/company-config.js +26 -0
- package/dist/cjs/lib/api/estimation/content.js +210 -0
- package/dist/cjs/lib/api/estimation/freight.js +25 -0
- package/dist/cjs/lib/api/estimation/grid-costing-drafts.js +30 -0
- package/dist/cjs/lib/api/estimation/grid-costing.js +176 -0
- package/dist/cjs/lib/api/estimation/index.js +58 -0
- package/dist/cjs/lib/api/estimation/legacy-costing.js +51 -0
- package/dist/cjs/lib/api/estimation/machines.js +74 -0
- package/dist/cjs/lib/api/estimation/planning.js +403 -0
- package/dist/cjs/lib/api/estimation/qualities.js +245 -0
- package/dist/cjs/lib/api/estimation/quotation-load.js +52 -0
- package/dist/cjs/lib/api/estimation/quotation-save.js +109 -0
- package/dist/cjs/lib/api/estimation/quote-check.js +34 -0
- package/dist/cjs/lib/api/estimation/quotepanel.js +496 -0
- package/dist/cjs/lib/api/estimation/shipper-planning.js +220 -0
- package/dist/cjs/lib/api/estimation/wastage.js +47 -0
- package/dist/cjs/lib/api/index.js +33 -0
- package/dist/cjs/lib/api/integration/proxy.js +40 -0
- package/dist/cjs/lib/api/master/category.js +215 -0
- package/dist/cjs/lib/api/master/company.js +389 -0
- package/dist/cjs/lib/api/master/hsn.js +61 -0
- package/dist/cjs/lib/api/master/index.js +47 -0
- package/dist/cjs/lib/api/master/item.js +142 -0
- package/dist/cjs/lib/api/master/ledger.js +398 -0
- package/dist/cjs/lib/api/master/logistics.js +119 -0
- package/dist/cjs/lib/api/master/machine.js +579 -0
- package/dist/cjs/lib/api/master/material-group.js +103 -0
- package/dist/cjs/lib/api/master/other.js +63 -0
- package/dist/cjs/lib/api/master/process-types.js +5 -0
- package/dist/cjs/lib/api/master/process.js +131 -0
- package/dist/cjs/lib/api/master/production-units.js +22 -0
- package/dist/cjs/lib/api/master/rate.js +203 -0
- package/dist/cjs/lib/api/master/tool.js +88 -0
- package/dist/cjs/lib/api/master/user.js +154 -0
- package/dist/cjs/lib/api/settings/erp-parameters.js +69 -0
- package/dist/cjs/lib/api/utility/index.js +11 -0
- package/dist/cjs/lib/api/utility/menu.js +136 -0
- package/dist/cjs/lib/auth.js +10 -0
- package/dist/cjs/lib/pwa.js +59 -0
- package/dist/cjs/lib/react-query-config.js +134 -0
- package/dist/cjs/lib/security/audit-logger.js +177 -0
- package/dist/cjs/lib/security/rate-limiter.js +122 -0
- package/dist/cjs/lib/server-url.js +76 -0
- package/dist/cjs/lib/svg-utils.js +213 -0
- package/dist/cjs/lib/theme/types.js +235 -0
- package/dist/cjs/lib/theme/utils.js +363 -0
- package/dist/cjs/lib/types/index.js +3 -0
- package/dist/cjs/lib/utils/attachment-loader.js +82 -0
- package/dist/cjs/lib/utils/client-lead-utils.js +61 -0
- package/dist/cjs/lib/utils/device-detection.js +110 -0
- package/dist/cjs/lib/utils/logout-cleanup.js +312 -0
- package/dist/cjs/lib/utils/planning-prefs.js +31 -0
- package/dist/cjs/lib/utils.js +70 -0
- package/dist/cjs/lib/vision/dieline-extractor.js +321 -0
- package/dist/cjs/lib/vision/reference-grid.js +245 -0
- package/dist/cjs/locales/de.json +79 -0
- package/dist/cjs/locales/en.json +2217 -0
- package/dist/cjs/locales/es.json +79 -0
- package/dist/cjs/locales/fr.json +78 -0
- package/dist/cjs/locales/hi.json +1599 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/providers.js +43 -0
- package/dist/cjs/services/GlobalLoadingService.js +220 -0
- package/{src → dist/cjs}/styles/grid-themes.css +345 -345
- package/{src → dist/cjs}/styles/sidebar-scrollbar.css +45 -45
- package/{src → dist/cjs}/styles/tokens.css +712 -711
- package/dist/cjs/types/approval.js +22 -0
- package/dist/cjs/types/audit.js +50 -0
- package/dist/cjs/types/draft.js +22 -0
- package/dist/cjs/types/master.js +4 -0
- package/dist/cjs/types/shipper-planning.js +7 -0
- package/dist/components/auth/ProtectedRoute.d.ts +6 -0
- package/dist/components/auth/ProtectedRoute.js +45 -0
- package/dist/components/auth/UnauthorizedPage.d.ts +6 -0
- package/dist/components/auth/UnauthorizedPage.js +15 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.js +3 -0
- package/dist/components/chat/ai-messages.d.ts +32 -0
- package/dist/components/chat/ai-messages.js +265 -0
- package/dist/components/chat/chat-prompt-navigator.d.ts +9 -0
- package/dist/components/chat/chat-prompt-navigator.js +107 -0
- package/dist/components/chat/chat.d.ts +46 -0
- package/dist/components/chat/chat.js +1029 -0
- package/dist/components/chat/multimodal-input.d.ts +12 -0
- package/dist/components/chat/multimodal-input.js +114 -0
- package/dist/components/dashboard/DrillDownModal.d.ts +15 -0
- package/dist/components/dashboard/DrillDownModal.js +33 -0
- package/dist/components/dashboard/FilterBar.d.ts +108 -0
- package/dist/components/dashboard/FilterBar.js +428 -0
- package/dist/components/dashboard/Tooltip.d.ts +24 -0
- package/dist/components/dashboard/Tooltip.js +50 -0
- package/dist/components/dashboard/charts/Area.d.ts +28 -0
- package/dist/components/dashboard/charts/Area.js +121 -0
- package/dist/components/dashboard/charts/Bar.d.ts +27 -0
- package/dist/components/dashboard/charts/Bar.js +105 -0
- package/dist/components/dashboard/charts/BoxPlot.d.ts +23 -0
- package/dist/components/dashboard/charts/BoxPlot.js +112 -0
- package/dist/components/dashboard/charts/Bubble.d.ts +36 -0
- package/dist/components/dashboard/charts/Bubble.js +96 -0
- package/dist/components/dashboard/charts/DashboardCard.d.ts +12 -0
- package/dist/components/dashboard/charts/DashboardCard.js +9 -0
- package/dist/components/dashboard/charts/Donut.d.ts +23 -0
- package/dist/components/dashboard/charts/Donut.js +124 -0
- package/dist/components/dashboard/charts/FlowMap.d.ts +38 -0
- package/dist/components/dashboard/charts/FlowMap.js +199 -0
- package/dist/components/dashboard/charts/Funnel.d.ts +30 -0
- package/dist/components/dashboard/charts/Funnel.js +35 -0
- package/dist/components/dashboard/charts/Gantt.d.ts +26 -0
- package/dist/components/dashboard/charts/Gantt.js +265 -0
- package/dist/components/dashboard/charts/Gauge.d.ts +25 -0
- package/dist/components/dashboard/charts/Gauge.js +137 -0
- package/dist/components/dashboard/charts/GeoMap.d.ts +38 -0
- package/dist/components/dashboard/charts/GeoMap.js +125 -0
- package/dist/components/dashboard/charts/Heatmap.d.ts +31 -0
- package/dist/components/dashboard/charts/Heatmap.js +110 -0
- package/dist/components/dashboard/charts/Line.d.ts +33 -0
- package/dist/components/dashboard/charts/Line.js +69 -0
- package/dist/components/dashboard/charts/Pareto.d.ts +21 -0
- package/dist/components/dashboard/charts/Pareto.js +104 -0
- package/dist/components/dashboard/charts/Radar.d.ts +32 -0
- package/dist/components/dashboard/charts/Radar.js +88 -0
- package/dist/components/dashboard/charts/Sankey.d.ts +43 -0
- package/dist/components/dashboard/charts/Sankey.js +86 -0
- package/dist/components/dashboard/charts/Scatter.d.ts +38 -0
- package/dist/components/dashboard/charts/Scatter.js +122 -0
- package/dist/components/dashboard/charts/Sparkline.d.ts +37 -0
- package/dist/components/dashboard/charts/Sparkline.js +128 -0
- package/dist/components/dashboard/charts/Treemap.d.ts +30 -0
- package/dist/components/dashboard/charts/Treemap.js +98 -0
- package/dist/components/dashboard/charts/index.d.ts +38 -0
- package/dist/components/dashboard/charts/index.js +23 -0
- package/dist/components/dashboard/charts/india-map.d.ts +22 -0
- package/dist/components/dashboard/charts/india-map.js +461 -0
- package/dist/components/dashboard/charts/theme.d.ts +107 -0
- package/dist/components/dashboard/charts/theme.js +124 -0
- package/dist/components/dashboard/config.d.ts +96 -0
- package/dist/components/dashboard/config.js +113 -0
- package/dist/components/dashboard/index.d.ts +10 -0
- package/dist/components/dashboard/index.js +13 -0
- package/dist/components/dashboard/kpi/KpiBeforeAfter.d.ts +31 -0
- package/dist/components/dashboard/kpi/KpiBeforeAfter.js +13 -0
- package/dist/components/dashboard/kpi/KpiBreakdown.d.ts +31 -0
- package/dist/components/dashboard/kpi/KpiBreakdown.js +39 -0
- package/dist/components/dashboard/kpi/KpiComparison.d.ts +36 -0
- package/dist/components/dashboard/kpi/KpiComparison.js +38 -0
- package/dist/components/dashboard/kpi/KpiQuickStats.d.ts +30 -0
- package/dist/components/dashboard/kpi/KpiQuickStats.js +38 -0
- package/dist/components/dashboard/kpi/KpiRating.d.ts +46 -0
- package/dist/components/dashboard/kpi/KpiRating.js +35 -0
- package/dist/components/dashboard/kpi/KpiScroll.d.ts +63 -0
- package/dist/components/dashboard/kpi/KpiScroll.js +80 -0
- package/dist/components/dashboard/kpi/KpiTrend.d.ts +28 -0
- package/dist/components/dashboard/kpi/KpiTrend.js +34 -0
- package/dist/components/dashboard/kpi/index.d.ts +16 -0
- package/dist/components/dashboard/kpi/index.js +10 -0
- package/dist/components/dashboard/kpi/kpi-shell.d.ts +44 -0
- package/dist/components/dashboard/kpi/kpi-shell.js +108 -0
- package/dist/components/dashboard/time-range.d.ts +12 -0
- package/dist/components/dashboard/time-range.js +118 -0
- package/dist/components/datagrid/DataGrid.d.ts +126 -0
- package/dist/components/datagrid/DataGrid.js +1577 -0
- package/dist/components/datagrid/cells/BooleanCell.d.ts +15 -0
- package/dist/components/datagrid/cells/BooleanCell.js +39 -0
- package/dist/components/datagrid/cells/CellRenderer.d.ts +25 -0
- package/dist/components/datagrid/cells/CellRenderer.js +139 -0
- package/dist/components/datagrid/cells/EditableCell.d.ts +35 -0
- package/dist/components/datagrid/cells/EditableCell.js +179 -0
- package/dist/components/datagrid/cells/SelectionCell.d.ts +11 -0
- package/dist/components/datagrid/cells/SelectionCell.js +58 -0
- package/dist/components/datagrid/cells/index.d.ts +1 -0
- package/dist/components/datagrid/cells/index.js +2 -0
- package/dist/components/datagrid/columns/ActionsColumn.d.ts +174 -0
- package/dist/components/datagrid/columns/ActionsColumn.js +448 -0
- package/dist/components/datagrid/columns/ColumnContextMenu.d.ts +16 -0
- package/dist/components/datagrid/columns/ColumnContextMenu.js +338 -0
- package/dist/components/datagrid/columns/DraggableColumnHeader.d.ts +19 -0
- package/dist/components/datagrid/columns/DraggableColumnHeader.js +147 -0
- package/dist/components/datagrid/controls/AutoResizeButton.d.ts +8 -0
- package/dist/components/datagrid/controls/AutoResizeButton.js +7 -0
- package/dist/components/datagrid/controls/PaginationControls.d.ts +13 -0
- package/dist/components/datagrid/controls/PaginationControls.js +34 -0
- package/dist/components/datagrid/controls/SummaryControls.d.ts +10 -0
- package/dist/components/datagrid/controls/SummaryControls.js +27 -0
- package/dist/components/datagrid/controls/menu/ActionsMenu.d.ts +31 -0
- package/dist/components/datagrid/controls/menu/ActionsMenu.js +13 -0
- package/dist/components/datagrid/controls/menu/column/ColumnChooserModal.d.ts +13 -0
- package/dist/components/datagrid/controls/menu/column/ColumnChooserModal.js +22 -0
- package/dist/components/datagrid/controls/menu/column/ColumnSection.d.ts +9 -0
- package/dist/components/datagrid/controls/menu/column/ColumnSection.js +7 -0
- package/dist/components/datagrid/controls/menu/export/ExportSection.d.ts +7 -0
- package/dist/components/datagrid/controls/menu/export/ExportSection.js +16 -0
- package/dist/components/datagrid/controls/menu/export/export.d.ts +21 -0
- package/dist/components/datagrid/controls/menu/export/export.js +187 -0
- package/dist/components/datagrid/controls/menu/filter/AdvancedFilterModal.d.ts +29 -0
- package/dist/components/datagrid/controls/menu/filter/AdvancedFilterModal.js +369 -0
- package/dist/components/datagrid/controls/menu/filter/FilterSection.d.ts +12 -0
- package/dist/components/datagrid/controls/menu/filter/FilterSection.js +6 -0
- package/dist/components/datagrid/controls/menu/grouping/GroupingSection.d.ts +10 -0
- package/dist/components/datagrid/controls/menu/grouping/GroupingSection.js +20 -0
- package/dist/components/datagrid/controls/menu/grouping/index.d.ts +1 -0
- package/dist/components/datagrid/controls/menu/grouping/index.js +2 -0
- package/dist/components/datagrid/controls/menu/import/ImportSection.d.ts +6 -0
- package/dist/components/datagrid/controls/menu/import/ImportSection.js +72 -0
- package/dist/components/datagrid/controls/menu/import/import.d.ts +27 -0
- package/dist/components/datagrid/controls/menu/import/import.js +193 -0
- package/dist/components/datagrid/controls/menu/index.d.ts +10 -0
- package/dist/components/datagrid/controls/menu/index.js +11 -0
- package/dist/components/datagrid/controls/menu/view/CardView.d.ts +17 -0
- package/dist/components/datagrid/controls/menu/view/CardView.js +173 -0
- package/dist/components/datagrid/controls/menu/view/ChartView.d.ts +9 -0
- package/dist/components/datagrid/controls/menu/view/ChartView.js +363 -0
- package/dist/components/datagrid/controls/menu/view/ViewSection.d.ts +7 -0
- package/dist/components/datagrid/controls/menu/view/ViewSection.js +9 -0
- package/dist/components/datagrid/hooks/useCellRangeSelection.d.ts +20 -0
- package/dist/components/datagrid/hooks/useCellRangeSelection.js +124 -0
- package/dist/components/datagrid/hooks/useClipboard.d.ts +15 -0
- package/dist/components/datagrid/hooks/useClipboard.js +151 -0
- package/dist/components/datagrid/hooks/useDataGridState.d.ts +46 -0
- package/dist/components/datagrid/hooks/useDataGridState.js +112 -0
- package/dist/components/datagrid/hooks/useKeyboardNavigation.d.ts +18 -0
- package/dist/components/datagrid/hooks/useKeyboardNavigation.js +117 -0
- package/dist/components/datagrid/index.d.ts +34 -0
- package/dist/components/datagrid/index.js +41 -0
- package/dist/components/datagrid/rows/DraggableRow.d.ts +33 -0
- package/dist/components/datagrid/rows/DraggableRow.js +31 -0
- package/dist/components/datagrid/rows/ExpandableRow.d.ts +48 -0
- package/dist/components/datagrid/rows/ExpandableRow.js +178 -0
- package/dist/components/datagrid/rows/FilterRow.d.ts +10 -0
- package/dist/components/datagrid/rows/FilterRow.js +185 -0
- package/dist/components/datagrid/rows/SelectColumn.d.ts +2 -0
- package/dist/components/datagrid/rows/SelectColumn.js +31 -0
- package/dist/components/datagrid/rows/SummaryRow.d.ts +12 -0
- package/dist/components/datagrid/rows/SummaryRow.js +31 -0
- package/dist/components/datagrid/rows/summary.d.ts +9 -0
- package/dist/components/datagrid/rows/summary.js +63 -0
- package/dist/components/datagrid/search/InlineSearchCell.d.ts +13 -0
- package/dist/components/datagrid/search/InlineSearchCell.js +96 -0
- package/dist/components/datagrid/search/SearchHighlighter.d.ts +16 -0
- package/dist/components/datagrid/search/SearchHighlighter.js +124 -0
- package/dist/components/datagrid/search/SearchNavigator.d.ts +24 -0
- package/dist/components/datagrid/search/SearchNavigator.js +148 -0
- package/dist/components/datagrid/search/SearchNewModal.d.ts +12 -0
- package/dist/components/datagrid/search/SearchNewModal.js +202 -0
- package/dist/components/datagrid/search/advancedSearch.d.ts +23 -0
- package/dist/components/datagrid/search/advancedSearch.js +109 -0
- package/dist/components/datagrid/utils/grid-helpers.d.ts +34 -0
- package/dist/components/datagrid/utils/grid-helpers.js +94 -0
- package/dist/components/datagrid/utils/grid-types.d.ts +157 -0
- package/dist/components/datagrid/utils/grid-types.js +2 -0
- package/dist/components/draft/AutoSaveIndicator.d.ts +28 -0
- package/dist/components/draft/AutoSaveIndicator.js +67 -0
- package/dist/components/draft/DraftModal.d.ts +27 -0
- package/dist/components/draft/DraftModal.js +184 -0
- package/dist/components/forms/date-picker/CalendarView.d.ts +17 -0
- package/dist/components/forms/date-picker/CalendarView.js +46 -0
- package/dist/components/forms/date-picker/DatePicker.d.ts +31 -0
- package/dist/components/forms/date-picker/DatePicker.js +712 -0
- package/dist/components/forms/date-picker/DateTimePicker.d.ts +15 -0
- package/dist/components/forms/date-picker/DateTimePicker.js +138 -0
- package/dist/components/forms/date-picker/index.d.ts +7 -0
- package/dist/components/forms/date-picker/index.js +9 -0
- package/dist/components/forms/date-picker/shared-utils.d.ts +6 -0
- package/dist/components/forms/date-picker/shared-utils.js +19 -0
- package/dist/components/forms/dropdown/Dropdown.d.ts +144 -0
- package/dist/components/forms/dropdown/Dropdown.js +384 -0
- package/dist/components/forms/dropdown/MultiSelect.d.ts +29 -0
- package/dist/components/forms/dropdown/MultiSelect.js +100 -0
- package/dist/components/forms/dropdown/SingleSelect.d.ts +39 -0
- package/dist/components/forms/dropdown/SingleSelect.js +218 -0
- package/dist/components/forms/dropdown/hooks/useDropdownCreate.d.ts +8 -0
- package/dist/components/forms/dropdown/hooks/useDropdownCreate.js +52 -0
- package/dist/components/forms/dropdown/hooks/useDropdownFiltering.d.ts +5 -0
- package/dist/components/forms/dropdown/hooks/useDropdownFiltering.js +51 -0
- package/dist/components/forms/dropdown/hooks/useDropdownState.d.ts +7 -0
- package/dist/components/forms/dropdown/hooks/useDropdownState.js +27 -0
- package/dist/components/forms/dropdown/index.d.ts +2 -0
- package/dist/components/forms/dropdown/index.js +2 -0
- package/dist/components/forms/dropdown/types.d.ts +67 -0
- package/dist/components/forms/dropdown/types.js +2 -0
- package/dist/components/forms/file-attachment/EmailPreview.d.ts +5 -0
- package/dist/components/forms/file-attachment/EmailPreview.js +383 -0
- package/dist/components/forms/file-attachment/FileAttachment.d.ts +30 -0
- package/dist/components/forms/file-attachment/FileAttachment.js +930 -0
- package/dist/components/forms/file-attachment/index.d.ts +2 -0
- package/dist/components/forms/file-attachment/index.js +2 -0
- package/dist/components/forms/index.d.ts +9 -0
- package/dist/components/forms/index.js +7 -0
- package/dist/components/forms/quantity-input-popup.d.ts +10 -0
- package/dist/components/forms/quantity-input-popup.js +99 -0
- package/dist/components/forms/remark-input/RemarkInput.d.ts +58 -0
- package/dist/components/forms/remark-input/RemarkInput.js +258 -0
- package/dist/components/forms/remark-input/index.d.ts +1 -0
- package/dist/components/forms/remark-input/index.js +2 -0
- package/dist/components/forms/unified-currency-dropdown.d.ts +26 -0
- package/dist/components/forms/unified-currency-dropdown.js +166 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +15 -0
- package/dist/components/layout/SidebarContextMenu.d.ts +18 -0
- package/dist/components/layout/SidebarContextMenu.js +142 -0
- package/dist/components/layout/app-shell.d.ts +32 -0
- package/dist/components/layout/app-shell.js +43 -0
- package/dist/components/layout/bottom-nav.d.ts +28 -0
- package/dist/components/layout/bottom-nav.js +219 -0
- package/dist/components/layout/floating-action-button.d.ts +10 -0
- package/dist/components/layout/floating-action-button.js +74 -0
- package/dist/components/layout/footer.d.ts +37 -0
- package/dist/components/layout/footer.js +56 -0
- package/dist/components/layout/index.d.ts +8 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/components/layout/mobile-menu-sheet.d.ts +7 -0
- package/dist/components/layout/mobile-menu-sheet.js +159 -0
- package/dist/components/layout/side-panel.d.ts +50 -0
- package/dist/components/layout/side-panel.js +115 -0
- package/dist/components/layout/sidebar.d.ts +12 -0
- package/dist/components/layout/sidebar.js +542 -0
- package/dist/components/layout/top-header.d.ts +8 -0
- package/dist/components/layout/top-header.js +234 -0
- package/dist/components/layout/userprofile-dropdown.d.ts +1 -0
- package/dist/components/layout/userprofile-dropdown.js +97 -0
- package/dist/components/master/editable-cells/EditableCell.d.ts +43 -0
- package/dist/components/master/editable-cells/EditableCell.js +66 -0
- package/dist/components/master/editable-cells/index.d.ts +9 -0
- package/dist/components/master/editable-cells/index.js +10 -0
- package/dist/components/master/index.d.ts +1 -0
- package/dist/components/master/index.js +3 -0
- package/dist/components/messaging/conversation-list.d.ts +13 -0
- package/dist/components/messaging/conversation-list.js +103 -0
- package/dist/components/messaging/create-conversation-modal.d.ts +9 -0
- package/dist/components/messaging/create-conversation-modal.js +109 -0
- package/dist/components/messaging/message-bubble.d.ts +15 -0
- package/dist/components/messaging/message-bubble.js +66 -0
- package/dist/components/messaging/message-input.d.ts +17 -0
- package/dist/components/messaging/message-input.js +151 -0
- package/dist/components/messaging/message-thread.d.ts +10 -0
- package/dist/components/messaging/message-thread.js +121 -0
- package/dist/components/messaging/messaging-panel-content.d.ts +5 -0
- package/dist/components/messaging/messaging-panel-content.js +66 -0
- package/dist/components/messaging/thread-panel.d.ts +10 -0
- package/dist/components/messaging/thread-panel.js +47 -0
- package/dist/components/modals/3DModal.d.ts +39 -0
- package/dist/components/modals/3DModal.js +32 -0
- package/dist/components/modals/ImageModal.d.ts +28 -0
- package/dist/components/modals/ImageModal.js +551 -0
- package/dist/components/modals/Modal.d.ts +92 -0
- package/dist/components/modals/Modal.js +264 -0
- package/dist/components/modals/StandardModal.d.ts +27 -0
- package/dist/components/modals/StandardModal.js +25 -0
- package/dist/components/modals/api-config-modal.d.ts +7 -0
- package/dist/components/modals/api-config-modal.js +117 -0
- package/dist/components/modals/global-api-config-modal.d.ts +7 -0
- package/dist/components/modals/global-api-config-modal.js +124 -0
- package/dist/components/modals/index.d.ts +7 -0
- package/dist/components/modals/index.js +8 -0
- package/dist/components/modals/logout-modal.d.ts +32 -0
- package/dist/components/modals/logout-modal.js +42 -0
- package/dist/components/modals/modal-alert.d.ts +139 -0
- package/dist/components/modals/modal-alert.js +250 -0
- package/dist/components/modals/password-reset-modal.d.ts +11 -0
- package/dist/components/modals/password-reset-modal.js +109 -0
- package/dist/components/modals/session-expiry-warning.d.ts +12 -0
- package/dist/components/modals/session-expiry-warning.js +15 -0
- package/dist/components/providers/api-provider.d.ts +10 -0
- package/dist/components/providers/api-provider.js +15 -0
- package/dist/components/providers/query-provider.d.ts +3 -0
- package/dist/components/providers/query-provider.js +26 -0
- package/dist/components/providers/session-provider.d.ts +7 -0
- package/dist/components/providers/session-provider.js +116 -0
- package/dist/components/theme/ThemeCustomizer.d.ts +37 -0
- package/dist/components/theme/ThemeCustomizer.js +178 -0
- package/dist/components/ui/buttons/button.d.ts +59 -0
- package/dist/components/ui/buttons/button.js +228 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/card.js +17 -0
- package/dist/components/ui/chart.d.ts +83 -0
- package/dist/components/ui/chart.js +113 -0
- package/dist/components/ui/display/boolean-badge.d.ts +7 -0
- package/dist/components/ui/display/boolean-badge.js +23 -0
- package/dist/components/ui/display/card.d.ts +10 -0
- package/dist/components/ui/display/card.js +11 -0
- package/dist/components/ui/display/collapsible.d.ts +6 -0
- package/dist/components/ui/display/collapsible.js +6 -0
- package/dist/components/ui/display/separator.d.ts +4 -0
- package/dist/components/ui/display/separator.js +8 -0
- package/dist/components/ui/display/stats-card.d.ts +22 -0
- package/dist/components/ui/display/stats-card.js +25 -0
- package/dist/components/ui/display/text.d.ts +14 -0
- package/dist/components/ui/display/text.js +57 -0
- package/dist/components/ui/feedback/alert.d.ts +8 -0
- package/dist/components/ui/feedback/alert.js +23 -0
- package/dist/components/ui/feedback/badge.d.ts +49 -0
- package/dist/components/ui/feedback/badge.js +87 -0
- package/dist/components/ui/feedback/progress.d.ts +4 -0
- package/dist/components/ui/feedback/progress.js +8 -0
- package/dist/components/ui/feedback/reminder-button.d.ts +22 -0
- package/dist/components/ui/feedback/reminder-button.js +75 -0
- package/dist/components/ui/feedback/skeleton-table.d.ts +18 -0
- package/dist/components/ui/feedback/skeleton-table.js +17 -0
- package/dist/components/ui/feedback/skeleton.d.ts +53 -0
- package/dist/components/ui/feedback/skeleton.js +48 -0
- package/dist/components/ui/feedback/tooltip.d.ts +15 -0
- package/dist/components/ui/feedback/tooltip.js +14 -0
- package/dist/components/ui/form-toggle.d.ts +57 -0
- package/dist/components/ui/form-toggle.js +44 -0
- package/dist/components/ui/forms/checkbox.d.ts +6 -0
- package/dist/components/ui/forms/checkbox.js +17 -0
- package/dist/components/ui/forms/input.d.ts +18 -0
- package/dist/components/ui/forms/input.js +75 -0
- package/dist/components/ui/forms/label.d.ts +5 -0
- package/dist/components/ui/forms/label.js +6 -0
- package/dist/components/ui/forms/switch.d.ts +10 -0
- package/dist/components/ui/forms/switch.js +22 -0
- package/dist/components/ui/forms/textarea.d.ts +8 -0
- package/dist/components/ui/forms/textarea.js +13 -0
- package/dist/components/ui/index.d.ts +49 -0
- package/dist/components/ui/index.js +62 -0
- package/dist/components/ui/navigation/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/navigation/dropdown-menu.js +34 -0
- package/dist/components/ui/navigation/header-steps.d.ts +16 -0
- package/dist/components/ui/navigation/header-steps.js +15 -0
- package/dist/components/ui/navigation/tabs.d.ts +40 -0
- package/dist/components/ui/navigation/tabs.js +59 -0
- package/dist/components/ui/overlays/loading.d.ts +47 -0
- package/dist/components/ui/overlays/loading.js +131 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/select.js +27 -0
- package/dist/config/api.d.ts +30 -0
- package/dist/config/api.js +58 -0
- package/dist/contexts/AppConfigContext.d.ts +13 -0
- package/dist/contexts/AppConfigContext.js +33 -0
- package/dist/contexts/CurrencyContext.d.ts +43 -0
- package/dist/contexts/CurrencyContext.js +331 -0
- package/dist/contexts/DeviceContext.d.ts +12 -0
- package/dist/contexts/DeviceContext.js +69 -0
- package/dist/contexts/EmailContext.d.ts +112 -0
- package/dist/contexts/EmailContext.js +720 -0
- package/dist/contexts/GlobalAlertContext.d.ts +67 -0
- package/dist/contexts/GlobalAlertContext.js +192 -0
- package/dist/contexts/ImpactAnalysisContext.d.ts +11 -0
- package/dist/contexts/ImpactAnalysisContext.js +23 -0
- package/dist/contexts/LanguageContext.d.ts +21 -0
- package/dist/contexts/LanguageContext.js +66 -0
- package/dist/contexts/MessagingContext.d.ts +70 -0
- package/dist/contexts/MessagingContext.js +722 -0
- package/dist/contexts/ModuleAuthContext.d.ts +42 -0
- package/dist/contexts/ModuleAuthContext.js +278 -0
- package/dist/contexts/NavigationContext.d.ts +26 -0
- package/dist/contexts/NavigationContext.js +143 -0
- package/dist/contexts/NetworkStatusContext.d.ts +18 -0
- package/dist/contexts/NetworkStatusContext.js +87 -0
- package/dist/contexts/NotificationContext.d.ts +47 -0
- package/dist/contexts/NotificationContext.js +165 -0
- package/dist/contexts/PageTitleContext.d.ts +11 -0
- package/dist/contexts/PageTitleContext.js +23 -0
- package/dist/contexts/SearchPreferencesContext.d.ts +11 -0
- package/dist/contexts/SearchPreferencesContext.js +38 -0
- package/dist/contexts/SessionAdapterContext.d.ts +39 -0
- package/dist/contexts/SessionAdapterContext.js +20 -0
- package/dist/contexts/SidebarPreferencesContext.d.ts +19 -0
- package/dist/contexts/SidebarPreferencesContext.js +112 -0
- package/dist/contexts/ThemeContext.d.ts +63 -0
- package/dist/contexts/ThemeContext.js +153 -0
- package/dist/hooks/index.d.ts +23 -0
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/useApproval.d.ts +47 -0
- package/dist/hooks/useApproval.js +247 -0
- package/dist/hooks/useBacchaSearch.d.ts +57 -0
- package/dist/hooks/useBacchaSearch.js +254 -0
- package/dist/hooks/useBusinessAudit.d.ts +24 -0
- package/dist/hooks/useBusinessAudit.js +51 -0
- package/dist/hooks/useColumnFreezing.d.ts +85 -0
- package/dist/hooks/useColumnFreezing.js +201 -0
- package/dist/hooks/useColumnMetadata.d.ts +20 -0
- package/dist/hooks/useColumnMetadata.js +44 -0
- package/dist/hooks/useConditionalFormatting.d.ts +43 -0
- package/dist/hooks/useConditionalFormatting.js +193 -0
- package/dist/hooks/useDebounce.d.ts +14 -0
- package/dist/hooks/useDebounce.js +45 -0
- package/dist/hooks/useDraft.d.ts +46 -0
- package/dist/hooks/useDraft.js +178 -0
- package/dist/hooks/useFormValidation.d.ts +37 -0
- package/dist/hooks/useFormValidation.js +65 -0
- package/dist/hooks/useGridSettings.d.ts +26 -0
- package/dist/hooks/useGridSettings.js +82 -0
- package/dist/hooks/useGridTheme.d.ts +59 -0
- package/dist/hooks/useGridTheme.js +199 -0
- package/dist/hooks/useId.d.ts +2 -0
- package/dist/hooks/useId.js +17 -0
- package/dist/hooks/useIntelligentColumnSizing.d.ts +71 -0
- package/dist/hooks/useIntelligentColumnSizing.js +310 -0
- package/dist/hooks/useKeyboardNavigation.d.ts +33 -0
- package/dist/hooks/useKeyboardNavigation.js +189 -0
- package/dist/hooks/useNotifications.d.ts +7 -0
- package/dist/hooks/useNotifications.js +56 -0
- package/dist/hooks/usePrevious.d.ts +9 -0
- package/dist/hooks/usePrevious.js +17 -0
- package/dist/hooks/useRowSelection.d.ts +45 -0
- package/dist/hooks/useRowSelection.js +147 -0
- package/dist/hooks/useSignalR.d.ts +13 -0
- package/dist/hooks/useSignalR.js +50 -0
- package/dist/hooks/useTheme.d.ts +59 -0
- package/dist/hooks/useTheme.js +261 -0
- package/dist/hooks/useTranslation.d.ts +5 -0
- package/dist/hooks/useTranslation.js +17 -0
- package/dist/hooks/useUnsavedChanges.d.ts +40 -0
- package/dist/hooks/useUnsavedChanges.js +83 -0
- package/dist/index.d.ts +2 -3173
- package/dist/index.js +4 -25937
- package/dist/lib/api/activity/audit/audit.d.ts +34 -0
- package/dist/lib/api/activity/audit/audit.js +44 -0
- package/dist/lib/api/activity/audit/index.d.ts +6 -0
- package/dist/lib/api/activity/audit/index.js +7 -0
- package/dist/lib/api/activity/audit/send.d.ts +152 -0
- package/dist/lib/api/activity/audit/send.js +403 -0
- package/dist/lib/api/activity/email/client.d.ts +167 -0
- package/dist/lib/api/activity/email/client.js +455 -0
- package/dist/lib/api/activity/email/index.d.ts +7 -0
- package/dist/lib/api/activity/email/index.js +10 -0
- package/dist/lib/api/activity/email/password-reset.d.ts +8 -0
- package/dist/lib/api/activity/email/password-reset.js +55 -0
- package/dist/lib/api/activity/email/templates.d.ts +10 -0
- package/dist/lib/api/activity/email/templates.js +531 -0
- package/dist/lib/api/activity/email/types.d.ts +237 -0
- package/dist/lib/api/activity/email/types.js +21 -0
- package/dist/lib/api/activity/index.d.ts +12 -0
- package/dist/lib/api/activity/index.js +15 -0
- package/dist/lib/api/activity/messaging/messaging.d.ts +149 -0
- package/dist/lib/api/activity/messaging/messaging.js +245 -0
- package/dist/lib/api/activity/notifications/index.d.ts +9 -0
- package/dist/lib/api/activity/notifications/index.js +9 -0
- package/dist/lib/api/activity/notifications/notifications.d.ts +59 -0
- package/dist/lib/api/activity/notifications/notifications.js +218 -0
- package/dist/lib/api/activity/notifications/reminders.d.ts +35 -0
- package/dist/lib/api/activity/notifications/reminders.js +25 -0
- package/dist/lib/api/activity/notifications/send.d.ts +122 -0
- package/dist/lib/api/activity/notifications/send.js +252 -0
- package/dist/lib/api/activity/notifications/types.d.ts +119 -0
- package/dist/lib/api/activity/notifications/types.js +62 -0
- package/dist/lib/api/activity/notify-and-log.d.ts +50 -0
- package/dist/lib/api/activity/notify-and-log.js +60 -0
- package/dist/lib/api/activity/remarks/index.d.ts +2 -0
- package/dist/lib/api/activity/remarks/index.js +2 -0
- package/dist/lib/api/activity/remarks/remarks.d.ts +83 -0
- package/dist/lib/api/activity/remarks/remarks.js +179 -0
- package/dist/lib/api/activity/storage.d.ts +28 -0
- package/dist/lib/api/activity/storage.js +79 -0
- package/dist/lib/api/ai/chat.d.ts +67 -0
- package/dist/lib/api/ai/chat.js +212 -0
- package/dist/lib/api/ai/types.d.ts +69 -0
- package/dist/lib/api/ai/types.js +5 -0
- package/dist/lib/api/approval/approvals.d.ts +66 -0
- package/dist/lib/api/approval/approvals.js +205 -0
- package/dist/lib/api/approval/index.d.ts +5 -0
- package/dist/lib/api/approval/index.js +6 -0
- package/dist/lib/api/auth/auth.d.ts +12 -0
- package/dist/lib/api/auth/auth.js +148 -0
- package/dist/lib/api/auth/index.d.ts +1 -0
- package/dist/lib/api/auth/index.js +4 -0
- package/dist/lib/api/auth/password-reset-otp.d.ts +49 -0
- package/dist/lib/api/auth/password-reset-otp.js +185 -0
- package/dist/lib/api/auth/two-factor-auth.d.ts +55 -0
- package/dist/lib/api/auth/two-factor-auth.js +84 -0
- package/dist/lib/api/auth/two-factor.d.ts +41 -0
- package/dist/lib/api/auth/two-factor.js +180 -0
- package/dist/lib/api/core/auth-helpers.d.ts +13 -0
- package/dist/lib/api/core/auth-helpers.js +137 -0
- package/dist/lib/api/core/client.d.ts +37 -0
- package/dist/lib/api/core/client.js +301 -0
- package/dist/lib/api/core/config.d.ts +46 -0
- package/dist/lib/api/core/config.js +238 -0
- package/dist/lib/api/core/index.d.ts +6 -0
- package/dist/lib/api/core/index.js +11 -0
- package/dist/lib/api/core/session-validator.d.ts +55 -0
- package/dist/lib/api/core/session-validator.js +94 -0
- package/dist/lib/api/core/types.d.ts +192 -0
- package/dist/lib/api/core/types.js +3 -0
- package/dist/lib/api/core/utils.d.ts +15 -0
- package/dist/lib/api/core/utils.js +64 -0
- package/dist/lib/api/dashboard/costing.d.ts +129 -0
- package/dist/lib/api/dashboard/costing.js +8 -0
- package/dist/lib/api/dashboard/management.d.ts +91 -0
- package/dist/lib/api/dashboard/management.js +5 -0
- package/dist/lib/api/dashboard/sales.d.ts +87 -0
- package/dist/lib/api/dashboard/sales.js +5 -0
- package/dist/lib/api/draft/drafts.d.ts +49 -0
- package/dist/lib/api/draft/drafts.js +274 -0
- package/dist/lib/api/draft/index.d.ts +5 -0
- package/dist/lib/api/draft/index.js +6 -0
- package/dist/lib/api/enquiry/enquiry.d.ts +324 -0
- package/dist/lib/api/enquiry/enquiry.js +617 -0
- package/dist/lib/api/enquiry/index.d.ts +2 -0
- package/dist/lib/api/enquiry/index.js +4 -0
- package/dist/lib/api/enquiry/rate-enquiry.d.ts +97 -0
- package/dist/lib/api/enquiry/rate-enquiry.js +69 -0
- package/dist/lib/api/estimation/categories.d.ts +28 -0
- package/dist/lib/api/estimation/categories.js +104 -0
- package/dist/lib/api/estimation/category-defaults.d.ts +56 -0
- package/dist/lib/api/estimation/category-defaults.js +41 -0
- package/dist/lib/api/estimation/company-config.d.ts +59 -0
- package/dist/lib/api/estimation/company-config.js +19 -0
- package/dist/lib/api/estimation/content.d.ts +103 -0
- package/dist/lib/api/estimation/content.js +203 -0
- package/dist/lib/api/estimation/freight.d.ts +34 -0
- package/dist/lib/api/estimation/freight.js +18 -0
- package/dist/lib/api/estimation/grid-costing-drafts.d.ts +38 -0
- package/dist/lib/api/estimation/grid-costing-drafts.js +21 -0
- package/dist/lib/api/estimation/grid-costing.d.ts +353 -0
- package/dist/lib/api/estimation/grid-costing.js +126 -0
- package/dist/lib/api/estimation/index.d.ts +10 -0
- package/dist/lib/api/estimation/index.js +22 -0
- package/dist/lib/api/estimation/legacy-costing.d.ts +42 -0
- package/dist/lib/api/estimation/legacy-costing.js +46 -0
- package/dist/lib/api/estimation/machines.d.ts +32 -0
- package/dist/lib/api/estimation/machines.js +67 -0
- package/dist/lib/api/estimation/planning.d.ts +479 -0
- package/dist/lib/api/estimation/planning.js +385 -0
- package/dist/lib/api/estimation/qualities.d.ts +128 -0
- package/dist/lib/api/estimation/qualities.js +229 -0
- package/dist/lib/api/estimation/quotation-load.d.ts +30 -0
- package/dist/lib/api/estimation/quotation-load.js +46 -0
- package/dist/lib/api/estimation/quotation-save.d.ts +88 -0
- package/dist/lib/api/estimation/quotation-save.js +101 -0
- package/dist/lib/api/estimation/quote-check.d.ts +19 -0
- package/dist/lib/api/estimation/quote-check.js +28 -0
- package/dist/lib/api/estimation/quotepanel.d.ts +304 -0
- package/dist/lib/api/estimation/quotepanel.js +489 -0
- package/dist/lib/api/estimation/shipper-planning.d.ts +71 -0
- package/dist/lib/api/estimation/shipper-planning.js +208 -0
- package/dist/lib/api/estimation/wastage.d.ts +40 -0
- package/dist/lib/api/estimation/wastage.js +40 -0
- package/dist/lib/api/index.d.ts +7 -0
- package/dist/lib/api/index.js +17 -0
- package/dist/lib/api/integration/proxy.d.ts +7 -0
- package/dist/lib/api/integration/proxy.js +34 -0
- package/dist/lib/api/master/category.d.ts +126 -0
- package/dist/lib/api/master/category.js +208 -0
- package/dist/lib/api/master/company.d.ts +167 -0
- package/dist/lib/api/master/company.js +368 -0
- package/dist/lib/api/master/hsn.d.ts +36 -0
- package/dist/lib/api/master/hsn.js +54 -0
- package/dist/lib/api/master/index.d.ts +12 -0
- package/dist/lib/api/master/index.js +27 -0
- package/dist/lib/api/master/item.d.ts +158 -0
- package/dist/lib/api/master/item.js +135 -0
- package/dist/lib/api/master/ledger.d.ts +173 -0
- package/dist/lib/api/master/ledger.js +391 -0
- package/dist/lib/api/master/logistics.d.ts +117 -0
- package/dist/lib/api/master/logistics.js +107 -0
- package/dist/lib/api/master/machine.d.ts +406 -0
- package/dist/lib/api/master/machine.js +570 -0
- package/dist/lib/api/master/material-group.d.ts +97 -0
- package/dist/lib/api/master/material-group.js +96 -0
- package/dist/lib/api/master/other.d.ts +65 -0
- package/dist/lib/api/master/other.js +56 -0
- package/dist/lib/api/master/process-types.d.ts +178 -0
- package/dist/lib/api/master/process-types.js +4 -0
- package/dist/lib/api/master/process.d.ts +94 -0
- package/dist/lib/api/master/process.js +124 -0
- package/dist/lib/api/master/production-units.d.ts +10 -0
- package/dist/lib/api/master/production-units.js +15 -0
- package/dist/lib/api/master/rate.d.ts +174 -0
- package/dist/lib/api/master/rate.js +196 -0
- package/dist/lib/api/master/tool.d.ts +48 -0
- package/dist/lib/api/master/tool.js +80 -0
- package/dist/lib/api/master/user.d.ts +473 -0
- package/dist/lib/api/master/user.js +147 -0
- package/dist/lib/api/settings/erp-parameters.d.ts +33 -0
- package/dist/lib/api/settings/erp-parameters.js +61 -0
- package/dist/lib/api/utility/index.d.ts +1 -0
- package/dist/lib/api/utility/index.js +5 -0
- package/dist/lib/api/utility/menu.d.ts +32 -0
- package/dist/lib/api/utility/menu.js +128 -0
- package/dist/lib/auth.d.ts +3 -0
- package/dist/lib/auth.js +7 -0
- package/dist/lib/pwa.d.ts +8 -0
- package/dist/lib/pwa.js +53 -0
- package/dist/lib/react-query-config.d.ts +140 -0
- package/dist/lib/react-query-config.js +131 -0
- package/dist/lib/security/audit-logger.d.ts +71 -0
- package/dist/lib/security/audit-logger.js +173 -0
- package/dist/lib/security/rate-limiter.d.ts +28 -0
- package/dist/lib/security/rate-limiter.js +118 -0
- package/dist/lib/server-url.d.ts +18 -0
- package/dist/lib/server-url.js +70 -0
- package/dist/lib/svg-utils.d.ts +62 -0
- package/dist/lib/svg-utils.js +206 -0
- package/dist/lib/theme/types.d.ts +109 -0
- package/dist/lib/theme/types.js +231 -0
- package/dist/lib/theme/utils.d.ts +73 -0
- package/dist/lib/theme/utils.js +343 -0
- package/dist/lib/types/index.d.ts +58 -0
- package/dist/lib/types/index.js +2 -0
- package/dist/lib/utils/attachment-loader.d.ts +27 -0
- package/dist/lib/utils/attachment-loader.js +79 -0
- package/dist/lib/utils/client-lead-utils.d.ts +24 -0
- package/dist/lib/utils/client-lead-utils.js +56 -0
- package/dist/lib/utils/device-detection.d.ts +19 -0
- package/dist/lib/utils/device-detection.js +105 -0
- package/dist/lib/utils/logout-cleanup.d.ts +63 -0
- package/dist/lib/utils/logout-cleanup.js +297 -0
- package/dist/lib/utils/planning-prefs.d.ts +10 -0
- package/dist/lib/utils/planning-prefs.js +27 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.js +60 -0
- package/dist/lib/vision/dieline-extractor.d.ts +38 -0
- package/dist/lib/vision/dieline-extractor.js +313 -0
- package/dist/lib/vision/reference-grid.d.ts +52 -0
- package/dist/lib/vision/reference-grid.js +241 -0
- package/dist/locales/de.json +79 -0
- package/dist/locales/en.json +2217 -0
- package/dist/locales/es.json +79 -0
- package/dist/locales/fr.json +78 -0
- package/dist/locales/hi.json +1599 -0
- package/dist/providers.d.ts +14 -0
- package/dist/providers.js +15 -0
- package/dist/services/GlobalLoadingService.d.ts +216 -0
- package/dist/services/GlobalLoadingService.js +216 -0
- package/dist/styles/grid-themes.css +346 -0
- package/dist/styles/index.css +5 -0
- package/dist/{sidebar-scrollbar-NBCB2OO2.css → styles/sidebar-scrollbar.css} +45 -45
- package/dist/styles/tokens.css +713 -0
- package/dist/types/approval.d.ts +201 -0
- package/dist/types/approval.js +19 -0
- package/dist/types/audit.d.ts +87 -0
- package/dist/types/audit.js +47 -0
- package/dist/types/draft.d.ts +142 -0
- package/dist/types/draft.js +19 -0
- package/dist/types/master.d.ts +154 -0
- package/dist/types/master.js +3 -0
- package/dist/types/shipper-planning.d.ts +277 -0
- package/dist/types/shipper-planning.js +6 -0
- package/package.json +182 -119
- package/dist/chunk-4PEFU7N7.js +0 -16
- package/dist/chunk-4PEFU7N7.js.map +0 -1
- package/dist/de-EKT7SUK5.js +0 -106
- package/dist/de-EKT7SUK5.js.map +0 -1
- package/dist/en-QRFSIEHD.js +0 -1685
- package/dist/en-QRFSIEHD.js.map +0 -1
- package/dist/es-KHZMWGUI.js +0 -106
- package/dist/es-KHZMWGUI.js.map +0 -1
- package/dist/fr-X2XUXSHK.js +0 -105
- package/dist/fr-X2XUXSHK.js.map +0 -1
- package/dist/hi-YRATOE5Q.js +0 -415
- package/dist/hi-YRATOE5Q.js.map +0 -1
- package/dist/index.cjs +0 -28216
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3173
- package/dist/index.js.map +0 -1
- /package/{src → dist/cjs}/styles/index.css +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MultimodalInput = MultimodalInput;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/**
|
|
7
|
+
* Multimodal Input Component
|
|
8
|
+
* Chat input with auto-expanding textarea, file upload, and voice input
|
|
9
|
+
*/
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const lucide_react_1 = require("lucide-react");
|
|
12
|
+
const utils_1 = require("../../lib/utils.js");
|
|
13
|
+
const LanguageContext_1 = require("../../contexts/LanguageContext.js");
|
|
14
|
+
function MultimodalInput({ onSubmit, onStop, isLoading = false, placeholder = 'Send a message...', allowFileUpload = true, compact = false, disabled = false, disabledReason }) {
|
|
15
|
+
const { t } = (0, LanguageContext_1.useLanguage)();
|
|
16
|
+
const [input, setInput] = (0, react_1.useState)('');
|
|
17
|
+
const [files, setFiles] = (0, react_1.useState)([]);
|
|
18
|
+
const [isListening, setIsListening] = (0, react_1.useState)(false);
|
|
19
|
+
const textareaRef = (0, react_1.useRef)(null);
|
|
20
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
21
|
+
const recognitionRef = (0, react_1.useRef)(null);
|
|
22
|
+
// Voice input support check (must be in state to survive SSR hydration)
|
|
23
|
+
const [speechSupported, setSpeechSupported] = (0, react_1.useState)(false);
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
setSpeechSupported(typeof window !== 'undefined' &&
|
|
26
|
+
!!(window.SpeechRecognition || window.webkitSpeechRecognition));
|
|
27
|
+
}, []);
|
|
28
|
+
const handleVoiceInput = (0, react_1.useCallback)(() => {
|
|
29
|
+
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
30
|
+
if (!SpeechRecognition)
|
|
31
|
+
return;
|
|
32
|
+
if (isListening) {
|
|
33
|
+
recognitionRef.current?.stop();
|
|
34
|
+
setIsListening(false);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Fresh instance every click — reusing a stopped instance throws InvalidStateError
|
|
38
|
+
const recognition = new SpeechRecognition();
|
|
39
|
+
recognition.continuous = false;
|
|
40
|
+
recognition.interimResults = false;
|
|
41
|
+
recognition.lang = 'en-IN';
|
|
42
|
+
recognition.onresult = (event) => {
|
|
43
|
+
const transcript = event.results[0]?.[0]?.transcript;
|
|
44
|
+
if (transcript) {
|
|
45
|
+
setInput(prev => prev + (prev ? ' ' : '') + transcript.trim());
|
|
46
|
+
}
|
|
47
|
+
setIsListening(false);
|
|
48
|
+
recognitionRef.current = null;
|
|
49
|
+
};
|
|
50
|
+
recognition.onerror = (event) => {
|
|
51
|
+
setIsListening(false);
|
|
52
|
+
recognitionRef.current = null;
|
|
53
|
+
};
|
|
54
|
+
recognition.onend = () => {
|
|
55
|
+
setIsListening(false);
|
|
56
|
+
recognitionRef.current = null;
|
|
57
|
+
};
|
|
58
|
+
recognitionRef.current = recognition;
|
|
59
|
+
try {
|
|
60
|
+
recognition.start();
|
|
61
|
+
setIsListening(true);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
setIsListening(false);
|
|
65
|
+
recognitionRef.current = null;
|
|
66
|
+
}
|
|
67
|
+
}, [isListening]);
|
|
68
|
+
// Cleanup on unmount
|
|
69
|
+
(0, react_1.useEffect)(() => {
|
|
70
|
+
return () => { recognitionRef.current?.abort(); };
|
|
71
|
+
}, []);
|
|
72
|
+
// Auto-focus textarea on mount
|
|
73
|
+
(0, react_1.useEffect)(() => {
|
|
74
|
+
const timer = setTimeout(() => { textareaRef.current?.focus(); }, 100);
|
|
75
|
+
return () => clearTimeout(timer);
|
|
76
|
+
}, []);
|
|
77
|
+
// Auto-resize textarea
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
if (textareaRef.current) {
|
|
80
|
+
textareaRef.current.style.height = 'auto';
|
|
81
|
+
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
82
|
+
}
|
|
83
|
+
}, [input]);
|
|
84
|
+
const handleSubmit = () => {
|
|
85
|
+
if (disabled)
|
|
86
|
+
return;
|
|
87
|
+
if (!input.trim() && files.length === 0)
|
|
88
|
+
return;
|
|
89
|
+
onSubmit(input, files.length > 0 ? files : undefined);
|
|
90
|
+
setInput('');
|
|
91
|
+
setFiles([]);
|
|
92
|
+
if (textareaRef.current) {
|
|
93
|
+
textareaRef.current.style.height = 'auto';
|
|
94
|
+
textareaRef.current.focus();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const handleKeyDown = (e) => {
|
|
98
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
handleSubmit();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const handleFileSelect = (e) => {
|
|
104
|
+
const selectedFiles = Array.from(e.target.files || []);
|
|
105
|
+
setFiles(prev => [...prev, ...selectedFiles]);
|
|
106
|
+
};
|
|
107
|
+
const removeFile = (index) => {
|
|
108
|
+
setFiles(prev => prev.filter((_, i) => i !== index));
|
|
109
|
+
};
|
|
110
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-[rgb(var(--bg-surface))] shrink-0", compact ? "px-1 py-1" : "border-t border-[rgb(var(--bd-default))] px-4 py-2.5"), children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-3xl mx-auto", children: [disabled && disabledReason && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/30 text-xs text-amber-700 dark:text-amber-400 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }), (0, jsx_runtime_1.jsx)("span", { children: disabledReason })] })), files.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap gap-2 mb-3", children: files.map((file, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-3 py-2 bg-[rgb(var(--bg-app))] border border-[rgb(var(--bd-default))] rounded-lg text-sm", children: [file.type.startsWith('image/') ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Image, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.FileIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })), (0, jsx_runtime_1.jsx)("span", { className: "text-[rgb(var(--fg-default))] truncate max-w-[150px]", children: file.name }), (0, jsx_runtime_1.jsx)("button", { onClick: () => removeFile(index), className: "text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-3 h-3" }) })] }, index))) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("relative flex items-center gap-1 bg-[rgb(var(--bg-app))]/60 backdrop-blur-xl border border-[rgb(var(--bd-default))] shadow-lg transition-all duration-250 focus-within:border-[rgb(var(--color-primary))] focus-within:shadow-[0_0_0_4px_rgb(var(--color-primary)/0.12),0_20px_25px_-5px_rgba(0,0,0,0.15)] focus-within:-translate-y-px", compact ? "rounded-xl p-1.5" : "rounded-2xl p-2.5"), children: [allowFileUpload && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", multiple: true, accept: "image/*,application/pdf,.doc,.docx,.txt", onChange: handleFileSelect, className: "hidden" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => fileInputRef.current?.click(), className: "shrink-0 !min-h-0 w-9 h-9 rounded-lg flex items-center justify-center transition-colors text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]", "aria-label": "Attach file", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { className: "w-4 h-4" }) })] })), (0, jsx_runtime_1.jsx)("textarea", { ref: textareaRef, "data-chat-input": true, value: input, onChange: (e) => setInput(e.target.value), onKeyDown: handleKeyDown, placeholder: disabled ? t('Conversation closed — start a new chat')
|
|
111
|
+
: isListening ? t('Listening...')
|
|
112
|
+
: placeholder, disabled: isListening || disabled, autoFocus: !disabled, rows: 1, className: (0, utils_1.cn)('flex-1 bg-transparent text-[rgb(var(--fg-default))] placeholder:text-[rgb(var(--fg-muted))]', 'resize-none outline-none text-sm', compact ? 'px-2 py-1.5 max-h-[120px]' : 'px-3 py-2.5 max-h-[200px]', 'overflow-y-auto', disabled && 'cursor-not-allowed') }), speechSupported && ((0, jsx_runtime_1.jsx)("button", { onClick: handleVoiceInput, className: (0, utils_1.cn)('shrink-0 !min-h-0 w-9 h-9 rounded-lg flex items-center justify-center transition-colors', isListening
|
|
113
|
+
? 'text-red-500 bg-red-500/10 animate-pulse'
|
|
114
|
+
: 'text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]'), "aria-label": isListening ? t('Stop listening') : t('Voice input'), children: isListening ? (0, jsx_runtime_1.jsx)(lucide_react_1.MicOff, { className: "w-4 h-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Mic, { className: "w-4 h-4" }) })), isLoading && onStop ? ((0, jsx_runtime_1.jsx)("button", { onClick: onStop, className: "shrink-0 !min-h-0 w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-[180ms] ease-out shadow-sm bg-[rgb(var(--color-primary))] text-white hover:opacity-90 hover:scale-[1.04] active:scale-95 ring-1 ring-[rgb(var(--color-primary))]/20", "aria-label": "Stop generation", title: "Stop", children: (0, jsx_runtime_1.jsx)("span", { className: "w-2.5 h-2.5 rounded-[2px] bg-white" }) })) : ((0, jsx_runtime_1.jsx)("button", { onClick: handleSubmit, disabled: (!input.trim() && files.length === 0) || isListening || disabled, className: (0, utils_1.cn)('shrink-0 !min-h-0 w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-[180ms] ease-out shadow-md', (input.trim() || files.length > 0) && !isListening && !disabled
|
|
115
|
+
? 'bg-[rgb(var(--color-primary))] text-white hover:scale-[1.06] active:scale-95'
|
|
116
|
+
: 'bg-[rgb(var(--bg-subtle))] text-[rgb(var(--fg-muted))] cursor-not-allowed shadow-none'), "aria-label": "Send message", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "w-4 h-4 transition-transform duration-200 active:rotate-45" }) }))] })] }) }));
|
|
117
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DrillDownModal = DrillDownModal;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const components_1 = require("../index.js");
|
|
8
|
+
const components_2 = require("../index.js");
|
|
9
|
+
const LanguageContext_1 = require("../../contexts/LanguageContext.js");
|
|
10
|
+
function DrillDownModal({ drill, onClose, columns, getRowId, fetcher, titlePrefix }) {
|
|
11
|
+
const { t } = (0, LanguageContext_1.useLanguage)();
|
|
12
|
+
const [rows, setRows] = (0, react_1.useState)([]);
|
|
13
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
14
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
15
|
+
const load = (0, react_1.useCallback)(async (ctx) => {
|
|
16
|
+
setLoading(true);
|
|
17
|
+
setError(null);
|
|
18
|
+
try {
|
|
19
|
+
setRows(await fetcher(ctx));
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
setError(t('Failed to load details'));
|
|
23
|
+
setRows([]);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
setLoading(false);
|
|
27
|
+
}
|
|
28
|
+
}, [fetcher, t]);
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
if (drill)
|
|
31
|
+
load(drill);
|
|
32
|
+
else
|
|
33
|
+
setRows([]);
|
|
34
|
+
}, [drill, load]);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(components_1.StandardModal, { isOpen: !!drill, onClose: onClose, title: drill?.label || '', subtitle: titlePrefix, size: "xl", showFooter: false, children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "h-64 flex items-center justify-center text-sm text-[rgb(var(--fg-muted))]", children: t('Loading...') })) : error ? ((0, jsx_runtime_1.jsx)("div", { className: "h-64 flex items-center justify-center text-sm text-[rgb(var(--color-error))]", children: error })) : ((0, jsx_runtime_1.jsx)(components_2.DataGrid, { data: rows, columns: columns, getRowId: getRowId, pageSize: 15, enablePagination: true, enableSorting: true, enableFilterRow: true, title: `${drill?.label || ''} (${rows.length})` })) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FORECAST_METHODS = void 0;
|
|
5
|
+
exports.computeForecast = computeForecast;
|
|
6
|
+
exports.projectForecast = projectForecast;
|
|
7
|
+
exports.FilterBar = FilterBar;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const lucide_react_1 = require("lucide-react");
|
|
11
|
+
const utils_1 = require("../../lib/utils.js");
|
|
12
|
+
const dropdown_1 = require("../forms/dropdown/index.js");
|
|
13
|
+
const date_picker_1 = require("../forms/date-picker/index.js");
|
|
14
|
+
const tabs_1 = require("../ui/navigation/tabs.js");
|
|
15
|
+
const LanguageContext_1 = require("../../contexts/LanguageContext.js");
|
|
16
|
+
const ui_1 = require("../ui/index.js");
|
|
17
|
+
exports.FORECAST_METHODS = [
|
|
18
|
+
{ value: 'ma', label: 'Moving Avg', hint: 'Averages the last N values, all counted equally. Smooths out spikes but lags behind real shifts.' },
|
|
19
|
+
{ value: 'wma', label: 'Weighted', hint: 'Averages the last N values, newer ones weighted higher. Picks up recent changes sooner.' },
|
|
20
|
+
{ value: 'es', label: 'Exponential', hint: 'Blends all history, with influence fading the older a value gets. Smooth yet quick to adapt.' },
|
|
21
|
+
{ value: 'holt', label: 'Trend', hint: 'Exponential smoothing plus a trend component. The only method that projects the slope into future periods.' },
|
|
22
|
+
];
|
|
23
|
+
const FORECAST_PERIOD_LIMITS = {
|
|
24
|
+
Day: { min: 2, max: 60 },
|
|
25
|
+
Week: { min: 2, max: 52 },
|
|
26
|
+
Month: { min: 2, max: 24 },
|
|
27
|
+
Quarter: { min: 2, max: 12 },
|
|
28
|
+
Year: { min: 2, max: 10 },
|
|
29
|
+
};
|
|
30
|
+
const FORECAST_HORIZON_LIMITS = {
|
|
31
|
+
Day: { min: 1, max: 30 },
|
|
32
|
+
Week: { min: 1, max: 26 },
|
|
33
|
+
Month: { min: 1, max: 12 },
|
|
34
|
+
Quarter: { min: 1, max: 8 },
|
|
35
|
+
Year: { min: 1, max: 5 },
|
|
36
|
+
};
|
|
37
|
+
const SHORT_MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
38
|
+
function labelForUnit(timeFilter, offset) {
|
|
39
|
+
const now = new Date();
|
|
40
|
+
switch (timeFilter) {
|
|
41
|
+
case 'Day': {
|
|
42
|
+
const d = new Date(now);
|
|
43
|
+
d.setDate(now.getDate() + offset);
|
|
44
|
+
return `${d.getDate()} ${SHORT_MONTHS[d.getMonth()]}`;
|
|
45
|
+
}
|
|
46
|
+
case 'Week': {
|
|
47
|
+
const d = new Date(now);
|
|
48
|
+
d.setDate(now.getDate() + offset * 7);
|
|
49
|
+
const oneJan = new Date(d.getFullYear(), 0, 1);
|
|
50
|
+
const week = Math.ceil((((d.getTime() - oneJan.getTime()) / 86400000) + oneJan.getDay() + 1) / 7);
|
|
51
|
+
return `W${week}`;
|
|
52
|
+
}
|
|
53
|
+
case 'Month': {
|
|
54
|
+
const d = new Date(now.getFullYear(), now.getMonth() + offset, 1);
|
|
55
|
+
return `${SHORT_MONTHS[d.getMonth()]} ${d.getFullYear()}`;
|
|
56
|
+
}
|
|
57
|
+
case 'Quarter': {
|
|
58
|
+
const d = new Date(now.getFullYear(), now.getMonth() + offset * 3, 1);
|
|
59
|
+
return `Q${Math.floor(d.getMonth() / 3) + 1} ${d.getFullYear()}`;
|
|
60
|
+
}
|
|
61
|
+
case 'Year':
|
|
62
|
+
return String(now.getFullYear() + offset);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Range covering `count` periods. dir=-1 means the last N (ending this period), dir=+1 means next N (starting next period). */
|
|
66
|
+
function resolvePeriodRange(timeFilter, count, dir) {
|
|
67
|
+
if (count < 1)
|
|
68
|
+
return '';
|
|
69
|
+
const start = dir === -1 ? -(count - 1) : 1;
|
|
70
|
+
const end = dir === -1 ? 0 : count;
|
|
71
|
+
const startLabel = labelForUnit(timeFilter, start);
|
|
72
|
+
const endLabel = labelForUnit(timeFilter, end);
|
|
73
|
+
return count === 1 ? endLabel : `${startLabel} – ${endLabel}`;
|
|
74
|
+
}
|
|
75
|
+
const HOLT_BETA = 0.3;
|
|
76
|
+
function holtState(values, period) {
|
|
77
|
+
const alpha = 2 / (period + 1);
|
|
78
|
+
let level = values[0];
|
|
79
|
+
let trend = values.length > 1 ? values[1] - values[0] : 0;
|
|
80
|
+
for (let i = 1; i < values.length; i++) {
|
|
81
|
+
const prevLevel = level;
|
|
82
|
+
level = alpha * values[i] + (1 - alpha) * (level + trend);
|
|
83
|
+
trend = HOLT_BETA * (level - prevLevel) + (1 - HOLT_BETA) * trend;
|
|
84
|
+
}
|
|
85
|
+
return { level, trend };
|
|
86
|
+
}
|
|
87
|
+
function computeForecast(values, method, period) {
|
|
88
|
+
if (period < 1 || values.length === 0)
|
|
89
|
+
return values.map(() => null);
|
|
90
|
+
if (method === 'es' || method === 'holt') {
|
|
91
|
+
const alpha = 2 / (period + 1);
|
|
92
|
+
const out = [values[0]];
|
|
93
|
+
if (method === 'es') {
|
|
94
|
+
for (let i = 1; i < values.length; i++) {
|
|
95
|
+
out.push(alpha * values[i] + (1 - alpha) * out[i - 1]);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
let level = values[0];
|
|
100
|
+
let trend = values.length > 1 ? values[1] - values[0] : 0;
|
|
101
|
+
for (let i = 1; i < values.length; i++) {
|
|
102
|
+
const prevLevel = level;
|
|
103
|
+
level = alpha * values[i] + (1 - alpha) * (level + trend);
|
|
104
|
+
trend = HOLT_BETA * (level - prevLevel) + (1 - HOLT_BETA) * trend;
|
|
105
|
+
out.push(level);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
return values.map((_, i) => {
|
|
111
|
+
if (i < period - 1)
|
|
112
|
+
return null;
|
|
113
|
+
const window = values.slice(i - period + 1, i + 1);
|
|
114
|
+
if (method === 'wma') {
|
|
115
|
+
const denom = (period * (period + 1)) / 2;
|
|
116
|
+
return window.reduce((sum, v, j) => sum + v * (j + 1), 0) / denom;
|
|
117
|
+
}
|
|
118
|
+
return window.reduce((sum, v) => sum + v, 0) / period;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function projectForecast(values, method, period, horizon) {
|
|
122
|
+
if (values.length === 0 || horizon < 1 || period < 1)
|
|
123
|
+
return [];
|
|
124
|
+
if (method === 'holt') {
|
|
125
|
+
const { level, trend } = holtState(values, period);
|
|
126
|
+
return Array.from({ length: horizon }, (_, h) => level + trend * (h + 1));
|
|
127
|
+
}
|
|
128
|
+
let next;
|
|
129
|
+
if (method === 'es') {
|
|
130
|
+
const smoothed = computeForecast(values, 'es', period);
|
|
131
|
+
next = smoothed[smoothed.length - 1];
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
const window = values.slice(-period);
|
|
135
|
+
if (method === 'wma') {
|
|
136
|
+
const n = window.length;
|
|
137
|
+
const denom = (n * (n + 1)) / 2;
|
|
138
|
+
next = window.reduce((sum, v, j) => sum + v * (j + 1), 0) / denom;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
next = window.reduce((sum, v) => sum + v, 0) / window.length;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return Array.from({ length: horizon }, () => next);
|
|
145
|
+
}
|
|
146
|
+
// ============================================================================
|
|
147
|
+
// FilterBar Component
|
|
148
|
+
// ============================================================================
|
|
149
|
+
// Time filter dropdown options — quick = relative shortcuts (pinned footer), options = explicit list
|
|
150
|
+
const DAY_QUICK = [
|
|
151
|
+
{ value: 'today', label: 'Today' },
|
|
152
|
+
{ value: 'yesterday', label: 'Yesterday' },
|
|
153
|
+
{ value: 'last7', label: 'Last 7 Days' },
|
|
154
|
+
{ value: 'last14', label: 'Last 14 Days' },
|
|
155
|
+
{ value: 'last30', label: 'Last 30 Days' },
|
|
156
|
+
];
|
|
157
|
+
const DAY_OPTIONS = DAY_QUICK;
|
|
158
|
+
const WEEK_QUICK = [
|
|
159
|
+
{ value: 'this', label: 'This Week' },
|
|
160
|
+
{ value: 'last', label: 'Last Week' },
|
|
161
|
+
{ value: 'last2', label: 'Last 2 Weeks' },
|
|
162
|
+
{ value: 'last4', label: 'Last 4 Weeks' },
|
|
163
|
+
];
|
|
164
|
+
// Fallback static list; the live options are built fiscal-year-aware in buildTimeOptions().
|
|
165
|
+
const WEEK_OPTIONS = [
|
|
166
|
+
{ value: 'W1', label: 'Week 1' },
|
|
167
|
+
{ value: 'W2', label: 'Week 2' },
|
|
168
|
+
{ value: 'W3', label: 'Week 3' },
|
|
169
|
+
{ value: 'W4', label: 'Week 4' },
|
|
170
|
+
{ value: 'W5', label: 'Week 5' },
|
|
171
|
+
];
|
|
172
|
+
const MONTH_QUICK = [
|
|
173
|
+
{ value: 'this', label: 'This Month' },
|
|
174
|
+
{ value: 'last', label: 'Last Month' },
|
|
175
|
+
];
|
|
176
|
+
const MONTH_OPTIONS = [
|
|
177
|
+
{ value: 'jan', label: 'Jan' },
|
|
178
|
+
{ value: 'feb', label: 'Feb' },
|
|
179
|
+
{ value: 'mar', label: 'Mar' },
|
|
180
|
+
{ value: 'apr', label: 'Apr' },
|
|
181
|
+
{ value: 'may', label: 'May' },
|
|
182
|
+
{ value: 'jun', label: 'Jun' },
|
|
183
|
+
{ value: 'jul', label: 'Jul' },
|
|
184
|
+
{ value: 'aug', label: 'Aug' },
|
|
185
|
+
{ value: 'sep', label: 'Sep' },
|
|
186
|
+
{ value: 'oct', label: 'Oct' },
|
|
187
|
+
{ value: 'nov', label: 'Nov' },
|
|
188
|
+
{ value: 'dec', label: 'Dec' },
|
|
189
|
+
];
|
|
190
|
+
const QUARTER_QUICK = [
|
|
191
|
+
{ value: 'this', label: 'This Quarter' },
|
|
192
|
+
{ value: 'last', label: 'Last Quarter' },
|
|
193
|
+
];
|
|
194
|
+
const QUARTER_OPTIONS = [
|
|
195
|
+
{ value: 'Q1', label: 'Q1 (Apr-Jun)' },
|
|
196
|
+
{ value: 'Q2', label: 'Q2 (Jul-Sep)' },
|
|
197
|
+
{ value: 'Q3', label: 'Q3 (Oct-Dec)' },
|
|
198
|
+
{ value: 'Q4', label: 'Q4 (Jan-Mar)' },
|
|
199
|
+
];
|
|
200
|
+
const currentYear = new Date().getFullYear();
|
|
201
|
+
const YEAR_QUICK = [
|
|
202
|
+
{ value: 'this', label: 'This Year' },
|
|
203
|
+
{ value: 'last', label: 'Last Year' },
|
|
204
|
+
];
|
|
205
|
+
const YEAR_OPTIONS = [
|
|
206
|
+
{ value: String(currentYear), label: String(currentYear) },
|
|
207
|
+
{ value: String(currentYear - 1), label: String(currentYear - 1) },
|
|
208
|
+
{ value: String(currentYear - 2), label: String(currentYear - 2) },
|
|
209
|
+
{ value: String(currentYear - 3), label: String(currentYear - 3) },
|
|
210
|
+
];
|
|
211
|
+
// Time filter toggle options with dropdown configs (static fallback)
|
|
212
|
+
const TIME_FILTER_OPTIONS = [
|
|
213
|
+
{ value: 'Day', label: 'Day', dropdownOptions: DAY_OPTIONS, quickOptions: DAY_QUICK },
|
|
214
|
+
{ value: 'Week', label: 'Week', dropdownOptions: WEEK_OPTIONS, quickOptions: WEEK_QUICK },
|
|
215
|
+
{ value: 'Month', label: 'Month', dropdownOptions: MONTH_OPTIONS, quickOptions: MONTH_QUICK },
|
|
216
|
+
{ value: 'Quarter', label: 'Quarter', dropdownOptions: QUARTER_OPTIONS, quickOptions: QUARTER_QUICK },
|
|
217
|
+
{ value: 'Year', label: 'Year', dropdownOptions: YEAR_OPTIONS, quickOptions: YEAR_QUICK },
|
|
218
|
+
];
|
|
219
|
+
const fmtFiscalDay = (d) => `${String(d.getDate()).padStart(2, '0')} ${SHORT_MONTHS[d.getMonth()]}`;
|
|
220
|
+
// Fiscal-year-aware dropdown options. FY runs 1 Apr (fyStart) → 31 Mar (fyStart+1).
|
|
221
|
+
// Weeks are W1..W52/53 counting 7-day spans from 1 Apr; months ordered Apr→Mar;
|
|
222
|
+
// quarters Q1 Apr-Jun … Q4 Jan-Mar; year shown as "YYYY-YYYY".
|
|
223
|
+
function buildTimeOptions(fyStart) {
|
|
224
|
+
const fyOpen = new Date(fyStart, 3, 1);
|
|
225
|
+
const fyClose = new Date(fyStart + 1, 2, 31);
|
|
226
|
+
// Monday-aligned weeks clamped to the FY: W1 = 1 Apr → first Sunday (partial),
|
|
227
|
+
// then each week runs Mon–Sun; the last week is clamped to 31 Mar.
|
|
228
|
+
const firstSunday = new Date(fyStart, 3, 1 + ((7 - fyOpen.getDay()) % 7));
|
|
229
|
+
const weeks = [];
|
|
230
|
+
let from = new Date(fyOpen);
|
|
231
|
+
let sunday = new Date(firstSunday);
|
|
232
|
+
let wk = 1;
|
|
233
|
+
while (from <= fyClose) {
|
|
234
|
+
const to = sunday > fyClose ? fyClose : sunday;
|
|
235
|
+
weeks.push({ value: `W${wk}`, label: `Week ${wk} (${fmtFiscalDay(from)} – ${fmtFiscalDay(to)})` });
|
|
236
|
+
from = new Date(sunday.getFullYear(), sunday.getMonth(), sunday.getDate() + 1);
|
|
237
|
+
sunday = new Date(from.getFullYear(), from.getMonth(), from.getDate() + 6);
|
|
238
|
+
wk++;
|
|
239
|
+
}
|
|
240
|
+
const months = Array.from({ length: 12 }, (_, i) => {
|
|
241
|
+
const mo = (3 + i) % 12;
|
|
242
|
+
const yr = mo >= 3 ? fyStart : fyStart + 1;
|
|
243
|
+
return { value: `${mo}`, label: `${SHORT_MONTHS[mo]} ${yr}` };
|
|
244
|
+
});
|
|
245
|
+
const quarters = [
|
|
246
|
+
{ value: 'Q1', label: `Q1 (Apr – Jun ${fyStart})` },
|
|
247
|
+
{ value: 'Q2', label: `Q2 (Jul – Sep ${fyStart})` },
|
|
248
|
+
{ value: 'Q3', label: `Q3 (Oct – Dec ${fyStart})` },
|
|
249
|
+
{ value: 'Q4', label: `Q4 (Jan – Mar ${fyStart + 1})` },
|
|
250
|
+
];
|
|
251
|
+
const years = [{ value: `${fyStart}`, label: `${fyStart}-${fyStart + 1}` }];
|
|
252
|
+
return [
|
|
253
|
+
{ value: 'Day', label: 'Day', dropdownOptions: DAY_OPTIONS, quickOptions: DAY_QUICK },
|
|
254
|
+
{ value: 'Week', label: 'Week', dropdownOptions: weeks, quickOptions: WEEK_QUICK },
|
|
255
|
+
{ value: 'Month', label: 'Month', dropdownOptions: months, quickOptions: MONTH_QUICK },
|
|
256
|
+
{ value: 'Quarter', label: 'Quarter', dropdownOptions: quarters, quickOptions: QUARTER_QUICK },
|
|
257
|
+
{ value: 'Year', label: 'Year', dropdownOptions: years, quickOptions: YEAR_QUICK },
|
|
258
|
+
];
|
|
259
|
+
}
|
|
260
|
+
function Stepper({ value, min, max, onChange }) {
|
|
261
|
+
const [text, setText] = (0, react_1.useState)(String(value));
|
|
262
|
+
(0, react_1.useEffect)(() => {
|
|
263
|
+
setText(String(value));
|
|
264
|
+
}, [value]);
|
|
265
|
+
const commit = () => {
|
|
266
|
+
const parsed = parseInt(text, 10);
|
|
267
|
+
const clamped = isNaN(parsed) ? value : Math.min(max, Math.max(min, parsed));
|
|
268
|
+
setText(String(clamped));
|
|
269
|
+
if (clamped !== value)
|
|
270
|
+
onChange(clamped);
|
|
271
|
+
};
|
|
272
|
+
const buttonClasses = (0, utils_1.cn)('w-7 h-7 rounded-md flex items-center justify-center transition-colors shrink-0', 'border border-[rgb(var(--bd-default))] text-[rgb(var(--fg-muted))]', 'hover:bg-[rgb(var(--bg-subtle))] disabled:opacity-40 disabled:pointer-events-none');
|
|
273
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => onChange(value - 1), disabled: value <= min, className: buttonClasses, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Minus, { className: "w-3.5 h-3.5" }) }), (0, jsx_runtime_1.jsx)("input", { value: text, onChange: (e) => setText(e.target.value.replace(/\D/g, '')), onBlur: commit, onKeyDown: (e) => e.key === 'Enter' && e.target.blur(), inputMode: "numeric", className: (0, utils_1.cn)('flex-1 h-7 w-full min-w-0 rounded-md border border-[rgb(var(--bd-default))] bg-transparent', 'text-center text-xs font-semibold text-[rgb(var(--fg-default))]', 'focus:outline-none focus:border-[rgb(var(--color-primary))]') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => onChange(value + 1), disabled: value >= max, className: buttonClasses, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { className: "w-3.5 h-3.5" }) })] }));
|
|
274
|
+
}
|
|
275
|
+
function OverflowMenu({ showInsights, insightsActive, onInsightsClick, reports, onReportSelect, onShare, onExport }) {
|
|
276
|
+
const { t } = (0, LanguageContext_1.useLanguage)();
|
|
277
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(ui_1.DropdownMenuTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("button", { type: "button", className: (0, utils_1.cn)('w-7 h-7 rounded-md flex items-center justify-center transition-colors', 'text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]'), title: t('More'), children: (0, jsx_runtime_1.jsx)(lucide_react_1.MoreHorizontal, { className: "w-4 h-4" }) }) }), (0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuContent, { align: "end", className: "w-52 [&_[role=menuitem]]:cursor-pointer", children: [showInsights && ((0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuItem, { onClick: onInsightsClick, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Lightbulb, { className: (0, utils_1.cn)('w-4 h-4 mr-2', insightsActive && 'text-[rgb(var(--color-warning))]') }), t('Sahay Insights')] })), reports.length > 0 && ((0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuSub, { children: [(0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuSubTrigger, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.FileBarChart, { className: "w-4 h-4 mr-2" }), t('Reports')] }), (0, jsx_runtime_1.jsx)(ui_1.DropdownMenuSubContent, { children: reports.map((report) => ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenuItem, { onClick: () => onReportSelect?.(report.value), children: report.label }, report.value))) })] })), onShare && ((0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuItem, { onClick: onShare, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Share2, { className: "w-4 h-4 mr-2" }), t('Share')] })), onExport && ((0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuSub, { children: [(0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuSubTrigger, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.FileOutput, { className: "w-4 h-4 mr-2" }), t('Export')] }), (0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuSubContent, { children: [(0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuItem, { onClick: () => onExport('print'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Printer, { className: "w-4 h-4 mr-2" }), t('Print')] }), (0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuItem, { onClick: () => onExport('excel'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.FileSpreadsheet, { className: "w-4 h-4 mr-2" }), t('Excel')] }), (0, jsx_runtime_1.jsxs)(ui_1.DropdownMenuItem, { onClick: () => onExport('pdf'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.FileText, { className: "w-4 h-4 mr-2" }), t('PDF')] })] })] }))] })] }));
|
|
278
|
+
}
|
|
279
|
+
function ForecastControl({ forecast, onForecastChange, timeFilter, onTimeFilterChange, bare = false }) {
|
|
280
|
+
const { t } = (0, LanguageContext_1.useLanguage)();
|
|
281
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
282
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
283
|
+
const limits = FORECAST_PERIOD_LIMITS[timeFilter];
|
|
284
|
+
const horizonLimits = FORECAST_HORIZON_LIMITS[timeFilter];
|
|
285
|
+
(0, react_1.useEffect)(() => {
|
|
286
|
+
const period = Math.min(limits.max, Math.max(limits.min, forecast.period));
|
|
287
|
+
const horizon = Math.min(horizonLimits.max, Math.max(horizonLimits.min, forecast.horizon));
|
|
288
|
+
if (period !== forecast.period || horizon !== forecast.horizon) {
|
|
289
|
+
onForecastChange({ ...forecast, period, horizon });
|
|
290
|
+
}
|
|
291
|
+
}, [timeFilter]);
|
|
292
|
+
const setPeriod = (p) => {
|
|
293
|
+
onForecastChange({ ...forecast, period: Math.min(limits.max, Math.max(limits.min, p)) });
|
|
294
|
+
};
|
|
295
|
+
const setHorizon = (h) => {
|
|
296
|
+
onForecastChange({ ...forecast, horizon: Math.min(horizonLimits.max, Math.max(horizonLimits.min, h)) });
|
|
297
|
+
};
|
|
298
|
+
const activeMethod = exports.FORECAST_METHODS.find(m => m.value === forecast.method);
|
|
299
|
+
(0, react_1.useEffect)(() => {
|
|
300
|
+
if (!open)
|
|
301
|
+
return;
|
|
302
|
+
const handleClickOutside = (e) => {
|
|
303
|
+
const target = e.target;
|
|
304
|
+
if (target?.closest?.('[data-radix-popper-content-wrapper],[role="listbox"]'))
|
|
305
|
+
return;
|
|
306
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
307
|
+
setOpen(false);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
const handleEscape = (e) => {
|
|
311
|
+
if (e.key === 'Escape')
|
|
312
|
+
setOpen(false);
|
|
313
|
+
};
|
|
314
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
315
|
+
document.addEventListener('keydown', handleEscape);
|
|
316
|
+
return () => {
|
|
317
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
318
|
+
document.removeEventListener('keydown', handleEscape);
|
|
319
|
+
};
|
|
320
|
+
}, [open]);
|
|
321
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", ref: containerRef, children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setOpen(!open), className: (0, utils_1.cn)('flex items-center justify-center transition-colors relative', bare ? 'w-7 h-7 rounded-md' : 'w-8 h-8 rounded-md border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-surface))]', open
|
|
322
|
+
? 'bg-[rgb(var(--color-primary))] text-white shadow-sm'
|
|
323
|
+
: bare
|
|
324
|
+
? 'text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]'
|
|
325
|
+
: 'text-[rgb(var(--fg-muted))] hover:bg-[rgb(var(--bg-subtle))] hover:border-[rgb(var(--color-primary))] hover:text-[rgb(var(--color-primary))]'), title: t('Forecast'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-4 h-4" }), forecast.enabled && !open && ((0, jsx_runtime_1.jsx)("span", { className: "absolute -top-1 -right-1 w-2 h-2 bg-[rgb(var(--color-primary))] rounded-full" }))] }), open && ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)('absolute top-full right-0 mt-2 z-50 w-96 max-w-[calc(100vw-2rem)]', 'bg-[rgb(var(--bg-surface))] rounded-xl shadow-xl border border-[rgb(var(--bd-default))]', 'overflow-hidden'), children: [(0, jsx_runtime_1.jsxs)("div", { className: "px-3 py-2 border-b border-[rgb(var(--bd-default))] flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-semibold text-[rgb(var(--fg-default))] shrink-0", children: t('Forecast') }), onTimeFilterChange ? ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { options: TIME_FILTER_OPTIONS.map(o => ({ value: o.value, label: t(o.label) })), value: timeFilter, onValueChange: (v) => onTimeFilterChange(v), searchable: false, size: "sm", triggerClassName: "h-6 text-[11px] min-w-[6.5rem]" })) : ((0, jsx_runtime_1.jsxs)("span", { className: "text-[10px] text-[rgb(var(--fg-muted))]", children: ["\u00B7 ", t(timeFilter)] }))] }), (0, jsx_runtime_1.jsx)(ui_1.Switch, { checked: forecast.enabled, onCheckedChange: (enabled) => onForecastChange({ ...forecast, enabled }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)('p-3 space-y-3', !forecast.enabled && 'opacity-50 pointer-events-none'), children: [(0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: exports.FORECAST_METHODS.map(m => ({ id: m.value, label: t(m.label) })), activeTab: forecast.method, onTabChange: (tabId) => onForecastChange({ ...forecast, method: tabId }), variant: "rounded", size: "sm", fullWidth: true }), activeMethod && ((0, jsx_runtime_1.jsx)("p", { className: "text-[10px] text-[rgb(var(--fg-muted))]", children: t(activeMethod.hint) })), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-[10px] font-semibold text-[rgb(var(--fg-muted))] uppercase tracking-wider mb-1 block", children: t('Based On Last') }), (0, jsx_runtime_1.jsx)(Stepper, { value: forecast.period, min: limits.min, max: limits.max, onChange: setPeriod }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-[10px] text-[rgb(var(--fg-muted))] truncate", children: resolvePeriodRange(timeFilter, forecast.period, -1) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-[10px] font-semibold text-[rgb(var(--fg-muted))] uppercase tracking-wider mb-1 block", children: t('Forecast Ahead') }), (0, jsx_runtime_1.jsx)(Stepper, { value: forecast.horizon, min: horizonLimits.min, max: horizonLimits.max, onChange: setHorizon }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-[10px] text-[rgb(var(--fg-muted))] truncate", children: resolvePeriodRange(timeFilter, forecast.horizon, 1) })] })] })] })] }))] }));
|
|
326
|
+
}
|
|
327
|
+
function FilterBar({ title, contextLabel, secondaryToggle, timeFilter = 'Week', onTimeFilterChange, timeFilterSelection, onTimeFilterSelectionChange, hideTimeFilter = false, filters = [], filterValues = {}, onFilterChange, dateFrom, dateTo, onDateFromChange, onDateToChange, onApply, onReset, reports = [], onReportSelect, onExport, hideFilterButton = false, hideDateRange = false, showApplyButton = false, forecast, onForecastChange, onShare, showInsights = false, insightsActive = false, onInsightsClick, children, className, layout = 'default', fiscalStartYear }) {
|
|
328
|
+
const [popoverOpen, setPopoverOpen] = (0, react_1.useState)(false);
|
|
329
|
+
const popoverRef = (0, react_1.useRef)(null);
|
|
330
|
+
const buttonRef = (0, react_1.useRef)(null);
|
|
331
|
+
const timeOptions = (0, react_1.useMemo)(() => (fiscalStartYear ? buildTimeOptions(fiscalStartYear) : TIME_FILTER_OPTIONS), [fiscalStartYear]);
|
|
332
|
+
// Handle click outside. Ignore clicks landing inside a portalled dropdown/select
|
|
333
|
+
// list (rendered to document.body, outside popoverRef) so selecting a filter
|
|
334
|
+
// option doesn't close this popover before the value commits.
|
|
335
|
+
(0, react_1.useEffect)(() => {
|
|
336
|
+
const handleClickOutside = (e) => {
|
|
337
|
+
const target = e.target;
|
|
338
|
+
if (target?.closest?.('[data-radix-popper-content-wrapper],[role="listbox"]'))
|
|
339
|
+
return;
|
|
340
|
+
if (popoverOpen &&
|
|
341
|
+
popoverRef.current &&
|
|
342
|
+
!popoverRef.current.contains(e.target) &&
|
|
343
|
+
buttonRef.current &&
|
|
344
|
+
!buttonRef.current.contains(e.target)) {
|
|
345
|
+
setPopoverOpen(false);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
349
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
350
|
+
}, [popoverOpen]);
|
|
351
|
+
// Handle escape key
|
|
352
|
+
(0, react_1.useEffect)(() => {
|
|
353
|
+
const handleEscape = (e) => {
|
|
354
|
+
if (e.key === 'Escape' && popoverOpen) {
|
|
355
|
+
setPopoverOpen(false);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
document.addEventListener('keydown', handleEscape);
|
|
359
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
360
|
+
}, [popoverOpen]);
|
|
361
|
+
const handleDateRangeChange = (0, react_1.useCallback)((value) => {
|
|
362
|
+
if (value && typeof value === 'object' && 'from' in value) {
|
|
363
|
+
const range = value;
|
|
364
|
+
onDateFromChange?.(range.from);
|
|
365
|
+
onDateToChange?.(range.to);
|
|
366
|
+
}
|
|
367
|
+
}, [onDateFromChange, onDateToChange]);
|
|
368
|
+
const handleReset = () => {
|
|
369
|
+
onDateFromChange?.(undefined);
|
|
370
|
+
onDateToChange?.(undefined);
|
|
371
|
+
onReset?.();
|
|
372
|
+
};
|
|
373
|
+
const hasActiveFilters = Object.values(filterValues).some(v => v && v.length > 0) || dateFrom || dateTo;
|
|
374
|
+
const dateRangeValue = { from: dateFrom, to: dateTo };
|
|
375
|
+
// Centered layout: Title in center, controls on left and right
|
|
376
|
+
if (layout === 'centered') {
|
|
377
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('bg-[rgb(var(--bg-surface))] border-b border-[rgb(var(--bd-default))]', className), children: (0, jsx_runtime_1.jsx)("div", { className: "px-4 py-3 lg:px-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [secondaryToggle && ((0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: secondaryToggle.options.map(opt => ({ id: opt.value, label: opt.label })), activeTab: secondaryToggle.value, onTabChange: secondaryToggle.onChange, size: "sm" })), !hideTimeFilter && ((0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: timeOptions.map(opt => ({ id: opt.value, label: opt.label, dropdownOptions: opt.dropdownOptions, quickOptions: opt.quickOptions })), activeTab: timeFilter, onTabChange: (tabId) => onTimeFilterChange?.(tabId), variant: "rounded", size: "sm", dropdownValues: {
|
|
378
|
+
Day: timeFilterSelection?.days || [],
|
|
379
|
+
Week: timeFilterSelection?.weeks || [],
|
|
380
|
+
Month: timeFilterSelection?.months || [],
|
|
381
|
+
Quarter: timeFilterSelection?.quarters || [],
|
|
382
|
+
Year: timeFilterSelection?.years || [],
|
|
383
|
+
}, onDropdownChange: (tabId, selectedValues) => {
|
|
384
|
+
const filter = tabId;
|
|
385
|
+
const newSelection = {
|
|
386
|
+
type: filter,
|
|
387
|
+
...(filter === 'Day' && { days: selectedValues }),
|
|
388
|
+
...(filter === 'Week' && { weeks: selectedValues }),
|
|
389
|
+
...(filter === 'Month' && { months: selectedValues }),
|
|
390
|
+
...(filter === 'Quarter' && { quarters: selectedValues }),
|
|
391
|
+
...(filter === 'Year' && { years: selectedValues }),
|
|
392
|
+
};
|
|
393
|
+
onTimeFilterSelectionChange?.(newSelection);
|
|
394
|
+
} }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 text-center", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-sm font-semibold text-[rgb(var(--fg-default))]", children: title }), contextLabel && ((0, jsx_runtime_1.jsx)("span", { className: "text-xs text-[rgb(var(--fg-muted))]", children: contextLabel }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [!hideFilterButton && ((0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("button", { ref: buttonRef, onClick: () => setPopoverOpen(!popoverOpen), className: (0, utils_1.cn)('w-8 h-8 rounded-md flex items-center justify-center transition-colors relative', 'border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-surface))]', 'text-[rgb(var(--fg-muted))] hover:bg-[rgb(var(--bg-subtle))] hover:border-[rgb(var(--color-primary))] hover:text-[rgb(var(--color-primary))]', popoverOpen && 'bg-[rgb(var(--color-primary))] text-white border-[rgb(var(--color-primary))] hover:bg-[rgb(var(--color-primary))]'), title: "Filters", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ListFilter, { className: "w-4 h-4" }), hasActiveFilters && !popoverOpen && ((0, jsx_runtime_1.jsx)("span", { className: "absolute -top-1 -right-1 w-2 h-2 bg-[rgb(var(--color-primary))] rounded-full" }))] }), popoverOpen && ((0, jsx_runtime_1.jsxs)("div", { ref: popoverRef, className: (0, utils_1.cn)('absolute top-full right-0 mt-2 z-50', 'w-[95vw] sm:w-auto', 'bg-[rgb(var(--bg-surface))] rounded-xl shadow-xl border border-[rgb(var(--bd-default))]', 'overflow-hidden'), children: [(0, jsx_runtime_1.jsxs)("div", { className: "px-3 py-2 border-b border-[rgb(var(--bd-default))] flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-semibold text-[rgb(var(--fg-default))]", children: "Filters" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setPopoverOpen(false), className: "w-5 h-5 rounded flex items-center justify-center hover:bg-[rgb(var(--bg-subtle))] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-3 h-3 text-[rgb(var(--fg-muted))]" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 space-y-3", children: [filters.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-3", style: { gridTemplateColumns: `repeat(${filters.length}, minmax(140px, 1fr))` }, children: filters.map((filter) => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-[10px] font-semibold text-[rgb(var(--fg-muted))] uppercase tracking-wider mb-1 block", children: filter.label }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { options: filter.options, multiSelect: filter.type === 'multiselect', value: filterValues[filter.id] ?? (filter.type === 'multiselect' ? [] : ''), onValueChange: (value) => onFilterChange?.(filter.id, value), placeholder: filter.placeholder || `All ${filter.label}s`, searchable: true, className: "w-full" })] }, filter.id))) })), children, !hideDateRange && ((0, jsx_runtime_1.jsx)(date_picker_1.DatePicker, { mode: "range", value: dateRangeValue, onChange: handleDateRangeChange, inline: true }))] })] }))] })), forecast && onForecastChange && ((0, jsx_runtime_1.jsx)(ForecastControl, { forecast: forecast, onForecastChange: onForecastChange, timeFilter: timeFilter, onTimeFilterChange: onTimeFilterChange })), showApplyButton && ((0, jsx_runtime_1.jsx)("button", { onClick: onApply, className: (0, utils_1.cn)('h-8 px-4 rounded-md flex items-center gap-1.5', 'bg-[rgb(var(--color-primary))] text-white', 'text-xs font-semibold', 'shadow-sm hover:shadow-md transition-all', 'hover:brightness-110'), children: "Apply" })), (reports.length > 0 || onShare || onExport) && ((0, jsx_runtime_1.jsx)(OverflowMenu, { reports: reports, onReportSelect: onReportSelect, onShare: onShare, onExport: onExport }))] })] }) }) }));
|
|
395
|
+
}
|
|
396
|
+
// Default layout: Title centered, controls on right
|
|
397
|
+
return ((0, jsx_runtime_1.jsxs)("header", { className: (0, utils_1.cn)('bg-[rgb(var(--bg-surface))] border-b border-[rgb(var(--bd-default))]', 'px-4 py-3 lg:px-6', className), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0 flex items-center gap-2.5", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base sm:text-xl font-bold text-[rgb(var(--fg-default))] leading-tight truncate", children: title }), contextLabel && ((0, jsx_runtime_1.jsxs)("span", { className: "hidden sm:inline-flex items-center gap-1.5 shrink-0 h-6 px-2.5 rounded-full border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-subtle))] text-xs font-medium text-[rgb(var(--fg-muted))]", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CalendarDays, { className: "w-3.5 h-3.5" }), contextLabel] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [secondaryToggle && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "hidden sm:block", children: (0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: secondaryToggle.options.map(opt => ({ id: opt.value, label: opt.label })), activeTab: secondaryToggle.value, onTabChange: secondaryToggle.onChange, size: "sm" }) }), (0, jsx_runtime_1.jsx)("div", { className: "hidden sm:block h-4 w-px bg-[rgb(var(--bd-default))] self-center" })] })), !hideTimeFilter && ((0, jsx_runtime_1.jsx)("div", { className: "hidden sm:block", children: (0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: timeOptions.map(opt => ({ id: opt.value, label: opt.label, dropdownOptions: opt.dropdownOptions, quickOptions: opt.quickOptions })), activeTab: timeFilter, onTabChange: (tabId) => onTimeFilterChange?.(tabId), variant: "rounded", size: "sm", dropdownValues: {
|
|
398
|
+
Day: timeFilterSelection?.days || [],
|
|
399
|
+
Week: timeFilterSelection?.weeks || [],
|
|
400
|
+
Month: timeFilterSelection?.months || [],
|
|
401
|
+
Quarter: timeFilterSelection?.quarters || [],
|
|
402
|
+
Year: timeFilterSelection?.years || [],
|
|
403
|
+
}, onDropdownChange: (tabId, selectedValues) => {
|
|
404
|
+
const filter = tabId;
|
|
405
|
+
const newSelection = {
|
|
406
|
+
type: filter,
|
|
407
|
+
...(filter === 'Day' && { days: selectedValues }),
|
|
408
|
+
...(filter === 'Week' && { weeks: selectedValues }),
|
|
409
|
+
...(filter === 'Month' && { months: selectedValues }),
|
|
410
|
+
...(filter === 'Quarter' && { quarters: selectedValues }),
|
|
411
|
+
...(filter === 'Year' && { years: selectedValues }),
|
|
412
|
+
};
|
|
413
|
+
onTimeFilterSelectionChange?.(newSelection);
|
|
414
|
+
} }) })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-0.5 rounded-lg border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-surface))] p-0.5", children: [!hideFilterButton && ((0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("button", { ref: buttonRef, onClick: () => setPopoverOpen(!popoverOpen), className: (0, utils_1.cn)('w-7 h-7 rounded-md flex items-center justify-center transition-colors relative', popoverOpen
|
|
415
|
+
? 'bg-[rgb(var(--color-primary))] text-white shadow-sm'
|
|
416
|
+
: 'text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]'), title: "Filters", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ListFilter, { className: "w-4 h-4" }), hasActiveFilters && !popoverOpen && ((0, jsx_runtime_1.jsx)("span", { className: "absolute -top-1 -right-1 w-2 h-2 bg-[rgb(var(--color-primary))] rounded-full" }))] }), popoverOpen && ((0, jsx_runtime_1.jsxs)("div", { ref: popoverRef, className: (0, utils_1.cn)('absolute top-full right-0 mt-2 z-50', 'w-[95vw] sm:w-auto', 'bg-[rgb(var(--bg-surface))] rounded-xl shadow-xl border border-[rgb(var(--bd-default))]', 'overflow-hidden'), children: [(0, jsx_runtime_1.jsxs)("div", { className: "px-3 py-2 border-b border-[rgb(var(--bd-default))] flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-semibold text-[rgb(var(--fg-default))]", children: "Filters" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setPopoverOpen(false), className: "w-5 h-5 rounded flex items-center justify-center hover:bg-[rgb(var(--bg-subtle))] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-3 h-3 text-[rgb(var(--fg-muted))]" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 space-y-3", children: [filters.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-3", style: { gridTemplateColumns: `repeat(${Math.min(filters.length, 3)}, minmax(140px, 1fr))` }, children: filters.map((filter) => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-[10px] font-semibold text-[rgb(var(--fg-muted))] uppercase tracking-wider mb-1 block", children: filter.label }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { options: filter.options, multiSelect: filter.type === 'multiselect', value: filterValues[filter.id] ?? (filter.type === 'multiselect' ? [] : ''), onValueChange: (value) => onFilterChange?.(filter.id, value), placeholder: filter.placeholder || `All ${filter.label}s`, searchable: true, className: "w-full" })] }, filter.id))) })), children, !hideDateRange && ((0, jsx_runtime_1.jsx)(date_picker_1.DatePicker, { mode: "range", value: dateRangeValue, onChange: handleDateRangeChange, inline: true }))] })] }))] })), forecast && onForecastChange && ((0, jsx_runtime_1.jsx)(ForecastControl, { forecast: forecast, onForecastChange: onForecastChange, timeFilter: timeFilter, onTimeFilterChange: onTimeFilterChange, bare: true })), (showInsights || reports.length > 0 || onShare || onExport) && ((0, jsx_runtime_1.jsx)(OverflowMenu, { showInsights: showInsights, insightsActive: insightsActive, onInsightsClick: onInsightsClick, reports: reports, onReportSelect: onReportSelect, onShare: onShare, onExport: onExport }))] }), showApplyButton && ((0, jsx_runtime_1.jsx)("button", { onClick: onApply, className: (0, utils_1.cn)('h-8 px-4 rounded-md flex items-center gap-1.5', 'bg-[rgb(var(--color-primary))] text-white', 'text-xs font-semibold', 'shadow-sm hover:shadow-md transition-all', 'hover:brightness-110'), children: "Apply" }))] })] }), contextLabel && ((0, jsx_runtime_1.jsxs)("span", { className: "sm:hidden mt-2 inline-flex items-center gap-1.5 h-6 px-2.5 rounded-full border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-subtle))] text-xs font-medium text-[rgb(var(--fg-muted))]", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CalendarDays, { className: "w-3.5 h-3.5" }), contextLabel] })), (!hideTimeFilter || secondaryToggle) && ((0, jsx_runtime_1.jsxs)("div", { className: "sm:hidden mt-2 flex items-center gap-2 overflow-x-auto", children: [secondaryToggle && ((0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: secondaryToggle.options.map(opt => ({ id: opt.value, label: opt.label })), activeTab: secondaryToggle.value, onTabChange: secondaryToggle.onChange, size: "sm" })), !hideTimeFilter && ((0, jsx_runtime_1.jsx)(tabs_1.Tabs, { tabs: timeOptions.map(opt => ({ id: opt.value, label: opt.label, dropdownOptions: opt.dropdownOptions, quickOptions: opt.quickOptions })), activeTab: timeFilter, onTabChange: (tabId) => onTimeFilterChange?.(tabId), variant: "rounded", size: "sm", dropdownValues: {
|
|
417
|
+
Day: timeFilterSelection?.days || [],
|
|
418
|
+
Week: timeFilterSelection?.weeks || [],
|
|
419
|
+
Month: timeFilterSelection?.months || [],
|
|
420
|
+
Quarter: timeFilterSelection?.quarters || [],
|
|
421
|
+
Year: timeFilterSelection?.years || [],
|
|
422
|
+
}, onDropdownChange: (tabId, selectedValues) => {
|
|
423
|
+
const filter = tabId;
|
|
424
|
+
const newSelection = {
|
|
425
|
+
type: filter,
|
|
426
|
+
...(filter === 'Day' && { days: selectedValues }),
|
|
427
|
+
...(filter === 'Week' && { weeks: selectedValues }),
|
|
428
|
+
...(filter === 'Month' && { months: selectedValues }),
|
|
429
|
+
...(filter === 'Quarter' && { quarters: selectedValues }),
|
|
430
|
+
...(filter === 'Year' && { years: selectedValues }),
|
|
431
|
+
};
|
|
432
|
+
onTimeFilterSelectionChange?.(newSelection);
|
|
433
|
+
} }))] }))] }));
|
|
434
|
+
}
|