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
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sakana-element",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A pixel-style Vue 3 component library, built with TypeScript and Vitest",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/umd/index.umd.cjs",
|
|
7
|
-
"module": "./dist/es/index.js",
|
|
8
|
-
"types": "./dist/types/core/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
],
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"types": "./dist/types/core/index.d.ts",
|
|
15
|
-
"import": "./dist/es/index.js",
|
|
16
|
-
"require": "./dist/umd/index.umd.cjs"
|
|
17
|
-
},
|
|
18
|
-
"./dist/index.css": "./dist/index.css",
|
|
19
|
-
"./dist/": {
|
|
20
|
-
"import": "./dist/",
|
|
21
|
-
"require": "./dist/"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"sideEffects": [
|
|
25
|
-
"./dist/index.css"
|
|
26
|
-
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "run-p build-es build-umd",
|
|
29
|
-
"build:watch": "run-p build-es:watch build-umd:watch",
|
|
30
|
-
"build-umd": "vite build --config build/vite.umd.config.ts",
|
|
31
|
-
"build-es": "vite build --config build/vite.es.config.ts",
|
|
32
|
-
"build-umd:watch": "vite build --watch --config build/vite.umd.config.ts",
|
|
33
|
-
"build-es:watch": "vite build --watch --config build/vite.es.config.ts"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "sakana-element",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "A pixel-style Vue 3 component library, built with TypeScript and Vitest",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/umd/index.umd.cjs",
|
|
7
|
+
"module": "./dist/es/index.js",
|
|
8
|
+
"types": "./dist/types/core/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/types/core/index.d.ts",
|
|
15
|
+
"import": "./dist/es/index.js",
|
|
16
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./dist/index.css": "./dist/index.css",
|
|
19
|
+
"./dist/": {
|
|
20
|
+
"import": "./dist/",
|
|
21
|
+
"require": "./dist/"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"sideEffects": [
|
|
25
|
+
"./dist/index.css"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "run-p build-es build-umd",
|
|
29
|
+
"build:watch": "run-p build-es:watch build-umd:watch",
|
|
30
|
+
"build-umd": "vite build --config build/vite.umd.config.ts",
|
|
31
|
+
"build-es": "vite build --config build/vite.es.config.ts",
|
|
32
|
+
"build-umd:watch": "vite build --watch --config build/vite.umd.config.ts",
|
|
33
|
+
"build-es:watch": "vite build --watch --config build/vite.es.config.ts"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [],
|
|
36
|
+
"author": "",
|
|
37
|
+
"license": "ISC",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/yu859/sakana-element.git"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/yu859/sakana-element#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/yu859/sakana-element/issues"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@popperjs/core": "^2.11.8"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
51
|
+
"@sakana-element/components": "workspace:*",
|
|
52
|
+
"terser": "^5.39.0",
|
|
53
|
+
"vite-plugin-compression2": "^1.3.3"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"vue": "^3.4.19",
|
|
57
|
+
"zod": "^3.0.0 || ^4.0.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { r as e, c as a, S as o, _ as s, w as t } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as d, computed as l, createElementBlock as r, openBlock as u, normalizeStyle as n, normalizeClass as p, renderSlot as i } from "vue";
|
|
3
|
-
const c = t(s(d({ name: "PxBadge", __name: "Badge", props: { type: { default: "primary" }, size: { default: "default" }, outline: { type: Boolean }, dash: { type: Boolean }, color: {}, round: { type: Boolean } }, setup(s2) {
|
|
4
|
-
const t2 = s2, d2 = l((() => {
|
|
5
|
-
if (!t2.color) return {};
|
|
6
|
-
const s3 = t2.outline ? "outline" : t2.dash ? "dash" : "default";
|
|
7
|
-
return e(a(t2.color), "px-badge", o[s3]);
|
|
8
|
-
}));
|
|
9
|
-
return (e2, a2) => (u(), r("span", { class: p(["px-badge", { [`px-badge--${e2.type}`]: e2.type, [`px-badge--${e2.size}`]: e2.size && "default" !== e2.size, "is-outline": e2.outline, "is-dash": e2.dash, "is-round": e2.round }]), style: n(d2.value) }, [i(e2.$slots, "default", {}, void 0, true)], 6));
|
|
10
|
-
} }), [["__scopeId", "data-v-c5a490ec"]]));
|
|
11
|
-
export {
|
|
12
|
-
c as P
|
|
13
|
-
};
|
package/dist/es/Card-BCBnlVi_.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { _ as a, w as e } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as s, useSlots as o, computed as r, createElementBlock as d, openBlock as t, normalizeClass as l, createCommentVNode as p, createElementVNode as c, unref as i, renderSlot as v } from "vue";
|
|
3
|
-
const h = { key: 0, class: "px-card__header" }, n = { class: "px-card__body" }, _ = { key: 1, class: "px-card__footer" }, x = e(a(s({ name: "PxCard", __name: "Card", props: { hoverable: { type: Boolean }, shadow: { type: [Boolean, String], default: "always" }, size: {} }, setup(a2) {
|
|
4
|
-
const e2 = a2, s2 = o(), x2 = r((() => {
|
|
5
|
-
const a3 = e2.shadow;
|
|
6
|
-
return true === a3 ? "px-card--shadow-always" : false === a3 ? "px-card--shadow-never" : `px-card--shadow-${a3}`;
|
|
7
|
-
}));
|
|
8
|
-
return (a3, e3) => (t(), d("div", { class: l(["px-card", [x2.value, { [`px-card--${a3.size}`]: a3.size, "is-hoverable": a3.hoverable }]]) }, [i(s2).header ? (t(), d("div", h, [v(a3.$slots, "header", {}, void 0, true)])) : p("", true), c("div", n, [v(a3.$slots, "default", {}, void 0, true)]), i(s2).footer ? (t(), d("div", _, [v(a3.$slots, "footer", {}, void 0, true)])) : p("", true)], 2));
|
|
9
|
-
} }), [["__scopeId", "data-v-1f65a210"]]));
|
|
10
|
-
export {
|
|
11
|
-
x as P
|
|
12
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { _ as e, w as a } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as l, ref as t, watchEffect as s, watch as o, provide as i, createElementBlock as d, openBlock as n, renderSlot as c, inject as p, computed as m, normalizeClass as r, createElementVNode as u, createVNode as v, createTextVNode as f, toDisplayString as h, Transition as _, mergeProps as x, toHandlers as g, unref as b, withCtx as y, withDirectives as C, vShow as I } from "vue";
|
|
3
|
-
import { P as $ } from "./Icon-DpJyuj7c.js";
|
|
4
|
-
const V = Symbol("collapseContext"), w = { class: "px-collapse" }, P = e(l({ name: "PxCollapse", __name: "Collapse", props: { modelValue: {}, accordion: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: a2 }) {
|
|
5
|
-
const l2 = e2, p2 = a2, m2 = t(l2.modelValue);
|
|
6
|
-
function r2(e3) {
|
|
7
|
-
m2.value = e3, p2("update:modelValue", e3), p2("change", e3);
|
|
8
|
-
}
|
|
9
|
-
return l2.accordion && m2.value.length > 1 && (m2.value = [m2.value[0]]), s((() => {
|
|
10
|
-
l2.accordion && m2.value.length;
|
|
11
|
-
})), o((() => l2.modelValue), ((e3) => r2(e3))), i(V, { activeNames: m2, handleItemClick: function(e3) {
|
|
12
|
-
let a3 = [...m2.value];
|
|
13
|
-
if (l2.accordion) return a3 = [a3[0] === e3 ? "" : e3], void r2(a3);
|
|
14
|
-
const t2 = a3.indexOf(e3);
|
|
15
|
-
t2 > -1 ? a3.splice(t2, 1) : a3.push(e3), r2(a3);
|
|
16
|
-
} }), (e3, a3) => (n(), d("div", w, [c(e3.$slots, "default", {}, void 0, true)]));
|
|
17
|
-
} }), [["__scopeId", "data-v-4f9f8081"]]), k = (e2) => e2.style.height = "0px", j = (e2) => e2.style.height = `${e2.scrollHeight}px`, B = (e2) => e2.style.height = "", E = (e2) => e2.style.overflow = "hidden", L = (e2) => e2.style.overflow = "", N = { beforeEnter(e2) {
|
|
18
|
-
k(e2), E(e2);
|
|
19
|
-
}, enter: (e2) => j(e2), afterEnter(e2) {
|
|
20
|
-
B(e2), L(e2);
|
|
21
|
-
}, beforeLeave(e2) {
|
|
22
|
-
j(e2), E(e2);
|
|
23
|
-
}, leave: (e2) => k(e2), afterLeave(e2) {
|
|
24
|
-
B(e2), L(e2);
|
|
25
|
-
} }, H = ["id"], O = { class: "px-collapse-item__title" }, S = { class: "px-collapse-item__wapper" }, q = ["id"], z = e(l({ name: "PxCollapseItem", __name: "CollapseItem", props: { name: {}, title: {}, disabled: { type: Boolean } }, setup(e2) {
|
|
26
|
-
const a2 = e2, l2 = p(V, void 0), t2 = m((() => {
|
|
27
|
-
var _a;
|
|
28
|
-
return (_a = l2 == null ? void 0 : l2.activeNames.value) == null ? void 0 : _a.includes(a2.name);
|
|
29
|
-
}));
|
|
30
|
-
function s2() {
|
|
31
|
-
a2.disabled || (l2 == null ? void 0 : l2.handleItemClick(a2.name));
|
|
32
|
-
}
|
|
33
|
-
return (e3, a3) => (n(), d("div", { class: r(["px-collapse-item", { "is-disabled": e3.disabled }]) }, [u("div", { class: r(["px-collapse-item__header", { "is-disabled": e3.disabled, "is-active": t2.value }]), id: `item-header-${e3.name}`, onClick: s2 }, [u("span", O, [c(e3.$slots, "title", {}, (() => [f(h(e3.title), 1)]), true)]), v($, { icon: "chevron-right", class: "header-angle" })], 10, H), v(_, x({ name: "slide" }, g(b(N))), { default: y((() => [C(u("div", S, [u("div", { class: "px-collapse-item__content", id: `item-content-${e3.name}` }, [c(e3.$slots, "default", {}, void 0, true)], 8, q)], 512), [[I, t2.value]])])), _: 3 }, 16)], 2));
|
|
34
|
-
} }), [["__scopeId", "data-v-9af3f092"]]), A = a(P), D = a(z);
|
|
35
|
-
export {
|
|
36
|
-
A as P,
|
|
37
|
-
D as a
|
|
38
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { w as e } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { ref as t, getCurrentInstance as a, unref as o, watch as r, provide as n, inject as l, computed as s, defineComponent as i, renderSlot as c } from "vue";
|
|
3
|
-
import { n as d, m as u, o as m } from "./vendor-DXmGx29U.js";
|
|
4
|
-
const p = { name: "en", el: { colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color." }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }, h = Symbol(), g = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
5
|
-
function v(e2, ...t2) {
|
|
6
|
-
return u(e2, ...t2, ((e3, t3, a2) => {
|
|
7
|
-
if (g.has(a2)) return e3;
|
|
8
|
-
}));
|
|
9
|
-
}
|
|
10
|
-
const f = t();
|
|
11
|
-
function w(e2, t2 = void 0) {
|
|
12
|
-
const o2 = a() ? l(h, f) : f;
|
|
13
|
-
return e2 ? s((() => {
|
|
14
|
-
var _a;
|
|
15
|
-
return ((_a = o2.value) == null ? void 0 : _a[e2]) ?? t2;
|
|
16
|
-
})) : o2;
|
|
17
|
-
}
|
|
18
|
-
const y = (e2) => {
|
|
19
|
-
var _a, _b, _c;
|
|
20
|
-
const t2 = (t3) => v(t3, (e2 == null ? void 0 : e2.extendsI18nMsg) ?? {});
|
|
21
|
-
return m((e2 == null ? void 0 : e2.locale) ? { locale: ((_a = e2.locale) == null ? void 0 : _a.name) || "en", messages: t2({ en: p.el, [(_b = e2.locale) == null ? void 0 : _b.name]: ((_c = e2.locale) == null ? void 0 : _c.el) ?? {} }) } : { locale: "en", messages: t2({ en: p.el }) });
|
|
22
|
-
};
|
|
23
|
-
function x(e2 = { locale: p }, l2, s2 = false) {
|
|
24
|
-
const i2 = a(), c2 = i2 ? w() : void 0, u2 = (l2 == null ? void 0 : l2.provide) ?? (i2 ? n : void 0);
|
|
25
|
-
if (!u2) return;
|
|
26
|
-
const m2 = t(o(e2));
|
|
27
|
-
r((() => e2), ((e3) => {
|
|
28
|
-
const t2 = o(e3);
|
|
29
|
-
if (!(c2 == null ? void 0 : c2.value)) return t2;
|
|
30
|
-
m2.value = v(c2.value, t2);
|
|
31
|
-
}), { deep: true });
|
|
32
|
-
const g2 = t(y(m2.value));
|
|
33
|
-
return r((() => m2.value), ((e3) => g2.value = y(e3)), { deep: true }), u2(h, m2), u2(d, g2), l2 && l2.use(g2.value), !s2 && f.value || (f.value = m2.value), m2;
|
|
34
|
-
}
|
|
35
|
-
const b = e(i({ name: "PxConfigProvider", __name: "ConfigProvider", props: { locale: {}, extendsI18nMsg: {} }, setup(e2) {
|
|
36
|
-
const t2 = x(e2);
|
|
37
|
-
return (e3, a2) => c(e3.$slots, "default", { config: o(t2) });
|
|
38
|
-
} }));
|
|
39
|
-
export {
|
|
40
|
-
p as E,
|
|
41
|
-
b as P,
|
|
42
|
-
x as p,
|
|
43
|
-
w as u
|
|
44
|
-
};
|
package/dist/es/Form-CGiTDSGI.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { defineComponent as e, reactive as r, toRefs as t, provide as a, createElementBlock as l, openBlock as s, renderSlot as o, useCssVars as i, computed as u, useSlots as d, inject as n, ref as p, onMounted as v, onUnmounted as c, normalizeStyle as m, normalizeClass as f, unref as h, createBlock as b, createCommentVNode as g, createElementVNode as y, resolveDynamicComponent as x, withCtx as _, createTextVNode as F, toDisplayString as q, nextTick as P } from "vue";
|
|
2
|
-
import { d as w, _ as k, w as j } from "./utils-bsCscZfS.js";
|
|
3
|
-
import { f as I, b as $, s as A, c as B, d as S, i as W, e as M, g as V, h as C, j as O, k as D, l as E, p as R } from "./vendor-DXmGx29U.js";
|
|
4
|
-
import { u as z } from "./hooks-CYdEHUVd.js";
|
|
5
|
-
import G from "async-validator";
|
|
6
|
-
const H = Symbol("formContext"), J = Symbol("formItemContext"), K = { class: "px-form" }, L = e({ name: "PxForm", __name: "Form", props: { model: {}, rules: {}, disabled: { type: Boolean }, labelWidth: {}, labelPosition: { default: "right" }, labelSuffix: {}, showMessage: { type: Boolean, default: true }, hideRequiredAsterisk: { type: Boolean, default: false }, requiredAsteriskPosition: { default: "left" } }, emits: ["validate"], setup(e2, { expose: i2, emit: u2 }) {
|
|
7
|
-
const d2 = u2, n2 = [], p2 = async (e3, r2) => {
|
|
8
|
-
try {
|
|
9
|
-
const t2 = await (async function(e4 = []) {
|
|
10
|
-
let r3 = {};
|
|
11
|
-
for (const t3 of e4) try {
|
|
12
|
-
await t3.validate("");
|
|
13
|
-
} catch (e5) {
|
|
14
|
-
r3 = { ...r3, ...e5 };
|
|
15
|
-
}
|
|
16
|
-
return !A(Object.keys(r3)) || Promise.reject(r3);
|
|
17
|
-
})(v2(n2, e3 ?? []));
|
|
18
|
-
return true === t2 && (r2 == null ? void 0 : r2(t2)), t2;
|
|
19
|
-
} catch (e4) {
|
|
20
|
-
if (e4 instanceof Error) throw e4;
|
|
21
|
-
const t2 = e4;
|
|
22
|
-
return r2 == null ? void 0 : r2(false, t2), Promise.reject(t2);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
function v2(e3, r2) {
|
|
26
|
-
return A(r2) ? $(e3, ((e4) => B(r2, e4.prop))) : e3;
|
|
27
|
-
}
|
|
28
|
-
const c2 = r({ ...t(e2), emits: d2, addField: (e3) => {
|
|
29
|
-
e3.prop && n2.push(e3);
|
|
30
|
-
}, removeField: (e3) => {
|
|
31
|
-
e3.prop && n2.splice(n2.indexOf(e3), 1);
|
|
32
|
-
} });
|
|
33
|
-
return a(H, c2), i2({ validate: async (e3) => p2([], e3), validateField: p2, resetFields: (e3) => {
|
|
34
|
-
I(v2(n2, e3 ?? []), ((e4) => e4.resetField()));
|
|
35
|
-
}, clearValidate: (e3) => {
|
|
36
|
-
I(v2(n2, e3 ?? []), ((e4) => e4.clearValidate()));
|
|
37
|
-
} }), (e3, r2) => (s(), l("form", K, [o(e3.$slots, "default")]));
|
|
38
|
-
} }), N = { key: 0, class: "px-form-item__error-msg" }, Q = k(e({ name: "PxFormItem", __name: "FormItem", props: { prop: {}, label: {}, for: {}, labelWidth: {}, disabled: { type: Boolean }, required: { type: Boolean, default: void 0 }, showMessage: { type: Boolean, default: true }, error: {}, rules: {} }, setup(e2, { expose: k2 }) {
|
|
39
|
-
i(((e3) => ({ f6756cfe: te.value })));
|
|
40
|
-
const j2 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), I2 = e2, K2 = d(), L2 = n(H), Q2 = z().value, T2 = p("init"), U2 = p(""), X2 = p([]), Y = (e3) => {
|
|
41
|
-
return e3 && I2.prop && !W(V(e3, I2.prop)) ? (r2 = I2.prop, (E(r2) ? r2 : r2.split(".")).some(((e4) => j2.has(e4))) ? (w("PxFormItem", `Prop path "${I2.prop}" contains a dangerous segment and was rejected.`), null) : V(e3, I2.prop)) : null;
|
|
42
|
-
var r2;
|
|
43
|
-
}, Z = u((() => !(!I2.label && !K2.label))), ee = u((() => I2.for || (X2.value.length ? X2.value[0] : ""))), re = u((() => `${I2.label ?? ""}${(L2 == null ? void 0 : L2.labelSuffix) ?? ""}`)), te = u((() => {
|
|
44
|
-
const e3 = (e4) => C(e4) ? `${e4}px` : O(e4, "px") ? e4 : `${e4}px`;
|
|
45
|
-
return I2.labelWidth ? e3(I2.labelWidth) : (L2 == null ? void 0 : L2.labelWidth) ? e3(L2 == null ? void 0 : L2.labelWidth) : "150px";
|
|
46
|
-
})), ae = u((() => (L2 == null ? void 0 : L2.labelPosition) ?? "right")), le = u((() => "top" === ae.value)), se = u((() => le.value ? { width: "100%", textAlign: "left", padding: "0 0 8px 0" } : { textAlign: "left" === ae.value ? "left" : "right" })), oe = u((() => (L2 == null ? void 0 : L2.disabled) || I2.disabled)), ie = u((() => {
|
|
47
|
-
const e3 = L2 == null ? void 0 : L2.model;
|
|
48
|
-
return Y(e3);
|
|
49
|
-
})), ue = u((() => I2.prop ? S(I2.prop) ? I2.prop : I2.prop.join(".") : "")), de = u((() => {
|
|
50
|
-
const { required: e3 } = I2, r2 = [];
|
|
51
|
-
I2.rules && r2.push(...I2.rules);
|
|
52
|
-
const t2 = L2 == null ? void 0 : L2.rules;
|
|
53
|
-
if (t2 && I2.prop && Y(t2) && r2.push(...r2), !W(e3)) {
|
|
54
|
-
const t3 = $(M(r2, ((e4, r3) => [e4, r3])), ((e4) => B(R(e4[0]), "required")));
|
|
55
|
-
if (A(t3)) for (const a2 of t3) {
|
|
56
|
-
const [t4, l2] = a2;
|
|
57
|
-
t4.required !== e3 && (r2[l2] = { ...t4, required: e3 });
|
|
58
|
-
}
|
|
59
|
-
else r2.push({ required: e3 });
|
|
60
|
-
}
|
|
61
|
-
return r2;
|
|
62
|
-
})), ne = u((() => W(I2.required) ? A($(de.value, ((e3) => e3.required))) > 0 : I2.required));
|
|
63
|
-
let pe = null, ve = false;
|
|
64
|
-
const ce = async (e3, r2) => {
|
|
65
|
-
if (ve || !I2.prop || oe.value) return false;
|
|
66
|
-
if (!T2.value) return r2 == null ? void 0 : r2(false), false;
|
|
67
|
-
const t2 = (function(e4) {
|
|
68
|
-
const r3 = de.value;
|
|
69
|
-
return r3 ? $(r3, ((r4) => !(r4 == null ? void 0 : r4.trigger) || !e4 || (E(r4.trigger) ? r4.trigger.includes(e4) : r4.trigger === e4))).map((({ trigger: e5, ...r4 }) => r4)) : [];
|
|
70
|
-
})(e3);
|
|
71
|
-
return A(t2) ? (T2.value = "validating", (async function(e4) {
|
|
72
|
-
const r3 = ue.value;
|
|
73
|
-
return new G({ [r3]: e4 }).validate({ [r3]: ie.value }, { firstFields: true }).then((() => (T2.value = "success", L2 == null ? void 0 : L2.emits("validate", I2, true, ""), true))).catch(((e5) => {
|
|
74
|
-
const { errors: r4 } = e5;
|
|
75
|
-
return T2.value = "error", U2.value = r4 && A(r4) > 0 ? r4[0].message ?? "" : "", L2 == null ? void 0 : L2.emits("validate", I2, false, U2.value), Promise.reject(e5);
|
|
76
|
-
}));
|
|
77
|
-
})(t2).then((() => (r2 == null ? void 0 : r2(true), true))).catch(((e4) => {
|
|
78
|
-
const { fields: t3 } = e4;
|
|
79
|
-
return r2 == null ? void 0 : r2(false, t3), Promise.reject(t3);
|
|
80
|
-
}))) : (r2 == null ? void 0 : r2(true), true);
|
|
81
|
-
}, me = () => {
|
|
82
|
-
const e3 = L2 == null ? void 0 : L2.model;
|
|
83
|
-
e3 && ue.value && !W(V(e3, ue.value)) && (ve = true, e3[ue.value] = D(pe)), P((() => fe()));
|
|
84
|
-
}, fe = () => {
|
|
85
|
-
T2.value = "init", U2.value = "", ve = false;
|
|
86
|
-
}, he = r({ ...t(I2), disabled: oe.value, validate: ce, resetField: me, clearValidate: fe, addInputId: (e3) => {
|
|
87
|
-
B(X2.value, e3) || X2.value.push(e3);
|
|
88
|
-
}, removeInputId: (e3) => {
|
|
89
|
-
X2.value = $(X2.value, ((r2) => r2 !== e3));
|
|
90
|
-
} });
|
|
91
|
-
return v((() => {
|
|
92
|
-
I2.prop && (L2 == null ? void 0 : L2.addField(he), pe = ie.value);
|
|
93
|
-
})), c((() => {
|
|
94
|
-
I2.prop && (L2 == null ? void 0 : L2.removeField(he));
|
|
95
|
-
})), a(J, he), k2({ validateMessage: U2, validateStatus: T2, validate: ce, resetField: me, clearValidate: fe }), (e3, r2) => {
|
|
96
|
-
var _a, _b, _c;
|
|
97
|
-
return s(), l("div", { class: f(["px-form-item", { "is-error": "error" === T2.value, "is-disabled": oe.value, "is-required": ne.value, "asterisk-left": "left" === ((_a = h(L2)) == null ? void 0 : _a.requiredAsteriskPosition), "asterisk-right": "right" === ((_b = h(L2)) == null ? void 0 : _b.requiredAsteriskPosition) }]), style: m(le.value ? { flexDirection: "column" } : {}) }, [Z.value ? (s(), b(x(ee.value ? "label" : "div"), { key: 0, class: "px-form-item__label", style: m(se.value), id: h(Q2), for: ee.value }, { default: _((() => [o(e3.$slots, "label", { label: re.value }, (() => [F(q(re.value), 1)]), true)])), _: 3 }, 8, ["style", "id", "for"])) : g("", true), y("div", { class: "px-form-item__content", style: m(le.value ? { width: "100%" } : {}) }, [o(e3.$slots, "default", { validate: ce }, void 0, true), "error" === T2.value ? (s(), l("div", N, [((_c = h(L2)) == null ? void 0 : _c.showMessage) && e3.showMessage ? o(e3.$slots, "error", { key: 0, error: U2.value }, (() => [F(q(U2.value), 1)]), true) : g("", true)])) : g("", true)], 4)], 6);
|
|
98
|
-
};
|
|
99
|
-
} }), [["__scopeId", "data-v-b1c8aebb"]]);
|
|
100
|
-
function T() {
|
|
101
|
-
return { form: n(H, void 0), formItem: n(J, void 0) };
|
|
102
|
-
}
|
|
103
|
-
const U = j(L), X = j(Q);
|
|
104
|
-
export {
|
|
105
|
-
U as P,
|
|
106
|
-
X as a,
|
|
107
|
-
T as u
|
|
108
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { defineComponent as e, useCssVars as n, computed as t, createBlock as o, openBlock as i, Transition as l, withCtx as r, withDirectives as s, createElementVNode as c, normalizeClass as d, createCommentVNode as u, createElementBlock as a, toDisplayString as b, vShow as p, nextTick as m, ref as f, reactive as v, createApp as g } from "vue";
|
|
2
|
-
import { d as y } from "./hooks-CYdEHUVd.js";
|
|
3
|
-
import { P as x } from "./Icon-DpJyuj7c.js";
|
|
4
|
-
import { d as k, i as L, r as A, u as $ } from "./vendor-DXmGx29U.js";
|
|
5
|
-
const I = { class: "px-loading__spinner" }, _ = { key: 1, class: "px-loading-text" }, h = e({ 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) {
|
|
6
|
-
n(((e3) => ({ c7e915b4: e3.background, 24995070: e3.zIndex })));
|
|
7
|
-
const m2 = e2, f2 = t((() => k(m2.spinner) ? m2.spinner : "spinner"));
|
|
8
|
-
return (e3, n2) => (i(), o(l, { name: "fade-in-linear", onAfterLeave: e3.onAfterLeave }, { default: r((() => [s(c("div", { class: d(["px-loading px-loading__mask", { "is-fullscreen": e3.fullscreen }]) }, [c("div", I, [false !== m2.spinner ? (i(), o(x, { key: 0, icon: f2.value, spin: "" }, null, 8, ["icon"])) : u("", true), e3.text ? (i(), a("p", _, b(e3.text), 1)) : u("", true)])], 2), [[p, m2.visible.value]])])), _: 1 }, 8, ["onAfterLeave"]));
|
|
9
|
-
} }), C = "px-loading-parent--relative", P = "px-loading-parent--hiden", j = "px-loading-numb", z = /* @__PURE__ */ new Map(), { nextZIndex: F } = y(3e3);
|
|
10
|
-
function N(e2 = document.body) {
|
|
11
|
-
e2.classList.remove(P);
|
|
12
|
-
}
|
|
13
|
-
function S(e2 = document.body) {
|
|
14
|
-
return e2.getAttribute(j);
|
|
15
|
-
}
|
|
16
|
-
let T = null;
|
|
17
|
-
function V(e2 = {}) {
|
|
18
|
-
var _a;
|
|
19
|
-
const n2 = (function(e3) {
|
|
20
|
-
let n3;
|
|
21
|
-
return n3 = k(e3.target) ? document.querySelector(e3.target) ?? document.body : e3.target || document.body, { parent: n3 === document.body || e3.body ? document.body : n3, background: e3.background ?? "rgba(0, 0, 0, 0.5)", spinner: e3.spinner, text: e3.text, fullscreen: n3 === document.body && (e3.fullscreen ?? true), lock: e3.lock ?? false, visible: e3.visible ?? true, target: n3 };
|
|
22
|
-
})(e2), t2 = n2.parent ?? document.body;
|
|
23
|
-
if (n2.fullscreen && !L(T)) return T;
|
|
24
|
-
if ((function(e3 = document.body) {
|
|
25
|
-
const n3 = S(e3) ?? "0";
|
|
26
|
-
e3.setAttribute(j, `${Number.parseInt(n3, 10) + 1}`);
|
|
27
|
-
})(n2 == null ? void 0 : n2.parent), z.has(t2)) return z.get(t2);
|
|
28
|
-
const o2 = (function(e3) {
|
|
29
|
-
const n3 = f(e3.visible), t3 = f(false), o3 = () => {
|
|
30
|
-
t3.value && l2();
|
|
31
|
-
}, i2 = v({ ...e3, onAfterLeave: o3 }), l2 = () => {
|
|
32
|
-
var _a2, _b;
|
|
33
|
-
const e4 = i2.parent;
|
|
34
|
-
!(function(e5 = document.body) {
|
|
35
|
-
const n4 = S(e5);
|
|
36
|
-
if (n4) {
|
|
37
|
-
const t4 = Number.parseInt(n4, 10) - 1;
|
|
38
|
-
0 === t4 ? (function(e6 = document.body) {
|
|
39
|
-
e6.removeAttribute(j);
|
|
40
|
-
})(e5) : e5.setAttribute(j, `${t4}`);
|
|
41
|
-
}
|
|
42
|
-
})(e4), S(e4) || ($((() => {
|
|
43
|
-
!(function(e5 = document.body) {
|
|
44
|
-
e5.classList.remove(C);
|
|
45
|
-
})(e4), N(e4);
|
|
46
|
-
}), 1), z.delete(e4 ?? document.body), (_b = (_a2 = c2.$el) == null ? void 0 : _a2.parentNode) == null ? void 0 : _b.removeChild(c2.$el), s2.unmount());
|
|
47
|
-
};
|
|
48
|
-
let r2;
|
|
49
|
-
const s2 = g(h, { ...i2, zIndex: i2.fullscreen ? F() : void 0, visible: n3 }), c2 = s2.mount(document.createElement("div"));
|
|
50
|
-
return { get $el() {
|
|
51
|
-
return c2.$el;
|
|
52
|
-
}, vm: c2, close: () => {
|
|
53
|
-
var _a2;
|
|
54
|
-
e3.beforeClose && !e3.beforeClose() || (t3.value = true, clearTimeout(r2), r2 = A(o3), n3.value = false, (_a2 = e3.closed) == null ? void 0 : _a2.call(e3));
|
|
55
|
-
}, visible: n3, setText: (e4) => i2.text = e4 };
|
|
56
|
-
})({ ...n2, closed: () => {
|
|
57
|
-
var _a2;
|
|
58
|
-
(_a2 = n2.closed) == null ? void 0 : _a2.call(n2), n2.fullscreen && (T = null);
|
|
59
|
-
} });
|
|
60
|
-
return (function(e3, n3 = document.body) {
|
|
61
|
-
e3.lock ? (function(e4 = document.body) {
|
|
62
|
-
e4.classList.add(P);
|
|
63
|
-
})(n3) : N(n3), (function(e4 = document.body) {
|
|
64
|
-
e4.classList.add(C);
|
|
65
|
-
})(n3);
|
|
66
|
-
})(e2, n2 == null ? void 0 : n2.parent), (_a = n2.parent) == null ? void 0 : _a.appendChild(o2.$el), m((() => o2.visible.value = !!n2.visible)), n2.fullscreen && (T = o2), z.set(t2, o2), o2;
|
|
67
|
-
}
|
|
68
|
-
const q = Symbol("loading");
|
|
69
|
-
function w(e2, n2) {
|
|
70
|
-
const t2 = (n3) => e2.getAttribute(`px-loading-${n3}`), o2 = (e3) => n2.modifiers[e3], i2 = o2("fullscreen"), l2 = { text: t2("text"), spinner: t2("spinner"), background: t2("background"), target: i2 ? void 0 : e2, body: o2("body"), lock: o2("lock"), fullscreen: i2 };
|
|
71
|
-
e2[q] = { options: l2, instance: V(l2) };
|
|
72
|
-
}
|
|
73
|
-
const B = { mounted(e2, n2) {
|
|
74
|
-
n2.value && w(e2, n2);
|
|
75
|
-
}, updated(e2, n2) {
|
|
76
|
-
var _a;
|
|
77
|
-
n2.oldValue !== n2.value && (!n2.value || n2.oldValue ? (_a = e2[q]) == null ? void 0 : _a.instance.close() : w(e2, n2));
|
|
78
|
-
}, unmounted(e2) {
|
|
79
|
-
var _a;
|
|
80
|
-
(_a = e2[q]) == null ? void 0 : _a.instance.close(), e2[q] = void 0;
|
|
81
|
-
} }, E = { name: "PxLoading", install(e2) {
|
|
82
|
-
e2.directive("loading", B), e2.config.globalProperties.$loading = V;
|
|
83
|
-
}, directive: B, service: V };
|
|
84
|
-
export {
|
|
85
|
-
V as L,
|
|
86
|
-
E as P,
|
|
87
|
-
B as v
|
|
88
|
-
};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { t as e, e as o, R as t, f as n } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as s, ref as a, computed as l, watch as c, onMounted as i, createBlock as r, openBlock as u, Transition as p, withCtx as d, withDirectives as f, createElementVNode as m, normalizeStyle as y, normalizeClass as g, createVNode as v, createElementBlock as x, createCommentVNode as b, renderSlot as h, unref as B, withModifiers as _, vShow as C, shallowReactive as k, isVNode as w, h as I, render as T, reactive as P, nextTick as z, createTextVNode as $, toDisplayString as M, resolveDynamicComponent as O, withKeys as j } from "vue";
|
|
3
|
-
import { e as A, f as L, d as V, u as E } from "./hooks-CYdEHUVd.js";
|
|
4
|
-
import { P as D } from "./Icon-DpJyuj7c.js";
|
|
5
|
-
import { v as R, u as N, f as K, d as S, w as Z, g as H, x as U, i as q, y as F, z as G, A as J, B as Q } from "./vendor-DXmGx29U.js";
|
|
6
|
-
import { b as W } from "./Button-fW_ZOLmT.js";
|
|
7
|
-
import { _ as X } from "./Input-DBPpvf0Y.js";
|
|
8
|
-
import { P as Y } from "./Overlay-BRDSWspM.js";
|
|
9
|
-
const ee = ["aria-live"], oe = { class: "px-message__content" }, te = { key: 0, class: "px-message__close" }, ne = s({ 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" }, onDestory: {} }, setup(n2, { expose: s2 }) {
|
|
10
|
-
const k2 = n2, w2 = a(false), I2 = a(), T2 = a(0), { topOffset: P2, bottomOffset: z2 } = A({ getLastBottomOffset: R(re, k2), offset: k2.offset, boxHeight: T2 }), $2 = l((() => e.get(k2.type) ?? "circle-info")), M2 = l((() => ({ top: o(P2.value), zIndex: k2.zIndex })));
|
|
11
|
-
let O2;
|
|
12
|
-
function j2() {
|
|
13
|
-
0 !== k2.duration && (O2 = N(E2, k2.duration));
|
|
14
|
-
}
|
|
15
|
-
function V2() {
|
|
16
|
-
clearTimeout(O2);
|
|
17
|
-
}
|
|
18
|
-
function E2() {
|
|
19
|
-
w2.value = false;
|
|
20
|
-
}
|
|
21
|
-
return c(w2, ((e2) => {
|
|
22
|
-
e2 || (T2.value = -k2.offset);
|
|
23
|
-
})), L(document, "keydown", ((e2) => {
|
|
24
|
-
const { code: o2 } = e2;
|
|
25
|
-
"Escape" === o2 && E2();
|
|
26
|
-
})), i((() => {
|
|
27
|
-
w2.value = true, j2();
|
|
28
|
-
})), s2({ close: E2, bottomOffset: z2 }), (e2, o2) => (u(), r(p, { name: e2.transitionName, onEnter: o2[0] || (o2[0] = (e3) => T2.value = I2.value.getBoundingClientRect().height), onAfterLeave: o2[1] || (o2[1] = (o3) => !w2.value && e2.onDestory()) }, { default: d((() => [f(m("div", { ref_key: "messageRef", ref: I2, class: g(["px-message", { [`px-message--${e2.type}`]: e2.type, "is-close": e2.showClose, "text-center": e2.center }]), style: y(M2.value), role: "alert", "aria-live": "danger" === e2.type || "warning" === e2.type ? "assertive" : "polite", onMouseenter: V2, onMouseleave: j2 }, [v(D, { class: "px-message__icon", icon: $2.value }, null, 8, ["icon"]), m("div", oe, [h(e2.$slots, "default", {}, (() => [e2.message ? (u(), r(B(t), { key: 0, vNode: e2.message }, null, 8, ["vNode"])) : b("", true)]))]), e2.showClose ? (u(), x("div", te, [v(D, { icon: "close", onClick: _(E2, ["stop"]) })])) : b("", true)], 46, ee), [[C, w2.value]])])), _: 3 }, 8, ["name"]));
|
|
29
|
-
} }), se = ["info", "success", "warning", "danger", "error"], ae = k([]), { nextZIndex: le } = V(), ce = { type: "info", duration: 3e3, offset: 10, transitionName: "fade-up" }, ie = (e2) => {
|
|
30
|
-
const o2 = !e2 || w(e2) || S(e2) ? { message: e2 } : e2;
|
|
31
|
-
return { ...ce, ...o2 };
|
|
32
|
-
};
|
|
33
|
-
function re() {
|
|
34
|
-
const e2 = Z(ae, { id: this.id });
|
|
35
|
-
return e2 <= 0 ? 0 : H(ae, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
|
|
36
|
-
}
|
|
37
|
-
const ue = (e2 = {}) => ((e3) => {
|
|
38
|
-
const o2 = E().value, t2 = document.createElement("div"), n2 = { ...e3, id: o2, zIndex: le(), onDestory: () => {
|
|
39
|
-
const e4 = Z(ae, { id: o2 });
|
|
40
|
-
-1 !== e4 && (ae.splice(e4, 1), T(null, t2));
|
|
41
|
-
} }, s2 = I(ne, n2);
|
|
42
|
-
T(s2, t2), document.body.appendChild(t2.firstElementChild);
|
|
43
|
-
const a2 = s2.component, l2 = { close: () => a2.exposed.close() }, c2 = { props: n2, id: o2, vm: a2, vnode: s2, handler: l2 };
|
|
44
|
-
return ae.push(c2), c2;
|
|
45
|
-
})(ie(e2)).handler;
|
|
46
|
-
K(se, ((e2) => {
|
|
47
|
-
U(ue, e2, ((o2) => {
|
|
48
|
-
const t2 = ie(o2);
|
|
49
|
-
return ue({ ...t2, type: e2 });
|
|
50
|
-
}));
|
|
51
|
-
})), ue.closeAll = function(e2) {
|
|
52
|
-
K(ae, ((o2) => {
|
|
53
|
-
e2 ? o2.props.type === e2 && o2.handler.close() : o2.handler.close();
|
|
54
|
-
}));
|
|
55
|
-
};
|
|
56
|
-
const pe = n(ue, "$message"), de = { class: "px-message-box__title" }, fe = { class: "px-message-box__content" }, me = { key: 1, class: "px-message-box__message" }, ye = { class: "px-message-box__input" }, ge = { class: "px-message-box__footer" }, ve = s({ 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: { default: "Cancel" }, confirmButtonText: { default: "Ok" }, 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: { default: "Please input..." }, inputValue: { default: "" }, inputType: {}, buttonSize: {}, beforeClose: {} }, setup(o2) {
|
|
57
|
-
const t2 = o2, { doAction: n2 } = t2, { nextZIndex: s2 } = V(), i2 = a(), y2 = a(), k2 = E(), w2 = P({ ...t2, zIndex: s2() }), I2 = l((() => !!w2.message)), T2 = l((() => w2.icon ?? e.get(w2.type ?? "")));
|
|
58
|
-
function A2() {
|
|
59
|
-
t2.closeOnClickModal && R2("close");
|
|
60
|
-
}
|
|
61
|
-
function L2(e2) {
|
|
62
|
-
if ("textarea" !== w2.inputType) return e2.preventDefault(), R2("confirm");
|
|
63
|
-
}
|
|
64
|
-
function R2(e2) {
|
|
65
|
-
F(t2.beforeClose) ? t2.beforeClose(e2, w2, (() => n2(e2, w2.inputValue))) : n2(e2, w2.inputValue);
|
|
66
|
-
}
|
|
67
|
-
function N2() {
|
|
68
|
-
R2("close");
|
|
69
|
-
}
|
|
70
|
-
return c((() => {
|
|
71
|
-
var _a;
|
|
72
|
-
return (_a = t2.visible) == null ? void 0 : _a.value;
|
|
73
|
-
}), ((e2) => {
|
|
74
|
-
e2 && (w2.zIndex = s2()), "prompt" === t2.boxType && e2 && z((() => {
|
|
75
|
-
var _a;
|
|
76
|
-
(_a = y2.value) == null ? void 0 : _a.focus();
|
|
77
|
-
}));
|
|
78
|
-
})), (e2, o3) => (u(), r(p, { name: "fade-in-linear", onAfterLeave: e2.destroy }, { default: d((() => [f(v(Y, { "z-index": w2.zIndex, mask: "" }, { default: d((() => [m("div", { role: "dialog", class: "px-overlay-message-box", onClick: A2 }, [m("div", { ref: "rootRef", class: g(["px-message-box", { "is-center": w2.center }]), onClick: o3[5] || (o3[5] = _((() => {
|
|
79
|
-
}), ["stop"])) }, [B(q)(w2.title) ? b("", true) : (u(), x("div", { key: 0, ref_key: "headerRef", ref: i2, class: g(["px-message-box__header", { "show-close": w2.showClose }]) }, [m("div", de, [T2.value && w2.center ? (u(), r(D, { key: 0, class: g({ [`px-icon-${w2.type}`]: w2.type }), icon: T2.value }, null, 8, ["class", "icon"])) : b("", true), $(" " + M(w2.title), 1)]), e2.showClose ? (u(), x("button", { key: 0, class: "px-message-box__header-btn", onClick: _(N2, ["stop"]) }, [v(D, { icon: "close" })])) : b("", true)], 2)), m("div", fe, [T2.value && !w2.center && I2.value ? (u(), r(D, { key: 0, class: g({ [`px-icon-${w2.type}`]: w2.type }), icon: T2.value }, null, 8, ["class", "icon"])) : b("", true), I2.value ? (u(), x("div", me, [h(e2.$slots, "default", {}, (() => [(u(), r(O(w2.showInput ? "label" : "p"), { for: w2.showInput ? B(k2) : void 0 }, { default: d((() => [$(M(w2.message), 1)])), _: 1 }, 8, ["for"]))]))])) : b("", true)]), f(m("div", ye, [v(X, { modelValue: w2.inputValue, "onUpdate:modelValue": o3[0] || (o3[0] = (e3) => w2.inputValue = e3), ref_key: "inputRef", ref: y2, placeholder: w2.inputPlaceholder, type: w2.inputType, onKeyup: j(L2, ["enter"]) }, null, 8, ["modelValue", "placeholder", "type"])], 512), [[C, w2.showInput]]), m("div", ge, [w2.showCancelButton ? (u(), r(W, { key: 0, class: "px-message-box__footer-btn px-message-box__cancel-btn", type: w2.cancelButtonType, round: w2.roundButton, loading: w2.cancelButtonLoading, onClick: o3[1] || (o3[1] = (e3) => R2("cancel")), onKeydown: o3[2] || (o3[2] = j(_(((e3) => R2("cancel")), ["prevent"]), ["enter"])) }, { default: d((() => [$(M(w2.cancelButtonText), 1)])), _: 1 }, 8, ["type", "round", "loading"])) : b("", true), f(v(W, { class: "px-message-box__footer-btn px-message-box__confirm-btn", type: w2.confirmButtonType ?? "primary", round: w2.roundButton, loading: w2.confirmButtonLoading, onClick: o3[3] || (o3[3] = (e3) => R2("confirm")), onKeydown: o3[4] || (o3[4] = j(_(((e3) => R2("confirm")), ["prevent"]), ["enter"])) }, { default: d((() => [$(M(w2.confirmButtonText), 1)])), _: 1 }, 8, ["type", "round", "loading"]), [[C, w2.showConfirmButton]])])], 2)])])), _: 3 }, 8, ["z-index"]), [[C, e2.visible.value]])])), _: 3 }, 8, ["onAfterLeave"]));
|
|
80
|
-
} }), xe = /* @__PURE__ */ new Map();
|
|
81
|
-
function be(e2) {
|
|
82
|
-
let o2;
|
|
83
|
-
return S(e2) || w(e2) ? e2 = { message: e2 } : o2 = e2.callback, new Promise(((t2, n2) => {
|
|
84
|
-
const s2 = (function(e3) {
|
|
85
|
-
const o3 = document.createElement("div"), t3 = (function(e4, o4) {
|
|
86
|
-
const t4 = a(false), n4 = F(e4 == null ? void 0 : e4.message) || w(e4 == null ? void 0 : e4.message), s3 = v(ve, { ...e4, visible: t4 }, n4 ? { default: (l2 = e4.message, F(l2) ? l2 : () => l2) } : void 0);
|
|
87
|
-
var l2;
|
|
88
|
-
return T(s3, o4), document.body.appendChild(o4.firstElementChild), s3.component;
|
|
89
|
-
})({ ...e3, doClose: () => {
|
|
90
|
-
n3.visible.value = false;
|
|
91
|
-
}, doAction: (o4, t4) => {
|
|
92
|
-
const s3 = xe.get(n3);
|
|
93
|
-
let a2;
|
|
94
|
-
z((() => n3.doClose())), a2 = e3.showInput ? { value: t4, action: o4 } : o4, e3.callback ? e3.callback(a2) : "cancel" !== o4 && "close" !== o4 ? s3 == null ? void 0 : s3.resolve(a2) : s3 == null ? void 0 : s3.reject(o4);
|
|
95
|
-
}, destroy: () => {
|
|
96
|
-
T(null, o3), xe.delete(n3);
|
|
97
|
-
} }, o3), n3 = t3 == null ? void 0 : t3.proxy;
|
|
98
|
-
return n3.visible.value = true, n3;
|
|
99
|
-
})(e2);
|
|
100
|
-
xe.set(s2, { options: e2, callback: o2, resolve: t2, reject: n2 });
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
const he = { alert: { closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } };
|
|
104
|
-
K(["alert", "confirm", "prompt"], ((e2) => {
|
|
105
|
-
return U(be, e2, (o2 = e2, (e3, t2, n2) => {
|
|
106
|
-
let s2 = "";
|
|
107
|
-
return J(t2) ? (n2 = t2, s2 = "") : s2 = Q(t2) ? "" : t2, be(G({ title: s2, message: e3, type: "", boxType: o2, ...he[o2] }, n2));
|
|
108
|
-
}));
|
|
109
|
-
var o2;
|
|
110
|
-
})), U(be, "close", (() => {
|
|
111
|
-
xe.forEach(((e2, o2) => {
|
|
112
|
-
o2.doClose();
|
|
113
|
-
})), xe.clear();
|
|
114
|
-
}));
|
|
115
|
-
const Be = be;
|
|
116
|
-
U(Be, "install", ((e2) => {
|
|
117
|
-
e2.config.globalProperties.$msgbox = be, e2.config.globalProperties.$messagebox = be, e2.config.globalProperties.$alert = be.alert, e2.config.globalProperties.$confirm = be.confirm, e2.config.globalProperties.$prompt = be.prompt;
|
|
118
|
-
}));
|
|
119
|
-
export {
|
|
120
|
-
pe as P,
|
|
121
|
-
Be as a,
|
|
122
|
-
se as m
|
|
123
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { e as o, _ as e, w as t } from "./utils-bsCscZfS.js";
|
|
2
|
-
import { defineComponent as n, ref as i, computed as c, createBlock as l, openBlock as a, createSlots as r, withCtx as f, createElementVNode as s, normalizeStyle as p, createCommentVNode as m, createTextVNode as u, toDisplayString as d, createVNode as _, renderSlot as y } from "vue";
|
|
3
|
-
import { b as v } from "./Button-fW_ZOLmT.js";
|
|
4
|
-
import { P as x } from "./Icon-DpJyuj7c.js";
|
|
5
|
-
import { T as h } from "./Tooltip-HWx_i2FA.js";
|
|
6
|
-
const B = { class: "px-popconfirm__main" }, T = { class: "px-popconfirm__action" }, k = t(e(n({ 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 } }, emits: ["confirm", "cancel"], setup(e2, { emit: t2 }) {
|
|
7
|
-
const n2 = e2, k2 = t2, C = i(), P = c((() => ({ width: o(n2.width) })));
|
|
8
|
-
function j() {
|
|
9
|
-
var _a;
|
|
10
|
-
(_a = C.value) == null ? void 0 : _a.hide();
|
|
11
|
-
}
|
|
12
|
-
function w(o2) {
|
|
13
|
-
k2("confirm", o2), j();
|
|
14
|
-
}
|
|
15
|
-
function I(o2) {
|
|
16
|
-
k2("cancel", o2), j();
|
|
17
|
-
}
|
|
18
|
-
return (o2, e3) => (a(), l(h, { ref_key: "tooltipRef", ref: C, trigger: "click", "hide-timeout": o2.hideAfter }, r({ content: f((() => [s("div", { class: "px-popconfirm", style: p(P.value) }, [s("div", B, [!o2.hideIcon && o2.icon ? (a(), l(x, { key: 0, icon: o2.icon, color: o2.iconColor }, null, 8, ["icon", "color"])) : m("", true), u(" " + d(o2.title), 1)])], 4), s("div", T, [_(v, { class: "px-popconfirm__cancel", size: "small", type: o2.cancelButtonType, onClick: I }, { default: f((() => [u(d(o2.cancelButtonText || "Cancel"), 1)])), _: 1 }, 8, ["type"]), _(v, { class: "px-popconfirm__confirm", size: "small", type: o2.confirmButtonType, onClick: w }, { default: f((() => [u(d(o2.confirmButtonText || "Confirm"), 1)])), _: 1 }, 8, ["type"])])])), _: 2 }, [o2.$slots.default ? { name: "default", fn: f((() => [y(o2.$slots, "default", {}, void 0, true)])), key: "0" } : void 0, o2.$slots.reference ? { name: "default", fn: f((() => [y(o2.$slots, "reference", {}, void 0, true)])), key: "1" } : void 0]), 1032, ["hide-timeout"]));
|
|
19
|
-
} }), [["__scopeId", "data-v-72e03259"]]));
|
|
20
|
-
export {
|
|
21
|
-
k as P
|
|
22
|
-
};
|