@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,135 @@
|
|
|
1
|
+
import { shallowRef as B, ref as d, computed as S, readonly as f, triggerRef as g } from "vue";
|
|
2
|
+
let D = !1;
|
|
3
|
+
function H(u = {}) {
|
|
4
|
+
const r = B(u.data ?? []), h = d(!1), p = d(null), i = d(/* @__PURE__ */ new Set()), n = d({ field: null, order: null }), t = d({
|
|
5
|
+
page: 1,
|
|
6
|
+
pageSize: u.pageSize ?? 20,
|
|
7
|
+
total: (u.data ?? []).length
|
|
8
|
+
});
|
|
9
|
+
function x(e) {
|
|
10
|
+
n.value.field === e ? (n.value.order = n.value.order === "asc" ? "desc" : n.value.order === "desc" ? null : "asc", n.value.order === null && (n.value.field = null)) : (n.value.field = e, n.value.order = "asc"), t.value.page = 1, i.value.clear(), u.serverSide && c();
|
|
11
|
+
}
|
|
12
|
+
function M(e, l) {
|
|
13
|
+
n.value = { field: e, order: l }, t.value.page = 1, i.value.clear(), u.serverSide && c();
|
|
14
|
+
}
|
|
15
|
+
function P(e) {
|
|
16
|
+
if (!n.value.field || !n.value.order) return e;
|
|
17
|
+
const l = n.value.field, a = n.value.order;
|
|
18
|
+
return [...e].sort((o, y) => {
|
|
19
|
+
const s = o[l], v = y[l];
|
|
20
|
+
if (s == null && v == null) return 0;
|
|
21
|
+
if (s == null) return 1;
|
|
22
|
+
if (v == null) return -1;
|
|
23
|
+
if (typeof s == "number" && typeof v == "number")
|
|
24
|
+
return a === "asc" ? s - v : v - s;
|
|
25
|
+
const R = String(s), b = String(v);
|
|
26
|
+
return a === "asc" ? R.localeCompare(b) : b.localeCompare(R);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function C(e) {
|
|
30
|
+
t.value.page = Math.max(1, Math.min(e, z.value)), u.serverSide && c();
|
|
31
|
+
}
|
|
32
|
+
function A(e) {
|
|
33
|
+
t.value.pageSize = e, t.value.page = 1, u.serverSide && c();
|
|
34
|
+
}
|
|
35
|
+
const z = S(
|
|
36
|
+
() => Math.max(1, Math.ceil(t.value.total / t.value.pageSize))
|
|
37
|
+
), w = S(() => {
|
|
38
|
+
if (u.serverSide) return r.value;
|
|
39
|
+
const e = P(r.value);
|
|
40
|
+
t.value.total = e.length;
|
|
41
|
+
const { page: l, pageSize: a } = t.value;
|
|
42
|
+
return e.slice((l - 1) * a, l * a);
|
|
43
|
+
});
|
|
44
|
+
function m(e, l) {
|
|
45
|
+
const a = e.id;
|
|
46
|
+
return a == null && !D && (D = !0, console.warn(
|
|
47
|
+
"[OneUI] DataTable: row is missing an `id` field. Row selection may behave incorrectly after sorting or filtering. Please ensure each row has a unique `id` property."
|
|
48
|
+
)), a ?? l;
|
|
49
|
+
}
|
|
50
|
+
function F(e, l) {
|
|
51
|
+
const a = m(e, l);
|
|
52
|
+
i.value.has(a) ? i.value.delete(a) : i.value.add(a);
|
|
53
|
+
}
|
|
54
|
+
function I(e) {
|
|
55
|
+
i.value.size === e.length ? i.value.clear() : e.forEach((l, a) => i.value.add(m(l, a)));
|
|
56
|
+
}
|
|
57
|
+
function T(e, l) {
|
|
58
|
+
return i.value.has(m(e, l));
|
|
59
|
+
}
|
|
60
|
+
function k() {
|
|
61
|
+
i.value.clear();
|
|
62
|
+
}
|
|
63
|
+
const q = S(() => i.value.size), E = S(
|
|
64
|
+
() => w.value.length > 0 && i.value.size === w.value.length
|
|
65
|
+
);
|
|
66
|
+
async function c() {
|
|
67
|
+
if (u.onFetch) {
|
|
68
|
+
h.value = !0, p.value = null;
|
|
69
|
+
try {
|
|
70
|
+
const e = await u.onFetch({
|
|
71
|
+
page: t.value.page,
|
|
72
|
+
pageSize: t.value.pageSize,
|
|
73
|
+
sort: n.value
|
|
74
|
+
});
|
|
75
|
+
r.value = e.data, g(r), t.value.total = e.total;
|
|
76
|
+
} catch (e) {
|
|
77
|
+
p.value = e;
|
|
78
|
+
} finally {
|
|
79
|
+
h.value = !1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function K() {
|
|
84
|
+
u.serverSide ? c() : t.value.page = 1;
|
|
85
|
+
}
|
|
86
|
+
function O(e) {
|
|
87
|
+
r.value = e, g(r), t.value.page = 1, u.serverSide || (t.value.total = e.length);
|
|
88
|
+
}
|
|
89
|
+
function U(e, l) {
|
|
90
|
+
const a = r.value, o = a.findIndex((y) => y.id === e);
|
|
91
|
+
o !== -1 && (a[o] = { ...a[o], ...l }, g(r));
|
|
92
|
+
}
|
|
93
|
+
function _(e, l) {
|
|
94
|
+
const a = r.value;
|
|
95
|
+
l !== void 0 && l >= 0 && l <= a.length ? a.splice(l, 0, e) : a.push(e), g(r), u.serverSide || (t.value.total = a.length);
|
|
96
|
+
}
|
|
97
|
+
function j(e) {
|
|
98
|
+
const l = new Set(e.map(String)), a = r.value;
|
|
99
|
+
r.value = a.filter(
|
|
100
|
+
(o) => !l.has(String(o.id))
|
|
101
|
+
), g(r);
|
|
102
|
+
for (const o of e)
|
|
103
|
+
i.value.delete(o);
|
|
104
|
+
u.serverSide || (t.value.total = r.value.length);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
data: w,
|
|
108
|
+
rawData: f(r),
|
|
109
|
+
loading: f(h),
|
|
110
|
+
error: f(p),
|
|
111
|
+
sort: f(n),
|
|
112
|
+
pagination: f(t),
|
|
113
|
+
totalPages: z,
|
|
114
|
+
selectedRows: f(i),
|
|
115
|
+
selectedCount: q,
|
|
116
|
+
isAllSelected: E,
|
|
117
|
+
toggleSort: x,
|
|
118
|
+
setSort: M,
|
|
119
|
+
setPage: C,
|
|
120
|
+
setPageSize: A,
|
|
121
|
+
toggleRowSelection: F,
|
|
122
|
+
toggleSelectAll: I,
|
|
123
|
+
isRowSelected: T,
|
|
124
|
+
clearSelection: k,
|
|
125
|
+
refresh: K,
|
|
126
|
+
fetchData: c,
|
|
127
|
+
setData: O,
|
|
128
|
+
patchRow: U,
|
|
129
|
+
insertRow: _,
|
|
130
|
+
removeRows: j
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
H as useTable
|
|
135
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { computed as c } from "vue";
|
|
2
|
+
import { DEFAULT_TABLE_COLUMNS as v } from "../constants/table.js";
|
|
3
|
+
function d(e) {
|
|
4
|
+
return e.type === "number" || e.type === "date" ? e.type : e.type === "select" ? "status" : "string";
|
|
5
|
+
}
|
|
6
|
+
function f(e) {
|
|
7
|
+
return {
|
|
8
|
+
key: e.id,
|
|
9
|
+
label: e.name,
|
|
10
|
+
width: e.width,
|
|
11
|
+
type: d(e)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function T(e) {
|
|
15
|
+
return { columns: c(() => {
|
|
16
|
+
var u, t, i, n, r, s, m, a;
|
|
17
|
+
return (t = (u = e.columns) == null ? void 0 : u.value) != null && t.length ? e.columns.value : (r = (n = (i = e.schema) == null ? void 0 : i.value) == null ? void 0 : n.fields) != null && r.length ? ((a = (m = (s = e.view) == null ? void 0 : s.value) == null ? void 0 : m.visibleFields) != null && a.length ? e.schema.value.fields.filter(
|
|
18
|
+
(l) => e.view.value.visibleFields.includes(l.id)
|
|
19
|
+
) : e.schema.value.fields).filter((l) => !l.hidden).map(f) : v;
|
|
20
|
+
}) };
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
T as useTableColumns
|
|
24
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { computed as d } from "vue";
|
|
2
|
+
function n(t) {
|
|
3
|
+
return { rows: d(() => {
|
|
4
|
+
var a, r, u;
|
|
5
|
+
return (r = (a = t.records) == null ? void 0 : a.value) != null && r.length ? t.records.value.map((e) => ({
|
|
6
|
+
id: e.id,
|
|
7
|
+
...e.fields,
|
|
8
|
+
createdAt: e.createdAt,
|
|
9
|
+
updatedAt: e.updatedAt,
|
|
10
|
+
__record: e
|
|
11
|
+
})) : ((u = t.tasks) == null ? void 0 : u.value) ?? [];
|
|
12
|
+
}) };
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
n as useTableData
|
|
16
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { shallowRef as m, ref as _, computed as p, readonly as g, triggerRef as o } from "vue";
|
|
2
|
+
const h = [
|
|
3
|
+
{ value: "contains", label: "包含" },
|
|
4
|
+
{ value: "not_contains", label: "不包含" },
|
|
5
|
+
{ value: "equals", label: "等于" },
|
|
6
|
+
{ value: "not_equals", label: "不等于" },
|
|
7
|
+
{ value: "starts_with", label: "开头是" },
|
|
8
|
+
{ value: "ends_with", label: "结尾是" },
|
|
9
|
+
{ value: "is_empty", label: "为空" },
|
|
10
|
+
{ value: "is_not_empty", label: "不为空" }
|
|
11
|
+
], y = [
|
|
12
|
+
{ value: "equals", label: "等于" },
|
|
13
|
+
{ value: "not_equals", label: "不等于" },
|
|
14
|
+
{ value: "gt", label: "大于" },
|
|
15
|
+
{ value: "gte", label: "大于等于" },
|
|
16
|
+
{ value: "lt", label: "小于" },
|
|
17
|
+
{ value: "lte", label: "小于等于" },
|
|
18
|
+
{ value: "is_empty", label: "为空" },
|
|
19
|
+
{ value: "is_not_empty", label: "不为空" }
|
|
20
|
+
];
|
|
21
|
+
function N() {
|
|
22
|
+
return Math.random().toString(36).slice(2, 8);
|
|
23
|
+
}
|
|
24
|
+
function w(n, e) {
|
|
25
|
+
const t = String(n ?? "").toLowerCase(), r = e.value.toLowerCase();
|
|
26
|
+
switch (e.operator) {
|
|
27
|
+
case "equals":
|
|
28
|
+
return t === r;
|
|
29
|
+
case "not_equals":
|
|
30
|
+
return t !== r;
|
|
31
|
+
case "contains":
|
|
32
|
+
return t.includes(r);
|
|
33
|
+
case "not_contains":
|
|
34
|
+
return !t.includes(r);
|
|
35
|
+
case "starts_with":
|
|
36
|
+
return t.startsWith(r);
|
|
37
|
+
case "ends_with":
|
|
38
|
+
return t.endsWith(r);
|
|
39
|
+
case "is_empty":
|
|
40
|
+
return t === "" || n == null;
|
|
41
|
+
case "is_not_empty":
|
|
42
|
+
return t !== "" && n != null;
|
|
43
|
+
case "gt":
|
|
44
|
+
return Number(n) > Number(e.value);
|
|
45
|
+
case "gte":
|
|
46
|
+
return Number(n) >= Number(e.value);
|
|
47
|
+
case "lt":
|
|
48
|
+
return Number(n) < Number(e.value);
|
|
49
|
+
case "lte":
|
|
50
|
+
return Number(n) <= Number(e.value);
|
|
51
|
+
default:
|
|
52
|
+
return !0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function C(n = {}) {
|
|
56
|
+
const e = m([]), t = _("and"), r = p(() => e.value.length > 0);
|
|
57
|
+
function i(l) {
|
|
58
|
+
var u, a;
|
|
59
|
+
e.value.push({
|
|
60
|
+
id: N(),
|
|
61
|
+
field: l ?? ((a = (u = n.columns) == null ? void 0 : u[0]) == null ? void 0 : a.key) ?? "",
|
|
62
|
+
operator: "contains",
|
|
63
|
+
value: ""
|
|
64
|
+
}), o(e);
|
|
65
|
+
}
|
|
66
|
+
function c(l) {
|
|
67
|
+
e.value = e.value.filter((u) => u.id !== l), o(e);
|
|
68
|
+
}
|
|
69
|
+
function v(l, u) {
|
|
70
|
+
const a = e.value.findIndex((s) => s.id === l);
|
|
71
|
+
a !== -1 && (e.value[a] = { ...e.value[a], ...u }, o(e));
|
|
72
|
+
}
|
|
73
|
+
function b() {
|
|
74
|
+
e.value = [], o(e);
|
|
75
|
+
}
|
|
76
|
+
function d(l) {
|
|
77
|
+
return e.value.length ? l.filter((u) => {
|
|
78
|
+
const a = e.value.map((s) => s.field ? w(u[s.field], s) : !0);
|
|
79
|
+
return t.value === "and" ? a.every(Boolean) : a.some(Boolean);
|
|
80
|
+
}) : l;
|
|
81
|
+
}
|
|
82
|
+
const f = (l) => l === "number" ? y : h;
|
|
83
|
+
return {
|
|
84
|
+
conditions: g(e),
|
|
85
|
+
logic: t,
|
|
86
|
+
isActive: r,
|
|
87
|
+
addCondition: i,
|
|
88
|
+
removeCondition: c,
|
|
89
|
+
updateCondition: v,
|
|
90
|
+
clearConditions: b,
|
|
91
|
+
filterData: d,
|
|
92
|
+
operatorsFor: f
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
C as useTableFilter
|
|
97
|
+
};
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
+
import { AggregationConfig } from '../types';
|
|
3
|
+
export interface GroupConfig {
|
|
4
|
+
fieldId: string;
|
|
5
|
+
}
|
|
2
6
|
export interface UseTableGroupOptions<T> {
|
|
3
7
|
data: Ref<T[]>;
|
|
4
|
-
groupBy
|
|
8
|
+
/** Single groupBy field (backwards-compatible) */
|
|
9
|
+
groupBy?: Ref<string | undefined>;
|
|
10
|
+
/** Multi-level group configs (takes priority over groupBy) */
|
|
11
|
+
groups?: Ref<GroupConfig[] | undefined>;
|
|
12
|
+
/** Aggregation configs applied to each group */
|
|
13
|
+
aggregations?: Ref<AggregationConfig[] | undefined>;
|
|
5
14
|
}
|
|
6
15
|
export type GroupHeaderItem = {
|
|
7
16
|
__type: "group-header";
|
|
8
17
|
__groupKey: string;
|
|
18
|
+
/** Full path for nested groups, e.g. ['status:done', 'priority:P0'] */
|
|
19
|
+
__groupPath: string[];
|
|
20
|
+
__groupLevel: number;
|
|
9
21
|
__groupCount: number;
|
|
22
|
+
__aggregations?: Record<string, number>;
|
|
10
23
|
id: string;
|
|
11
24
|
};
|
|
12
25
|
export type GroupedListItem<T> = (T & {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ref as G, computed as h, watch as I } from "vue";
|
|
2
|
+
import { computeAggregations as L } from "../utils/aggregation.js";
|
|
3
|
+
function b(r) {
|
|
4
|
+
const n = G(/* @__PURE__ */ new Set());
|
|
5
|
+
function p(e) {
|
|
6
|
+
const t = new Set(n.value);
|
|
7
|
+
t.has(e) ? t.delete(e) : t.add(e), n.value = t;
|
|
8
|
+
}
|
|
9
|
+
const f = h(() => {
|
|
10
|
+
var t, s;
|
|
11
|
+
if ((t = r.groups) != null && t.value && r.groups.value.length > 0)
|
|
12
|
+
return r.groups.value;
|
|
13
|
+
const e = (s = r.groupBy) == null ? void 0 : s.value;
|
|
14
|
+
return e ? [{ fieldId: e }] : [];
|
|
15
|
+
});
|
|
16
|
+
I(f, () => {
|
|
17
|
+
n.value = /* @__PURE__ */ new Set();
|
|
18
|
+
});
|
|
19
|
+
const d = h(() => {
|
|
20
|
+
var _;
|
|
21
|
+
const e = r.data.value, t = f.value;
|
|
22
|
+
if (t.length === 0)
|
|
23
|
+
return e.map((o) => ({ ...o, __type: "data-row" }));
|
|
24
|
+
const s = ((_ = r.aggregations) == null ? void 0 : _.value) ?? [], l = n.value, a = [];
|
|
25
|
+
return v(e, t, 0, [], l, s, a), a;
|
|
26
|
+
});
|
|
27
|
+
function g(e) {
|
|
28
|
+
return e && e.__type === "group-header";
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
groupedItems: d,
|
|
32
|
+
collapsedGroups: n,
|
|
33
|
+
toggleGroup: p,
|
|
34
|
+
isGroupHeader: g
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function v(r, n, p, f, d, g, e) {
|
|
38
|
+
const t = n[p];
|
|
39
|
+
if (!t) {
|
|
40
|
+
for (const o of r)
|
|
41
|
+
e.push({ ...o, __type: "data-row" });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const s = t.fieldId, l = [], a = /* @__PURE__ */ new Map();
|
|
45
|
+
for (const o of r) {
|
|
46
|
+
const c = o[s], u = c != null ? String(c) : "";
|
|
47
|
+
a.has(u) || (l.push(u), a.set(u, [])), a.get(u).push(o);
|
|
48
|
+
}
|
|
49
|
+
const _ = p === n.length - 1;
|
|
50
|
+
for (const o of l) {
|
|
51
|
+
const c = a.get(o), u = [...f, `${s}:${o}`], i = u.join("/"), w = g.length > 0 ? L(c, g) : void 0, y = {
|
|
52
|
+
__type: "group-header",
|
|
53
|
+
__groupKey: o,
|
|
54
|
+
__groupPath: u,
|
|
55
|
+
__groupLevel: p,
|
|
56
|
+
__groupCount: c.length,
|
|
57
|
+
__aggregations: w,
|
|
58
|
+
id: `__group__${i}`
|
|
59
|
+
};
|
|
60
|
+
if (e.push(y), !d.has(i))
|
|
61
|
+
if (_)
|
|
62
|
+
for (const m of c)
|
|
63
|
+
e.push({ ...m, __type: "data-row" });
|
|
64
|
+
else
|
|
65
|
+
v(c, n, p + 1, u, d, g, e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
b as useTableGroup
|
|
70
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { reactive as d } from "vue";
|
|
2
|
+
const n = d([]);
|
|
3
|
+
let s = 0;
|
|
4
|
+
function u(t, e, r) {
|
|
5
|
+
const a = `toast-${Date.now()}-${s++}`, i = {
|
|
6
|
+
id: a,
|
|
7
|
+
type: t,
|
|
8
|
+
message: e,
|
|
9
|
+
title: r == null ? void 0 : r.title,
|
|
10
|
+
duration: (r == null ? void 0 : r.duration) ?? 3e3
|
|
11
|
+
};
|
|
12
|
+
return n.push(i), i.duration && i.duration > 0 && setTimeout(() => c(a), i.duration), a;
|
|
13
|
+
}
|
|
14
|
+
function c(t) {
|
|
15
|
+
const e = n.findIndex((r) => r.id === t);
|
|
16
|
+
e !== -1 && n.splice(e, 1);
|
|
17
|
+
}
|
|
18
|
+
function o() {
|
|
19
|
+
return {
|
|
20
|
+
/** 响应式 toast 列表 */
|
|
21
|
+
toasts: n,
|
|
22
|
+
/** 显示 info 类型通知 */
|
|
23
|
+
info: (t, e) => u("info", t, e),
|
|
24
|
+
/** 显示 success 类型通知 */
|
|
25
|
+
success: (t, e) => u("success", t, e),
|
|
26
|
+
/** 显示 warning 类型通知 */
|
|
27
|
+
warning: (t, e) => u("warning", t, e),
|
|
28
|
+
/** 显示 error 类型通知 */
|
|
29
|
+
error: (t, e) => u("error", t, e),
|
|
30
|
+
/** 移除指定 id 的 toast */
|
|
31
|
+
remove: c,
|
|
32
|
+
/** 清除所有 toast */
|
|
33
|
+
clear: () => n.splice(0, n.length)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
o as useToast
|
|
38
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ref as h, readonly as g } from "vue";
|
|
2
|
+
function U(e = {}) {
|
|
3
|
+
const a = h(""), u = h(!1);
|
|
4
|
+
let f = "", r = 0, t = null, c = null;
|
|
5
|
+
const v = e.speed ?? 20;
|
|
6
|
+
function m() {
|
|
7
|
+
t !== null && (cancelAnimationFrame(t), t = null), c !== null && (clearTimeout(c), c = null);
|
|
8
|
+
}
|
|
9
|
+
function i() {
|
|
10
|
+
var l, n;
|
|
11
|
+
if (r >= f.length) {
|
|
12
|
+
u.value = !1, c = null, (l = e.onComplete) == null || l.call(e);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
a.value = f.slice(0, ++r), (n = e.onUpdate) == null || n.call(e, a.value), u.value && (c = setTimeout(i, v));
|
|
16
|
+
}
|
|
17
|
+
function x() {
|
|
18
|
+
if (typeof document < "u" && document.hidden) {
|
|
19
|
+
i();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let l = 0;
|
|
23
|
+
function n(d) {
|
|
24
|
+
var T, y;
|
|
25
|
+
if (l || (l = d), d - l >= v) {
|
|
26
|
+
if (l = d, r >= f.length) {
|
|
27
|
+
u.value = !1, t = null, (T = e.onComplete) == null || T.call(e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
a.value = f.slice(0, ++r), (y = e.onUpdate) == null || y.call(e, a.value);
|
|
31
|
+
}
|
|
32
|
+
u.value && (t = requestAnimationFrame(n));
|
|
33
|
+
}
|
|
34
|
+
t = requestAnimationFrame(n);
|
|
35
|
+
}
|
|
36
|
+
function A(l) {
|
|
37
|
+
f += l, u.value || (u.value = !0, x());
|
|
38
|
+
}
|
|
39
|
+
function C() {
|
|
40
|
+
m(), f = "", r = 0, a.value = "", u.value = !1;
|
|
41
|
+
}
|
|
42
|
+
function F() {
|
|
43
|
+
var l, n;
|
|
44
|
+
m(), a.value = f, r = f.length, u.value = !1, (l = e.onUpdate) == null || l.call(e, a.value), (n = e.onComplete) == null || n.call(e);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
displayText: g(a),
|
|
48
|
+
isTyping: g(u),
|
|
49
|
+
append: A,
|
|
50
|
+
reset: C,
|
|
51
|
+
flush: F
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
U as useTypewriter
|
|
56
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ViewConfig } from '../types';
|
|
2
|
+
export interface ViewStorageBackend {
|
|
3
|
+
/** 加载指定表的所有视图 */
|
|
4
|
+
load(tableId: string): Promise<ViewConfig[]>;
|
|
5
|
+
/** 保存/更新视图 */
|
|
6
|
+
save(tableId: string, view: ViewConfig): Promise<void>;
|
|
7
|
+
/** 删除视图 */
|
|
8
|
+
remove(tableId: string, viewId: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createLocalStorageBackend(): ViewStorageBackend;
|
|
11
|
+
export interface SupabaseViewBackendOptions {
|
|
12
|
+
/** Supabase client (最小接口:from().select/insert/update/delete) */
|
|
13
|
+
client: {
|
|
14
|
+
from(table: string): any;
|
|
15
|
+
};
|
|
16
|
+
/** 存储视图配置的表名,默认 'view_configs' */
|
|
17
|
+
tableName?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function createSupabaseBackend(options: SupabaseViewBackendOptions): ViewStorageBackend;
|
|
20
|
+
export interface UseViewPersistenceOptions {
|
|
21
|
+
/** 表 ID */
|
|
22
|
+
tableId: string;
|
|
23
|
+
/** 存储后端,默认 localStorage */
|
|
24
|
+
backend?: ViewStorageBackend;
|
|
25
|
+
/** 默认视图(当没有保存的视图时使用) */
|
|
26
|
+
defaultView?: ViewConfig;
|
|
27
|
+
/** 是否自动加载(默认 true) */
|
|
28
|
+
autoLoad?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function useViewPersistence(options: UseViewPersistenceOptions): {
|
|
31
|
+
views: Readonly<import('vue').Ref<readonly {
|
|
32
|
+
readonly viewId: string;
|
|
33
|
+
readonly viewType: import('..').ViewType;
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly visibleFields: readonly string[];
|
|
36
|
+
readonly sorts?: readonly {
|
|
37
|
+
readonly fieldId: string;
|
|
38
|
+
readonly direction: "asc" | "desc";
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
readonly groups?: readonly {
|
|
41
|
+
readonly fieldId: string;
|
|
42
|
+
}[] | undefined;
|
|
43
|
+
readonly filters?: readonly {
|
|
44
|
+
readonly fieldId: string;
|
|
45
|
+
readonly operator: "eq" | "neq" | "contains" | "gt" | "lt" | "is_empty" | "is_not_empty";
|
|
46
|
+
readonly value?: string | number | boolean | readonly string[] | null | undefined;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
readonly kanbanFieldId?: string | undefined;
|
|
49
|
+
readonly galleryCoverFieldId?: string | undefined;
|
|
50
|
+
readonly galleryCardFields?: readonly string[] | undefined;
|
|
51
|
+
readonly aggregations?: readonly {
|
|
52
|
+
readonly fieldId: string;
|
|
53
|
+
readonly fn: import('..').AggregationFn;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
readonly fixedColumns?: readonly string[] | undefined;
|
|
56
|
+
}[], readonly {
|
|
57
|
+
readonly viewId: string;
|
|
58
|
+
readonly viewType: import('..').ViewType;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly visibleFields: readonly string[];
|
|
61
|
+
readonly sorts?: readonly {
|
|
62
|
+
readonly fieldId: string;
|
|
63
|
+
readonly direction: "asc" | "desc";
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
readonly groups?: readonly {
|
|
66
|
+
readonly fieldId: string;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
readonly filters?: readonly {
|
|
69
|
+
readonly fieldId: string;
|
|
70
|
+
readonly operator: "eq" | "neq" | "contains" | "gt" | "lt" | "is_empty" | "is_not_empty";
|
|
71
|
+
readonly value?: string | number | boolean | readonly string[] | null | undefined;
|
|
72
|
+
}[] | undefined;
|
|
73
|
+
readonly kanbanFieldId?: string | undefined;
|
|
74
|
+
readonly galleryCoverFieldId?: string | undefined;
|
|
75
|
+
readonly galleryCardFields?: readonly string[] | undefined;
|
|
76
|
+
readonly aggregations?: readonly {
|
|
77
|
+
readonly fieldId: string;
|
|
78
|
+
readonly fn: import('..').AggregationFn;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
readonly fixedColumns?: readonly string[] | undefined;
|
|
81
|
+
}[]>>;
|
|
82
|
+
activeView: import('vue').ComputedRef<ViewConfig>;
|
|
83
|
+
activeViewId: import('vue').Ref<string, string>;
|
|
84
|
+
viewList: import('vue').ComputedRef<{
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
type: import('..').ViewType;
|
|
88
|
+
}[]>;
|
|
89
|
+
loading: Readonly<import('vue').Ref<boolean, boolean>>;
|
|
90
|
+
error: Readonly<import('vue').Ref<Error | null, Error | null>>;
|
|
91
|
+
loadViews: () => Promise<void>;
|
|
92
|
+
saveView: (config?: Partial<ViewConfig>) => Promise<void>;
|
|
93
|
+
createView: (name: string, baseConfig?: Partial<ViewConfig>) => Promise<string>;
|
|
94
|
+
deleteView: (viewId: string) => Promise<void>;
|
|
95
|
+
switchView: (viewId: string) => void;
|
|
96
|
+
duplicateView: (sourceViewId: string, newName: string) => Promise<string>;
|
|
97
|
+
updateActiveView: (patch: Partial<ViewConfig>) => void;
|
|
98
|
+
};
|