sakana-element 2.1.3 → 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.
- package/README.md +81 -80
- package/dist/es/{Alert-A4stKumX.js → Alert-C76ZWSVk.js} +5 -5
- package/dist/es/Button-fW_ZOLmT.js +24 -0
- package/dist/es/Card-BCBnlVi_.js +12 -0
- package/dist/es/{Dropdown-CA-nv-2j.js → Dropdown-49nf6F8P.js} +10 -10
- package/dist/es/{Form-VB1SL_iW.js → Form-CGiTDSGI.js} +1 -1
- package/dist/es/Input-DBPpvf0Y.js +42 -0
- package/dist/es/{Loading-4MsOvzx9.js → Loading-DlygqGOv.js} +3 -3
- package/dist/es/{Message-CxT9rRUp.js → Message-ganFfLeU.js} +11 -11
- package/dist/es/{Notification-D6em5HmO.js → Notification-D4RYHV9o.js} +3 -3
- package/dist/es/{Popconfirm-D0ABSr-F.js → Popconfirm-Cop44KwQ.js} +2 -2
- package/dist/es/Select-TIoGsqKv.js +133 -0
- package/dist/es/Switch-CHjcLtHs.js +34 -0
- package/dist/es/{Tooltip-KpwbZdMX.js → Tooltip-HWx_i2FA.js} +8 -8
- package/dist/es/{hooks-DNMt3QPi.js → hooks-CYdEHUVd.js} +6 -5
- package/dist/es/index.js +53 -51
- package/dist/index.css +1 -1
- package/dist/theme/Alert.css +51 -51
- package/dist/theme/Button.css +365 -105
- package/dist/theme/Card.css +112 -0
- package/dist/theme/Collapse.css +2 -2
- package/dist/theme/Dropdown.css +4 -4
- package/dist/theme/Input.css +213 -4
- package/dist/theme/Select.css +182 -38
- package/dist/theme/Switch.css +56 -0
- package/dist/theme/Tooltip.css +10 -10
- package/dist/theme/fonts/zpix.woff2 +0 -0
- package/dist/theme/index.css +21 -3
- package/dist/types/components/Button/types.d.ts +3 -0
- package/dist/types/components/Card/index.d.ts +26 -0
- package/dist/types/components/Card/types.d.ts +6 -0
- package/dist/types/components/Input/constants.d.ts +3 -0
- package/dist/types/components/Input/types.d.ts +2 -0
- package/dist/types/components/Select/constants.d.ts +3 -0
- package/dist/types/components/Select/index.d.ts +7 -5
- package/dist/types/components/Select/types.d.ts +4 -1
- package/dist/types/components/Select/useKeyMap.d.ts +1 -1
- package/dist/types/components/Switch/types.d.ts +6 -0
- package/dist/types/components/Tooltip/useEventsToTriggerNode.d.ts +4 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/hooks/useSystemTheme.d.ts +1 -1
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +3 -3
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/Button-CFGE4_Ng.js +0 -22
- package/dist/es/Input-C-bIqqo_.js +0 -38
- package/dist/es/Select-BKYDP224.js +0 -126
- package/dist/es/Switch-C1IdbnUa.js +0 -22
- package/dist/types/components/Tooltip/useEventsToTiggerNode.d.ts +0 -4
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { d as o, l as t, c as e, r, _ as l, w as a } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as i, useSlots as s, inject as c, ref as d, computed as n, createBlock as b, openBlock as u, resolveDynamicComponent as g, unref as p, normalizeStyle as h, normalizeClass as v, withCtx as y, renderSlot as x, createCommentVNode as f, createVNode as k, provide as m, reactive as B, toRef as _, createElementBlock as z } from "vue";
|
|
3
|
-
import { P as T } from "./Icon-DpJyuj7c.js";
|
|
4
|
-
import { t as $ } from "./vendor-DXmGx29U.js";
|
|
5
|
-
const w = Symbol("BUTTON_GROUP_CTX_KEY"), I = { ghost: { "text-color": "color", "bg-color": "transparent", "border-color": "transparent", "shadow-color": "transparent", "hover-text-color": "dark", "hover-bg-color": "lighter", "hover-border-color": "transparent", "active-text-color": "dark", "active-bg-color": "light", "active-border-color": "transparent", "disabled-text-color": "light", "disabled-bg-color": "transparent", "disabled-border-color": "transparent" }, dash: { "text-color": "color", "bg-color": "lighter", "border-color": "color", "shadow-color": "transparent", "hover-text-color": "dark", "hover-bg-color": "light", "hover-border-color": "dark", "active-text-color": "dark", "active-bg-color": "color", "active-border-color": "dark", "disabled-text-color": "light", "disabled-bg-color": "lighter", "disabled-border-color": "light" }, plain: { "text-color": "color", "bg-color": "lighter", "border-color": "color", "hover-text-color": "contrast", "hover-bg-color": "color", "hover-border-color": "color", "active-text-color": "contrast", "active-bg-color": "dark", "active-border-color": "dark", "disabled-text-color": "light", "disabled-bg-color": "lighter", "disabled-border-color": "light" }, default: { "text-color": "contrast", "bg-color": "color", "border-color": "dark", "shadow-color": "dark", "hover-text-color": "contrast", "hover-bg-color": "light", "hover-border-color": "color", "active-text-color": "contrast", "active-bg-color": "dark", "active-border-color": "dark", "disabled-text-color": "contrast", "disabled-bg-color": "light", "disabled-border-color": "light" } }, P = l(i({ 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(l2, { expose: a2, emit: i2 }) {
|
|
6
|
-
const m2 = /* @__PURE__ */ new Set(["button", "a", "div", "span", "router-link"]), B2 = l2;
|
|
7
|
-
"string" != typeof B2.tag || m2.has(B2.tag) || o("PxButton", `Invalid tag "${B2.tag}". Allowed tags: ${[...m2].join(", ")}. Falling back to "button".`);
|
|
8
|
-
const _2 = i2, z2 = s(), P2 = c(w, void 0), j2 = d(), G2 = n((() => "string" != typeof B2.tag || m2.has(B2.tag) ? B2.tag : "button")), C2 = n((() => (P2 == null ? void 0 : P2.size) ?? (B2 == null ? void 0 : B2.size) ?? "")), D2 = n((() => (P2 == null ? void 0 : P2.type) ?? (B2 == null ? void 0 : B2.type) ?? "")), L = n((() => (P2 == null ? void 0 : P2.disabled) || (B2 == null ? void 0 : B2.disabled) || false)), O = n((() => ({ marginRight: z2.default ? "6px" : "0px" }))), R = n((() => {
|
|
9
|
-
if (!B2.color) return {};
|
|
10
|
-
const o2 = { ...e(B2.color), light: t(B2.color, 20), lighter: t(B2.color, 35) }, l3 = B2.ghost ? "ghost" : B2.dash ? "dash" : B2.plain ? "plain" : "default";
|
|
11
|
-
return r(o2, "px-button", I[l3]);
|
|
12
|
-
})), S = (o2) => _2("click", o2), U = $(S, B2.throttleDuration, { trailing: false });
|
|
13
|
-
return a2({ ref: j2, disabled: L, size: C2, type: D2 }), (o2, t2) => (u(), b(g(G2.value), { ref_key: "_ref", ref: j2, autofocus: o2.autofocus, type: "button" === G2.value ? o2.nativeType : void 0, class: v(["px-button", { [`px-button--${D2.value}`]: D2.value, [`px-button--${C2.value}`]: C2.value, "is-plain": o2.plain, "is-round": o2.round, "is-circle": o2.circle, "is-dash": o2.dash, "is-ghost": o2.ghost, "is-disabled": L.value, "is-loading": o2.loading }]), "aria-label": o2.ariaLabel, disabled: !(!L.value && !o2.loading) || void 0, style: h(R.value), onClick: t2[0] || (t2[0] = (t3) => o2.useThrottle ? p(U)(t3) : S(t3)) }, { default: y((() => [o2.loading ? x(o2.$slots, "loading", { key: 0 }, (() => [k(T, { class: "loading-icon", icon: o2.loadingIcon ?? "loader", style: h(O.value), size: "1x", spin: "" }, null, 8, ["icon", "style"])]), true) : f("", true), o2.icon && !o2.loading ? (u(), b(T, { key: 1, icon: o2.icon, style: h(O.value), size: "1x" }, null, 8, ["icon", "style"])) : f("", true), x(o2.$slots, "default", {}, void 0, true)])), _: 3 }, 8, ["autofocus", "type", "aria-label", "disabled", "class", "style"]));
|
|
14
|
-
} }), [["__scopeId", "data-v-6be339e2"]]), j = { class: "px-button-group" }, G = l(i({ name: "PxButtonGroup", __name: "ButtonGroup", props: { size: {}, type: {}, disabled: { type: Boolean } }, setup(o2) {
|
|
15
|
-
const t2 = o2;
|
|
16
|
-
return m(w, B({ size: _(t2, "size"), type: _(t2, "type"), disabled: _(t2, "disabled") })), (o3, t3) => (u(), z("div", j, [x(o3.$slots, "default", {}, void 0, true)]));
|
|
17
|
-
} }), [["__scopeId", "data-v-7bc34bb7"]]), C = a(P), D = a(G);
|
|
18
|
-
export {
|
|
19
|
-
D as P,
|
|
20
|
-
C as a,
|
|
21
|
-
P as b
|
|
22
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { d as e, w as a } from "./utils-bsCscZfS.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-VB1SL_iW.js";
|
|
5
|
-
import { P as g } from "./Icon-DpJyuj7c.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-bsCscZfS.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-DpJyuj7c.js";
|
|
6
|
-
import { _ as G } from "./Input-C-bIqqo_.js";
|
|
7
|
-
import { T as K } from "./Tooltip-KpwbZdMX.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-bsCscZfS.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,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;
|