sakana-element 2.0.2 → 2.1.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.
Files changed (35) hide show
  1. package/dist/es/{Alert-D4jZO-Gv.js → Alert-C5X-XFGJ.js} +1 -1
  2. package/dist/es/Button-DTik2ZP6.js +33 -0
  3. package/dist/es/{Collapse-CgadjkRS.js → Collapse-l_8qKOBG.js} +1 -1
  4. package/dist/es/Dropdown-ZjZ0qSn2.js +40 -0
  5. package/dist/es/{Form-X4dNzwFt.js → Form-pxRZxseS.js} +1 -1
  6. package/dist/es/Icon-UBaqO2nY.js +27 -0
  7. package/dist/es/{Input-C0g1h9x2.js → Input-BJoBaFXa.js} +3 -3
  8. package/dist/es/{Loading-Cv4Fsu-C.js → Loading-BJJBJhg3.js} +2 -2
  9. package/dist/es/{Message-BuoSEEVc.js → Message-CqBKW0c8.js} +41 -41
  10. package/dist/es/Notification-CVACM2cj.js +58 -0
  11. package/dist/es/{Popconfirm-mMYpa7O6.js → Popconfirm-CW8oRycq.js} +3 -3
  12. package/dist/es/{Select-SRw_b6I2.js → Select-C7mwByXa.js} +4 -4
  13. package/dist/es/{Switch-bhJBaSI7.js → Switch-CgFPFC3j.js} +1 -1
  14. package/dist/es/Tooltip-D9rQ4LEg.js +74 -0
  15. package/dist/es/hooks-DNMt3QPi.js +104 -0
  16. package/dist/es/index.js +55 -51
  17. package/dist/index.css +1 -1
  18. package/dist/theme/Button.css +508 -116
  19. package/dist/theme/Notification.css +20 -20
  20. package/dist/theme/Tooltip.css +10 -10
  21. package/dist/types/components/Button/types.d.ts +3 -0
  22. package/dist/types/components/Icon/icons/pixelarticons-all.d.ts +1 -0
  23. package/dist/types/core/index.d.ts +1 -0
  24. package/dist/umd/index.css +1 -1
  25. package/dist/umd/index.css.gz +0 -0
  26. package/dist/umd/index.umd.cjs +12 -12
  27. package/dist/umd/index.umd.cjs.gz +0 -0
  28. package/package.json +11 -3
  29. package/dist/es/Button-l3ljgd74.js +0 -33
  30. package/dist/es/Dropdown-DBqye5wx.js +0 -38
  31. package/dist/es/Icon-4XdUD4qc.js +0 -27
  32. package/dist/es/Notification-Bv_vDOpB.js +0 -58
  33. package/dist/es/Tooltip-CUOZC7JN.js +0 -74
  34. package/dist/es/hooks-qpAqkY5H.js +0 -64
  35. /package/dist/types/components/Button/{contants.d.ts → constants.d.ts} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { t as e, b as o, R as t, c as n } from "./utils-340oIQ8K.js";
2
- import { defineComponent as s, ref as a, computed as l, watch as c, onMounted as r, createBlock as i, openBlock as u, Transition as p, withCtx as d, withDirectives as f, createElementVNode as m, normalizeStyle as y, normalizeClass as g, createVNode as x, createElementBlock as v, createCommentVNode as b, renderSlot as B, unref as h, withModifiers as _, vShow as C, shallowReactive as k, isVNode as w, h as I, render as T, reactive as P, nextTick as z, createTextVNode as $, toDisplayString as M, resolveDynamicComponent as O, withKeys as j } from "vue";
3
- import { e as A, f as L, d as V, u as E } from "./hooks-qpAqkY5H.js";
4
- import { P as D } from "./Icon-4XdUD4qc.js";
2
+ import { defineComponent as s, ref as a, computed as l, watch as c, onMounted as i, createBlock as r, openBlock as u, Transition as p, withCtx as d, withDirectives as f, createElementVNode as m, normalizeStyle as y, normalizeClass as g, createVNode as v, createElementBlock as x, createCommentVNode as b, renderSlot as B, unref as h, withModifiers as _, vShow as C, shallowReactive as k, isVNode as w, h as I, render as T, reactive as P, nextTick as z, createTextVNode as $, toDisplayString as M, resolveDynamicComponent as O, withKeys as j } from "vue";
3
+ import { e as A, f as L, d as V, u as E } from "./hooks-DNMt3QPi.js";
4
+ import { P as D } from "./Icon-UBaqO2nY.js";
5
5
  import { v as R, u as N, f as K, d as S, w as Z, g as H, x as U, i as q, y as F, z as G, A as J, B as Q } from "./vendor-DXmGx29U.js";
6
- import { b as W } from "./Button-l3ljgd74.js";
7
- import { _ as X } from "./Input-C0g1h9x2.js";
6
+ import { b as W } from "./Button-DTik2ZP6.js";
7
+ import { _ as X } from "./Input-BJoBaFXa.js";
8
8
  import { P as Y } from "./Overlay-C1k4Jcl7.js";
9
- const ee = { class: "px-message__content" }, oe = { key: 0, class: "px-message__close" }, te = s({ name: "PxMessage", __name: "Message", props: { id: {}, message: {}, duration: { default: 3e3 }, showClose: { type: Boolean }, center: { type: Boolean }, type: { default: "info" }, offset: { default: 10 }, zIndex: {}, transitionName: { default: "fade-up" }, onDestory: {} }, setup(n2, { expose: s2 }) {
9
+ const ee = ["aria-live"], oe = { class: "px-message__content" }, te = { key: 0, class: "px-message__close" }, ne = s({ name: "PxMessage", __name: "Message", props: { id: {}, message: {}, duration: { default: 3e3 }, showClose: { type: Boolean }, center: { type: Boolean }, type: { default: "info" }, offset: { default: 10 }, zIndex: {}, transitionName: { default: "fade-up" }, onDestory: {} }, setup(n2, { expose: s2 }) {
10
10
  const k2 = n2, w2 = a(false), I2 = a(), T2 = a(0), { topOffset: P2, bottomOffset: z2 } = A({ getLastBottomOffset: R(re, k2), offset: k2.offset, boxHeight: T2 }), $2 = l((() => e.get(k2.type) ?? "circle-info")), M2 = l((() => ({ top: o(P2.value), zIndex: k2.zIndex })));
11
11
  let O2;
12
12
  function j2() {
@@ -23,38 +23,38 @@ const ee = { class: "px-message__content" }, oe = { key: 0, class: "px-message__
23
23
  })), L(document, "keydown", ((e2) => {
24
24
  const { code: o2 } = e2;
25
25
  "Escape" === o2 && E2();
26
- })), r((() => {
26
+ })), i((() => {
27
27
  w2.value = true, j2();
28
- })), s2({ close: E2, bottomOffset: z2 }), (e2, o2) => (u(), i(p, { name: e2.transitionName, onEnter: o2[0] || (o2[0] = (e3) => T2.value = I2.value.getBoundingClientRect().height), onAfterLeave: o2[1] || (o2[1] = (o3) => !w2.value && e2.onDestory()) }, { default: d((() => [f(m("div", { ref_key: "messageRef", ref: I2, class: g(["px-message", { [`px-message--${e2.type}`]: e2.type, "is-close": e2.showClose, "text-center": e2.center }]), style: y(M2.value), role: "alert", onMouseenter: V2, onMouseleave: j2 }, [x(D, { class: "px-message__icon", icon: $2.value }, null, 8, ["icon"]), m("div", ee, [B(e2.$slots, "default", {}, (() => [e2.message ? (u(), i(h(t), { key: 0, vNode: e2.message }, null, 8, ["vNode"])) : b("", true)]))]), e2.showClose ? (u(), v("div", oe, [x(D, { icon: "close", onClick: _(E2, ["stop"]) })])) : b("", true)], 38), [[C, w2.value]])])), _: 3 }, 8, ["name"]));
29
- } }), ne = ["info", "success", "warning", "danger", "error"], se = k([]), { nextZIndex: ae } = V(), le = { type: "info", duration: 3e3, offset: 10, transitionName: "fade-up" }, ce = (e2) => {
28
+ })), s2({ close: E2, bottomOffset: z2 }), (e2, o2) => (u(), r(p, { name: e2.transitionName, onEnter: o2[0] || (o2[0] = (e3) => T2.value = I2.value.getBoundingClientRect().height), onAfterLeave: o2[1] || (o2[1] = (o3) => !w2.value && e2.onDestory()) }, { default: d((() => [f(m("div", { ref_key: "messageRef", ref: I2, class: g(["px-message", { [`px-message--${e2.type}`]: e2.type, "is-close": e2.showClose, "text-center": e2.center }]), style: y(M2.value), role: "alert", "aria-live": "danger" === e2.type || "warning" === e2.type ? "assertive" : "polite", onMouseenter: V2, onMouseleave: j2 }, [v(D, { class: "px-message__icon", icon: $2.value }, null, 8, ["icon"]), m("div", oe, [B(e2.$slots, "default", {}, (() => [e2.message ? (u(), r(h(t), { key: 0, vNode: e2.message }, null, 8, ["vNode"])) : b("", true)]))]), e2.showClose ? (u(), x("div", te, [v(D, { icon: "close", onClick: _(E2, ["stop"]) })])) : b("", true)], 46, ee), [[C, w2.value]])])), _: 3 }, 8, ["name"]));
29
+ } }), se = ["info", "success", "warning", "danger", "error"], ae = k([]), { nextZIndex: le } = V(), ce = { type: "info", duration: 3e3, offset: 10, transitionName: "fade-up" }, ie = (e2) => {
30
30
  const o2 = !e2 || w(e2) || S(e2) ? { message: e2 } : e2;
31
- return { ...le, ...o2 };
31
+ return { ...ce, ...o2 };
32
32
  };
33
33
  function re() {
34
- const e2 = Z(se, { id: this.id });
35
- return e2 <= 0 ? 0 : H(se, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
34
+ const e2 = Z(ae, { id: this.id });
35
+ return e2 <= 0 ? 0 : H(ae, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
36
36
  }
37
- const ie = (e2 = {}) => ((e3) => {
38
- const o2 = E().value, t2 = document.createElement("div"), n2 = { ...e3, id: o2, zIndex: ae(), onDestory: () => {
39
- const e4 = Z(se, { id: o2 });
40
- -1 !== e4 && (se.splice(e4, 1), T(null, t2));
41
- } }, s2 = I(te, n2);
37
+ const ue = (e2 = {}) => ((e3) => {
38
+ const o2 = E().value, t2 = document.createElement("div"), n2 = { ...e3, id: o2, zIndex: le(), onDestory: () => {
39
+ const e4 = Z(ae, { id: o2 });
40
+ -1 !== e4 && (ae.splice(e4, 1), T(null, t2));
41
+ } }, s2 = I(ne, n2);
42
42
  T(s2, t2), document.body.appendChild(t2.firstElementChild);
43
43
  const a2 = s2.component, l2 = { close: () => a2.exposed.close() }, c2 = { props: n2, id: o2, vm: a2, vnode: s2, handler: l2 };
44
- return se.push(c2), c2;
45
- })(ce(e2)).handler;
46
- K(ne, ((e2) => {
47
- U(ie, e2, ((o2) => {
48
- const t2 = ce(o2);
49
- return ie({ ...t2, type: e2 });
44
+ return ae.push(c2), c2;
45
+ })(ie(e2)).handler;
46
+ K(se, ((e2) => {
47
+ U(ue, e2, ((o2) => {
48
+ const t2 = ie(o2);
49
+ return ue({ ...t2, type: e2 });
50
50
  }));
51
- })), ie.closeAll = function(e2) {
52
- K(se, ((o2) => {
51
+ })), ue.closeAll = function(e2) {
52
+ K(ae, ((o2) => {
53
53
  e2 ? o2.props.type === e2 && o2.handler.close() : o2.handler.close();
54
54
  }));
55
55
  };
56
- const ue = n(ie, "$message"), pe = { class: "px-message-box__title" }, de = { class: "px-message-box__content" }, fe = { key: 1, class: "px-message-box__message" }, me = { class: "px-message-box__input" }, ye = { class: "px-message-box__footer" }, ge = s({ name: "PxMessageBox", inheritAttrs: false, __name: "MessageBox", props: { visible: {}, doClose: {}, doAction: {}, destroy: {}, title: {}, message: {}, type: {}, boxType: { default: "" }, icon: {}, callback: {}, showClose: { type: Boolean, default: true }, showInput: { type: Boolean }, showCancelButton: { type: Boolean }, showConfirmButton: { type: Boolean, default: true }, cancelButtonText: { default: "Cancel" }, confirmButtonText: { default: "Ok" }, cancelButtonLoading: { type: Boolean }, confirmButtonLoading: { type: Boolean }, cancelButtonDisabled: { type: Boolean }, confirmButtonDisabled: { type: Boolean }, cancelButtonType: {}, confirmButtonType: { default: "primary" }, roundButton: { type: Boolean, default: false }, center: { type: Boolean }, lockScroll: { type: Boolean, default: true }, closeOnClickModal: { type: Boolean, default: true }, inputPlaceholder: { default: "Please input..." }, inputValue: { default: "" }, inputType: {}, buttonSize: {}, beforeClose: {} }, setup(o2) {
57
- const t2 = o2, { doAction: n2 } = t2, { nextZIndex: s2 } = V(), r2 = a(), y2 = a(), k2 = E(), w2 = P({ ...t2, zIndex: s2() }), I2 = l((() => !!w2.message)), T2 = l((() => w2.icon ?? e.get(w2.type ?? "")));
56
+ const pe = n(ue, "$message"), de = { class: "px-message-box__title" }, fe = { class: "px-message-box__content" }, me = { key: 1, class: "px-message-box__message" }, ye = { class: "px-message-box__input" }, ge = { class: "px-message-box__footer" }, ve = s({ name: "PxMessageBox", inheritAttrs: false, __name: "MessageBox", props: { visible: {}, doClose: {}, doAction: {}, destroy: {}, title: {}, message: {}, type: {}, boxType: { default: "" }, icon: {}, callback: {}, showClose: { type: Boolean, default: true }, showInput: { type: Boolean }, showCancelButton: { type: Boolean }, showConfirmButton: { type: Boolean, default: true }, cancelButtonText: { default: "Cancel" }, confirmButtonText: { default: "Ok" }, cancelButtonLoading: { type: Boolean }, confirmButtonLoading: { type: Boolean }, cancelButtonDisabled: { type: Boolean }, confirmButtonDisabled: { type: Boolean }, cancelButtonType: {}, confirmButtonType: { default: "primary" }, roundButton: { type: Boolean, default: false }, center: { type: Boolean }, lockScroll: { type: Boolean, default: true }, closeOnClickModal: { type: Boolean, default: true }, inputPlaceholder: { default: "Please input..." }, inputValue: { default: "" }, inputType: {}, buttonSize: {}, beforeClose: {} }, setup(o2) {
57
+ const t2 = o2, { doAction: n2 } = t2, { nextZIndex: s2 } = V(), i2 = a(), y2 = a(), k2 = E(), w2 = P({ ...t2, zIndex: s2() }), I2 = l((() => !!w2.message)), T2 = l((() => w2.icon ?? e.get(w2.type ?? "")));
58
58
  function A2() {
59
59
  t2.closeOnClickModal && R2("close");
60
60
  }
@@ -75,15 +75,15 @@ const ue = n(ie, "$message"), pe = { class: "px-message-box__title" }, de = { cl
75
75
  var _a;
76
76
  (_a = y2.value) == null ? void 0 : _a.focus();
77
77
  }));
78
- })), (e2, o3) => (u(), i(p, { name: "fade-in-linear", onAfterLeave: e2.destroy }, { default: d((() => [f(x(Y, { "z-index": w2.zIndex, mask: "" }, { default: d((() => [m("div", { role: "dialog", class: "px-overlay-message-box", onClick: A2 }, [m("div", { ref: "rootRef", class: g(["px-message-box", { "is-center": w2.center }]), onClick: o3[5] || (o3[5] = _((() => {
79
- }), ["stop"])) }, [h(q)(w2.title) ? b("", true) : (u(), v("div", { key: 0, ref_key: "headerRef", ref: r2, class: g(["px-message-box__header", { "show-close": w2.showClose }]) }, [m("div", pe, [T2.value && w2.center ? (u(), i(D, { key: 0, class: g({ [`px-icon-${w2.type}`]: w2.type }), icon: T2.value }, null, 8, ["class", "icon"])) : b("", true), $(" " + M(w2.title), 1)]), e2.showClose ? (u(), v("button", { key: 0, class: "px-message-box__header-btn", onClick: _(N2, ["stop"]) }, [x(D, { icon: "close" })])) : b("", true)], 2)), m("div", de, [T2.value && !w2.center && I2.value ? (u(), i(D, { key: 0, class: g({ [`px-icon-${w2.type}`]: w2.type }), icon: T2.value }, null, 8, ["class", "icon"])) : b("", true), I2.value ? (u(), v("div", fe, [B(e2.$slots, "default", {}, (() => [(u(), i(O(w2.showInput ? "label" : "p"), { for: w2.showInput ? h(k2) : void 0 }, { default: d((() => [$(M(w2.message), 1)])), _: 1 }, 8, ["for"]))]))])) : b("", true)]), f(m("div", me, [x(X, { modelValue: w2.inputValue, "onUpdate:modelValue": o3[0] || (o3[0] = (e3) => w2.inputValue = e3), ref_key: "inputRef", ref: y2, placeholder: w2.inputPlaceholder, type: w2.inputType, onKeyup: j(L2, ["enter"]) }, null, 8, ["modelValue", "placeholder", "type"])], 512), [[C, w2.showInput]]), m("div", ye, [w2.showCancelButton ? (u(), i(W, { key: 0, class: "px-message-box__footer-btn px-message-box__cancel-btn", type: w2.cancelButtonType, round: w2.roundButton, loading: w2.cancelButtonLoading, onClick: o3[1] || (o3[1] = (e3) => R2("cancel")), onKeydown: o3[2] || (o3[2] = j(_(((e3) => R2("cancel")), ["prevent"]), ["enter"])) }, { default: d((() => [$(M(w2.cancelButtonText), 1)])), _: 1 }, 8, ["type", "round", "loading"])) : b("", true), f(x(W, { class: "px-message-box__footer-btn px-message-box__confirm-btn", type: w2.confirmButtonType ?? "primary", round: w2.roundButton, loading: w2.confirmButtonLoading, onClick: o3[3] || (o3[3] = (e3) => R2("confirm")), onKeydown: o3[4] || (o3[4] = j(_(((e3) => R2("confirm")), ["prevent"]), ["enter"])) }, { default: d((() => [$(M(w2.confirmButtonText), 1)])), _: 1 }, 8, ["type", "round", "loading"]), [[C, w2.showConfirmButton]])])], 2)])])), _: 3 }, 8, ["z-index"]), [[C, e2.visible.value]])])), _: 3 }, 8, ["onAfterLeave"]));
78
+ })), (e2, o3) => (u(), r(p, { name: "fade-in-linear", onAfterLeave: e2.destroy }, { default: d((() => [f(v(Y, { "z-index": w2.zIndex, mask: "" }, { default: d((() => [m("div", { role: "dialog", class: "px-overlay-message-box", onClick: A2 }, [m("div", { ref: "rootRef", class: g(["px-message-box", { "is-center": w2.center }]), onClick: o3[5] || (o3[5] = _((() => {
79
+ }), ["stop"])) }, [h(q)(w2.title) ? b("", true) : (u(), x("div", { key: 0, ref_key: "headerRef", ref: i2, class: g(["px-message-box__header", { "show-close": w2.showClose }]) }, [m("div", de, [T2.value && w2.center ? (u(), r(D, { key: 0, class: g({ [`px-icon-${w2.type}`]: w2.type }), icon: T2.value }, null, 8, ["class", "icon"])) : b("", true), $(" " + M(w2.title), 1)]), e2.showClose ? (u(), x("button", { key: 0, class: "px-message-box__header-btn", onClick: _(N2, ["stop"]) }, [v(D, { icon: "close" })])) : b("", true)], 2)), m("div", fe, [T2.value && !w2.center && I2.value ? (u(), r(D, { key: 0, class: g({ [`px-icon-${w2.type}`]: w2.type }), icon: T2.value }, null, 8, ["class", "icon"])) : b("", true), I2.value ? (u(), x("div", me, [B(e2.$slots, "default", {}, (() => [(u(), r(O(w2.showInput ? "label" : "p"), { for: w2.showInput ? h(k2) : void 0 }, { default: d((() => [$(M(w2.message), 1)])), _: 1 }, 8, ["for"]))]))])) : b("", true)]), f(m("div", ye, [v(X, { modelValue: w2.inputValue, "onUpdate:modelValue": o3[0] || (o3[0] = (e3) => w2.inputValue = e3), ref_key: "inputRef", ref: y2, placeholder: w2.inputPlaceholder, type: w2.inputType, onKeyup: j(L2, ["enter"]) }, null, 8, ["modelValue", "placeholder", "type"])], 512), [[C, w2.showInput]]), m("div", ge, [w2.showCancelButton ? (u(), r(W, { key: 0, class: "px-message-box__footer-btn px-message-box__cancel-btn", type: w2.cancelButtonType, round: w2.roundButton, loading: w2.cancelButtonLoading, onClick: o3[1] || (o3[1] = (e3) => R2("cancel")), onKeydown: o3[2] || (o3[2] = j(_(((e3) => R2("cancel")), ["prevent"]), ["enter"])) }, { default: d((() => [$(M(w2.cancelButtonText), 1)])), _: 1 }, 8, ["type", "round", "loading"])) : b("", true), f(v(W, { class: "px-message-box__footer-btn px-message-box__confirm-btn", type: w2.confirmButtonType ?? "primary", round: w2.roundButton, loading: w2.confirmButtonLoading, onClick: o3[3] || (o3[3] = (e3) => R2("confirm")), onKeydown: o3[4] || (o3[4] = j(_(((e3) => R2("confirm")), ["prevent"]), ["enter"])) }, { default: d((() => [$(M(w2.confirmButtonText), 1)])), _: 1 }, 8, ["type", "round", "loading"]), [[C, w2.showConfirmButton]])])], 2)])])), _: 3 }, 8, ["z-index"]), [[C, e2.visible.value]])])), _: 3 }, 8, ["onAfterLeave"]));
80
80
  } }), xe = /* @__PURE__ */ new Map();
81
- function ve(e2) {
81
+ function be(e2) {
82
82
  let o2;
83
83
  return S(e2) || w(e2) ? e2 = { message: e2 } : o2 = e2.callback, new Promise(((t2, n2) => {
84
84
  const s2 = (function(e3) {
85
85
  const o3 = document.createElement("div"), t3 = (function(e4, o4) {
86
- const t4 = a(false), n4 = F(e4 == null ? void 0 : e4.message) || w(e4 == null ? void 0 : e4.message), s3 = x(ge, { ...e4, visible: t4 }, n4 ? { default: (l2 = e4.message, F(l2) ? l2 : () => l2) } : void 0);
86
+ const t4 = a(false), n4 = F(e4 == null ? void 0 : e4.message) || w(e4 == null ? void 0 : e4.message), s3 = v(ve, { ...e4, visible: t4 }, n4 ? { default: (l2 = e4.message, F(l2) ? l2 : () => l2) } : void 0);
87
87
  var l2;
88
88
  return T(s3, o4), document.body.appendChild(o4.firstElementChild), s3.component;
89
89
  })({ ...e3, doClose: () => {
@@ -100,24 +100,24 @@ function ve(e2) {
100
100
  xe.set(s2, { options: e2, callback: o2, resolve: t2, reject: n2 });
101
101
  }));
102
102
  }
103
- const be = { alert: { closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } };
103
+ const Be = { alert: { closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } };
104
104
  K(["alert", "confirm", "prompt"], ((e2) => {
105
- return U(ve, e2, (o2 = e2, (e3, t2, n2) => {
105
+ return U(be, e2, (o2 = e2, (e3, t2, n2) => {
106
106
  let s2 = "";
107
- return J(t2) ? (n2 = t2, s2 = "") : s2 = Q(t2) ? "" : t2, ve(G({ title: s2, message: e3, type: "", boxType: o2, ...be[o2] }, n2));
107
+ return J(t2) ? (n2 = t2, s2 = "") : s2 = Q(t2) ? "" : t2, be(G({ title: s2, message: e3, type: "", boxType: o2, ...Be[o2] }, n2));
108
108
  }));
109
109
  var o2;
110
- })), U(ve, "close", (() => {
110
+ })), U(be, "close", (() => {
111
111
  xe.forEach(((e2, o2) => {
112
112
  o2.doClose();
113
113
  })), xe.clear();
114
114
  }));
115
- const Be = ve;
116
- U(Be, "install", ((e2) => {
117
- e2.config.globalProperties.$msgbox = ve, e2.config.globalProperties.$messagebox = ve, e2.config.globalProperties.$alert = ve.alert, e2.config.globalProperties.$confirm = ve.confirm, e2.config.globalProperties.$prompt = ve.prompt;
115
+ const he = be;
116
+ U(he, "install", ((e2) => {
117
+ e2.config.globalProperties.$msgbox = be, e2.config.globalProperties.$messagebox = be, e2.config.globalProperties.$alert = be.alert, e2.config.globalProperties.$confirm = be.confirm, e2.config.globalProperties.$prompt = be.prompt;
118
118
  }));
119
119
  export {
120
- ue as P,
121
- Be as a,
122
- ne as m
120
+ pe as P,
121
+ he as a,
122
+ se as m
123
123
  };
@@ -0,0 +1,58 @@
1
+ import { t, b as e, R as o, _ as n, c as s } from "./utils-340oIQ8K.js";
2
+ import { defineComponent as i, ref as a, computed as l, onMounted as c, createBlock as f, openBlock as r, Transition as p, withCtx as d, withDirectives as u, createElementVNode as m, normalizeStyle as v, normalizeClass as h, createCommentVNode as g, createElementBlock as x, toDisplayString as y, renderSlot as _, unref as C, createVNode as k, withModifiers as b, vShow as w, isVNode as I, h as N, render as O, shallowReactive as j } from "vue";
3
+ import { e as z, d as E, u as $ } from "./hooks-DNMt3QPi.js";
4
+ import { P as B } from "./Icon-UBaqO2nY.js";
5
+ import { v as D, u as M, f as P, d as R, w as A, g as L, x as W } from "./vendor-DXmGx29U.js";
6
+ const H = ["aria-live"], T = { class: "px-notification__text" }, Z = { class: "px-notification__title" }, q = { class: "px-notification__content" }, F = { key: 1, class: "px-notification__close" }, G = n(i({ name: "PxNotification", __name: "Notification", props: { title: {}, id: {}, zIndex: {}, position: { default: "top-right" }, type: { default: "info" }, message: {}, duration: { default: 3e3 }, showClose: { type: Boolean, default: true }, offset: { default: 20 }, transitionName: { default: "fade" }, icon: {}, onClick: {}, onClose: {}, onDestory: {} }, setup(n2, { expose: s2 }) {
7
+ const i2 = n2, I2 = a(false), N2 = a(), O2 = a(0), { topOffset: j2, bottomOffset: E2 } = z({ getLastBottomOffset: D(tt, i2), offset: i2.offset, boxHeight: O2 }), $2 = l((() => t.get(i2.type) ?? "circle-info")), P2 = l((() => i2.position.endsWith("right") ? "right" : "left")), R2 = l((() => i2.position.startsWith("top") ? "top" : "bottom")), A2 = l((() => ({ [R2.value]: e(j2.value), zIndex: i2.zIndex })));
8
+ let L2;
9
+ function W2() {
10
+ 0 !== i2.duration && (L2 = M(J2, i2.duration));
11
+ }
12
+ function G2() {
13
+ clearTimeout(L2);
14
+ }
15
+ function J2() {
16
+ I2.value = false;
17
+ }
18
+ return c((() => {
19
+ I2.value = true, W2();
20
+ })), s2({ bottomOffset: E2, close: J2 }), (t2, e2) => (r(), f(p, { name: `px-notification-${t2.transitionName}`, onAfterLeave: e2[1] || (e2[1] = (e3) => !I2.value && t2.onDestory()), onEnter: e2[2] || (e2[2] = (t3) => O2.value = N2.value.getBoundingClientRect().height) }, { default: d((() => [u(m("div", { ref_key: "notifyRef", ref: N2, class: h(["px-notification", { [`px-notification--${t2.type}`]: t2.type, [P2.value]: true, "show-close": t2.showClose }]), style: v(A2.value), role: "alert", "aria-live": "danger" === t2.type || "warning" === t2.type ? "assertive" : "polite", onClick: e2[0] || (e2[0] = (...e3) => t2.onClick && t2.onClick(...e3)), onMouseenter: G2, onMouseleave: W2 }, [$2.value ? (r(), f(B, { key: 0, icon: $2.value, class: "px-notification__icon" }, null, 8, ["icon"])) : g("", true), m("div", T, [m("div", Z, y(t2.title), 1), m("div", q, [_(t2.$slots, "default", {}, (() => [t2.message ? (r(), f(C(o), { key: 0, vNode: t2.message }, null, 8, ["vNode"])) : g("", true)]), true)])]), t2.showClose ? (r(), x("div", F, [k(B, { icon: "close", onClick: b(J2, ["stop"]) })])) : g("", true)], 46, H), [[w, I2.value]])])), _: 3 }, 8, ["name"]));
21
+ } }), [["__scopeId", "data-v-2111f4f7"]]), J = ["info", "success", "warning", "danger"], K = ["top-right", "top-left", "bottom-right", "bottom-left"], Q = /* @__PURE__ */ new Map();
22
+ P(K, ((t2) => {
23
+ Q.set(t2, j([]));
24
+ }));
25
+ const { nextZIndex: S } = E(), U = { type: "info", duration: 3e3, offset: 20, transitionName: "fade", showClose: true }, V = (t2) => {
26
+ const e2 = !t2 || I(t2) || R(t2) ? { message: t2 } : t2;
27
+ return { ...U, ...e2 };
28
+ }, X = (t2) => Q.get(t2), Y = (t2 = {}) => ((t3) => {
29
+ const e2 = $().value, o2 = document.createElement("div"), n2 = X(t3.position || "top-right"), s2 = { ...t3, id: e2, zIndex: S(), onDestory: () => {
30
+ const t4 = A(n2, { id: e2 });
31
+ -1 !== t4 && (n2.splice(t4, 1), O(null, o2));
32
+ } }, i2 = N(G, s2);
33
+ O(i2, o2), document.body.appendChild(o2.firstElementChild);
34
+ const a2 = i2.component, l2 = { close: () => a2.exposed.close() }, c2 = { props: s2, id: e2, vm: a2, vnode: i2, handler: l2 };
35
+ return n2.push(c2), c2;
36
+ })(V(t2)).handler;
37
+ function tt() {
38
+ const t2 = X(this.position || "top-right"), e2 = A(t2, { id: this.id });
39
+ return e2 <= 0 ? 0 : L(t2, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
40
+ }
41
+ P(J, ((t2) => {
42
+ W(Y, t2, ((e2) => {
43
+ const o2 = V(e2);
44
+ return Y({ ...o2, type: t2 });
45
+ }));
46
+ })), Y.closeAll = function(t2) {
47
+ Q.forEach(((e2) => {
48
+ P(e2, ((e3) => {
49
+ t2 ? e3.props.type === t2 && e3.handler.close() : e3.handler.close();
50
+ }));
51
+ }));
52
+ };
53
+ const et = s(Y, "$notify");
54
+ export {
55
+ et as P,
56
+ K as a,
57
+ J as n
58
+ };
@@ -1,8 +1,8 @@
1
1
  import { b as o, _ as e, w as t } from "./utils-340oIQ8K.js";
2
2
  import { defineComponent as n, ref as i, computed as c, createBlock as l, openBlock as a, createSlots as r, withCtx as f, createElementVNode as s, normalizeStyle as p, createCommentVNode as m, createTextVNode as u, toDisplayString as d, createVNode as _, renderSlot as y } from "vue";
3
- import { b as v } from "./Button-l3ljgd74.js";
4
- import { P as x } from "./Icon-4XdUD4qc.js";
5
- import { T as h } from "./Tooltip-CUOZC7JN.js";
3
+ import { b as v } from "./Button-DTik2ZP6.js";
4
+ import { P as x } from "./Icon-UBaqO2nY.js";
5
+ import { T as h } from "./Tooltip-D9rQ4LEg.js";
6
6
  const B = { class: "px-popconfirm__main" }, T = { class: "px-popconfirm__action" }, k = t(e(n({ name: "PxPopconfirm", __name: "Popconfirm", props: { title: { default: "" }, confirmButtonText: {}, cancelButtonText: {}, confirmButtonType: { default: "primary" }, cancelButtonType: {}, icon: { default: "question-circle" }, iconColor: { default: "#f90" }, hideIcon: { type: Boolean }, hideAfter: { default: 200 }, width: { default: 150 } }, emits: ["confirm", "cancel"], setup(e2, { emit: t2 }) {
7
7
  const n2 = e2, k2 = t2, C = i(), P = c((() => ({ width: o(n2.width) })));
8
8
  function j() {
@@ -1,10 +1,10 @@
1
1
  import { R as e, _ as l, w as a } from "./utils-340oIQ8K.js";
2
2
  import { defineComponent as t, inject as o, computed as i, createElementBlock as n, openBlock as s, withModifiers as u, normalizeClass as d, renderSlot as r, createVNode as p, unref as c, useSlots as h, ref as v, reactive as f, watch as m, onMounted as b, provide as g, withCtx as y, createCommentVNode as x, createElementVNode as _, Fragment as V, renderList as I, createBlock as w, mergeProps as M, nextTick as k, h as O } from "vue";
3
3
  import { C as S, D as L, g as B, b as D, s as N, e as j, E as C, F, f as R, y as E, q as H, z as P, i as z, G as W, c as $ } from "./vendor-DXmGx29U.js";
4
- import { u as q, c as A, a as T } from "./hooks-qpAqkY5H.js";
5
- import { P as U } from "./Icon-4XdUD4qc.js";
6
- import { _ as G } from "./Input-C0g1h9x2.js";
7
- import { T as K } from "./Tooltip-CUOZC7JN.js";
4
+ import { u as q, c as A, a as T } from "./hooks-DNMt3QPi.js";
5
+ import { P as U } from "./Icon-UBaqO2nY.js";
6
+ import { _ as G } from "./Input-BJoBaFXa.js";
7
+ import { T as K } from "./Tooltip-D9rQ4LEg.js";
8
8
  const J = Symbol("selectContext"), Q = { modifiers: [{ name: "offset", options: { offset: [0, 9] } }, { name: "sameWidth", enabled: true, fn: ({ state: e2 }) => {
9
9
  e2.styles.popper.width = `${e2.rects.reference.width}px`;
10
10
  }, phase: "beforeWrite", requires: ["computeStyles"] }] }, X = ["id"], Y = l(t({ name: "PxOption", __name: "Option", props: { value: {}, label: {}, disabled: { type: Boolean, default: false } }, setup(l2) {
@@ -1,6 +1,6 @@
1
1
  import { w as e } from "./utils-340oIQ8K.js";
2
2
  import { defineComponent as a, computed as i, ref as t, onMounted as c, watch as l, createElementBlock as s, openBlock as u, normalizeClass as n, createElementVNode as o, withKeys as d, unref as r, createCommentVNode as v, toDisplayString as p } from "vue";
3
- import { u as h } from "./hooks-qpAqkY5H.js";
3
+ import { u as h } from "./hooks-DNMt3QPi.js";
4
4
  const m = ["id", "name", "disabled", "checked"], x = { class: "px-switch__core" }, _ = { class: "px-switch__core-inner" }, f = { key: 0, class: "px-switch__core-inner-text" }, w = e(a({ name: "PxSwitch", inheritAttrs: false, __name: "Switch", props: { modelValue: { type: [Boolean, String, Number] }, disabled: { type: Boolean }, activeText: {}, inactiveText: {}, activeValue: { type: [Boolean, String, Number], default: true }, inactiveValue: { type: [Boolean, String, Number], default: false }, name: {}, id: {}, size: {} }, emits: ["update:modelValue", "change"], setup(e2, { expose: a2, emit: w2 }) {
5
5
  const k = e2, b = w2, V = i((() => k.disabled)), y = t(k.modelValue), T = t(), g = h().value, S = i((() => y.value === k.activeValue));
6
6
  function B() {
@@ -0,0 +1,74 @@
1
+ import { _ as e, w as t } from "./utils-340oIQ8K.js";
2
+ import { onMounted as o, watch as a, onUnmounted as i, defineComponent as l, ref as r, computed as n, watchEffect as u, createElementBlock as s, openBlock as v, mergeProps as c, toHandlers as p, renderSlot as d, createVNode as f, unref as g, Transition as m, withCtx as h, createCommentVNode as _, createElementVNode as k, createTextVNode as y, toDisplayString as T } from "vue";
3
+ import { createPopper as b } from "@popperjs/core";
4
+ import { u as x, a as w } from "./hooks-DNMt3QPi.js";
5
+ import { H as j, f as B, E, v as L } from "./vendor-DXmGx29U.js";
6
+ const N = ["aria-describedby"], R = ["id"], $ = e(l({ name: "PxTooltip", __name: "Tooltip", props: { content: {}, trigger: { default: "hover" }, placement: { default: "bottom" }, manual: { type: Boolean }, disabled: { type: Boolean }, popperOptions: {}, transition: { default: "fade" }, showTimeout: { default: 0 }, hideTimeout: { default: 200 }, virtualRef: {}, virtualTriggering: { type: Boolean } }, emits: ["visible-change", "click-outside"], setup(e2, { expose: t2, emit: l2 }) {
7
+ const $2 = e2, O2 = l2, P = r(false), A = x("px-tooltip"), D = r({}), H = r({}), I = r({}), M = r(), q = r(), z = r(), C = n((() => $2.virtualTriggering ? $2.virtualRef : z.value)), F = n((() => ({ placement: $2.placement, modifiers: [{ name: "offset", options: { offset: [0, 9] } }], ...$2.popperOptions }))), G = n((() => "hover" === $2.trigger ? $2.showTimeout : 0)), J = n((() => "hover" === $2.trigger ? $2.hideTimeout : 0));
8
+ let K, Q, S;
9
+ function U() {
10
+ Q == null ? void 0 : Q.cancel(), K == null ? void 0 : K();
11
+ }
12
+ function V() {
13
+ K == null ? void 0 : K.cancel(), Q == null ? void 0 : Q();
14
+ }
15
+ function W() {
16
+ P.value ? V() : U();
17
+ }
18
+ function X(e3) {
19
+ $2.disabled || (P.value = e3, O2("visible-change", e3));
20
+ }
21
+ function Y() {
22
+ if (!$2.disabled && !$2.manual) return "hover" === $2.trigger ? (D.value.mouseenter = U, H.value.mouseleave = V, void (I.value.mouseenter = U)) : void ("click" !== $2.trigger ? "contextmenu" !== $2.trigger || (D.value.contextmenu = (e3) => {
23
+ e3.preventDefault(), U();
24
+ }) : D.value.click = W);
25
+ }
26
+ function Z() {
27
+ S == null ? void 0 : S.destroy(), S = null;
28
+ }
29
+ function ee() {
30
+ D.value = {}, H.value = {}, I.value = {}, Y();
31
+ }
32
+ const te = U, oe = () => {
33
+ K == null ? void 0 : K.cancel(), X(false);
34
+ };
35
+ return a(P, ((e3) => {
36
+ e3 && C.value && q.value && (S = b(C.value, q.value, F.value));
37
+ }), { flush: "post" }), a((() => $2.manual), ((e3) => {
38
+ e3 ? ee() : Y();
39
+ })), a((() => $2.trigger), (() => {
40
+ K == null ? void 0 : K.cancel(), P.value = false, O2("visible-change", false), ee();
41
+ })), u((() => {
42
+ $2.manual || Y(), K = E(L(X, null, true), G.value), Q = E(L(X, null, false), J.value);
43
+ })), w(M, (() => {
44
+ O2("click-outside"), "hover" === $2.trigger || $2.manual || P.value && V();
45
+ })), (function(e3, t3, l3) {
46
+ let r2, n2;
47
+ const u2 = /* @__PURE__ */ new Map(), s2 = () => {
48
+ const e4 = t3.value;
49
+ e4 && j(e4) && B(l3.value, ((t4, o2) => {
50
+ u2.set(o2, t4), e4.addEventListener(o2, t4);
51
+ }));
52
+ }, v2 = (e4) => {
53
+ const o2 = e4 ?? t3.value;
54
+ o2 && j(o2) && B(["mouseenter", "click", "contextmenu"], ((e5) => u2.has(e5) && o2.removeEventListener(e5, u2.get(e5))));
55
+ };
56
+ o((() => {
57
+ n2 = a((() => e3.virtualRef), ((t4, o2) => {
58
+ e3.virtualTriggering && (j(o2) && v2(o2), j(t4) && s2());
59
+ }), { immediate: true }), r2 = a(l3, (() => {
60
+ e3.virtualTriggering && (v2(), s2(), K == null ? void 0 : K.cancel(), X(false));
61
+ }), { deep: true });
62
+ })), i((() => {
63
+ r2 == null ? void 0 : r2(), n2 == null ? void 0 : n2();
64
+ }));
65
+ })($2, C, D), i((() => {
66
+ Z();
67
+ })), t2({ show: te, hide: oe, toggle: () => {
68
+ P.value ? oe() : te();
69
+ } }), (e3, t3) => (v(), s("div", c({ class: "px-tooltip", ref_key: "containerNode", ref: M }, p(H.value, true)), [e3.virtualTriggering ? d(e3.$slots, "default", { key: 1 }, void 0, true) : (v(), s("div", c({ key: 0, class: "px-tooltip__trigger", ref_key: "_triggerNode", ref: z }, p(D.value, true), { "aria-describedby": P.value ? g(A) : void 0 }), [d(e3.$slots, "default", {}, void 0, true)], 16, N)), f(m, { name: e3.transition, onAfterLeave: Z }, { default: h((() => [P.value ? (v(), s("div", c({ key: 0, class: "px-tooltip__popper", ref_key: "popperNode", ref: q }, p(I.value, true), { id: g(A), role: "tooltip" }), [d(e3.$slots, "content", {}, (() => [y(T(e3.content), 1)]), true), t3[0] || (t3[0] = k("div", { id: "arrow", "data-popper-arrow": "" }, null, -1))], 16, R)) : _("", true)])), _: 3 }, 8, ["name"])], 16));
70
+ } }), [["__scopeId", "data-v-77c52c17"]]), O = t($);
71
+ export {
72
+ O as P,
73
+ $ as T
74
+ };
@@ -0,0 +1,104 @@
1
+ import { isRef as e, watch as t, onMounted as n, onBeforeUnmount as a, unref as r, getCurrentInstance as o, useSlots as l, watchEffect as s, ref as u, computed as d, onUnmounted as c } from "vue";
2
+ import { f as i, y as v, k as f, z as m } from "./vendor-DXmGx29U.js";
3
+ function p(o2, l2, s2) {
4
+ e(o2) ? t(o2, ((e2, t2) => {
5
+ null == t2 || t2.removeEventListener(l2, s2), null == e2 || e2.addEventListener(l2, s2);
6
+ })) : n((() => null == o2 ? void 0 : o2.addEventListener(l2, s2))), a((() => {
7
+ var e2;
8
+ return null == (e2 = r(o2)) ? void 0 : e2.removeEventListener(l2, s2);
9
+ }));
10
+ }
11
+ function h(e2, t2) {
12
+ p(document, "click", ((n2) => {
13
+ e2.value && n2.target && (e2.value.contains(n2.target) || t2(n2));
14
+ }));
15
+ }
16
+ const g = (e2, t2) => i(e2, ((e3) => {
17
+ v(t2) && t2(e3), e3.children && g(e3.children, t2);
18
+ }));
19
+ function w() {
20
+ var e2, t2;
21
+ const n2 = /* @__PURE__ */ new Map(), a2 = o(), r2 = null == (t2 = null == (e2 = l()) ? void 0 : e2.default) ? void 0 : t2.call(e2);
22
+ s((() => {
23
+ (null == a2 ? void 0 : a2.props.disabled) ? g(r2 ?? [], ((e3) => {
24
+ (null == e3 ? void 0 : e3.props) && (n2.set(e3, f(e3.props)), e3.props = m(null == e3 ? void 0 : e3.props, { style: { cursor: "not-allowed", color: "var(--px-text-color-placeholder)" } }));
25
+ })) : g(r2 ?? [], ((e3) => {
26
+ n2.has(e3) && (e3.props = n2.get(e3));
27
+ }));
28
+ }));
29
+ }
30
+ function L(e2, { afterBlur: t2, beforeBlur: n2, afterFocus: a2 } = {}) {
31
+ const r2 = o(), { emit: l2 } = r2, s2 = u(), d2 = u(false);
32
+ return p(s2, "click", (() => {
33
+ var t3;
34
+ null == (t3 = e2.value) || t3.focus();
35
+ })), { wrapperRef: s2, isFocused: d2, handleFocus: (e3) => {
36
+ d2.value || (d2.value = true, l2("focus", e3), null == a2 || a2());
37
+ }, handleBlur: (e3) => {
38
+ var a3;
39
+ v(n2) && n2(e3) || e3.relatedTarget && (null == (a3 = s2.value) ? void 0 : a3.contains(e3.relatedTarget)) || (d2.value = false, l2("blur", e3), null == t2 || t2());
40
+ } };
41
+ }
42
+ const y = { prefix: Math.floor(1e4 * Math.random()), current: 0 };
43
+ function k(e2 = "er") {
44
+ return d((() => `${e2}-${y.prefix}-${y.current++}`));
45
+ }
46
+ function E(e2) {
47
+ const t2 = d((() => e2.getLastBottomOffset())), n2 = d((() => e2.offset + t2.value)), a2 = d((() => n2.value + e2.boxHeight.value));
48
+ return { topOffset: n2, bottomOffset: a2 };
49
+ }
50
+ const x = u(0);
51
+ function b(e2 = 2e3) {
52
+ const t2 = u(e2), n2 = d((() => x.value + t2.value));
53
+ return { initialValue: t2, currentZIndex: n2, nextZIndex: () => (x.value++, n2.value) };
54
+ }
55
+ function M() {
56
+ const e2 = u(false);
57
+ let t2 = null, a2 = null;
58
+ return n((() => {
59
+ "undefined" != typeof window && (t2 = window.matchMedia("(prefers-color-scheme: dark)"), e2.value = t2.matches, a2 = (t3) => {
60
+ e2.value = t3.matches;
61
+ }, t2.addEventListener ? t2.addEventListener("change", a2) : t2.addListener(a2));
62
+ })), c((() => {
63
+ t2 && a2 && (t2.removeEventListener ? t2.removeEventListener("change", a2) : t2.removeListener(a2));
64
+ })), { prefersDark: e2, prefers: u("light") };
65
+ }
66
+ const B = "px-theme", I = "px-dark", T = u("system"), F = u(false);
67
+ function O(e2) {
68
+ "undefined" != typeof document && (e2 ? document.documentElement.classList.add(I) : document.documentElement.classList.remove(I));
69
+ }
70
+ function S(e2) {
71
+ return "system" === e2 ? "undefined" != typeof window && window.matchMedia("(prefers-color-scheme: dark)").matches : "dark" === e2;
72
+ }
73
+ let $ = false;
74
+ function D() {
75
+ if (!$ && "undefined" != typeof window) {
76
+ !(function() {
77
+ if ("undefined" == typeof window) return;
78
+ const e4 = localStorage.getItem(B);
79
+ e4 && ["light", "dark", "system"].includes(e4) ? T.value = e4 : T.value = "system", F.value = S(T.value), O(F.value);
80
+ })(), $ = true;
81
+ const e3 = window.matchMedia("(prefers-color-scheme: dark)"), t2 = (e4) => {
82
+ "system" === T.value && (F.value = e4.matches, O(F.value));
83
+ };
84
+ e3.addEventListener ? e3.addEventListener("change", t2) : e3.addListener(t2);
85
+ }
86
+ const e2 = (e3) => {
87
+ T.value = e3, F.value = S(e3), O(F.value), "undefined" != typeof localStorage && localStorage.setItem(B, e3);
88
+ };
89
+ return { theme: d((() => T.value)), isDark: d((() => F.value)), setTheme: e2, toggleTheme: () => {
90
+ const t2 = F.value ? "light" : "dark";
91
+ e2(t2);
92
+ } };
93
+ }
94
+ export {
95
+ h as a,
96
+ w as b,
97
+ L as c,
98
+ b as d,
99
+ E as e,
100
+ p as f,
101
+ M as g,
102
+ D as h,
103
+ k as u
104
+ };