@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,43 @@
|
|
|
1
|
+
import { FieldDef as CellFieldDef } from './FieldCell.vue';
|
|
2
|
+
import { TableColumn } from '../../types';
|
|
3
|
+
type TableRow = Record<string, unknown> & {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
row: TableRow;
|
|
8
|
+
columns: TableColumn[];
|
|
9
|
+
fieldDefs?: CellFieldDef[];
|
|
10
|
+
visible: boolean;
|
|
11
|
+
/** 标记哪些字段是 content 字段(全宽 markdown 渲染) */
|
|
12
|
+
contentFields?: string[];
|
|
13
|
+
/** 是否显示为全屏模式(桌面端宽面板) */
|
|
14
|
+
fullPage?: boolean;
|
|
15
|
+
/** 只读模式 */
|
|
16
|
+
readonly?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
delete: (rowId: string) => any;
|
|
20
|
+
close: () => any;
|
|
21
|
+
save: (payload: {
|
|
22
|
+
rowId: string;
|
|
23
|
+
fields: Record<string, unknown>;
|
|
24
|
+
}) => any;
|
|
25
|
+
"cell-edit": (payload: {
|
|
26
|
+
rowId: string;
|
|
27
|
+
fieldId: string;
|
|
28
|
+
value: unknown;
|
|
29
|
+
}) => any;
|
|
30
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
onDelete?: ((rowId: string) => any) | undefined;
|
|
32
|
+
onClose?: (() => any) | undefined;
|
|
33
|
+
onSave?: ((payload: {
|
|
34
|
+
rowId: string;
|
|
35
|
+
fields: Record<string, unknown>;
|
|
36
|
+
}) => any) | undefined;
|
|
37
|
+
"onCell-edit"?: ((payload: {
|
|
38
|
+
rowId: string;
|
|
39
|
+
fieldId: string;
|
|
40
|
+
value: unknown;
|
|
41
|
+
}) => any) | undefined;
|
|
42
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent as V, ref as L, computed as c, openBlock as o, createBlock as k, Teleport as N, createVNode as E, Transition as H, withCtx as j, createElementBlock as d, withModifiers as z, normalizeClass as h, createElementVNode as n, Fragment as b, renderList as C, toDisplayString as v, createCommentVNode as g } from "vue";
|
|
2
|
+
import O from "./FieldCell.vue.js";
|
|
3
|
+
import { useMarkdown as R } from "../../composables/useMarkdown.js";
|
|
4
|
+
const q = { class: "of-detail-sheet__properties" }, A = { class: "of-detail-sheet__label" }, G = { class: "of-detail-sheet__cell" }, I = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "of-detail-sheet__value"
|
|
7
|
+
}, J = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "of-detail-sheet__content"
|
|
10
|
+
}, Q = { class: "of-detail-sheet__content-label" }, U = ["innerHTML"], W = { class: "of-detail-sheet__footer" }, X = ["disabled"], K = /* @__PURE__ */ V({
|
|
11
|
+
__name: "DetailSheet",
|
|
12
|
+
props: {
|
|
13
|
+
row: {},
|
|
14
|
+
columns: {},
|
|
15
|
+
fieldDefs: {},
|
|
16
|
+
visible: { type: Boolean },
|
|
17
|
+
contentFields: {},
|
|
18
|
+
fullPage: { type: Boolean },
|
|
19
|
+
readonly: { type: Boolean }
|
|
20
|
+
},
|
|
21
|
+
emits: ["close", "save", "delete", "cell-edit"],
|
|
22
|
+
setup(s, { emit: p }) {
|
|
23
|
+
const i = s, r = p, { renderMarkdown: w } = R({ showCopyButton: !0 }), a = L({}), D = c(() => Object.keys(a.value).length > 0), B = c(() => new Set(i.contentFields ?? []));
|
|
24
|
+
function m(t) {
|
|
25
|
+
var l;
|
|
26
|
+
if (B.value.has(t.key)) return !0;
|
|
27
|
+
const e = (l = i.fieldDefs) == null ? void 0 : l.find((f) => f.id === t.key);
|
|
28
|
+
return (e == null ? void 0 : e.type) === "richtext";
|
|
29
|
+
}
|
|
30
|
+
const F = c(() => i.columns.filter((t) => !m(t))), y = c(() => i.columns.filter((t) => m(t)));
|
|
31
|
+
function x(t) {
|
|
32
|
+
var e;
|
|
33
|
+
return ((e = i.fieldDefs) == null ? void 0 : e.find((l) => l.id === t)) ?? {
|
|
34
|
+
id: t,
|
|
35
|
+
type: "text",
|
|
36
|
+
label: t
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function u(t) {
|
|
40
|
+
return t.key in a.value ? a.value[t.key] : i.row[t.key];
|
|
41
|
+
}
|
|
42
|
+
function M(t) {
|
|
43
|
+
const e = u(t);
|
|
44
|
+
return typeof e != "string" || !e ? "" : w(e);
|
|
45
|
+
}
|
|
46
|
+
function S(t, e, l) {
|
|
47
|
+
a.value = { ...a.value, [e]: l }, r("cell-edit", { rowId: t, fieldId: e, value: l });
|
|
48
|
+
}
|
|
49
|
+
function P() {
|
|
50
|
+
r("save", { rowId: i.row.id, fields: { ...a.value } }), a.value = {}, r("close");
|
|
51
|
+
}
|
|
52
|
+
function _() {
|
|
53
|
+
a.value = {}, r("close");
|
|
54
|
+
}
|
|
55
|
+
function T() {
|
|
56
|
+
r("delete", i.row.id), r("close");
|
|
57
|
+
}
|
|
58
|
+
return (t, e) => (o(), k(N, { to: "body" }, [
|
|
59
|
+
E(H, { name: "of-sheet" }, {
|
|
60
|
+
default: j(() => [
|
|
61
|
+
s.visible ? (o(), d("div", {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: h(["of-detail-sheet-overlay", { "of-detail-sheet-overlay--full-page": s.fullPage }]),
|
|
64
|
+
onClick: z(_, ["self"])
|
|
65
|
+
}, [
|
|
66
|
+
n("div", {
|
|
67
|
+
class: h(["of-detail-sheet", { "of-detail-sheet--full-page": s.fullPage }])
|
|
68
|
+
}, [
|
|
69
|
+
n("div", { class: "of-detail-sheet__header" }, [
|
|
70
|
+
n("button", {
|
|
71
|
+
class: "of-detail-sheet__close",
|
|
72
|
+
onClick: _
|
|
73
|
+
}, "✕"),
|
|
74
|
+
e[0] || (e[0] = n("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
|
|
75
|
+
e[1] || (e[1] = n("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
|
|
76
|
+
]),
|
|
77
|
+
n("div", {
|
|
78
|
+
class: h(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": s.fullPage }])
|
|
79
|
+
}, [
|
|
80
|
+
n("div", q, [
|
|
81
|
+
(o(!0), d(b, null, C(F.value, (l) => {
|
|
82
|
+
var f;
|
|
83
|
+
return o(), d("div", {
|
|
84
|
+
key: l.key,
|
|
85
|
+
class: "of-detail-sheet__field"
|
|
86
|
+
}, [
|
|
87
|
+
n("label", A, v(l.label), 1),
|
|
88
|
+
n("div", G, [
|
|
89
|
+
(f = s.fieldDefs) != null && f.length ? (o(), k(O, {
|
|
90
|
+
key: 0,
|
|
91
|
+
"row-id": s.row.id,
|
|
92
|
+
field: x(l.key),
|
|
93
|
+
value: u(l),
|
|
94
|
+
readonly: s.readonly,
|
|
95
|
+
onCommit: S
|
|
96
|
+
}, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), d("span", I, v(u(l) ?? "—"), 1))
|
|
97
|
+
])
|
|
98
|
+
]);
|
|
99
|
+
}), 128))
|
|
100
|
+
]),
|
|
101
|
+
y.value.length > 0 ? (o(), d("div", J, [
|
|
102
|
+
(o(!0), d(b, null, C(y.value, (l) => (o(), d("div", {
|
|
103
|
+
key: l.key,
|
|
104
|
+
class: "of-detail-sheet__content-block"
|
|
105
|
+
}, [
|
|
106
|
+
n("label", Q, v(l.label), 1),
|
|
107
|
+
n("div", {
|
|
108
|
+
class: "of-detail-sheet__markdown of-markdown",
|
|
109
|
+
innerHTML: M(l)
|
|
110
|
+
}, null, 8, U)
|
|
111
|
+
]))), 128))
|
|
112
|
+
])) : g("", !0)
|
|
113
|
+
], 2),
|
|
114
|
+
n("div", W, [
|
|
115
|
+
n("button", {
|
|
116
|
+
class: "of-detail-sheet__btn of-detail-sheet__btn--delete",
|
|
117
|
+
onClick: T
|
|
118
|
+
}, " 删除 "),
|
|
119
|
+
e[2] || (e[2] = n("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
|
|
120
|
+
n("button", {
|
|
121
|
+
class: "of-detail-sheet__btn of-detail-sheet__btn--cancel",
|
|
122
|
+
onClick: _
|
|
123
|
+
}, " 取消 "),
|
|
124
|
+
n("button", {
|
|
125
|
+
class: "of-detail-sheet__btn of-detail-sheet__btn--save",
|
|
126
|
+
disabled: !D.value,
|
|
127
|
+
onClick: P
|
|
128
|
+
}, " 保存 ", 8, X)
|
|
129
|
+
])
|
|
130
|
+
], 2)
|
|
131
|
+
], 2)) : g("", !0)
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
]));
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
K as default
|
|
140
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type FieldType = "text" | "number" | "checkbox" | "select" | "multiselect" | "date" | "datetime" | "rating" | "url" | "email";
|
|
1
|
+
export type FieldType = "text" | "number" | "checkbox" | "select" | "multiselect" | "date" | "datetime" | "rating" | "url" | "email" | "currency" | "richtext" | "auto_number" | "creator" | "progress" | "relation" | "attachment" | "phone";
|
|
2
2
|
export interface FieldOption {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent as I, computed as n, defineAsyncComponent as e, openBlock as o, createElementBlock as a, normalizeClass as N, createBlock as c, Suspense as B, withCtx as f, resolveDynamicComponent as A, createElementVNode as S, Fragment as F, toDisplayString as D } from "vue";
|
|
2
|
+
import { useInlineEdit as M } from "../../composables/useInlineEdit.js";
|
|
3
|
+
import T from "../field/FieldMarkdownPreview.vue.js";
|
|
4
|
+
const V = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "of-field-cell__display"
|
|
7
|
+
}, R = /* @__PURE__ */ I({
|
|
8
|
+
__name: "FieldCell",
|
|
9
|
+
props: {
|
|
10
|
+
rowId: {},
|
|
11
|
+
field: {},
|
|
12
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
13
|
+
readonly: { type: Boolean, default: !1 }
|
|
14
|
+
},
|
|
15
|
+
emits: ["commit", "cancel", "tabNext"],
|
|
16
|
+
setup(l, { emit: s }) {
|
|
17
|
+
const t = l, r = s, { isEditing: p, activate: y, commit: v, cancel: k } = M(), d = n(() => p(t.rowId, t.field.id)), m = n(() => t.readonly || t.field.readonly);
|
|
18
|
+
function x() {
|
|
19
|
+
m.value || y(t.rowId, t.field.id);
|
|
20
|
+
}
|
|
21
|
+
function C(i) {
|
|
22
|
+
v(t.rowId, t.field.id, i), r("commit", t.rowId, t.field.id, i);
|
|
23
|
+
}
|
|
24
|
+
function g() {
|
|
25
|
+
k(), r("cancel");
|
|
26
|
+
}
|
|
27
|
+
function b() {
|
|
28
|
+
r("tabNext");
|
|
29
|
+
}
|
|
30
|
+
const h = {
|
|
31
|
+
text: e(() => import("../field/FieldText.vue.js")),
|
|
32
|
+
number: e(() => import("../field/FieldNumber.vue.js")),
|
|
33
|
+
checkbox: e(() => import("../field/FieldCheckbox.vue.js")),
|
|
34
|
+
select: e(() => import("../field/FieldSelect.vue.js")),
|
|
35
|
+
multiselect: e(() => import("../field/FieldMultiSelect.vue.js")),
|
|
36
|
+
date: e(() => import("../field/FieldDate.vue.js")),
|
|
37
|
+
datetime: e(() => import("../field/FieldDatetime.vue.js")),
|
|
38
|
+
rating: e(() => import("../field/FieldRating.vue.js")),
|
|
39
|
+
url: e(() => import("../field/FieldUrl.vue.js")),
|
|
40
|
+
email: e(() => import("../field/FieldEmail.vue.js")),
|
|
41
|
+
currency: e(() => import("../field/FieldCurrency.vue.js")),
|
|
42
|
+
richtext: e(() => import("../field/FieldRichText.vue.js")),
|
|
43
|
+
auto_number: e(() => import("../field/FieldAutoNumber.vue.js")),
|
|
44
|
+
creator: e(() => import("../field/FieldCreator.vue.js")),
|
|
45
|
+
progress: e(() => import("../field/FieldProgress.vue.js")),
|
|
46
|
+
relation: e(() => import("../field/FieldRelation.vue.js")),
|
|
47
|
+
attachment: e(() => import("../field/FieldAttachment.vue.js")),
|
|
48
|
+
phone: e(() => import("../field/FieldPhone.vue.js"))
|
|
49
|
+
}, w = n(() => h[t.field.type]), E = n(() => {
|
|
50
|
+
const i = t.value;
|
|
51
|
+
return i == null || i === "" ? "—" : Array.isArray(i) ? i.join(", ") : typeof i == "boolean" ? i ? "✓" : "—" : String(i);
|
|
52
|
+
});
|
|
53
|
+
return (i, u) => (o(), a("div", {
|
|
54
|
+
class: N(["of-field-cell", {
|
|
55
|
+
"of-field-cell--editing": d.value,
|
|
56
|
+
"of-field-cell--readonly": m.value
|
|
57
|
+
}]),
|
|
58
|
+
onClick: x
|
|
59
|
+
}, [
|
|
60
|
+
d.value ? (o(), c(B, { key: 0 }, {
|
|
61
|
+
fallback: f(() => [...u[0] || (u[0] = [
|
|
62
|
+
S("span", { class: "of-field-cell__loading" }, "...", -1)
|
|
63
|
+
])]),
|
|
64
|
+
default: f(() => [
|
|
65
|
+
(o(), c(A(w.value), {
|
|
66
|
+
value: l.value,
|
|
67
|
+
field: l.field,
|
|
68
|
+
onCommit: C,
|
|
69
|
+
onCancel: g,
|
|
70
|
+
onTabNext: b
|
|
71
|
+
}, null, 40, ["value", "field"]))
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
})) : (o(), a(F, { key: 1 }, [
|
|
75
|
+
l.field.type === "richtext" && typeof l.value == "string" && l.value ? (o(), c(T, {
|
|
76
|
+
key: 0,
|
|
77
|
+
content: l.value,
|
|
78
|
+
"max-lines": 2
|
|
79
|
+
}, null, 8, ["content"])) : (o(), a("span", V, D(E.value), 1))
|
|
80
|
+
], 64))
|
|
81
|
+
], 2));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
R as default
|
|
86
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FieldType } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 当前选中的类型(高亮) */
|
|
4
|
+
currentType?: FieldType;
|
|
5
|
+
/** 搜索过滤 */
|
|
6
|
+
searchable?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
select: (type: FieldType) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onSelect?: ((type: FieldType) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
searchable: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent as k, ref as v, computed as y, openBlock as l, createElementBlock as a, withDirectives as C, createElementVNode as i, vModelText as T, createCommentVNode as x, Fragment as p, renderList as u, toDisplayString as d, normalizeClass as S, createBlock as B, resolveDynamicComponent as L } from "vue";
|
|
2
|
+
import { Type as D, Hash as F, CheckSquare as E, ListChecks as g, Calendar as M, CalendarClock as P, Link as q, Mail as w, Phone as U, Star as V, DollarSign as z, BarChart3 as N, FileText as G, User as H, UserCheck as I, ListOrdered as O, GitBranch as Q, Paperclip as Y, FunctionSquare as $ } from "lucide-vue-next";
|
|
3
|
+
const j = { class: "of-field-type-picker" }, A = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-field-type-picker__search"
|
|
6
|
+
}, J = { class: "of-field-type-picker__list" }, K = { class: "of-field-type-picker__group-label" }, R = ["onClick"], ee = /* @__PURE__ */ k({
|
|
7
|
+
__name: "FieldTypePicker",
|
|
8
|
+
props: {
|
|
9
|
+
currentType: {},
|
|
10
|
+
searchable: { type: Boolean, default: !0 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["select"],
|
|
13
|
+
setup(n, { emit: f }) {
|
|
14
|
+
const m = f, r = v(""), s = [
|
|
15
|
+
// 基础
|
|
16
|
+
{ type: "text", label: "文本", icon: D, category: "基础" },
|
|
17
|
+
{ type: "number", label: "数字", icon: F, category: "基础" },
|
|
18
|
+
{ type: "checkbox", label: "复选框", icon: E, category: "基础" },
|
|
19
|
+
{ type: "select", label: "单选", icon: g, category: "基础" },
|
|
20
|
+
{ type: "multi_select", label: "多选", icon: g, category: "基础" },
|
|
21
|
+
// 日期
|
|
22
|
+
{ type: "date", label: "日期", icon: M, category: "日期" },
|
|
23
|
+
{ type: "datetime", label: "日期时间", icon: P, category: "日期" },
|
|
24
|
+
// 联系方式
|
|
25
|
+
{ type: "url", label: "链接", icon: q, category: "联系" },
|
|
26
|
+
{ type: "email", label: "邮箱", icon: w, category: "联系" },
|
|
27
|
+
{ type: "phone", label: "电话", icon: U, category: "联系" },
|
|
28
|
+
// 高级
|
|
29
|
+
{ type: "rating", label: "评分", icon: V, category: "高级" },
|
|
30
|
+
{ type: "currency", label: "货币", icon: z, category: "高级" },
|
|
31
|
+
{ type: "progress", label: "进度", icon: N, category: "高级" },
|
|
32
|
+
{ type: "richtext", label: "富文本", icon: G, category: "高级" },
|
|
33
|
+
// 系统
|
|
34
|
+
{ type: "user", label: "用户", icon: H, category: "系统" },
|
|
35
|
+
{ type: "creator", label: "创建者", icon: I, category: "系统" },
|
|
36
|
+
{ type: "auto_number", label: "自动编号", icon: O, category: "系统" },
|
|
37
|
+
// 关联
|
|
38
|
+
{ type: "relation", label: "关联", icon: Q, category: "关联" },
|
|
39
|
+
{ type: "attachment", label: "附件", icon: Y, category: "关联" },
|
|
40
|
+
{ type: "formula", label: "公式", icon: $, category: "关联" }
|
|
41
|
+
], _ = y(() => {
|
|
42
|
+
if (!r.value) return s;
|
|
43
|
+
const o = r.value.toLowerCase();
|
|
44
|
+
return s.filter(
|
|
45
|
+
(t) => t.label.includes(o) || t.type.includes(o) || t.category.includes(o)
|
|
46
|
+
);
|
|
47
|
+
}), b = y(() => {
|
|
48
|
+
const o = [], t = /* @__PURE__ */ new Map();
|
|
49
|
+
for (const e of _.value)
|
|
50
|
+
t.has(e.category) || t.set(e.category, []), t.get(e.category).push(e);
|
|
51
|
+
for (const [e, c] of t)
|
|
52
|
+
o.push({ category: e, items: c });
|
|
53
|
+
return o;
|
|
54
|
+
});
|
|
55
|
+
function h(o) {
|
|
56
|
+
m("select", o);
|
|
57
|
+
}
|
|
58
|
+
return (o, t) => (l(), a("div", j, [
|
|
59
|
+
n.searchable ? (l(), a("div", A, [
|
|
60
|
+
C(i("input", {
|
|
61
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => r.value = e),
|
|
62
|
+
class: "of-field-type-picker__search-input",
|
|
63
|
+
placeholder: "搜索字段类型..."
|
|
64
|
+
}, null, 512), [
|
|
65
|
+
[T, r.value]
|
|
66
|
+
])
|
|
67
|
+
])) : x("", !0),
|
|
68
|
+
i("div", J, [
|
|
69
|
+
(l(!0), a(p, null, u(b.value, (e) => (l(), a("div", {
|
|
70
|
+
key: e.category,
|
|
71
|
+
class: "of-field-type-picker__group"
|
|
72
|
+
}, [
|
|
73
|
+
i("div", K, d(e.category), 1),
|
|
74
|
+
(l(!0), a(p, null, u(e.items, (c) => (l(), a("button", {
|
|
75
|
+
key: c.type,
|
|
76
|
+
class: S(["of-field-type-picker__item", { "of-field-type-picker__item--active": n.currentType === c.type }]),
|
|
77
|
+
onClick: (W) => h(c.type)
|
|
78
|
+
}, [
|
|
79
|
+
(l(), B(L(c.icon), {
|
|
80
|
+
size: 14,
|
|
81
|
+
class: "of-field-type-picker__icon"
|
|
82
|
+
})),
|
|
83
|
+
i("span", null, d(c.label), 1)
|
|
84
|
+
], 10, R))), 128))
|
|
85
|
+
]))), 128))
|
|
86
|
+
])
|
|
87
|
+
]));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
ee as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TableColumn, ColorMap } from '../../types';
|
|
2
|
+
type TableRow = Record<string, unknown> & {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
rows: TableRow[];
|
|
7
|
+
columns: TableColumn[];
|
|
8
|
+
selectable?: boolean;
|
|
9
|
+
addable?: boolean;
|
|
10
|
+
statusColorMap?: ColorMap;
|
|
11
|
+
readonly?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"row-click": (row: any) => any;
|
|
15
|
+
"add-row": () => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onRow-click"?: ((row: any) => any) | undefined;
|
|
18
|
+
"onAdd-row"?: (() => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
selectable: boolean;
|
|
21
|
+
addable: boolean;
|
|
22
|
+
readonly: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as V, computed as f, ref as g, openBlock as l, createElementBlock as o, Fragment as v, renderList as C, createElementVNode as X, normalizeStyle as M, toDisplayString as d, createCommentVNode as i } from "vue";
|
|
2
|
+
import { mergeColorMap as A, DEFAULT_STATUS_MAP as L, resolveBadge as Y } from "../../composables/useBadge.js";
|
|
3
|
+
const $ = { class: "of-mobile-list" }, D = ["onClick", "onTouchstart"], F = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-mobile-card__title"
|
|
6
|
+
}, N = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "of-mobile-card__meta"
|
|
9
|
+
}, U = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "of-mobile-card__tag"
|
|
12
|
+
}, w = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "of-mobile-card__action-delete"
|
|
15
|
+
}, O = /* @__PURE__ */ V({
|
|
16
|
+
__name: "MobileListView",
|
|
17
|
+
props: {
|
|
18
|
+
rows: {},
|
|
19
|
+
columns: {},
|
|
20
|
+
selectable: { type: Boolean, default: !1 },
|
|
21
|
+
addable: { type: Boolean, default: !0 },
|
|
22
|
+
statusColorMap: {},
|
|
23
|
+
readonly: { type: Boolean, default: !1 }
|
|
24
|
+
},
|
|
25
|
+
emits: ["row-click", "add-row"],
|
|
26
|
+
setup(r, { emit: S }) {
|
|
27
|
+
const m = r, y = S, T = f(() => A(L, m.statusColorMap)), h = f(() => m.columns[0]), _ = f(() => m.columns.slice(1, 4));
|
|
28
|
+
function u(a, n) {
|
|
29
|
+
const e = a[n.key];
|
|
30
|
+
return e != null ? String(e) : "";
|
|
31
|
+
}
|
|
32
|
+
function p(a) {
|
|
33
|
+
return Y(a, T.value);
|
|
34
|
+
}
|
|
35
|
+
let b = 0, k = 0;
|
|
36
|
+
const c = g(null), s = g(0);
|
|
37
|
+
function B(a, n) {
|
|
38
|
+
b = a.touches[0].clientX, k = a.touches[0].clientY, c.value = n, s.value = 0;
|
|
39
|
+
}
|
|
40
|
+
function x(a) {
|
|
41
|
+
if (!c.value) return;
|
|
42
|
+
const n = a.touches[0].clientX - b, e = a.touches[0].clientY - k;
|
|
43
|
+
if (Math.abs(e) > Math.abs(n)) {
|
|
44
|
+
c.value = null;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
s.value = Math.max(-80, Math.min(0, n));
|
|
48
|
+
}
|
|
49
|
+
function E() {
|
|
50
|
+
s.value < -40 ? s.value = -80 : (s.value = 0, c.value = null);
|
|
51
|
+
}
|
|
52
|
+
return (a, n) => (l(), o("div", $, [
|
|
53
|
+
(l(!0), o(v, null, C(r.rows, (e) => (l(), o("div", {
|
|
54
|
+
key: e.id,
|
|
55
|
+
class: "of-mobile-card-wrapper"
|
|
56
|
+
}, [
|
|
57
|
+
X("div", {
|
|
58
|
+
class: "of-mobile-card",
|
|
59
|
+
style: M({ transform: c.value === e.id ? `translateX(${s.value}px)` : "" }),
|
|
60
|
+
onClick: (t) => y("row-click", e),
|
|
61
|
+
onTouchstart: (t) => B(t, e.id),
|
|
62
|
+
onTouchmove: x,
|
|
63
|
+
onTouchend: E
|
|
64
|
+
}, [
|
|
65
|
+
h.value ? (l(), o("div", F, d(u(e, h.value) || "—"), 1)) : i("", !0),
|
|
66
|
+
_.value.length > 0 ? (l(), o("div", N, [
|
|
67
|
+
(l(!0), o(v, null, C(_.value, (t) => (l(), o(v, {
|
|
68
|
+
key: t.key
|
|
69
|
+
}, [
|
|
70
|
+
t.key === "status" && u(e, t) ? (l(), o("span", {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "of-mobile-card__badge",
|
|
73
|
+
style: M(p(u(e, t)).style)
|
|
74
|
+
}, d(p(u(e, t)).label), 5)) : u(e, t) ? (l(), o("span", U, d(t.label) + ": " + d(u(e, t)), 1)) : i("", !0)
|
|
75
|
+
], 64))), 128))
|
|
76
|
+
])) : i("", !0)
|
|
77
|
+
], 44, D),
|
|
78
|
+
c.value === e.id && s.value < -40 ? (l(), o("div", w, " 删除 ")) : i("", !0)
|
|
79
|
+
]))), 128)),
|
|
80
|
+
r.addable && !r.readonly ? (l(), o("button", {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "of-mobile-add-btn",
|
|
83
|
+
onClick: n[0] || (n[0] = (e) => y("add-row"))
|
|
84
|
+
}, " + 新增记录 ")) : i("", !0)
|
|
85
|
+
]));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
O as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as r, createElementBlock as s, createVNode as l, unref as c, createElementVNode as i } from "vue";
|
|
2
|
+
import { Plus as m } from "lucide-vue-next";
|
|
3
|
+
const k = /* @__PURE__ */ n({
|
|
4
|
+
__name: "NewRowBtn",
|
|
5
|
+
emits: ["click"],
|
|
6
|
+
setup(a, { emit: o }) {
|
|
7
|
+
const t = o;
|
|
8
|
+
return (f, e) => (r(), s("button", {
|
|
9
|
+
class: "of-new-row-btn",
|
|
10
|
+
onClick: e[0] || (e[0] = (p) => t("click"))
|
|
11
|
+
}, [
|
|
12
|
+
l(c(m), {
|
|
13
|
+
size: 14,
|
|
14
|
+
class: "of-new-row-icon"
|
|
15
|
+
}),
|
|
16
|
+
e[1] || (e[1] = i("span", { class: "of-new-row-label" }, "新建任务", -1))
|
|
17
|
+
]));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
k as default
|
|
22
|
+
};
|