@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,69 @@
|
|
|
1
|
+
import { defineComponent as _, ref as m, openBlock as a, createElementBlock as o, Fragment as k, renderList as b, createElementVNode as i, toDisplayString as C, createCommentVNode as A } from "vue";
|
|
2
|
+
const F = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "of-field-attachment-list"
|
|
5
|
+
}, N = { class: "of-field-attachment-name" }, x = ["onClick"], E = /* @__PURE__ */ _({
|
|
6
|
+
__name: "FieldAttachment",
|
|
7
|
+
props: {
|
|
8
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
9
|
+
field: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["commit", "cancel", "tabNext"],
|
|
12
|
+
setup(p, { emit: d }) {
|
|
13
|
+
const n = p, c = d, t = m(
|
|
14
|
+
Array.isArray(n.value) ? n.value.filter((e) => typeof e == "string") : typeof n.value == "string" && n.value ? [n.value] : []
|
|
15
|
+
), u = m(null);
|
|
16
|
+
function v() {
|
|
17
|
+
var e;
|
|
18
|
+
(e = u.value) == null || e.click();
|
|
19
|
+
}
|
|
20
|
+
function y(e) {
|
|
21
|
+
var l;
|
|
22
|
+
const s = e.target;
|
|
23
|
+
if (!((l = s.files) != null && l.length)) return;
|
|
24
|
+
const r = Array.from(s.files).map((f) => f.name);
|
|
25
|
+
t.value = [...t.value, ...r], c("commit", t.value.length > 0 ? t.value : null);
|
|
26
|
+
}
|
|
27
|
+
function h(e) {
|
|
28
|
+
t.value.splice(e, 1), c("commit", t.value.length > 0 ? [...t.value] : null);
|
|
29
|
+
}
|
|
30
|
+
function g(e) {
|
|
31
|
+
e.key === "Escape" && (e.preventDefault(), c("cancel"));
|
|
32
|
+
}
|
|
33
|
+
return (e, s) => (a(), o("div", {
|
|
34
|
+
class: "of-field-attachment",
|
|
35
|
+
tabindex: "0",
|
|
36
|
+
onKeydown: g
|
|
37
|
+
}, [
|
|
38
|
+
t.value.length > 0 ? (a(), o("div", F, [
|
|
39
|
+
(a(!0), o(k, null, b(t.value, (r, l) => (a(), o("div", {
|
|
40
|
+
key: l,
|
|
41
|
+
class: "of-field-attachment-item"
|
|
42
|
+
}, [
|
|
43
|
+
i("span", N, C(r), 1),
|
|
44
|
+
i("button", {
|
|
45
|
+
type: "button",
|
|
46
|
+
class: "of-field-attachment-remove",
|
|
47
|
+
onClick: (f) => h(l)
|
|
48
|
+
}, "×", 8, x)
|
|
49
|
+
]))), 128))
|
|
50
|
+
])) : A("", !0),
|
|
51
|
+
i("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
class: "of-field-attachment-add",
|
|
54
|
+
onClick: v
|
|
55
|
+
}, "+ 添加附件"),
|
|
56
|
+
i("input", {
|
|
57
|
+
ref_key: "fileInputRef",
|
|
58
|
+
ref: u,
|
|
59
|
+
type: "file",
|
|
60
|
+
multiple: "",
|
|
61
|
+
style: { display: "none" },
|
|
62
|
+
onChange: y
|
|
63
|
+
}, null, 544)
|
|
64
|
+
], 32));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
E as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CellValue, FieldDef } from '../table/FieldCell.vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
value?: CellValue;
|
|
4
|
+
field: FieldDef;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as l, createElementBlock as i, toDisplayString as a, unref as p } from "vue";
|
|
2
|
+
const u = { class: "of-field-auto-number" }, d = /* @__PURE__ */ r({
|
|
3
|
+
__name: "FieldAutoNumber",
|
|
4
|
+
props: {
|
|
5
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
6
|
+
field: {}
|
|
7
|
+
},
|
|
8
|
+
setup(n) {
|
|
9
|
+
const e = n, t = e.field.type === "auto_number" && "prefix" in e.field ? e.field.prefix ?? "" : "", o = e.value != null ? `${t}${e.value}` : "";
|
|
10
|
+
return (s, f) => (l(), i("span", u, a(p(o)), 1));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
d as default
|
|
15
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, computed as f, openBlock as p, createElementBlock as r, withModifiers as
|
|
2
|
-
import { _ as u } from "./index-DQph5iTq.js";
|
|
1
|
+
import { defineComponent as s, computed as f, openBlock as p, createElementBlock as r, withModifiers as m, createElementVNode as d, toDisplayString as u } from "vue";
|
|
3
2
|
const k = { class: "of-field-checkbox__icon" }, x = /* @__PURE__ */ s({
|
|
4
3
|
__name: "FieldCheckbox",
|
|
5
4
|
props: {
|
|
@@ -7,24 +6,24 @@ const k = { class: "of-field-checkbox__icon" }, x = /* @__PURE__ */ s({
|
|
|
7
6
|
field: {}
|
|
8
7
|
},
|
|
9
8
|
emits: ["commit", "cancel", "tabNext"],
|
|
10
|
-
setup(n, { emit:
|
|
11
|
-
const
|
|
9
|
+
setup(n, { emit: i }) {
|
|
10
|
+
const a = n, t = i, o = f(() => !!a.value);
|
|
12
11
|
function c() {
|
|
13
12
|
t("commit", !o.value);
|
|
14
13
|
}
|
|
15
14
|
function l(e) {
|
|
16
15
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), c()), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("tabNext"));
|
|
17
16
|
}
|
|
18
|
-
return (e,
|
|
17
|
+
return (e, _) => (p(), r("div", {
|
|
19
18
|
class: "of-field-checkbox",
|
|
20
19
|
tabindex: "0",
|
|
21
|
-
onClick:
|
|
20
|
+
onClick: m(c, ["stop"]),
|
|
22
21
|
onKeydown: l
|
|
23
22
|
}, [
|
|
24
|
-
|
|
23
|
+
d("span", k, u(o.value ? "☑" : "☐"), 1)
|
|
25
24
|
], 32));
|
|
26
25
|
}
|
|
27
|
-
})
|
|
26
|
+
});
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
x as default
|
|
30
29
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CellValue, FieldDef } from '../table/FieldCell.vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
value?: CellValue;
|
|
4
|
+
field: FieldDef;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent as i, unref as t, openBlock as a, createElementBlock as s, createElementVNode as r, toDisplayString as n } from "vue";
|
|
2
|
+
const p = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "of-field-creator"
|
|
5
|
+
}, d = { class: "of-field-creator-avatar" }, f = { class: "of-field-creator-name" }, _ = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "of-field-creator-empty"
|
|
8
|
+
}, h = /* @__PURE__ */ i({
|
|
9
|
+
__name: "FieldCreator",
|
|
10
|
+
props: {
|
|
11
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
12
|
+
field: {}
|
|
13
|
+
},
|
|
14
|
+
setup(c) {
|
|
15
|
+
const o = c, e = typeof o.value == "string" ? o.value : "", l = e.charAt(0).toUpperCase();
|
|
16
|
+
return (m, u) => t(e) ? (a(), s("div", p, [
|
|
17
|
+
r("span", d, n(t(l)), 1),
|
|
18
|
+
r("span", f, n(t(e)), 1)
|
|
19
|
+
])) : (a(), s("span", _, "—"));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
h as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CellValue, FieldDef } from '../table/FieldCell.vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
value?: CellValue;
|
|
4
|
+
field: FieldDef;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
cancel: () => any;
|
|
8
|
+
commit: (value: CellValue) => any;
|
|
9
|
+
tabNext: () => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onCancel?: (() => any) | undefined;
|
|
12
|
+
onCommit?: ((value: CellValue) => any) | undefined;
|
|
13
|
+
onTabNext?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
15
|
+
inputRef: HTMLInputElement;
|
|
16
|
+
}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent as p, ref as c, onMounted as y, nextTick as v, openBlock as N, createElementBlock as b, createElementVNode as a, toDisplayString as k, unref as x, withDirectives as _, vModelText as C } from "vue";
|
|
2
|
+
const D = { class: "of-field-currency" }, g = { class: "of-field-currency-symbol" }, E = /* @__PURE__ */ p({
|
|
3
|
+
__name: "FieldCurrency",
|
|
4
|
+
props: {
|
|
5
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
6
|
+
field: {}
|
|
7
|
+
},
|
|
8
|
+
emits: ["commit", "cancel", "tabNext"],
|
|
9
|
+
setup(s, { emit: f }) {
|
|
10
|
+
const n = s, l = f, u = c(null), o = c(n.value === null || n.value === void 0 ? "" : String(n.value)), m = n.field.type === "currency" && "currencyCode" in n.field && n.field.currencyCode === "CNY" ? "¥" : "$";
|
|
11
|
+
y(() => v(() => {
|
|
12
|
+
var e;
|
|
13
|
+
return (e = u.value) == null ? void 0 : e.focus();
|
|
14
|
+
}));
|
|
15
|
+
function r() {
|
|
16
|
+
if (o.value === "") return null;
|
|
17
|
+
const e = o.value.replace(/[^0-9.-]/g, ""), t = Number(e);
|
|
18
|
+
return Number.isNaN(t) ? null : t;
|
|
19
|
+
}
|
|
20
|
+
function d(e) {
|
|
21
|
+
e.key === "Enter" && (e.preventDefault(), l("commit", r())), e.key === "Escape" && (e.preventDefault(), l("cancel")), e.key === "Tab" && (e.preventDefault(), l("commit", r()), l("tabNext"));
|
|
22
|
+
}
|
|
23
|
+
return (e, t) => (N(), b("div", D, [
|
|
24
|
+
a("span", g, k(x(m)), 1),
|
|
25
|
+
_(a("input", {
|
|
26
|
+
ref_key: "inputRef",
|
|
27
|
+
ref: u,
|
|
28
|
+
class: "of-field-input",
|
|
29
|
+
type: "text",
|
|
30
|
+
inputmode: "decimal",
|
|
31
|
+
"onUpdate:modelValue": t[0] || (t[0] = (i) => o.value = i),
|
|
32
|
+
onKeydown: d,
|
|
33
|
+
onBlur: t[1] || (t[1] = (i) => l("commit", r()))
|
|
34
|
+
}, null, 544), [
|
|
35
|
+
[C, o.value]
|
|
36
|
+
])
|
|
37
|
+
]));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
E as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as m, ref as i, onMounted as c, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as k, vModelText as y } from "vue";
|
|
2
|
+
import { useBreakpoint as x } from "../../composables/useBreakpoint.js";
|
|
3
|
+
const b = /* @__PURE__ */ m({
|
|
4
|
+
__name: "FieldDate",
|
|
5
|
+
props: {
|
|
6
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
7
|
+
field: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["commit", "cancel", "tabNext"],
|
|
10
|
+
setup(a, { emit: r }) {
|
|
11
|
+
const p = a, t = r;
|
|
12
|
+
x();
|
|
13
|
+
const o = i(null), n = i(String(p.value ?? ""));
|
|
14
|
+
c(() => s(() => {
|
|
15
|
+
var e;
|
|
16
|
+
return (e = o.value) == null ? void 0 : e.focus();
|
|
17
|
+
}));
|
|
18
|
+
function f(e) {
|
|
19
|
+
e.key === "Enter" && (e.preventDefault(), t("commit", n.value || null)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", n.value || null), t("tabNext"));
|
|
20
|
+
}
|
|
21
|
+
return (e, l) => v((d(), k("input", {
|
|
22
|
+
ref_key: "inputRef",
|
|
23
|
+
ref: o,
|
|
24
|
+
"onUpdate:modelValue": l[0] || (l[0] = (u) => n.value = u),
|
|
25
|
+
class: "of-field-input",
|
|
26
|
+
type: "date",
|
|
27
|
+
onKeydown: f,
|
|
28
|
+
onBlur: l[1] || (l[1] = (u) => t("commit", n.value || null))
|
|
29
|
+
}, null, 544)), [
|
|
30
|
+
[y, n.value]
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
b as default
|
|
36
|
+
};
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
const x = /* @__PURE__ */ p({
|
|
1
|
+
import { defineComponent as f, ref as i, onMounted as p, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as k } from "vue";
|
|
2
|
+
const D = /* @__PURE__ */ f({
|
|
4
3
|
__name: "FieldDatetime",
|
|
5
4
|
props: {
|
|
6
5
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
7
6
|
field: {}
|
|
8
7
|
},
|
|
9
8
|
emits: ["commit", "cancel", "tabNext"],
|
|
10
|
-
setup(
|
|
11
|
-
const m =
|
|
12
|
-
|
|
9
|
+
setup(a, { emit: r }) {
|
|
10
|
+
const m = a, t = r, o = i(null), n = i(String(m.value ?? ""));
|
|
11
|
+
p(() => s(() => {
|
|
13
12
|
var e;
|
|
14
13
|
return (e = o.value) == null ? void 0 : e.focus();
|
|
15
14
|
}));
|
|
16
15
|
function c(e) {
|
|
17
16
|
e.key === "Enter" && (e.preventDefault(), t("commit", n.value || null)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", n.value || null), t("tabNext"));
|
|
18
17
|
}
|
|
19
|
-
return (e, l) =>
|
|
18
|
+
return (e, l) => v((d(), y("input", {
|
|
20
19
|
ref_key: "inputRef",
|
|
21
20
|
ref: o,
|
|
22
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
21
|
+
"onUpdate:modelValue": l[0] || (l[0] = (u) => n.value = u),
|
|
23
22
|
class: "of-field-input",
|
|
24
23
|
type: "datetime-local",
|
|
25
24
|
onKeydown: c,
|
|
26
|
-
onBlur: l[1] || (l[1] = (
|
|
25
|
+
onBlur: l[1] || (l[1] = (u) => t("commit", n.value || null))
|
|
27
26
|
}, null, 544)), [
|
|
28
|
-
[
|
|
27
|
+
[k, n.value]
|
|
29
28
|
]);
|
|
30
29
|
}
|
|
31
|
-
})
|
|
30
|
+
});
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
D as default
|
|
34
33
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
const x = /* @__PURE__ */ c({
|
|
1
|
+
import { defineComponent as p, ref as u, onMounted as c, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as k } from "vue";
|
|
2
|
+
const b = /* @__PURE__ */ p({
|
|
4
3
|
__name: "FieldEmail",
|
|
5
4
|
props: {
|
|
6
5
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
7
6
|
field: {}
|
|
8
7
|
},
|
|
9
8
|
emits: ["commit", "cancel", "tabNext"],
|
|
10
|
-
setup(
|
|
11
|
-
const m =
|
|
12
|
-
|
|
9
|
+
setup(a, { emit: r }) {
|
|
10
|
+
const m = a, t = r, o = u(null), n = u(String(m.value ?? ""));
|
|
11
|
+
c(() => s(() => {
|
|
13
12
|
var e;
|
|
14
13
|
return (e = o.value) == null ? void 0 : e.focus();
|
|
15
14
|
}));
|
|
16
|
-
function
|
|
15
|
+
function f(e) {
|
|
17
16
|
e.key === "Enter" && (e.preventDefault(), t("commit", n.value)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", n.value), t("tabNext"));
|
|
18
17
|
}
|
|
19
18
|
return (e, l) => v((d(), y("input", {
|
|
@@ -21,14 +20,14 @@ const x = /* @__PURE__ */ c({
|
|
|
21
20
|
ref: o,
|
|
22
21
|
class: "of-field-input",
|
|
23
22
|
type: "email",
|
|
24
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
25
|
-
onKeydown:
|
|
26
|
-
onBlur: l[1] || (l[1] = (
|
|
23
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => n.value = i),
|
|
24
|
+
onKeydown: f,
|
|
25
|
+
onBlur: l[1] || (l[1] = (i) => t("commit", n.value))
|
|
27
26
|
}, null, 544)), [
|
|
28
|
-
[
|
|
27
|
+
[k, n.value]
|
|
29
28
|
]);
|
|
30
29
|
}
|
|
31
|
-
})
|
|
30
|
+
});
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
b as default
|
|
34
33
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** markdown 原文 */
|
|
3
|
+
content: string;
|
|
4
|
+
/** 最大显示行数,默认 2 */
|
|
5
|
+
maxLines?: number;
|
|
6
|
+
/** 是否展开显示完整内容 */
|
|
7
|
+
expanded?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
maxLines: number;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as p, computed as a, openBlock as t, createElementBlock as r, normalizeClass as m, normalizeStyle as f, toDisplayString as u, createCommentVNode as g } from "vue";
|
|
2
|
+
import { useMarkdown as w } from "../../composables/useMarkdown.js";
|
|
3
|
+
const v = ["innerHTML"], k = {
|
|
4
|
+
key: 2,
|
|
5
|
+
class: "of-field-md-preview__more"
|
|
6
|
+
}, M = /* @__PURE__ */ p({
|
|
7
|
+
__name: "FieldMarkdownPreview",
|
|
8
|
+
props: {
|
|
9
|
+
content: {},
|
|
10
|
+
maxLines: { default: 2 },
|
|
11
|
+
expanded: { type: Boolean, default: !1 }
|
|
12
|
+
},
|
|
13
|
+
setup(n) {
|
|
14
|
+
const e = n, { renderMarkdown: o } = w(), c = a(() => e.content ? i(e.content) : "—"), d = a(() => e.content ? o(e.content) : ""), s = a(() => e.content ? e.content.length > 100 || e.content.includes(`
|
|
15
|
+
`) : !1);
|
|
16
|
+
function i(l) {
|
|
17
|
+
return l.replace(/^#{1,6}\s+/gm, "").replace(/\*{1,3}(.*?)\*{1,3}/g, "$1").replace(/_{1,3}(.*?)_{1,3}/g, "$1").replace(/```[\s\S]*?```/g, "[代码]").replace(/`([^`]+)`/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/!\[([^\]]*)\]\([^)]+\)/g, "[图片]").replace(/^[\s]*[-*+]\s+/gm, "").replace(/^[\s]*\d+\.\s+/gm, "").replace(/^>\s+/gm, "").replace(/^---+$/gm, "").replace(/\n{2,}/g, " — ").replace(/\n/g, " ").trim();
|
|
18
|
+
}
|
|
19
|
+
return (l, x) => (t(), r("div", {
|
|
20
|
+
class: m(["of-field-md-preview", { "of-field-md-preview--expanded": n.expanded }])
|
|
21
|
+
}, [
|
|
22
|
+
n.expanded ? (t(), r("div", {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "of-field-md-preview__full of-markdown",
|
|
25
|
+
innerHTML: d.value
|
|
26
|
+
}, null, 8, v)) : (t(), r("span", {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "of-field-md-preview__text",
|
|
29
|
+
style: f({ "-webkit-line-clamp": n.maxLines })
|
|
30
|
+
}, u(c.value), 5)),
|
|
31
|
+
!n.expanded && s.value ? (t(), r("span", k, "...")) : g("", !0)
|
|
32
|
+
], 2));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
M as default
|
|
37
|
+
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { defineComponent as $, ref as
|
|
2
|
-
|
|
3
|
-
const W = {
|
|
1
|
+
import { defineComponent as $, ref as a, computed as M, onMounted as z, nextTick as O, onBeforeUnmount as T, watch as F, openBlock as l, createElementBlock as i, Fragment as A, renderList as L, normalizeStyle as w, toDisplayString as k, createBlock as P, Teleport as U, withModifiers as m, normalizeClass as V, createElementVNode as p, createCommentVNode as I } from "vue";
|
|
2
|
+
const K = {
|
|
4
3
|
key: 0,
|
|
5
4
|
class: "of-field-multiselect__chips"
|
|
6
|
-
},
|
|
5
|
+
}, W = {
|
|
7
6
|
key: 1,
|
|
8
7
|
class: "of-field-multiselect__placeholder"
|
|
9
|
-
},
|
|
8
|
+
}, j = ["onMouseenter", "onClick"], q = ["checked"], G = { key: 1 }, H = { class: "of-field-multiselect__actions" }, Q = /* @__PURE__ */ $({
|
|
10
9
|
__name: "FieldMultiSelect",
|
|
11
10
|
props: {
|
|
12
11
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
13
12
|
field: {}
|
|
14
13
|
},
|
|
15
14
|
emits: ["commit", "cancel", "tabNext"],
|
|
16
|
-
setup(
|
|
17
|
-
const d =
|
|
15
|
+
setup(B, { emit: S }) {
|
|
16
|
+
const d = B, _ = S, u = a(null), b = a(null), h = a({ top: "0px", left: "0px", width: "0px" }), f = a(!0), v = M(() => d.field.options ?? []), o = a([]), r = a(0), x = M(() => {
|
|
18
17
|
const e = new Set(o.value);
|
|
19
18
|
return v.value.filter((n) => e.has(n.value));
|
|
20
19
|
});
|
|
21
20
|
function g() {
|
|
22
21
|
o.value = Array.isArray(d.value) ? d.value.filter((e) => typeof e == "string") : [];
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
if (!
|
|
26
|
-
const e =
|
|
23
|
+
function s() {
|
|
24
|
+
if (!u.value) return;
|
|
25
|
+
const e = u.value.getBoundingClientRect();
|
|
27
26
|
h.value = {
|
|
28
27
|
top: `${e.bottom}px`,
|
|
29
28
|
left: `${e.left}px`,
|
|
@@ -45,16 +44,16 @@ const W = {
|
|
|
45
44
|
}
|
|
46
45
|
function N(e) {
|
|
47
46
|
if (e.key === "ArrowDown") {
|
|
48
|
-
e.preventDefault(),
|
|
47
|
+
e.preventDefault(), r.value = Math.min(r.value + 1, Math.max(v.value.length - 1, 0));
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
50
|
if (e.key === "ArrowUp") {
|
|
52
|
-
e.preventDefault(),
|
|
51
|
+
e.preventDefault(), r.value = Math.max(r.value - 1, 0);
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
55
54
|
if (e.key === " " || e.key === "Enter") {
|
|
56
55
|
e.preventDefault();
|
|
57
|
-
const n = v.value[
|
|
56
|
+
const n = v.value[r.value];
|
|
58
57
|
n && C(n.value);
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
@@ -67,35 +66,35 @@ const W = {
|
|
|
67
66
|
function E(e) {
|
|
68
67
|
var t, c;
|
|
69
68
|
const n = e.target;
|
|
70
|
-
n && ((t =
|
|
69
|
+
n && ((t = u.value) != null && t.contains(n) || (c = b.value) != null && c.contains(n) || y());
|
|
71
70
|
}
|
|
72
71
|
return z(() => {
|
|
73
|
-
g(),
|
|
72
|
+
g(), O(() => {
|
|
74
73
|
var e;
|
|
75
|
-
|
|
76
|
-
}), window.addEventListener("resize",
|
|
77
|
-
}),
|
|
78
|
-
window.removeEventListener("resize",
|
|
79
|
-
}),
|
|
74
|
+
s(), (e = u.value) == null || e.focus();
|
|
75
|
+
}), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), window.addEventListener("mousedown", E, !0);
|
|
76
|
+
}), T(() => {
|
|
77
|
+
window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0), window.removeEventListener("mousedown", E, !0);
|
|
78
|
+
}), F(
|
|
80
79
|
() => d.value,
|
|
81
80
|
() => {
|
|
82
81
|
g();
|
|
83
82
|
}
|
|
84
83
|
), (e, n) => (l(), i("div", {
|
|
85
84
|
ref_key: "triggerRef",
|
|
86
|
-
ref:
|
|
85
|
+
ref: u,
|
|
87
86
|
class: "of-field-multiselect",
|
|
88
87
|
tabindex: "0",
|
|
89
88
|
onKeydown: N
|
|
90
89
|
}, [
|
|
91
|
-
x.value.length ? (l(), i("div",
|
|
90
|
+
x.value.length ? (l(), i("div", K, [
|
|
92
91
|
(l(!0), i(A, null, L(x.value, (t) => (l(), i("span", {
|
|
93
92
|
key: t.value,
|
|
94
93
|
class: "of-field-multiselect__badge",
|
|
95
94
|
style: w(t.color ? { background: t.color } : void 0)
|
|
96
95
|
}, k(t.label), 5))), 128))
|
|
97
|
-
])) : (l(), i("span",
|
|
98
|
-
(l(),
|
|
96
|
+
])) : (l(), i("span", W, "—")),
|
|
97
|
+
(l(), P(U, { to: "body" }, [
|
|
99
98
|
f.value ? (l(), i("div", {
|
|
100
99
|
key: 0,
|
|
101
100
|
ref_key: "dropdownRef",
|
|
@@ -105,8 +104,8 @@ const W = {
|
|
|
105
104
|
}, [
|
|
106
105
|
(l(!0), i(A, null, L(v.value, (t, c) => (l(), i("div", {
|
|
107
106
|
key: t.value,
|
|
108
|
-
class:
|
|
109
|
-
onMouseenter: (R) =>
|
|
107
|
+
class: V(["of-field-multiselect__option", { active: c === r.value, selected: o.value.includes(t.value) }]),
|
|
108
|
+
onMouseenter: (R) => r.value = c,
|
|
110
109
|
onClick: m((R) => C(t.value), ["stop"])
|
|
111
110
|
}, [
|
|
112
111
|
p("input", {
|
|
@@ -116,14 +115,14 @@ const W = {
|
|
|
116
115
|
checked: o.value.includes(t.value),
|
|
117
116
|
onChange: n[0] || (n[0] = m(() => {
|
|
118
117
|
}, ["prevent"]))
|
|
119
|
-
}, null, 40,
|
|
118
|
+
}, null, 40, q),
|
|
120
119
|
t.color ? (l(), i("span", {
|
|
121
120
|
key: 0,
|
|
122
121
|
class: "of-field-multiselect__badge",
|
|
123
122
|
style: w({ background: t.color })
|
|
124
|
-
}, k(t.label), 5)) : (l(), i("span",
|
|
125
|
-
], 42,
|
|
126
|
-
p("div",
|
|
123
|
+
}, k(t.label), 5)) : (l(), i("span", G, k(t.label), 1))
|
|
124
|
+
], 42, j))), 128)),
|
|
125
|
+
p("div", H, [
|
|
127
126
|
p("button", {
|
|
128
127
|
class: "of-field-multiselect__btn",
|
|
129
128
|
type: "button",
|
|
@@ -135,11 +134,11 @@ const W = {
|
|
|
135
134
|
onClick: m(y, ["stop"])
|
|
136
135
|
}, " 完成 ")
|
|
137
136
|
])
|
|
138
|
-
], 4)) :
|
|
137
|
+
], 4)) : I("", !0)
|
|
139
138
|
]))
|
|
140
139
|
], 544));
|
|
141
140
|
}
|
|
142
|
-
})
|
|
141
|
+
});
|
|
143
142
|
export {
|
|
144
|
-
|
|
143
|
+
Q as default
|
|
145
144
|
};
|