@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,43 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBreakpoint as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as S, ref as m, computed as E, onMounted as V, nextTick as z, onBeforeUnmount as A, watch as I, openBlock as o, createElementBlock as u, normalizeStyle as h, toDisplayString as b, createBlock as T, Teleport as O, unref as K, normalizeClass as D, createElementVNode as P, withKeys as g, withModifiers as v, Fragment as U, renderList as W, createCommentVNode as j } from "vue";
|
|
2
|
+
import { useBreakpoint as q } from "../../composables/useBreakpoint.js";
|
|
3
|
+
const G = ["aria-label"], H = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "of-field-select__display"
|
|
6
|
-
},
|
|
6
|
+
}, J = ["aria-selected"], Q = ["aria-selected", "onMouseenter", "onClick", "onFocusin", "onKeydown"], X = { key: 1 }, ee = /* @__PURE__ */ S({
|
|
7
7
|
__name: "FieldSelect",
|
|
8
8
|
props: {
|
|
9
9
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
10
10
|
field: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["commit", "cancel", "tabNext"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
const e = typeof
|
|
16
|
-
return
|
|
17
|
-
}), n =
|
|
18
|
-
function
|
|
19
|
-
if (!
|
|
20
|
-
const e =
|
|
21
|
-
|
|
13
|
+
setup(C, { emit: N }) {
|
|
14
|
+
const c = C, x = N, { isMobile: M } = q(), d = m(null), B = m(null), L = m({ top: "0px", left: "0px", width: "0px" }), y = m(!0), i = E(() => c.field.options ?? []), s = E(() => {
|
|
15
|
+
const e = typeof c.value == "string" ? c.value : null;
|
|
16
|
+
return i.value.findIndex((t) => t.value === e);
|
|
17
|
+
}), n = m(0);
|
|
18
|
+
function f() {
|
|
19
|
+
if (!d.value) return;
|
|
20
|
+
const e = d.value.getBoundingClientRect();
|
|
21
|
+
L.value = {
|
|
22
22
|
top: `${e.bottom}px`,
|
|
23
23
|
left: `${e.left}px`,
|
|
24
24
|
width: `${Math.max(e.width, 160)}px`
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function a(e) {
|
|
28
|
+
y.value = !1, x("commit", e);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
30
|
+
function $() {
|
|
31
|
+
y.value && (y.value = !1, x("cancel"));
|
|
32
32
|
}
|
|
33
33
|
function R(e) {
|
|
34
|
-
var t,
|
|
35
|
-
if (!
|
|
36
|
-
e.key === "Escape" && (e.preventDefault(),
|
|
34
|
+
var t, r;
|
|
35
|
+
if (!i.value.length) {
|
|
36
|
+
e.key === "Escape" && (e.preventDefault(), $());
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
if (e.key === "ArrowDown") {
|
|
40
|
-
e.preventDefault(), n.value = Math.min(n.value + 1,
|
|
40
|
+
e.preventDefault(), n.value = Math.min(n.value + 1, i.value.length - 1);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
if (e.key === "ArrowUp") {
|
|
@@ -45,78 +45,96 @@ const q = {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
if (e.key === "Enter") {
|
|
48
|
-
e.preventDefault(),
|
|
48
|
+
e.preventDefault(), a(((t = i.value[n.value]) == null ? void 0 : t.value) ?? null);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
if (e.key === "Escape") {
|
|
52
|
-
e.preventDefault(),
|
|
52
|
+
e.preventDefault(), $();
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
e.key === "Tab" && (e.preventDefault(),
|
|
55
|
+
e.key === "Tab" && (e.preventDefault(), a(((r = i.value[n.value]) == null ? void 0 : r.value) ?? null), x("tabNext"));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
var
|
|
57
|
+
function F(e) {
|
|
58
|
+
var r, p;
|
|
59
59
|
const t = e.target;
|
|
60
|
-
t && ((
|
|
60
|
+
t && ((r = d.value) != null && r.contains(t) || (p = B.value) != null && p.contains(t) || $());
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
n.value =
|
|
62
|
+
V(() => {
|
|
63
|
+
n.value = s.value >= 0 ? s.value : 0, z(() => {
|
|
64
64
|
var e;
|
|
65
|
-
|
|
66
|
-
}), window.addEventListener("resize",
|
|
67
|
-
}),
|
|
68
|
-
window.removeEventListener("resize",
|
|
69
|
-
}),
|
|
65
|
+
f(), (e = d.value) == null || e.focus();
|
|
66
|
+
}), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0), window.addEventListener("mousedown", F, !0);
|
|
67
|
+
}), A(() => {
|
|
68
|
+
window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0), window.removeEventListener("mousedown", F, !0);
|
|
69
|
+
}), I(s, (e) => {
|
|
70
70
|
e >= 0 && (n.value = e);
|
|
71
71
|
});
|
|
72
|
-
const
|
|
73
|
-
const e = typeof
|
|
74
|
-
return
|
|
72
|
+
const k = E(() => {
|
|
73
|
+
const e = typeof c.value == "string" ? c.value : null;
|
|
74
|
+
return i.value.find((t) => t.value === e);
|
|
75
75
|
});
|
|
76
76
|
return (e, t) => {
|
|
77
|
-
var
|
|
78
|
-
return
|
|
77
|
+
var r, p;
|
|
78
|
+
return o(), u("div", {
|
|
79
79
|
ref_key: "triggerRef",
|
|
80
|
-
ref:
|
|
80
|
+
ref: d,
|
|
81
81
|
class: "of-field-select",
|
|
82
82
|
tabindex: "0",
|
|
83
|
+
role: "listbox",
|
|
84
|
+
"aria-label": C.field.label,
|
|
83
85
|
onKeydown: R
|
|
84
86
|
}, [
|
|
85
|
-
(
|
|
87
|
+
(r = k.value) != null && r.color ? (o(), u("span", {
|
|
86
88
|
key: 0,
|
|
87
89
|
class: "of-field-select__badge",
|
|
88
|
-
style:
|
|
89
|
-
},
|
|
90
|
-
(
|
|
91
|
-
|
|
90
|
+
style: h({ background: k.value.color })
|
|
91
|
+
}, b(k.value.label), 5)) : (o(), u("span", H, b(((p = k.value) == null ? void 0 : p.label) ?? "—"), 1)),
|
|
92
|
+
(o(), T(O, { to: "body" }, [
|
|
93
|
+
y.value ? (o(), u("div", {
|
|
92
94
|
key: 0,
|
|
93
95
|
ref_key: "dropdownRef",
|
|
94
|
-
ref:
|
|
95
|
-
class:
|
|
96
|
-
style:
|
|
96
|
+
ref: B,
|
|
97
|
+
class: D(["of-field-select__dropdown", { "of-field-select__dropdown--sheet": K(M) }]),
|
|
98
|
+
style: h(K(M) ? {} : L.value)
|
|
97
99
|
}, [
|
|
98
100
|
P("div", {
|
|
99
|
-
class:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
class: D(["of-field-select__option of-field-select__option--clear", { active: n.value === -1, selected: s.value === -1 }]),
|
|
102
|
+
role: "option",
|
|
103
|
+
tabindex: "0",
|
|
104
|
+
"aria-selected": s.value === -1,
|
|
105
|
+
onClick: t[0] || (t[0] = v((l) => a(null), ["stop"])),
|
|
106
|
+
onFocusin: t[1] || (t[1] = (l) => n.value = -1),
|
|
107
|
+
onKeydown: [
|
|
108
|
+
t[2] || (t[2] = g(v((l) => a(null), ["prevent"]), ["enter"])),
|
|
109
|
+
t[3] || (t[3] = g(v((l) => a(null), ["prevent"]), ["space"]))
|
|
110
|
+
]
|
|
111
|
+
}, " — ", 42, J),
|
|
112
|
+
(o(!0), u(U, null, W(i.value, (l, w) => (o(), u("div", {
|
|
113
|
+
key: l.value,
|
|
114
|
+
class: D(["of-field-select__option", { active: w === n.value, selected: w === s.value }]),
|
|
115
|
+
role: "option",
|
|
116
|
+
tabindex: "0",
|
|
117
|
+
"aria-selected": w === s.value,
|
|
118
|
+
onMouseenter: (_) => n.value = w,
|
|
119
|
+
onClick: v((_) => a(l.value), ["stop"]),
|
|
120
|
+
onFocusin: (_) => n.value = w,
|
|
121
|
+
onKeydown: [
|
|
122
|
+
g(v((_) => a(l.value), ["prevent"]), ["enter"]),
|
|
123
|
+
g(v((_) => a(l.value), ["prevent"]), ["space"])
|
|
124
|
+
]
|
|
107
125
|
}, [
|
|
108
|
-
|
|
126
|
+
l.color ? (o(), u("span", {
|
|
109
127
|
key: 0,
|
|
110
128
|
class: "of-field-select__badge",
|
|
111
|
-
style:
|
|
112
|
-
},
|
|
113
|
-
], 42,
|
|
114
|
-
], 6)) :
|
|
129
|
+
style: h({ background: l.color })
|
|
130
|
+
}, b(l.label), 5)) : (o(), u("span", X, b(l.label), 1))
|
|
131
|
+
], 42, Q))), 128))
|
|
132
|
+
], 6)) : j("", !0)
|
|
115
133
|
]))
|
|
116
|
-
],
|
|
134
|
+
], 40, G);
|
|
117
135
|
};
|
|
118
136
|
}
|
|
119
137
|
});
|
|
120
138
|
export {
|
|
121
|
-
|
|
139
|
+
ee as default
|
|
122
140
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FieldText.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a9d8988d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const b = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as m, ref as u, onMounted as p, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as x, vModelText as y } from "vue";
|
|
2
|
+
const b = ["aria-label"], B = /* @__PURE__ */ m({
|
|
3
3
|
__name: "FieldText",
|
|
4
4
|
props: {
|
|
5
5
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
6
6
|
field: {}
|
|
7
7
|
},
|
|
8
8
|
emits: ["commit", "cancel", "tabNext"],
|
|
9
|
-
setup(
|
|
10
|
-
const f =
|
|
11
|
-
|
|
9
|
+
setup(o, { emit: r }) {
|
|
10
|
+
const f = o, t = r, a = u(null), l = u(String(f.value ?? ""));
|
|
11
|
+
p(() => s(() => {
|
|
12
12
|
var e;
|
|
13
|
-
return (e =
|
|
13
|
+
return (e = a.value) == null ? void 0 : e.focus();
|
|
14
14
|
}));
|
|
15
|
-
function
|
|
16
|
-
e.key === "Enter" && (e.preventDefault(), t("commit",
|
|
15
|
+
function c(e) {
|
|
16
|
+
e.key === "Enter" && (e.preventDefault(), t("commit", l.value)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", l.value), t("tabNext"));
|
|
17
17
|
}
|
|
18
|
-
return (e,
|
|
18
|
+
return (e, n) => v((d(), x("input", {
|
|
19
19
|
ref_key: "inputRef",
|
|
20
|
-
ref:
|
|
20
|
+
ref: a,
|
|
21
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => l.value = i),
|
|
21
22
|
class: "of-field-input",
|
|
22
23
|
type: "text",
|
|
23
|
-
"
|
|
24
|
-
onKeydown:
|
|
25
|
-
onBlur:
|
|
26
|
-
}, null,
|
|
27
|
-
[y,
|
|
24
|
+
"aria-label": o.field.label,
|
|
25
|
+
onKeydown: c,
|
|
26
|
+
onBlur: n[1] || (n[1] = (i) => t("commit", l.value))
|
|
27
|
+
}, null, 40, b)), [
|
|
28
|
+
[y, l.value]
|
|
28
29
|
]);
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
B as default
|
|
33
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FieldUrl.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-e2908cdc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as m, ref as u, onMounted as p, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as b } from "vue";
|
|
2
|
+
const k = ["aria-label"], B = /* @__PURE__ */ m({
|
|
3
3
|
__name: "FieldUrl",
|
|
4
4
|
props: {
|
|
5
5
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
6
6
|
field: {}
|
|
7
7
|
},
|
|
8
8
|
emits: ["commit", "cancel", "tabNext"],
|
|
9
|
-
setup(
|
|
10
|
-
const f =
|
|
11
|
-
|
|
9
|
+
setup(o, { emit: r }) {
|
|
10
|
+
const f = o, t = r, a = u(null), l = u(String(f.value ?? ""));
|
|
11
|
+
p(() => s(() => {
|
|
12
12
|
var e;
|
|
13
|
-
return (e =
|
|
13
|
+
return (e = a.value) == null ? void 0 : e.focus();
|
|
14
14
|
}));
|
|
15
|
-
function
|
|
16
|
-
e.key === "Enter" && (e.preventDefault(), t("commit",
|
|
15
|
+
function c(e) {
|
|
16
|
+
e.key === "Enter" && (e.preventDefault(), t("commit", l.value)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", l.value), t("tabNext"));
|
|
17
17
|
}
|
|
18
|
-
return (e,
|
|
18
|
+
return (e, n) => v((d(), y("input", {
|
|
19
19
|
ref_key: "inputRef",
|
|
20
|
-
ref:
|
|
20
|
+
ref: a,
|
|
21
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => l.value = i),
|
|
21
22
|
class: "of-field-input",
|
|
22
23
|
type: "url",
|
|
23
|
-
"
|
|
24
|
-
onKeydown:
|
|
25
|
-
onBlur:
|
|
26
|
-
}, null,
|
|
27
|
-
[
|
|
24
|
+
"aria-label": o.field.label,
|
|
25
|
+
onKeydown: c,
|
|
26
|
+
onBlur: n[1] || (n[1] = (i) => t("commit", l.value))
|
|
27
|
+
}, null, 40, k)), [
|
|
28
|
+
[b, l.value]
|
|
28
29
|
]);
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
B as default
|
|
33
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormDesigner.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-27f61d04"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as u, createElementVNode as
|
|
1
|
+
import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as u, createElementVNode as t, toDisplayString as c, createVNode as m, unref as f, createTextVNode as _, createCommentVNode as b, withCtx as $, Fragment as C, renderList as x, normalizeClass as j } from "vue";
|
|
2
2
|
import { Plus as G, GripVertical as U, Trash2 as Y } from "lucide-vue-next";
|
|
3
3
|
import { VueDraggable as A } from "vue-draggable-plus";
|
|
4
4
|
import { isSelectField as h } from "../../types/index.js";
|
|
5
|
-
const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header" }, K = { class: "of-form-designer__title" }, M = { class: "of-form-designer__meta" }, Q = { class: "of-form-designer__inputs" }, R = ["value", "disabled", "onInput"], W = ["value", "disabled", "onChange"], X = ["value"], Z = { class: "of-form-designer__checkbox-label" }, ee = ["checked", "disabled", "onChange"],
|
|
5
|
+
const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header" }, K = { class: "of-form-designer__title" }, M = { class: "of-form-designer__meta" }, Q = { class: "of-form-designer__inputs" }, R = ["value", "disabled", "onInput"], W = ["value", "disabled", "onChange"], X = ["value"], Z = { class: "of-form-designer__checkbox-label" }, ee = ["checked", "disabled", "onChange"], ae = { class: "of-form-designer__checkbox-label" }, ne = ["checked", "disabled", "onChange"], le = ["onClick"], te = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "of-form-designer__options-wrap"
|
|
8
8
|
}, oe = ["value", "disabled", "onChange"], de = /* @__PURE__ */ z({
|
|
@@ -14,7 +14,7 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:schema", "change"],
|
|
16
16
|
setup(r, { emit: F }) {
|
|
17
|
-
const S = [
|
|
17
|
+
const d = r, p = F, S = [
|
|
18
18
|
{ value: "text", label: "文本" },
|
|
19
19
|
{ value: "number", label: "数字" },
|
|
20
20
|
{ value: "select", label: "单选" },
|
|
@@ -30,7 +30,7 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
30
30
|
{ value: "attachment", label: "附件" },
|
|
31
31
|
{ value: "relation", label: "关联" },
|
|
32
32
|
{ value: "formula", label: "公式" }
|
|
33
|
-
],
|
|
33
|
+
], o = T(v(d.schema));
|
|
34
34
|
L(
|
|
35
35
|
() => d.schema,
|
|
36
36
|
(e) => {
|
|
@@ -43,13 +43,13 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
43
43
|
return {
|
|
44
44
|
...e,
|
|
45
45
|
fields: e.fields.map(y),
|
|
46
|
-
views: e.views.map((
|
|
46
|
+
views: e.views.map((a) => ({ ...a }))
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function y(e) {
|
|
50
50
|
return h(e) ? {
|
|
51
51
|
...e,
|
|
52
|
-
options: e.options.map((
|
|
52
|
+
options: e.options.map((a) => ({ ...a }))
|
|
53
53
|
} : { ...e };
|
|
54
54
|
}
|
|
55
55
|
function s() {
|
|
@@ -64,48 +64,48 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
64
64
|
hidden: !1
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function k(e,
|
|
67
|
+
function k(e, a) {
|
|
68
68
|
switch (e) {
|
|
69
69
|
case "text":
|
|
70
|
-
return { ...
|
|
70
|
+
return { ...a, type: e };
|
|
71
71
|
case "number":
|
|
72
|
-
return { ...
|
|
72
|
+
return { ...a, type: e };
|
|
73
73
|
case "select":
|
|
74
74
|
case "multi_select":
|
|
75
75
|
return {
|
|
76
|
-
...
|
|
76
|
+
...a,
|
|
77
77
|
type: e,
|
|
78
78
|
options: D()
|
|
79
79
|
};
|
|
80
80
|
case "date":
|
|
81
81
|
case "datetime":
|
|
82
|
-
return { ...
|
|
82
|
+
return { ...a, type: e };
|
|
83
83
|
case "checkbox":
|
|
84
|
-
return { ...
|
|
84
|
+
return { ...a, type: e };
|
|
85
85
|
case "url":
|
|
86
86
|
case "email":
|
|
87
87
|
case "phone":
|
|
88
|
-
return { ...
|
|
88
|
+
return { ...a, type: e };
|
|
89
89
|
case "rating":
|
|
90
|
-
return { ...
|
|
90
|
+
return { ...a, type: e };
|
|
91
91
|
case "user":
|
|
92
|
-
return { ...
|
|
92
|
+
return { ...a, type: e };
|
|
93
93
|
case "attachment":
|
|
94
|
-
return { ...
|
|
94
|
+
return { ...a, type: e };
|
|
95
95
|
case "relation":
|
|
96
|
-
return { ...
|
|
96
|
+
return { ...a, type: e };
|
|
97
97
|
case "formula":
|
|
98
|
-
return { ...
|
|
98
|
+
return { ...a, type: e, formula: "" };
|
|
99
99
|
case "currency":
|
|
100
|
-
return { ...
|
|
100
|
+
return { ...a, type: e };
|
|
101
101
|
case "richtext":
|
|
102
|
-
return { ...
|
|
102
|
+
return { ...a, type: e };
|
|
103
103
|
case "auto_number":
|
|
104
|
-
return { ...
|
|
104
|
+
return { ...a, type: e };
|
|
105
105
|
case "creator":
|
|
106
|
-
return { ...
|
|
106
|
+
return { ...a, type: e };
|
|
107
107
|
case "progress":
|
|
108
|
-
return { ...
|
|
108
|
+
return { ...a, type: e };
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function D() {
|
|
@@ -118,42 +118,42 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
118
118
|
d.readonly || (o.value.fields.push(V()), s());
|
|
119
119
|
}
|
|
120
120
|
function E(e) {
|
|
121
|
-
d.readonly || (o.value.fields = o.value.fields.filter((
|
|
121
|
+
d.readonly || (o.value.fields = o.value.fields.filter((a) => a.id !== e), s());
|
|
122
122
|
}
|
|
123
|
-
function q(e,
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
123
|
+
function q(e, a) {
|
|
124
|
+
const l = o.value.fields.findIndex((g) => g.id === e.id);
|
|
125
|
+
if (l === -1) return;
|
|
126
|
+
const n = {
|
|
127
127
|
id: e.id,
|
|
128
128
|
name: e.name,
|
|
129
129
|
required: e.required,
|
|
130
130
|
hidden: e.hidden,
|
|
131
131
|
width: e.width
|
|
132
132
|
};
|
|
133
|
-
o.value.fields[
|
|
134
|
-
...
|
|
135
|
-
type:
|
|
133
|
+
o.value.fields[l] = h(e) && (a === "select" || a === "multi_select") ? {
|
|
134
|
+
...n,
|
|
135
|
+
type: a,
|
|
136
136
|
options: e.options.map(
|
|
137
137
|
(g) => ({ ...g })
|
|
138
138
|
)
|
|
139
|
-
} : k(
|
|
139
|
+
} : k(a, n), s();
|
|
140
140
|
}
|
|
141
|
-
function I(e,
|
|
141
|
+
function I(e, a) {
|
|
142
142
|
if (!h(e)) return;
|
|
143
|
-
const
|
|
144
|
-
e.options =
|
|
143
|
+
const l = a.split(",").map((n) => n.trim()).filter(Boolean);
|
|
144
|
+
e.options = l.map((n) => ({ value: n, label: n })), s();
|
|
145
145
|
}
|
|
146
146
|
function N(e) {
|
|
147
|
-
return h(e) ? e.options.map((
|
|
147
|
+
return h(e) ? e.options.map((a) => a.label).join(", ") : "";
|
|
148
148
|
}
|
|
149
149
|
function O() {
|
|
150
150
|
s();
|
|
151
151
|
}
|
|
152
|
-
return (e,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
return (e, a) => (i(), u("div", H, [
|
|
153
|
+
t("div", J, [
|
|
154
|
+
t("div", null, [
|
|
155
|
+
t("h3", K, c(r.title), 1),
|
|
156
|
+
t("p", M, c(o.value.name) + " · " + c(w.value), 1)
|
|
157
157
|
]),
|
|
158
158
|
r.readonly ? b("", !0) : (i(), u("button", {
|
|
159
159
|
key: 0,
|
|
@@ -161,86 +161,91 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
161
161
|
onClick: B
|
|
162
162
|
}, [
|
|
163
163
|
m(f(G), { size: 14 }),
|
|
164
|
-
|
|
164
|
+
a[1] || (a[1] = _(" 添加字段 ", -1))
|
|
165
165
|
]))
|
|
166
166
|
]),
|
|
167
167
|
m(f(A), {
|
|
168
168
|
modelValue: o.value.fields,
|
|
169
|
-
"onUpdate:modelValue":
|
|
169
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => o.value.fields = l),
|
|
170
170
|
handle: ".of-form-designer__drag",
|
|
171
171
|
disabled: r.readonly,
|
|
172
172
|
animation: 150,
|
|
173
173
|
onEnd: O
|
|
174
174
|
}, {
|
|
175
175
|
default: $(() => [
|
|
176
|
-
(i(!0), u(C, null, x(o.value.fields, (
|
|
177
|
-
key:
|
|
176
|
+
(i(!0), u(C, null, x(o.value.fields, (l) => (i(), u("div", {
|
|
177
|
+
key: l.id,
|
|
178
178
|
class: "of-form-designer__row"
|
|
179
179
|
}, [
|
|
180
|
-
|
|
180
|
+
t("span", {
|
|
181
181
|
class: j(["of-form-designer__drag", { disabled: r.readonly }])
|
|
182
182
|
}, [
|
|
183
183
|
m(f(U), { size: 14 })
|
|
184
184
|
], 2),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
value:
|
|
185
|
+
t("div", Q, [
|
|
186
|
+
t("input", {
|
|
187
|
+
value: l.name,
|
|
188
188
|
class: "of-form-designer__input",
|
|
189
|
+
"aria-label": "字段名称",
|
|
189
190
|
placeholder: "字段名称",
|
|
190
191
|
disabled: r.readonly,
|
|
191
|
-
onInput: (
|
|
192
|
-
|
|
192
|
+
onInput: (n) => {
|
|
193
|
+
l.name = String(n.target.value), s();
|
|
193
194
|
}
|
|
194
195
|
}, null, 40, R),
|
|
195
|
-
|
|
196
|
+
t("select", {
|
|
196
197
|
class: "of-form-designer__select",
|
|
197
|
-
|
|
198
|
+
"aria-label": "字段类型",
|
|
199
|
+
value: l.type,
|
|
198
200
|
disabled: r.readonly,
|
|
199
|
-
onChange: (
|
|
201
|
+
onChange: (n) => q(l, n.target.value)
|
|
200
202
|
}, [
|
|
201
|
-
(i(), u(C, null, x(S, (
|
|
202
|
-
key:
|
|
203
|
-
value:
|
|
204
|
-
}, c(
|
|
203
|
+
(i(), u(C, null, x(S, (n) => t("option", {
|
|
204
|
+
key: n.value,
|
|
205
|
+
value: n.value
|
|
206
|
+
}, c(n.label), 9, X)), 64))
|
|
205
207
|
], 40, W),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
t("span", Z, [
|
|
209
|
+
t("input", {
|
|
208
210
|
type: "checkbox",
|
|
209
|
-
|
|
211
|
+
"aria-label": "必填",
|
|
212
|
+
checked: !!l.required,
|
|
210
213
|
disabled: r.readonly,
|
|
211
|
-
onChange: (
|
|
212
|
-
|
|
214
|
+
onChange: (n) => {
|
|
215
|
+
l.required = n.target.checked, s();
|
|
213
216
|
}
|
|
214
217
|
}, null, 40, ee),
|
|
215
|
-
|
|
218
|
+
a[2] || (a[2] = _(" 必填 ", -1))
|
|
216
219
|
]),
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
t("span", ae, [
|
|
221
|
+
t("input", {
|
|
219
222
|
type: "checkbox",
|
|
220
|
-
|
|
223
|
+
"aria-label": "隐藏",
|
|
224
|
+
checked: !!l.hidden,
|
|
221
225
|
disabled: r.readonly,
|
|
222
|
-
onChange: (
|
|
223
|
-
|
|
226
|
+
onChange: (n) => {
|
|
227
|
+
l.hidden = n.target.checked, s();
|
|
224
228
|
}
|
|
225
|
-
}, null, 40,
|
|
226
|
-
|
|
229
|
+
}, null, 40, ne),
|
|
230
|
+
a[3] || (a[3] = _(" 隐藏 ", -1))
|
|
227
231
|
])
|
|
228
232
|
]),
|
|
229
233
|
r.readonly ? b("", !0) : (i(), u("button", {
|
|
230
234
|
key: 0,
|
|
231
235
|
class: "of-form-designer__remove-btn",
|
|
232
|
-
onClick: (
|
|
236
|
+
onClick: (n) => E(l.id)
|
|
233
237
|
}, [
|
|
234
238
|
m(f(Y), { size: 14 })
|
|
235
|
-
], 8,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
value: N(
|
|
239
|
+
], 8, le)),
|
|
240
|
+
l.type === "select" || l.type === "multi_select" ? (i(), u("div", te, [
|
|
241
|
+
a[4] || (a[4] = t("span", { class: "of-form-designer__options-label" }, "选项(逗号分隔)", -1)),
|
|
242
|
+
t("input", {
|
|
243
|
+
value: N(l),
|
|
240
244
|
class: "of-form-designer__input",
|
|
245
|
+
"aria-label": "选项列表",
|
|
241
246
|
placeholder: "例如:待办, 进行中, 完成",
|
|
242
247
|
disabled: r.readonly,
|
|
243
|
-
onChange: (
|
|
248
|
+
onChange: (n) => I(l, String(n.target.value))
|
|
244
249
|
}, null, 40, oe)
|
|
245
250
|
])) : b("", !0)
|
|
246
251
|
]))), 128))
|