sakana-element 1.0.3 → 2.0.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.
Files changed (153) hide show
  1. package/dist/es/Alert-D4jZO-Gv.js +15 -0
  2. package/dist/es/Button-l3ljgd74.js +33 -0
  3. package/dist/es/Collapse-CgadjkRS.js +38 -0
  4. package/dist/es/ConfigProvider-BPm3h9RG.js +44 -0
  5. package/dist/es/Dropdown-DBqye5wx.js +38 -0
  6. package/dist/es/Form-X4dNzwFt.js +108 -0
  7. package/dist/es/Icon-4XdUD4qc.js +27 -0
  8. package/dist/es/Input-C0g1h9x2.js +38 -0
  9. package/dist/es/Loading-Cv4Fsu-C.js +88 -0
  10. package/dist/es/Message-BuoSEEVc.js +123 -0
  11. package/dist/es/Notification-Bv_vDOpB.js +58 -0
  12. package/dist/es/Overlay-C1k4Jcl7.js +12 -0
  13. package/dist/es/Popconfirm-mMYpa7O6.js +22 -0
  14. package/dist/es/Select-SRw_b6I2.js +126 -0
  15. package/dist/es/Switch-bhJBaSI7.js +22 -0
  16. package/dist/es/Tooltip-CUOZC7JN.js +74 -0
  17. package/dist/es/hooks-qpAqkY5H.js +64 -0
  18. package/dist/es/index.js +71 -22
  19. package/dist/es/utils-340oIQ8K.js +59 -0
  20. package/dist/es/vendor-DXmGx29U.js +1309 -0
  21. package/dist/index.css +1 -1
  22. package/dist/theme/Alert.css +203 -97
  23. package/dist/theme/Button.css +785 -559
  24. package/dist/theme/Collapse.css +594 -104
  25. package/dist/theme/Dropdown.css +187 -0
  26. package/dist/theme/Form.css +52 -0
  27. package/dist/theme/Icon.css +158 -15
  28. package/dist/theme/Input.css +430 -0
  29. package/dist/theme/Loading.css +78 -0
  30. package/dist/theme/Message.css +353 -0
  31. package/dist/theme/Notification.css +126 -0
  32. package/dist/theme/Overlay.css +12 -0
  33. package/dist/theme/Popconfirm.css +30 -0
  34. package/dist/theme/Select.css +330 -0
  35. package/dist/theme/Switch.css +248 -0
  36. package/dist/theme/Tooltip.css +111 -0
  37. package/dist/theme/index.css +327 -181
  38. package/dist/types/components/Alert/index.d.ts +9 -84
  39. package/dist/types/components/Alert/types.d.ts +1 -3
  40. package/dist/types/components/Button/contants.d.ts +0 -1
  41. package/dist/types/components/Button/index.d.ts +18 -187
  42. package/dist/types/components/Button/types.d.ts +3 -8
  43. package/dist/types/components/Collapse/constants.d.ts +0 -1
  44. package/dist/types/components/Collapse/index.d.ts +15 -72
  45. package/dist/types/components/Collapse/types.d.ts +0 -1
  46. package/dist/types/components/ConfigProvider/constants.d.ts +4 -0
  47. package/dist/types/components/ConfigProvider/hooks.d.ts +20 -0
  48. package/dist/types/components/ConfigProvider/index.d.ts +27 -0
  49. package/dist/types/components/ConfigProvider/types.d.ts +5 -0
  50. package/dist/types/components/Dropdown/constants.d.ts +3 -0
  51. package/dist/types/components/Dropdown/index.d.ts +177 -0
  52. package/dist/types/components/Dropdown/types.d.ts +30 -0
  53. package/dist/types/components/Form/constants.d.ts +4 -0
  54. package/dist/types/components/Form/hooks.d.ts +4 -0
  55. package/dist/types/components/Form/index.d.ts +101 -0
  56. package/dist/types/components/Form/types.d.ts +61 -0
  57. package/dist/types/components/Icon/icons/alert.d.ts +2 -0
  58. package/dist/types/components/Icon/icons/arrow-left.d.ts +2 -0
  59. package/dist/types/components/Icon/icons/arrow-right.d.ts +2 -0
  60. package/dist/types/components/Icon/icons/bookmark.d.ts +2 -0
  61. package/dist/types/components/Icon/icons/check.d.ts +2 -0
  62. package/dist/types/components/Icon/icons/chevron-down.d.ts +2 -0
  63. package/dist/types/components/Icon/icons/chevron-left.d.ts +2 -0
  64. package/dist/types/components/Icon/icons/chevron-right.d.ts +2 -0
  65. package/dist/types/components/Icon/icons/chevron-up.d.ts +2 -0
  66. package/dist/types/components/Icon/icons/circle.d.ts +2 -0
  67. package/dist/types/components/Icon/icons/close-box.d.ts +2 -0
  68. package/dist/types/components/Icon/icons/close.d.ts +2 -0
  69. package/dist/types/components/Icon/icons/coffee.d.ts +2 -0
  70. package/dist/types/components/Icon/icons/edit.d.ts +2 -0
  71. package/dist/types/components/Icon/icons/external-link.d.ts +2 -0
  72. package/dist/types/components/Icon/icons/eye-closed.d.ts +2 -0
  73. package/dist/types/components/Icon/icons/eye.d.ts +2 -0
  74. package/dist/types/components/Icon/icons/gift.d.ts +2 -0
  75. package/dist/types/components/Icon/icons/heart.d.ts +2 -0
  76. package/dist/types/components/Icon/icons/home.d.ts +2 -0
  77. package/dist/types/components/Icon/icons/index.d.ts +35 -0
  78. package/dist/types/components/Icon/icons/info-box.d.ts +2 -0
  79. package/dist/types/components/Icon/icons/link.d.ts +2 -0
  80. package/dist/types/components/Icon/icons/loader.d.ts +2 -0
  81. package/dist/types/components/Icon/icons/message.d.ts +2 -0
  82. package/dist/types/components/Icon/icons/moon-star.d.ts +2 -0
  83. package/dist/types/components/Icon/icons/music.d.ts +2 -0
  84. package/dist/types/components/Icon/icons/notification.d.ts +2 -0
  85. package/dist/types/components/Icon/icons/search.d.ts +2 -0
  86. package/dist/types/components/Icon/icons/sliders.d.ts +2 -0
  87. package/dist/types/components/Icon/icons/trash.d.ts +2 -0
  88. package/dist/types/components/Icon/icons/upload.d.ts +2 -0
  89. package/dist/types/components/Icon/icons/user.d.ts +2 -0
  90. package/dist/types/components/Icon/icons/warning-box.d.ts +2 -0
  91. package/dist/types/components/Icon/icons/zap.d.ts +2 -0
  92. package/dist/types/components/Icon/index.d.ts +16 -235
  93. package/dist/types/components/Icon/types.d.ts +49 -19
  94. package/dist/types/components/Input/index.d.ts +87 -0
  95. package/dist/types/components/Input/types.d.ts +30 -0
  96. package/dist/types/components/Loading/directive.d.ts +12 -0
  97. package/dist/types/components/Loading/index.d.ts +12 -0
  98. package/dist/types/components/Loading/service.d.ts +11 -0
  99. package/dist/types/components/Loading/types.d.ts +19 -0
  100. package/dist/types/components/Message/index.d.ts +2 -0
  101. package/dist/types/components/Message/methods.d.ts +12 -0
  102. package/dist/types/components/Message/types.d.ts +44 -0
  103. package/dist/types/components/MessageBox/index.d.ts +3 -0
  104. package/dist/types/components/MessageBox/methods.d.ts +3 -0
  105. package/dist/types/components/MessageBox/types.d.ts +57 -0
  106. package/dist/types/components/Notification/index.d.ts +2 -0
  107. package/dist/types/components/Notification/methods.d.ts +13 -0
  108. package/dist/types/components/Notification/types.d.ts +49 -0
  109. package/dist/types/components/Overlay/types.d.ts +6 -0
  110. package/dist/types/components/Popconfirm/index.d.ts +148 -0
  111. package/dist/types/components/Popconfirm/types.d.ts +17 -0
  112. package/dist/types/components/Select/constants.d.ts +4 -0
  113. package/dist/types/components/Select/index.d.ts +292 -0
  114. package/dist/types/components/Select/types.d.ts +47 -0
  115. package/dist/types/components/Select/useKeyMap.d.ts +13 -0
  116. package/dist/types/components/Switch/index.d.ts +49 -0
  117. package/dist/types/components/Switch/types.d.ts +21 -0
  118. package/dist/types/components/Tooltip/index.d.ts +69 -0
  119. package/dist/types/components/Tooltip/types.d.ts +23 -0
  120. package/dist/types/components/Tooltip/useEventsToTiggerNode.d.ts +4 -0
  121. package/dist/types/components/index.d.ts +14 -2
  122. package/dist/types/core/index.d.ts +1 -1
  123. package/dist/types/hooks/index.d.ts +11 -0
  124. package/dist/types/hooks/useClickOutside.d.ts +3 -0
  125. package/dist/types/hooks/useDisabledStyle.d.ts +2 -0
  126. package/dist/types/hooks/useEventListener.d.ts +2 -0
  127. package/dist/types/hooks/useFocusController.d.ts +15 -0
  128. package/dist/types/hooks/useId.d.ts +3 -0
  129. package/dist/types/hooks/useLocale.d.ts +5 -0
  130. package/dist/types/hooks/useOffset.d.ts +12 -0
  131. package/dist/types/hooks/useSystemTheme.d.ts +25 -0
  132. package/dist/types/hooks/useTheme.d.ts +31 -0
  133. package/dist/types/hooks/useZIndex.d.ts +5 -0
  134. package/dist/types/hooks/vite.config.d.ts +2 -0
  135. package/dist/types/hooks/vitest.config.d.ts +2 -0
  136. package/dist/types/utils/icon-map.d.ts +15 -0
  137. package/dist/types/utils/icon-registry.d.ts +39 -0
  138. package/dist/types/utils/index.d.ts +17 -1
  139. package/dist/types/utils/install.d.ts +1 -2
  140. package/dist/types/utils/sanitize-svg.d.ts +12 -0
  141. package/dist/types/utils/style.d.ts +1 -0
  142. package/dist/types/utils/test.d.ts +1 -0
  143. package/dist/umd/index.css +1 -1
  144. package/dist/umd/index.css.gz +0 -0
  145. package/dist/umd/index.umd.cjs +14 -579
  146. package/dist/umd/index.umd.cjs.gz +0 -0
  147. package/package.json +2 -4
  148. package/dist/es/Alert-Y-4NzXo2.js +0 -15
  149. package/dist/es/Button-QmYnZwSJ.js +0 -15
  150. package/dist/es/Collapse-DuP1vJB8.js +0 -38
  151. package/dist/es/Icon-DmsxaUyH.js +0 -12
  152. package/dist/es/utils-CiAcDRmu.js +0 -35
  153. package/dist/es/vendor-DFf1bTHP.js +0 -590
@@ -0,0 +1,123 @@
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";
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";
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 }) {
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
+ let O2;
12
+ function j2() {
13
+ 0 !== k2.duration && (O2 = N(E2, k2.duration));
14
+ }
15
+ function V2() {
16
+ clearTimeout(O2);
17
+ }
18
+ function E2() {
19
+ w2.value = false;
20
+ }
21
+ return c(w2, ((e2) => {
22
+ e2 || (T2.value = -k2.offset);
23
+ })), L(document, "keydown", ((e2) => {
24
+ const { code: o2 } = e2;
25
+ "Escape" === o2 && E2();
26
+ })), r((() => {
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) => {
30
+ const o2 = !e2 || w(e2) || S(e2) ? { message: e2 } : e2;
31
+ return { ...le, ...o2 };
32
+ };
33
+ function re() {
34
+ const e2 = Z(se, { id: this.id });
35
+ return e2 <= 0 ? 0 : H(se, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
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);
42
+ T(s2, t2), document.body.appendChild(t2.firstElementChild);
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 });
50
+ }));
51
+ })), ie.closeAll = function(e2) {
52
+ K(se, ((o2) => {
53
+ e2 ? o2.props.type === e2 && o2.handler.close() : o2.handler.close();
54
+ }));
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 ?? "")));
58
+ function A2() {
59
+ t2.closeOnClickModal && R2("close");
60
+ }
61
+ function L2(e2) {
62
+ if ("textarea" !== w2.inputType) return e2.preventDefault(), R2("confirm");
63
+ }
64
+ function R2(e2) {
65
+ F(t2.beforeClose) ? t2.beforeClose(e2, w2, (() => n2(e2, w2.inputValue))) : n2(e2, w2.inputValue);
66
+ }
67
+ function N2() {
68
+ R2("close");
69
+ }
70
+ return c((() => {
71
+ var _a;
72
+ return (_a = t2.visible) == null ? void 0 : _a.value;
73
+ }), ((e2) => {
74
+ e2 && (w2.zIndex = s2()), "prompt" === t2.boxType && e2 && z((() => {
75
+ var _a;
76
+ (_a = y2.value) == null ? void 0 : _a.focus();
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"]));
80
+ } }), xe = /* @__PURE__ */ new Map();
81
+ function ve(e2) {
82
+ let o2;
83
+ return S(e2) || w(e2) ? e2 = { message: e2 } : o2 = e2.callback, new Promise(((t2, n2) => {
84
+ const s2 = (function(e3) {
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);
87
+ var l2;
88
+ return T(s3, o4), document.body.appendChild(o4.firstElementChild), s3.component;
89
+ })({ ...e3, doClose: () => {
90
+ n3.visible.value = false;
91
+ }, doAction: (o4, t4) => {
92
+ const s3 = xe.get(n3);
93
+ let a2;
94
+ z((() => n3.doClose())), a2 = e3.showInput ? { value: t4, action: o4 } : o4, e3.callback ? e3.callback(a2) : "cancel" !== o4 && "close" !== o4 ? s3 == null ? void 0 : s3.resolve(a2) : s3 == null ? void 0 : s3.reject(o4);
95
+ }, destroy: () => {
96
+ T(null, o3), xe.delete(n3);
97
+ } }, o3), n3 = t3 == null ? void 0 : t3.proxy;
98
+ return n3.visible.value = true, n3;
99
+ })(e2);
100
+ xe.set(s2, { options: e2, callback: o2, resolve: t2, reject: n2 });
101
+ }));
102
+ }
103
+ const be = { alert: { closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } };
104
+ K(["alert", "confirm", "prompt"], ((e2) => {
105
+ return U(ve, e2, (o2 = e2, (e3, t2, n2) => {
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));
108
+ }));
109
+ var o2;
110
+ })), U(ve, "close", (() => {
111
+ xe.forEach(((e2, o2) => {
112
+ o2.doClose();
113
+ })), xe.clear();
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;
118
+ }));
119
+ export {
120
+ ue as P,
121
+ Be as a,
122
+ ne as m
123
+ };
@@ -0,0 +1,58 @@
1
+ import { t, b as o, R as e, _ 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 d, withCtx as p, withDirectives as u, createElementVNode as m, normalizeStyle as v, normalizeClass as h, createCommentVNode as x, createElementBlock as g, 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-qpAqkY5H.js";
4
+ import { P as B } from "./Icon-4XdUD4qc.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 = { class: "px-notification__text" }, T = { class: "px-notification__title" }, Z = { class: "px-notification__content" }, q = { key: 1, class: "px-notification__close" }, F = 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(Y, 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]: o(j2.value), zIndex: i2.zIndex })));
8
+ let L2;
9
+ function W2() {
10
+ 0 !== i2.duration && (L2 = M(G2, i2.duration));
11
+ }
12
+ function F2() {
13
+ clearTimeout(L2);
14
+ }
15
+ function G2() {
16
+ I2.value = false;
17
+ }
18
+ return c((() => {
19
+ I2.value = true, W2();
20
+ })), s2({ bottomOffset: E2, close: G2 }), (t2, o2) => (r(), f(d, { name: `px-notification-${t2.transitionName}`, onAfterLeave: o2[1] || (o2[1] = (o3) => !I2.value && t2.onDestory()), onEnter: o2[2] || (o2[2] = (t3) => O2.value = N2.value.getBoundingClientRect().height) }, { default: p((() => [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", onClick: o2[0] || (o2[0] = (...o3) => t2.onClick && t2.onClick(...o3)), onMouseenter: F2, onMouseleave: W2 }, [$2.value ? (r(), f(B, { key: 0, icon: $2.value, class: "px-notification__icon" }, null, 8, ["icon"])) : x("", true), m("div", H, [m("div", T, y(t2.title), 1), m("div", Z, [_(t2.$slots, "default", {}, (() => [t2.message ? (r(), f(C(e), { key: 0, vNode: t2.message }, null, 8, ["vNode"])) : x("", true)]), true)])]), t2.showClose ? (r(), g("div", q, [k(B, { icon: "close", onClick: b(G2, ["stop"]) })])) : x("", true)], 38), [[w, I2.value]])])), _: 3 }, 8, ["name"]));
21
+ } }), [["__scopeId", "data-v-44d5f081"]]), G = ["info", "success", "warning", "danger"], J = ["top-right", "top-left", "bottom-right", "bottom-left"], K = /* @__PURE__ */ new Map();
22
+ P(J, ((t2) => {
23
+ K.set(t2, j([]));
24
+ }));
25
+ const { nextZIndex: Q } = E(), S = { type: "info", duration: 3e3, offset: 20, transitionName: "fade", showClose: true }, U = (t2) => {
26
+ const o2 = !t2 || I(t2) || R(t2) ? { message: t2 } : t2;
27
+ return { ...S, ...o2 };
28
+ }, V = (t2) => K.get(t2), X = (t2 = {}) => ((t3) => {
29
+ const o2 = $().value, e2 = document.createElement("div"), n2 = V(t3.position || "top-right"), s2 = { ...t3, id: o2, zIndex: Q(), onDestory: () => {
30
+ const t4 = A(n2, { id: o2 });
31
+ -1 !== t4 && (n2.splice(t4, 1), O(null, e2));
32
+ } }, i2 = N(F, s2);
33
+ O(i2, e2), document.body.appendChild(e2.firstElementChild);
34
+ const a2 = i2.component, l2 = { close: () => a2.exposed.close() }, c2 = { props: s2, id: o2, vm: a2, vnode: i2, handler: l2 };
35
+ return n2.push(c2), c2;
36
+ })(U(t2)).handler;
37
+ function Y() {
38
+ const t2 = V(this.position || "top-right"), o2 = A(t2, { id: this.id });
39
+ return o2 <= 0 ? 0 : L(t2, [o2 - 1, "vm", "exposed", "bottomOffset", "value"]);
40
+ }
41
+ P(G, ((t2) => {
42
+ W(X, t2, ((o2) => {
43
+ const e2 = U(o2);
44
+ return X({ ...e2, type: t2 });
45
+ }));
46
+ })), X.closeAll = function(t2) {
47
+ K.forEach(((o2) => {
48
+ P(o2, ((o3) => {
49
+ t2 ? o3.props.type === t2 && o3.handler.close() : o3.handler.close();
50
+ }));
51
+ }));
52
+ };
53
+ const tt = s(X, "$notify");
54
+ export {
55
+ tt as P,
56
+ J as a,
57
+ G as n
58
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as e, createElementBlock as s, openBlock as o, normalizeStyle as t, normalizeClass as a, renderSlot as l } from "vue";
2
+ import { _ as i } from "./utils-340oIQ8K.js";
3
+ const d = i(e({ name: "PxOverlay", __name: "Overlay", props: { mask: { type: Boolean, default: true }, zIndex: {}, overlayClass: {} }, emits: ["click"], setup(e2, { emit: i2 }) {
4
+ const d2 = i2;
5
+ function n(e3) {
6
+ d2("click", e3);
7
+ }
8
+ return (e3, i3) => e3.mask ? (o(), s("div", { key: 0, class: a(["px-overlay", e3.overlayClass]), style: t({ zIndex: e3.zIndex }), onClick: n }, [l(e3.$slots, "default", {}, void 0, true)], 6)) : (o(), s("div", { key: 1, class: a(e3.overlayClass), style: t({ zIndex: e3.zIndex, position: "fixed", top: 0, left: 0, right: 0, bottom: 0 }) }, [l(e3.$slots, "default", {}, void 0, true)], 6));
9
+ } }), [["__scopeId", "data-v-a64cd74a"]]);
10
+ export {
11
+ d as P
12
+ };
@@ -0,0 +1,22 @@
1
+ import { b as o, _ as e, w as t } from "./utils-340oIQ8K.js";
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";
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
+ const n2 = e2, k2 = t2, C = i(), P = c((() => ({ width: o(n2.width) })));
8
+ function j() {
9
+ var _a;
10
+ (_a = C.value) == null ? void 0 : _a.hide();
11
+ }
12
+ function w(o2) {
13
+ k2("confirm", o2), j();
14
+ }
15
+ function I(o2) {
16
+ k2("cancel", o2), j();
17
+ }
18
+ return (o2, e3) => (a(), l(h, { ref_key: "tooltipRef", ref: C, trigger: "click", "hide-timeout": o2.hideAfter }, r({ content: f((() => [s("div", { class: "px-popconfirm", style: p(P.value) }, [s("div", B, [!o2.hideIcon && o2.icon ? (a(), l(x, { key: 0, icon: o2.icon, color: o2.iconColor }, null, 8, ["icon", "color"])) : m("", true), u(" " + d(o2.title), 1)])], 4), s("div", T, [_(v, { class: "px-popconfirm__cancel", size: "small", type: o2.cancelButtonType, onClick: I }, { default: f((() => [u(d(o2.cancelButtonText || "Cancel"), 1)])), _: 1 }, 8, ["type"]), _(v, { class: "px-popconfirm__confirm", size: "small", type: o2.confirmButtonType, onClick: w }, { default: f((() => [u(d(o2.confirmButtonText || "Confirm"), 1)])), _: 1 }, 8, ["type"])])])), _: 2 }, [o2.$slots.default ? { name: "default", fn: f((() => [y(o2.$slots, "default", {}, void 0, true)])), key: "0" } : void 0, o2.$slots.reference ? { name: "default", fn: f((() => [y(o2.$slots, "reference", {}, void 0, true)])), key: "1" } : void 0]), 1032, ["hide-timeout"]));
19
+ } }), [["__scopeId", "data-v-72e03259"]]));
20
+ export {
21
+ k as P
22
+ };
@@ -0,0 +1,126 @@
1
+ import { R as e, _ as l, w as a } from "./utils-340oIQ8K.js";
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
+ 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";
8
+ const J = Symbol("selectContext"), Q = { modifiers: [{ name: "offset", options: { offset: [0, 9] } }, { name: "sameWidth", enabled: true, fn: ({ state: e2 }) => {
9
+ e2.styles.popper.width = `${e2.rects.reference.width}px`;
10
+ }, phase: "beforeWrite", requires: ["computeStyles"] }] }, X = ["id"], Y = l(t({ name: "PxOption", __name: "Option", props: { value: {}, label: {}, disabled: { type: Boolean, default: false } }, setup(l2) {
11
+ const a2 = l2, t2 = o(J), h2 = i((() => {
12
+ var _a;
13
+ return ((_a = t2 == null ? void 0 : t2.selectStates.selectedOption) == null ? void 0 : _a.value) === a2.value;
14
+ })), v2 = i((() => S(["label", "value"], ((e2) => L(B(t2, ["highlightedLine", "value", e2]), B(a2, e2))))));
15
+ function f2() {
16
+ a2.disabled || (t2 == null ? void 0 : t2.handleSelect(a2));
17
+ }
18
+ return (l3, o2) => (s(), n("li", { class: d(["px-select__menu-item", { "is-disabled": l3.disabled, "is-selected": h2.value, "is-highlighted": v2.value }]), id: `select-item-${l3.value}`, onClick: u(f2, ["stop"]) }, [r(l3.$slots, "default", {}, (() => {
19
+ var _a, _b;
20
+ return [p(c(e), { vNode: ((_a = c(t2)) == null ? void 0 : _a.renderLabel) ? (_b = c(t2)) == null ? void 0 : _b.renderLabel(a2) : l3.label }, null, 8, ["vNode"])];
21
+ }), true)], 10, X));
22
+ } }), [["__scopeId", "data-v-c5f1823d"]]), Z = { key: 0, class: "px-select__loading" }, ee = { key: 1, class: "px-select__nodata" }, le = { class: "px-select__menu" }, ae = a(l(t({ name: "PxSelect", __name: "Select", props: { modelValue: {}, id: {}, options: { default: () => [] }, placeholder: {}, disabled: { type: Boolean }, clearable: { type: Boolean }, renderLabel: {}, filterable: { type: Boolean }, filterMethod: {}, remote: { type: Boolean }, remoteMethod: {} }, emits: ["update:modelValue", "change", "visible-change", "clear", "focus", "blur"], setup(l2, { expose: a2, emit: t2 }) {
23
+ const o2 = l2, r2 = t2, S2 = h(), X2 = v(), ae2 = v(), te2 = v(), oe = v(/* @__PURE__ */ new Map()), ie = v(o2.options ?? []), ne = v(false), se = De(o2.modelValue), ue = f({ inputValue: (se == null ? void 0 : se.label) ?? "", selectedOption: se, mouseHover: false, loading: false, highlightedIndex: -1 }), de = i((() => o2.disabled)), re = i((() => {
24
+ var _a;
25
+ return D((_a = S2 == null ? void 0 : S2.default) == null ? void 0 : _a.call(S2), ((e2) => L(e2.type, Y)));
26
+ })), pe = i((() => N(re.value) > 0)), ce = i((() => o2.clearable && ue.mouseHover && "" !== ue.inputValue)), he = i((() => {
27
+ var _a;
28
+ let e2;
29
+ if (pe.value) {
30
+ const l3 = (_a = [...oe.value][ue.highlightedIndex]) == null ? void 0 : _a[0];
31
+ e2 = oe.value.get(l3);
32
+ } else e2 = ie.value[ue.highlightedIndex];
33
+ return e2;
34
+ })), ve = i((() => pe.value ? j(re.value, ((e2) => {
35
+ var _a, _b, _c;
36
+ return { vNode: O(e2), props: P(e2.props, { disabled: true === ((_a = e2.props) == null ? void 0 : _a.disabled) || !z((_b = e2.props) == null ? void 0 : _b.disabled) && !W((_c = e2.props) == null ? void 0 : _c.disabled) }) };
37
+ })) : [])), fe = i((() => !!o2.filterable && !me.value)), me = i((() => pe.value && oe.value.size > 0 || !pe.value && N(ie.value) > 0)), be = i((() => pe.value ? oe.value.size - 1 : N(ie.value) - 1)), ge = i((() => o2.filterable && ue.selectedOption && ne.value ? ue.selectedOption.label : o2.placeholder)), ye = i((() => o2.remote ? 300 : 100)), xe = C((function() {
38
+ const e2 = ue.inputValue;
39
+ ue.highlightedIndex = -1, pe.value ? (async function(e3) {
40
+ if (o2.filterable) {
41
+ if (o2.remote && o2.remoteMethod && E(o2.remoteMethod)) return await Fe(o2.remoteMethod, e3), void je(ve.value);
42
+ if (o2.filterMethod && E(o2.filterMethod)) {
43
+ const l3 = j(o2.filterMethod(e3), "value");
44
+ je(D(ve.value, ((e4) => $(l3, B(e4, ["props", "value"])))));
45
+ } else je(D(ve.value, ((l3) => $(B(l3, ["props", "label"]), e3))));
46
+ }
47
+ })(e2) : (async function(e3) {
48
+ o2.filterable && (o2.remote && o2.remoteMethod && E(o2.remoteMethod) ? ie.value = await Fe(o2.remoteMethod, e3) : o2.filterMethod && E(o2.filterMethod) ? ie.value = o2.filterMethod(e3) : ie.value = D(o2.options, ((l3) => $(l3.label, e3))));
49
+ })(e2);
50
+ }), ye.value), _e = q().value, { wrapperRef: Ve, isFocused: Ie, handleBlur: we, handleFocus: Me } = A(te2), ke = (function({ isDropdownVisible: e2, controlVisible: l3, selectStates: a3, highlightedLine: t3, handleSelect: o3, hasData: i2, lastIndex: n2 }) {
51
+ const s2 = /* @__PURE__ */ new Map();
52
+ return s2.set("Enter", (() => {
53
+ e2.value && a3.highlightedIndex >= 0 && t3.value && o3(t3.value), l3(!e2.value);
54
+ })), s2.set("Escape", (() => e2.value && l3(!e2.value))), s2.set("ArrowUp", ((e3) => {
55
+ e3.preventDefault(), i2.value && (-1 !== a3.highlightedIndex && 0 !== a3.highlightedIndex ? a3.highlightedIndex-- : a3.highlightedIndex = n2.value);
56
+ })), s2.set("ArrowDown", ((e3) => {
57
+ e3.preventDefault(), i2.value && (-1 !== a3.highlightedIndex && a3.highlightedIndex !== n2.value ? a3.highlightedIndex++ : a3.highlightedIndex = 0);
58
+ })), s2;
59
+ })({ isDropdownVisible: ne, controlVisible: Se, selectStates: ue, highlightedLine: he, handleSelect: Ne, hasData: me, lastIndex: be });
60
+ function Oe(e2) {
61
+ Ie.value && k((() => we(new FocusEvent("focus", e2))));
62
+ }
63
+ function Se(e2) {
64
+ var _a;
65
+ ae2.value && ((_a = B(ae2, ["value", e2 ? "show" : "hide"])) == null ? void 0 : _a(), o2.filterable && (function(e3) {
66
+ var _a2;
67
+ o2.filterable && (e3 ? (ue.selectedOption && (ue.inputValue = ""), xe()) : ue.inputValue = ((_a2 = ue.selectedOption) == null ? void 0 : _a2.label) || "");
68
+ })(e2), ne.value = e2, r2("visible-change", e2), ue.highlightedIndex = -1);
69
+ }
70
+ function Le() {
71
+ de.value || Se(!ne.value);
72
+ }
73
+ function Be() {
74
+ var _a;
75
+ (_a = te2.value) == null ? void 0 : _a.clear(), ue.inputValue = "", ue.selectedOption = null, r2("clear"), R(["change", "update:modelValue"], ((e2) => r2(e2, "")));
76
+ }
77
+ function De(e2) {
78
+ return F(o2.options, ((l3) => l3.value === e2));
79
+ }
80
+ function Ne(e2) {
81
+ var _a;
82
+ e2.disabled || (ue.inputValue = e2.label, ue.selectedOption = e2, R(["change", "update:modelValue"], ((l3) => r2(l3, e2.value))), Se(false), (_a = te2.value) == null ? void 0 : _a.focus());
83
+ }
84
+ function je(e2) {
85
+ oe.value.clear(), R(e2, ((e3) => {
86
+ oe.value.set(e3.vNode, e3.props);
87
+ }));
88
+ }
89
+ function Ce(e2) {
90
+ var _a;
91
+ ke.has(e2.key) && ((_a = ke.get(e2.key)) == null ? void 0 : _a(e2));
92
+ }
93
+ async function Fe(e2, l3) {
94
+ if (!e2 || !E(e2)) return;
95
+ let a3;
96
+ ue.loading = true;
97
+ try {
98
+ a3 = await e2(l3);
99
+ } catch (e3) {
100
+ a3 = [];
101
+ }
102
+ return a3;
103
+ }
104
+ function Re() {
105
+ const e2 = De(o2.modelValue);
106
+ e2 && (ue.inputValue = e2.label, ue.selectedOption = e2);
107
+ }
108
+ return T(X2, ((e2) => Oe(e2))), m((() => o2.options), ((e2) => {
109
+ ie.value = e2 ?? [];
110
+ })), m((() => ve.value), ((e2) => je(e2)), { immediate: true }), m((() => o2.modelValue), (() => {
111
+ Re();
112
+ })), b((() => {
113
+ Re();
114
+ })), g(J, { handleSelect: Ne, selectStates: ue, renderLabel: function(e2) {
115
+ return E(o2.renderLabel) ? o2.renderLabel(e2) : e2.label;
116
+ }, highlightedLine: he }), a2({ focus: () => {
117
+ var _a;
118
+ (_a = te2.value) == null ? void 0 : _a.focus();
119
+ }, blur: () => {
120
+ Oe();
121
+ } }), (l3, a3) => (s(), n("div", { ref_key: "selectRef", ref: X2, class: d(["px-select", { "is-disabled": de.value }]), onClick: u(Le, ["stop"]), onMouseenter: a3[2] || (a3[2] = (e2) => ue.mouseHover = true), onMouseleave: a3[3] || (a3[3] = (e2) => ue.mouseHover = false) }, [p(K, { ref_key: "tooltipRef", ref: ae2, placement: "bottom-start", "popper-options": c(Q), onClickOutside: a3[1] || (a3[1] = (e2) => Se(false)), manual: "" }, { default: y((() => [_("div", { ref_key: "inputWrapperRef", ref: Ve }, [p(G, { ref_key: "inputRef", ref: te2, modelValue: ue.inputValue, "onUpdate:modelValue": a3[0] || (a3[0] = (e2) => ue.inputValue = e2), id: c(_e), disabled: de.value, placeholder: l3.filterable ? ge.value : l3.placeholder, readonly: !l3.filterable || !ne.value, onFocus: c(Me), onBlur: c(we), onInput: c(xe), onKeydown: Ce }, { suffix: y((() => [ce.value ? (s(), w(U, { key: 0, icon: "close-box", class: "px-input__clear", onClick: u(Be, ["stop"]), onMousedown: u(c(H), ["prevent"]) }, null, 8, ["onMousedown"])) : (s(), w(U, { key: 1, class: d(["header-angle", { "is-active": ne.value }]), icon: "chevron-down" }, null, 8, ["class"]))])), _: 1 }, 8, ["modelValue", "id", "disabled", "placeholder", "readonly", "onFocus", "onBlur", "onInput"])], 512)])), content: y((() => [ue.loading ? (s(), n("div", Z, [p(U, { icon: "loader", spin: "" })])) : l3.filterable && fe.value ? (s(), n("div", ee, " No data ")) : x("", true), _("ul", le, [pe.value ? (s(true), n(V, { key: 1 }, I(oe.value, (([l4, a4]) => (s(), w(c(e), { key: a4.value, vNode: l4 }, null, 8, ["vNode"])))), 128)) : (s(true), n(V, { key: 0 }, I(ie.value, ((e2) => (s(), w(Y, M({ key: e2.value, ref_for: true }, e2), null, 16)))), 128))])])), _: 1 }, 8, ["popper-options"])], 34));
122
+ } }), [["__scopeId", "data-v-cf32c555"]])), te = a(Y);
123
+ export {
124
+ ae as P,
125
+ te as a
126
+ };
@@ -0,0 +1,22 @@
1
+ import { w as e } from "./utils-340oIQ8K.js";
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";
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
+ 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
+ function B() {
7
+ if (V.value) return;
8
+ const e3 = S.value ? k.inactiveValue : k.activeValue;
9
+ y.value = e3, b("update:modelValue", e3), b("change", e3);
10
+ }
11
+ return c((() => {
12
+ T.value.checked = S.value;
13
+ })), l(S, ((e3) => {
14
+ T.value.checked = e3;
15
+ })), a2({ checked: S, focus: () => {
16
+ var _a;
17
+ (_a = T.value) == null ? void 0 : _a.focus();
18
+ } }), (e3, a3) => (u(), s("div", { class: n(["px-switch", { [`px-switch--${e3.size}`]: e3.size, "is-disabled": V.value, "is-checked": S.value }]), onClick: B }, [o("input", { class: "px-switch__input", type: "checkbox", role: "switch", ref_key: "inputRef", ref: T, id: r(g), name: e3.name, disabled: V.value, checked: S.value, onKeydown: d(B, ["enter"]) }, null, 40, m), o("div", x, [o("div", _, [e3.activeText || e3.inactiveText ? (u(), s("span", f, p(S.value ? e3.activeText : e3.inactiveText), 1)) : v("", true)]), a3[0] || (a3[0] = o("div", { class: "px-switch__core-action" }, null, -1))])], 2));
19
+ } }));
20
+ export {
21
+ w as P
22
+ };
@@ -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 l, defineComponent as i, 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, Transition as g, withCtx as m, createCommentVNode as h, createElementVNode as _, createTextVNode as k, toDisplayString as T } from "vue";
3
+ import { createPopper as y } from "@popperjs/core";
4
+ import { a as x } from "./hooks-qpAqkY5H.js";
5
+ import { H as b, f as w, E as j, v as B } from "./vendor-DXmGx29U.js";
6
+ const E = e(i({ 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: i2 }) {
7
+ const E2 = e2, L2 = i2, N = r(false), R = r({}), $ = r({}), O = r({}), P = r(), A = r(), D = r(), H = n((() => E2.virtualTriggering ? E2.virtualRef : D.value)), I = n((() => ({ placement: E2.placement, modifiers: [{ name: "offset", options: { offset: [0, 9] } }], ...E2.popperOptions }))), M = n((() => "hover" === E2.trigger ? E2.showTimeout : 0)), q = n((() => "hover" === E2.trigger ? E2.hideTimeout : 0));
8
+ let z, C, F;
9
+ function G() {
10
+ C == null ? void 0 : C.cancel(), z == null ? void 0 : z();
11
+ }
12
+ function J() {
13
+ z == null ? void 0 : z.cancel(), C == null ? void 0 : C();
14
+ }
15
+ function K() {
16
+ N.value ? J() : G();
17
+ }
18
+ function Q(e3) {
19
+ E2.disabled || (N.value = e3, L2("visible-change", e3));
20
+ }
21
+ function S() {
22
+ if (!E2.disabled && !E2.manual) return "hover" === E2.trigger ? (R.value.mouseenter = G, $.value.mouseleave = J, void (O.value.mouseenter = G)) : void ("click" !== E2.trigger ? "contextmenu" !== E2.trigger || (R.value.contextmenu = (e3) => {
23
+ e3.preventDefault(), G();
24
+ }) : R.value.click = K);
25
+ }
26
+ function U() {
27
+ F == null ? void 0 : F.destroy(), F = null;
28
+ }
29
+ function V() {
30
+ R.value = {}, $.value = {}, O.value = {}, S();
31
+ }
32
+ const W = G, X = () => {
33
+ z == null ? void 0 : z.cancel(), Q(false);
34
+ };
35
+ return a(N, ((e3) => {
36
+ e3 && H.value && A.value && (F = y(H.value, A.value, I.value));
37
+ }), { flush: "post" }), a((() => E2.manual), ((e3) => {
38
+ e3 ? V() : S();
39
+ })), a((() => E2.trigger), (() => {
40
+ z == null ? void 0 : z.cancel(), N.value = false, L2("visible-change", false), V();
41
+ })), u((() => {
42
+ E2.manual || S(), z = j(B(Q, null, true), M.value), C = j(B(Q, null, false), q.value);
43
+ })), x(P, (() => {
44
+ L2("click-outside"), "hover" === E2.trigger || E2.manual || N.value && J();
45
+ })), (function(e3, t3, i3) {
46
+ let r2, n2;
47
+ const u2 = /* @__PURE__ */ new Map(), s2 = () => {
48
+ const e4 = t3.value;
49
+ e4 && b(e4) && w(i3.value, ((t4, o2) => {
50
+ u2.set(o2, t4), e4.addEventListener(o2, t4);
51
+ }));
52
+ }, v2 = (e4) => {
53
+ const o2 = e4 ?? t3.value;
54
+ o2 && b(o2) && w(["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 && (b(o2) && v2(o2), b(t4) && s2());
59
+ }), { immediate: true }), r2 = a(i3, (() => {
60
+ e3.virtualTriggering && (v2(), s2(), z == null ? void 0 : z.cancel(), Q(false));
61
+ }), { deep: true });
62
+ })), l((() => {
63
+ r2 == null ? void 0 : r2(), n2 == null ? void 0 : n2();
64
+ }));
65
+ })(E2, H, R), l((() => {
66
+ U();
67
+ })), t2({ show: W, hide: X, toggle: () => {
68
+ N.value ? X() : W();
69
+ } }), (e3, t3) => (v(), s("div", c({ class: "px-tooltip", ref_key: "containerNode", ref: P }, p($.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: D }, p(R.value, true)), [d(e3.$slots, "default", {}, void 0, true)], 16)), f(g, { name: e3.transition, onAfterLeave: U }, { default: m((() => [N.value ? (v(), s("div", c({ key: 0, class: "px-tooltip__popper", ref_key: "popperNode", ref: A }, p(O.value, true)), [d(e3.$slots, "content", {}, (() => [k(T(e3.content), 1)]), true), t3[0] || (t3[0] = _("div", { id: "arrow", "data-popper-arrow": "" }, null, -1))], 16)) : h("", true)])), _: 3 }, 8, ["name"])], 16));
70
+ } }), [["__scopeId", "data-v-e8b45d39"]]), L = t(E);
71
+ export {
72
+ L as P,
73
+ E as T
74
+ };
@@ -0,0 +1,64 @@
1
+ import { isRef as e, watch as t, onMounted as n, onBeforeUnmount as l, unref as r, getCurrentInstance as o, useSlots as a, watchEffect as u, ref as s, computed as c } from "vue";
2
+ import { f as i, y as v, k as d, z as f } from "./vendor-DXmGx29U.js";
3
+ function p(o2, a2, u2) {
4
+ e(o2) ? t(o2, ((e2, t2) => {
5
+ null == t2 || t2.removeEventListener(a2, u2), null == e2 || e2.addEventListener(a2, u2);
6
+ })) : n((() => null == o2 ? void 0 : o2.addEventListener(a2, u2))), l((() => {
7
+ var e2;
8
+ return null == (e2 = r(o2)) ? void 0 : e2.removeEventListener(a2, u2);
9
+ }));
10
+ }
11
+ function m(e2, t2) {
12
+ p(document, "click", ((n2) => {
13
+ e2.value && n2.target && (e2.value.contains(n2.target) || t2(n2));
14
+ }));
15
+ }
16
+ const h = (e2, t2) => i(e2, ((e3) => {
17
+ v(t2) && t2(e3), e3.children && h(e3.children, t2);
18
+ }));
19
+ function x() {
20
+ var e2, t2;
21
+ const n2 = /* @__PURE__ */ new Map(), l2 = o(), r2 = null == (t2 = null == (e2 = a()) ? void 0 : e2.default) ? void 0 : t2.call(e2);
22
+ u((() => {
23
+ (null == l2 ? void 0 : l2.props.disabled) ? h(r2 ?? [], ((e3) => {
24
+ (null == e3 ? void 0 : e3.props) && (n2.set(e3, d(e3.props)), e3.props = f(null == e3 ? void 0 : e3.props, { style: { cursor: "not-allowed", color: "var(--px-text-color-placeholder)" } }));
25
+ })) : h(r2 ?? [], ((e3) => {
26
+ n2.has(e3) && (e3.props = n2.get(e3));
27
+ }));
28
+ }));
29
+ }
30
+ function g(e2, { afterBlur: t2, beforeBlur: n2, afterFocus: l2 } = {}) {
31
+ const r2 = o(), { emit: a2 } = r2, u2 = s(), c2 = s(false);
32
+ return p(u2, "click", (() => {
33
+ var t3;
34
+ null == (t3 = e2.value) || t3.focus();
35
+ })), { wrapperRef: u2, isFocused: c2, handleFocus: (e3) => {
36
+ c2.value || (c2.value = true, a2("focus", e3), null == l2 || l2());
37
+ }, handleBlur: (e3) => {
38
+ var l3;
39
+ v(n2) && n2(e3) || e3.relatedTarget && (null == (l3 = u2.value) ? void 0 : l3.contains(e3.relatedTarget)) || (c2.value = false, a2("blur", e3), null == t2 || t2());
40
+ } };
41
+ }
42
+ const b = { prefix: Math.floor(1e4 * Math.random()), current: 0 };
43
+ function L(e2 = "er") {
44
+ return c((() => `${e2}-${b.prefix}-${b.current++}`));
45
+ }
46
+ function B(e2) {
47
+ const t2 = c((() => e2.getLastBottomOffset())), n2 = c((() => e2.offset + t2.value)), l2 = c((() => n2.value + e2.boxHeight.value));
48
+ return { topOffset: n2, bottomOffset: l2 };
49
+ }
50
+ const E = s(0);
51
+ function k(e2 = 2e3) {
52
+ const t2 = s(e2), n2 = c((() => E.value + t2.value));
53
+ return { initialValue: t2, currentZIndex: n2, nextZIndex: () => (E.value++, n2.value) };
54
+ }
55
+ s("system"), s(false);
56
+ export {
57
+ m as a,
58
+ x as b,
59
+ g as c,
60
+ k as d,
61
+ B as e,
62
+ p as f,
63
+ L as u
64
+ };