sakana-element 2.2.0 → 2.3.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 +95 -22
- package/dist/es/{Alert-C76ZWSVk.js → Alert-BwTsp4X3.js} +2 -2
- package/dist/es/Avatar-CJu6JYV3.js +9 -0
- package/dist/es/{Badge-CoFWwBwv.js → Badge-BmxZXX8k.js} +2 -2
- package/dist/es/{Breadcrumb-BtrwTVKW.js → Breadcrumb-BP8MSklj.js} +2 -2
- package/dist/es/{Button-S_31-UWJ.js → Button-BJHtN7gh.js} +2 -2
- package/dist/es/{Card-DcW6nHYD.js → Card-DJHkCmsz.js} +2 -2
- package/dist/es/Checkbox-DX8L3fyp.js +51 -0
- package/dist/es/{Collapse-DsS7M-m3.js → Collapse-Ir3V9CuO.js} +2 -2
- package/dist/es/{ConfigProvider-BgIewHXP.js → ConfigProvider-CsbSqwwi.js} +1 -1
- package/dist/es/Divider-C7PtODSK.js +9 -0
- package/dist/es/Drawer-C2eVmvUp.js +40 -0
- package/dist/es/Dropdown-CVg_c2fB.js +104 -0
- package/dist/es/{FileInput-BQ59woas.js → FileInput-BE26BmXm.js} +3 -3
- package/dist/es/Form-7lZt5ehf.js +122 -0
- package/dist/es/{Icon-DpJyuj7c.js → Icon-BLDDdSU-.js} +1 -1
- package/dist/es/Indicator-B-en-MgG.js +9 -0
- package/dist/es/{Input-CiE4bPJN.js → Input-C5HuVehE.js} +6 -6
- package/dist/es/{Link-B9B2APZq.js → Link-Av9RdcFv.js} +1 -1
- package/dist/es/{Loading-BW99pE5N.js → Loading-CBNDUWQd.js} +12 -12
- package/dist/es/Message-DgnyyuXn.js +152 -0
- package/dist/es/Notification-LYRXnVAf.js +69 -0
- package/dist/es/{Overlay-BRDSWspM.js → Overlay-CpvMhnuU.js} +1 -1
- package/dist/es/Pixelate-BPypBgJU.js +67 -0
- package/dist/es/Popconfirm-DvxFdLrw.js +23 -0
- package/dist/es/Progress-Bc5INMhJ.js +12 -0
- package/dist/es/Radio-263_rtRl.js +33 -0
- package/dist/es/{Select-Dwqv8isB.js → Select-7ZxUCS8z.js} +13 -13
- package/dist/es/{Switch-B1Gnv1tB.js → Switch-DiCsMJT3.js} +3 -3
- package/dist/es/Table-BvA_xzDe.js +10 -0
- package/dist/es/Tooltip-J3ji6weH.js +74 -0
- package/dist/es/hooks-BqobYUzS.js +171 -0
- package/dist/es/index.js +90 -70
- package/dist/{theme → es/theme}/Avatar.css +13 -43
- package/dist/{theme → es/theme}/Breadcrumb.css +46 -4
- package/dist/es/theme/Card.css +347 -0
- package/dist/es/theme/Checkbox.css +484 -0
- package/dist/es/theme/Divider.css +111 -0
- package/dist/es/theme/Drawer.css +206 -0
- package/dist/es/theme/Dropdown.css +471 -0
- package/dist/es/theme/Indicator.css +159 -0
- package/dist/{theme → es/theme}/Input.css +1 -0
- package/dist/{theme → es/theme}/Link.css +22 -3
- package/dist/{theme → es/theme}/Loading.css +50 -12
- package/dist/{theme → es/theme}/Message.css +249 -40
- package/dist/es/theme/Notification.css +316 -0
- package/dist/es/theme/Popconfirm.css +46 -0
- package/dist/es/theme/Progress.css +278 -0
- package/dist/es/theme/Radio.css +426 -0
- package/dist/es/theme/Table.css +680 -0
- package/dist/es/theme/Tooltip.css +235 -0
- package/dist/es/utils-BS5vsvlM.js +101 -0
- package/dist/index.css +1 -1
- package/dist/types/components/Avatar/types.d.ts +0 -2
- package/dist/types/components/Checkbox/constants.d.ts +5 -0
- package/dist/types/components/Checkbox/index.d.ts +94 -0
- package/dist/types/components/Checkbox/types.d.ts +46 -0
- package/dist/types/components/Collapse/index.d.ts +5 -5
- package/dist/types/components/Divider/index.d.ts +30 -0
- package/dist/types/components/Divider/types.d.ts +10 -0
- package/dist/types/components/Drawer/constants.d.ts +1 -0
- package/dist/types/components/Drawer/index.d.ts +72 -0
- package/dist/types/components/Drawer/types.d.ts +20 -0
- package/dist/types/components/Dropdown/index.d.ts +11 -1
- package/dist/types/components/Dropdown/types.d.ts +3 -0
- package/dist/types/components/Dropdown/useDropdownKeyboard.d.ts +8 -0
- package/dist/types/components/FileInput/index.d.ts +5 -5
- package/dist/types/components/Indicator/constants.d.ts +2 -0
- package/dist/types/components/Indicator/index.d.ts +28 -0
- package/dist/types/components/Indicator/types.d.ts +10 -0
- package/dist/types/components/Input/index.d.ts +10 -10
- package/dist/types/components/Message/methods.d.ts +2 -0
- package/dist/types/components/Message/types.d.ts +7 -1
- package/dist/types/components/MessageBox/types.d.ts +14 -2
- package/dist/types/components/Notification/methods.d.ts +3 -0
- package/dist/types/components/Notification/types.d.ts +8 -2
- package/dist/types/components/Pixelate/constants.d.ts +2 -0
- package/dist/types/components/Pixelate/index.d.ts +71 -0
- package/dist/types/components/Pixelate/types.d.ts +23 -0
- package/dist/types/components/Popconfirm/index.d.ts +16 -7
- package/dist/types/components/Popconfirm/types.d.ts +2 -1
- package/dist/types/components/Progress/constants.d.ts +2 -0
- package/dist/types/components/Progress/index.d.ts +50 -0
- package/dist/types/components/Progress/types.d.ts +22 -0
- package/dist/types/components/Radio/constants.d.ts +5 -0
- package/dist/types/components/Radio/index.d.ts +88 -0
- package/dist/types/components/Radio/types.d.ts +43 -0
- package/dist/types/components/Select/index.d.ts +30 -21
- package/dist/types/components/Switch/index.d.ts +5 -5
- package/dist/types/components/Table/index.d.ts +27 -0
- package/dist/types/components/Table/types.d.ts +20 -0
- package/dist/types/components/Tooltip/index.d.ts +6 -0
- package/dist/types/components/Tooltip/types.d.ts +7 -0
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/hooks/index.d.ts +3 -1
- package/dist/types/hooks/useDraggable.d.ts +7 -0
- package/dist/types/hooks/useFocusTrap.d.ts +5 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/instance-management.d.ts +40 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +4 -4
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +59 -59
- package/dist/es/Avatar-CxsRW-wl.js +0 -9
- package/dist/es/Dropdown-GcomGMAI.js +0 -40
- package/dist/es/Form-j90EzLXU.js +0 -122
- package/dist/es/Message-DCNnTUje.js +0 -123
- package/dist/es/Notification-CBzY5904.js +0 -58
- package/dist/es/Popconfirm-DF6d2ORS.js +0 -23
- package/dist/es/Tooltip-k6gKnMyt.js +0 -74
- package/dist/es/hooks-BaG7l8K5.js +0 -116
- package/dist/es/utils-bsCscZfS.js +0 -84
- package/dist/theme/Card.css +0 -263
- package/dist/theme/Dropdown.css +0 -187
- package/dist/theme/Notification.css +0 -126
- package/dist/theme/Popconfirm.css +0 -30
- package/dist/theme/Tooltip.css +0 -111
- /package/dist/{theme → es/theme}/Alert.css +0 -0
- /package/dist/{theme → es/theme}/Badge.css +0 -0
- /package/dist/{theme → es/theme}/Button.css +0 -0
- /package/dist/{theme → es/theme}/Collapse.css +0 -0
- /package/dist/{theme → es/theme}/FileInput.css +0 -0
- /package/dist/{theme → es/theme}/Form.css +0 -0
- /package/dist/{theme → es/theme}/Icon.css +0 -0
- /package/dist/{theme → es/theme}/Overlay.css +0 -0
- /package/dist/{theme → es/theme}/Select.css +0 -0
- /package/dist/{theme → es/theme}/Switch.css +0 -0
- /package/dist/{theme → es/theme}/fonts/zpix.woff2 +0 -0
- /package/dist/{theme → es/theme}/index.css +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { r as o, c as i, _ as e, w as t } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as a, useSlots as s, computed as n, createElementBlock as r, openBlock as p, normalizeClass as c, renderSlot as l, createCommentVNode as d, createElementVNode as f, normalizeStyle as _ } from "vue";
|
|
3
|
+
const x = { "bg-color": "color", "border-color": "dark", "shadow-color": "dark" }, u = t(e(a({ name: "PxIndicator", __name: "Indicator", props: { placement: { default: "top-end" }, type: { default: "primary" }, color: {}, offset: {}, inline: { type: Boolean }, processing: { type: Boolean } }, setup(e2) {
|
|
4
|
+
const t2 = e2, a2 = s(), u2 = n((() => !a2.indicator)), m = n((() => t2.color ? o(i(t2.color), "px-indicator", x) : {})), v = n((() => t2.offset ? { "--px-indicator-offset-x": `${t2.offset[0]}px`, "--px-indicator-offset-y": `${t2.offset[1]}px` } : {}));
|
|
5
|
+
return (o2, i2) => (p(), r("div", { class: c(["px-indicator", { "is-inline": o2.inline }]) }, [l(o2.$slots, "default", {}, void 0, true), o2.processing && u2.value ? (p(), r("span", { key: 0, class: c(["px-indicator__ping", [`px-indicator__ping--${o2.placement}`, `px-indicator__ping--${o2.type}`]]), style: _([m.value, v.value]) }, null, 6)) : d("", true), f("div", { class: c(["px-indicator__item", [`px-indicator__item--${o2.placement}`, `px-indicator__item--${o2.type}`, { "is-dot": u2.value, "is-processing": o2.processing }]]), style: _([m.value, v.value]) }, [l(o2.$slots, "indicator", {}, void 0, true)], 6)], 2));
|
|
6
|
+
} }), [["__scopeId", "data-v-84fa8f8b"]]));
|
|
7
|
+
export {
|
|
8
|
+
u as P
|
|
9
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as e, r as o, d as a, w as l } from "./utils-
|
|
2
|
-
import { defineComponent as s, ref as r, shallowRef as u, useAttrs as t, computed as p, watch as n, createElementBlock as d, openBlock as c, normalizeStyle as i, normalizeClass as f, unref as v, withDirectives as m, Fragment as y, createCommentVNode as h, createElementVNode as x, renderSlot as _, mergeProps as w, vModelDynamic as k, createBlock as b, withModifiers as
|
|
3
|
-
import {
|
|
4
|
-
import { u as P } from "./Form-
|
|
5
|
-
import { P as j } from "./Icon-
|
|
1
|
+
import { c as e, r as o, d as a, w as l } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as s, ref as r, shallowRef as u, useAttrs as t, computed as p, watch as n, createElementBlock as d, openBlock as c, normalizeStyle as i, normalizeClass as f, unref as v, withDirectives as m, Fragment as y, createCommentVNode as h, createElementVNode as x, renderSlot as _, mergeProps as w, vModelDynamic as k, createBlock as b, withModifiers as $, vModelText as g, nextTick as B } from "vue";
|
|
3
|
+
import { e as V, u as I } from "./hooks-BqobYUzS.js";
|
|
4
|
+
import { u as P } from "./Form-7lZt5ehf.js";
|
|
5
|
+
import { P as j } from "./Icon-BLDDdSU-.js";
|
|
6
6
|
import { q as C, f as F } from "./vendor-DXmGx29U.js";
|
|
7
7
|
const R = /* @__PURE__ */ new Set(["primary", "success", "warning", "danger", "info"]), z = { default: { "border-color": "color", "hover-border-color": "dark", "focus-border-color": "dark", "shadow-color": "dark", "focus-shadow-color": "dark" }, ghost: { "border-color": "transparent", "hover-border-color": "color", "focus-border-color": "dark", "shadow-color": "transparent", "focus-shadow-color": "dark" } }, M = { key: 0, class: "px-input__prepend" }, U = { key: 0, class: "px-input__prefix" }, q = ["id", "type", "disabled", "readonly", "autocomplete", "placeholder", "autofocus", "form"], A = { key: 1, class: "px-input__suffix" }, S = { key: 1, class: "px-input__append" }, D = ["id", "disabled", "readonly", "autocomplete", "placeholder", "autofocus", "form"], E = s({ name: "PxInput", inheritAttrs: false, __name: "Input", props: { id: {}, modelValue: {}, type: { default: "text" }, size: {}, color: {}, ghost: { type: Boolean }, 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(l2, { expose: s2, emit: E2 }) {
|
|
8
8
|
const G2 = l2, H = E2, J = r(G2.modelValue), K = r(false), L = u(), N = u(), O = t(), { formItem: Q } = P(), T = p((() => L.value || N.value)), W = p((() => G2.disabled)), X = p((() => R.has(G2.color ?? ""))), Y = p((() => !!G2.color && !X.value)), Z = p((() => {
|
|
@@ -34,7 +34,7 @@ const R = /* @__PURE__ */ new Set(["primary", "success", "warning", "danger", "i
|
|
|
34
34
|
}, select: () => {
|
|
35
35
|
var _a;
|
|
36
36
|
(_a = T.value) == null ? void 0 : _a.select();
|
|
37
|
-
}, clear: ue }), (e2, o2) => (c(), d("div", { class: f(["px-input", { [`px-input--${e2.type}`]: e2.type, [`px-input--${e2.size}`]: e2.size, [`px-input--${e2.color}`]: X.value, "is-ghost": e2.ghost, "is-disabled": W.value, "is-prepend": e2.$slots.prepend, "is-append": e2.$slots.append, "is-prefix": e2.$slots.prefix, "is-suffix": e2.$slots.suffix, "is-focus": v(le) }]), style: i(Z.value) }, ["textarea" !== e2.type ? (c(), d(y, { key: 0 }, [e2.$slots.prepend ? (c(), d("div", M, [_(e2.$slots, "prepend")])) : h("", true), x("div", { class: "px-input__wrapper", ref_key: "wrapperRef", ref: ae }, [e2.$slots.prefix ? (c(), d("span", U, [_(e2.$slots, "prefix")])) : h("", true), m(x("input", w({ class: "px-input__inner", ref_key: "inputRef", ref: L, id: v(I)().value, type: e2.showPassword ? K.value ? "text" : "password" : e2.type, disabled: W.value, readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, form: e2.form, "onUpdate:modelValue": o2[0] || (o2[0] = (e3) => J.value = e3) }, v(O), { onInput: te, onChange: pe, onFocus: o2[1] || (o2[1] = (...e3) => v(se) && v(se)(...e3)), onBlur: o2[2] || (o2[2] = (...e3) => v(re) && v(re)(...e3)) }), null, 16, q), [[k, J.value]]), e2.$slots.suffix || ee.value || oe.value ? (c(), d("span", A, [_(e2.$slots, "suffix"), ee.value ? (c(), b(j, { key: 0, icon: "close-box", class: "px-input__clear", onClick: ue, onMousedown:
|
|
37
|
+
}, clear: ue }), (e2, o2) => (c(), d("div", { class: f(["px-input", { [`px-input--${e2.type}`]: e2.type, [`px-input--${e2.size}`]: e2.size, [`px-input--${e2.color}`]: X.value, "is-ghost": e2.ghost, "is-disabled": W.value, "is-prepend": e2.$slots.prepend, "is-append": e2.$slots.append, "is-prefix": e2.$slots.prefix, "is-suffix": e2.$slots.suffix, "is-focus": v(le) }]), style: i(Z.value) }, ["textarea" !== e2.type ? (c(), d(y, { key: 0 }, [e2.$slots.prepend ? (c(), d("div", M, [_(e2.$slots, "prepend")])) : h("", true), x("div", { class: "px-input__wrapper", ref_key: "wrapperRef", ref: ae }, [e2.$slots.prefix ? (c(), d("span", U, [_(e2.$slots, "prefix")])) : h("", true), m(x("input", w({ class: "px-input__inner", ref_key: "inputRef", ref: L, id: v(I)().value, type: e2.showPassword ? K.value ? "text" : "password" : e2.type, disabled: W.value, readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, form: e2.form, "onUpdate:modelValue": o2[0] || (o2[0] = (e3) => J.value = e3) }, v(O), { onInput: te, onChange: pe, onFocus: o2[1] || (o2[1] = (...e3) => v(se) && v(se)(...e3)), onBlur: o2[2] || (o2[2] = (...e3) => v(re) && v(re)(...e3)) }), null, 16, q), [[k, J.value]]), e2.$slots.suffix || ee.value || oe.value ? (c(), d("span", A, [_(e2.$slots, "suffix"), ee.value ? (c(), b(j, { key: 0, icon: "close-box", class: "px-input__clear", onClick: ue, onMousedown: $(v(C), ["prevent"]) }, null, 8, ["onMousedown"])) : h("", true), oe.value && K.value ? (c(), b(j, { key: 1, icon: "eye", class: "px-input__password", onClick: ne })) : h("", true), oe.value && !K.value ? (c(), b(j, { key: 2, icon: "eye-closed", class: "px-input__password", onClick: ne })) : h("", true)])) : h("", true)], 512), e2.$slots.append ? (c(), d("div", S, [_(e2.$slots, "append")])) : h("", true)], 64)) : m((c(), d("textarea", w({ key: 1, class: "px-textarea__wrapper", ref_key: "textareaRef", ref: N, id: v(I)().value, disabled: W.value, readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, form: e2.form, "onUpdate:modelValue": o2[3] || (o2[3] = (e3) => J.value = e3) }, v(O), { onInput: te, onChange: pe, onFocus: o2[4] || (o2[4] = (...e3) => v(se) && v(se)(...e3)), onBlur: o2[5] || (o2[5] = (...e3) => v(re) && v(re)(...e3)) }), null, 16, D)), [[g, J.value]])], 6));
|
|
38
38
|
} }), G = l(E);
|
|
39
39
|
export {
|
|
40
40
|
G as P,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e, c as o, _ as t, w as l } from "./utils-
|
|
1
|
+
import { r as e, c as o, _ as t, w as l } from "./utils-BS5vsvlM.js";
|
|
2
2
|
import { defineComponent as r, computed as a, createElementBlock as i, openBlock as s, normalizeStyle as d, normalizeClass as n, renderSlot as c } from "vue";
|
|
3
3
|
const p = ["href", "target"], u = l(t(r({ name: "PxLink", __name: "Link", props: { type: {}, underline: { type: Boolean, default: true }, disabled: { type: Boolean }, href: {}, target: {}, color: {} }, emits: ["click"], setup(t2, { emit: l2 }) {
|
|
4
4
|
const r2 = t2, u2 = l2, k = { "text-color": "color", "hover-color": "dark" }, f = a((() => r2.color ? e(o(r2.color), "px-link", k) : {})), m = (e2) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { _ as e, w as n } from "./utils-
|
|
2
|
-
import { defineComponent as t, computed as o, createElementBlock as
|
|
3
|
-
import {
|
|
1
|
+
import { _ as e, w as n } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as t, computed as o, createElementBlock as a, openBlock as i, normalizeStyle as l, normalizeClass as r, createElementVNode as s, useCssVars as d, createBlock as c, Transition as u, withCtx as p, withDirectives as b, createCommentVNode as m, toDisplayString as f, vShow as v, nextTick as g, ref as x, reactive as y, createApp as k } from "vue";
|
|
3
|
+
import { a as L } from "./hooks-BqobYUzS.js";
|
|
4
4
|
import { i as _, d as $, r as A, u as I } from "./vendor-DXmGx29U.js";
|
|
5
5
|
const h = e(t({ name: "PxLoadingIndicator", __name: "LoadingIndicator", props: { variant: { default: "spinner" }, size: { default: "md" }, type: { default: "primary" }, color: {} }, setup(e2) {
|
|
6
6
|
const n2 = e2, t2 = o((() => n2.color ? { "--px-loading-indicator-color": n2.color } : {}));
|
|
7
|
-
return (e3, n3) => (
|
|
7
|
+
return (e3, n3) => (i(), a("span", { class: r(["px-loading-indicator", [`px-loading-indicator--${e3.variant}`, `px-loading-indicator--${e3.size}`, `px-loading-indicator--${e3.type}`]]), style: l(t2.value), role: "status", "aria-label": "Loading" }, n3[0] || (n3[0] = [s("span", { class: "px-loading-indicator__inner" }, null, -1)]), 6));
|
|
8
8
|
} }), [["__scopeId", "data-v-1435ecee"]]), z = { class: "px-loading__spinner" }, C = { key: 1, class: "px-loading-text" }, P = t({ name: "PxLoading", inheritAttrs: false, __name: "Loading", props: { visible: {}, background: {}, spinner: {}, text: {}, fullscreen: {}, lock: {}, beforeClose: { type: Function }, closed: { type: Function }, target: {}, body: { type: Boolean }, zIndex: {}, onAfterLeave: { type: Function } }, setup(e2) {
|
|
9
9
|
d(((e3) => ({ d4003bba: e3.background, b5c47826: e3.zIndex })));
|
|
10
10
|
const n2 = e2;
|
|
11
|
-
return (e3, t2) => (
|
|
11
|
+
return (e3, t2) => (i(), c(u, { name: "fade-in-linear", onAfterLeave: e3.onAfterLeave }, { default: p((() => [b(s("div", { class: r(["px-loading px-loading__mask", { "is-fullscreen": e3.fullscreen }]), role: "status", "aria-live": "polite" }, [s("div", z, [false !== n2.spinner ? (i(), c(h, { key: 0, variant: "spinner", size: "lg" })) : m("", true), e3.text ? (i(), a("p", C, f(e3.text), 1)) : m("", true)])], 2), [[v, n2.visible.value]])])), _: 1 }, 8, ["onAfterLeave"]));
|
|
12
12
|
} }), j = "px-loading-parent--relative", F = "px-loading-parent--hiden", N = "px-loading-numb", w = /* @__PURE__ */ new Map(), { nextZIndex: S } = L(3e3);
|
|
13
13
|
function T(e2 = document.body) {
|
|
14
14
|
e2.classList.remove(F);
|
|
@@ -30,10 +30,10 @@ function B(e2 = {}) {
|
|
|
30
30
|
})(n2 == null ? void 0 : n2.parent), w.has(t2)) return w.get(t2);
|
|
31
31
|
const o2 = (function(e3) {
|
|
32
32
|
const n3 = x(e3.visible), t3 = x(false), o3 = () => {
|
|
33
|
-
t3.value &&
|
|
34
|
-
},
|
|
33
|
+
t3.value && i2();
|
|
34
|
+
}, a2 = y({ ...e3, onAfterLeave: o3 }), i2 = () => {
|
|
35
35
|
var _a2, _b;
|
|
36
|
-
const e4 =
|
|
36
|
+
const e4 = a2.parent;
|
|
37
37
|
!(function(e5 = document.body) {
|
|
38
38
|
const n4 = V(e5);
|
|
39
39
|
if (n4) {
|
|
@@ -49,13 +49,13 @@ function B(e2 = {}) {
|
|
|
49
49
|
}), 1), w.delete(e4 ?? document.body), (_b = (_a2 = s2.$el) == null ? void 0 : _a2.parentNode) == null ? void 0 : _b.removeChild(s2.$el), r2.unmount());
|
|
50
50
|
};
|
|
51
51
|
let l2;
|
|
52
|
-
const r2 = k(P, { ...
|
|
52
|
+
const r2 = k(P, { ...a2, zIndex: a2.fullscreen ? S() : void 0, visible: n3 }), s2 = r2.mount(document.createElement("div"));
|
|
53
53
|
return { get $el() {
|
|
54
54
|
return s2.$el;
|
|
55
55
|
}, vm: s2, close: () => {
|
|
56
56
|
var _a2;
|
|
57
57
|
e3.beforeClose && !e3.beforeClose() || (t3.value = true, clearTimeout(l2), l2 = A(o3), n3.value = false, (_a2 = e3.closed) == null ? void 0 : _a2.call(e3));
|
|
58
|
-
}, visible: n3, setText: (e4) =>
|
|
58
|
+
}, visible: n3, setText: (e4) => a2.text = e4 };
|
|
59
59
|
})({ ...n2, closed: () => {
|
|
60
60
|
var _a2;
|
|
61
61
|
(_a2 = n2.closed) == null ? void 0 : _a2.call(n2), n2.fullscreen && (q = null);
|
|
@@ -70,8 +70,8 @@ function B(e2 = {}) {
|
|
|
70
70
|
}
|
|
71
71
|
const E = Symbol("loading");
|
|
72
72
|
function M(e2, n2) {
|
|
73
|
-
const t2 = (n3) => e2.getAttribute(`px-loading-${n3}`), o2 = (e3) => n2.modifiers[e3],
|
|
74
|
-
e2[E] = { options:
|
|
73
|
+
const t2 = (n3) => e2.getAttribute(`px-loading-${n3}`), o2 = (e3) => n2.modifiers[e3], a2 = o2("fullscreen"), i2 = { text: t2("text"), spinner: t2("spinner"), background: t2("background"), target: a2 ? void 0 : e2, body: o2("body"), lock: o2("lock"), fullscreen: a2 };
|
|
74
|
+
e2[E] = { options: i2, instance: B(i2) };
|
|
75
75
|
}
|
|
76
76
|
const Z = { mounted(e2, n2) {
|
|
77
77
|
n2.value && M(e2, n2);
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { t as e, e as o, R as t, f as s, h as n, i as a } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as l, ref as i, computed as r, watch as c, onMounted as u, onBeforeUnmount as p, createBlock as d, openBlock as f, Transition as m, withCtx as g, withDirectives as y, createElementVNode as v, normalizeStyle as x, normalizeClass as b, createVNode as h, createElementBlock as B, createCommentVNode as _, renderSlot as C, unref as w, withModifiers as k, vShow as I, shallowReactive as T, isVNode as P, h as $, render as O, reactive as M, nextTick as z, createTextVNode as A, toDisplayString as E, resolveDynamicComponent as L, withKeys as V, Fragment as j } from "vue";
|
|
3
|
+
import { f as D, a as N, u as R, g as S, h as H, i as K, b as Z } from "./hooks-BqobYUzS.js";
|
|
4
|
+
import { P as U } from "./Icon-BLDDdSU-.js";
|
|
5
|
+
import { v as q, u as F, f as G, d as J, w as Q, g as W, x as X, i as Y, y as ee, z as oe, A as te, B as se } from "./vendor-DXmGx29U.js";
|
|
6
|
+
import { b as ne } from "./Button-BJHtN7gh.js";
|
|
7
|
+
import { _ as ae } from "./Input-C5HuVehE.js";
|
|
8
|
+
import { P as le } from "./Overlay-CpvMhnuU.js";
|
|
9
|
+
const ie = ["aria-live"], re = { class: "px-message__content" }, ce = { key: 0, class: "px-message__close" }, ue = l({ name: "PxMessage", __name: "Message", props: { id: {}, message: {}, duration: { default: 3e3 }, showClose: { type: Boolean }, center: { type: Boolean }, type: { default: "info" }, offset: { default: 10 }, zIndex: {}, transitionName: { default: "fade-up" }, plain: { type: Boolean }, ghost: { type: Boolean }, icon: {}, showTimer: { type: Boolean, default: true }, onDestroy: {} }, setup(s2, { expose: n2 }) {
|
|
10
|
+
const a2 = s2, l2 = i(false), T2 = i(), P2 = i(0), { topOffset: $2, bottomOffset: O2 } = D({ getLastBottomOffset: q(ve, a2), offset: a2.offset, boxHeight: P2 }), M2 = r((() => a2.icon ?? e.get(a2.type) ?? "circle-info")), z2 = r((() => ({ top: o($2.value), zIndex: a2.zIndex })));
|
|
11
|
+
let A2;
|
|
12
|
+
function E2() {
|
|
13
|
+
0 !== a2.duration && (A2 = F(V2, a2.duration));
|
|
14
|
+
}
|
|
15
|
+
function L2() {
|
|
16
|
+
clearTimeout(A2);
|
|
17
|
+
}
|
|
18
|
+
function V2() {
|
|
19
|
+
L2(), l2.value = false;
|
|
20
|
+
}
|
|
21
|
+
return c(l2, ((e2) => {
|
|
22
|
+
e2 || (P2.value = -a2.offset);
|
|
23
|
+
})), u((() => {
|
|
24
|
+
l2.value = true, E2();
|
|
25
|
+
})), p((() => L2())), n2({ close: V2, bottomOffset: O2 }), (e2, o2) => (f(), d(m, { name: e2.transitionName, onEnter: o2[0] || (o2[0] = (e3) => P2.value = T2.value.getBoundingClientRect().height), onAfterLeave: o2[1] || (o2[1] = (o3) => !l2.value && e2.onDestroy()) }, { default: g((() => [y(v("div", { ref_key: "messageRef", ref: T2, class: b(["px-message", { [`px-message--${e2.type}`]: e2.type, "is-close": e2.showClose, "text-center": e2.center, "is-plain": e2.plain, "is-ghost": e2.ghost }]), style: x(z2.value), role: "alert", "aria-live": "danger" === e2.type || "warning" === e2.type ? "assertive" : "polite", onMouseenter: L2, onMouseleave: E2 }, [h(U, { class: "px-message__icon", icon: M2.value }, null, 8, ["icon"]), v("div", re, [C(e2.$slots, "default", {}, (() => [e2.message ? (f(), d(w(t), { key: 0, vNode: e2.message }, null, 8, ["vNode"])) : _("", true)]))]), e2.showClose ? (f(), B("div", ce, [h(U, { icon: "close", onClick: k(V2, ["stop"]) })])) : _("", true), e2.showTimer && e2.duration > 0 ? (f(), B("div", { key: 1, class: "px-message__timer", style: x({ animationDuration: `${e2.duration}ms` }) }, null, 4)) : _("", true)], 46, ie), [[I, l2.value]])])), _: 3 }, 8, ["name"]));
|
|
26
|
+
} }), pe = ["info", "success", "warning", "danger", "error"], de = T([]), { nextZIndex: fe } = N(), me = n((() => de.length ? de[de.length - 1] : void 0)), ge = { type: "info", duration: 3e3, offset: 10, transitionName: "fade-up" }, ye = (e2) => {
|
|
27
|
+
const o2 = !e2 || P(e2) || J(e2) ? { message: e2 } : e2;
|
|
28
|
+
return { ...ge, ...o2 };
|
|
29
|
+
};
|
|
30
|
+
function ve() {
|
|
31
|
+
const e2 = Q(de, { id: this.id });
|
|
32
|
+
return e2 <= 0 ? 0 : W(de, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
|
|
33
|
+
}
|
|
34
|
+
const xe = (e2 = {}) => {
|
|
35
|
+
const o2 = ye(e2), t2 = (!e2 || P(e2) || J(e2) ? {} : e2).max;
|
|
36
|
+
return t2 && t2 > 0 && s(de, t2), ((e3) => {
|
|
37
|
+
const o3 = R().value, t3 = document.createElement("div"), s2 = { ...e3, id: o3, zIndex: fe(), onDestroy: () => {
|
|
38
|
+
const e4 = Q(de, { id: o3 });
|
|
39
|
+
-1 !== e4 && (de.splice(e4, 1), O(null, t3), me.unregister());
|
|
40
|
+
} }, n2 = $(ue, s2);
|
|
41
|
+
O(n2, t3), document.body.appendChild(t3.firstElementChild);
|
|
42
|
+
const a2 = n2.component, l2 = { close: () => a2.exposed.close() }, i2 = { props: s2, id: o3, vm: a2, vnode: n2, handler: l2 };
|
|
43
|
+
return de.push(i2), me.register(), i2;
|
|
44
|
+
})(o2).handler;
|
|
45
|
+
};
|
|
46
|
+
G(pe, ((e2) => {
|
|
47
|
+
X(xe, e2, ((o2) => {
|
|
48
|
+
const t2 = ye(o2);
|
|
49
|
+
return xe({ ...t2, type: e2 });
|
|
50
|
+
}));
|
|
51
|
+
})), xe.closeAll = function(e2) {
|
|
52
|
+
G(de, ((o2) => {
|
|
53
|
+
e2 ? o2.props.type === e2 && o2.handler.close() : o2.handler.close();
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
const be = a(xe, "$message"), he = { class: "px-message-box__content" }, Be = { key: 1, class: "px-message-box__message" }, _e = { class: "px-message-box__input" }, Ce = { key: 0, class: "px-message-box__error" }, we = { class: "px-message-box__footer" }, ke = l({ name: "PxMessageBox", inheritAttrs: false, __name: "MessageBox", props: { visible: {}, doClose: {}, doAction: {}, destroy: {}, title: {}, message: {}, type: {}, boxType: { default: "" }, icon: {}, callback: {}, showClose: { type: Boolean, default: true }, showInput: { type: Boolean }, showCancelButton: { type: Boolean }, showConfirmButton: { type: Boolean, default: true }, cancelButtonText: {}, confirmButtonText: {}, cancelButtonLoading: { type: Boolean }, confirmButtonLoading: { type: Boolean }, cancelButtonDisabled: { type: Boolean }, confirmButtonDisabled: { type: Boolean }, cancelButtonType: {}, confirmButtonType: { default: "primary" }, roundButton: { type: Boolean, default: false }, center: { type: Boolean }, lockScroll: { type: Boolean, default: true }, closeOnClickModal: { type: Boolean, default: true }, inputPlaceholder: {}, inputValue: { default: "" }, inputType: {}, buttonSize: {}, beforeClose: {}, customClass: {}, customStyle: {}, width: {}, closeOnPressEscape: { type: Boolean, default: true }, inputSchema: {}, inputErrorMessage: {}, distinguishCancelAndClose: { type: Boolean, default: true }, overlayClass: {}, closeOnHashChange: { type: Boolean, default: true }, draggable: { type: Boolean, default: false }, footer: {} }, setup(o2) {
|
|
57
|
+
const s2 = o2, n2 = S(), { doAction: a2 } = s2, { nextZIndex: l2 } = N(), u2 = i(), p2 = i(), T2 = i(), P2 = i(), $2 = R(), O2 = `msgbox-title-${R().value}`, D2 = M({ ...s2, zIndex: l2() }), q2 = r((() => {
|
|
58
|
+
var _a;
|
|
59
|
+
return ((_a = s2.visible) == null ? void 0 : _a.value) ?? false;
|
|
60
|
+
})), F2 = r((() => !!D2.message)), G2 = r((() => D2.icon ?? e.get(D2.type ?? ""))), J2 = r((() => ({ ...D2.customStyle, ...D2.width ? { "--px-message-box-width": "number" == typeof D2.width ? `${D2.width}px` : D2.width } : {} }))), Q2 = i(""), { activate: W2, deactivate: X2 } = H(u2), { reset: oe2 } = K(r((() => D2.draggable ? u2.value : void 0)), r((() => D2.draggable ? p2.value : void 0)), { constrainToViewport: true });
|
|
61
|
+
function te2() {
|
|
62
|
+
s2.closeOnClickModal && re2();
|
|
63
|
+
}
|
|
64
|
+
function se2(e2) {
|
|
65
|
+
if ("textarea" !== D2.inputType) return e2.preventDefault(), ie2("confirm");
|
|
66
|
+
}
|
|
67
|
+
function ie2(e2) {
|
|
68
|
+
if ("confirm" !== e2 || !D2.showInput || (function() {
|
|
69
|
+
var _a;
|
|
70
|
+
if (!D2.inputSchema) return true;
|
|
71
|
+
const e3 = D2.inputSchema.safeParse(D2.inputValue ?? "");
|
|
72
|
+
return e3.success ? (Q2.value = "", true) : (Q2.value = D2.inputErrorMessage ?? ((_a = e3.error.issues[0]) == null ? void 0 : _a.message) ?? n2.value.t("messagebox.error"), false);
|
|
73
|
+
})()) if (ee(s2.beforeClose)) {
|
|
74
|
+
const o3 = "confirm" === e2 ? "confirmButtonLoading" : "cancel" === e2 ? "cancelButtonLoading" : void 0;
|
|
75
|
+
let t2;
|
|
76
|
+
o3 && (D2[o3] = true);
|
|
77
|
+
try {
|
|
78
|
+
t2 = s2.beforeClose(e2, D2, (() => {
|
|
79
|
+
o3 && (D2[o3] = false), a2(e2, D2.inputValue);
|
|
80
|
+
}));
|
|
81
|
+
} catch {
|
|
82
|
+
return void (o3 && (D2[o3] = false));
|
|
83
|
+
}
|
|
84
|
+
t2 instanceof Promise && t2.catch((() => {
|
|
85
|
+
o3 && (D2[o3] = false);
|
|
86
|
+
}));
|
|
87
|
+
} else a2(e2, D2.inputValue);
|
|
88
|
+
}
|
|
89
|
+
function re2() {
|
|
90
|
+
ie2(false === D2.distinguishCancelAndClose ? "cancel" : "close");
|
|
91
|
+
}
|
|
92
|
+
return c((() => {
|
|
93
|
+
var _a;
|
|
94
|
+
return (_a = s2.visible) == null ? void 0 : _a.value;
|
|
95
|
+
}), ((e2) => {
|
|
96
|
+
e2 ? (D2.zIndex = l2(), oe2(), z((() => {
|
|
97
|
+
var _a, _b, _c;
|
|
98
|
+
"prompt" === s2.boxType ? (_a = T2.value) == null ? void 0 : _a.focus() : (_c = (_b = P2.value) == null ? void 0 : _b.$el) == null ? void 0 : _c.focus(), W2();
|
|
99
|
+
}))) : (X2(), Q2.value = "");
|
|
100
|
+
})), Z(document, "keydown", ((e2) => {
|
|
101
|
+
D2.closeOnPressEscape && q2.value && "Escape" === e2.key && re2();
|
|
102
|
+
})), Z(window, "hashchange", (() => {
|
|
103
|
+
D2.closeOnHashChange && q2.value && re2();
|
|
104
|
+
})), (e2, o3) => (f(), d(m, { name: "fade-in-linear", onAfterLeave: e2.destroy }, { default: g((() => [y(h(le, { "z-index": D2.zIndex, "overlay-class": D2.overlayClass, mask: "" }, { default: g((() => [v("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": O2, class: "px-overlay-message-box", onClick: te2 }, [v("div", { ref_key: "rootRef", ref: u2, class: b(["px-message-box", { "is-center": D2.center, "is-draggable": D2.draggable }, D2.type ? `px-message-box--${D2.type}` : "", D2.customClass]), style: x(J2.value), onClick: o3[5] || (o3[5] = k((() => {
|
|
105
|
+
}), ["stop"])) }, [w(Y)(D2.title) ? _("", true) : (f(), B("div", { key: 0, ref_key: "headerRef", ref: p2, class: "px-message-box__header" }, [v("div", { class: "px-message-box__title", id: O2 }, [G2.value && D2.center ? (f(), d(U, { key: 0, class: b({ [`px-icon-${D2.type}`]: D2.type }), icon: G2.value }, null, 8, ["class", "icon"])) : _("", true), A(" " + E(D2.title), 1)]), e2.showClose ? (f(), B("button", { key: 0, class: "px-message-box__header-btn", onClick: k(re2, ["stop"]) }, [h(U, { icon: "close" })])) : _("", true)], 512)), v("div", he, [G2.value && !D2.center && F2.value ? (f(), d(U, { key: 0, class: b({ [`px-icon-${D2.type}`]: D2.type }), icon: G2.value }, null, 8, ["class", "icon"])) : _("", true), F2.value ? (f(), B("div", Be, [C(e2.$slots, "default", {}, (() => [(f(), d(L(D2.showInput ? "label" : "p"), { for: D2.showInput ? w($2) : void 0 }, { default: g((() => [A(E(D2.message), 1)])), _: 1 }, 8, ["for"]))]))])) : _("", true)]), y(v("div", _e, [h(ae, { modelValue: D2.inputValue, "onUpdate:modelValue": o3[0] || (o3[0] = (e3) => D2.inputValue = e3), ref_key: "inputRef", ref: T2, placeholder: D2.inputPlaceholder, type: D2.inputType, onKeyup: V(se2, ["enter"]) }, null, 8, ["modelValue", "placeholder", "type"]), Q2.value ? (f(), B("div", Ce, E(Q2.value), 1)) : _("", true)], 512), [[I, D2.showInput]]), v("div", we, [D2.footer ? (f(), d(w(t), { key: 0, vNode: D2.footer }, null, 8, ["vNode"])) : (f(), B(j, { key: 1 }, [D2.showCancelButton ? (f(), d(ne, { key: 0, class: "px-message-box__footer-btn px-message-box__cancel-btn", type: D2.cancelButtonType, round: D2.roundButton, loading: D2.cancelButtonLoading, onClick: o3[1] || (o3[1] = (e3) => ie2("cancel")), onKeydown: o3[2] || (o3[2] = V(k(((e3) => ie2("cancel")), ["prevent"]), ["enter"])) }, { default: g((() => [A(E(D2.cancelButtonText || w(n2).t("messagebox.cancel")), 1)])), _: 1 }, 8, ["type", "round", "loading"])) : _("", true), y(h(ne, { ref_key: "confirmBtnRef", ref: P2, class: "px-message-box__footer-btn px-message-box__confirm-btn", type: D2.confirmButtonType ?? "primary", round: D2.roundButton, loading: D2.confirmButtonLoading, onClick: o3[3] || (o3[3] = (e3) => ie2("confirm")), onKeydown: o3[4] || (o3[4] = V(k(((e3) => ie2("confirm")), ["prevent"]), ["enter"])) }, { default: g((() => [A(E(D2.confirmButtonText || w(n2).t("messagebox.confirm")), 1)])), _: 1 }, 8, ["type", "round", "loading"]), [[I, D2.showConfirmButton]])], 64))])], 6)])])), _: 3 }, 8, ["z-index", "overlay-class"]), [[I, q2.value]])])), _: 3 }, 8, ["onAfterLeave"]));
|
|
106
|
+
} }), Ie = /* @__PURE__ */ new Map();
|
|
107
|
+
function Te(e2) {
|
|
108
|
+
let o2;
|
|
109
|
+
J(e2) || P(e2) ? e2 = { message: e2 } : o2 = e2.callback;
|
|
110
|
+
const t2 = new Promise(((t3, s2) => {
|
|
111
|
+
const n2 = (function(e3) {
|
|
112
|
+
const o3 = document.createElement("div"), t4 = (function(e4, o4) {
|
|
113
|
+
const t5 = i(false), s4 = ee(e4 == null ? void 0 : e4.message) || P(e4 == null ? void 0 : e4.message), n3 = h(ke, { ...e4, visible: t5 }, s4 ? { default: (a2 = e4.message, ee(a2) ? a2 : () => a2) } : void 0);
|
|
114
|
+
var a2;
|
|
115
|
+
return O(n3, o4), document.body.appendChild(o4.firstElementChild), n3.component;
|
|
116
|
+
})({ ...e3, doClose: () => {
|
|
117
|
+
s3.visible.value = false;
|
|
118
|
+
}, doAction: (o4, t5) => {
|
|
119
|
+
const n3 = Ie.get(s3);
|
|
120
|
+
let a2;
|
|
121
|
+
z((() => s3.doClose())), a2 = e3.showInput ? { value: t5, action: o4 } : o4, e3.callback ? e3.callback(a2) : "cancel" !== o4 && "close" !== o4 ? n3 == null ? void 0 : n3.resolve(a2) : n3 == null ? void 0 : n3.reject(o4);
|
|
122
|
+
}, destroy: () => {
|
|
123
|
+
O(null, o3), Ie.delete(s3);
|
|
124
|
+
} }, o3), s3 = t4 == null ? void 0 : t4.proxy;
|
|
125
|
+
return s3.visible.value = true, s3;
|
|
126
|
+
})(e2);
|
|
127
|
+
Ie.set(n2, { options: e2, callback: o2, resolve: t3, reject: s2 });
|
|
128
|
+
}));
|
|
129
|
+
return t2.catch((() => {
|
|
130
|
+
})), t2;
|
|
131
|
+
}
|
|
132
|
+
const Pe = { alert: { closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } };
|
|
133
|
+
G(["alert", "confirm", "prompt"], ((e2) => {
|
|
134
|
+
return X(Te, e2, (o2 = e2, (e3, t2, s2) => {
|
|
135
|
+
let n2 = "";
|
|
136
|
+
return te(t2) ? (s2 = t2, n2 = "") : n2 = se(t2) ? "" : t2, Te(oe({ title: n2, message: e3, type: "", boxType: o2, ...Pe[o2] }, s2));
|
|
137
|
+
}));
|
|
138
|
+
var o2;
|
|
139
|
+
})), X(Te, "close", (() => {
|
|
140
|
+
Ie.forEach(((e2, o2) => {
|
|
141
|
+
o2.doClose();
|
|
142
|
+
})), Ie.clear();
|
|
143
|
+
}));
|
|
144
|
+
const $e = Te;
|
|
145
|
+
X($e, "install", ((e2) => {
|
|
146
|
+
e2.config.globalProperties.$msgbox = Te, e2.config.globalProperties.$messagebox = Te, e2.config.globalProperties.$alert = Te.alert, e2.config.globalProperties.$confirm = Te.confirm, e2.config.globalProperties.$prompt = Te.prompt;
|
|
147
|
+
}));
|
|
148
|
+
export {
|
|
149
|
+
be as P,
|
|
150
|
+
$e as a,
|
|
151
|
+
pe as m
|
|
152
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { t, e as o, R as e, _ as n, f as i, h as s, i as a } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as l, ref as r, computed as c, onMounted as p, onBeforeUnmount as f, createBlock as d, openBlock as u, Transition as m, withCtx as h, withDirectives as v, createElementVNode as g, normalizeStyle as x, normalizeClass as y, createCommentVNode as _, createElementBlock as C, toDisplayString as w, renderSlot as k, unref as b, createVNode as I, withModifiers as N, vShow as z, isVNode as B, h as E, render as O, shallowReactive as $ } from "vue";
|
|
3
|
+
import { f as j, a as D, u as T } from "./hooks-BqobYUzS.js";
|
|
4
|
+
import { P as M } from "./Icon-BLDDdSU-.js";
|
|
5
|
+
import { v as P, u as R, f as A, d as L, w as W, g as H, x as Z } from "./vendor-DXmGx29U.js";
|
|
6
|
+
const q = ["aria-live"], F = { class: "px-notification__text" }, G = { class: "px-notification__title" }, J = { class: "px-notification__content" }, K = { key: 1, class: "px-notification__close" }, Q = n(l({ 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: {}, plain: { type: Boolean }, ghost: { type: Boolean }, showTimer: { type: Boolean, default: true }, onClick: {}, onClose: {}, onDestroy: {} }, setup(n2, { expose: i2 }) {
|
|
7
|
+
const s2 = n2, a2 = r(false), l2 = r(), B2 = r(0), { topOffset: E2, bottomOffset: O2 } = j({ getLastBottomOffset: P(it, s2), offset: s2.offset, boxHeight: B2 }), $2 = c((() => s2.icon ?? t.get(s2.type) ?? "circle-info")), D2 = c((() => s2.position.endsWith("right") ? "right" : "left")), T2 = c((() => s2.position.startsWith("top") ? "top" : "bottom")), A2 = c((() => ({ [T2.value]: o(E2.value), zIndex: s2.zIndex })));
|
|
8
|
+
let L2;
|
|
9
|
+
function W2() {
|
|
10
|
+
0 !== s2.duration && (L2 = R(Z2, s2.duration));
|
|
11
|
+
}
|
|
12
|
+
function H2() {
|
|
13
|
+
clearTimeout(L2);
|
|
14
|
+
}
|
|
15
|
+
function Z2() {
|
|
16
|
+
H2(), a2.value = false;
|
|
17
|
+
}
|
|
18
|
+
return p((() => {
|
|
19
|
+
a2.value = true, W2();
|
|
20
|
+
})), f((() => H2())), i2({ bottomOffset: O2, close: Z2 }), (t2, o2) => (u(), d(m, { name: `px-notification-${t2.transitionName}`, onAfterLeave: o2[1] || (o2[1] = (o3) => !a2.value && t2.onDestroy()), onEnter: o2[2] || (o2[2] = (t3) => B2.value = l2.value.getBoundingClientRect().height) }, { default: h((() => [v(g("div", { ref_key: "notifyRef", ref: l2, class: y(["px-notification", { [`px-notification--${t2.type}`]: t2.type, [D2.value]: true, "show-close": t2.showClose, "is-plain": t2.plain, "is-ghost": t2.ghost }]), style: x(A2.value), role: "alert", "aria-live": "danger" === t2.type || "warning" === t2.type ? "assertive" : "polite", onClick: o2[0] || (o2[0] = (...o3) => t2.onClick && t2.onClick(...o3)), onMouseenter: H2, onMouseleave: W2 }, [$2.value ? (u(), d(M, { key: 0, icon: $2.value, class: "px-notification__icon" }, null, 8, ["icon"])) : _("", true), g("div", F, [g("div", G, w(t2.title), 1), g("div", J, [k(t2.$slots, "default", {}, (() => [t2.message ? (u(), d(b(e), { key: 0, vNode: t2.message }, null, 8, ["vNode"])) : _("", true)]), true)])]), t2.showClose ? (u(), C("div", K, [I(M, { icon: "close", onClick: N(Z2, ["stop"]) })])) : _("", true), t2.showTimer && t2.duration > 0 ? (u(), C("div", { key: 2, class: "px-notification__timer", style: x({ animationDuration: `${t2.duration}ms` }) }, null, 4)) : _("", true)], 46, q), [[z, a2.value]])])), _: 3 }, 8, ["name"]));
|
|
21
|
+
} }), [["__scopeId", "data-v-4191d2e2"]]), S = ["info", "success", "warning", "danger", "error"], U = ["top-right", "top-left", "bottom-right", "bottom-left"], V = /* @__PURE__ */ new Map();
|
|
22
|
+
A(U, ((t2) => {
|
|
23
|
+
V.set(t2, $([]));
|
|
24
|
+
}));
|
|
25
|
+
const { nextZIndex: X } = D(), Y = s((() => {
|
|
26
|
+
let t2;
|
|
27
|
+
return V.forEach(((o2) => {
|
|
28
|
+
if (o2.length) {
|
|
29
|
+
const e2 = o2[o2.length - 1];
|
|
30
|
+
(!t2 || e2.props.zIndex > t2.props.zIndex) && (t2 = e2);
|
|
31
|
+
}
|
|
32
|
+
})), t2;
|
|
33
|
+
})), tt = { title: "", type: "info", duration: 3e3, offset: 20, position: "top-right", transitionName: "fade", showClose: true, showTimer: true }, ot = (t2) => {
|
|
34
|
+
const o2 = !t2 || B(t2) || L(t2) ? { message: t2 } : t2;
|
|
35
|
+
return { ...tt, ...o2 };
|
|
36
|
+
}, et = (t2) => V.get(t2), nt = (t2 = {}) => {
|
|
37
|
+
const o2 = ot(t2), e2 = (!t2 || B(t2) || L(t2) ? {} : t2).max, n2 = o2.position || "top-right";
|
|
38
|
+
return e2 && e2 > 0 && i(et(n2), e2), ((t3) => {
|
|
39
|
+
const o3 = T().value, e3 = document.createElement("div"), n3 = et(t3.position || "top-right"), i2 = { ...t3, id: o3, zIndex: X(), onDestroy: () => {
|
|
40
|
+
const t4 = W(n3, { id: o3 });
|
|
41
|
+
-1 !== t4 && (n3.splice(t4, 1), O(null, e3), Y.unregister());
|
|
42
|
+
} }, s2 = E(Q, i2);
|
|
43
|
+
O(s2, e3), document.body.appendChild(e3.firstElementChild);
|
|
44
|
+
const a2 = s2.component, l2 = { close: () => a2.exposed.close() }, r2 = { props: i2, id: o3, vm: a2, vnode: s2, handler: l2 };
|
|
45
|
+
return n3.push(r2), Y.register(), r2;
|
|
46
|
+
})(o2).handler;
|
|
47
|
+
};
|
|
48
|
+
function it() {
|
|
49
|
+
const t2 = et(this.position || "top-right"), o2 = W(t2, { id: this.id });
|
|
50
|
+
return o2 <= 0 ? 0 : H(t2, [o2 - 1, "vm", "exposed", "bottomOffset", "value"]);
|
|
51
|
+
}
|
|
52
|
+
A(S, ((t2) => {
|
|
53
|
+
Z(nt, t2, ((o2) => {
|
|
54
|
+
const e2 = ot(o2);
|
|
55
|
+
return nt({ ...e2, type: t2 });
|
|
56
|
+
}));
|
|
57
|
+
})), nt.closeAll = function(t2) {
|
|
58
|
+
V.forEach(((o2) => {
|
|
59
|
+
A(o2, ((o3) => {
|
|
60
|
+
t2 ? o3.props.type === t2 && o3.handler.close() : o3.handler.close();
|
|
61
|
+
}));
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
const st = a(nt, "$notify");
|
|
65
|
+
export {
|
|
66
|
+
st as P,
|
|
67
|
+
U as a,
|
|
68
|
+
S as n
|
|
69
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as e, createElementBlock as s, openBlock as o, normalizeStyle as t, normalizeClass as a, renderSlot as l } from "vue";
|
|
2
|
-
import { _ as i } from "./utils-
|
|
2
|
+
import { _ as i } from "./utils-BS5vsvlM.js";
|
|
3
3
|
const d = i(e({ name: "PxOverlay", __name: "Overlay", props: { mask: { type: Boolean, default: true }, zIndex: {}, overlayClass: {} }, emits: ["click"], setup(e2, { emit: i2 }) {
|
|
4
4
|
const d2 = i2;
|
|
5
5
|
function n(e3) {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { w as e } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as t, ref as n, computed as r, watch as a, createElementBlock as l, openBlock as i, normalizeStyle as o, createElementVNode as u } from "vue";
|
|
3
|
+
const s = ["src"], h = e(t({ name: "PxPixelate", __name: "Pixelate", props: { src: {}, pixelSize: { default: 8 }, width: {}, height: {}, grayscale: { type: Boolean, default: false }, palette: {}, background: { default: "#FFFFFF" } }, emits: ["rendered", "error"], setup(e2, { expose: t2, emit: h2 }) {
|
|
4
|
+
const c = e2, g = h2, d = n(), f = n(), p = n(false), m = r((() => {
|
|
5
|
+
const e3 = {};
|
|
6
|
+
return null != c.width && (e3.width = "number" == typeof c.width ? `${c.width}px` : c.width), null != c.height && (e3.height = "number" == typeof c.height ? `${c.height}px` : c.height), e3;
|
|
7
|
+
})), y = r((() => {
|
|
8
|
+
const e3 = { "image-rendering": "pixelated" };
|
|
9
|
+
return null != c.width && (e3.width = "100%"), null != c.height && (e3.height = "100%"), e3;
|
|
10
|
+
}));
|
|
11
|
+
function v(e3, t3, n2, r2) {
|
|
12
|
+
let a2 = 1 / 0, l2 = r2[0];
|
|
13
|
+
for (const i2 of r2) {
|
|
14
|
+
const r3 = (e3 - i2[0]) ** 2 + (t3 - i2[1]) ** 2 + (n2 - i2[2]) ** 2;
|
|
15
|
+
r3 < a2 && (a2 = r3, l2 = i2);
|
|
16
|
+
}
|
|
17
|
+
return l2;
|
|
18
|
+
}
|
|
19
|
+
function x() {
|
|
20
|
+
const e3 = d.value, t3 = f.value;
|
|
21
|
+
if (!e3 || !t3 || !p.value) return;
|
|
22
|
+
const n2 = e3.getContext("2d");
|
|
23
|
+
if (!n2) return;
|
|
24
|
+
const r2 = t3.naturalWidth, a2 = t3.naturalHeight;
|
|
25
|
+
e3.width = r2, e3.height = a2, n2.fillStyle = c.background, n2.fillRect(0, 0, r2, a2), n2.drawImage(t3, 0, 0, r2, a2);
|
|
26
|
+
const l2 = n2.getImageData(0, 0, r2, a2).data, i2 = Math.max(1, Math.round(c.pixelSize)), o2 = c.palette ? c.palette.map(((e4) => "string" == typeof e4 ? (function(e5) {
|
|
27
|
+
const t4 = e5.replace("#", "");
|
|
28
|
+
return [parseInt(t4.substring(0, 2), 16), parseInt(t4.substring(2, 4), 16), parseInt(t4.substring(4, 6), 16)];
|
|
29
|
+
})(e4) : e4)) : null;
|
|
30
|
+
n2.fillStyle = c.background, n2.fillRect(0, 0, r2, a2);
|
|
31
|
+
for (let e4 = 0; e4 < a2; e4 += i2) for (let t4 = 0; t4 < r2; t4 += i2) {
|
|
32
|
+
const u2 = Math.min(i2, r2 - t4), s2 = Math.min(i2, a2 - e4);
|
|
33
|
+
let h3 = 0, g2 = 0, d2 = 0, f2 = 0;
|
|
34
|
+
for (let n3 = 0; n3 < s2; n3++) for (let a3 = 0; a3 < u2; a3++) {
|
|
35
|
+
const i3 = 4 * ((e4 + n3) * r2 + (t4 + a3));
|
|
36
|
+
h3 += l2[i3], g2 += l2[i3 + 1], d2 += l2[i3 + 2], f2++;
|
|
37
|
+
}
|
|
38
|
+
let p2 = Math.round(h3 / f2), m2 = Math.round(g2 / f2), y2 = Math.round(d2 / f2);
|
|
39
|
+
c.grayscale && (p2 = m2 = y2 = Math.round(0.299 * p2 + 0.587 * m2 + 0.114 * y2)), o2 && ([p2, m2, y2] = v(p2, m2, y2, o2)), n2.fillStyle = `rgb(${p2},${m2},${y2})`, n2.fillRect(t4, e4, u2, s2);
|
|
40
|
+
}
|
|
41
|
+
g("rendered");
|
|
42
|
+
}
|
|
43
|
+
function w() {
|
|
44
|
+
p.value = true, x();
|
|
45
|
+
}
|
|
46
|
+
function b(e3) {
|
|
47
|
+
g("error", e3);
|
|
48
|
+
}
|
|
49
|
+
return a((() => [c.pixelSize, c.grayscale, c.palette, c.background]), (() => {
|
|
50
|
+
p.value && x();
|
|
51
|
+
})), a((() => c.src), (() => {
|
|
52
|
+
p.value = false;
|
|
53
|
+
})), t2({ render: function() {
|
|
54
|
+
x();
|
|
55
|
+
}, canvasRef: d, originRef: f, getSize: function() {
|
|
56
|
+
const e3 = d.value;
|
|
57
|
+
return { width: (e3 == null ? void 0 : e3.width) ?? 0, height: (e3 == null ? void 0 : e3.height) ?? 0 };
|
|
58
|
+
}, getImageData: function() {
|
|
59
|
+
const e3 = d.value;
|
|
60
|
+
if (!e3 || !p.value) return null;
|
|
61
|
+
const t3 = e3.getContext("2d");
|
|
62
|
+
return t3 ? t3.getImageData(0, 0, e3.width, e3.height) : null;
|
|
63
|
+
} }), (e3, t3) => (i(), l("div", { class: "px-pixelate", style: o(m.value) }, [u("canvas", { ref_key: "canvasRef", ref: d, style: o(y.value) }, null, 4), u("img", { ref_key: "originRef", ref: f, src: e3.src, style: { display: "none" }, crossorigin: "anonymous", onLoad: w, onError: b }, null, 40, s)], 4));
|
|
64
|
+
} }));
|
|
65
|
+
export {
|
|
66
|
+
h as P
|
|
67
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { e as o, _ as e, w as t } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as c, ref as i, computed as n, createBlock as l, openBlock as r, withCtx as a, renderSlot as f, createElementVNode as p, normalizeStyle as s, createCommentVNode as m, createTextVNode as d, toDisplayString as u, createVNode as _, unref as h } from "vue";
|
|
3
|
+
import { g as y } from "./hooks-BqobYUzS.js";
|
|
4
|
+
import { b as B } from "./Button-BJHtN7gh.js";
|
|
5
|
+
import { P as x } from "./Icon-BLDDdSU-.js";
|
|
6
|
+
import { T as w } from "./Tooltip-J3ji6weH.js";
|
|
7
|
+
const T = { class: "px-popconfirm__main" }, v = { class: "px-popconfirm__action" }, b = t(e(c({ name: "PxPopconfirm", __name: "Popconfirm", props: { title: { default: "" }, confirmButtonText: {}, cancelButtonText: {}, confirmButtonType: { default: "primary" }, cancelButtonType: {}, icon: { default: "question-circle" }, iconColor: { default: "#f90" }, hideIcon: { type: Boolean }, hideAfter: { default: 200 }, width: { default: 150 }, disabled: { type: Boolean }, placement: {}, showArrow: { type: Boolean }, effect: {} }, emits: ["confirm", "cancel"], setup(e2, { emit: t2 }) {
|
|
8
|
+
const c2 = e2, b2 = t2, k = y(), j = i(), P = n((() => ({ width: o(c2.width) })));
|
|
9
|
+
function g() {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = j.value) == null ? void 0 : _a.hide();
|
|
12
|
+
}
|
|
13
|
+
function A(o2) {
|
|
14
|
+
b2("confirm", o2), g();
|
|
15
|
+
}
|
|
16
|
+
function C(o2) {
|
|
17
|
+
b2("cancel", o2), g();
|
|
18
|
+
}
|
|
19
|
+
return (o2, e3) => (r(), l(w, { ref_key: "tooltipRef", ref: j, trigger: "click", "hide-timeout": o2.hideAfter, disabled: o2.disabled, placement: o2.placement, "show-arrow": o2.showArrow, effect: o2.effect }, { content: a((() => [p("div", { class: "px-popconfirm", role: "alertdialog", style: s(P.value) }, [p("div", T, [!o2.hideIcon && o2.icon ? (r(), l(x, { key: 0, icon: o2.icon, color: o2.iconColor }, null, 8, ["icon", "color"])) : m("", true), d(" " + u(o2.title), 1)]), p("div", v, [_(B, { class: "px-popconfirm__cancel", size: "small", type: o2.cancelButtonType, onClick: C }, { default: a((() => [d(u(o2.cancelButtonText || h(k).t("popconfirm.cancelButtonText")), 1)])), _: 1 }, 8, ["type"]), _(B, { class: "px-popconfirm__confirm", size: "small", type: o2.confirmButtonType, onClick: A }, { default: a((() => [d(u(o2.confirmButtonText || h(k).t("popconfirm.confirmButtonText")), 1)])), _: 1 }, 8, ["type"])])], 4)])), default: a((() => [f(o2.$slots, "reference", {}, (() => [f(o2.$slots, "default", {}, void 0, true)]), true)])), _: 3 }, 8, ["hide-timeout", "disabled", "placement", "show-arrow", "effect"]));
|
|
20
|
+
} }), [["__scopeId", "data-v-68772965"]]));
|
|
21
|
+
export {
|
|
22
|
+
b as P
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { r as e, c as t, w as r } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as a, computed as s, createElementBlock as o, openBlock as l, normalizeClass as i, createElementVNode as p, createCommentVNode as n, normalizeStyle as d, toDisplayString as u } from "vue";
|
|
3
|
+
const x = { "fill-color": "color", "fill-border-color": "dark", "track-border-color": "dark", "text-color": "dark", "shadow-color": "dark" }, c = ["aria-valuenow"], v = { class: "px-progress__track" }, m = { key: 0, class: "px-progress__inner-text" }, f = { key: 0, class: "px-progress__text" }, g = r(a({ name: "PxProgress", __name: "Progress", props: { percentage: { default: 0 }, type: { default: "primary" }, size: { default: "default" }, status: {}, variant: { default: "solid" }, stripedFlow: { type: Boolean, default: false }, indeterminate: { type: Boolean, default: false }, strokeWidth: { default: 0 }, showText: { type: Boolean, default: true }, textInside: { type: Boolean, default: false }, color: {}, format: {} }, setup(r2, { expose: a2 }) {
|
|
4
|
+
const g2 = r2, h = s((() => Math.max(0, Math.min(100, g2.percentage)))), k = s((() => g2.color ? "function" == typeof g2.color ? g2.color(h.value) : g2.color : "")), w = s((() => k.value ? e(t(k.value), "px-progress", x) : {})), y = s((() => {
|
|
5
|
+
const e2 = { ...w.value };
|
|
6
|
+
return g2.indeterminate || (e2.width = `${h.value}%`), g2.strokeWidth && (e2["--px-progress-height"] = `${g2.strokeWidth}px`), e2;
|
|
7
|
+
})), _ = s((() => g2.format ? g2.format(h.value) : `${h.value}%`)), $ = s((() => g2.status ? `px-progress--${g2.status}` : ""));
|
|
8
|
+
return a2({ clampedPercentage: h }), (e2, t2) => (l(), o("div", { class: i(["px-progress", [`px-progress--${e2.type}`, `px-progress--${e2.size}`, $.value, { [`px-progress--${e2.variant}`]: "solid" !== e2.variant, "is-striped-flow": e2.stripedFlow && "striped" === e2.variant, "is-indeterminate": e2.indeterminate, "is-text-inside": e2.textInside }]]), role: "progressbar", "aria-valuenow": e2.indeterminate ? void 0 : h.value, "aria-valuemin": 0, "aria-valuemax": 100 }, [p("div", v, [p("div", { class: "px-progress__fill", style: d(y.value) }, [e2.showText && e2.textInside && !e2.indeterminate ? (l(), o("span", m, u(_.value), 1)) : n("", true)], 4)]), !e2.showText || e2.textInside || e2.indeterminate ? n("", true) : (l(), o("span", f, u(_.value), 1))], 10, c));
|
|
9
|
+
} }));
|
|
10
|
+
export {
|
|
11
|
+
g as P
|
|
12
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { c as e, r as a, w as l } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as o, useSlots as d, inject as r, ref as u, computed as i, createElementBlock as t, openBlock as s, normalizeStyle as n, normalizeClass as c, createElementVNode as p, createCommentVNode as m, unref as v, renderSlot as f, createTextVNode as h, toDisplayString as b, provide as y } from "vue";
|
|
3
|
+
import { u as x } from "./hooks-BqobYUzS.js";
|
|
4
|
+
import { u as _ } from "./Form-7lZt5ehf.js";
|
|
5
|
+
const g = Symbol("radioGroupContext"), k = { "checked-color": "color", "checked-border-color": "dark" }, V = { class: "px-radio__input" }, z = ["aria-checked", "id", "name", "disabled", "checked"], B = { key: 0, class: "px-radio__label" }, R = o({ name: "PxRadio", inheritAttrs: false, __name: "Radio", props: { modelValue: { type: [String, Number, Boolean] }, value: { type: [String, Number, Boolean] }, disabled: { type: Boolean, default: false }, size: {}, type: {}, color: {}, label: {}, name: {}, id: {} }, emits: ["update:modelValue", "change"], setup(l2, { expose: o2, emit: y2 }) {
|
|
6
|
+
const R2 = l2, S2 = y2, $2 = d(), j2 = r(g, void 0), G2 = !!j2, { formItem: N } = _(), P = u(), C = x().value, E = i((() => G2 ? j2.modelValue.value === R2.value : R2.modelValue === R2.value)), I = i((() => !!(j2 == null ? void 0 : j2.disabled.value) || R2.disabled)), w = i((() => R2.size ?? (j2 == null ? void 0 : j2.size.value))), A = i((() => R2.type ?? (j2 == null ? void 0 : j2.type.value))), F = i((() => R2.color ?? (j2 == null ? void 0 : j2.color.value))), q = i((() => R2.name ?? (j2 == null ? void 0 : j2.name.value))), D = i((() => {
|
|
7
|
+
const l3 = F.value;
|
|
8
|
+
if (!l3) return {};
|
|
9
|
+
const o3 = e(l3);
|
|
10
|
+
return a(o3, "px-radio", k);
|
|
11
|
+
}));
|
|
12
|
+
function H() {
|
|
13
|
+
if (I.value) return;
|
|
14
|
+
if (E.value) return;
|
|
15
|
+
const e2 = R2.value;
|
|
16
|
+
G2 ? j2.changeEvent(e2) : (S2("update:modelValue", e2), S2("change", e2)), G2 || (N == null ? void 0 : N.validate("change").catch(((e3) => {
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
return o2({ checked: E, focus: () => {
|
|
20
|
+
var _a;
|
|
21
|
+
(_a = P.value) == null ? void 0 : _a.focus();
|
|
22
|
+
} }), (e2, a2) => (s(), t("div", { class: c(["px-radio", { [`px-radio--${w.value}`]: w.value, [`px-radio--${A.value}`]: A.value, "is-disabled": I.value, "is-checked": E.value }]), style: n(D.value), onClick: H }, [p("span", V, [p("input", { ref_key: "inputRef", ref: P, class: "px-radio__original", type: "radio", "aria-checked": E.value, id: e2.id || v(C), name: q.value, disabled: I.value, checked: E.value }, null, 8, z), a2[0] || (a2[0] = p("span", { class: "px-radio__inner" }, [p("span", { class: "px-radio__dot" })], -1))]), e2.label || v($2).default ? (s(), t("span", B, [f(e2.$slots, "default", {}, (() => [h(b(e2.label), 1)]))])) : m("", true)], 6));
|
|
23
|
+
} }), S = { class: "px-radio-group", role: "radiogroup" }, $ = o({ name: "PxRadioGroup", __name: "RadioGroup", props: { modelValue: { type: [String, Number, Boolean] }, disabled: { type: Boolean, default: false }, size: {}, type: {}, color: {}, name: {} }, emits: ["update:modelValue", "change"], setup(e2, { emit: a2 }) {
|
|
24
|
+
const l2 = e2, o2 = a2, { formItem: d2 } = _();
|
|
25
|
+
return y(g, { modelValue: i((() => l2.modelValue)), disabled: i((() => l2.disabled)), size: i((() => l2.size)), type: i((() => l2.type)), color: i((() => l2.color)), name: i((() => l2.name)), changeEvent: (e3) => {
|
|
26
|
+
o2("update:modelValue", e3), o2("change", e3), d2 == null ? void 0 : d2.validate("change").catch(((e4) => {
|
|
27
|
+
}));
|
|
28
|
+
} }), (e3, a3) => (s(), t("div", S, [f(e3.$slots, "default")]));
|
|
29
|
+
} }), j = l(R), G = l($);
|
|
30
|
+
export {
|
|
31
|
+
j as P,
|
|
32
|
+
G as a
|
|
33
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as e, _ as l, c as t, r as a, w as o } from "./utils-
|
|
2
|
-
import { defineComponent as i, inject as s, computed as n, createElementBlock as u, openBlock as r, withModifiers as d, normalizeClass as c, renderSlot as p, createVNode as h, unref as v, useSlots as f, ref as m, reactive as g, watchEffect as b,
|
|
1
|
+
import { R as e, _ as l, c as t, r as a, w as o } from "./utils-BS5vsvlM.js";
|
|
2
|
+
import { defineComponent as i, inject as s, computed as n, createElementBlock as u, openBlock as r, withModifiers as d, normalizeClass as c, renderSlot as p, createVNode as h, unref as v, useSlots as f, ref as m, reactive as g, watchEffect as b, nextTick as x, watch as y, onMounted as _, onBeforeUnmount as V, provide as w, normalizeStyle as I, withCtx as M, createCommentVNode as k, createElementVNode as S, toDisplayString as O, Fragment as L, renderList as B, createBlock as D, mergeProps as z } from "vue";
|
|
3
3
|
import { C as $, D as j, g as C, b as F, s as R, e as E, E as H, F as P, f as W, y as q, q as A, i as N, G as T, c as U } from "./vendor-DXmGx29U.js";
|
|
4
|
-
import { g as G, u as K,
|
|
5
|
-
import { P as X } from "./Icon-
|
|
6
|
-
import { _ as Y } from "./Input-
|
|
7
|
-
import { T as Z } from "./Tooltip-
|
|
4
|
+
import { g as G, u as K, e as J, c as Q } from "./hooks-BqobYUzS.js";
|
|
5
|
+
import { P as X } from "./Icon-BLDDdSU-.js";
|
|
6
|
+
import { _ as Y } from "./Input-C5HuVehE.js";
|
|
7
|
+
import { T as Z } from "./Tooltip-J3ji6weH.js";
|
|
8
8
|
const ee = Symbol("selectContext"), le = { modifiers: [{ name: "offset", options: { offset: [0, 9] } }, { name: "sameWidth", enabled: true, fn: ({ state: e2 }) => {
|
|
9
9
|
e2.styles.popper.width = `${e2.rects.reference.width}px`;
|
|
10
10
|
}, phase: "beforeWrite", requires: ["computeStyles"] }] }, te = /* @__PURE__ */ new Set(["primary", "success", "warning", "danger", "info"]), ae = { default: { "item-selected-font-color": "color", "item-selected-bg-color": "light", "item-indicator-color": "color", "item-highlighted-border-color": "color" }, ghost: { "item-selected-font-color": "color", "item-selected-bg-color": "light", "item-indicator-color": "color", "item-highlighted-border-color": "color" } }, oe = ["aria-selected", "id"], ie = l(i({ name: "PxOption", __name: "Option", props: { value: {}, label: {}, disabled: { type: Boolean, default: false } }, setup(l2) {
|
|
@@ -49,7 +49,7 @@ const ee = Symbol("selectContext"), le = { modifiers: [{ name: "offset", options
|
|
|
49
49
|
})), n2;
|
|
50
50
|
})({ isDropdownVisible: he, controlVisible: Ee, selectStates: fe, highlightedLine: we, handleSelect: qe, hasData: ke, lastIndex: Se });
|
|
51
51
|
function Re(e3) {
|
|
52
|
-
$e.value &&
|
|
52
|
+
$e.value && x((() => je(new FocusEvent("focus", e3))));
|
|
53
53
|
}
|
|
54
54
|
function Ee(e3) {
|
|
55
55
|
var _a;
|
|
@@ -110,22 +110,22 @@ const ee = Symbol("selectContext"), le = { modifiers: [{ name: "offset", options
|
|
|
110
110
|
const e3 = We(s2.modelValue);
|
|
111
111
|
e3 && (fe.inputValue = e3.label, fe.selectedOption = e3);
|
|
112
112
|
}
|
|
113
|
-
return Q(oe2, ((e3) => Re(e3))),
|
|
113
|
+
return Q(oe2, ((e3) => Re(e3))), y((() => s2.options), ((e3) => {
|
|
114
114
|
pe.value = e3 ?? [];
|
|
115
|
-
})),
|
|
116
|
-
Ge();
|
|
117
|
-
})), y((() => {
|
|
115
|
+
})), y((() => Ie.value), ((e3) => Ae(e3)), { immediate: true }), y((() => s2.modelValue), (() => {
|
|
118
116
|
Ge();
|
|
119
117
|
})), _((() => {
|
|
118
|
+
Ge();
|
|
119
|
+
})), V((() => {
|
|
120
120
|
Be.cancel();
|
|
121
|
-
})),
|
|
121
|
+
})), w(ee, { handleSelect: qe, selectStates: fe, renderLabel: function(e3) {
|
|
122
122
|
return q(s2.renderLabel) ? s2.renderLabel(e3) : e3.label;
|
|
123
123
|
}, highlightedLine: we }), l2({ focus: () => {
|
|
124
124
|
var _a;
|
|
125
125
|
(_a = de2.value) == null ? void 0 : _a.focus();
|
|
126
126
|
}, blur: () => {
|
|
127
127
|
Re();
|
|
128
|
-
} }), (e3, l3) => (r(), u("div", { ref_key: "selectRef", ref: oe2, class: c(["px-select", { "is-disabled": me.value, "is-ghost": e3.ghost, [`px-select--${e3.size}`]: e3.size, [`px-select--${e3.color}`]: ge.value }]), style:
|
|
128
|
+
} }), (e3, l3) => (r(), u("div", { ref_key: "selectRef", ref: oe2, class: c(["px-select", { "is-disabled": me.value, "is-ghost": e3.ghost, [`px-select--${e3.size}`]: e3.size, [`px-select--${e3.color}`]: ge.value }]), style: I(xe.value), onClick: d(He, ["stop"]), onMouseenter: l3[2] || (l3[2] = (e4) => fe.mouseHover = true), onMouseleave: l3[3] || (l3[3] = (e4) => fe.mouseHover = false) }, [h(Z, { ref_key: "tooltipRef", ref: re2, placement: "bottom-start", "popper-options": v(le), onClickOutside: l3[1] || (l3[1] = (e4) => Ee(false)), manual: "" }, { default: M((() => [S("div", { ref_key: "inputWrapperRef", ref: ze }, [h(Y, { ref_key: "inputRef", ref: de2, modelValue: fe.inputValue, "onUpdate:modelValue": l3[0] || (l3[0] = (e4) => fe.inputValue = e4), id: v(De), disabled: me.value, ghost: e3.ghost, color: e3.color, size: e3.size, placeholder: e3.filterable ? Oe.value : e3.placeholder, readonly: !e3.filterable || !he.value, "aria-controls": `px-select-menu-${v(De)}`, "aria-activedescendant": we.value ? `select-item-${we.value.value}` : void 0, onFocus: v(Ce), onBlur: v(je), onInput: v(Be), onKeydown: Te }, { suffix: M((() => [Ve.value ? (r(), D(X, { key: 0, icon: "close-box", class: "px-input__clear", onClick: d(Pe, ["stop"]), onMousedown: d(v(A), ["prevent"]) }, null, 8, ["onMousedown"])) : (r(), D(X, { key: 1, class: c(["header-angle", { "is-active": he.value }]), icon: "chevron-down" }, null, 8, ["class"]))])), _: 1 }, 8, ["modelValue", "id", "disabled", "ghost", "color", "size", "placeholder", "readonly", "aria-controls", "aria-activedescendant", "onFocus", "onBlur", "onInput"])], 512)])), content: M((() => [fe.loading ? (r(), u("div", se, [h(X, { icon: "loader", spin: "" })])) : e3.filterable && Me.value ? (r(), u("div", ne, O(v(i2).t("select.noData")), 1)) : k("", true), S("ul", { class: "px-select__menu", role: "listbox", id: `px-select-menu-${v(De)}` }, [_e.value ? (r(true), u(L, { key: 1 }, B(ce.value, (([e4, l4]) => (r(), D(ie, z({ key: e4, ref_for: true }, l4), null, 16)))), 128)) : (r(true), u(L, { key: 0 }, B(pe.value, ((e4) => (r(), D(ie, z({ key: e4.value, ref_for: true }, e4), null, 16)))), 128))], 8, ue)])), _: 1 }, 8, ["popper-options"])], 38));
|
|
129
129
|
} }), [["__scopeId", "data-v-4d450d40"]])), de = o(ie);
|
|
130
130
|
export {
|
|
131
131
|
re as P,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as e, w as c } from "./utils-
|
|
1
|
+
import { c as e, w as c } from "./utils-BS5vsvlM.js";
|
|
2
2
|
import { defineComponent as i, computed as a, ref as t, onMounted as o, watch as l, createElementBlock as s, openBlock as n, normalizeStyle as r, normalizeClass as u, createElementVNode as v, withKeys as d, unref as p, createCommentVNode as h, toDisplayString as x, createBlock as m } from "vue";
|
|
3
|
-
import { u as f } from "./hooks-
|
|
4
|
-
import { P as w } from "./Icon-
|
|
3
|
+
import { u as f } from "./hooks-BqobYUzS.js";
|
|
4
|
+
import { P as w } from "./Icon-BLDDdSU-.js";
|
|
5
5
|
const k = ["aria-checked", "id", "name", "disabled", "checked"], _ = { class: "px-switch__core" }, y = { class: "px-switch__core-inner" }, b = { key: 0, class: "px-switch__core-inner-text" }, V = { class: "px-switch__core-action" }, C = c(i({ name: "PxSwitch", inheritAttrs: false, __name: "Switch", props: { modelValue: { type: [Boolean, String, Number] }, disabled: { type: Boolean }, activeText: {}, inactiveText: {}, activeValue: { type: [Boolean, String, Number], default: true }, inactiveValue: { type: [Boolean, String, Number], default: false }, name: {}, id: {}, size: {}, type: {}, activeColor: {}, inactiveColor: {}, activeIcon: {}, inactiveIcon: {} }, emits: ["update:modelValue", "change"], setup(c2, { expose: i2, emit: C2 }) {
|
|
6
6
|
const T = c2, g = C2, I = a((() => T.disabled)), S = t(T.modelValue), z = t(), B = f().value, j = a((() => S.value === T.activeValue)), N = a((() => j.value ? T.activeIcon : T.inactiveIcon)), P = a((() => {
|
|
7
7
|
const c3 = {};
|