sakana-element 2.1.4 → 2.2.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.
- package/README.md +9 -6
- package/dist/es/Avatar-CxsRW-wl.js +9 -0
- package/dist/es/Badge-CoFWwBwv.js +14 -0
- package/dist/es/Breadcrumb-BtrwTVKW.js +15 -0
- package/dist/es/{Button-fW_ZOLmT.js → Button-S_31-UWJ.js} +3 -3
- package/dist/es/Card-DcW6nHYD.js +16 -0
- package/dist/es/Collapse-DsS7M-m3.js +53 -0
- package/dist/es/ConfigProvider-BgIewHXP.js +44 -0
- package/dist/es/{Dropdown-49nf6F8P.js → Dropdown-GcomGMAI.js} +10 -10
- package/dist/es/FileInput-BQ59woas.js +33 -0
- package/dist/es/Form-j90EzLXU.js +122 -0
- package/dist/es/{Input-DBPpvf0Y.js → Input-CiE4bPJN.js} +4 -4
- package/dist/es/Link-B9B2APZq.js +11 -0
- package/dist/es/Loading-BW99pE5N.js +92 -0
- package/dist/es/Message-DCNnTUje.js +123 -0
- package/dist/es/{Notification-D4RYHV9o.js → Notification-CBzY5904.js} +14 -14
- package/dist/es/Popconfirm-DF6d2ORS.js +23 -0
- package/dist/es/Select-Dwqv8isB.js +133 -0
- package/dist/es/Switch-B1Gnv1tB.js +34 -0
- package/dist/es/{Tooltip-HWx_i2FA.js → Tooltip-k6gKnMyt.js} +3 -3
- package/dist/es/hooks-BaG7l8K5.js +116 -0
- package/dist/es/index.js +73 -63
- package/dist/index.css +1 -1
- package/dist/theme/Alert.css +1 -1
- package/dist/theme/Avatar.css +116 -0
- package/dist/theme/Badge.css +36 -30
- package/dist/theme/Breadcrumb.css +150 -0
- package/dist/theme/Button.css +216 -216
- package/dist/theme/Card.css +170 -19
- package/dist/theme/Collapse.css +214 -54
- package/dist/theme/FileInput.css +365 -0
- package/dist/theme/Form.css +65 -34
- package/dist/theme/Link.css +50 -0
- package/dist/theme/Loading.css +154 -4
- package/dist/theme/Message.css +7 -4
- package/dist/theme/Notification.css +21 -21
- package/dist/theme/Popconfirm.css +5 -5
- package/dist/theme/Select.css +78 -78
- package/dist/theme/index.css +1 -5
- package/dist/types/components/Avatar/index.d.ts +30 -0
- package/dist/types/components/Avatar/types.d.ts +10 -0
- package/dist/types/components/Badge/types.d.ts +1 -0
- package/dist/types/components/Breadcrumb/constants.d.ts +3 -0
- package/dist/types/components/Breadcrumb/index.d.ts +45 -0
- package/dist/types/components/Breadcrumb/types.d.ts +13 -0
- package/dist/types/components/Card/types.d.ts +6 -0
- package/dist/types/components/Collapse/constants.d.ts +3 -0
- package/dist/types/components/Collapse/index.d.ts +9 -3
- package/dist/types/components/Collapse/types.d.ts +12 -0
- package/dist/types/components/FileInput/constants.d.ts +3 -0
- package/dist/types/components/FileInput/index.d.ts +58 -0
- package/dist/types/components/FileInput/types.d.ts +24 -0
- package/dist/types/components/Form/types.d.ts +17 -7
- package/dist/types/components/Input/index.d.ts +5 -5
- package/dist/types/components/Link/index.d.ts +34 -0
- package/dist/types/components/Link/types.d.ts +10 -0
- package/dist/types/components/Loading/index.d.ts +25 -0
- package/dist/types/components/Loading/types.d.ts +9 -0
- package/dist/types/components/Message/types.d.ts +2 -2
- package/dist/types/components/MessageBox/types.d.ts +2 -2
- package/dist/types/components/Notification/index.d.ts +1 -1
- package/dist/types/components/Notification/methods.d.ts +3 -1
- package/dist/types/components/Notification/types.d.ts +2 -2
- package/dist/types/components/Select/constants.d.ts +2 -1
- package/dist/types/components/Select/index.d.ts +11 -11
- package/dist/types/components/Select/useKeyMap.d.ts +1 -1
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/hooks/vitest.setup.d.ts +4 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +5 -14
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +59 -60
- package/dist/es/Badge-BG-vYP8Y.js +0 -13
- package/dist/es/Card-BCBnlVi_.js +0 -12
- package/dist/es/Collapse-B08VhCVq.js +0 -38
- package/dist/es/ConfigProvider-DZO1d5Eq.js +0 -44
- package/dist/es/Form-CGiTDSGI.js +0 -108
- package/dist/es/Loading-DlygqGOv.js +0 -88
- package/dist/es/Message-ganFfLeU.js +0 -123
- package/dist/es/Popconfirm-Cop44KwQ.js +0 -22
- package/dist/es/Select-TIoGsqKv.js +0 -133
- package/dist/es/Switch-CHjcLtHs.js +0 -34
- package/dist/es/hooks-CYdEHUVd.js +0 -105
- package/dist/theme/fonts/zpix.ttf +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { t as e, e as o, R as t, f as n } from "./utils-bsCscZfS.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 x, createElementBlock as v, createCommentVNode as b, renderSlot as h, unref as B, withModifiers as _, vShow as C, shallowReactive as k, isVNode as w, h as I, render as T, reactive as P, nextTick as $, createTextVNode as z, toDisplayString as M, resolveDynamicComponent as j, withKeys as A } from "vue";
|
|
3
|
+
import { e as O, f as L, d as V, u as E, g as D } from "./hooks-BaG7l8K5.js";
|
|
4
|
+
import { P as R } from "./Icon-DpJyuj7c.js";
|
|
5
|
+
import { v as N, u as K, f as S, d as Z, w as H, g as U, x as q, i as F, y as G, z as J, A as Q, B as W } from "./vendor-DXmGx29U.js";
|
|
6
|
+
import { b as X } from "./Button-S_31-UWJ.js";
|
|
7
|
+
import { _ as Y } from "./Input-CiE4bPJN.js";
|
|
8
|
+
import { P as ee } from "./Overlay-BRDSWspM.js";
|
|
9
|
+
const oe = ["aria-live"], te = { class: "px-message__content" }, ne = { key: 0, class: "px-message__close" }, se = 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" }, onDestroy: {} }, setup(n2, { expose: s2 }) {
|
|
10
|
+
const k2 = n2, w2 = a(false), I2 = a(), T2 = a(0), { topOffset: P2, bottomOffset: $2 } = O({ getLastBottomOffset: N(ue, k2), offset: k2.offset, boxHeight: T2 }), z2 = l((() => e.get(k2.type) ?? "circle-info")), M2 = l((() => ({ top: o(P2.value), zIndex: k2.zIndex })));
|
|
11
|
+
let j2;
|
|
12
|
+
function A2() {
|
|
13
|
+
0 !== k2.duration && (j2 = K(E2, k2.duration));
|
|
14
|
+
}
|
|
15
|
+
function V2() {
|
|
16
|
+
clearTimeout(j2);
|
|
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
|
+
})), i((() => {
|
|
27
|
+
w2.value = true, A2();
|
|
28
|
+
})), s2({ close: E2, bottomOffset: $2 }), (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.onDestroy()) }, { 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: A2 }, [x(R, { class: "px-message__icon", icon: z2.value }, null, 8, ["icon"]), m("div", te, [h(e2.$slots, "default", {}, (() => [e2.message ? (u(), r(B(t), { key: 0, vNode: e2.message }, null, 8, ["vNode"])) : b("", true)]))]), e2.showClose ? (u(), v("div", ne, [x(R, { icon: "close", onClick: _(E2, ["stop"]) })])) : b("", true)], 46, oe), [[C, w2.value]])])), _: 3 }, 8, ["name"]));
|
|
29
|
+
} }), ae = ["info", "success", "warning", "danger", "error"], le = k([]), { nextZIndex: ce } = V(), ie = { type: "info", duration: 3e3, offset: 10, transitionName: "fade-up" }, re = (e2) => {
|
|
30
|
+
const o2 = !e2 || w(e2) || Z(e2) ? { message: e2 } : e2;
|
|
31
|
+
return { ...ie, ...o2 };
|
|
32
|
+
};
|
|
33
|
+
function ue() {
|
|
34
|
+
const e2 = H(le, { id: this.id });
|
|
35
|
+
return e2 <= 0 ? 0 : U(le, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
|
|
36
|
+
}
|
|
37
|
+
const pe = (e2 = {}) => ((e3) => {
|
|
38
|
+
const o2 = E().value, t2 = document.createElement("div"), n2 = { ...e3, id: o2, zIndex: ce(), onDestroy: () => {
|
|
39
|
+
const e4 = H(le, { id: o2 });
|
|
40
|
+
-1 !== e4 && (le.splice(e4, 1), T(null, t2));
|
|
41
|
+
} }, s2 = I(se, 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 le.push(c2), c2;
|
|
45
|
+
})(re(e2)).handler;
|
|
46
|
+
S(ae, ((e2) => {
|
|
47
|
+
q(pe, e2, ((o2) => {
|
|
48
|
+
const t2 = re(o2);
|
|
49
|
+
return pe({ ...t2, type: e2 });
|
|
50
|
+
}));
|
|
51
|
+
})), pe.closeAll = function(e2) {
|
|
52
|
+
S(le, ((o2) => {
|
|
53
|
+
e2 ? o2.props.type === e2 && o2.handler.close() : o2.handler.close();
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
const de = n(pe, "$message"), 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" }, xe = 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: {}, confirmButtonText: {}, 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: {}, inputValue: { default: "" }, inputType: {}, buttonSize: {}, beforeClose: {} }, setup(o2) {
|
|
57
|
+
const t2 = o2, n2 = D(), { doAction: s2 } = t2, { nextZIndex: i2 } = V(), y2 = a(), k2 = a(), w2 = E(), I2 = `msgbox-title-${E().value}`, T2 = P({ ...t2, zIndex: i2() }), O2 = l((() => !!T2.message)), L2 = l((() => T2.icon ?? e.get(T2.type ?? "")));
|
|
58
|
+
function N2() {
|
|
59
|
+
t2.closeOnClickModal && S2("close");
|
|
60
|
+
}
|
|
61
|
+
function K2(e2) {
|
|
62
|
+
if ("textarea" !== T2.inputType) return e2.preventDefault(), S2("confirm");
|
|
63
|
+
}
|
|
64
|
+
function S2(e2) {
|
|
65
|
+
G(t2.beforeClose) ? t2.beforeClose(e2, T2, (() => s2(e2, T2.inputValue))) : s2(e2, T2.inputValue);
|
|
66
|
+
}
|
|
67
|
+
function Z2() {
|
|
68
|
+
S2("close");
|
|
69
|
+
}
|
|
70
|
+
return c((() => {
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = t2.visible) == null ? void 0 : _a.value;
|
|
73
|
+
}), ((e2) => {
|
|
74
|
+
e2 && (T2.zIndex = i2()), "prompt" === t2.boxType && e2 && $((() => {
|
|
75
|
+
var _a;
|
|
76
|
+
(_a = k2.value) == null ? void 0 : _a.focus();
|
|
77
|
+
}));
|
|
78
|
+
})), (e2, o3) => (u(), r(p, { name: "fade-in-linear", onAfterLeave: e2.destroy }, { default: d((() => [f(x(ee, { "z-index": T2.zIndex, mask: "" }, { default: d((() => [m("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": I2, class: "px-overlay-message-box", onClick: N2 }, [m("div", { ref: "rootRef", class: g(["px-message-box", { "is-center": T2.center }]), onClick: o3[5] || (o3[5] = _((() => {
|
|
79
|
+
}), ["stop"])) }, [B(F)(T2.title) ? b("", true) : (u(), v("div", { key: 0, ref_key: "headerRef", ref: y2, class: g(["px-message-box__header", { "show-close": T2.showClose }]) }, [m("div", { class: "px-message-box__title", id: I2 }, [L2.value && T2.center ? (u(), r(R, { key: 0, class: g({ [`px-icon-${T2.type}`]: T2.type }), icon: L2.value }, null, 8, ["class", "icon"])) : b("", true), z(" " + M(T2.title), 1)]), e2.showClose ? (u(), v("button", { key: 0, class: "px-message-box__header-btn", onClick: _(Z2, ["stop"]) }, [x(R, { icon: "close" })])) : b("", true)], 2)), m("div", fe, [L2.value && !T2.center && O2.value ? (u(), r(R, { key: 0, class: g({ [`px-icon-${T2.type}`]: T2.type }), icon: L2.value }, null, 8, ["class", "icon"])) : b("", true), O2.value ? (u(), v("div", me, [h(e2.$slots, "default", {}, (() => [(u(), r(j(T2.showInput ? "label" : "p"), { for: T2.showInput ? B(w2) : void 0 }, { default: d((() => [z(M(T2.message), 1)])), _: 1 }, 8, ["for"]))]))])) : b("", true)]), f(m("div", ye, [x(Y, { modelValue: T2.inputValue, "onUpdate:modelValue": o3[0] || (o3[0] = (e3) => T2.inputValue = e3), ref_key: "inputRef", ref: k2, placeholder: T2.inputPlaceholder, type: T2.inputType, onKeyup: A(K2, ["enter"]) }, null, 8, ["modelValue", "placeholder", "type"])], 512), [[C, T2.showInput]]), m("div", ge, [T2.showCancelButton ? (u(), r(X, { key: 0, class: "px-message-box__footer-btn px-message-box__cancel-btn", type: T2.cancelButtonType, round: T2.roundButton, loading: T2.cancelButtonLoading, onClick: o3[1] || (o3[1] = (e3) => S2("cancel")), onKeydown: o3[2] || (o3[2] = A(_(((e3) => S2("cancel")), ["prevent"]), ["enter"])) }, { default: d((() => [z(M(T2.cancelButtonText || B(n2).t("messagebox.cancel")), 1)])), _: 1 }, 8, ["type", "round", "loading"])) : b("", true), f(x(X, { class: "px-message-box__footer-btn px-message-box__confirm-btn", type: T2.confirmButtonType ?? "primary", round: T2.roundButton, loading: T2.confirmButtonLoading, onClick: o3[3] || (o3[3] = (e3) => S2("confirm")), onKeydown: o3[4] || (o3[4] = A(_(((e3) => S2("confirm")), ["prevent"]), ["enter"])) }, { default: d((() => [z(M(T2.confirmButtonText || B(n2).t("messagebox.confirm")), 1)])), _: 1 }, 8, ["type", "round", "loading"]), [[C, T2.showConfirmButton]])])], 2)])])), _: 3 }, 8, ["z-index"]), [[C, e2.visible.value]])])), _: 3 }, 8, ["onAfterLeave"]));
|
|
80
|
+
} }), ve = /* @__PURE__ */ new Map();
|
|
81
|
+
function be(e2) {
|
|
82
|
+
let o2;
|
|
83
|
+
return Z(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 = G(e4 == null ? void 0 : e4.message) || w(e4 == null ? void 0 : e4.message), s3 = x(xe, { ...e4, visible: t4 }, n4 ? { default: (l2 = e4.message, G(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 = ve.get(n3);
|
|
93
|
+
let a2;
|
|
94
|
+
$((() => 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), ve.delete(n3);
|
|
97
|
+
} }, o3), n3 = t3 == null ? void 0 : t3.proxy;
|
|
98
|
+
return n3.visible.value = true, n3;
|
|
99
|
+
})(e2);
|
|
100
|
+
ve.set(s2, { options: e2, callback: o2, resolve: t2, reject: n2 });
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
const he = { alert: { closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } };
|
|
104
|
+
S(["alert", "confirm", "prompt"], ((e2) => {
|
|
105
|
+
return q(be, e2, (o2 = e2, (e3, t2, n2) => {
|
|
106
|
+
let s2 = "";
|
|
107
|
+
return Q(t2) ? (n2 = t2, s2 = "") : s2 = W(t2) ? "" : t2, be(J({ title: s2, message: e3, type: "", boxType: o2, ...he[o2] }, n2));
|
|
108
|
+
}));
|
|
109
|
+
var o2;
|
|
110
|
+
})), q(be, "close", (() => {
|
|
111
|
+
ve.forEach(((e2, o2) => {
|
|
112
|
+
o2.doClose();
|
|
113
|
+
})), ve.clear();
|
|
114
|
+
}));
|
|
115
|
+
const Be = be;
|
|
116
|
+
q(Be, "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
|
+
}));
|
|
119
|
+
export {
|
|
120
|
+
de as P,
|
|
121
|
+
Be as a,
|
|
122
|
+
ae as m
|
|
123
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t, e, R as o, _ as n, f as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { e as z, d as E, u as $ } from "./hooks-
|
|
1
|
+
import { t, e, R as o, _ as n, f as i } from "./utils-bsCscZfS.js";
|
|
2
|
+
import { defineComponent as s, ref as a, computed as l, onMounted as f, createBlock as r, openBlock as c, 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 w, vShow as b, 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-BaG7l8K5.js";
|
|
4
4
|
import { P as B } from "./Icon-DpJyuj7c.js";
|
|
5
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(
|
|
7
|
-
const
|
|
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(s({ 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: {}, onDestroy: {} }, setup(n2, { expose: i2 }) {
|
|
7
|
+
const s2 = n2, I2 = a(false), N2 = a(), O2 = a(0), { topOffset: j2, bottomOffset: E2 } = z({ getLastBottomOffset: D(tt, s2), offset: s2.offset, boxHeight: O2 }), $2 = l((() => t.get(s2.type) ?? "circle-info")), P2 = l((() => s2.position.endsWith("right") ? "right" : "left")), R2 = l((() => s2.position.startsWith("top") ? "top" : "bottom")), A2 = l((() => ({ [R2.value]: e(j2.value), zIndex: s2.zIndex })));
|
|
8
8
|
let L2;
|
|
9
9
|
function W2() {
|
|
10
|
-
0 !==
|
|
10
|
+
0 !== s2.duration && (L2 = M(J2, s2.duration));
|
|
11
11
|
}
|
|
12
12
|
function G2() {
|
|
13
13
|
clearTimeout(L2);
|
|
@@ -17,21 +17,21 @@ const H = ["aria-live"], T = { class: "px-notification__text" }, Z = { class: "p
|
|
|
17
17
|
}
|
|
18
18
|
return f((() => {
|
|
19
19
|
I2.value = true, W2();
|
|
20
|
-
})),
|
|
21
|
-
} }), [["__scopeId", "data-v-
|
|
20
|
+
})), i2({ bottomOffset: E2, close: J2 }), (t2, e2) => (c(), r(p, { name: `px-notification-${t2.transitionName}`, onAfterLeave: e2[1] || (e2[1] = (e3) => !I2.value && t2.onDestroy()), 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 ? (c(), r(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 ? (c(), r(C(o), { key: 0, vNode: t2.message }, null, 8, ["vNode"])) : g("", true)]), true)])]), t2.showClose ? (c(), x("div", F, [k(B, { icon: "close", onClick: w(J2, ["stop"]) })])) : g("", true)], 46, H), [[b, I2.value]])])), _: 3 }, 8, ["name"]));
|
|
21
|
+
} }), [["__scopeId", "data-v-ff3aeca4"]]), J = ["info", "success", "warning", "danger"], K = ["top-right", "top-left", "bottom-right", "bottom-left"], Q = /* @__PURE__ */ new Map();
|
|
22
22
|
P(K, ((t2) => {
|
|
23
23
|
Q.set(t2, j([]));
|
|
24
24
|
}));
|
|
25
|
-
const { nextZIndex: S } = E(), U = { type: "info", duration: 3e3, offset: 20, transitionName: "fade", showClose: true }, V = (t2) => {
|
|
25
|
+
const { nextZIndex: S } = E(), U = { title: "", type: "info", duration: 3e3, offset: 20, position: "top-right", transitionName: "fade", showClose: true }, V = (t2) => {
|
|
26
26
|
const e2 = !t2 || I(t2) || R(t2) ? { message: t2 } : t2;
|
|
27
27
|
return { ...U, ...e2 };
|
|
28
28
|
}, X = (t2) => Q.get(t2), Y = (t2 = {}) => ((t3) => {
|
|
29
|
-
const e2 = $().value, o2 = document.createElement("div"), n2 = X(t3.position || "top-right"),
|
|
29
|
+
const e2 = $().value, o2 = document.createElement("div"), n2 = X(t3.position || "top-right"), i2 = { ...t3, id: e2, zIndex: S(), onDestroy: () => {
|
|
30
30
|
const t4 = A(n2, { id: e2 });
|
|
31
31
|
-1 !== t4 && (n2.splice(t4, 1), O(null, o2));
|
|
32
|
-
} },
|
|
33
|
-
O(
|
|
34
|
-
const a2 =
|
|
32
|
+
} }, s2 = N(G, i2);
|
|
33
|
+
O(s2, o2), document.body.appendChild(o2.firstElementChild);
|
|
34
|
+
const a2 = s2.component, l2 = { close: () => a2.exposed.close() }, f2 = { props: i2, id: e2, vm: a2, vnode: s2, handler: l2 };
|
|
35
35
|
return n2.push(f2), f2;
|
|
36
36
|
})(V(t2)).handler;
|
|
37
37
|
function tt() {
|
|
@@ -50,7 +50,7 @@ P(J, ((t2) => {
|
|
|
50
50
|
}));
|
|
51
51
|
}));
|
|
52
52
|
};
|
|
53
|
-
const et =
|
|
53
|
+
const et = i(Y, "$notify");
|
|
54
54
|
export {
|
|
55
55
|
et as P,
|
|
56
56
|
K as a,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { e as o, _ as t, w as e } from "./utils-bsCscZfS.js";
|
|
2
|
+
import { defineComponent as n, ref as i, computed as c, createBlock as l, openBlock as r, createSlots as a, withCtx as f, createElementVNode as s, normalizeStyle as p, createCommentVNode as m, createTextVNode as d, toDisplayString as u, createVNode as _, unref as y, renderSlot as x } from "vue";
|
|
3
|
+
import { g as B } from "./hooks-BaG7l8K5.js";
|
|
4
|
+
import { b as T } from "./Button-S_31-UWJ.js";
|
|
5
|
+
import { P as h } from "./Icon-DpJyuj7c.js";
|
|
6
|
+
import { T as v } from "./Tooltip-k6gKnMyt.js";
|
|
7
|
+
const k = { class: "px-popconfirm__main" }, j = { class: "px-popconfirm__action" }, P = e(t(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(t2, { emit: e2 }) {
|
|
8
|
+
const n2 = t2, P2 = e2, g = B(), w = i(), C = c((() => ({ width: o(n2.width) })));
|
|
9
|
+
function I() {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = w.value) == null ? void 0 : _a.hide();
|
|
12
|
+
}
|
|
13
|
+
function $(o2) {
|
|
14
|
+
P2("confirm", o2), I();
|
|
15
|
+
}
|
|
16
|
+
function z(o2) {
|
|
17
|
+
P2("cancel", o2), I();
|
|
18
|
+
}
|
|
19
|
+
return (o2, t3) => (r(), l(v, { ref_key: "tooltipRef", ref: w, trigger: "click", "hide-timeout": o2.hideAfter }, a({ content: f((() => [s("div", { class: "px-popconfirm", role: "alertdialog", style: p(C.value) }, [s("div", k, [!o2.hideIcon && o2.icon ? (r(), l(h, { key: 0, icon: o2.icon, color: o2.iconColor }, null, 8, ["icon", "color"])) : m("", true), d(" " + u(o2.title), 1)])], 4), s("div", j, [_(T, { class: "px-popconfirm__cancel", size: "small", type: o2.cancelButtonType, onClick: z }, { default: f((() => [d(u(o2.cancelButtonText || y(g).t("popconfirm.cancelButtonText")), 1)])), _: 1 }, 8, ["type"]), _(T, { class: "px-popconfirm__confirm", size: "small", type: o2.confirmButtonType, onClick: $ }, { default: f((() => [d(u(o2.confirmButtonText || y(g).t("popconfirm.confirmButtonText")), 1)])), _: 1 }, 8, ["type"])])])), _: 2 }, [o2.$slots.default ? { name: "default", fn: f((() => [x(o2.$slots, "default", {}, void 0, true)])), key: "0" } : void 0, o2.$slots.reference ? { name: "default", fn: f((() => [x(o2.$slots, "reference", {}, void 0, true)])), key: "1" } : void 0]), 1032, ["hide-timeout"]));
|
|
20
|
+
} }), [["__scopeId", "data-v-fd6e7d1d"]]));
|
|
21
|
+
export {
|
|
22
|
+
P
|
|
23
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { R as e, _ as l, c as t, r as a, w as o } from "./utils-bsCscZfS.js";
|
|
2
|
+
import { defineComponent as i, inject as s, computed as n, createElementBlock as u, openBlock as r, withModifiers as d, normalizeClass as c, renderSlot as p, createVNode as h, unref as v, useSlots as f, ref as m, reactive as g, watchEffect as b, watch as x, onMounted as y, onBeforeUnmount as _, provide as V, normalizeStyle as w, withCtx as I, createCommentVNode as M, createElementVNode as k, toDisplayString as S, Fragment as O, renderList as L, createBlock as B, mergeProps as D, nextTick as z } from "vue";
|
|
3
|
+
import { C as $, D as j, g as C, b as F, s as R, e as E, E as H, F as P, f as W, y as q, q as A, i as N, G as T, c as U } from "./vendor-DXmGx29U.js";
|
|
4
|
+
import { g as G, u as K, c as J, a as Q } from "./hooks-BaG7l8K5.js";
|
|
5
|
+
import { P as X } from "./Icon-DpJyuj7c.js";
|
|
6
|
+
import { _ as Y } from "./Input-CiE4bPJN.js";
|
|
7
|
+
import { T as Z } from "./Tooltip-k6gKnMyt.js";
|
|
8
|
+
const ee = Symbol("selectContext"), le = { 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"] }] }, te = /* @__PURE__ */ new Set(["primary", "success", "warning", "danger", "info"]), ae = { default: { "item-selected-font-color": "color", "item-selected-bg-color": "light", "item-indicator-color": "color", "item-highlighted-border-color": "color" }, ghost: { "item-selected-font-color": "color", "item-selected-bg-color": "light", "item-indicator-color": "color", "item-highlighted-border-color": "color" } }, oe = ["aria-selected", "id"], ie = l(i({ name: "PxOption", __name: "Option", props: { value: {}, label: {}, disabled: { type: Boolean, default: false } }, setup(l2) {
|
|
11
|
+
const t2 = l2, a2 = s(ee), o2 = n((() => {
|
|
12
|
+
var _a;
|
|
13
|
+
return ((_a = a2 == null ? void 0 : a2.selectStates.selectedOption) == null ? void 0 : _a.value) === t2.value;
|
|
14
|
+
})), i2 = n((() => $(["label", "value"], ((e2) => j(C(a2, ["highlightedLine", "value", e2]), C(t2, e2))))));
|
|
15
|
+
function f2() {
|
|
16
|
+
t2.disabled || (a2 == null ? void 0 : a2.handleSelect(t2));
|
|
17
|
+
}
|
|
18
|
+
return (l3, s2) => (r(), u("li", { role: "option", "aria-selected": o2.value, class: c(["px-select__menu-item", { "is-disabled": l3.disabled, "is-selected": o2.value, "is-highlighted": i2.value }]), id: `select-item-${l3.value}`, onClick: d(f2, ["stop"]) }, [p(l3.$slots, "default", {}, (() => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return [h(v(e), { vNode: ((_a = v(a2)) == null ? void 0 : _a.renderLabel) ? (_b = v(a2)) == null ? void 0 : _b.renderLabel(t2) : l3.label }, null, 8, ["vNode"])];
|
|
21
|
+
}), true)], 10, oe));
|
|
22
|
+
} }), [["__scopeId", "data-v-d9852f9a"]]), se = { key: 0, class: "px-select__loading" }, ne = { key: 1, class: "px-select__nodata" }, ue = ["id"], re = o(l(i({ name: "PxSelect", __name: "Select", props: { modelValue: {}, id: {}, options: { default: () => [] }, placeholder: {}, disabled: { type: Boolean }, clearable: { type: Boolean }, ghost: { type: Boolean }, color: {}, size: {}, renderLabel: {}, filterable: { type: Boolean }, filterMethod: {}, remote: { type: Boolean }, remoteMethod: {} }, emits: ["update:modelValue", "change", "visible-change", "clear", "focus", "blur"], setup(e2, { expose: l2, emit: o2 }) {
|
|
23
|
+
const i2 = G(), s2 = e2, p2 = o2, $2 = f(), oe2 = m(), re2 = m(), de2 = m(), ce = m(/* @__PURE__ */ new Map()), pe = m(s2.options ?? []), he = m(false), ve = We(s2.modelValue), fe = g({ inputValue: (ve == null ? void 0 : ve.label) ?? "", selectedOption: ve, mouseHover: false, loading: false, highlightedIndex: -1 }), me = n((() => s2.disabled)), ge = n((() => te.has(s2.color ?? ""))), be = n((() => !!s2.color && !ge.value)), xe = n((() => {
|
|
24
|
+
if (!be.value) return {};
|
|
25
|
+
const e3 = t(s2.color), l3 = s2.ghost ? "ghost" : "default";
|
|
26
|
+
return a(e3, "px-select", ae[l3]);
|
|
27
|
+
})), ye = n((() => {
|
|
28
|
+
var _a;
|
|
29
|
+
return F((_a = $2 == null ? void 0 : $2.default) == null ? void 0 : _a.call($2), ((e3) => j(e3.type, ie)));
|
|
30
|
+
})), _e = n((() => R(ye.value) > 0)), Ve = n((() => s2.clearable && fe.mouseHover && "" !== fe.inputValue)), we = n((() => {
|
|
31
|
+
let e3;
|
|
32
|
+
return e3 = _e.value ? [...ce.value.values()][fe.highlightedIndex] : pe.value[fe.highlightedIndex], e3;
|
|
33
|
+
})), Ie = n((() => _e.value ? E(ye.value, ((e3) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
return { props: { ...e3.props, disabled: true === ((_a = e3.props) == null ? void 0 : _a.disabled) || !N((_b = e3.props) == null ? void 0 : _b.disabled) && !T((_c = e3.props) == null ? void 0 : _c.disabled) } };
|
|
36
|
+
})) : [])), Me = n((() => !!s2.filterable && !ke.value)), ke = n((() => _e.value && ce.value.size > 0 || !_e.value && R(pe.value) > 0)), Se = n((() => _e.value ? ce.value.size - 1 : R(pe.value) - 1)), Oe = n((() => s2.filterable && fe.selectedOption && he.value ? fe.selectedOption.label : s2.placeholder)), Le = n((() => s2.remote ? 300 : 100));
|
|
37
|
+
let Be = H(Ne, Le.value);
|
|
38
|
+
b((() => {
|
|
39
|
+
Be.cancel(), Be = H(Ne, Le.value);
|
|
40
|
+
}));
|
|
41
|
+
const De = K().value, { wrapperRef: ze, isFocused: $e, handleBlur: je, handleFocus: Ce } = J(de2), Fe = (function({ isDropdownVisible: e3, controlVisible: l3, selectStates: t2, highlightedLine: a2, handleSelect: o3, hasData: i3, lastIndex: s3 }) {
|
|
42
|
+
const n2 = /* @__PURE__ */ new Map();
|
|
43
|
+
return n2.set("Enter", (() => {
|
|
44
|
+
e3.value && t2.highlightedIndex >= 0 && a2.value && o3(a2.value), l3(!e3.value);
|
|
45
|
+
})), n2.set("Escape", (() => e3.value && l3(!e3.value))), n2.set("ArrowUp", ((e4) => {
|
|
46
|
+
e4.preventDefault(), i3.value && (-1 !== t2.highlightedIndex && 0 !== t2.highlightedIndex ? t2.highlightedIndex-- : t2.highlightedIndex = s3.value);
|
|
47
|
+
})), n2.set("ArrowDown", ((e4) => {
|
|
48
|
+
e4.preventDefault(), i3.value && (-1 !== t2.highlightedIndex && t2.highlightedIndex !== s3.value ? t2.highlightedIndex++ : t2.highlightedIndex = 0);
|
|
49
|
+
})), n2;
|
|
50
|
+
})({ isDropdownVisible: he, controlVisible: Ee, selectStates: fe, highlightedLine: we, handleSelect: qe, hasData: ke, lastIndex: Se });
|
|
51
|
+
function Re(e3) {
|
|
52
|
+
$e.value && z((() => je(new FocusEvent("focus", e3))));
|
|
53
|
+
}
|
|
54
|
+
function Ee(e3) {
|
|
55
|
+
var _a;
|
|
56
|
+
re2.value && ((_a = C(re2, ["value", e3 ? "show" : "hide"])) == null ? void 0 : _a(), s2.filterable && (function(e4) {
|
|
57
|
+
var _a2;
|
|
58
|
+
s2.filterable && (e4 ? (fe.selectedOption && (fe.inputValue = ""), Be()) : fe.inputValue = ((_a2 = fe.selectedOption) == null ? void 0 : _a2.label) || "");
|
|
59
|
+
})(e3), he.value = e3, p2("visible-change", e3), fe.highlightedIndex = -1);
|
|
60
|
+
}
|
|
61
|
+
function He() {
|
|
62
|
+
me.value || Ee(!he.value);
|
|
63
|
+
}
|
|
64
|
+
function Pe() {
|
|
65
|
+
var _a;
|
|
66
|
+
(_a = de2.value) == null ? void 0 : _a.clear(), fe.inputValue = "", fe.selectedOption = null, p2("clear"), W(["change", "update:modelValue"], ((e3) => p2(e3, "")));
|
|
67
|
+
}
|
|
68
|
+
function We(e3) {
|
|
69
|
+
return P(s2.options, ((l3) => l3.value === e3));
|
|
70
|
+
}
|
|
71
|
+
function qe(e3) {
|
|
72
|
+
var _a;
|
|
73
|
+
e3.disabled || (fe.inputValue = e3.label, fe.selectedOption = e3, W(["change", "update:modelValue"], ((l3) => p2(l3, e3.value))), Ee(false), (_a = de2.value) == null ? void 0 : _a.focus());
|
|
74
|
+
}
|
|
75
|
+
function Ae(e3) {
|
|
76
|
+
ce.value.clear(), W(e3, ((e4) => {
|
|
77
|
+
ce.value.set(e4.props.value, e4.props);
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
function Ne() {
|
|
81
|
+
const e3 = fe.inputValue;
|
|
82
|
+
fe.highlightedIndex = -1, _e.value ? (async function(e4) {
|
|
83
|
+
if (s2.filterable) {
|
|
84
|
+
if (s2.remote && s2.remoteMethod && q(s2.remoteMethod)) return await Ue(s2.remoteMethod, e4), void Ae(Ie.value);
|
|
85
|
+
if (s2.filterMethod && q(s2.filterMethod)) {
|
|
86
|
+
const l3 = E(s2.filterMethod(e4), "value");
|
|
87
|
+
Ae(F(Ie.value, ((e5) => U(l3, C(e5, ["props", "value"])))));
|
|
88
|
+
} else Ae(F(Ie.value, ((l3) => U(C(l3, ["props", "label"]), e4))));
|
|
89
|
+
}
|
|
90
|
+
})(e3) : (async function(e4) {
|
|
91
|
+
s2.filterable && (s2.remote && s2.remoteMethod && q(s2.remoteMethod) ? pe.value = await Ue(s2.remoteMethod, e4) : s2.filterMethod && q(s2.filterMethod) ? pe.value = s2.filterMethod(e4) : pe.value = F(s2.options, ((l3) => U(l3.label, e4))));
|
|
92
|
+
})(e3);
|
|
93
|
+
}
|
|
94
|
+
function Te(e3) {
|
|
95
|
+
var _a;
|
|
96
|
+
Fe.has(e3.key) && ((_a = Fe.get(e3.key)) == null ? void 0 : _a(e3));
|
|
97
|
+
}
|
|
98
|
+
async function Ue(e3, l3) {
|
|
99
|
+
if (!e3 || !q(e3)) return;
|
|
100
|
+
let t2;
|
|
101
|
+
fe.loading = true;
|
|
102
|
+
try {
|
|
103
|
+
t2 = await e3(l3);
|
|
104
|
+
} catch (e4) {
|
|
105
|
+
t2 = [];
|
|
106
|
+
}
|
|
107
|
+
return t2;
|
|
108
|
+
}
|
|
109
|
+
function Ge() {
|
|
110
|
+
const e3 = We(s2.modelValue);
|
|
111
|
+
e3 && (fe.inputValue = e3.label, fe.selectedOption = e3);
|
|
112
|
+
}
|
|
113
|
+
return Q(oe2, ((e3) => Re(e3))), x((() => s2.options), ((e3) => {
|
|
114
|
+
pe.value = e3 ?? [];
|
|
115
|
+
})), x((() => Ie.value), ((e3) => Ae(e3)), { immediate: true }), x((() => s2.modelValue), (() => {
|
|
116
|
+
Ge();
|
|
117
|
+
})), y((() => {
|
|
118
|
+
Ge();
|
|
119
|
+
})), _((() => {
|
|
120
|
+
Be.cancel();
|
|
121
|
+
})), V(ee, { handleSelect: qe, selectStates: fe, renderLabel: function(e3) {
|
|
122
|
+
return q(s2.renderLabel) ? s2.renderLabel(e3) : e3.label;
|
|
123
|
+
}, highlightedLine: we }), l2({ focus: () => {
|
|
124
|
+
var _a;
|
|
125
|
+
(_a = de2.value) == null ? void 0 : _a.focus();
|
|
126
|
+
}, blur: () => {
|
|
127
|
+
Re();
|
|
128
|
+
} }), (e3, l3) => (r(), u("div", { ref_key: "selectRef", ref: oe2, class: c(["px-select", { "is-disabled": me.value, "is-ghost": e3.ghost, [`px-select--${e3.size}`]: e3.size, [`px-select--${e3.color}`]: ge.value }]), style: w(xe.value), onClick: d(He, ["stop"]), onMouseenter: l3[2] || (l3[2] = (e4) => fe.mouseHover = true), onMouseleave: l3[3] || (l3[3] = (e4) => fe.mouseHover = false) }, [h(Z, { ref_key: "tooltipRef", ref: re2, placement: "bottom-start", "popper-options": v(le), onClickOutside: l3[1] || (l3[1] = (e4) => Ee(false)), manual: "" }, { default: I((() => [k("div", { ref_key: "inputWrapperRef", ref: ze }, [h(Y, { ref_key: "inputRef", ref: de2, modelValue: fe.inputValue, "onUpdate:modelValue": l3[0] || (l3[0] = (e4) => fe.inputValue = e4), id: v(De), disabled: me.value, ghost: e3.ghost, color: e3.color, size: e3.size, placeholder: e3.filterable ? Oe.value : e3.placeholder, readonly: !e3.filterable || !he.value, "aria-controls": `px-select-menu-${v(De)}`, "aria-activedescendant": we.value ? `select-item-${we.value.value}` : void 0, onFocus: v(Ce), onBlur: v(je), onInput: v(Be), onKeydown: Te }, { suffix: I((() => [Ve.value ? (r(), B(X, { key: 0, icon: "close-box", class: "px-input__clear", onClick: d(Pe, ["stop"]), onMousedown: d(v(A), ["prevent"]) }, null, 8, ["onMousedown"])) : (r(), B(X, { key: 1, class: c(["header-angle", { "is-active": he.value }]), icon: "chevron-down" }, null, 8, ["class"]))])), _: 1 }, 8, ["modelValue", "id", "disabled", "ghost", "color", "size", "placeholder", "readonly", "aria-controls", "aria-activedescendant", "onFocus", "onBlur", "onInput"])], 512)])), content: I((() => [fe.loading ? (r(), u("div", se, [h(X, { icon: "loader", spin: "" })])) : e3.filterable && Me.value ? (r(), u("div", ne, S(v(i2).t("select.noData")), 1)) : M("", true), k("ul", { class: "px-select__menu", role: "listbox", id: `px-select-menu-${v(De)}` }, [_e.value ? (r(true), u(O, { key: 1 }, L(ce.value, (([e4, l4]) => (r(), B(ie, D({ key: e4, ref_for: true }, l4), null, 16)))), 128)) : (r(true), u(O, { key: 0 }, L(pe.value, ((e4) => (r(), B(ie, D({ key: e4.value, ref_for: true }, e4), null, 16)))), 128))], 8, ue)])), _: 1 }, 8, ["popper-options"])], 38));
|
|
129
|
+
} }), [["__scopeId", "data-v-4d450d40"]])), de = o(ie);
|
|
130
|
+
export {
|
|
131
|
+
re as P,
|
|
132
|
+
de as a
|
|
133
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c as e, w as c } from "./utils-bsCscZfS.js";
|
|
2
|
+
import { defineComponent as i, computed as a, ref as t, onMounted as o, watch as l, createElementBlock as s, openBlock as n, normalizeStyle as r, normalizeClass as u, createElementVNode as v, withKeys as d, unref as p, createCommentVNode as h, toDisplayString as x, createBlock as m } from "vue";
|
|
3
|
+
import { u as f } from "./hooks-BaG7l8K5.js";
|
|
4
|
+
import { P as w } from "./Icon-DpJyuj7c.js";
|
|
5
|
+
const k = ["aria-checked", "id", "name", "disabled", "checked"], _ = { class: "px-switch__core" }, y = { class: "px-switch__core-inner" }, b = { key: 0, class: "px-switch__core-inner-text" }, V = { class: "px-switch__core-action" }, C = c(i({ 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: {}, type: {}, activeColor: {}, inactiveColor: {}, activeIcon: {}, inactiveIcon: {} }, emits: ["update:modelValue", "change"], setup(c2, { expose: i2, emit: C2 }) {
|
|
6
|
+
const T = c2, g = C2, I = a((() => T.disabled)), S = t(T.modelValue), z = t(), B = f().value, j = a((() => S.value === T.activeValue)), N = a((() => j.value ? T.activeIcon : T.inactiveIcon)), P = a((() => {
|
|
7
|
+
const c3 = {};
|
|
8
|
+
if (T.activeColor) {
|
|
9
|
+
const i3 = e(T.activeColor);
|
|
10
|
+
c3["--px-switch-on-color"] = i3.color, c3["--px-switch-on-border-color"] = i3.dark;
|
|
11
|
+
}
|
|
12
|
+
if (T.inactiveColor) {
|
|
13
|
+
const i3 = e(T.inactiveColor);
|
|
14
|
+
c3["--px-switch-off-color"] = i3.color, c3["--px-switch-off-border-color"] = i3.dark;
|
|
15
|
+
}
|
|
16
|
+
return c3;
|
|
17
|
+
}));
|
|
18
|
+
function $() {
|
|
19
|
+
if (I.value) return;
|
|
20
|
+
const e2 = j.value ? T.inactiveValue : T.activeValue;
|
|
21
|
+
S.value = e2, g("update:modelValue", e2), g("change", e2);
|
|
22
|
+
}
|
|
23
|
+
return o((() => {
|
|
24
|
+
z.value.checked = j.value;
|
|
25
|
+
})), l(j, ((e2) => {
|
|
26
|
+
z.value.checked = e2;
|
|
27
|
+
})), i2({ checked: j, focus: () => {
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = z.value) == null ? void 0 : _a.focus();
|
|
30
|
+
} }), (e2, c3) => (n(), s("div", { class: u(["px-switch", { [`px-switch--${e2.size}`]: e2.size, [`px-switch--${e2.type}`]: e2.type, "is-disabled": I.value, "is-checked": j.value }]), style: r(P.value), onClick: $ }, [v("input", { class: "px-switch__input", type: "checkbox", role: "switch", "aria-checked": j.value, ref_key: "inputRef", ref: z, id: p(B), name: e2.name, disabled: I.value, checked: j.value, onKeydown: d($, ["enter"]) }, null, 40, k), v("div", _, [v("div", y, [e2.activeText || e2.inactiveText ? (n(), s("span", b, x(j.value ? e2.activeText : e2.inactiveText), 1)) : h("", true)]), v("div", V, [N.value ? (n(), m(w, { key: 0, class: "px-switch__icon", icon: N.value, size: "xs" }, null, 8, ["icon"])) : h("", true)])])], 6));
|
|
31
|
+
} }));
|
|
32
|
+
export {
|
|
33
|
+
C as P
|
|
34
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, w as t } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { onMounted as a, watch as o, 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
|
|
2
|
+
import { onMounted as a, watch as o, 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 b, createTextVNode as k, toDisplayString as y } from "vue";
|
|
3
3
|
import { createPopper as T } from "@popperjs/core";
|
|
4
|
-
import { u as x, a as w } from "./hooks-
|
|
4
|
+
import { u as x, a as w } from "./hooks-BaG7l8K5.js";
|
|
5
5
|
import { H as j, f as B, E, v as L } from "./vendor-DXmGx29U.js";
|
|
6
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
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));
|
|
@@ -66,7 +66,7 @@ const N = ["aria-describedby"], R = ["id"], $ = e(l({ name: "PxTooltip", __name:
|
|
|
66
66
|
Z(), K == null ? void 0 : K.cancel(), Q == null ? void 0 : Q.cancel();
|
|
67
67
|
})), t2({ show: te, hide: ae, toggle: () => {
|
|
68
68
|
P.value ? ae() : 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", {}, (() => [k(y(e3.content), 1)]), true), t3[0] || (t3[0] =
|
|
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", {}, (() => [k(y(e3.content), 1)]), true), t3[0] || (t3[0] = b("div", { id: "arrow", "data-popper-arrow": "" }, null, -1))], 16, R)) : _("", true)])), _: 3 }, 8, ["name"])], 16));
|
|
70
70
|
} }), [["__scopeId", "data-v-4e2bfb45"]]), O = t($);
|
|
71
71
|
export {
|
|
72
72
|
O as P,
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { isRef as e, watch as t, onMounted as n, onBeforeUnmount as a, unref as o, getCurrentInstance as l, useSlots as r, watchEffect as s, ref as u, inject as c, computed as d, onUnmounted as i } from "vue";
|
|
2
|
+
import { f as v, y as f, k as m, z as p, n as h, o as g, a as w } from "./vendor-DXmGx29U.js";
|
|
3
|
+
function L(l2, r2, s2) {
|
|
4
|
+
e(l2) ? t(l2, ((e2, t2) => {
|
|
5
|
+
null == t2 || t2.removeEventListener(r2, s2), null == e2 || e2.addEventListener(r2, s2);
|
|
6
|
+
})) : n((() => null == l2 ? void 0 : l2.addEventListener(r2, s2))), a((() => {
|
|
7
|
+
var e2;
|
|
8
|
+
return null == (e2 = o(l2)) ? void 0 : e2.removeEventListener(r2, s2);
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
function x(e2, t2) {
|
|
12
|
+
L(document, "click", ((n2) => {
|
|
13
|
+
e2.value && n2.target && (e2.value.contains(n2.target) || t2(n2));
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
const k = (e2, t2) => v(e2, ((e3) => {
|
|
17
|
+
f(t2) && t2(e3), e3.children && k(e3.children, t2);
|
|
18
|
+
}));
|
|
19
|
+
function y() {
|
|
20
|
+
var e2, t2;
|
|
21
|
+
const n2 = /* @__PURE__ */ new Map(), a2 = l(), o2 = null == (t2 = null == (e2 = r()) ? void 0 : e2.default) ? void 0 : t2.call(e2);
|
|
22
|
+
s((() => {
|
|
23
|
+
(null == a2 ? void 0 : a2.props.disabled) ? k(o2 ?? [], ((e3) => {
|
|
24
|
+
(null == e3 ? void 0 : e3.props) && (n2.set(e3, m(e3.props)), e3.props = p(null == e3 ? void 0 : e3.props, { style: { cursor: "not-allowed", color: "var(--px-text-color-placeholder)" } }));
|
|
25
|
+
})) : k(o2 ?? [], ((e3) => {
|
|
26
|
+
n2.has(e3) && (e3.props = n2.get(e3));
|
|
27
|
+
}));
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
function E(e2, { afterBlur: t2, beforeBlur: n2, afterFocus: a2 } = {}) {
|
|
31
|
+
const o2 = l(), { emit: r2 } = o2, s2 = u(), c2 = u(false);
|
|
32
|
+
return L(s2, "click", (() => {
|
|
33
|
+
var t3;
|
|
34
|
+
null == (t3 = e2.value) || t3.focus();
|
|
35
|
+
})), { wrapperRef: s2, isFocused: c2, handleFocus: (e3) => {
|
|
36
|
+
c2.value || (c2.value = true, r2("focus", e3), null == a2 || a2());
|
|
37
|
+
}, handleBlur: (e3) => {
|
|
38
|
+
var a3;
|
|
39
|
+
f(n2) && n2(e3) || e3.relatedTarget && (null == (a3 = s2.value) ? void 0 : a3.contains(e3.relatedTarget)) || (c2.value = false, r2("blur", e3), null == t2 || t2());
|
|
40
|
+
} };
|
|
41
|
+
}
|
|
42
|
+
const M = { prefix: Math.floor(1e4 * Math.random()), current: 0 };
|
|
43
|
+
function b(e2 = "er") {
|
|
44
|
+
const t2 = `${e2}-${M.prefix}-${M.current++}`;
|
|
45
|
+
return u(t2);
|
|
46
|
+
}
|
|
47
|
+
const T = { name: "en", el: { select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" } } };
|
|
48
|
+
function B(e2) {
|
|
49
|
+
{
|
|
50
|
+
const e3 = c(h, u(g({ locale: T.name, messages: { en: T.el } })));
|
|
51
|
+
return d((() => {
|
|
52
|
+
return t2 = o(e3), w(t2, "install");
|
|
53
|
+
var t2;
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function D(e2) {
|
|
58
|
+
const t2 = d((() => e2.getLastBottomOffset())), n2 = d((() => e2.offset + t2.value)), a2 = d((() => n2.value + e2.boxHeight.value));
|
|
59
|
+
return { topOffset: n2, bottomOffset: a2 };
|
|
60
|
+
}
|
|
61
|
+
const I = u(0);
|
|
62
|
+
function O(e2 = 2e3) {
|
|
63
|
+
const t2 = u(e2), n2 = d((() => I.value + t2.value));
|
|
64
|
+
return { initialValue: t2, currentZIndex: n2, nextZIndex: () => (I.value++, n2.value) };
|
|
65
|
+
}
|
|
66
|
+
function S() {
|
|
67
|
+
const e2 = u(false);
|
|
68
|
+
let t2 = null, a2 = null;
|
|
69
|
+
return n((() => {
|
|
70
|
+
"undefined" != typeof window && (t2 = window.matchMedia("(prefers-color-scheme: dark)"), e2.value = t2.matches, a2 = (t3) => {
|
|
71
|
+
e2.value = t3.matches;
|
|
72
|
+
}, t2.addEventListener ? t2.addEventListener("change", a2) : t2.addListener(a2));
|
|
73
|
+
})), i((() => {
|
|
74
|
+
t2 && a2 && (t2.removeEventListener ? t2.removeEventListener("change", a2) : t2.removeListener(a2));
|
|
75
|
+
})), { prefersDark: e2, prefers: d((() => e2.value ? "dark" : "light")) };
|
|
76
|
+
}
|
|
77
|
+
const F = "px-theme", N = "px-dark", $ = u("system"), C = u(false);
|
|
78
|
+
function Z(e2) {
|
|
79
|
+
"undefined" != typeof document && (e2 ? document.documentElement.classList.add(N) : document.documentElement.classList.remove(N));
|
|
80
|
+
}
|
|
81
|
+
function j(e2) {
|
|
82
|
+
return "system" === e2 ? "undefined" != typeof window && window.matchMedia("(prefers-color-scheme: dark)").matches : "dark" === e2;
|
|
83
|
+
}
|
|
84
|
+
let z = false;
|
|
85
|
+
function H() {
|
|
86
|
+
if (!z && "undefined" != typeof window) {
|
|
87
|
+
!(function() {
|
|
88
|
+
if ("undefined" == typeof window) return;
|
|
89
|
+
const e4 = localStorage.getItem(F);
|
|
90
|
+
e4 && ["light", "dark", "system"].includes(e4) ? $.value = e4 : $.value = "system", C.value = j($.value), Z(C.value);
|
|
91
|
+
})(), z = true;
|
|
92
|
+
const e3 = window.matchMedia("(prefers-color-scheme: dark)"), t2 = (e4) => {
|
|
93
|
+
"system" === $.value && (C.value = e4.matches, Z(C.value));
|
|
94
|
+
};
|
|
95
|
+
e3.addEventListener ? e3.addEventListener("change", t2) : e3.addListener(t2);
|
|
96
|
+
}
|
|
97
|
+
const e2 = (e3) => {
|
|
98
|
+
$.value = e3, C.value = j(e3), Z(C.value), "undefined" != typeof localStorage && localStorage.setItem(F, e3);
|
|
99
|
+
};
|
|
100
|
+
return { theme: d((() => $.value)), isDark: d((() => C.value)), setTheme: e2, toggleTheme: () => {
|
|
101
|
+
const t2 = C.value ? "light" : "dark";
|
|
102
|
+
e2(t2);
|
|
103
|
+
} };
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
x as a,
|
|
107
|
+
y as b,
|
|
108
|
+
E as c,
|
|
109
|
+
O as d,
|
|
110
|
+
D as e,
|
|
111
|
+
L as f,
|
|
112
|
+
B as g,
|
|
113
|
+
S as h,
|
|
114
|
+
H as i,
|
|
115
|
+
b as u
|
|
116
|
+
};
|