@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 @@
|
|
|
1
|
+
(function(){"use strict";function i(r,e,t){return[...r].sort((s,u)=>{const n=s[e],a=u[e];if(n==null&&a==null)return 0;if(n==null)return 1;if(a==null)return-1;if(typeof n=="number"&&typeof a=="number")return t==="asc"?n-a:a-n;const l=String(n),o=String(a);return t==="asc"?l.localeCompare(o):o.localeCompare(l)})}function c(r,e){const t=String(r??"").toLowerCase(),s=e.value.toLowerCase();switch(e.operator){case"equals":return t===s;case"not_equals":return t!==s;case"contains":return t.includes(s);case"not_contains":return!t.includes(s);case"starts_with":return t.startsWith(s);case"ends_with":return t.endsWith(s);case"is_empty":return t===""||r==null;case"is_not_empty":return t!==""&&r!=null;case"gt":return Number(r)>Number(e.value);case"gte":return Number(r)>=Number(e.value);case"lt":return Number(r)<Number(e.value);case"lte":return Number(r)<=Number(e.value);default:return!0}}function f(r,e,t){return e.length===0?r:r.filter(s=>{const u=e.map(n=>n.field?c(s[n.field],n):!0);return t==="and"?u.every(Boolean):u.some(Boolean)})}self.onmessage=r=>{try{const e=r.data;if(e.type==="sort"){const t=i(e.data,e.field,e.order);self.postMessage({type:"sort-result",data:t})}else if(e.type==="filter"){const t=f(e.data,e.conditions,e.logic);self.postMessage({type:"filter-result",data:t})}}catch(e){self.postMessage({type:"error",message:e instanceof Error?e.message:String(e)})}}})();
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent as x, ref as h, computed as w, watch as g, onBeforeUnmount as C, openBlock as t, createBlock as p, Teleport as E, createElementBlock as o, withModifiers as L, normalizeStyle as B, Fragment as y, renderList as D, normalizeClass as M, resolveDynamicComponent as S, unref as $, createCommentVNode as a, createElementVNode as z, toDisplayString as N } from "vue";
|
|
2
|
+
import { resolveIcon as R } from "../../utils/icon.js";
|
|
3
|
+
const V = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-context-menu__sep"
|
|
6
|
+
}, F = ["disabled", "onClick"], I = { class: "of-context-menu__label" }, K = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "of-context-menu__submenu-indicator"
|
|
9
|
+
}, q = /* @__PURE__ */ x({
|
|
10
|
+
name: "ContextMenu",
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
x: {},
|
|
14
|
+
y: {},
|
|
15
|
+
items: {},
|
|
16
|
+
visible: { type: Boolean, default: !0 }
|
|
17
|
+
},
|
|
18
|
+
emits: ["select", "close"],
|
|
19
|
+
setup(l, { emit: _ }) {
|
|
20
|
+
const c = l, r = _, i = h(null), k = w(() => ({
|
|
21
|
+
position: "fixed",
|
|
22
|
+
left: `${c.x}px`,
|
|
23
|
+
top: `${c.y}px`
|
|
24
|
+
}));
|
|
25
|
+
function v(e) {
|
|
26
|
+
e.disabled || e.separator || (r("select", e.key), r("close"));
|
|
27
|
+
}
|
|
28
|
+
function u(e) {
|
|
29
|
+
const s = e.target;
|
|
30
|
+
i.value && s && !i.value.contains(s) && r("close");
|
|
31
|
+
}
|
|
32
|
+
function d(e) {
|
|
33
|
+
e.key === "Escape" && r("close");
|
|
34
|
+
}
|
|
35
|
+
function b() {
|
|
36
|
+
document.addEventListener("mousedown", u), document.addEventListener("keydown", d);
|
|
37
|
+
}
|
|
38
|
+
function m() {
|
|
39
|
+
document.removeEventListener("mousedown", u), document.removeEventListener("keydown", d);
|
|
40
|
+
}
|
|
41
|
+
return g(
|
|
42
|
+
() => c.visible,
|
|
43
|
+
(e) => {
|
|
44
|
+
if (e) {
|
|
45
|
+
b();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
m();
|
|
49
|
+
},
|
|
50
|
+
{ immediate: !0 }
|
|
51
|
+
), C(() => {
|
|
52
|
+
m();
|
|
53
|
+
}), (e, s) => (t(), p(E, { to: "body" }, [
|
|
54
|
+
l.visible ? (t(), o("div", {
|
|
55
|
+
key: 0,
|
|
56
|
+
ref_key: "menuRef",
|
|
57
|
+
ref: i,
|
|
58
|
+
class: "of-context-menu",
|
|
59
|
+
style: B(k.value),
|
|
60
|
+
role: "menu",
|
|
61
|
+
onMousedown: s[0] || (s[0] = L(() => {
|
|
62
|
+
}, ["stop"]))
|
|
63
|
+
}, [
|
|
64
|
+
(t(!0), o(y, null, D(l.items, (n) => {
|
|
65
|
+
var f;
|
|
66
|
+
return t(), o(y, {
|
|
67
|
+
key: n.key
|
|
68
|
+
}, [
|
|
69
|
+
n.separator ? (t(), o("hr", V)) : (t(), o("button", {
|
|
70
|
+
key: 1,
|
|
71
|
+
type: "button",
|
|
72
|
+
class: M(["of-context-menu__item", { "is-disabled": n.disabled, "is-danger": n.danger }]),
|
|
73
|
+
disabled: n.disabled,
|
|
74
|
+
role: "menuitem",
|
|
75
|
+
onClick: (T) => v(n)
|
|
76
|
+
}, [
|
|
77
|
+
n.icon ? (t(), p(S($(R)(n.icon)), {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: "of-context-menu__icon"
|
|
80
|
+
})) : a("", !0),
|
|
81
|
+
z("span", I, N(n.label), 1),
|
|
82
|
+
(f = n.children) != null && f.length ? (t(), o("span", K, "›")) : a("", !0)
|
|
83
|
+
], 10, F))
|
|
84
|
+
], 64);
|
|
85
|
+
}), 128))
|
|
86
|
+
], 36)) : a("", !0)
|
|
87
|
+
]));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
q as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as i, ref as l, onMounted as n, onUnmounted as d, watch as c, openBlock as u, createElementBlock as f, createElementVNode as p } from "vue";
|
|
2
|
+
import * as x from "echarts";
|
|
3
|
+
const m = { class: "of-dashboard-chart" }, b = /* @__PURE__ */ i({
|
|
4
|
+
__name: "BarChart",
|
|
5
|
+
props: {
|
|
6
|
+
title: { default: "" },
|
|
7
|
+
xAxisData: { default: () => ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] },
|
|
8
|
+
seriesName: { default: "Value" },
|
|
9
|
+
data: { default: () => [120, 200, 150, 80, 70, 110, 130] },
|
|
10
|
+
colors: { default: () => ["#3b82f6"] }
|
|
11
|
+
},
|
|
12
|
+
setup(s) {
|
|
13
|
+
const e = s, a = l(null);
|
|
14
|
+
let t = null, o = null;
|
|
15
|
+
const r = () => {
|
|
16
|
+
a.value && (t || (t = x.init(a.value)), t.setOption({
|
|
17
|
+
color: e.colors,
|
|
18
|
+
title: e.title ? { text: e.title, left: "center", textStyle: { fontSize: 14, fontWeight: 600 } } : void 0,
|
|
19
|
+
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
|
|
20
|
+
grid: { left: 12, right: 12, top: e.title ? 42 : 16, bottom: 8, containLabel: !0 },
|
|
21
|
+
xAxis: { type: "category", data: e.xAxisData },
|
|
22
|
+
yAxis: { type: "value" },
|
|
23
|
+
series: [{ name: e.seriesName, type: "bar", barMaxWidth: 36, data: e.data }]
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
return n(() => {
|
|
27
|
+
r(), a.value && (o = new ResizeObserver(() => t == null ? void 0 : t.resize()), o.observe(a.value));
|
|
28
|
+
}), d(() => {
|
|
29
|
+
o == null || o.disconnect(), t == null || t.dispose();
|
|
30
|
+
}), c(() => [e.title, e.xAxisData, e.seriesName, e.data, e.colors], r, {
|
|
31
|
+
deep: !0
|
|
32
|
+
}), (h, _) => (u(), f("div", m, [
|
|
33
|
+
p("div", {
|
|
34
|
+
ref_key: "chartRef",
|
|
35
|
+
ref: a,
|
|
36
|
+
class: "of-dashboard-chart__canvas"
|
|
37
|
+
}, null, 512)
|
|
38
|
+
]));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
b as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineComponent as t, openBlock as o, createBlock as a } from "vue";
|
|
2
|
+
import n from "./PieChart.vue.js";
|
|
3
|
+
const s = /* @__PURE__ */ t({
|
|
4
|
+
__name: "DoughnutChart",
|
|
5
|
+
props: {
|
|
6
|
+
title: {},
|
|
7
|
+
data: {},
|
|
8
|
+
colors: {},
|
|
9
|
+
showLegend: { type: Boolean }
|
|
10
|
+
},
|
|
11
|
+
setup(e) {
|
|
12
|
+
return (l, r) => (o(), a(n, {
|
|
13
|
+
title: e.title,
|
|
14
|
+
data: e.data,
|
|
15
|
+
colors: e.colors,
|
|
16
|
+
"show-legend": e.showLegend,
|
|
17
|
+
doughnut: ""
|
|
18
|
+
}, null, 8, ["title", "data", "colors", "show-legend"]));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
s as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent as s, computed as i, openBlock as o, createElementBlock as a, createElementVNode as r, toDisplayString as n, normalizeStyle as m, createBlock as c, unref as l, createCommentVNode as u } from "vue";
|
|
2
|
+
import { TrendingUpIcon as f, TrendingDownIcon as _ } from "lucide-vue-next";
|
|
3
|
+
const p = { class: "of-number-card" }, v = { class: "of-number-card__title" }, b = { class: "of-number-card__value-row" }, y = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-number-card__compare"
|
|
6
|
+
}, g = /* @__PURE__ */ s({
|
|
7
|
+
__name: "NumberCard",
|
|
8
|
+
props: {
|
|
9
|
+
title: { default: "Metric" },
|
|
10
|
+
value: { default: 0 },
|
|
11
|
+
unit: { default: "" },
|
|
12
|
+
compare: { default: "" },
|
|
13
|
+
trend: { default: void 0 },
|
|
14
|
+
color: { default: "var(--of-color-blue-600)" }
|
|
15
|
+
},
|
|
16
|
+
setup(e) {
|
|
17
|
+
const t = e, d = i(() => t.value >= 1e4 ? `${(t.value / 1e4).toFixed(1)}w${t.unit}` : `${t.value}${t.unit}`);
|
|
18
|
+
return (k, h) => (o(), a("div", p, [
|
|
19
|
+
r("p", v, n(e.title), 1),
|
|
20
|
+
r("div", b, [
|
|
21
|
+
r("p", {
|
|
22
|
+
class: "of-number-card__value",
|
|
23
|
+
style: m({ color: e.color })
|
|
24
|
+
}, n(d.value), 5),
|
|
25
|
+
e.trend === "up" ? (o(), c(l(f), {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "of-number-card__trend up",
|
|
28
|
+
size: 16
|
|
29
|
+
})) : e.trend === "down" ? (o(), c(l(_), {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "of-number-card__trend down",
|
|
32
|
+
size: 16
|
|
33
|
+
})) : u("", !0)
|
|
34
|
+
]),
|
|
35
|
+
e.compare ? (o(), a("p", y, "环比 " + n(e.compare), 1)) : u("", !0)
|
|
36
|
+
]));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
g as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as r, ref as s, onMounted as d, onUnmounted as i, watch as u, openBlock as f, createElementBlock as c, createElementVNode as p } from "vue";
|
|
2
|
+
import * as h from "echarts";
|
|
3
|
+
const m = { class: "of-dashboard-chart" }, b = /* @__PURE__ */ r({
|
|
4
|
+
__name: "PieChart",
|
|
5
|
+
props: {
|
|
6
|
+
title: { default: "" },
|
|
7
|
+
data: { default: () => [
|
|
8
|
+
{ name: "Todo", value: 12 },
|
|
9
|
+
{ name: "In Progress", value: 9 },
|
|
10
|
+
{ name: "Done", value: 18 }
|
|
11
|
+
] },
|
|
12
|
+
colors: { default: () => ["#3b82f6", "#10b981", "#f59e0b", "#8b5cf6", "#ef4444"] },
|
|
13
|
+
doughnut: { type: Boolean, default: !1 },
|
|
14
|
+
showLegend: { type: Boolean, default: !0 }
|
|
15
|
+
},
|
|
16
|
+
setup(l) {
|
|
17
|
+
const e = l, o = s(null);
|
|
18
|
+
let t = null, n = null;
|
|
19
|
+
const a = () => {
|
|
20
|
+
o.value && (t || (t = h.init(o.value)), t.setOption({
|
|
21
|
+
color: e.colors,
|
|
22
|
+
title: e.title ? { text: e.title, left: "center", textStyle: { fontSize: 14, fontWeight: 600 } } : void 0,
|
|
23
|
+
tooltip: { trigger: "item" },
|
|
24
|
+
legend: e.showLegend ? { bottom: 0 } : void 0,
|
|
25
|
+
series: [
|
|
26
|
+
{
|
|
27
|
+
type: "pie",
|
|
28
|
+
radius: e.doughnut ? ["45%", "70%"] : "65%",
|
|
29
|
+
center: ["50%", e.showLegend ? "45%" : "50%"],
|
|
30
|
+
data: e.data,
|
|
31
|
+
label: { formatter: "{b}: {d}%" }
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
return d(() => {
|
|
37
|
+
a(), o.value && (n = new ResizeObserver(() => t == null ? void 0 : t.resize()), n.observe(o.value));
|
|
38
|
+
}), i(() => {
|
|
39
|
+
n == null || n.disconnect(), t == null || t.dispose();
|
|
40
|
+
}), u(() => [e.title, e.data, e.colors, e.doughnut, e.showLegend], a, {
|
|
41
|
+
deep: !0
|
|
42
|
+
}), (v, g) => (f(), c("div", m, [
|
|
43
|
+
p("div", {
|
|
44
|
+
ref_key: "chartRef",
|
|
45
|
+
ref: o,
|
|
46
|
+
class: "of-dashboard-chart__canvas"
|
|
47
|
+
}, null, 512)
|
|
48
|
+
]));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
b as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent as d, openBlock as e, createElementBlock as t, toDisplayString as r, createCommentVNode as m, createElementVNode as n, Fragment as u, renderList as i, normalizeStyle as o } from "vue";
|
|
2
|
+
const y = { class: "of-table-chart" }, h = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "of-table-chart__title"
|
|
5
|
+
}, f = { class: "of-table-chart__wrapper" }, b = { class: "of-table-chart__table" }, v = /* @__PURE__ */ d({
|
|
6
|
+
__name: "TableChart",
|
|
7
|
+
props: {
|
|
8
|
+
title: { default: "" },
|
|
9
|
+
columns: { default: () => [
|
|
10
|
+
{ key: "name", label: "Name" },
|
|
11
|
+
{ key: "status", label: "Status", align: "center" },
|
|
12
|
+
{ key: "value", label: "Value", align: "right" }
|
|
13
|
+
] },
|
|
14
|
+
rows: { default: () => [
|
|
15
|
+
{ id: 1, name: "Alpha", status: "In Progress", value: 120 },
|
|
16
|
+
{ id: 2, name: "Beta", status: "Done", value: 86 },
|
|
17
|
+
{ id: 3, name: "Gamma", status: "Todo", value: 42 }
|
|
18
|
+
] }
|
|
19
|
+
},
|
|
20
|
+
setup(a) {
|
|
21
|
+
return (k, _) => (e(), t("div", y, [
|
|
22
|
+
a.title ? (e(), t("p", h, r(a.title), 1)) : m("", !0),
|
|
23
|
+
n("div", f, [
|
|
24
|
+
n("table", b, [
|
|
25
|
+
n("thead", null, [
|
|
26
|
+
n("tr", null, [
|
|
27
|
+
(e(!0), t(u, null, i(a.columns, (l) => (e(), t("th", {
|
|
28
|
+
key: l.key,
|
|
29
|
+
style: o({ textAlign: l.align ?? "left" })
|
|
30
|
+
}, r(l.label), 5))), 128))
|
|
31
|
+
])
|
|
32
|
+
]),
|
|
33
|
+
n("tbody", null, [
|
|
34
|
+
(e(!0), t(u, null, i(a.rows, (l, c) => (e(), t("tr", {
|
|
35
|
+
key: l.id ?? c
|
|
36
|
+
}, [
|
|
37
|
+
(e(!0), t(u, null, i(a.columns, (s) => (e(), t("td", {
|
|
38
|
+
key: s.key,
|
|
39
|
+
style: o({ textAlign: s.align ?? "left" })
|
|
40
|
+
}, r(l[s.key] ?? "-"), 5))), 128))
|
|
41
|
+
]))), 128))
|
|
42
|
+
])
|
|
43
|
+
])
|
|
44
|
+
])
|
|
45
|
+
]));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
v as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { defineComponent as m, computed as l, openBlock as t, createElementBlock as r, createElementVNode as o, toDisplayString as p, normalizeStyle as s, Fragment as u, renderList as f, createBlock as b, resolveDynamicComponent as h, mergeProps as _ } from "vue";
|
|
2
|
+
import y from "./charts/BarChart.vue.js";
|
|
3
|
+
import g from "./charts/PieChart.vue.js";
|
|
4
|
+
import S from "./charts/DoughnutChart.vue.js";
|
|
5
|
+
import v from "./charts/NumberCard.vue.js";
|
|
6
|
+
import k from "./charts/TableChart.vue.js";
|
|
7
|
+
const C = { class: "of-dashboard" }, D = { class: "of-dashboard__header" }, x = { class: "of-dashboard__title" }, M = /* @__PURE__ */ m({
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
title: { default: "Dashboard" },
|
|
11
|
+
widgets: { default: () => [] },
|
|
12
|
+
columns: { default: 4 },
|
|
13
|
+
gap: { default: 16 }
|
|
14
|
+
},
|
|
15
|
+
setup(n) {
|
|
16
|
+
const a = n, i = {
|
|
17
|
+
bar: y,
|
|
18
|
+
pie: g,
|
|
19
|
+
doughnut: S,
|
|
20
|
+
"number-card": v,
|
|
21
|
+
table: k
|
|
22
|
+
}, d = l(() => ({
|
|
23
|
+
gridTemplateColumns: `repeat(${a.columns}, minmax(0, 1fr))`,
|
|
24
|
+
gap: `${a.gap}px`
|
|
25
|
+
})), c = l(() => a.widgets.length > 0 ? a.widgets : [
|
|
26
|
+
{
|
|
27
|
+
id: "metric-1",
|
|
28
|
+
type: "number-card",
|
|
29
|
+
title: "总任务",
|
|
30
|
+
data: { value: 128, trend: "up", compare: "+12%" },
|
|
31
|
+
colSpan: 1
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "metric-2",
|
|
35
|
+
type: "number-card",
|
|
36
|
+
title: "已完成",
|
|
37
|
+
data: { value: 84, trend: "up", compare: "+8%" },
|
|
38
|
+
colSpan: 1
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "bar-1",
|
|
42
|
+
type: "bar",
|
|
43
|
+
title: "周趋势",
|
|
44
|
+
data: [12, 17, 14, 20, 23, 16, 19],
|
|
45
|
+
colSpan: 2
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "pie-1",
|
|
49
|
+
type: "pie",
|
|
50
|
+
title: "状态分布",
|
|
51
|
+
data: [
|
|
52
|
+
{ name: "Todo", value: 34 },
|
|
53
|
+
{ name: "In Progress", value: 52 },
|
|
54
|
+
{ name: "Done", value: 42 }
|
|
55
|
+
],
|
|
56
|
+
colSpan: 2
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "table-1",
|
|
60
|
+
type: "table",
|
|
61
|
+
title: "关键任务",
|
|
62
|
+
data: {
|
|
63
|
+
columns: [
|
|
64
|
+
{ key: "name", label: "任务" },
|
|
65
|
+
{ key: "owner", label: "负责人" },
|
|
66
|
+
{ key: "status", label: "状态" }
|
|
67
|
+
],
|
|
68
|
+
rows: [
|
|
69
|
+
{ name: "Migrate Dashboard", owner: "FE", status: "In Progress" },
|
|
70
|
+
{ name: "Type Definition", owner: "FE", status: "Done" },
|
|
71
|
+
{ name: "Integrate RichText", owner: "FE", status: "Todo" }
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
colSpan: 4
|
|
75
|
+
}
|
|
76
|
+
]);
|
|
77
|
+
return (T, E) => (t(), r("section", C, [
|
|
78
|
+
o("header", D, [
|
|
79
|
+
o("h3", x, p(n.title), 1)
|
|
80
|
+
]),
|
|
81
|
+
o("div", {
|
|
82
|
+
class: "of-dashboard__grid",
|
|
83
|
+
style: s(d.value)
|
|
84
|
+
}, [
|
|
85
|
+
(t(!0), r(u, null, f(c.value, (e) => (t(), r("article", {
|
|
86
|
+
key: e.id,
|
|
87
|
+
class: "of-dashboard__item",
|
|
88
|
+
style: s({
|
|
89
|
+
gridColumn: `span ${e.colSpan ?? 1}`,
|
|
90
|
+
gridRow: `span ${e.rowSpan ?? 1}`
|
|
91
|
+
})
|
|
92
|
+
}, [
|
|
93
|
+
(t(), b(h(i[e.type]), _({
|
|
94
|
+
title: e.title,
|
|
95
|
+
data: e.data
|
|
96
|
+
}, { ref_for: !0 }, e.config ?? {}), null, 16, ["title", "data"]))
|
|
97
|
+
], 4))), 128))
|
|
98
|
+
], 4)
|
|
99
|
+
]));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export {
|
|
103
|
+
M as default
|
|
104
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineComponent as m, openBlock as a, createElementBlock as s, createElementVNode as t, toDisplayString as o, createCommentVNode as i, normalizeClass as n, createBlock as c } from "vue";
|
|
2
|
+
import r from "./AiStreamingCursor.vue.js";
|
|
3
|
+
const l = { class: "of-ai-message" }, _ = { class: "of-ai-message__avatar" }, d = ["src", "alt"], g = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "of-ai-message__avatar-emoji"
|
|
6
|
+
}, f = { class: "of-ai-message__body" }, u = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "of-ai-message__name"
|
|
9
|
+
}, v = { class: "of-ai-message__content" }, b = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "of-ai-message__timestamp"
|
|
12
|
+
}, C = /* @__PURE__ */ m({
|
|
13
|
+
__name: "AiMessageBubble",
|
|
14
|
+
props: {
|
|
15
|
+
content: {},
|
|
16
|
+
isStreaming: { type: Boolean },
|
|
17
|
+
isError: { type: Boolean },
|
|
18
|
+
avatar: {},
|
|
19
|
+
name: {},
|
|
20
|
+
timestamp: {}
|
|
21
|
+
},
|
|
22
|
+
setup(e) {
|
|
23
|
+
return (h, y) => (a(), s("div", l, [
|
|
24
|
+
t("div", _, [
|
|
25
|
+
e.avatar ? (a(), s("img", {
|
|
26
|
+
key: 0,
|
|
27
|
+
src: e.avatar,
|
|
28
|
+
alt: e.name || "AI",
|
|
29
|
+
class: "of-ai-message__avatar-img"
|
|
30
|
+
}, null, 8, d)) : (a(), s("span", g, "🤖"))
|
|
31
|
+
]),
|
|
32
|
+
t("div", f, [
|
|
33
|
+
e.name ? (a(), s("div", u, o(e.name), 1)) : i("", !0),
|
|
34
|
+
t("div", {
|
|
35
|
+
class: n(["of-ai-message__bubble", { "of-ai-message__bubble--error": e.isError }])
|
|
36
|
+
}, [
|
|
37
|
+
t("span", v, o(e.content), 1),
|
|
38
|
+
e.isStreaming ? (a(), c(r, { key: 0 })) : i("", !0)
|
|
39
|
+
], 2),
|
|
40
|
+
e.timestamp ? (a(), s("div", b, o(e.timestamp), 1)) : i("", !0)
|
|
41
|
+
])
|
|
42
|
+
]));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
C as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as B, ref as T, computed as b, watch as x, nextTick as M, openBlock as t, createElementBlock as n, createElementVNode as u, normalizeStyle as f, unref as s, Fragment as p, renderList as _, createBlock as r, createCommentVNode as L } from "vue";
|
|
2
|
+
import { useVirtualList as A } from "../../composables/useVirtualList.js";
|
|
3
|
+
import E from "./AiMessageBubble.vue.js";
|
|
4
|
+
import H from "./UserMessageBubble.vue.js";
|
|
5
|
+
import R from "./AiThinking.vue.js";
|
|
6
|
+
const Y = /* @__PURE__ */ B({
|
|
7
|
+
__name: "AiMessageList",
|
|
8
|
+
props: {
|
|
9
|
+
messages: {},
|
|
10
|
+
isThinking: { type: Boolean }
|
|
11
|
+
},
|
|
12
|
+
setup(o) {
|
|
13
|
+
const i = o, m = T(null), g = (l) => {
|
|
14
|
+
var c;
|
|
15
|
+
const a = i.messages[l];
|
|
16
|
+
if (!a) return 80;
|
|
17
|
+
if (a.role === "user") return 60;
|
|
18
|
+
const e = Math.ceil((((c = a.content) == null ? void 0 : c.length) ?? 0) / 60);
|
|
19
|
+
return Math.max(80, 48 + e * 24);
|
|
20
|
+
}, {
|
|
21
|
+
visibleItems: h,
|
|
22
|
+
totalHeight: v,
|
|
23
|
+
offsetY: k,
|
|
24
|
+
scrollToBottom: d
|
|
25
|
+
} = A({
|
|
26
|
+
items: b(() => i.messages),
|
|
27
|
+
itemHeight: g,
|
|
28
|
+
overscan: 3,
|
|
29
|
+
containerRef: m
|
|
30
|
+
});
|
|
31
|
+
function y() {
|
|
32
|
+
d();
|
|
33
|
+
}
|
|
34
|
+
return x(
|
|
35
|
+
() => [i.messages.length, i.isThinking],
|
|
36
|
+
async () => {
|
|
37
|
+
await M(), y();
|
|
38
|
+
},
|
|
39
|
+
{ immediate: !0 }
|
|
40
|
+
), (l, a) => (t(), n("div", {
|
|
41
|
+
ref_key: "listRef",
|
|
42
|
+
ref: m,
|
|
43
|
+
class: "of-ai-message-list"
|
|
44
|
+
}, [
|
|
45
|
+
u("div", {
|
|
46
|
+
style: f({ height: s(v) + "px", position: "relative" })
|
|
47
|
+
}, [
|
|
48
|
+
u("div", {
|
|
49
|
+
class: "of-ai-message-list-inner",
|
|
50
|
+
style: f({ transform: `translateY(${s(k)}px)` })
|
|
51
|
+
}, [
|
|
52
|
+
(t(!0), n(p, null, _(s(h), ({ data: e }) => (t(), n(p, {
|
|
53
|
+
key: e.id
|
|
54
|
+
}, [
|
|
55
|
+
e.role === "ai" ? (t(), r(E, {
|
|
56
|
+
key: 0,
|
|
57
|
+
content: e.content,
|
|
58
|
+
"is-streaming": e.isStreaming,
|
|
59
|
+
"is-error": e.isError,
|
|
60
|
+
avatar: e.avatar,
|
|
61
|
+
name: e.name,
|
|
62
|
+
timestamp: e.timestamp
|
|
63
|
+
}, null, 8, ["content", "is-streaming", "is-error", "avatar", "name", "timestamp"])) : (t(), r(H, {
|
|
64
|
+
key: 1,
|
|
65
|
+
content: e.content,
|
|
66
|
+
avatar: e.avatar,
|
|
67
|
+
timestamp: e.timestamp
|
|
68
|
+
}, null, 8, ["content", "avatar", "timestamp"]))
|
|
69
|
+
], 64))), 128))
|
|
70
|
+
], 4)
|
|
71
|
+
], 4),
|
|
72
|
+
o.isThinking ? (t(), r(R, { key: 0 })) : L("", !0)
|
|
73
|
+
], 512));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
Y as default
|
|
78
|
+
};
|