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,819 +0,0 @@
1
- import * as H from "react";
2
- import a, { forwardRef as F, useContext as D, useMemo as Do, useState as ao, Children as Ro, useEffect as uo, createRef as _o } from "react";
3
- import { c as $ } from "./index-NQd_zMf0.js";
4
- import { o as Ao } from "./omit-ylWA0ZLZ.js";
5
- import { C as fo, u as Mo, D as ho, F as Fo, m as L, $ as R, h as Vo, d as E, a0 as qo, B as Uo, a1 as Xo, G as Jo } from "./index-1KQbTQJ2.js";
6
- import { W as Ko } from "./index-ZT64Ec6u.js";
7
- import { a as Qo, b as Yo } from "./Compact-fdEKV_mF.js";
8
- import { c as Zo, a as ko } from "./reactNode-R20zZQk1.js";
9
- import { L as oe } from "./LoadingOutlined-6Ipqn0og.js";
10
- import { g as ee } from "./compact-item-jjuVmDBH.js";
11
- var te = function(o, e) {
12
- var t = {};
13
- for (var r in o)
14
- Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
15
- if (o != null && typeof Object.getOwnPropertySymbols == "function")
16
- for (var n = 0, r = Object.getOwnPropertySymbols(o); n < r.length; n++)
17
- e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[n]) && (t[r[n]] = o[r[n]]);
18
- return t;
19
- };
20
- const So = /* @__PURE__ */ H.createContext(void 0), re = (o) => {
21
- const {
22
- getPrefixCls: e,
23
- direction: t
24
- } = H.useContext(fo), {
25
- prefixCls: r,
26
- size: n,
27
- className: l
28
- } = o, i = te(o, ["prefixCls", "size", "className"]), c = e("btn-group", r), [, , u] = Mo();
29
- let d = "";
30
- switch (n) {
31
- case "large":
32
- d = "lg";
33
- break;
34
- case "small":
35
- d = "sm";
36
- break;
37
- }
38
- if (process.env.NODE_ENV !== "production") {
39
- const h = ho("Button.Group");
40
- process.env.NODE_ENV !== "production" && h(!n || ["large", "small", "middle"].includes(n), "usage", "Invalid prop `size`.");
41
- }
42
- const m = $(c, {
43
- [`${c}-${d}`]: d,
44
- [`${c}-rtl`]: t === "rtl"
45
- }, l, u);
46
- return /* @__PURE__ */ H.createElement(So.Provider, {
47
- value: n
48
- }, /* @__PURE__ */ H.createElement("div", Object.assign({}, i, {
49
- className: m
50
- })));
51
- }, ne = re, go = /^[\u4e00-\u9fa5]{2}$/, M = go.test.bind(go);
52
- function Ve(o) {
53
- return o === "danger" ? {
54
- danger: !0
55
- } : {
56
- type: o
57
- };
58
- }
59
- function mo(o) {
60
- return typeof o == "string";
61
- }
62
- function z(o) {
63
- return o === "text" || o === "link";
64
- }
65
- function ie(o, e) {
66
- if (o == null)
67
- return;
68
- const t = e ? " " : "";
69
- return typeof o != "string" && typeof o != "number" && mo(o.type) && M(o.props.children) ? Zo(o, {
70
- children: o.props.children.split("").join(t)
71
- }) : mo(o) ? M(o) ? /* @__PURE__ */ a.createElement("span", null, o.split("").join(t)) : /* @__PURE__ */ a.createElement("span", null, o) : ko(o) ? /* @__PURE__ */ a.createElement("span", null, o) : o;
72
- }
73
- function le(o, e) {
74
- let t = !1;
75
- const r = [];
76
- return a.Children.forEach(o, (n) => {
77
- const l = typeof n, i = l === "string" || l === "number";
78
- if (t && i) {
79
- const c = r.length - 1, u = r[c];
80
- r[c] = `${u}${n}`;
81
- } else
82
- r.push(n);
83
- t = i;
84
- }), a.Children.map(r, (n) => ie(n, e));
85
- }
86
- const ce = /* @__PURE__ */ F((o, e) => {
87
- const {
88
- className: t,
89
- style: r,
90
- children: n,
91
- prefixCls: l
92
- } = o, i = $(`${l}-icon`, t);
93
- return /* @__PURE__ */ a.createElement("span", {
94
- ref: e,
95
- className: i,
96
- style: r
97
- }, n);
98
- }), yo = ce, po = /* @__PURE__ */ F((o, e) => {
99
- let {
100
- prefixCls: t,
101
- className: r,
102
- style: n,
103
- iconClassName: l
104
- } = o;
105
- const i = $(`${t}-loading-icon`, r);
106
- return /* @__PURE__ */ a.createElement(yo, {
107
- prefixCls: t,
108
- className: i,
109
- style: n,
110
- ref: e
111
- }, /* @__PURE__ */ a.createElement(oe, {
112
- className: l
113
- }));
114
- }), _ = () => ({
115
- width: 0,
116
- opacity: 0,
117
- transform: "scale(0)"
118
- }), A = (o) => ({
119
- width: o.scrollWidth,
120
- opacity: 1,
121
- transform: "scale(1)"
122
- }), se = (o) => {
123
- const {
124
- prefixCls: e,
125
- loading: t,
126
- existIcon: r,
127
- className: n,
128
- style: l
129
- } = o, i = !!t;
130
- return r ? /* @__PURE__ */ a.createElement(po, {
131
- prefixCls: e,
132
- className: n,
133
- style: l
134
- }) : /* @__PURE__ */ a.createElement(Fo, {
135
- visible: i,
136
- // We do not really use this motionName
137
- motionName: `${e}-loading-icon-motion`,
138
- motionLeave: i,
139
- removeOnLeave: !0,
140
- onAppearStart: _,
141
- onAppearActive: A,
142
- onEnterStart: _,
143
- onEnterActive: A,
144
- onLeaveStart: A,
145
- onLeaveActive: _
146
- }, (c, u) => {
147
- let {
148
- className: d,
149
- style: m
150
- } = c;
151
- return /* @__PURE__ */ a.createElement(po, {
152
- prefixCls: e,
153
- className: n,
154
- style: Object.assign(Object.assign({}, l), m),
155
- ref: u,
156
- iconClassName: d
157
- });
158
- });
159
- }, ae = se, bo = (o, e) => ({
160
- // Border
161
- [`> span, > ${o}`]: {
162
- "&:not(:last-child)": {
163
- [`&, & > ${o}`]: {
164
- "&:not(:disabled)": {
165
- borderInlineEndColor: e
166
- }
167
- }
168
- },
169
- "&:not(:first-child)": {
170
- [`&, & > ${o}`]: {
171
- "&:not(:disabled)": {
172
- borderInlineStartColor: e
173
- }
174
- }
175
- }
176
- }
177
- }), de = (o) => {
178
- const {
179
- componentCls: e,
180
- fontSize: t,
181
- lineWidth: r,
182
- groupBorderColor: n,
183
- colorErrorHover: l
184
- } = o;
185
- return {
186
- [`${e}-group`]: [
187
- {
188
- position: "relative",
189
- display: "inline-flex",
190
- // Border
191
- [`> span, > ${e}`]: {
192
- "&:not(:last-child)": {
193
- [`&, & > ${e}`]: {
194
- borderStartEndRadius: 0,
195
- borderEndEndRadius: 0
196
- }
197
- },
198
- "&:not(:first-child)": {
199
- marginInlineStart: o.calc(r).mul(-1).equal(),
200
- [`&, & > ${e}`]: {
201
- borderStartStartRadius: 0,
202
- borderEndStartRadius: 0
203
- }
204
- }
205
- },
206
- [e]: {
207
- position: "relative",
208
- zIndex: 1,
209
- "&:hover,\n &:focus,\n &:active": {
210
- zIndex: 2
211
- },
212
- "&[disabled]": {
213
- zIndex: 0
214
- }
215
- },
216
- [`${e}-icon-only`]: {
217
- fontSize: t
218
- }
219
- },
220
- // Border Color
221
- bo(`${e}-primary`, n),
222
- bo(`${e}-danger`, l)
223
- ]
224
- };
225
- }, ue = de, Co = (o) => {
226
- const {
227
- paddingInline: e,
228
- onlyIconSize: t,
229
- paddingBlock: r
230
- } = o;
231
- return L(o, {
232
- buttonPaddingHorizontal: e,
233
- buttonPaddingVertical: r,
234
- buttonIconOnlyFontSize: t
235
- });
236
- }, vo = (o) => {
237
- var e, t, r, n, l, i;
238
- const c = (e = o.contentFontSize) !== null && e !== void 0 ? e : o.fontSize, u = (t = o.contentFontSizeSM) !== null && t !== void 0 ? t : o.fontSize, d = (r = o.contentFontSizeLG) !== null && r !== void 0 ? r : o.fontSizeLG, m = (n = o.contentLineHeight) !== null && n !== void 0 ? n : R(c), h = (l = o.contentLineHeightSM) !== null && l !== void 0 ? l : R(u), I = (i = o.contentLineHeightLG) !== null && i !== void 0 ? i : R(d);
239
- return {
240
- fontWeight: 400,
241
- defaultShadow: `0 ${o.controlOutlineWidth}px 0 ${o.controlTmpOutline}`,
242
- primaryShadow: `0 ${o.controlOutlineWidth}px 0 ${o.controlOutline}`,
243
- dangerShadow: `0 ${o.controlOutlineWidth}px 0 ${o.colorErrorOutline}`,
244
- primaryColor: o.colorTextLightSolid,
245
- dangerColor: o.colorTextLightSolid,
246
- borderColorDisabled: o.colorBorder,
247
- defaultGhostColor: o.colorBgContainer,
248
- ghostBg: "transparent",
249
- defaultGhostBorderColor: o.colorBgContainer,
250
- paddingInline: o.paddingContentHorizontal - o.lineWidth,
251
- paddingInlineLG: o.paddingContentHorizontal - o.lineWidth,
252
- paddingInlineSM: 8 - o.lineWidth,
253
- onlyIconSize: o.fontSizeLG,
254
- onlyIconSizeSM: o.fontSizeLG - 2,
255
- onlyIconSizeLG: o.fontSizeLG + 2,
256
- groupBorderColor: o.colorPrimaryHover,
257
- linkHoverBg: "transparent",
258
- textHoverBg: o.colorBgTextHover,
259
- defaultColor: o.colorText,
260
- defaultBg: o.colorBgContainer,
261
- defaultBorderColor: o.colorBorder,
262
- defaultBorderColorDisabled: o.colorBorder,
263
- contentFontSize: c,
264
- contentFontSizeSM: u,
265
- contentFontSizeLG: d,
266
- contentLineHeight: m,
267
- contentLineHeightSM: h,
268
- contentLineHeightLG: I,
269
- paddingBlock: Math.max((o.controlHeight - c * m) / 2 - o.lineWidth, 0),
270
- paddingBlockSM: Math.max((o.controlHeightSM - u * h) / 2 - o.lineWidth, 0),
271
- paddingBlockLG: Math.max((o.controlHeightLG - d * I) / 2 - o.lineWidth, 0)
272
- };
273
- }, ge = (o) => {
274
- const {
275
- componentCls: e,
276
- iconCls: t,
277
- fontWeight: r
278
- } = o;
279
- return {
280
- [e]: {
281
- outline: "none",
282
- position: "relative",
283
- display: "inline-block",
284
- fontWeight: r,
285
- whiteSpace: "nowrap",
286
- textAlign: "center",
287
- backgroundImage: "none",
288
- background: "transparent",
289
- border: `${E(o.lineWidth)} ${o.lineType} transparent`,
290
- cursor: "pointer",
291
- transition: `all ${o.motionDurationMid} ${o.motionEaseInOut}`,
292
- userSelect: "none",
293
- touchAction: "manipulation",
294
- color: o.colorText,
295
- "&:disabled > *": {
296
- pointerEvents: "none"
297
- },
298
- "> span": {
299
- display: "inline-block"
300
- },
301
- [`${e}-icon`]: {
302
- lineHeight: 0
303
- },
304
- // Leave a space between icon and text.
305
- [`> ${t} + span, > span + ${t}`]: {
306
- marginInlineStart: o.marginXS
307
- },
308
- [`&:not(${e}-icon-only) > ${e}-icon`]: {
309
- [`&${e}-loading-icon, &:not(:last-child)`]: {
310
- marginInlineEnd: o.marginXS
311
- }
312
- },
313
- "> a": {
314
- color: "currentColor"
315
- },
316
- "&:not(:disabled)": Object.assign({}, qo(o)),
317
- [`&${e}-two-chinese-chars::first-letter`]: {
318
- letterSpacing: "0.34em"
319
- },
320
- [`&${e}-two-chinese-chars > *:not(${t})`]: {
321
- marginInlineEnd: "-0.34em",
322
- letterSpacing: "0.34em"
323
- },
324
- // make `btn-icon-only` not too narrow
325
- [`&-icon-only${e}-compact-item`]: {
326
- flex: "none"
327
- }
328
- }
329
- };
330
- }, f = (o, e, t) => ({
331
- [`&:not(:disabled):not(${o}-disabled)`]: {
332
- "&:hover": e,
333
- "&:active": t
334
- }
335
- }), me = (o) => ({
336
- minWidth: o.controlHeight,
337
- paddingInlineStart: 0,
338
- paddingInlineEnd: 0,
339
- borderRadius: "50%"
340
- }), pe = (o) => ({
341
- borderRadius: o.controlHeight,
342
- paddingInlineStart: o.calc(o.controlHeight).div(2).equal(),
343
- paddingInlineEnd: o.calc(o.controlHeight).div(2).equal()
344
- }), be = (o) => ({
345
- cursor: "not-allowed",
346
- borderColor: o.borderColorDisabled,
347
- color: o.colorTextDisabled,
348
- background: o.colorBgContainerDisabled,
349
- boxShadow: "none"
350
- }), x = (o, e, t, r, n, l, i, c) => ({
351
- [`&${o}-background-ghost`]: Object.assign(Object.assign({
352
- color: t || void 0,
353
- background: e,
354
- borderColor: r || void 0,
355
- boxShadow: "none"
356
- }, f(o, Object.assign({
357
- background: e
358
- }, i), Object.assign({
359
- background: e
360
- }, c))), {
361
- "&:disabled": {
362
- cursor: "not-allowed",
363
- color: n || void 0,
364
- borderColor: l || void 0
365
- }
366
- })
367
- }), V = (o) => ({
368
- [`&:disabled, &${o.componentCls}-disabled`]: Object.assign({}, be(o))
369
- }), $o = (o) => Object.assign({}, V(o)), j = (o) => ({
370
- [`&:disabled, &${o.componentCls}-disabled`]: {
371
- cursor: "not-allowed",
372
- color: o.colorTextDisabled
373
- }
374
- }), Bo = (o) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, $o(o)), {
375
- background: o.defaultBg,
376
- borderColor: o.defaultBorderColor,
377
- color: o.defaultColor,
378
- boxShadow: o.defaultShadow
379
- }), f(o.componentCls, {
380
- color: o.colorPrimaryHover,
381
- borderColor: o.colorPrimaryHover
382
- }, {
383
- color: o.colorPrimaryActive,
384
- borderColor: o.colorPrimaryActive
385
- })), x(o.componentCls, o.ghostBg, o.defaultGhostColor, o.defaultGhostBorderColor, o.colorTextDisabled, o.colorBorder)), {
386
- [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign(Object.assign({
387
- color: o.colorError,
388
- borderColor: o.colorError
389
- }, f(o.componentCls, {
390
- color: o.colorErrorHover,
391
- borderColor: o.colorErrorBorderHover
392
- }, {
393
- color: o.colorErrorActive,
394
- borderColor: o.colorErrorActive
395
- })), x(o.componentCls, o.ghostBg, o.colorError, o.colorError, o.colorTextDisabled, o.colorBorder)), V(o))
396
- }), fe = (o) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, $o(o)), {
397
- color: o.primaryColor,
398
- background: o.colorPrimary,
399
- boxShadow: o.primaryShadow
400
- }), f(o.componentCls, {
401
- color: o.colorTextLightSolid,
402
- background: o.colorPrimaryHover
403
- }, {
404
- color: o.colorTextLightSolid,
405
- background: o.colorPrimaryActive
406
- })), x(o.componentCls, o.ghostBg, o.colorPrimary, o.colorPrimary, o.colorTextDisabled, o.colorBorder, {
407
- color: o.colorPrimaryHover,
408
- borderColor: o.colorPrimaryHover
409
- }, {
410
- color: o.colorPrimaryActive,
411
- borderColor: o.colorPrimaryActive
412
- })), {
413
- [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign(Object.assign({
414
- background: o.colorError,
415
- boxShadow: o.dangerShadow,
416
- color: o.dangerColor
417
- }, f(o.componentCls, {
418
- background: o.colorErrorHover
419
- }, {
420
- background: o.colorErrorActive
421
- })), x(o.componentCls, o.ghostBg, o.colorError, o.colorError, o.colorTextDisabled, o.colorBorder, {
422
- color: o.colorErrorHover,
423
- borderColor: o.colorErrorHover
424
- }, {
425
- color: o.colorErrorActive,
426
- borderColor: o.colorErrorActive
427
- })), V(o))
428
- }), he = (o) => Object.assign(Object.assign({}, Bo(o)), {
429
- borderStyle: "dashed"
430
- }), Se = (o) => Object.assign(Object.assign(Object.assign({
431
- color: o.colorLink
432
- }, f(o.componentCls, {
433
- color: o.colorLinkHover,
434
- background: o.linkHoverBg
435
- }, {
436
- color: o.colorLinkActive
437
- })), j(o)), {
438
- [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign({
439
- color: o.colorError
440
- }, f(o.componentCls, {
441
- color: o.colorErrorHover
442
- }, {
443
- color: o.colorErrorActive
444
- })), j(o))
445
- }), ye = (o) => Object.assign(Object.assign(Object.assign({}, f(o.componentCls, {
446
- color: o.colorText,
447
- background: o.textHoverBg
448
- }, {
449
- color: o.colorText,
450
- background: o.colorBgTextActive
451
- })), j(o)), {
452
- [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign({
453
- color: o.colorError
454
- }, j(o)), f(o.componentCls, {
455
- color: o.colorErrorHover,
456
- background: o.colorErrorBg
457
- }, {
458
- color: o.colorErrorHover,
459
- background: o.colorErrorBg
460
- }))
461
- }), Ce = (o) => {
462
- const {
463
- componentCls: e
464
- } = o;
465
- return {
466
- [`${e}-default`]: Bo(o),
467
- [`${e}-primary`]: fe(o),
468
- [`${e}-dashed`]: he(o),
469
- [`${e}-link`]: Se(o),
470
- [`${e}-text`]: ye(o),
471
- [`${e}-ghost`]: x(o.componentCls, o.ghostBg, o.colorBgContainer, o.colorBgContainer, o.colorTextDisabled, o.colorBorder)
472
- };
473
- }, q = function(o) {
474
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
475
- const {
476
- componentCls: t,
477
- controlHeight: r,
478
- fontSize: n,
479
- lineHeight: l,
480
- borderRadius: i,
481
- buttonPaddingHorizontal: c,
482
- iconCls: u,
483
- buttonPaddingVertical: d
484
- } = o, m = `${t}-icon-only`;
485
- return [
486
- // Size
487
- {
488
- [`${t}${e}`]: {
489
- fontSize: n,
490
- lineHeight: l,
491
- height: r,
492
- padding: `${E(d)} ${E(c)}`,
493
- borderRadius: i,
494
- [`&${m}`]: {
495
- width: r,
496
- paddingInlineStart: 0,
497
- paddingInlineEnd: 0,
498
- [`&${t}-round`]: {
499
- width: "auto"
500
- },
501
- [u]: {
502
- fontSize: o.buttonIconOnlyFontSize
503
- }
504
- },
505
- // Loading
506
- [`&${t}-loading`]: {
507
- opacity: o.opacityLoading,
508
- cursor: "default"
509
- },
510
- [`${t}-loading-icon`]: {
511
- transition: `width ${o.motionDurationSlow} ${o.motionEaseInOut}, opacity ${o.motionDurationSlow} ${o.motionEaseInOut}`
512
- }
513
- }
514
- },
515
- // Shape - patch prefixCls again to override solid border radius style
516
- {
517
- [`${t}${t}-circle${e}`]: me(o)
518
- },
519
- {
520
- [`${t}${t}-round${e}`]: pe(o)
521
- }
522
- ];
523
- }, ve = (o) => q(L(o, {
524
- fontSize: o.contentFontSize,
525
- lineHeight: o.contentLineHeight
526
- })), $e = (o) => {
527
- const e = L(o, {
528
- controlHeight: o.controlHeightSM,
529
- fontSize: o.contentFontSizeSM,
530
- lineHeight: o.contentLineHeightSM,
531
- padding: o.paddingXS,
532
- buttonPaddingHorizontal: o.paddingInlineSM,
533
- buttonPaddingVertical: o.paddingBlockSM,
534
- borderRadius: o.borderRadiusSM,
535
- buttonIconOnlyFontSize: o.onlyIconSizeSM
536
- });
537
- return q(e, `${o.componentCls}-sm`);
538
- }, Be = (o) => {
539
- const e = L(o, {
540
- controlHeight: o.controlHeightLG,
541
- fontSize: o.contentFontSizeLG,
542
- lineHeight: o.contentLineHeightLG,
543
- buttonPaddingHorizontal: o.paddingInlineLG,
544
- buttonPaddingVertical: o.paddingBlockLG,
545
- borderRadius: o.borderRadiusLG,
546
- buttonIconOnlyFontSize: o.onlyIconSizeLG
547
- });
548
- return q(e, `${o.componentCls}-lg`);
549
- }, Oe = (o) => {
550
- const {
551
- componentCls: e
552
- } = o;
553
- return {
554
- [e]: {
555
- [`&${e}-block`]: {
556
- width: "100%"
557
- }
558
- }
559
- };
560
- }, Ee = Vo("Button", (o) => {
561
- const e = Co(o);
562
- return [
563
- // Shared
564
- ge(e),
565
- // Size
566
- $e(e),
567
- ve(e),
568
- Be(e),
569
- // Block
570
- Oe(e),
571
- // Group (type, ghost, danger, loading)
572
- Ce(e),
573
- // Button Group
574
- ue(e)
575
- ];
576
- }, vo, {
577
- unitless: {
578
- fontWeight: !0,
579
- contentLineHeight: !0,
580
- contentLineHeightSM: !0,
581
- contentLineHeightLG: !0
582
- }
583
- });
584
- function xe(o, e) {
585
- return {
586
- // border collapse
587
- [`&-item:not(${e}-last-item)`]: {
588
- marginBottom: o.calc(o.lineWidth).mul(-1).equal()
589
- },
590
- "&-item": {
591
- "&:hover,&:focus,&:active": {
592
- zIndex: 2
593
- },
594
- "&[disabled]": {
595
- zIndex: 0
596
- }
597
- }
598
- };
599
- }
600
- function Ie(o, e) {
601
- return {
602
- [`&-item:not(${e}-first-item):not(${e}-last-item)`]: {
603
- borderRadius: 0
604
- },
605
- [`&-item${e}-first-item:not(${e}-last-item)`]: {
606
- [`&, &${o}-sm, &${o}-lg`]: {
607
- borderEndEndRadius: 0,
608
- borderEndStartRadius: 0
609
- }
610
- },
611
- [`&-item${e}-last-item:not(${e}-first-item)`]: {
612
- [`&, &${o}-sm, &${o}-lg`]: {
613
- borderStartStartRadius: 0,
614
- borderStartEndRadius: 0
615
- }
616
- }
617
- };
618
- }
619
- function ze(o) {
620
- const e = `${o.componentCls}-compact-vertical`;
621
- return {
622
- [e]: Object.assign(Object.assign({}, xe(o, e)), Ie(o.componentCls, e))
623
- };
624
- }
625
- const He = (o) => {
626
- const {
627
- componentCls: e,
628
- calc: t
629
- } = o;
630
- return {
631
- [e]: {
632
- // Special styles for Primary Button
633
- [`&-compact-item${e}-primary`]: {
634
- [`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]: {
635
- position: "relative",
636
- "&:before": {
637
- position: "absolute",
638
- top: t(o.lineWidth).mul(-1).equal(),
639
- insetInlineStart: t(o.lineWidth).mul(-1).equal(),
640
- display: "inline-block",
641
- width: o.lineWidth,
642
- height: `calc(100% + ${E(o.lineWidth)} * 2)`,
643
- backgroundColor: o.colorPrimaryHover,
644
- content: '""'
645
- }
646
- }
647
- },
648
- // Special styles for Primary Button
649
- "&-compact-vertical-item": {
650
- [`&${e}-primary`]: {
651
- [`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]: {
652
- position: "relative",
653
- "&:before": {
654
- position: "absolute",
655
- top: t(o.lineWidth).mul(-1).equal(),
656
- insetInlineStart: t(o.lineWidth).mul(-1).equal(),
657
- display: "inline-block",
658
- width: `calc(100% + ${E(o.lineWidth)} * 2)`,
659
- height: o.lineWidth,
660
- backgroundColor: o.colorPrimaryHover,
661
- content: '""'
662
- }
663
- }
664
- }
665
- }
666
- }
667
- };
668
- }, je = Uo(["Button", "compact"], (o) => {
669
- const e = Co(o);
670
- return [
671
- // Space Compact
672
- ee(e),
673
- ze(e),
674
- He(e)
675
- ];
676
- }, vo);
677
- var Le = function(o, e) {
678
- var t = {};
679
- for (var r in o)
680
- Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
681
- if (o != null && typeof Object.getOwnPropertySymbols == "function")
682
- for (var n = 0, r = Object.getOwnPropertySymbols(o); n < r.length; n++)
683
- e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[n]) && (t[r[n]] = o[r[n]]);
684
- return t;
685
- };
686
- function Ne(o) {
687
- if (typeof o == "object" && o) {
688
- let e = o == null ? void 0 : o.delay;
689
- return e = !Number.isNaN(e) && typeof e == "number" ? e : 0, {
690
- loading: e <= 0,
691
- delay: e
692
- };
693
- }
694
- return {
695
- loading: !!o,
696
- delay: 0
697
- };
698
- }
699
- const Pe = (o, e) => {
700
- var t, r;
701
- const {
702
- loading: n = !1,
703
- prefixCls: l,
704
- type: i = "default",
705
- danger: c,
706
- shape: u = "default",
707
- size: d,
708
- styles: m,
709
- disabled: h,
710
- className: I,
711
- rootClassName: Oo,
712
- children: C,
713
- icon: S,
714
- ghost: U = !1,
715
- block: Eo = !1,
716
- // React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
717
- htmlType: xo = "button",
718
- classNames: P,
719
- style: Io = {}
720
- } = o, X = Le(o, ["loading", "prefixCls", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "ghost", "block", "htmlType", "classNames", "style"]), {
721
- getPrefixCls: zo,
722
- autoInsertSpaceInButton: J,
723
- direction: K,
724
- button: p
725
- } = D(fo), s = zo("btn", l), [Q, Ho, jo] = Ee(s), Lo = D(Xo), B = h ?? Lo, No = D(So), O = Do(() => Ne(n), [n]), [y, Y] = ao(O.loading), [w, Z] = ao(!1), v = Jo(e, /* @__PURE__ */ _o()), k = Ro.count(C) === 1 && !S && !z(i);
726
- uo(() => {
727
- let g = null;
728
- O.delay > 0 ? g = setTimeout(() => {
729
- g = null, Y(!0);
730
- }, O.delay) : Y(O.loading);
731
- function b() {
732
- g && (clearTimeout(g), g = null);
733
- }
734
- return b;
735
- }, [O]), uo(() => {
736
- if (!v || !v.current || J === !1)
737
- return;
738
- const g = v.current.textContent;
739
- k && M(g) ? w || Z(!0) : w && Z(!1);
740
- }, [v]);
741
- const oo = (g) => {
742
- const {
743
- onClick: b
744
- } = o;
745
- if (y || B) {
746
- g.preventDefault();
747
- return;
748
- }
749
- b == null || b(g);
750
- };
751
- if (process.env.NODE_ENV !== "production") {
752
- const g = ho("Button");
753
- process.env.NODE_ENV !== "production" && g(!(typeof S == "string" && S.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${S}\` at https://ant.design/components/icon`), process.env.NODE_ENV !== "production" && g(!(U && z(i)), "usage", "`link` or `text` button can't be a `ghost` button.");
754
- }
755
- const eo = J !== !1, {
756
- compactSize: Po,
757
- compactItemClassnames: to
758
- } = Qo(s, K), wo = {
759
- large: "lg",
760
- small: "sm",
761
- middle: void 0
762
- }, ro = Yo((g) => {
763
- var b, W;
764
- return (W = (b = d ?? Po) !== null && b !== void 0 ? b : No) !== null && W !== void 0 ? W : g;
765
- }), no = ro && wo[ro] || "", To = y ? "loading" : S, T = Ao(X, ["navigate"]), io = $(s, Ho, jo, {
766
- [`${s}-${u}`]: u !== "default" && u,
767
- [`${s}-${i}`]: i,
768
- [`${s}-${no}`]: no,
769
- [`${s}-icon-only`]: !C && C !== 0 && !!To,
770
- [`${s}-background-ghost`]: U && !z(i),
771
- [`${s}-loading`]: y,
772
- [`${s}-two-chinese-chars`]: w && eo && !y,
773
- [`${s}-block`]: Eo,
774
- [`${s}-dangerous`]: !!c,
775
- [`${s}-rtl`]: K === "rtl"
776
- }, to, I, Oo, p == null ? void 0 : p.className), lo = Object.assign(Object.assign({}, p == null ? void 0 : p.style), Io), Go = $(P == null ? void 0 : P.icon, (t = p == null ? void 0 : p.classNames) === null || t === void 0 ? void 0 : t.icon), Wo = Object.assign(Object.assign({}, (m == null ? void 0 : m.icon) || {}), ((r = p == null ? void 0 : p.styles) === null || r === void 0 ? void 0 : r.icon) || {}), co = S && !y ? /* @__PURE__ */ a.createElement(yo, {
777
- prefixCls: s,
778
- className: Go,
779
- style: Wo
780
- }, S) : /* @__PURE__ */ a.createElement(ae, {
781
- existIcon: !!S,
782
- prefixCls: s,
783
- loading: !!y
784
- }), so = C || C === 0 ? le(C, k && eo) : null;
785
- if (T.href !== void 0)
786
- return Q(/* @__PURE__ */ a.createElement("a", Object.assign({}, T, {
787
- className: $(io, {
788
- [`${s}-disabled`]: B
789
- }),
790
- href: B ? void 0 : T.href,
791
- style: lo,
792
- onClick: oo,
793
- ref: v,
794
- tabIndex: B ? -1 : 0
795
- }), co, so));
796
- let G = /* @__PURE__ */ a.createElement("button", Object.assign({}, X, {
797
- type: xo,
798
- className: io,
799
- style: lo,
800
- onClick: oo,
801
- disabled: B,
802
- ref: v
803
- }), co, so, to && /* @__PURE__ */ a.createElement(je, {
804
- key: "compact",
805
- prefixCls: s
806
- }));
807
- return z(i) || (G = /* @__PURE__ */ a.createElement(Ko, {
808
- component: "Button",
809
- disabled: !!y
810
- }, G)), Q(G);
811
- }, N = /* @__PURE__ */ F(Pe);
812
- process.env.NODE_ENV !== "production" && (N.displayName = "Button");
813
- N.Group = ne;
814
- N.__ANT_BUTTON = !0;
815
- const qe = N;
816
- export {
817
- qe as B,
818
- Ve as c
819
- };