zhihao-ui 1.1.0 → 1.1.2

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.
Files changed (69) hide show
  1. package/dist/es/{Button-CUB5krFr.js → Button-Q7GkKwFF.js} +3 -2
  2. package/dist/es/DatePicker-D8LPaPf6.js +57 -0
  3. package/dist/es/DetailSubTitle-C5pVYJhX.js +35 -0
  4. package/dist/es/Dialog-BASeD5f8.js +74 -0
  5. package/dist/es/EditInfoPair-CM5piQwT.js +36 -0
  6. package/dist/es/FileWrapper-DN-KKB9p.js +77 -0
  7. package/dist/es/Grid-Ds-Jy0Mn.js +96 -0
  8. package/dist/es/InfoPair-CnBR3fy9.js +36 -0
  9. package/dist/es/Input-C1s8JqmI.js +88 -0
  10. package/dist/es/Loading-DELLXz7f.js +22 -0
  11. package/dist/es/MessageBox-26ImfgOR.js +100 -0
  12. package/dist/es/MoneyInput-Dt_ZE-zv.js +53 -0
  13. package/dist/es/PageHeadPanel-CdohXWA9.js +32 -0
  14. package/dist/es/ToolTips-CxyQMewg.js +37 -0
  15. package/dist/es/index.js +32 -5
  16. package/dist/es/{utils-Dj4hZBjs.js → utils-DBdiSe6_.js} +1 -1
  17. package/dist/es/vendor-mKFy0Hb6.js +12409 -0
  18. package/dist/index.css +1 -1
  19. package/dist/types/components/DatePicker/DatePicker.vue.d.ts +28 -0
  20. package/dist/types/components/DatePicker/index.d.ts +70 -0
  21. package/dist/types/components/DatePicker/types.d.ts +1 -0
  22. package/dist/types/components/DetailSubTitle/DetailSubTitle.vue.d.ts +30 -0
  23. package/dist/types/components/DetailSubTitle/index.d.ts +59 -0
  24. package/dist/types/components/DetailSubTitle/types.d.ts +7 -0
  25. package/dist/types/components/Dialog/Dialog.vue.d.ts +48 -0
  26. package/dist/types/components/Dialog/index.d.ts +77 -0
  27. package/dist/types/components/Dialog/types.d.ts +6 -0
  28. package/dist/types/components/EditInfoPair/EditInfoPair.vue.d.ts +30 -0
  29. package/dist/types/components/EditInfoPair/index.d.ts +59 -0
  30. package/dist/types/components/EditInfoPair/types.d.ts +1 -0
  31. package/dist/types/components/FileWrapper/FileWrapper.vue.d.ts +64 -0
  32. package/dist/types/components/FileWrapper/index.d.ts +119 -0
  33. package/dist/types/components/FileWrapper/types.d.ts +1 -0
  34. package/dist/types/components/Grid/Grid.vue.d.ts +65 -0
  35. package/dist/types/components/Grid/index.d.ts +107 -0
  36. package/dist/types/components/Grid/interface/index.d.ts +5 -0
  37. package/dist/types/components/Grid/types.d.ts +1 -0
  38. package/dist/types/components/InfoPair/InfoPair.vue.d.ts +30 -0
  39. package/dist/types/components/InfoPair/index.d.ts +59 -0
  40. package/dist/types/components/InfoPair/types.d.ts +1 -0
  41. package/dist/types/components/Input/Input.vue.d.ts +45 -0
  42. package/dist/types/components/Input/index.d.ts +72 -0
  43. package/dist/types/components/Input/types.d.ts +1 -0
  44. package/dist/types/components/InputNumber/InputNumber.vue.d.ts +33 -0
  45. package/dist/types/components/InputNumber/index.d.ts +67 -0
  46. package/dist/types/components/InputNumber/types.d.ts +1 -0
  47. package/dist/types/components/Loading/Loading.vue.d.ts +2 -0
  48. package/dist/types/components/Loading/index.d.ts +13 -0
  49. package/dist/types/components/Loading/types.d.ts +1 -0
  50. package/dist/types/components/MessageBox/MessageBox.vue.d.ts +219 -0
  51. package/dist/types/components/MessageBox/index.d.ts +343 -0
  52. package/dist/types/components/MessageBox/types.d.ts +20 -0
  53. package/dist/types/components/MoneyInput/MoneyInput.vue.d.ts +40 -0
  54. package/dist/types/components/MoneyInput/index.d.ts +67 -0
  55. package/dist/types/components/MoneyInput/types.d.ts +1 -0
  56. package/dist/types/components/PageHeadPanel/PageHeadPanel.vue.d.ts +30 -0
  57. package/dist/types/components/PageHeadPanel/index.d.ts +32 -0
  58. package/dist/types/components/PageHeadPanel/types.d.ts +1 -0
  59. package/dist/types/components/ToolTips/ToolTips.vue.d.ts +33 -0
  60. package/dist/types/components/ToolTips/index.d.ts +53 -0
  61. package/dist/types/components/ToolTips/types.d.ts +1 -0
  62. package/dist/types/components/const.d.ts +4 -0
  63. package/dist/types/components/index.d.ts +14 -0
  64. package/dist/types/components/utils.d.ts +4 -0
  65. package/dist/umd/index.css +1 -1
  66. package/dist/umd/index.umd.cjs +40 -1
  67. package/package.json +1 -1
  68. package/dist/es/vendor-Co4JjPth.js +0 -157
  69. package/dist/types/components/vitest.config.d.ts +0 -2
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as c, useSlots as r, openBlock as _, createElementBlock as a } from "vue";
2
- import { w as p } from "./utils-Dj4hZBjs.js";
2
+ import { w as p } from "./utils-DBdiSe6_.js";
3
3
  const u = { style: { "background-color": "blue", color: "red" } }, l = /* @__PURE__ */ c({
4
4
  name: "ZhButton",
5
5
  __name: "Button",
@@ -17,5 +17,6 @@ const u = { style: { "background-color": "blue", color: "red" } }, l = /* @__PUR
17
17
  return o;
18
18
  }, m = /* @__PURE__ */ i(l, [["__scopeId", "data-v-e1dcabfd"]]), h = p(m);
19
19
  export {
20
- h as Z
20
+ h as Z,
21
+ i as _
21
22
  };
@@ -0,0 +1,57 @@
1
+ import { defineComponent as d, openBlock as u, createElementBlock as f, normalizeClass as h, createVNode as D, unref as M, mergeProps as _ } from "vue";
2
+ import { h as g, E as Y } from "./vendor-mKFy0Hb6.js";
3
+ import { w as A } from "./utils-DBdiSe6_.js";
4
+ const p = "--", m = "YYYY-MM-DDTHH:mm:ss", E = "YYYY-MM-DDT23:59:59", T = "YYYY-MM-DD", i = (e, l = T) => e ? g(e).format(l).replace("Invalid date", p) : p, N = (e) => typeof e == "number" ? !0 : typeof e == "string" ? !isNaN(parseFloat(e)) : !1;
5
+ function O(e) {
6
+ const l = ["角", "分"], c = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"], s = [
7
+ ["元", "万", "亿"],
8
+ ["", "拾", "佰", "仟"]
9
+ ], n = e < 0 ? "负" : "";
10
+ e = Math.abs(e);
11
+ let a = "";
12
+ for (let o = 0; o < l.length; o++)
13
+ a += (c[Math.floor(e * 10 * Math.pow(10, o)) % 10] + l[o]).replace(/零./, "");
14
+ a = a || "整", e = Math.floor(e);
15
+ for (let o = 0; o < s[0].length && e > 0; o++) {
16
+ let t = "";
17
+ for (let r = 0; r < s[1].length && e > 0; r++)
18
+ t = c[e % 10] + s[1][r] + t, e = Math.floor(e / 10);
19
+ a = t.replace(/(零.)*零$/, "").replace(/^$/, "零") + s[0][o] + a;
20
+ }
21
+ return n + a.replace(/(零.)*零元/, "元").replace(/(零.)+/g, "零").replace(/^整$/, "零元整");
22
+ }
23
+ const k = /* @__PURE__ */ d({
24
+ name: "zh-date-icker",
25
+ __name: "DatePicker",
26
+ props: {
27
+ style: {},
28
+ class: {},
29
+ modelValue: {}
30
+ },
31
+ emits: ["update:modelValue", "change"],
32
+ setup(e, { emit: l }) {
33
+ const c = e, s = l, n = (t) => Array.isArray(t) ? [i(t[0], m), i(t[1], E)] : t && i(t, m), a = (t) => {
34
+ const r = n(t);
35
+ s("update:modelValue", r);
36
+ }, o = (t) => {
37
+ const r = n(t);
38
+ s("change", r);
39
+ };
40
+ return (t, r) => (u(), f("div", {
41
+ class: h([c.class, "zh-date-picker"])
42
+ }, [
43
+ D(M(Y), _(t.$attrs, {
44
+ style: c.style,
45
+ "model-value": c.modelValue,
46
+ "onUpdate:modelValue": a,
47
+ onChange: o
48
+ }), null, 16, ["style", "model-value"])
49
+ ], 2));
50
+ }
51
+ }), P = A(k);
52
+ export {
53
+ p as D,
54
+ P as Z,
55
+ O as d,
56
+ N as v
57
+ };
@@ -0,0 +1,35 @@
1
+ import { defineComponent as r, openBlock as o, createElementBlock as s, createElementVNode as l, createTextVNode as a, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as m, unref as d } from "vue";
2
+ import { D as u } from "./DatePicker-D8LPaPf6.js";
3
+ import { w as f } from "./utils-DBdiSe6_.js";
4
+ const _ = { class: "info-pair" }, v = { class: "info-pair--title" }, h = {
5
+ key: 0,
6
+ class: "info-pair--title--tip"
7
+ }, D = /* @__PURE__ */ r({
8
+ name: "zh-detail-sub-title",
9
+ __name: "DetailSubTitle",
10
+ props: {
11
+ title: {},
12
+ value: {},
13
+ ellipsis: { type: Boolean },
14
+ tip: {}
15
+ },
16
+ setup(n) {
17
+ const i = n;
18
+ return (e, E) => (o(), s("div", _, [
19
+ l("div", v, [
20
+ a(t(i.title) + " ", 1),
21
+ e.tip ? (o(), s("div", h, t(e.tip), 1)) : p("", !0)
22
+ ]),
23
+ l("div", {
24
+ class: c(["info-pair--value", { ellipsis: e.ellipsis }])
25
+ }, [
26
+ m(e.$slots, "value", {}, () => [
27
+ a(t(i.value || d(u)), 1)
28
+ ])
29
+ ], 2)
30
+ ]));
31
+ }
32
+ }), b = f(D);
33
+ export {
34
+ b as Z
35
+ };
@@ -0,0 +1,74 @@
1
+ import { defineComponent as v, useModel as _, openBlock as r, createElementBlock as n, createVNode as l, unref as s, mergeProps as k, withCtx as o, renderSlot as C, createElementVNode as m, createTextVNode as u, toDisplayString as a, createCommentVNode as w, mergeModels as c } from "vue";
2
+ import { a as y, b as p } from "./vendor-mKFy0Hb6.js";
3
+ import { _ as D } from "./Button-Q7GkKwFF.js";
4
+ import { w as B } from "./utils-DBdiSe6_.js";
5
+ const E = { class: "dialog-wrap" }, M = { class: "title" }, N = {
6
+ key: 0,
7
+ class: "subtitle"
8
+ }, $ = { class: "dialog-footer" }, z = /* @__PURE__ */ v({
9
+ name: "zh-dialog",
10
+ __name: "Dialog",
11
+ props: /* @__PURE__ */ c({
12
+ title: {},
13
+ subtitle: {},
14
+ submitText: {},
15
+ submitDisabled: { type: Boolean }
16
+ }, {
17
+ modelValue: { type: Boolean, default: !0 },
18
+ modelModifiers: {}
19
+ }),
20
+ emits: /* @__PURE__ */ c(["close", "submit"], ["update:modelValue"]),
21
+ setup(f, { emit: b }) {
22
+ const i = b, d = _(f, "modelValue"), g = async () => {
23
+ i("submit");
24
+ }, h = () => {
25
+ i("close");
26
+ };
27
+ return (e, t) => (r(), n("div", E, [
28
+ l(s(y), k({
29
+ modelValue: d.value,
30
+ "onUpdate:modelValue": t[0] || (t[0] = (V) => d.value = V)
31
+ }, e.$attrs, {
32
+ "close-on-click-modal": e.$attrs.closeOnClickModal ?? !1,
33
+ "show-close": e.$attrs.showClose ?? !0
34
+ }), {
35
+ header: o(() => [
36
+ m("div", M, a(e.title), 1),
37
+ e.subtitle ? (r(), n("div", N, a(e.subtitle), 1)) : w("", !0)
38
+ ]),
39
+ footer: o(() => [
40
+ m("div", $, [
41
+ l(s(p), {
42
+ plain: "",
43
+ onClick: h
44
+ }, {
45
+ default: o(() => t[1] || (t[1] = [
46
+ u("取消")
47
+ ])),
48
+ _: 1
49
+ }),
50
+ l(s(p), {
51
+ type: "primary",
52
+ color: "#1966FF",
53
+ onClick: g,
54
+ disabled: e.submitDisabled
55
+ }, {
56
+ default: o(() => [
57
+ u(a(e.submitText || "提交"), 1)
58
+ ]),
59
+ _: 1
60
+ }, 8, ["disabled"])
61
+ ])
62
+ ]),
63
+ default: o(() => [
64
+ C(e.$slots, "default", {}, void 0, !0)
65
+ ]),
66
+ _: 3
67
+ }, 16, ["modelValue", "close-on-click-modal", "show-close"])
68
+ ]));
69
+ }
70
+ }), S = /* @__PURE__ */ D(z, [["__scopeId", "data-v-3003248f"]]), O = B(S);
71
+ export {
72
+ O as Z,
73
+ S as z
74
+ };
@@ -0,0 +1,36 @@
1
+ import { defineComponent as l, openBlock as o, createElementBlock as s, createElementVNode as a, createTextVNode as r, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as d, unref as m } from "vue";
2
+ import { D as f } from "./DatePicker-D8LPaPf6.js";
3
+ import { _ } from "./Button-Q7GkKwFF.js";
4
+ import { w as u } from "./utils-DBdiSe6_.js";
5
+ const v = { class: "info-pair" }, h = { class: "info-pair--title" }, E = {
6
+ key: 0,
7
+ class: "info-pair--title--tip"
8
+ }, I = /* @__PURE__ */ l({
9
+ name: "zh-edit-info-pair",
10
+ __name: "EditInfoPair",
11
+ props: {
12
+ title: {},
13
+ value: {},
14
+ ellipsis: { type: Boolean },
15
+ tip: {}
16
+ },
17
+ setup(n) {
18
+ const i = n;
19
+ return (e, k) => (o(), s("div", v, [
20
+ a("div", h, [
21
+ r(t(i.title) + " ", 1),
22
+ e.tip ? (o(), s("div", E, t(e.tip), 1)) : p("", !0)
23
+ ]),
24
+ a("div", {
25
+ class: c(["info-pair--value", { ellipsis: e.ellipsis }])
26
+ }, [
27
+ d(e.$slots, "value", {}, () => [
28
+ r(t(i.value || m(f)), 1)
29
+ ], !0)
30
+ ], 2)
31
+ ]));
32
+ }
33
+ }), V = /* @__PURE__ */ _(I, [["__scopeId", "data-v-8ed96c83"]]), N = u(V);
34
+ export {
35
+ N as Z
36
+ };
@@ -0,0 +1,77 @@
1
+ import { defineComponent as f, openBlock as i, createElementBlock as o, toDisplayString as n, createCommentVNode as s, createElementVNode as t, createVNode as p, unref as m, withCtx as _, createTextVNode as u } from "vue";
2
+ import { D as w } from "./DatePicker-D8LPaPf6.js";
3
+ import { c as y } from "./vendor-mKFy0Hb6.js";
4
+ import { _ as h } from "./Button-Q7GkKwFF.js";
5
+ import { w as v } from "./utils-DBdiSe6_.js";
6
+ const k = { class: "file_wrapper" }, x = {
7
+ key: 0,
8
+ class: "header"
9
+ }, F = { class: "file_main" }, N = { class: "file" }, g = { class: "file_name" }, D = /* @__PURE__ */ f({
10
+ name: "zh-file-wrapper",
11
+ __name: "FileWrapper",
12
+ props: {
13
+ downLoadUrl: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ canPreview: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ fileName: {
22
+ type: String,
23
+ default: w
24
+ },
25
+ canDelete: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ title: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ fileId: {
34
+ type: Number,
35
+ default: 0
36
+ }
37
+ },
38
+ emits: ["deleteFile"],
39
+ setup(a, { emit: r }) {
40
+ const e = a, d = r, c = () => {
41
+ e.canDelete && d("deleteFile", e.fileId);
42
+ };
43
+ return (L, l) => (i(), o("div", k, [
44
+ e.title ? (i(), o("div", x, n(e.title), 1)) : s("", !0),
45
+ t("div", F, [
46
+ t("div", N, [
47
+ l[0] || (l[0] = t("div", { class: "file_type mr-12" }, [
48
+ t("i", { class: "iconfont icon-xiangmuguanli" })
49
+ ], -1)),
50
+ t("div", g, n(e.fileName), 1)
51
+ ]),
52
+ p(m(y), {
53
+ size: "small",
54
+ class: "btn",
55
+ link: "",
56
+ style: { width: "80px" },
57
+ href: e.downLoadUrl,
58
+ underline: !1,
59
+ download: "download"
60
+ }, {
61
+ default: _(() => l[1] || (l[1] = [
62
+ u(" 查看/下载 ")
63
+ ])),
64
+ _: 1
65
+ }, 8, ["href"]),
66
+ a.canDelete ? (i(), o("i", {
67
+ key: 0,
68
+ class: "iconfont icon-close close",
69
+ onClick: c
70
+ })) : s("", !0)
71
+ ])
72
+ ]));
73
+ }
74
+ }), E = /* @__PURE__ */ h(D, [["__scopeId", "data-v-480bb0e6"]]), S = v(E);
75
+ export {
76
+ S as Z
77
+ };
@@ -0,0 +1,96 @@
1
+ import { defineComponent as $, onBeforeMount as B, useSlots as C, ref as k, computed as f, onMounted as L, onActivated as S, onUnmounted as j, onDeactivated as M, provide as p, watch as z, openBlock as P, createElementBlock as R, normalizeStyle as Z, renderSlot as D } from "vue";
2
+ import { w as H } from "./utils-DBdiSe6_.js";
3
+ const N = /* @__PURE__ */ $({
4
+ name: "zh-grid",
5
+ __name: "Grid",
6
+ props: {
7
+ cols: { default: () => ({ xs: 1, sm: 2, md: 2, lg: 4, xl: 4 }) },
8
+ collapsed: { type: Boolean, default: !1 },
9
+ collapsedRows: { default: 1 },
10
+ gap: { default: 10 }
11
+ },
12
+ setup(A, { expose: E }) {
13
+ const t = A;
14
+ B(() => t.collapsed && u()), L(() => {
15
+ o({ target: { innerWidth: window.innerWidth } }), window.addEventListener("resize", o);
16
+ }), S(() => {
17
+ o({ target: { innerWidth: window.innerWidth } }), window.addEventListener("resize", o);
18
+ }), j(() => {
19
+ window.removeEventListener("resize", o);
20
+ }), M(() => {
21
+ window.removeEventListener("resize", o);
22
+ });
23
+ const o = (s) => {
24
+ let e = s.target.innerWidth;
25
+ switch (!!e) {
26
+ case e < 768:
27
+ r.value = "xs";
28
+ break;
29
+ case (e >= 768 && e < 992):
30
+ r.value = "sm";
31
+ break;
32
+ case (e >= 992 && e < 1200):
33
+ r.value = "md";
34
+ break;
35
+ case (e >= 1200 && e < 1920):
36
+ r.value = "lg";
37
+ break;
38
+ case e >= 1920:
39
+ r.value = "xl";
40
+ break;
41
+ }
42
+ };
43
+ p("gap", Array.isArray(t.gap) ? t.gap[0] : t.gap);
44
+ let r = k("xl");
45
+ p("breakPoint", r);
46
+ const i = k(-1);
47
+ p("shouldHiddenIndex", i);
48
+ const d = f(() => typeof t.cols == "object" ? t.cols[r.value] ?? t.cols : t.cols);
49
+ p("cols", d);
50
+ const G = C().default(), u = () => {
51
+ var m, v, g, h;
52
+ let s = [], e = null;
53
+ G.forEach((a) => {
54
+ var n;
55
+ typeof a.type == "object" && a.type.name === "GridItem" && ((n = a.props) == null ? void 0 : n.suffix) !== void 0 && (e = a), typeof a.type == "symbol" && Array.isArray(a.children) && s.push(...a.children);
56
+ });
57
+ let c = 0;
58
+ e && (c = (((m = e.props[r.value]) == null ? void 0 : m.span) ?? ((v = e.props) == null ? void 0 : v.span) ?? 1) + (((g = e.props[r.value]) == null ? void 0 : g.offset) ?? ((h = e.props) == null ? void 0 : h.offset) ?? 0));
59
+ try {
60
+ let a = !1;
61
+ s.reduce((n = 0, l, _) => {
62
+ var w, y, x, b;
63
+ if (n += (((w = l.props[r.value]) == null ? void 0 : w.span) ?? ((y = l.props) == null ? void 0 : y.span) ?? 1) + (((x = l.props[r.value]) == null ? void 0 : x.offset) ?? ((b = l.props) == null ? void 0 : b.offset) ?? 0), Number(n) > t.collapsedRows * d.value - c)
64
+ throw i.value = _, a = !0, "find it";
65
+ return n;
66
+ }, 0), a || (i.value = -1);
67
+ } catch {
68
+ }
69
+ };
70
+ z(
71
+ () => r.value,
72
+ () => {
73
+ t.collapsed && u();
74
+ }
75
+ ), z(
76
+ () => t.collapsed,
77
+ (s) => {
78
+ if (s) return u();
79
+ i.value = -1;
80
+ }
81
+ );
82
+ const I = f(() => typeof t.gap == "number" ? `${t.gap}px` : Array.isArray(t.gap) ? `${t.gap[1]}px ${t.gap[0]}px` : "unset"), W = f(() => ({
83
+ display: "grid",
84
+ gridGap: I.value,
85
+ gridTemplateColumns: `repeat(${d.value}, minmax(0, 1fr))`
86
+ }));
87
+ return E({ breakPoint: r }), (s, e) => (P(), R("div", {
88
+ style: Z(W.value)
89
+ }, [
90
+ D(s.$slots, "default")
91
+ ], 4));
92
+ }
93
+ }), q = H(N);
94
+ export {
95
+ q as Z
96
+ };
@@ -0,0 +1,36 @@
1
+ import { defineComponent as l, openBlock as i, createElementBlock as s, createElementVNode as a, createTextVNode as r, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as m, unref as f } from "vue";
2
+ import { D as d } from "./DatePicker-D8LPaPf6.js";
3
+ import { _ } from "./Button-Q7GkKwFF.js";
4
+ import { w as u } from "./utils-DBdiSe6_.js";
5
+ const v = { class: "info-pair" }, h = { class: "info-pair--title" }, I = {
6
+ key: 0,
7
+ class: "info-pair--title--tip"
8
+ }, E = /* @__PURE__ */ l({
9
+ name: "zh-info-pair",
10
+ __name: "InfoPair",
11
+ props: {
12
+ title: {},
13
+ value: {},
14
+ ellipsis: { type: Boolean },
15
+ tip: {}
16
+ },
17
+ setup(n) {
18
+ const o = n;
19
+ return (e, k) => (i(), s("div", v, [
20
+ a("div", h, [
21
+ r(t(o.title) + " ", 1),
22
+ e.tip ? (i(), s("div", I, t(e.tip), 1)) : p("", !0)
23
+ ]),
24
+ a("div", {
25
+ class: c(["info-pair--value", { ellipsis: e.ellipsis }])
26
+ }, [
27
+ m(e.$slots, "value", {}, () => [
28
+ r(t(o.value || f(d)), 1)
29
+ ], !0)
30
+ ], 2)
31
+ ]));
32
+ }
33
+ }), V = /* @__PURE__ */ _(E, [["__scopeId", "data-v-7c46e10e"]]), N = u(V);
34
+ export {
35
+ N as Z
36
+ };
@@ -0,0 +1,88 @@
1
+ import { defineComponent as b, useAttrs as v, useModel as k, openBlock as h, createElementBlock as I, normalizeClass as z, createVNode as S, unref as $, mergeProps as N, createSlots as x, renderList as _, withCtx as y, renderSlot as B, normalizeProps as M, guardReactiveProps as C, mergeModels as E, normalizeStyle as j } from "vue";
2
+ import { d as P } from "./vendor-mKFy0Hb6.js";
3
+ import { _ as U } from "./Button-Q7GkKwFF.js";
4
+ import { w as Z } from "./utils-DBdiSe6_.js";
5
+ const A = /* @__PURE__ */ b({
6
+ name: "zh-input",
7
+ __name: "Input",
8
+ props: /* @__PURE__ */ E({
9
+ style: {},
10
+ class: { default: "zh-default-input" },
11
+ size: { default: "default" },
12
+ className: {}
13
+ }, {
14
+ modelValue: {},
15
+ modelModifiers: {}
16
+ }),
17
+ emits: ["update:modelValue"],
18
+ setup(d) {
19
+ const o = v(), r = d, l = k(d, "modelValue"), s = () => {
20
+ (o.max || Number(o.max) === 0) && Number(l.value) >= o.max && (l.value = o.max.toString()), (o.min || Number(o.min) === 0) && Number(l.value) <= o.min && (l.value = o.min.toString());
21
+ };
22
+ return (m, p) => (h(), I("div", {
23
+ class: z(r.class)
24
+ }, [
25
+ S($(P), N(m.$attrs, {
26
+ modelValue: l.value,
27
+ "onUpdate:modelValue": p[0] || (p[0] = (a) => l.value = a),
28
+ size: m.size,
29
+ onBlur: s
30
+ }), x({ _: 2 }, [
31
+ _(m.$slots, (a, g) => ({
32
+ name: a,
33
+ fn: y((t) => [
34
+ B(m.$slots, a, M(C(t)), void 0, !0)
35
+ ])
36
+ }))
37
+ ]), 1040, ["modelValue", "size"])
38
+ ], 2));
39
+ }
40
+ }), H = /* @__PURE__ */ U(A, [["__scopeId", "data-v-75a9ec9f"]]), G = Z(H), L = /* @__PURE__ */ b({
41
+ name: "zh-input-number",
42
+ __name: "InputNumber",
43
+ props: {
44
+ style: {},
45
+ class: {},
46
+ modelValue: {}
47
+ },
48
+ emits: ["update:modelValue"],
49
+ setup(d, { emit: o }) {
50
+ const r = d, l = o, s = v(), m = (t, n = 0, u = 0, c = 0) => {
51
+ let e = (t == null ? void 0 : t.toString()) ?? "", i, f, V;
52
+ return u === 0 ? (e = e.replace(/[^\d]/g, ""), e = e.replace(/^0\d+/g, "0"), n !== 0 && (e = e.slice(0, n))) : (e = e.replace(/[^\-\d.]/g, ""), e = e.replace(/^[^\-\d]/g, ""), e = e.replace(/\.{2}/g, "."), e = e.replace(/^0(\d+)/g, "$1"), i = e.split(".") || [], i.length > 1 ? (n === 0 ? f = i[0] : f = i[0].slice(0, n), V = i[1].slice(0, u), e = f + "." + V) : n !== 0 && (e = e.slice(0, n))), c !== 0 && (e = e.slice(0, c)), e;
53
+ }, p = () => {
54
+ r.modelValue === "" || r.modelValue === void 0 || (s.max && Number(r.modelValue) > s.max && l("update:modelValue", s.max.toString()), s.min && Number(r.modelValue) < s.min && l("update:modelValue", s.min.toString()));
55
+ }, a = (t) => t ? m(
56
+ t,
57
+ s.integer,
58
+ s.precision,
59
+ s.maxLength
60
+ ) : "", g = (t) => {
61
+ /^\d+\.0*$/.test((t == null ? void 0 : t.toString()) || "") || t === "" ? l("update:modelValue", a(t)) : l("update:modelValue", Number(a(t)));
62
+ };
63
+ return (t, n) => (h(), I("div", {
64
+ class: z(["input-number", r.class]),
65
+ style: j(r.style)
66
+ }, [
67
+ S($(P), N(t.$attrs, {
68
+ "model-value": r.modelValue,
69
+ "onUpdate:modelValue": g,
70
+ onBlur: p,
71
+ style: { width: "100%" },
72
+ formatter: a
73
+ }), x({ _: 2 }, [
74
+ _(Object.keys(t.$slots), (u) => ({
75
+ name: u,
76
+ fn: y((c) => [
77
+ B(t.$slots, u, M(C(c)), void 0, !0)
78
+ ])
79
+ }))
80
+ ]), 1040, ["model-value"])
81
+ ], 6));
82
+ }
83
+ }), O = /* @__PURE__ */ U(L, [["__scopeId", "data-v-32d536a9"]]), J = Z(O);
84
+ export {
85
+ O as I,
86
+ G as Z,
87
+ J as a
88
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as t, openBlock as a, createElementBlock as s, createElementVNode as o } from "vue";
2
+ import { _ as e } from "./Button-Q7GkKwFF.js";
3
+ import { w as i } from "./utils-DBdiSe6_.js";
4
+ const r = { class: "loading-box" }, c = /* @__PURE__ */ t({
5
+ name: "zh-loading",
6
+ __name: "Loading",
7
+ setup(p) {
8
+ return (_, n) => (a(), s("div", r, n[0] || (n[0] = [
9
+ o("div", { class: "loading-wrap" }, [
10
+ o("span", { class: "dot dot-spin" }, [
11
+ o("i"),
12
+ o("i"),
13
+ o("i"),
14
+ o("i")
15
+ ])
16
+ ], -1)
17
+ ])));
18
+ }
19
+ }), d = /* @__PURE__ */ e(c, [["__scopeId", "data-v-bcc04aa5"]]), g = i(d);
20
+ export {
21
+ g as Z
22
+ };
@@ -0,0 +1,100 @@
1
+ import { defineComponent as k, useModel as P, ref as m, openBlock as n, createBlock as p, mergeProps as r, withCtx as u, createElementBlock as w, toDisplayString as V, createCommentVNode as v, resolveDynamicComponent as M, normalizeProps as C, unref as d, createVNode as h, mergeModels as g } from "vue";
2
+ import { e as F, f as I, d as z } from "./vendor-mKFy0Hb6.js";
3
+ import { z as E } from "./Dialog-BASeD5f8.js";
4
+ import { _ } from "./Button-Q7GkKwFF.js";
5
+ import { w as A } from "./utils-DBdiSe6_.js";
6
+ const D = {
7
+ key: 0,
8
+ class: "tips"
9
+ }, T = /* @__PURE__ */ k({
10
+ name: "zh-message-box",
11
+ __name: "MessageBox",
12
+ props: /* @__PURE__ */ g({
13
+ title: {},
14
+ subtitle: {},
15
+ tip: {},
16
+ placeholder: {},
17
+ formItemProps: {},
18
+ formProps: {},
19
+ inputProps: {},
20
+ closeOnClickModal: { type: Boolean },
21
+ callBack: { type: Function },
22
+ onAction: { type: Function },
23
+ onVanish: { type: Function },
24
+ submitText: {},
25
+ render: { type: Function },
26
+ maxlength: {},
27
+ renderProps: {}
28
+ }, {
29
+ visible: { type: Boolean, default: !0 },
30
+ visibleModifiers: {}
31
+ }),
32
+ emits: /* @__PURE__ */ g(["action", "vanish"], ["update:visible"]),
33
+ setup(c, { emit: y }) {
34
+ const t = c, i = y, l = P(c, "visible"), f = m(), s = m({
35
+ textarea: ""
36
+ }), x = m({
37
+ textarea: [{ validator: (e, a, o) => {
38
+ a || o(t.placeholder), o();
39
+ }, trigger: ["blur", "change"] }]
40
+ }), b = async () => {
41
+ var e;
42
+ t.placeholder ? (e = f.value) == null || e.validate(async (a) => {
43
+ if (a)
44
+ try {
45
+ if (t.callBack) {
46
+ const o = await t.callBack(s.value.textarea);
47
+ console.log(o);
48
+ }
49
+ i("action", "submit"), l.value = !1;
50
+ } catch (o) {
51
+ console.log(o);
52
+ }
53
+ }) : (i("action", "submit"), l.value = !1);
54
+ }, B = () => {
55
+ i("action", "cancel"), l.value = !1;
56
+ };
57
+ return (e, a) => (n(), p(E, r({
58
+ modelValue: l.value,
59
+ "onUpdate:modelValue": a[1] || (a[1] = (o) => l.value = o),
60
+ width: "544"
61
+ }, t, {
62
+ onSubmit: b,
63
+ onClose: B
64
+ }), {
65
+ default: u(() => [
66
+ e.tip ? (n(), w("div", D, V(e.tip), 1)) : v("", !0),
67
+ e.render ? (n(), p(M(e.render), C(r({ key: 1 }, t.renderProps)), null, 16)) : e.placeholder ? (n(), p(d(F), r({
68
+ key: 2,
69
+ ref_key: "formRef",
70
+ ref: f,
71
+ model: s.value,
72
+ rules: x.value
73
+ }, t.formProps), {
74
+ default: u(() => [
75
+ h(d(I), r({ prop: "textarea" }, t.formItemProps), {
76
+ default: u(() => [
77
+ h(d(z), r({
78
+ modelValue: s.value.textarea,
79
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => s.value.textarea = o),
80
+ style: { width: "100%" },
81
+ rows: 4,
82
+ type: "textarea",
83
+ placeholder: e.placeholder,
84
+ maxlength: t.maxlength || 100,
85
+ "show-word-limit": ""
86
+ }, e.inputProps), null, 16, ["modelValue", "placeholder", "maxlength"])
87
+ ]),
88
+ _: 1
89
+ }, 16)
90
+ ]),
91
+ _: 1
92
+ }, 16, ["model", "rules"])) : v("", !0)
93
+ ]),
94
+ _: 1
95
+ }, 16, ["modelValue"]));
96
+ }
97
+ }), N = /* @__PURE__ */ _(T, [["__scopeId", "data-v-1903b5ef"]]), q = A(N);
98
+ export {
99
+ q as Z
100
+ };