@oneflowui/ui 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/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 +19 -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/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 +28 -4
- package/dist/index.js +264 -216
- package/dist/style.css +1 -1
- 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 +1 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { X as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as b, watch as w, onUnmounted as p, openBlock as o, createBlock as C, Teleport as V, createVNode as r, Transition as B, withCtx as _, createElementBlock as l, withModifiers as z, normalizeStyle as c, createElementVNode as m, normalizeClass as E, renderSlot as s, toDisplayString as T, unref as $, createCommentVNode as a } from "vue";
|
|
2
|
+
import { X as x } from "lucide-vue-next";
|
|
3
|
+
import { useFocusTrap as I } from "../../composables/useFocusTrap.js";
|
|
4
|
+
const L = ["aria-label"], M = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "of-modal__header"
|
|
6
|
-
},
|
|
7
|
+
}, N = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "of-modal__title"
|
|
9
10
|
}, R = {
|
|
10
11
|
key: 1,
|
|
11
12
|
class: "of-modal__title-placeholder"
|
|
12
|
-
},
|
|
13
|
+
}, S = { class: "of-modal__body" }, g = {
|
|
13
14
|
key: 1,
|
|
14
15
|
class: "of-modal__footer"
|
|
15
|
-
},
|
|
16
|
+
}, U = /* @__PURE__ */ b({
|
|
16
17
|
inheritAttrs: !1,
|
|
17
18
|
__name: "Modal",
|
|
18
19
|
props: {
|
|
@@ -25,85 +26,68 @@ const M = ["aria-label"], N = {
|
|
|
25
26
|
zIndex: { default: 1e3 }
|
|
26
27
|
},
|
|
27
28
|
emits: ["update:modelValue"],
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
).filter((e) => !e.closest('[aria-hidden="true"]')) : [];
|
|
29
|
+
setup(e, { emit: f }) {
|
|
30
|
+
const d = e, u = f, {
|
|
31
|
+
containerRef: y,
|
|
32
|
+
activate: h,
|
|
33
|
+
deactivate: k
|
|
34
|
+
} = I();
|
|
35
|
+
function n() {
|
|
36
|
+
u("update:modelValue", !1);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
const o = m();
|
|
41
|
-
if (o.length === 0) {
|
|
42
|
-
e.preventDefault();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const y = o[0], v = o[o.length - 1];
|
|
46
|
-
e.shiftKey ? document.activeElement === y && (e.preventDefault(), v.focus()) : document.activeElement === v && (e.preventDefault(), y.focus());
|
|
47
|
-
}
|
|
48
|
-
function u() {
|
|
49
|
-
E("update:modelValue", !1);
|
|
50
|
-
}
|
|
51
|
-
function p() {
|
|
52
|
-
i.maskClosable && u();
|
|
38
|
+
function v() {
|
|
39
|
+
d.maskClosable && n();
|
|
53
40
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
41
|
+
function i(t) {
|
|
42
|
+
t.key === "Escape" && d.modelValue && n();
|
|
56
43
|
}
|
|
57
|
-
return
|
|
58
|
-
() =>
|
|
59
|
-
(
|
|
60
|
-
typeof document > "u" || (
|
|
61
|
-
const o = m();
|
|
62
|
-
o.length && o[0].focus(), document.addEventListener("keydown", r);
|
|
63
|
-
})) : (document.body.style.overflow = "", document.removeEventListener("keydown", c), document.removeEventListener("keydown", r), a == null || a.focus(), a = null));
|
|
44
|
+
return w(
|
|
45
|
+
() => d.modelValue,
|
|
46
|
+
(t) => {
|
|
47
|
+
typeof document > "u" || (t ? (document.body.style.overflow = "hidden", document.addEventListener("keydown", i), h()) : (document.body.style.overflow = "", document.removeEventListener("keydown", i), k()));
|
|
64
48
|
}
|
|
65
|
-
),
|
|
66
|
-
typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown",
|
|
67
|
-
}), (
|
|
68
|
-
|
|
69
|
-
default:
|
|
70
|
-
|
|
49
|
+
), p(() => {
|
|
50
|
+
typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", i));
|
|
51
|
+
}), (t, A) => (o(), C(V, { to: "body" }, [
|
|
52
|
+
r(B, { name: "of-modal" }, {
|
|
53
|
+
default: _(() => [
|
|
54
|
+
e.modelValue ? (o(), l("div", {
|
|
71
55
|
key: 0,
|
|
72
56
|
class: "of-modal-backdrop",
|
|
73
|
-
style:
|
|
74
|
-
onClick:
|
|
57
|
+
style: c({ zIndex: e.zIndex }),
|
|
58
|
+
onClick: z(v, ["self"])
|
|
75
59
|
}, [
|
|
76
|
-
|
|
60
|
+
m("div", {
|
|
77
61
|
ref_key: "modalRef",
|
|
78
|
-
ref:
|
|
79
|
-
class:
|
|
80
|
-
style:
|
|
62
|
+
ref: y,
|
|
63
|
+
class: E(["of-modal", { "of-modal--centered": e.centered }]),
|
|
64
|
+
style: c({ width: e.width, maxWidth: "90vw" }),
|
|
81
65
|
role: "dialog",
|
|
82
66
|
"aria-modal": "true",
|
|
83
|
-
"aria-label":
|
|
67
|
+
"aria-label": e.title
|
|
84
68
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
69
|
+
t.$slots.header || e.title || e.closable ? (o(), l("div", M, [
|
|
70
|
+
s(t.$slots, "header", {}, () => [
|
|
71
|
+
e.title ? (o(), l("h3", N, T(e.title), 1)) : (o(), l("div", R))
|
|
88
72
|
], !0),
|
|
89
|
-
|
|
73
|
+
e.closable ? (o(), l("button", {
|
|
90
74
|
key: 0,
|
|
91
75
|
class: "of-modal__close",
|
|
92
|
-
onClick:
|
|
76
|
+
onClick: n,
|
|
93
77
|
"aria-label": "关闭",
|
|
94
78
|
type: "button"
|
|
95
79
|
}, [
|
|
96
|
-
|
|
97
|
-
])) :
|
|
98
|
-
])) :
|
|
99
|
-
|
|
100
|
-
|
|
80
|
+
r($(x), { size: 18 })
|
|
81
|
+
])) : a("", !0)
|
|
82
|
+
])) : a("", !0),
|
|
83
|
+
m("div", S, [
|
|
84
|
+
s(t.$slots, "default", {}, void 0, !0)
|
|
101
85
|
]),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
])) :
|
|
105
|
-
], 14,
|
|
106
|
-
], 4)) :
|
|
86
|
+
t.$slots.footer ? (o(), l("div", g, [
|
|
87
|
+
s(t.$slots, "footer", {}, void 0, !0)
|
|
88
|
+
])) : a("", !0)
|
|
89
|
+
], 14, L)
|
|
90
|
+
], 4)) : a("", !0)
|
|
107
91
|
]),
|
|
108
92
|
_: 3
|
|
109
93
|
})
|
|
@@ -111,5 +95,5 @@ const M = ["aria-label"], N = {
|
|
|
111
95
|
}
|
|
112
96
|
});
|
|
113
97
|
export {
|
|
114
|
-
|
|
98
|
+
U as default
|
|
115
99
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidePanel.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-45ffc40d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { X as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as _, computed as V, onMounted as C, watch as $, onBeforeUnmount as B, openBlock as t, createBlock as S, Teleport as E, createElementBlock as l, Fragment as g, normalizeStyle as u, renderSlot as d, toDisplayString as f, createVNode as m, unref as y, createCommentVNode as a, createElementVNode as h, withDirectives as z, vShow as P } from "vue";
|
|
2
|
+
import { X as k } from "lucide-vue-next";
|
|
3
|
+
import { useFocusTrap as R } from "../../composables/useFocusTrap.js";
|
|
4
|
+
const T = ["aria-label"], N = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "of-side-panel__header"
|
|
6
|
-
},
|
|
7
|
+
}, D = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "of-side-panel__title"
|
|
9
|
-
},
|
|
10
|
+
}, F = {
|
|
10
11
|
key: 1,
|
|
11
12
|
class: "of-side-panel__title-placeholder"
|
|
12
|
-
},
|
|
13
|
+
}, L = { class: "of-side-panel__body" }, K = ["aria-label"], M = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "of-side-panel__header"
|
|
15
|
-
},
|
|
16
|
+
}, U = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "of-side-panel__title"
|
|
18
|
-
},
|
|
19
|
+
}, X = {
|
|
19
20
|
key: 1,
|
|
20
21
|
class: "of-side-panel__title-placeholder"
|
|
21
|
-
},
|
|
22
|
+
}, j = { class: "of-side-panel__body" }, I = /* @__PURE__ */ _({
|
|
22
23
|
__name: "SidePanel",
|
|
23
24
|
props: {
|
|
24
25
|
modelValue: { type: Boolean },
|
|
@@ -28,110 +29,93 @@ const F = ["aria-label"], K = {
|
|
|
28
29
|
mode: { default: "persistent" }
|
|
29
30
|
},
|
|
30
31
|
emits: ["update:modelValue"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
width: `${
|
|
34
|
-
})),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
).filter((e) => !e.closest('[aria-hidden="true"]')) : [];
|
|
32
|
+
setup(e, { emit: v }) {
|
|
33
|
+
const i = e, w = v, n = V(() => ({
|
|
34
|
+
width: `${i.width}px`
|
|
35
|
+
})), {
|
|
36
|
+
containerRef: r,
|
|
37
|
+
activate: b,
|
|
38
|
+
deactivate: p
|
|
39
|
+
} = R();
|
|
40
|
+
function c(o) {
|
|
41
|
+
o.key === "Escape" && i.modelValue && s();
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
C(() => {
|
|
44
|
+
typeof document > "u" || document.addEventListener("keydown", c);
|
|
45
|
+
}), $(
|
|
46
|
+
() => i.modelValue,
|
|
47
|
+
(o) => {
|
|
48
|
+
typeof document > "u" || (document.body.style.overflow = o ? "hidden" : "", o ? b() : p());
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
function y(e) {
|
|
54
|
-
e.key === "Escape" && u.modelValue && c();
|
|
55
|
-
}
|
|
56
|
-
B(() => {
|
|
57
|
-
typeof document > "u" || document.addEventListener("keydown", y);
|
|
58
|
-
}), D(
|
|
59
|
-
() => u.modelValue,
|
|
60
|
-
(e) => {
|
|
61
|
-
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "", e ? (a = document.activeElement, L(() => {
|
|
62
|
-
const n = m();
|
|
63
|
-
n.length && n[0].focus(), document.addEventListener("keydown", r);
|
|
64
|
-
})) : (document.removeEventListener("keydown", r), a == null || a.focus(), a = null));
|
|
65
|
-
}
|
|
66
|
-
), z(() => {
|
|
67
|
-
typeof document > "u" || (document.removeEventListener("keydown", y), document.removeEventListener("keydown", r), document.body.style.overflow = "");
|
|
50
|
+
), B(() => {
|
|
51
|
+
typeof document > "u" || (document.removeEventListener("keydown", c), document.body.style.overflow = "");
|
|
68
52
|
});
|
|
69
|
-
function
|
|
70
|
-
|
|
53
|
+
function s() {
|
|
54
|
+
w("update:modelValue", !1);
|
|
71
55
|
}
|
|
72
|
-
return (
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
return (o, q) => (t(), S(E, { to: "body" }, [
|
|
57
|
+
e.mode === "lazy" ? (t(), l(g, { key: 0 }, [
|
|
58
|
+
e.modelValue ? (t(), l("aside", {
|
|
75
59
|
key: 0,
|
|
76
60
|
ref_key: "sidePanelRef",
|
|
77
|
-
ref:
|
|
61
|
+
ref: r,
|
|
78
62
|
class: "of-side-panel",
|
|
79
|
-
style:
|
|
63
|
+
style: u(n.value),
|
|
80
64
|
role: "dialog",
|
|
81
65
|
"aria-modal": "true",
|
|
82
|
-
"aria-label":
|
|
66
|
+
"aria-label": e.title
|
|
83
67
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
68
|
+
o.$slots.header || e.title || e.showClose ? (t(), l("div", N, [
|
|
69
|
+
d(o.$slots, "header", {}, () => [
|
|
70
|
+
e.title ? (t(), l("h3", D, f(e.title), 1)) : (t(), l("div", F))
|
|
87
71
|
], !0),
|
|
88
|
-
|
|
72
|
+
e.showClose ? (t(), l("button", {
|
|
89
73
|
key: 0,
|
|
90
74
|
class: "of-side-panel__close",
|
|
91
75
|
type: "button",
|
|
92
76
|
"aria-label": "关闭",
|
|
93
|
-
onClick:
|
|
77
|
+
onClick: s
|
|
94
78
|
}, [
|
|
95
|
-
|
|
96
|
-
])) :
|
|
97
|
-
])) :
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
m(y(k), { size: 18 })
|
|
80
|
+
])) : a("", !0)
|
|
81
|
+
])) : a("", !0),
|
|
82
|
+
h("div", L, [
|
|
83
|
+
d(o.$slots, "default", {}, void 0, !0)
|
|
100
84
|
])
|
|
101
|
-
], 12,
|
|
102
|
-
], 64)) :
|
|
85
|
+
], 12, T)) : a("", !0)
|
|
86
|
+
], 64)) : z((t(), l("aside", {
|
|
103
87
|
key: 1,
|
|
104
88
|
ref_key: "sidePanelRef",
|
|
105
|
-
ref:
|
|
89
|
+
ref: r,
|
|
106
90
|
class: "of-side-panel",
|
|
107
|
-
style:
|
|
91
|
+
style: u(n.value),
|
|
108
92
|
role: "dialog",
|
|
109
93
|
"aria-modal": "true",
|
|
110
|
-
"aria-label":
|
|
94
|
+
"aria-label": e.title
|
|
111
95
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
96
|
+
o.$slots.header || e.title || e.showClose ? (t(), l("div", M, [
|
|
97
|
+
d(o.$slots, "header", {}, () => [
|
|
98
|
+
e.title ? (t(), l("h3", U, f(e.title), 1)) : (t(), l("div", X))
|
|
115
99
|
], !0),
|
|
116
|
-
|
|
100
|
+
e.showClose ? (t(), l("button", {
|
|
117
101
|
key: 0,
|
|
118
102
|
class: "of-side-panel__close",
|
|
119
103
|
type: "button",
|
|
120
104
|
"aria-label": "关闭",
|
|
121
|
-
onClick:
|
|
105
|
+
onClick: s
|
|
122
106
|
}, [
|
|
123
|
-
|
|
124
|
-
])) :
|
|
125
|
-
])) :
|
|
126
|
-
|
|
127
|
-
|
|
107
|
+
m(y(k), { size: 18 })
|
|
108
|
+
])) : a("", !0)
|
|
109
|
+
])) : a("", !0),
|
|
110
|
+
h("div", j, [
|
|
111
|
+
d(o.$slots, "default", {}, void 0, !0)
|
|
128
112
|
])
|
|
129
|
-
], 12,
|
|
130
|
-
[
|
|
113
|
+
], 12, K)), [
|
|
114
|
+
[P, e.modelValue]
|
|
131
115
|
])
|
|
132
116
|
]));
|
|
133
117
|
}
|
|
134
118
|
});
|
|
135
119
|
export {
|
|
136
|
-
|
|
120
|
+
I as default
|
|
137
121
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FieldType } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
colKey: string;
|
|
4
|
+
colLabel: string;
|
|
5
|
+
fieldType?: FieldType;
|
|
6
|
+
sortOrder?: "asc" | "desc" | null;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
deletable?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
sort: (colKey: string, direction: "asc" | "desc") => any;
|
|
14
|
+
delete: (colKey: string) => any;
|
|
15
|
+
close: () => any;
|
|
16
|
+
rename: (colKey: string, newName: string) => any;
|
|
17
|
+
"change-type": (colKey: string, newType: FieldType) => any;
|
|
18
|
+
hide: (colKey: string) => any;
|
|
19
|
+
duplicate: (colKey: string) => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onSort?: ((colKey: string, direction: "asc" | "desc") => any) | undefined;
|
|
22
|
+
onDelete?: ((colKey: string) => any) | undefined;
|
|
23
|
+
onClose?: (() => any) | undefined;
|
|
24
|
+
onRename?: ((colKey: string, newName: string) => any) | undefined;
|
|
25
|
+
"onChange-type"?: ((colKey: string, newType: FieldType) => any) | undefined;
|
|
26
|
+
onHide?: ((colKey: string) => any) | undefined;
|
|
27
|
+
onDuplicate?: ((colKey: string) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
deletable: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
31
|
+
renameInput: HTMLInputElement;
|
|
32
|
+
}, any>;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { defineComponent as $, ref as y, computed as p, onMounted as w, nextTick as z, openBlock as a, createBlock as B, Teleport as L, createElementBlock as d, withModifiers as E, createElementVNode as l, normalizeStyle as S, withKeys as v, toDisplayString as N, createVNode as u, createCommentVNode as c, unref as r, Fragment as A } from "vue";
|
|
2
|
+
import { ArrowUp as D, ArrowDown as M, EyeOff as P, Copy as V, Trash2 as F } from "lucide-vue-next";
|
|
3
|
+
import I from "./FieldTypePicker.vue.js";
|
|
4
|
+
const O = { class: "of-col-menu__section" }, H = ["value"], R = { class: "of-col-menu__item-value" }, U = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "of-col-menu__sub"
|
|
7
|
+
}, G = /* @__PURE__ */ $({
|
|
8
|
+
__name: "ColumnHeaderMenu",
|
|
9
|
+
props: {
|
|
10
|
+
colKey: {},
|
|
11
|
+
colLabel: {},
|
|
12
|
+
fieldType: {},
|
|
13
|
+
sortOrder: {},
|
|
14
|
+
visible: { type: Boolean },
|
|
15
|
+
x: {},
|
|
16
|
+
y: {},
|
|
17
|
+
deletable: { type: Boolean, default: !0 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["close", "rename", "change-type", "sort", "hide", "delete", "duplicate"],
|
|
20
|
+
setup(s, { emit: b }) {
|
|
21
|
+
const i = s, t = b, f = y(null), m = y(!1), k = {
|
|
22
|
+
text: "文本",
|
|
23
|
+
number: "数字",
|
|
24
|
+
select: "单选",
|
|
25
|
+
multi_select: "多选",
|
|
26
|
+
date: "日期",
|
|
27
|
+
datetime: "日期时间",
|
|
28
|
+
checkbox: "复选框",
|
|
29
|
+
url: "链接",
|
|
30
|
+
email: "邮箱",
|
|
31
|
+
phone: "电话",
|
|
32
|
+
rating: "评分",
|
|
33
|
+
currency: "货币",
|
|
34
|
+
richtext: "富文本",
|
|
35
|
+
auto_number: "自动编号",
|
|
36
|
+
creator: "创建者",
|
|
37
|
+
progress: "进度",
|
|
38
|
+
relation: "关联",
|
|
39
|
+
attachment: "附件",
|
|
40
|
+
formula: "公式",
|
|
41
|
+
user: "用户"
|
|
42
|
+
}, C = p(() => k[i.fieldType ?? ""] ?? i.fieldType ?? "");
|
|
43
|
+
w(() => z(() => {
|
|
44
|
+
var o;
|
|
45
|
+
return (o = f.value) == null ? void 0 : o.select();
|
|
46
|
+
}));
|
|
47
|
+
function T(o) {
|
|
48
|
+
const n = o.target.value.trim();
|
|
49
|
+
n && n !== i.colLabel && t("rename", i.colKey, n), t("close");
|
|
50
|
+
}
|
|
51
|
+
function x(o) {
|
|
52
|
+
t("change-type", i.colKey, o), m.value = !1, t("close");
|
|
53
|
+
}
|
|
54
|
+
function K() {
|
|
55
|
+
t("delete", i.colKey), t("close");
|
|
56
|
+
}
|
|
57
|
+
const g = p(() => {
|
|
58
|
+
const o = {};
|
|
59
|
+
return o.left = `${i.x}px`, o.top = `${i.y}px`, o;
|
|
60
|
+
});
|
|
61
|
+
return (o, e) => (a(), B(L, { to: "body" }, [
|
|
62
|
+
s.visible ? (a(), d("div", {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: "of-col-menu-overlay",
|
|
65
|
+
onClick: e[6] || (e[6] = E((n) => t("close"), ["self"]))
|
|
66
|
+
}, [
|
|
67
|
+
l("div", {
|
|
68
|
+
class: "of-col-menu",
|
|
69
|
+
style: S(g.value)
|
|
70
|
+
}, [
|
|
71
|
+
l("div", O, [
|
|
72
|
+
l("input", {
|
|
73
|
+
ref_key: "renameInput",
|
|
74
|
+
ref: f,
|
|
75
|
+
class: "of-col-menu__rename-input",
|
|
76
|
+
value: s.colLabel,
|
|
77
|
+
placeholder: "字段名称",
|
|
78
|
+
onKeydown: [
|
|
79
|
+
v(T, ["enter"]),
|
|
80
|
+
e[0] || (e[0] = v((n) => t("close"), ["escape"]))
|
|
81
|
+
]
|
|
82
|
+
}, null, 40, H)
|
|
83
|
+
]),
|
|
84
|
+
e[14] || (e[14] = l("div", { class: "of-col-menu__divider" }, null, -1)),
|
|
85
|
+
l("button", {
|
|
86
|
+
class: "of-col-menu__item",
|
|
87
|
+
onClick: e[1] || (e[1] = (n) => m.value = !m.value)
|
|
88
|
+
}, [
|
|
89
|
+
e[7] || (e[7] = l("span", null, "字段类型", -1)),
|
|
90
|
+
l("span", R, N(C.value), 1)
|
|
91
|
+
]),
|
|
92
|
+
m.value ? (a(), d("div", U, [
|
|
93
|
+
u(I, {
|
|
94
|
+
"current-type": s.fieldType,
|
|
95
|
+
onSelect: x
|
|
96
|
+
}, null, 8, ["current-type"])
|
|
97
|
+
])) : c("", !0),
|
|
98
|
+
e[15] || (e[15] = l("div", { class: "of-col-menu__divider" }, null, -1)),
|
|
99
|
+
l("button", {
|
|
100
|
+
class: "of-col-menu__item",
|
|
101
|
+
onClick: e[2] || (e[2] = (n) => {
|
|
102
|
+
t("sort", s.colKey, "asc"), t("close");
|
|
103
|
+
})
|
|
104
|
+
}, [
|
|
105
|
+
u(r(D), { size: 14 }),
|
|
106
|
+
e[8] || (e[8] = l("span", null, "升序排序", -1))
|
|
107
|
+
]),
|
|
108
|
+
l("button", {
|
|
109
|
+
class: "of-col-menu__item",
|
|
110
|
+
onClick: e[3] || (e[3] = (n) => {
|
|
111
|
+
t("sort", s.colKey, "desc"), t("close");
|
|
112
|
+
})
|
|
113
|
+
}, [
|
|
114
|
+
u(r(M), { size: 14 }),
|
|
115
|
+
e[9] || (e[9] = l("span", null, "降序排序", -1))
|
|
116
|
+
]),
|
|
117
|
+
e[16] || (e[16] = l("div", { class: "of-col-menu__divider" }, null, -1)),
|
|
118
|
+
l("button", {
|
|
119
|
+
class: "of-col-menu__item",
|
|
120
|
+
onClick: e[4] || (e[4] = (n) => {
|
|
121
|
+
t("hide", s.colKey), t("close");
|
|
122
|
+
})
|
|
123
|
+
}, [
|
|
124
|
+
u(r(P), { size: 14 }),
|
|
125
|
+
e[10] || (e[10] = l("span", null, "隐藏列", -1))
|
|
126
|
+
]),
|
|
127
|
+
l("button", {
|
|
128
|
+
class: "of-col-menu__item",
|
|
129
|
+
onClick: e[5] || (e[5] = (n) => {
|
|
130
|
+
t("duplicate", s.colKey), t("close");
|
|
131
|
+
})
|
|
132
|
+
}, [
|
|
133
|
+
u(r(V), { size: 14 }),
|
|
134
|
+
e[11] || (e[11] = l("span", null, "复制列", -1))
|
|
135
|
+
]),
|
|
136
|
+
s.deletable ? (a(), d(A, { key: 1 }, [
|
|
137
|
+
e[13] || (e[13] = l("div", { class: "of-col-menu__divider" }, null, -1)),
|
|
138
|
+
l("button", {
|
|
139
|
+
class: "of-col-menu__item of-col-menu__item--danger",
|
|
140
|
+
onClick: K
|
|
141
|
+
}, [
|
|
142
|
+
u(r(F), { size: 14 }),
|
|
143
|
+
e[12] || (e[12] = l("span", null, "删除列", -1))
|
|
144
|
+
])
|
|
145
|
+
], 64)) : c("", !0)
|
|
146
|
+
], 4)
|
|
147
|
+
])) : c("", !0)
|
|
148
|
+
]));
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
export {
|
|
152
|
+
G as default
|
|
153
|
+
};
|