@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
|
@@ -1,86 +1,119 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Plus as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { buildKanbanColumns as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as I, computed as u, ref as g, watch as y, openBlock as d, createElementBlock as s, createElementVNode as k, Fragment as A, renderList as K, createVNode as c, unref as V, createCommentVNode as x } from "vue";
|
|
2
|
+
import { Plus as B } from "lucide-vue-next";
|
|
3
|
+
import S from "./KanbanColumn.vue.js";
|
|
4
|
+
import L from "./QuickAddRow.vue.js";
|
|
5
|
+
import { isSelectField as p, buildKanbanColumns as N } from "../../types/index.js";
|
|
6
|
+
const _ = { class: "of-kanban-board" }, z = { class: "of-kanban-inner" }, j = /* @__PURE__ */ I({
|
|
7
7
|
__name: "KanbanBoard",
|
|
8
8
|
props: {
|
|
9
9
|
columns: { default: () => [] },
|
|
10
10
|
records: { default: () => [] },
|
|
11
|
-
|
|
11
|
+
schema: { default: void 0 },
|
|
12
|
+
view: { default: void 0 },
|
|
13
|
+
kanbanFieldId: { default: void 0 },
|
|
12
14
|
laneOrder: { default: () => [] },
|
|
13
15
|
laneTitles: { default: () => ({}) },
|
|
14
16
|
addColumnVisible: { type: Boolean, default: !1 }
|
|
15
17
|
},
|
|
16
18
|
emits: ["update:columns", "add-column", "card-click"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
kanbanFieldId: n.kanbanFieldId,
|
|
20
|
-
laneOrder: n.laneOrder,
|
|
21
|
-
laneTitles: n.laneTitles
|
|
22
|
-
}) : [], a = w(c());
|
|
23
|
-
A(
|
|
24
|
-
() => [n.columns, n.records, n.kanbanFieldId, n.laneOrder, n.laneTitles],
|
|
19
|
+
setup(f, { emit: b }) {
|
|
20
|
+
const e = f, i = b, r = u(
|
|
25
21
|
() => {
|
|
26
|
-
|
|
22
|
+
var n;
|
|
23
|
+
return e.kanbanFieldId ?? ((n = e.view) == null ? void 0 : n.kanbanFieldId) ?? "status";
|
|
24
|
+
}
|
|
25
|
+
), C = u(() => {
|
|
26
|
+
if (e.laneOrder && e.laneOrder.length > 0) return e.laneOrder;
|
|
27
|
+
if (e.schema) {
|
|
28
|
+
const n = e.schema.fields.find((l) => l.id === r.value);
|
|
29
|
+
if (n && p(n))
|
|
30
|
+
return n.options.map((l) => l.value);
|
|
31
|
+
}
|
|
32
|
+
}), h = u(() => {
|
|
33
|
+
if (e.laneTitles && Object.keys(e.laneTitles).length > 0) return e.laneTitles;
|
|
34
|
+
if (e.schema) {
|
|
35
|
+
const n = e.schema.fields.find((l) => l.id === r.value);
|
|
36
|
+
if (n && p(n)) {
|
|
37
|
+
const l = {};
|
|
38
|
+
for (const t of n.options)
|
|
39
|
+
l[t.value] = t.label;
|
|
40
|
+
return l;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}), m = () => e.columns.length > 0 ? structuredClone(e.columns) : e.records.length > 0 ? N(e.records, {
|
|
44
|
+
kanbanFieldId: r.value,
|
|
45
|
+
laneOrder: C.value,
|
|
46
|
+
laneTitles: h.value
|
|
47
|
+
}) : [], o = g(m());
|
|
48
|
+
y(
|
|
49
|
+
() => [
|
|
50
|
+
e.columns,
|
|
51
|
+
e.records,
|
|
52
|
+
e.kanbanFieldId,
|
|
53
|
+
e.laneOrder,
|
|
54
|
+
e.laneTitles,
|
|
55
|
+
e.view,
|
|
56
|
+
e.schema
|
|
57
|
+
],
|
|
58
|
+
() => {
|
|
59
|
+
o.value = m();
|
|
27
60
|
}
|
|
28
61
|
);
|
|
29
|
-
function
|
|
30
|
-
const l =
|
|
62
|
+
function v(n) {
|
|
63
|
+
const l = o.value.findIndex((t) => t.id === n.id);
|
|
31
64
|
if (l !== -1) {
|
|
32
|
-
const
|
|
33
|
-
...
|
|
34
|
-
status:
|
|
65
|
+
const t = n.tasks.map((a) => ({
|
|
66
|
+
...a,
|
|
67
|
+
status: n.id
|
|
35
68
|
}));
|
|
36
|
-
|
|
69
|
+
o.value[l] = { ...n, tasks: t }, i("update:columns", structuredClone(o.value));
|
|
37
70
|
}
|
|
38
71
|
}
|
|
39
|
-
function
|
|
72
|
+
function T(n) {
|
|
40
73
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
74
|
+
function w(n, l) {
|
|
75
|
+
const t = o.value.find((O) => O.id === n);
|
|
76
|
+
if (!t) return;
|
|
77
|
+
const a = {
|
|
45
78
|
id: `TASK-${Date.now()}`,
|
|
46
79
|
title: l,
|
|
47
|
-
status:
|
|
80
|
+
status: n,
|
|
48
81
|
priority: "P3"
|
|
49
|
-
},
|
|
50
|
-
...
|
|
51
|
-
tasks: [...
|
|
82
|
+
}, F = {
|
|
83
|
+
...t,
|
|
84
|
+
tasks: [...t.tasks, a]
|
|
52
85
|
};
|
|
53
|
-
|
|
86
|
+
v(F);
|
|
54
87
|
}
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
(d(!0), s(
|
|
58
|
-
key:
|
|
88
|
+
return (n, l) => (d(), s("div", _, [
|
|
89
|
+
k("div", z, [
|
|
90
|
+
(d(!0), s(A, null, K(o.value, (t) => (d(), s("div", {
|
|
91
|
+
key: t.id,
|
|
59
92
|
class: "of-kanban-col-wrapper"
|
|
60
93
|
}, [
|
|
61
|
-
|
|
62
|
-
column:
|
|
63
|
-
onAddCard:
|
|
64
|
-
onCardClick: l[0] || (l[0] = (
|
|
65
|
-
"onUpdate:column":
|
|
94
|
+
c(S, {
|
|
95
|
+
column: t,
|
|
96
|
+
onAddCard: T,
|
|
97
|
+
onCardClick: l[0] || (l[0] = (a) => i("card-click", a)),
|
|
98
|
+
"onUpdate:column": v
|
|
66
99
|
}, null, 8, ["column"]),
|
|
67
|
-
|
|
100
|
+
c(L, {
|
|
68
101
|
class: "of-quick-add-below",
|
|
69
|
-
onSubmit: (
|
|
102
|
+
onSubmit: (a) => w(t.id, a)
|
|
70
103
|
}, null, 8, ["onSubmit"])
|
|
71
104
|
]))), 128)),
|
|
72
|
-
|
|
105
|
+
f.addColumnVisible ? (d(), s("button", {
|
|
73
106
|
key: 0,
|
|
74
107
|
class: "of-add-column-btn",
|
|
75
|
-
onClick: l[1] || (l[1] = (
|
|
108
|
+
onClick: l[1] || (l[1] = (t) => i("add-column"))
|
|
76
109
|
}, [
|
|
77
|
-
|
|
78
|
-
l[2] || (l[2] =
|
|
110
|
+
c(V(B), { size: 16 }),
|
|
111
|
+
l[2] || (l[2] = k("span", null, "添加列", -1))
|
|
79
112
|
])) : x("", !0)
|
|
80
113
|
])
|
|
81
114
|
]));
|
|
82
115
|
}
|
|
83
116
|
});
|
|
84
117
|
export {
|
|
85
|
-
|
|
118
|
+
j as default
|
|
86
119
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppLayout.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8488617f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,98 +1,82 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBreakpoint as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as h, provide as l, computed as w, ref as g, onBeforeUnmount as E, openBlock as o, createElementBlock as t, normalizeClass as v, createElementVNode as s, unref as c, createCommentVNode as d, renderSlot as r, Fragment as N } from "vue";
|
|
2
|
+
import { useBreakpoint as T } from "../../composables/useBreakpoint.js";
|
|
3
|
+
import { useFocusTrap as C } from "../../composables/useFocusTrap.js";
|
|
4
|
+
const L = { class: "of-app-layout__navbar" }, $ = ["aria-expanded"], B = { class: "of-app-layout__body" }, R = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "of-app-layout__sidebar"
|
|
6
|
-
},
|
|
7
|
+
}, S = { class: "of-app-layout__main" }, F = { class: "of-app-layout__statusbar" }, O = /* @__PURE__ */ h({
|
|
7
8
|
__name: "AppLayout",
|
|
8
9
|
props: {
|
|
9
10
|
density: { default: "comfortable" }
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
setup(u) {
|
|
13
|
+
const m = u, { isMobile: n, isTablet: y } = T();
|
|
14
|
+
l("isMobile", n), l("isTablet", y), l(
|
|
14
15
|
"density",
|
|
15
|
-
|
|
16
|
+
w(() => m.density)
|
|
16
17
|
);
|
|
17
|
-
const a =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
24
|
-
).filter((e) => !e.closest('[aria-hidden="true"]')) : [];
|
|
25
|
-
}
|
|
26
|
-
function d(e) {
|
|
27
|
-
if (e.key !== "Tab") return;
|
|
28
|
-
const o = b();
|
|
29
|
-
if (o.length === 0) {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const _ = o[0], k = o[o.length - 1];
|
|
34
|
-
e.shiftKey ? document.activeElement === _ && (e.preventDefault(), k.focus()) : document.activeElement === k && (e.preventDefault(), _.focus());
|
|
35
|
-
}
|
|
36
|
-
function L() {
|
|
18
|
+
const a = g(!1), {
|
|
19
|
+
containerRef: _,
|
|
20
|
+
activate: b,
|
|
21
|
+
deactivate: p
|
|
22
|
+
} = C();
|
|
23
|
+
function k() {
|
|
37
24
|
const e = !a.value;
|
|
38
|
-
a.value = e, e ? (
|
|
39
|
-
const o = b();
|
|
40
|
-
o.length && o[0].focus(), document.addEventListener("keydown", d), document.addEventListener("keydown", u);
|
|
41
|
-
})) : (document.removeEventListener("keydown", d), document.removeEventListener("keydown", u), t == null || t.focus(), t = null);
|
|
25
|
+
a.value = e, e ? (b(), document.addEventListener("keydown", i)) : (p(), document.removeEventListener("keydown", i));
|
|
42
26
|
}
|
|
43
|
-
function
|
|
44
|
-
a.value = !1,
|
|
27
|
+
function f() {
|
|
28
|
+
a.value = !1, p(), document.removeEventListener("keydown", i);
|
|
45
29
|
}
|
|
46
|
-
function
|
|
47
|
-
e.key === "Escape" &&
|
|
30
|
+
function i(e) {
|
|
31
|
+
e.key === "Escape" && f();
|
|
48
32
|
}
|
|
49
|
-
return
|
|
50
|
-
document.removeEventListener("keydown",
|
|
51
|
-
}), (e,
|
|
52
|
-
class:
|
|
33
|
+
return E(() => {
|
|
34
|
+
document.removeEventListener("keydown", i);
|
|
35
|
+
}), (e, M) => (o(), t("div", {
|
|
36
|
+
class: v(["of-app-layout", { "of-density-compact": u.density === "compact" }])
|
|
53
37
|
}, [
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
s("header", L, [
|
|
39
|
+
c(n) ? (o(), t("button", {
|
|
56
40
|
key: 0,
|
|
57
41
|
class: "of-app-layout__hamburger",
|
|
58
42
|
"aria-label": "Toggle sidebar",
|
|
59
43
|
"aria-expanded": a.value,
|
|
60
|
-
onClick:
|
|
61
|
-
}, " ☰ ", 8,
|
|
62
|
-
|
|
44
|
+
onClick: k
|
|
45
|
+
}, " ☰ ", 8, $)) : d("", !0),
|
|
46
|
+
r(e.$slots, "navbar", {}, void 0, !0)
|
|
63
47
|
]),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
s("div", B, [
|
|
49
|
+
c(n) ? d("", !0) : (o(), t("aside", R, [
|
|
50
|
+
r(e.$slots, "sidebar", {}, void 0, !0)
|
|
67
51
|
])),
|
|
68
|
-
|
|
69
|
-
a.value ? (
|
|
52
|
+
c(n) ? (o(), t(N, { key: 1 }, [
|
|
53
|
+
a.value ? (o(), t("div", {
|
|
70
54
|
key: 0,
|
|
71
55
|
class: "of-drawer-overlay",
|
|
72
56
|
"aria-hidden": "true",
|
|
73
|
-
onClick:
|
|
74
|
-
})) :
|
|
75
|
-
|
|
57
|
+
onClick: f
|
|
58
|
+
})) : d("", !0),
|
|
59
|
+
s("aside", {
|
|
76
60
|
ref_key: "drawerNavRef",
|
|
77
|
-
ref:
|
|
78
|
-
class:
|
|
61
|
+
ref: _,
|
|
62
|
+
class: v(["of-drawer-sidebar", { "of-drawer-sidebar--open": a.value }]),
|
|
79
63
|
role: "dialog",
|
|
80
64
|
"aria-modal": "true",
|
|
81
65
|
"aria-label": "导航菜单"
|
|
82
66
|
}, [
|
|
83
|
-
|
|
67
|
+
r(e.$slots, "sidebar", {}, void 0, !0)
|
|
84
68
|
], 2)
|
|
85
|
-
], 64)) :
|
|
86
|
-
|
|
87
|
-
|
|
69
|
+
], 64)) : d("", !0),
|
|
70
|
+
s("main", S, [
|
|
71
|
+
r(e.$slots, "default", {}, void 0, !0)
|
|
88
72
|
])
|
|
89
73
|
]),
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
s("footer", F, [
|
|
75
|
+
r(e.$slots, "statusbar", {}, void 0, !0)
|
|
92
76
|
])
|
|
93
77
|
], 2));
|
|
94
78
|
}
|
|
95
79
|
});
|
|
96
80
|
export {
|
|
97
|
-
|
|
81
|
+
O as default
|
|
98
82
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Drawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cf8560a2"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { X as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as p, useSlots as V, computed as _, onMounted as B, watch as x, onBeforeUnmount as z, openBlock as o, createBlock as E, Teleport as S, createVNode as u, Transition as T, withCtx as $, createElementBlock as l, normalizeStyle as f, createElementVNode as d, withModifiers as I, unref as c, renderSlot as m, toDisplayString as N, createCommentVNode as n } from "vue";
|
|
2
|
+
import { X as R } from "lucide-vue-next";
|
|
3
|
+
import { useFocusTrap as g } from "../../composables/useFocusTrap.js";
|
|
4
|
+
const D = ["aria-label"], L = { class: "of-drawer__inner" }, M = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "of-drawer__header"
|
|
6
|
-
},
|
|
7
|
+
}, F = { class: "of-drawer__title" }, K = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "of-drawer__title-text"
|
|
9
|
-
},
|
|
10
|
+
}, U = { class: "of-drawer__body" }, G = /* @__PURE__ */ p({
|
|
10
11
|
__name: "Drawer",
|
|
11
12
|
props: {
|
|
12
13
|
modelValue: { type: Boolean },
|
|
@@ -17,90 +18,73 @@ const R = ["aria-label"], q = { class: "of-drawer__inner" }, F = {
|
|
|
17
18
|
zIndex: { default: 1e3 }
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:modelValue"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
width: `${
|
|
23
|
-
})),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
).filter((e) => !e.closest('[aria-hidden="true"]')) : [];
|
|
21
|
+
setup(e, { emit: y }) {
|
|
22
|
+
const r = e, w = y, v = V(), h = _(() => ({
|
|
23
|
+
width: `${r.width}px`
|
|
24
|
+
})), {
|
|
25
|
+
containerRef: k,
|
|
26
|
+
activate: C,
|
|
27
|
+
deactivate: b
|
|
28
|
+
} = g();
|
|
29
|
+
function i() {
|
|
30
|
+
w("update:modelValue", !1);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
const t = m();
|
|
35
|
-
if (t.length === 0) {
|
|
36
|
-
e.preventDefault();
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const c = t[0], w = t[t.length - 1];
|
|
40
|
-
e.shiftKey ? document.activeElement === c && (e.preventDefault(), w.focus()) : document.activeElement === w && (e.preventDefault(), c.focus());
|
|
32
|
+
function s(t) {
|
|
33
|
+
t.key === "Escape" && r.modelValue && i();
|
|
41
34
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return S(() => {
|
|
49
|
-
typeof document > "u" || document.addEventListener("keydown", y);
|
|
50
|
-
}), z(
|
|
51
|
-
() => i.modelValue,
|
|
52
|
-
(e) => {
|
|
53
|
-
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "", e ? (n = document.activeElement, D(() => {
|
|
54
|
-
const t = m();
|
|
55
|
-
t.length && t[0].focus(), document.addEventListener("keydown", u);
|
|
56
|
-
})) : (document.removeEventListener("keydown", u), n == null || n.focus(), n = null));
|
|
35
|
+
return B(() => {
|
|
36
|
+
typeof document > "u" || document.addEventListener("keydown", s);
|
|
37
|
+
}), x(
|
|
38
|
+
() => r.modelValue,
|
|
39
|
+
(t) => {
|
|
40
|
+
typeof document > "u" || (document.body.style.overflow = t ? "hidden" : "", t ? C() : b());
|
|
57
41
|
},
|
|
58
42
|
{ immediate: !0 }
|
|
59
|
-
),
|
|
60
|
-
typeof document > "u" || (document.removeEventListener("keydown",
|
|
61
|
-
}), (
|
|
62
|
-
|
|
63
|
-
default:
|
|
64
|
-
|
|
43
|
+
), z(() => {
|
|
44
|
+
typeof document > "u" || (document.removeEventListener("keydown", s), document.body.style.overflow = "");
|
|
45
|
+
}), (t, a) => (o(), E(S, { to: "body" }, [
|
|
46
|
+
u(T, { name: "of-drawer" }, {
|
|
47
|
+
default: $(() => [
|
|
48
|
+
e.modelValue ? (o(), l("div", {
|
|
65
49
|
key: 0,
|
|
66
50
|
class: "of-drawer-overlay",
|
|
67
|
-
style:
|
|
68
|
-
onClick:
|
|
51
|
+
style: f({ zIndex: e.zIndex }),
|
|
52
|
+
onClick: a[1] || (a[1] = (X) => e.maskClosable && i())
|
|
69
53
|
}, [
|
|
70
|
-
|
|
54
|
+
d("aside", {
|
|
71
55
|
ref_key: "drawerRef",
|
|
72
|
-
ref:
|
|
56
|
+
ref: k,
|
|
73
57
|
class: "of-drawer",
|
|
74
58
|
role: "dialog",
|
|
75
59
|
"aria-modal": "true",
|
|
76
|
-
"aria-label":
|
|
77
|
-
style:
|
|
78
|
-
onClick:
|
|
60
|
+
"aria-label": e.title,
|
|
61
|
+
style: f(h.value),
|
|
62
|
+
onClick: a[0] || (a[0] = I(() => {
|
|
79
63
|
}, ["stop"]))
|
|
80
64
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
65
|
+
d("div", L, [
|
|
66
|
+
c(v).title || e.title || e.showClose ? (o(), l("div", M, [
|
|
67
|
+
d("div", F, [
|
|
68
|
+
m(t.$slots, "title", {}, () => [
|
|
69
|
+
e.title ? (o(), l("h3", K, N(e.title), 1)) : n("", !0)
|
|
86
70
|
], !0)
|
|
87
71
|
]),
|
|
88
|
-
|
|
72
|
+
e.showClose ? (o(), l("button", {
|
|
89
73
|
key: 0,
|
|
90
74
|
class: "of-drawer__close",
|
|
91
75
|
type: "button",
|
|
92
76
|
"aria-label": "关闭",
|
|
93
|
-
onClick:
|
|
77
|
+
onClick: i
|
|
94
78
|
}, [
|
|
95
|
-
|
|
96
|
-
])) :
|
|
97
|
-
])) :
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
u(c(R), { size: 18 })
|
|
80
|
+
])) : n("", !0)
|
|
81
|
+
])) : n("", !0),
|
|
82
|
+
d("div", U, [
|
|
83
|
+
m(t.$slots, "default", {}, void 0, !0)
|
|
100
84
|
])
|
|
101
85
|
])
|
|
102
|
-
], 12,
|
|
103
|
-
], 4)) :
|
|
86
|
+
], 12, D)
|
|
87
|
+
], 4)) : n("", !0)
|
|
104
88
|
]),
|
|
105
89
|
_: 3
|
|
106
90
|
})
|
|
@@ -108,5 +92,5 @@ const R = ["aria-label"], q = { class: "of-drawer__inner" }, F = {
|
|
|
108
92
|
}
|
|
109
93
|
});
|
|
110
94
|
export {
|
|
111
|
-
|
|
95
|
+
G as default
|
|
112
96
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Modal.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-98fd9016"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|