sakana-element 2.1.5 → 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.
Files changed (157) hide show
  1. package/README.md +95 -19
  2. package/dist/es/{Alert-C76ZWSVk.js → Alert-BwTsp4X3.js} +2 -2
  3. package/dist/es/Avatar-CJu6JYV3.js +9 -0
  4. package/dist/es/Badge-BmxZXX8k.js +14 -0
  5. package/dist/es/Breadcrumb-BP8MSklj.js +15 -0
  6. package/dist/es/{Button-fW_ZOLmT.js → Button-BJHtN7gh.js} +5 -5
  7. package/dist/es/Card-DJHkCmsz.js +16 -0
  8. package/dist/es/Checkbox-DX8L3fyp.js +51 -0
  9. package/dist/es/Collapse-Ir3V9CuO.js +53 -0
  10. package/dist/es/ConfigProvider-CsbSqwwi.js +44 -0
  11. package/dist/es/Divider-C7PtODSK.js +9 -0
  12. package/dist/es/Drawer-C2eVmvUp.js +40 -0
  13. package/dist/es/Dropdown-CVg_c2fB.js +104 -0
  14. package/dist/es/FileInput-BE26BmXm.js +33 -0
  15. package/dist/es/Form-7lZt5ehf.js +122 -0
  16. package/dist/es/{Icon-DpJyuj7c.js → Icon-BLDDdSU-.js} +1 -1
  17. package/dist/es/Indicator-B-en-MgG.js +9 -0
  18. package/dist/es/{Input-DBPpvf0Y.js → Input-C5HuVehE.js} +4 -4
  19. package/dist/es/Link-Av9RdcFv.js +11 -0
  20. package/dist/es/Loading-CBNDUWQd.js +92 -0
  21. package/dist/es/Message-DgnyyuXn.js +152 -0
  22. package/dist/es/Notification-LYRXnVAf.js +69 -0
  23. package/dist/es/{Overlay-BRDSWspM.js → Overlay-CpvMhnuU.js} +1 -1
  24. package/dist/es/Pixelate-BPypBgJU.js +67 -0
  25. package/dist/es/Popconfirm-DvxFdLrw.js +23 -0
  26. package/dist/es/Progress-Bc5INMhJ.js +12 -0
  27. package/dist/es/Radio-263_rtRl.js +33 -0
  28. package/dist/es/Select-7ZxUCS8z.js +133 -0
  29. package/dist/es/Switch-DiCsMJT3.js +34 -0
  30. package/dist/es/Table-BvA_xzDe.js +10 -0
  31. package/dist/es/Tooltip-J3ji6weH.js +74 -0
  32. package/dist/es/hooks-BqobYUzS.js +171 -0
  33. package/dist/es/index.js +94 -64
  34. package/dist/{theme → es/theme}/Alert.css +1 -1
  35. package/dist/es/theme/Avatar.css +86 -0
  36. package/dist/{theme → es/theme}/Badge.css +36 -30
  37. package/dist/es/theme/Breadcrumb.css +192 -0
  38. package/dist/{theme → es/theme}/Button.css +216 -216
  39. package/dist/es/theme/Card.css +347 -0
  40. package/dist/es/theme/Checkbox.css +484 -0
  41. package/dist/{theme → es/theme}/Collapse.css +214 -54
  42. package/dist/es/theme/Divider.css +111 -0
  43. package/dist/es/theme/Drawer.css +206 -0
  44. package/dist/es/theme/Dropdown.css +471 -0
  45. package/dist/es/theme/FileInput.css +365 -0
  46. package/dist/es/theme/Form.css +83 -0
  47. package/dist/es/theme/Indicator.css +159 -0
  48. package/dist/{theme → es/theme}/Input.css +1 -0
  49. package/dist/es/theme/Link.css +69 -0
  50. package/dist/es/theme/Loading.css +266 -0
  51. package/dist/es/theme/Message.css +565 -0
  52. package/dist/es/theme/Notification.css +316 -0
  53. package/dist/es/theme/Popconfirm.css +46 -0
  54. package/dist/es/theme/Progress.css +278 -0
  55. package/dist/es/theme/Radio.css +426 -0
  56. package/dist/{theme → es/theme}/Select.css +78 -78
  57. package/dist/es/theme/Table.css +680 -0
  58. package/dist/es/theme/Tooltip.css +235 -0
  59. package/dist/es/utils-BS5vsvlM.js +101 -0
  60. package/dist/index.css +1 -1
  61. package/dist/types/components/Avatar/index.d.ts +30 -0
  62. package/dist/types/components/Avatar/types.d.ts +8 -0
  63. package/dist/types/components/Badge/types.d.ts +1 -0
  64. package/dist/types/components/Breadcrumb/constants.d.ts +3 -0
  65. package/dist/types/components/Breadcrumb/index.d.ts +45 -0
  66. package/dist/types/components/Breadcrumb/types.d.ts +13 -0
  67. package/dist/types/components/Card/types.d.ts +6 -0
  68. package/dist/types/components/Checkbox/constants.d.ts +5 -0
  69. package/dist/types/components/Checkbox/index.d.ts +94 -0
  70. package/dist/types/components/Checkbox/types.d.ts +46 -0
  71. package/dist/types/components/Collapse/constants.d.ts +3 -0
  72. package/dist/types/components/Collapse/index.d.ts +14 -8
  73. package/dist/types/components/Collapse/types.d.ts +12 -0
  74. package/dist/types/components/Divider/index.d.ts +30 -0
  75. package/dist/types/components/Divider/types.d.ts +10 -0
  76. package/dist/types/components/Drawer/constants.d.ts +1 -0
  77. package/dist/types/components/Drawer/index.d.ts +72 -0
  78. package/dist/types/components/Drawer/types.d.ts +20 -0
  79. package/dist/types/components/Dropdown/index.d.ts +11 -1
  80. package/dist/types/components/Dropdown/types.d.ts +3 -0
  81. package/dist/types/components/Dropdown/useDropdownKeyboard.d.ts +8 -0
  82. package/dist/types/components/FileInput/constants.d.ts +3 -0
  83. package/dist/types/components/FileInput/index.d.ts +58 -0
  84. package/dist/types/components/FileInput/types.d.ts +24 -0
  85. package/dist/types/components/Form/types.d.ts +17 -7
  86. package/dist/types/components/Indicator/constants.d.ts +2 -0
  87. package/dist/types/components/Indicator/index.d.ts +28 -0
  88. package/dist/types/components/Indicator/types.d.ts +10 -0
  89. package/dist/types/components/Input/index.d.ts +10 -10
  90. package/dist/types/components/Link/index.d.ts +34 -0
  91. package/dist/types/components/Link/types.d.ts +10 -0
  92. package/dist/types/components/Loading/index.d.ts +25 -0
  93. package/dist/types/components/Loading/types.d.ts +9 -0
  94. package/dist/types/components/Message/methods.d.ts +2 -0
  95. package/dist/types/components/Message/types.d.ts +9 -3
  96. package/dist/types/components/MessageBox/types.d.ts +16 -4
  97. package/dist/types/components/Notification/index.d.ts +1 -1
  98. package/dist/types/components/Notification/methods.d.ts +6 -1
  99. package/dist/types/components/Notification/types.d.ts +10 -4
  100. package/dist/types/components/Pixelate/constants.d.ts +2 -0
  101. package/dist/types/components/Pixelate/index.d.ts +71 -0
  102. package/dist/types/components/Pixelate/types.d.ts +23 -0
  103. package/dist/types/components/Popconfirm/index.d.ts +16 -7
  104. package/dist/types/components/Popconfirm/types.d.ts +2 -1
  105. package/dist/types/components/Progress/constants.d.ts +2 -0
  106. package/dist/types/components/Progress/index.d.ts +50 -0
  107. package/dist/types/components/Progress/types.d.ts +22 -0
  108. package/dist/types/components/Radio/constants.d.ts +5 -0
  109. package/dist/types/components/Radio/index.d.ts +88 -0
  110. package/dist/types/components/Radio/types.d.ts +43 -0
  111. package/dist/types/components/Select/constants.d.ts +2 -1
  112. package/dist/types/components/Select/index.d.ts +35 -26
  113. package/dist/types/components/Switch/index.d.ts +5 -5
  114. package/dist/types/components/Table/index.d.ts +27 -0
  115. package/dist/types/components/Table/types.d.ts +20 -0
  116. package/dist/types/components/Tooltip/index.d.ts +6 -0
  117. package/dist/types/components/Tooltip/types.d.ts +7 -0
  118. package/dist/types/components/index.d.ts +12 -0
  119. package/dist/types/hooks/index.d.ts +3 -1
  120. package/dist/types/hooks/useDraggable.d.ts +7 -0
  121. package/dist/types/hooks/useFocusTrap.d.ts +5 -0
  122. package/dist/types/hooks/vitest.setup.d.ts +4 -0
  123. package/dist/types/utils/index.d.ts +1 -0
  124. package/dist/types/utils/instance-management.d.ts +40 -0
  125. package/dist/umd/index.css +1 -1
  126. package/dist/umd/index.css.gz +0 -0
  127. package/dist/umd/index.umd.cjs +5 -14
  128. package/dist/umd/index.umd.cjs.gz +0 -0
  129. package/package.json +5 -6
  130. package/dist/es/Badge-BG-vYP8Y.js +0 -13
  131. package/dist/es/Card-BCBnlVi_.js +0 -12
  132. package/dist/es/Collapse-B08VhCVq.js +0 -38
  133. package/dist/es/ConfigProvider-DZO1d5Eq.js +0 -44
  134. package/dist/es/Dropdown-49nf6F8P.js +0 -40
  135. package/dist/es/Form-CGiTDSGI.js +0 -108
  136. package/dist/es/Loading-DlygqGOv.js +0 -88
  137. package/dist/es/Message-ganFfLeU.js +0 -123
  138. package/dist/es/Notification-D4RYHV9o.js +0 -58
  139. package/dist/es/Popconfirm-Cop44KwQ.js +0 -22
  140. package/dist/es/Select-Blw_iO2r.js +0 -133
  141. package/dist/es/Switch-CHjcLtHs.js +0 -34
  142. package/dist/es/Tooltip-HWx_i2FA.js +0 -74
  143. package/dist/es/hooks-CYdEHUVd.js +0 -105
  144. package/dist/es/utils-bsCscZfS.js +0 -84
  145. package/dist/theme/Card.css +0 -112
  146. package/dist/theme/Dropdown.css +0 -187
  147. package/dist/theme/Form.css +0 -52
  148. package/dist/theme/Loading.css +0 -78
  149. package/dist/theme/Message.css +0 -353
  150. package/dist/theme/Notification.css +0 -126
  151. package/dist/theme/Popconfirm.css +0 -30
  152. package/dist/theme/Tooltip.css +0 -111
  153. /package/dist/{theme → es/theme}/Icon.css +0 -0
  154. /package/dist/{theme → es/theme}/Overlay.css +0 -0
  155. /package/dist/{theme → es/theme}/Switch.css +0 -0
  156. /package/dist/{theme → es/theme}/fonts/zpix.woff2 +0 -0
  157. /package/dist/{theme → es/theme}/index.css +0 -0
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sakana-element",
3
- "version": "2.1.5",
3
+ "version": "2.3.0",
4
4
  "description": "A pixel-style Vue 3 component library, built with TypeScript and Vitest",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",
@@ -30,8 +30,7 @@
30
30
  "build-umd": "vite build --config build/vite.umd.config.ts",
31
31
  "build-es": "vite build --config build/vite.es.config.ts",
32
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
- "release": "release-it"
33
+ "build-es:watch": "vite build --watch --config build/vite.es.config.ts"
35
34
  },
36
35
  "keywords": [],
37
36
  "author": "",
@@ -45,8 +44,7 @@
45
44
  "url": "https://github.com/yu859/sakana-element/issues"
46
45
  },
47
46
  "dependencies": {
48
- "@popperjs/core": "^2.11.8",
49
- "async-validator": "^4.2.5"
47
+ "@popperjs/core": "^2.11.8"
50
48
  },
51
49
  "devDependencies": {
52
50
  "@rollup/plugin-terser": "^0.4.4",
@@ -55,6 +53,7 @@
55
53
  "vite-plugin-compression2": "^1.3.3"
56
54
  },
57
55
  "peerDependencies": {
58
- "vue": "^3.4.19"
56
+ "vue": "^3.4.19",
57
+ "zod": "^3.0.0 || ^4.0.0"
59
58
  }
60
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
- };
@@ -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
- };
@@ -1,40 +0,0 @@
1
- import { w as e } from "./utils-bsCscZfS.js";
2
- import { defineComponent as o, inject as i, computed as t, createElementBlock as a, openBlock as l, Fragment as d, createCommentVNode as n, createElementVNode as s, normalizeClass as p, unref as r, renderSlot as u, createTextVNode as m, toDisplayString as c, useSlots as f, ref as v, provide as h, createVNode as y, mergeProps as b, withCtx as k, createBlock as w, renderList as _ } from "vue";
3
- import { u as B, a as x, b as g } from "./hooks-CYdEHUVd.js";
4
- import { P as C, a as z } from "./Button-fW_ZOLmT.js";
5
- import { T as $ } from "./Tooltip-HWx_i2FA.js";
6
- import { a as j, i as T } from "./vendor-DXmGx29U.js";
7
- const D = Symbol("dropdownContext"), I = { key: 0, role: "separator", class: "divided-placeholder" }, O = ["id"], P = o({ name: "PxDropdownItem", __name: "DropdownItem", props: { command: { default: B().value }, label: {}, disabled: { type: Boolean, default: false }, divided: { type: Boolean, default: false } }, setup(e2) {
8
- const o2 = e2, f2 = i(D), v2 = t((() => f2 == null ? void 0 : f2.size.value));
9
- function h2() {
10
- o2.disabled || (f2 == null ? void 0 : f2.handleItemClick(o2));
11
- }
12
- return (e3, o3) => (l(), a(d, null, [e3.divided ? (l(), a("li", I)) : n("", true), s("li", { id: `dropdown-item-${e3.command ?? r(B)().value}`, class: p({ "px-dropdown__item": true, ["px-dropdown__item--" + v2.value]: v2.value, "is-disabled": e3.disabled, "is-divided": e3.divided }), onClick: h2 }, [u(e3.$slots, "default", {}, (() => [m(c(e3.label), 1)]))], 10, O)], 64));
13
- } }), R = ["aria-expanded"], A = { class: "px-dropdown__menu" }, S = e(o({ name: "PxDropdown", inheritAttrs: false, __name: "Dropdown", props: { type: {}, size: {}, items: { default: () => [] }, hideOnClick: { type: Boolean, default: true }, splitButton: { type: Boolean }, content: {}, trigger: {}, placement: {}, manual: { type: Boolean }, disabled: { type: Boolean }, popperOptions: {}, transition: {}, showTimeout: {}, hideTimeout: {}, virtualRef: {}, virtualTriggering: { type: Boolean } }, emits: ["visible-change", "command", "click"], setup(e2, { expose: o2, emit: i2 }) {
14
- const n2 = e2, m2 = i2;
15
- f();
16
- const c2 = v(), B2 = v(), I2 = v(false), O2 = t((() => j(n2, ["items", "hideOnClick", "size", "type", "splitButton"])));
17
- function S2() {
18
- var _a;
19
- (_a = c2.value) == null ? void 0 : _a.toggle();
20
- }
21
- return x(B2, (() => {
22
- var _a;
23
- n2.splitButton && ((_a = c2.value) == null ? void 0 : _a.hide());
24
- })), g(), h(D, { handleItemClick: function(e3) {
25
- var _a;
26
- n2.hideOnClick && ((_a = c2.value) == null ? void 0 : _a.hide()), !T(e3.command) && m2("command", e3.command);
27
- }, size: t((() => n2.size)) }), o2({ open: () => {
28
- var _a;
29
- return (_a = c2.value) == null ? void 0 : _a.show();
30
- }, close: () => {
31
- var _a;
32
- return (_a = c2.value) == null ? void 0 : _a.hide();
33
- } }), (e3, o3) => (l(), a("div", { ref_key: "dropdownRef", ref: B2, class: p(["px-dropdown", { "is-disabled": n2.disabled }]), role: "menu", "aria-haspopup": "true", "aria-expanded": I2.value }, [y($, b({ ref_key: "tooltipRef", ref: c2 }, O2.value, { manual: e3.splitButton, onVisibleChange: o3[1] || (o3[1] = (o4) => {
34
- I2.value = o4, e3.$emit("visible-change", o4);
35
- }) }), { content: k((() => [s("div", A, [u(e3.$slots, "dropdown", {}, (() => [(l(true), a(d, null, _(e3.items, ((e4) => (l(), w(P, b({ key: e4.command, ref_for: true }, e4), null, 16)))), 128))]))])])), default: k((() => [e3.splitButton ? (l(), w(r(C), { key: 0, type: e3.type, size: e3.size, disabled: e3.disabled }, { default: k((() => [y(r(z), { onClick: o3[0] || (o3[0] = (o4) => e3.$emit("click", o4)) }, { default: k((() => [u(e3.$slots, "default")])), _: 3 }), y(r(z), { icon: "chevron-down", onClick: S2 })])), _: 3 }, 8, ["type", "size", "disabled"])) : u(e3.$slots, "default", { key: 1 })])), _: 3 }, 16, ["manual"])], 10, R));
36
- } })), V = e(P);
37
- export {
38
- S as P,
39
- V as a
40
- };
@@ -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,58 +0,0 @@
1
- import { t, e, R as o, _ as n, f as s } from "./utils-bsCscZfS.js";
2
- import { defineComponent as i, ref as a, computed as l, onMounted as f, createBlock as r, openBlock as c, Transition as p, withCtx as d, withDirectives as u, createElementVNode as m, normalizeStyle as v, normalizeClass as h, createCommentVNode as g, createElementBlock as x, toDisplayString as y, renderSlot as _, unref as C, createVNode as k, withModifiers as b, vShow as w, isVNode as I, h as N, render as O, shallowReactive as j } from "vue";
3
- import { e as z, d as E, u as $ } from "./hooks-CYdEHUVd.js";
4
- import { P as B } from "./Icon-DpJyuj7c.js";
5
- import { v as D, u as M, f as P, d as R, w as A, g as L, x as W } from "./vendor-DXmGx29U.js";
6
- const H = ["aria-live"], T = { class: "px-notification__text" }, Z = { class: "px-notification__title" }, q = { class: "px-notification__content" }, F = { key: 1, class: "px-notification__close" }, G = n(i({ 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: {}, onClick: {}, onClose: {}, onDestory: {} }, setup(n2, { expose: s2 }) {
7
- const i2 = n2, I2 = a(false), N2 = a(), O2 = a(0), { topOffset: j2, bottomOffset: E2 } = z({ getLastBottomOffset: D(tt, i2), offset: i2.offset, boxHeight: O2 }), $2 = l((() => t.get(i2.type) ?? "circle-info")), P2 = l((() => i2.position.endsWith("right") ? "right" : "left")), R2 = l((() => i2.position.startsWith("top") ? "top" : "bottom")), A2 = l((() => ({ [R2.value]: e(j2.value), zIndex: i2.zIndex })));
8
- let L2;
9
- function W2() {
10
- 0 !== i2.duration && (L2 = M(J2, i2.duration));
11
- }
12
- function G2() {
13
- clearTimeout(L2);
14
- }
15
- function J2() {
16
- I2.value = false;
17
- }
18
- return f((() => {
19
- I2.value = true, W2();
20
- })), s2({ bottomOffset: E2, close: J2 }), (t2, e2) => (c(), r(p, { name: `px-notification-${t2.transitionName}`, onAfterLeave: e2[1] || (e2[1] = (e3) => !I2.value && t2.onDestory()), onEnter: e2[2] || (e2[2] = (t3) => O2.value = N2.value.getBoundingClientRect().height) }, { default: d((() => [u(m("div", { ref_key: "notifyRef", ref: N2, class: h(["px-notification", { [`px-notification--${t2.type}`]: t2.type, [P2.value]: true, "show-close": t2.showClose }]), style: v(A2.value), role: "alert", "aria-live": "danger" === t2.type || "warning" === t2.type ? "assertive" : "polite", onClick: e2[0] || (e2[0] = (...e3) => t2.onClick && t2.onClick(...e3)), onMouseenter: G2, onMouseleave: W2 }, [$2.value ? (c(), r(B, { key: 0, icon: $2.value, class: "px-notification__icon" }, null, 8, ["icon"])) : g("", true), m("div", T, [m("div", Z, y(t2.title), 1), m("div", q, [_(t2.$slots, "default", {}, (() => [t2.message ? (c(), r(C(o), { key: 0, vNode: t2.message }, null, 8, ["vNode"])) : g("", true)]), true)])]), t2.showClose ? (c(), x("div", F, [k(B, { icon: "close", onClick: b(J2, ["stop"]) })])) : g("", true)], 46, H), [[w, I2.value]])])), _: 3 }, 8, ["name"]));
21
- } }), [["__scopeId", "data-v-2111f4f7"]]), J = ["info", "success", "warning", "danger"], K = ["top-right", "top-left", "bottom-right", "bottom-left"], Q = /* @__PURE__ */ new Map();
22
- P(K, ((t2) => {
23
- Q.set(t2, j([]));
24
- }));
25
- const { nextZIndex: S } = E(), U = { type: "info", duration: 3e3, offset: 20, transitionName: "fade", showClose: true }, V = (t2) => {
26
- const e2 = !t2 || I(t2) || R(t2) ? { message: t2 } : t2;
27
- return { ...U, ...e2 };
28
- }, X = (t2) => Q.get(t2), Y = (t2 = {}) => ((t3) => {
29
- const e2 = $().value, o2 = document.createElement("div"), n2 = X(t3.position || "top-right"), s2 = { ...t3, id: e2, zIndex: S(), onDestory: () => {
30
- const t4 = A(n2, { id: e2 });
31
- -1 !== t4 && (n2.splice(t4, 1), O(null, o2));
32
- } }, i2 = N(G, s2);
33
- O(i2, o2), document.body.appendChild(o2.firstElementChild);
34
- const a2 = i2.component, l2 = { close: () => a2.exposed.close() }, f2 = { props: s2, id: e2, vm: a2, vnode: i2, handler: l2 };
35
- return n2.push(f2), f2;
36
- })(V(t2)).handler;
37
- function tt() {
38
- const t2 = X(this.position || "top-right"), e2 = A(t2, { id: this.id });
39
- return e2 <= 0 ? 0 : L(t2, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
40
- }
41
- P(J, ((t2) => {
42
- W(Y, t2, ((e2) => {
43
- const o2 = V(e2);
44
- return Y({ ...o2, type: t2 });
45
- }));
46
- })), Y.closeAll = function(t2) {
47
- Q.forEach(((e2) => {
48
- P(e2, ((e3) => {
49
- t2 ? e3.props.type === t2 && e3.handler.close() : e3.handler.close();
50
- }));
51
- }));
52
- };
53
- const et = s(Y, "$notify");
54
- export {
55
- et as P,
56
- K as a,
57
- J as n
58
- };
@@ -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
- };