indas-ui 0.0.1 → 0.1.1
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/index.js +19 -0
- package/dist/cjs/components/chat/multimodal-input.js +119 -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 +18 -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/index.d.ts +5 -0
- package/dist/components/chat/index.js +13 -0
- package/dist/components/chat/multimodal-input.d.ts +12 -0
- package/dist/components/chat/multimodal-input.js +116 -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 +35 -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 +10 -0
- package/dist/components/layout/index.js +7 -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 +187 -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,199 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
const DEFAULT_CONFIG = {
|
|
4
|
+
theme: 'auto',
|
|
5
|
+
autoDetectSystemTheme: true
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Hook for managing grid theme with system preference detection
|
|
9
|
+
* and persistent storage
|
|
10
|
+
*/
|
|
11
|
+
export function useGridTheme(initialConfig = {}) {
|
|
12
|
+
const config = { ...DEFAULT_CONFIG, ...initialConfig };
|
|
13
|
+
const [currentTheme, setCurrentTheme] = useState(() => {
|
|
14
|
+
if (typeof window === 'undefined')
|
|
15
|
+
return config.theme;
|
|
16
|
+
try {
|
|
17
|
+
const stored = localStorage.getItem('grid-theme');
|
|
18
|
+
return stored || config.theme;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return config.theme;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const [systemTheme, setSystemTheme] = useState(() => {
|
|
25
|
+
if (typeof window === 'undefined')
|
|
26
|
+
return 'light';
|
|
27
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
28
|
+
});
|
|
29
|
+
// Detect system theme changes
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!config.autoDetectSystemTheme || typeof window === 'undefined')
|
|
32
|
+
return;
|
|
33
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
34
|
+
const handleChange = (e) => {
|
|
35
|
+
setSystemTheme(e.matches ? 'dark' : 'light');
|
|
36
|
+
};
|
|
37
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
38
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
39
|
+
}, [config.autoDetectSystemTheme]);
|
|
40
|
+
// Determine the actual theme to apply
|
|
41
|
+
const resolvedTheme = currentTheme === 'auto' ? systemTheme : currentTheme;
|
|
42
|
+
// Apply theme to document
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (typeof document === 'undefined')
|
|
45
|
+
return;
|
|
46
|
+
// Set theme attribute on document root
|
|
47
|
+
document.documentElement.setAttribute('data-theme', resolvedTheme);
|
|
48
|
+
// Also set a class for easier CSS targeting
|
|
49
|
+
document.documentElement.className = document.documentElement.className
|
|
50
|
+
.replace(/theme-\w+/g, '')
|
|
51
|
+
.concat(` theme-${resolvedTheme}`)
|
|
52
|
+
.trim();
|
|
53
|
+
// Store preference
|
|
54
|
+
try {
|
|
55
|
+
localStorage.setItem('grid-theme', currentTheme);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Ignore localStorage errors
|
|
59
|
+
}
|
|
60
|
+
}, [currentTheme, resolvedTheme]);
|
|
61
|
+
// Apply custom colors
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!config.customColors || typeof document === 'undefined')
|
|
64
|
+
return;
|
|
65
|
+
const root = document.documentElement;
|
|
66
|
+
if (config.customColors) {
|
|
67
|
+
Object.entries(config.customColors).forEach(([property, value]) => {
|
|
68
|
+
root.style.setProperty(`--grid-${property}`, value);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return () => {
|
|
72
|
+
// Cleanup custom properties
|
|
73
|
+
if (config.customColors) {
|
|
74
|
+
Object.keys(config.customColors).forEach(property => {
|
|
75
|
+
root.style.removeProperty(`--grid-${property}`);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}, [config.customColors]);
|
|
80
|
+
// Change theme
|
|
81
|
+
const setTheme = useCallback((newTheme) => {
|
|
82
|
+
setCurrentTheme(newTheme);
|
|
83
|
+
}, []);
|
|
84
|
+
// Toggle between light and dark
|
|
85
|
+
const toggleTheme = useCallback(() => {
|
|
86
|
+
setCurrentTheme(current => {
|
|
87
|
+
if (current === 'auto') {
|
|
88
|
+
return systemTheme === 'light' ? 'dark' : 'light';
|
|
89
|
+
}
|
|
90
|
+
return current === 'light' ? 'dark' : 'light';
|
|
91
|
+
});
|
|
92
|
+
}, [systemTheme]);
|
|
93
|
+
// Reset to auto/system theme
|
|
94
|
+
const resetToSystemTheme = useCallback(() => {
|
|
95
|
+
setCurrentTheme('auto');
|
|
96
|
+
}, []);
|
|
97
|
+
// Get CSS custom properties for the current theme
|
|
98
|
+
const getThemeProperties = useCallback(() => {
|
|
99
|
+
if (typeof window === 'undefined')
|
|
100
|
+
return {};
|
|
101
|
+
const computedStyle = getComputedStyle(document.documentElement);
|
|
102
|
+
const properties = {};
|
|
103
|
+
// Extract all grid-related CSS variables
|
|
104
|
+
const rootStyle = document.documentElement.style;
|
|
105
|
+
for (let i = 0; i < rootStyle.length; i++) {
|
|
106
|
+
const property = rootStyle[i];
|
|
107
|
+
if (property.startsWith('--grid-')) {
|
|
108
|
+
properties[property] = computedStyle.getPropertyValue(property).trim();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return properties;
|
|
112
|
+
}, []);
|
|
113
|
+
// Apply custom color overrides
|
|
114
|
+
const setCustomColors = useCallback((colors) => {
|
|
115
|
+
if (typeof document === 'undefined')
|
|
116
|
+
return;
|
|
117
|
+
const root = document.documentElement;
|
|
118
|
+
Object.entries(colors).forEach(([property, value]) => {
|
|
119
|
+
root.style.setProperty(`--grid-${property}`, value);
|
|
120
|
+
});
|
|
121
|
+
}, []);
|
|
122
|
+
// Clear custom color overrides
|
|
123
|
+
const clearCustomColors = useCallback(() => {
|
|
124
|
+
if (typeof document === 'undefined')
|
|
125
|
+
return;
|
|
126
|
+
const root = document.documentElement;
|
|
127
|
+
const style = root.style;
|
|
128
|
+
// Remove all custom grid properties
|
|
129
|
+
for (let i = style.length - 1; i >= 0; i--) {
|
|
130
|
+
const property = style[i];
|
|
131
|
+
if (property.startsWith('--grid-')) {
|
|
132
|
+
style.removeProperty(property);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, []);
|
|
136
|
+
// Check if system supports dark mode
|
|
137
|
+
const systemSupportsDarkMode = typeof window !== 'undefined' &&
|
|
138
|
+
window.matchMedia('(prefers-color-scheme: dark)').media !== 'not all';
|
|
139
|
+
// Get theme status information
|
|
140
|
+
const themeInfo = {
|
|
141
|
+
current: currentTheme,
|
|
142
|
+
resolved: resolvedTheme,
|
|
143
|
+
isAuto: currentTheme === 'auto',
|
|
144
|
+
isDark: resolvedTheme === 'dark',
|
|
145
|
+
isLight: resolvedTheme === 'light',
|
|
146
|
+
isHighContrast: resolvedTheme === 'high-contrast',
|
|
147
|
+
systemTheme,
|
|
148
|
+
systemSupportsDarkMode
|
|
149
|
+
};
|
|
150
|
+
return {
|
|
151
|
+
...themeInfo,
|
|
152
|
+
setTheme,
|
|
153
|
+
toggleTheme,
|
|
154
|
+
resetToSystemTheme,
|
|
155
|
+
getThemeProperties,
|
|
156
|
+
setCustomColors,
|
|
157
|
+
clearCustomColors
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
// Utility function to get theme-aware CSS classes
|
|
161
|
+
export function getThemeClasses(theme = 'auto') {
|
|
162
|
+
const classes = ['advanced-data-grid'];
|
|
163
|
+
if (theme !== 'auto') {
|
|
164
|
+
classes.push(`theme-${theme}`);
|
|
165
|
+
}
|
|
166
|
+
return classes.join(' ');
|
|
167
|
+
}
|
|
168
|
+
// Predefined theme configurations
|
|
169
|
+
export const THEME_PRESETS = {
|
|
170
|
+
default: {
|
|
171
|
+
theme: 'auto',
|
|
172
|
+
autoDetectSystemTheme: true
|
|
173
|
+
},
|
|
174
|
+
corporate: {
|
|
175
|
+
theme: 'light',
|
|
176
|
+
customColors: {
|
|
177
|
+
'accent-primary': '#1e40af',
|
|
178
|
+
'accent-secondary': '#1e3a8a',
|
|
179
|
+
'header-bg': '#f8fafc',
|
|
180
|
+
'border-primary': '#e2e8f0'
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
minimal: {
|
|
184
|
+
theme: 'light',
|
|
185
|
+
customColors: {
|
|
186
|
+
'border-primary': '#f1f5f9',
|
|
187
|
+
'header-bg': '#ffffff',
|
|
188
|
+
'bg-hover': '#fafafa'
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
vibrant: {
|
|
192
|
+
theme: 'dark',
|
|
193
|
+
customColors: {
|
|
194
|
+
'accent-primary': '#8b5cf6',
|
|
195
|
+
'accent-secondary': '#a78bfa',
|
|
196
|
+
'bg-selected': '#5b21b6'
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
let idCounter = 0;
|
|
4
|
+
export function useClientId(prefix = 'id') {
|
|
5
|
+
const [id, setId] = useState(`${prefix}-ssr`);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
setId(`${prefix}-${++idCounter}`);
|
|
8
|
+
}, [prefix]);
|
|
9
|
+
return id;
|
|
10
|
+
}
|
|
11
|
+
export function useUniqueId(prefix = 'id') {
|
|
12
|
+
const [id, setId] = useState(`${prefix}-ssr`);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setId(`${prefix}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`);
|
|
15
|
+
}, [prefix]);
|
|
16
|
+
return id;
|
|
17
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
export interface ColumnSizingConfig {
|
|
3
|
+
globalMinWidth?: number;
|
|
4
|
+
globalMaxWidth?: number;
|
|
5
|
+
paddingBuffer?: number;
|
|
6
|
+
sampleSize?: number;
|
|
7
|
+
enableIntelligentSizing?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ColumnSizeConstraints {
|
|
10
|
+
minWidth: number;
|
|
11
|
+
maxWidth: number;
|
|
12
|
+
contentWidth: number;
|
|
13
|
+
optimalWidth: number;
|
|
14
|
+
dataType?: 'text' | 'number' | 'date' | 'boolean' | 'array' | 'badge' | 'action';
|
|
15
|
+
variance?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Hook for intelligent column sizing based on content analysis
|
|
19
|
+
* Automatically calculates optimal column widths based on content
|
|
20
|
+
* MERGED: Best features from useAutoIntelligentSizing + useIntelligentColumnSizing
|
|
21
|
+
*/
|
|
22
|
+
export declare function useIntelligentColumnSizing<TData>(data: TData[], columns: ColumnDef<TData>[], config?: ColumnSizingConfig): {
|
|
23
|
+
enhancedColumns: ColumnDef<TData>[];
|
|
24
|
+
getColumnWidth: (columnId: string) => number;
|
|
25
|
+
getColumnConstraints: (columnId: string) => ColumnSizeConstraints | null;
|
|
26
|
+
getSizingSummary: () => Record<string, any>;
|
|
27
|
+
recalculateWidths: () => Record<string, any>;
|
|
28
|
+
autoResizeAllColumns: (table: any) => void;
|
|
29
|
+
smartResize: (columnId: string, table: any) => void;
|
|
30
|
+
columnAnalysis: {
|
|
31
|
+
[k: string]: ColumnSizeConstraints;
|
|
32
|
+
};
|
|
33
|
+
config: {
|
|
34
|
+
globalMinWidth: number;
|
|
35
|
+
globalMaxWidth: number;
|
|
36
|
+
paddingBuffer: number;
|
|
37
|
+
sampleSize: number;
|
|
38
|
+
enableIntelligentSizing: boolean;
|
|
39
|
+
};
|
|
40
|
+
stats: {
|
|
41
|
+
totalColumns: number;
|
|
42
|
+
avgOptimalWidth: number;
|
|
43
|
+
minWidth: number;
|
|
44
|
+
maxWidth: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Helper function to create a column with intelligent sizing options
|
|
49
|
+
*/
|
|
50
|
+
export declare function createIntelligentColumn<TData>(columnDef: ColumnDef<TData>, sizingOptions?: {
|
|
51
|
+
minWidth?: number;
|
|
52
|
+
maxWidth?: number;
|
|
53
|
+
priority?: 'compact' | 'comfortable' | 'spacious';
|
|
54
|
+
}): ColumnDef<TData>;
|
|
55
|
+
/**
|
|
56
|
+
* Preset configurations for common use cases
|
|
57
|
+
*/
|
|
58
|
+
export declare const COLUMN_SIZING_PRESETS: {
|
|
59
|
+
readonly compact: {
|
|
60
|
+
readonly globalMinWidth: 20;
|
|
61
|
+
readonly globalMaxWidth: 200;
|
|
62
|
+
readonly paddingBuffer: 4;
|
|
63
|
+
readonly sampleSize: 50;
|
|
64
|
+
};
|
|
65
|
+
readonly standard: {
|
|
66
|
+
readonly globalMinWidth: 30;
|
|
67
|
+
readonly globalMaxWidth: 300;
|
|
68
|
+
readonly paddingBuffer: 4;
|
|
69
|
+
readonly sampleSize: 100;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMemo, useCallback } from 'react';
|
|
3
|
+
const DEFAULT_CONFIG = {
|
|
4
|
+
globalMinWidth: 30, // Very small - will be overridden by content
|
|
5
|
+
globalMaxWidth: 300, // Maximum column width
|
|
6
|
+
paddingBuffer: 4, // Extra padding buffer
|
|
7
|
+
sampleSize: 100, // Sample first 100 rows for performance
|
|
8
|
+
enableIntelligentSizing: true
|
|
9
|
+
};
|
|
10
|
+
// Internal defaults for calculations
|
|
11
|
+
const CALCULATION_DEFAULTS = {
|
|
12
|
+
characterWidth: 7, // Average character width for 12px font (text-xs)
|
|
13
|
+
headerPadding: 8, // 4px left + 4px right (matches px-1 in CSS)
|
|
14
|
+
cellPadding: 8, // 4px left + 4px right (matches px-1 in CSS)
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Hook for intelligent column sizing based on content analysis
|
|
18
|
+
* Automatically calculates optimal column widths based on content
|
|
19
|
+
* MERGED: Best features from useAutoIntelligentSizing + useIntelligentColumnSizing
|
|
20
|
+
*/
|
|
21
|
+
export function useIntelligentColumnSizing(data, columns, config = {}) {
|
|
22
|
+
const finalConfig = { ...DEFAULT_CONFIG, ...config };
|
|
23
|
+
// Smart content analyzer - detects data type and calculates optimal width
|
|
24
|
+
const analyzeContent = useCallback((columnId, sampleData) => {
|
|
25
|
+
const values = sampleData.map(row => row[columnId]).filter(v => v !== null && v !== undefined);
|
|
26
|
+
if (values.length === 0) {
|
|
27
|
+
return {
|
|
28
|
+
dataType: 'text',
|
|
29
|
+
widths: [80], // Default fallback
|
|
30
|
+
avgLength: 0
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Smart type detection
|
|
34
|
+
let dataType = 'text';
|
|
35
|
+
const widths = [];
|
|
36
|
+
values.forEach(value => {
|
|
37
|
+
let displayText = '';
|
|
38
|
+
let detectedType = 'text';
|
|
39
|
+
if (typeof value === 'number') {
|
|
40
|
+
detectedType = 'number';
|
|
41
|
+
// Smart number formatting detection
|
|
42
|
+
const formattedNumber = value.toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
43
|
+
if (columnId.toLowerCase().includes('salary') || columnId.toLowerCase().includes('price')) {
|
|
44
|
+
displayText = `$${formattedNumber}`;
|
|
45
|
+
}
|
|
46
|
+
else if (columnId.toLowerCase().includes('percent') || columnId.toLowerCase().includes('performance')) {
|
|
47
|
+
displayText = `${value}%`;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
displayText = formattedNumber;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else if (typeof value === 'boolean') {
|
|
54
|
+
detectedType = 'boolean';
|
|
55
|
+
displayText = value ? 'Yes' : 'No';
|
|
56
|
+
}
|
|
57
|
+
else if (Array.isArray(value)) {
|
|
58
|
+
detectedType = 'array';
|
|
59
|
+
displayText = value.length > 2 ? `${value.slice(0, 2).join(', ')} +${value.length - 2}` : value.join(', ');
|
|
60
|
+
}
|
|
61
|
+
else if (typeof value === 'string') {
|
|
62
|
+
// Smart string type detection
|
|
63
|
+
if (value.match(/^\d{4}-\d{2}-\d{2}/)) {
|
|
64
|
+
detectedType = 'date';
|
|
65
|
+
}
|
|
66
|
+
else if (value.length < 20 && ['active', 'inactive', 'pending', 'approved', 'rejected', 'admin', 'user', 'manager'].includes(value.toLowerCase())) {
|
|
67
|
+
detectedType = 'badge';
|
|
68
|
+
}
|
|
69
|
+
displayText = String(value);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
displayText = String(value);
|
|
73
|
+
}
|
|
74
|
+
// Calculate display width (8px per character average + smart type-based adjustments)
|
|
75
|
+
let pixelWidth = displayText.length * CALCULATION_DEFAULTS.characterWidth;
|
|
76
|
+
// Smart adjustments based on content type
|
|
77
|
+
if (detectedType === 'number')
|
|
78
|
+
pixelWidth += 10; // Numbers need extra space for formatting
|
|
79
|
+
if (detectedType === 'badge')
|
|
80
|
+
pixelWidth += 20; // Badges have padding and borders
|
|
81
|
+
if (detectedType === 'array')
|
|
82
|
+
pixelWidth += 15; // Arrays have spacing between items
|
|
83
|
+
if (detectedType === 'date')
|
|
84
|
+
pixelWidth += 5; // Dates are consistent but need slight buffer
|
|
85
|
+
widths.push(pixelWidth);
|
|
86
|
+
// Set the most common type
|
|
87
|
+
if (dataType === 'text' || detectedType !== 'text') {
|
|
88
|
+
dataType = detectedType;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
dataType,
|
|
93
|
+
widths,
|
|
94
|
+
avgLength: widths.reduce((sum, w) => sum + w, 0) / widths.length
|
|
95
|
+
};
|
|
96
|
+
}, []);
|
|
97
|
+
// Intelligent analysis of all columns
|
|
98
|
+
const columnAnalysis = useMemo(() => {
|
|
99
|
+
if (!finalConfig.enableIntelligentSizing || !data.length) {
|
|
100
|
+
return new Map();
|
|
101
|
+
}
|
|
102
|
+
const analysis = new Map();
|
|
103
|
+
const sampleData = data.slice(0, Math.min(finalConfig.sampleSize, data.length));
|
|
104
|
+
columns.forEach(column => {
|
|
105
|
+
const columnId = column.id || column.accessorKey;
|
|
106
|
+
if (!columnId || columnId === 'select' || columnId === 'actions')
|
|
107
|
+
return;
|
|
108
|
+
// Get column configuration from meta
|
|
109
|
+
const columnMeta = column.meta;
|
|
110
|
+
const metaMinWidth = columnMeta?.minWidth;
|
|
111
|
+
const metaMaxWidth = columnMeta?.maxWidth;
|
|
112
|
+
// Calculate header text width
|
|
113
|
+
const headerText = typeof column.header === 'string' ? column.header : columnId;
|
|
114
|
+
const headerWidth = (headerText.length * CALCULATION_DEFAULTS.characterWidth) + CALCULATION_DEFAULTS.headerPadding;
|
|
115
|
+
// Analyze content with smart type detection
|
|
116
|
+
const contentAnalysis = analyzeContent(columnId, sampleData);
|
|
117
|
+
// Calculate content statistics
|
|
118
|
+
const maxContentWidth = Math.max(...contentAnalysis.widths, 0);
|
|
119
|
+
const avgContentWidth = contentAnalysis.avgLength;
|
|
120
|
+
const minContentWidth = Math.min(...contentAnalysis.widths, 0);
|
|
121
|
+
// Calculate variance (how much content size varies)
|
|
122
|
+
const variance = contentAnalysis.widths.length > 1
|
|
123
|
+
? Math.sqrt(contentAnalysis.widths.reduce((sum, w) => sum + Math.pow(w - avgContentWidth, 2), 0) / contentAnalysis.widths.length)
|
|
124
|
+
: 0;
|
|
125
|
+
// BALANCED LOGIC: Compare header vs content, use intelligent rules
|
|
126
|
+
// Calculate header-to-content ratio
|
|
127
|
+
const headerToContentRatio = headerWidth / Math.max(maxContentWidth, 1);
|
|
128
|
+
// Dynamic buffer based on content type
|
|
129
|
+
let contentBuffer;
|
|
130
|
+
if (contentAnalysis.dataType === 'badge' || contentAnalysis.dataType === 'boolean') {
|
|
131
|
+
contentBuffer = 15;
|
|
132
|
+
}
|
|
133
|
+
else if (contentAnalysis.dataType === 'number') {
|
|
134
|
+
contentBuffer = 25;
|
|
135
|
+
}
|
|
136
|
+
else if (contentAnalysis.dataType === 'date') {
|
|
137
|
+
contentBuffer = 20;
|
|
138
|
+
}
|
|
139
|
+
else if (variance > avgContentWidth * 0.5) {
|
|
140
|
+
contentBuffer = 35;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
contentBuffer = 30;
|
|
144
|
+
}
|
|
145
|
+
// Optimal width calculation with intelligent rules
|
|
146
|
+
let optimalWidth;
|
|
147
|
+
// Calculate base width from content
|
|
148
|
+
const baseContentWidth = variance > avgContentWidth * 0.5
|
|
149
|
+
? avgContentWidth + contentBuffer
|
|
150
|
+
: maxContentWidth + contentBuffer;
|
|
151
|
+
// Rule 1: If header is much wider than content (ratio > 1.8), use compromise
|
|
152
|
+
if (headerToContentRatio > 1.8) {
|
|
153
|
+
// Use 60% content + 40% header (let header wrap significantly)
|
|
154
|
+
optimalWidth = (baseContentWidth * 0.6) + (headerWidth * 0.4);
|
|
155
|
+
}
|
|
156
|
+
// Rule 2: If header is moderately wider (ratio 1.2-1.8), use balanced approach
|
|
157
|
+
else if (headerToContentRatio > 1.2) {
|
|
158
|
+
// Use 50% content + 50% header (balanced)
|
|
159
|
+
optimalWidth = (baseContentWidth * 0.5) + (headerWidth * 0.5);
|
|
160
|
+
}
|
|
161
|
+
// Rule 3: If content is wider or similar to header, use content
|
|
162
|
+
else {
|
|
163
|
+
// Use content width (header fits comfortably)
|
|
164
|
+
optimalWidth = baseContentWidth;
|
|
165
|
+
}
|
|
166
|
+
// Minimum width = reasonable minimum, not too cramped
|
|
167
|
+
const actualMinWidth = Math.max(minContentWidth + 20, finalConfig.globalMinWidth);
|
|
168
|
+
// Apply meta overrides if present
|
|
169
|
+
const finalMinWidth = metaMinWidth || actualMinWidth;
|
|
170
|
+
const finalMaxWidth = metaMaxWidth || finalConfig.globalMaxWidth;
|
|
171
|
+
// Final optimal width = content-based but capped at max
|
|
172
|
+
const finalWidth = Math.min(Math.max(finalMinWidth, optimalWidth), // At least minimum, prefer optimal
|
|
173
|
+
finalMaxWidth // But never exceed maximum
|
|
174
|
+
);
|
|
175
|
+
analysis.set(columnId, {
|
|
176
|
+
minWidth: finalMinWidth,
|
|
177
|
+
maxWidth: finalMaxWidth,
|
|
178
|
+
contentWidth: maxContentWidth,
|
|
179
|
+
optimalWidth: finalWidth,
|
|
180
|
+
dataType: contentAnalysis.dataType,
|
|
181
|
+
variance
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
return analysis;
|
|
185
|
+
}, [data, columns, finalConfig, analyzeContent]);
|
|
186
|
+
// Get optimal width for a specific column
|
|
187
|
+
const getColumnWidth = useCallback((columnId) => {
|
|
188
|
+
const analysis = columnAnalysis.get(columnId);
|
|
189
|
+
return analysis?.optimalWidth || finalConfig.globalMinWidth;
|
|
190
|
+
}, [columnAnalysis, finalConfig.globalMinWidth]);
|
|
191
|
+
// Get sizing constraints for a column
|
|
192
|
+
const getColumnConstraints = useCallback((columnId) => {
|
|
193
|
+
return columnAnalysis.get(columnId) || null;
|
|
194
|
+
}, [columnAnalysis]);
|
|
195
|
+
// Get sizing summary for debugging/monitoring
|
|
196
|
+
const getSizingSummary = useCallback(() => {
|
|
197
|
+
const summary = {};
|
|
198
|
+
columnAnalysis.forEach((constraints, columnId) => {
|
|
199
|
+
summary[columnId] = {
|
|
200
|
+
optimal: constraints.optimalWidth,
|
|
201
|
+
min: constraints.minWidth,
|
|
202
|
+
max: constraints.maxWidth,
|
|
203
|
+
content: constraints.contentWidth,
|
|
204
|
+
type: constraints.dataType,
|
|
205
|
+
variance: constraints.variance
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
return summary;
|
|
209
|
+
}, [columnAnalysis]);
|
|
210
|
+
// Recalculate widths (useful when data changes)
|
|
211
|
+
const recalculateWidths = useCallback(() => {
|
|
212
|
+
return getSizingSummary();
|
|
213
|
+
}, [getSizingSummary]);
|
|
214
|
+
// Auto-resize all columns to optimal width
|
|
215
|
+
const autoResizeAllColumns = useCallback((table) => {
|
|
216
|
+
if (!table?.getAllColumns)
|
|
217
|
+
return;
|
|
218
|
+
const allColumns = table.getAllColumns();
|
|
219
|
+
allColumns.forEach((column) => {
|
|
220
|
+
const columnId = column.id;
|
|
221
|
+
const optimalWidth = getColumnWidth(columnId);
|
|
222
|
+
if (column.setSize) {
|
|
223
|
+
column.setSize(optimalWidth);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}, [getColumnWidth]);
|
|
227
|
+
// Smart resize based on content changes (single column)
|
|
228
|
+
const smartResize = useCallback((columnId, table) => {
|
|
229
|
+
const column = table?.getColumn?.(columnId);
|
|
230
|
+
if (!column?.setSize)
|
|
231
|
+
return;
|
|
232
|
+
const optimalWidth = getColumnWidth(columnId);
|
|
233
|
+
column.setSize(optimalWidth);
|
|
234
|
+
}, [getColumnWidth]);
|
|
235
|
+
// Apply intelligent sizing to column definitions
|
|
236
|
+
const enhancedColumns = useMemo(() => {
|
|
237
|
+
if (!finalConfig.enableIntelligentSizing) {
|
|
238
|
+
return columns;
|
|
239
|
+
}
|
|
240
|
+
return columns.map(column => {
|
|
241
|
+
const columnId = column.id || column.accessorKey;
|
|
242
|
+
if (!columnId)
|
|
243
|
+
return column;
|
|
244
|
+
const constraints = columnAnalysis.get(columnId);
|
|
245
|
+
if (!constraints)
|
|
246
|
+
return column;
|
|
247
|
+
return {
|
|
248
|
+
...column,
|
|
249
|
+
size: constraints.optimalWidth,
|
|
250
|
+
minSize: constraints.minWidth,
|
|
251
|
+
// maxSize intentionally not set here - allows users to drag columns wider than calculated optimal
|
|
252
|
+
// The calculated maxWidth is only used for auto-sizing, not for limiting manual resize
|
|
253
|
+
enableResizing: true
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
}, [columns, columnAnalysis, finalConfig]);
|
|
257
|
+
return {
|
|
258
|
+
// Enhanced columns with intelligent sizing
|
|
259
|
+
enhancedColumns,
|
|
260
|
+
// Utilities
|
|
261
|
+
getColumnWidth,
|
|
262
|
+
getColumnConstraints,
|
|
263
|
+
getSizingSummary,
|
|
264
|
+
recalculateWidths,
|
|
265
|
+
autoResizeAllColumns,
|
|
266
|
+
smartResize,
|
|
267
|
+
// Analysis data
|
|
268
|
+
columnAnalysis: Object.fromEntries(columnAnalysis),
|
|
269
|
+
// Configuration
|
|
270
|
+
config: finalConfig,
|
|
271
|
+
// Statistics
|
|
272
|
+
stats: {
|
|
273
|
+
totalColumns: columnAnalysis.size,
|
|
274
|
+
avgOptimalWidth: Array.from(columnAnalysis.values()).reduce((sum, c) => sum + c.optimalWidth, 0) / columnAnalysis.size || 0,
|
|
275
|
+
minWidth: Math.min(...Array.from(columnAnalysis.values()).map(c => c.optimalWidth), finalConfig.globalMaxWidth),
|
|
276
|
+
maxWidth: Math.max(...Array.from(columnAnalysis.values()).map(c => c.optimalWidth), finalConfig.globalMinWidth)
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Helper function to create a column with intelligent sizing options
|
|
282
|
+
*/
|
|
283
|
+
export function createIntelligentColumn(columnDef, sizingOptions) {
|
|
284
|
+
return {
|
|
285
|
+
...columnDef,
|
|
286
|
+
meta: {
|
|
287
|
+
...columnDef.meta,
|
|
288
|
+
minWidth: sizingOptions?.minWidth,
|
|
289
|
+
maxWidth: sizingOptions?.maxWidth,
|
|
290
|
+
priority: sizingOptions?.priority
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Preset configurations for common use cases
|
|
296
|
+
*/
|
|
297
|
+
export const COLUMN_SIZING_PRESETS = {
|
|
298
|
+
compact: {
|
|
299
|
+
globalMinWidth: 20,
|
|
300
|
+
globalMaxWidth: 200,
|
|
301
|
+
paddingBuffer: 4,
|
|
302
|
+
sampleSize: 50
|
|
303
|
+
},
|
|
304
|
+
standard: {
|
|
305
|
+
globalMinWidth: 30,
|
|
306
|
+
globalMaxWidth: 300,
|
|
307
|
+
paddingBuffer: 4,
|
|
308
|
+
sampleSize: 100
|
|
309
|
+
}
|
|
310
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Row } from '@tanstack/react-table';
|
|
2
|
+
interface NavigationPosition {
|
|
3
|
+
rowIndex: number;
|
|
4
|
+
columnIndex: number;
|
|
5
|
+
}
|
|
6
|
+
interface KeyboardNavigationOptions {
|
|
7
|
+
enableNavigation?: boolean;
|
|
8
|
+
enableCellEdit?: boolean;
|
|
9
|
+
onCellEdit?: (rowIndex: number, columnIndex: string) => void;
|
|
10
|
+
onCellSelect?: (rowIndex: number, columnIndex: string) => void;
|
|
11
|
+
onRowSelect?: (rowIndex: number, isMultiSelect: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Hook for keyboard navigation in data grids
|
|
15
|
+
* Supports arrow keys, Enter for editing, Space for selection
|
|
16
|
+
*/
|
|
17
|
+
export declare function useKeyboardNavigation<TData>(rows: Row<TData>[], columns: any[], options?: KeyboardNavigationOptions): {
|
|
18
|
+
containerRef: import("react").MutableRefObject<HTMLDivElement>;
|
|
19
|
+
focusedCell: NavigationPosition;
|
|
20
|
+
isEditing: boolean;
|
|
21
|
+
moveFocus: (rowIndex: number, columnIndex: number) => void;
|
|
22
|
+
startEditing: () => void;
|
|
23
|
+
stopEditing: () => void;
|
|
24
|
+
setFocusedCell: import("react").Dispatch<import("react").SetStateAction<NavigationPosition>>;
|
|
25
|
+
isCellFocused: (rowIndex: number, columnIndex: number) => boolean;
|
|
26
|
+
getCellProps: (rowIndex: number, columnIndex: number) => {
|
|
27
|
+
'data-row-index': number;
|
|
28
|
+
'data-column-index': number;
|
|
29
|
+
tabIndex: number;
|
|
30
|
+
className: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|