@oneflowui/ui 0.4.3 → 0.5.0
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.en.md +1 -1
- package/README.md +70 -0
- package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
- package/dist/components/ContextMenu/index.vue.d.ts +2 -1
- package/dist/components/ContextMenu/index.vue.js +2 -2
- package/dist/components/ContextMenu/index.vue2.js +37 -36
- package/dist/components/base/DropdownMenu.vue.js +2 -2
- package/dist/components/base/DropdownMenu.vue2.js +38 -39
- package/dist/components/base/MonitorItem.vue.d.ts +1 -1
- package/dist/components/base/PersonaCard.vue.d.ts +2 -1
- package/dist/components/base/PersonaCard.vue.js +3 -3
- package/dist/components/base/PersonaCard.vue2.js +51 -39
- package/dist/components/base/RefTag.vue.d.ts +2 -2
- package/dist/components/base/RefTag.vue.js +3 -3
- package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
- package/dist/components/base/SearchHighlight.vue.js +7 -0
- package/dist/components/base/SearchHighlight.vue2.js +21 -0
- package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
- package/dist/components/base/ToolbarBtn.vue.js +1 -1
- package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
- package/dist/components/base/ViewModeGroup.vue.js +3 -3
- package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
- package/dist/components/base/ViewSwitcher.vue.js +2 -2
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/database/DatabaseView.vue.d.ts +171 -0
- package/dist/components/database/DatabaseView.vue.js +7 -0
- package/dist/components/database/DatabaseView.vue2.js +774 -0
- package/dist/components/database/index.d.ts +2 -0
- package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
- package/dist/components/field/FieldAttachment.vue.js +7 -0
- package/dist/components/field/FieldAttachment.vue2.js +69 -0
- package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
- package/dist/components/field/FieldAutoNumber.vue.js +7 -0
- package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
- package/dist/components/field/FieldCreator.vue.d.ts +7 -0
- package/dist/components/field/FieldCreator.vue.js +7 -0
- package/dist/components/field/FieldCreator.vue2.js +24 -0
- package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
- package/dist/components/field/FieldCurrency.vue.js +7 -0
- package/dist/components/field/FieldCurrency.vue2.js +42 -0
- package/dist/components/field/FieldDate.vue.js +2 -2
- package/dist/components/field/FieldDate.vue2.js +13 -10
- package/dist/components/field/FieldDatetime.vue.js +1 -1
- package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
- package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
- package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
- package/dist/components/field/FieldMultiSelect.vue.js +2 -2
- package/dist/components/field/FieldPhone.vue.d.ts +17 -0
- package/dist/components/field/FieldPhone.vue.js +7 -0
- package/dist/components/field/FieldPhone.vue2.js +34 -0
- package/dist/components/field/FieldProgress.vue.d.ts +15 -0
- package/dist/components/field/FieldProgress.vue.js +7 -0
- package/dist/components/field/FieldProgress.vue2.js +40 -0
- package/dist/components/field/FieldRelation.vue.d.ts +17 -0
- package/dist/components/field/FieldRelation.vue.js +7 -0
- package/dist/components/field/FieldRelation.vue2.js +67 -0
- package/dist/components/field/FieldRichText.vue.d.ts +17 -0
- package/dist/components/field/FieldRichText.vue.js +7 -0
- package/dist/components/field/FieldRichText.vue2.js +65 -0
- package/dist/components/field/FieldSelect.vue.js +1 -1
- package/dist/components/field/FieldSelect.vue2.js +43 -42
- package/dist/components/form/FormDesigner.vue.js +2 -2
- package/dist/components/form/FormDesigner.vue2.js +62 -52
- package/dist/components/gallery/GalleryCard.vue.js +2 -2
- package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
- package/dist/components/gallery/GalleryView.vue.js +2 -2
- package/dist/components/gallery/GalleryView.vue2.js +30 -20
- package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
- package/dist/components/kanban/KanbanBoard.vue.js +4 -4
- package/dist/components/kanban/KanbanBoard.vue2.js +81 -48
- package/dist/components/layout/AppLayout.vue.js +2 -2
- package/dist/components/layout/AppLayout.vue2.js +46 -62
- package/dist/components/overlay/Drawer.vue.js +1 -1
- package/dist/components/overlay/Drawer.vue2.js +52 -68
- package/dist/components/overlay/Modal.vue.js +1 -1
- package/dist/components/overlay/Modal.vue2.js +52 -68
- package/dist/components/overlay/SidePanel.vue.js +2 -2
- package/dist/components/overlay/SidePanel.vue2.js +64 -80
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
- package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
- package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
- package/dist/components/table/DataTable.vue.d.ts +116 -25
- package/dist/components/table/DataTable.vue.js +4 -4
- package/dist/components/table/DataTable.vue2.js +775 -188
- package/dist/components/table/DetailSheet.vue.d.ts +43 -0
- package/dist/components/table/DetailSheet.vue.js +7 -0
- package/dist/components/table/DetailSheet.vue2.js +140 -0
- package/dist/components/table/FieldCell.vue.d.ts +1 -1
- package/dist/components/table/FieldCell.vue.js +1 -1
- package/dist/components/table/FieldCell.vue2.js +59 -44
- package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
- package/dist/components/table/FieldTypePicker.vue.js +7 -0
- package/dist/components/table/FieldTypePicker.vue2.js +92 -0
- package/dist/components/table/MobileListView.vue.d.ts +24 -0
- package/dist/components/table/MobileListView.vue.js +7 -0
- package/dist/components/table/MobileListView.vue2.js +90 -0
- package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
- package/dist/components/table/TableGroupRow.vue.js +2 -2
- package/dist/components/table/TableGroupRow.vue2.js +33 -23
- package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
- package/dist/components/table/TableHeaderRow.vue.js +2 -2
- package/dist/components/table/TableHeaderRow.vue2.js +54 -33
- package/dist/components/table/TableToolbar.vue.d.ts +118 -0
- package/dist/components/table/TableToolbar.vue.js +7 -0
- package/dist/components/table/TableToolbar.vue2.js +273 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/timeline/GanttTimeline.vue.js +1 -1
- package/dist/components/timeline/GanttTimeline.vue2.js +128 -127
- package/dist/components/toast/ToastItem.vue.js +3 -3
- package/dist/composables/index.d.ts +21 -0
- package/dist/composables/useBreakpoint.d.ts +2 -1
- package/dist/composables/useBreakpoint.js +14 -12
- package/dist/composables/useColumnResize.d.ts +19 -0
- package/dist/composables/useColumnResize.js +58 -0
- package/dist/composables/useDatabaseView.d.ts +138 -0
- package/dist/composables/useDatabaseView.js +388 -0
- package/dist/composables/useDraftRows.d.ts +33 -0
- package/dist/composables/useDraftRows.js +103 -0
- package/dist/composables/useFixedColumns.d.ts +25 -0
- package/dist/composables/useFixedColumns.js +61 -0
- package/dist/composables/useFocusTrap.d.ts +10 -0
- package/dist/composables/useFocusTrap.js +37 -0
- package/dist/composables/useInlineEdit.js +3 -3
- package/dist/composables/useKeyboardNavigation.d.ts +45 -0
- package/dist/composables/useKeyboardNavigation.js +140 -0
- package/dist/composables/useRowDrag.d.ts +32 -0
- package/dist/composables/useRowDrag.js +85 -0
- package/dist/composables/useSchemaEngine.d.ts +31 -0
- package/dist/composables/useSchemaEngine.js +129 -0
- package/dist/composables/useSearch.d.ts +30 -0
- package/dist/composables/useSearch.js +59 -0
- package/dist/composables/useSupabaseProvider.d.ts +70 -0
- package/dist/composables/useSupabaseProvider.js +126 -0
- package/dist/composables/useTable.d.ts +3 -0
- package/dist/composables/useTable.js +103 -83
- package/dist/composables/useTableGroup.d.ts +14 -1
- package/dist/composables/useTableGroup.js +57 -33
- package/dist/composables/useViewPersistence.d.ts +98 -0
- package/dist/composables/useViewPersistence.js +141 -0
- package/dist/composables/useVirtualList.d.ts +4 -1
- package/dist/composables/useVirtualList.js +108 -85
- package/dist/composables/useWorkerSort.d.ts +14 -0
- package/dist/composables/useWorkerSort.js +61 -0
- package/dist/index.d.ts +32 -4
- package/dist/index.js +274 -221
- package/dist/style.css +1 -1
- package/dist/tests/database-view.integration.spec.d.ts +1 -0
- package/dist/types/index.d.ts +63 -2
- package/dist/types/index.js +23 -6
- package/dist/types/table-internal.d.ts +64 -0
- package/dist/utils/aggregation.d.ts +5 -0
- package/dist/utils/aggregation.js +38 -0
- package/dist/utils/supabaseAdapter.d.ts +48 -0
- package/dist/utils/supabaseAdapter.js +76 -0
- package/dist/utils/supabaseSchema.d.ts +81 -0
- package/dist/utils/supabaseSchema.js +202 -0
- package/dist/workers/tableWorker.d.ts +31 -0
- package/package.json +17 -17
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineComponent as p, ref as d, onMounted as b, nextTick as x, openBlock as y, createElementBlock as M, createElementVNode as n, withModifiers as r } from "vue";
|
|
2
|
+
const k = { class: "of-field-richtext" }, w = { class: "of-field-richtext-toolbar" }, T = /* @__PURE__ */ p({
|
|
3
|
+
__name: "FieldRichText",
|
|
4
|
+
props: {
|
|
5
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
6
|
+
field: {}
|
|
7
|
+
},
|
|
8
|
+
emits: ["commit", "cancel", "tabNext"],
|
|
9
|
+
setup(a, { emit: c }) {
|
|
10
|
+
const s = a, l = c, o = d(null), i = d(typeof s.value == "string" ? s.value : "");
|
|
11
|
+
b(
|
|
12
|
+
() => x(() => {
|
|
13
|
+
o.value && (o.value.innerHTML = i.value, o.value.focus());
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
function m(t) {
|
|
17
|
+
var e;
|
|
18
|
+
t.key === "Escape" && (t.preventDefault(), l("cancel")), t.key === "Enter" && (t.ctrlKey || t.metaKey) && (t.preventDefault(), l("commit", ((e = o.value) == null ? void 0 : e.innerHTML) ?? i.value));
|
|
19
|
+
}
|
|
20
|
+
function v() {
|
|
21
|
+
var t;
|
|
22
|
+
l("commit", ((t = o.value) == null ? void 0 : t.innerHTML) ?? i.value);
|
|
23
|
+
}
|
|
24
|
+
function u(t) {
|
|
25
|
+
var e;
|
|
26
|
+
document.execCommand(t, !1), (e = o.value) == null || e.focus();
|
|
27
|
+
}
|
|
28
|
+
return (t, e) => (y(), M("div", k, [
|
|
29
|
+
n("div", w, [
|
|
30
|
+
n("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
class: "of-field-richtext-btn",
|
|
33
|
+
onMousedown: e[0] || (e[0] = r((f) => u("bold"), ["prevent"]))
|
|
34
|
+
}, [...e[3] || (e[3] = [
|
|
35
|
+
n("strong", null, "B", -1)
|
|
36
|
+
])], 32),
|
|
37
|
+
n("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
class: "of-field-richtext-btn",
|
|
40
|
+
onMousedown: e[1] || (e[1] = r((f) => u("italic"), ["prevent"]))
|
|
41
|
+
}, [...e[4] || (e[4] = [
|
|
42
|
+
n("em", null, "I", -1)
|
|
43
|
+
])], 32),
|
|
44
|
+
n("button", {
|
|
45
|
+
type: "button",
|
|
46
|
+
class: "of-field-richtext-btn",
|
|
47
|
+
onMousedown: e[2] || (e[2] = r((f) => u("underline"), ["prevent"]))
|
|
48
|
+
}, [...e[5] || (e[5] = [
|
|
49
|
+
n("u", null, "U", -1)
|
|
50
|
+
])], 32)
|
|
51
|
+
]),
|
|
52
|
+
n("div", {
|
|
53
|
+
ref_key: "editorRef",
|
|
54
|
+
ref: o,
|
|
55
|
+
class: "of-field-richtext-editor",
|
|
56
|
+
contenteditable: "true",
|
|
57
|
+
onKeydown: m,
|
|
58
|
+
onBlur: v
|
|
59
|
+
}, null, 544)
|
|
60
|
+
]));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
T as default
|
|
65
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FieldSelect.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-602f7b18"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as V, ref as f, computed as b, onMounted as z, nextTick as A, onBeforeUnmount as I, watch as T, openBlock as l, createElementBlock as a, normalizeStyle as x, toDisplayString as _, createBlock as F, Teleport as O, unref as B, normalizeClass as h, createElementVNode as P, withModifiers as L, Fragment as U, renderList as K, createCommentVNode as W } from "vue";
|
|
2
|
+
import { useBreakpoint as j } from "../../composables/useBreakpoint.js";
|
|
3
|
+
const q = {
|
|
3
4
|
key: 1,
|
|
4
5
|
class: "of-field-select__display"
|
|
5
|
-
},
|
|
6
|
+
}, G = ["onMouseenter", "onClick"], H = { key: 1 }, X = /* @__PURE__ */ V({
|
|
6
7
|
__name: "FieldSelect",
|
|
7
8
|
props: {
|
|
8
9
|
value: { type: [String, Number, Boolean, Array, null] },
|
|
9
10
|
field: {}
|
|
10
11
|
},
|
|
11
12
|
emits: ["commit", "cancel", "tabNext"],
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
13
|
+
setup($, { emit: N }) {
|
|
14
|
+
const { isMobile: E } = j(), i = $, y = N, s = f(null), D = f(null), C = f({ top: "0px", left: "0px", width: "0px" }), p = f(!0), r = b(() => i.field.options ?? []), c = b(() => {
|
|
14
15
|
const e = typeof i.value == "string" ? i.value : null;
|
|
15
16
|
return r.value.findIndex((t) => t.value === e);
|
|
16
17
|
}), n = f(0);
|
|
17
|
-
function
|
|
18
|
+
function d() {
|
|
18
19
|
if (!s.value) return;
|
|
19
20
|
const e = s.value.getBoundingClientRect();
|
|
20
|
-
|
|
21
|
+
C.value = {
|
|
21
22
|
top: `${e.bottom}px`,
|
|
22
23
|
left: `${e.left}px`,
|
|
23
24
|
width: `${Math.max(e.width, 160)}px`
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
function m(e) {
|
|
27
|
-
p.value = !1,
|
|
28
|
+
p.value = !1, y("commit", e);
|
|
28
29
|
}
|
|
29
30
|
function k() {
|
|
30
|
-
p.value && (p.value = !1,
|
|
31
|
+
p.value && (p.value = !1, y("cancel"));
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function R(e) {
|
|
33
34
|
var t, o;
|
|
34
35
|
if (!r.value.length) {
|
|
35
36
|
e.key === "Escape" && (e.preventDefault(), k());
|
|
@@ -51,71 +52,71 @@ const K = {
|
|
|
51
52
|
e.preventDefault(), k();
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
e.key === "Tab" && (e.preventDefault(), m(((o = r.value[n.value]) == null ? void 0 : o.value) ?? null),
|
|
55
|
+
e.key === "Tab" && (e.preventDefault(), m(((o = r.value[n.value]) == null ? void 0 : o.value) ?? null), y("tabNext"));
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
var o,
|
|
57
|
+
function M(e) {
|
|
58
|
+
var o, v;
|
|
58
59
|
const t = e.target;
|
|
59
|
-
t && ((o = s.value) != null && o.contains(t) || (
|
|
60
|
+
t && ((o = s.value) != null && o.contains(t) || (v = D.value) != null && v.contains(t) || k());
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
n.value = c.value >= 0 ? c.value : 0,
|
|
62
|
+
z(() => {
|
|
63
|
+
n.value = c.value >= 0 ? c.value : 0, A(() => {
|
|
63
64
|
var e;
|
|
64
|
-
|
|
65
|
-
}), window.addEventListener("resize",
|
|
66
|
-
}),
|
|
67
|
-
window.removeEventListener("resize",
|
|
68
|
-
}),
|
|
65
|
+
d(), (e = s.value) == null || e.focus();
|
|
66
|
+
}), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), window.addEventListener("mousedown", M, !0);
|
|
67
|
+
}), I(() => {
|
|
68
|
+
window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), window.removeEventListener("mousedown", M, !0);
|
|
69
|
+
}), T(c, (e) => {
|
|
69
70
|
e >= 0 && (n.value = e);
|
|
70
71
|
});
|
|
71
|
-
const w =
|
|
72
|
+
const w = b(() => {
|
|
72
73
|
const e = typeof i.value == "string" ? i.value : null;
|
|
73
74
|
return r.value.find((t) => t.value === e);
|
|
74
75
|
});
|
|
75
76
|
return (e, t) => {
|
|
76
|
-
var o,
|
|
77
|
+
var o, v;
|
|
77
78
|
return l(), a("div", {
|
|
78
79
|
ref_key: "triggerRef",
|
|
79
80
|
ref: s,
|
|
80
81
|
class: "of-field-select",
|
|
81
82
|
tabindex: "0",
|
|
82
|
-
onKeydown:
|
|
83
|
+
onKeydown: R
|
|
83
84
|
}, [
|
|
84
85
|
(o = w.value) != null && o.color ? (l(), a("span", {
|
|
85
86
|
key: 0,
|
|
86
87
|
class: "of-field-select__badge",
|
|
87
|
-
style:
|
|
88
|
-
},
|
|
89
|
-
(l(),
|
|
88
|
+
style: x({ background: w.value.color })
|
|
89
|
+
}, _(w.value.label), 5)) : (l(), a("span", q, _(((v = w.value) == null ? void 0 : v.label) ?? "—"), 1)),
|
|
90
|
+
(l(), F(O, { to: "body" }, [
|
|
90
91
|
p.value ? (l(), a("div", {
|
|
91
92
|
key: 0,
|
|
92
93
|
ref_key: "dropdownRef",
|
|
93
|
-
ref:
|
|
94
|
-
class: "of-field-select__dropdown",
|
|
95
|
-
style:
|
|
94
|
+
ref: D,
|
|
95
|
+
class: h(["of-field-select__dropdown", { "of-field-select__dropdown--sheet": B(E) }]),
|
|
96
|
+
style: x(B(E) ? {} : C.value)
|
|
96
97
|
}, [
|
|
97
|
-
|
|
98
|
-
class:
|
|
99
|
-
onClick: t[0] || (t[0] =
|
|
98
|
+
P("div", {
|
|
99
|
+
class: h(["of-field-select__option of-field-select__option--clear", { active: n.value === -1, selected: c.value === -1 }]),
|
|
100
|
+
onClick: t[0] || (t[0] = L((u) => m(null), ["stop"]))
|
|
100
101
|
}, " — ", 2),
|
|
101
|
-
(l(!0), a(
|
|
102
|
+
(l(!0), a(U, null, K(r.value, (u, g) => (l(), a("div", {
|
|
102
103
|
key: u.value,
|
|
103
|
-
class:
|
|
104
|
-
onMouseenter: (
|
|
105
|
-
onClick:
|
|
104
|
+
class: h(["of-field-select__option", { active: g === n.value, selected: g === c.value }]),
|
|
105
|
+
onMouseenter: (S) => n.value = g,
|
|
106
|
+
onClick: L((S) => m(u.value), ["stop"])
|
|
106
107
|
}, [
|
|
107
108
|
u.color ? (l(), a("span", {
|
|
108
109
|
key: 0,
|
|
109
110
|
class: "of-field-select__badge",
|
|
110
|
-
style:
|
|
111
|
-
},
|
|
112
|
-
], 42,
|
|
113
|
-
],
|
|
111
|
+
style: x({ background: u.color })
|
|
112
|
+
}, _(u.label), 5)) : (l(), a("span", H, _(u.label), 1))
|
|
113
|
+
], 42, G))), 128))
|
|
114
|
+
], 6)) : W("", !0)
|
|
114
115
|
]))
|
|
115
116
|
], 544);
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
});
|
|
119
120
|
export {
|
|
120
|
-
|
|
121
|
+
X as default
|
|
121
122
|
};
|
|
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-85067929"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as
|
|
1
|
+
import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as u, createElementVNode as a, 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"], ne = { class: "of-form-designer__checkbox-label" }, le = ["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"], ne = { class: "of-form-designer__checkbox-label" }, le = ["checked", "disabled", "onChange"], te = ["onClick"], ae = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "of-form-designer__options-wrap"
|
|
8
|
-
}, oe = ["value", "disabled", "onChange"],
|
|
8
|
+
}, oe = ["value", "disabled", "onChange"], de = /* @__PURE__ */ z({
|
|
9
9
|
__name: "FormDesigner",
|
|
10
10
|
props: {
|
|
11
11
|
schema: {},
|
|
@@ -13,8 +13,8 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
13
13
|
readonly: { type: Boolean, default: !1 }
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:schema", "change"],
|
|
16
|
-
setup(r, { emit:
|
|
17
|
-
const
|
|
16
|
+
setup(r, { emit: F }) {
|
|
17
|
+
const S = [
|
|
18
18
|
{ value: "text", label: "文本" },
|
|
19
19
|
{ value: "number", label: "数字" },
|
|
20
20
|
{ value: "select", label: "单选" },
|
|
@@ -30,23 +30,23 @@ 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
|
+
], d = r, p = F, o = T(v(d.schema));
|
|
34
34
|
L(
|
|
35
|
-
() =>
|
|
35
|
+
() => d.schema,
|
|
36
36
|
(e) => {
|
|
37
37
|
o.value = v(e);
|
|
38
38
|
},
|
|
39
39
|
{ deep: !0 }
|
|
40
40
|
);
|
|
41
|
-
const
|
|
41
|
+
const w = P(() => `${o.value.fields.length} 个字段`);
|
|
42
42
|
function v(e) {
|
|
43
43
|
return {
|
|
44
44
|
...e,
|
|
45
|
-
fields: e.fields.map(
|
|
45
|
+
fields: e.fields.map(y),
|
|
46
46
|
views: e.views.map((n) => ({ ...n }))
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function y(e) {
|
|
50
50
|
return h(e) ? {
|
|
51
51
|
...e,
|
|
52
52
|
options: e.options.map((n) => ({ ...n }))
|
|
@@ -96,6 +96,16 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
96
96
|
return { ...n, type: e };
|
|
97
97
|
case "formula":
|
|
98
98
|
return { ...n, type: e, formula: "" };
|
|
99
|
+
case "currency":
|
|
100
|
+
return { ...n, type: e };
|
|
101
|
+
case "richtext":
|
|
102
|
+
return { ...n, type: e };
|
|
103
|
+
case "auto_number":
|
|
104
|
+
return { ...n, type: e };
|
|
105
|
+
case "creator":
|
|
106
|
+
return { ...n, type: e };
|
|
107
|
+
case "progress":
|
|
108
|
+
return { ...n, type: e };
|
|
99
109
|
}
|
|
100
110
|
}
|
|
101
111
|
function D() {
|
|
@@ -105,14 +115,14 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
105
115
|
];
|
|
106
116
|
}
|
|
107
117
|
function B() {
|
|
108
|
-
|
|
118
|
+
d.readonly || (o.value.fields.push(V()), s());
|
|
109
119
|
}
|
|
110
120
|
function E(e) {
|
|
111
|
-
|
|
121
|
+
d.readonly || (o.value.fields = o.value.fields.filter((n) => n.id !== e), s());
|
|
112
122
|
}
|
|
113
123
|
function q(e, n) {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
124
|
+
const t = o.value.fields.findIndex((g) => g.id === e.id);
|
|
125
|
+
if (t === -1) return;
|
|
116
126
|
const l = {
|
|
117
127
|
id: e.id,
|
|
118
128
|
name: e.name,
|
|
@@ -120,7 +130,7 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
120
130
|
hidden: e.hidden,
|
|
121
131
|
width: e.width
|
|
122
132
|
};
|
|
123
|
-
o.value.fields[
|
|
133
|
+
o.value.fields[t] = h(e) && (n === "select" || n === "multi_select") ? {
|
|
124
134
|
...l,
|
|
125
135
|
type: n,
|
|
126
136
|
options: e.options.map(
|
|
@@ -130,8 +140,8 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
130
140
|
}
|
|
131
141
|
function I(e, n) {
|
|
132
142
|
if (!h(e)) return;
|
|
133
|
-
const
|
|
134
|
-
e.options =
|
|
143
|
+
const t = n.split(",").map((l) => l.trim()).filter(Boolean);
|
|
144
|
+
e.options = t.map((l) => ({ value: l, label: l })), s();
|
|
135
145
|
}
|
|
136
146
|
function N(e) {
|
|
137
147
|
return h(e) ? e.options.map((n) => n.label).join(", ") : "";
|
|
@@ -139,13 +149,13 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
139
149
|
function O() {
|
|
140
150
|
s();
|
|
141
151
|
}
|
|
142
|
-
return (e, n) => (i(),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
return (e, n) => (i(), u("div", H, [
|
|
153
|
+
a("div", J, [
|
|
154
|
+
a("div", null, [
|
|
155
|
+
a("h3", K, c(r.title), 1),
|
|
156
|
+
a("p", M, c(o.value.name) + " · " + c(w.value), 1)
|
|
147
157
|
]),
|
|
148
|
-
r.readonly ? b("", !0) : (i(),
|
|
158
|
+
r.readonly ? b("", !0) : (i(), u("button", {
|
|
149
159
|
key: 0,
|
|
150
160
|
class: "of-form-designer__add-btn",
|
|
151
161
|
onClick: B
|
|
@@ -156,81 +166,81 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
156
166
|
]),
|
|
157
167
|
m(f(A), {
|
|
158
168
|
modelValue: o.value.fields,
|
|
159
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
169
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => o.value.fields = t),
|
|
160
170
|
handle: ".of-form-designer__drag",
|
|
161
171
|
disabled: r.readonly,
|
|
162
172
|
animation: 150,
|
|
163
173
|
onEnd: O
|
|
164
174
|
}, {
|
|
165
175
|
default: $(() => [
|
|
166
|
-
(i(!0),
|
|
167
|
-
key:
|
|
176
|
+
(i(!0), u(C, null, x(o.value.fields, (t) => (i(), u("div", {
|
|
177
|
+
key: t.id,
|
|
168
178
|
class: "of-form-designer__row"
|
|
169
179
|
}, [
|
|
170
|
-
|
|
180
|
+
a("span", {
|
|
171
181
|
class: j(["of-form-designer__drag", { disabled: r.readonly }])
|
|
172
182
|
}, [
|
|
173
183
|
m(f(U), { size: 14 })
|
|
174
184
|
], 2),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
value:
|
|
185
|
+
a("div", Q, [
|
|
186
|
+
a("input", {
|
|
187
|
+
value: t.name,
|
|
178
188
|
class: "of-form-designer__input",
|
|
179
189
|
placeholder: "字段名称",
|
|
180
190
|
disabled: r.readonly,
|
|
181
191
|
onInput: (l) => {
|
|
182
|
-
|
|
192
|
+
t.name = String(l.target.value), s();
|
|
183
193
|
}
|
|
184
194
|
}, null, 40, R),
|
|
185
|
-
|
|
195
|
+
a("select", {
|
|
186
196
|
class: "of-form-designer__select",
|
|
187
|
-
value:
|
|
197
|
+
value: t.type,
|
|
188
198
|
disabled: r.readonly,
|
|
189
|
-
onChange: (l) => q(
|
|
199
|
+
onChange: (l) => q(t, l.target.value)
|
|
190
200
|
}, [
|
|
191
|
-
(i(),
|
|
201
|
+
(i(), u(C, null, x(S, (l) => a("option", {
|
|
192
202
|
key: l.value,
|
|
193
203
|
value: l.value
|
|
194
204
|
}, c(l.label), 9, X)), 64))
|
|
195
205
|
], 40, W),
|
|
196
|
-
|
|
197
|
-
|
|
206
|
+
a("label", Z, [
|
|
207
|
+
a("input", {
|
|
198
208
|
type: "checkbox",
|
|
199
|
-
checked: !!
|
|
209
|
+
checked: !!t.required,
|
|
200
210
|
disabled: r.readonly,
|
|
201
211
|
onChange: (l) => {
|
|
202
|
-
|
|
212
|
+
t.required = l.target.checked, s();
|
|
203
213
|
}
|
|
204
214
|
}, null, 40, ee),
|
|
205
215
|
n[2] || (n[2] = _(" 必填 ", -1))
|
|
206
216
|
]),
|
|
207
|
-
|
|
208
|
-
|
|
217
|
+
a("label", ne, [
|
|
218
|
+
a("input", {
|
|
209
219
|
type: "checkbox",
|
|
210
|
-
checked: !!
|
|
220
|
+
checked: !!t.hidden,
|
|
211
221
|
disabled: r.readonly,
|
|
212
222
|
onChange: (l) => {
|
|
213
|
-
|
|
223
|
+
t.hidden = l.target.checked, s();
|
|
214
224
|
}
|
|
215
225
|
}, null, 40, le),
|
|
216
226
|
n[3] || (n[3] = _(" 隐藏 ", -1))
|
|
217
227
|
])
|
|
218
228
|
]),
|
|
219
|
-
r.readonly ? b("", !0) : (i(),
|
|
229
|
+
r.readonly ? b("", !0) : (i(), u("button", {
|
|
220
230
|
key: 0,
|
|
221
231
|
class: "of-form-designer__remove-btn",
|
|
222
|
-
onClick: (l) => E(
|
|
232
|
+
onClick: (l) => E(t.id)
|
|
223
233
|
}, [
|
|
224
234
|
m(f(Y), { size: 14 })
|
|
225
|
-
], 8,
|
|
226
|
-
|
|
227
|
-
n[4] || (n[4] =
|
|
228
|
-
|
|
229
|
-
value: N(
|
|
235
|
+
], 8, te)),
|
|
236
|
+
t.type === "select" || t.type === "multi_select" ? (i(), u("div", ae, [
|
|
237
|
+
n[4] || (n[4] = a("label", { class: "of-form-designer__options-label" }, "选项(逗号分隔)", -1)),
|
|
238
|
+
a("input", {
|
|
239
|
+
value: N(t),
|
|
230
240
|
class: "of-form-designer__input",
|
|
231
241
|
placeholder: "例如:待办, 进行中, 完成",
|
|
232
242
|
disabled: r.readonly,
|
|
233
|
-
onChange: (l) => I(
|
|
243
|
+
onChange: (l) => I(t, String(l.target.value))
|
|
234
244
|
}, null, 40, oe)
|
|
235
245
|
])) : b("", !0)
|
|
236
246
|
]))), 128))
|
|
@@ -241,5 +251,5 @@ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header"
|
|
|
241
251
|
}
|
|
242
252
|
});
|
|
243
253
|
export {
|
|
244
|
-
|
|
254
|
+
de as default
|
|
245
255
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./GalleryCard.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-38d1e761"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { DataRecord, GalleryItem } from '../../types';
|
|
1
|
+
import { DataRecord, GalleryItem, TableSchema, ViewConfig } from '../../types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
items?: GalleryItem[];
|
|
4
4
|
records?: DataRecord[];
|
|
5
|
+
schema?: TableSchema;
|
|
6
|
+
view?: ViewConfig;
|
|
5
7
|
coverFieldId?: string;
|
|
6
8
|
cardFieldIds?: string[];
|
|
7
9
|
columns?: number;
|
|
@@ -15,9 +17,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
15
17
|
"onCard-click"?: ((item: GalleryItem) => any) | undefined;
|
|
16
18
|
}>, {
|
|
17
19
|
items: GalleryItem[];
|
|
20
|
+
view: ViewConfig;
|
|
18
21
|
columns: number;
|
|
19
|
-
records: DataRecord[];
|
|
20
22
|
addable: boolean;
|
|
23
|
+
records: DataRecord[];
|
|
24
|
+
schema: TableSchema;
|
|
21
25
|
coverFieldId: string;
|
|
22
26
|
cardFieldIds: string[];
|
|
23
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./GalleryView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b432e370"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,48 +1,58 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import
|
|
4
|
-
import { buildGalleryItems as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as g, computed as t, openBlock as i, createElementBlock as o, normalizeStyle as p, Fragment as I, renderList as w, createBlock as C, createVNode as k, unref as b, createElementVNode as _, createCommentVNode as B } from "vue";
|
|
2
|
+
import { PlusIcon as V } from "lucide-vue-next";
|
|
3
|
+
import h from "./GalleryCard.vue.js";
|
|
4
|
+
import { buildGalleryItems as G } from "../../types/index.js";
|
|
5
|
+
const S = /* @__PURE__ */ g({
|
|
6
6
|
__name: "GalleryView",
|
|
7
7
|
props: {
|
|
8
8
|
items: { default: () => [] },
|
|
9
9
|
records: { default: () => [] },
|
|
10
|
+
schema: { default: void 0 },
|
|
11
|
+
view: { default: void 0 },
|
|
10
12
|
coverFieldId: { default: "" },
|
|
11
13
|
cardFieldIds: { default: () => [] },
|
|
12
14
|
columns: { default: 4 },
|
|
13
15
|
addable: { type: Boolean, default: !0 }
|
|
14
16
|
},
|
|
15
17
|
emits: ["card-click", "add"],
|
|
16
|
-
setup(
|
|
17
|
-
const e =
|
|
18
|
+
setup(n, { emit: v }) {
|
|
19
|
+
const e = n, s = v, m = t(() => ({
|
|
18
20
|
"--columns": e.columns
|
|
19
|
-
})), c =
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
})), c = t(
|
|
22
|
+
() => {
|
|
23
|
+
var d;
|
|
24
|
+
return e.coverFieldId || ((d = e.view) == null ? void 0 : d.galleryCoverFieldId) || "";
|
|
25
|
+
}
|
|
26
|
+
), f = t(() => {
|
|
27
|
+
var d, l, r, a, u;
|
|
28
|
+
return (d = e.cardFieldIds) != null && d.length ? e.cardFieldIds : (r = (l = e.view) == null ? void 0 : l.galleryCardFields) != null && r.length ? e.view.galleryCardFields : (u = (a = e.view) == null ? void 0 : a.visibleFields) != null && u.length ? e.view.visibleFields.filter((F) => F !== c.value) : [];
|
|
29
|
+
}), y = t(() => e.items.length > 0 ? e.items : e.records.length > 0 ? G(e.records, {
|
|
30
|
+
coverFieldId: c.value || void 0,
|
|
31
|
+
cardFieldIds: f.value
|
|
22
32
|
}) : []);
|
|
23
|
-
return (
|
|
33
|
+
return (d, l) => (i(), o("div", {
|
|
24
34
|
class: "gallery-view",
|
|
25
|
-
style: m
|
|
35
|
+
style: p(m.value)
|
|
26
36
|
}, [
|
|
27
|
-
(
|
|
37
|
+
(i(!0), o(I, null, w(y.value, (r) => (i(), C(h, {
|
|
28
38
|
key: r.id,
|
|
29
39
|
item: r,
|
|
30
|
-
onClick: (
|
|
40
|
+
onClick: (a) => s("card-click", r)
|
|
31
41
|
}, null, 8, ["item", "onClick"]))), 128)),
|
|
32
|
-
|
|
42
|
+
n.addable ? (i(), o("button", {
|
|
33
43
|
key: 0,
|
|
34
44
|
class: "gallery-view__add-btn",
|
|
35
|
-
onClick: l[0] || (l[0] = (r) =>
|
|
45
|
+
onClick: l[0] || (l[0] = (r) => s("add"))
|
|
36
46
|
}, [
|
|
37
|
-
|
|
47
|
+
k(b(V), {
|
|
38
48
|
size: 18,
|
|
39
49
|
class: "gallery-view__add-icon"
|
|
40
50
|
}),
|
|
41
|
-
l[1] || (l[1] =
|
|
42
|
-
])) :
|
|
51
|
+
l[1] || (l[1] = _("span", { class: "gallery-view__add-label" }, "添加", -1))
|
|
52
|
+
])) : B("", !0)
|
|
43
53
|
], 4));
|
|
44
54
|
}
|
|
45
55
|
});
|
|
46
56
|
export {
|
|
47
|
-
|
|
57
|
+
S as default
|
|
48
58
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { DataRecord, KanbanColumnData, Task } from '../../types';
|
|
1
|
+
import { DataRecord, KanbanColumnData, Task, TableSchema, ViewConfig } from '../../types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
columns?: KanbanColumnData[];
|
|
4
4
|
records?: DataRecord[];
|
|
5
|
+
schema?: TableSchema;
|
|
6
|
+
view?: ViewConfig;
|
|
5
7
|
kanbanFieldId?: string;
|
|
6
8
|
laneOrder?: string[];
|
|
7
9
|
laneTitles?: Record<string, string>;
|
|
@@ -16,8 +18,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
16
18
|
"onCard-click"?: ((task: Task) => any) | undefined;
|
|
17
19
|
"onAdd-column"?: (() => any) | undefined;
|
|
18
20
|
}>, {
|
|
21
|
+
view: ViewConfig;
|
|
19
22
|
columns: KanbanColumnData[];
|
|
20
23
|
records: DataRecord[];
|
|
24
|
+
schema: TableSchema;
|
|
21
25
|
kanbanFieldId: string;
|
|
22
26
|
laneOrder: string[];
|
|
23
27
|
laneTitles: Record<string, string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./KanbanBoard.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-5b7aa191"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|