@vavt/react-ui 1.2.0 → 1.2.2

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 (56) hide show
  1. package/dist/{MessageBox-BSMYQenX.cjs → MessageBox-D7Ib1f7K.cjs} +1 -1
  2. package/dist/{MessageBox-DipOfKXI.js → MessageBox-DDP6UWFU.js} +1 -1
  3. package/dist/{Modal-BOI8r4y1.cjs → Modal-DPxZEr2v.cjs} +1 -1
  4. package/dist/Modal-Du7aVdWl.js +239 -0
  5. package/dist/Notification-CJraaZIi.js +197 -0
  6. package/dist/Notification-D6m4qHKz.cjs +1 -0
  7. package/dist/Tag-4iZGcfrg.cjs +1 -0
  8. package/dist/Tag-TeYTDdHt.js +51 -0
  9. package/dist/cjs/MessageBox.cjs +1 -1
  10. package/dist/cjs/Modal.cjs +1 -1
  11. package/dist/cjs/Notification.cjs +1 -0
  12. package/dist/cjs/Tag.cjs +1 -1
  13. package/dist/cjs/global.cjs +1 -1
  14. package/dist/cjs/index.cjs +1 -1
  15. package/dist/cjs/register.cjs +1 -1
  16. package/dist/css/MessageBox.css +1 -1
  17. package/dist/css/Modal.css +1 -1
  18. package/dist/css/Notification.css +1 -0
  19. package/dist/css/Tag.css +1 -1
  20. package/dist/es/MessageBox.mjs +1 -1
  21. package/dist/es/Modal.mjs +1 -1
  22. package/dist/es/Notification.mjs +3 -0
  23. package/dist/es/Tag.mjs +1 -1
  24. package/dist/es/global.mjs +1 -1
  25. package/dist/es/index.mjs +20 -19
  26. package/dist/es/register.mjs +1 -1
  27. package/dist/index.css +1 -1
  28. package/dist/{registry-BLaletUC.js → registry-BUQSQSwB.js} +37 -35
  29. package/dist/registry-DF1N2ITX.cjs +1 -0
  30. package/dist/style/Notification.cjs +8 -0
  31. package/dist/style/Notification.mjs +8 -0
  32. package/dist/types/Notification/Notification.d.cts +4 -0
  33. package/dist/types/Notification/Notification.d.ts +4 -0
  34. package/dist/types/Notification/host.d.cts +9 -0
  35. package/dist/types/Notification/host.d.ts +9 -0
  36. package/dist/types/Notification/index.d.cts +5 -0
  37. package/dist/types/Notification/index.d.ts +5 -0
  38. package/dist/types/Notification/service.d.cts +5 -0
  39. package/dist/types/Notification/service.d.ts +5 -0
  40. package/dist/types/Notification/type.d.cts +55 -0
  41. package/dist/types/Notification/type.d.ts +55 -0
  42. package/dist/types/Tag/index.d.cts +1 -1
  43. package/dist/types/Tag/index.d.ts +1 -1
  44. package/dist/types/Tag/type.d.cts +5 -0
  45. package/dist/types/Tag/type.d.ts +5 -0
  46. package/dist/types/global.d.cts +2 -0
  47. package/dist/types/global.d.ts +2 -0
  48. package/dist/types/index.d.cts +1 -0
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/registry.d.cts +1 -0
  51. package/dist/types/registry.d.ts +1 -0
  52. package/package.json +1 -1
  53. package/dist/Modal-De9igZ5e.js +0 -238
  54. package/dist/Tag-Cf9M_HT6.cjs +0 -1
  55. package/dist/Tag-CkfqoSwA.js +0 -42
  56. package/dist/registry-hU7S5myb.cjs +0 -1
@@ -1,238 +0,0 @@
1
- import { t as e } from "./effect-nifYL_rH.js";
2
- import { n as t, t as n } from "./state-BSDh-Ob2.js";
3
- import { t as r } from "./client-pj_wzx28.js";
4
- import { n as i } from "./refs-D5IYOBaf.js";
5
- import { t as a } from "./content-Dllrr-7G.js";
6
- import { n as o, t as s } from "./number-BN2jHM6Z.js";
7
- import { t as ee } from "./id-CHixuHb7.js";
8
- import { n as te, r as ne, t as re } from "./layer-DDm97-sb.js";
9
- import { n as ie, r as ae, t as oe } from "./dialog-shell-CdYlPT9f.js";
10
- import { t as se } from "./Scrollbar-BdMGZrYi.js";
11
- import { X as ce } from "lucide-react";
12
- import { forwardRef as c, useCallback as l, useEffect as u, useMemo as le, useRef as d, useState as ue } from "react";
13
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
14
- //#region components/Modal/Modal.tsx
15
- var de = .25, fe = 0, pe = (e) => {
16
- if (typeof e == "number") return Number.isFinite(e) ? e : 0;
17
- if (typeof e == "string") {
18
- let t = e.trim();
19
- if (t.endsWith("vh")) {
20
- let e = parseFloat(t);
21
- return Number.isFinite(e) ? window.innerHeight * e / 100 : 0;
22
- }
23
- if (t.endsWith("px")) {
24
- let e = parseFloat(t);
25
- return Number.isFinite(e) ? e : 0;
26
- }
27
- let n = parseFloat(t);
28
- return Number.isFinite(n) ? n : 0;
29
- }
30
- return 0;
31
- }, m = c((c, m) => {
32
- let { open: h, defaultOpen: me = !1, title: g, width: he = 520, offsetY: _ = fe, center: v = !1, mask: ge = !0, closeOnClickOverlay: _e = !0, closeOnPressEscape: ve = !0, showClose: y = !0, lockScroll: ye = !0, destroyOnClose: b = !1, draggable: x = !0, fullscreen: S = !1, zIndex: be, header: C, footer: w, className: xe, style: T, children: Se, onClick: Ce, onChange: we, onOpen: E, onClose: D, onAfterClose: Te, "aria-label": Ee, "aria-labelledby": De, "aria-describedby": Oe, ...ke } = c, O = r(), Ae = typeof T?.zIndex == "number" ? T.zIndex : void 0, k = ne({
33
- defaultZIndex: te.modal,
34
- zIndex: be ?? Ae,
35
- withMask: !0
36
- }), A = d(null), je = le(() => i(A, m), [m]), Me = n(c, "open"), [j, M] = t({
37
- value: !!h,
38
- defaultValue: me,
39
- controlled: Me,
40
- onChange: we
41
- }), [Ne, N] = ue(!1), P = d({
42
- x: 0,
43
- y: 0
44
- }), F = d(!1), I = d(!1), L = d({
45
- x: 0,
46
- y: 0
47
- }), R = d(null), z = d(!1), B = d(null), V = d(null), H = ee("vl-modal-title"), U = l(() => M(!1), [M]), { isTopLayer: W } = ae({
48
- active: O && j,
49
- containerRef: A,
50
- closeOnPressEscape: ve,
51
- lockScroll: ye,
52
- onRequestClose: U
53
- }), G = l((e) => {
54
- A.current && (A.current.style.visibility = e ? "visible" : "hidden");
55
- }, []), K = l((e, t) => {
56
- P.current = {
57
- x: e,
58
- y: t
59
- }, A.current && (A.current.style.left = `${e}px`, A.current.style.top = `${t}px`);
60
- }, []), q = l((e, t) => {
61
- let n = e.getBoundingClientRect();
62
- return {
63
- rect: n,
64
- maxX: Math.max(t, window.innerWidth - n.width - t),
65
- maxY: Math.max(t, window.innerHeight - n.height - t)
66
- };
67
- }, []), J = l(() => {
68
- let e = A.current;
69
- if (!e || typeof window > "u") return;
70
- if (S) {
71
- K(0, 0), F.current = !1;
72
- return;
73
- }
74
- let { rect: t, maxX: n, maxY: r } = q(e, 12), i = (v ? (window.innerHeight - t.height) / 2 : window.innerHeight * de) + pe(_);
75
- K(Math.round(s((window.innerWidth - t.width) / 2, 12, n)), Math.round(s(i, 12, r)));
76
- }, [
77
- v,
78
- S,
79
- q,
80
- _,
81
- K
82
- ]), Y = l(() => {
83
- let e = A.current;
84
- if (!e) return;
85
- let { maxX: t, maxY: n } = q(e, 12);
86
- K(Math.round(s(P.current.x, 12, t)), Math.round(s(P.current.y, 12, n)));
87
- }, [q, K]), X = l((e, t) => {
88
- let n = A.current;
89
- if (!n || S) return;
90
- let { maxX: r, maxY: i } = q(n, 12), a = s(e - L.current.x, 12, r), o = s(t - L.current.y, 12, i);
91
- K(Math.round(a), Math.round(o)), F.current = !0;
92
- }, [
93
- S,
94
- q,
95
- K
96
- ]), Pe = d(X);
97
- e(() => {
98
- Pe.current = X;
99
- }, [X]);
100
- let Fe = l((e) => {
101
- I.current && Pe.current(e.clientX, e.clientY);
102
- }, []), Z = l(() => {
103
- V.current?.abort(), V.current = null, R.current?.(), R.current = null;
104
- }, []), Q = l(() => {
105
- I.current && (I.current = !1, N(!1), Z());
106
- }, [Z]), Ie = (e) => {
107
- if (!x || S || !j || !W() || e.button !== 0 || e.target.closest(".vl-modal__close")) return;
108
- let t = A.current;
109
- if (!t) return;
110
- e.preventDefault();
111
- let n = t.getBoundingClientRect();
112
- L.current = {
113
- x: e.clientX - n.left,
114
- y: e.clientY - n.top
115
- }, I.current = !0, N(!0), R.current = ie(), V.current = new AbortController();
116
- let { signal: r } = V.current;
117
- window.addEventListener("pointermove", Fe, { signal: r }), window.addEventListener("pointerup", Q, {
118
- once: !0,
119
- signal: r
120
- });
121
- };
122
- u(() => {
123
- let e = z.current;
124
- j && !e ? E?.() : !j && e && D?.(), z.current = j;
125
- }, [
126
- j,
127
- E,
128
- D
129
- ]), e(() => {
130
- !j || !O || (G(!1), S ? K(0, 0) : !b && F.current ? Y() : J(), G(!0));
131
- }, [
132
- j,
133
- O,
134
- S,
135
- b,
136
- J,
137
- Y,
138
- K,
139
- G
140
- ]), u(() => {
141
- j || Q();
142
- }, [j, Q]), u(() => {
143
- if (!j) return;
144
- let e = () => {
145
- I.current || (B.current !== null && window.clearTimeout(B.current), B.current = window.setTimeout(() => {
146
- B.current = null, F.current ? Y() : J();
147
- }, 100));
148
- };
149
- return window.addEventListener("resize", e, { passive: !0 }), () => {
150
- window.removeEventListener("resize", e), B.current !== null && (window.clearTimeout(B.current), B.current = null);
151
- };
152
- }, [
153
- j,
154
- J,
155
- Y
156
- ]), u(() => () => {
157
- Z(), B.current !== null && (window.clearTimeout(B.current), B.current = null);
158
- }, [Z]);
159
- let Le = () => {
160
- _e && W() && U();
161
- }, Re = (e) => {
162
- e.stopPropagation(), Ce?.(e);
163
- }, ze = [
164
- "vl-modal",
165
- Ne ? "is-dragging" : "",
166
- v ? "is-center" : "",
167
- S ? "is-fullscreen" : "",
168
- xe || ""
169
- ].filter(Boolean).join(" "), Be = ["vl-modal__header", x && !S ? "is-draggable" : ""].filter(Boolean).join(" "), $ = { ...T };
170
- k.zIndex !== void 0 && ($.zIndex = k.zIndex), S ? ($.width = "100vw", $.height = "100vh") : $.width = o(he) ?? "520px";
171
- let Ve = C ?? (g ? /* @__PURE__ */ f("div", {
172
- id: H,
173
- className: "vl-modal__title",
174
- children: g
175
- }) : null), He = De ?? (!C && g ? H : void 0), Ue = Ee ?? (He ? void 0 : typeof g == "string" ? g : "对话框");
176
- return /* @__PURE__ */ f(re, {
177
- layer: k.layer,
178
- children: /* @__PURE__ */ p(oe, {
179
- clientReady: O,
180
- open: j,
181
- mask: ge,
182
- destroyOnClose: b,
183
- maskTransitionName: "vl-modal-mask",
184
- transitionName: "vl-modal",
185
- maskClassName: "vl-modal__mask",
186
- panelClassName: ze,
187
- panelStyle: $,
188
- maskStyle: k.maskZIndex === void 0 ? void 0 : { zIndex: k.maskZIndex },
189
- panelRef: je,
190
- role: "dialog",
191
- ariaLabel: Ue,
192
- ariaLabelledBy: He,
193
- ariaDescribedBy: Oe,
194
- onMaskClick: Le,
195
- onPanelClick: Re,
196
- onAfterLeave: () => {
197
- Q(), b && (F.current = !1), Te?.();
198
- },
199
- panelProps: ke,
200
- children: [
201
- a(Ve) || y ? /* @__PURE__ */ f("div", {
202
- className: Be,
203
- onPointerDown: Ie,
204
- children: /* @__PURE__ */ p("div", {
205
- className: "vl-modal__headerInner",
206
- children: [/* @__PURE__ */ f("div", {
207
- className: "vl-modal__headerMain",
208
- children: Ve
209
- }), y ? /* @__PURE__ */ f("button", {
210
- type: "button",
211
- className: "vl-modal__close",
212
- "aria-label": "关闭对话框",
213
- onClick: U,
214
- children: /* @__PURE__ */ f(ce, {
215
- size: 20,
216
- "aria-hidden": "true"
217
- })
218
- }) : null]
219
- })
220
- }) : null,
221
- /* @__PURE__ */ f(se, {
222
- className: "vl-modal__body",
223
- children: Se
224
- }),
225
- a(w) ? /* @__PURE__ */ f("div", {
226
- className: "vl-modal__footer",
227
- children: w
228
- }) : null
229
- ]
230
- })
231
- });
232
- });
233
- m.displayName = "VlModal";
234
- //#endregion
235
- //#region components/Modal/index.ts
236
- var h = m, me = m;
237
- //#endregion
238
- export { h as n, me as t };
@@ -1 +0,0 @@
1
- let e=require("lucide-react"),t=require("react"),n=require("react/jsx-runtime");var r=(0,t.forwardRef)((t,r)=>{let{status:i,size:a=`md`,closable:o=!1,disabled:s=!1,tag:c=`span`,className:l,children:u,onClose:d,...f}=t,p=[`vl-tag`,i?`is-${i}`:``,a?`size-${a}`:``,s?`is-disabled`:``,l||``].filter(Boolean).join(` `),m=e=>{s||d?.(e)};return(0,n.jsxs)(c,{ref:r,className:p,...f,children:[(0,n.jsx)(`span`,{className:`vl-tag__content`,children:u}),o?(0,n.jsx)(`button`,{type:`button`,className:`vl-tag__close`,disabled:s,"aria-label":typeof u==`string`?`移除 ${u}`:`移除标签`,onClick:e=>{e.stopPropagation(),m(e)},children:(0,n.jsx)(e.X,{size:14,"aria-hidden":`true`})}):null]})});r.displayName=`VlTag`;var i=r,a=r;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -1,42 +0,0 @@
1
- import { X as e } from "lucide-react";
2
- import { forwardRef as t } from "react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- //#region components/Tag/Tag.tsx
5
- var i = t((t, i) => {
6
- let { status: a, size: o = "md", closable: s = !1, disabled: c = !1, tag: l = "span", className: u, children: d, onClose: f, ...p } = t, m = [
7
- "vl-tag",
8
- a ? `is-${a}` : "",
9
- o ? `size-${o}` : "",
10
- c ? "is-disabled" : "",
11
- u || ""
12
- ].filter(Boolean).join(" "), h = (e) => {
13
- c || f?.(e);
14
- };
15
- return /* @__PURE__ */ r(l, {
16
- ref: i,
17
- className: m,
18
- ...p,
19
- children: [/* @__PURE__ */ n("span", {
20
- className: "vl-tag__content",
21
- children: d
22
- }), s ? /* @__PURE__ */ n("button", {
23
- type: "button",
24
- className: "vl-tag__close",
25
- disabled: c,
26
- "aria-label": typeof d == "string" ? `移除 ${d}` : "移除标签",
27
- onClick: (e) => {
28
- e.stopPropagation(), h(e);
29
- },
30
- children: /* @__PURE__ */ n(e, {
31
- size: 14,
32
- "aria-hidden": "true"
33
- })
34
- }) : null]
35
- });
36
- });
37
- i.displayName = "VlTag";
38
- //#endregion
39
- //#region components/Tag/index.ts
40
- var a = i, o = i;
41
- //#endregion
42
- export { a as n, o as t };
@@ -1 +0,0 @@
1
- const e=require("./Alert-tPSJmCXK.cjs"),t=require("./Anchor-CmuV1Ump.cjs"),n=require("./Announcement-D0hZE2sM.cjs"),r=require("./Button-qURrKHQ0.cjs"),i=require("./Card-BkZhLXQ5.cjs"),a=require("./Checkbox-CzNGP2tH.cjs"),o=require("./Col-qcq7T83y.cjs"),s=require("./Transition-X_89ga-e.cjs"),c=require("./Input-C9ESmbJ7.cjs"),l=require("./Tabs-BZ0Zc0bL.cjs"),u=require("./NumberInput-Dp1vTDkW.cjs"),d=require("./Cron-MhbYMEeJ.cjs"),f=require("./Dropdown-PHqXNiAZ.cjs"),p=require("./DatePicker-Bj709smn.cjs"),m=require("./DateTimePicker-ZSScsk-j.cjs"),h=require("./Divider-BnmUNmy2.cjs"),g=require("./Drawer-DcbgMkub.cjs"),_=require("./Empty-Dny96c3p.cjs"),v=require("./Form-BkyDHPEI.cjs"),y=require("./Tooltip-DDjGLjoV.cjs"),b=require("./Loading-C2pY-4fA.cjs"),x=require("./Scrollbar-CEQT6Ao_.cjs"),S=require("./Modal-BOI8r4y1.cjs"),C=require("./MessageBox-BSMYQenX.cjs"),w=require("./Select-C6O0tmM_.cjs"),T=require("./Pagination-DatEegaF.cjs"),E=require("./Progress-DTAjlgwZ.cjs"),D=require("./cjs/Radio.cjs"),O=require("./cjs/Row.cjs"),k=require("./Sidebar-BPXVnP7y.cjs"),A=require("./Slider-CU9OS2HB.cjs"),j=require("./Space-DJGRG2rt.cjs"),M=require("./Switch-CpXDMcPW.cjs"),N=require("./Table-BNGO_7Rx.cjs"),P=require("./Tag-Cf9M_HT6.cjs"),F=require("./Textarea-CEhAvE10.cjs"),I=require("./Timeline-ROggEQnD.cjs"),L=require("./TimePicker-DoGbwfkU.cjs"),R=require("./Upload-wHEEoe1c.cjs");var z={VlAlert:e.n,VlAnchor:t.n,VlAnnouncement:n.n,VlButton:r.n,VlCard:i.n,VlCheckbox:a.n,VlCol:o.n,VlCron:d.n,VlDatePicker:p.n,VlDateTimePicker:m.n,VlDivider:h.n,VlDrawer:g.n,VlDropdown:f.n,VlEmpty:_.n,VlForm:v.t,VlInput:c.n,VlLoading:b.n,VlMessageBox:C.t,VlModal:S.n,VlNumberInput:u.n,VlPagination:T.n,VlProgress:E.n,VlRadio:D.VlRadio,VlRow:O.VlRow,VlScrollbar:x.n,VlSelect:w.n,VlSidebar:k.n,VlSlider:A.n,VlSpace:j.n,VlSwitch:M.n,VlTable:N.n,VlTabs:l.n,VlTag:P.n,VlTextarea:F.n,VlTimeline:I.n,VlTimePicker:L.n,VlTooltip:y.n,VlTransition:s.n,VlUpload:R.n},B=(e=globalThis)=>(Object.assign(e,z),z);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return z}});