gasp-components 1.0.10 → 1.0.12

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 (86) hide show
  1. package/dist/UploadOutlined-9WKjHsqa.js +878 -0
  2. package/dist/components/ag-grid-table/index.js +57877 -38314
  3. package/dist/components/button/index.js +18 -18
  4. package/dist/components/checklist/checklist-item.js +3 -3
  5. package/dist/components/checklist/index.js +5 -5
  6. package/dist/components/date-picker/index.js +9 -5022
  7. package/dist/components/dragger/index.js +28 -28
  8. package/dist/components/dropdown/index.js +10 -11
  9. package/dist/components/form/index.js +8 -9
  10. package/dist/components/form-item/index.js +10 -10
  11. package/dist/components/input/index.js +8 -8
  12. package/dist/components/modal/index.js +18 -20
  13. package/dist/components/password-input/index.js +2 -2
  14. package/dist/components/progress/index.js +16 -18
  15. package/dist/components/progress-circle/index.js +3 -3
  16. package/dist/components/radio-button/index.js +8 -8
  17. package/dist/components/result-popup/index.js +13 -14
  18. package/dist/components/select/index.js +1 -1
  19. package/dist/components/side-menu/index.js +2 -2
  20. package/dist/components/side-menu/menu-item.js +4 -6
  21. package/dist/components/steps/index.js +9 -9
  22. package/dist/components/table/index.js +16 -9298
  23. package/dist/components/tabs/index.js +10 -10
  24. package/dist/components/tabs/tab.js +7 -8
  25. package/dist/components/tag/index.js +9 -258
  26. package/dist/components/timeline-horizontal/index.js +7 -7
  27. package/dist/components/upload/index.js +62 -77
  28. package/dist/index-WlPrqxgY.js +87 -0
  29. package/dist/main.js +69 -457
  30. package/package.json +1 -1
  31. package/dist/CheckCircleFilled-xt-0R96Z.js +0 -16
  32. package/dist/CheckOutlined-EgxCAgj_.js +0 -16
  33. package/dist/CloseCircleFilled-bIgIULWb.js +0 -16
  34. package/dist/CloseOutlined-Q3kC3EZS.js +0 -16
  35. package/dist/Compact-fdEKV_mF.js +0 -180
  36. package/dist/ExclamationCircleFilled-XzDBEGmA.js +0 -16
  37. package/dist/KeyCode-qFRXB1-n.js +0 -517
  38. package/dist/LoadingOutlined-6Ipqn0og.js +0 -16
  39. package/dist/Overflow-JFdXKgCr.js +0 -231
  40. package/dist/PurePanel-hLGnXbul.js +0 -60
  41. package/dist/SearchOutlined-rJTFGXUi.js +0 -16
  42. package/dist/TextArea-n3dknzTq.js +0 -716
  43. package/dist/UploadOutlined-D8jfLEgv.js +0 -27
  44. package/dist/asyncToGenerator-t4sKr8R4.js +0 -340
  45. package/dist/button-LN5ZDad8.js +0 -819
  46. package/dist/collapse-ilv4Tji1.js +0 -20
  47. package/dist/colors-opGg9oSz.js +0 -25
  48. package/dist/compact-item-jjuVmDBH.js +0 -61
  49. package/dist/context-h3WSVDPz.js +0 -2087
  50. package/dist/createFormattedComponent-FcpICAm8.js +0 -3260
  51. package/dist/index--6VfGMUo.js +0 -402
  52. package/dist/index-0mpuHoS5.js +0 -996
  53. package/dist/index-1KQbTQJ2.js +0 -4405
  54. package/dist/index-5Uo03BMk.js +0 -681
  55. package/dist/index-BFgxz47K.js +0 -89
  56. package/dist/index-D3LMPWyJ.js +0 -1437
  57. package/dist/index-DVS_nWxv.js +0 -3026
  58. package/dist/index-ELHBhuK9.js +0 -100
  59. package/dist/index-Fn8q8B3V.js +0 -107
  60. package/dist/index-GgkQrebz.js +0 -950
  61. package/dist/index-L-MzVDcK.js +0 -616
  62. package/dist/index-M3WnMjiA.js +0 -230
  63. package/dist/index-NQd_zMf0.js +0 -69
  64. package/dist/index-ZT64Ec6u.js +0 -267
  65. package/dist/index-aawDqn9q.js +0 -3337
  66. package/dist/index-k04G4nlS.js +0 -1416
  67. package/dist/index-s3u4YBl4.js +0 -8
  68. package/dist/index-vtDVJV8q.js +0 -19571
  69. package/dist/isVisible-Qi9l15Ty.js +0 -232
  70. package/dist/motion-0ToOu81j.js +0 -226
  71. package/dist/motion-NQme0FJ_.js +0 -32
  72. package/dist/omit-ylWA0ZLZ.js +0 -10
  73. package/dist/pickAttrs-zaQzRTqh.js +0 -42
  74. package/dist/progress-a1_pwKVT.js +0 -722
  75. package/dist/reactNode-R20zZQk1.js +0 -18
  76. package/dist/responsiveObserver-V1_1G14X.js +0 -71
  77. package/dist/roundedArrow-p1Pmd9av.js +0 -64
  78. package/dist/row-sPFiFm0C.js +0 -230
  79. package/dist/slide-mFXPRHku.js +0 -265
  80. package/dist/styleChecker-pZ3k2IiY.js +0 -37
  81. package/dist/useCSSVarCls-GwZT_WiF.js +0 -9
  82. package/dist/useClosable-4G12n4Bp.js +0 -15
  83. package/dist/useLocale-eThlLZJw.js +0 -16
  84. package/dist/useMergedState-qUafLuUa.js +0 -23
  85. package/dist/useVariants-s0IcneBD.js +0 -25
  86. package/dist/zoom-Ps8y0jNW.js +0 -174
@@ -1,616 +0,0 @@
1
- import { F as ya, e as wa, b as x, z as de, G as Sa, _ as j, s as Na, a4 as Da, t as Ta, a5 as na, i as la, y as ua, w as La, x as za } from "./index-1KQbTQJ2.js";
2
- import { a as xa, P as ba } from "./motion-0ToOu81j.js";
3
- import { c as rr } from "./index-NQd_zMf0.js";
4
- import { R as Ca } from "./index--6VfGMUo.js";
5
- import { u as qe, i as Wa, g as oa } from "./isVisible-Qi9l15Ty.js";
6
- import * as o from "react";
7
- const $a = function() {
8
- if (typeof navigator > "u" || typeof window > "u")
9
- return !1;
10
- var e = navigator.userAgent || navigator.vendor || window.opera;
11
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e == null ? void 0 : e.substr(0, 4));
12
- };
13
- function Ba(e) {
14
- var n = e.prefixCls, r = e.align, t = e.arrow, s = e.arrowPos, u = t || {}, v = u.className, d = u.content, h = s.x, b = h === void 0 ? 0 : h, T = s.y, g = T === void 0 ? 0 : T, W = o.useRef();
15
- if (!r || !r.points)
16
- return null;
17
- var c = {
18
- position: "absolute"
19
- };
20
- if (r.autoArrow !== !1) {
21
- var N = r.points[0], R = r.points[1], D = N[0], $ = N[1], k = R[0], y = R[1];
22
- D === k || !["t", "b"].includes(D) ? c.top = g : D === "t" ? c.top = 0 : c.bottom = 0, $ === y || !["l", "r"].includes($) ? c.left = b : $ === "l" ? c.left = 0 : c.right = 0;
23
- }
24
- return /* @__PURE__ */ o.createElement("div", {
25
- ref: W,
26
- className: rr("".concat(n, "-arrow"), v),
27
- style: c
28
- }, d);
29
- }
30
- function Ha(e) {
31
- var n = e.prefixCls, r = e.open, t = e.zIndex, s = e.mask, u = e.motion;
32
- return s ? /* @__PURE__ */ o.createElement(ya, wa({}, u, {
33
- motionAppear: !0,
34
- visible: r,
35
- removeOnLeave: !0
36
- }), function(v) {
37
- var d = v.className;
38
- return /* @__PURE__ */ o.createElement("div", {
39
- style: {
40
- zIndex: t
41
- },
42
- className: rr("".concat(n, "-mask"), d)
43
- });
44
- }) : null;
45
- }
46
- var Ma = /* @__PURE__ */ o.memo(function(e) {
47
- var n = e.children;
48
- return n;
49
- }, function(e, n) {
50
- return n.cache;
51
- });
52
- process.env.NODE_ENV !== "production" && (Ma.displayName = "PopupContent");
53
- var Pa = /* @__PURE__ */ o.forwardRef(function(e, n) {
54
- var r = e.popup, t = e.className, s = e.prefixCls, u = e.style, v = e.target, d = e.onVisibleChanged, h = e.open, b = e.keepDom, T = e.fresh, g = e.onClick, W = e.mask, c = e.arrow, N = e.arrowPos, R = e.align, D = e.motion, $ = e.maskMotion, k = e.forceRender, y = e.getPopupContainer, i = e.autoDestroy, F = e.portal, Q = e.zIndex, O = e.onMouseEnter, ie = e.onMouseLeave, Me = e.onPointerEnter, p = e.ready, me = e.offsetX, ee = e.offsetY, re = e.offsetR, A = e.offsetB, U = e.onAlign, L = e.onPrepare, B = e.stretch, m = e.targetWidth, Z = e.targetHeight, C = typeof r == "function" ? r() : r, se = h || b, ae = (y == null ? void 0 : y.length) > 0, ar = o.useState(!y || !ae), Ue = x(ar, 2), he = Ue[0], Ge = Ue[1];
55
- if (de(function() {
56
- !he && ae && v && Ge(!0);
57
- }, [he, ae, v]), !he)
58
- return null;
59
- var te = "auto", H = {
60
- left: "-1000vw",
61
- top: "-1000vh",
62
- right: te,
63
- bottom: te
64
- };
65
- if (p || !h) {
66
- var I, le = R.points, ue = R.dynamicInset || ((I = R._experimental) === null || I === void 0 ? void 0 : I.dynamicInset), Je = ue && le[0][1] === "r", tr = ue && le[0][0] === "b";
67
- Je ? (H.right = re, H.left = te) : (H.left = me, H.right = te), tr ? (H.bottom = A, H.top = te) : (H.top = ee, H.bottom = te);
68
- }
69
- var V = {};
70
- return B && (B.includes("height") && Z ? V.height = Z : B.includes("minHeight") && Z && (V.minHeight = Z), B.includes("width") && m ? V.width = m : B.includes("minWidth") && m && (V.minWidth = m)), h || (V.pointerEvents = "none"), /* @__PURE__ */ o.createElement(F, {
71
- open: k || se,
72
- getContainer: y && function() {
73
- return y(v);
74
- },
75
- autoDestroy: i
76
- }, /* @__PURE__ */ o.createElement(Ha, {
77
- prefixCls: s,
78
- open: h,
79
- zIndex: Q,
80
- mask: W,
81
- motion: $
82
- }), /* @__PURE__ */ o.createElement(Ca, {
83
- onResize: U,
84
- disabled: !h
85
- }, function(Ke) {
86
- return /* @__PURE__ */ o.createElement(ya, wa({
87
- motionAppear: !0,
88
- motionEnter: !0,
89
- motionLeave: !0,
90
- removeOnLeave: !1,
91
- forceRender: k,
92
- leavedClassName: "".concat(s, "-hidden")
93
- }, D, {
94
- onAppearPrepare: L,
95
- onEnterPrepare: L,
96
- visible: h,
97
- onVisibleChanged: function(G) {
98
- var ge;
99
- D == null || (ge = D.onVisibleChanged) === null || ge === void 0 || ge.call(D, G), d(G);
100
- }
101
- }), function(Pe, G) {
102
- var ge = Pe.className, w = Pe.style, xe = rr(s, ge, t);
103
- return /* @__PURE__ */ o.createElement("div", {
104
- ref: Sa(Ke, n, G),
105
- className: xe,
106
- style: j(j(j(j({
107
- "--arrow-x": "".concat(N.x || 0, "px"),
108
- "--arrow-y": "".concat(N.y || 0, "px")
109
- }, H), V), w), {}, {
110
- boxSizing: "border-box",
111
- zIndex: Q
112
- }, u),
113
- onMouseEnter: O,
114
- onMouseLeave: ie,
115
- onPointerEnter: Me,
116
- onClick: g
117
- }, c && /* @__PURE__ */ o.createElement(Ba, {
118
- prefixCls: s,
119
- arrow: c,
120
- arrowPos: N,
121
- align: R
122
- }), /* @__PURE__ */ o.createElement(Ma, {
123
- cache: !h && !T
124
- }, C));
125
- });
126
- }));
127
- });
128
- process.env.NODE_ENV !== "production" && (Pa.displayName = "Popup");
129
- var ka = /* @__PURE__ */ o.forwardRef(function(e, n) {
130
- var r = e.children, t = e.getTriggerDOMNode, s = Na(r), u = o.useCallback(function(d) {
131
- Da(n, t ? t(d) : d);
132
- }, [t]), v = Ta(u, r.ref);
133
- return s ? /* @__PURE__ */ o.cloneElement(r, {
134
- ref: v
135
- }) : r;
136
- });
137
- process.env.NODE_ENV !== "production" && (ka.displayName = "TriggerWrapper");
138
- var va = /* @__PURE__ */ o.createContext(null);
139
- function ca(e) {
140
- return e ? Array.isArray(e) ? e : [e] : [];
141
- }
142
- function Ra(e, n, r, t) {
143
- return o.useMemo(function() {
144
- var s = ca(r ?? n), u = ca(t ?? n), v = new Set(s), d = new Set(u);
145
- return e && (v.has("hover") && (v.delete("hover"), v.add("click")), d.has("hover") && (d.delete("hover"), d.add("click"))), [v, d];
146
- }, [e, n, r, t]);
147
- }
148
- function Ea() {
149
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], r = arguments.length > 2 ? arguments[2] : void 0;
150
- return r ? e[0] === n[0] : e[0] === n[0] && e[1] === n[1];
151
- }
152
- function Fa(e, n, r, t) {
153
- for (var s = r.points, u = Object.keys(e), v = 0; v < u.length; v += 1) {
154
- var d, h = u[v];
155
- if (Ea((d = e[h]) === null || d === void 0 ? void 0 : d.points, s, t))
156
- return "".concat(n, "-placement-").concat(h);
157
- }
158
- return "";
159
- }
160
- function fa(e, n, r, t) {
161
- return n || (r ? {
162
- motionName: "".concat(e, "-").concat(r)
163
- } : t ? {
164
- motionName: t
165
- } : null);
166
- }
167
- function hr(e) {
168
- return e.ownerDocument.defaultView;
169
- }
170
- function ia(e) {
171
- for (var n = [], r = e == null ? void 0 : e.parentElement, t = ["hidden", "scroll", "clip", "auto"]; r; ) {
172
- var s = hr(r).getComputedStyle(r), u = s.overflowX, v = s.overflowY, d = s.overflow;
173
- [u, v, d].some(function(h) {
174
- return t.includes(h);
175
- }) && n.push(r), r = r.parentElement;
176
- }
177
- return n;
178
- }
179
- function mr(e) {
180
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
181
- return Number.isNaN(e) ? n : e;
182
- }
183
- function dr(e) {
184
- return mr(parseFloat(e), 0);
185
- }
186
- function da(e, n) {
187
- var r = j({}, e);
188
- return (n || []).forEach(function(t) {
189
- if (!(t instanceof HTMLBodyElement || t instanceof HTMLHtmlElement)) {
190
- var s = hr(t).getComputedStyle(t), u = s.overflow, v = s.overflowClipMargin, d = s.borderTopWidth, h = s.borderBottomWidth, b = s.borderLeftWidth, T = s.borderRightWidth, g = t.getBoundingClientRect(), W = t.offsetHeight, c = t.clientHeight, N = t.offsetWidth, R = t.clientWidth, D = dr(d), $ = dr(h), k = dr(b), y = dr(T), i = mr(Math.round(g.width / N * 1e3) / 1e3), F = mr(Math.round(g.height / W * 1e3) / 1e3), Q = (N - R - k - y) * i, O = (W - c - D - $) * F, ie = D * F, Me = $ * F, p = k * i, me = y * i, ee = 0, re = 0;
191
- if (u === "clip") {
192
- var A = dr(v);
193
- ee = A * i, re = A * F;
194
- }
195
- var U = g.x + p - ee, L = g.y + ie - re, B = U + g.width + 2 * ee - p - me - Q, m = L + g.height + 2 * re - ie - Me - O;
196
- r.left = Math.max(r.left, U), r.top = Math.max(r.top, L), r.right = Math.min(r.right, B), r.bottom = Math.min(r.bottom, m);
197
- }
198
- }), r;
199
- }
200
- function ma(e) {
201
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = "".concat(n), t = r.match(/^(.*)\%$/);
202
- return t ? e * (parseFloat(t[1]) / 100) : parseFloat(r);
203
- }
204
- function ha(e, n) {
205
- var r = n || [], t = x(r, 2), s = t[0], u = t[1];
206
- return [ma(e.width, s), ma(e.height, u)];
207
- }
208
- function ga() {
209
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
210
- return [e[0], e[1]];
211
- }
212
- function er(e, n) {
213
- var r = n[0], t = n[1], s, u;
214
- return r === "t" ? u = e.y : r === "b" ? u = e.y + e.height : u = e.y + e.height / 2, t === "l" ? s = e.x : t === "r" ? s = e.x + e.width : s = e.x + e.width / 2, {
215
- x: s,
216
- y: u
217
- };
218
- }
219
- function ze(e, n) {
220
- var r = {
221
- t: "b",
222
- b: "t",
223
- l: "r",
224
- r: "l"
225
- };
226
- return e.map(function(t, s) {
227
- return s === n ? r[t] || "c" : t;
228
- }).join("");
229
- }
230
- function Va(e, n, r, t, s, u, v) {
231
- var d = o.useState({
232
- ready: !1,
233
- offsetX: 0,
234
- offsetY: 0,
235
- offsetR: 0,
236
- offsetB: 0,
237
- arrowX: 0,
238
- arrowY: 0,
239
- scaleX: 1,
240
- scaleY: 1,
241
- align: s[t] || {}
242
- }), h = x(d, 2), b = h[0], T = h[1], g = o.useRef(0), W = o.useMemo(function() {
243
- return n ? ia(n) : [];
244
- }, [n]), c = o.useRef({}), N = function() {
245
- c.current = {};
246
- };
247
- e || N();
248
- var R = qe(function() {
249
- if (n && r && e) {
250
- let Y = function(Ce, Ae) {
251
- var Oe = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : xe, pe = C.x + Ce, cr = C.y + Ae, fr = pe + I, Rr = cr + H, pr = Math.max(pe, Oe.left), ea = Math.max(cr, Oe.top), ra = Math.min(fr, Oe.right), aa = Math.min(Rr, Oe.bottom);
252
- return Math.max(0, (ra - pr) * (aa - ea));
253
- }, Hr = function() {
254
- Ne = C.y + f, De = Ne + H, Te = C.x + S, Ie = Te + I;
255
- };
256
- var k, y, i = n, F = i.ownerDocument, Q = hr(i), O = Q.getComputedStyle(i), ie = O.width, Me = O.height, p = O.position, me = i.style.left, ee = i.style.top, re = i.style.right, A = i.style.bottom, U = i.style.overflow, L = j(j({}, s[t]), u), B = F.createElement("div");
257
- (k = i.parentElement) === null || k === void 0 || k.appendChild(B), B.style.left = "".concat(i.offsetLeft, "px"), B.style.top = "".concat(i.offsetTop, "px"), B.style.position = p, B.style.height = "".concat(i.offsetHeight, "px"), B.style.width = "".concat(i.offsetWidth, "px"), i.style.left = "0", i.style.top = "0", i.style.right = "auto", i.style.bottom = "auto", i.style.overflow = "hidden";
258
- var m;
259
- if (Array.isArray(r))
260
- m = {
261
- x: r[0],
262
- y: r[1],
263
- width: 0,
264
- height: 0
265
- };
266
- else {
267
- var Z = r.getBoundingClientRect();
268
- m = {
269
- x: Z.x,
270
- y: Z.y,
271
- width: Z.width,
272
- height: Z.height
273
- };
274
- }
275
- var C = i.getBoundingClientRect(), se = F.documentElement, ae = se.clientWidth, ar = se.clientHeight, Ue = se.scrollWidth, he = se.scrollHeight, Ge = se.scrollTop, te = se.scrollLeft, H = C.height, I = C.width, le = m.height, ue = m.width, Je = {
276
- left: 0,
277
- top: 0,
278
- right: ae,
279
- bottom: ar
280
- }, tr = {
281
- left: -te,
282
- top: -Ge,
283
- right: Ue - te,
284
- bottom: he - Ge
285
- }, V = L.htmlRegion, Ke = "visible", Pe = "visibleFirst";
286
- V !== "scroll" && V !== Pe && (V = Ke);
287
- var G = V === Pe, ge = da(tr, W), w = da(Je, W), xe = V === Ke ? w : ge, _ = G ? w : xe;
288
- i.style.left = "auto", i.style.top = "auto", i.style.right = "0", i.style.bottom = "0";
289
- var gr = i.getBoundingClientRect();
290
- i.style.left = me, i.style.top = ee, i.style.right = re, i.style.bottom = A, i.style.overflow = U, (y = i.parentElement) === null || y === void 0 || y.removeChild(B);
291
- var We = mr(Math.round(I / parseFloat(ie) * 1e3) / 1e3), $e = mr(Math.round(H / parseFloat(Me) * 1e3) / 1e3);
292
- if (We === 0 || $e === 0 || na(r) && !Wa(r))
293
- return;
294
- var yr = L.offset, ne = L.targetOffset, Vr = ha(C, yr), wr = x(Vr, 2), oe = wr[0], X = wr[1], ve = ha(m, ne), br = x(ve, 2), Cr = br[0], jr = br[1];
295
- m.x -= Cr, m.y -= jr;
296
- var Qe = L.points || [], J = x(Qe, 2), ke = J[0], Ar = J[1], ye = ga(Ar), K = ga(ke), Mr = er(m, ye), nr = er(C, K), Se = j({}, L), S = Mr.x - nr.x + oe, f = Mr.y - nr.y + X, ce = Y(S, f), fe = Y(S, f, w), Be = er(m, ["t", "l"]), or = er(C, ["t", "l"]), ir = er(m, ["b", "r"]), sr = er(C, ["b", "r"]), q = L.overflow || {}, qr = q.adjustX, Pr = q.adjustY, Ze = q.shiftX, lr = q.shiftY, kr = function(Ae) {
297
- return typeof Ae == "boolean" ? Ae : Ae >= 0;
298
- }, Ne, De, Te, Ie;
299
- Hr();
300
- var ur = kr(Pr), vr = K[0] === ye[0];
301
- if (ur && K[0] === "t" && (De > _.bottom || c.current.bt)) {
302
- var He = f;
303
- vr ? He -= H - le : He = Be.y - sr.y - X;
304
- var Re = Y(S, He), Ur = Y(S, He, w);
305
- // Of course use larger one
306
- Re > ce || Re === ce && (!G || // Choose recommend one
307
- Ur >= fe) ? (c.current.bt = !0, f = He, X = -X, Se.points = [ze(K, 0), ze(ye, 0)]) : c.current.bt = !1;
308
- }
309
- if (ur && K[0] === "b" && (Ne < _.top || c.current.tb)) {
310
- var E = f;
311
- vr ? E += H - le : E = ir.y - or.y - X;
312
- var Sr = Y(S, E), Gr = Y(S, E, w);
313
- // Of course use larger one
314
- Sr > ce || Sr === ce && (!G || // Choose recommend one
315
- Gr >= fe) ? (c.current.tb = !0, f = E, X = -X, Se.points = [ze(K, 0), ze(ye, 0)]) : c.current.tb = !1;
316
- }
317
- var Nr = kr(qr), Dr = K[1] === ye[1];
318
- if (Nr && K[1] === "l" && (Ie > _.right || c.current.rl)) {
319
- var Ee = S;
320
- Dr ? Ee -= I - ue : Ee = Be.x - sr.x - oe;
321
- var Tr = Y(Ee, f), Jr = Y(Ee, f, w);
322
- // Of course use larger one
323
- Tr > ce || Tr === ce && (!G || // Choose recommend one
324
- Jr >= fe) ? (c.current.rl = !0, S = Ee, oe = -oe, Se.points = [ze(K, 1), ze(ye, 1)]) : c.current.rl = !1;
325
- }
326
- if (Nr && K[1] === "r" && (Te < _.left || c.current.lr)) {
327
- var Fe = S;
328
- Dr ? Fe += I - ue : Fe = ir.x - or.x - oe;
329
- var Lr = Y(Fe, f), _e = Y(Fe, f, w);
330
- // Of course use larger one
331
- Lr > ce || Lr === ce && (!G || // Choose recommend one
332
- _e >= fe) ? (c.current.lr = !0, S = Fe, oe = -oe, Se.points = [ze(K, 1), ze(ye, 1)]) : c.current.lr = !1;
333
- }
334
- Hr();
335
- var we = Ze === !0 ? 0 : Ze;
336
- typeof we == "number" && (Te < w.left && (S -= Te - w.left - oe, m.x + ue < w.left + we && (S += m.x - w.left + ue - we)), Ie > w.right && (S -= Ie - w.right - oe, m.x > w.right - we && (S += m.x - w.right + we)));
337
- var Ve = lr === !0 ? 0 : lr;
338
- typeof Ve == "number" && (Ne < w.top && (f -= Ne - w.top - X, m.y + le < w.top + Ve && (f += m.y - w.top + le - Ve)), De > w.bottom && (f -= De - w.bottom - X, m.y > w.bottom - Ve && (f += m.y - w.bottom + Ve)));
339
- var Xe = C.x + S, Ye = Xe + I, be = C.y + f, zr = be + H, je = m.x, Le = je + ue, xr = m.y, Kr = xr + le, Qr = Math.max(Xe, je), Wr = Math.min(Ye, Le), Zr = (Qr + Wr) / 2, Ir = Zr - Xe, _r = Math.max(be, xr), $r = Math.min(zr, Kr), Xr = (_r + $r) / 2, Yr = Xr - be;
340
- v == null || v(n, Se);
341
- var Br = gr.right - C.x - (S + C.width), Or = gr.bottom - C.y - (f + C.height);
342
- T({
343
- ready: !0,
344
- offsetX: S / We,
345
- offsetY: f / $e,
346
- offsetR: Br / We,
347
- offsetB: Or / $e,
348
- arrowX: Ir / We,
349
- arrowY: Yr / $e,
350
- scaleX: We,
351
- scaleY: $e,
352
- align: Se
353
- });
354
- }
355
- }), D = function() {
356
- g.current += 1;
357
- var y = g.current;
358
- Promise.resolve().then(function() {
359
- g.current === y && R();
360
- });
361
- }, $ = function() {
362
- T(function(y) {
363
- return j(j({}, y), {}, {
364
- ready: !1
365
- });
366
- });
367
- };
368
- return de($, [t]), de(function() {
369
- e || $();
370
- }, [e]), [b.ready, b.offsetX, b.offsetY, b.offsetR, b.offsetB, b.arrowX, b.arrowY, b.scaleX, b.scaleY, b.align, D];
371
- }
372
- function ja(e, n, r, t, s) {
373
- de(function() {
374
- if (e && n && r) {
375
- let g = function() {
376
- t(), s();
377
- };
378
- var u = n, v = r, d = ia(u), h = ia(v), b = hr(v), T = new Set([b].concat(la(d), la(h)));
379
- return T.forEach(function(W) {
380
- W.addEventListener("scroll", g, {
381
- passive: !0
382
- });
383
- }), b.addEventListener("resize", g, {
384
- passive: !0
385
- }), t(), function() {
386
- T.forEach(function(W) {
387
- W.removeEventListener("scroll", g), b.removeEventListener("resize", g);
388
- });
389
- };
390
- }
391
- }, [e, n, r]);
392
- }
393
- function Aa(e, n, r, t, s, u, v, d) {
394
- var h = o.useRef(e), b = o.useRef(!1);
395
- h.current !== e && (b.current = !0, h.current = e), o.useEffect(function() {
396
- var T = ua(function() {
397
- b.current = !1;
398
- });
399
- return function() {
400
- ua.cancel(T);
401
- };
402
- }, [e]), o.useEffect(function() {
403
- if (n && t && (!s || u)) {
404
- var T = function() {
405
- var p = !1, me = function(A) {
406
- var U = A.target;
407
- p = v(U);
408
- }, ee = function(A) {
409
- var U = A.target;
410
- !b.current && h.current && !p && !v(U) && d(!1);
411
- };
412
- return [me, ee];
413
- }, g = T(), W = x(g, 2), c = W[0], N = W[1], R = T(), D = x(R, 2), $ = D[0], k = D[1], y = hr(t);
414
- y.addEventListener("mousedown", c, !0), y.addEventListener("click", N, !0), y.addEventListener("contextmenu", N, !0);
415
- var i = oa(r);
416
- if (i && (i.addEventListener("mousedown", $, !0), i.addEventListener("click", k, !0), i.addEventListener("contextmenu", k, !0)), process.env.NODE_ENV !== "production") {
417
- var F, Q, O = r == null || (F = r.getRootNode) === null || F === void 0 ? void 0 : F.call(r), ie = (Q = t.getRootNode) === null || Q === void 0 ? void 0 : Q.call(t);
418
- La(O === ie, "trigger element and popup element should in same shadow root.");
419
- }
420
- return function() {
421
- y.removeEventListener("mousedown", c, !0), y.removeEventListener("click", N, !0), y.removeEventListener("contextmenu", N, !0), i && (i.removeEventListener("mousedown", $, !0), i.removeEventListener("click", k, !0), i.removeEventListener("contextmenu", k, !0));
422
- };
423
- }
424
- }, [n, r, t, s, u]);
425
- }
426
- var qa = ["prefixCls", "children", "action", "showAction", "hideAction", "popupVisible", "defaultPopupVisible", "onPopupVisibleChange", "afterPopupVisibleChange", "mouseEnterDelay", "mouseLeaveDelay", "focusDelay", "blurDelay", "mask", "maskClosable", "getPopupContainer", "forceRender", "autoDestroy", "destroyPopupOnHide", "popup", "popupClassName", "popupStyle", "popupPlacement", "builtinPlacements", "popupAlign", "zIndex", "stretch", "getPopupClassNameFromAlign", "fresh", "alignPoint", "onPopupClick", "onPopupAlign", "arrow", "popupMotion", "maskMotion", "popupTransitionName", "popupAnimation", "maskTransitionName", "maskAnimation", "className", "getTriggerDOMNode"];
427
- function Ua() {
428
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ba, n = /* @__PURE__ */ o.forwardRef(function(r, t) {
429
- var s = r.prefixCls, u = s === void 0 ? "rc-trigger-popup" : s, v = r.children, d = r.action, h = d === void 0 ? "hover" : d, b = r.showAction, T = r.hideAction, g = r.popupVisible, W = r.defaultPopupVisible, c = r.onPopupVisibleChange, N = r.afterPopupVisibleChange, R = r.mouseEnterDelay, D = r.mouseLeaveDelay, $ = D === void 0 ? 0.1 : D, k = r.focusDelay, y = r.blurDelay, i = r.mask, F = r.maskClosable, Q = F === void 0 ? !0 : F, O = r.getPopupContainer, ie = r.forceRender, Me = r.autoDestroy, p = r.destroyPopupOnHide, me = r.popup, ee = r.popupClassName, re = r.popupStyle, A = r.popupPlacement, U = r.builtinPlacements, L = U === void 0 ? {} : U, B = r.popupAlign, m = r.zIndex, Z = r.stretch, C = r.getPopupClassNameFromAlign, se = r.fresh, ae = r.alignPoint, ar = r.onPopupClick, Ue = r.onPopupAlign, he = r.arrow, Ge = r.popupMotion, te = r.maskMotion, H = r.popupTransitionName, I = r.popupAnimation, le = r.maskTransitionName, ue = r.maskAnimation, Je = r.className, tr = r.getTriggerDOMNode, V = za(r, qa), Ke = Me || p || !1, Pe = o.useState(!1), G = x(Pe, 2), ge = G[0], w = G[1];
430
- de(function() {
431
- w($a());
432
- }, []);
433
- var xe = o.useRef({}), _ = o.useContext(va), gr = o.useMemo(function() {
434
- return {
435
- registerSubPopup: function(l, M) {
436
- xe.current[l] = M, _ == null || _.registerSubPopup(l, M);
437
- }
438
- };
439
- }, [_]), We = xa(), $e = o.useState(null), yr = x($e, 2), ne = yr[0], Vr = yr[1], wr = qe(function(a) {
440
- na(a) && ne !== a && Vr(a), _ == null || _.registerSubPopup(We, a);
441
- }), oe = o.useState(null), X = x(oe, 2), ve = X[0], br = X[1], Cr = o.useRef(null), jr = qe(function(a) {
442
- na(a) && ve !== a && (br(a), Cr.current = a);
443
- }), Qe = o.Children.only(v), J = (Qe == null ? void 0 : Qe.props) || {}, ke = {}, Ar = qe(function(a) {
444
- var l, M, z = ve;
445
- return (z == null ? void 0 : z.contains(a)) || ((l = oa(z)) === null || l === void 0 ? void 0 : l.host) === a || a === z || (ne == null ? void 0 : ne.contains(a)) || ((M = oa(ne)) === null || M === void 0 ? void 0 : M.host) === a || a === ne || Object.values(xe.current).some(function(P) {
446
- return (P == null ? void 0 : P.contains(a)) || a === P;
447
- });
448
- }), ye = fa(u, Ge, I, H), K = fa(u, te, ue, le), Mr = o.useState(W || !1), nr = x(Mr, 2), Se = nr[0], S = nr[1], f = g ?? Se, ce = qe(function(a) {
449
- g === void 0 && S(a);
450
- });
451
- de(function() {
452
- S(g || !1);
453
- }, [g]);
454
- var fe = o.useRef(f);
455
- fe.current = f;
456
- var Be = o.useRef([]);
457
- Be.current = [];
458
- var or = qe(function(a) {
459
- var l;
460
- ce(a), ((l = Be.current[Be.current.length - 1]) !== null && l !== void 0 ? l : f) !== a && (Be.current.push(a), c == null || c(a));
461
- }), ir = o.useRef(), sr = function() {
462
- clearTimeout(ir.current);
463
- }, q = function(l) {
464
- var M = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
465
- sr(), M === 0 ? or(l) : ir.current = setTimeout(function() {
466
- or(l);
467
- }, M * 1e3);
468
- };
469
- o.useEffect(function() {
470
- return sr;
471
- }, []);
472
- var qr = o.useState(!1), Pr = x(qr, 2), Ze = Pr[0], lr = Pr[1];
473
- de(function(a) {
474
- (!a || f) && lr(!0);
475
- }, [f]);
476
- var kr = o.useState(null), Ne = x(kr, 2), De = Ne[0], Te = Ne[1], Ie = o.useState([0, 0]), ur = x(Ie, 2), vr = ur[0], He = ur[1], Re = function(l) {
477
- He([l.clientX, l.clientY]);
478
- }, Ur = Va(f, ne, ae ? vr : ve, A, L, B, Ue), E = x(Ur, 11), Sr = E[0], Gr = E[1], Nr = E[2], Dr = E[3], Ee = E[4], Tr = E[5], Jr = E[6], Fe = E[7], Lr = E[8], _e = E[9], we = E[10], Ve = Ra(ge, h, b, T), Xe = x(Ve, 2), Ye = Xe[0], be = Xe[1], zr = Ye.has("click"), je = be.has("click") || be.has("contextMenu"), Le = qe(function() {
479
- Ze || we();
480
- }), xr = function() {
481
- fe.current && ae && je && q(!1);
482
- };
483
- ja(f, ve, ne, Le, xr), de(function() {
484
- Le();
485
- }, [vr, A]), de(function() {
486
- f && !(L != null && L[A]) && Le();
487
- }, [JSON.stringify(B)]);
488
- var Kr = o.useMemo(function() {
489
- var a = Fa(L, u, _e, ae);
490
- return rr(a, C == null ? void 0 : C(_e));
491
- }, [_e, C, L, u, ae]);
492
- o.useImperativeHandle(t, function() {
493
- return {
494
- nativeElement: Cr.current,
495
- forceAlign: Le
496
- };
497
- });
498
- var Qr = o.useState(0), Wr = x(Qr, 2), Zr = Wr[0], Ir = Wr[1], _r = o.useState(0), $r = x(_r, 2), Xr = $r[0], Yr = $r[1], Br = function() {
499
- if (Z && ve) {
500
- var l = ve.getBoundingClientRect();
501
- Ir(l.width), Yr(l.height);
502
- }
503
- }, Or = function() {
504
- Br(), Le();
505
- }, Y = function(l) {
506
- lr(!1), we(), N == null || N(l);
507
- }, Hr = function() {
508
- return new Promise(function(l) {
509
- Br(), Te(function() {
510
- return l;
511
- });
512
- });
513
- };
514
- de(function() {
515
- De && (we(), De(), Te(null));
516
- }, [De]);
517
- function Ce(a, l, M, z) {
518
- ke[a] = function(P) {
519
- var Er;
520
- z == null || z(P), q(l, M);
521
- for (var ta = arguments.length, sa = new Array(ta > 1 ? ta - 1 : 0), Fr = 1; Fr < ta; Fr++)
522
- sa[Fr - 1] = arguments[Fr];
523
- (Er = J[a]) === null || Er === void 0 || Er.call.apply(Er, [J, P].concat(sa));
524
- };
525
- }
526
- (zr || je) && (ke.onClick = function(a) {
527
- var l;
528
- fe.current && je ? q(!1) : !fe.current && zr && (Re(a), q(!0));
529
- for (var M = arguments.length, z = new Array(M > 1 ? M - 1 : 0), P = 1; P < M; P++)
530
- z[P - 1] = arguments[P];
531
- (l = J.onClick) === null || l === void 0 || l.call.apply(l, [J, a].concat(z));
532
- }), Aa(f, je, ve, ne, i, Q, Ar, q);
533
- var Ae = Ye.has("hover"), Oe = be.has("hover"), pe, cr;
534
- Ae && (Ce("onMouseEnter", !0, R, function(a) {
535
- Re(a);
536
- }), Ce("onPointerEnter", !0, R, function(a) {
537
- Re(a);
538
- }), pe = function() {
539
- (f || Ze) && q(!0, R);
540
- }, ae && (ke.onMouseMove = function(a) {
541
- var l;
542
- (l = J.onMouseMove) === null || l === void 0 || l.call(J, a);
543
- })), Oe && (Ce("onMouseLeave", !1, $), Ce("onPointerLeave", !1, $), cr = function() {
544
- q(!1, $);
545
- }), Ye.has("focus") && Ce("onFocus", !0, k), be.has("focus") && Ce("onBlur", !1, y), Ye.has("contextMenu") && (ke.onContextMenu = function(a) {
546
- var l;
547
- fe.current && be.has("contextMenu") ? q(!1) : (Re(a), q(!0)), a.preventDefault();
548
- for (var M = arguments.length, z = new Array(M > 1 ? M - 1 : 0), P = 1; P < M; P++)
549
- z[P - 1] = arguments[P];
550
- (l = J.onContextMenu) === null || l === void 0 || l.call.apply(l, [J, a].concat(z));
551
- }), Je && (ke.className = rr(J.className, Je));
552
- var fr = j(j({}, J), ke), Rr = {}, pr = ["onContextMenu", "onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur"];
553
- pr.forEach(function(a) {
554
- V[a] && (Rr[a] = function() {
555
- for (var l, M = arguments.length, z = new Array(M), P = 0; P < M; P++)
556
- z[P] = arguments[P];
557
- (l = fr[a]) === null || l === void 0 || l.call.apply(l, [fr].concat(z)), V[a].apply(V, z);
558
- });
559
- });
560
- var ea = /* @__PURE__ */ o.cloneElement(Qe, j(j({}, fr), Rr)), ra = {
561
- x: Tr,
562
- y: Jr
563
- }, aa = he ? j({}, he !== !0 ? he : {}) : null;
564
- return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Ca, {
565
- disabled: !f,
566
- ref: jr,
567
- onResize: Or
568
- }, /* @__PURE__ */ o.createElement(ka, {
569
- getTriggerDOMNode: tr
570
- }, ea)), /* @__PURE__ */ o.createElement(va.Provider, {
571
- value: gr
572
- }, /* @__PURE__ */ o.createElement(Pa, {
573
- portal: e,
574
- ref: wr,
575
- prefixCls: u,
576
- popup: me,
577
- className: rr(ee, Kr),
578
- style: re,
579
- target: ve,
580
- onMouseEnter: pe,
581
- onMouseLeave: cr,
582
- onPointerEnter: pe,
583
- zIndex: m,
584
- open: f,
585
- keepDom: Ze,
586
- fresh: se,
587
- onClick: ar,
588
- mask: i,
589
- motion: ye,
590
- maskMotion: K,
591
- onVisibleChanged: Y,
592
- onPrepare: Hr,
593
- forceRender: ie,
594
- autoDestroy: Ke,
595
- getPopupContainer: O,
596
- align: _e,
597
- arrow: aa,
598
- arrowPos: ra,
599
- ready: Sr,
600
- offsetX: Gr,
601
- offsetY: Nr,
602
- offsetR: Dr,
603
- offsetB: Ee,
604
- onAlign: Le,
605
- stretch: Z,
606
- targetWidth: Zr / Fe,
607
- targetHeight: Xr / Lr
608
- })));
609
- });
610
- return process.env.NODE_ENV !== "production" && (n.displayName = "Trigger"), n;
611
- }
612
- const Ia = Ua(ba);
613
- export {
614
- Ia as T,
615
- $a as i
616
- };