sakana-element 2.1.2 → 2.1.4

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 (66) hide show
  1. package/README.md +81 -79
  2. package/dist/es/Alert-C76ZWSVk.js +19 -0
  3. package/dist/es/Badge-BG-vYP8Y.js +13 -0
  4. package/dist/es/Button-fW_ZOLmT.js +24 -0
  5. package/dist/es/Card-BCBnlVi_.js +12 -0
  6. package/dist/es/{Collapse-l_8qKOBG.js → Collapse-B08VhCVq.js} +2 -2
  7. package/dist/es/{ConfigProvider-BPm3h9RG.js → ConfigProvider-DZO1d5Eq.js} +1 -1
  8. package/dist/es/{Dropdown-ZjZ0qSn2.js → Dropdown-49nf6F8P.js} +11 -11
  9. package/dist/es/{Form-pxRZxseS.js → Form-CGiTDSGI.js} +2 -2
  10. package/dist/es/{Icon-UBaqO2nY.js → Icon-DpJyuj7c.js} +1 -1
  11. package/dist/es/Input-DBPpvf0Y.js +42 -0
  12. package/dist/es/{Loading-BJJBJhg3.js → Loading-DlygqGOv.js} +2 -2
  13. package/dist/es/{Message-CqBKW0c8.js → Message-ganFfLeU.js} +14 -14
  14. package/dist/es/{Notification-CVACM2cj.js → Notification-D4RYHV9o.js} +8 -8
  15. package/dist/es/{Overlay-C1k4Jcl7.js → Overlay-BRDSWspM.js} +1 -1
  16. package/dist/es/{Popconfirm-CW8oRycq.js → Popconfirm-Cop44KwQ.js} +4 -4
  17. package/dist/es/Select-TIoGsqKv.js +133 -0
  18. package/dist/es/Switch-CHjcLtHs.js +34 -0
  19. package/dist/es/{Tooltip-D9rQ4LEg.js → Tooltip-HWx_i2FA.js} +23 -23
  20. package/dist/es/{hooks-DNMt3QPi.js → hooks-CYdEHUVd.js} +6 -5
  21. package/dist/es/index.js +59 -55
  22. package/dist/es/utils-bsCscZfS.js +84 -0
  23. package/dist/index.css +1 -1
  24. package/dist/theme/Alert.css +114 -38
  25. package/dist/theme/Badge.css +208 -0
  26. package/dist/theme/Button.css +365 -105
  27. package/dist/theme/Card.css +112 -0
  28. package/dist/theme/Collapse.css +2 -2
  29. package/dist/theme/Dropdown.css +4 -4
  30. package/dist/theme/Input.css +213 -4
  31. package/dist/theme/Select.css +182 -38
  32. package/dist/theme/Switch.css +56 -0
  33. package/dist/theme/Tooltip.css +10 -10
  34. package/dist/theme/fonts/zpix.woff2 +0 -0
  35. package/dist/theme/index.css +21 -3
  36. package/dist/types/components/Alert/types.d.ts +3 -0
  37. package/dist/types/components/Badge/index.d.ts +27 -0
  38. package/dist/types/components/Badge/types.d.ts +10 -0
  39. package/dist/types/components/Button/constants.d.ts +2 -0
  40. package/dist/types/components/Button/types.d.ts +3 -0
  41. package/dist/types/components/Card/index.d.ts +26 -0
  42. package/dist/types/components/Card/types.d.ts +6 -0
  43. package/dist/types/components/Input/constants.d.ts +3 -0
  44. package/dist/types/components/Input/types.d.ts +2 -0
  45. package/dist/types/components/Select/constants.d.ts +3 -0
  46. package/dist/types/components/Select/index.d.ts +7 -5
  47. package/dist/types/components/Select/types.d.ts +4 -1
  48. package/dist/types/components/Select/useKeyMap.d.ts +1 -1
  49. package/dist/types/components/Switch/types.d.ts +6 -0
  50. package/dist/types/components/Tooltip/useEventsToTriggerNode.d.ts +4 -0
  51. package/dist/types/components/index.d.ts +2 -0
  52. package/dist/types/hooks/useSystemTheme.d.ts +1 -1
  53. package/dist/types/utils/color.d.ts +33 -0
  54. package/dist/types/utils/index.d.ts +1 -0
  55. package/dist/umd/index.css +1 -1
  56. package/dist/umd/index.css.gz +0 -0
  57. package/dist/umd/index.umd.cjs +3 -3
  58. package/dist/umd/index.umd.cjs.gz +0 -0
  59. package/package.json +1 -1
  60. package/dist/es/Alert-C5X-XFGJ.js +0 -15
  61. package/dist/es/Button-DTik2ZP6.js +0 -33
  62. package/dist/es/Input-BJoBaFXa.js +0 -38
  63. package/dist/es/Select-C7mwByXa.js +0 -126
  64. package/dist/es/Switch-CgFPFC3j.js +0 -22
  65. package/dist/es/utils-340oIQ8K.js +0 -59
  66. package/dist/types/components/Tooltip/useEventsToTiggerNode.d.ts +0 -4
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sakana-element",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "A pixel-style Vue 3 component library, built with TypeScript and Vitest",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",
@@ -1,15 +0,0 @@
1
- import { t as e, _ as t, w as l } from "./utils-340oIQ8K.js";
2
- import { defineComponent as o, useSlots as s, ref as a, computed as c, createBlock as n, openBlock as i, Transition as p, withCtx as r, withDirectives as f, createElementVNode as _, normalizeClass as u, createCommentVNode as d, createElementBlock as x, normalizeStyle as m, renderSlot as v, createTextVNode as y, toDisplayString as w, createVNode as h, withModifiers as I, vShow as $ } from "vue";
3
- import { P as b } from "./Icon-UBaqO2nY.js";
4
- const g = { class: "px-alert__content" }, k = { class: "px-alert__description" }, B = { key: 0, class: "px-alert__close" }, P = l(t(o({ name: "PxAlert", __name: "Alert", props: { title: {}, type: { default: "info" }, description: {}, effect: { default: "light" }, closable: { type: Boolean, default: true }, center: { type: Boolean }, showIcon: { type: Boolean } }, emits: ["close"], setup(t2, { expose: l2, emit: o2 }) {
5
- const P2 = t2, j = o2, A = s(), C = a(true), q = c((() => e.get(P2.type) ?? "circle-info")), z = c((() => P2.description || A.default));
6
- function D() {
7
- C.value = false, j("close");
8
- }
9
- return l2({ open: function() {
10
- C.value = true;
11
- }, close: D }), (e2, t3) => (i(), n(p, { name: "px-alert-fade" }, { default: r((() => [f(_("div", { class: u(["px-alert", { [`px-alert__${e2.type}`]: e2.type, [`px-alert__${e2.effect}`]: e2.effect, "text-center": e2.center }]), role: "alert" }, [e2.showIcon ? (i(), n(b, { key: 0, class: u(["px-alert__icon", { "big-icon": z.value }]), icon: q.value }, null, 8, ["class", "icon"])) : d("", true), _("div", g, [_("span", { class: u(["px-alert__title", { "with-desc": z.value }]), style: m({ display: e2.center && !e2.showIcon ? "flow" : "inline" }) }, [v(e2.$slots, "title", {}, (() => [y(w(e2.title), 1)]), true)], 6), _("p", k, [v(e2.$slots, "default", {}, (() => [y(w(e2.description), 1)]), true)]), e2.closable ? (i(), x("div", B, [h(b, { onClick: I(D, ["stop"]), icon: "close" })])) : d("", true)])], 2), [[$, C.value]])])), _: 3 }));
12
- } }), [["__scopeId", "data-v-9f432773"]]));
13
- export {
14
- P
15
- };
@@ -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 r, inject as n, ref as l, computed as u, createBlock as b, openBlock as s, resolveDynamicComponent as i, unref as p, normalizeStyle as c, normalizeClass as d, withCtx as x, renderSlot as v, createCommentVNode as g, createVNode as h, provide as y, reactive as f, toRef as m, createElementBlock as B } from "vue";
3
- import { P as _ } from "./Icon-UBaqO2nY.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 }, dash: { type: Boolean }, ghost: { type: Boolean }, color: {}, loadingIcon: {}, ariaLabel: {}, 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"]), f2 = o2;
7
- "string" != typeof f2.tag || y2.has(f2.tag) || t("PxButton", `Invalid tag "${f2.tag}". Allowed tags: ${[...y2].join(", ")}. Falling back to "button".`);
8
- const m2 = a2, B2 = r(), I2 = n(z, void 0), $2 = l(), k2 = u((() => "string" != typeof f2.tag || y2.has(f2.tag) ? f2.tag : "button")), T2 = u((() => (I2 == null ? void 0 : I2.size) ?? (f2 == null ? void 0 : f2.size) ?? "")), w2 = u((() => (I2 == null ? void 0 : I2.type) ?? (f2 == null ? void 0 : f2.type) ?? "")), P = u((() => (I2 == null ? void 0 : I2.disabled) || (f2 == null ? void 0 : f2.disabled) || false)), S = u((() => ({ marginRight: B2.default ? "6px" : "0px" })));
9
- function j(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 = u((() => {
14
- if (!f2.color) return {};
15
- const t2 = f2.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 = j(t2, 20), r2 = j(t2, 35);
22
- return f2.ghost ? { "--px-button-text-color": t2, "--px-button-bg-color": "transparent", "--px-button-border-color": "transparent", "--px-button-shadow-color": "transparent", "--px-button-hover-text-color": e3, "--px-button-hover-bg-color": r2, "--px-button-hover-border-color": "transparent", "--px-button-active-text-color": e3, "--px-button-active-bg-color": a3, "--px-button-active-border-color": "transparent", "--px-button-disabled-text-color": a3, "--px-button-disabled-bg-color": "transparent", "--px-button-disabled-border-color": "transparent" } : f2.dash ? { "--px-button-text-color": t2, "--px-button-bg-color": r2, "--px-button-border-color": t2, "--px-button-shadow-color": "transparent", "--px-button-hover-text-color": e3, "--px-button-hover-bg-color": a3, "--px-button-hover-border-color": e3, "--px-button-active-text-color": e3, "--px-button-active-bg-color": t2, "--px-button-active-border-color": e3, "--px-button-disabled-text-color": a3, "--px-button-disabled-bg-color": r2, "--px-button-disabled-border-color": a3 } : f2.plain ? { "--px-button-text-color": t2, "--px-button-bg-color": r2, "--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": r2, "--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, f2.throttleDuration, { trailing: false });
24
- return e2({ ref: $2, disabled: P, size: T2, type: w2 }), (t2, o3) => (s(), b(i(k2.value), { ref_key: "_ref", ref: $2, autofocus: t2.autofocus, type: "button" === k2.value ? t2.nativeType : void 0, class: d(["px-button", { [`px-button--${w2.value}`]: w2.value, [`px-button--${T2.value}`]: T2.value, "is-plain": t2.plain, "is-round": t2.round, "is-circle": t2.circle, "is-dash": t2.dash, "is-ghost": t2.ghost, "is-disabled": P.value, "is-loading": t2.loading }]), "aria-label": t2.ariaLabel, disabled: !(!P.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 }, (() => [h(_, { class: "loading-icon", icon: t2.loadingIcon ?? "loader", style: c(S.value), size: "1x", spin: "" }, null, 8, ["icon", "style"])]), true) : g("", true), t2.icon && !t2.loading ? (s(), b(_, { key: 1, icon: t2.icon, style: c(S.value), size: "1x" }, null, 8, ["icon", "style"])) : g("", true), v(t2.$slots, "default", {}, void 0, true)])), _: 3 }, 8, ["autofocus", "type", "aria-label", "disabled", "class", "style"]));
25
- } }), [["__scopeId", "data-v-7044e22a"]]), $ = { 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, f({ size: m(o2, "size"), type: m(o2, "type"), disabled: m(o2, "disabled") })), (t3, o3) => (s(), B("div", $, [v(t3.$slots, "default", {}, void 0, true)]));
28
- } }), [["__scopeId", "data-v-7bc34bb7"]]), T = e(I), w = e(k);
29
- export {
30
- w as P,
31
- T as a,
32
- I as b
33
- };
@@ -1,38 +0,0 @@
1
- import { d as e, w as a } from "./utils-340oIQ8K.js";
2
- import { defineComponent as l, ref as o, shallowRef as s, useAttrs as u, computed as p, watch as t, createElementBlock as r, openBlock as n, normalizeClass as d, unref as i, withDirectives as c, Fragment as f, createCommentVNode as v, createElementVNode as m, renderSlot as y, mergeProps as x, vModelDynamic as _, createBlock as h, withModifiers as w, vModelText as k, nextTick as b } from "vue";
3
- import { c as $, u as B } from "./hooks-DNMt3QPi.js";
4
- import { u as V } from "./Form-pxRZxseS.js";
5
- import { P as g } from "./Icon-UBaqO2nY.js";
6
- import { q as I, f as P } from "./vendor-DXmGx29U.js";
7
- const j = { key: 0, class: "px-input__prepend" }, C = { key: 0, class: "px-input__prefix" }, F = ["id", "type", "disabled", "readonly", "autocomplete", "placeholder", "autofocus", "form"], R = { key: 1, class: "px-input__suffix" }, z = { key: 1, class: "px-input__append" }, M = ["id", "disabled", "readonly", "autocomplete", "placeholder", "autofocus", "form"], U = l({ name: "PxInput", inheritAttrs: false, __name: "Input", props: { id: {}, modelValue: {}, type: { default: "text" }, size: {}, disabled: { type: Boolean }, clearable: { type: Boolean }, showPassword: { type: Boolean }, placeholder: {}, readonly: { type: Boolean }, autocomplete: { default: "off" }, autofocus: { type: Boolean }, form: {} }, emits: ["update:modelValue", "input", "change", "focus", "blur", "clear"], setup(a2, { expose: l2, emit: U2 }) {
8
- const q2 = a2, A = U2, D = o(q2.modelValue), E = o(false), G = s(), H = s(), J = u(), { formItem: K } = V(), L = p((() => G.value || H.value)), N = p((() => q2.disabled)), O = p((() => q2.clearable && !!D.value && !N.value && T.value)), Q = p((() => "password" === q2.type && q2.showPassword && !N.value && !!D.value)), { wrapperRef: S, isFocused: T, handleFocus: W, handleBlur: X } = $(L, { afterBlur() {
9
- K == null ? void 0 : K.validate("blur").catch(((a3) => e()));
10
- } }), Y = () => {
11
- D.value = "", P(["input", "change", "update:modelValue"], ((e2) => A(e2, ""))), A("clear"), K == null ? void 0 : K.clearValidate();
12
- };
13
- function Z() {
14
- A("update:modelValue", D.value), A("input", D.value);
15
- }
16
- function ee() {
17
- A("change", D.value);
18
- }
19
- function ae() {
20
- E.value = !E.value;
21
- }
22
- return t((() => q2.modelValue), ((a3) => {
23
- D.value = a3, K == null ? void 0 : K.validate("change").catch(((a4) => e()));
24
- })), l2({ ref: L, focus: async () => {
25
- var _a;
26
- await b(), (_a = L.value) == null ? void 0 : _a.focus();
27
- }, blur: () => {
28
- var _a;
29
- (_a = L.value) == null ? void 0 : _a.blur();
30
- }, select: () => {
31
- var _a;
32
- (_a = L.value) == null ? void 0 : _a.select();
33
- }, clear: Y }), (e2, a3) => (n(), r("div", { class: d(["px-input", { [`px-input--${e2.type}`]: e2.type, [`px-input--${e2.size}`]: e2.size, "is-disabled": N.value, "is-prepend": e2.$slots.prepend, "is-append": e2.$slots.append, "is-prefix": e2.$slots.prefix, "is-suffix": e2.$slots.suffix, "is-focus": i(T) }]) }, ["textarea" !== e2.type ? (n(), r(f, { key: 0 }, [e2.$slots.prepend ? (n(), r("div", j, [y(e2.$slots, "prepend")])) : v("", true), m("div", { class: "px-input__wrapper", ref_key: "wrapperRef", ref: S }, [e2.$slots.prefix ? (n(), r("span", C, [y(e2.$slots, "prefix")])) : v("", true), c(m("input", x({ class: "px-input__inner", ref_key: "inputRef", ref: G, id: i(B)().value, type: e2.showPassword ? E.value ? "text" : "password" : e2.type, disabled: N.value, readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, form: e2.form, "onUpdate:modelValue": a3[0] || (a3[0] = (e3) => D.value = e3) }, i(J), { onInput: Z, onChange: ee, onFocus: a3[1] || (a3[1] = (...e3) => i(W) && i(W)(...e3)), onBlur: a3[2] || (a3[2] = (...e3) => i(X) && i(X)(...e3)) }), null, 16, F), [[_, D.value]]), e2.$slots.suffix || O.value || Q.value ? (n(), r("span", R, [y(e2.$slots, "suffix"), O.value ? (n(), h(g, { key: 0, icon: "close-box", class: "px-input__clear", onClick: Y, onMousedown: w(i(I), ["prevent"]) }, null, 8, ["onMousedown"])) : v("", true), Q.value && E.value ? (n(), h(g, { key: 1, icon: "eye", class: "px-input__password", onClick: ae })) : v("", true), Q.value && !E.value ? (n(), h(g, { key: 2, icon: "eye-closed", class: "px-input__password", onClick: ae })) : v("", true)])) : v("", true)], 512), e2.$slots.append ? (n(), r("div", z, [y(e2.$slots, "append")])) : v("", true)], 64)) : c((n(), r("textarea", x({ key: 1, class: "px-textarea__wrapper", ref_key: "textareaRef", ref: H, id: i(B)().value, disabled: N.value, readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, form: e2.form, "onUpdate:modelValue": a3[3] || (a3[3] = (e3) => D.value = e3) }, i(J), { onInput: Z, onChange: ee, onFocus: a3[4] || (a3[4] = (...e3) => i(W) && i(W)(...e3)), onBlur: a3[5] || (a3[5] = (...e3) => i(X) && i(X)(...e3)) }), null, 16, M)), [[k, D.value]])], 2));
34
- } }), q = a(U);
35
- export {
36
- q as P,
37
- U as _
38
- };
@@ -1,126 +0,0 @@
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-DNMt3QPi.js";
5
- import { P as U } from "./Icon-UBaqO2nY.js";
6
- import { _ as G } from "./Input-BJoBaFXa.js";
7
- import { T as K } from "./Tooltip-D9rQ4LEg.js";
8
- 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
- };
@@ -1,22 +0,0 @@
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-DNMt3QPi.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
- };
@@ -1,59 +0,0 @@
1
- import { h as e, d as o, y as r } from "./vendor-DXmGx29U.js";
2
- import { defineComponent as n } from "vue";
3
- function c(e2, o2) {
4
- }
5
- const t = { spinner: "loader", loading: "loader", "eye-slash": "eye-closed", "eye-off": "eye-closed", xmark: "close", x: "close", times: "close", "circle-xmark": "close-box", "x-circle": "close-box", "times-circle": "close-box", error: "close-box", "circle-info": "info-box", "info-circle": "info-box", info: "info-box", "check-circle": "check", "circle-check": "check", success: "check", "circle-exclamation": "warning-box", "exclamation-circle": "warning-box", warning: "warning-box", "angle-down": "chevron-down", "caret-down": "chevron-down", "angle-up": "chevron-up", "caret-up": "chevron-up", "angle-left": "chevron-left", "caret-left": "chevron-left", "angle-right": "chevron-right", "caret-right": "chevron-right", "question-circle": "info-box", "circle-question": "info-box", help: "info-box", question: "info-box", gear: "sliders", cog: "sliders", settings: "sliders", star: "bookmark", "star-solid": "bookmark" };
6
- function s(e2) {
7
- return e2 in t ? t[e2] : e2;
8
- }
9
- const i = /* @__PURE__ */ new Set(["svg", "path", "rect", "circle", "ellipse", "line", "polyline", "polygon", "g", "defs", "clipPath", "mask", "title", "desc", "linearGradient", "radialGradient", "stop", "symbol", "use"]), a = /^on/i, l = /^\s*javascript\s*:/i;
10
- function f(e2) {
11
- if (!e2 || "string" != typeof e2) return "";
12
- if ("undefined" == typeof DOMParser) return "";
13
- const o2 = new DOMParser().parseFromString(e2, "image/svg+xml");
14
- return o2.querySelector("parsererror") ? "" : (u(o2.documentElement), o2.documentElement.outerHTML);
15
- }
16
- function u(e2) {
17
- const o2 = Array.from(e2.children);
18
- for (const e3 of o2) {
19
- const o3 = e3.tagName.toLowerCase();
20
- if (i.has(o3)) {
21
- for (const o4 of Array.from(e3.attributes)) (a.test(o4.name) || "href" === o4.name && l.test(o4.value) || "xlink:href" === o4.name && l.test(o4.value)) && e3.removeAttribute(o4.name);
22
- u(e3);
23
- } else e3.remove();
24
- }
25
- }
26
- const m = /* @__PURE__ */ new Map();
27
- function d(e2) {
28
- for (const [o2, r2] of Object.entries(e2)) m.set(o2, f(r2));
29
- }
30
- function g(e2) {
31
- return m.get(e2);
32
- }
33
- const p = (e2) => (e2.install = (o2) => {
34
- const r2 = e2.name;
35
- o2.component(r2, e2);
36
- }, e2), b = (e2, o2) => (e2.install = (r2) => {
37
- r2.config.globalProperties[o2] = e2;
38
- }, e2);
39
- function x(r2, n2 = "px") {
40
- return r2 ? e(r2) || ((e2) => !!o(e2) && !Number.isNaN(Number(e2)))(r2) ? `${r2}${n2}` : o(r2) ? r2 : void 0 : "";
41
- }
42
- const h = /* @__PURE__ */ new Map([["info", "info-box"], ["success", "check"], ["warning", "warning-box"], ["danger", "close-box"], ["error", "close-box"]]), v = n({ props: { vNode: { type: [String, Object, Function], required: true } }, setup: (e2) => () => r(e2.vNode) ? e2.vNode() : e2.vNode }), w = (e2, o2) => {
43
- const r2 = e2.__vccOpts || e2;
44
- for (const [e3, n2] of o2) r2[e3] = n2;
45
- return r2;
46
- };
47
- export {
48
- v as R,
49
- w as _,
50
- d as a,
51
- x as b,
52
- b as c,
53
- c as d,
54
- g,
55
- s as r,
56
- f as s,
57
- h as t,
58
- p as w
59
- };
@@ -1,4 +0,0 @@
1
- import { ComputedRef, Ref } from 'vue';
2
- import { TooltipProps } from './types';
3
- export declare function useEvenstToTiggerNode(props: TooltipProps, triggerNode: ComputedRef<HTMLElement | undefined>, events: Ref<Record<string, EventListener>>, closeMethod: () => void): void;
4
- export default useEvenstToTiggerNode;