antd3-esm 1.0.1

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 (174) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Checkbox.js +164 -0
  3. package/dist/CommonMixin.js +816 -0
  4. package/dist/Divider.js +646 -0
  5. package/dist/Notification.js +279 -0
  6. package/dist/Pagination.js +1106 -0
  7. package/dist/PortalWrapper.js +347 -0
  8. package/dist/RowContext.js +5 -0
  9. package/dist/Sider.js +533 -0
  10. package/dist/TextArea.js +432 -0
  11. package/dist/_arrayMap.js +68 -0
  12. package/dist/_assignValue.js +95 -0
  13. package/dist/_copyArray.js +31 -0
  14. package/dist/_hasPath.js +53 -0
  15. package/dist/_overArg.js +437 -0
  16. package/dist/_stringToArray.js +136 -0
  17. package/dist/antd/es/affix.js +12 -0
  18. package/dist/antd/es/alert.js +5 -0
  19. package/dist/antd/es/anchor.js +466 -0
  20. package/dist/antd/es/auto-complete.js +5 -0
  21. package/dist/antd/es/avatar.js +5 -0
  22. package/dist/antd/es/back-top.js +5 -0
  23. package/dist/antd/es/badge.js +5 -0
  24. package/dist/antd/es/breadcrumb.js +18 -0
  25. package/dist/antd/es/button.js +12 -0
  26. package/dist/antd/es/calendar.js +953 -0
  27. package/dist/antd/es/card.js +5 -0
  28. package/dist/antd/es/carousel.js +5 -0
  29. package/dist/antd/es/cascader.js +1275 -0
  30. package/dist/antd/es/checkbox.js +11 -0
  31. package/dist/antd/es/col.js +4 -0
  32. package/dist/antd/es/collapse.js +688 -0
  33. package/dist/antd/es/comment.js +5 -0
  34. package/dist/antd/es/config-provider.js +2 -0
  35. package/dist/antd/es/date-picker.js +4322 -0
  36. package/dist/antd/es/descriptions.js +342 -0
  37. package/dist/antd/es/divider.js +53 -0
  38. package/dist/antd/es/drawer.js +1115 -0
  39. package/dist/antd/es/dropdown.js +14 -0
  40. package/dist/antd/es/empty.js +6 -0
  41. package/dist/antd/es/form.js +5008 -0
  42. package/dist/antd/es/grid.js +13 -0
  43. package/dist/antd/es/icon.js +6 -0
  44. package/dist/antd/es/input-number.js +5 -0
  45. package/dist/antd/es/input.js +16 -0
  46. package/dist/antd/es/layout.js +14 -0
  47. package/dist/antd/es/list.js +5 -0
  48. package/dist/antd/es/locale/ar_EG.js +102 -0
  49. package/dist/antd/es/locale/bg_BG.js +98 -0
  50. package/dist/antd/es/locale/ca_ES.js +96 -0
  51. package/dist/antd/es/locale/cs_CZ.js +96 -0
  52. package/dist/antd/es/locale/da_DK.js +98 -0
  53. package/dist/antd/es/locale/de_DE.js +98 -0
  54. package/dist/antd/es/locale/default.js +2 -0
  55. package/dist/antd/es/locale/el_GR.js +98 -0
  56. package/dist/antd/es/locale/en_GB.js +98 -0
  57. package/dist/antd/es/locale/en_US.js +2 -0
  58. package/dist/antd/es/locale/es_ES.js +114 -0
  59. package/dist/antd/es/locale/et_EE.js +98 -0
  60. package/dist/antd/es/locale/fa_IR.js +98 -0
  61. package/dist/antd/es/locale/fi_FI.js +99 -0
  62. package/dist/antd/es/locale/fr_BE.js +102 -0
  63. package/dist/antd/es/locale/fr_FR.js +102 -0
  64. package/dist/antd/es/locale/ga_IE.js +99 -0
  65. package/dist/antd/es/locale/he_IL.js +99 -0
  66. package/dist/antd/es/locale/hi_IN.js +107 -0
  67. package/dist/antd/es/locale/hr_HR.js +113 -0
  68. package/dist/antd/es/locale/hu_HU.js +99 -0
  69. package/dist/antd/es/locale/hy_AM.js +109 -0
  70. package/dist/antd/es/locale/id_ID.js +101 -0
  71. package/dist/antd/es/locale/is_IS.js +98 -0
  72. package/dist/antd/es/locale/it_IT.js +111 -0
  73. package/dist/antd/es/locale/ja_JP.js +96 -0
  74. package/dist/antd/es/locale/kn_IN.js +107 -0
  75. package/dist/antd/es/locale/ko_KR.js +98 -0
  76. package/dist/antd/es/locale/ku_IQ.js +98 -0
  77. package/dist/antd/es/locale/lv_LV.js +98 -0
  78. package/dist/antd/es/locale/mk_MK.js +113 -0
  79. package/dist/antd/es/locale/mn_MN.js +99 -0
  80. package/dist/antd/es/locale/ms_MY.js +118 -0
  81. package/dist/antd/es/locale/nb_NO.js +97 -0
  82. package/dist/antd/es/locale/ne_NP.js +44 -0
  83. package/dist/antd/es/locale/nl_BE.js +98 -0
  84. package/dist/antd/es/locale/nl_NL.js +117 -0
  85. package/dist/antd/es/locale/pl_PL.js +98 -0
  86. package/dist/antd/es/locale/pt_BR.js +104 -0
  87. package/dist/antd/es/locale/pt_PT.js +127 -0
  88. package/dist/antd/es/locale/ro_RO.js +118 -0
  89. package/dist/antd/es/locale/ru_RU.js +110 -0
  90. package/dist/antd/es/locale/sk_SK.js +118 -0
  91. package/dist/antd/es/locale/sl_SI.js +96 -0
  92. package/dist/antd/es/locale/sr_RS.js +97 -0
  93. package/dist/antd/es/locale/sv_SE.js +101 -0
  94. package/dist/antd/es/locale/ta_IN.js +119 -0
  95. package/dist/antd/es/locale/th_TH.js +117 -0
  96. package/dist/antd/es/locale/tr_TR.js +112 -0
  97. package/dist/antd/es/locale/uk_UA.js +97 -0
  98. package/dist/antd/es/locale/vi_VN.js +99 -0
  99. package/dist/antd/es/locale/zh_CN.js +104 -0
  100. package/dist/antd/es/locale/zh_TW.js +100 -0
  101. package/dist/antd/es/locale-provider.js +6 -0
  102. package/dist/antd/es/mention.js +23215 -0
  103. package/dist/antd/es/mentions.js +961 -0
  104. package/dist/antd/es/menu.js +5 -0
  105. package/dist/antd/es/message.js +161 -0
  106. package/dist/antd/es/modal.js +885 -0
  107. package/dist/antd/es/notification.js +216 -0
  108. package/dist/antd/es/page-header.js +350 -0
  109. package/dist/antd/es/pagination.js +15 -0
  110. package/dist/antd/es/popconfirm.js +215 -0
  111. package/dist/antd/es/popover.js +5 -0
  112. package/dist/antd/es/progress.js +10 -0
  113. package/dist/antd/es/radio.js +10 -0
  114. package/dist/antd/es/rate.js +5 -0
  115. package/dist/antd/es/result.js +828 -0
  116. package/dist/antd/es/row.js +9 -0
  117. package/dist/antd/es/select.js +5 -0
  118. package/dist/antd/es/skeleton.js +370 -0
  119. package/dist/antd/es/slider.js +5 -0
  120. package/dist/antd/es/spin.js +11 -0
  121. package/dist/antd/es/statistic.js +650 -0
  122. package/dist/antd/es/steps.js +5 -0
  123. package/dist/antd/es/style.js +5 -0
  124. package/dist/antd/es/switch.js +5 -0
  125. package/dist/antd/es/table.js +7057 -0
  126. package/dist/antd/es/tabs.js +5 -0
  127. package/dist/antd/es/tag.js +12 -0
  128. package/dist/antd/es/time-picker.js +10 -0
  129. package/dist/antd/es/timeline.js +206 -0
  130. package/dist/antd/es/tooltip.js +9 -0
  131. package/dist/antd/es/transfer.js +2508 -0
  132. package/dist/antd/es/tree-select.js +5 -0
  133. package/dist/antd/es/tree.js +10 -0
  134. package/dist/antd/es/typography.js +1246 -0
  135. package/dist/antd/es/upload.js +3418 -0
  136. package/dist/antd/es/version.js +7 -0
  137. package/dist/col.js +142 -0
  138. package/dist/config-provider.js +6949 -0
  139. package/dist/dropdown.js +442 -0
  140. package/dist/get.js +1043 -0
  141. package/dist/icon.js +6138 -0
  142. package/dist/identity.js +230 -0
  143. package/dist/index.js +462 -0
  144. package/dist/index10.js +478 -0
  145. package/dist/index11.js +232 -0
  146. package/dist/index12.js +2766 -0
  147. package/dist/index13.js +422 -0
  148. package/dist/index14.js +283 -0
  149. package/dist/index15.js +1755 -0
  150. package/dist/index2.js +374 -0
  151. package/dist/index3.js +407 -0
  152. package/dist/index4.js +522 -0
  153. package/dist/index5.js +601 -0
  154. package/dist/index6.js +601 -0
  155. package/dist/index7.js +364 -0
  156. package/dist/index8.js +436 -0
  157. package/dist/index9.js +130 -0
  158. package/dist/input.js +475 -0
  159. package/dist/isLength.js +402 -0
  160. package/dist/keys.js +292 -0
  161. package/dist/menu.js +8138 -0
  162. package/dist/progress.js +852 -0
  163. package/dist/raf.js +34 -0
  164. package/dist/responsiveObserve.js +444 -0
  165. package/dist/row.js +173 -0
  166. package/dist/scrollTo.js +66 -0
  167. package/dist/toInteger.js +123 -0
  168. package/dist/toString.js +84 -0
  169. package/dist/transButton.js +121 -0
  170. package/dist/tree.js +3017 -0
  171. package/dist/warning.js +55 -0
  172. package/dist/wave.js +230 -0
  173. package/dist/zh_CN.js +17 -0
  174. package/package.json +160 -0
@@ -0,0 +1,650 @@
1
+ import { n, g as getDefaultExportFromCjs, s as withConfigConsumer, c as classNames, o as interopDefault, q as moment } from '../../config-provider.js';
2
+ import * as React from 'react';
3
+ import { r as require_baseToString, a as requireToString } from '../../toString.js';
4
+ import { r as require_hasUnicode, a as require_stringToArray } from '../../_stringToArray.js';
5
+ import { r as require_baseProperty, a as requireToInteger } from '../../toInteger.js';
6
+ import { p as polyfill } from '../../menu.js';
7
+ import '../../tree.js';
8
+ import '../../input.js';
9
+ import '../../icon.js';
10
+ import '../../_arrayMap.js';
11
+ import 'react-dom';
12
+
13
+ var css = "/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable no-duplicate-selectors */\n/* stylelint-disable */\n/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */\n.ant-statistic {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.65);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n font-feature-settings: 'tnum';\n}\n.ant-statistic-title {\n margin-bottom: 4px;\n color: rgba(0, 0, 0, 0.45);\n font-size: 14px;\n}\n.ant-statistic-content {\n color: rgba(0, 0, 0, 0.85);\n font-size: 24px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n}\n.ant-statistic-content-value-decimal {\n font-size: 16px;\n}\n.ant-statistic-content-prefix,\n.ant-statistic-content-suffix {\n display: inline-block;\n}\n.ant-statistic-content-prefix {\n margin-right: 4px;\n}\n.ant-statistic-content-suffix {\n margin-left: 4px;\n font-size: 16px;\n}\n/*# sourceMappingURL=index.css.map */";
14
+ n(css,{"prepend":true});
15
+
16
+ /** Used as references for various `Number` constants. */
17
+
18
+ var _baseRepeat;
19
+ var hasRequired_baseRepeat;
20
+
21
+ function require_baseRepeat () {
22
+ if (hasRequired_baseRepeat) return _baseRepeat;
23
+ hasRequired_baseRepeat = 1;
24
+ var MAX_SAFE_INTEGER = 9007199254740991;
25
+
26
+ /* Built-in method references for those with the same name as other `lodash` methods. */
27
+ var nativeFloor = Math.floor;
28
+
29
+ /**
30
+ * The base implementation of `_.repeat` which doesn't coerce arguments.
31
+ *
32
+ * @private
33
+ * @param {string} string The string to repeat.
34
+ * @param {number} n The number of times to repeat the string.
35
+ * @returns {string} Returns the repeated string.
36
+ */
37
+ function baseRepeat(string, n) {
38
+ var result = '';
39
+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
40
+ return result;
41
+ }
42
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
43
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
44
+ do {
45
+ if (n % 2) {
46
+ result += string;
47
+ }
48
+ n = nativeFloor(n / 2);
49
+ if (n) {
50
+ string += string;
51
+ }
52
+ } while (n);
53
+
54
+ return result;
55
+ }
56
+
57
+ _baseRepeat = baseRepeat;
58
+ return _baseRepeat;
59
+ }
60
+
61
+ /**
62
+ * The base implementation of `_.slice` without an iteratee call guard.
63
+ *
64
+ * @private
65
+ * @param {Array} array The array to slice.
66
+ * @param {number} [start=0] The start position.
67
+ * @param {number} [end=array.length] The end position.
68
+ * @returns {Array} Returns the slice of `array`.
69
+ */
70
+
71
+ var _baseSlice;
72
+ var hasRequired_baseSlice;
73
+
74
+ function require_baseSlice () {
75
+ if (hasRequired_baseSlice) return _baseSlice;
76
+ hasRequired_baseSlice = 1;
77
+ function baseSlice(array, start, end) {
78
+ var index = -1,
79
+ length = array.length;
80
+
81
+ if (start < 0) {
82
+ start = -start > length ? 0 : (length + start);
83
+ }
84
+ end = end > length ? length : end;
85
+ if (end < 0) {
86
+ end += length;
87
+ }
88
+ length = start > end ? 0 : ((end - start) >>> 0);
89
+ start >>>= 0;
90
+
91
+ var result = Array(length);
92
+ while (++index < length) {
93
+ result[index] = array[index + start];
94
+ }
95
+ return result;
96
+ }
97
+
98
+ _baseSlice = baseSlice;
99
+ return _baseSlice;
100
+ }
101
+
102
+ var _castSlice;
103
+ var hasRequired_castSlice;
104
+
105
+ function require_castSlice () {
106
+ if (hasRequired_castSlice) return _castSlice;
107
+ hasRequired_castSlice = 1;
108
+ var baseSlice = require_baseSlice();
109
+
110
+ /**
111
+ * Casts `array` to a slice if it's needed.
112
+ *
113
+ * @private
114
+ * @param {Array} array The array to inspect.
115
+ * @param {number} start The start position.
116
+ * @param {number} [end=array.length] The end position.
117
+ * @returns {Array} Returns the cast slice.
118
+ */
119
+ function castSlice(array, start, end) {
120
+ var length = array.length;
121
+ end = end === undefined ? length : end;
122
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
123
+ }
124
+
125
+ _castSlice = castSlice;
126
+ return _castSlice;
127
+ }
128
+
129
+ var _asciiSize;
130
+ var hasRequired_asciiSize;
131
+
132
+ function require_asciiSize () {
133
+ if (hasRequired_asciiSize) return _asciiSize;
134
+ hasRequired_asciiSize = 1;
135
+ var baseProperty = require_baseProperty();
136
+
137
+ /**
138
+ * Gets the size of an ASCII `string`.
139
+ *
140
+ * @private
141
+ * @param {string} string The string inspect.
142
+ * @returns {number} Returns the string size.
143
+ */
144
+ var asciiSize = baseProperty('length');
145
+
146
+ _asciiSize = asciiSize;
147
+ return _asciiSize;
148
+ }
149
+
150
+ /** Used to compose unicode character classes. */
151
+
152
+ var _unicodeSize;
153
+ var hasRequired_unicodeSize;
154
+
155
+ function require_unicodeSize () {
156
+ if (hasRequired_unicodeSize) return _unicodeSize;
157
+ hasRequired_unicodeSize = 1;
158
+ var rsAstralRange = '\\ud800-\\udfff',
159
+ rsComboMarksRange = '\\u0300-\\u036f',
160
+ reComboHalfMarksRange = '\\ufe20-\\ufe2f',
161
+ rsComboSymbolsRange = '\\u20d0-\\u20ff',
162
+ rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
163
+ rsVarRange = '\\ufe0e\\ufe0f';
164
+
165
+ /** Used to compose unicode capture groups. */
166
+ var rsAstral = '[' + rsAstralRange + ']',
167
+ rsCombo = '[' + rsComboRange + ']',
168
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
169
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
170
+ rsNonAstral = '[^' + rsAstralRange + ']',
171
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
172
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
173
+ rsZWJ = '\\u200d';
174
+
175
+ /** Used to compose unicode regexes. */
176
+ var reOptMod = rsModifier + '?',
177
+ rsOptVar = '[' + rsVarRange + ']?',
178
+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
179
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
180
+ rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
181
+
182
+ /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
183
+ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
184
+
185
+ /**
186
+ * Gets the size of a Unicode `string`.
187
+ *
188
+ * @private
189
+ * @param {string} string The string inspect.
190
+ * @returns {number} Returns the string size.
191
+ */
192
+ function unicodeSize(string) {
193
+ var result = reUnicode.lastIndex = 0;
194
+ while (reUnicode.test(string)) {
195
+ ++result;
196
+ }
197
+ return result;
198
+ }
199
+
200
+ _unicodeSize = unicodeSize;
201
+ return _unicodeSize;
202
+ }
203
+
204
+ var _stringSize;
205
+ var hasRequired_stringSize;
206
+
207
+ function require_stringSize () {
208
+ if (hasRequired_stringSize) return _stringSize;
209
+ hasRequired_stringSize = 1;
210
+ var asciiSize = require_asciiSize(),
211
+ hasUnicode = require_hasUnicode(),
212
+ unicodeSize = require_unicodeSize();
213
+
214
+ /**
215
+ * Gets the number of symbols in `string`.
216
+ *
217
+ * @private
218
+ * @param {string} string The string to inspect.
219
+ * @returns {number} Returns the string size.
220
+ */
221
+ function stringSize(string) {
222
+ return hasUnicode(string)
223
+ ? unicodeSize(string)
224
+ : asciiSize(string);
225
+ }
226
+
227
+ _stringSize = stringSize;
228
+ return _stringSize;
229
+ }
230
+
231
+ var _createPadding;
232
+ var hasRequired_createPadding;
233
+
234
+ function require_createPadding () {
235
+ if (hasRequired_createPadding) return _createPadding;
236
+ hasRequired_createPadding = 1;
237
+ var baseRepeat = require_baseRepeat(),
238
+ baseToString = require_baseToString(),
239
+ castSlice = require_castSlice(),
240
+ hasUnicode = require_hasUnicode(),
241
+ stringSize = require_stringSize(),
242
+ stringToArray = require_stringToArray();
243
+
244
+ /* Built-in method references for those with the same name as other `lodash` methods. */
245
+ var nativeCeil = Math.ceil;
246
+
247
+ /**
248
+ * Creates the padding for `string` based on `length`. The `chars` string
249
+ * is truncated if the number of characters exceeds `length`.
250
+ *
251
+ * @private
252
+ * @param {number} length The padding length.
253
+ * @param {string} [chars=' '] The string used as padding.
254
+ * @returns {string} Returns the padding for `string`.
255
+ */
256
+ function createPadding(length, chars) {
257
+ chars = chars === undefined ? ' ' : baseToString(chars);
258
+
259
+ var charsLength = chars.length;
260
+ if (charsLength < 2) {
261
+ return charsLength ? baseRepeat(chars, length) : chars;
262
+ }
263
+ var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
264
+ return hasUnicode(chars)
265
+ ? castSlice(stringToArray(result), 0, length).join('')
266
+ : result.slice(0, length);
267
+ }
268
+
269
+ _createPadding = createPadding;
270
+ return _createPadding;
271
+ }
272
+
273
+ var padEnd_1;
274
+ var hasRequiredPadEnd;
275
+
276
+ function requirePadEnd () {
277
+ if (hasRequiredPadEnd) return padEnd_1;
278
+ hasRequiredPadEnd = 1;
279
+ var createPadding = require_createPadding(),
280
+ stringSize = require_stringSize(),
281
+ toInteger = requireToInteger(),
282
+ toString = requireToString();
283
+
284
+ /**
285
+ * Pads `string` on the right side if it's shorter than `length`. Padding
286
+ * characters are truncated if they exceed `length`.
287
+ *
288
+ * @static
289
+ * @memberOf _
290
+ * @since 4.0.0
291
+ * @category String
292
+ * @param {string} [string=''] The string to pad.
293
+ * @param {number} [length=0] The padding length.
294
+ * @param {string} [chars=' '] The string used as padding.
295
+ * @returns {string} Returns the padded string.
296
+ * @example
297
+ *
298
+ * _.padEnd('abc', 6);
299
+ * // => 'abc '
300
+ *
301
+ * _.padEnd('abc', 6, '_-');
302
+ * // => 'abc_-_'
303
+ *
304
+ * _.padEnd('abc', 3);
305
+ * // => 'abc'
306
+ */
307
+ function padEnd(string, length, chars) {
308
+ string = toString(string);
309
+ length = toInteger(length);
310
+
311
+ var strLength = length ? stringSize(string) : 0;
312
+ return (length && strLength < length)
313
+ ? (string + createPadding(length - strLength, chars))
314
+ : string;
315
+ }
316
+
317
+ padEnd_1 = padEnd;
318
+ return padEnd_1;
319
+ }
320
+
321
+ var padEndExports = requirePadEnd();
322
+ var padEnd = /*@__PURE__*/getDefaultExportFromCjs(padEndExports);
323
+
324
+ var StatisticNumber = function StatisticNumber(props) {
325
+ var value = props.value,
326
+ formatter = props.formatter,
327
+ precision = props.precision,
328
+ decimalSeparator = props.decimalSeparator,
329
+ _props$groupSeparator = props.groupSeparator,
330
+ groupSeparator = _props$groupSeparator === void 0 ? '' : _props$groupSeparator,
331
+ prefixCls = props.prefixCls;
332
+ var valueNode;
333
+
334
+ if (typeof formatter === 'function') {
335
+ // Customize formatter
336
+ valueNode = formatter(value);
337
+ } else {
338
+ // Internal formatter
339
+ var val = String(value);
340
+ var cells = val.match(/^(-?)(\d*)(\.(\d+))?$/); // Process if illegal number
341
+
342
+ if (!cells) {
343
+ valueNode = val;
344
+ } else {
345
+ var negative = cells[1];
346
+
347
+ var _int = cells[2] || '0';
348
+
349
+ var decimal = cells[4] || '';
350
+ _int = _int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
351
+
352
+ if (typeof precision === 'number') {
353
+ decimal = padEnd(decimal, precision, '0').slice(0, precision);
354
+ }
355
+
356
+ if (decimal) {
357
+ decimal = "".concat(decimalSeparator).concat(decimal);
358
+ }
359
+
360
+ valueNode = [/*#__PURE__*/React.createElement("span", {
361
+ key: "int",
362
+ className: "".concat(prefixCls, "-content-value-int")
363
+ }, negative, _int), decimal && /*#__PURE__*/React.createElement("span", {
364
+ key: "decimal",
365
+ className: "".concat(prefixCls, "-content-value-decimal")
366
+ }, decimal)];
367
+ }
368
+ }
369
+
370
+ return /*#__PURE__*/React.createElement("span", {
371
+ className: "".concat(prefixCls, "-content-value")
372
+ }, valueNode);
373
+ };
374
+
375
+ function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
376
+
377
+ var Statistic = function Statistic(props) {
378
+ var prefixCls = props.prefixCls,
379
+ className = props.className,
380
+ style = props.style,
381
+ valueStyle = props.valueStyle,
382
+ _props$value = props.value,
383
+ value = _props$value === void 0 ? 0 : _props$value,
384
+ title = props.title,
385
+ valueRender = props.valueRender,
386
+ prefix = props.prefix,
387
+ suffix = props.suffix;
388
+ var valueNode = /*#__PURE__*/React.createElement(StatisticNumber, _extends$1({}, props, {
389
+ value: value
390
+ }));
391
+
392
+ if (valueRender) {
393
+ valueNode = valueRender(valueNode);
394
+ }
395
+
396
+ return /*#__PURE__*/React.createElement("div", {
397
+ className: classNames(prefixCls, className),
398
+ style: style
399
+ }, title && /*#__PURE__*/React.createElement("div", {
400
+ className: "".concat(prefixCls, "-title")
401
+ }, title), /*#__PURE__*/React.createElement("div", {
402
+ style: valueStyle,
403
+ className: "".concat(prefixCls, "-content")
404
+ }, prefix && /*#__PURE__*/React.createElement("span", {
405
+ className: "".concat(prefixCls, "-content-prefix")
406
+ }, prefix), valueNode, suffix && /*#__PURE__*/React.createElement("span", {
407
+ className: "".concat(prefixCls, "-content-suffix")
408
+ }, suffix)));
409
+ };
410
+
411
+ Statistic.defaultProps = {
412
+ decimalSeparator: '.',
413
+ groupSeparator: ','
414
+ };
415
+ var WrapperStatistic = withConfigConsumer({
416
+ prefixCls: 'statistic'
417
+ })(Statistic);
418
+
419
+ var padStart_1;
420
+ var hasRequiredPadStart;
421
+
422
+ function requirePadStart () {
423
+ if (hasRequiredPadStart) return padStart_1;
424
+ hasRequiredPadStart = 1;
425
+ var createPadding = require_createPadding(),
426
+ stringSize = require_stringSize(),
427
+ toInteger = requireToInteger(),
428
+ toString = requireToString();
429
+
430
+ /**
431
+ * Pads `string` on the left side if it's shorter than `length`. Padding
432
+ * characters are truncated if they exceed `length`.
433
+ *
434
+ * @static
435
+ * @memberOf _
436
+ * @since 4.0.0
437
+ * @category String
438
+ * @param {string} [string=''] The string to pad.
439
+ * @param {number} [length=0] The padding length.
440
+ * @param {string} [chars=' '] The string used as padding.
441
+ * @returns {string} Returns the padded string.
442
+ * @example
443
+ *
444
+ * _.padStart('abc', 6);
445
+ * // => ' abc'
446
+ *
447
+ * _.padStart('abc', 6, '_-');
448
+ * // => '_-_abc'
449
+ *
450
+ * _.padStart('abc', 3);
451
+ * // => 'abc'
452
+ */
453
+ function padStart(string, length, chars) {
454
+ string = toString(string);
455
+ length = toInteger(length);
456
+
457
+ var strLength = length ? stringSize(string) : 0;
458
+ return (length && strLength < length)
459
+ ? (createPadding(length - strLength, chars) + string)
460
+ : string;
461
+ }
462
+
463
+ padStart_1 = padStart;
464
+ return padStart_1;
465
+ }
466
+
467
+ var padStartExports = requirePadStart();
468
+ var padStart = /*@__PURE__*/getDefaultExportFromCjs(padStartExports);
469
+
470
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
471
+
472
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
473
+
474
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
475
+
476
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
477
+
478
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
479
+
480
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
481
+
482
+ var timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1]];
483
+ function formatTimeStr(duration, format) {
484
+ var leftDuration = duration;
485
+ var escapeRegex = /\[[^\]]*\]/g;
486
+ var keepList = (format.match(escapeRegex) || []).map(function (str) {
487
+ return str.slice(1, -1);
488
+ });
489
+ var templateText = format.replace(escapeRegex, '[]');
490
+ var replacedText = timeUnits.reduce(function (current, _ref) {
491
+ var _ref2 = _slicedToArray(_ref, 2),
492
+ name = _ref2[0],
493
+ unit = _ref2[1];
494
+
495
+ if (current.indexOf(name) !== -1) {
496
+ var value = Math.floor(leftDuration / unit);
497
+ leftDuration -= value * unit;
498
+ return current.replace(new RegExp("".concat(name, "+"), 'g'), function (match) {
499
+ var len = match.length;
500
+ return padStart(value.toString(), len, '0');
501
+ });
502
+ }
503
+
504
+ return current;
505
+ }, templateText);
506
+ var index = 0;
507
+ return replacedText.replace(escapeRegex, function () {
508
+ var match = keepList[index];
509
+ index += 1;
510
+ return match;
511
+ });
512
+ }
513
+ function formatCountdown(value, config) {
514
+ var _config$format = config.format,
515
+ format = _config$format === void 0 ? '' : _config$format;
516
+ var target = interopDefault(moment)(value).valueOf();
517
+ var current = interopDefault(moment)().valueOf();
518
+ var diff = Math.max(target - current, 0);
519
+ return formatTimeStr(diff, format);
520
+ }
521
+
522
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
523
+
524
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
525
+
526
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
527
+
528
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
529
+
530
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); return Constructor; }
531
+
532
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
533
+
534
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
535
+
536
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
537
+
538
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
539
+
540
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
541
+
542
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
543
+
544
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
545
+ var REFRESH_INTERVAL = 1000 / 30;
546
+
547
+ function getTime(value) {
548
+ return interopDefault(moment)(value).valueOf();
549
+ }
550
+
551
+ var Countdown = /*#__PURE__*/function (_React$Component) {
552
+ _inherits(Countdown, _React$Component);
553
+
554
+ var _super = _createSuper(Countdown);
555
+
556
+ function Countdown() {
557
+ var _this;
558
+
559
+ _classCallCheck(this, Countdown);
560
+
561
+ _this = _super.apply(this, arguments);
562
+
563
+ _this.syncTimer = function () {
564
+ var value = _this.props.value;
565
+ var timestamp = getTime(value);
566
+
567
+ if (timestamp >= Date.now()) {
568
+ _this.startTimer();
569
+ } else {
570
+ _this.stopTimer();
571
+ }
572
+ };
573
+
574
+ _this.startTimer = function () {
575
+ if (_this.countdownId) return;
576
+ _this.countdownId = window.setInterval(function () {
577
+ _this.forceUpdate();
578
+ }, REFRESH_INTERVAL);
579
+ };
580
+
581
+ _this.stopTimer = function () {
582
+ var _this$props = _this.props,
583
+ onFinish = _this$props.onFinish,
584
+ value = _this$props.value;
585
+
586
+ if (_this.countdownId) {
587
+ clearInterval(_this.countdownId);
588
+ _this.countdownId = undefined;
589
+ var timestamp = getTime(value);
590
+
591
+ if (onFinish && timestamp < Date.now()) {
592
+ onFinish();
593
+ }
594
+ }
595
+ };
596
+
597
+ _this.formatCountdown = function (value, config) {
598
+ var format = _this.props.format;
599
+ return formatCountdown(value, _extends(_extends({}, config), {
600
+ format: format
601
+ }));
602
+ }; // Countdown do not need display the timestamp
603
+
604
+
605
+ _this.valueRender = function (node) {
606
+ return /*#__PURE__*/React.cloneElement(node, {
607
+ title: undefined
608
+ });
609
+ };
610
+
611
+ return _this;
612
+ }
613
+
614
+ _createClass(Countdown, [{
615
+ key: "componentDidMount",
616
+ value: function componentDidMount() {
617
+ this.syncTimer();
618
+ }
619
+ }, {
620
+ key: "componentDidUpdate",
621
+ value: function componentDidUpdate() {
622
+ this.syncTimer();
623
+ }
624
+ }, {
625
+ key: "componentWillUnmount",
626
+ value: function componentWillUnmount() {
627
+ this.stopTimer();
628
+ }
629
+ }, {
630
+ key: "render",
631
+ value: function render() {
632
+ return /*#__PURE__*/React.createElement(WrapperStatistic, _extends({
633
+ valueRender: this.valueRender
634
+ }, this.props, {
635
+ formatter: this.formatCountdown
636
+ }));
637
+ }
638
+ }]);
639
+
640
+ return Countdown;
641
+ }(React.Component);
642
+
643
+ Countdown.defaultProps = {
644
+ format: 'HH:mm:ss'
645
+ };
646
+ polyfill(Countdown);
647
+
648
+ WrapperStatistic.Countdown = Countdown;
649
+
650
+ export { WrapperStatistic as default };