hys-ui 0.1.0 → 0.1.1
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/CHANGELOG.md +26 -1
- package/README.md +16 -6
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysBadge/HysBadge.vue.js +1 -1
- package/dist/components/HysBadge/HysBadge2.vue.js +20 -19
- package/dist/components/HysCalendar/HysCalendar.vue.js +48 -40
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +9 -9
- package/dist/components/HysCascader/HysCascader.vue.js +88 -76
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +85 -2
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +22 -22
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +85 -2
- package/dist/components/HysForm/HysForm.vue.js +2 -2
- package/dist/components/HysForm/HysForm2.vue.js +66 -64
- package/dist/components/HysFormItem/HysFormItem.vue.js +53 -37
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +302 -2
- package/dist/components/HysInput/HysInput.vue.js +1 -1
- package/dist/components/HysInput/HysInput2.vue.js +42 -41
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +49 -40
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +34 -32
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +91 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +100 -2
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +80 -2
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +86 -67
- package/dist/components/HysSearch/HysSearch.vue.js +49 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +39 -34
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +130 -109
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +40 -40
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +15 -14
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +38 -27
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +42 -38
- package/dist/components/HysTabs/HysTabs.vue.js +1 -1
- package/dist/components/HysTabs/HysTabs2.vue.js +8 -6
- package/dist/components/HysTextarea/HysTextarea.vue.js +58 -48
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +159 -143
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +62 -61
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +64 -57
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +95 -77
- package/dist/composables/formContext.js +9 -3
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +40 -40
- package/dist/composables/useHysToast.js +148 -0
- package/dist/config.js +18 -15
- package/dist/index.js +10 -7
- package/dist/style.css +1 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +2 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +5 -1
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +21 -4
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +6 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +6 -0
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -0
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +3 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +40 -17
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +7 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -0
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +1 -1
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +3 -1
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +11 -1
- package/dist/types/composables/formContext.d.ts +5 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/useFloating.d.ts +1 -1
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +46 -11
|
@@ -1,4 +1,304 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { defineComponent as ge, ref as W, watch as j, computed as y, onMounted as ye, onActivated as fe, nextTick as le, onDeactivated as me, onBeforeUnmount as we, openBlock as i, createElementBlock as o, mergeProps as be, unref as q, createElementVNode as r, createVNode as se, withCtx as xe, createTextVNode as ie, toDisplayString as f, normalizeStyle as p, Fragment as P, renderList as S, withKeys as _, withModifiers as x, normalizeClass as K, createCommentVNode as z } from "vue";
|
|
2
|
+
import { useHysRootAttrs as ke } from "../../config.js";
|
|
3
|
+
import $e from "../HysSegmented/HysSegmented.vue.js";
|
|
4
|
+
import Ce from "../HysButton/HysButton.vue.js";
|
|
5
|
+
const Me = { class: "hys-ui-pg-toolbar" }, De = { class: "hys-ui-pg-hint" }, Pe = { class: "hys-ui-pg-body" }, Se = ["onClick", "onKeydown"], _e = ["title"], Te = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "hys-ui-pg-empty"
|
|
8
|
+
}, He = { class: "hys-ui-pg-months" }, Ue = ["title"], Ve = { class: "hys-ui-pg-days" }, We = ["aria-label", "title", "onClick", "onKeydown", "onPointerdown"], ze = { class: "hys-ui-pg-bar-title" }, Le = ["onPointerdown"], Ae = ["onPointerdown"], Be = ["width", "height"], Fe = ["d"], Ee = { class: "hys-ui-pg-footer" }, Ke = { key: 0 }, oe = 864e5, Oe = /* @__PURE__ */ ge({
|
|
9
|
+
__name: "HysGantt",
|
|
10
|
+
props: {
|
|
11
|
+
items: {},
|
|
12
|
+
modelValue: {},
|
|
13
|
+
scale: { default: "day" },
|
|
14
|
+
editable: { type: Boolean, default: !1 },
|
|
15
|
+
rowHeight: { default: 46 },
|
|
16
|
+
labelWidth: { default: 270 },
|
|
17
|
+
fitContainer: { type: Boolean, default: !0 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue", "update:scale", "scaleChange", "update:items", "change", "open"],
|
|
20
|
+
setup(d, { emit: re }) {
|
|
21
|
+
const ue = ke(), c = d, m = re, w = W(c.scale);
|
|
22
|
+
j(() => c.scale, (e) => w.value = e);
|
|
23
|
+
const T = W(c.modelValue ?? null);
|
|
24
|
+
j(() => c.modelValue, (e) => T.value = e ?? null);
|
|
25
|
+
const k = W(null), H = /* @__PURE__ */ new Date();
|
|
26
|
+
H.setHours(0, 0, 0, 0);
|
|
27
|
+
function $(e) {
|
|
28
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(e)) return null;
|
|
29
|
+
const [n, t, l] = e.split("-").map(Number), a = new Date(n, t - 1, l);
|
|
30
|
+
return a.getFullYear() === n && a.getMonth() === t - 1 && a.getDate() === l ? a : null;
|
|
31
|
+
}
|
|
32
|
+
function h(e) {
|
|
33
|
+
return Math.round((Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - Date.UTC(1970, 0, 1)) / oe);
|
|
34
|
+
}
|
|
35
|
+
function U(e) {
|
|
36
|
+
return new Date(e * oe);
|
|
37
|
+
}
|
|
38
|
+
function L(e) {
|
|
39
|
+
return U(e).toISOString().slice(0, 10);
|
|
40
|
+
}
|
|
41
|
+
const v = y(() => c.items.map((e) => {
|
|
42
|
+
const n = $(e.start), t = $(e.end);
|
|
43
|
+
return !n || !t || h(t) < h(n) ? null : { ...e, s: h(n), e: h(t), progress: Math.min(100, Math.max(0, e.progress ?? 0)) };
|
|
44
|
+
}).filter((e) => e !== null)), de = y(() => w.value === "day" ? 36 : w.value === "week" ? 17 : w.value === "month" ? 7 : 36), b = y(() => {
|
|
45
|
+
const e = v.value.flatMap((t) => [t.s, t.e]), n = h(H);
|
|
46
|
+
return { start: Math.min(n - 7, ...e) - 7, end: Math.max(n + 21, ...e) + 14 };
|
|
47
|
+
}), N = y(() => b.value.end - b.value.start + 1), Y = W(0), u = y(() => Math.max(de.value, c.fitContainer ? Y.value / N.value : 0)), J = y(() => Math.max(N.value * u.value, c.fitContainer ? Y.value : 0));
|
|
48
|
+
let C, M = !0;
|
|
49
|
+
function A() {
|
|
50
|
+
var e;
|
|
51
|
+
M && (Y.value = ((e = k.value) == null ? void 0 : e.clientWidth) || 0);
|
|
52
|
+
}
|
|
53
|
+
function R() {
|
|
54
|
+
C == null || C.disconnect(), C = void 0, window.removeEventListener("resize", A);
|
|
55
|
+
}
|
|
56
|
+
function Q() {
|
|
57
|
+
R(), !(!M || !k.value) && (A(), k.value && typeof ResizeObserver < "u" ? (C = new ResizeObserver(A), C.observe(k.value)) : window.addEventListener("resize", A));
|
|
58
|
+
}
|
|
59
|
+
ye(Q), fe(() => {
|
|
60
|
+
M = !0, le(() => M && Q());
|
|
61
|
+
}), me(() => {
|
|
62
|
+
M = !1, R(), V();
|
|
63
|
+
}), we(() => {
|
|
64
|
+
M = !1, R(), V();
|
|
65
|
+
});
|
|
66
|
+
function ce(e) {
|
|
67
|
+
!["day", "week", "month"].includes(e) || e === w.value || (w.value = e, m("update:scale", e), m("scaleChange", e));
|
|
68
|
+
}
|
|
69
|
+
const B = y(() => Array.from({ length: N.value }, (e, n) => b.value.start + n)), he = y(() => {
|
|
70
|
+
const e = [];
|
|
71
|
+
for (let n = 0; n < B.value.length; n++) {
|
|
72
|
+
const t = U(B.value[n]), l = `${t.getUTCFullYear()}-${t.getUTCMonth()}`, a = e[e.length - 1];
|
|
73
|
+
(a == null ? void 0 : a.key) === l ? a.width += u.value : e.push({ key: l, label: `${t.getUTCFullYear()}年${t.getUTCMonth() + 1}月`, left: n * u.value, width: u.value });
|
|
74
|
+
}
|
|
75
|
+
return e;
|
|
76
|
+
}), Z = y(() => new Map(v.value.map((e, n) => [String(e.id), { x: (e.s - b.value.start) * u.value, w: (e.e - e.s + 1) * u.value, y: n * c.rowHeight + c.rowHeight / 2 }]))), ee = y(() => v.value.flatMap((e) => (e.dependencies ?? []).flatMap((n) => {
|
|
77
|
+
const t = Z.value.get(String(n)), l = Z.value.get(String(e.id));
|
|
78
|
+
return !t || !l || String(n) === String(e.id) ? [] : [{ id: `${n}-${e.id}`, path: `M ${t.x + t.w} ${t.y} H ${t.x + t.w + 9} V ${l.y} H ${l.x}` }];
|
|
79
|
+
})));
|
|
80
|
+
function F(e) {
|
|
81
|
+
T.value = e.id, m("update:modelValue", e.id), m("open", e);
|
|
82
|
+
}
|
|
83
|
+
function te() {
|
|
84
|
+
const e = k.value;
|
|
85
|
+
e && (e.scrollLeft = Math.max(0, (h(H) - b.value.start) * u.value - e.clientWidth / 3));
|
|
86
|
+
}
|
|
87
|
+
j(w, () => le(te));
|
|
88
|
+
const g = W(null);
|
|
89
|
+
let I;
|
|
90
|
+
function ne() {
|
|
91
|
+
var n, t;
|
|
92
|
+
const e = I;
|
|
93
|
+
I = void 0, (t = e == null ? void 0 : (n = e.element).hasPointerCapture) != null && t.call(n, e.id) && e.element.releasePointerCapture(e.id);
|
|
94
|
+
}
|
|
95
|
+
function V() {
|
|
96
|
+
g.value = null, ne();
|
|
97
|
+
}
|
|
98
|
+
function O(e, n, t) {
|
|
99
|
+
!c.editable || n.disabled || e.button !== 0 || (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), I = { element: e.currentTarget, id: e.pointerId }, g.value = { id: n.id, type: t, x: e.clientX, original: { ...n }, days: 0, unitWidth: u.value }, T.value = n.id, m("update:modelValue", n.id));
|
|
100
|
+
}
|
|
101
|
+
function X(e) {
|
|
102
|
+
g.value && (g.value.days = Math.round((e.clientX - g.value.x) / g.value.unitWidth));
|
|
103
|
+
}
|
|
104
|
+
function D(e) {
|
|
105
|
+
const n = g.value;
|
|
106
|
+
if (!n || (g.value = null, ne(), e.type === "pointercancel" || !n.days)) return;
|
|
107
|
+
const t = $(n.original.start), l = $(n.original.end);
|
|
108
|
+
if (!t || !l) return;
|
|
109
|
+
let a = h(t), s = h(l);
|
|
110
|
+
n.type === "move" ? (a += n.days, s += n.days) : n.type === "start" ? a = Math.min(s, a + n.days) : s = Math.max(a, s + n.days);
|
|
111
|
+
const G = { ...n.original, start: L(a), end: L(s) };
|
|
112
|
+
m("update:items", c.items.map((ae) => String(ae.id) === String(G.id) ? G : ae)), m("change", G);
|
|
113
|
+
}
|
|
114
|
+
function ve(e) {
|
|
115
|
+
const n = g.value;
|
|
116
|
+
if (!n || String(n.id) !== String(e.id)) return { s: e.s, e: e.e };
|
|
117
|
+
const t = n.days;
|
|
118
|
+
return n.type === "move" ? { s: e.s + t, e: e.e + t } : n.type === "start" ? { s: Math.min(e.e, e.s + t), e: e.e } : { s: e.s, e: Math.max(e.s, e.e + t) };
|
|
119
|
+
}
|
|
120
|
+
function pe(e) {
|
|
121
|
+
const n = ve(e);
|
|
122
|
+
return { left: `${(n.s - b.value.start) * u.value}px`, width: `${Math.max(u.value, (n.e - n.s + 1) * u.value)}px`, background: e.color || "var(--hys-ui-primary,var(--hys-ui-theme-primary, #4776ed))" };
|
|
123
|
+
}
|
|
124
|
+
function E(e, n) {
|
|
125
|
+
if (!c.editable || e.disabled) return;
|
|
126
|
+
const t = $(e.start), l = $(e.end);
|
|
127
|
+
if (!t || !l) return;
|
|
128
|
+
const a = { ...e, start: L(h(t) + n), end: L(h(l) + n) };
|
|
129
|
+
m("update:items", c.items.map((s) => String(s.id) === String(e.id) ? a : s)), m("change", a);
|
|
130
|
+
}
|
|
131
|
+
return (e, n) => (i(), o("section", be(q(ue), {
|
|
132
|
+
class: "hys-ui-pg-gantt",
|
|
133
|
+
"aria-label": "项目甘特图"
|
|
134
|
+
}), [
|
|
135
|
+
r("div", Me, [
|
|
136
|
+
se($e, {
|
|
137
|
+
class: "hys-ui-pg-scale",
|
|
138
|
+
"model-value": w.value,
|
|
139
|
+
options: [{ label: "日", value: "day" }, { label: "周", value: "week" }, { label: "月", value: "month" }],
|
|
140
|
+
"aria-label": "时间刻度",
|
|
141
|
+
"onUpdate:modelValue": ce
|
|
142
|
+
}, null, 8, ["model-value"]),
|
|
143
|
+
se(Ce, {
|
|
144
|
+
variant: "secondary",
|
|
145
|
+
size: "sm",
|
|
146
|
+
class: "hys-ui-pg-today",
|
|
147
|
+
onClick: te
|
|
148
|
+
}, {
|
|
149
|
+
default: xe(() => [...n[0] || (n[0] = [
|
|
150
|
+
ie("定位今天", -1)
|
|
151
|
+
])]),
|
|
152
|
+
_: 1
|
|
153
|
+
}),
|
|
154
|
+
r("span", De, f(d.editable ? "拖动任务条调整排期 · Alt + 左/右方向键微调日期" : "点击任务查看详情"), 1)
|
|
155
|
+
]),
|
|
156
|
+
r("div", Pe, [
|
|
157
|
+
r("div", {
|
|
158
|
+
class: "hys-ui-pg-labels",
|
|
159
|
+
style: p({ width: d.labelWidth + "px", minWidth: d.labelWidth + "px" })
|
|
160
|
+
}, [
|
|
161
|
+
n[1] || (n[1] = r("div", { class: "hys-ui-pg-label-head" }, "任务 / 负责人", -1)),
|
|
162
|
+
(i(!0), o(P, null, S(v.value, (t) => (i(), o("button", {
|
|
163
|
+
type: "button",
|
|
164
|
+
key: t.id,
|
|
165
|
+
class: K(["hys-ui-pg-task-label", { "hys-ui-selected": T.value === t.id }]),
|
|
166
|
+
style: p({ height: d.rowHeight + "px" }),
|
|
167
|
+
onClick: (l) => F(t),
|
|
168
|
+
onKeydown: [
|
|
169
|
+
_(x((l) => E(t, -1), ["alt", "prevent"]), ["left"]),
|
|
170
|
+
_(x((l) => E(t, 1), ["alt", "prevent"]), ["right"])
|
|
171
|
+
]
|
|
172
|
+
}, [
|
|
173
|
+
r("strong", {
|
|
174
|
+
title: t.title
|
|
175
|
+
}, f(t.title), 9, _e),
|
|
176
|
+
r("small", null, f(t.owner || "未分配") + " · " + f(t.status || "待办"), 1)
|
|
177
|
+
], 46, Se))), 128)),
|
|
178
|
+
v.value.length ? z("", !0) : (i(), o("div", Te, "暂无有效排期任务"))
|
|
179
|
+
], 4),
|
|
180
|
+
r("div", {
|
|
181
|
+
ref_key: "scroller",
|
|
182
|
+
ref: k,
|
|
183
|
+
class: "hys-ui-pg-scroll",
|
|
184
|
+
tabindex: "0",
|
|
185
|
+
"aria-label": "可横向滚动的甘特图时间轴"
|
|
186
|
+
}, [
|
|
187
|
+
r("div", {
|
|
188
|
+
class: "hys-ui-pg-canvas",
|
|
189
|
+
style: p({ width: J.value + "px" })
|
|
190
|
+
}, [
|
|
191
|
+
r("div", He, [
|
|
192
|
+
(i(!0), o(P, null, S(he.value, (t) => (i(), o("span", {
|
|
193
|
+
key: t.key,
|
|
194
|
+
title: t.label,
|
|
195
|
+
style: p({ left: t.left + "px", width: t.width + "px" })
|
|
196
|
+
}, f(t.label), 13, Ue))), 128))
|
|
197
|
+
]),
|
|
198
|
+
r("div", Ve, [
|
|
199
|
+
(i(!0), o(P, null, S(B.value, (t) => (i(), o("span", {
|
|
200
|
+
key: t,
|
|
201
|
+
class: K({ "hys-ui-weekend": [0, 6].includes(U(t).getUTCDay()), "hys-ui-today": t === h(q(H)) }),
|
|
202
|
+
style: p({ width: u.value + "px" })
|
|
203
|
+
}, f(w.value === "month" ? "" : U(t).getUTCDate()), 7))), 128))
|
|
204
|
+
]),
|
|
205
|
+
r("div", {
|
|
206
|
+
class: "hys-ui-pg-grid",
|
|
207
|
+
style: p({ height: v.value.length * d.rowHeight + "px" })
|
|
208
|
+
}, [
|
|
209
|
+
(i(!0), o(P, null, S(B.value, (t) => (i(), o("div", {
|
|
210
|
+
key: t,
|
|
211
|
+
class: K(["hys-ui-pg-day-column", { "hys-ui-weekend": [0, 6].includes(U(t).getUTCDay()) }]),
|
|
212
|
+
style: p({ left: (t - b.value.start) * u.value + "px", width: u.value + "px" })
|
|
213
|
+
}, null, 6))), 128)),
|
|
214
|
+
r("div", {
|
|
215
|
+
class: "hys-ui-pg-today-line",
|
|
216
|
+
style: p({ left: (h(q(H)) - b.value.start) * u.value + u.value / 2 + "px" })
|
|
217
|
+
}, null, 4),
|
|
218
|
+
(i(!0), o(P, null, S(v.value, (t, l) => {
|
|
219
|
+
var a;
|
|
220
|
+
return i(), o("div", {
|
|
221
|
+
key: t.id,
|
|
222
|
+
class: "hys-ui-pg-row",
|
|
223
|
+
style: p({ top: l * d.rowHeight + "px", height: d.rowHeight + "px" })
|
|
224
|
+
}, [
|
|
225
|
+
r("div", {
|
|
226
|
+
class: K(["hys-ui-pg-bar", { "hys-ui-selected": T.value === t.id, "hys-ui-dragging": ((a = g.value) == null ? void 0 : a.id) === t.id, "hys-ui-disabled": t.disabled }]),
|
|
227
|
+
style: p(pe(t)),
|
|
228
|
+
role: "button",
|
|
229
|
+
tabindex: "0",
|
|
230
|
+
"aria-label": `${t.title},${t.start} 至 ${t.end},完成 ${t.progress}%`,
|
|
231
|
+
title: `${t.title}
|
|
232
|
+
${t.start} → ${t.end}
|
|
233
|
+
完成 ${t.progress}%`,
|
|
234
|
+
onClick: (s) => F(t),
|
|
235
|
+
onKeydown: [
|
|
236
|
+
_((s) => F(t), ["enter"]),
|
|
237
|
+
_(x((s) => F(t), ["prevent"]), ["space"]),
|
|
238
|
+
_(x((s) => E(t, -1), ["alt", "prevent"]), ["left"]),
|
|
239
|
+
_(x((s) => E(t, 1), ["alt", "prevent"]), ["right"])
|
|
240
|
+
],
|
|
241
|
+
onPointerdown: (s) => O(s, t, "move"),
|
|
242
|
+
onPointermove: X,
|
|
243
|
+
onPointerup: D,
|
|
244
|
+
onPointercancel: D,
|
|
245
|
+
onLostpointercapture: V
|
|
246
|
+
}, [
|
|
247
|
+
r("div", {
|
|
248
|
+
class: "hys-ui-pg-progress",
|
|
249
|
+
style: p({ width: t.progress + "%" })
|
|
250
|
+
}, null, 4),
|
|
251
|
+
r("span", ze, f(t.progress) + "%", 1),
|
|
252
|
+
d.editable && !t.disabled ? (i(), o("span", {
|
|
253
|
+
key: 0,
|
|
254
|
+
class: "hys-ui-pg-handle hys-ui-start",
|
|
255
|
+
title: "调整开始日期",
|
|
256
|
+
onPointerdown: x((s) => O(s, t, "start"), ["stop"]),
|
|
257
|
+
onPointermove: X,
|
|
258
|
+
onPointerup: D,
|
|
259
|
+
onPointercancel: D,
|
|
260
|
+
onLostpointercapture: V
|
|
261
|
+
}, null, 40, Le)) : z("", !0),
|
|
262
|
+
d.editable && !t.disabled ? (i(), o("span", {
|
|
263
|
+
key: 1,
|
|
264
|
+
class: "hys-ui-pg-handle hys-ui-end",
|
|
265
|
+
title: "调整结束日期",
|
|
266
|
+
onPointerdown: x((s) => O(s, t, "end"), ["stop"]),
|
|
267
|
+
onPointermove: X,
|
|
268
|
+
onPointerup: D,
|
|
269
|
+
onPointercancel: D,
|
|
270
|
+
onLostpointercapture: V
|
|
271
|
+
}, null, 40, Ae)) : z("", !0)
|
|
272
|
+
], 46, We)
|
|
273
|
+
], 4);
|
|
274
|
+
}), 128)),
|
|
275
|
+
ee.value.length ? (i(), o("svg", {
|
|
276
|
+
key: 0,
|
|
277
|
+
class: "hys-ui-pg-dependencies",
|
|
278
|
+
width: J.value,
|
|
279
|
+
height: v.value.length * d.rowHeight,
|
|
280
|
+
"aria-hidden": "true"
|
|
281
|
+
}, [
|
|
282
|
+
(i(!0), o(P, null, S(ee.value, (t) => (i(), o("path", {
|
|
283
|
+
key: t.id,
|
|
284
|
+
d: t.path,
|
|
285
|
+
fill: "none",
|
|
286
|
+
stroke: "currentColor",
|
|
287
|
+
"stroke-width": "1.5",
|
|
288
|
+
"stroke-dasharray": "4 3"
|
|
289
|
+
}, null, 8, Fe))), 128))
|
|
290
|
+
], 8, Be)) : z("", !0)
|
|
291
|
+
], 4)
|
|
292
|
+
], 4)
|
|
293
|
+
], 512)
|
|
294
|
+
]),
|
|
295
|
+
r("div", Ee, [
|
|
296
|
+
ie(f(v.value.length) + " 项任务 · " + f(v.value.filter((t) => t.status === "已完成").length) + " 项已完成 ", 1),
|
|
297
|
+
v.value.length !== d.items.length ? (i(), o("span", Ke, "· " + f(d.items.length - v.value.length) + " 项日期无效已隐藏", 1)) : z("", !0)
|
|
298
|
+
])
|
|
299
|
+
], 16));
|
|
300
|
+
}
|
|
301
|
+
});
|
|
2
302
|
export {
|
|
3
|
-
|
|
303
|
+
Oe as default
|
|
4
304
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysInput2.vue.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-bee455c4"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as P, ref as h, useAttrs as
|
|
2
|
-
import { X as
|
|
3
|
-
import { useHysRootAttrs as
|
|
4
|
-
import { fieldKey as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as P, ref as h, useAttrs as q, useId as K, inject as N, computed as O, openBlock as i, createElementBlock as o, mergeProps as V, unref as s, createElementVNode as b, renderSlot as f, createCommentVNode as r, normalizeClass as D, withKeys as H, withModifiers as L, createVNode as M, createBlock as R, resolveDynamicComponent as S, toDisplayString as c } from "vue";
|
|
2
|
+
import { X as F, EyeOff as X, Eye as G } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as J } from "../../config.js";
|
|
4
|
+
import { fieldKey as Q } from "../../composables/formContext.js";
|
|
5
|
+
const T = { class: "hys-ui-input-group" }, U = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "hys-ui-input-addon"
|
|
8
|
-
},
|
|
8
|
+
}, W = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "hys-ui-input-affix"
|
|
11
|
-
},
|
|
11
|
+
}, Y = ["id", "aria-label", "aria-invalid", "aria-required", "aria-describedby", "value", "placeholder", "type", "disabled", "readonly", "maxlength", "minlength", "autocomplete", "name"], Z = ["aria-label", "aria-pressed", "disabled"], _ = {
|
|
12
12
|
key: 3,
|
|
13
13
|
class: "hys-ui-input-affix"
|
|
14
|
-
},
|
|
14
|
+
}, ee = {
|
|
15
15
|
key: 4,
|
|
16
16
|
class: "hys-ui-input-count"
|
|
17
|
-
},
|
|
17
|
+
}, te = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "hys-ui-input-addon"
|
|
20
|
-
},
|
|
20
|
+
}, ae = ["id"], oe = /* @__PURE__ */ P({
|
|
21
21
|
inheritAttrs: !1,
|
|
22
22
|
__name: "HysInput",
|
|
23
23
|
props: {
|
|
@@ -38,10 +38,10 @@ const Q = { class: "hys-ui-input-group" }, T = {
|
|
|
38
38
|
size: { default: "md" }
|
|
39
39
|
},
|
|
40
40
|
emits: ["update:modelValue", "input", "change", "clear", "focus", "blur", "pressEnter"],
|
|
41
|
-
setup(t, { expose:
|
|
42
|
-
const m = t, n =
|
|
43
|
-
function
|
|
44
|
-
return Object.fromEntries(Object.entries(
|
|
41
|
+
setup(t, { expose: E, emit: x }) {
|
|
42
|
+
const m = t, n = x, z = J(), d = h(), A = q(), p = K(), y = h(!1), v = h(!1), u = N(Q, void 0), g = O(() => m.error || (u == null ? void 0 : u.error.value));
|
|
43
|
+
function j() {
|
|
44
|
+
return Object.fromEntries(Object.entries(A).filter(([e]) => !["class", "style"].includes(e)));
|
|
45
45
|
}
|
|
46
46
|
function k(e) {
|
|
47
47
|
if (v.value || m.disabled || m.readonly) return;
|
|
@@ -52,7 +52,7 @@ const Q = { class: "hys-ui-input-group" }, T = {
|
|
|
52
52
|
var e;
|
|
53
53
|
m.disabled || m.readonly || (n("update:modelValue", ""), n("input", ""), n("clear"), (e = d.value) == null || e.focus());
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return E({ input: d, focus: () => {
|
|
56
56
|
var e;
|
|
57
57
|
return (e = d.value) == null ? void 0 : e.focus();
|
|
58
58
|
}, blur: () => {
|
|
@@ -62,31 +62,32 @@ const Q = { class: "hys-ui-input-group" }, T = {
|
|
|
62
62
|
var e;
|
|
63
63
|
return (e = d.value) == null ? void 0 : e.select();
|
|
64
64
|
} }), (e, a) => {
|
|
65
|
-
var w, $, C;
|
|
66
|
-
return
|
|
65
|
+
var w, $, C, B;
|
|
66
|
+
return i(), o("div", V(s(z), {
|
|
67
67
|
class: ["hys-ui-input-wrap", [e.$attrs.class, { "hys-ui-input-disabled": t.disabled }, "hys-ui-input-" + t.size]],
|
|
68
68
|
style: e.$attrs.style
|
|
69
69
|
}), [
|
|
70
|
-
b("div",
|
|
71
|
-
e.$slots.prepend ? (
|
|
70
|
+
b("div", T, [
|
|
71
|
+
e.$slots.prepend ? (i(), o("span", U, [
|
|
72
72
|
f(e.$slots, "prepend", {}, void 0, !0)
|
|
73
73
|
])) : r("", !0),
|
|
74
74
|
b("div", {
|
|
75
|
-
class:
|
|
75
|
+
class: D(["hys-ui-input-shell", { "hys-ui-input-shell-error": g.value }])
|
|
76
76
|
}, [
|
|
77
|
-
e.$slots.prefix ? (
|
|
77
|
+
e.$slots.prefix ? (i(), o("span", W, [
|
|
78
78
|
f(e.$slots, "prefix", {}, void 0, !0)
|
|
79
79
|
])) : r("", !0),
|
|
80
80
|
b("input", V({
|
|
81
81
|
ref_key: "input",
|
|
82
82
|
ref: d
|
|
83
|
-
},
|
|
84
|
-
id: e.$attrs.id || ((w =
|
|
83
|
+
}, j(), {
|
|
84
|
+
id: e.$attrs.id || ((w = s(u)) == null ? void 0 : w.id.value),
|
|
85
85
|
class: "hys-ui-input",
|
|
86
|
-
"
|
|
86
|
+
"data-hys-ui-field-managed": "",
|
|
87
|
+
"aria-label": t.ariaLabel || e.$attrs["aria-label"] || (($ = s(u)) == null ? void 0 : $.label.value),
|
|
87
88
|
"aria-invalid": !!g.value || void 0,
|
|
88
|
-
"aria-required": ((
|
|
89
|
-
"aria-describedby": t.error ?
|
|
89
|
+
"aria-required": ((C = s(u)) == null ? void 0 : C.required.value) || void 0,
|
|
90
|
+
"aria-describedby": [t.error ? s(p) : (B = s(u)) == null ? void 0 : B.describedBy.value, e.$attrs["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
90
91
|
value: t.modelValue,
|
|
91
92
|
placeholder: t.placeholder,
|
|
92
93
|
type: t.showPassword && y.value ? "text" : t.type,
|
|
@@ -104,23 +105,23 @@ const Q = { class: "hys-ui-input-group" }, T = {
|
|
|
104
105
|
onChange: a[2] || (a[2] = (l) => n("change", l.target.value)),
|
|
105
106
|
onFocus: a[3] || (a[3] = (l) => n("focus", l)),
|
|
106
107
|
onBlur: a[4] || (a[4] = (l) => n("blur", l)),
|
|
107
|
-
onKeydown: a[5] || (a[5] =
|
|
108
|
-
}), null, 16,
|
|
109
|
-
t.clearable && t.modelValue && !t.disabled && !t.readonly ? (
|
|
108
|
+
onKeydown: a[5] || (a[5] = H((l) => !l.isComposing && n("pressEnter", l), ["enter"]))
|
|
109
|
+
}), null, 16, Y),
|
|
110
|
+
t.clearable && t.modelValue && !t.disabled && !t.readonly ? (i(), o("button", {
|
|
110
111
|
key: 1,
|
|
111
112
|
type: "button",
|
|
112
113
|
class: "hys-ui-input-action",
|
|
113
114
|
"aria-label": "清空输入",
|
|
114
|
-
onMousedown: a[6] || (a[6] =
|
|
115
|
+
onMousedown: a[6] || (a[6] = L(() => {
|
|
115
116
|
}, ["prevent"])),
|
|
116
117
|
onClick: I
|
|
117
118
|
}, [
|
|
118
|
-
|
|
119
|
+
M(s(F), {
|
|
119
120
|
size: 14,
|
|
120
121
|
"aria-hidden": "true"
|
|
121
122
|
})
|
|
122
123
|
], 32)) : r("", !0),
|
|
123
|
-
t.showPassword && t.type === "password" ? (
|
|
124
|
+
t.showPassword && t.type === "password" ? (i(), o("button", {
|
|
124
125
|
key: 2,
|
|
125
126
|
type: "button",
|
|
126
127
|
class: "hys-ui-input-action",
|
|
@@ -129,30 +130,30 @@ const Q = { class: "hys-ui-input-group" }, T = {
|
|
|
129
130
|
disabled: t.disabled,
|
|
130
131
|
onClick: a[7] || (a[7] = (l) => y.value = !y.value)
|
|
131
132
|
}, [
|
|
132
|
-
(
|
|
133
|
+
(i(), R(S(y.value ? s(X) : s(G)), {
|
|
133
134
|
size: 16,
|
|
134
135
|
"aria-hidden": "true"
|
|
135
136
|
}))
|
|
136
|
-
], 8,
|
|
137
|
-
e.$slots.suffix ? (
|
|
137
|
+
], 8, Z)) : r("", !0),
|
|
138
|
+
e.$slots.suffix ? (i(), o("span", _, [
|
|
138
139
|
f(e.$slots, "suffix", {}, void 0, !0)
|
|
139
140
|
])) : r("", !0),
|
|
140
|
-
t.showCount ? (
|
|
141
|
+
t.showCount ? (i(), o("small", ee, c(t.modelValue.length) + c(t.maxlength ? " / " + t.maxlength : ""), 1)) : r("", !0)
|
|
141
142
|
], 2),
|
|
142
|
-
e.$slots.append ? (
|
|
143
|
+
e.$slots.append ? (i(), o("span", te, [
|
|
143
144
|
f(e.$slots, "append", {}, void 0, !0)
|
|
144
145
|
])) : r("", !0)
|
|
145
146
|
]),
|
|
146
|
-
t.error ? (
|
|
147
|
+
t.error ? (i(), o("small", {
|
|
147
148
|
key: 0,
|
|
148
|
-
id:
|
|
149
|
+
id: s(p),
|
|
149
150
|
class: "hys-ui-error-text",
|
|
150
151
|
role: "alert"
|
|
151
|
-
}, c(t.error), 9,
|
|
152
|
+
}, c(t.error), 9, ae)) : r("", !0)
|
|
152
153
|
], 16);
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
export {
|
|
157
|
-
|
|
158
|
+
oe as default
|
|
158
159
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysModal2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-518b4887"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, ref as g, toRef as E, watch as O, onDeactivated as $, openBlock as
|
|
1
|
+
import { defineComponent as B, ref as g, toRef as E, watch as O, onDeactivated as $, openBlock as r, createBlock as x, Teleport as D, createVNode as C, Transition as M, withCtx as S, unref as f, withDirectives as H, createElementBlock as y, mergeProps as N, withModifiers as R, createElementVNode as u, normalizeStyle as V, renderSlot as h, toDisplayString as z, createCommentVNode as m, vShow as A } from "vue";
|
|
2
2
|
import { useHysRootAttrs as P } from "../../config.js";
|
|
3
3
|
import { X as T } from "lucide-vue-next";
|
|
4
4
|
import { useDialog as q } from "../../composables/useDialog.js";
|
|
@@ -21,75 +21,75 @@ const W = ["aria-label", "aria-busy"], X = { class: "hys-ui-dialog-head" }, j =
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["close", "closeError"],
|
|
23
23
|
setup(e, { expose: k, emit: w }) {
|
|
24
|
-
const p = P(), s = e,
|
|
25
|
-
s.closeOnEscape &&
|
|
24
|
+
const p = P(), s = e, v = w, d = g(), l = g(!1), { active: n } = q(E(s, "open"), d, () => {
|
|
25
|
+
s.closeOnEscape && i("escape");
|
|
26
26
|
});
|
|
27
|
-
let
|
|
27
|
+
let a = 0;
|
|
28
28
|
function b() {
|
|
29
|
-
|
|
29
|
+
a++, l.value = !1;
|
|
30
30
|
}
|
|
31
31
|
O(() => s.open, (o) => {
|
|
32
32
|
o || b();
|
|
33
33
|
}), $(b);
|
|
34
|
-
async function
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
34
|
+
async function i(o = "button") {
|
|
35
|
+
if (l.value || !s.open || !n.value) return;
|
|
36
|
+
const t = ++a;
|
|
37
|
+
l.value = !0;
|
|
38
38
|
try {
|
|
39
39
|
if (s.beforeClose && await s.beforeClose(o) === !1) return;
|
|
40
|
-
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
40
|
+
n.value && t === a && v("close");
|
|
41
|
+
} catch (c) {
|
|
42
|
+
n.value && t === a && v("closeError", c);
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
t === a && (l.value = !1);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return k({ close:
|
|
47
|
+
return k({ close: i, element: d }), (o, t) => (r(), x(D, { to: "body" }, [
|
|
48
48
|
C(M, { name: "hys-ui-modal-motion" }, {
|
|
49
49
|
default: S(() => [
|
|
50
|
-
|
|
50
|
+
f(n) && (e.open || !e.destroyOnClose) ? H((r(), y("div", N({ key: 0 }, f(p), {
|
|
51
51
|
class: ["hys-ui-overlay", { "hys-ui-modal-fullscreen": e.fullscreen }],
|
|
52
|
-
onPointerdown:
|
|
52
|
+
onPointerdown: t[1] || (t[1] = R((c) => e.closeOnMask && i("mask"), ["self"]))
|
|
53
53
|
}), [
|
|
54
|
-
|
|
54
|
+
u("section", {
|
|
55
55
|
ref_key: "dialog",
|
|
56
|
-
ref:
|
|
56
|
+
ref: d,
|
|
57
57
|
tabindex: "-1",
|
|
58
58
|
class: "hys-ui-modal",
|
|
59
59
|
role: "dialog",
|
|
60
60
|
"aria-modal": "true",
|
|
61
61
|
"aria-label": e.title,
|
|
62
|
-
"aria-busy":
|
|
62
|
+
"aria-busy": l.value,
|
|
63
63
|
style: V({ maxWidth: e.fullscreen ? "100%" : e.width, width: e.fullscreen ? "100%" : void 0, height: e.fullscreen ? "100dvh" : void 0, maxHeight: e.fullscreen ? "100dvh" : void 0 })
|
|
64
64
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
u("header", X, [
|
|
66
|
+
h(o.$slots, "header", {}, () => [
|
|
67
|
+
u("h3", null, z(e.title), 1)
|
|
68
68
|
], !0),
|
|
69
|
-
e.showClose ? (
|
|
69
|
+
e.showClose ? (r(), y("button", {
|
|
70
70
|
key: 0,
|
|
71
71
|
type: "button",
|
|
72
72
|
class: "hys-ui-icon-action",
|
|
73
73
|
"aria-label": "关闭",
|
|
74
|
-
disabled:
|
|
75
|
-
onClick:
|
|
74
|
+
disabled: l.value,
|
|
75
|
+
onClick: t[0] || (t[0] = (c) => i("button"))
|
|
76
76
|
}, [
|
|
77
|
-
C(
|
|
78
|
-
], 8, j)) :
|
|
77
|
+
C(f(T), { size: 18 })
|
|
78
|
+
], 8, j)) : m("", !0)
|
|
79
79
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
u("div", F, [
|
|
81
|
+
h(o.$slots, "default", {}, void 0, !0)
|
|
82
82
|
]),
|
|
83
|
-
o.$slots.footer ? (
|
|
84
|
-
|
|
85
|
-
close:
|
|
86
|
-
closing:
|
|
83
|
+
o.$slots.footer ? (r(), y("footer", G, [
|
|
84
|
+
h(o.$slots, "footer", {
|
|
85
|
+
close: i,
|
|
86
|
+
closing: l.value
|
|
87
87
|
}, void 0, !0)
|
|
88
|
-
])) :
|
|
88
|
+
])) : m("", !0)
|
|
89
89
|
], 12, W)
|
|
90
90
|
], 16)), [
|
|
91
91
|
[A, e.open]
|
|
92
|
-
]) :
|
|
92
|
+
]) : m("", !0)
|
|
93
93
|
]),
|
|
94
94
|
_: 3
|
|
95
95
|
})
|