sakana-element 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{Alert-D4jZO-Gv.js → Alert-C5X-XFGJ.js} +1 -1
- package/dist/es/Button-DTik2ZP6.js +33 -0
- package/dist/es/{Collapse-CgadjkRS.js → Collapse-l_8qKOBG.js} +1 -1
- package/dist/es/Dropdown-ZjZ0qSn2.js +40 -0
- package/dist/es/{Form-X4dNzwFt.js → Form-pxRZxseS.js} +1 -1
- package/dist/es/Icon-UBaqO2nY.js +27 -0
- package/dist/es/{Input-C0g1h9x2.js → Input-BJoBaFXa.js} +3 -3
- package/dist/es/{Loading-Cv4Fsu-C.js → Loading-BJJBJhg3.js} +2 -2
- package/dist/es/{Message-BuoSEEVc.js → Message-CqBKW0c8.js} +41 -41
- package/dist/es/Notification-CVACM2cj.js +58 -0
- package/dist/es/{Popconfirm-mMYpa7O6.js → Popconfirm-CW8oRycq.js} +3 -3
- package/dist/es/{Select-SRw_b6I2.js → Select-C7mwByXa.js} +4 -4
- package/dist/es/{Switch-bhJBaSI7.js → Switch-CgFPFC3j.js} +1 -1
- package/dist/es/Tooltip-D9rQ4LEg.js +74 -0
- package/dist/es/hooks-DNMt3QPi.js +104 -0
- package/dist/es/index.js +55 -51
- package/dist/index.css +1 -1
- package/dist/theme/Button.css +508 -116
- package/dist/theme/Notification.css +20 -20
- package/dist/theme/Tooltip.css +10 -10
- package/dist/types/components/Button/types.d.ts +3 -0
- package/dist/types/components/Icon/icons/pixelarticons-all.d.ts +1 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +12 -12
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +11 -3
- package/dist/es/Button-l3ljgd74.js +0 -33
- package/dist/es/Dropdown-DBqye5wx.js +0 -38
- package/dist/es/Icon-4XdUD4qc.js +0 -27
- package/dist/es/Notification-Bv_vDOpB.js +0 -58
- package/dist/es/Tooltip-CUOZC7JN.js +0 -74
- package/dist/es/hooks-qpAqkY5H.js +0 -64
- /package/dist/types/components/Button/{contants.d.ts → constants.d.ts} +0 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sakana-element",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Components library by Vue3 + Ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/umd/index.umd.cjs",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./dist/types/core/index.d.ts",
|
|
14
15
|
"import": "./dist/es/index.js",
|
|
15
|
-
"require": "./dist/umd/index.umd.cjs"
|
|
16
|
-
"types": "./dist/types/core/index.d.ts"
|
|
16
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
17
17
|
},
|
|
18
18
|
"./dist/index.css": "./dist/index.css",
|
|
19
19
|
"./dist/": {
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
"keywords": [],
|
|
37
37
|
"author": "",
|
|
38
38
|
"license": "ISC",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/yu859/sakana-element.git"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/yu859/sakana-element#readme",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/yu859/sakana-element/issues"
|
|
46
|
+
},
|
|
39
47
|
"dependencies": {
|
|
40
48
|
"@popperjs/core": "^2.11.8",
|
|
41
49
|
"async-validator": "^4.2.5"
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { d as t, _ as o, w as e } from "./utils-340oIQ8K.js";
|
|
2
|
-
import { defineComponent as a, useSlots as n, inject as l, ref as r, computed as i, createBlock as u, openBlock as s, resolveDynamicComponent as d, unref as p, normalizeStyle as c, normalizeClass as b, withCtx as x, renderSlot as v, createCommentVNode as g, createVNode as f, provide as y, reactive as h, toRef as m, createElementBlock as _ } from "vue";
|
|
3
|
-
import { P as B } from "./Icon-4XdUD4qc.js";
|
|
4
|
-
import { t as M } from "./vendor-DXmGx29U.js";
|
|
5
|
-
const z = Symbol("BUTTON_GROUP_CTX_KEY"), I = o(a({ name: "PxButton", __name: "Button", props: { tag: { default: "button" }, type: {}, size: {}, nativeType: { default: "button" }, disabled: { type: Boolean }, loading: { type: Boolean }, icon: {}, circle: { type: Boolean }, plain: { type: Boolean }, round: { type: Boolean }, color: {}, loadingIcon: {}, autofocus: { type: Boolean }, useThrottle: { type: Boolean, default: true }, throttleDuration: { default: 500 } }, emits: ["click"], setup(o2, { expose: e2, emit: a2 }) {
|
|
6
|
-
const y2 = /* @__PURE__ */ new Set(["button", "a", "div", "span", "router-link"]), h2 = o2;
|
|
7
|
-
"string" != typeof h2.tag || y2.has(h2.tag) || t("PxButton", `Invalid tag "${h2.tag}". Allowed tags: ${[...y2].join(", ")}. Falling back to "button".`);
|
|
8
|
-
const m2 = a2, _2 = n(), I2 = l(z, void 0), $2 = r(), k2 = i((() => "string" != typeof h2.tag || y2.has(h2.tag) ? h2.tag : "button")), T2 = i((() => (I2 == null ? void 0 : I2.size) ?? (h2 == null ? void 0 : h2.size) ?? "")), P2 = i((() => (I2 == null ? void 0 : I2.type) ?? (h2 == null ? void 0 : h2.type) ?? "")), S = i((() => (I2 == null ? void 0 : I2.disabled) || (h2 == null ? void 0 : h2.disabled) || false)), j = i((() => ({ marginRight: _2.default ? "6px" : "0px" })));
|
|
9
|
-
function w(t2, o3) {
|
|
10
|
-
const e3 = parseInt(t2.replace("#", ""), 16);
|
|
11
|
-
return `#${(Math.min(255, (e3 >> 16) + Math.round(2.55 * o3)) << 16 | Math.min(255, (e3 >> 8 & 255) + Math.round(2.55 * o3)) << 8 | Math.min(255, (255 & e3) + Math.round(2.55 * o3))).toString(16).padStart(6, "0")}`;
|
|
12
|
-
}
|
|
13
|
-
const G = i((() => {
|
|
14
|
-
if (!h2.color) return {};
|
|
15
|
-
const t2 = h2.color, o3 = (function(t3) {
|
|
16
|
-
const o4 = parseInt(t3.replace("#", ""), 16);
|
|
17
|
-
return (0.299 * (o4 >> 16) + 0.587 * (o4 >> 8 & 255) + 0.114 * (255 & o4)) / 255 > 0.6 ? "#1e1e2e" : "#ffffff";
|
|
18
|
-
})(t2), e3 = (function(t3) {
|
|
19
|
-
const o4 = parseInt(t3.replace("#", ""), 16);
|
|
20
|
-
return `#${(Math.max(0, (o4 >> 16) - Math.round(38.25)) << 16 | Math.max(0, (o4 >> 8 & 255) - Math.round(38.25)) << 8 | Math.max(0, (255 & o4) - Math.round(38.25))).toString(16).padStart(6, "0")}`;
|
|
21
|
-
})(t2), a3 = w(t2, 20), n2 = w(t2, 35);
|
|
22
|
-
return h2.plain ? { "--px-button-text-color": t2, "--px-button-bg-color": n2, "--px-button-border-color": t2, "--px-button-hover-text-color": o3, "--px-button-hover-bg-color": t2, "--px-button-hover-border-color": t2, "--px-button-active-text-color": o3, "--px-button-active-bg-color": e3, "--px-button-active-border-color": e3, "--px-button-disabled-text-color": a3, "--px-button-disabled-bg-color": n2, "--px-button-disabled-border-color": a3 } : { "--px-button-text-color": o3, "--px-button-bg-color": t2, "--px-button-border-color": e3, "--px-button-shadow-color": e3, "--px-button-hover-text-color": o3, "--px-button-hover-bg-color": a3, "--px-button-hover-border-color": t2, "--px-button-active-text-color": o3, "--px-button-active-bg-color": e3, "--px-button-active-border-color": e3, "--px-button-disabled-text-color": o3, "--px-button-disabled-bg-color": a3, "--px-button-disabled-border-color": a3 };
|
|
23
|
-
})), C = (t2) => m2("click", t2), D = M(C, h2.throttleDuration, { trailing: false });
|
|
24
|
-
return e2({ ref: $2, disabled: S, size: T2, type: P2 }), (t2, o3) => (s(), u(d(k2.value), { ref_key: "_ref", ref: $2, autofocus: t2.autofocus, type: "button" === k2.value ? t2.nativeType : void 0, class: b(["px-button", { [`px-button--${P2.value}`]: P2.value, [`px-button--${T2.value}`]: T2.value, "is-plain": t2.plain, "is-round": t2.round, "is-circle": t2.circle, "is-disabled": S.value, "is-loading": t2.loading }]), disabled: !(!S.value && !t2.loading) || void 0, style: c(G.value), onClick: o3[0] || (o3[0] = (o4) => t2.useThrottle ? p(D)(o4) : C(o4)) }, { default: x((() => [t2.loading ? v(t2.$slots, "loading", { key: 0 }, (() => [f(B, { class: "loading-icon", icon: t2.loadingIcon ?? "loader", style: c(j.value), size: "1x", spin: "" }, null, 8, ["icon", "style"])]), true) : g("", true), t2.icon && !t2.loading ? (s(), u(B, { key: 1, icon: t2.icon, style: c(j.value), size: "1x" }, null, 8, ["icon", "style"])) : g("", true), v(t2.$slots, "default", {}, void 0, true)])), _: 3 }, 8, ["autofocus", "type", "disabled", "class", "style"]));
|
|
25
|
-
} }), [["__scopeId", "data-v-8bf437b2"]]), $ = { class: "px-button-group" }, k = o(a({ name: "PxButtonGroup", __name: "ButtonGroup", props: { size: {}, type: {}, disabled: { type: Boolean } }, setup(t2) {
|
|
26
|
-
const o2 = t2;
|
|
27
|
-
return y(z, h({ size: m(o2, "size"), type: m(o2, "type"), disabled: m(o2, "disabled") })), (t3, o3) => (s(), _("div", $, [v(t3.$slots, "default", {}, void 0, true)]));
|
|
28
|
-
} }), [["__scopeId", "data-v-2aa41476"]]), T = e(I), P = e(k);
|
|
29
|
-
export {
|
|
30
|
-
P,
|
|
31
|
-
T as a,
|
|
32
|
-
I as b
|
|
33
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { w as e } from "./utils-340oIQ8K.js";
|
|
2
|
-
import { defineComponent as o, inject as i, computed as t, createElementBlock as l, openBlock as a, Fragment as d, createCommentVNode as n, createElementVNode as s, normalizeClass as p, unref as r, renderSlot as m, createTextVNode as u, toDisplayString as c, useSlots as f, ref as v, provide as y, createVNode as h, mergeProps as b, withCtx as k, createBlock as w, renderList as _ } from "vue";
|
|
3
|
-
import { u as B, a as g, b as C } from "./hooks-qpAqkY5H.js";
|
|
4
|
-
import { P as x, a as z } from "./Button-l3ljgd74.js";
|
|
5
|
-
import { T as $ } from "./Tooltip-CUOZC7JN.js";
|
|
6
|
-
import { a as j, i as T } from "./vendor-DXmGx29U.js";
|
|
7
|
-
const D = Symbol("dropdownContext"), I = { key: 0, role: "separator", class: "divided-placeholder" }, O = ["id"], P = o({ name: "PxDropdownItem", __name: "DropdownItem", props: { command: { default: B().value }, label: {}, disabled: { type: Boolean, default: false }, divided: { type: Boolean, default: false } }, setup(e2) {
|
|
8
|
-
const o2 = e2, f2 = i(D), v2 = t((() => f2 == null ? void 0 : f2.size.value));
|
|
9
|
-
function y2() {
|
|
10
|
-
o2.disabled || (f2 == null ? void 0 : f2.handleItemClick(o2));
|
|
11
|
-
}
|
|
12
|
-
return (e3, o3) => (a(), l(d, null, [e3.divided ? (a(), l("li", I)) : n("", true), s("li", { id: `dropdown-item-${e3.command ?? r(B)().value}`, class: p({ "px-dropdown__item": true, ["px-dropdown__item--" + v2.value]: v2.value, "is-disabled": e3.disabled, "is-divided": e3.divided }), onClick: y2 }, [m(e3.$slots, "default", {}, (() => [u(c(e3.label), 1)]))], 10, O)], 64));
|
|
13
|
-
} }), R = { class: "px-dropdown__menu" }, A = e(o({ name: "PxDropdown", inheritAttrs: false, __name: "Dropdown", props: { type: {}, size: {}, items: { default: () => [] }, hideOnClick: { type: Boolean, default: true }, splitButton: { type: Boolean }, content: {}, trigger: {}, placement: {}, manual: { type: Boolean }, disabled: { type: Boolean }, popperOptions: {}, transition: {}, showTimeout: {}, hideTimeout: {}, virtualRef: {}, virtualTriggering: { type: Boolean } }, emits: ["visible-change", "command", "click"], setup(e2, { expose: o2, emit: i2 }) {
|
|
14
|
-
const n2 = e2, u2 = i2;
|
|
15
|
-
f();
|
|
16
|
-
const c2 = v(), B2 = v(), I2 = t((() => j(n2, ["items", "hideOnClick", "size", "type", "splitButton"])));
|
|
17
|
-
function O2() {
|
|
18
|
-
var _a;
|
|
19
|
-
(_a = c2.value) == null ? void 0 : _a.toggle();
|
|
20
|
-
}
|
|
21
|
-
return g(B2, (() => {
|
|
22
|
-
var _a;
|
|
23
|
-
n2.splitButton && ((_a = c2.value) == null ? void 0 : _a.hide());
|
|
24
|
-
})), C(), y(D, { handleItemClick: function(e3) {
|
|
25
|
-
var _a;
|
|
26
|
-
n2.hideOnClick && ((_a = c2.value) == null ? void 0 : _a.hide()), !T(e3.command) && u2("command", e3.command);
|
|
27
|
-
}, size: t((() => n2.size)) }), o2({ open: () => {
|
|
28
|
-
var _a;
|
|
29
|
-
return (_a = c2.value) == null ? void 0 : _a.show();
|
|
30
|
-
}, close: () => {
|
|
31
|
-
var _a;
|
|
32
|
-
return (_a = c2.value) == null ? void 0 : _a.hide();
|
|
33
|
-
} }), (e3, o3) => (a(), l("div", { ref_key: "dropdownRef", ref: B2, class: p(["px-dropdown", { "is-disabled": n2.disabled }]) }, [h($, b({ ref_key: "tooltipRef", ref: c2 }, I2.value, { manual: e3.splitButton, onVisibleChange: o3[1] || (o3[1] = (o4) => e3.$emit("visible-change", o4)) }), { content: k((() => [s("div", R, [m(e3.$slots, "dropdown", {}, (() => [(a(true), l(d, null, _(e3.items, ((e4) => (a(), w(P, b({ key: e4.command, ref_for: true }, e4), null, 16)))), 128))]))])])), default: k((() => [e3.splitButton ? (a(), w(r(x), { key: 0, type: e3.type, size: e3.size, disabled: e3.disabled }, { default: k((() => [h(r(z), { onClick: o3[0] || (o3[0] = (o4) => e3.$emit("click", o4)) }, { default: k((() => [m(e3.$slots, "default")])), _: 3 }), h(r(z), { icon: "chevron-down", onClick: O2 })])), _: 3 }, 8, ["type", "size", "disabled"])) : m(e3.$slots, "default", { key: 1 })])), _: 3 }, 16, ["manual"])], 2));
|
|
34
|
-
} })), S = e(P);
|
|
35
|
-
export {
|
|
36
|
-
A as P,
|
|
37
|
-
S as a
|
|
38
|
-
};
|
package/dist/es/Icon-4XdUD4qc.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { r as v, g as h, s as o, _ as l, w as s, a as n } from "./utils-340oIQ8K.js";
|
|
2
|
-
import { defineComponent as t, computed as e, createElementBlock as r, openBlock as w, mergeProps as i } from "vue";
|
|
3
|
-
const m = { xs: 12, sm: 18, md: 24, lg: 36, xl: 48, "2xl": 72, "1x": 24, "2x": 48, "3x": 72 }, z = ["innerHTML"], H = { key: 1, class: "px-icon__fallback" }, V = l(t({ name: "PxIcon", inheritAttrs: false, __name: "Icon", props: { icon: {}, size: { default: "md" }, rotation: {}, flip: {}, spin: { type: Boolean }, pulse: { type: Boolean }, bounce: { type: Boolean }, shake: { type: Boolean }, beat: { type: Boolean }, fade: { type: Boolean }, type: {}, color: {} }, setup(l2) {
|
|
4
|
-
const s2 = l2, n2 = e((() => v(s2.icon))), t2 = e((() => {
|
|
5
|
-
const v2 = h(n2.value);
|
|
6
|
-
return v2 ? o(v2) : void 0;
|
|
7
|
-
})), V2 = e((() => {
|
|
8
|
-
const v2 = ["px-icon"];
|
|
9
|
-
return s2.type && v2.push(`px-icon--${s2.type}`), s2.size && v2.push(`px-icon--${s2.size}`), s2.spin && v2.push("px-icon--spin"), s2.pulse && v2.push("px-icon--pulse"), s2.bounce && v2.push("px-icon--bounce"), s2.shake && v2.push("px-icon--shake"), s2.beat && v2.push("px-icon--beat"), s2.fade && v2.push("px-icon--fade"), "horizontal" === s2.flip && v2.push("px-icon--flip-h"), "vertical" === s2.flip && v2.push("px-icon--flip-v"), "both" === s2.flip && v2.push("px-icon--flip-h", "px-icon--flip-v"), s2.rotation && v2.push(`px-icon--rotate-${s2.rotation}`), v2;
|
|
10
|
-
})), g2 = e((() => {
|
|
11
|
-
const v2 = {};
|
|
12
|
-
s2.color && (v2.color = s2.color);
|
|
13
|
-
const h2 = m[s2.size || "md"];
|
|
14
|
-
return v2.width = `${h2}px`, v2.height = `${h2}px`, v2;
|
|
15
|
-
}));
|
|
16
|
-
return (v2, h2) => (w(), r("i", i({ class: V2.value, style: g2.value }, v2.$attrs), [t2.value ? (w(), r("span", { key: 0, class: "px-icon__pixel", innerHTML: t2.value }, null, 8, z)) : (w(), r("span", H, "?"))], 16));
|
|
17
|
-
} }), [["__scopeId", "data-v-57d28fe2"]]), g = { check: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 6h2v2h-2V6zm-2 4V8h2v2h-2zm-2 2v-2h2v2h-2zm-2 2h2v-2h-2v2zm-2 2h2v-2h-2v2zm-2 0v2h2v-2H8zm-2-2h2v2H6v-2zm0 0H4v-2h2v2z" fill="currentColor"/></svg>', close: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z" fill="currentColor"/></svg>', "close-box": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 3H3v18h18V3H5zm14 2v14H5V5h14zm-8 4H9V7H7v2h2v2h2v2H9v2H7v2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2v-2h2V9h2V7h-2v2h-2v2h-2V9z" fill="currentColor"/></svg>', "info-box": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h2v18H3V3zm16 0H5v2h14v14H5v2h16V3h-2zm-8 6h2V7h-2v2zm2 8h-2v-6h2v6z" fill="currentColor"/></svg>', "warning-box": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h16v2H5v14h14v2H3V3zm18 0h-2v18h2V3zM11 15h2v2h-2v-2zm2-8h-2v6h2V7z" fill="currentColor"/></svg>', loader: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 2h-2v6h2V2zm0 14h-2v6h2v-6zm9-5v2h-6v-2h6zM8 13v-2H2v2h6zm7-6h2v2h-2V7zm4-2h-2v2h2V5zM9 7H7v2h2V7zM5 5h2v2H5V5zm10 12h2v2h2v-2h-2v-2h-2v2zm-8 0v-2h2v2H7v2H5v-2h2z" fill="currentColor"/></svg>', eye: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 6h8v2H8V6zm-4 4V8h4v2H4zm-2 2v-2h2v2H2zm0 2v-2H0v2h2zm2 2H2v-2h2v2zm4 2H4v-2h4v2zm8 0v2H8v-2h8zm4-2v2h-4v-2h4zm2-2v2h-2v-2h2zm0-2h2v2h-2v-2zm-2-2h2v2h-2v-2zm0 0V8h-4v2h4zm-10 1h4v4h-4v-4z" fill="currentColor"/></svg>', "eye-closed": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 7h2v2H0V7zm4 4H2V9h2v2zm4 2v-2H4v2H2v2h2v-2h4zm8 0H8v2H6v2h2v-2h8v2h2v-2h-2v-2zm4-2h-4v2h4v2h2v-2h-2v-2zm2-2v2h-2V9h2zm0 0V7h2v2h-2z" fill="currentColor"/></svg>', "chevron-down": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z" fill="currentColor"/></svg>', "chevron-up": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 16H5v-2h2v-2h2v-2h2V8h2v2h2v2h2v2h2v2h-2v-2h-2v-2h-2v-2h-2v2H9v2H7v2z" fill="currentColor"/></svg>', "chevron-right": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z" fill="currentColor"/></svg>', "chevron-left": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 5v2h-2V5h2zm-4 4V7h2v2h-2zm-2 2V9h2v2h-2zm0 2H8v-2h2v2zm2 2v-2h-2v2h2zm0 0h2v2h-2v-2zm4 4v-2h-2v2h2z" fill="currentColor"/></svg>', home: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2h-4v2H8v2H6v2H4v2H2v2h2v10h7v-6h2v6h7V12h2v-2h-2V8h-2V6h-2V4h-2V2zm0 2v2h2v2h2v2h2v2h-2v8h-3v-6H9v6H6v-8H4v-2h2V8h2V6h2V4h4z" fill="currentColor"/></svg>', user: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z" fill="currentColor"/></svg>', search: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z" fill="currentColor"/></svg>', "moon-star": '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M6 2h8v2h-2v2h-2V4H6V2ZM4 6V4h2v2H4Zm0 10H2V6h2v10Zm2 2H4v-2h2v2Zm2 2H6v-2h2v2Zm10 0v2H8v-2h10Zm2-2v2h-2v-2h2Zm-2-4v-2h2v-2h2v8h-2v-4h-2Zm-6 0h6v2h-6v-2Zm-2-2h2v2h-2v-2Zm0 0V6H8v6h2Zm8-10h2v2h2v2h-2v2h-2V6h-2V4h2V2Z"/></svg>', heart: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 2H5v2H3v2H1v6h2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v-2h2V6h-2V4h-2V2h-4v2h-2v2h-2V4H9V2zm0 2v2h2v2h2V6h2V4h4v2h2v6h-2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2H3V6h2V4h4z" fill="currentColor"/></svg>', circle: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 3H7v2H5v2H3v10h2v2h2v2h10v-2h2v-2h2V7h-2V5h-2V3zm0 2v2h2v10h-2v2H7v-2H5V7h2V5h10z" fill="currentColor"/></svg>', sliders: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 4h2v10h-2V4zm0 12h-2v2h2v2h2v-2h2v-2h-4zm-4-6h-2v10h2V10zm-8 2H3v2h2v6h2v-6h2v-2H5zm8-8h-2v2H9v2h6V6h-2V4zM5 4h2v6H5V4z" fill="currentColor"/></svg>', notification: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 4V2h-4v2H5v2h14V4h-5zm5 12H5v-4H3v6h5v4h2v-4h4v2h-4v2h6v-4h5v-6h-2V6h-2v8h2v2zM5 6v8h2V6H5z" fill="currentColor"/></svg>', alert: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 1h-2v2H9v2H7v2H5v2H3v2H1v2h2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v-2h2v-2h-2V9h-2V7h-2V5h-2V3h-2V1zm0 2v2h2v2h2v2h2v2h2v2h-2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2H3v-2h2V9h2V7h2V5h2V3h2zm0 4h-2v6h2V7zm0 8h-2v2h2v-2z" fill="currentColor"/></svg>', bookmark: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 2H6v2h12v16h-2v-2h-2v-2h-4v2H8v2H6V2H4v20h4v-2h2v-2h4v2h2v2h4V2h-2z" fill="currentColor"/></svg>', zap: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1h2v8h8v4h-2v-2h-8V5h-2V3h2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z" fill="currentColor"/></svg>', gift: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 12v8h-7m7-8h2V8h-3m1 4H5m13-4V4h-6m6 4H6m0 0V4h6M6 8H3v4h2m0 0v8h7m0 0V4" stroke="currentColor" stroke-width="2"/></svg>', music: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 4h12v16h-8v-8h6V8h-8v12H2v-8h6V4zm0 10H4v4h4v-4zm10 0h-4v4h4v-4z" fill="currentColor"/></svg>', coffee: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h18v7h-4v5H4V4zm14 5h2V6h-2v3zm-2-3H6v8h10V6zm3 14H3v-2h16v2z" fill="currentColor"/></svg>', edit: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 2h-2v2h-2v2h-2v2h-2v2H8v2H6v2H4v2H2v6h6v-2h2v-2h2v-2h2v-2h2v-2h2v-2h2V8h2V6h-2V4h-2V2zm0 8h-2v2h-2v2h-2v2h-2v2H8v-2H6v-2h2v-2h2v-2h2V8h2V6h2v2h2v2zM6 16H4v4h4v-2H6v-2z" fill="currentColor"/></svg>', trash: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 2v4h6v2h-2v14H4V8H2V6h6V2h8zm-2 2h-4v2h4V4zm0 4H6v12h12V8h-4zm-5 2h2v8H9v-8zm6 0h-2v8h2v-8z" fill="currentColor"/></svg>', upload: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 5V3h2v2h2v2h2v2h-2V7h-2v10h-2V7H9v2H7V7h2V5h2zM3 15v6h18v-6h-2v4H5v-4H3z" fill="currentColor"/></svg>', message: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2h-2z" fill="currentColor"/></svg>', "external-link": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 11V3h-8v2h4v2h-2v2h-2v2h-2v2H9v2h2v-2h2v-2h2V9h2V7h2v4h2zM11 5H3v16h16v-8h-2v6H5V7h6V5z" fill="currentColor"/></svg>', link: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 6h7v2H4v8h7v2H2V6h2zm16 0h-7v2h7v8h-7v2h9V6h-2zm-3 5H7v2h10v-2z" fill="currentColor"/></svg>', "arrow-left": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z" fill="currentColor"/></svg>', "arrow-right": '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z" fill="currentColor"/></svg>' }, p = s(V);
|
|
18
|
-
function a() {
|
|
19
|
-
n(g);
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
V as P,
|
|
23
|
-
p as a,
|
|
24
|
-
g as d,
|
|
25
|
-
m as i,
|
|
26
|
-
a as r
|
|
27
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
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
|
-
};
|
|
File without changes
|