@oneflowui/ui 0.5.6 → 0.5.8
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/README.md +11 -0
- package/dist/components/ContextMenu/index.vue.js +2 -2
- package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
- package/dist/components/Dashboard/index.vue.d.ts +3 -2
- package/dist/components/Dashboard/index.vue.js +2 -2
- package/dist/components/ai/AiSender.vue.js +2 -2
- package/dist/components/ai/AiSender.vue2.js +8 -7
- package/dist/components/auxiliary/ColorPanel.vue.js +2 -2
- package/dist/components/auxiliary/ColorPanel.vue2.js +25 -23
- package/dist/components/auxiliary/FileUpload.vue.js +2 -2
- package/dist/components/auxiliary/FileUpload.vue2.js +1 -0
- package/dist/components/auxiliary/PersonPanel.vue.js +1 -1
- package/dist/components/auxiliary/PersonPanel.vue2.js +2 -1
- package/dist/components/base/Accordion.vue.js +1 -1
- package/dist/components/base/Avatar.vue.d.ts +3 -0
- package/dist/components/base/Avatar.vue.js +4 -4
- package/dist/components/base/Avatar.vue2.js +8 -8
- package/dist/components/base/Badge.vue.d.ts +2 -0
- package/dist/components/base/Badge.vue.js +2 -2
- package/dist/components/base/Badge.vue2.js +2 -2
- package/dist/components/base/ButtonGroup.vue.js +2 -2
- package/dist/components/base/ButtonGroup.vue2.js +2 -2
- package/dist/components/base/ChainItem.vue.d.ts +6 -0
- package/dist/components/base/ChainItem.vue.js +2 -2
- package/dist/components/base/ChainItem.vue2.js +17 -17
- package/dist/components/base/DropdownMenu.vue.js +2 -2
- package/dist/components/base/DropdownMenu.vue2.js +22 -20
- package/dist/components/base/EmptyState.vue.js +2 -2
- package/dist/components/base/EmptyState.vue2.js +2 -2
- package/dist/components/base/InfoCard.vue.d.ts +9 -0
- package/dist/components/base/InfoCard.vue.js +2 -2
- package/dist/components/base/InfoCard.vue2.js +65 -57
- package/dist/components/base/MonitorItem.vue.js +2 -2
- package/dist/components/base/MonitorItem.vue2.js +33 -25
- package/dist/components/base/PersonaCard.vue.d.ts +5 -0
- package/dist/components/base/PersonaCard.vue.js +3 -3
- package/dist/components/base/PersonaCard.vue2.js +56 -50
- package/dist/components/base/ProgressBar.vue.d.ts +1 -0
- package/dist/components/base/ProgressBar.vue.js +2 -2
- package/dist/components/base/ProgressBar.vue2.js +10 -10
- package/dist/components/base/RangeSlider.vue.d.ts +15 -0
- package/dist/components/base/RangeSlider.vue.js +1 -1
- package/dist/components/base/RangeSlider.vue2.js +22 -15
- package/dist/components/base/RefTag.vue.d.ts +4 -0
- package/dist/components/base/RefTag.vue.js +3 -3
- package/dist/components/base/RefTag.vue2.js +14 -14
- package/dist/components/base/SearchHighlight.vue.js +1 -1
- package/dist/components/base/SectionBlock.vue.js +2 -2
- package/dist/components/base/SectionBlock.vue2.js +54 -48
- package/dist/components/base/SelectBadge.vue.d.ts +5 -0
- package/dist/components/base/SelectBadge.vue.js +3 -3
- package/dist/components/base/SelectBadge.vue2.js +36 -28
- package/dist/components/base/StatisticCard.vue.js +1 -1
- package/dist/components/base/StatusIndicator.vue.js +2 -2
- package/dist/components/base/StatusIndicator.vue2.js +2 -2
- package/dist/components/base/StatusSummary.vue.js +2 -2
- package/dist/components/base/Stepper.vue.js +2 -2
- package/dist/components/base/Switch.vue.js +2 -2
- package/dist/components/base/ToolbarBtn.vue.js +2 -2
- package/dist/components/base/ViewModeGroup.vue.js +1 -1
- package/dist/components/base/ViewModeGroup.vue2.js +3 -3
- package/dist/components/base/ViewSwitcher.vue.js +1 -1
- package/dist/components/base/ViewSwitcher.vue2.js +3 -3
- package/dist/components/base/ViewTab.vue.js +1 -1
- package/dist/components/base/ViewTab.vue2.js +5 -6
- package/dist/components/breadcrumb/Breadcrumb.vue.js +2 -2
- package/dist/components/breadcrumb/BreadcrumbItem.vue.js +2 -2
- package/dist/components/database/DatabaseView.vue.d.ts +6 -1
- package/dist/components/database/DatabaseView.vue.js +2 -2
- package/dist/components/database/DatabaseView.vue2.js +438 -293
- package/dist/components/detail/PropPanel.vue.js +2 -2
- package/dist/components/detail/PropPanel.vue2.js +34 -30
- package/dist/components/detail/PropRow.vue.d.ts +6 -0
- package/dist/components/detail/PropRow.vue.js +2 -2
- package/dist/components/detail/PropRow.vue2.js +24 -24
- package/dist/components/editor/BlockQuote.vue.d.ts +2 -1
- package/dist/components/editor/BlockQuote.vue.js +1 -1
- package/dist/components/editor/BlockQuote.vue2.js +43 -29
- package/dist/components/editor/ContentBlock.vue.d.ts +4 -2
- package/dist/components/editor/ContentBlock.vue.js +2 -2
- package/dist/components/editor/ContentBlock.vue2.js +54 -33
- package/dist/components/editor/RichTextEditor.vue.js +2 -2
- package/dist/components/editor/RichTextEditor.vue2.js +10 -14
- package/dist/components/field/FieldAttachment.vue.js +2 -2
- package/dist/components/field/FieldAttachment.vue2.js +30 -32
- package/dist/components/field/FieldAutoNumber.vue.js +2 -2
- package/dist/components/field/FieldCheckbox.vue.js +2 -2
- package/dist/components/field/FieldCheckbox.vue2.js +13 -11
- package/dist/components/field/FieldCreator.vue.js +2 -2
- package/dist/components/field/FieldCurrency.vue.js +2 -2
- package/dist/components/field/FieldCurrency.vue2.js +15 -14
- package/dist/components/field/FieldDate.vue.js +1 -1
- package/dist/components/field/FieldDate.vue2.js +14 -16
- package/dist/components/field/FieldDatetime.vue.js +1 -1
- package/dist/components/field/FieldDatetime.vue2.js +12 -11
- package/dist/components/field/FieldEmail.vue.js +2 -2
- package/dist/components/field/FieldEmail.vue2.js +14 -13
- package/dist/components/field/FieldMarkdownPreview.vue.js +2 -2
- package/dist/components/field/FieldMultiSelect.vue.d.ts +2 -2
- package/dist/components/field/FieldMultiSelect.vue.js +2 -2
- package/dist/components/field/FieldMultiSelect.vue2.js +80 -75
- package/dist/components/field/FieldNumber.vue.js +3 -3
- package/dist/components/field/FieldNumber.vue2.js +19 -18
- package/dist/components/field/FieldPhone.vue.js +2 -2
- package/dist/components/field/FieldPhone.vue2.js +12 -11
- package/dist/components/field/FieldProgress.vue.js +1 -1
- package/dist/components/field/FieldProgress.vue2.js +18 -17
- package/dist/components/field/FieldRating.vue.js +2 -2
- package/dist/components/field/FieldRating.vue2.js +22 -16
- package/dist/components/field/FieldRelation.vue.js +1 -1
- package/dist/components/field/FieldRelation.vue2.js +25 -22
- package/dist/components/field/FieldRichText.vue.js +1 -1
- package/dist/components/field/FieldRichText.vue2.js +10 -7
- package/dist/components/field/FieldSelect.vue.js +2 -2
- package/dist/components/field/FieldSelect.vue2.js +81 -63
- package/dist/components/field/FieldText.vue.js +2 -2
- package/dist/components/field/FieldText.vue2.js +17 -16
- package/dist/components/field/FieldUrl.vue.js +2 -2
- package/dist/components/field/FieldUrl.vue2.js +17 -16
- package/dist/components/form/FormDesigner.vue.js +2 -2
- package/dist/components/form/FormDesigner.vue2.js +83 -78
- package/dist/components/gallery/GalleryCard.vue.d.ts +1 -1
- package/dist/components/gallery/GalleryCard.vue.js +2 -2
- package/dist/components/gallery/GalleryCard.vue2.js +2 -1
- package/dist/components/kanban/KanbanCard.vue.d.ts +3 -1
- package/dist/components/kanban/KanbanCard.vue.js +1 -1
- package/dist/components/kanban/KanbanCard.vue2.js +15 -14
- package/dist/components/kanban/KanbanColumn.vue.d.ts +2 -0
- package/dist/components/kanban/KanbanColumn.vue.js +2 -2
- package/dist/components/kanban/KanbanColumn.vue2.js +9 -9
- package/dist/components/kanban/QuickAddRow.vue.js +2 -2
- package/dist/components/kanban/QuickAddRow.vue2.js +15 -14
- package/dist/components/layout/Navbar.vue.js +3 -3
- package/dist/components/layout/Navbar.vue2.js +5 -4
- package/dist/components/layout/Sidebar.vue.js +2 -2
- package/dist/components/layout/Sidebar.vue2.js +1 -1
- package/dist/components/mermaid/MermaidChart.vue.js +2 -2
- package/dist/components/mermaid/MermaidChart.vue2.js +17 -17
- package/dist/components/overlay/Dialog.vue.d.ts +1 -0
- package/dist/components/overlay/Dialog.vue.js +1 -1
- package/dist/components/overlay/Dialog.vue2.js +9 -9
- package/dist/components/overlay/Drawer.vue.d.ts +2 -1
- package/dist/components/overlay/Drawer.vue.js +2 -2
- package/dist/components/overlay/Drawer.vue2.js +35 -29
- package/dist/components/overlay/Modal.vue.d.ts +2 -1
- package/dist/components/overlay/Modal.vue.js +1 -1
- package/dist/components/overlay/Modal.vue2.js +34 -28
- package/dist/components/overlay/SidePanel.vue.d.ts +1 -0
- package/dist/components/overlay/SidePanel.vue.js +1 -1
- package/dist/components/overlay/SidePanel.vue2.js +6 -6
- package/dist/components/split/SplitPane.vue.js +2 -2
- package/dist/components/split/SplitPane.vue2.js +11 -9
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +4 -2
- package/dist/components/table/ColumnHeaderMenu.vue.js +1 -1
- package/dist/components/table/ColumnHeaderMenu.vue2.js +42 -36
- package/dist/components/table/DataTable.vue.d.ts +9 -6
- package/dist/components/table/DataTable.vue.js +2 -2
- package/dist/components/table/DataTable.vue2.js +643 -521
- package/dist/components/table/DetailSheet.vue.d.ts +2 -0
- package/dist/components/table/DetailSheet.vue.js +2 -2
- package/dist/components/table/DetailSheet.vue2.js +154 -70
- package/dist/components/table/FieldCell.vue.d.ts +2 -1
- package/dist/components/table/FieldCell.vue.js +1 -1
- package/dist/components/table/FieldCell.vue2.js +57 -48
- package/dist/components/table/FieldTypePicker.vue.d.ts +1 -0
- package/dist/components/table/FieldTypePicker.vue.js +4 -4
- package/dist/components/table/FieldTypePicker.vue2.js +1 -1
- package/dist/components/table/MobileListView.vue.d.ts +3 -2
- package/dist/components/table/MobileListView.vue.js +2 -2
- package/dist/components/table/MobileListView.vue2.js +57 -50
- package/dist/components/table/TableColumnManager.vue.js +1 -1
- package/dist/components/table/TableColumnManager.vue2.js +29 -28
- package/dist/components/table/TableDataRow.vue.d.ts +5 -1
- package/dist/components/table/TableDataRow.vue.js +3 -3
- package/dist/components/table/TableDataRow.vue2.js +102 -63
- package/dist/components/table/TableFilterPanel.vue.js +2 -2
- package/dist/components/table/TableFilterPanel.vue2.js +3 -0
- package/dist/components/table/TableGroupRow.vue.d.ts +2 -0
- package/dist/components/table/TableGroupRow.vue.js +2 -2
- package/dist/components/table/TableGroupRow.vue2.js +35 -30
- package/dist/components/table/TableHeaderRow.vue.d.ts +3 -1
- package/dist/components/table/TableHeaderRow.vue.js +1 -1
- package/dist/components/table/TableHeaderRow.vue2.js +111 -58
- package/dist/components/table/TableToolbar.vue.js +1 -1
- package/dist/components/table/TableToolbar.vue2.js +2 -2
- package/dist/components/tabs/TabPanel.vue.js +4 -4
- package/dist/components/tabs/TabPanel.vue2.js +1 -1
- package/dist/components/tabs/Tabs.vue.js +2 -2
- package/dist/components/tabs/Tabs.vue2.js +2 -2
- package/dist/components/timeline/GanttRow.vue.d.ts +2 -0
- package/dist/components/timeline/GanttRow.vue.js +2 -2
- package/dist/components/timeline/GanttRow.vue2.js +68 -52
- package/dist/components/timeline/GanttTimeline.vue.d.ts +6 -0
- package/dist/components/timeline/GanttTimeline.vue.js +2 -2
- package/dist/components/timeline/GanttTimeline.vue2.js +24 -24
- package/dist/composables/useColumnResize.d.ts +4 -1
- package/dist/composables/useColumnResize.js +114 -45
- package/dist/composables/useKeyboardNavigation.d.ts +1 -1
- package/dist/composables/useRowDrag.d.ts +7 -5
- package/dist/composables/useRowDrag.js +24 -24
- package/dist/composables/useSupabaseProvider.d.ts +8 -1
- package/dist/composables/useTableData.d.ts +5 -3
- package/dist/composables/useTableGroup.d.ts +2 -2
- package/dist/composables/useViewPersistence.d.ts +32 -3
- package/dist/composables/useVirtualList.d.ts +1 -0
- package/dist/composables/useVirtualList.js +94 -81
- package/dist/plugin.js +103 -102
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/echarts.d.ts +1 -0
- package/dist/utils/supabaseSchema.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,99 +1,106 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mergeColorMap as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as D, computed as v, ref as _, openBlock as a, createElementBlock as n, Fragment as g, renderList as C, createElementVNode as X, normalizeStyle as T, renderSlot as M, createTextVNode as A, toDisplayString as d, createCommentVNode as c } from "vue";
|
|
2
|
+
import { mergeColorMap as K, DEFAULT_STATUS_MAP as L, resolveBadge as N } from "../../composables/useBadge.js";
|
|
3
|
+
const Y = { class: "of-mobile-list" }, w = ["onClick", "onKeydown", "onTouchstart"], F = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-mobile-card__title"
|
|
6
|
-
},
|
|
6
|
+
}, U = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "of-mobile-card__meta"
|
|
9
|
-
},
|
|
9
|
+
}, z = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "of-mobile-card__tag"
|
|
12
|
-
},
|
|
12
|
+
}, I = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "of-mobile-card__action-delete"
|
|
15
|
-
},
|
|
15
|
+
}, R = /* @__PURE__ */ D({
|
|
16
16
|
__name: "MobileListView",
|
|
17
17
|
props: {
|
|
18
18
|
rows: {},
|
|
19
19
|
columns: {},
|
|
20
20
|
selectable: { type: Boolean, default: !1 },
|
|
21
21
|
addable: { type: Boolean, default: !0 },
|
|
22
|
-
statusColorMap: {},
|
|
22
|
+
statusColorMap: { default: void 0 },
|
|
23
23
|
readonly: { type: Boolean, default: !1 }
|
|
24
24
|
},
|
|
25
25
|
emits: ["row-click", "add-row"],
|
|
26
|
-
setup(
|
|
27
|
-
const m =
|
|
28
|
-
function u(t,
|
|
29
|
-
const e = t[
|
|
26
|
+
setup(i, { emit: S }) {
|
|
27
|
+
const m = i, f = S, B = v(() => K(L, m.statusColorMap)), y = v(() => m.columns[0]), h = v(() => m.columns.slice(1, 4));
|
|
28
|
+
function u(t, o) {
|
|
29
|
+
const e = t[o.key];
|
|
30
30
|
return e != null ? String(e) : "";
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function b(t) {
|
|
33
|
+
return N(t, B.value);
|
|
34
34
|
}
|
|
35
|
-
let
|
|
36
|
-
const
|
|
37
|
-
function
|
|
38
|
-
|
|
35
|
+
let p = 0, k = 0;
|
|
36
|
+
const r = _(null), s = _(0);
|
|
37
|
+
function x(t, o) {
|
|
38
|
+
p = t.touches[0].clientX, k = t.touches[0].clientY, r.value = o, s.value = 0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
if (Math.abs(e) > Math.abs(
|
|
44
|
-
|
|
40
|
+
function E(t) {
|
|
41
|
+
if (!r.value) return;
|
|
42
|
+
const o = t.touches[0].clientX - p, e = t.touches[0].clientY - k;
|
|
43
|
+
if (Math.abs(e) > Math.abs(o)) {
|
|
44
|
+
r.value = null;
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
s.value = Math.max(-80, Math.min(0,
|
|
47
|
+
s.value = Math.max(-80, Math.min(0, o));
|
|
48
|
+
}
|
|
49
|
+
function V() {
|
|
50
|
+
s.value < -40 ? s.value = -80 : (s.value = 0, r.value = null);
|
|
48
51
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
52
|
+
function $(t, o) {
|
|
53
|
+
t.target === t.currentTarget && (t.key !== "Enter" && t.key !== " " || (t.preventDefault(), f("row-click", o)));
|
|
51
54
|
}
|
|
52
|
-
return (t,
|
|
53
|
-
(
|
|
55
|
+
return (t, o) => (a(), n("div", Y, [
|
|
56
|
+
(a(!0), n(g, null, C(i.rows, (e) => (a(), n("div", {
|
|
54
57
|
key: e.id,
|
|
55
58
|
class: "of-mobile-card-wrapper"
|
|
56
59
|
}, [
|
|
57
60
|
X("div", {
|
|
58
61
|
class: "of-mobile-card",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
role: "button",
|
|
63
|
+
tabindex: "0",
|
|
64
|
+
style: T({ transform: r.value === e.id ? `translateX(${s.value}px)` : "" }),
|
|
65
|
+
onClick: (l) => f("row-click", e),
|
|
66
|
+
onKeydown: (l) => $(l, e),
|
|
67
|
+
onTouchstart: (l) => x(l, e.id),
|
|
68
|
+
onTouchmove: E,
|
|
69
|
+
onTouchend: V
|
|
64
70
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
y.value ? (a(), n("div", F, [
|
|
72
|
+
M(t.$slots, "cell", {
|
|
67
73
|
row: e,
|
|
68
|
-
col:
|
|
74
|
+
col: y.value
|
|
69
75
|
}, () => [
|
|
70
|
-
A(d(u(e,
|
|
76
|
+
A(d(u(e, y.value) || "—"), 1)
|
|
71
77
|
], !0)
|
|
72
|
-
])) :
|
|
73
|
-
h.value.length > 0 ? (
|
|
74
|
-
(
|
|
78
|
+
])) : c("", !0),
|
|
79
|
+
h.value.length > 0 ? (a(), n("div", U, [
|
|
80
|
+
(a(!0), n(g, null, C(h.value, (l) => M(t.$slots, "cell", {
|
|
75
81
|
key: l.key,
|
|
76
82
|
row: e,
|
|
77
83
|
col: l
|
|
78
84
|
}, () => [
|
|
79
|
-
l.key === "status" && u(e, l) ? (
|
|
85
|
+
l.key === "status" && u(e, l) ? (a(), n("span", {
|
|
80
86
|
key: 0,
|
|
81
87
|
class: "of-mobile-card__badge",
|
|
82
|
-
style:
|
|
83
|
-
}, d(
|
|
88
|
+
style: T(b(u(e, l)).style)
|
|
89
|
+
}, d(b(u(e, l)).label), 5)) : u(e, l) ? (a(), n("span", z, d(l.label) + ": " + d(u(e, l)), 1)) : c("", !0)
|
|
84
90
|
], !0)), 128))
|
|
85
|
-
])) :
|
|
86
|
-
], 44,
|
|
87
|
-
|
|
91
|
+
])) : c("", !0)
|
|
92
|
+
], 44, w),
|
|
93
|
+
r.value === e.id && s.value < -40 ? (a(), n("div", I, " 删除 ")) : c("", !0)
|
|
88
94
|
]))), 128)),
|
|
89
|
-
|
|
95
|
+
i.addable && !i.readonly ? (a(), n("button", {
|
|
90
96
|
key: 0,
|
|
97
|
+
type: "button",
|
|
91
98
|
class: "of-mobile-add-btn",
|
|
92
|
-
onClick:
|
|
93
|
-
}, " + 新增记录 ")) :
|
|
99
|
+
onClick: o[0] || (o[0] = (e) => f("add-row"))
|
|
100
|
+
}, " + 新增记录 ")) : c("", !0)
|
|
94
101
|
]));
|
|
95
102
|
}
|
|
96
103
|
});
|
|
97
104
|
export {
|
|
98
|
-
|
|
105
|
+
R as default
|
|
99
106
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableColumnManager.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-bade90c0"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { X as N, Eye as B, EyeOff as D, GripVertical as
|
|
3
|
-
import { VueDraggable as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as v, 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 $ } from "lucide-vue-next";
|
|
3
|
+
import { VueDraggable as A } from "vue-draggable-plus";
|
|
4
|
+
const T = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "of-col-manager"
|
|
7
|
-
},
|
|
7
|
+
}, U = { class: "of-col-manager__header" }, F = { class: "of-col-manager__actions" }, G = { class: "of-col-manager__drag" }, L = ["aria-label", "checked", "onChange"], j = /* @__PURE__ */ v({
|
|
8
8
|
__name: "TableColumnManager",
|
|
9
9
|
props: {
|
|
10
10
|
columns: {},
|
|
@@ -15,35 +15,35 @@ const U = {
|
|
|
15
15
|
const _ = c, m = f, t = k([]);
|
|
16
16
|
C(
|
|
17
17
|
() => _.columns,
|
|
18
|
-
(
|
|
19
|
-
t.value =
|
|
18
|
+
(a) => {
|
|
19
|
+
t.value = a.map((e) => ({ ...e }));
|
|
20
20
|
},
|
|
21
21
|
{ immediate: !0, deep: !0 }
|
|
22
22
|
);
|
|
23
23
|
function i() {
|
|
24
24
|
m(
|
|
25
25
|
"update:columns",
|
|
26
|
-
t.value.map((
|
|
26
|
+
t.value.map((a) => ({ ...a }))
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
function g(
|
|
30
|
-
|
|
29
|
+
function g(a) {
|
|
30
|
+
a.hidden = !a.hidden, i();
|
|
31
31
|
}
|
|
32
32
|
function p() {
|
|
33
|
-
t.value.forEach((
|
|
33
|
+
t.value.forEach((a) => a.hidden = !1), i();
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
t.value.forEach((
|
|
35
|
+
function b() {
|
|
36
|
+
t.value.forEach((a) => a.hidden = !0), i();
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function h() {
|
|
39
39
|
i();
|
|
40
40
|
}
|
|
41
|
-
return (
|
|
42
|
-
n("div",
|
|
41
|
+
return (a, e) => c.visible ? (r(), d("div", T, [
|
|
42
|
+
n("div", U, [
|
|
43
43
|
e[2] || (e[2] = n("span", { class: "of-col-manager__title" }, "管理列", -1)),
|
|
44
44
|
n("button", {
|
|
45
45
|
class: "of-col-manager__close",
|
|
46
|
-
onClick: e[0] || (e[0] = (
|
|
46
|
+
onClick: e[0] || (e[0] = (o) => m("close"))
|
|
47
47
|
}, [
|
|
48
48
|
l(s(N), { size: 14 })
|
|
49
49
|
])
|
|
@@ -58,36 +58,37 @@ const U = {
|
|
|
58
58
|
]),
|
|
59
59
|
n("button", {
|
|
60
60
|
class: "of-col-manager__action-btn",
|
|
61
|
-
onClick:
|
|
61
|
+
onClick: b
|
|
62
62
|
}, [
|
|
63
63
|
l(s(D), { size: 12 }),
|
|
64
64
|
e[4] || (e[4] = u(" 隐藏全部 ", -1))
|
|
65
65
|
])
|
|
66
66
|
]),
|
|
67
|
-
l(s(
|
|
67
|
+
l(s(A), {
|
|
68
68
|
modelValue: t.value,
|
|
69
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
69
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => t.value = o),
|
|
70
70
|
handle: ".of-col-manager__drag",
|
|
71
71
|
animation: 150,
|
|
72
|
-
onEnd:
|
|
72
|
+
onEnd: h
|
|
73
73
|
}, {
|
|
74
74
|
default: V(() => [
|
|
75
|
-
(r(!0), d(y, null, E(t.value, (
|
|
76
|
-
key:
|
|
75
|
+
(r(!0), d(y, null, E(t.value, (o) => (r(), d("div", {
|
|
76
|
+
key: o.key,
|
|
77
77
|
class: "of-col-manager__row"
|
|
78
78
|
}, [
|
|
79
79
|
n("span", G, [
|
|
80
|
-
l(s(
|
|
80
|
+
l(s($), { size: 14 })
|
|
81
81
|
]),
|
|
82
82
|
n("input", {
|
|
83
83
|
type: "checkbox",
|
|
84
84
|
class: "of-col-manager__checkbox",
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
"aria-label": `显示列 ${o.label}`,
|
|
86
|
+
checked: !o.hidden,
|
|
87
|
+
onChange: (M) => g(o)
|
|
87
88
|
}, null, 40, L),
|
|
88
89
|
n("span", {
|
|
89
|
-
class: x(["of-col-manager__label", { dimmed:
|
|
90
|
-
}, z(
|
|
90
|
+
class: x(["of-col-manager__label", { dimmed: o.hidden }])
|
|
91
|
+
}, z(o.label), 3)
|
|
91
92
|
]))), 128))
|
|
92
93
|
]),
|
|
93
94
|
_: 1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableColumn, ColorMap } from '../../types';
|
|
1
|
+
import { TableColumn, ColorMap, Density } from '../../types';
|
|
2
2
|
type TableRow = Record<string, unknown> & {
|
|
3
3
|
id: string;
|
|
4
4
|
};
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
selected?: boolean;
|
|
9
9
|
selectable?: boolean;
|
|
10
10
|
columns: TableColumn[];
|
|
11
|
+
density?: Density;
|
|
11
12
|
/**
|
|
12
13
|
* 优先级颜色映射,与内置默认映射合并(传入优先)
|
|
13
14
|
*/
|
|
@@ -36,9 +37,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
36
37
|
onSelect?: ((id: string) => any) | undefined;
|
|
37
38
|
onClick?: ((row: TableRow) => any) | undefined;
|
|
38
39
|
}>, {
|
|
40
|
+
density: Density;
|
|
39
41
|
selectable: boolean;
|
|
40
42
|
rowKey: string;
|
|
41
43
|
selected: boolean;
|
|
44
|
+
priorityColorMap: ColorMap;
|
|
45
|
+
statusColorMap: ColorMap;
|
|
42
46
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
43
47
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
44
48
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableDataRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-4ecab060"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mergeColorMap as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as B, computed as d, openBlock as o, createElementBlock as n, normalizeStyle as c, normalizeClass as Y, withModifiers as E, createElementVNode as g, createCommentVNode as R, Fragment as b, renderList as W, renderSlot as _, toDisplayString as r } from "vue";
|
|
2
|
+
import { mergeColorMap as v, DEFAULT_PRIORITY_MAP as H, DEFAULT_STATUS_MAP as N, resolveBadge as x } from "../../composables/useBadge.js";
|
|
3
|
+
const I = ["aria-selected"], K = ["for"], L = ["id", "checked"], U = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-badge of-badge--role"
|
|
6
|
-
},
|
|
6
|
+
}, V = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "of-td-empty"
|
|
9
|
-
},
|
|
9
|
+
}, X = {
|
|
10
10
|
key: 3,
|
|
11
11
|
class: "of-td-text"
|
|
12
|
-
},
|
|
12
|
+
}, F = {
|
|
13
13
|
key: 4,
|
|
14
14
|
class: "of-td-id"
|
|
15
|
-
},
|
|
15
|
+
}, z = {
|
|
16
16
|
key: 5,
|
|
17
17
|
class: "of-td-title"
|
|
18
|
-
},
|
|
18
|
+
}, O = {
|
|
19
19
|
key: 6,
|
|
20
20
|
class: "of-td-text"
|
|
21
|
-
},
|
|
21
|
+
}, q = /* @__PURE__ */ B({
|
|
22
22
|
__name: "TableDataRow",
|
|
23
23
|
props: {
|
|
24
24
|
row: {},
|
|
@@ -26,94 +26,133 @@ const E = ["aria-selected"], N = ["checked"], V = {
|
|
|
26
26
|
selected: { type: Boolean, default: !1 },
|
|
27
27
|
selectable: { type: Boolean, default: !0 },
|
|
28
28
|
columns: {},
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
density: { default: "standard" },
|
|
30
|
+
priorityColorMap: { default: void 0 },
|
|
31
|
+
statusColorMap: { default: void 0 }
|
|
31
32
|
},
|
|
32
33
|
emits: ["select", "click"],
|
|
33
|
-
setup(
|
|
34
|
-
const i =
|
|
35
|
-
|
|
34
|
+
setup(i, { emit: M }) {
|
|
35
|
+
const s = i, y = M, C = {
|
|
36
|
+
compact: {
|
|
37
|
+
rowHeight: 36,
|
|
38
|
+
cellPaddingX: 10,
|
|
39
|
+
cellPaddingY: 6,
|
|
40
|
+
fillMinWidth: 180
|
|
41
|
+
},
|
|
42
|
+
standard: {
|
|
43
|
+
rowHeight: 44,
|
|
44
|
+
cellPaddingX: 12,
|
|
45
|
+
cellPaddingY: 8,
|
|
46
|
+
fillMinWidth: 220
|
|
47
|
+
},
|
|
48
|
+
comfortable: {
|
|
49
|
+
rowHeight: 52,
|
|
50
|
+
cellPaddingX: 14,
|
|
51
|
+
cellPaddingY: 10,
|
|
52
|
+
fillMinWidth: 240
|
|
53
|
+
}
|
|
54
|
+
}, u = d(() => C[s.density]), P = d(() => ({
|
|
55
|
+
minHeight: `${u.value.rowHeight}px`
|
|
56
|
+
})), k = d(() => ({
|
|
57
|
+
padding: `${u.value.cellPaddingY}px ${u.value.cellPaddingX}px`
|
|
58
|
+
}));
|
|
59
|
+
function S(e) {
|
|
60
|
+
const l = k.value;
|
|
36
61
|
if (e.width === "fill") {
|
|
37
|
-
const
|
|
38
|
-
return { flex: `1 1 ${
|
|
62
|
+
const t = `${e.minWidth ?? u.value.fillMinWidth}px`;
|
|
63
|
+
return { ...l, flex: `1 1 ${t}`, minWidth: t };
|
|
39
64
|
}
|
|
40
|
-
return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
65
|
+
return { ...l, width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
41
66
|
}
|
|
42
|
-
const
|
|
43
|
-
() =>
|
|
44
|
-
),
|
|
45
|
-
function
|
|
46
|
-
return
|
|
67
|
+
const $ = d(
|
|
68
|
+
() => v(H, s.priorityColorMap)
|
|
69
|
+
), D = d(() => v(N, s.statusColorMap));
|
|
70
|
+
function p(e) {
|
|
71
|
+
return x(e, $.value);
|
|
47
72
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
73
|
+
function m(e) {
|
|
74
|
+
return x(e, D.value);
|
|
50
75
|
}
|
|
51
|
-
function
|
|
76
|
+
function T(e) {
|
|
52
77
|
if (!e) return "-";
|
|
53
|
-
const
|
|
54
|
-
return isNaN(
|
|
78
|
+
const l = new Date(e);
|
|
79
|
+
return isNaN(l.getTime()) ? e : `${l.getMonth() + 1}/${l.getDate()}`;
|
|
55
80
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
81
|
+
function w(e) {
|
|
82
|
+
return s.row[e.key];
|
|
58
83
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
return
|
|
84
|
+
function h(e) {
|
|
85
|
+
const l = w(e);
|
|
86
|
+
return l != null ? String(l) : "-";
|
|
62
87
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return typeof
|
|
88
|
+
function a(e) {
|
|
89
|
+
const l = w(e);
|
|
90
|
+
return typeof l == "string" ? l : "";
|
|
66
91
|
}
|
|
67
|
-
function
|
|
68
|
-
const e =
|
|
92
|
+
function f() {
|
|
93
|
+
const e = s.row[s.rowKey];
|
|
69
94
|
return e != null ? String(e) : "";
|
|
70
95
|
}
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
function A(e) {
|
|
97
|
+
e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), y("click", s.row)));
|
|
98
|
+
}
|
|
99
|
+
return (e, l) => (o(), n("div", {
|
|
100
|
+
class: Y(["of-table-row", { "of-table-row--selected": i.selected }]),
|
|
73
101
|
role: "row",
|
|
74
|
-
|
|
75
|
-
|
|
102
|
+
tabindex: "0",
|
|
103
|
+
"aria-selected": i.selected || void 0,
|
|
104
|
+
style: c(P.value),
|
|
105
|
+
onClick: l[2] || (l[2] = (t) => y("click", i.row)),
|
|
106
|
+
onKeydown: A
|
|
76
107
|
}, [
|
|
77
|
-
|
|
108
|
+
i.selectable ? (o(), n("div", {
|
|
78
109
|
key: 0,
|
|
79
110
|
class: "of-td of-td-checkbox",
|
|
80
111
|
role: "gridcell",
|
|
81
|
-
|
|
112
|
+
style: c(k.value),
|
|
113
|
+
onClick: l[1] || (l[1] = E(() => {
|
|
82
114
|
}, ["stop"]))
|
|
83
115
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
116
|
+
g("label", {
|
|
117
|
+
class: "of-checkbox-label",
|
|
118
|
+
for: `of-table-row-checkbox-${f()}`
|
|
119
|
+
}, [
|
|
120
|
+
g("input", {
|
|
121
|
+
id: `of-table-row-checkbox-${f()}`,
|
|
122
|
+
type: "checkbox",
|
|
123
|
+
class: "of-checkbox",
|
|
124
|
+
checked: i.selected,
|
|
125
|
+
onChange: l[0] || (l[0] = (t) => y("select", f()))
|
|
126
|
+
}, null, 40, L),
|
|
127
|
+
l[3] || (l[3] = g("span", { class: "of-sr-only" }, "选择当前行", -1))
|
|
128
|
+
], 8, K)
|
|
129
|
+
], 4)) : R("", !0),
|
|
130
|
+
(o(!0), n(b, null, W(i.columns, (t) => (o(), n("div", {
|
|
92
131
|
key: t.key,
|
|
93
132
|
class: "of-td",
|
|
94
133
|
role: "gridcell",
|
|
95
|
-
style:
|
|
134
|
+
style: c(S(t))
|
|
96
135
|
}, [
|
|
97
|
-
|
|
98
|
-
row:
|
|
136
|
+
_(e.$slots, "cell", {
|
|
137
|
+
row: i.row,
|
|
99
138
|
col: t
|
|
100
139
|
}, () => [
|
|
101
|
-
t.key === "status" ? (
|
|
140
|
+
t.key === "status" ? (o(), n("span", {
|
|
102
141
|
key: 0,
|
|
103
142
|
class: "of-badge",
|
|
104
|
-
style:
|
|
105
|
-
},
|
|
143
|
+
style: c(m(a(t)).style)
|
|
144
|
+
}, r(m(a(t)).label), 5)) : t.key === "priority" ? (o(), n("span", {
|
|
106
145
|
key: 1,
|
|
107
146
|
class: "of-badge",
|
|
108
|
-
style:
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
], 64)) : t.key === "updatedAt" ? (
|
|
147
|
+
style: c(p(a(t)).style)
|
|
148
|
+
}, r(p(a(t)).label), 5)) : t.key === "role" ? (o(), n(b, { key: 2 }, [
|
|
149
|
+
a(t) ? (o(), n("span", U, r(a(t)), 1)) : (o(), n("span", V, "-"))
|
|
150
|
+
], 64)) : t.key === "updatedAt" ? (o(), n("span", X, r(T(a(t))), 1)) : t.key === "id" ? (o(), n("span", F, r(f()), 1)) : t.key === "title" ? (o(), n("span", z, r(h(t)), 1)) : (o(), n("span", O, r(h(t)), 1))
|
|
112
151
|
], !0)
|
|
113
152
|
], 4))), 128))
|
|
114
|
-
],
|
|
153
|
+
], 46, I));
|
|
115
154
|
}
|
|
116
155
|
});
|
|
117
156
|
export {
|
|
118
|
-
|
|
157
|
+
q as default
|
|
119
158
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableFilterPanel.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3e9c57c5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -85,6 +85,7 @@ const x = {
|
|
|
85
85
|
])),
|
|
86
86
|
i("select", {
|
|
87
87
|
class: "of-filter-condition__select of-filter-condition__select--field",
|
|
88
|
+
"aria-label": "筛选字段",
|
|
88
89
|
value: l.field,
|
|
89
90
|
onChange: (t) => a("update-condition", l.id, { field: t.target.value })
|
|
90
91
|
}, [
|
|
@@ -95,6 +96,7 @@ const x = {
|
|
|
95
96
|
], 40, w),
|
|
96
97
|
i("select", {
|
|
97
98
|
class: "of-filter-condition__select",
|
|
99
|
+
"aria-label": "筛选条件",
|
|
98
100
|
value: l.operator,
|
|
99
101
|
onChange: (t) => a("update-condition", l.id, {
|
|
100
102
|
operator: t.target.value
|
|
@@ -108,6 +110,7 @@ const x = {
|
|
|
108
110
|
h(l.operator) ? (o(), n("span", L)) : (o(), n("input", {
|
|
109
111
|
key: 2,
|
|
110
112
|
class: "of-filter-condition__input",
|
|
113
|
+
"aria-label": "筛选值",
|
|
111
114
|
value: l.value,
|
|
112
115
|
placeholder: "输入值...",
|
|
113
116
|
onInput: (t) => a("update-condition", l.id, { value: t.target.value })
|
|
@@ -17,6 +17,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
17
17
|
}>, {
|
|
18
18
|
collapsed: boolean;
|
|
19
19
|
selectable: boolean;
|
|
20
|
+
colorMap: ColorMap;
|
|
20
21
|
level: number;
|
|
22
|
+
aggregations: Record<string, number>;
|
|
21
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
22
24
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableGroupRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-42db94c3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|