@gostack-framework/ui 0.0.0-stage → 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/NOTICE.md +5 -0
- package/dist/activity/index.d.ts +2 -0
- package/dist/activity/index.js +3 -0
- package/dist/activity/index.js.map +1 -0
- package/dist/clickup/common/InlineNameTab.d.ts +11 -0
- package/dist/clickup/common/InlineNameTab.js +50 -0
- package/dist/clickup/common/InlineNameTab.js.map +1 -0
- package/dist/clickup/common/TaskAssigneeAvatar.d.ts +14 -0
- package/dist/clickup/common/TaskAssigneeAvatar.js +32 -0
- package/dist/clickup/common/TaskAssigneeAvatar.js.map +1 -0
- package/dist/clickup/common/TaskBreadcrumb.d.ts +11 -0
- package/dist/clickup/common/TaskBreadcrumb.js +11 -0
- package/dist/clickup/common/TaskBreadcrumb.js.map +1 -0
- package/dist/clickup/common/TaskCheck.d.ts +10 -0
- package/dist/clickup/common/TaskCheck.js +17 -0
- package/dist/clickup/common/TaskCheck.js.map +1 -0
- package/dist/clickup/common/TaskContextMenu.d.ts +10 -0
- package/dist/clickup/common/TaskContextMenu.js +22 -0
- package/dist/clickup/common/TaskContextMenu.js.map +1 -0
- package/dist/clickup/common/TaskIcon.d.ts +29 -0
- package/dist/clickup/common/TaskIcon.js +30 -0
- package/dist/clickup/common/TaskIcon.js.map +1 -0
- package/dist/clickup/common/TaskPriorityBadge.d.ts +11 -0
- package/dist/clickup/common/TaskPriorityBadge.js +11 -0
- package/dist/clickup/common/TaskPriorityBadge.js.map +1 -0
- package/dist/clickup/common/TaskRowActionMenu.d.ts +6 -0
- package/dist/clickup/common/TaskRowActionMenu.js +10 -0
- package/dist/clickup/common/TaskRowActionMenu.js.map +1 -0
- package/dist/clickup/common/TaskStatusPill.d.ts +12 -0
- package/dist/clickup/common/TaskStatusPill.js +24 -0
- package/dist/clickup/common/TaskStatusPill.js.map +1 -0
- package/dist/clickup/common/WorkspaceButton.d.ts +3 -0
- package/dist/clickup/common/WorkspaceButton.js +8 -0
- package/dist/clickup/common/WorkspaceButton.js.map +1 -0
- package/dist/clickup/common/WorkspaceHeader.d.ts +9 -0
- package/dist/clickup/common/WorkspaceHeader.js +7 -0
- package/dist/clickup/common/WorkspaceHeader.js.map +1 -0
- package/dist/clickup/common/WorkspaceMenus.d.ts +17 -0
- package/dist/clickup/common/WorkspaceMenus.js +15 -0
- package/dist/clickup/common/WorkspaceMenus.js.map +1 -0
- package/dist/clickup/common/WorkspaceMessage.d.ts +7 -0
- package/dist/clickup/common/WorkspaceMessage.js +6 -0
- package/dist/clickup/common/WorkspaceMessage.js.map +1 -0
- package/dist/clickup/common/WorkspaceMetricStrip.d.ts +10 -0
- package/dist/clickup/common/WorkspaceMetricStrip.js +6 -0
- package/dist/clickup/common/WorkspaceMetricStrip.js.map +1 -0
- package/dist/clickup/common/WorkspacePanel.d.ts +7 -0
- package/dist/clickup/common/WorkspacePanel.js +7 -0
- package/dist/clickup/common/WorkspacePanel.js.map +1 -0
- package/dist/clickup/common/WorkspaceSelect.d.ts +5 -0
- package/dist/clickup/common/WorkspaceSelect.js +64 -0
- package/dist/clickup/common/WorkspaceSelect.js.map +1 -0
- package/dist/clickup/common/WorkspaceTable.d.ts +16 -0
- package/dist/clickup/common/WorkspaceTable.js +7 -0
- package/dist/clickup/common/WorkspaceTable.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpCommentComposer.d.ts +9 -0
- package/dist/clickup/dialogs/ClickUpCommentComposer.js +35 -0
- package/dist/clickup/dialogs/ClickUpCommentComposer.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskActions.d.ts +8 -0
- package/dist/clickup/dialogs/ClickUpTaskActions.js +10 -0
- package/dist/clickup/dialogs/ClickUpTaskActions.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskAssignee.d.ts +7 -0
- package/dist/clickup/dialogs/ClickUpTaskAssignee.js +12 -0
- package/dist/clickup/dialogs/ClickUpTaskAssignee.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskDescription.d.ts +12 -0
- package/dist/clickup/dialogs/ClickUpTaskDescription.js +12 -0
- package/dist/clickup/dialogs/ClickUpTaskDescription.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskDialog.d.ts +27 -0
- package/dist/clickup/dialogs/ClickUpTaskDialog.js +35 -0
- package/dist/clickup/dialogs/ClickUpTaskDialog.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskDiscussion.d.ts +11 -0
- package/dist/clickup/dialogs/ClickUpTaskDiscussion.js +29 -0
- package/dist/clickup/dialogs/ClickUpTaskDiscussion.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskMain.d.ts +24 -0
- package/dist/clickup/dialogs/ClickUpTaskMain.js +26 -0
- package/dist/clickup/dialogs/ClickUpTaskMain.js.map +1 -0
- package/dist/clickup/dialogs/ClickUpTaskProperties.d.ts +17 -0
- package/dist/clickup/dialogs/ClickUpTaskProperties.js +26 -0
- package/dist/clickup/dialogs/ClickUpTaskProperties.js.map +1 -0
- package/dist/clickup/elements/TaskCalendarCell.d.ts +14 -0
- package/dist/clickup/elements/TaskCalendarCell.js +19 -0
- package/dist/clickup/elements/TaskCalendarCell.js.map +1 -0
- package/dist/clickup/elements/TaskCard.d.ts +16 -0
- package/dist/clickup/elements/TaskCard.js +51 -0
- package/dist/clickup/elements/TaskCard.js.map +1 -0
- package/dist/clickup/elements/TaskGroup.d.ts +24 -0
- package/dist/clickup/elements/TaskGroup.js +50 -0
- package/dist/clickup/elements/TaskGroup.js.map +1 -0
- package/dist/clickup/elements/TaskRow.d.ts +19 -0
- package/dist/clickup/elements/TaskRow.js +60 -0
- package/dist/clickup/elements/TaskRow.js.map +1 -0
- package/dist/clickup/elements/TaskTableHead.d.ts +1 -0
- package/dist/clickup/elements/TaskTableHead.js +15 -0
- package/dist/clickup/elements/TaskTableHead.js.map +1 -0
- package/dist/clickup/elements/TaskTimelineRow.d.ts +12 -0
- package/dist/clickup/elements/TaskTimelineRow.js +16 -0
- package/dist/clickup/elements/TaskTimelineRow.js.map +1 -0
- package/dist/clickup/index.d.ts +41 -0
- package/dist/clickup/index.js +48 -0
- package/dist/clickup/index.js.map +1 -0
- package/dist/clickup/task-ui.css +864 -0
- package/dist/clickup/toolbar/TaskToolbar.d.ts +20 -0
- package/dist/clickup/toolbar/TaskToolbar.js +16 -0
- package/dist/clickup/toolbar/TaskToolbar.js.map +1 -0
- package/dist/clickup/toolbar/TaskViewPicker.d.ts +8 -0
- package/dist/clickup/toolbar/TaskViewPicker.js +48 -0
- package/dist/clickup/toolbar/TaskViewPicker.js.map +1 -0
- package/dist/clickup/toolbar/TaskViewSwitcher.d.ts +21 -0
- package/dist/clickup/toolbar/TaskViewSwitcher.js +55 -0
- package/dist/clickup/toolbar/TaskViewSwitcher.js.map +1 -0
- package/dist/clickup/types.d.ts +66 -0
- package/dist/clickup/types.js +2 -0
- package/dist/clickup/types.js.map +1 -0
- package/dist/clickup/views/TaskBoardView.d.ts +21 -0
- package/dist/clickup/views/TaskBoardView.js +75 -0
- package/dist/clickup/views/TaskBoardView.js.map +1 -0
- package/dist/clickup/views/TaskCalendarView.d.ts +12 -0
- package/dist/clickup/views/TaskCalendarView.js +197 -0
- package/dist/clickup/views/TaskCalendarView.js.map +1 -0
- package/dist/clickup/views/TaskGanttView.d.ts +12 -0
- package/dist/clickup/views/TaskGanttView.js +64 -0
- package/dist/clickup/views/TaskGanttView.js.map +1 -0
- package/dist/clickup/views/TaskListView.d.ts +22 -0
- package/dist/clickup/views/TaskListView.js +17 -0
- package/dist/clickup/views/TaskListView.js.map +1 -0
- package/dist/clickup/views/TaskTableView.d.ts +21 -0
- package/dist/clickup/views/TaskTableView.js +50 -0
- package/dist/clickup/views/TaskTableView.js.map +1 -0
- package/dist/components/ActivityFeed.d.ts +48 -0
- package/dist/components/ActivityFeed.js +60 -0
- package/dist/components/ActivityFeed.js.map +1 -0
- package/dist/components/AudioPlayer.d.ts +8 -0
- package/dist/components/AudioPlayer.js +96 -0
- package/dist/components/AudioPlayer.js.map +1 -0
- package/dist/components/BulkActionBar.d.ts +10 -0
- package/dist/components/BulkActionBar.js +10 -0
- package/dist/components/BulkActionBar.js.map +1 -0
- package/dist/components/Carousel.d.ts +8 -0
- package/dist/components/Carousel.js +38 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/ChatBot.d.ts +6 -0
- package/dist/components/ChatBot.js +52 -0
- package/dist/components/ChatBot.js.map +1 -0
- package/dist/components/CheckboxCustom.d.ts +9 -0
- package/dist/components/CheckboxCustom.js +42 -0
- package/dist/components/CheckboxCustom.js.map +1 -0
- package/dist/components/ClickUpTaskModal.d.ts +36 -0
- package/dist/components/ClickUpTaskModal.js +180 -0
- package/dist/components/ClickUpTaskModal.js.map +1 -0
- package/dist/components/ConditionBuilder.d.ts +28 -0
- package/dist/components/ConditionBuilder.js +63 -0
- package/dist/components/ConditionBuilder.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +21 -0
- package/dist/components/ConfirmDialog.js +51 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/DataCard.d.ts +43 -0
- package/dist/components/DataCard.js +30 -0
- package/dist/components/DataCard.js.map +1 -0
- package/dist/components/DataTable.d.ts +107 -0
- package/dist/components/DataTable.js +153 -0
- package/dist/components/DataTable.js.map +1 -0
- package/dist/components/DatePicker.d.ts +16 -0
- package/dist/components/DatePicker.js +184 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/EmptyState.d.ts +26 -0
- package/dist/components/EmptyState.js +37 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/Error.d.ts +12 -0
- package/dist/components/Error.js +41 -0
- package/dist/components/Error.js.map +1 -0
- package/dist/components/ErrorState.d.ts +10 -0
- package/dist/components/ErrorState.js +53 -0
- package/dist/components/ErrorState.js.map +1 -0
- package/dist/components/FileAttachmentChip.d.ts +10 -0
- package/dist/components/FileAttachmentChip.js +21 -0
- package/dist/components/FileAttachmentChip.js.map +1 -0
- package/dist/components/FilterConditionChip.d.ts +10 -0
- package/dist/components/FilterConditionChip.js +11 -0
- package/dist/components/FilterConditionChip.js.map +1 -0
- package/dist/components/GalleryCarouselDialog.d.ts +14 -0
- package/dist/components/GalleryCarouselDialog.js +167 -0
- package/dist/components/GalleryCarouselDialog.js.map +1 -0
- package/dist/components/HierarchicalSelectionMenu.d.ts +21 -0
- package/dist/components/HierarchicalSelectionMenu.js +168 -0
- package/dist/components/HierarchicalSelectionMenu.js.map +1 -0
- package/dist/components/InfiniteSelect.d.ts +44 -0
- package/dist/components/InfiniteSelect.js +121 -0
- package/dist/components/InfiniteSelect.js.map +1 -0
- package/dist/components/LoadingState.d.ts +28 -0
- package/dist/components/LoadingState.js +24 -0
- package/dist/components/LoadingState.js.map +1 -0
- package/dist/components/LucidIconRender.d.ts +9 -0
- package/dist/components/LucidIconRender.js +7 -0
- package/dist/components/LucidIconRender.js.map +1 -0
- package/dist/components/MasterDetailLayout.d.ts +67 -0
- package/dist/components/MasterDetailLayout.js +79 -0
- package/dist/components/MasterDetailLayout.js.map +1 -0
- package/dist/components/PinnedAttributeRow.d.ts +12 -0
- package/dist/components/PinnedAttributeRow.js +11 -0
- package/dist/components/PinnedAttributeRow.js.map +1 -0
- package/dist/components/PopUp.d.ts +11 -0
- package/dist/components/PopUp.js +83 -0
- package/dist/components/PopUp.js.map +1 -0
- package/dist/components/PrioritySignal.d.ts +10 -0
- package/dist/components/PrioritySignal.js +54 -0
- package/dist/components/PrioritySignal.js.map +1 -0
- package/dist/components/RichTextEditor.d.ts +7 -0
- package/dist/components/RichTextEditor.js +252 -0
- package/dist/components/RichTextEditor.js.map +1 -0
- package/dist/components/SLACountdown.d.ts +15 -0
- package/dist/components/SLACountdown.js +26 -0
- package/dist/components/SLACountdown.js.map +1 -0
- package/dist/components/StatusBadge.d.ts +14 -0
- package/dist/components/StatusBadge.js +55 -0
- package/dist/components/StatusBadge.js.map +1 -0
- package/dist/components/StatusCards.d.ts +12 -0
- package/dist/components/StatusCards.js +12 -0
- package/dist/components/StatusCards.js.map +1 -0
- package/dist/components/StatusProgressBar.d.ts +18 -0
- package/dist/components/StatusProgressBar.js +50 -0
- package/dist/components/StatusProgressBar.js.map +1 -0
- package/dist/components/TableActions.d.ts +26 -0
- package/dist/components/TableActions.js +49 -0
- package/dist/components/TableActions.js.map +1 -0
- package/dist/components/TaskDetailsModal.d.ts +3 -0
- package/dist/components/TaskDetailsModal.js +8 -0
- package/dist/components/TaskDetailsModal.js.map +1 -0
- package/dist/components/ThemedText.d.ts +24 -0
- package/dist/components/ThemedText.js +103 -0
- package/dist/components/ThemedText.js.map +1 -0
- package/dist/components/TicketWorkspaceLayout.d.ts +11 -0
- package/dist/components/TicketWorkspaceLayout.js +7 -0
- package/dist/components/TicketWorkspaceLayout.js.map +1 -0
- package/dist/components/TimePicker.d.ts +15 -0
- package/dist/components/TimePicker.js +96 -0
- package/dist/components/TimePicker.js.map +1 -0
- package/dist/components/Tooltip.d.ts +19 -0
- package/dist/components/Tooltip.js +75 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/TreeView.d.ts +33 -0
- package/dist/components/TreeView.js +55 -0
- package/dist/components/TreeView.js.map +1 -0
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +18 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +23 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +44 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +47 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.d.ts +11 -0
- package/dist/components/card.js +25 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/context menu core/context-menu.d.ts +28 -0
- package/dist/components/context menu core/context-menu.js +91 -0
- package/dist/components/context menu core/context-menu.js.map +1 -0
- package/dist/components/context menu core/contextMenuAdvanced.d.ts +46 -0
- package/dist/components/context menu core/contextMenuAdvanced.js +34 -0
- package/dist/components/context menu core/contextMenuAdvanced.js.map +1 -0
- package/dist/components/dialog.d.ts +18 -0
- package/dist/components/dialog.js +42 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.js +51 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/filter/AdvancedFilters.d.ts +14 -0
- package/dist/components/filter/AdvancedFilters.js +220 -0
- package/dist/components/filter/AdvancedFilters.js.map +1 -0
- package/dist/components/filter/Filter.d.ts +48 -0
- package/dist/components/filter/Filter.js +153 -0
- package/dist/components/filter/Filter.js.map +1 -0
- package/dist/components/filter/FilterButton.d.ts +10 -0
- package/dist/components/filter/FilterButton.js +9 -0
- package/dist/components/filter/FilterButton.js.map +1 -0
- package/dist/components/filter/NormalFilters.d.ts +14 -0
- package/dist/components/filter/NormalFilters.js +40 -0
- package/dist/components/filter/NormalFilters.js.map +1 -0
- package/dist/components/filter/index.d.ts +5 -0
- package/dist/components/filter/index.js +6 -0
- package/dist/components/filter/index.js.map +1 -0
- package/dist/components/filter/types.d.ts +32 -0
- package/dist/components/filter/types.js +2 -0
- package/dist/components/filter/types.js.map +1 -0
- package/dist/components/form-error.d.ts +42 -0
- package/dist/components/form-error.js +103 -0
- package/dist/components/form-error.js.map +1 -0
- package/dist/components/icons.d.ts +19 -0
- package/dist/components/icons.js +21 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/image.d.ts +12 -0
- package/dist/components/image.js +18 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/index.d.ts +59 -0
- package/dist/components/index.js +60 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input.d.ts +22 -0
- package/dist/components/input.js +102 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +7 -0
- package/dist/components/label.js +8 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/layout/FeatureLayout.d.ts +131 -0
- package/dist/components/layout/FeatureLayout.js +113 -0
- package/dist/components/layout/FeatureLayout.js.map +1 -0
- package/dist/components/layout/FeatureLayoutExportButton.d.ts +10 -0
- package/dist/components/layout/FeatureLayoutExportButton.js +21 -0
- package/dist/components/layout/FeatureLayoutExportButton.js.map +1 -0
- package/dist/components/layout/FeatureLayoutTabs.d.ts +36 -0
- package/dist/components/layout/FeatureLayoutTabs.js +192 -0
- package/dist/components/layout/FeatureLayoutTabs.js.map +1 -0
- package/dist/components/layout/kanban/FeatureLayoutKanban.d.ts +6 -0
- package/dist/components/layout/kanban/FeatureLayoutKanban.js +195 -0
- package/dist/components/layout/kanban/FeatureLayoutKanban.js.map +1 -0
- package/dist/components/layout/kanban/KanbanCard.d.ts +12 -0
- package/dist/components/layout/kanban/KanbanCard.js +43 -0
- package/dist/components/layout/kanban/KanbanCard.js.map +1 -0
- package/dist/components/layout/kanban/KanbanColumn.d.ts +23 -0
- package/dist/components/layout/kanban/KanbanColumn.js +30 -0
- package/dist/components/layout/kanban/KanbanColumn.js.map +1 -0
- package/dist/components/layout/kanban/KanbanToolbar.d.ts +11 -0
- package/dist/components/layout/kanban/KanbanToolbar.js +10 -0
- package/dist/components/layout/kanban/KanbanToolbar.js.map +1 -0
- package/dist/components/layout/kanban/index.d.ts +6 -0
- package/dist/components/layout/kanban/index.js +7 -0
- package/dist/components/layout/kanban/index.js.map +1 -0
- package/dist/components/layout/kanban/types.d.ts +67 -0
- package/dist/components/layout/kanban/types.js +2 -0
- package/dist/components/layout/kanban/types.js.map +1 -0
- package/dist/components/popover.d.ts +11 -0
- package/dist/components/popover.js +20 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/react-flow/FlowGraphHeader.d.ts +2 -0
- package/dist/components/react-flow/FlowGraphHeader.js +10 -0
- package/dist/components/react-flow/FlowGraphHeader.js.map +1 -0
- package/dist/components/react-flow/GlowEdge.d.ts +3 -0
- package/dist/components/react-flow/GlowEdge.js +100 -0
- package/dist/components/react-flow/GlowEdge.js.map +1 -0
- package/dist/components/react-flow/ReactFlowCanvas.d.ts +7 -0
- package/dist/components/react-flow/ReactFlowCanvas.js +44 -0
- package/dist/components/react-flow/ReactFlowCanvas.js.map +1 -0
- package/dist/components/react-flow/RelationshipFlow.d.ts +2 -0
- package/dist/components/react-flow/RelationshipFlow.js +9 -0
- package/dist/components/react-flow/RelationshipFlow.js.map +1 -0
- package/dist/components/react-flow/TreeFlowLayout.d.ts +29 -0
- package/dist/components/react-flow/TreeFlowLayout.js +14 -0
- package/dist/components/react-flow/TreeFlowLayout.js.map +1 -0
- package/dist/components/react-flow/edges.d.ts +8 -0
- package/dist/components/react-flow/edges.js +21 -0
- package/dist/components/react-flow/edges.js.map +1 -0
- package/dist/components/react-flow/index.d.ts +9 -0
- package/dist/components/react-flow/index.js +10 -0
- package/dist/components/react-flow/index.js.map +1 -0
- package/dist/components/react-flow/layout.d.ts +5 -0
- package/dist/components/react-flow/layout.js +11 -0
- package/dist/components/react-flow/layout.js.map +1 -0
- package/dist/components/react-flow/types.d.ts +82 -0
- package/dist/components/react-flow/types.js +6 -0
- package/dist/components/react-flow/types.js.map +1 -0
- package/dist/components/react-flow/useFlowGraph.d.ts +3 -0
- package/dist/components/react-flow/useFlowGraph.js +22 -0
- package/dist/components/react-flow/useFlowGraph.js.map +1 -0
- package/dist/components/react-flow/useFlowGraphSync.d.ts +4 -0
- package/dist/components/react-flow/useFlowGraphSync.js +43 -0
- package/dist/components/react-flow/useFlowGraphSync.js.map +1 -0
- package/dist/components/select.d.ts +23 -0
- package/dist/components/select.js +109 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/sonner.d.ts +4 -0
- package/dist/components/sonner.js +29 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/stepper.d.ts +12 -0
- package/dist/components/stepper.js +22 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.js +16 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +52 -0
- package/dist/components/table.js +112 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +10 -0
- package/dist/components/tabs.js +29 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.js +17 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/condition-builder/index.d.ts +2 -0
- package/dist/condition-builder/index.js +3 -0
- package/dist/condition-builder/index.js.map +1 -0
- package/dist/context-menu/index.d.ts +2 -0
- package/dist/context-menu/index.js +3 -0
- package/dist/context-menu/index.js.map +1 -0
- package/dist/dropdown/SearchDropdown.d.ts +19 -0
- package/dist/dropdown/SearchDropdown.js +27 -0
- package/dist/dropdown/SearchDropdown.js.map +1 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +3 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +2 -0
- package/dist/editor.js.map +1 -0
- package/dist/feedback/index.d.ts +6 -0
- package/dist/feedback/index.js +7 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/flow.d.ts +1 -0
- package/dist/flow.js +2 -0
- package/dist/flow.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useContextMenuActions.d.ts +16 -0
- package/dist/hooks/useContextMenuActions.js +35 -0
- package/dist/hooks/useContextMenuActions.js.map +1 -0
- package/dist/hooks/useFeatureLayout.d.ts +14 -0
- package/dist/hooks/useFeatureLayout.js +21 -0
- package/dist/hooks/useFeatureLayout.js.map +1 -0
- package/dist/hooks/useTableActions.d.ts +46 -0
- package/dist/hooks/useTableActions.js +71 -0
- package/dist/hooks/useTableActions.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations.d.ts +42 -0
- package/dist/integrations.js +9 -0
- package/dist/integrations.js.map +1 -0
- package/dist/itsm/index.d.ts +7 -0
- package/dist/itsm/index.js +8 -0
- package/dist/itsm/index.js.map +1 -0
- package/dist/locales/ar.json +149 -0
- package/dist/locales/en.json +149 -0
- package/dist/primitives/index.d.ts +11 -0
- package/dist/primitives/index.js +12 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/progress.d.ts +7 -0
- package/dist/progress.js +20 -0
- package/dist/progress.js.map +1 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.js +4 -0
- package/dist/select/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/support/api.d.ts +8 -0
- package/dist/support/api.js +2 -0
- package/dist/support/api.js.map +1 -0
- package/dist/support/types/file.types.d.ts +12 -0
- package/dist/support/types/file.types.js +2 -0
- package/dist/support/types/file.types.js.map +1 -0
- package/dist/support/types/gallery.types.d.ts +22 -0
- package/dist/support/types/gallery.types.js +2 -0
- package/dist/support/types/gallery.types.js.map +1 -0
- package/dist/support/types/governorates.types.d.ts +12 -0
- package/dist/support/types/governorates.types.js +2 -0
- package/dist/support/types/governorates.types.js.map +1 -0
- package/dist/support/types/grade.types.d.ts +7 -0
- package/dist/support/types/grade.types.js +2 -0
- package/dist/support/types/grade.types.js.map +1 -0
- package/dist/support/types/index.d.ts +13 -0
- package/dist/support/types/index.js +14 -0
- package/dist/support/types/index.js.map +1 -0
- package/dist/support/types/metadata.types.d.ts +61 -0
- package/dist/support/types/metadata.types.js +3 -0
- package/dist/support/types/metadata.types.js.map +1 -0
- package/dist/support/types/table.types.d.ts +33 -0
- package/dist/support/types/table.types.js +2 -0
- package/dist/support/types/table.types.js.map +1 -0
- package/dist/support/types/viewCard.types.d.ts +78 -0
- package/dist/support/types/viewCard.types.js +3 -0
- package/dist/support/types/viewCard.types.js.map +1 -0
- package/dist/support/utils/fileUtils.d.ts +1 -0
- package/dist/support/utils/fileUtils.js +2 -0
- package/dist/support/utils/fileUtils.js.map +1 -0
- package/dist/support/utils.d.ts +5 -0
- package/dist/support/utils.js +4 -0
- package/dist/support/utils.js.map +1 -0
- package/dist/table/index.d.ts +6 -0
- package/dist/table/index.js +7 -0
- package/dist/table/index.js.map +1 -0
- package/dist/tasks.d.ts +3 -0
- package/dist/tasks.js +4 -0
- package/dist/tasks.js.map +1 -0
- package/dist/tours/TourContext.d.ts +33 -0
- package/dist/tours/TourContext.js +98 -0
- package/dist/tours/TourContext.js.map +1 -0
- package/dist/tours/TourOverlay.d.ts +7 -0
- package/dist/tours/TourOverlay.js +129 -0
- package/dist/tours/TourOverlay.js.map +1 -0
- package/dist/tours.d.ts +2 -0
- package/dist/tours.js +3 -0
- package/dist/tours.js.map +1 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/typography/index.d.ts +4 -0
- package/dist/typography/index.js +5 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/typography.adapter.d.ts +18 -0
- package/dist/typography/typography.adapter.js +113 -0
- package/dist/typography/typography.adapter.js.map +1 -0
- package/dist/typography/typography.constants.d.ts +56 -0
- package/dist/typography/typography.constants.js +649 -0
- package/dist/typography/typography.constants.js.map +1 -0
- package/dist/typography/typography.types.d.ts +62 -0
- package/dist/typography/typography.types.js +6 -0
- package/dist/typography/typography.types.js.map +1 -0
- package/dist/typography/useTypography.d.ts +25 -0
- package/dist/typography/useTypography.js +158 -0
- package/dist/typography/useTypography.js.map +1 -0
- package/dist/ui/accordion.d.ts +7 -0
- package/dist/ui/accordion.js +18 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/avatar.d.ts +11 -0
- package/dist/ui/avatar.js +23 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.js +33 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.js +41 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.js +25 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dialog.js +37 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +25 -0
- package/dist/ui/dropdown-menu.js +51 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/index.d.ts +15 -0
- package/dist/ui/index.js +16 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +26 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +38 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +8 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +28 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +11 -0
- package/dist/ui/tabs.js +29 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +17 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.js +3 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +61 -4
- package/src/activity/index.ts +2 -0
- package/src/clickup/common/InlineNameTab.tsx +122 -0
- package/src/clickup/common/TaskAssigneeAvatar.tsx +127 -0
- package/src/clickup/common/TaskBreadcrumb.tsx +91 -0
- package/src/clickup/common/TaskCheck.tsx +51 -0
- package/src/clickup/common/TaskContextMenu.tsx +42 -0
- package/src/clickup/common/TaskIcon.tsx +145 -0
- package/src/clickup/common/TaskPriorityBadge.tsx +52 -0
- package/src/clickup/common/TaskRowActionMenu.tsx +43 -0
- package/src/clickup/common/TaskStatusPill.tsx +73 -0
- package/src/clickup/common/WorkspaceButton.tsx +22 -0
- package/src/clickup/common/WorkspaceHeader.tsx +41 -0
- package/src/clickup/common/WorkspaceMenus.tsx +92 -0
- package/src/clickup/common/WorkspaceMessage.tsx +39 -0
- package/src/clickup/common/WorkspaceMetricStrip.tsx +49 -0
- package/src/clickup/common/WorkspacePanel.tsx +27 -0
- package/src/clickup/common/WorkspaceSelect.tsx +173 -0
- package/src/clickup/common/WorkspaceTable.tsx +78 -0
- package/src/clickup/dialogs/ClickUpCommentComposer.tsx +93 -0
- package/src/clickup/dialogs/ClickUpTaskActions.tsx +73 -0
- package/src/clickup/dialogs/ClickUpTaskAssignee.tsx +86 -0
- package/src/clickup/dialogs/ClickUpTaskDescription.tsx +67 -0
- package/src/clickup/dialogs/ClickUpTaskDialog.tsx +187 -0
- package/src/clickup/dialogs/ClickUpTaskDiscussion.tsx +136 -0
- package/src/clickup/dialogs/ClickUpTaskMain.tsx +156 -0
- package/src/clickup/dialogs/ClickUpTaskProperties.tsx +214 -0
- package/src/clickup/elements/TaskCalendarCell.tsx +91 -0
- package/src/clickup/elements/TaskCard.tsx +154 -0
- package/src/clickup/elements/TaskGroup.tsx +208 -0
- package/src/clickup/elements/TaskRow.tsx +172 -0
- package/src/clickup/elements/TaskTableHead.tsx +29 -0
- package/src/clickup/elements/TaskTimelineRow.tsx +77 -0
- package/src/clickup/index.ts +63 -0
- package/src/clickup/task-ui.css +864 -0
- package/src/clickup/toolbar/TaskToolbar.tsx +130 -0
- package/src/clickup/toolbar/TaskViewPicker.tsx +148 -0
- package/src/clickup/toolbar/TaskViewSwitcher.tsx +129 -0
- package/src/clickup/types.ts +79 -0
- package/src/clickup/views/TaskBoardView.tsx +259 -0
- package/src/clickup/views/TaskCalendarView.tsx +410 -0
- package/src/clickup/views/TaskGanttView.tsx +178 -0
- package/src/clickup/views/TaskListView.tsx +95 -0
- package/src/clickup/views/TaskTableView.tsx +192 -0
- package/src/components/ActivityFeed.tsx +440 -0
- package/src/components/AudioPlayer.tsx +179 -0
- package/src/components/BulkActionBar.tsx +72 -0
- package/src/components/Carousel.tsx +107 -0
- package/src/components/ChatBot.tsx +205 -0
- package/src/components/CheckboxCustom.tsx +106 -0
- package/src/components/ClickUpTaskModal.tsx +661 -0
- package/src/components/ConditionBuilder.tsx +322 -0
- package/src/components/ConfirmDialog.tsx +157 -0
- package/src/components/DataCard.tsx +203 -0
- package/src/components/DataTable.tsx +609 -0
- package/src/components/DatePicker.tsx +397 -0
- package/src/components/EmptyState.tsx +105 -0
- package/src/components/Error.tsx +248 -0
- package/src/components/ErrorState.tsx +199 -0
- package/src/components/FileAttachmentChip.tsx +84 -0
- package/src/components/FilterConditionChip.tsx +56 -0
- package/src/components/GalleryCarouselDialog.tsx +439 -0
- package/src/components/HierarchicalSelectionMenu.tsx +432 -0
- package/src/components/InfiniteSelect.tsx +397 -0
- package/src/components/LoadingState.tsx +105 -0
- package/src/components/LucidIconRender.tsx +25 -0
- package/src/components/MasterDetailLayout.tsx +442 -0
- package/src/components/PinnedAttributeRow.tsx +70 -0
- package/src/components/PopUp.tsx +309 -0
- package/src/components/PrioritySignal.tsx +131 -0
- package/src/components/RichTextEditor.tsx +433 -0
- package/src/components/SLACountdown.tsx +133 -0
- package/src/components/StatusBadge.tsx +119 -0
- package/src/components/StatusCards.tsx +78 -0
- package/src/components/StatusProgressBar.tsx +158 -0
- package/src/components/TableActions.tsx +182 -0
- package/src/components/TaskDetailsModal.tsx +7 -0
- package/src/components/ThemedText.tsx +181 -0
- package/src/components/TicketWorkspaceLayout.tsx +63 -0
- package/src/components/TimePicker.tsx +283 -0
- package/src/components/Tooltip.tsx +128 -0
- package/src/components/TreeView.tsx +297 -0
- package/src/components/accordion.tsx +78 -0
- package/src/components/avatar.tsx +107 -0
- package/src/components/badge.tsx +72 -0
- package/src/components/button.tsx +93 -0
- package/src/components/card.tsx +103 -0
- package/src/components/context menu core/context-menu.tsx +304 -0
- package/src/components/context menu core/contextMenuAdvanced.tsx +130 -0
- package/src/components/dialog.tsx +186 -0
- package/src/components/dropdown-menu.tsx +274 -0
- package/src/components/filter/AdvancedFilters.tsx +834 -0
- package/src/components/filter/Filter.tsx +233 -0
- package/src/components/filter/FilterButton.tsx +38 -0
- package/src/components/filter/NormalFilters.tsx +109 -0
- package/src/components/filter/index.ts +5 -0
- package/src/components/filter/types.ts +36 -0
- package/src/components/form-error.tsx +172 -0
- package/src/components/icons.tsx +468 -0
- package/src/components/image.tsx +85 -0
- package/src/components/index.ts +59 -0
- package/src/components/input.tsx +260 -0
- package/src/components/label.tsx +27 -0
- package/src/components/layout/FeatureLayout.tsx +739 -0
- package/src/components/layout/FeatureLayoutExportButton.tsx +93 -0
- package/src/components/layout/FeatureLayoutTabs.tsx +413 -0
- package/src/components/layout/kanban/FeatureLayoutKanban.tsx +386 -0
- package/src/components/layout/kanban/KanbanCard.tsx +132 -0
- package/src/components/layout/kanban/KanbanColumn.tsx +241 -0
- package/src/components/layout/kanban/KanbanToolbar.tsx +77 -0
- package/src/components/layout/kanban/index.ts +6 -0
- package/src/components/layout/kanban/types.ts +96 -0
- package/src/components/popover.tsx +66 -0
- package/src/components/react-flow/FlowGraphHeader.tsx +68 -0
- package/src/components/react-flow/GlowEdge.tsx +238 -0
- package/src/components/react-flow/ReactFlowCanvas.tsx +112 -0
- package/src/components/react-flow/RelationshipFlow.tsx +50 -0
- package/src/components/react-flow/TreeFlowLayout.tsx +187 -0
- package/src/components/react-flow/edges.ts +39 -0
- package/src/components/react-flow/index.ts +9 -0
- package/src/components/react-flow/layout.ts +16 -0
- package/src/components/react-flow/types.ts +103 -0
- package/src/components/react-flow/useFlowGraph.ts +36 -0
- package/src/components/react-flow/useFlowGraphSync.ts +67 -0
- package/src/components/select.tsx +386 -0
- package/src/components/sonner.tsx +58 -0
- package/src/components/stepper.tsx +97 -0
- package/src/components/switch.tsx +46 -0
- package/src/components/table.tsx +577 -0
- package/src/components/tabs.tsx +81 -0
- package/src/components/textarea.tsx +67 -0
- package/src/condition-builder/index.ts +2 -0
- package/src/context-menu/index.ts +2 -0
- package/src/dropdown/SearchDropdown.tsx +145 -0
- package/src/dropdown/index.ts +2 -0
- package/src/editor.ts +1 -0
- package/src/feedback/index.ts +6 -0
- package/src/flow.ts +1 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useContextMenuActions.ts +69 -0
- package/src/hooks/useFeatureLayout.ts +44 -0
- package/src/hooks/useTableActions.ts +146 -0
- package/src/index.ts +27 -0
- package/src/integrations.tsx +11 -0
- package/src/itsm/index.ts +7 -0
- package/src/locales/ar.json +149 -0
- package/src/locales/en.json +149 -0
- package/src/primitives/index.ts +11 -0
- package/src/progress.tsx +87 -0
- package/src/select/index.ts +3 -0
- package/src/support/api.ts +1 -0
- package/src/support/types/file.types.ts +13 -0
- package/src/support/types/gallery.types.ts +22 -0
- package/src/support/types/governorates.types.ts +13 -0
- package/src/support/types/grade.types.ts +7 -0
- package/src/support/types/index.ts +14 -0
- package/src/support/types/metadata.types.ts +93 -0
- package/src/support/types/table.types.ts +45 -0
- package/src/support/types/viewCard.types.ts +100 -0
- package/src/support/utils/fileUtils.ts +1 -0
- package/src/support/utils.ts +3 -0
- package/src/table/index.ts +6 -0
- package/src/tasks.ts +3 -0
- package/src/tours/TourContext.tsx +142 -0
- package/src/tours/TourOverlay.tsx +281 -0
- package/src/tours.ts +2 -0
- package/src/types.ts +138 -0
- package/src/typography/index.ts +4 -0
- package/src/typography/typography.adapter.ts +131 -0
- package/src/typography/typography.constants.ts +700 -0
- package/src/typography/typography.types.ts +156 -0
- package/src/typography/useTypography.ts +211 -0
- package/src/ui/accordion.tsx +66 -0
- package/src/ui/avatar.tsx +106 -0
- package/src/ui/badge.tsx +58 -0
- package/src/ui/button.tsx +69 -0
- package/src/ui/card.tsx +97 -0
- package/src/ui/dialog.tsx +165 -0
- package/src/ui/dropdown-menu.tsx +262 -0
- package/src/ui/index.ts +15 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/popover.tsx +86 -0
- package/src/ui/select.tsx +193 -0
- package/src/ui/switch.tsx +32 -0
- package/src/ui/table.tsx +119 -0
- package/src/ui/tabs.tsx +89 -0
- package/src/ui/textarea.tsx +21 -0
- package/src/ui/tooltip.tsx +54 -0
- package/src/workspace/index.ts +2 -0
- package/styles.css +532 -0
- package/README.md +0 -3
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
import { motion } from "framer-motion";
|
|
2
|
+
import { ChevronDown, ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Button } from "../button";
|
|
5
|
+
import {
|
|
6
|
+
DropdownMenu,
|
|
7
|
+
DropdownMenuContent,
|
|
8
|
+
DropdownMenuItem,
|
|
9
|
+
DropdownMenuTrigger,
|
|
10
|
+
} from "../dropdown-menu";
|
|
11
|
+
import { FilterMetadata, FilterValue } from "./types";
|
|
12
|
+
|
|
13
|
+
export interface AdvancedFiltersProps<TKey extends string = string> {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
metadata: FilterMetadata<TKey>;
|
|
17
|
+
localFilters: FilterValue<TKey>[];
|
|
18
|
+
setLocalFilters: React.Dispatch<React.SetStateAction<FilterValue<TKey>[]>>;
|
|
19
|
+
onApply: () => void;
|
|
20
|
+
onReset: () => void;
|
|
21
|
+
isAr?: boolean;
|
|
22
|
+
inline?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function AdvancedFilters<TKey extends string = string>({
|
|
26
|
+
isOpen,
|
|
27
|
+
onClose,
|
|
28
|
+
metadata,
|
|
29
|
+
localFilters,
|
|
30
|
+
setLocalFilters,
|
|
31
|
+
onApply,
|
|
32
|
+
onReset,
|
|
33
|
+
isAr = false,
|
|
34
|
+
inline = false,
|
|
35
|
+
}: AdvancedFiltersProps<TKey>) {
|
|
36
|
+
if (!isOpen || !metadata) return null;
|
|
37
|
+
|
|
38
|
+
const handleAddFilter = () => {
|
|
39
|
+
if (!metadata || metadata.filters.length === 0) return;
|
|
40
|
+
const defaultCol = metadata.filters[0];
|
|
41
|
+
const defaultOp = defaultCol.operators[0];
|
|
42
|
+
const fieldType = defaultCol.type || "text";
|
|
43
|
+
setLocalFilters((prev) => [
|
|
44
|
+
...prev,
|
|
45
|
+
{
|
|
46
|
+
column: defaultCol.column as TKey,
|
|
47
|
+
operator: defaultOp,
|
|
48
|
+
value:
|
|
49
|
+
fieldType === "boolean"
|
|
50
|
+
? true
|
|
51
|
+
: defaultOp === "between"
|
|
52
|
+
? ["", ""]
|
|
53
|
+
: "",
|
|
54
|
+
},
|
|
55
|
+
]);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleRemoveFilter = (idx: number) => {
|
|
59
|
+
setLocalFilters((prev) => prev.filter((_, i) => i !== idx));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const handleColumnChange = (idx: number, newCol: TKey) => {
|
|
63
|
+
const colMeta = metadata.filters.find((f) => f.column === newCol);
|
|
64
|
+
const defaultOp = colMeta?.operators[0] || "=";
|
|
65
|
+
const fieldType = colMeta?.type || "text";
|
|
66
|
+
setLocalFilters((prev) =>
|
|
67
|
+
prev.map((item, i) =>
|
|
68
|
+
i === idx
|
|
69
|
+
? {
|
|
70
|
+
column: newCol,
|
|
71
|
+
operator: defaultOp,
|
|
72
|
+
value:
|
|
73
|
+
fieldType === "boolean"
|
|
74
|
+
? true
|
|
75
|
+
: defaultOp === "between"
|
|
76
|
+
? ["", ""]
|
|
77
|
+
: "",
|
|
78
|
+
}
|
|
79
|
+
: item,
|
|
80
|
+
),
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleOperatorChange = (idx: number, newOp: string) => {
|
|
85
|
+
setLocalFilters((prev) =>
|
|
86
|
+
prev.map((item, i) => {
|
|
87
|
+
if (i !== idx) return item;
|
|
88
|
+
const wasBetween = item.operator === "between";
|
|
89
|
+
const isBetween = newOp === "between";
|
|
90
|
+
let newVal = item.value;
|
|
91
|
+
if (isBetween && !wasBetween) {
|
|
92
|
+
newVal = ["", ""];
|
|
93
|
+
} else if (!isBetween && wasBetween) {
|
|
94
|
+
newVal = "";
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
...item,
|
|
98
|
+
operator: newOp,
|
|
99
|
+
value: newVal,
|
|
100
|
+
};
|
|
101
|
+
}),
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const handleValueChange = (
|
|
106
|
+
idx: number,
|
|
107
|
+
val: any,
|
|
108
|
+
isBetweenSecond = false,
|
|
109
|
+
) => {
|
|
110
|
+
setLocalFilters((prev) =>
|
|
111
|
+
prev.map((item, i) => {
|
|
112
|
+
if (i !== idx) return item;
|
|
113
|
+
if (item.operator === "between") {
|
|
114
|
+
const currentVal = Array.isArray(item.value)
|
|
115
|
+
? item.value
|
|
116
|
+
: ["", ""];
|
|
117
|
+
const newVal = [...currentVal];
|
|
118
|
+
if (isBetweenSecond) {
|
|
119
|
+
newVal[1] = val;
|
|
120
|
+
} else {
|
|
121
|
+
newVal[0] = val;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
...item,
|
|
125
|
+
value: newVal,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
...item,
|
|
130
|
+
value: val,
|
|
131
|
+
};
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
if (inline) {
|
|
137
|
+
return (
|
|
138
|
+
<div className="flex flex-col h-full w-full bg-dashboard-card font-sans text-left overflow-hidden">
|
|
139
|
+
{/* Header */}
|
|
140
|
+
<div className="p-4 border-b border-dashboard-border flex items-center justify-between shrink-0">
|
|
141
|
+
<div className="flex items-center gap-2.5">
|
|
142
|
+
<div className="flex flex-col">
|
|
143
|
+
<span className="text-[13px] font-bold text-dashboard-foreground">
|
|
144
|
+
{isAr ? "الفلاتر المتقدمة" : "Advanced Filters"}
|
|
145
|
+
</span>
|
|
146
|
+
<span className="text-[10px] text-dashboard-muted-foreground leading-none mt-0.5">
|
|
147
|
+
{isAr
|
|
148
|
+
? "تخصيص نتائج البحث بدقة"
|
|
149
|
+
: "Refine search results precisely"}
|
|
150
|
+
</span>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
<div className="flex items-center gap-2">
|
|
154
|
+
{localFilters.length > 0 && (
|
|
155
|
+
<button
|
|
156
|
+
onClick={() => setLocalFilters([])}
|
|
157
|
+
className="text-[10px] text-dashboard-muted-foreground hover:text-dashboard-destructive transition font-bold tracking-wider cursor-pointer bg-transparent border-0 p-0 mr-2"
|
|
158
|
+
>
|
|
159
|
+
{isAr ? "مسح" : "Clear"}
|
|
160
|
+
</button>
|
|
161
|
+
)}
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
onClick={onClose}
|
|
165
|
+
aria-label={isAr ? "إغلاق" : "Close"}
|
|
166
|
+
className="h-8 w-8 text-dashboard-muted-foreground hover:text-dashboard-foreground hover:bg-dashboard-secondary rounded-xl flex items-center justify-center transition-colors cursor-pointer outline-none bg-transparent border-0"
|
|
167
|
+
>
|
|
168
|
+
<X className="h-4 w-4" />
|
|
169
|
+
</button>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
{/* Form Fields Area (Dynamic Query Builder) */}
|
|
174
|
+
<div className="flex-1 overflow-y-auto p-4 space-y-4 custom-scrollbar bg-dashboard-background/30">
|
|
175
|
+
{localFilters.length === 0 ? (
|
|
176
|
+
<div className="text-center py-12 text-xs text-dashboard-muted-foreground font-semibold">
|
|
177
|
+
{isAr
|
|
178
|
+
? 'لم يتم إضافة فلاتر بعد. اضغط على "إضافة فلتر" للبدء.'
|
|
179
|
+
: 'No filters added yet. Click "Add Filter" to start.'}
|
|
180
|
+
</div>
|
|
181
|
+
) : (
|
|
182
|
+
<div className="space-y-4">
|
|
183
|
+
{localFilters.map((filterItem, idx) => {
|
|
184
|
+
const colMeta = metadata.filters.find(
|
|
185
|
+
(f) => f.column === filterItem.column,
|
|
186
|
+
);
|
|
187
|
+
const operators = colMeta?.operators || [];
|
|
188
|
+
const fieldType = colMeta?.type || "text";
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<div
|
|
192
|
+
key={idx}
|
|
193
|
+
className="flex flex-col gap-3 bg-dashboard-secondary/40 p-4 rounded-xl border border-dashboard-border"
|
|
194
|
+
>
|
|
195
|
+
{/* Column Selection */}
|
|
196
|
+
<div className="space-y-1">
|
|
197
|
+
<label className="block text-[9px] font-bold text-dashboard-muted-foreground tracking-wider">
|
|
198
|
+
{isAr ? "الحقل" : "Field"}
|
|
199
|
+
</label>
|
|
200
|
+
<DropdownMenu>
|
|
201
|
+
<DropdownMenuTrigger className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold flex items-center justify-between outline-none text-dashboard-foreground hover:bg-dashboard-secondary">
|
|
202
|
+
<span>
|
|
203
|
+
{colMeta?.label ||
|
|
204
|
+
filterItem.column}
|
|
205
|
+
</span>
|
|
206
|
+
<ChevronDown className="w-3.5 h-3.5 opacity-50 shrink-0" />
|
|
207
|
+
</DropdownMenuTrigger>
|
|
208
|
+
<DropdownMenuContent className="w-full min-w-50">
|
|
209
|
+
{metadata.filters.map(
|
|
210
|
+
(f) => (
|
|
211
|
+
<DropdownMenuItem
|
|
212
|
+
key={f.column}
|
|
213
|
+
onClick={() =>
|
|
214
|
+
handleColumnChange(
|
|
215
|
+
idx,
|
|
216
|
+
f.column as TKey,
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
>
|
|
220
|
+
{f.label}
|
|
221
|
+
</DropdownMenuItem>
|
|
222
|
+
),
|
|
223
|
+
)}
|
|
224
|
+
</DropdownMenuContent>
|
|
225
|
+
</DropdownMenu>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
{/* Operator Selection */}
|
|
229
|
+
<div className="space-y-1">
|
|
230
|
+
<label className="block text-[9px] font-bold text-dashboard-muted-foreground tracking-wider">
|
|
231
|
+
{isAr ? "الشرط" : "Condition"}
|
|
232
|
+
</label>
|
|
233
|
+
<DropdownMenu>
|
|
234
|
+
<DropdownMenuTrigger className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold flex items-center justify-between outline-none text-dashboard-foreground hover:bg-dashboard-secondary">
|
|
235
|
+
<span>
|
|
236
|
+
{metadata.operators[
|
|
237
|
+
filterItem.operator
|
|
238
|
+
] ||
|
|
239
|
+
filterItem.operator}
|
|
240
|
+
</span>
|
|
241
|
+
<ChevronDown className="w-3.5 h-3.5 opacity-50 shrink-0" />
|
|
242
|
+
</DropdownMenuTrigger>
|
|
243
|
+
<DropdownMenuContent className="w-full min-w-50">
|
|
244
|
+
{operators.map((op) => (
|
|
245
|
+
<DropdownMenuItem
|
|
246
|
+
key={op}
|
|
247
|
+
onClick={() =>
|
|
248
|
+
handleOperatorChange(
|
|
249
|
+
idx,
|
|
250
|
+
op,
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
>
|
|
254
|
+
{metadata.operators[
|
|
255
|
+
op
|
|
256
|
+
] || op}
|
|
257
|
+
</DropdownMenuItem>
|
|
258
|
+
))}
|
|
259
|
+
</DropdownMenuContent>
|
|
260
|
+
</DropdownMenu>
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
{/* Value input fields */}
|
|
264
|
+
<div className="space-y-1">
|
|
265
|
+
<label className="block text-[9px] font-bold text-dashboard-muted-foreground tracking-wider">
|
|
266
|
+
{isAr ? "القيمة" : "Value"}
|
|
267
|
+
</label>
|
|
268
|
+
{fieldType === "boolean" ? (
|
|
269
|
+
<DropdownMenu>
|
|
270
|
+
<DropdownMenuTrigger className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold flex items-center justify-between outline-none text-dashboard-foreground hover:bg-dashboard-secondary">
|
|
271
|
+
<span>
|
|
272
|
+
{String(
|
|
273
|
+
filterItem.value,
|
|
274
|
+
) === "true"
|
|
275
|
+
? isAr
|
|
276
|
+
? "نعم"
|
|
277
|
+
: "Yes"
|
|
278
|
+
: isAr
|
|
279
|
+
? "لا"
|
|
280
|
+
: "No"}
|
|
281
|
+
</span>
|
|
282
|
+
<ChevronDown className="w-3.5 h-3.5 opacity-50 shrink-0" />
|
|
283
|
+
</DropdownMenuTrigger>
|
|
284
|
+
<DropdownMenuContent className="w-full min-w-30">
|
|
285
|
+
<DropdownMenuItem
|
|
286
|
+
onClick={() =>
|
|
287
|
+
handleValueChange(
|
|
288
|
+
idx,
|
|
289
|
+
true,
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
>
|
|
293
|
+
{isAr
|
|
294
|
+
? "نعم"
|
|
295
|
+
: "Yes"}
|
|
296
|
+
</DropdownMenuItem>
|
|
297
|
+
<DropdownMenuItem
|
|
298
|
+
onClick={() =>
|
|
299
|
+
handleValueChange(
|
|
300
|
+
idx,
|
|
301
|
+
false,
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
>
|
|
305
|
+
{isAr ? "لا" : "No"}
|
|
306
|
+
</DropdownMenuItem>
|
|
307
|
+
</DropdownMenuContent>
|
|
308
|
+
</DropdownMenu>
|
|
309
|
+
) : filterItem.operator ===
|
|
310
|
+
"between" ? (
|
|
311
|
+
<div className="flex items-center gap-2">
|
|
312
|
+
<input
|
|
313
|
+
type={
|
|
314
|
+
fieldType ===
|
|
315
|
+
"number"
|
|
316
|
+
? "number"
|
|
317
|
+
: fieldType ===
|
|
318
|
+
"date"
|
|
319
|
+
? "date"
|
|
320
|
+
: "text"
|
|
321
|
+
}
|
|
322
|
+
placeholder={
|
|
323
|
+
isAr ? "من" : "Min"
|
|
324
|
+
}
|
|
325
|
+
value={
|
|
326
|
+
Array.isArray(
|
|
327
|
+
filterItem.value,
|
|
328
|
+
)
|
|
329
|
+
? filterItem
|
|
330
|
+
.value[0]
|
|
331
|
+
: ""
|
|
332
|
+
}
|
|
333
|
+
onChange={(e) =>
|
|
334
|
+
handleValueChange(
|
|
335
|
+
idx,
|
|
336
|
+
e.target.value,
|
|
337
|
+
false,
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold focus:ring-2 focus:ring-dashboard-primary/20 transition-all outline-none text-dashboard-foreground"
|
|
341
|
+
/>
|
|
342
|
+
<span className="text-[10px] font-bold text-dashboard-muted-foreground shrink-0">
|
|
343
|
+
{isAr ? "إلى" : "To"}
|
|
344
|
+
</span>
|
|
345
|
+
<input
|
|
346
|
+
type={
|
|
347
|
+
fieldType ===
|
|
348
|
+
"number"
|
|
349
|
+
? "number"
|
|
350
|
+
: fieldType ===
|
|
351
|
+
"date"
|
|
352
|
+
? "date"
|
|
353
|
+
: "text"
|
|
354
|
+
}
|
|
355
|
+
placeholder={
|
|
356
|
+
isAr ? "إلى" : "Max"
|
|
357
|
+
}
|
|
358
|
+
value={
|
|
359
|
+
Array.isArray(
|
|
360
|
+
filterItem.value,
|
|
361
|
+
)
|
|
362
|
+
? filterItem
|
|
363
|
+
.value[1]
|
|
364
|
+
: ""
|
|
365
|
+
}
|
|
366
|
+
onChange={(e) =>
|
|
367
|
+
handleValueChange(
|
|
368
|
+
idx,
|
|
369
|
+
e.target.value,
|
|
370
|
+
true,
|
|
371
|
+
)
|
|
372
|
+
}
|
|
373
|
+
className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold focus:ring-2 focus:ring-dashboard-primary/20 transition-all outline-none text-dashboard-foreground"
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
) : (
|
|
377
|
+
<input
|
|
378
|
+
type={
|
|
379
|
+
fieldType === "number"
|
|
380
|
+
? "number"
|
|
381
|
+
: fieldType ===
|
|
382
|
+
"date"
|
|
383
|
+
? "date"
|
|
384
|
+
: "text"
|
|
385
|
+
}
|
|
386
|
+
placeholder={
|
|
387
|
+
isAr
|
|
388
|
+
? "القيمة"
|
|
389
|
+
: "Value"
|
|
390
|
+
}
|
|
391
|
+
value={
|
|
392
|
+
typeof filterItem.value ===
|
|
393
|
+
"string" ||
|
|
394
|
+
typeof filterItem.value ===
|
|
395
|
+
"number"
|
|
396
|
+
? filterItem.value
|
|
397
|
+
: ""
|
|
398
|
+
}
|
|
399
|
+
onChange={(e) =>
|
|
400
|
+
handleValueChange(
|
|
401
|
+
idx,
|
|
402
|
+
e.target.value,
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold focus:ring-2 focus:ring-dashboard-primary/20 transition-all outline-none text-dashboard-foreground"
|
|
406
|
+
/>
|
|
407
|
+
)}
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
{/* Delete Button */}
|
|
411
|
+
<button
|
|
412
|
+
onClick={() =>
|
|
413
|
+
handleRemoveFilter(idx)
|
|
414
|
+
}
|
|
415
|
+
className="mt-1 flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-xl text-xs font-semibold text-dashboard-destructive hover:bg-dashboard-destructive/10 border border-dashboard-destructive/20 hover:border-transparent transition cursor-pointer self-end bg-transparent"
|
|
416
|
+
>
|
|
417
|
+
<X size={12} />
|
|
418
|
+
<span>
|
|
419
|
+
{isAr
|
|
420
|
+
? "حذف التصفية"
|
|
421
|
+
: "Delete Filter"}
|
|
422
|
+
</span>
|
|
423
|
+
</button>
|
|
424
|
+
</div>
|
|
425
|
+
);
|
|
426
|
+
})}
|
|
427
|
+
</div>
|
|
428
|
+
)}
|
|
429
|
+
|
|
430
|
+
<Button
|
|
431
|
+
onClick={handleAddFilter}
|
|
432
|
+
className="w-full rounded-xl border border-dashboard-border bg-dashboard-card text-dashboard-muted-foreground hover:bg-dashboard-secondary hover:text-dashboard-foreground font-bold text-xs py-2.5 px-4 transition"
|
|
433
|
+
>
|
|
434
|
+
{isAr ? "+ إضافة تصفية جديدة" : "+ Add New Filter"}
|
|
435
|
+
</Button>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
{/* Footer */}
|
|
439
|
+
<div className="p-4 border-t border-dashboard-border bg-dashboard-card flex items-center justify-end gap-2 shrink-0">
|
|
440
|
+
<Button
|
|
441
|
+
onClick={() => {
|
|
442
|
+
onReset();
|
|
443
|
+
onClose();
|
|
444
|
+
}}
|
|
445
|
+
className="rounded-xl border border-dashboard-border bg-dashboard-card text-dashboard-destructive hover:bg-dashboard-destructive/5 font-bold text-[10px] tracking-wider py-2 px-4 transition"
|
|
446
|
+
>
|
|
447
|
+
{isAr ? "إعادة تعيين" : "Reset"}
|
|
448
|
+
</Button>
|
|
449
|
+
<Button
|
|
450
|
+
onClick={() => {
|
|
451
|
+
onApply();
|
|
452
|
+
onClose();
|
|
453
|
+
}}
|
|
454
|
+
className="rounded-xl bg-dashboard-primary text-dashboard-card hover:bg-dashboard-primary/95 font-bold text-[10px] tracking-wider py-2 px-4 shadow-sm transition"
|
|
455
|
+
>
|
|
456
|
+
{isAr ? "تطبيق" : "Apply"}
|
|
457
|
+
</Button>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return (
|
|
464
|
+
<>
|
|
465
|
+
{/* Backdrop Overlay */}
|
|
466
|
+
<motion.div
|
|
467
|
+
initial={{ opacity: 0 }}
|
|
468
|
+
animate={{ opacity: 1 }}
|
|
469
|
+
exit={{ opacity: 0 }}
|
|
470
|
+
onClick={onClose}
|
|
471
|
+
className="fixed inset-0 bg-black/20 backdrop-blur-xs z-50 cursor-pointer"
|
|
472
|
+
/>
|
|
473
|
+
|
|
474
|
+
{/* Slide-out Panel */}
|
|
475
|
+
<motion.div
|
|
476
|
+
initial={{ x: isAr ? "-100%" : "100%" }}
|
|
477
|
+
animate={{ x: 0 }}
|
|
478
|
+
exit={{ x: isAr ? "-100%" : "100%" }}
|
|
479
|
+
transition={{
|
|
480
|
+
type: "spring",
|
|
481
|
+
damping: 26,
|
|
482
|
+
stiffness: 220,
|
|
483
|
+
}}
|
|
484
|
+
className="fixed ltr:right-0 rtl:left-0 top-0 bottom-0 w-105 max-w-full bg-dashboard-card border-l border-dashboard-border shadow-2xl z-50 flex flex-col overflow-hidden font-sans text-left"
|
|
485
|
+
>
|
|
486
|
+
{/* Stuck-out Close Tab */}
|
|
487
|
+
<button
|
|
488
|
+
type="button"
|
|
489
|
+
onClick={onClose}
|
|
490
|
+
className={`absolute top-1/2 -translate-y-1/2 h-12.5 w-6.5 bg-dashboard-card border border-dashboard-border rounded-xl flex items-center justify-center cursor-pointer text-dashboard-foreground hover:bg-dashboard-secondary transition-colors outline-none shadow-md ${
|
|
491
|
+
isAr
|
|
492
|
+
? "rtl:-left-6.5 rtl:border-l-0"
|
|
493
|
+
: "ltr:-right-6.5 ltr:border-r-0"
|
|
494
|
+
}`}
|
|
495
|
+
title={isAr ? "إغلاق" : "Close"}
|
|
496
|
+
aria-label={isAr ? "إغلاق" : "Close"}
|
|
497
|
+
>
|
|
498
|
+
{isAr ? (
|
|
499
|
+
<ChevronLeft className="h-4 w-4 rtl:rotate-180" />
|
|
500
|
+
) : (
|
|
501
|
+
<ChevronRight className="h-4 w-4 rtl:rotate-180" />
|
|
502
|
+
)}
|
|
503
|
+
</button>
|
|
504
|
+
|
|
505
|
+
{/* Header */}
|
|
506
|
+
<div className="p-4 border-b border-dashboard-border flex items-center justify-between shrink-0">
|
|
507
|
+
<div className="flex items-center gap-2.5">
|
|
508
|
+
<div className="flex flex-col">
|
|
509
|
+
<span className="text-[13px] font-bold text-dashboard-foreground">
|
|
510
|
+
{isAr ? "الفلاتر المتقدمة" : "Advanced Filters"}
|
|
511
|
+
</span>
|
|
512
|
+
<span className="text-[10px] text-dashboard-muted-foreground leading-none mt-0.5">
|
|
513
|
+
{isAr
|
|
514
|
+
? "تخصيص نتائج البحث بدقة"
|
|
515
|
+
: "Refine search results precisely"}
|
|
516
|
+
</span>
|
|
517
|
+
</div>
|
|
518
|
+
</div>
|
|
519
|
+
<div className="flex items-center gap-2">
|
|
520
|
+
{localFilters.length > 0 && (
|
|
521
|
+
<button
|
|
522
|
+
onClick={() => setLocalFilters([])}
|
|
523
|
+
className="text-[10px] text-dashboard-muted-foreground hover:text-dashboard-destructive transition font-bold tracking-wider cursor-pointer bg-transparent border-0 p-0 mr-2"
|
|
524
|
+
>
|
|
525
|
+
{isAr ? "مسح الحالي" : "Clear Current"}
|
|
526
|
+
</button>
|
|
527
|
+
)}
|
|
528
|
+
<button
|
|
529
|
+
type="button"
|
|
530
|
+
onClick={onClose}
|
|
531
|
+
aria-label={isAr ? "إغلاق" : "Close"}
|
|
532
|
+
className="h-8 w-8 text-dashboard-muted-foreground hover:text-dashboard-foreground hover:bg-dashboard-secondary rounded-xl flex items-center justify-center transition-colors cursor-pointer outline-none bg-transparent border-0"
|
|
533
|
+
>
|
|
534
|
+
<X className="h-4 w-4" />
|
|
535
|
+
</button>
|
|
536
|
+
</div>
|
|
537
|
+
</div>
|
|
538
|
+
|
|
539
|
+
{/* Form Fields Area (Dynamic Query Builder) */}
|
|
540
|
+
<div className="flex-1 overflow-y-auto p-5 space-y-5 custom-scrollbar bg-dashboard-background/30">
|
|
541
|
+
{localFilters.length === 0 ? (
|
|
542
|
+
<div className="text-center py-12 text-xs text-dashboard-muted-foreground font-semibold">
|
|
543
|
+
{isAr
|
|
544
|
+
? 'لم يتم إضافة فلاتر بعد. اضغط على "إضافة فلتر" للبدء.'
|
|
545
|
+
: 'No filters added yet. Click "Add Filter" to start.'}
|
|
546
|
+
</div>
|
|
547
|
+
) : (
|
|
548
|
+
<div className="space-y-4">
|
|
549
|
+
{localFilters.map((filterItem, idx) => {
|
|
550
|
+
const colMeta = metadata.filters.find(
|
|
551
|
+
(f) => f.column === filterItem.column,
|
|
552
|
+
);
|
|
553
|
+
const operators = colMeta?.operators || [];
|
|
554
|
+
const fieldType = colMeta?.type || "text";
|
|
555
|
+
|
|
556
|
+
return (
|
|
557
|
+
<div
|
|
558
|
+
key={idx}
|
|
559
|
+
className="flex flex-col gap-3 bg-dashboard-muted/50 p-4 rounded-xl border border-dashboard-border"
|
|
560
|
+
>
|
|
561
|
+
{/* Column Selection */}
|
|
562
|
+
<div className="space-y-1">
|
|
563
|
+
<label className="block text-[9px] font-bold text-dashboard-muted-foreground tracking-wider">
|
|
564
|
+
{isAr ? "الحقل" : "Field"}
|
|
565
|
+
</label>
|
|
566
|
+
<DropdownMenu>
|
|
567
|
+
<DropdownMenuTrigger className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold flex items-center justify-between outline-none text-dashboard-foreground hover:bg-dashboard-secondary">
|
|
568
|
+
<span>
|
|
569
|
+
{colMeta?.label ||
|
|
570
|
+
filterItem.column}
|
|
571
|
+
</span>
|
|
572
|
+
<ChevronDown className="w-3.5 h-3.5 opacity-50 shrink-0" />
|
|
573
|
+
</DropdownMenuTrigger>
|
|
574
|
+
<DropdownMenuContent className="w-full min-w-50">
|
|
575
|
+
{metadata.filters.map(
|
|
576
|
+
(f) => (
|
|
577
|
+
<DropdownMenuItem
|
|
578
|
+
key={f.column}
|
|
579
|
+
onClick={() =>
|
|
580
|
+
handleColumnChange(
|
|
581
|
+
idx,
|
|
582
|
+
f.column as TKey,
|
|
583
|
+
)
|
|
584
|
+
}
|
|
585
|
+
>
|
|
586
|
+
{f.label}
|
|
587
|
+
</DropdownMenuItem>
|
|
588
|
+
),
|
|
589
|
+
)}
|
|
590
|
+
</DropdownMenuContent>
|
|
591
|
+
</DropdownMenu>
|
|
592
|
+
</div>
|
|
593
|
+
|
|
594
|
+
{/* Operator Selection */}
|
|
595
|
+
<div className="space-y-1">
|
|
596
|
+
<label className="block text-[9px] font-bold text-dashboard-muted-foreground tracking-wider">
|
|
597
|
+
{isAr ? "الشرط" : "Condition"}
|
|
598
|
+
</label>
|
|
599
|
+
<DropdownMenu>
|
|
600
|
+
<DropdownMenuTrigger className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold flex items-center justify-between outline-none text-dashboard-foreground hover:bg-dashboard-secondary">
|
|
601
|
+
<span>
|
|
602
|
+
{metadata.operators[
|
|
603
|
+
filterItem.operator
|
|
604
|
+
] ||
|
|
605
|
+
filterItem.operator}
|
|
606
|
+
</span>
|
|
607
|
+
<ChevronDown className="w-3.5 h-3.5 opacity-50 shrink-0" />
|
|
608
|
+
</DropdownMenuTrigger>
|
|
609
|
+
<DropdownMenuContent className="w-full min-w-50">
|
|
610
|
+
{operators.map((op) => (
|
|
611
|
+
<DropdownMenuItem
|
|
612
|
+
key={op}
|
|
613
|
+
onClick={() =>
|
|
614
|
+
handleOperatorChange(
|
|
615
|
+
idx,
|
|
616
|
+
op,
|
|
617
|
+
)
|
|
618
|
+
}
|
|
619
|
+
>
|
|
620
|
+
{metadata.operators[
|
|
621
|
+
op
|
|
622
|
+
] || op}
|
|
623
|
+
</DropdownMenuItem>
|
|
624
|
+
))}
|
|
625
|
+
</DropdownMenuContent>
|
|
626
|
+
</DropdownMenu>
|
|
627
|
+
</div>
|
|
628
|
+
|
|
629
|
+
{/* Value input fields */}
|
|
630
|
+
<div className="space-y-1">
|
|
631
|
+
<label className="block text-[9px] font-bold text-dashboard-muted-foreground tracking-wider">
|
|
632
|
+
{isAr ? "القيمة" : "Value"}
|
|
633
|
+
</label>
|
|
634
|
+
{fieldType === "boolean" ? (
|
|
635
|
+
<DropdownMenu>
|
|
636
|
+
<DropdownMenuTrigger className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold flex items-center justify-between outline-none text-dashboard-foreground hover:bg-dashboard-secondary">
|
|
637
|
+
<span>
|
|
638
|
+
{String(
|
|
639
|
+
filterItem.value,
|
|
640
|
+
) === "true"
|
|
641
|
+
? isAr
|
|
642
|
+
? "نعم"
|
|
643
|
+
: "Yes"
|
|
644
|
+
: isAr
|
|
645
|
+
? "لا"
|
|
646
|
+
: "No"}
|
|
647
|
+
</span>
|
|
648
|
+
<ChevronDown className="w-3.5 h-3.5 opacity-50 shrink-0" />
|
|
649
|
+
</DropdownMenuTrigger>
|
|
650
|
+
<DropdownMenuContent className="w-full min-w-30">
|
|
651
|
+
<DropdownMenuItem
|
|
652
|
+
onClick={() =>
|
|
653
|
+
handleValueChange(
|
|
654
|
+
idx,
|
|
655
|
+
true,
|
|
656
|
+
)
|
|
657
|
+
}
|
|
658
|
+
>
|
|
659
|
+
{isAr
|
|
660
|
+
? "نعم"
|
|
661
|
+
: "Yes"}
|
|
662
|
+
</DropdownMenuItem>
|
|
663
|
+
<DropdownMenuItem
|
|
664
|
+
onClick={() =>
|
|
665
|
+
handleValueChange(
|
|
666
|
+
idx,
|
|
667
|
+
false,
|
|
668
|
+
)
|
|
669
|
+
}
|
|
670
|
+
>
|
|
671
|
+
{isAr ? "لا" : "No"}
|
|
672
|
+
</DropdownMenuItem>
|
|
673
|
+
</DropdownMenuContent>
|
|
674
|
+
</DropdownMenu>
|
|
675
|
+
) : filterItem.operator ===
|
|
676
|
+
"between" ? (
|
|
677
|
+
<div className="flex items-center gap-2">
|
|
678
|
+
<input
|
|
679
|
+
type={
|
|
680
|
+
fieldType ===
|
|
681
|
+
"number"
|
|
682
|
+
? "number"
|
|
683
|
+
: fieldType ===
|
|
684
|
+
"date"
|
|
685
|
+
? "date"
|
|
686
|
+
: "text"
|
|
687
|
+
}
|
|
688
|
+
placeholder={
|
|
689
|
+
isAr ? "من" : "Min"
|
|
690
|
+
}
|
|
691
|
+
value={
|
|
692
|
+
Array.isArray(
|
|
693
|
+
filterItem.value,
|
|
694
|
+
)
|
|
695
|
+
? filterItem
|
|
696
|
+
.value[0]
|
|
697
|
+
: ""
|
|
698
|
+
}
|
|
699
|
+
onChange={(e) =>
|
|
700
|
+
handleValueChange(
|
|
701
|
+
idx,
|
|
702
|
+
e.target.value,
|
|
703
|
+
false,
|
|
704
|
+
)
|
|
705
|
+
}
|
|
706
|
+
className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold focus:ring-2 focus:ring-dashboard-primary/20 transition-all outline-none text-dashboard-foreground"
|
|
707
|
+
/>
|
|
708
|
+
<span className="text-[10px] font-bold text-dashboard-muted-foreground shrink-0">
|
|
709
|
+
{isAr ? "إلى" : "To"}
|
|
710
|
+
</span>
|
|
711
|
+
<input
|
|
712
|
+
type={
|
|
713
|
+
fieldType ===
|
|
714
|
+
"number"
|
|
715
|
+
? "number"
|
|
716
|
+
: fieldType ===
|
|
717
|
+
"date"
|
|
718
|
+
? "date"
|
|
719
|
+
: "text"
|
|
720
|
+
}
|
|
721
|
+
placeholder={
|
|
722
|
+
isAr ? "إلى" : "Max"
|
|
723
|
+
}
|
|
724
|
+
value={
|
|
725
|
+
Array.isArray(
|
|
726
|
+
filterItem.value,
|
|
727
|
+
)
|
|
728
|
+
? filterItem
|
|
729
|
+
.value[1]
|
|
730
|
+
: ""
|
|
731
|
+
}
|
|
732
|
+
onChange={(e) =>
|
|
733
|
+
handleValueChange(
|
|
734
|
+
idx,
|
|
735
|
+
e.target.value,
|
|
736
|
+
true,
|
|
737
|
+
)
|
|
738
|
+
}
|
|
739
|
+
className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold focus:ring-2 focus:ring-dashboard-primary/20 transition-all outline-none text-dashboard-foreground"
|
|
740
|
+
/>
|
|
741
|
+
</div>
|
|
742
|
+
) : (
|
|
743
|
+
<input
|
|
744
|
+
type={
|
|
745
|
+
fieldType === "number"
|
|
746
|
+
? "number"
|
|
747
|
+
: fieldType ===
|
|
748
|
+
"date"
|
|
749
|
+
? "date"
|
|
750
|
+
: "text"
|
|
751
|
+
}
|
|
752
|
+
placeholder={
|
|
753
|
+
isAr
|
|
754
|
+
? "القيمة"
|
|
755
|
+
: "Value"
|
|
756
|
+
}
|
|
757
|
+
value={
|
|
758
|
+
typeof filterItem.value ===
|
|
759
|
+
"string" ||
|
|
760
|
+
typeof filterItem.value ===
|
|
761
|
+
"number"
|
|
762
|
+
? filterItem.value
|
|
763
|
+
: ""
|
|
764
|
+
}
|
|
765
|
+
onChange={(e) =>
|
|
766
|
+
handleValueChange(
|
|
767
|
+
idx,
|
|
768
|
+
e.target.value,
|
|
769
|
+
)
|
|
770
|
+
}
|
|
771
|
+
className="w-full bg-dashboard-card border border-dashboard-border rounded-xl px-3 py-2 text-xs font-semibold focus:ring-2 focus:ring-dashboard-primary/20 transition-all outline-none text-dashboard-foreground"
|
|
772
|
+
/>
|
|
773
|
+
)}
|
|
774
|
+
</div>
|
|
775
|
+
|
|
776
|
+
{/* Delete Button */}
|
|
777
|
+
<button
|
|
778
|
+
onClick={() =>
|
|
779
|
+
handleRemoveFilter(idx)
|
|
780
|
+
}
|
|
781
|
+
className="mt-1 flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-xl text-xs font-semibold text-dashboard-destructive hover:bg-dashboard-destructive/10 border border-dashboard-destructive/20 hover:border-transparent transition cursor-pointer self-end bg-transparent"
|
|
782
|
+
>
|
|
783
|
+
<X size={12} />
|
|
784
|
+
<span>
|
|
785
|
+
{isAr
|
|
786
|
+
? "حذف التصفية"
|
|
787
|
+
: "Delete Filter"}
|
|
788
|
+
</span>
|
|
789
|
+
</button>
|
|
790
|
+
</div>
|
|
791
|
+
);
|
|
792
|
+
})}
|
|
793
|
+
</div>
|
|
794
|
+
)}
|
|
795
|
+
|
|
796
|
+
<Button
|
|
797
|
+
onClick={handleAddFilter}
|
|
798
|
+
className="w-full rounded-xl border border-dashboard-border bg-dashboard-card text-dashboard-muted-foreground hover:bg-dashboard-secondary hover:text-dashboard-foreground font-bold text-xs py-2.5 px-4 transition"
|
|
799
|
+
>
|
|
800
|
+
{isAr ? "+ إضافة تصفية جديدة" : "+ Add New Filter"}
|
|
801
|
+
</Button>
|
|
802
|
+
</div>
|
|
803
|
+
|
|
804
|
+
{/* Footer */}
|
|
805
|
+
<div className="p-4 border-t border-dashboard-border bg-dashboard-card flex items-center justify-end gap-2 shrink-0">
|
|
806
|
+
<Button
|
|
807
|
+
onClick={() => {
|
|
808
|
+
onReset();
|
|
809
|
+
onClose();
|
|
810
|
+
}}
|
|
811
|
+
className="rounded-xl border border-dashboard-border bg-dashboard-card text-dashboard-destructive hover:bg-dashboard-destructive/5 font-bold text-[10px] tracking-wider py-2 px-4 transition"
|
|
812
|
+
>
|
|
813
|
+
{isAr ? "إعادة تعيين" : "Reset"}
|
|
814
|
+
</Button>
|
|
815
|
+
<Button
|
|
816
|
+
onClick={onClose}
|
|
817
|
+
className="rounded-xl border border-dashboard-border bg-dashboard-card text-dashboard-foreground hover:bg-dashboard-secondary font-bold text-[10px] tracking-wider py-2 px-4 transition"
|
|
818
|
+
>
|
|
819
|
+
{isAr ? "إلغاء" : "Cancel"}
|
|
820
|
+
</Button>
|
|
821
|
+
<Button
|
|
822
|
+
onClick={() => {
|
|
823
|
+
onApply();
|
|
824
|
+
onClose();
|
|
825
|
+
}}
|
|
826
|
+
className="rounded-xl bg-dashboard-primary text-dashboard-card hover:bg-dashboard-primary/95 font-bold text-[10px] tracking-wider py-2 px-4 shadow-sm transition"
|
|
827
|
+
>
|
|
828
|
+
{isAr ? "تطبيق" : "Apply"}
|
|
829
|
+
</Button>
|
|
830
|
+
</div>
|
|
831
|
+
</motion.div>
|
|
832
|
+
</>
|
|
833
|
+
);
|
|
834
|
+
}
|