@oneflowui/ui 0.4.2 → 0.4.3
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/components/ContextMenu/index.vue.js +7 -0
- package/dist/components/ContextMenu/index.vue2.js +91 -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 +92 -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.js +7 -0
- package/dist/components/base/MonitorItem.vue2.js +56 -0
- package/dist/components/base/PersonaCard.vue.js +7 -0
- package/dist/components/base/PersonaCard.vue2.js +173 -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.js +7 -0
- package/dist/components/base/RefTag.vue2.js +52 -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.js +7 -0
- package/dist/components/base/ToolbarBtn.vue2.js +30 -0
- package/dist/components/base/ViewModeGroup.vue.js +7 -0
- package/dist/components/base/ViewModeGroup.vue2.js +32 -0
- 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/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/FieldCheckbox.vue.js +7 -0
- package/dist/{FieldCheckbox-CV3QtQ4Y.js → components/field/FieldCheckbox.vue2.js} +8 -9
- package/dist/components/field/FieldDate.vue.js +7 -0
- package/dist/{FieldDate-Bljx4jb7.js → components/field/FieldDate.vue2.js} +9 -10
- 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/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/FieldRating.vue.js +7 -0
- package/dist/components/field/FieldRating.vue2.js +31 -0
- package/dist/components/field/FieldSelect.vue.js +7 -0
- package/dist/{FieldSelect-B39Ad8VH.js → components/field/FieldSelect.vue2.js} +34 -35
- 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 +245 -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.js +7 -0
- package/dist/components/gallery/GalleryView.vue2.js +48 -0
- package/dist/components/kanban/KanbanBoard.vue.js +7 -0
- package/dist/components/kanban/KanbanBoard.vue2.js +86 -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 +98 -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 +112 -0
- package/dist/components/overlay/Modal.vue.js +7 -0
- package/dist/components/overlay/Modal.vue2.js +115 -0
- package/dist/components/overlay/SidePanel.vue.js +7 -0
- package/dist/components/overlay/SidePanel.vue2.js +137 -0
- package/dist/components/split/SplitPane.vue.js +8 -0
- package/dist/components/split/SplitPane.vue2.js +68 -0
- package/dist/components/table/DataTable.vue.js +7 -0
- package/dist/components/table/DataTable.vue2.js +234 -0
- package/dist/components/table/FieldCell.vue.js +7 -0
- package/dist/components/table/FieldCell.vue2.js +71 -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.js +7 -0
- package/dist/components/table/TableGroupRow.vue2.js +48 -0
- package/dist/components/table/TableHeaderRow.vue.js +7 -0
- package/dist/components/table/TableHeaderRow.vue2.js +69 -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 +185 -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/useAiChat.js +103 -0
- package/dist/composables/useBadge.js +76 -0
- package/dist/composables/useBreakpoint.js +16 -0
- package/dist/composables/useInlineEdit.js +28 -0
- package/dist/composables/useMarkdown.js +69 -0
- package/dist/composables/useStream.js +80 -0
- package/dist/composables/useTable.js +115 -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.js +46 -0
- package/dist/composables/useToast.js +38 -0
- package/dist/composables/useTypewriter.js +56 -0
- package/dist/composables/useVirtualList.js +117 -0
- package/dist/constants/table.js +11 -0
- package/dist/index.js +301 -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.js +77 -0
- package/dist/utils/icon.js +15 -0
- package/package.json +13 -6
- 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,234 @@
|
|
|
1
|
+
import { defineComponent as ne, toRef as i, watch as I, ref as se, computed as f, openBlock as a, createElementBlock as c, createVNode as b, unref as r, createElementVNode as $, normalizeStyle as V, Fragment as v, renderList as z, createBlock as m, mergeProps as y, createSlots as N, withCtx as P, createCommentVNode as ie } from "vue";
|
|
2
|
+
import ce from "./TableHeaderRow.vue.js";
|
|
3
|
+
import F from "./TableDataRow.vue.js";
|
|
4
|
+
import L from "./TableGroupRow.vue.js";
|
|
5
|
+
import ue from "./NewRowBtn.vue.js";
|
|
6
|
+
import O from "./FieldCell.vue.js";
|
|
7
|
+
import { useInlineEdit as de } from "../../composables/useInlineEdit.js";
|
|
8
|
+
import { useVirtualList as fe } from "../../composables/useVirtualList.js";
|
|
9
|
+
import { useTable as me } from "../../composables/useTable.js";
|
|
10
|
+
import { useTableGroup as pe } from "../../composables/useTableGroup.js";
|
|
11
|
+
import { useTableData as ve } from "../../composables/useTableData.js";
|
|
12
|
+
import { useTableColumns as ye } from "../../composables/useTableColumns.js";
|
|
13
|
+
const ge = {
|
|
14
|
+
class: "of-data-table",
|
|
15
|
+
role: "grid"
|
|
16
|
+
}, ke = 36, we = 44, Ee = /* @__PURE__ */ ne({
|
|
17
|
+
__name: "DataTable",
|
|
18
|
+
props: {
|
|
19
|
+
tasks: {},
|
|
20
|
+
records: {},
|
|
21
|
+
schema: {},
|
|
22
|
+
view: {},
|
|
23
|
+
columns: {},
|
|
24
|
+
fieldDefs: {},
|
|
25
|
+
rowKey: { default: "id" },
|
|
26
|
+
selectable: { type: Boolean, default: !0 },
|
|
27
|
+
addable: { type: Boolean, default: !0 },
|
|
28
|
+
priorityColorMap: {},
|
|
29
|
+
statusColorMap: {},
|
|
30
|
+
groupBy: {},
|
|
31
|
+
groupColorMap: {},
|
|
32
|
+
virtual: { type: Boolean },
|
|
33
|
+
virtualThreshold: { default: 100 },
|
|
34
|
+
readonly: { type: Boolean, default: !1 }
|
|
35
|
+
},
|
|
36
|
+
emits: ["row-click", "row-click-record", "add-row", "selection-change", "cell-edit"],
|
|
37
|
+
setup(g, { emit: Y }) {
|
|
38
|
+
const t = g, s = Y, { commit: U } = de(), { rows: T } = ve({
|
|
39
|
+
tasks: i(t, "tasks"),
|
|
40
|
+
records: i(t, "records")
|
|
41
|
+
}), { columns: R } = ye({
|
|
42
|
+
columns: i(t, "columns"),
|
|
43
|
+
schema: i(t, "schema"),
|
|
44
|
+
view: i(t, "view")
|
|
45
|
+
}), {
|
|
46
|
+
data: k,
|
|
47
|
+
sort: S,
|
|
48
|
+
toggleSort: W,
|
|
49
|
+
selectedRows: w,
|
|
50
|
+
toggleSelectAll: j,
|
|
51
|
+
toggleRowSelection: q,
|
|
52
|
+
isAllSelected: D,
|
|
53
|
+
setData: J
|
|
54
|
+
} = me({
|
|
55
|
+
data: T.value,
|
|
56
|
+
pageSize: 999999
|
|
57
|
+
// Disable pagination inside DataTable for now or manage it externally
|
|
58
|
+
});
|
|
59
|
+
I(
|
|
60
|
+
T,
|
|
61
|
+
(e) => {
|
|
62
|
+
J(e);
|
|
63
|
+
},
|
|
64
|
+
{ deep: !1 }
|
|
65
|
+
);
|
|
66
|
+
const { groupedItems: p, collapsedGroups: Q, toggleGroup: B, isGroupHeader: _ } = pe({
|
|
67
|
+
data: k,
|
|
68
|
+
// Consumes sorted data from Brain 1
|
|
69
|
+
groupBy: i(t, "groupBy")
|
|
70
|
+
}), A = se(null), X = f(() => t.virtual !== void 0 ? t.virtual : p.value.length >= t.virtualThreshold), { visibleItems: Z, totalHeight: ee, offsetY: oe } = fe({
|
|
71
|
+
items: p,
|
|
72
|
+
itemHeight: (e) => {
|
|
73
|
+
const l = p.value[e];
|
|
74
|
+
return _(l) ? ke : we;
|
|
75
|
+
},
|
|
76
|
+
overscan: 5,
|
|
77
|
+
containerRef: A
|
|
78
|
+
}), C = f(() => t.readonly ? !1 : t.selectable), te = f(() => t.readonly ? !1 : t.addable), le = f(() => Array.from(w.value)), re = f(() => w.value.size > 0 && !D.value);
|
|
79
|
+
function ae() {
|
|
80
|
+
j(k.value);
|
|
81
|
+
}
|
|
82
|
+
function H(e) {
|
|
83
|
+
const l = k.value.find((o) => o[t.rowKey] === e);
|
|
84
|
+
l && q(l, 0);
|
|
85
|
+
}
|
|
86
|
+
I(
|
|
87
|
+
le,
|
|
88
|
+
(e) => {
|
|
89
|
+
s("selection-change", e);
|
|
90
|
+
},
|
|
91
|
+
{ immediate: !1 }
|
|
92
|
+
);
|
|
93
|
+
function h(e) {
|
|
94
|
+
const l = e[t.rowKey];
|
|
95
|
+
return l != null ? String(l) : "";
|
|
96
|
+
}
|
|
97
|
+
function M(e) {
|
|
98
|
+
var l;
|
|
99
|
+
return ((l = t.fieldDefs) == null ? void 0 : l.find((o) => o.id === e)) ?? {
|
|
100
|
+
id: e,
|
|
101
|
+
type: "text",
|
|
102
|
+
label: e
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function E(e, l, o) {
|
|
106
|
+
U(e, l, o), s("cell-edit", { rowId: e, fieldId: l, value: o });
|
|
107
|
+
}
|
|
108
|
+
function G(e) {
|
|
109
|
+
const l = e;
|
|
110
|
+
if (l.__record) {
|
|
111
|
+
s("row-click-record", l.__record), s("row-click", l.__record);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
s("row-click", e);
|
|
115
|
+
}
|
|
116
|
+
function K(e) {
|
|
117
|
+
return {
|
|
118
|
+
groupKey: e.__groupKey,
|
|
119
|
+
count: e.__groupCount,
|
|
120
|
+
collapsed: Q.value.has(e.__groupKey),
|
|
121
|
+
colorMap: t.groupColorMap,
|
|
122
|
+
selectable: C.value
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function x(e) {
|
|
126
|
+
return {
|
|
127
|
+
row: e,
|
|
128
|
+
rowKey: t.rowKey,
|
|
129
|
+
selected: w.value.has(h(e)),
|
|
130
|
+
selectable: C.value,
|
|
131
|
+
columns: R.value,
|
|
132
|
+
priorityColorMap: t.priorityColorMap,
|
|
133
|
+
statusColorMap: t.statusColorMap
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return (e, l) => (a(), c("div", ge, [
|
|
137
|
+
b(ce, {
|
|
138
|
+
columns: r(R),
|
|
139
|
+
selectable: C.value,
|
|
140
|
+
"sort-key": r(S).field ?? "",
|
|
141
|
+
"sort-order": r(S).order ?? "asc",
|
|
142
|
+
"all-selected": r(D),
|
|
143
|
+
indeterminate: re.value,
|
|
144
|
+
onSort: r(W),
|
|
145
|
+
onSelectAll: ae
|
|
146
|
+
}, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "onSort"]),
|
|
147
|
+
$("div", {
|
|
148
|
+
ref_key: "scrollContainerRef",
|
|
149
|
+
ref: A,
|
|
150
|
+
class: "of-data-table-scroll-container"
|
|
151
|
+
}, [
|
|
152
|
+
X.value ? (a(), c("div", {
|
|
153
|
+
key: 0,
|
|
154
|
+
style: V({ height: r(ee) + "px", position: "relative" })
|
|
155
|
+
}, [
|
|
156
|
+
$("div", {
|
|
157
|
+
style: V({ transform: `translateY(${r(oe)}px)` })
|
|
158
|
+
}, [
|
|
159
|
+
(a(!0), c(v, null, z(r(Z), ({ data: o }) => {
|
|
160
|
+
var u;
|
|
161
|
+
return a(), c(v, {
|
|
162
|
+
key: o.id
|
|
163
|
+
}, [
|
|
164
|
+
r(_)(o) ? (a(), m(L, y({
|
|
165
|
+
key: 0,
|
|
166
|
+
ref_for: !0
|
|
167
|
+
}, K(o), {
|
|
168
|
+
onToggle: (n) => r(B)(o.__groupKey)
|
|
169
|
+
}), null, 16, ["onToggle"])) : (a(), m(F, y({
|
|
170
|
+
key: 1,
|
|
171
|
+
ref_for: !0
|
|
172
|
+
}, x(o), {
|
|
173
|
+
onSelect: H,
|
|
174
|
+
onClick: (n) => G(o)
|
|
175
|
+
}), N({ _: 2 }, [
|
|
176
|
+
(u = g.fieldDefs) != null && u.length ? {
|
|
177
|
+
name: "cell",
|
|
178
|
+
fn: P(({ row: n, col: d }) => [
|
|
179
|
+
b(O, {
|
|
180
|
+
"row-id": h(n),
|
|
181
|
+
field: M(d.key),
|
|
182
|
+
value: n[d.key],
|
|
183
|
+
onCommit: E
|
|
184
|
+
}, null, 8, ["row-id", "field", "value"])
|
|
185
|
+
]),
|
|
186
|
+
key: "0"
|
|
187
|
+
} : void 0
|
|
188
|
+
]), 1040, ["onClick"]))
|
|
189
|
+
], 64);
|
|
190
|
+
}), 128))
|
|
191
|
+
], 4)
|
|
192
|
+
], 4)) : (a(!0), c(v, { key: 1 }, z(r(p), (o) => {
|
|
193
|
+
var u;
|
|
194
|
+
return a(), c(v, {
|
|
195
|
+
key: o.id
|
|
196
|
+
}, [
|
|
197
|
+
r(_)(o) ? (a(), m(L, y({
|
|
198
|
+
key: 0,
|
|
199
|
+
ref_for: !0
|
|
200
|
+
}, K(o), {
|
|
201
|
+
onToggle: (n) => r(B)(o.__groupKey)
|
|
202
|
+
}), null, 16, ["onToggle"])) : (a(), m(F, y({
|
|
203
|
+
key: 1,
|
|
204
|
+
ref_for: !0
|
|
205
|
+
}, x(o), {
|
|
206
|
+
onSelect: H,
|
|
207
|
+
onClick: (n) => G(o)
|
|
208
|
+
}), N({ _: 2 }, [
|
|
209
|
+
(u = g.fieldDefs) != null && u.length ? {
|
|
210
|
+
name: "cell",
|
|
211
|
+
fn: P(({ row: n, col: d }) => [
|
|
212
|
+
b(O, {
|
|
213
|
+
"row-id": h(n),
|
|
214
|
+
field: M(d.key),
|
|
215
|
+
value: n[d.key],
|
|
216
|
+
onCommit: E
|
|
217
|
+
}, null, 8, ["row-id", "field", "value"])
|
|
218
|
+
]),
|
|
219
|
+
key: "0"
|
|
220
|
+
} : void 0
|
|
221
|
+
]), 1040, ["onClick"]))
|
|
222
|
+
], 64);
|
|
223
|
+
}), 128))
|
|
224
|
+
], 512),
|
|
225
|
+
te.value ? (a(), m(ue, {
|
|
226
|
+
key: 0,
|
|
227
|
+
onClick: l[0] || (l[0] = (o) => s("add-row"))
|
|
228
|
+
})) : ie("", !0)
|
|
229
|
+
]));
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
export {
|
|
233
|
+
Ee as default
|
|
234
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as E, computed as i, defineAsyncComponent as l, openBlock as o, createElementBlock as m, normalizeClass as I, createBlock as s, Suspense as N, withCtx as f, resolveDynamicComponent as B, createElementVNode as A, toDisplayString as S } from "vue";
|
|
2
|
+
import { useInlineEdit as D } from "../../composables/useInlineEdit.js";
|
|
3
|
+
const T = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "of-field-cell__display"
|
|
6
|
+
}, z = /* @__PURE__ */ E({
|
|
7
|
+
__name: "FieldCell",
|
|
8
|
+
props: {
|
|
9
|
+
rowId: {},
|
|
10
|
+
field: {},
|
|
11
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
12
|
+
readonly: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["commit", "cancel", "tabNext"],
|
|
15
|
+
setup(n, { emit: u }) {
|
|
16
|
+
const e = n, a = u, { isEditing: p, activate: y, commit: v, cancel: C } = D(), r = i(() => p(e.rowId, e.field.id)), d = i(() => e.readonly || e.field.readonly);
|
|
17
|
+
function b() {
|
|
18
|
+
d.value || y(e.rowId, e.field.id);
|
|
19
|
+
}
|
|
20
|
+
function k(t) {
|
|
21
|
+
v(e.rowId, e.field.id, t), a("commit", e.rowId, e.field.id, t);
|
|
22
|
+
}
|
|
23
|
+
function x() {
|
|
24
|
+
C(), a("cancel");
|
|
25
|
+
}
|
|
26
|
+
function g() {
|
|
27
|
+
a("tabNext");
|
|
28
|
+
}
|
|
29
|
+
const _ = {
|
|
30
|
+
text: l(() => import("../field/FieldText.vue.js")),
|
|
31
|
+
number: l(() => import("../field/FieldNumber.vue.js")),
|
|
32
|
+
checkbox: l(() => import("../field/FieldCheckbox.vue.js")),
|
|
33
|
+
select: l(() => import("../field/FieldSelect.vue.js")),
|
|
34
|
+
multiselect: l(() => import("../field/FieldMultiSelect.vue.js")),
|
|
35
|
+
date: l(() => import("../field/FieldDate.vue.js")),
|
|
36
|
+
datetime: l(() => import("../field/FieldDatetime.vue.js")),
|
|
37
|
+
rating: l(() => import("../field/FieldRating.vue.js")),
|
|
38
|
+
url: l(() => import("../field/FieldUrl.vue.js")),
|
|
39
|
+
email: l(() => import("../field/FieldEmail.vue.js"))
|
|
40
|
+
}, h = i(() => _[e.field.type]), w = i(() => {
|
|
41
|
+
const t = e.value;
|
|
42
|
+
return t == null || t === "" ? "—" : Array.isArray(t) ? t.join(", ") : typeof t == "boolean" ? t ? "✓" : "—" : String(t);
|
|
43
|
+
});
|
|
44
|
+
return (t, c) => (o(), m("div", {
|
|
45
|
+
class: I(["of-field-cell", {
|
|
46
|
+
"of-field-cell--editing": r.value,
|
|
47
|
+
"of-field-cell--readonly": d.value
|
|
48
|
+
}]),
|
|
49
|
+
onClick: b
|
|
50
|
+
}, [
|
|
51
|
+
r.value ? (o(), s(N, { key: 0 }, {
|
|
52
|
+
fallback: f(() => [...c[0] || (c[0] = [
|
|
53
|
+
A("span", { class: "of-field-cell__loading" }, "...", -1)
|
|
54
|
+
])]),
|
|
55
|
+
default: f(() => [
|
|
56
|
+
(o(), s(B(h.value), {
|
|
57
|
+
value: n.value,
|
|
58
|
+
field: n.field,
|
|
59
|
+
onCommit: k,
|
|
60
|
+
onCancel: x,
|
|
61
|
+
onTabNext: g
|
|
62
|
+
}, null, 40, ["value", "field"]))
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
})) : (o(), m("span", T, S(w.value), 1))
|
|
66
|
+
], 2));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
z as default
|
|
71
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineComponent as b, ref as k, watch as C, openBlock as r, createElementBlock as d, createElementVNode as n, createVNode as l, unref as s, createTextVNode as u, withCtx as V, Fragment as y, renderList as E, normalizeClass as x, toDisplayString as z, createCommentVNode as w } from "vue";
|
|
2
|
+
import { X as N, Eye as B, EyeOff as D, GripVertical as A } from "lucide-vue-next";
|
|
3
|
+
import { VueDraggable as T } from "vue-draggable-plus";
|
|
4
|
+
const U = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "of-col-manager"
|
|
7
|
+
}, $ = { class: "of-col-manager__header" }, F = { class: "of-col-manager__actions" }, G = { class: "of-col-manager__drag" }, L = ["checked", "onChange"], j = /* @__PURE__ */ b({
|
|
8
|
+
__name: "TableColumnManager",
|
|
9
|
+
props: {
|
|
10
|
+
columns: {},
|
|
11
|
+
visible: { type: Boolean, default: !0 }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:columns", "close"],
|
|
14
|
+
setup(c, { emit: f }) {
|
|
15
|
+
const _ = c, m = f, t = k([]);
|
|
16
|
+
C(
|
|
17
|
+
() => _.columns,
|
|
18
|
+
(o) => {
|
|
19
|
+
t.value = o.map((e) => ({ ...e }));
|
|
20
|
+
},
|
|
21
|
+
{ immediate: !0, deep: !0 }
|
|
22
|
+
);
|
|
23
|
+
function i() {
|
|
24
|
+
m(
|
|
25
|
+
"update:columns",
|
|
26
|
+
t.value.map((o) => ({ ...o }))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function g(o) {
|
|
30
|
+
o.hidden = !o.hidden, i();
|
|
31
|
+
}
|
|
32
|
+
function p() {
|
|
33
|
+
t.value.forEach((o) => o.hidden = !1), i();
|
|
34
|
+
}
|
|
35
|
+
function h() {
|
|
36
|
+
t.value.forEach((o) => o.hidden = !0), i();
|
|
37
|
+
}
|
|
38
|
+
function v() {
|
|
39
|
+
i();
|
|
40
|
+
}
|
|
41
|
+
return (o, e) => c.visible ? (r(), d("div", U, [
|
|
42
|
+
n("div", $, [
|
|
43
|
+
e[2] || (e[2] = n("span", { class: "of-col-manager__title" }, "管理列", -1)),
|
|
44
|
+
n("button", {
|
|
45
|
+
class: "of-col-manager__close",
|
|
46
|
+
onClick: e[0] || (e[0] = (a) => m("close"))
|
|
47
|
+
}, [
|
|
48
|
+
l(s(N), { size: 14 })
|
|
49
|
+
])
|
|
50
|
+
]),
|
|
51
|
+
n("div", F, [
|
|
52
|
+
n("button", {
|
|
53
|
+
class: "of-col-manager__action-btn",
|
|
54
|
+
onClick: p
|
|
55
|
+
}, [
|
|
56
|
+
l(s(B), { size: 12 }),
|
|
57
|
+
e[3] || (e[3] = u(" 显示全部 ", -1))
|
|
58
|
+
]),
|
|
59
|
+
n("button", {
|
|
60
|
+
class: "of-col-manager__action-btn",
|
|
61
|
+
onClick: h
|
|
62
|
+
}, [
|
|
63
|
+
l(s(D), { size: 12 }),
|
|
64
|
+
e[4] || (e[4] = u(" 隐藏全部 ", -1))
|
|
65
|
+
])
|
|
66
|
+
]),
|
|
67
|
+
l(s(T), {
|
|
68
|
+
modelValue: t.value,
|
|
69
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => t.value = a),
|
|
70
|
+
handle: ".of-col-manager__drag",
|
|
71
|
+
animation: 150,
|
|
72
|
+
onEnd: v
|
|
73
|
+
}, {
|
|
74
|
+
default: V(() => [
|
|
75
|
+
(r(!0), d(y, null, E(t.value, (a) => (r(), d("div", {
|
|
76
|
+
key: a.key,
|
|
77
|
+
class: "of-col-manager__row"
|
|
78
|
+
}, [
|
|
79
|
+
n("span", G, [
|
|
80
|
+
l(s(A), { size: 14 })
|
|
81
|
+
]),
|
|
82
|
+
n("input", {
|
|
83
|
+
type: "checkbox",
|
|
84
|
+
class: "of-col-manager__checkbox",
|
|
85
|
+
checked: !a.hidden,
|
|
86
|
+
onChange: (M) => g(a)
|
|
87
|
+
}, null, 40, L),
|
|
88
|
+
n("span", {
|
|
89
|
+
class: x(["of-col-manager__label", { dimmed: a.hidden }])
|
|
90
|
+
}, z(a.label), 3)
|
|
91
|
+
]))), 128))
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
}, 8, ["modelValue"])
|
|
95
|
+
])) : w("", !0);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
j as default
|
|
100
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { defineComponent as S, computed as p, openBlock as o, createElementBlock as s, normalizeClass as $, withModifiers as B, createElementVNode as D, createCommentVNode as T, Fragment as g, renderList as A, normalizeStyle as d, renderSlot as P, toDisplayString as a } from "vue";
|
|
2
|
+
import { mergeColorMap as w, DEFAULT_PRIORITY_MAP as R, DEFAULT_STATUS_MAP as _, resolveBadge as h } from "../../composables/useBadge.js";
|
|
3
|
+
const E = ["checked"], N = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-badge of-badge--role"
|
|
6
|
+
}, V = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "of-td-empty"
|
|
9
|
+
}, F = {
|
|
10
|
+
key: 3,
|
|
11
|
+
class: "of-td-text"
|
|
12
|
+
}, I = {
|
|
13
|
+
key: 4,
|
|
14
|
+
class: "of-td-id"
|
|
15
|
+
}, L = {
|
|
16
|
+
key: 5,
|
|
17
|
+
class: "of-td-title"
|
|
18
|
+
}, U = {
|
|
19
|
+
key: 6,
|
|
20
|
+
class: "of-td-text"
|
|
21
|
+
}, W = /* @__PURE__ */ S({
|
|
22
|
+
__name: "TableDataRow",
|
|
23
|
+
props: {
|
|
24
|
+
row: {},
|
|
25
|
+
rowKey: { default: "id" },
|
|
26
|
+
selected: { type: Boolean, default: !1 },
|
|
27
|
+
selectable: { type: Boolean, default: !0 },
|
|
28
|
+
columns: {},
|
|
29
|
+
priorityColorMap: {},
|
|
30
|
+
statusColorMap: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["select", "click"],
|
|
33
|
+
setup(r, { emit: b }) {
|
|
34
|
+
const i = r, u = b;
|
|
35
|
+
function C(e) {
|
|
36
|
+
if (e.width === "fill") {
|
|
37
|
+
const n = `${e.minWidth ?? 220}px`;
|
|
38
|
+
return { flex: `1 1 ${n}`, minWidth: n };
|
|
39
|
+
}
|
|
40
|
+
return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
41
|
+
}
|
|
42
|
+
const v = p(
|
|
43
|
+
() => w(R, i.priorityColorMap)
|
|
44
|
+
), x = p(() => w(_, i.statusColorMap));
|
|
45
|
+
function c(e) {
|
|
46
|
+
return h(e, v.value);
|
|
47
|
+
}
|
|
48
|
+
function f(e) {
|
|
49
|
+
return h(e, x.value);
|
|
50
|
+
}
|
|
51
|
+
function M(e) {
|
|
52
|
+
if (!e) return "-";
|
|
53
|
+
const n = new Date(e);
|
|
54
|
+
return isNaN(n.getTime()) ? e : `${n.getMonth() + 1}/${n.getDate()}`;
|
|
55
|
+
}
|
|
56
|
+
function y(e) {
|
|
57
|
+
return i.row[e.key];
|
|
58
|
+
}
|
|
59
|
+
function k(e) {
|
|
60
|
+
const n = y(e);
|
|
61
|
+
return n != null ? String(n) : "-";
|
|
62
|
+
}
|
|
63
|
+
function l(e) {
|
|
64
|
+
const n = y(e);
|
|
65
|
+
return typeof n == "string" ? n : "";
|
|
66
|
+
}
|
|
67
|
+
function m() {
|
|
68
|
+
const e = i.row[i.rowKey];
|
|
69
|
+
return e != null ? String(e) : "";
|
|
70
|
+
}
|
|
71
|
+
return (e, n) => (o(), s("div", {
|
|
72
|
+
class: $(["of-table-row", { "of-table-row--selected": r.selected }]),
|
|
73
|
+
onClick: n[2] || (n[2] = (t) => u("click", r.row))
|
|
74
|
+
}, [
|
|
75
|
+
r.selectable ? (o(), s("div", {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "of-td of-td-checkbox",
|
|
78
|
+
onClick: n[1] || (n[1] = B(() => {
|
|
79
|
+
}, ["stop"]))
|
|
80
|
+
}, [
|
|
81
|
+
D("input", {
|
|
82
|
+
type: "checkbox",
|
|
83
|
+
class: "of-checkbox",
|
|
84
|
+
checked: r.selected,
|
|
85
|
+
onChange: n[0] || (n[0] = (t) => u("select", m()))
|
|
86
|
+
}, null, 40, E)
|
|
87
|
+
])) : T("", !0),
|
|
88
|
+
(o(!0), s(g, null, A(r.columns, (t) => (o(), s("div", {
|
|
89
|
+
key: t.key,
|
|
90
|
+
class: "of-td",
|
|
91
|
+
style: d(C(t))
|
|
92
|
+
}, [
|
|
93
|
+
P(e.$slots, "cell", {
|
|
94
|
+
row: r.row,
|
|
95
|
+
col: t
|
|
96
|
+
}, () => [
|
|
97
|
+
t.key === "status" ? (o(), s("span", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "of-badge",
|
|
100
|
+
style: d(f(l(t)).style)
|
|
101
|
+
}, a(f(l(t)).label), 5)) : t.key === "priority" ? (o(), s("span", {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: "of-badge",
|
|
104
|
+
style: d(c(l(t)).style)
|
|
105
|
+
}, a(c(l(t)).label), 5)) : t.key === "role" ? (o(), s(g, { key: 2 }, [
|
|
106
|
+
l(t) ? (o(), s("span", N, a(l(t)), 1)) : (o(), s("span", V, "-"))
|
|
107
|
+
], 64)) : t.key === "updatedAt" ? (o(), s("span", F, a(M(l(t))), 1)) : t.key === "id" ? (o(), s("span", I, a(m()), 1)) : t.key === "title" ? (o(), s("span", L, a(k(t)), 1)) : (o(), s("span", U, a(k(t)), 1))
|
|
108
|
+
], !0)
|
|
109
|
+
], 4))), 128))
|
|
110
|
+
], 2));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export {
|
|
114
|
+
W as default
|
|
115
|
+
};
|