@oneflowui/ui 0.4.2 → 0.4.4
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/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
- package/dist/components/ContextMenu/index.vue.d.ts +2 -1
- package/dist/components/ContextMenu/index.vue.js +7 -0
- package/dist/components/ContextMenu/index.vue2.js +92 -0
- package/dist/components/Dashboard/charts/BarChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/BarChart.vue2.js +43 -0
- package/dist/components/Dashboard/charts/DoughnutChart.vue.js +23 -0
- package/dist/components/Dashboard/charts/DoughnutChart.vue2.js +4 -0
- package/dist/components/Dashboard/charts/NumberCard.vue.js +7 -0
- package/dist/components/Dashboard/charts/NumberCard.vue2.js +41 -0
- package/dist/components/Dashboard/charts/PieChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/PieChart.vue2.js +53 -0
- package/dist/components/Dashboard/charts/TableChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/TableChart.vue2.js +50 -0
- package/dist/components/Dashboard/index.vue.js +7 -0
- package/dist/components/Dashboard/index.vue2.js +104 -0
- package/dist/components/ai/AiMessageBubble.vue.js +7 -0
- package/dist/components/ai/AiMessageBubble.vue2.js +47 -0
- package/dist/components/ai/AiMessageList.vue.js +7 -0
- package/dist/components/ai/AiMessageList.vue2.js +78 -0
- package/dist/components/ai/AiSender.vue.js +7 -0
- package/dist/components/ai/AiSender.vue2.js +86 -0
- package/dist/components/ai/AiStreamingCursor.vue.js +7 -0
- package/dist/components/ai/AiStreamingCursor.vue2.js +16 -0
- package/dist/components/ai/AiThinking.vue.js +7 -0
- package/dist/components/ai/AiThinking.vue2.js +19 -0
- package/dist/components/ai/UserMessageBubble.vue.js +7 -0
- package/dist/components/ai/UserMessageBubble.vue2.js +34 -0
- package/dist/components/auxiliary/ColorPanel.vue.js +7 -0
- package/dist/components/auxiliary/ColorPanel.vue2.js +65 -0
- package/dist/components/auxiliary/FileUpload.vue.js +7 -0
- package/dist/components/auxiliary/FileUpload.vue2.js +90 -0
- package/dist/components/auxiliary/PersonPanel.vue.js +7 -0
- package/dist/components/auxiliary/PersonPanel.vue2.js +66 -0
- package/dist/components/base/Accordion.vue.js +7 -0
- package/dist/components/base/Accordion.vue2.js +78 -0
- package/dist/components/base/AddViewBtn.vue.js +7 -0
- package/dist/components/base/AddViewBtn.vue2.js +25 -0
- package/dist/components/base/Avatar.vue.js +7 -0
- package/dist/components/base/Avatar.vue2.js +72 -0
- package/dist/components/base/Badge.vue.js +7 -0
- package/dist/components/base/Badge.vue2.js +70 -0
- package/dist/components/base/ButtonGroup.vue.js +7 -0
- package/dist/components/base/ButtonGroup.vue2.js +40 -0
- package/dist/components/base/ChainItem.vue.js +7 -0
- package/dist/components/base/ChainItem.vue2.js +68 -0
- package/dist/components/base/DescBlock.vue.js +7 -0
- package/dist/components/base/DescBlock.vue2.js +13 -0
- package/dist/components/base/DropdownMenu.vue.js +7 -0
- package/dist/components/base/DropdownMenu.vue2.js +91 -0
- package/dist/components/base/EmptyState.vue.js +7 -0
- package/dist/components/base/EmptyState.vue2.js +38 -0
- package/dist/components/base/InfoCard.vue.js +7 -0
- package/dist/components/base/InfoCard.vue2.js +167 -0
- package/dist/components/base/MonitorItem.vue.d.ts +1 -1
- package/dist/components/base/MonitorItem.vue.js +7 -0
- package/dist/components/base/MonitorItem.vue2.js +56 -0
- package/dist/components/base/PersonaCard.vue.d.ts +2 -1
- package/dist/components/base/PersonaCard.vue.js +7 -0
- package/dist/components/base/PersonaCard.vue2.js +185 -0
- package/dist/components/base/ProgressBar.vue.js +7 -0
- package/dist/components/base/ProgressBar.vue2.js +49 -0
- package/dist/components/base/RangeSlider.vue.js +7 -0
- package/dist/components/base/RangeSlider.vue2.js +35 -0
- package/dist/components/base/RefTag.vue.d.ts +2 -2
- package/dist/components/base/RefTag.vue.js +7 -0
- package/dist/components/base/RefTag.vue2.js +52 -0
- package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
- package/dist/components/base/SearchHighlight.vue.js +7 -0
- package/dist/components/base/SearchHighlight.vue2.js +21 -0
- package/dist/components/base/SectionBlock.vue.js +7 -0
- package/dist/components/base/SectionBlock.vue2.js +115 -0
- package/dist/components/base/SelectBadge.vue.js +7 -0
- package/dist/components/base/SelectBadge.vue2.js +81 -0
- package/dist/components/base/StatisticCard.vue.js +7 -0
- package/dist/components/base/StatisticCard.vue2.js +57 -0
- package/dist/components/base/StatusIndicator.vue.js +7 -0
- package/dist/components/base/StatusIndicator.vue2.js +54 -0
- package/dist/components/base/StatusSummary.vue.js +7 -0
- package/dist/components/base/StatusSummary.vue2.js +64 -0
- package/dist/components/base/Stepper.vue.js +7 -0
- package/dist/components/base/Stepper.vue2.js +70 -0
- package/dist/components/base/Switch.vue.js +7 -0
- package/dist/components/base/Switch.vue2.js +43 -0
- package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
- package/dist/components/base/ToolbarBtn.vue.js +7 -0
- package/dist/components/base/ToolbarBtn.vue2.js +30 -0
- package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
- package/dist/components/base/ViewModeGroup.vue.js +7 -0
- package/dist/components/base/ViewModeGroup.vue2.js +32 -0
- package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
- package/dist/components/base/ViewSwitcher.vue.js +7 -0
- package/dist/components/base/ViewSwitcher.vue2.js +73 -0
- package/dist/components/base/ViewTab.vue.js +7 -0
- package/dist/components/base/ViewTab.vue2.js +42 -0
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/breadcrumb/Breadcrumb.vue.js +7 -0
- package/dist/components/breadcrumb/Breadcrumb.vue2.js +52 -0
- package/dist/components/breadcrumb/BreadcrumbItem.vue.js +7 -0
- package/dist/components/breadcrumb/BreadcrumbItem.vue2.js +35 -0
- package/dist/components/detail/CommentItem.vue.js +7 -0
- package/dist/components/detail/CommentItem.vue2.js +29 -0
- package/dist/components/detail/DetailLayout.vue.js +7 -0
- package/dist/components/detail/DetailLayout.vue2.js +118 -0
- package/dist/components/detail/PropPanel.vue.js +7 -0
- package/dist/components/detail/PropPanel.vue2.js +51 -0
- package/dist/components/detail/PropRow.vue.js +7 -0
- package/dist/components/detail/PropRow.vue2.js +51 -0
- package/dist/components/editor/BlockQuote.vue.js +7 -0
- package/dist/components/editor/BlockQuote.vue2.js +45 -0
- package/dist/components/editor/CodeBlock.vue.js +7 -0
- package/dist/components/editor/CodeBlock.vue2.js +48 -0
- package/dist/components/editor/ContentBlock.vue.js +7 -0
- package/dist/components/editor/ContentBlock.vue2.js +49 -0
- package/dist/components/editor/RefLink.vue.js +7 -0
- package/dist/components/editor/RefLink.vue2.js +37 -0
- package/dist/components/editor/RichTextEditor.vue.js +7 -0
- package/dist/components/editor/RichTextEditor.vue2.js +132 -0
- package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
- package/dist/components/field/FieldAttachment.vue.js +7 -0
- package/dist/components/field/FieldAttachment.vue2.js +69 -0
- package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
- package/dist/components/field/FieldAutoNumber.vue.js +7 -0
- package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
- package/dist/components/field/FieldCheckbox.vue.js +7 -0
- package/dist/{FieldCheckbox-CV3QtQ4Y.js → components/field/FieldCheckbox.vue2.js} +8 -9
- package/dist/components/field/FieldCreator.vue.d.ts +7 -0
- package/dist/components/field/FieldCreator.vue.js +7 -0
- package/dist/components/field/FieldCreator.vue2.js +24 -0
- package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
- package/dist/components/field/FieldCurrency.vue.js +7 -0
- package/dist/components/field/FieldCurrency.vue2.js +42 -0
- package/dist/components/field/FieldDate.vue.js +7 -0
- package/dist/components/field/FieldDate.vue2.js +36 -0
- package/dist/components/field/FieldDatetime.vue.js +7 -0
- package/dist/{FieldDatetime-B52GfWrK.js → components/field/FieldDatetime.vue2.js} +11 -12
- package/dist/components/field/FieldEmail.vue.js +7 -0
- package/dist/{FieldEmail-UREMoue-.js → components/field/FieldEmail.vue2.js} +12 -13
- package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
- package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
- package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
- package/dist/components/field/FieldMultiSelect.vue.js +7 -0
- package/dist/{FieldMultiSelect-Dlay1Fop.js → components/field/FieldMultiSelect.vue2.js} +32 -33
- package/dist/components/field/FieldNumber.vue.js +7 -0
- package/dist/{FieldNumber-BjhfFhs6.js → components/field/FieldNumber.vue2.js} +8 -9
- package/dist/components/field/FieldPhone.vue.d.ts +17 -0
- package/dist/components/field/FieldPhone.vue.js +7 -0
- package/dist/components/field/FieldPhone.vue2.js +34 -0
- package/dist/components/field/FieldProgress.vue.d.ts +15 -0
- package/dist/components/field/FieldProgress.vue.js +7 -0
- package/dist/components/field/FieldProgress.vue2.js +40 -0
- package/dist/components/field/FieldRating.vue.js +7 -0
- package/dist/components/field/FieldRating.vue2.js +31 -0
- package/dist/components/field/FieldRelation.vue.d.ts +17 -0
- package/dist/components/field/FieldRelation.vue.js +7 -0
- package/dist/components/field/FieldRelation.vue2.js +67 -0
- package/dist/components/field/FieldRichText.vue.d.ts +17 -0
- package/dist/components/field/FieldRichText.vue.js +7 -0
- package/dist/components/field/FieldRichText.vue2.js +65 -0
- package/dist/components/field/FieldSelect.vue.js +7 -0
- package/dist/{FieldSelect-B39Ad8VH.js → components/field/FieldSelect.vue2.js} +44 -44
- package/dist/components/field/FieldText.vue.js +7 -0
- package/dist/{FieldText-Ry7f72Ug.js → components/field/FieldText.vue2.js} +13 -14
- package/dist/components/field/FieldUrl.vue.js +7 -0
- package/dist/components/field/FieldUrl.vue2.js +33 -0
- package/dist/components/form/FormDesigner.vue.js +7 -0
- package/dist/components/form/FormDesigner.vue2.js +255 -0
- package/dist/components/gallery/GalleryCard.vue.js +7 -0
- package/dist/components/gallery/GalleryCard.vue2.js +87 -0
- package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
- package/dist/components/gallery/GalleryView.vue.js +7 -0
- package/dist/components/gallery/GalleryView.vue2.js +58 -0
- package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
- package/dist/components/kanban/KanbanBoard.vue.js +7 -0
- package/dist/components/kanban/KanbanBoard.vue2.js +119 -0
- package/dist/components/kanban/KanbanCard.vue.js +7 -0
- package/dist/components/kanban/KanbanCard.vue2.js +56 -0
- package/dist/components/kanban/KanbanColumn.vue.js +7 -0
- package/dist/components/kanban/KanbanColumn.vue2.js +103 -0
- package/dist/components/kanban/QuickAddRow.vue.js +7 -0
- package/dist/components/kanban/QuickAddRow.vue2.js +58 -0
- package/dist/components/layout/AppLayout.vue.js +7 -0
- package/dist/components/layout/AppLayout.vue2.js +82 -0
- package/dist/components/layout/Navbar.vue.js +7 -0
- package/dist/components/layout/Navbar.vue2.js +70 -0
- package/dist/components/layout/Sidebar.vue.js +7 -0
- package/dist/components/layout/Sidebar.vue2.js +88 -0
- package/dist/components/layout/StatusBar.vue.js +7 -0
- package/dist/components/layout/StatusBar.vue2.js +37 -0
- package/dist/components/mermaid/MermaidChart.vue.js +7 -0
- package/dist/components/mermaid/MermaidChart.vue2.js +75 -0
- package/dist/components/overlay/Dialog.vue.js +7 -0
- package/dist/components/overlay/Dialog.vue2.js +89 -0
- package/dist/components/overlay/Drawer.vue.js +7 -0
- package/dist/components/overlay/Drawer.vue2.js +96 -0
- package/dist/components/overlay/Modal.vue.js +7 -0
- package/dist/components/overlay/Modal.vue2.js +99 -0
- package/dist/components/overlay/SidePanel.vue.js +7 -0
- package/dist/components/overlay/SidePanel.vue2.js +121 -0
- package/dist/components/split/SplitPane.vue.js +8 -0
- package/dist/components/split/SplitPane.vue2.js +68 -0
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
- package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
- package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
- package/dist/components/table/DataTable.vue.d.ts +116 -25
- package/dist/components/table/DataTable.vue.js +7 -0
- package/dist/components/table/DataTable.vue2.js +821 -0
- package/dist/components/table/DetailSheet.vue.d.ts +43 -0
- package/dist/components/table/DetailSheet.vue.js +7 -0
- package/dist/components/table/DetailSheet.vue2.js +140 -0
- package/dist/components/table/FieldCell.vue.d.ts +1 -1
- package/dist/components/table/FieldCell.vue.js +7 -0
- package/dist/components/table/FieldCell.vue2.js +86 -0
- package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
- package/dist/components/table/FieldTypePicker.vue.js +7 -0
- package/dist/components/table/FieldTypePicker.vue2.js +92 -0
- package/dist/components/table/MobileListView.vue.d.ts +24 -0
- package/dist/components/table/MobileListView.vue.js +7 -0
- package/dist/components/table/MobileListView.vue2.js +90 -0
- package/dist/components/table/NewRowBtn.vue.js +7 -0
- package/dist/components/table/NewRowBtn.vue2.js +22 -0
- package/dist/components/table/TableColumnManager.vue.js +7 -0
- package/dist/components/table/TableColumnManager.vue2.js +100 -0
- package/dist/components/table/TableDataRow.vue.js +7 -0
- package/dist/components/table/TableDataRow.vue2.js +115 -0
- package/dist/components/table/TableFilterPanel.vue.js +7 -0
- package/dist/components/table/TableFilterPanel.vue2.js +142 -0
- package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
- package/dist/components/table/TableGroupRow.vue.js +7 -0
- package/dist/components/table/TableGroupRow.vue2.js +58 -0
- package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
- package/dist/components/table/TableHeaderRow.vue.js +7 -0
- package/dist/components/table/TableHeaderRow.vue2.js +90 -0
- package/dist/components/table/TableToolbar.vue.d.ts +118 -0
- package/dist/components/table/TableToolbar.vue.js +7 -0
- package/dist/components/table/TableToolbar.vue2.js +273 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/tabs/TabPanel.vue.js +7 -0
- package/dist/components/tabs/TabPanel.vue2.js +26 -0
- package/dist/components/tabs/Tabs.vue.js +7 -0
- package/dist/components/tabs/Tabs.vue2.js +87 -0
- package/dist/components/timeline/ActivityTimeline.vue.js +7 -0
- package/dist/components/timeline/ActivityTimeline.vue2.js +104 -0
- package/dist/components/timeline/GanttRow.vue.js +7 -0
- package/dist/components/timeline/GanttRow.vue2.js +110 -0
- package/dist/components/timeline/GanttTimeline.vue.js +7 -0
- package/dist/components/timeline/GanttTimeline.vue2.js +186 -0
- package/dist/components/toast/ToastContainer.vue.js +34 -0
- package/dist/components/toast/ToastContainer.vue3.js +5 -0
- package/dist/components/toast/ToastItem.vue.js +7 -0
- package/dist/components/toast/ToastItem.vue2.js +78 -0
- package/dist/composables/index.d.ts +19 -0
- package/dist/composables/useAiChat.js +103 -0
- package/dist/composables/useBadge.js +76 -0
- package/dist/composables/useBreakpoint.d.ts +2 -1
- package/dist/composables/useBreakpoint.js +18 -0
- package/dist/composables/useColumnResize.d.ts +19 -0
- package/dist/composables/useColumnResize.js +58 -0
- package/dist/composables/useDraftRows.d.ts +33 -0
- package/dist/composables/useDraftRows.js +103 -0
- package/dist/composables/useFixedColumns.d.ts +25 -0
- package/dist/composables/useFixedColumns.js +61 -0
- package/dist/composables/useFocusTrap.d.ts +10 -0
- package/dist/composables/useFocusTrap.js +37 -0
- package/dist/composables/useInlineEdit.js +28 -0
- package/dist/composables/useKeyboardNavigation.d.ts +45 -0
- package/dist/composables/useKeyboardNavigation.js +140 -0
- package/dist/composables/useMarkdown.js +69 -0
- package/dist/composables/useRowDrag.d.ts +32 -0
- package/dist/composables/useRowDrag.js +85 -0
- package/dist/composables/useSchemaEngine.d.ts +31 -0
- package/dist/composables/useSchemaEngine.js +129 -0
- package/dist/composables/useSearch.d.ts +30 -0
- package/dist/composables/useSearch.js +59 -0
- package/dist/composables/useStream.js +80 -0
- package/dist/composables/useSupabaseProvider.d.ts +70 -0
- package/dist/composables/useSupabaseProvider.js +126 -0
- package/dist/composables/useTable.d.ts +3 -0
- package/dist/composables/useTable.js +135 -0
- package/dist/composables/useTableColumns.js +24 -0
- package/dist/composables/useTableData.js +16 -0
- package/dist/composables/useTableFilter.js +97 -0
- package/dist/composables/useTableGroup.d.ts +14 -1
- package/dist/composables/useTableGroup.js +70 -0
- package/dist/composables/useToast.js +38 -0
- package/dist/composables/useTypewriter.js +56 -0
- package/dist/composables/useViewPersistence.d.ts +98 -0
- package/dist/composables/useViewPersistence.js +141 -0
- package/dist/composables/useVirtualList.d.ts +4 -1
- package/dist/composables/useVirtualList.js +140 -0
- package/dist/composables/useWorkerSort.d.ts +14 -0
- package/dist/composables/useWorkerSort.js +61 -0
- package/dist/constants/table.js +11 -0
- package/dist/index.d.ts +28 -4
- package/dist/index.js +349 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +5 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +377 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +923 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +151 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +240 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +658 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +38 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +216 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +13 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +399 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +305 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +615 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +753 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +219 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +183 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1063 -0
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +63 -2
- package/dist/types/index.js +94 -0
- package/dist/types/table-internal.d.ts +64 -0
- package/dist/utils/aggregation.d.ts +5 -0
- package/dist/utils/aggregation.js +38 -0
- package/dist/utils/icon.js +15 -0
- package/dist/utils/supabaseAdapter.d.ts +48 -0
- package/dist/utils/supabaseAdapter.js +76 -0
- package/dist/utils/supabaseSchema.d.ts +81 -0
- package/dist/utils/supabaseSchema.js +202 -0
- package/dist/workers/tableWorker.d.ts +31 -0
- package/package.json +13 -6
- package/dist/FieldDate-Bljx4jb7.js +0 -34
- package/dist/FieldRating-BKHUu-A1.js +0 -32
- package/dist/FieldUrl-bv0EB9sh.js +0 -34
- package/dist/index-DQph5iTq.js +0 -12936
- package/dist/oneflow-ui.js +0 -111
- package/dist/oneflow-ui.umd.cjs +0 -13
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineComponent as b, ref as k, watch as C, openBlock as r, createElementBlock as d, createElementVNode as n, createVNode as l, unref as s, createTextVNode as u, withCtx as V, Fragment as y, renderList as E, normalizeClass as x, toDisplayString as z, createCommentVNode as w } from "vue";
|
|
2
|
+
import { X as N, Eye as B, EyeOff as D, GripVertical as A } from "lucide-vue-next";
|
|
3
|
+
import { VueDraggable as T } from "vue-draggable-plus";
|
|
4
|
+
const U = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "of-col-manager"
|
|
7
|
+
}, $ = { class: "of-col-manager__header" }, F = { class: "of-col-manager__actions" }, G = { class: "of-col-manager__drag" }, L = ["checked", "onChange"], j = /* @__PURE__ */ b({
|
|
8
|
+
__name: "TableColumnManager",
|
|
9
|
+
props: {
|
|
10
|
+
columns: {},
|
|
11
|
+
visible: { type: Boolean, default: !0 }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:columns", "close"],
|
|
14
|
+
setup(c, { emit: f }) {
|
|
15
|
+
const _ = c, m = f, t = k([]);
|
|
16
|
+
C(
|
|
17
|
+
() => _.columns,
|
|
18
|
+
(o) => {
|
|
19
|
+
t.value = o.map((e) => ({ ...e }));
|
|
20
|
+
},
|
|
21
|
+
{ immediate: !0, deep: !0 }
|
|
22
|
+
);
|
|
23
|
+
function i() {
|
|
24
|
+
m(
|
|
25
|
+
"update:columns",
|
|
26
|
+
t.value.map((o) => ({ ...o }))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function g(o) {
|
|
30
|
+
o.hidden = !o.hidden, i();
|
|
31
|
+
}
|
|
32
|
+
function p() {
|
|
33
|
+
t.value.forEach((o) => o.hidden = !1), i();
|
|
34
|
+
}
|
|
35
|
+
function h() {
|
|
36
|
+
t.value.forEach((o) => o.hidden = !0), i();
|
|
37
|
+
}
|
|
38
|
+
function v() {
|
|
39
|
+
i();
|
|
40
|
+
}
|
|
41
|
+
return (o, e) => c.visible ? (r(), d("div", U, [
|
|
42
|
+
n("div", $, [
|
|
43
|
+
e[2] || (e[2] = n("span", { class: "of-col-manager__title" }, "管理列", -1)),
|
|
44
|
+
n("button", {
|
|
45
|
+
class: "of-col-manager__close",
|
|
46
|
+
onClick: e[0] || (e[0] = (a) => m("close"))
|
|
47
|
+
}, [
|
|
48
|
+
l(s(N), { size: 14 })
|
|
49
|
+
])
|
|
50
|
+
]),
|
|
51
|
+
n("div", F, [
|
|
52
|
+
n("button", {
|
|
53
|
+
class: "of-col-manager__action-btn",
|
|
54
|
+
onClick: p
|
|
55
|
+
}, [
|
|
56
|
+
l(s(B), { size: 12 }),
|
|
57
|
+
e[3] || (e[3] = u(" 显示全部 ", -1))
|
|
58
|
+
]),
|
|
59
|
+
n("button", {
|
|
60
|
+
class: "of-col-manager__action-btn",
|
|
61
|
+
onClick: h
|
|
62
|
+
}, [
|
|
63
|
+
l(s(D), { size: 12 }),
|
|
64
|
+
e[4] || (e[4] = u(" 隐藏全部 ", -1))
|
|
65
|
+
])
|
|
66
|
+
]),
|
|
67
|
+
l(s(T), {
|
|
68
|
+
modelValue: t.value,
|
|
69
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => t.value = a),
|
|
70
|
+
handle: ".of-col-manager__drag",
|
|
71
|
+
animation: 150,
|
|
72
|
+
onEnd: v
|
|
73
|
+
}, {
|
|
74
|
+
default: V(() => [
|
|
75
|
+
(r(!0), d(y, null, E(t.value, (a) => (r(), d("div", {
|
|
76
|
+
key: a.key,
|
|
77
|
+
class: "of-col-manager__row"
|
|
78
|
+
}, [
|
|
79
|
+
n("span", G, [
|
|
80
|
+
l(s(A), { size: 14 })
|
|
81
|
+
]),
|
|
82
|
+
n("input", {
|
|
83
|
+
type: "checkbox",
|
|
84
|
+
class: "of-col-manager__checkbox",
|
|
85
|
+
checked: !a.hidden,
|
|
86
|
+
onChange: (M) => g(a)
|
|
87
|
+
}, null, 40, L),
|
|
88
|
+
n("span", {
|
|
89
|
+
class: x(["of-col-manager__label", { dimmed: a.hidden }])
|
|
90
|
+
}, z(a.label), 3)
|
|
91
|
+
]))), 128))
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
}, 8, ["modelValue"])
|
|
95
|
+
])) : w("", !0);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
j as default
|
|
100
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { defineComponent as S, computed as p, openBlock as o, createElementBlock as s, normalizeClass as $, withModifiers as B, createElementVNode as D, createCommentVNode as T, Fragment as g, renderList as A, normalizeStyle as d, renderSlot as P, toDisplayString as a } from "vue";
|
|
2
|
+
import { mergeColorMap as w, DEFAULT_PRIORITY_MAP as R, DEFAULT_STATUS_MAP as _, resolveBadge as h } from "../../composables/useBadge.js";
|
|
3
|
+
const E = ["checked"], N = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-badge of-badge--role"
|
|
6
|
+
}, V = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "of-td-empty"
|
|
9
|
+
}, F = {
|
|
10
|
+
key: 3,
|
|
11
|
+
class: "of-td-text"
|
|
12
|
+
}, I = {
|
|
13
|
+
key: 4,
|
|
14
|
+
class: "of-td-id"
|
|
15
|
+
}, L = {
|
|
16
|
+
key: 5,
|
|
17
|
+
class: "of-td-title"
|
|
18
|
+
}, U = {
|
|
19
|
+
key: 6,
|
|
20
|
+
class: "of-td-text"
|
|
21
|
+
}, W = /* @__PURE__ */ S({
|
|
22
|
+
__name: "TableDataRow",
|
|
23
|
+
props: {
|
|
24
|
+
row: {},
|
|
25
|
+
rowKey: { default: "id" },
|
|
26
|
+
selected: { type: Boolean, default: !1 },
|
|
27
|
+
selectable: { type: Boolean, default: !0 },
|
|
28
|
+
columns: {},
|
|
29
|
+
priorityColorMap: {},
|
|
30
|
+
statusColorMap: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["select", "click"],
|
|
33
|
+
setup(r, { emit: b }) {
|
|
34
|
+
const i = r, u = b;
|
|
35
|
+
function C(e) {
|
|
36
|
+
if (e.width === "fill") {
|
|
37
|
+
const n = `${e.minWidth ?? 220}px`;
|
|
38
|
+
return { flex: `1 1 ${n}`, minWidth: n };
|
|
39
|
+
}
|
|
40
|
+
return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
41
|
+
}
|
|
42
|
+
const v = p(
|
|
43
|
+
() => w(R, i.priorityColorMap)
|
|
44
|
+
), x = p(() => w(_, i.statusColorMap));
|
|
45
|
+
function c(e) {
|
|
46
|
+
return h(e, v.value);
|
|
47
|
+
}
|
|
48
|
+
function f(e) {
|
|
49
|
+
return h(e, x.value);
|
|
50
|
+
}
|
|
51
|
+
function M(e) {
|
|
52
|
+
if (!e) return "-";
|
|
53
|
+
const n = new Date(e);
|
|
54
|
+
return isNaN(n.getTime()) ? e : `${n.getMonth() + 1}/${n.getDate()}`;
|
|
55
|
+
}
|
|
56
|
+
function y(e) {
|
|
57
|
+
return i.row[e.key];
|
|
58
|
+
}
|
|
59
|
+
function k(e) {
|
|
60
|
+
const n = y(e);
|
|
61
|
+
return n != null ? String(n) : "-";
|
|
62
|
+
}
|
|
63
|
+
function l(e) {
|
|
64
|
+
const n = y(e);
|
|
65
|
+
return typeof n == "string" ? n : "";
|
|
66
|
+
}
|
|
67
|
+
function m() {
|
|
68
|
+
const e = i.row[i.rowKey];
|
|
69
|
+
return e != null ? String(e) : "";
|
|
70
|
+
}
|
|
71
|
+
return (e, n) => (o(), s("div", {
|
|
72
|
+
class: $(["of-table-row", { "of-table-row--selected": r.selected }]),
|
|
73
|
+
onClick: n[2] || (n[2] = (t) => u("click", r.row))
|
|
74
|
+
}, [
|
|
75
|
+
r.selectable ? (o(), s("div", {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "of-td of-td-checkbox",
|
|
78
|
+
onClick: n[1] || (n[1] = B(() => {
|
|
79
|
+
}, ["stop"]))
|
|
80
|
+
}, [
|
|
81
|
+
D("input", {
|
|
82
|
+
type: "checkbox",
|
|
83
|
+
class: "of-checkbox",
|
|
84
|
+
checked: r.selected,
|
|
85
|
+
onChange: n[0] || (n[0] = (t) => u("select", m()))
|
|
86
|
+
}, null, 40, E)
|
|
87
|
+
])) : T("", !0),
|
|
88
|
+
(o(!0), s(g, null, A(r.columns, (t) => (o(), s("div", {
|
|
89
|
+
key: t.key,
|
|
90
|
+
class: "of-td",
|
|
91
|
+
style: d(C(t))
|
|
92
|
+
}, [
|
|
93
|
+
P(e.$slots, "cell", {
|
|
94
|
+
row: r.row,
|
|
95
|
+
col: t
|
|
96
|
+
}, () => [
|
|
97
|
+
t.key === "status" ? (o(), s("span", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "of-badge",
|
|
100
|
+
style: d(f(l(t)).style)
|
|
101
|
+
}, a(f(l(t)).label), 5)) : t.key === "priority" ? (o(), s("span", {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: "of-badge",
|
|
104
|
+
style: d(c(l(t)).style)
|
|
105
|
+
}, a(c(l(t)).label), 5)) : t.key === "role" ? (o(), s(g, { key: 2 }, [
|
|
106
|
+
l(t) ? (o(), s("span", N, a(l(t)), 1)) : (o(), s("span", V, "-"))
|
|
107
|
+
], 64)) : t.key === "updatedAt" ? (o(), s("span", F, a(M(l(t))), 1)) : t.key === "id" ? (o(), s("span", I, a(m()), 1)) : t.key === "title" ? (o(), s("span", L, a(k(t)), 1)) : (o(), s("span", U, a(k(t)), 1))
|
|
108
|
+
], !0)
|
|
109
|
+
], 4))), 128))
|
|
110
|
+
], 2));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export {
|
|
114
|
+
W as default
|
|
115
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { defineComponent as V, openBlock as o, createElementBlock as n, createElementVNode as i, createVNode as r, unref as c, Fragment as d, renderList as f, normalizeClass as _, toDisplayString as v, createTextVNode as $, createCommentVNode as p } from "vue";
|
|
2
|
+
import { X as T, Trash2 as q, Plus as z } from "lucide-vue-next";
|
|
3
|
+
const x = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-filter-panel"
|
|
6
|
+
}, B = { class: "of-filter-panel__header" }, I = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "of-filter-panel__empty"
|
|
9
|
+
}, O = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "of-filter-panel__conditions"
|
|
12
|
+
}, P = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "of-filter-condition__logic-label"
|
|
15
|
+
}, S = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "of-filter-condition__logic-group"
|
|
18
|
+
}, w = ["value", "onChange"], E = ["value"], F = ["value", "onChange"], D = ["value"], G = ["value", "onInput"], L = {
|
|
19
|
+
key: 3,
|
|
20
|
+
class: "of-filter-condition__no-value"
|
|
21
|
+
}, R = ["onClick"], X = { class: "of-filter-panel__footer" }, H = /* @__PURE__ */ V({
|
|
22
|
+
__name: "TableFilterPanel",
|
|
23
|
+
props: {
|
|
24
|
+
columns: {},
|
|
25
|
+
conditions: {},
|
|
26
|
+
logic: {},
|
|
27
|
+
visible: { type: Boolean, default: !0 }
|
|
28
|
+
},
|
|
29
|
+
emits: ["add-condition", "remove-condition", "update-condition", "update:logic", "clear", "close"],
|
|
30
|
+
setup(s, { emit: b }) {
|
|
31
|
+
const m = s, a = b, y = [
|
|
32
|
+
{ value: "contains", label: "包含" },
|
|
33
|
+
{ value: "not_contains", label: "不包含" },
|
|
34
|
+
{ value: "equals", label: "等于" },
|
|
35
|
+
{ value: "not_equals", label: "不等于" },
|
|
36
|
+
{ value: "starts_with", label: "开头是" },
|
|
37
|
+
{ value: "ends_with", label: "结尾是" },
|
|
38
|
+
{ value: "is_empty", label: "为空" },
|
|
39
|
+
{ value: "is_not_empty", label: "不为空" }
|
|
40
|
+
];
|
|
41
|
+
function g(u) {
|
|
42
|
+
var e;
|
|
43
|
+
return (e = m.columns.find((l) => l.key === u)) == null ? void 0 : e.type;
|
|
44
|
+
}
|
|
45
|
+
function k(u) {
|
|
46
|
+
return g(u) === "number" ? [
|
|
47
|
+
{ value: "equals", label: "等于" },
|
|
48
|
+
{ value: "not_equals", label: "不等于" },
|
|
49
|
+
{ value: "gt", label: "大于" },
|
|
50
|
+
{ value: "gte", label: "大于等于" },
|
|
51
|
+
{ value: "lt", label: "小于" },
|
|
52
|
+
{ value: "lte", label: "小于等于" },
|
|
53
|
+
{ value: "is_empty", label: "为空" },
|
|
54
|
+
{ value: "is_not_empty", label: "不为空" }
|
|
55
|
+
] : y;
|
|
56
|
+
}
|
|
57
|
+
const C = ["is_empty", "is_not_empty"];
|
|
58
|
+
function h(u) {
|
|
59
|
+
return C.includes(u);
|
|
60
|
+
}
|
|
61
|
+
return (u, e) => s.visible ? (o(), n("div", x, [
|
|
62
|
+
i("div", B, [
|
|
63
|
+
e[5] || (e[5] = i("span", { class: "of-filter-panel__title" }, "筛选", -1)),
|
|
64
|
+
i("button", {
|
|
65
|
+
class: "of-filter-panel__close",
|
|
66
|
+
onClick: e[0] || (e[0] = (l) => a("close"))
|
|
67
|
+
}, [
|
|
68
|
+
r(c(T), { size: 14 })
|
|
69
|
+
])
|
|
70
|
+
]),
|
|
71
|
+
s.conditions.length === 0 ? (o(), n("div", I, " 暂无筛选条件,点击下方添加 ")) : (o(), n("div", O, [
|
|
72
|
+
(o(!0), n(d, null, f(s.conditions, (l, N) => (o(), n("div", {
|
|
73
|
+
key: l.id,
|
|
74
|
+
class: "of-filter-condition"
|
|
75
|
+
}, [
|
|
76
|
+
N === 0 ? (o(), n("span", P, "当")) : (o(), n("span", S, [
|
|
77
|
+
i("button", {
|
|
78
|
+
class: _(["of-filter-condition__logic-btn", { active: s.logic === "and" }]),
|
|
79
|
+
onClick: e[1] || (e[1] = (t) => a("update:logic", "and"))
|
|
80
|
+
}, " 且 ", 2),
|
|
81
|
+
i("button", {
|
|
82
|
+
class: _(["of-filter-condition__logic-btn", { active: s.logic === "or" }]),
|
|
83
|
+
onClick: e[2] || (e[2] = (t) => a("update:logic", "or"))
|
|
84
|
+
}, " 或 ", 2)
|
|
85
|
+
])),
|
|
86
|
+
i("select", {
|
|
87
|
+
class: "of-filter-condition__select of-filter-condition__select--field",
|
|
88
|
+
value: l.field,
|
|
89
|
+
onChange: (t) => a("update-condition", l.id, { field: t.target.value })
|
|
90
|
+
}, [
|
|
91
|
+
(o(!0), n(d, null, f(s.columns, (t) => (o(), n("option", {
|
|
92
|
+
key: t.key,
|
|
93
|
+
value: t.key
|
|
94
|
+
}, v(t.label), 9, E))), 128))
|
|
95
|
+
], 40, w),
|
|
96
|
+
i("select", {
|
|
97
|
+
class: "of-filter-condition__select",
|
|
98
|
+
value: l.operator,
|
|
99
|
+
onChange: (t) => a("update-condition", l.id, {
|
|
100
|
+
operator: t.target.value
|
|
101
|
+
})
|
|
102
|
+
}, [
|
|
103
|
+
(o(!0), n(d, null, f(k(l.field), (t) => (o(), n("option", {
|
|
104
|
+
key: t.value,
|
|
105
|
+
value: t.value
|
|
106
|
+
}, v(t.label), 9, D))), 128))
|
|
107
|
+
], 40, F),
|
|
108
|
+
h(l.operator) ? (o(), n("span", L)) : (o(), n("input", {
|
|
109
|
+
key: 2,
|
|
110
|
+
class: "of-filter-condition__input",
|
|
111
|
+
value: l.value,
|
|
112
|
+
placeholder: "输入值...",
|
|
113
|
+
onInput: (t) => a("update-condition", l.id, { value: t.target.value })
|
|
114
|
+
}, null, 40, G)),
|
|
115
|
+
i("button", {
|
|
116
|
+
class: "of-filter-condition__remove",
|
|
117
|
+
onClick: (t) => a("remove-condition", l.id)
|
|
118
|
+
}, [
|
|
119
|
+
r(c(q), { size: 13 })
|
|
120
|
+
], 8, R)
|
|
121
|
+
]))), 128))
|
|
122
|
+
])),
|
|
123
|
+
i("div", X, [
|
|
124
|
+
i("button", {
|
|
125
|
+
class: "of-filter-panel__add-btn",
|
|
126
|
+
onClick: e[3] || (e[3] = (l) => a("add-condition"))
|
|
127
|
+
}, [
|
|
128
|
+
r(c(z), { size: 13 }),
|
|
129
|
+
e[6] || (e[6] = $(" 添加条件 ", -1))
|
|
130
|
+
]),
|
|
131
|
+
s.conditions.length ? (o(), n("button", {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: "of-filter-panel__clear",
|
|
134
|
+
onClick: e[4] || (e[4] = (l) => a("clear"))
|
|
135
|
+
}, " 清除全部 ")) : p("", !0)
|
|
136
|
+
])
|
|
137
|
+
])) : p("", !0);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
export {
|
|
141
|
+
H as default
|
|
142
|
+
};
|
|
@@ -5,6 +5,10 @@ type __VLS_Props = {
|
|
|
5
5
|
collapsed?: boolean;
|
|
6
6
|
colorMap?: ColorMap;
|
|
7
7
|
selectable?: boolean;
|
|
8
|
+
/** Nesting level for multi-level grouping (0-based) */
|
|
9
|
+
level?: number;
|
|
10
|
+
/** Aggregation results to display inline */
|
|
11
|
+
aggregations?: Record<string, number>;
|
|
8
12
|
};
|
|
9
13
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
14
|
toggle: () => any;
|
|
@@ -13,5 +17,6 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
13
17
|
}>, {
|
|
14
18
|
collapsed: boolean;
|
|
15
19
|
selectable: boolean;
|
|
20
|
+
level: number;
|
|
16
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
22
|
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as w, computed as u, openBlock as l, createElementBlock as a, normalizeStyle as p, createCommentVNode as g, createElementVNode as d, normalizeClass as k, createTextVNode as x, toDisplayString as n, Fragment as h, renderList as B } from "vue";
|
|
2
|
+
import { resolveBadge as C } from "../../composables/useBadge.js";
|
|
3
|
+
const N = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-table-group-row__checkbox-spacer"
|
|
6
|
+
}, K = {
|
|
7
|
+
key: 2,
|
|
8
|
+
class: "of-table-group-row__label"
|
|
9
|
+
}, L = { class: "of-table-group-row__count" }, T = /* @__PURE__ */ w({
|
|
10
|
+
name: "TableGroupRow",
|
|
11
|
+
__name: "TableGroupRow",
|
|
12
|
+
props: {
|
|
13
|
+
groupKey: {},
|
|
14
|
+
count: {},
|
|
15
|
+
collapsed: { type: Boolean, default: !1 },
|
|
16
|
+
colorMap: {},
|
|
17
|
+
selectable: { type: Boolean, default: !0 },
|
|
18
|
+
level: { default: 0 },
|
|
19
|
+
aggregations: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["toggle"],
|
|
22
|
+
setup(s, { emit: i }) {
|
|
23
|
+
const o = s, m = i, r = u(() => o.colorMap ? C(o.groupKey, o.colorMap) : null), b = u(() => o.groupKey || "(空)"), f = u(() => o.level * 16), _ = u(() => o.aggregations ? Object.entries(o.aggregations).map(([c, t]) => {
|
|
24
|
+
const [, e] = c.split(":"), y = e === "sum" ? "总计" : e === "avg" ? "平均" : e === "min" ? "最小" : e === "max" ? "最大" : "计数", v = typeof t == "number" && !Number.isInteger(t) ? t.toFixed(2) : String(t);
|
|
25
|
+
return { key: c, label: y, value: v };
|
|
26
|
+
}) : []);
|
|
27
|
+
return (c, t) => (l(), a("div", {
|
|
28
|
+
class: "of-table-group-row",
|
|
29
|
+
onClick: t[0] || (t[0] = (e) => m("toggle")),
|
|
30
|
+
style: p({ paddingLeft: `${12 + f.value}px` })
|
|
31
|
+
}, [
|
|
32
|
+
s.selectable ? (l(), a("div", N)) : g("", !0),
|
|
33
|
+
d("span", {
|
|
34
|
+
class: k(["of-table-group-row__chevron", { "of-table-group-row__chevron--collapsed": s.collapsed }])
|
|
35
|
+
}, "▼", 2),
|
|
36
|
+
r.value ? (l(), a("span", {
|
|
37
|
+
key: 1,
|
|
38
|
+
class: "of-table-group-row__badge",
|
|
39
|
+
style: p(r.value.style)
|
|
40
|
+
}, [
|
|
41
|
+
r.value.dot ? (l(), a("span", {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "of-table-group-row__badge-dot",
|
|
44
|
+
style: p({ background: r.value.dot })
|
|
45
|
+
}, null, 4)) : g("", !0),
|
|
46
|
+
x(" " + n(r.value.label), 1)
|
|
47
|
+
], 4)) : (l(), a("span", K, n(b.value), 1)),
|
|
48
|
+
d("span", L, "(" + n(s.count) + ")", 1),
|
|
49
|
+
(l(!0), a(h, null, B(_.value, (e) => (l(), a("span", {
|
|
50
|
+
key: e.key,
|
|
51
|
+
class: "of-table-group-row__agg"
|
|
52
|
+
}, n(e.label) + ": " + n(e.value), 1))), 128))
|
|
53
|
+
], 4));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
T as default
|
|
58
|
+
};
|
|
@@ -6,18 +6,34 @@ type __VLS_Props = {
|
|
|
6
6
|
sortOrder?: "asc" | "desc";
|
|
7
7
|
allSelected?: boolean;
|
|
8
8
|
indeterminate?: boolean;
|
|
9
|
+
enableResize?: boolean;
|
|
10
|
+
enableFieldMenu?: boolean;
|
|
11
|
+
enableAddField?: boolean;
|
|
9
12
|
};
|
|
10
13
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
14
|
sort: (key: string) => any;
|
|
12
15
|
"select-all": () => any;
|
|
16
|
+
"resize-start": (event: MouseEvent, colKey: string) => any;
|
|
17
|
+
"resize-dblclick": (colKey: string) => any;
|
|
18
|
+
"header-contextmenu": (event: MouseEvent, colKey: string) => any;
|
|
19
|
+
"header-dblclick": (colKey: string) => any;
|
|
20
|
+
"add-field": () => any;
|
|
13
21
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
22
|
onSort?: ((key: string) => any) | undefined;
|
|
15
23
|
"onSelect-all"?: (() => any) | undefined;
|
|
24
|
+
"onResize-start"?: ((event: MouseEvent, colKey: string) => any) | undefined;
|
|
25
|
+
"onResize-dblclick"?: ((colKey: string) => any) | undefined;
|
|
26
|
+
"onHeader-contextmenu"?: ((event: MouseEvent, colKey: string) => any) | undefined;
|
|
27
|
+
"onHeader-dblclick"?: ((colKey: string) => any) | undefined;
|
|
28
|
+
"onAdd-field"?: (() => any) | undefined;
|
|
16
29
|
}>, {
|
|
17
30
|
selectable: boolean;
|
|
18
31
|
sortKey: string;
|
|
19
32
|
sortOrder: "asc" | "desc";
|
|
20
33
|
allSelected: boolean;
|
|
21
34
|
indeterminate: boolean;
|
|
35
|
+
enableResize: boolean;
|
|
36
|
+
enableFieldMenu: boolean;
|
|
37
|
+
enableAddField: boolean;
|
|
22
38
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
23
39
|
export default _default;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as v, openBlock as o, createElementBlock as i, createElementVNode as c, createCommentVNode as f, Fragment as x, renderList as z, withModifiers as d, normalizeStyle as C, normalizeClass as w, toDisplayString as B, createBlock as u, unref as r, createVNode as S } from "vue";
|
|
2
|
+
import { ChevronUp as $, ChevronDown as k, Plus as g } from "lucide-vue-next";
|
|
3
|
+
const D = { class: "of-table-header" }, F = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-th of-th-checkbox"
|
|
6
|
+
}, M = ["checked", "indeterminate"], K = ["aria-sort", "onClick", "onContextmenu", "onDblclick"], O = { class: "of-th-label" }, R = { class: "of-th-sort-icon" }, N = ["onMousedown", "onDblclick"], E = /* @__PURE__ */ v({
|
|
7
|
+
__name: "TableHeaderRow",
|
|
8
|
+
props: {
|
|
9
|
+
columns: {},
|
|
10
|
+
selectable: { type: Boolean, default: !0 },
|
|
11
|
+
sortKey: { default: "" },
|
|
12
|
+
sortOrder: { default: "asc" },
|
|
13
|
+
allSelected: { type: Boolean, default: !1 },
|
|
14
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
15
|
+
enableResize: { type: Boolean, default: !1 },
|
|
16
|
+
enableFieldMenu: { type: Boolean, default: !1 },
|
|
17
|
+
enableAddField: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["sort", "select-all", "resize-start", "resize-dblclick", "header-contextmenu", "header-dblclick", "add-field"],
|
|
20
|
+
setup(e, { emit: h }) {
|
|
21
|
+
const s = h;
|
|
22
|
+
function y(n) {
|
|
23
|
+
if (n.width === "fill") {
|
|
24
|
+
const l = `${n.minWidth ?? 220}px`;
|
|
25
|
+
return { flex: `1 1 ${l}`, minWidth: l };
|
|
26
|
+
}
|
|
27
|
+
return { width: `${n.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
28
|
+
}
|
|
29
|
+
function m(n) {
|
|
30
|
+
s("sort", n);
|
|
31
|
+
}
|
|
32
|
+
function b(n, l) {
|
|
33
|
+
n.stopPropagation(), s("resize-start", n, l);
|
|
34
|
+
}
|
|
35
|
+
return (n, l) => (o(), i("div", D, [
|
|
36
|
+
e.selectable ? (o(), i("div", F, [
|
|
37
|
+
c("input", {
|
|
38
|
+
type: "checkbox",
|
|
39
|
+
class: "of-checkbox",
|
|
40
|
+
checked: e.allSelected,
|
|
41
|
+
indeterminate: e.indeterminate,
|
|
42
|
+
onChange: l[0] || (l[0] = (t) => s("select-all"))
|
|
43
|
+
}, null, 40, M)
|
|
44
|
+
])) : f("", !0),
|
|
45
|
+
(o(!0), i(x, null, z(e.columns, (t) => (o(), i("div", {
|
|
46
|
+
key: t.key,
|
|
47
|
+
role: "columnheader",
|
|
48
|
+
class: w(["of-th", { "of-th--sortable": !0, "of-th--active": e.sortKey === t.key }]),
|
|
49
|
+
style: C(y(t)),
|
|
50
|
+
"aria-sort": e.sortKey === t.key ? e.sortOrder === "asc" ? "ascending" : "descending" : "none",
|
|
51
|
+
onClick: (a) => m(t.key),
|
|
52
|
+
onContextmenu: d((a) => e.enableFieldMenu && s("header-contextmenu", a, t.key), ["prevent"]),
|
|
53
|
+
onDblclick: d((a) => e.enableFieldMenu && s("header-dblclick", t.key), ["stop"])
|
|
54
|
+
}, [
|
|
55
|
+
c("span", O, B(t.label), 1),
|
|
56
|
+
c("span", R, [
|
|
57
|
+
e.sortKey === t.key && e.sortOrder === "asc" ? (o(), u(r($), {
|
|
58
|
+
key: 0,
|
|
59
|
+
size: 12,
|
|
60
|
+
class: "of-sort-icon-active"
|
|
61
|
+
})) : e.sortKey === t.key && e.sortOrder === "desc" ? (o(), u(r(k), {
|
|
62
|
+
key: 1,
|
|
63
|
+
size: 12,
|
|
64
|
+
class: "of-sort-icon-active"
|
|
65
|
+
})) : (o(), u(r(k), {
|
|
66
|
+
key: 2,
|
|
67
|
+
size: 12,
|
|
68
|
+
class: "of-sort-icon-idle"
|
|
69
|
+
}))
|
|
70
|
+
]),
|
|
71
|
+
e.enableResize ? (o(), i("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "of-th-resizer",
|
|
74
|
+
onMousedown: (a) => b(a, t.key),
|
|
75
|
+
onDblclick: d((a) => s("resize-dblclick", t.key), ["stop"])
|
|
76
|
+
}, null, 40, N)) : f("", !0)
|
|
77
|
+
], 46, K))), 128)),
|
|
78
|
+
e.enableAddField ? (o(), i("div", {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: "of-th of-th-add",
|
|
81
|
+
onClick: l[1] || (l[1] = d((t) => s("add-field"), ["stop"]))
|
|
82
|
+
}, [
|
|
83
|
+
S(r(g), { size: 14 })
|
|
84
|
+
])) : f("", !0)
|
|
85
|
+
]));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
E as default
|
|
90
|
+
};
|