sakana-element 2.2.0 → 2.4.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 (155) hide show
  1. package/README.md +98 -25
  2. package/dist/es/{Alert-C76ZWSVk.js → Alert-DfLsJvQD.js} +2 -2
  3. package/dist/es/Avatar-Ci4OKsv7.js +9 -0
  4. package/dist/es/{Badge-CoFWwBwv.js → Badge-B4wEToK6.js} +2 -2
  5. package/dist/es/{Breadcrumb-BtrwTVKW.js → Breadcrumb-BFzww8jd.js} +2 -2
  6. package/dist/es/{Button-S_31-UWJ.js → Button-DbFviVWb.js} +3 -3
  7. package/dist/es/{Card-DcW6nHYD.js → Card-ClRqKkc_.js} +2 -2
  8. package/dist/es/ChatBubble-DFEV_lVI.js +9 -0
  9. package/dist/es/Checkbox-l86YI3Fr.js +51 -0
  10. package/dist/es/{Collapse-DsS7M-m3.js → Collapse-B67v6RSE.js} +4 -4
  11. package/dist/es/{ConfigProvider-BgIewHXP.js → ConfigProvider-BCoGbcS5.js} +2 -2
  12. package/dist/es/Diff-BLiniLom.js +64 -0
  13. package/dist/es/Divider-DDSOHv8G.js +9 -0
  14. package/dist/es/Drawer-apeXw6EO.js +40 -0
  15. package/dist/es/Dropdown-By9qIErf.js +104 -0
  16. package/dist/es/{FileInput-BQ59woas.js → FileInput-CZ5jTfB_.js} +3 -3
  17. package/dist/es/Filter-B_1zU4Dq.js +40 -0
  18. package/dist/es/Form-B_XDnSjK.js +123 -0
  19. package/dist/es/{Icon-DpJyuj7c.js → Icon-D6qRB3pq.js} +1 -1
  20. package/dist/es/Indicator-C6Ip4dpP.js +9 -0
  21. package/dist/es/{Input-CiE4bPJN.js → Input-bThwBbNZ.js} +7 -7
  22. package/dist/es/Kbd-DXNjs7at.js +13 -0
  23. package/dist/es/{Link-B9B2APZq.js → Link-08Ee61Fv.js} +1 -1
  24. package/dist/es/{Loading-BW99pE5N.js → Loading-ByI9mjss.js} +13 -13
  25. package/dist/es/Message-CGG-lV5I.js +152 -0
  26. package/dist/es/Notification-B4clKY5h.js +69 -0
  27. package/dist/es/{Overlay-BRDSWspM.js → Overlay-6iPenJB1.js} +1 -1
  28. package/dist/es/Pixelate-A8J7jxDW.js +39 -0
  29. package/dist/es/Popconfirm-gcHGcOTz.js +23 -0
  30. package/dist/es/Progress-DFUBJQ4X.js +12 -0
  31. package/dist/es/Radio-CLBa1XIM.js +33 -0
  32. package/dist/es/Resizable-BWrFr2oj.js +151 -0
  33. package/dist/es/{Select-Dwqv8isB.js → Select-BtLqds1d.js} +20 -20
  34. package/dist/es/Skeleton-CGUQv3nQ.js +15 -0
  35. package/dist/es/{Switch-B1Gnv1tB.js → Switch-CZJ-S77_.js} +3 -3
  36. package/dist/es/Table-lHbxiyGq.js +10 -0
  37. package/dist/es/Tooltip-CdPqNYdn.js +74 -0
  38. package/dist/es/Validator-7ZT_nXDZ.js +40 -0
  39. package/dist/es/hooks-pU4JmsO3.js +171 -0
  40. package/dist/es/index.js +107 -70
  41. package/dist/es/utils-BXICIEsD.js +139 -0
  42. package/dist/es/{vendor-DXmGx29U.js → vendor-DrBJKLFW.js} +254 -210
  43. package/dist/index.css +1 -1
  44. package/dist/theme/Avatar.css +13 -43
  45. package/dist/theme/Badge.css +151 -151
  46. package/dist/theme/Breadcrumb.css +46 -4
  47. package/dist/theme/Button.css +72 -8
  48. package/dist/theme/Card.css +177 -93
  49. package/dist/theme/ChatBubble.css +218 -0
  50. package/dist/theme/Checkbox.css +604 -0
  51. package/dist/theme/Collapse.css +96 -96
  52. package/dist/theme/Diff.css +110 -0
  53. package/dist/theme/Divider.css +150 -0
  54. package/dist/theme/Drawer.css +206 -0
  55. package/dist/theme/Dropdown.css +359 -75
  56. package/dist/theme/FileInput.css +32 -0
  57. package/dist/theme/Filter.css +598 -0
  58. package/dist/theme/Indicator.css +159 -0
  59. package/dist/theme/Input.css +414 -406
  60. package/dist/theme/Kbd.css +104 -0
  61. package/dist/theme/Link.css +22 -3
  62. package/dist/theme/Loading.css +50 -12
  63. package/dist/theme/Message.css +250 -41
  64. package/dist/theme/Notification.css +232 -42
  65. package/dist/theme/Popconfirm.css +23 -7
  66. package/dist/theme/Progress.css +278 -0
  67. package/dist/theme/Radio.css +492 -0
  68. package/dist/theme/Resizable.css +95 -0
  69. package/dist/theme/Select.css +198 -88
  70. package/dist/theme/Skeleton.css +192 -0
  71. package/dist/theme/Switch.css +22 -3
  72. package/dist/theme/Table.css +680 -0
  73. package/dist/theme/Tooltip.css +150 -26
  74. package/dist/theme/Validator.css +25 -0
  75. package/dist/types/components/Avatar/types.d.ts +0 -2
  76. package/dist/types/components/ChatBubble/constants.d.ts +2 -0
  77. package/dist/types/components/ChatBubble/index.d.ts +27 -0
  78. package/dist/types/components/ChatBubble/types.d.ts +10 -0
  79. package/dist/types/components/Checkbox/constants.d.ts +5 -0
  80. package/dist/types/components/Checkbox/index.d.ts +94 -0
  81. package/dist/types/components/Checkbox/types.d.ts +46 -0
  82. package/dist/types/components/Collapse/index.d.ts +5 -5
  83. package/dist/types/components/Diff/constants.d.ts +4 -0
  84. package/dist/types/components/Diff/index.d.ts +67 -0
  85. package/dist/types/components/Diff/types.d.ts +29 -0
  86. package/dist/types/components/Divider/index.d.ts +30 -0
  87. package/dist/types/components/Divider/types.d.ts +10 -0
  88. package/dist/types/components/Drawer/constants.d.ts +1 -0
  89. package/dist/types/components/Drawer/index.d.ts +72 -0
  90. package/dist/types/components/Drawer/types.d.ts +20 -0
  91. package/dist/types/components/Dropdown/index.d.ts +13 -3
  92. package/dist/types/components/Dropdown/types.d.ts +3 -0
  93. package/dist/types/components/Dropdown/useDropdownKeyboard.d.ts +8 -0
  94. package/dist/types/components/FileInput/index.d.ts +5 -5
  95. package/dist/types/components/Filter/constants.d.ts +5 -0
  96. package/dist/types/components/Filter/index.d.ts +59 -0
  97. package/dist/types/components/Filter/types.d.ts +38 -0
  98. package/dist/types/components/Indicator/constants.d.ts +2 -0
  99. package/dist/types/components/Indicator/index.d.ts +28 -0
  100. package/dist/types/components/Indicator/types.d.ts +10 -0
  101. package/dist/types/components/Input/index.d.ts +10 -10
  102. package/dist/types/components/Kbd/constants.d.ts +3 -0
  103. package/dist/types/components/Kbd/index.d.ts +24 -0
  104. package/dist/types/components/Kbd/types.d.ts +10 -0
  105. package/dist/types/components/Message/methods.d.ts +2 -0
  106. package/dist/types/components/Message/types.d.ts +7 -1
  107. package/dist/types/components/MessageBox/types.d.ts +14 -2
  108. package/dist/types/components/Notification/methods.d.ts +3 -0
  109. package/dist/types/components/Notification/types.d.ts +8 -2
  110. package/dist/types/components/Pixelate/constants.d.ts +2 -0
  111. package/dist/types/components/Pixelate/index.d.ts +71 -0
  112. package/dist/types/components/Pixelate/types.d.ts +23 -0
  113. package/dist/types/components/Popconfirm/index.d.ts +18 -9
  114. package/dist/types/components/Popconfirm/types.d.ts +2 -1
  115. package/dist/types/components/Progress/constants.d.ts +2 -0
  116. package/dist/types/components/Progress/index.d.ts +50 -0
  117. package/dist/types/components/Progress/types.d.ts +22 -0
  118. package/dist/types/components/Radio/constants.d.ts +5 -0
  119. package/dist/types/components/Radio/index.d.ts +88 -0
  120. package/dist/types/components/Radio/types.d.ts +43 -0
  121. package/dist/types/components/Resizable/constants.d.ts +3 -0
  122. package/dist/types/components/Resizable/index.d.ts +135 -0
  123. package/dist/types/components/Resizable/types.d.ts +52 -0
  124. package/dist/types/components/Select/index.d.ts +32 -23
  125. package/dist/types/components/Skeleton/index.d.ts +36 -0
  126. package/dist/types/components/Skeleton/types.d.ts +12 -0
  127. package/dist/types/components/Switch/index.d.ts +5 -5
  128. package/dist/types/components/Table/index.d.ts +27 -0
  129. package/dist/types/components/Table/types.d.ts +20 -0
  130. package/dist/types/components/Tooltip/index.d.ts +9 -3
  131. package/dist/types/components/Tooltip/types.d.ts +7 -0
  132. package/dist/types/components/Validator/index.d.ts +52 -0
  133. package/dist/types/components/Validator/types.d.ts +13 -0
  134. package/dist/types/components/index.d.ts +15 -0
  135. package/dist/types/hooks/index.d.ts +3 -1
  136. package/dist/types/hooks/useDraggable.d.ts +7 -0
  137. package/dist/types/hooks/useFocusTrap.d.ts +5 -0
  138. package/dist/types/utils/index.d.ts +2 -0
  139. package/dist/types/utils/instance-management.d.ts +40 -0
  140. package/dist/types/utils/pixelate.d.ts +10 -0
  141. package/dist/types/utils/style.d.ts +1 -0
  142. package/dist/umd/index.css +1 -1
  143. package/dist/umd/index.css.gz +0 -0
  144. package/dist/umd/index.umd.cjs +4 -4
  145. package/dist/umd/index.umd.cjs.gz +0 -0
  146. package/package.json +59 -59
  147. package/dist/es/Avatar-CxsRW-wl.js +0 -9
  148. package/dist/es/Dropdown-GcomGMAI.js +0 -40
  149. package/dist/es/Form-j90EzLXU.js +0 -122
  150. package/dist/es/Message-DCNnTUje.js +0 -123
  151. package/dist/es/Notification-CBzY5904.js +0 -58
  152. package/dist/es/Popconfirm-DF6d2ORS.js +0 -23
  153. package/dist/es/Tooltip-k6gKnMyt.js +0 -74
  154. package/dist/es/hooks-BaG7l8K5.js +0 -116
  155. package/dist/es/utils-bsCscZfS.js +0 -84
Binary file
package/package.json CHANGED
@@ -1,59 +1,59 @@
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
+ {
2
+ "name": "sakana-element",
3
+ "version": "2.4.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/SaKaNa-Y/sakana-element.git"
41
+ },
42
+ "homepage": "https://github.com/SaKaNa-Y/sakana-element#readme",
43
+ "bugs": {
44
+ "url": "https://github.com/SaKaNa-Y/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,9 +0,0 @@
1
- import { r as a, c as s, S as t, _ as e, w as r } from "./utils-bsCscZfS.js";
2
- import { defineComponent as o, computed as l, createElementBlock as u, openBlock as p, normalizeStyle as d, normalizeClass as i, renderSlot as c, createCommentVNode as n } from "vue";
3
- const v = r(e(o({ name: "PxAvatar", __name: "Avatar", props: { size: { default: "default" }, shape: { default: "circle" }, border: { type: Boolean, default: true }, color: {}, status: {} }, setup(e2) {
4
- const r2 = e2, o2 = l((() => r2.color ? a(s(r2.color), "px-avatar", t.default) : {}));
5
- return (a2, s2) => (p(), u("span", { class: i(["px-avatar", { [`px-avatar--${a2.size}`]: a2.size && "default" !== a2.size, "is-square": "square" === a2.shape, "is-border": a2.border }]), style: d(o2.value) }, [c(a2.$slots, "default", {}, void 0, true), a2.status ? (p(), u("span", { key: 0, class: i(["px-avatar__indicator", `is-${a2.status}`]) }, null, 2)) : n("", true)], 6));
6
- } }), [["__scopeId", "data-v-47da9c60"]]));
7
- export {
8
- v as P
9
- };
@@ -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 m, createTextVNode as u, 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-BaG7l8K5.js";
4
- import { P as C, a as z } from "./Button-S_31-UWJ.js";
5
- import { T as $ } from "./Tooltip-k6gKnMyt.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", { role: "menuitem", 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 }, [m(e3.$slots, "default", {}, (() => [u(c(e3.label), 1)]))], 10, O)], 64));
13
- } }), R = ["aria-expanded"], A = { class: "px-dropdown__menu", role: "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, u2 = 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) && u2("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 }]), "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, [m(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((() => [m(e3.$slots, "default")])), _: 3 }), y(r(z), { icon: "chevron-down", onClick: S2 })])), _: 3 }, 8, ["type", "size", "disabled"])) : m(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,122 +0,0 @@
1
- import { defineComponent as e, reactive as r, toRefs as s, provide as t, createElementBlock as a, openBlock as l, normalizeClass as o, renderSlot as i, useCssVars as u, computed as n, useSlots as d, inject as c, ref as p, onMounted as m, onUnmounted as v, normalizeStyle as f, unref as h, createBlock as b, createCommentVNode as g, createElementVNode as y, resolveDynamicComponent as x, withCtx as _, createTextVNode as q, toDisplayString as P, nextTick as k } from "vue";
2
- import { d as F, _ as I, w } from "./utils-bsCscZfS.js";
3
- import { f as j, b as $, s as B, c as A, d as S, i as W, e as M, g as V, h as z, j as C, k as O, l as T, p as D } from "./vendor-DXmGx29U.js";
4
- import { u as E } from "./hooks-BaG7l8K5.js";
5
- import { z as R } from "zod";
6
- import { P as G } from "./Icon-DpJyuj7c.js";
7
- const H = Symbol("formContext"), J = Symbol("formItemContext"), K = e({ name: "PxForm", __name: "Form", props: { model: {}, rules: {}, disabled: { type: Boolean }, inline: { type: Boolean }, statusIcon: { 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: u2, emit: n2 }) {
8
- const d2 = n2, c2 = [], p2 = async (e3, r2) => {
9
- try {
10
- const s2 = await (async function(e4 = []) {
11
- let r3 = {};
12
- for (const s3 of e4) try {
13
- await s3.validate("");
14
- } catch (e5) {
15
- r3 = { ...r3, ...e5 };
16
- }
17
- return !B(Object.keys(r3)) || Promise.reject(r3);
18
- })(m2(c2, e3 ?? []));
19
- return true === s2 && (r2 == null ? void 0 : r2(s2)), s2;
20
- } catch (e4) {
21
- if (e4 instanceof Error) throw e4;
22
- const s2 = e4;
23
- return r2 == null ? void 0 : r2(false, s2), Promise.reject(s2);
24
- }
25
- };
26
- function m2(e3, r2) {
27
- return B(r2) ? $(e3, ((e4) => A(r2, e4.prop))) : e3;
28
- }
29
- const v2 = r({ ...s(e2), emits: d2, addField: (e3) => {
30
- e3.prop && c2.push(e3);
31
- }, removeField: (e3) => {
32
- e3.prop && c2.splice(c2.indexOf(e3), 1);
33
- } });
34
- return t(H, v2), u2({ validate: async (e3) => p2([], e3), validateField: p2, resetFields: (e3) => {
35
- j(m2(c2, e3 ?? []), ((e4) => e4.resetField()));
36
- }, clearValidate: (e3) => {
37
- j(m2(c2, e3 ?? []), ((e4) => e4.clearValidate()));
38
- } }), (e3, r2) => (l(), a("form", { class: o(["px-form", { "is-inline": e3.inline }]) }, [i(e3.$slots, "default")], 2));
39
- } }), L = ["aria-describedby"], N = { class: "px-form-item__input-wrap" }, Q = ["id"], U = I(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: I2 }) {
40
- u(((e3) => ({ ac9c6e38: le.value })));
41
- const w2 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), j2 = e2, K2 = d(), U2 = c(H), X2 = E().value, Y2 = p("init"), Z2 = p(""), ee = p([]), re = (e3) => {
42
- return e3 && j2.prop && !W(V(e3, j2.prop)) ? (r2 = j2.prop, (T(r2) ? r2 : r2.split(".")).some(((e4) => w2.has(e4))) ? (F("PxFormItem", `Prop path "${j2.prop}" contains a dangerous segment and was rejected.`), null) : V(e3, j2.prop)) : null;
43
- var r2;
44
- }, se = n((() => !(!j2.label && !K2.label))), te = n((() => j2.for || (ee.value.length ? ee.value[0] : ""))), ae = n((() => `${j2.label ?? ""}${(U2 == null ? void 0 : U2.labelSuffix) ?? ""}`)), le = n((() => {
45
- const e3 = (e4) => z(e4) ? `${e4}px` : C(e4, "px") ? e4 : `${e4}px`;
46
- return j2.labelWidth ? e3(j2.labelWidth) : (U2 == null ? void 0 : U2.labelWidth) ? e3(U2 == null ? void 0 : U2.labelWidth) : "150px";
47
- })), oe = n((() => (U2 == null ? void 0 : U2.labelPosition) ?? "right")), ie = n((() => "top" === oe.value)), ue = n((() => ie.value ? { width: "100%", textAlign: "left", padding: "0 0 8px 0" } : { textAlign: "left" === oe.value ? "left" : "right" })), ne = n((() => (U2 == null ? void 0 : U2.disabled) || j2.disabled)), de = n((() => {
48
- const e3 = U2 == null ? void 0 : U2.model;
49
- return re(e3);
50
- })), ce = n((() => j2.prop ? S(j2.prop) ? j2.prop : j2.prop.join(".") : "")), pe = n((() => {
51
- const { required: e3 } = j2, r2 = [];
52
- j2.rules && r2.push(...j2.rules);
53
- const s2 = U2 == null ? void 0 : U2.rules;
54
- if (s2 && j2.prop) {
55
- const e4 = re(s2);
56
- e4 && r2.push(...e4);
57
- }
58
- if (!W(e3)) {
59
- const s3 = $(M(r2, ((e4, r3) => [e4, r3])), ((e4) => A(D(e4[0]), "required")));
60
- if (B(s3)) for (const t2 of s3) {
61
- const [s4, a2] = t2;
62
- s4.required !== e3 && (r2[a2] = { ...s4, required: e3 });
63
- }
64
- else r2.push({ required: e3 });
65
- }
66
- return r2;
67
- })), me = n((() => W(j2.required) ? B($(pe.value, ((e3) => e3.required))) > 0 : j2.required));
68
- let ve = null, fe = false;
69
- const he = async (e3, r2) => {
70
- if (fe || !j2.prop || ne.value) return false;
71
- if (!Y2.value) return r2 == null ? void 0 : r2(false), false;
72
- const s2 = (function(e4) {
73
- const r3 = pe.value;
74
- return r3 ? $(r3, ((r4) => !(r4 == null ? void 0 : r4.trigger) || !e4 || (T(r4.trigger) ? r4.trigger.includes(e4) : r4.trigger === e4))) : [];
75
- })(e3);
76
- return B(s2) ? (Y2.value = "validating", (async function(e4) {
77
- var _a;
78
- const r3 = de.value;
79
- for (const s3 of e4) {
80
- let e5 = s3.schema ?? null;
81
- if (!e5 && s3.required && (e5 = R.string({ message: s3.message ?? "This field is required" }).min(1, s3.message ?? "This field is required")), !e5) continue;
82
- const t2 = e5.safeParse(r3);
83
- if (!t2.success) {
84
- const e6 = s3.message ?? ((_a = t2.error.issues[0]) == null ? void 0 : _a.message) ?? "Validation failed";
85
- Y2.value = "error", Z2.value = e6;
86
- const r4 = { errors: [{ field: ce.value, message: e6 }], fields: { [ce.value]: [{ message: e6 }] } };
87
- return U2 == null ? void 0 : U2.emits("validate", j2, false, e6), Promise.reject(r4);
88
- }
89
- }
90
- return Y2.value = "success", U2 == null ? void 0 : U2.emits("validate", j2, true, ""), true;
91
- })(s2).then((() => (r2 == null ? void 0 : r2(true), true))).catch(((e4) => {
92
- const { fields: s3 } = e4;
93
- return r2 == null ? void 0 : r2(false, s3), Promise.reject(s3);
94
- }))) : (r2 == null ? void 0 : r2(true), true);
95
- }, be = () => {
96
- const e3 = U2 == null ? void 0 : U2.model;
97
- e3 && ce.value && !W(V(e3, ce.value)) && (fe = true, e3[ce.value] = O(ve)), k((() => ge()));
98
- }, ge = () => {
99
- Y2.value = "init", Z2.value = "", fe = false;
100
- }, ye = r({ ...s(j2), disabled: ne.value, validate: he, resetField: be, clearValidate: ge, addInputId: (e3) => {
101
- A(ee.value, e3) || ee.value.push(e3);
102
- }, removeInputId: (e3) => {
103
- ee.value = $(ee.value, ((r2) => r2 !== e3));
104
- } });
105
- return m((() => {
106
- j2.prop && (U2 == null ? void 0 : U2.addField(ye), ve = de.value);
107
- })), v((() => {
108
- j2.prop && (U2 == null ? void 0 : U2.removeField(ye));
109
- })), t(J, ye), I2({ validateMessage: Z2, validateStatus: Y2, validate: he, resetField: be, clearValidate: ge }), (e3, r2) => {
110
- var _a, _b, _c, _d, _e;
111
- return l(), a("div", { class: o(["px-form-item", { "is-error": "error" === Y2.value, "is-success": "success" === Y2.value, "is-disabled": ne.value, "is-required": me.value, "asterisk-left": "left" === ((_a = h(U2)) == null ? void 0 : _a.requiredAsteriskPosition), "asterisk-right": "right" === ((_b = h(U2)) == null ? void 0 : _b.requiredAsteriskPosition) }]), style: f(ie.value ? { flexDirection: "column" } : {}) }, [se.value ? (l(), b(x(te.value ? "label" : "div"), { key: 0, class: "px-form-item__label", style: f(ue.value), id: h(X2), for: te.value }, { default: _((() => [i(e3.$slots, "label", { label: ae.value }, (() => [q(P(ae.value), 1)]), true)])), _: 3 }, 8, ["style", "id", "for"])) : g("", true), y("div", { class: "px-form-item__content", style: f(ie.value ? { width: "100%" } : {}), "aria-describedby": "error" === Y2.value ? `form-item-error-${h(X2)}` : void 0 }, [y("div", N, [i(e3.$slots, "default", { validate: he }, void 0, true), ((_c = h(U2)) == null ? void 0 : _c.statusIcon) && "success" === Y2.value ? (l(), b(G, { key: 0, icon: "check", class: "px-form-item__status-icon is-success", size: "sm" })) : g("", true), ((_d = h(U2)) == null ? void 0 : _d.statusIcon) && "error" === Y2.value ? (l(), b(G, { key: 1, icon: "close", class: "px-form-item__status-icon is-error", size: "sm" })) : g("", true)]), "error" === Y2.value ? (l(), a("div", { key: 0, class: "px-form-item__error-msg", id: `form-item-error-${h(X2)}` }, [((_e = h(U2)) == null ? void 0 : _e.showMessage) && e3.showMessage ? i(e3.$slots, "error", { key: 0, error: Z2.value }, (() => [q(P(Z2.value), 1)]), true) : g("", true)], 8, Q)) : g("", true)], 12, L)], 6);
112
- };
113
- } }), [["__scopeId", "data-v-0e2bbb22"]]);
114
- function X() {
115
- return { form: c(H, void 0), formItem: c(J, void 0) };
116
- }
117
- const Y = w(K), Z = w(U);
118
- export {
119
- Y as P,
120
- Z as a,
121
- X as u
122
- };
@@ -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 x, createElementBlock as v, 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 $, createTextVNode as z, toDisplayString as M, resolveDynamicComponent as j, withKeys as A } from "vue";
3
- import { e as O, f as L, d as V, u as E, g as D } from "./hooks-BaG7l8K5.js";
4
- import { P as R } from "./Icon-DpJyuj7c.js";
5
- import { v as N, u as K, f as S, d as Z, w as H, g as U, x as q, i as F, y as G, z as J, A as Q, B as W } from "./vendor-DXmGx29U.js";
6
- import { b as X } from "./Button-S_31-UWJ.js";
7
- import { _ as Y } from "./Input-CiE4bPJN.js";
8
- import { P as ee } from "./Overlay-BRDSWspM.js";
9
- const oe = ["aria-live"], te = { class: "px-message__content" }, ne = { key: 0, class: "px-message__close" }, se = 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" }, onDestroy: {} }, setup(n2, { expose: s2 }) {
10
- const k2 = n2, w2 = a(false), I2 = a(), T2 = a(0), { topOffset: P2, bottomOffset: $2 } = O({ getLastBottomOffset: N(ue, k2), offset: k2.offset, boxHeight: T2 }), z2 = l((() => e.get(k2.type) ?? "circle-info")), M2 = l((() => ({ top: o(P2.value), zIndex: k2.zIndex })));
11
- let j2;
12
- function A2() {
13
- 0 !== k2.duration && (j2 = K(E2, k2.duration));
14
- }
15
- function V2() {
16
- clearTimeout(j2);
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, A2();
28
- })), s2({ close: E2, bottomOffset: $2 }), (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.onDestroy()) }, { 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: A2 }, [x(R, { class: "px-message__icon", icon: z2.value }, null, 8, ["icon"]), m("div", te, [h(e2.$slots, "default", {}, (() => [e2.message ? (u(), r(B(t), { key: 0, vNode: e2.message }, null, 8, ["vNode"])) : b("", true)]))]), e2.showClose ? (u(), v("div", ne, [x(R, { icon: "close", onClick: _(E2, ["stop"]) })])) : b("", true)], 46, oe), [[C, w2.value]])])), _: 3 }, 8, ["name"]));
29
- } }), ae = ["info", "success", "warning", "danger", "error"], le = k([]), { nextZIndex: ce } = V(), ie = { type: "info", duration: 3e3, offset: 10, transitionName: "fade-up" }, re = (e2) => {
30
- const o2 = !e2 || w(e2) || Z(e2) ? { message: e2 } : e2;
31
- return { ...ie, ...o2 };
32
- };
33
- function ue() {
34
- const e2 = H(le, { id: this.id });
35
- return e2 <= 0 ? 0 : U(le, [e2 - 1, "vm", "exposed", "bottomOffset", "value"]);
36
- }
37
- const pe = (e2 = {}) => ((e3) => {
38
- const o2 = E().value, t2 = document.createElement("div"), n2 = { ...e3, id: o2, zIndex: ce(), onDestroy: () => {
39
- const e4 = H(le, { id: o2 });
40
- -1 !== e4 && (le.splice(e4, 1), T(null, t2));
41
- } }, s2 = I(se, 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 le.push(c2), c2;
45
- })(re(e2)).handler;
46
- S(ae, ((e2) => {
47
- q(pe, e2, ((o2) => {
48
- const t2 = re(o2);
49
- return pe({ ...t2, type: e2 });
50
- }));
51
- })), pe.closeAll = function(e2) {
52
- S(le, ((o2) => {
53
- e2 ? o2.props.type === e2 && o2.handler.close() : o2.handler.close();
54
- }));
55
- };
56
- const de = n(pe, "$message"), 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" }, xe = 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: {}, confirmButtonText: {}, cancelButtonLoading: { type: Boolean }, confirmButtonLoading: { type: Boolean }, cancelButtonDisabled: { type: Boolean }, confirmButtonDisabled: { type: Boolean }, cancelButtonType: {}, confirmButtonType: { default: "primary" }, roundButton: { type: Boolean, default: false }, center: { type: Boolean }, lockScroll: { type: Boolean, default: true }, closeOnClickModal: { type: Boolean, default: true }, inputPlaceholder: {}, inputValue: { default: "" }, inputType: {}, buttonSize: {}, beforeClose: {} }, setup(o2) {
57
- const t2 = o2, n2 = D(), { doAction: s2 } = t2, { nextZIndex: i2 } = V(), y2 = a(), k2 = a(), w2 = E(), I2 = `msgbox-title-${E().value}`, T2 = P({ ...t2, zIndex: i2() }), O2 = l((() => !!T2.message)), L2 = l((() => T2.icon ?? e.get(T2.type ?? "")));
58
- function N2() {
59
- t2.closeOnClickModal && S2("close");
60
- }
61
- function K2(e2) {
62
- if ("textarea" !== T2.inputType) return e2.preventDefault(), S2("confirm");
63
- }
64
- function S2(e2) {
65
- G(t2.beforeClose) ? t2.beforeClose(e2, T2, (() => s2(e2, T2.inputValue))) : s2(e2, T2.inputValue);
66
- }
67
- function Z2() {
68
- S2("close");
69
- }
70
- return c((() => {
71
- var _a;
72
- return (_a = t2.visible) == null ? void 0 : _a.value;
73
- }), ((e2) => {
74
- e2 && (T2.zIndex = i2()), "prompt" === t2.boxType && e2 && $((() => {
75
- var _a;
76
- (_a = k2.value) == null ? void 0 : _a.focus();
77
- }));
78
- })), (e2, o3) => (u(), r(p, { name: "fade-in-linear", onAfterLeave: e2.destroy }, { default: d((() => [f(x(ee, { "z-index": T2.zIndex, mask: "" }, { default: d((() => [m("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": I2, class: "px-overlay-message-box", onClick: N2 }, [m("div", { ref: "rootRef", class: g(["px-message-box", { "is-center": T2.center }]), onClick: o3[5] || (o3[5] = _((() => {
79
- }), ["stop"])) }, [B(F)(T2.title) ? b("", true) : (u(), v("div", { key: 0, ref_key: "headerRef", ref: y2, class: g(["px-message-box__header", { "show-close": T2.showClose }]) }, [m("div", { class: "px-message-box__title", id: I2 }, [L2.value && T2.center ? (u(), r(R, { key: 0, class: g({ [`px-icon-${T2.type}`]: T2.type }), icon: L2.value }, null, 8, ["class", "icon"])) : b("", true), z(" " + M(T2.title), 1)]), e2.showClose ? (u(), v("button", { key: 0, class: "px-message-box__header-btn", onClick: _(Z2, ["stop"]) }, [x(R, { icon: "close" })])) : b("", true)], 2)), m("div", fe, [L2.value && !T2.center && O2.value ? (u(), r(R, { key: 0, class: g({ [`px-icon-${T2.type}`]: T2.type }), icon: L2.value }, null, 8, ["class", "icon"])) : b("", true), O2.value ? (u(), v("div", me, [h(e2.$slots, "default", {}, (() => [(u(), r(j(T2.showInput ? "label" : "p"), { for: T2.showInput ? B(w2) : void 0 }, { default: d((() => [z(M(T2.message), 1)])), _: 1 }, 8, ["for"]))]))])) : b("", true)]), f(m("div", ye, [x(Y, { modelValue: T2.inputValue, "onUpdate:modelValue": o3[0] || (o3[0] = (e3) => T2.inputValue = e3), ref_key: "inputRef", ref: k2, placeholder: T2.inputPlaceholder, type: T2.inputType, onKeyup: A(K2, ["enter"]) }, null, 8, ["modelValue", "placeholder", "type"])], 512), [[C, T2.showInput]]), m("div", ge, [T2.showCancelButton ? (u(), r(X, { key: 0, class: "px-message-box__footer-btn px-message-box__cancel-btn", type: T2.cancelButtonType, round: T2.roundButton, loading: T2.cancelButtonLoading, onClick: o3[1] || (o3[1] = (e3) => S2("cancel")), onKeydown: o3[2] || (o3[2] = A(_(((e3) => S2("cancel")), ["prevent"]), ["enter"])) }, { default: d((() => [z(M(T2.cancelButtonText || B(n2).t("messagebox.cancel")), 1)])), _: 1 }, 8, ["type", "round", "loading"])) : b("", true), f(x(X, { class: "px-message-box__footer-btn px-message-box__confirm-btn", type: T2.confirmButtonType ?? "primary", round: T2.roundButton, loading: T2.confirmButtonLoading, onClick: o3[3] || (o3[3] = (e3) => S2("confirm")), onKeydown: o3[4] || (o3[4] = A(_(((e3) => S2("confirm")), ["prevent"]), ["enter"])) }, { default: d((() => [z(M(T2.confirmButtonText || B(n2).t("messagebox.confirm")), 1)])), _: 1 }, 8, ["type", "round", "loading"]), [[C, T2.showConfirmButton]])])], 2)])])), _: 3 }, 8, ["z-index"]), [[C, e2.visible.value]])])), _: 3 }, 8, ["onAfterLeave"]));
80
- } }), ve = /* @__PURE__ */ new Map();
81
- function be(e2) {
82
- let o2;
83
- return Z(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 = G(e4 == null ? void 0 : e4.message) || w(e4 == null ? void 0 : e4.message), s3 = x(xe, { ...e4, visible: t4 }, n4 ? { default: (l2 = e4.message, G(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 = ve.get(n3);
93
- let a2;
94
- $((() => 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), ve.delete(n3);
97
- } }, o3), n3 = t3 == null ? void 0 : t3.proxy;
98
- return n3.visible.value = true, n3;
99
- })(e2);
100
- ve.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
- S(["alert", "confirm", "prompt"], ((e2) => {
105
- return q(be, e2, (o2 = e2, (e3, t2, n2) => {
106
- let s2 = "";
107
- return Q(t2) ? (n2 = t2, s2 = "") : s2 = W(t2) ? "" : t2, be(J({ title: s2, message: e3, type: "", boxType: o2, ...he[o2] }, n2));
108
- }));
109
- var o2;
110
- })), q(be, "close", (() => {
111
- ve.forEach(((e2, o2) => {
112
- o2.doClose();
113
- })), ve.clear();
114
- }));
115
- const Be = be;
116
- q(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
- de as P,
121
- Be as a,
122
- ae as m
123
- };
@@ -1,58 +0,0 @@
1
- import { t, e, R as o, _ as n, f as i } from "./utils-bsCscZfS.js";
2
- import { defineComponent as s, 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 w, vShow as b, 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-BaG7l8K5.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(s({ 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: {}, onDestroy: {} }, setup(n2, { expose: i2 }) {
7
- const s2 = n2, I2 = a(false), N2 = a(), O2 = a(0), { topOffset: j2, bottomOffset: E2 } = z({ getLastBottomOffset: D(tt, s2), offset: s2.offset, boxHeight: O2 }), $2 = l((() => t.get(s2.type) ?? "circle-info")), P2 = l((() => s2.position.endsWith("right") ? "right" : "left")), R2 = l((() => s2.position.startsWith("top") ? "top" : "bottom")), A2 = l((() => ({ [R2.value]: e(j2.value), zIndex: s2.zIndex })));
8
- let L2;
9
- function W2() {
10
- 0 !== s2.duration && (L2 = M(J2, s2.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
- })), i2({ bottomOffset: E2, close: J2 }), (t2, e2) => (c(), r(p, { name: `px-notification-${t2.transitionName}`, onAfterLeave: e2[1] || (e2[1] = (e3) => !I2.value && t2.onDestroy()), 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: w(J2, ["stop"]) })])) : g("", true)], 46, H), [[b, I2.value]])])), _: 3 }, 8, ["name"]));
21
- } }), [["__scopeId", "data-v-ff3aeca4"]]), 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 = { title: "", type: "info", duration: 3e3, offset: 20, position: "top-right", 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"), i2 = { ...t3, id: e2, zIndex: S(), onDestroy: () => {
30
- const t4 = A(n2, { id: e2 });
31
- -1 !== t4 && (n2.splice(t4, 1), O(null, o2));
32
- } }, s2 = N(G, i2);
33
- O(s2, o2), document.body.appendChild(o2.firstElementChild);
34
- const a2 = s2.component, l2 = { close: () => a2.exposed.close() }, f2 = { props: i2, id: e2, vm: a2, vnode: s2, 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 = i(Y, "$notify");
54
- export {
55
- et as P,
56
- K as a,
57
- J as n
58
- };
@@ -1,23 +0,0 @@
1
- import { e as o, _ as t, w as e } from "./utils-bsCscZfS.js";
2
- import { defineComponent as n, ref as i, computed as c, createBlock as l, openBlock as r, createSlots as a, withCtx as f, createElementVNode as s, normalizeStyle as p, createCommentVNode as m, createTextVNode as d, toDisplayString as u, createVNode as _, unref as y, renderSlot as x } from "vue";
3
- import { g as B } from "./hooks-BaG7l8K5.js";
4
- import { b as T } from "./Button-S_31-UWJ.js";
5
- import { P as h } from "./Icon-DpJyuj7c.js";
6
- import { T as v } from "./Tooltip-k6gKnMyt.js";
7
- const k = { class: "px-popconfirm__main" }, j = { class: "px-popconfirm__action" }, P = e(t(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(t2, { emit: e2 }) {
8
- const n2 = t2, P2 = e2, g = B(), w = i(), C = c((() => ({ width: o(n2.width) })));
9
- function I() {
10
- var _a;
11
- (_a = w.value) == null ? void 0 : _a.hide();
12
- }
13
- function $(o2) {
14
- P2("confirm", o2), I();
15
- }
16
- function z(o2) {
17
- P2("cancel", o2), I();
18
- }
19
- return (o2, t3) => (r(), l(v, { ref_key: "tooltipRef", ref: w, trigger: "click", "hide-timeout": o2.hideAfter }, a({ content: f((() => [s("div", { class: "px-popconfirm", role: "alertdialog", style: p(C.value) }, [s("div", k, [!o2.hideIcon && o2.icon ? (r(), l(h, { key: 0, icon: o2.icon, color: o2.iconColor }, null, 8, ["icon", "color"])) : m("", true), d(" " + u(o2.title), 1)])], 4), s("div", j, [_(T, { class: "px-popconfirm__cancel", size: "small", type: o2.cancelButtonType, onClick: z }, { default: f((() => [d(u(o2.cancelButtonText || y(g).t("popconfirm.cancelButtonText")), 1)])), _: 1 }, 8, ["type"]), _(T, { class: "px-popconfirm__confirm", size: "small", type: o2.confirmButtonType, onClick: $ }, { default: f((() => [d(u(o2.confirmButtonText || y(g).t("popconfirm.confirmButtonText")), 1)])), _: 1 }, 8, ["type"])])])), _: 2 }, [o2.$slots.default ? { name: "default", fn: f((() => [x(o2.$slots, "default", {}, void 0, true)])), key: "0" } : void 0, o2.$slots.reference ? { name: "default", fn: f((() => [x(o2.$slots, "reference", {}, void 0, true)])), key: "1" } : void 0]), 1032, ["hide-timeout"]));
20
- } }), [["__scopeId", "data-v-fd6e7d1d"]]));
21
- export {
22
- P
23
- };
@@ -1,74 +0,0 @@
1
- import { _ as e, w as t } from "./utils-bsCscZfS.js";
2
- import { onMounted as a, watch as o, onUnmounted as i, defineComponent as l, ref as r, computed as n, watchEffect as u, createElementBlock as s, openBlock as v, mergeProps as c, toHandlers as p, renderSlot as d, createVNode as f, unref as g, Transition as m, withCtx as h, createCommentVNode as _, createElementVNode as b, createTextVNode as k, toDisplayString as y } from "vue";
3
- import { createPopper as T } from "@popperjs/core";
4
- import { u as x, a as w } from "./hooks-BaG7l8K5.js";
5
- import { H as j, f as B, E, v as L } from "./vendor-DXmGx29U.js";
6
- const N = ["aria-describedby"], R = ["id"], $ = e(l({ name: "PxTooltip", __name: "Tooltip", props: { content: {}, trigger: { default: "hover" }, placement: { default: "bottom" }, manual: { type: Boolean }, disabled: { type: Boolean }, popperOptions: {}, transition: { default: "fade" }, showTimeout: { default: 0 }, hideTimeout: { default: 200 }, virtualRef: {}, virtualTriggering: { type: Boolean } }, emits: ["visible-change", "click-outside"], setup(e2, { expose: t2, emit: l2 }) {
7
- const $2 = e2, O2 = l2, P = r(false), A = x("px-tooltip"), D = r({}), H = r({}), I = r({}), M = r(), q = r(), z = r(), C = n((() => $2.virtualTriggering ? $2.virtualRef : z.value)), F = n((() => ({ placement: $2.placement, modifiers: [{ name: "offset", options: { offset: [0, 9] } }], ...$2.popperOptions }))), G = n((() => "hover" === $2.trigger ? $2.showTimeout : 0)), J = n((() => "hover" === $2.trigger ? $2.hideTimeout : 0));
8
- let K, Q, S;
9
- function U() {
10
- Q == null ? void 0 : Q.cancel(), K == null ? void 0 : K();
11
- }
12
- function V() {
13
- K == null ? void 0 : K.cancel(), Q == null ? void 0 : Q();
14
- }
15
- function W() {
16
- P.value ? V() : U();
17
- }
18
- function X(e3) {
19
- $2.disabled || (P.value = e3, O2("visible-change", e3));
20
- }
21
- function Y() {
22
- if (!$2.disabled && !$2.manual) return "hover" === $2.trigger ? (D.value.mouseenter = U, H.value.mouseleave = V, void (I.value.mouseenter = U)) : void ("click" !== $2.trigger ? "contextmenu" !== $2.trigger || (D.value.contextmenu = (e3) => {
23
- e3.preventDefault(), U();
24
- }) : D.value.click = W);
25
- }
26
- function Z() {
27
- S == null ? void 0 : S.destroy(), S = null;
28
- }
29
- function ee() {
30
- D.value = {}, H.value = {}, I.value = {}, Y();
31
- }
32
- const te = U, ae = () => {
33
- K == null ? void 0 : K.cancel(), X(false);
34
- };
35
- return o(P, ((e3) => {
36
- e3 && C.value && q.value && (S = T(C.value, q.value, F.value));
37
- }), { flush: "post" }), o((() => $2.manual), ((e3) => {
38
- e3 ? ee() : Y();
39
- })), o((() => $2.trigger), (() => {
40
- K == null ? void 0 : K.cancel(), P.value = false, O2("visible-change", false), ee();
41
- })), u((() => {
42
- $2.manual || Y(), K == null ? void 0 : K.cancel(), Q == null ? void 0 : Q.cancel(), K = E(L(X, null, true), G.value), Q = E(L(X, null, false), J.value);
43
- })), w(M, (() => {
44
- O2("click-outside"), "hover" === $2.trigger || $2.manual || P.value && V();
45
- })), (function(e3, t3, l3) {
46
- let r2, n2;
47
- const u2 = /* @__PURE__ */ new Map(), s2 = () => {
48
- const e4 = t3.value;
49
- e4 && j(e4) && B(l3.value, ((t4, a2) => {
50
- u2.set(a2, t4), e4.addEventListener(a2, t4);
51
- }));
52
- }, v2 = (e4) => {
53
- const a2 = e4 ?? t3.value;
54
- a2 && j(a2) && B(["mouseenter", "click", "contextmenu"], ((e5) => u2.has(e5) && a2.removeEventListener(e5, u2.get(e5))));
55
- };
56
- a((() => {
57
- n2 = o((() => e3.virtualRef), ((t4, a2) => {
58
- e3.virtualTriggering && (j(a2) && v2(a2), j(t4) && s2());
59
- }), { immediate: true }), r2 = o(l3, (() => {
60
- e3.virtualTriggering && (v2(), s2(), K == null ? void 0 : K.cancel(), X(false));
61
- }), { deep: true });
62
- })), i((() => {
63
- r2 == null ? void 0 : r2(), n2 == null ? void 0 : n2();
64
- }));
65
- })($2, C, D), i((() => {
66
- Z(), K == null ? void 0 : K.cancel(), Q == null ? void 0 : Q.cancel();
67
- })), t2({ show: te, hide: ae, toggle: () => {
68
- P.value ? ae() : te();
69
- } }), (e3, t3) => (v(), s("div", c({ class: "px-tooltip", ref_key: "containerNode", ref: M }, p(H.value, true)), [e3.virtualTriggering ? d(e3.$slots, "default", { key: 1 }, void 0, true) : (v(), s("div", c({ key: 0, class: "px-tooltip__trigger", ref_key: "_triggerNode", ref: z }, p(D.value, true), { "aria-describedby": P.value ? g(A) : void 0 }), [d(e3.$slots, "default", {}, void 0, true)], 16, N)), f(m, { name: e3.transition, onAfterLeave: Z }, { default: h((() => [P.value ? (v(), s("div", c({ key: 0, class: "px-tooltip__popper", ref_key: "popperNode", ref: q }, p(I.value, true), { id: g(A), role: "tooltip" }), [d(e3.$slots, "content", {}, (() => [k(y(e3.content), 1)]), true), t3[0] || (t3[0] = b("div", { id: "arrow", "data-popper-arrow": "" }, null, -1))], 16, R)) : _("", true)])), _: 3 }, 8, ["name"])], 16));
70
- } }), [["__scopeId", "data-v-4e2bfb45"]]), O = t($);
71
- export {
72
- O as P,
73
- $ as T
74
- };