sakana-element 2.1.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/es/Avatar-CxsRW-wl.js +9 -0
- package/dist/es/Badge-CoFWwBwv.js +14 -0
- package/dist/es/Breadcrumb-BtrwTVKW.js +15 -0
- package/dist/es/{Button-fW_ZOLmT.js → Button-S_31-UWJ.js} +3 -3
- package/dist/es/Card-DcW6nHYD.js +16 -0
- package/dist/es/Collapse-DsS7M-m3.js +53 -0
- package/dist/es/ConfigProvider-BgIewHXP.js +44 -0
- package/dist/es/{Dropdown-49nf6F8P.js → Dropdown-GcomGMAI.js} +10 -10
- package/dist/es/FileInput-BQ59woas.js +33 -0
- package/dist/es/Form-j90EzLXU.js +122 -0
- package/dist/es/{Input-DBPpvf0Y.js → Input-CiE4bPJN.js} +4 -4
- package/dist/es/Link-B9B2APZq.js +11 -0
- package/dist/es/Loading-BW99pE5N.js +92 -0
- package/dist/es/Message-DCNnTUje.js +123 -0
- package/dist/es/{Notification-D4RYHV9o.js → Notification-CBzY5904.js} +14 -14
- package/dist/es/Popconfirm-DF6d2ORS.js +23 -0
- package/dist/es/Select-Dwqv8isB.js +133 -0
- package/dist/es/Switch-B1Gnv1tB.js +34 -0
- package/dist/es/{Tooltip-HWx_i2FA.js → Tooltip-k6gKnMyt.js} +3 -3
- package/dist/es/hooks-BaG7l8K5.js +116 -0
- package/dist/es/index.js +73 -63
- package/dist/index.css +1 -1
- package/dist/theme/Alert.css +1 -1
- package/dist/theme/Avatar.css +116 -0
- package/dist/theme/Badge.css +36 -30
- package/dist/theme/Breadcrumb.css +150 -0
- package/dist/theme/Button.css +216 -216
- package/dist/theme/Card.css +170 -19
- package/dist/theme/Collapse.css +214 -54
- package/dist/theme/FileInput.css +365 -0
- package/dist/theme/Form.css +65 -34
- package/dist/theme/Link.css +50 -0
- package/dist/theme/Loading.css +154 -4
- package/dist/theme/Message.css +7 -4
- package/dist/theme/Notification.css +21 -21
- package/dist/theme/Popconfirm.css +5 -5
- package/dist/theme/Select.css +78 -78
- package/dist/theme/index.css +1 -5
- package/dist/types/components/Avatar/index.d.ts +30 -0
- package/dist/types/components/Avatar/types.d.ts +10 -0
- package/dist/types/components/Badge/types.d.ts +1 -0
- package/dist/types/components/Breadcrumb/constants.d.ts +3 -0
- package/dist/types/components/Breadcrumb/index.d.ts +45 -0
- package/dist/types/components/Breadcrumb/types.d.ts +13 -0
- package/dist/types/components/Card/types.d.ts +6 -0
- package/dist/types/components/Collapse/constants.d.ts +3 -0
- package/dist/types/components/Collapse/index.d.ts +9 -3
- package/dist/types/components/Collapse/types.d.ts +12 -0
- package/dist/types/components/FileInput/constants.d.ts +3 -0
- package/dist/types/components/FileInput/index.d.ts +58 -0
- package/dist/types/components/FileInput/types.d.ts +24 -0
- package/dist/types/components/Form/types.d.ts +17 -7
- package/dist/types/components/Input/index.d.ts +5 -5
- package/dist/types/components/Link/index.d.ts +34 -0
- package/dist/types/components/Link/types.d.ts +10 -0
- package/dist/types/components/Loading/index.d.ts +25 -0
- package/dist/types/components/Loading/types.d.ts +9 -0
- package/dist/types/components/Message/types.d.ts +2 -2
- package/dist/types/components/MessageBox/types.d.ts +2 -2
- package/dist/types/components/Notification/index.d.ts +1 -1
- package/dist/types/components/Notification/methods.d.ts +3 -1
- package/dist/types/components/Notification/types.d.ts +2 -2
- package/dist/types/components/Select/constants.d.ts +2 -1
- package/dist/types/components/Select/index.d.ts +11 -11
- package/dist/types/components/Select/useKeyMap.d.ts +1 -1
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/hooks/vitest.setup.d.ts +4 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +5 -14
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +59 -60
- package/dist/es/Badge-BG-vYP8Y.js +0 -13
- package/dist/es/Card-BCBnlVi_.js +0 -12
- package/dist/es/Collapse-B08VhCVq.js +0 -38
- package/dist/es/ConfigProvider-DZO1d5Eq.js +0 -44
- package/dist/es/Form-CGiTDSGI.js +0 -108
- package/dist/es/Loading-DlygqGOv.js +0 -88
- package/dist/es/Message-ganFfLeU.js +0 -123
- package/dist/es/Popconfirm-Cop44KwQ.js +0 -22
- package/dist/es/Select-TIoGsqKv.js +0 -133
- package/dist/es/Switch-CHjcLtHs.js +0 -34
- package/dist/es/hooks-CYdEHUVd.js +0 -105
- package/dist/theme/fonts/zpix.ttf +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { R as e, _ as l, c as t, r as o, w as a } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as i, inject as s, computed as n, createElementBlock as u, openBlock as r, withModifiers as d, normalizeClass as c, renderSlot as p, createVNode as h, unref as v, useSlots as f, ref as g, reactive as m, watchEffect as b, watch as y, onMounted as x, onBeforeUnmount as _, provide as V, normalizeStyle as w, withCtx as I, createCommentVNode as M, createElementVNode as k, Fragment as S, renderList as O, createBlock as L, mergeProps as B, nextTick as z } from "vue";
|
|
3
|
-
import { C as D, D as j, g as C, b as F, s as R, e as $, E, F as H, f as P, y as N, q as W, i as q, G as A, c as T } from "./vendor-DXmGx29U.js";
|
|
4
|
-
import { u as U, c as G, a as K } from "./hooks-CYdEHUVd.js";
|
|
5
|
-
import { P as J } from "./Icon-DpJyuj7c.js";
|
|
6
|
-
import { _ as Q } from "./Input-DBPpvf0Y.js";
|
|
7
|
-
import { T as X } from "./Tooltip-HWx_i2FA.js";
|
|
8
|
-
const Y = Symbol("selectContext"), Z = { 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"] }] }, ee = /* @__PURE__ */ new Set(["primary", "success", "warning", "danger", "info"]), le = { default: { "item-selected-font-color": "color", "item-selected-bg-color": "light", "item-indicator-color": "color", "item-highlighted-border-color": "color" }, ghost: { "item-selected-font-color": "color", "item-selected-bg-color": "light", "item-indicator-color": "color", "item-highlighted-border-color": "color" } }, te = ["id"], oe = l(i({ name: "PxOption", __name: "Option", props: { value: {}, label: {}, disabled: { type: Boolean, default: false } }, setup(l2) {
|
|
11
|
-
const t2 = l2, o2 = s(Y), a2 = n((() => {
|
|
12
|
-
var _a;
|
|
13
|
-
return ((_a = o2 == null ? void 0 : o2.selectStates.selectedOption) == null ? void 0 : _a.value) === t2.value;
|
|
14
|
-
})), i2 = n((() => D(["label", "value"], ((e2) => j(C(o2, ["highlightedLine", "value", e2]), C(t2, e2))))));
|
|
15
|
-
function f2() {
|
|
16
|
-
t2.disabled || (o2 == null ? void 0 : o2.handleSelect(t2));
|
|
17
|
-
}
|
|
18
|
-
return (l3, s2) => (r(), u("li", { class: c(["px-select__menu-item", { "is-disabled": l3.disabled, "is-selected": a2.value, "is-highlighted": i2.value }]), id: `select-item-${l3.value}`, onClick: d(f2, ["stop"]) }, [p(l3.$slots, "default", {}, (() => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
return [h(v(e), { vNode: ((_a = v(o2)) == null ? void 0 : _a.renderLabel) ? (_b = v(o2)) == null ? void 0 : _b.renderLabel(t2) : l3.label }, null, 8, ["vNode"])];
|
|
21
|
-
}), true)], 10, te));
|
|
22
|
-
} }), [["__scopeId", "data-v-c5f1823d"]]), ae = { key: 0, class: "px-select__loading" }, ie = { key: 1, class: "px-select__nodata" }, se = { class: "px-select__menu" }, ne = a(l(i({ name: "PxSelect", __name: "Select", props: { modelValue: {}, id: {}, options: { default: () => [] }, placeholder: {}, disabled: { type: Boolean }, clearable: { type: Boolean }, ghost: { type: Boolean }, color: {}, size: {}, renderLabel: {}, filterable: { type: Boolean }, filterMethod: {}, remote: { type: Boolean }, remoteMethod: {} }, emits: ["update:modelValue", "change", "visible-change", "clear", "focus", "blur"], setup(e2, { expose: l2, emit: a2 }) {
|
|
23
|
-
const i2 = e2, s2 = a2, p2 = f(), D2 = g(), te2 = g(), ne2 = g(), ue2 = g(/* @__PURE__ */ new Map()), re = g(i2.options ?? []), de = g(false), ce = Ee(i2.modelValue), pe = m({ inputValue: (ce == null ? void 0 : ce.label) ?? "", selectedOption: ce, mouseHover: false, loading: false, highlightedIndex: -1 }), he = n((() => i2.disabled)), ve = n((() => ee.has(i2.color ?? ""))), fe = n((() => !!i2.color && !ve.value)), ge = n((() => {
|
|
24
|
-
if (!fe.value) return {};
|
|
25
|
-
const e3 = t(i2.color), l3 = i2.ghost ? "ghost" : "default";
|
|
26
|
-
return o(e3, "px-select", le[l3]);
|
|
27
|
-
})), me = n((() => {
|
|
28
|
-
var _a;
|
|
29
|
-
return F((_a = p2 == null ? void 0 : p2.default) == null ? void 0 : _a.call(p2), ((e3) => j(e3.type, oe)));
|
|
30
|
-
})), be = n((() => R(me.value) > 0)), ye = n((() => i2.clearable && pe.mouseHover && "" !== pe.inputValue)), xe = n((() => {
|
|
31
|
-
let e3;
|
|
32
|
-
return e3 = be.value ? [...ue2.value.values()][pe.highlightedIndex] : re.value[pe.highlightedIndex], e3;
|
|
33
|
-
})), _e = n((() => be.value ? $(me.value, ((e3) => {
|
|
34
|
-
var _a, _b, _c;
|
|
35
|
-
return { props: { ...e3.props, disabled: true === ((_a = e3.props) == null ? void 0 : _a.disabled) || !q((_b = e3.props) == null ? void 0 : _b.disabled) && !A((_c = e3.props) == null ? void 0 : _c.disabled) } };
|
|
36
|
-
})) : [])), Ve = n((() => !!i2.filterable && !we.value)), we = n((() => be.value && ue2.value.size > 0 || !be.value && R(re.value) > 0)), Ie = n((() => be.value ? ue2.value.size - 1 : R(re.value) - 1)), Me = n((() => i2.filterable && pe.selectedOption && de.value ? pe.selectedOption.label : i2.placeholder)), ke = n((() => i2.remote ? 300 : 100));
|
|
37
|
-
let Se = E(Ne, ke.value);
|
|
38
|
-
b((() => {
|
|
39
|
-
Se.cancel(), Se = E(Ne, ke.value);
|
|
40
|
-
}));
|
|
41
|
-
const Oe = U().value, { wrapperRef: Le, isFocused: Be, handleBlur: ze, handleFocus: De } = G(ne2), je = (function({ isDropdownVisible: e3, controlVisible: l3, selectStates: t2, highlightedLine: o2, handleSelect: a3, hasData: i3, lastIndex: s3 }) {
|
|
42
|
-
const n2 = /* @__PURE__ */ new Map();
|
|
43
|
-
return n2.set("Enter", (() => {
|
|
44
|
-
e3.value && t2.highlightedIndex >= 0 && o2.value && a3(o2.value), l3(!e3.value);
|
|
45
|
-
})), n2.set("Escape", (() => e3.value && l3(!e3.value))), n2.set("ArrowUp", ((e4) => {
|
|
46
|
-
e4.preventDefault(), i3.value && (-1 !== t2.highlightedIndex && 0 !== t2.highlightedIndex ? t2.highlightedIndex-- : t2.highlightedIndex = s3.value);
|
|
47
|
-
})), n2.set("ArrowDown", ((e4) => {
|
|
48
|
-
e4.preventDefault(), i3.value && (-1 !== t2.highlightedIndex && t2.highlightedIndex !== s3.value ? t2.highlightedIndex++ : t2.highlightedIndex = 0);
|
|
49
|
-
})), n2;
|
|
50
|
-
})({ isDropdownVisible: de, controlVisible: Fe, selectStates: pe, highlightedLine: xe, handleSelect: He, hasData: we, lastIndex: Ie });
|
|
51
|
-
function Ce(e3) {
|
|
52
|
-
Be.value && z((() => ze(new FocusEvent("focus", e3))));
|
|
53
|
-
}
|
|
54
|
-
function Fe(e3) {
|
|
55
|
-
var _a;
|
|
56
|
-
te2.value && ((_a = C(te2, ["value", e3 ? "show" : "hide"])) == null ? void 0 : _a(), i2.filterable && (function(e4) {
|
|
57
|
-
var _a2;
|
|
58
|
-
i2.filterable && (e4 ? (pe.selectedOption && (pe.inputValue = ""), Se()) : pe.inputValue = ((_a2 = pe.selectedOption) == null ? void 0 : _a2.label) || "");
|
|
59
|
-
})(e3), de.value = e3, s2("visible-change", e3), pe.highlightedIndex = -1);
|
|
60
|
-
}
|
|
61
|
-
function Re() {
|
|
62
|
-
he.value || Fe(!de.value);
|
|
63
|
-
}
|
|
64
|
-
function $e() {
|
|
65
|
-
var _a;
|
|
66
|
-
(_a = ne2.value) == null ? void 0 : _a.clear(), pe.inputValue = "", pe.selectedOption = null, s2("clear"), P(["change", "update:modelValue"], ((e3) => s2(e3, "")));
|
|
67
|
-
}
|
|
68
|
-
function Ee(e3) {
|
|
69
|
-
return H(i2.options, ((l3) => l3.value === e3));
|
|
70
|
-
}
|
|
71
|
-
function He(e3) {
|
|
72
|
-
var _a;
|
|
73
|
-
e3.disabled || (pe.inputValue = e3.label, pe.selectedOption = e3, P(["change", "update:modelValue"], ((l3) => s2(l3, e3.value))), Fe(false), (_a = ne2.value) == null ? void 0 : _a.focus());
|
|
74
|
-
}
|
|
75
|
-
function Pe(e3) {
|
|
76
|
-
ue2.value.clear(), P(e3, ((e4) => {
|
|
77
|
-
ue2.value.set(e4.props.value, e4.props);
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
function Ne() {
|
|
81
|
-
const e3 = pe.inputValue;
|
|
82
|
-
pe.highlightedIndex = -1, be.value ? (async function(e4) {
|
|
83
|
-
if (i2.filterable) {
|
|
84
|
-
if (i2.remote && i2.remoteMethod && N(i2.remoteMethod)) return await qe(i2.remoteMethod, e4), void Pe(_e.value);
|
|
85
|
-
if (i2.filterMethod && N(i2.filterMethod)) {
|
|
86
|
-
const l3 = $(i2.filterMethod(e4), "value");
|
|
87
|
-
Pe(F(_e.value, ((e5) => T(l3, C(e5, ["props", "value"])))));
|
|
88
|
-
} else Pe(F(_e.value, ((l3) => T(C(l3, ["props", "label"]), e4))));
|
|
89
|
-
}
|
|
90
|
-
})(e3) : (async function(e4) {
|
|
91
|
-
i2.filterable && (i2.remote && i2.remoteMethod && N(i2.remoteMethod) ? re.value = await qe(i2.remoteMethod, e4) : i2.filterMethod && N(i2.filterMethod) ? re.value = i2.filterMethod(e4) : re.value = F(i2.options, ((l3) => T(l3.label, e4))));
|
|
92
|
-
})(e3);
|
|
93
|
-
}
|
|
94
|
-
function We(e3) {
|
|
95
|
-
var _a;
|
|
96
|
-
je.has(e3.key) && ((_a = je.get(e3.key)) == null ? void 0 : _a(e3));
|
|
97
|
-
}
|
|
98
|
-
async function qe(e3, l3) {
|
|
99
|
-
if (!e3 || !N(e3)) return;
|
|
100
|
-
let t2;
|
|
101
|
-
pe.loading = true;
|
|
102
|
-
try {
|
|
103
|
-
t2 = await e3(l3);
|
|
104
|
-
} catch (e4) {
|
|
105
|
-
t2 = [];
|
|
106
|
-
}
|
|
107
|
-
return t2;
|
|
108
|
-
}
|
|
109
|
-
function Ae() {
|
|
110
|
-
const e3 = Ee(i2.modelValue);
|
|
111
|
-
e3 && (pe.inputValue = e3.label, pe.selectedOption = e3);
|
|
112
|
-
}
|
|
113
|
-
return K(D2, ((e3) => Ce(e3))), y((() => i2.options), ((e3) => {
|
|
114
|
-
re.value = e3 ?? [];
|
|
115
|
-
})), y((() => _e.value), ((e3) => Pe(e3)), { immediate: true }), y((() => i2.modelValue), (() => {
|
|
116
|
-
Ae();
|
|
117
|
-
})), x((() => {
|
|
118
|
-
Ae();
|
|
119
|
-
})), _((() => {
|
|
120
|
-
Se.cancel();
|
|
121
|
-
})), V(Y, { handleSelect: He, selectStates: pe, renderLabel: function(e3) {
|
|
122
|
-
return N(i2.renderLabel) ? i2.renderLabel(e3) : e3.label;
|
|
123
|
-
}, highlightedLine: xe }), l2({ focus: () => {
|
|
124
|
-
var _a;
|
|
125
|
-
(_a = ne2.value) == null ? void 0 : _a.focus();
|
|
126
|
-
}, blur: () => {
|
|
127
|
-
Ce();
|
|
128
|
-
} }), (e3, l3) => (r(), u("div", { ref_key: "selectRef", ref: D2, class: c(["px-select", { "is-disabled": he.value, "is-ghost": e3.ghost, [`px-select--${e3.size}`]: e3.size, [`px-select--${e3.color}`]: ve.value }]), style: w(ge.value), onClick: d(Re, ["stop"]), onMouseenter: l3[2] || (l3[2] = (e4) => pe.mouseHover = true), onMouseleave: l3[3] || (l3[3] = (e4) => pe.mouseHover = false) }, [h(X, { ref_key: "tooltipRef", ref: te2, placement: "bottom-start", "popper-options": v(Z), onClickOutside: l3[1] || (l3[1] = (e4) => Fe(false)), manual: "" }, { default: I((() => [k("div", { ref_key: "inputWrapperRef", ref: Le }, [h(Q, { ref_key: "inputRef", ref: ne2, modelValue: pe.inputValue, "onUpdate:modelValue": l3[0] || (l3[0] = (e4) => pe.inputValue = e4), id: v(Oe), disabled: he.value, ghost: e3.ghost, color: e3.color, size: e3.size, placeholder: e3.filterable ? Me.value : e3.placeholder, readonly: !e3.filterable || !de.value, onFocus: v(De), onBlur: v(ze), onInput: v(Se), onKeydown: We }, { suffix: I((() => [ye.value ? (r(), L(J, { key: 0, icon: "close-box", class: "px-input__clear", onClick: d($e, ["stop"]), onMousedown: d(v(W), ["prevent"]) }, null, 8, ["onMousedown"])) : (r(), L(J, { key: 1, class: c(["header-angle", { "is-active": de.value }]), icon: "chevron-down" }, null, 8, ["class"]))])), _: 1 }, 8, ["modelValue", "id", "disabled", "ghost", "color", "size", "placeholder", "readonly", "onFocus", "onBlur", "onInput"])], 512)])), content: I((() => [pe.loading ? (r(), u("div", ae, [h(J, { icon: "loader", spin: "" })])) : e3.filterable && Ve.value ? (r(), u("div", ie, " No data ")) : M("", true), k("ul", se, [be.value ? (r(true), u(S, { key: 1 }, O(ue2.value, (([e4, l4]) => (r(), L(oe, B({ key: e4, ref_for: true }, l4), null, 16)))), 128)) : (r(true), u(S, { key: 0 }, O(re.value, ((e4) => (r(), L(oe, B({ key: e4.value, ref_for: true }, e4), null, 16)))), 128))])])), _: 1 }, 8, ["popper-options"])], 38));
|
|
129
|
-
} }), [["__scopeId", "data-v-ec41a99d"]])), ue = a(oe);
|
|
130
|
-
export {
|
|
131
|
-
ne as P,
|
|
132
|
-
ue as a
|
|
133
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { c as e, w as i } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as c, computed as t, ref as a, onMounted as o, watch as l, createElementBlock as s, openBlock as n, normalizeStyle as r, normalizeClass as u, createElementVNode as v, withKeys as d, unref as p, createCommentVNode as h, toDisplayString as x, createBlock as m } from "vue";
|
|
3
|
-
import { u as f } from "./hooks-CYdEHUVd.js";
|
|
4
|
-
import { P as w } from "./Icon-DpJyuj7c.js";
|
|
5
|
-
const _ = ["id", "name", "disabled", "checked"], k = { class: "px-switch__core" }, y = { class: "px-switch__core-inner" }, b = { key: 0, class: "px-switch__core-inner-text" }, V = { class: "px-switch__core-action" }, C = i(c({ name: "PxSwitch", inheritAttrs: false, __name: "Switch", props: { modelValue: { type: [Boolean, String, Number] }, disabled: { type: Boolean }, activeText: {}, inactiveText: {}, activeValue: { type: [Boolean, String, Number], default: true }, inactiveValue: { type: [Boolean, String, Number], default: false }, name: {}, id: {}, size: {}, type: {}, activeColor: {}, inactiveColor: {}, activeIcon: {}, inactiveIcon: {} }, emits: ["update:modelValue", "change"], setup(i2, { expose: c2, emit: C2 }) {
|
|
6
|
-
const T = i2, g = C2, I = t((() => T.disabled)), S = a(T.modelValue), z = a(), B = f().value, j = t((() => S.value === T.activeValue)), N = t((() => j.value ? T.activeIcon : T.inactiveIcon)), P = t((() => {
|
|
7
|
-
const i3 = {};
|
|
8
|
-
if (T.activeColor) {
|
|
9
|
-
const c3 = e(T.activeColor);
|
|
10
|
-
i3["--px-switch-on-color"] = c3.color, i3["--px-switch-on-border-color"] = c3.dark;
|
|
11
|
-
}
|
|
12
|
-
if (T.inactiveColor) {
|
|
13
|
-
const c3 = e(T.inactiveColor);
|
|
14
|
-
i3["--px-switch-off-color"] = c3.color, i3["--px-switch-off-border-color"] = c3.dark;
|
|
15
|
-
}
|
|
16
|
-
return i3;
|
|
17
|
-
}));
|
|
18
|
-
function $() {
|
|
19
|
-
if (I.value) return;
|
|
20
|
-
const e2 = j.value ? T.inactiveValue : T.activeValue;
|
|
21
|
-
S.value = e2, g("update:modelValue", e2), g("change", e2);
|
|
22
|
-
}
|
|
23
|
-
return o((() => {
|
|
24
|
-
z.value.checked = j.value;
|
|
25
|
-
})), l(j, ((e2) => {
|
|
26
|
-
z.value.checked = e2;
|
|
27
|
-
})), c2({ checked: j, focus: () => {
|
|
28
|
-
var _a;
|
|
29
|
-
(_a = z.value) == null ? void 0 : _a.focus();
|
|
30
|
-
} }), (e2, i3) => (n(), s("div", { class: u(["px-switch", { [`px-switch--${e2.size}`]: e2.size, [`px-switch--${e2.type}`]: e2.type, "is-disabled": I.value, "is-checked": j.value }]), style: r(P.value), onClick: $ }, [v("input", { class: "px-switch__input", type: "checkbox", role: "switch", ref_key: "inputRef", ref: z, id: p(B), name: e2.name, disabled: I.value, checked: j.value, onKeydown: d($, ["enter"]) }, null, 40, _), v("div", k, [v("div", y, [e2.activeText || e2.inactiveText ? (n(), s("span", b, x(j.value ? e2.activeText : e2.inactiveText), 1)) : h("", true)]), v("div", V, [N.value ? (n(), m(w, { key: 0, class: "px-switch__icon", icon: N.value, size: "xs" }, null, 8, ["icon"])) : h("", true)])])], 6));
|
|
31
|
-
} }));
|
|
32
|
-
export {
|
|
33
|
-
C as P
|
|
34
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { isRef as e, watch as t, onMounted as n, onBeforeUnmount as a, unref as r, getCurrentInstance as o, useSlots as l, watchEffect as s, ref as u, computed as d, onUnmounted as c } from "vue";
|
|
2
|
-
import { f as i, y as v, k as f, z as m } from "./vendor-DXmGx29U.js";
|
|
3
|
-
function p(o2, l2, s2) {
|
|
4
|
-
e(o2) ? t(o2, ((e2, t2) => {
|
|
5
|
-
null == t2 || t2.removeEventListener(l2, s2), null == e2 || e2.addEventListener(l2, s2);
|
|
6
|
-
})) : n((() => null == o2 ? void 0 : o2.addEventListener(l2, s2))), a((() => {
|
|
7
|
-
var e2;
|
|
8
|
-
return null == (e2 = r(o2)) ? void 0 : e2.removeEventListener(l2, s2);
|
|
9
|
-
}));
|
|
10
|
-
}
|
|
11
|
-
function h(e2, t2) {
|
|
12
|
-
p(document, "click", ((n2) => {
|
|
13
|
-
e2.value && n2.target && (e2.value.contains(n2.target) || t2(n2));
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
16
|
-
const g = (e2, t2) => i(e2, ((e3) => {
|
|
17
|
-
v(t2) && t2(e3), e3.children && g(e3.children, t2);
|
|
18
|
-
}));
|
|
19
|
-
function w() {
|
|
20
|
-
var e2, t2;
|
|
21
|
-
const n2 = /* @__PURE__ */ new Map(), a2 = o(), r2 = null == (t2 = null == (e2 = l()) ? void 0 : e2.default) ? void 0 : t2.call(e2);
|
|
22
|
-
s((() => {
|
|
23
|
-
(null == a2 ? void 0 : a2.props.disabled) ? g(r2 ?? [], ((e3) => {
|
|
24
|
-
(null == e3 ? void 0 : e3.props) && (n2.set(e3, f(e3.props)), e3.props = m(null == e3 ? void 0 : e3.props, { style: { cursor: "not-allowed", color: "var(--px-text-color-placeholder)" } }));
|
|
25
|
-
})) : g(r2 ?? [], ((e3) => {
|
|
26
|
-
n2.has(e3) && (e3.props = n2.get(e3));
|
|
27
|
-
}));
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
function L(e2, { afterBlur: t2, beforeBlur: n2, afterFocus: a2 } = {}) {
|
|
31
|
-
const r2 = o(), { emit: l2 } = r2, s2 = u(), d2 = u(false);
|
|
32
|
-
return p(s2, "click", (() => {
|
|
33
|
-
var t3;
|
|
34
|
-
null == (t3 = e2.value) || t3.focus();
|
|
35
|
-
})), { wrapperRef: s2, isFocused: d2, handleFocus: (e3) => {
|
|
36
|
-
d2.value || (d2.value = true, l2("focus", e3), null == a2 || a2());
|
|
37
|
-
}, handleBlur: (e3) => {
|
|
38
|
-
var a3;
|
|
39
|
-
v(n2) && n2(e3) || e3.relatedTarget && (null == (a3 = s2.value) ? void 0 : a3.contains(e3.relatedTarget)) || (d2.value = false, l2("blur", e3), null == t2 || t2());
|
|
40
|
-
} };
|
|
41
|
-
}
|
|
42
|
-
const k = { prefix: Math.floor(1e4 * Math.random()), current: 0 };
|
|
43
|
-
function y(e2 = "er") {
|
|
44
|
-
const t2 = `${e2}-${k.prefix}-${k.current++}`;
|
|
45
|
-
return u(t2);
|
|
46
|
-
}
|
|
47
|
-
function E(e2) {
|
|
48
|
-
const t2 = d((() => e2.getLastBottomOffset())), n2 = d((() => e2.offset + t2.value)), a2 = d((() => n2.value + e2.boxHeight.value));
|
|
49
|
-
return { topOffset: n2, bottomOffset: a2 };
|
|
50
|
-
}
|
|
51
|
-
const x = u(0);
|
|
52
|
-
function b(e2 = 2e3) {
|
|
53
|
-
const t2 = u(e2), n2 = d((() => x.value + t2.value));
|
|
54
|
-
return { initialValue: t2, currentZIndex: n2, nextZIndex: () => (x.value++, n2.value) };
|
|
55
|
-
}
|
|
56
|
-
function M() {
|
|
57
|
-
const e2 = u(false);
|
|
58
|
-
let t2 = null, a2 = null;
|
|
59
|
-
return n((() => {
|
|
60
|
-
"undefined" != typeof window && (t2 = window.matchMedia("(prefers-color-scheme: dark)"), e2.value = t2.matches, a2 = (t3) => {
|
|
61
|
-
e2.value = t3.matches;
|
|
62
|
-
}, t2.addEventListener ? t2.addEventListener("change", a2) : t2.addListener(a2));
|
|
63
|
-
})), c((() => {
|
|
64
|
-
t2 && a2 && (t2.removeEventListener ? t2.removeEventListener("change", a2) : t2.removeListener(a2));
|
|
65
|
-
})), { prefersDark: e2, prefers: d((() => e2.value ? "dark" : "light")) };
|
|
66
|
-
}
|
|
67
|
-
const B = "px-theme", I = "px-dark", T = u("system"), F = u(false);
|
|
68
|
-
function O(e2) {
|
|
69
|
-
"undefined" != typeof document && (e2 ? document.documentElement.classList.add(I) : document.documentElement.classList.remove(I));
|
|
70
|
-
}
|
|
71
|
-
function S(e2) {
|
|
72
|
-
return "system" === e2 ? "undefined" != typeof window && window.matchMedia("(prefers-color-scheme: dark)").matches : "dark" === e2;
|
|
73
|
-
}
|
|
74
|
-
let $ = false;
|
|
75
|
-
function D() {
|
|
76
|
-
if (!$ && "undefined" != typeof window) {
|
|
77
|
-
!(function() {
|
|
78
|
-
if ("undefined" == typeof window) return;
|
|
79
|
-
const e4 = localStorage.getItem(B);
|
|
80
|
-
e4 && ["light", "dark", "system"].includes(e4) ? T.value = e4 : T.value = "system", F.value = S(T.value), O(F.value);
|
|
81
|
-
})(), $ = true;
|
|
82
|
-
const e3 = window.matchMedia("(prefers-color-scheme: dark)"), t2 = (e4) => {
|
|
83
|
-
"system" === T.value && (F.value = e4.matches, O(F.value));
|
|
84
|
-
};
|
|
85
|
-
e3.addEventListener ? e3.addEventListener("change", t2) : e3.addListener(t2);
|
|
86
|
-
}
|
|
87
|
-
const e2 = (e3) => {
|
|
88
|
-
T.value = e3, F.value = S(e3), O(F.value), "undefined" != typeof localStorage && localStorage.setItem(B, e3);
|
|
89
|
-
};
|
|
90
|
-
return { theme: d((() => T.value)), isDark: d((() => F.value)), setTheme: e2, toggleTheme: () => {
|
|
91
|
-
const t2 = F.value ? "light" : "dark";
|
|
92
|
-
e2(t2);
|
|
93
|
-
} };
|
|
94
|
-
}
|
|
95
|
-
export {
|
|
96
|
-
h as a,
|
|
97
|
-
w as b,
|
|
98
|
-
L as c,
|
|
99
|
-
b as d,
|
|
100
|
-
E as e,
|
|
101
|
-
p as f,
|
|
102
|
-
M as g,
|
|
103
|
-
D as h,
|
|
104
|
-
y as u
|
|
105
|
-
};
|
|
Binary file
|