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
|
@@ -2,12 +2,12 @@ import { defineComponent as Mt, ref as v, watch as K, computed as b, nextTick as
|
|
|
2
2
|
import { useHysRootAttrs as Rt } from "../../config.js";
|
|
3
3
|
import { Settings2 as Lt, ChevronUp as Et, ChevronDown as Ae, Search as Bt, ChevronRight as We } from "lucide-vue-next";
|
|
4
4
|
import { useMotion as Tt } from "../../motion/useMotion.js";
|
|
5
|
-
import
|
|
5
|
+
import Ut from "../HysSortableList/HysSortableList.vue.js";
|
|
6
6
|
import Ie from "../HysSelect/HysSelect.vue.js";
|
|
7
7
|
import ze from "../HysInput/HysInput.vue.js";
|
|
8
8
|
import Re from "../HysCheckbox/HysCheckbox.vue.js";
|
|
9
9
|
import M from "../HysButton/HysButton.vue.js";
|
|
10
|
-
import
|
|
10
|
+
import $t from "../HysPagination/HysPagination.vue.js";
|
|
11
11
|
const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-search" }, Nt = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "hys-ui-pf-grid-group-label"
|
|
@@ -178,7 +178,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
178
178
|
function it(t, l) {
|
|
179
179
|
!o.editable || !l.editable || (Q.value = { id: Z(t, 0), key: l.key }, ge.value = oe(t, l.key));
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Ue(t, l) {
|
|
182
182
|
Q.value && (V("cellEdit", { row: t, rowKey: Q.value.id, column: l.key, value: ge.value }), Q.value = null);
|
|
183
183
|
}
|
|
184
184
|
function ut() {
|
|
@@ -196,7 +196,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
196
196
|
if (!e.length) return "—";
|
|
197
197
|
const a = t.summary === "sum" ? e.reduce((n, d) => n + d, 0) : t.summary === "avg" ? e.reduce((n, d) => n + d, 0) / e.length : t.summary === "min" ? Math.min(...e) : Math.max(...e);
|
|
198
198
|
return new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 2 }).format(a);
|
|
199
|
-
}, we = b(() => be.value.map((t, l) => Z(t, l))),
|
|
199
|
+
}, we = b(() => be.value.map((t, l) => Z(t, l))), $e = b(() => we.value.length > 0 && we.value.every((t) => h.value.includes(t))), ft = b(() => we.value.some((t) => h.value.includes(t)));
|
|
200
200
|
function yt(t, l) {
|
|
201
201
|
h.value = l ? [.../* @__PURE__ */ new Set([...h.value, t])] : h.value.filter((e) => e !== t), V("selectionChange", h.value);
|
|
202
202
|
}
|
|
@@ -240,7 +240,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
240
240
|
l.resizable !== !1 && (t.preventDefault(), t.stopPropagation(), T = { key: l.key, start: t.clientX, width: p.value[l.key] || l.width || 160, min: l.minWidth || 80, max: l.maxWidth || 800 }, document.body.style.cursor = "col-resize", window.addEventListener("pointermove", Ne), window.addEventListener("pointerup", Ce));
|
|
241
241
|
}
|
|
242
242
|
const { effectiveMotion: xe } = Tt(), se = v(null), W = v(null);
|
|
243
|
-
let
|
|
243
|
+
let U = 0, re = null, Ve = 0;
|
|
244
244
|
const ye = /* @__PURE__ */ new Set();
|
|
245
245
|
function ie() {
|
|
246
246
|
Ve++;
|
|
@@ -251,7 +251,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
251
251
|
t === "off" && ie();
|
|
252
252
|
});
|
|
253
253
|
function _() {
|
|
254
|
-
cancelAnimationFrame(
|
|
254
|
+
cancelAnimationFrame(U), U = 0, re = null, se.value = null, W.value = null;
|
|
255
255
|
}
|
|
256
256
|
function bt(t, l) {
|
|
257
257
|
if (T || l.reorderable === !1 || !t.dataTransfer) {
|
|
@@ -270,12 +270,12 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
270
270
|
}
|
|
271
271
|
function wt(t, l) {
|
|
272
272
|
if (!De(l)) {
|
|
273
|
-
cancelAnimationFrame(
|
|
273
|
+
cancelAnimationFrame(U), U = 0, re = null, W.value = null;
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), re = { element: t.currentTarget, column: l, x: t.clientX },
|
|
276
|
+
t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), re = { element: t.currentTarget, column: l, x: t.clientX }, !U && (U = requestAnimationFrame(() => {
|
|
277
277
|
var n;
|
|
278
|
-
|
|
278
|
+
U = 0;
|
|
279
279
|
const e = re;
|
|
280
280
|
if (re = null, !e || !De(e.column)) return;
|
|
281
281
|
const a = Oe(e.column, e.x, e.element);
|
|
@@ -283,7 +283,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
283
283
|
}));
|
|
284
284
|
}
|
|
285
285
|
function Ct(t) {
|
|
286
|
-
t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame(
|
|
286
|
+
t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame(U), U = 0, re = null, W.value = null);
|
|
287
287
|
}
|
|
288
288
|
function Pe() {
|
|
289
289
|
var t;
|
|
@@ -300,15 +300,15 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
300
300
|
const e = l.getBoundingClientRect(), a = Math.max(0, e.top), n = Math.min(window.innerHeight, e.bottom), d = Math.max(0, e.left), i = Math.min(window.innerWidth, e.right);
|
|
301
301
|
if (a >= n || d >= i) return;
|
|
302
302
|
const y = /* @__PURE__ */ new Map();
|
|
303
|
-
for (const [I,
|
|
303
|
+
for (const [I, $] of Pe()) {
|
|
304
304
|
const S = t.get(I);
|
|
305
|
-
S &&
|
|
305
|
+
S && $.right > d && $.left < i && Math.abs(S.left - $.left) > 0.5 && y.set(I, S.left - $.left);
|
|
306
306
|
}
|
|
307
307
|
const f = [];
|
|
308
308
|
for (const I of Array.from(l.querySelectorAll("thead tr,tbody tr,tfoot tr"))) {
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
311
|
-
if (!(
|
|
309
|
+
const $ = I.getBoundingClientRect();
|
|
310
|
+
if ($.top >= n) break;
|
|
311
|
+
if (!($.bottom <= a)) {
|
|
312
312
|
for (const S of Array.from(I.children))
|
|
313
313
|
if (S instanceof HTMLElement && y.has(S.dataset.columnKey || "") && f.push(S), f.length >= Xe) break;
|
|
314
314
|
if (f.length >= Xe) break;
|
|
@@ -316,7 +316,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
316
316
|
}
|
|
317
317
|
const ee = xe.value === "full" ? 280 : 180;
|
|
318
318
|
for (const I of f) {
|
|
319
|
-
const
|
|
319
|
+
const $ = y.get(I.dataset.columnKey), S = I.animate([{ transform: "translateX(" + $ + "px)" }, { transform: "translateX(0)" }], { duration: ee, easing: "cubic-bezier(.2,.8,.2,1)" });
|
|
320
320
|
ye.add(S), S.onfinish = () => ye.delete(S), S.oncancel = () => ye.delete(S);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -455,7 +455,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
455
455
|
}, 8, ["aria-expanded"]),
|
|
456
456
|
Y.value ? (s(), u("div", jt, [
|
|
457
457
|
l[19] || (l[19] = g("strong", null, "显示列与排序", -1)),
|
|
458
|
-
m(
|
|
458
|
+
m(Ut, {
|
|
459
459
|
class: "hys-ui-pf-grid-settings-list",
|
|
460
460
|
"model-value": tt.value,
|
|
461
461
|
"onUpdate:modelValue": l[7] || (l[7] = (e) => D.value = e.map((a) => a.id))
|
|
@@ -518,8 +518,8 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
518
518
|
r.selectable ? (s(), u("th", Wt, [
|
|
519
519
|
m(Re, {
|
|
520
520
|
"aria-label": "选择当前页全部行",
|
|
521
|
-
"model-value":
|
|
522
|
-
indeterminate: ft.value &&
|
|
521
|
+
"model-value": $e.value,
|
|
522
|
+
indeterminate: ft.value && !$e.value,
|
|
523
523
|
"onUpdate:modelValue": vt
|
|
524
524
|
}, null, 8, ["model-value", "indeterminate"])
|
|
525
525
|
])) : k("", !0),
|
|
@@ -718,10 +718,10 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
718
718
|
onClick: l[11] || (l[11] = A(() => {
|
|
719
719
|
}, ["stop"])),
|
|
720
720
|
onKeydown: [
|
|
721
|
-
ve(A((f) =>
|
|
721
|
+
ve(A((f) => Ue(e.row, a), ["stop"]), ["enter"]),
|
|
722
722
|
l[12] || (l[12] = ve(A((f) => Q.value = null, ["stop"]), ["esc"]))
|
|
723
723
|
],
|
|
724
|
-
onFocusout: (f) =>
|
|
724
|
+
onFocusout: (f) => Ue(e.row, a)
|
|
725
725
|
}, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (s(), u(B, { key: 1 }, [
|
|
726
726
|
r.treeMode && a.key === ((i = L.value[0]) == null ? void 0 : i.key) && e.row.__pfHasChildren ? (s(), ce(M, {
|
|
727
727
|
key: 0,
|
|
@@ -780,7 +780,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
780
780
|
], 6)
|
|
781
781
|
], 32),
|
|
782
782
|
g("footer", vl, [
|
|
783
|
-
m(
|
|
783
|
+
m($t, {
|
|
784
784
|
page: C.value,
|
|
785
785
|
total: r.serverMode ? r.totalRows ?? r.rows.length : q.value.length,
|
|
786
786
|
"page-size": ne.value,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysDrawer2.vue.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-8ba9617d"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
import { X as
|
|
4
|
-
import { useDialog as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as x, ref as w, computed as E, toRef as O, watch as $, onDeactivated as D, openBlock as n, createBlock as S, Teleport as H, createVNode as b, Transition as M, withCtx as N, unref as h, withDirectives as R, createElementBlock as f, mergeProps as V, withModifiers as z, createElementVNode as d, normalizeStyle as A, renderSlot as y, toDisplayString as P, createCommentVNode as m, vShow as T } from "vue";
|
|
2
|
+
import { useHysRootAttrs as q } from "../../config.js";
|
|
3
|
+
import { X as W } from "lucide-vue-next";
|
|
4
|
+
import { useDialog as X } from "../../composables/useDialog.js";
|
|
5
|
+
const j = ["aria-label", "aria-busy"], F = { class: "hys-ui-dialog-head" }, G = ["disabled"], I = { class: "hys-ui-drawer-body" }, J = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "hys-ui-dialog-foot"
|
|
8
|
-
},
|
|
8
|
+
}, Y = /* @__PURE__ */ x({
|
|
9
9
|
__name: "HysDrawer",
|
|
10
10
|
props: {
|
|
11
11
|
open: { type: Boolean },
|
|
12
12
|
title: {},
|
|
13
13
|
width: { default: "520px" },
|
|
14
|
+
height: {},
|
|
14
15
|
closeOnMask: { type: Boolean, default: !0 },
|
|
15
16
|
closeOnEscape: { type: Boolean, default: !0 },
|
|
16
17
|
showClose: { type: Boolean, default: !0 },
|
|
@@ -20,76 +21,76 @@ const X = ["aria-label", "aria-busy"], j = { class: "hys-ui-dialog-head" }, F =
|
|
|
20
21
|
beforeClose: {}
|
|
21
22
|
},
|
|
22
23
|
emits: ["close", "closeError"],
|
|
23
|
-
setup(
|
|
24
|
-
const k =
|
|
25
|
-
|
|
24
|
+
setup(t, { expose: g, emit: C }) {
|
|
25
|
+
const k = q(), e = t, p = C, u = w(), a = w(!1), B = E(() => ({ ...e.fullscreen ? { width: "100%", height: "100dvh", maxWidth: "100vw", maxHeight: "100dvh" } : e.placement === "top" || e.placement === "bottom" ? { width: "100%", height: e.height || e.width, maxHeight: "100dvh" } : { width: e.width }, "--hys-ui-drawer-enter-x": e.placement === "left" ? "-100%" : e.placement === "right" ? "100%" : "0px", "--hys-ui-drawer-enter-y": e.placement === "top" ? "-100%" : e.placement === "bottom" ? "100%" : "0px" })), { active: r } = X(O(e, "open"), u, () => {
|
|
26
|
+
e.closeOnEscape && i("escape");
|
|
26
27
|
});
|
|
27
|
-
let
|
|
28
|
-
function
|
|
29
|
-
|
|
28
|
+
let s = 0;
|
|
29
|
+
function v() {
|
|
30
|
+
s++, a.value = !1;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}),
|
|
34
|
-
async function
|
|
35
|
-
if (
|
|
36
|
-
const l = ++
|
|
37
|
-
|
|
32
|
+
$(() => e.open, (o) => {
|
|
33
|
+
o || v();
|
|
34
|
+
}), D(v);
|
|
35
|
+
async function i(o = "button") {
|
|
36
|
+
if (a.value || !e.open || !r.value) return;
|
|
37
|
+
const l = ++s;
|
|
38
|
+
a.value = !0;
|
|
38
39
|
try {
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
40
|
+
if (e.beforeClose && await e.beforeClose(o) === !1) return;
|
|
41
|
+
r.value && l === s && p("close");
|
|
42
|
+
} catch (c) {
|
|
43
|
+
r.value && l === s && p("closeError", c);
|
|
43
44
|
} finally {
|
|
44
|
-
l ===
|
|
45
|
+
l === s && (a.value = !1);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
return g({ close:
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
|
|
51
|
-
class: ["hys-ui-overlay hys-ui-drawer-overlay", "hys-ui-drawer-" +
|
|
52
|
-
onPointerdown: l[1] || (l[1] =
|
|
48
|
+
return g({ close: i, element: u }), (o, l) => (n(), S(H, { to: "body" }, [
|
|
49
|
+
b(M, { name: "hys-ui-drawer-motion" }, {
|
|
50
|
+
default: N(() => [
|
|
51
|
+
h(r) && (t.open || !t.destroyOnClose) ? R((n(), f("div", V({ key: 0 }, h(k), {
|
|
52
|
+
class: ["hys-ui-overlay hys-ui-drawer-overlay", "hys-ui-drawer-" + t.placement],
|
|
53
|
+
onPointerdown: l[1] || (l[1] = z((c) => t.closeOnMask && i("mask"), ["self"]))
|
|
53
54
|
}), [
|
|
54
|
-
|
|
55
|
+
d("aside", {
|
|
55
56
|
ref_key: "dialog",
|
|
56
|
-
ref:
|
|
57
|
+
ref: u,
|
|
57
58
|
tabindex: "-1",
|
|
58
59
|
class: "hys-ui-drawer",
|
|
59
60
|
role: "dialog",
|
|
60
61
|
"aria-modal": "true",
|
|
61
|
-
"aria-label":
|
|
62
|
-
"aria-busy":
|
|
63
|
-
style:
|
|
62
|
+
"aria-label": t.title,
|
|
63
|
+
"aria-busy": a.value,
|
|
64
|
+
style: A(B.value)
|
|
64
65
|
}, [
|
|
65
|
-
|
|
66
|
-
y(
|
|
67
|
-
|
|
66
|
+
d("header", F, [
|
|
67
|
+
y(o.$slots, "header", {}, () => [
|
|
68
|
+
d("h3", null, P(t.title), 1)
|
|
68
69
|
], !0),
|
|
69
|
-
|
|
70
|
+
t.showClose ? (n(), f("button", {
|
|
70
71
|
key: 0,
|
|
71
72
|
type: "button",
|
|
72
73
|
class: "hys-ui-icon-action",
|
|
73
74
|
"aria-label": "关闭",
|
|
74
|
-
disabled:
|
|
75
|
-
onClick: l[0] || (l[0] = (
|
|
75
|
+
disabled: a.value,
|
|
76
|
+
onClick: l[0] || (l[0] = (c) => i("button"))
|
|
76
77
|
}, [
|
|
77
|
-
|
|
78
|
-
], 8,
|
|
78
|
+
b(h(W), { size: 18 })
|
|
79
|
+
], 8, G)) : m("", !0)
|
|
79
80
|
]),
|
|
80
|
-
|
|
81
|
-
y(
|
|
81
|
+
d("div", I, [
|
|
82
|
+
y(o.$slots, "default", {}, void 0, !0)
|
|
82
83
|
]),
|
|
83
|
-
|
|
84
|
-
y(
|
|
85
|
-
close:
|
|
86
|
-
closing:
|
|
84
|
+
o.$slots.footer ? (n(), f("footer", J, [
|
|
85
|
+
y(o.$slots, "footer", {
|
|
86
|
+
close: i,
|
|
87
|
+
closing: a.value
|
|
87
88
|
}, void 0, !0)
|
|
88
|
-
])) :
|
|
89
|
-
], 12,
|
|
89
|
+
])) : m("", !0)
|
|
90
|
+
], 12, j)
|
|
90
91
|
], 16)), [
|
|
91
|
-
[
|
|
92
|
-
]) :
|
|
92
|
+
[T, t.open]
|
|
93
|
+
]) : m("", !0)
|
|
93
94
|
]),
|
|
94
95
|
_: 3
|
|
95
96
|
})
|
|
@@ -97,5 +98,5 @@ const X = ["aria-label", "aria-busy"], j = { class: "hys-ui-dialog-head" }, F =
|
|
|
97
98
|
}
|
|
98
99
|
});
|
|
99
100
|
export {
|
|
100
|
-
|
|
101
|
+
Y as default
|
|
101
102
|
};
|
|
@@ -1,65 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class: "hys-ui-ent-muted"
|
|
6
|
-
}, T = /* @__PURE__ */ k({
|
|
7
|
-
__name: "HysFileManager",
|
|
8
|
-
props: {
|
|
9
|
-
modelValue: { default: () => [] },
|
|
10
|
-
modelModifiers: {}
|
|
11
|
-
},
|
|
12
|
-
emits: /* @__PURE__ */ A(["upload", "remove", "download"], ["update:modelValue"]),
|
|
13
|
-
setup(p, { emit: f }) {
|
|
14
|
-
const v = F(), u = C(p, "modelValue"), a = f, l = D(!1);
|
|
15
|
-
function d(t) {
|
|
16
|
-
t && (a("upload", Array.from(t)), l.value = !1);
|
|
17
|
-
}
|
|
18
|
-
function g(t) {
|
|
19
|
-
var e;
|
|
20
|
-
t.preventDefault(), d(((e = t.dataTransfer) == null ? void 0 : e.files) || null);
|
|
21
|
-
}
|
|
22
|
-
V(() => l.value = !1);
|
|
23
|
-
function y(t) {
|
|
24
|
-
return t < 1024 ? t + " B" : (t / 1024).toFixed(1) + " KB";
|
|
25
|
-
}
|
|
26
|
-
return (t, e) => (r(), s("div", b(M(v), { class: "hys-ui-ent-panel" }), [
|
|
27
|
-
n("label", {
|
|
28
|
-
class: h(["hys-ui-ent-drop", { "hys-ui-dragging": l.value }]),
|
|
29
|
-
onDragenter: e[1] || (e[1] = i((o) => l.value = !0, ["prevent"])),
|
|
30
|
-
onDragleave: e[2] || (e[2] = i((o) => l.value = !1, ["prevent"])),
|
|
31
|
-
onDragover: e[3] || (e[3] = i(() => {
|
|
32
|
-
}, ["prevent"])),
|
|
33
|
-
onDrop: g
|
|
34
|
-
}, [
|
|
35
|
-
n("input", {
|
|
36
|
-
type: "file",
|
|
37
|
-
multiple: "",
|
|
38
|
-
onChange: e[0] || (e[0] = (o) => {
|
|
39
|
-
d(o.target.files), o.target.value = "";
|
|
40
|
-
})
|
|
41
|
-
}, null, 32),
|
|
42
|
-
e[4] || (e[4] = x("拖拽文件至此或点击选择(由业务层负责上传)", -1))
|
|
43
|
-
], 34),
|
|
44
|
-
n("ul", N, [
|
|
45
|
-
(r(!0), s(B, null, _(u.value, (o) => (r(), s("li", {
|
|
46
|
-
key: o.id
|
|
47
|
-
}, [
|
|
48
|
-
n("span", null, m(o.name) + " · " + m(y(o.size)), 1),
|
|
49
|
-
n("button", {
|
|
50
|
-
type: "button",
|
|
51
|
-
onClick: (c) => a("download", o.id)
|
|
52
|
-
}, "下载", 8, $),
|
|
53
|
-
n("button", {
|
|
54
|
-
type: "button",
|
|
55
|
-
onClick: (c) => a("remove", o.id)
|
|
56
|
-
}, "移除", 8, z)
|
|
57
|
-
]))), 128))
|
|
58
|
-
]),
|
|
59
|
-
u.value.length ? w("", !0) : (r(), s("p", E, "暂无附件"))
|
|
60
|
-
], 16));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
1
|
+
import o from "./HysFileManager2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fc3b6749"]]);
|
|
63
5
|
export {
|
|
64
|
-
|
|
6
|
+
f as default
|
|
65
7
|
};
|
|
@@ -1,4 +1,87 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as x, ref as y, useModel as V, onUnmounted as h, onDeactivated as B, watch as M, openBlock as s, createElementBlock as r, mergeProps as $, unref as A, createElementVNode as i, withModifiers as o, withKeys as g, normalizeClass as F, createTextVNode as K, Fragment as N, renderList as z, toDisplayString as c, createCommentVNode as E, mergeModels as p } from "vue";
|
|
2
|
+
import { useHysRootAttrs as H } from "../../config.js";
|
|
3
|
+
const R = ["aria-disabled", "tabindex"], T = ["disabled"], L = { class: "hys-ui-ent-files" }, P = ["disabled", "onClick"], S = ["disabled", "onClick"], U = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "hys-ui-ent-muted"
|
|
6
|
+
}, G = /* @__PURE__ */ x({
|
|
7
|
+
__name: "HysFileManager",
|
|
8
|
+
props: /* @__PURE__ */ p({
|
|
9
|
+
disabled: { type: Boolean }
|
|
10
|
+
}, {
|
|
11
|
+
modelValue: { default: () => [] },
|
|
12
|
+
modelModifiers: {}
|
|
13
|
+
}),
|
|
14
|
+
emits: /* @__PURE__ */ p(["upload", "remove", "download"], ["update:modelValue"]),
|
|
15
|
+
setup(t, { emit: k }) {
|
|
16
|
+
const C = H(), m = t, u = y(), v = V(t, "modelValue"), b = k, d = y(!1);
|
|
17
|
+
function f(n) {
|
|
18
|
+
m.disabled || !n || (b("upload", Array.from(n)), d.value = !1);
|
|
19
|
+
}
|
|
20
|
+
function D(n) {
|
|
21
|
+
var e;
|
|
22
|
+
n.preventDefault(), f(((e = n.dataTransfer) == null ? void 0 : e.files) || null);
|
|
23
|
+
}
|
|
24
|
+
h(() => d.value = !1), B(() => d.value = !1), M(() => m.disabled, () => d.value = !1);
|
|
25
|
+
function w(n) {
|
|
26
|
+
return n < 1024 ? n + " B" : (n / 1024).toFixed(1) + " KB";
|
|
27
|
+
}
|
|
28
|
+
return (n, e) => (s(), r("div", $(A(C), { class: "hys-ui-ent-panel" }), [
|
|
29
|
+
i("label", {
|
|
30
|
+
class: F(["hys-ui-ent-drop", { "hys-ui-dragging": d.value }]),
|
|
31
|
+
role: "button",
|
|
32
|
+
"aria-disabled": t.disabled,
|
|
33
|
+
tabindex: t.disabled ? -1 : 0,
|
|
34
|
+
"aria-label": "选择或拖入文件",
|
|
35
|
+
onKeydown: [
|
|
36
|
+
e[1] || (e[1] = g(o((l) => {
|
|
37
|
+
var a;
|
|
38
|
+
return !t.disabled && ((a = u.value) == null ? void 0 : a.click());
|
|
39
|
+
}, ["prevent"]), ["enter"])),
|
|
40
|
+
e[2] || (e[2] = g(o((l) => {
|
|
41
|
+
var a;
|
|
42
|
+
return !t.disabled && ((a = u.value) == null ? void 0 : a.click());
|
|
43
|
+
}, ["prevent"]), ["space"]))
|
|
44
|
+
],
|
|
45
|
+
onDragenter: e[3] || (e[3] = o((l) => !t.disabled && (d.value = !0), ["prevent"])),
|
|
46
|
+
onDragleave: e[4] || (e[4] = o((l) => d.value = !1, ["prevent"])),
|
|
47
|
+
onDragover: e[5] || (e[5] = o(() => {
|
|
48
|
+
}, ["prevent"])),
|
|
49
|
+
onDrop: D
|
|
50
|
+
}, [
|
|
51
|
+
i("input", {
|
|
52
|
+
ref_key: "input",
|
|
53
|
+
ref: u,
|
|
54
|
+
type: "file",
|
|
55
|
+
hidden: "",
|
|
56
|
+
disabled: t.disabled,
|
|
57
|
+
multiple: "",
|
|
58
|
+
onChange: e[0] || (e[0] = (l) => {
|
|
59
|
+
f(l.target.files), l.target.value = "";
|
|
60
|
+
})
|
|
61
|
+
}, null, 40, T),
|
|
62
|
+
e[6] || (e[6] = K("拖拽文件至此或点击选择(由业务层负责上传)", -1))
|
|
63
|
+
], 42, R),
|
|
64
|
+
i("ul", L, [
|
|
65
|
+
(s(!0), r(N, null, z(v.value, (l) => (s(), r("li", {
|
|
66
|
+
key: l.id
|
|
67
|
+
}, [
|
|
68
|
+
i("span", null, c(l.name) + " · " + c(w(l.size)), 1),
|
|
69
|
+
i("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
disabled: t.disabled,
|
|
72
|
+
onClick: (a) => !t.disabled && b("download", l.id)
|
|
73
|
+
}, "下载", 8, P),
|
|
74
|
+
i("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
disabled: t.disabled,
|
|
77
|
+
onClick: (a) => !t.disabled && b("remove", l.id)
|
|
78
|
+
}, "移除", 8, S)
|
|
79
|
+
]))), 128))
|
|
80
|
+
]),
|
|
81
|
+
v.value.length ? E("", !0) : (s(), r("p", U, "暂无附件"))
|
|
82
|
+
], 16));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
2
85
|
export {
|
|
3
|
-
|
|
86
|
+
G as default
|
|
4
87
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysForm2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-313cea92"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|