@oneflowui/ui 0.6.0 → 0.8.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/dist/components/Dashboard/index.vue.d.ts +3 -1
- package/dist/components/Dashboard/index.vue.js +2 -2
- package/dist/components/Dashboard/index.vue2.js +59 -30
- package/dist/components/database/DatabaseView.vue.js +4 -4
- package/dist/components/database/DatabaseView.vue2.js +597 -442
- package/dist/components/detail/DetailLayout.vue.d.ts +12 -1
- package/dist/components/detail/DetailLayout.vue.js +2 -2
- package/dist/components/detail/DetailLayout.vue2.js +115 -68
- package/dist/components/gallery/GalleryView.vue.d.ts +3 -1
- package/dist/components/gallery/GalleryView.vue.js +2 -2
- package/dist/components/gallery/GalleryView.vue2.js +51 -27
- package/dist/components/overlay/Drawer.vue.d.ts +10 -0
- package/dist/components/overlay/Drawer.vue.js +1 -1
- package/dist/components/overlay/Drawer.vue2.js +74 -48
- package/dist/components/overlay/SidePanel.vue.d.ts +8 -0
- package/dist/components/overlay/SidePanel.vue.js +2 -2
- package/dist/components/overlay/SidePanel.vue2.js +97 -65
- package/dist/components/table/DataTable.vue.d.ts +32 -2
- package/dist/components/table/DataTable.vue.js +3 -3
- package/dist/components/table/DataTable.vue2.js +751 -609
- package/dist/components/table/FieldCell.vue.js +2 -2
- package/dist/components/table/FieldCell.vue2.js +26 -24
- package/dist/components/table/TableDataRow.vue.d.ts +19 -0
- package/dist/components/table/TableDataRow.vue.js +3 -3
- package/dist/components/table/TableDataRow.vue2.js +110 -73
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Task, CommentData, PropItem } from '../../types';
|
|
2
|
+
type DetailLayoutState = "ready" | "loading" | "empty" | "error";
|
|
2
3
|
type __VLS_Props = {
|
|
3
|
-
task
|
|
4
|
+
task?: Task | null;
|
|
5
|
+
title?: string;
|
|
4
6
|
comments?: CommentData[];
|
|
5
7
|
propItems?: PropItem[];
|
|
6
8
|
descriptionContent?: string;
|
|
7
9
|
descriptionEditable?: boolean;
|
|
10
|
+
state?: DetailLayoutState;
|
|
11
|
+
stateTitle?: string;
|
|
12
|
+
stateDescription?: string;
|
|
8
13
|
};
|
|
9
14
|
declare function __VLS_template(): {
|
|
10
15
|
attrs: Partial<{}>;
|
|
@@ -12,6 +17,7 @@ declare function __VLS_template(): {
|
|
|
12
17
|
meta?(_: {}): any;
|
|
13
18
|
description?(_: {}): any;
|
|
14
19
|
comments?(_: {}): any;
|
|
20
|
+
footer?(_: {}): any;
|
|
15
21
|
props?(_: {}): any;
|
|
16
22
|
};
|
|
17
23
|
refs: {};
|
|
@@ -23,10 +29,15 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
23
29
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
30
|
"onUpdate:descriptionContent"?: ((value: string) => any) | undefined;
|
|
25
31
|
}>, {
|
|
32
|
+
title: string;
|
|
33
|
+
task: Task | null;
|
|
26
34
|
comments: CommentData[];
|
|
27
35
|
propItems: PropItem[];
|
|
28
36
|
descriptionContent: string;
|
|
29
37
|
descriptionEditable: boolean;
|
|
38
|
+
state: DetailLayoutState;
|
|
39
|
+
stateTitle: string;
|
|
40
|
+
stateDescription: string;
|
|
30
41
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
31
42
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
32
43
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DetailLayout.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-c18fe8bd"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,34 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as T, computed as s, openBlock as o, createElementBlock as r, createElementVNode as a, toDisplayString as i, Fragment as c, normalizeStyle as k, createCommentVNode as n, renderSlot as d, createBlock as p, resolveDynamicComponent as E, createVNode as N, unref as V, renderList as z } from "vue";
|
|
2
|
+
import { Loader2 as A, AlertCircle as M, Inbox as R } from "lucide-vue-next";
|
|
3
|
+
import U from "./PropPanel.vue.js";
|
|
4
|
+
import F from "./CommentItem.vue.js";
|
|
5
|
+
import j from "../editor/ContentBlock.vue.js";
|
|
6
|
+
const q = { class: "detail-layout" }, w = { class: "detail-layout__main" }, G = { class: "detail-layout__title" }, H = { class: "detail-layout__meta" }, J = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "detail-layout__badge detail-layout__badge--role"
|
|
8
|
-
},
|
|
9
|
+
}, K = {
|
|
9
10
|
key: 1,
|
|
10
11
|
class: "detail-layout__meta-text"
|
|
11
|
-
},
|
|
12
|
+
}, O = ["data-role"], Q = { class: "detail-layout__state-copy" }, W = { class: "detail-layout__state-title" }, X = { class: "detail-layout__state-description" }, Y = { class: "detail-layout__section" }, Z = { class: "detail-layout__description" }, tt = {
|
|
12
13
|
key: 0,
|
|
13
14
|
class: "detail-layout__desc-placeholder"
|
|
14
|
-
},
|
|
15
|
+
}, et = { class: "detail-layout__section" }, ot = { class: "detail-layout__comments" }, at = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "detail-layout__comment-list"
|
|
17
|
-
},
|
|
18
|
+
}, st = {
|
|
18
19
|
key: 1,
|
|
19
20
|
class: "detail-layout__empty-hint"
|
|
20
|
-
},
|
|
21
|
+
}, rt = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "detail-layout__footer"
|
|
24
|
+
}, lt = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "detail-layout__sidebar"
|
|
27
|
+
}, pt = /* @__PURE__ */ T({
|
|
21
28
|
__name: "DetailLayout",
|
|
22
29
|
props: {
|
|
23
|
-
task: {},
|
|
30
|
+
task: { default: null },
|
|
31
|
+
title: { default: "" },
|
|
24
32
|
comments: { default: () => [] },
|
|
25
33
|
propItems: { default: () => [] },
|
|
26
34
|
descriptionContent: { default: "" },
|
|
27
|
-
descriptionEditable: { type: Boolean, default: !1 }
|
|
35
|
+
descriptionEditable: { type: Boolean, default: !1 },
|
|
36
|
+
state: { default: "ready" },
|
|
37
|
+
stateTitle: { default: "" },
|
|
38
|
+
stateDescription: { default: "" }
|
|
28
39
|
},
|
|
29
40
|
emits: ["update:descriptionContent"],
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
41
|
+
setup(l, { emit: x }) {
|
|
42
|
+
const t = l, h = x, C = s(() => {
|
|
43
|
+
var e;
|
|
44
|
+
return t.title || ((e = t.task) == null ? void 0 : e.title) || "未命名工作区";
|
|
45
|
+
}), y = s(() => t.state === "ready"), D = s(() => t.state === "loading" ? A : t.state === "error" ? M : R), L = s(() => t.stateTitle ? t.stateTitle : t.state === "loading" ? "正在准备工作区" : t.state === "error" ? "工作区加载失败" : t.state === "empty" ? "暂无详情内容" : ""), $ = s(() => t.stateDescription ? t.stateDescription : t.state === "loading" ? "请稍候,当前记录的详情数据正在整理。" : t.state === "error" ? "暂时无法展示当前详情,请稍后重试。" : t.state === "empty" ? "当前记录还没有可展示的描述、属性或活动记录。" : ""), _ = s(() => t.task ? {
|
|
32
46
|
todo: { text: "var(--of-status-todo-text)", bg: "var(--of-status-todo-bg)" },
|
|
33
47
|
in_progress: {
|
|
34
48
|
text: "var(--of-status-in-progress-text)",
|
|
@@ -36,83 +50,116 @@ const E = { class: "detail-layout" }, D = { class: "detail-layout__main" }, L =
|
|
|
36
50
|
},
|
|
37
51
|
blocked: { text: "var(--of-status-blocked-text)", bg: "var(--of-status-blocked-bg)" },
|
|
38
52
|
done: { text: "var(--of-status-done-text)", bg: "var(--of-status-done-bg)" }
|
|
39
|
-
}
|
|
53
|
+
}[t.task.status] ?? {
|
|
54
|
+
text: "var(--of-color-text-secondary)",
|
|
55
|
+
bg: "var(--of-color-gray-100)"
|
|
56
|
+
} : {
|
|
40
57
|
text: "var(--of-color-text-secondary)",
|
|
41
58
|
bg: "var(--of-color-gray-100)"
|
|
42
|
-
}),
|
|
59
|
+
}), f = s(() => t.task ? {
|
|
43
60
|
P0: { text: "var(--of-priority-p0-text)", bg: "var(--of-priority-p0-bg)" },
|
|
44
61
|
P1: { text: "var(--of-priority-p1-text)", bg: "var(--of-priority-p1-bg)" },
|
|
45
62
|
P2: { text: "var(--of-priority-p2-text)", bg: "var(--of-priority-p2-bg)" },
|
|
46
63
|
P3: { text: "var(--of-priority-p3-text)", bg: "var(--of-priority-p3-bg)" }
|
|
47
|
-
}
|
|
64
|
+
}[t.task.priority] ?? {
|
|
48
65
|
text: "var(--of-color-text-secondary)",
|
|
49
66
|
bg: "var(--of-color-gray-100)"
|
|
50
|
-
}
|
|
67
|
+
} : {
|
|
68
|
+
text: "var(--of-color-text-secondary)",
|
|
69
|
+
bg: "var(--of-color-gray-100)"
|
|
70
|
+
}), B = s(() => t.task ? {
|
|
51
71
|
todo: "待处理",
|
|
52
72
|
in_progress: "进行中",
|
|
53
73
|
blocked: "阻塞",
|
|
54
74
|
done: "已完成"
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
75
|
+
}[t.task.status] ?? t.task.status : ""), I = s(() => t.task ? B.value : ""), P = s(() => t.task ? t.task.priority : ""), v = s(() => {
|
|
76
|
+
var e;
|
|
77
|
+
return ((e = t.task) == null ? void 0 : e.role) ?? "";
|
|
78
|
+
}), m = s(() => {
|
|
79
|
+
var e;
|
|
80
|
+
return ((e = t.task) == null ? void 0 : e.assignee) ?? "";
|
|
81
|
+
}), g = s(() => {
|
|
82
|
+
var e;
|
|
83
|
+
return t.descriptionContent || ((e = t.task) == null ? void 0 : e.description) || "";
|
|
84
|
+
});
|
|
85
|
+
function S(e) {
|
|
86
|
+
h("update:descriptionContent", e);
|
|
58
87
|
}
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
return (e, u) => (o(), r("div", q, [
|
|
89
|
+
a("div", w, [
|
|
90
|
+
a("h1", G, i(C.value), 1),
|
|
91
|
+
a("div", H, [
|
|
92
|
+
t.task && !e.$slots.meta ? (o(), r(c, { key: 0 }, [
|
|
93
|
+
a("span", {
|
|
65
94
|
class: "detail-layout__badge",
|
|
66
|
-
style:
|
|
67
|
-
}, i(
|
|
68
|
-
|
|
95
|
+
style: k({ color: _.value.text, backgroundColor: _.value.bg })
|
|
96
|
+
}, i(I.value), 5),
|
|
97
|
+
a("span", {
|
|
69
98
|
class: "detail-layout__badge",
|
|
70
|
-
style:
|
|
71
|
-
}, i(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
], 64)),
|
|
75
|
-
|
|
76
|
-
]),
|
|
77
|
-
e("div", U, [
|
|
78
|
-
n[0] || (n[0] = e("div", { class: "detail-layout__section-title" }, "描述", -1)),
|
|
79
|
-
e("div", z, [
|
|
80
|
-
c(o.$slots, "description", {}, () => [
|
|
81
|
-
C(B($), {
|
|
82
|
-
content: p.value,
|
|
83
|
-
editable: t.descriptionEditable,
|
|
84
|
-
"onUpdate:content": x
|
|
85
|
-
}, null, 8, ["content", "editable"]),
|
|
86
|
-
p.value ? r("", !0) : (s(), a("p", F, "暂无描述"))
|
|
87
|
-
], !0)
|
|
88
|
-
])
|
|
99
|
+
style: k({ color: f.value.text, backgroundColor: f.value.bg })
|
|
100
|
+
}, i(P.value), 5),
|
|
101
|
+
v.value ? (o(), r("span", J, i(v.value), 1)) : n("", !0),
|
|
102
|
+
m.value ? (o(), r("span", K, i(m.value), 1)) : n("", !0)
|
|
103
|
+
], 64)) : n("", !0),
|
|
104
|
+
d(e.$slots, "meta", {}, void 0, !0)
|
|
89
105
|
]),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
y.value ? (o(), r(c, { key: 1 }, [
|
|
107
|
+
a("div", Y, [
|
|
108
|
+
u[0] || (u[0] = a("div", { class: "detail-layout__section-title" }, "描述", -1)),
|
|
109
|
+
a("div", Z, [
|
|
110
|
+
d(e.$slots, "description", {}, () => [
|
|
111
|
+
N(V(j), {
|
|
112
|
+
content: g.value,
|
|
113
|
+
editable: l.descriptionEditable,
|
|
114
|
+
"onUpdate:content": S
|
|
115
|
+
}, null, 8, ["content", "editable"]),
|
|
116
|
+
g.value ? n("", !0) : (o(), r("p", tt, "暂无描述"))
|
|
117
|
+
], !0)
|
|
118
|
+
])
|
|
119
|
+
]),
|
|
120
|
+
a("div", et, [
|
|
121
|
+
u[1] || (u[1] = a("div", { class: "detail-layout__section-title" }, "活动记录", -1)),
|
|
122
|
+
a("div", ot, [
|
|
123
|
+
d(e.$slots, "comments", {}, () => [
|
|
124
|
+
l.comments && l.comments.length > 0 ? (o(), r("div", at, [
|
|
125
|
+
(o(!0), r(c, null, z(l.comments, (b) => (o(), p(F, {
|
|
126
|
+
key: b.id,
|
|
127
|
+
comment: b
|
|
128
|
+
}, null, 8, ["comment"]))), 128))
|
|
129
|
+
])) : (o(), r("p", st, "暂无活动记录"))
|
|
130
|
+
], !0)
|
|
131
|
+
])
|
|
132
|
+
]),
|
|
133
|
+
e.$slots.footer ? (o(), r("div", rt, [
|
|
134
|
+
d(e.$slots, "footer", {}, void 0, !0)
|
|
135
|
+
])) : n("", !0)
|
|
136
|
+
], 64)) : (o(), r("div", {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "detail-layout__state",
|
|
139
|
+
"data-role": `detail-state-${t.state}`
|
|
140
|
+
}, [
|
|
141
|
+
(o(), p(E(D.value), {
|
|
142
|
+
class: "detail-layout__state-icon",
|
|
143
|
+
size: 20
|
|
144
|
+
})),
|
|
145
|
+
a("div", Q, [
|
|
146
|
+
a("div", W, i(L.value), 1),
|
|
147
|
+
a("p", X, i($.value), 1)
|
|
101
148
|
])
|
|
102
|
-
])
|
|
149
|
+
], 8, O))
|
|
103
150
|
]),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
151
|
+
y.value ? (o(), r("div", lt, [
|
|
152
|
+
d(e.$slots, "props", {}, () => [
|
|
153
|
+
l.propItems && l.propItems.length > 0 ? (o(), p(U, {
|
|
107
154
|
key: 0,
|
|
108
|
-
items:
|
|
155
|
+
items: l.propItems,
|
|
109
156
|
title: "属性"
|
|
110
|
-
}, null, 8, ["items"])) :
|
|
157
|
+
}, null, 8, ["items"])) : n("", !0)
|
|
111
158
|
], !0)
|
|
112
|
-
])
|
|
159
|
+
])) : n("", !0)
|
|
113
160
|
]));
|
|
114
161
|
}
|
|
115
162
|
});
|
|
116
163
|
export {
|
|
117
|
-
|
|
164
|
+
pt as default
|
|
118
165
|
};
|
|
@@ -24,5 +24,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
24
24
|
schema: TableSchema;
|
|
25
25
|
coverFieldId: string;
|
|
26
26
|
cardFieldIds: string[];
|
|
27
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
27
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
28
|
+
galleryRef: HTMLDivElement;
|
|
29
|
+
}, HTMLDivElement>;
|
|
28
30
|
export default _default;
|
|
@@ -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-047984a4"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import
|
|
4
|
-
import { buildGalleryItems as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as k, ref as p, computed as d, onMounted as M, onBeforeUnmount as _, openBlock as a, createElementBlock as s, normalizeStyle as B, Fragment as R, renderList as x, createBlock as G, createVNode as V, unref as z, createElementVNode as N, createCommentVNode as S } from "vue";
|
|
2
|
+
import { PlusIcon as E } from "lucide-vue-next";
|
|
3
|
+
import W from "./GalleryCard.vue.js";
|
|
4
|
+
import { buildGalleryItems as $ } from "../../types/index.js";
|
|
5
|
+
const j = /* @__PURE__ */ k({
|
|
6
6
|
__name: "GalleryView",
|
|
7
7
|
props: {
|
|
8
8
|
items: { default: () => [] },
|
|
@@ -15,44 +15,68 @@ const S = /* @__PURE__ */ g({
|
|
|
15
15
|
addable: { type: Boolean, default: !0 }
|
|
16
16
|
},
|
|
17
17
|
emits: ["card-click", "add"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
setup(c, { emit: w }) {
|
|
19
|
+
const t = c, v = w, i = p(null), o = p(0);
|
|
20
|
+
let n = null;
|
|
21
|
+
const h = d(() => Math.max(1, Math.floor(t.columns))), f = d(() => {
|
|
22
|
+
const e = o.value, l = h.value;
|
|
23
|
+
return e ? e < 520 ? 1 : e < 820 ? Math.min(l, 2) : e < 1120 ? Math.min(l, 3) : l : l;
|
|
24
|
+
}), F = d(() => ({
|
|
25
|
+
"--gallery-columns": String(f.value),
|
|
26
|
+
"--gallery-card-min-width": f.value <= 1 ? "0px" : "220px"
|
|
27
|
+
}));
|
|
28
|
+
function m(e) {
|
|
29
|
+
var l;
|
|
30
|
+
if (e) {
|
|
31
|
+
o.value = Math.round(e.contentRect.width);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
o.value = Math.round(((l = i.value) == null ? void 0 : l.getBoundingClientRect().width) ?? 0);
|
|
35
|
+
}
|
|
36
|
+
M(() => {
|
|
37
|
+
m(), !(typeof ResizeObserver > "u" || !i.value) && (n = new ResizeObserver((e) => {
|
|
38
|
+
e[0] && m(e[0]);
|
|
39
|
+
}), n.observe(i.value));
|
|
40
|
+
}), _(() => {
|
|
41
|
+
n == null || n.disconnect(), n = null;
|
|
42
|
+
});
|
|
43
|
+
const y = d(
|
|
22
44
|
() => {
|
|
23
|
-
var
|
|
24
|
-
return
|
|
45
|
+
var e;
|
|
46
|
+
return t.coverFieldId || ((e = t.view) == null ? void 0 : e.galleryCoverFieldId) || "";
|
|
25
47
|
}
|
|
26
|
-
),
|
|
27
|
-
var
|
|
28
|
-
return (
|
|
29
|
-
}),
|
|
30
|
-
coverFieldId:
|
|
31
|
-
cardFieldIds:
|
|
48
|
+
), C = d(() => {
|
|
49
|
+
var e, l, r, u, g;
|
|
50
|
+
return (e = t.cardFieldIds) != null && e.length ? t.cardFieldIds : (r = (l = t.view) == null ? void 0 : l.galleryCardFields) != null && r.length ? t.view.galleryCardFields : (g = (u = t.view) == null ? void 0 : u.visibleFields) != null && g.length ? t.view.visibleFields.filter((b) => b !== y.value) : [];
|
|
51
|
+
}), I = d(() => t.items.length > 0 ? t.items : t.records.length > 0 ? $(t.records, {
|
|
52
|
+
coverFieldId: y.value || void 0,
|
|
53
|
+
cardFieldIds: C.value
|
|
32
54
|
}) : []);
|
|
33
|
-
return (
|
|
55
|
+
return (e, l) => (a(), s("div", {
|
|
56
|
+
ref_key: "galleryRef",
|
|
57
|
+
ref: i,
|
|
34
58
|
class: "gallery-view",
|
|
35
|
-
style:
|
|
59
|
+
style: B(F.value)
|
|
36
60
|
}, [
|
|
37
|
-
(
|
|
61
|
+
(a(!0), s(R, null, x(I.value, (r) => (a(), G(W, {
|
|
38
62
|
key: r.id,
|
|
39
63
|
item: r,
|
|
40
|
-
onClick: (
|
|
64
|
+
onClick: (u) => v("card-click", r)
|
|
41
65
|
}, null, 8, ["item", "onClick"]))), 128)),
|
|
42
|
-
|
|
66
|
+
c.addable ? (a(), s("button", {
|
|
43
67
|
key: 0,
|
|
44
68
|
class: "gallery-view__add-btn",
|
|
45
|
-
onClick: l[0] || (l[0] = (r) =>
|
|
69
|
+
onClick: l[0] || (l[0] = (r) => v("add"))
|
|
46
70
|
}, [
|
|
47
|
-
|
|
71
|
+
V(z(E), {
|
|
48
72
|
size: 18,
|
|
49
73
|
class: "gallery-view__add-icon"
|
|
50
74
|
}),
|
|
51
|
-
l[1] || (l[1] =
|
|
52
|
-
])) :
|
|
75
|
+
l[1] || (l[1] = N("span", { class: "gallery-view__add-label" }, "添加", -1))
|
|
76
|
+
])) : S("", !0)
|
|
53
77
|
], 4));
|
|
54
78
|
}
|
|
55
79
|
});
|
|
56
80
|
export {
|
|
57
|
-
|
|
81
|
+
j as default
|
|
58
82
|
};
|
|
@@ -5,6 +5,10 @@ type __VLS_Props = {
|
|
|
5
5
|
showClose?: boolean;
|
|
6
6
|
maskClosable?: boolean;
|
|
7
7
|
zIndex?: number;
|
|
8
|
+
fullscreen?: boolean;
|
|
9
|
+
resizable?: boolean;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
maxWidth?: number;
|
|
8
12
|
};
|
|
9
13
|
declare function __VLS_template(): {
|
|
10
14
|
attrs: Partial<{}>;
|
|
@@ -20,14 +24,20 @@ declare function __VLS_template(): {
|
|
|
20
24
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
25
|
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
26
|
"update:modelValue": (value: boolean) => any;
|
|
27
|
+
"update:width": (value: number) => any;
|
|
23
28
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
29
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
"onUpdate:width"?: ((value: number) => any) | undefined;
|
|
25
31
|
}>, {
|
|
26
32
|
title: string;
|
|
27
33
|
width: number;
|
|
34
|
+
fullscreen: boolean;
|
|
35
|
+
maxWidth: number;
|
|
36
|
+
minWidth: number;
|
|
28
37
|
zIndex: number;
|
|
29
38
|
maskClosable: boolean;
|
|
30
39
|
showClose: boolean;
|
|
40
|
+
resizable: boolean;
|
|
31
41
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
32
42
|
drawerRef: HTMLElement;
|
|
33
43
|
}, any>;
|
|
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c40443d8"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { X as
|
|
3
|
-
import { useFocusTrap as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as V, useSlots as _, computed as W, onMounted as L, watch as S, onBeforeUnmount as M, openBlock as n, createBlock as T, Teleport as R, createVNode as c, Transition as D, withCtx as I, createElementBlock as a, normalizeStyle as m, createCommentVNode as l, createElementVNode as r, withModifiers as N, normalizeClass as P, unref as w, renderSlot as y, toDisplayString as $ } from "vue";
|
|
2
|
+
import { X as g } from "lucide-vue-next";
|
|
3
|
+
import { useFocusTrap as U } from "../../composables/useFocusTrap.js";
|
|
4
|
+
const X = ["aria-label"], F = { class: "of-drawer__inner" }, K = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "of-drawer__header"
|
|
7
|
-
},
|
|
7
|
+
}, j = { class: "of-drawer__title" }, q = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "of-drawer__title-text"
|
|
10
|
-
},
|
|
10
|
+
}, A = { class: "of-drawer__body" }, O = /* @__PURE__ */ V({
|
|
11
11
|
__name: "Drawer",
|
|
12
12
|
props: {
|
|
13
13
|
modelValue: { type: Boolean },
|
|
@@ -15,81 +15,107 @@ const D = ["aria-label"], L = { class: "of-drawer__inner" }, M = {
|
|
|
15
15
|
title: { default: void 0 },
|
|
16
16
|
showClose: { type: Boolean, default: !0 },
|
|
17
17
|
maskClosable: { type: Boolean, default: !0 },
|
|
18
|
-
zIndex: { default: 1e3 }
|
|
18
|
+
zIndex: { default: 1e3 },
|
|
19
|
+
fullscreen: { type: Boolean, default: !1 },
|
|
20
|
+
resizable: { type: Boolean, default: !1 },
|
|
21
|
+
minWidth: { default: 360 },
|
|
22
|
+
maxWidth: { default: 1320 }
|
|
19
23
|
},
|
|
20
|
-
emits: ["update:modelValue"],
|
|
21
|
-
setup(e, { emit:
|
|
22
|
-
const
|
|
23
|
-
width: `${
|
|
24
|
+
emits: ["update:modelValue", "update:width"],
|
|
25
|
+
setup(e, { emit: h }) {
|
|
26
|
+
const o = e, s = h, v = _(), b = W(() => ({
|
|
27
|
+
"--of-drawer-width": `${o.width}px`
|
|
24
28
|
})), {
|
|
25
|
-
containerRef:
|
|
26
|
-
activate:
|
|
29
|
+
containerRef: p,
|
|
30
|
+
activate: k,
|
|
27
31
|
deactivate: C
|
|
28
|
-
} =
|
|
29
|
-
function
|
|
30
|
-
|
|
32
|
+
} = U();
|
|
33
|
+
function i() {
|
|
34
|
+
s("update:modelValue", !1);
|
|
31
35
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
36
|
+
function z(t) {
|
|
37
|
+
return Math.max(o.minWidth, Math.min(o.maxWidth, t));
|
|
34
38
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
+
function u(t) {
|
|
40
|
+
t.key === "Escape" && o.modelValue && i();
|
|
41
|
+
}
|
|
42
|
+
L(() => {
|
|
43
|
+
typeof document > "u" || document.addEventListener("keydown", u);
|
|
44
|
+
}), S(
|
|
45
|
+
() => o.modelValue,
|
|
39
46
|
(t) => {
|
|
40
|
-
typeof document > "u" || (document.body.style.overflow = t ? "hidden" : "", t ?
|
|
47
|
+
typeof document > "u" || (document.body.style.overflow = t ? "hidden" : "", t ? k() : C());
|
|
41
48
|
},
|
|
42
49
|
{ immediate: !0 }
|
|
43
|
-
),
|
|
44
|
-
typeof document > "u" || (document.removeEventListener("keydown",
|
|
45
|
-
})
|
|
46
|
-
|
|
50
|
+
), M(() => {
|
|
51
|
+
typeof document > "u" || (document.removeEventListener("keydown", u), document.body.style.overflow = "");
|
|
52
|
+
});
|
|
53
|
+
function x(t) {
|
|
54
|
+
if (!o.resizable || o.fullscreen || typeof window > "u") return;
|
|
55
|
+
t.preventDefault();
|
|
56
|
+
const d = (B) => {
|
|
57
|
+
const E = z(window.innerWidth - B.clientX);
|
|
58
|
+
s("update:width", E);
|
|
59
|
+
}, f = () => {
|
|
60
|
+
window.removeEventListener("pointermove", d), window.removeEventListener("pointerup", f);
|
|
61
|
+
};
|
|
62
|
+
window.addEventListener("pointermove", d), window.addEventListener("pointerup", f, { once: !0 });
|
|
63
|
+
}
|
|
64
|
+
return (t, d) => (n(), T(R, { to: "body" }, [
|
|
65
|
+
c(D, { name: "of-drawer" }, {
|
|
47
66
|
default: I(() => [
|
|
48
|
-
e.modelValue ? (
|
|
67
|
+
e.modelValue ? (n(), a("div", {
|
|
49
68
|
key: 0,
|
|
50
69
|
class: "of-drawer-overlay",
|
|
51
|
-
style:
|
|
70
|
+
style: m({ zIndex: e.zIndex })
|
|
52
71
|
}, [
|
|
53
|
-
e.maskClosable ? (
|
|
72
|
+
e.maskClosable ? (n(), a("button", {
|
|
54
73
|
key: 0,
|
|
55
74
|
type: "button",
|
|
56
75
|
class: "of-drawer-overlay__hitarea",
|
|
57
76
|
"aria-label": "关闭抽屉",
|
|
58
|
-
onClick:
|
|
77
|
+
onClick: i
|
|
59
78
|
})) : l("", !0),
|
|
60
|
-
|
|
79
|
+
r("aside", {
|
|
61
80
|
ref_key: "drawerRef",
|
|
62
|
-
ref:
|
|
63
|
-
class: "of-drawer",
|
|
81
|
+
ref: p,
|
|
82
|
+
class: P(["of-drawer", { "of-drawer--fullscreen": e.fullscreen }]),
|
|
64
83
|
role: "dialog",
|
|
65
84
|
"aria-modal": "true",
|
|
66
85
|
"aria-label": e.title,
|
|
67
|
-
style:
|
|
68
|
-
onClick:
|
|
86
|
+
style: m(b.value),
|
|
87
|
+
onClick: d[0] || (d[0] = N(() => {
|
|
69
88
|
}, ["stop"]))
|
|
70
89
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
e.resizable && !e.fullscreen ? (n(), a("button", {
|
|
91
|
+
key: 0,
|
|
92
|
+
type: "button",
|
|
93
|
+
class: "of-drawer__resize-handle",
|
|
94
|
+
"aria-label": "调整抽屉宽度",
|
|
95
|
+
onPointerdown: x
|
|
96
|
+
}, null, 32)) : l("", !0),
|
|
97
|
+
r("div", F, [
|
|
98
|
+
w(v).title || e.title || e.showClose ? (n(), a("div", K, [
|
|
99
|
+
r("div", j, [
|
|
100
|
+
y(t.$slots, "title", {}, () => [
|
|
101
|
+
e.title ? (n(), a("h3", q, $(e.title), 1)) : l("", !0)
|
|
76
102
|
], !0)
|
|
77
103
|
]),
|
|
78
|
-
e.showClose ? (
|
|
104
|
+
e.showClose ? (n(), a("button", {
|
|
79
105
|
key: 0,
|
|
80
106
|
class: "of-drawer__close",
|
|
81
107
|
type: "button",
|
|
82
108
|
"aria-label": "关闭",
|
|
83
|
-
onClick:
|
|
109
|
+
onClick: i
|
|
84
110
|
}, [
|
|
85
|
-
|
|
111
|
+
c(w(g), { size: 18 })
|
|
86
112
|
])) : l("", !0)
|
|
87
113
|
])) : l("", !0),
|
|
88
|
-
|
|
89
|
-
|
|
114
|
+
r("div", A, [
|
|
115
|
+
y(t.$slots, "default", {}, void 0, !0)
|
|
90
116
|
])
|
|
91
117
|
])
|
|
92
|
-
],
|
|
118
|
+
], 14, X)
|
|
93
119
|
], 4)) : l("", !0)
|
|
94
120
|
]),
|
|
95
121
|
_: 3
|
|
@@ -98,5 +124,5 @@ const D = ["aria-label"], L = { class: "of-drawer__inner" }, M = {
|
|
|
98
124
|
}
|
|
99
125
|
});
|
|
100
126
|
export {
|
|
101
|
-
|
|
127
|
+
O as default
|
|
102
128
|
};
|