@daoyi/nmtl-ui 2.0.1-beta.1 → 2.0.1-beta.100

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 (88) hide show
  1. package/lib/components/Autocomplete-9e392b0c.js +470 -0
  2. package/lib/components/Autocomplete.js +20 -0
  3. package/lib/components/Avatar.js +53 -0
  4. package/lib/components/BackTop.js +111 -0
  5. package/lib/components/BarChart.js +762 -0
  6. package/lib/components/Breadcrumbs.js +122 -0
  7. package/lib/components/Button-305b69a0.js +92 -0
  8. package/lib/components/Button.js +6 -0
  9. package/lib/components/Carousel.js +4654 -0
  10. package/lib/components/Checkbox.js +37 -0
  11. package/lib/components/CollapseContent.js +180 -0
  12. package/lib/components/ContactModal-90b95c63.js +12188 -0
  13. package/lib/components/ContactModal.js +24 -0
  14. package/lib/components/Drawer-2cbcec04.js +163 -0
  15. package/lib/components/Drawer.js +17 -0
  16. package/lib/components/Dropdown.js +134 -0
  17. package/lib/components/Empty-bf77164f.js +45 -0
  18. package/lib/components/Empty.js +5 -0
  19. package/lib/components/ExportButton.js +128 -0
  20. package/lib/components/ExtraTools-55f66039.js +3619 -0
  21. package/lib/components/ExtraTools.js +10 -0
  22. package/lib/components/Filter.js +814 -0
  23. package/lib/components/Footer.js +317 -0
  24. package/lib/components/ForwardLink-83a7eea9.js +125 -0
  25. package/lib/components/ForwardLink.js +10 -0
  26. package/lib/components/Header.js +220 -0
  27. package/lib/components/Image.js +61 -0
  28. package/lib/components/Input.js +82 -0
  29. package/lib/components/InputMethod.js +33963 -0
  30. package/lib/components/KeywordSearch-d378ca7f.js +151 -0
  31. package/lib/components/KeywordSearch.js +22 -0
  32. package/lib/components/KeywordTicker.js +224 -0
  33. package/lib/components/Keywords.js +343 -0
  34. package/lib/components/Loading.js +28 -0
  35. package/lib/components/MUITheme.js +2639 -0
  36. package/lib/components/Modal-777fe87d.js +116 -0
  37. package/lib/components/Modal.js +10 -0
  38. package/lib/components/MoreButton-493f7c82.js +148 -0
  39. package/lib/components/MoreButton.js +8 -0
  40. package/lib/components/Pagination.js +3632 -0
  41. package/lib/components/Radio.js +78 -0
  42. package/lib/components/SNA.js +1691 -0
  43. package/lib/components/Select-e0790135.js +145 -0
  44. package/lib/components/Select.js +13 -0
  45. package/lib/components/Spin-8dc60bfe.js +75 -0
  46. package/lib/components/Spin.js +6 -0
  47. package/lib/components/Table.js +51 -0
  48. package/lib/components/Tooltip-6ebfa9c1.js +70 -0
  49. package/lib/components/Tooltip.js +7 -0
  50. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  51. package/lib/components/_rollupPluginBabelHelpers-a52356f6.js +142 -0
  52. package/lib/components/createSvgIcon-e3803ee1.js +576 -0
  53. package/lib/components/dataExport-d55d6fa3.js +92 -0
  54. package/lib/components/debounce-127da66c.js +355 -0
  55. package/lib/components/defaultTheme-ed7746fe.js +1661 -0
  56. package/lib/components/globalConfig.js +248 -0
  57. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  58. package/lib/components/index-b47819f3.js +481 -0
  59. package/lib/components/index-b76a85f4.js +61 -0
  60. package/lib/components/isObjectLike-e111475d.js +190 -0
  61. package/lib/components/style-inject.es-1f59c1d0.js +28 -0
  62. package/lib/components/toConsumableArray-dbe8af76.js +19 -0
  63. package/lib/components/transform-3a04288b.js +5475 -0
  64. package/lib/components/useTheme-d16d02d9.js +11 -0
  65. package/lib/components/withTheme-2d778133.js +6 -0
  66. package/lib/configs/config.selector.js +151 -0
  67. package/lib/configs/index.d.ts +1 -0
  68. package/lib/configs/index.js +1 -0
  69. package/lib/index.d.ts +37 -0
  70. package/lib/index.js +37 -0
  71. package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
  72. package/lib/utils/arrayMerge.js +4953 -0
  73. package/lib/utils/chunkArray.js +15 -0
  74. package/lib/utils/convert2HtmlEntities.js +42 -0
  75. package/lib/utils/domToImage.js +802 -0
  76. package/lib/utils/downloadGephi.js +106 -0
  77. package/lib/utils/exportXlsx.js +219 -0
  78. package/lib/utils/historyAppendSearch.js +502 -0
  79. package/lib/utils/index.d.ts +13 -0
  80. package/lib/utils/index.js +13 -0
  81. package/lib/utils/isDevelopMode.js +5 -0
  82. package/lib/utils/parseYMD.js +36 -0
  83. package/lib/utils/removeDuplicateItem.js +11 -0
  84. package/lib/utils/sendEmail.js +39 -0
  85. package/lib/utils/snaDefine-6a2bcd94.js +5 -0
  86. package/lib/utils/snaDefine.js +1 -0
  87. package/lib/utils/snaPreProcess.js +84 -0
  88. package/package.json +125 -128
@@ -0,0 +1,3632 @@
1
+ import { c as _objectWithoutProperties$1 } from './_rollupPluginBabelHelpers-a52356f6.js';
2
+ import * as React$2 from 'react';
3
+ import React__default, { Children, isValidElement, cloneElement } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import { k as _objectWithoutProperties, o as _slicedToArray, _ as _extends, q as _objectWithoutPropertiesLoose, r as alpha, j as formatMuiErrorMessage } from './defaultTheme-ed7746fe.js';
6
+ import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-e3803ee1.js';
7
+ import 'react-is';
8
+ import '@material-ui/styles';
9
+ import './withTheme-2d778133.js';
10
+ import { _ as _toConsumableArray } from './toConsumableArray-dbe8af76.js';
11
+ import { u as useTheme } from './useTheme-d16d02d9.js';
12
+ import * as ReactDOM from 'react-dom';
13
+ import ReactDOM__default from 'react-dom';
14
+ import { c as classNames } from './index-b76a85f4.js';
15
+ import { IconButton } from '@material-ui/core';
16
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
17
+ import './_commonjsHelpers-70de2c37.js';
18
+
19
+ function usePagination() {
20
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
21
+
22
+ // keep default values in sync with @default tags in Pagination.propTypes
23
+ var _props$boundaryCount = props.boundaryCount,
24
+ boundaryCount = _props$boundaryCount === void 0 ? 1 : _props$boundaryCount,
25
+ _props$componentName = props.componentName,
26
+ componentName = _props$componentName === void 0 ? 'usePagination' : _props$componentName,
27
+ _props$count = props.count,
28
+ count = _props$count === void 0 ? 1 : _props$count,
29
+ _props$defaultPage = props.defaultPage,
30
+ defaultPage = _props$defaultPage === void 0 ? 1 : _props$defaultPage,
31
+ _props$disabled = props.disabled,
32
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
33
+ _props$hideNextButton = props.hideNextButton,
34
+ hideNextButton = _props$hideNextButton === void 0 ? false : _props$hideNextButton,
35
+ _props$hidePrevButton = props.hidePrevButton,
36
+ hidePrevButton = _props$hidePrevButton === void 0 ? false : _props$hidePrevButton,
37
+ handleChange = props.onChange,
38
+ pageProp = props.page,
39
+ _props$showFirstButto = props.showFirstButton,
40
+ showFirstButton = _props$showFirstButto === void 0 ? false : _props$showFirstButto,
41
+ _props$showLastButton = props.showLastButton,
42
+ showLastButton = _props$showLastButton === void 0 ? false : _props$showLastButton,
43
+ _props$siblingCount = props.siblingCount,
44
+ siblingCount = _props$siblingCount === void 0 ? 1 : _props$siblingCount,
45
+ other = _objectWithoutProperties(props, ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"]);
46
+
47
+ var _useControlled = useControlled({
48
+ controlled: pageProp,
49
+ default: defaultPage,
50
+ name: componentName,
51
+ state: 'page'
52
+ }),
53
+ _useControlled2 = _slicedToArray(_useControlled, 2),
54
+ page = _useControlled2[0],
55
+ setPageState = _useControlled2[1];
56
+
57
+ var handleClick = function handleClick(event, value) {
58
+ if (!pageProp) {
59
+ setPageState(value);
60
+ }
61
+
62
+ if (handleChange) {
63
+ handleChange(event, value);
64
+ }
65
+ }; // https://dev.to/namirsab/comment/2050
66
+
67
+
68
+ var range = function range(start, end) {
69
+ var length = end - start + 1;
70
+ return Array.from({
71
+ length: length
72
+ }, function (_, i) {
73
+ return start + i;
74
+ });
75
+ };
76
+
77
+ var startPages = range(1, Math.min(boundaryCount, count));
78
+ var endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count);
79
+ var siblingsStart = Math.max(Math.min( // Natural start
80
+ page - siblingCount, // Lower boundary when page is high
81
+ count - boundaryCount - siblingCount * 2 - 1), // Greater than startPages
82
+ boundaryCount + 2);
83
+ var siblingsEnd = Math.min(Math.max( // Natural end
84
+ page + siblingCount, // Upper boundary when page is low
85
+ boundaryCount + siblingCount * 2 + 2), // Less than endPages
86
+ endPages[0] - 2); // Basic list of items to render
87
+ // e.g. itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
88
+
89
+ var itemList = [].concat(_toConsumableArray(showFirstButton ? ['first'] : []), _toConsumableArray(hidePrevButton ? [] : ['previous']), _toConsumableArray(startPages), _toConsumableArray(siblingsStart > boundaryCount + 2 ? ['start-ellipsis'] : boundaryCount + 1 < count - boundaryCount ? [boundaryCount + 1] : []), _toConsumableArray(range(siblingsStart, siblingsEnd)), _toConsumableArray(siblingsEnd < count - boundaryCount - 1 ? ['end-ellipsis'] : count - boundaryCount > boundaryCount ? [count - boundaryCount] : []), _toConsumableArray(endPages), _toConsumableArray(hideNextButton ? [] : ['next']), _toConsumableArray(showLastButton ? ['last'] : [])); // Map the button type to its page number
90
+
91
+ var buttonPage = function buttonPage(type) {
92
+ switch (type) {
93
+ case 'first':
94
+ return 1;
95
+
96
+ case 'previous':
97
+ return page - 1;
98
+
99
+ case 'next':
100
+ return page + 1;
101
+
102
+ case 'last':
103
+ return count;
104
+
105
+ default:
106
+ return null;
107
+ }
108
+ }; // Convert the basic item list to PaginationItem props objects
109
+
110
+
111
+ var items = itemList.map(function (item) {
112
+ return typeof item === 'number' ? {
113
+ onClick: function onClick(event) {
114
+ handleClick(event, item);
115
+ },
116
+ type: 'page',
117
+ page: item,
118
+ selected: item === page,
119
+ disabled: disabled,
120
+ 'aria-current': item === page ? 'true' : undefined
121
+ } : {
122
+ onClick: function onClick(event) {
123
+ handleClick(event, buttonPage(item));
124
+ },
125
+ type: item,
126
+ page: buttonPage(item),
127
+ selected: false,
128
+ disabled: disabled || item.indexOf('ellipsis') === -1 && (item === 'next' || item === 'last' ? page >= count : page <= 1)
129
+ };
130
+ });
131
+ return _extends({
132
+ items: items
133
+ }, other);
134
+ }
135
+
136
+ function _setPrototypeOf(o, p) {
137
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
138
+ o.__proto__ = p;
139
+ return o;
140
+ };
141
+ return _setPrototypeOf(o, p);
142
+ }
143
+
144
+ function _inheritsLoose(subClass, superClass) {
145
+ subClass.prototype = Object.create(superClass.prototype);
146
+ subClass.prototype.constructor = subClass;
147
+ _setPrototypeOf(subClass, superClass);
148
+ }
149
+
150
+ /**
151
+ * Checks if a given element has a CSS class.
152
+ *
153
+ * @param element the element
154
+ * @param className the CSS class name
155
+ */
156
+ function hasClass(element, className) {
157
+ if (element.classList) return !!className && element.classList.contains(className);
158
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
159
+ }
160
+
161
+ /**
162
+ * Adds a CSS class to a given element.
163
+ *
164
+ * @param element the element
165
+ * @param className the CSS class name
166
+ */
167
+
168
+ function addClass(element, className) {
169
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
170
+ }
171
+
172
+ function replaceClassName(origClass, classToRemove) {
173
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
174
+ }
175
+ /**
176
+ * Removes a CSS class from a given element.
177
+ *
178
+ * @param element the element
179
+ * @param className the CSS class name
180
+ */
181
+
182
+
183
+ function removeClass$1(element, className) {
184
+ if (element.classList) {
185
+ element.classList.remove(className);
186
+ } else if (typeof element.className === 'string') {
187
+ element.className = replaceClassName(element.className, className);
188
+ } else {
189
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
190
+ }
191
+ }
192
+
193
+ var config = {
194
+ disabled: false
195
+ };
196
+
197
+ var TransitionGroupContext = React__default.createContext(null);
198
+
199
+ var forceReflow = function forceReflow(node) {
200
+ return node.scrollTop;
201
+ };
202
+
203
+ var UNMOUNTED = 'unmounted';
204
+ var EXITED = 'exited';
205
+ var ENTERING = 'entering';
206
+ var ENTERED = 'entered';
207
+ var EXITING = 'exiting';
208
+ /**
209
+ * The Transition component lets you describe a transition from one component
210
+ * state to another _over time_ with a simple declarative API. Most commonly
211
+ * it's used to animate the mounting and unmounting of a component, but can also
212
+ * be used to describe in-place transition states as well.
213
+ *
214
+ * ---
215
+ *
216
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
217
+ * transitions in CSS, you'll probably want to use
218
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
219
+ * instead. It inherits all the features of `Transition`, but contains
220
+ * additional features necessary to play nice with CSS transitions (hence the
221
+ * name of the component).
222
+ *
223
+ * ---
224
+ *
225
+ * By default the `Transition` component does not alter the behavior of the
226
+ * component it renders, it only tracks "enter" and "exit" states for the
227
+ * components. It's up to you to give meaning and effect to those states. For
228
+ * example we can add styles to a component when it enters or exits:
229
+ *
230
+ * ```jsx
231
+ * import { Transition } from 'react-transition-group';
232
+ *
233
+ * const duration = 300;
234
+ *
235
+ * const defaultStyle = {
236
+ * transition: `opacity ${duration}ms ease-in-out`,
237
+ * opacity: 0,
238
+ * }
239
+ *
240
+ * const transitionStyles = {
241
+ * entering: { opacity: 1 },
242
+ * entered: { opacity: 1 },
243
+ * exiting: { opacity: 0 },
244
+ * exited: { opacity: 0 },
245
+ * };
246
+ *
247
+ * const Fade = ({ in: inProp }) => (
248
+ * <Transition in={inProp} timeout={duration}>
249
+ * {state => (
250
+ * <div style={{
251
+ * ...defaultStyle,
252
+ * ...transitionStyles[state]
253
+ * }}>
254
+ * I'm a fade Transition!
255
+ * </div>
256
+ * )}
257
+ * </Transition>
258
+ * );
259
+ * ```
260
+ *
261
+ * There are 4 main states a Transition can be in:
262
+ * - `'entering'`
263
+ * - `'entered'`
264
+ * - `'exiting'`
265
+ * - `'exited'`
266
+ *
267
+ * Transition state is toggled via the `in` prop. When `true` the component
268
+ * begins the "Enter" stage. During this stage, the component will shift from
269
+ * its current transition state, to `'entering'` for the duration of the
270
+ * transition and then to the `'entered'` stage once it's complete. Let's take
271
+ * the following example (we'll use the
272
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
273
+ *
274
+ * ```jsx
275
+ * function App() {
276
+ * const [inProp, setInProp] = useState(false);
277
+ * return (
278
+ * <div>
279
+ * <Transition in={inProp} timeout={500}>
280
+ * {state => (
281
+ * // ...
282
+ * )}
283
+ * </Transition>
284
+ * <button onClick={() => setInProp(true)}>
285
+ * Click to Enter
286
+ * </button>
287
+ * </div>
288
+ * );
289
+ * }
290
+ * ```
291
+ *
292
+ * When the button is clicked the component will shift to the `'entering'` state
293
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
294
+ * to `'entered'`.
295
+ *
296
+ * When `in` is `false` the same thing happens except the state moves from
297
+ * `'exiting'` to `'exited'`.
298
+ */
299
+
300
+ var Transition = /*#__PURE__*/function (_React$Component) {
301
+ _inheritsLoose(Transition, _React$Component);
302
+
303
+ function Transition(props, context) {
304
+ var _this;
305
+
306
+ _this = _React$Component.call(this, props, context) || this;
307
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
308
+
309
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
310
+ var initialStatus;
311
+ _this.appearStatus = null;
312
+
313
+ if (props.in) {
314
+ if (appear) {
315
+ initialStatus = EXITED;
316
+ _this.appearStatus = ENTERING;
317
+ } else {
318
+ initialStatus = ENTERED;
319
+ }
320
+ } else {
321
+ if (props.unmountOnExit || props.mountOnEnter) {
322
+ initialStatus = UNMOUNTED;
323
+ } else {
324
+ initialStatus = EXITED;
325
+ }
326
+ }
327
+
328
+ _this.state = {
329
+ status: initialStatus
330
+ };
331
+ _this.nextCallback = null;
332
+ return _this;
333
+ }
334
+
335
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
336
+ var nextIn = _ref.in;
337
+
338
+ if (nextIn && prevState.status === UNMOUNTED) {
339
+ return {
340
+ status: EXITED
341
+ };
342
+ }
343
+
344
+ return null;
345
+ } // getSnapshotBeforeUpdate(prevProps) {
346
+ // let nextStatus = null
347
+ // if (prevProps !== this.props) {
348
+ // const { status } = this.state
349
+ // if (this.props.in) {
350
+ // if (status !== ENTERING && status !== ENTERED) {
351
+ // nextStatus = ENTERING
352
+ // }
353
+ // } else {
354
+ // if (status === ENTERING || status === ENTERED) {
355
+ // nextStatus = EXITING
356
+ // }
357
+ // }
358
+ // }
359
+ // return { nextStatus }
360
+ // }
361
+ ;
362
+
363
+ var _proto = Transition.prototype;
364
+
365
+ _proto.componentDidMount = function componentDidMount() {
366
+ this.updateStatus(true, this.appearStatus);
367
+ };
368
+
369
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
370
+ var nextStatus = null;
371
+
372
+ if (prevProps !== this.props) {
373
+ var status = this.state.status;
374
+
375
+ if (this.props.in) {
376
+ if (status !== ENTERING && status !== ENTERED) {
377
+ nextStatus = ENTERING;
378
+ }
379
+ } else {
380
+ if (status === ENTERING || status === ENTERED) {
381
+ nextStatus = EXITING;
382
+ }
383
+ }
384
+ }
385
+
386
+ this.updateStatus(false, nextStatus);
387
+ };
388
+
389
+ _proto.componentWillUnmount = function componentWillUnmount() {
390
+ this.cancelNextCallback();
391
+ };
392
+
393
+ _proto.getTimeouts = function getTimeouts() {
394
+ var timeout = this.props.timeout;
395
+ var exit, enter, appear;
396
+ exit = enter = appear = timeout;
397
+
398
+ if (timeout != null && typeof timeout !== 'number') {
399
+ exit = timeout.exit;
400
+ enter = timeout.enter; // TODO: remove fallback for next major
401
+
402
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
403
+ }
404
+
405
+ return {
406
+ exit: exit,
407
+ enter: enter,
408
+ appear: appear
409
+ };
410
+ };
411
+
412
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
413
+ if (mounting === void 0) {
414
+ mounting = false;
415
+ }
416
+
417
+ if (nextStatus !== null) {
418
+ // nextStatus will always be ENTERING or EXITING.
419
+ this.cancelNextCallback();
420
+
421
+ if (nextStatus === ENTERING) {
422
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
423
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
424
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
425
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
426
+
427
+ if (node) forceReflow(node);
428
+ }
429
+
430
+ this.performEnter(mounting);
431
+ } else {
432
+ this.performExit();
433
+ }
434
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
435
+ this.setState({
436
+ status: UNMOUNTED
437
+ });
438
+ }
439
+ };
440
+
441
+ _proto.performEnter = function performEnter(mounting) {
442
+ var _this2 = this;
443
+
444
+ var enter = this.props.enter;
445
+ var appearing = this.context ? this.context.isMounting : mounting;
446
+
447
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default.findDOMNode(this), appearing],
448
+ maybeNode = _ref2[0],
449
+ maybeAppearing = _ref2[1];
450
+
451
+ var timeouts = this.getTimeouts();
452
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
453
+ // if we are mounting and running this it means appear _must_ be set
454
+
455
+ if (!mounting && !enter || config.disabled) {
456
+ this.safeSetState({
457
+ status: ENTERED
458
+ }, function () {
459
+ _this2.props.onEntered(maybeNode);
460
+ });
461
+ return;
462
+ }
463
+
464
+ this.props.onEnter(maybeNode, maybeAppearing);
465
+ this.safeSetState({
466
+ status: ENTERING
467
+ }, function () {
468
+ _this2.props.onEntering(maybeNode, maybeAppearing);
469
+
470
+ _this2.onTransitionEnd(enterTimeout, function () {
471
+ _this2.safeSetState({
472
+ status: ENTERED
473
+ }, function () {
474
+ _this2.props.onEntered(maybeNode, maybeAppearing);
475
+ });
476
+ });
477
+ });
478
+ };
479
+
480
+ _proto.performExit = function performExit() {
481
+ var _this3 = this;
482
+
483
+ var exit = this.props.exit;
484
+ var timeouts = this.getTimeouts();
485
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM__default.findDOMNode(this); // no exit animation skip right to EXITED
486
+
487
+ if (!exit || config.disabled) {
488
+ this.safeSetState({
489
+ status: EXITED
490
+ }, function () {
491
+ _this3.props.onExited(maybeNode);
492
+ });
493
+ return;
494
+ }
495
+
496
+ this.props.onExit(maybeNode);
497
+ this.safeSetState({
498
+ status: EXITING
499
+ }, function () {
500
+ _this3.props.onExiting(maybeNode);
501
+
502
+ _this3.onTransitionEnd(timeouts.exit, function () {
503
+ _this3.safeSetState({
504
+ status: EXITED
505
+ }, function () {
506
+ _this3.props.onExited(maybeNode);
507
+ });
508
+ });
509
+ });
510
+ };
511
+
512
+ _proto.cancelNextCallback = function cancelNextCallback() {
513
+ if (this.nextCallback !== null) {
514
+ this.nextCallback.cancel();
515
+ this.nextCallback = null;
516
+ }
517
+ };
518
+
519
+ _proto.safeSetState = function safeSetState(nextState, callback) {
520
+ // This shouldn't be necessary, but there are weird race conditions with
521
+ // setState callbacks and unmounting in testing, so always make sure that
522
+ // we can cancel any pending setState callbacks after we unmount.
523
+ callback = this.setNextCallback(callback);
524
+ this.setState(nextState, callback);
525
+ };
526
+
527
+ _proto.setNextCallback = function setNextCallback(callback) {
528
+ var _this4 = this;
529
+
530
+ var active = true;
531
+
532
+ this.nextCallback = function (event) {
533
+ if (active) {
534
+ active = false;
535
+ _this4.nextCallback = null;
536
+ callback(event);
537
+ }
538
+ };
539
+
540
+ this.nextCallback.cancel = function () {
541
+ active = false;
542
+ };
543
+
544
+ return this.nextCallback;
545
+ };
546
+
547
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
548
+ this.setNextCallback(handler);
549
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
550
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
551
+
552
+ if (!node || doesNotHaveTimeoutOrListener) {
553
+ setTimeout(this.nextCallback, 0);
554
+ return;
555
+ }
556
+
557
+ if (this.props.addEndListener) {
558
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
559
+ maybeNode = _ref3[0],
560
+ maybeNextCallback = _ref3[1];
561
+
562
+ this.props.addEndListener(maybeNode, maybeNextCallback);
563
+ }
564
+
565
+ if (timeout != null) {
566
+ setTimeout(this.nextCallback, timeout);
567
+ }
568
+ };
569
+
570
+ _proto.render = function render() {
571
+ var status = this.state.status;
572
+
573
+ if (status === UNMOUNTED) {
574
+ return null;
575
+ }
576
+
577
+ var _this$props = this.props,
578
+ children = _this$props.children;
579
+ _this$props.in;
580
+ _this$props.mountOnEnter;
581
+ _this$props.unmountOnExit;
582
+ _this$props.appear;
583
+ _this$props.enter;
584
+ _this$props.exit;
585
+ _this$props.timeout;
586
+ _this$props.addEndListener;
587
+ _this$props.onEnter;
588
+ _this$props.onEntering;
589
+ _this$props.onEntered;
590
+ _this$props.onExit;
591
+ _this$props.onExiting;
592
+ _this$props.onExited;
593
+ _this$props.nodeRef;
594
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
595
+
596
+ return (
597
+ /*#__PURE__*/
598
+ // allows for nested Transitions
599
+ React__default.createElement(TransitionGroupContext.Provider, {
600
+ value: null
601
+ }, typeof children === 'function' ? children(status, childProps) : React__default.cloneElement(React__default.Children.only(children), childProps))
602
+ );
603
+ };
604
+
605
+ return Transition;
606
+ }(React__default.Component);
607
+
608
+ Transition.contextType = TransitionGroupContext;
609
+ Transition.propTypes = {}; // Name the function so it is clearer in the documentation
610
+
611
+ function noop() {}
612
+
613
+ Transition.defaultProps = {
614
+ in: false,
615
+ mountOnEnter: false,
616
+ unmountOnExit: false,
617
+ appear: false,
618
+ enter: true,
619
+ exit: true,
620
+ onEnter: noop,
621
+ onEntering: noop,
622
+ onEntered: noop,
623
+ onExit: noop,
624
+ onExiting: noop,
625
+ onExited: noop
626
+ };
627
+ Transition.UNMOUNTED = UNMOUNTED;
628
+ Transition.EXITED = EXITED;
629
+ Transition.ENTERING = ENTERING;
630
+ Transition.ENTERED = ENTERED;
631
+ Transition.EXITING = EXITING;
632
+
633
+ var _addClass = function addClass$1(node, classes) {
634
+ return node && classes && classes.split(' ').forEach(function (c) {
635
+ return addClass(node, c);
636
+ });
637
+ };
638
+
639
+ var removeClass = function removeClass(node, classes) {
640
+ return node && classes && classes.split(' ').forEach(function (c) {
641
+ return removeClass$1(node, c);
642
+ });
643
+ };
644
+ /**
645
+ * A transition component inspired by the excellent
646
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
647
+ * use it if you're using CSS transitions or animations. It's built upon the
648
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
649
+ * component, so it inherits all of its props.
650
+ *
651
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
652
+ * and `exit` states of the transition. The first class is applied and then a
653
+ * second `*-active` class in order to activate the CSS transition. After the
654
+ * transition, matching `*-done` class names are applied to persist the
655
+ * transition state.
656
+ *
657
+ * ```jsx
658
+ * function App() {
659
+ * const [inProp, setInProp] = useState(false);
660
+ * return (
661
+ * <div>
662
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
663
+ * <div>
664
+ * {"I'll receive my-node-* classes"}
665
+ * </div>
666
+ * </CSSTransition>
667
+ * <button type="button" onClick={() => setInProp(true)}>
668
+ * Click to Enter
669
+ * </button>
670
+ * </div>
671
+ * );
672
+ * }
673
+ * ```
674
+ *
675
+ * When the `in` prop is set to `true`, the child component will first receive
676
+ * the class `example-enter`, then the `example-enter-active` will be added in
677
+ * the next tick. `CSSTransition` [forces a
678
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
679
+ * between before adding the `example-enter-active`. This is an important trick
680
+ * because it allows us to transition between `example-enter` and
681
+ * `example-enter-active` even though they were added immediately one after
682
+ * another. Most notably, this is what makes it possible for us to animate
683
+ * _appearance_.
684
+ *
685
+ * ```css
686
+ * .my-node-enter {
687
+ * opacity: 0;
688
+ * }
689
+ * .my-node-enter-active {
690
+ * opacity: 1;
691
+ * transition: opacity 200ms;
692
+ * }
693
+ * .my-node-exit {
694
+ * opacity: 1;
695
+ * }
696
+ * .my-node-exit-active {
697
+ * opacity: 0;
698
+ * transition: opacity 200ms;
699
+ * }
700
+ * ```
701
+ *
702
+ * `*-active` classes represent which styles you want to animate **to**, so it's
703
+ * important to add `transition` declaration only to them, otherwise transitions
704
+ * might not behave as intended! This might not be obvious when the transitions
705
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
706
+ * the example above (minus `transition`), but it becomes apparent in more
707
+ * complex transitions.
708
+ *
709
+ * **Note**: If you're using the
710
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
711
+ * prop, make sure to define styles for `.appear-*` classes as well.
712
+ */
713
+
714
+
715
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
716
+ _inheritsLoose(CSSTransition, _React$Component);
717
+
718
+ function CSSTransition() {
719
+ var _this;
720
+
721
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
722
+ args[_key] = arguments[_key];
723
+ }
724
+
725
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
726
+ _this.appliedClasses = {
727
+ appear: {},
728
+ enter: {},
729
+ exit: {}
730
+ };
731
+
732
+ _this.onEnter = function (maybeNode, maybeAppearing) {
733
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
734
+ node = _this$resolveArgument[0],
735
+ appearing = _this$resolveArgument[1];
736
+
737
+ _this.removeClasses(node, 'exit');
738
+
739
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
740
+
741
+ if (_this.props.onEnter) {
742
+ _this.props.onEnter(maybeNode, maybeAppearing);
743
+ }
744
+ };
745
+
746
+ _this.onEntering = function (maybeNode, maybeAppearing) {
747
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
748
+ node = _this$resolveArgument2[0],
749
+ appearing = _this$resolveArgument2[1];
750
+
751
+ var type = appearing ? 'appear' : 'enter';
752
+
753
+ _this.addClass(node, type, 'active');
754
+
755
+ if (_this.props.onEntering) {
756
+ _this.props.onEntering(maybeNode, maybeAppearing);
757
+ }
758
+ };
759
+
760
+ _this.onEntered = function (maybeNode, maybeAppearing) {
761
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
762
+ node = _this$resolveArgument3[0],
763
+ appearing = _this$resolveArgument3[1];
764
+
765
+ var type = appearing ? 'appear' : 'enter';
766
+
767
+ _this.removeClasses(node, type);
768
+
769
+ _this.addClass(node, type, 'done');
770
+
771
+ if (_this.props.onEntered) {
772
+ _this.props.onEntered(maybeNode, maybeAppearing);
773
+ }
774
+ };
775
+
776
+ _this.onExit = function (maybeNode) {
777
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
778
+ node = _this$resolveArgument4[0];
779
+
780
+ _this.removeClasses(node, 'appear');
781
+
782
+ _this.removeClasses(node, 'enter');
783
+
784
+ _this.addClass(node, 'exit', 'base');
785
+
786
+ if (_this.props.onExit) {
787
+ _this.props.onExit(maybeNode);
788
+ }
789
+ };
790
+
791
+ _this.onExiting = function (maybeNode) {
792
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
793
+ node = _this$resolveArgument5[0];
794
+
795
+ _this.addClass(node, 'exit', 'active');
796
+
797
+ if (_this.props.onExiting) {
798
+ _this.props.onExiting(maybeNode);
799
+ }
800
+ };
801
+
802
+ _this.onExited = function (maybeNode) {
803
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
804
+ node = _this$resolveArgument6[0];
805
+
806
+ _this.removeClasses(node, 'exit');
807
+
808
+ _this.addClass(node, 'exit', 'done');
809
+
810
+ if (_this.props.onExited) {
811
+ _this.props.onExited(maybeNode);
812
+ }
813
+ };
814
+
815
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
816
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
817
+ : [maybeNode, maybeAppearing];
818
+ };
819
+
820
+ _this.getClassNames = function (type) {
821
+ var classNames = _this.props.classNames;
822
+ var isStringClassNames = typeof classNames === 'string';
823
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
824
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
825
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
826
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
827
+ return {
828
+ baseClassName: baseClassName,
829
+ activeClassName: activeClassName,
830
+ doneClassName: doneClassName
831
+ };
832
+ };
833
+
834
+ return _this;
835
+ }
836
+
837
+ var _proto = CSSTransition.prototype;
838
+
839
+ _proto.addClass = function addClass(node, type, phase) {
840
+ var className = this.getClassNames(type)[phase + "ClassName"];
841
+
842
+ var _this$getClassNames = this.getClassNames('enter'),
843
+ doneClassName = _this$getClassNames.doneClassName;
844
+
845
+ if (type === 'appear' && phase === 'done' && doneClassName) {
846
+ className += " " + doneClassName;
847
+ } // This is to force a repaint,
848
+ // which is necessary in order to transition styles when adding a class name.
849
+
850
+
851
+ if (phase === 'active') {
852
+ if (node) forceReflow(node);
853
+ }
854
+
855
+ if (className) {
856
+ this.appliedClasses[type][phase] = className;
857
+
858
+ _addClass(node, className);
859
+ }
860
+ };
861
+
862
+ _proto.removeClasses = function removeClasses(node, type) {
863
+ var _this$appliedClasses$ = this.appliedClasses[type],
864
+ baseClassName = _this$appliedClasses$.base,
865
+ activeClassName = _this$appliedClasses$.active,
866
+ doneClassName = _this$appliedClasses$.done;
867
+ this.appliedClasses[type] = {};
868
+
869
+ if (baseClassName) {
870
+ removeClass(node, baseClassName);
871
+ }
872
+
873
+ if (activeClassName) {
874
+ removeClass(node, activeClassName);
875
+ }
876
+
877
+ if (doneClassName) {
878
+ removeClass(node, doneClassName);
879
+ }
880
+ };
881
+
882
+ _proto.render = function render() {
883
+ var _this$props = this.props;
884
+ _this$props.classNames;
885
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
886
+
887
+ return /*#__PURE__*/React__default.createElement(Transition, _extends({}, props, {
888
+ onEnter: this.onEnter,
889
+ onEntered: this.onEntered,
890
+ onEntering: this.onEntering,
891
+ onExit: this.onExit,
892
+ onExiting: this.onExiting,
893
+ onExited: this.onExited
894
+ }));
895
+ };
896
+
897
+ return CSSTransition;
898
+ }(React__default.Component);
899
+
900
+ CSSTransition.defaultProps = {
901
+ classNames: ''
902
+ };
903
+ CSSTransition.propTypes = {};
904
+
905
+ function _assertThisInitialized(self) {
906
+ if (self === void 0) {
907
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
908
+ }
909
+ return self;
910
+ }
911
+
912
+ /**
913
+ * Given `this.props.children`, return an object mapping key to child.
914
+ *
915
+ * @param {*} children `this.props.children`
916
+ * @return {object} Mapping of key to child
917
+ */
918
+
919
+ function getChildMapping(children, mapFn) {
920
+ var mapper = function mapper(child) {
921
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
922
+ };
923
+
924
+ var result = Object.create(null);
925
+ if (children) Children.map(children, function (c) {
926
+ return c;
927
+ }).forEach(function (child) {
928
+ // run the map function here instead so that the key is the computed one
929
+ result[child.key] = mapper(child);
930
+ });
931
+ return result;
932
+ }
933
+ /**
934
+ * When you're adding or removing children some may be added or removed in the
935
+ * same render pass. We want to show *both* since we want to simultaneously
936
+ * animate elements in and out. This function takes a previous set of keys
937
+ * and a new set of keys and merges them with its best guess of the correct
938
+ * ordering. In the future we may expose some of the utilities in
939
+ * ReactMultiChild to make this easy, but for now React itself does not
940
+ * directly have this concept of the union of prevChildren and nextChildren
941
+ * so we implement it here.
942
+ *
943
+ * @param {object} prev prev children as returned from
944
+ * `ReactTransitionChildMapping.getChildMapping()`.
945
+ * @param {object} next next children as returned from
946
+ * `ReactTransitionChildMapping.getChildMapping()`.
947
+ * @return {object} a key set that contains all keys in `prev` and all keys
948
+ * in `next` in a reasonable order.
949
+ */
950
+
951
+ function mergeChildMappings(prev, next) {
952
+ prev = prev || {};
953
+ next = next || {};
954
+
955
+ function getValueForKey(key) {
956
+ return key in next ? next[key] : prev[key];
957
+ } // For each key of `next`, the list of keys to insert before that key in
958
+ // the combined list
959
+
960
+
961
+ var nextKeysPending = Object.create(null);
962
+ var pendingKeys = [];
963
+
964
+ for (var prevKey in prev) {
965
+ if (prevKey in next) {
966
+ if (pendingKeys.length) {
967
+ nextKeysPending[prevKey] = pendingKeys;
968
+ pendingKeys = [];
969
+ }
970
+ } else {
971
+ pendingKeys.push(prevKey);
972
+ }
973
+ }
974
+
975
+ var i;
976
+ var childMapping = {};
977
+
978
+ for (var nextKey in next) {
979
+ if (nextKeysPending[nextKey]) {
980
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
981
+ var pendingNextKey = nextKeysPending[nextKey][i];
982
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
983
+ }
984
+ }
985
+
986
+ childMapping[nextKey] = getValueForKey(nextKey);
987
+ } // Finally, add the keys which didn't appear before any key in `next`
988
+
989
+
990
+ for (i = 0; i < pendingKeys.length; i++) {
991
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
992
+ }
993
+
994
+ return childMapping;
995
+ }
996
+
997
+ function getProp(child, prop, props) {
998
+ return props[prop] != null ? props[prop] : child.props[prop];
999
+ }
1000
+
1001
+ function getInitialChildMapping(props, onExited) {
1002
+ return getChildMapping(props.children, function (child) {
1003
+ return cloneElement(child, {
1004
+ onExited: onExited.bind(null, child),
1005
+ in: true,
1006
+ appear: getProp(child, 'appear', props),
1007
+ enter: getProp(child, 'enter', props),
1008
+ exit: getProp(child, 'exit', props)
1009
+ });
1010
+ });
1011
+ }
1012
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
1013
+ var nextChildMapping = getChildMapping(nextProps.children);
1014
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
1015
+ Object.keys(children).forEach(function (key) {
1016
+ var child = children[key];
1017
+ if (!isValidElement(child)) return;
1018
+ var hasPrev = (key in prevChildMapping);
1019
+ var hasNext = (key in nextChildMapping);
1020
+ var prevChild = prevChildMapping[key];
1021
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
1022
+
1023
+ if (hasNext && (!hasPrev || isLeaving)) {
1024
+ // console.log('entering', key)
1025
+ children[key] = cloneElement(child, {
1026
+ onExited: onExited.bind(null, child),
1027
+ in: true,
1028
+ exit: getProp(child, 'exit', nextProps),
1029
+ enter: getProp(child, 'enter', nextProps)
1030
+ });
1031
+ } else if (!hasNext && hasPrev && !isLeaving) {
1032
+ // item is old (exiting)
1033
+ // console.log('leaving', key)
1034
+ children[key] = cloneElement(child, {
1035
+ in: false
1036
+ });
1037
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
1038
+ // item hasn't changed transition states
1039
+ // copy over the last transition props;
1040
+ // console.log('unchanged', key)
1041
+ children[key] = cloneElement(child, {
1042
+ onExited: onExited.bind(null, child),
1043
+ in: prevChild.props.in,
1044
+ exit: getProp(child, 'exit', nextProps),
1045
+ enter: getProp(child, 'enter', nextProps)
1046
+ });
1047
+ }
1048
+ });
1049
+ return children;
1050
+ }
1051
+
1052
+ var values = Object.values || function (obj) {
1053
+ return Object.keys(obj).map(function (k) {
1054
+ return obj[k];
1055
+ });
1056
+ };
1057
+
1058
+ var defaultProps = {
1059
+ component: 'div',
1060
+ childFactory: function childFactory(child) {
1061
+ return child;
1062
+ }
1063
+ };
1064
+ /**
1065
+ * The `<TransitionGroup>` component manages a set of transition components
1066
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
1067
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
1068
+ * and unmounting of components over time.
1069
+ *
1070
+ * Consider the example below. As items are removed or added to the TodoList the
1071
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
1072
+ *
1073
+ * Note that `<TransitionGroup>` does not define any animation behavior!
1074
+ * Exactly _how_ a list item animates is up to the individual transition
1075
+ * component. This means you can mix and match animations across different list
1076
+ * items.
1077
+ */
1078
+
1079
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
1080
+ _inheritsLoose(TransitionGroup, _React$Component);
1081
+
1082
+ function TransitionGroup(props, context) {
1083
+ var _this;
1084
+
1085
+ _this = _React$Component.call(this, props, context) || this;
1086
+
1087
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
1088
+
1089
+
1090
+ _this.state = {
1091
+ contextValue: {
1092
+ isMounting: true
1093
+ },
1094
+ handleExited: handleExited,
1095
+ firstRender: true
1096
+ };
1097
+ return _this;
1098
+ }
1099
+
1100
+ var _proto = TransitionGroup.prototype;
1101
+
1102
+ _proto.componentDidMount = function componentDidMount() {
1103
+ this.mounted = true;
1104
+ this.setState({
1105
+ contextValue: {
1106
+ isMounting: false
1107
+ }
1108
+ });
1109
+ };
1110
+
1111
+ _proto.componentWillUnmount = function componentWillUnmount() {
1112
+ this.mounted = false;
1113
+ };
1114
+
1115
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
1116
+ var prevChildMapping = _ref.children,
1117
+ handleExited = _ref.handleExited,
1118
+ firstRender = _ref.firstRender;
1119
+ return {
1120
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
1121
+ firstRender: false
1122
+ };
1123
+ } // node is `undefined` when user provided `nodeRef` prop
1124
+ ;
1125
+
1126
+ _proto.handleExited = function handleExited(child, node) {
1127
+ var currentChildMapping = getChildMapping(this.props.children);
1128
+ if (child.key in currentChildMapping) return;
1129
+
1130
+ if (child.props.onExited) {
1131
+ child.props.onExited(node);
1132
+ }
1133
+
1134
+ if (this.mounted) {
1135
+ this.setState(function (state) {
1136
+ var children = _extends({}, state.children);
1137
+
1138
+ delete children[child.key];
1139
+ return {
1140
+ children: children
1141
+ };
1142
+ });
1143
+ }
1144
+ };
1145
+
1146
+ _proto.render = function render() {
1147
+ var _this$props = this.props,
1148
+ Component = _this$props.component,
1149
+ childFactory = _this$props.childFactory,
1150
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
1151
+
1152
+ var contextValue = this.state.contextValue;
1153
+ var children = values(this.state.children).map(childFactory);
1154
+ delete props.appear;
1155
+ delete props.enter;
1156
+ delete props.exit;
1157
+
1158
+ if (Component === null) {
1159
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1160
+ value: contextValue
1161
+ }, children);
1162
+ }
1163
+
1164
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1165
+ value: contextValue
1166
+ }, /*#__PURE__*/React__default.createElement(Component, props, children));
1167
+ };
1168
+
1169
+ return TransitionGroup;
1170
+ }(React__default.Component);
1171
+
1172
+ TransitionGroup.propTypes = {};
1173
+ TransitionGroup.defaultProps = defaultProps;
1174
+
1175
+ /**
1176
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
1177
+ * that animates between two children.
1178
+ *
1179
+ * ```jsx
1180
+ * <ReplaceTransition in>
1181
+ * <Fade><div>I appear first</div></Fade>
1182
+ * <Fade><div>I replace the above</div></Fade>
1183
+ * </ReplaceTransition>
1184
+ * ```
1185
+ */
1186
+
1187
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
1188
+ _inheritsLoose(ReplaceTransition, _React$Component);
1189
+
1190
+ function ReplaceTransition() {
1191
+ var _this;
1192
+
1193
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
1194
+ _args[_key] = arguments[_key];
1195
+ }
1196
+
1197
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
1198
+
1199
+ _this.handleEnter = function () {
1200
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1201
+ args[_key2] = arguments[_key2];
1202
+ }
1203
+
1204
+ return _this.handleLifecycle('onEnter', 0, args);
1205
+ };
1206
+
1207
+ _this.handleEntering = function () {
1208
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1209
+ args[_key3] = arguments[_key3];
1210
+ }
1211
+
1212
+ return _this.handleLifecycle('onEntering', 0, args);
1213
+ };
1214
+
1215
+ _this.handleEntered = function () {
1216
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1217
+ args[_key4] = arguments[_key4];
1218
+ }
1219
+
1220
+ return _this.handleLifecycle('onEntered', 0, args);
1221
+ };
1222
+
1223
+ _this.handleExit = function () {
1224
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1225
+ args[_key5] = arguments[_key5];
1226
+ }
1227
+
1228
+ return _this.handleLifecycle('onExit', 1, args);
1229
+ };
1230
+
1231
+ _this.handleExiting = function () {
1232
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
1233
+ args[_key6] = arguments[_key6];
1234
+ }
1235
+
1236
+ return _this.handleLifecycle('onExiting', 1, args);
1237
+ };
1238
+
1239
+ _this.handleExited = function () {
1240
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1241
+ args[_key7] = arguments[_key7];
1242
+ }
1243
+
1244
+ return _this.handleLifecycle('onExited', 1, args);
1245
+ };
1246
+
1247
+ return _this;
1248
+ }
1249
+
1250
+ var _proto = ReplaceTransition.prototype;
1251
+
1252
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
1253
+ var _child$props;
1254
+
1255
+ var children = this.props.children;
1256
+ var child = React__default.Children.toArray(children)[idx];
1257
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
1258
+
1259
+ if (this.props[handler]) {
1260
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM__default.findDOMNode(this);
1261
+ this.props[handler](maybeNode);
1262
+ }
1263
+ };
1264
+
1265
+ _proto.render = function render() {
1266
+ var _this$props = this.props,
1267
+ children = _this$props.children,
1268
+ inProp = _this$props.in,
1269
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
1270
+
1271
+ var _React$Children$toArr = React__default.Children.toArray(children),
1272
+ first = _React$Children$toArr[0],
1273
+ second = _React$Children$toArr[1];
1274
+
1275
+ delete props.onEnter;
1276
+ delete props.onEntering;
1277
+ delete props.onEntered;
1278
+ delete props.onExit;
1279
+ delete props.onExiting;
1280
+ delete props.onExited;
1281
+ return /*#__PURE__*/React__default.createElement(TransitionGroup, props, inProp ? React__default.cloneElement(first, {
1282
+ key: 'first',
1283
+ onEnter: this.handleEnter,
1284
+ onEntering: this.handleEntering,
1285
+ onEntered: this.handleEntered
1286
+ }) : React__default.cloneElement(second, {
1287
+ key: 'second',
1288
+ onEnter: this.handleExit,
1289
+ onEntering: this.handleExiting,
1290
+ onEntered: this.handleExited
1291
+ }));
1292
+ };
1293
+
1294
+ return ReplaceTransition;
1295
+ }(React__default.Component);
1296
+
1297
+ ReplaceTransition.propTypes = {};
1298
+
1299
+ var _leaveRenders, _enterRenders;
1300
+
1301
+ function areChildrenDifferent(oldChildren, newChildren) {
1302
+ if (oldChildren === newChildren) return false;
1303
+
1304
+ if (React__default.isValidElement(oldChildren) && React__default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
1305
+ return false;
1306
+ }
1307
+
1308
+ return true;
1309
+ }
1310
+ /**
1311
+ * Enum of modes for SwitchTransition component
1312
+ * @enum { string }
1313
+ */
1314
+
1315
+
1316
+ var modes = {
1317
+ out: 'out-in',
1318
+ in: 'in-out'
1319
+ };
1320
+
1321
+ var callHook = function callHook(element, name, cb) {
1322
+ return function () {
1323
+ var _element$props;
1324
+
1325
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
1326
+ cb();
1327
+ };
1328
+ };
1329
+
1330
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
1331
+ var current = _ref.current,
1332
+ changeState = _ref.changeState;
1333
+ return React__default.cloneElement(current, {
1334
+ in: false,
1335
+ onExited: callHook(current, 'onExited', function () {
1336
+ changeState(ENTERING, null);
1337
+ })
1338
+ });
1339
+ }, _leaveRenders[modes.in] = function (_ref2) {
1340
+ var current = _ref2.current,
1341
+ changeState = _ref2.changeState,
1342
+ children = _ref2.children;
1343
+ return [current, React__default.cloneElement(children, {
1344
+ in: true,
1345
+ onEntered: callHook(children, 'onEntered', function () {
1346
+ changeState(ENTERING);
1347
+ })
1348
+ })];
1349
+ }, _leaveRenders);
1350
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
1351
+ var children = _ref3.children,
1352
+ changeState = _ref3.changeState;
1353
+ return React__default.cloneElement(children, {
1354
+ in: true,
1355
+ onEntered: callHook(children, 'onEntered', function () {
1356
+ changeState(ENTERED, React__default.cloneElement(children, {
1357
+ in: true
1358
+ }));
1359
+ })
1360
+ });
1361
+ }, _enterRenders[modes.in] = function (_ref4) {
1362
+ var current = _ref4.current,
1363
+ children = _ref4.children,
1364
+ changeState = _ref4.changeState;
1365
+ return [React__default.cloneElement(current, {
1366
+ in: false,
1367
+ onExited: callHook(current, 'onExited', function () {
1368
+ changeState(ENTERED, React__default.cloneElement(children, {
1369
+ in: true
1370
+ }));
1371
+ })
1372
+ }), React__default.cloneElement(children, {
1373
+ in: true
1374
+ })];
1375
+ }, _enterRenders);
1376
+ /**
1377
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
1378
+ * You can use it when you want to control the render between state transitions.
1379
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
1380
+ *
1381
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
1382
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
1383
+ *
1384
+ * **Note**: If you want the animation to happen simultaneously
1385
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
1386
+ * you should use
1387
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
1388
+ * instead.
1389
+ *
1390
+ * ```jsx
1391
+ * function App() {
1392
+ * const [state, setState] = useState(false);
1393
+ * return (
1394
+ * <SwitchTransition>
1395
+ * <CSSTransition
1396
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
1397
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
1398
+ * classNames='fade'
1399
+ * >
1400
+ * <button onClick={() => setState(state => !state)}>
1401
+ * {state ? "Goodbye, world!" : "Hello, world!"}
1402
+ * </button>
1403
+ * </CSSTransition>
1404
+ * </SwitchTransition>
1405
+ * );
1406
+ * }
1407
+ * ```
1408
+ *
1409
+ * ```css
1410
+ * .fade-enter{
1411
+ * opacity: 0;
1412
+ * }
1413
+ * .fade-exit{
1414
+ * opacity: 1;
1415
+ * }
1416
+ * .fade-enter-active{
1417
+ * opacity: 1;
1418
+ * }
1419
+ * .fade-exit-active{
1420
+ * opacity: 0;
1421
+ * }
1422
+ * .fade-enter-active,
1423
+ * .fade-exit-active{
1424
+ * transition: opacity 500ms;
1425
+ * }
1426
+ * ```
1427
+ */
1428
+
1429
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
1430
+ _inheritsLoose(SwitchTransition, _React$Component);
1431
+
1432
+ function SwitchTransition() {
1433
+ var _this;
1434
+
1435
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1436
+ args[_key] = arguments[_key];
1437
+ }
1438
+
1439
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1440
+ _this.state = {
1441
+ status: ENTERED,
1442
+ current: null
1443
+ };
1444
+ _this.appeared = false;
1445
+
1446
+ _this.changeState = function (status, current) {
1447
+ if (current === void 0) {
1448
+ current = _this.state.current;
1449
+ }
1450
+
1451
+ _this.setState({
1452
+ status: status,
1453
+ current: current
1454
+ });
1455
+ };
1456
+
1457
+ return _this;
1458
+ }
1459
+
1460
+ var _proto = SwitchTransition.prototype;
1461
+
1462
+ _proto.componentDidMount = function componentDidMount() {
1463
+ this.appeared = true;
1464
+ };
1465
+
1466
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
1467
+ if (props.children == null) {
1468
+ return {
1469
+ current: null
1470
+ };
1471
+ }
1472
+
1473
+ if (state.status === ENTERING && props.mode === modes.in) {
1474
+ return {
1475
+ status: ENTERING
1476
+ };
1477
+ }
1478
+
1479
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
1480
+ return {
1481
+ status: EXITING
1482
+ };
1483
+ }
1484
+
1485
+ return {
1486
+ current: React__default.cloneElement(props.children, {
1487
+ in: true
1488
+ })
1489
+ };
1490
+ };
1491
+
1492
+ _proto.render = function render() {
1493
+ var _this$props = this.props,
1494
+ children = _this$props.children,
1495
+ mode = _this$props.mode,
1496
+ _this$state = this.state,
1497
+ status = _this$state.status,
1498
+ current = _this$state.current;
1499
+ var data = {
1500
+ children: children,
1501
+ current: current,
1502
+ changeState: this.changeState,
1503
+ status: status
1504
+ };
1505
+ var component;
1506
+
1507
+ switch (status) {
1508
+ case ENTERING:
1509
+ component = enterRenders[mode](data);
1510
+ break;
1511
+
1512
+ case EXITING:
1513
+ component = leaveRenders[mode](data);
1514
+ break;
1515
+
1516
+ case ENTERED:
1517
+ component = current;
1518
+ }
1519
+
1520
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1521
+ value: {
1522
+ isMounting: !this.appeared
1523
+ }
1524
+ }, component);
1525
+ };
1526
+
1527
+ return SwitchTransition;
1528
+ }(React__default.Component);
1529
+
1530
+ SwitchTransition.propTypes = {};
1531
+ SwitchTransition.defaultProps = {
1532
+ mode: modes.out
1533
+ };
1534
+
1535
+ var useEnhancedEffect$2 = typeof window === 'undefined' ? React$2.useEffect : React$2.useLayoutEffect;
1536
+ /**
1537
+ * @ignore - internal component.
1538
+ */
1539
+
1540
+ function Ripple(props) {
1541
+ var classes = props.classes,
1542
+ _props$pulsate = props.pulsate,
1543
+ pulsate = _props$pulsate === void 0 ? false : _props$pulsate,
1544
+ rippleX = props.rippleX,
1545
+ rippleY = props.rippleY,
1546
+ rippleSize = props.rippleSize,
1547
+ inProp = props.in,
1548
+ _props$onExited = props.onExited,
1549
+ onExited = _props$onExited === void 0 ? function () {} : _props$onExited,
1550
+ timeout = props.timeout;
1551
+
1552
+ var _React$useState = React$2.useState(false),
1553
+ leaving = _React$useState[0],
1554
+ setLeaving = _React$useState[1];
1555
+
1556
+ var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
1557
+ var rippleStyles = {
1558
+ width: rippleSize,
1559
+ height: rippleSize,
1560
+ top: -(rippleSize / 2) + rippleY,
1561
+ left: -(rippleSize / 2) + rippleX
1562
+ };
1563
+ var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
1564
+ var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority
1565
+
1566
+ useEnhancedEffect$2(function () {
1567
+ if (!inProp) {
1568
+ // react-transition-group#onExit
1569
+ setLeaving(true); // react-transition-group#onExited
1570
+
1571
+ var timeoutId = setTimeout(handleExited, timeout);
1572
+ return function () {
1573
+ clearTimeout(timeoutId);
1574
+ };
1575
+ }
1576
+
1577
+ return undefined;
1578
+ }, [handleExited, inProp, timeout]);
1579
+ return /*#__PURE__*/React$2.createElement("span", {
1580
+ className: rippleClassName,
1581
+ style: rippleStyles
1582
+ }, /*#__PURE__*/React$2.createElement("span", {
1583
+ className: childClassName
1584
+ }));
1585
+ }
1586
+
1587
+ var DURATION = 550;
1588
+ var DELAY_RIPPLE = 80;
1589
+ var styles$7 = function styles(theme) {
1590
+ return {
1591
+ /* Styles applied to the root element. */
1592
+ root: {
1593
+ overflow: 'hidden',
1594
+ pointerEvents: 'none',
1595
+ position: 'absolute',
1596
+ zIndex: 0,
1597
+ top: 0,
1598
+ right: 0,
1599
+ bottom: 0,
1600
+ left: 0,
1601
+ borderRadius: 'inherit'
1602
+ },
1603
+
1604
+ /* Styles applied to the internal `Ripple` components `ripple` class. */
1605
+ ripple: {
1606
+ opacity: 0,
1607
+ position: 'absolute'
1608
+ },
1609
+
1610
+ /* Styles applied to the internal `Ripple` components `rippleVisible` class. */
1611
+ rippleVisible: {
1612
+ opacity: 0.3,
1613
+ transform: 'scale(1)',
1614
+ animation: "$enter ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
1615
+ },
1616
+
1617
+ /* Styles applied to the internal `Ripple` components `ripplePulsate` class. */
1618
+ ripplePulsate: {
1619
+ animationDuration: "".concat(theme.transitions.duration.shorter, "ms")
1620
+ },
1621
+
1622
+ /* Styles applied to the internal `Ripple` components `child` class. */
1623
+ child: {
1624
+ opacity: 1,
1625
+ display: 'block',
1626
+ width: '100%',
1627
+ height: '100%',
1628
+ borderRadius: '50%',
1629
+ backgroundColor: 'currentColor'
1630
+ },
1631
+
1632
+ /* Styles applied to the internal `Ripple` components `childLeaving` class. */
1633
+ childLeaving: {
1634
+ opacity: 0,
1635
+ animation: "$exit ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
1636
+ },
1637
+
1638
+ /* Styles applied to the internal `Ripple` components `childPulsate` class. */
1639
+ childPulsate: {
1640
+ position: 'absolute',
1641
+ left: 0,
1642
+ top: 0,
1643
+ animation: "$pulsate 2500ms ".concat(theme.transitions.easing.easeInOut, " 200ms infinite")
1644
+ },
1645
+ '@keyframes enter': {
1646
+ '0%': {
1647
+ transform: 'scale(0)',
1648
+ opacity: 0.1
1649
+ },
1650
+ '100%': {
1651
+ transform: 'scale(1)',
1652
+ opacity: 0.3
1653
+ }
1654
+ },
1655
+ '@keyframes exit': {
1656
+ '0%': {
1657
+ opacity: 1
1658
+ },
1659
+ '100%': {
1660
+ opacity: 0
1661
+ }
1662
+ },
1663
+ '@keyframes pulsate': {
1664
+ '0%': {
1665
+ transform: 'scale(1)'
1666
+ },
1667
+ '50%': {
1668
+ transform: 'scale(0.92)'
1669
+ },
1670
+ '100%': {
1671
+ transform: 'scale(1)'
1672
+ }
1673
+ }
1674
+ };
1675
+ };
1676
+ /**
1677
+ * @ignore - internal component.
1678
+ *
1679
+ * TODO v5: Make private
1680
+ */
1681
+
1682
+ var TouchRipple = /*#__PURE__*/React$2.forwardRef(function TouchRipple(props, ref) {
1683
+ var _props$center = props.center,
1684
+ centerProp = _props$center === void 0 ? false : _props$center,
1685
+ classes = props.classes,
1686
+ className = props.className,
1687
+ other = _objectWithoutProperties(props, ["center", "classes", "className"]);
1688
+
1689
+ var _React$useState = React$2.useState([]),
1690
+ ripples = _React$useState[0],
1691
+ setRipples = _React$useState[1];
1692
+
1693
+ var nextKey = React$2.useRef(0);
1694
+ var rippleCallback = React$2.useRef(null);
1695
+ React$2.useEffect(function () {
1696
+ if (rippleCallback.current) {
1697
+ rippleCallback.current();
1698
+ rippleCallback.current = null;
1699
+ }
1700
+ }, [ripples]); // Used to filter out mouse emulated events on mobile.
1701
+
1702
+ var ignoringMouseDown = React$2.useRef(false); // We use a timer in order to only show the ripples for touch "click" like events.
1703
+ // We don't want to display the ripple for touch scroll events.
1704
+
1705
+ var startTimer = React$2.useRef(null); // This is the hook called once the previous timeout is ready.
1706
+
1707
+ var startTimerCommit = React$2.useRef(null);
1708
+ var container = React$2.useRef(null);
1709
+ React$2.useEffect(function () {
1710
+ return function () {
1711
+ clearTimeout(startTimer.current);
1712
+ };
1713
+ }, []);
1714
+ var startCommit = React$2.useCallback(function (params) {
1715
+ var pulsate = params.pulsate,
1716
+ rippleX = params.rippleX,
1717
+ rippleY = params.rippleY,
1718
+ rippleSize = params.rippleSize,
1719
+ cb = params.cb;
1720
+ setRipples(function (oldRipples) {
1721
+ return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/React$2.createElement(Ripple, {
1722
+ key: nextKey.current,
1723
+ classes: classes,
1724
+ timeout: DURATION,
1725
+ pulsate: pulsate,
1726
+ rippleX: rippleX,
1727
+ rippleY: rippleY,
1728
+ rippleSize: rippleSize
1729
+ })]);
1730
+ });
1731
+ nextKey.current += 1;
1732
+ rippleCallback.current = cb;
1733
+ }, [classes]);
1734
+ var start = React$2.useCallback(function () {
1735
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1736
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1737
+ var cb = arguments.length > 2 ? arguments[2] : undefined;
1738
+ var _options$pulsate = options.pulsate,
1739
+ pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
1740
+ _options$center = options.center,
1741
+ center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,
1742
+ _options$fakeElement = options.fakeElement,
1743
+ fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;
1744
+
1745
+ if (event.type === 'mousedown' && ignoringMouseDown.current) {
1746
+ ignoringMouseDown.current = false;
1747
+ return;
1748
+ }
1749
+
1750
+ if (event.type === 'touchstart') {
1751
+ ignoringMouseDown.current = true;
1752
+ }
1753
+
1754
+ var element = fakeElement ? null : container.current;
1755
+ var rect = element ? element.getBoundingClientRect() : {
1756
+ width: 0,
1757
+ height: 0,
1758
+ left: 0,
1759
+ top: 0
1760
+ }; // Get the size of the ripple
1761
+
1762
+ var rippleX;
1763
+ var rippleY;
1764
+ var rippleSize;
1765
+
1766
+ if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
1767
+ rippleX = Math.round(rect.width / 2);
1768
+ rippleY = Math.round(rect.height / 2);
1769
+ } else {
1770
+ var _ref = event.touches ? event.touches[0] : event,
1771
+ clientX = _ref.clientX,
1772
+ clientY = _ref.clientY;
1773
+
1774
+ rippleX = Math.round(clientX - rect.left);
1775
+ rippleY = Math.round(clientY - rect.top);
1776
+ }
1777
+
1778
+ if (center) {
1779
+ rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.
1780
+
1781
+ if (rippleSize % 2 === 0) {
1782
+ rippleSize += 1;
1783
+ }
1784
+ } else {
1785
+ var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
1786
+ var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
1787
+ rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
1788
+ } // Touche devices
1789
+
1790
+
1791
+ if (event.touches) {
1792
+ // check that this isn't another touchstart due to multitouch
1793
+ // otherwise we will only clear a single timer when unmounting while two
1794
+ // are running
1795
+ if (startTimerCommit.current === null) {
1796
+ // Prepare the ripple effect.
1797
+ startTimerCommit.current = function () {
1798
+ startCommit({
1799
+ pulsate: pulsate,
1800
+ rippleX: rippleX,
1801
+ rippleY: rippleY,
1802
+ rippleSize: rippleSize,
1803
+ cb: cb
1804
+ });
1805
+ }; // Delay the execution of the ripple effect.
1806
+
1807
+
1808
+ startTimer.current = setTimeout(function () {
1809
+ if (startTimerCommit.current) {
1810
+ startTimerCommit.current();
1811
+ startTimerCommit.current = null;
1812
+ }
1813
+ }, DELAY_RIPPLE); // We have to make a tradeoff with this value.
1814
+ }
1815
+ } else {
1816
+ startCommit({
1817
+ pulsate: pulsate,
1818
+ rippleX: rippleX,
1819
+ rippleY: rippleY,
1820
+ rippleSize: rippleSize,
1821
+ cb: cb
1822
+ });
1823
+ }
1824
+ }, [centerProp, startCommit]);
1825
+ var pulsate = React$2.useCallback(function () {
1826
+ start({}, {
1827
+ pulsate: true
1828
+ });
1829
+ }, [start]);
1830
+ var stop = React$2.useCallback(function (event, cb) {
1831
+ clearTimeout(startTimer.current); // The touch interaction occurs too quickly.
1832
+ // We still want to show ripple effect.
1833
+
1834
+ if (event.type === 'touchend' && startTimerCommit.current) {
1835
+ event.persist();
1836
+ startTimerCommit.current();
1837
+ startTimerCommit.current = null;
1838
+ startTimer.current = setTimeout(function () {
1839
+ stop(event, cb);
1840
+ });
1841
+ return;
1842
+ }
1843
+
1844
+ startTimerCommit.current = null;
1845
+ setRipples(function (oldRipples) {
1846
+ if (oldRipples.length > 0) {
1847
+ return oldRipples.slice(1);
1848
+ }
1849
+
1850
+ return oldRipples;
1851
+ });
1852
+ rippleCallback.current = cb;
1853
+ }, []);
1854
+ React$2.useImperativeHandle(ref, function () {
1855
+ return {
1856
+ pulsate: pulsate,
1857
+ start: start,
1858
+ stop: stop
1859
+ };
1860
+ }, [pulsate, start, stop]);
1861
+ return /*#__PURE__*/React$2.createElement("span", _extends({
1862
+ className: clsx(classes.root, className),
1863
+ ref: container
1864
+ }, other), /*#__PURE__*/React$2.createElement(TransitionGroup, {
1865
+ component: null,
1866
+ exit: true
1867
+ }, ripples));
1868
+ });
1869
+ var TouchRipple$1 = withStyles(styles$7, {
1870
+ flip: false,
1871
+ name: 'MuiTouchRipple'
1872
+ })( /*#__PURE__*/React$2.memo(TouchRipple));
1873
+
1874
+ var styles$6 = {
1875
+ /* Styles applied to the root element. */
1876
+ root: {
1877
+ display: 'inline-flex',
1878
+ alignItems: 'center',
1879
+ justifyContent: 'center',
1880
+ position: 'relative',
1881
+ WebkitTapHighlightColor: 'transparent',
1882
+ backgroundColor: 'transparent',
1883
+ // Reset default value
1884
+ // We disable the focus ring for mouse, touch and keyboard users.
1885
+ outline: 0,
1886
+ border: 0,
1887
+ margin: 0,
1888
+ // Remove the margin in Safari
1889
+ borderRadius: 0,
1890
+ padding: 0,
1891
+ // Remove the padding in Firefox
1892
+ cursor: 'pointer',
1893
+ userSelect: 'none',
1894
+ verticalAlign: 'middle',
1895
+ '-moz-appearance': 'none',
1896
+ // Reset
1897
+ '-webkit-appearance': 'none',
1898
+ // Reset
1899
+ textDecoration: 'none',
1900
+ // So we take precedent over the style of a native <a /> element.
1901
+ color: 'inherit',
1902
+ '&::-moz-focus-inner': {
1903
+ borderStyle: 'none' // Remove Firefox dotted outline.
1904
+
1905
+ },
1906
+ '&$disabled': {
1907
+ pointerEvents: 'none',
1908
+ // Disable link interactions
1909
+ cursor: 'default'
1910
+ },
1911
+ '@media print': {
1912
+ colorAdjust: 'exact'
1913
+ }
1914
+ },
1915
+
1916
+ /* Pseudo-class applied to the root element if `disabled={true}`. */
1917
+ disabled: {},
1918
+
1919
+ /* Pseudo-class applied to the root element if keyboard focused. */
1920
+ focusVisible: {}
1921
+ };
1922
+ /**
1923
+ * `ButtonBase` contains as few styles as possible.
1924
+ * It aims to be a simple building block for creating a button.
1925
+ * It contains a load of style reset and some focus/ripple logic.
1926
+ */
1927
+
1928
+ var ButtonBase = /*#__PURE__*/React$2.forwardRef(function ButtonBase(props, ref) {
1929
+ var action = props.action,
1930
+ buttonRefProp = props.buttonRef,
1931
+ _props$centerRipple = props.centerRipple,
1932
+ centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,
1933
+ children = props.children,
1934
+ classes = props.classes,
1935
+ className = props.className,
1936
+ _props$component = props.component,
1937
+ component = _props$component === void 0 ? 'button' : _props$component,
1938
+ _props$disabled = props.disabled,
1939
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
1940
+ _props$disableRipple = props.disableRipple,
1941
+ disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,
1942
+ _props$disableTouchRi = props.disableTouchRipple,
1943
+ disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,
1944
+ _props$focusRipple = props.focusRipple,
1945
+ focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,
1946
+ focusVisibleClassName = props.focusVisibleClassName,
1947
+ onBlur = props.onBlur,
1948
+ onClick = props.onClick,
1949
+ onFocus = props.onFocus,
1950
+ onFocusVisible = props.onFocusVisible,
1951
+ onKeyDown = props.onKeyDown,
1952
+ onKeyUp = props.onKeyUp,
1953
+ onMouseDown = props.onMouseDown,
1954
+ onMouseLeave = props.onMouseLeave,
1955
+ onMouseUp = props.onMouseUp,
1956
+ onTouchEnd = props.onTouchEnd,
1957
+ onTouchMove = props.onTouchMove,
1958
+ onTouchStart = props.onTouchStart,
1959
+ onDragLeave = props.onDragLeave,
1960
+ _props$tabIndex = props.tabIndex,
1961
+ tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
1962
+ TouchRippleProps = props.TouchRippleProps,
1963
+ _props$type = props.type,
1964
+ type = _props$type === void 0 ? 'button' : _props$type,
1965
+ other = _objectWithoutProperties(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]);
1966
+
1967
+ var buttonRef = React$2.useRef(null);
1968
+
1969
+ function getButtonNode() {
1970
+ // #StrictMode ready
1971
+ return ReactDOM.findDOMNode(buttonRef.current);
1972
+ }
1973
+
1974
+ var rippleRef = React$2.useRef(null);
1975
+
1976
+ var _React$useState = React$2.useState(false),
1977
+ focusVisible = _React$useState[0],
1978
+ setFocusVisible = _React$useState[1];
1979
+
1980
+ if (disabled && focusVisible) {
1981
+ setFocusVisible(false);
1982
+ }
1983
+
1984
+ var _useIsFocusVisible = useIsFocusVisible(),
1985
+ isFocusVisible = _useIsFocusVisible.isFocusVisible,
1986
+ onBlurVisible = _useIsFocusVisible.onBlurVisible,
1987
+ focusVisibleRef = _useIsFocusVisible.ref;
1988
+
1989
+ React$2.useImperativeHandle(action, function () {
1990
+ return {
1991
+ focusVisible: function focusVisible() {
1992
+ setFocusVisible(true);
1993
+ buttonRef.current.focus();
1994
+ }
1995
+ };
1996
+ }, []);
1997
+ React$2.useEffect(function () {
1998
+ if (focusVisible && focusRipple && !disableRipple) {
1999
+ rippleRef.current.pulsate();
2000
+ }
2001
+ }, [disableRipple, focusRipple, focusVisible]);
2002
+
2003
+ function useRippleHandler(rippleAction, eventCallback) {
2004
+ var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;
2005
+ return useEventCallback(function (event) {
2006
+ if (eventCallback) {
2007
+ eventCallback(event);
2008
+ }
2009
+
2010
+ var ignore = skipRippleAction;
2011
+
2012
+ if (!ignore && rippleRef.current) {
2013
+ rippleRef.current[rippleAction](event);
2014
+ }
2015
+
2016
+ return true;
2017
+ });
2018
+ }
2019
+
2020
+ var handleMouseDown = useRippleHandler('start', onMouseDown);
2021
+ var handleDragLeave = useRippleHandler('stop', onDragLeave);
2022
+ var handleMouseUp = useRippleHandler('stop', onMouseUp);
2023
+ var handleMouseLeave = useRippleHandler('stop', function (event) {
2024
+ if (focusVisible) {
2025
+ event.preventDefault();
2026
+ }
2027
+
2028
+ if (onMouseLeave) {
2029
+ onMouseLeave(event);
2030
+ }
2031
+ });
2032
+ var handleTouchStart = useRippleHandler('start', onTouchStart);
2033
+ var handleTouchEnd = useRippleHandler('stop', onTouchEnd);
2034
+ var handleTouchMove = useRippleHandler('stop', onTouchMove);
2035
+ var handleBlur = useRippleHandler('stop', function (event) {
2036
+ if (focusVisible) {
2037
+ onBlurVisible(event);
2038
+ setFocusVisible(false);
2039
+ }
2040
+
2041
+ if (onBlur) {
2042
+ onBlur(event);
2043
+ }
2044
+ }, false);
2045
+ var handleFocus = useEventCallback(function (event) {
2046
+ // Fix for https://github.com/facebook/react/issues/7769
2047
+ if (!buttonRef.current) {
2048
+ buttonRef.current = event.currentTarget;
2049
+ }
2050
+
2051
+ if (isFocusVisible(event)) {
2052
+ setFocusVisible(true);
2053
+
2054
+ if (onFocusVisible) {
2055
+ onFocusVisible(event);
2056
+ }
2057
+ }
2058
+
2059
+ if (onFocus) {
2060
+ onFocus(event);
2061
+ }
2062
+ });
2063
+
2064
+ var isNonNativeButton = function isNonNativeButton() {
2065
+ var button = getButtonNode();
2066
+ return component && component !== 'button' && !(button.tagName === 'A' && button.href);
2067
+ };
2068
+ /**
2069
+ * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
2070
+ */
2071
+
2072
+
2073
+ var keydownRef = React$2.useRef(false);
2074
+ var handleKeyDown = useEventCallback(function (event) {
2075
+ // Check if key is already down to avoid repeats being counted as multiple activations
2076
+ if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
2077
+ keydownRef.current = true;
2078
+ event.persist();
2079
+ rippleRef.current.stop(event, function () {
2080
+ rippleRef.current.start(event);
2081
+ });
2082
+ }
2083
+
2084
+ if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
2085
+ event.preventDefault();
2086
+ }
2087
+
2088
+ if (onKeyDown) {
2089
+ onKeyDown(event);
2090
+ } // Keyboard accessibility for non interactive elements
2091
+
2092
+
2093
+ if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
2094
+ event.preventDefault();
2095
+
2096
+ if (onClick) {
2097
+ onClick(event);
2098
+ }
2099
+ }
2100
+ });
2101
+ var handleKeyUp = useEventCallback(function (event) {
2102
+ // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
2103
+ // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
2104
+ if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
2105
+ keydownRef.current = false;
2106
+ event.persist();
2107
+ rippleRef.current.stop(event, function () {
2108
+ rippleRef.current.pulsate(event);
2109
+ });
2110
+ }
2111
+
2112
+ if (onKeyUp) {
2113
+ onKeyUp(event);
2114
+ } // Keyboard accessibility for non interactive elements
2115
+
2116
+
2117
+ if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
2118
+ onClick(event);
2119
+ }
2120
+ });
2121
+ var ComponentProp = component;
2122
+
2123
+ if (ComponentProp === 'button' && other.href) {
2124
+ ComponentProp = 'a';
2125
+ }
2126
+
2127
+ var buttonProps = {};
2128
+
2129
+ if (ComponentProp === 'button') {
2130
+ buttonProps.type = type;
2131
+ buttonProps.disabled = disabled;
2132
+ } else {
2133
+ if (ComponentProp !== 'a' || !other.href) {
2134
+ buttonProps.role = 'button';
2135
+ }
2136
+
2137
+ buttonProps['aria-disabled'] = disabled;
2138
+ }
2139
+
2140
+ var handleUserRef = useForkRef(buttonRefProp, ref);
2141
+ var handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
2142
+ var handleRef = useForkRef(handleUserRef, handleOwnRef);
2143
+
2144
+ var _React$useState2 = React$2.useState(false),
2145
+ mountedState = _React$useState2[0],
2146
+ setMountedState = _React$useState2[1];
2147
+
2148
+ React$2.useEffect(function () {
2149
+ setMountedState(true);
2150
+ }, []);
2151
+ var enableTouchRipple = mountedState && !disableRipple && !disabled;
2152
+
2153
+ return /*#__PURE__*/React$2.createElement(ComponentProp, _extends({
2154
+ className: clsx(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled),
2155
+ onBlur: handleBlur,
2156
+ onClick: onClick,
2157
+ onFocus: handleFocus,
2158
+ onKeyDown: handleKeyDown,
2159
+ onKeyUp: handleKeyUp,
2160
+ onMouseDown: handleMouseDown,
2161
+ onMouseLeave: handleMouseLeave,
2162
+ onMouseUp: handleMouseUp,
2163
+ onDragLeave: handleDragLeave,
2164
+ onTouchEnd: handleTouchEnd,
2165
+ onTouchMove: handleTouchMove,
2166
+ onTouchStart: handleTouchStart,
2167
+ ref: handleRef,
2168
+ tabIndex: disabled ? -1 : tabIndex
2169
+ }, buttonProps, other), children, enableTouchRipple ?
2170
+ /*#__PURE__*/
2171
+
2172
+ /* TouchRipple is only needed client-side, x2 boost on the server. */
2173
+ React$2.createElement(TouchRipple$1, _extends({
2174
+ ref: rippleRef,
2175
+ center: centerRipple
2176
+ }, TouchRippleProps)) : null);
2177
+ });
2178
+ var ButtonBase$1 = withStyles(styles$6, {
2179
+ name: 'MuiButtonBase'
2180
+ })(ButtonBase);
2181
+
2182
+ /**
2183
+ * @ignore - internal component.
2184
+ */
2185
+
2186
+ var FirstPageIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2187
+ d: "M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"
2188
+ }));
2189
+
2190
+ /**
2191
+ * @ignore - internal component.
2192
+ */
2193
+
2194
+ var LastPageIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2195
+ d: "M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"
2196
+ }));
2197
+
2198
+ /**
2199
+ * @ignore - internal component.
2200
+ */
2201
+
2202
+ var NavigateBeforeIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2203
+ d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"
2204
+ }));
2205
+
2206
+ /**
2207
+ * @ignore - internal component.
2208
+ */
2209
+
2210
+ var NavigateNextIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2211
+ d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
2212
+ }));
2213
+
2214
+ var styles$5 = function styles(theme) {
2215
+ return {
2216
+ /* Styles applied to the root element. */
2217
+ root: _extends({}, theme.typography.body2, {
2218
+ borderRadius: 32 / 2,
2219
+ textAlign: 'center',
2220
+ boxSizing: 'border-box',
2221
+ minWidth: 32,
2222
+ height: 32,
2223
+ padding: '0 6px',
2224
+ margin: '0 3px',
2225
+ color: theme.palette.text.primary
2226
+ }),
2227
+
2228
+ /* Styles applied to the root element if `type="page"`. */
2229
+ page: {
2230
+ transition: theme.transitions.create(['color', 'background-color'], {
2231
+ duration: theme.transitions.duration.short
2232
+ }),
2233
+ '&:hover': {
2234
+ backgroundColor: theme.palette.action.hover,
2235
+ // Reset on touch devices, it doesn't add specificity
2236
+ '@media (hover: none)': {
2237
+ backgroundColor: 'transparent'
2238
+ }
2239
+ },
2240
+ '&$focusVisible': {
2241
+ backgroundColor: theme.palette.action.focus
2242
+ },
2243
+ '&$selected': {
2244
+ backgroundColor: theme.palette.action.selected,
2245
+ '&:hover, &$focusVisible': {
2246
+ backgroundColor: alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
2247
+ // Reset on touch devices, it doesn't add specificity
2248
+ '@media (hover: none)': {
2249
+ backgroundColor: theme.palette.action.selected
2250
+ }
2251
+ },
2252
+ '&$disabled': {
2253
+ opacity: 1,
2254
+ color: theme.palette.action.disabled,
2255
+ backgroundColor: theme.palette.action.selected
2256
+ }
2257
+ },
2258
+ '&$disabled': {
2259
+ opacity: theme.palette.action.disabledOpacity
2260
+ }
2261
+ },
2262
+
2263
+ /* Styles applied applied to the root element if `size="small"`. */
2264
+ sizeSmall: {
2265
+ minWidth: 26,
2266
+ height: 26,
2267
+ borderRadius: 26 / 2,
2268
+ margin: '0 1px',
2269
+ padding: '0 4px',
2270
+ '& $icon': {
2271
+ fontSize: theme.typography.pxToRem(18)
2272
+ }
2273
+ },
2274
+
2275
+ /* Styles applied applied to the root element if `size="large"`. */
2276
+ sizeLarge: {
2277
+ minWidth: 40,
2278
+ height: 40,
2279
+ borderRadius: 40 / 2,
2280
+ padding: '0 10px',
2281
+ fontSize: theme.typography.pxToRem(15),
2282
+ '& $icon': {
2283
+ fontSize: theme.typography.pxToRem(22)
2284
+ }
2285
+ },
2286
+
2287
+ /* Styles applied to the root element if `variant="text"` and `color="primary"`. */
2288
+ textPrimary: {
2289
+ '&$selected': {
2290
+ color: theme.palette.primary.contrastText,
2291
+ backgroundColor: theme.palette.primary.main,
2292
+ '&:hover, &$focusVisible': {
2293
+ backgroundColor: theme.palette.primary.dark,
2294
+ // Reset on touch devices, it doesn't add specificity
2295
+ '@media (hover: none)': {
2296
+ backgroundColor: theme.palette.primary.main
2297
+ }
2298
+ },
2299
+ '&$disabled': {
2300
+ color: theme.palette.action.disabled
2301
+ }
2302
+ }
2303
+ },
2304
+
2305
+ /* Styles applied to the root element if `variant="text"` and `color="secondary"`. */
2306
+ textSecondary: {
2307
+ '&$selected': {
2308
+ color: theme.palette.secondary.contrastText,
2309
+ backgroundColor: theme.palette.secondary.main,
2310
+ '&:hover, &$focusVisible': {
2311
+ backgroundColor: theme.palette.secondary.dark,
2312
+ // Reset on touch devices, it doesn't add specificity
2313
+ '@media (hover: none)': {
2314
+ backgroundColor: theme.palette.secondary.main
2315
+ }
2316
+ },
2317
+ '&$disabled': {
2318
+ color: theme.palette.action.disabled
2319
+ }
2320
+ }
2321
+ },
2322
+
2323
+ /* Styles applied to the root element if `outlined="true"`. */
2324
+ outlined: {
2325
+ border: "1px solid ".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'),
2326
+ '&$selected': {
2327
+ '&$disabled': {
2328
+ border: "1px solid ".concat(theme.palette.action.disabledBackground)
2329
+ }
2330
+ }
2331
+ },
2332
+
2333
+ /* Styles applied to the root element if `variant="outlined"` and `color="primary"`. */
2334
+ outlinedPrimary: {
2335
+ '&$selected': {
2336
+ color: theme.palette.primary.main,
2337
+ border: "1px solid ".concat(alpha(theme.palette.primary.main, 0.5)),
2338
+ backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity),
2339
+ '&:hover, &$focusVisible': {
2340
+ backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity + theme.palette.action.hoverOpacity),
2341
+ // Reset on touch devices, it doesn't add specificity
2342
+ '@media (hover: none)': {
2343
+ backgroundColor: 'transparent'
2344
+ }
2345
+ },
2346
+ '&$disabled': {
2347
+ color: theme.palette.action.disabled
2348
+ }
2349
+ }
2350
+ },
2351
+
2352
+ /* Styles applied to the root element if `variant="outlined"` and `color="secondary"`. */
2353
+ outlinedSecondary: {
2354
+ '&$selected': {
2355
+ color: theme.palette.secondary.main,
2356
+ border: "1px solid ".concat(alpha(theme.palette.secondary.main, 0.5)),
2357
+ backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.activatedOpacity),
2358
+ '&:hover, &$focusVisible': {
2359
+ backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.activatedOpacity + theme.palette.action.hoverOpacity),
2360
+ // Reset on touch devices, it doesn't add specificity
2361
+ '@media (hover: none)': {
2362
+ backgroundColor: 'transparent'
2363
+ }
2364
+ },
2365
+ '&$disabled': {
2366
+ color: theme.palette.action.disabled
2367
+ }
2368
+ }
2369
+ },
2370
+
2371
+ /* Styles applied to the root element if `rounded="true"`. */
2372
+ rounded: {
2373
+ borderRadius: theme.shape.borderRadius
2374
+ },
2375
+
2376
+ /* Styles applied to the root element if `type="start-ellipsis"` or `type="end-ellipsis"`. */
2377
+ ellipsis: {
2378
+ height: 'auto',
2379
+ '&$disabled': {
2380
+ opacity: theme.palette.action.disabledOpacity
2381
+ }
2382
+ },
2383
+
2384
+ /* Pseudo-class applied to the root element if keyboard focused. */
2385
+ focusVisible: {},
2386
+
2387
+ /* Pseudo-class applied to the root element if `disabled={true}`. */
2388
+ disabled: {},
2389
+
2390
+ /* Pseudo-class applied to the root element if `selected={true}`. */
2391
+ selected: {},
2392
+
2393
+ /* Styles applied to the icon element. */
2394
+ icon: {
2395
+ fontSize: theme.typography.pxToRem(20),
2396
+ margin: '0 -8px'
2397
+ }
2398
+ };
2399
+ };
2400
+ var PaginationItem = /*#__PURE__*/React$2.forwardRef(function PaginationItem(props, ref) {
2401
+ var classes = props.classes,
2402
+ className = props.className,
2403
+ _props$color = props.color,
2404
+ color = _props$color === void 0 ? 'standard' : _props$color,
2405
+ component = props.component,
2406
+ _props$disabled = props.disabled,
2407
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
2408
+ page = props.page,
2409
+ _props$selected = props.selected,
2410
+ selected = _props$selected === void 0 ? false : _props$selected,
2411
+ _props$shape = props.shape,
2412
+ shape = _props$shape === void 0 ? 'round' : _props$shape,
2413
+ _props$size = props.size,
2414
+ size = _props$size === void 0 ? 'medium' : _props$size,
2415
+ _props$type = props.type,
2416
+ type = _props$type === void 0 ? 'page' : _props$type,
2417
+ _props$variant = props.variant,
2418
+ variant = _props$variant === void 0 ? 'text' : _props$variant,
2419
+ other = _objectWithoutProperties(props, ["classes", "className", "color", "component", "disabled", "page", "selected", "shape", "size", "type", "variant"]);
2420
+
2421
+ var theme = useTheme();
2422
+ var normalizedIcons = theme.direction === 'rtl' ? {
2423
+ previous: NavigateNextIcon,
2424
+ next: NavigateBeforeIcon,
2425
+ last: FirstPageIcon,
2426
+ first: LastPageIcon
2427
+ } : {
2428
+ previous: NavigateBeforeIcon,
2429
+ next: NavigateNextIcon,
2430
+ first: FirstPageIcon,
2431
+ last: LastPageIcon
2432
+ };
2433
+ var Icon = normalizedIcons[type];
2434
+ return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/React$2.createElement("div", {
2435
+ ref: ref,
2436
+ className: clsx(classes.root, classes.ellipsis, disabled && classes.disabled, size !== 'medium' && classes["size".concat(capitalize(size))])
2437
+ }, "\u2026") : /*#__PURE__*/React$2.createElement(ButtonBase$1, _extends({
2438
+ ref: ref,
2439
+ component: component,
2440
+ disabled: disabled,
2441
+ focusVisibleClassName: classes.focusVisible,
2442
+ className: clsx(classes.root, classes.page, classes[variant], classes[shape], className, color !== 'standard' && classes["".concat(variant).concat(capitalize(color))], disabled && classes.disabled, selected && classes.selected, size !== 'medium' && classes["size".concat(capitalize(size))])
2443
+ }, other), type === 'page' && page, Icon ? /*#__PURE__*/React$2.createElement(Icon, {
2444
+ className: classes.icon
2445
+ }) : null);
2446
+ });
2447
+ var PaginationItem$1 = withStyles(styles$5, {
2448
+ name: 'MuiPaginationItem'
2449
+ })(PaginationItem);
2450
+
2451
+ var styles$4 = {
2452
+ /* Styles applied to the root element. */
2453
+ root: {},
2454
+
2455
+ /* Styles applied to the ul element. */
2456
+ ul: {
2457
+ display: 'flex',
2458
+ flexWrap: 'wrap',
2459
+ alignItems: 'center',
2460
+ padding: 0,
2461
+ margin: 0,
2462
+ listStyle: 'none'
2463
+ }
2464
+ };
2465
+
2466
+ function defaultGetAriaLabel(type, page, selected) {
2467
+ if (type === 'page') {
2468
+ return "".concat(selected ? '' : 'Go to ', "page ").concat(page);
2469
+ }
2470
+
2471
+ return "Go to ".concat(type, " page");
2472
+ }
2473
+
2474
+ var Pagination$1 = /*#__PURE__*/React$2.forwardRef(function Pagination(props, ref) {
2475
+ props.boundaryCount;
2476
+ var classes = props.classes,
2477
+ className = props.className,
2478
+ _props$color = props.color,
2479
+ color = _props$color === void 0 ? 'standard' : _props$color;
2480
+ props.count;
2481
+ props.defaultPage;
2482
+ props.disabled;
2483
+ var _props$getItemAriaLab = props.getItemAriaLabel,
2484
+ getItemAriaLabel = _props$getItemAriaLab === void 0 ? defaultGetAriaLabel : _props$getItemAriaLab;
2485
+ props.hideNextButton;
2486
+ props.hidePrevButton;
2487
+ props.onChange;
2488
+ props.page;
2489
+ var _props$renderItem = props.renderItem,
2490
+ renderItem = _props$renderItem === void 0 ? function (item) {
2491
+ return /*#__PURE__*/React$2.createElement(PaginationItem$1, item);
2492
+ } : _props$renderItem,
2493
+ _props$shape = props.shape,
2494
+ shape = _props$shape === void 0 ? 'round' : _props$shape;
2495
+ props.showFirstButton;
2496
+ props.showLastButton;
2497
+ props.siblingCount;
2498
+ var _props$size = props.size,
2499
+ size = _props$size === void 0 ? 'medium' : _props$size,
2500
+ _props$variant = props.variant,
2501
+ variant = _props$variant === void 0 ? 'text' : _props$variant,
2502
+ other = _objectWithoutProperties(props, ["boundaryCount", "classes", "className", "color", "count", "defaultPage", "disabled", "getItemAriaLabel", "hideNextButton", "hidePrevButton", "onChange", "page", "renderItem", "shape", "showFirstButton", "showLastButton", "siblingCount", "size", "variant"]);
2503
+
2504
+ var _usePagination = usePagination(_extends({}, props, {
2505
+ componentName: 'Pagination'
2506
+ })),
2507
+ items = _usePagination.items;
2508
+
2509
+ return /*#__PURE__*/React$2.createElement("nav", _extends({
2510
+ "aria-label": "pagination navigation",
2511
+ className: clsx(classes.root, className),
2512
+ ref: ref
2513
+ }, other), /*#__PURE__*/React$2.createElement("ul", {
2514
+ className: classes.ul
2515
+ }, items.map(function (item, index) {
2516
+ return /*#__PURE__*/React$2.createElement("li", {
2517
+ key: index
2518
+ }, renderItem(_extends({}, item, {
2519
+ color: color,
2520
+ 'aria-label': getItemAriaLabel(item.type, item.page, item.selected),
2521
+ shape: shape,
2522
+ size: size,
2523
+ variant: variant
2524
+ })));
2525
+ })));
2526
+ }); // @default tags synced with default values from usePagination
2527
+ var MUIPagination = withStyles(styles$4, {
2528
+ name: 'MuiPagination'
2529
+ })(Pagination$1);
2530
+
2531
+ /**
2532
+ * @ignore - internal component.
2533
+ */
2534
+
2535
+ var NativeSelectInput = /*#__PURE__*/React$2.forwardRef(function NativeSelectInput(props, ref) {
2536
+ var classes = props.classes,
2537
+ className = props.className,
2538
+ disabled = props.disabled,
2539
+ IconComponent = props.IconComponent,
2540
+ inputRef = props.inputRef,
2541
+ _props$variant = props.variant,
2542
+ variant = _props$variant === void 0 ? 'standard' : _props$variant,
2543
+ other = _objectWithoutProperties(props, ["classes", "className", "disabled", "IconComponent", "inputRef", "variant"]);
2544
+
2545
+ return /*#__PURE__*/React$2.createElement(React$2.Fragment, null, /*#__PURE__*/React$2.createElement("select", _extends({
2546
+ className: clsx(classes.root, // TODO v5: merge root and select
2547
+ classes.select, classes[variant], className, disabled && classes.disabled),
2548
+ disabled: disabled,
2549
+ ref: inputRef || ref
2550
+ }, other)), props.multiple ? null : /*#__PURE__*/React$2.createElement(IconComponent, {
2551
+ className: clsx(classes.icon, classes["icon".concat(capitalize(variant))], disabled && classes.disabled)
2552
+ }));
2553
+ });
2554
+
2555
+ function formControlState(_ref) {
2556
+ var props = _ref.props,
2557
+ states = _ref.states,
2558
+ muiFormControl = _ref.muiFormControl;
2559
+ return states.reduce(function (acc, state) {
2560
+ acc[state] = props[state];
2561
+
2562
+ if (muiFormControl) {
2563
+ if (typeof props[state] === 'undefined') {
2564
+ acc[state] = muiFormControl[state];
2565
+ }
2566
+ }
2567
+
2568
+ return acc;
2569
+ }, {});
2570
+ }
2571
+
2572
+ /**
2573
+ * @ignore - internal component.
2574
+ */
2575
+
2576
+ var FormControlContext = React$2.createContext();
2577
+
2578
+ function useFormControl$1() {
2579
+ return React$2.useContext(FormControlContext);
2580
+ }
2581
+
2582
+ function useFormControl() {
2583
+ return React$2.useContext(FormControlContext);
2584
+ }
2585
+
2586
+ /**
2587
+ * @ignore - internal component.
2588
+ */
2589
+
2590
+ var ArrowDropDownIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2591
+ d: "M7 10l5 5 5-5z"
2592
+ }));
2593
+
2594
+ function getStyleValue(computedStyle, property) {
2595
+ return parseInt(computedStyle[property], 10) || 0;
2596
+ }
2597
+
2598
+ var useEnhancedEffect$1 = typeof window !== 'undefined' ? React$2.useLayoutEffect : React$2.useEffect;
2599
+ var styles$3 = {
2600
+ /* Styles applied to the shadow textarea element. */
2601
+ shadow: {
2602
+ // Visibility needed to hide the extra text area on iPads
2603
+ visibility: 'hidden',
2604
+ // Remove from the content flow
2605
+ position: 'absolute',
2606
+ // Ignore the scrollbar width
2607
+ overflow: 'hidden',
2608
+ height: 0,
2609
+ top: 0,
2610
+ left: 0,
2611
+ // Create a new layer, increase the isolation of the computed values
2612
+ transform: 'translateZ(0)'
2613
+ }
2614
+ };
2615
+ var TextareaAutosize = /*#__PURE__*/React$2.forwardRef(function TextareaAutosize(props, ref) {
2616
+ var onChange = props.onChange,
2617
+ rows = props.rows,
2618
+ rowsMax = props.rowsMax,
2619
+ rowsMinProp = props.rowsMin,
2620
+ maxRowsProp = props.maxRows,
2621
+ _props$minRows = props.minRows,
2622
+ minRowsProp = _props$minRows === void 0 ? 1 : _props$minRows,
2623
+ style = props.style,
2624
+ value = props.value,
2625
+ other = _objectWithoutProperties(props, ["onChange", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "style", "value"]);
2626
+
2627
+ var maxRows = maxRowsProp || rowsMax;
2628
+ var minRows = rows || rowsMinProp || minRowsProp;
2629
+
2630
+ var _React$useRef = React$2.useRef(value != null),
2631
+ isControlled = _React$useRef.current;
2632
+
2633
+ var inputRef = React$2.useRef(null);
2634
+ var handleRef = useForkRef(ref, inputRef);
2635
+ var shadowRef = React$2.useRef(null);
2636
+ var renders = React$2.useRef(0);
2637
+
2638
+ var _React$useState = React$2.useState({}),
2639
+ state = _React$useState[0],
2640
+ setState = _React$useState[1];
2641
+
2642
+ var syncHeight = React$2.useCallback(function () {
2643
+ var input = inputRef.current;
2644
+ var computedStyle = window.getComputedStyle(input);
2645
+ var inputShallow = shadowRef.current;
2646
+ inputShallow.style.width = computedStyle.width;
2647
+ inputShallow.value = input.value || props.placeholder || 'x';
2648
+
2649
+ if (inputShallow.value.slice(-1) === '\n') {
2650
+ // Certain fonts which overflow the line height will cause the textarea
2651
+ // to report a different scrollHeight depending on whether the last line
2652
+ // is empty. Make it non-empty to avoid this issue.
2653
+ inputShallow.value += ' ';
2654
+ }
2655
+
2656
+ var boxSizing = computedStyle['box-sizing'];
2657
+ var padding = getStyleValue(computedStyle, 'padding-bottom') + getStyleValue(computedStyle, 'padding-top');
2658
+ var border = getStyleValue(computedStyle, 'border-bottom-width') + getStyleValue(computedStyle, 'border-top-width'); // The height of the inner content
2659
+
2660
+ var innerHeight = inputShallow.scrollHeight - padding; // Measure height of a textarea with a single row
2661
+
2662
+ inputShallow.value = 'x';
2663
+ var singleRowHeight = inputShallow.scrollHeight - padding; // The height of the outer content
2664
+
2665
+ var outerHeight = innerHeight;
2666
+
2667
+ if (minRows) {
2668
+ outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
2669
+ }
2670
+
2671
+ if (maxRows) {
2672
+ outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
2673
+ }
2674
+
2675
+ outerHeight = Math.max(outerHeight, singleRowHeight); // Take the box sizing into account for applying this value as a style.
2676
+
2677
+ var outerHeightStyle = outerHeight + (boxSizing === 'border-box' ? padding + border : 0);
2678
+ var overflow = Math.abs(outerHeight - innerHeight) <= 1;
2679
+ setState(function (prevState) {
2680
+ // Need a large enough difference to update the height.
2681
+ // This prevents infinite rendering loop.
2682
+ if (renders.current < 20 && (outerHeightStyle > 0 && Math.abs((prevState.outerHeightStyle || 0) - outerHeightStyle) > 1 || prevState.overflow !== overflow)) {
2683
+ renders.current += 1;
2684
+ return {
2685
+ overflow: overflow,
2686
+ outerHeightStyle: outerHeightStyle
2687
+ };
2688
+ }
2689
+
2690
+ return prevState;
2691
+ });
2692
+ }, [maxRows, minRows, props.placeholder]);
2693
+ React$2.useEffect(function () {
2694
+ var handleResize = debounce(function () {
2695
+ renders.current = 0;
2696
+ syncHeight();
2697
+ });
2698
+ window.addEventListener('resize', handleResize);
2699
+ return function () {
2700
+ handleResize.clear();
2701
+ window.removeEventListener('resize', handleResize);
2702
+ };
2703
+ }, [syncHeight]);
2704
+ useEnhancedEffect$1(function () {
2705
+ syncHeight();
2706
+ });
2707
+ React$2.useEffect(function () {
2708
+ renders.current = 0;
2709
+ }, [value]);
2710
+
2711
+ var handleChange = function handleChange(event) {
2712
+ renders.current = 0;
2713
+
2714
+ if (!isControlled) {
2715
+ syncHeight();
2716
+ }
2717
+
2718
+ if (onChange) {
2719
+ onChange(event);
2720
+ }
2721
+ };
2722
+
2723
+ return /*#__PURE__*/React$2.createElement(React$2.Fragment, null, /*#__PURE__*/React$2.createElement("textarea", _extends({
2724
+ value: value,
2725
+ onChange: handleChange,
2726
+ ref: handleRef // Apply the rows prop to get a "correct" first SSR paint
2727
+ ,
2728
+ rows: minRows,
2729
+ style: _extends({
2730
+ height: state.outerHeightStyle,
2731
+ // Need a large enough difference to allow scrolling.
2732
+ // This prevents infinite rendering loop.
2733
+ overflow: state.overflow ? 'hidden' : null
2734
+ }, style)
2735
+ }, other)), /*#__PURE__*/React$2.createElement("textarea", {
2736
+ "aria-hidden": true,
2737
+ className: props.className,
2738
+ readOnly: true,
2739
+ ref: shadowRef,
2740
+ tabIndex: -1,
2741
+ style: _extends({}, styles$3.shadow, style)
2742
+ }));
2743
+ });
2744
+
2745
+ // Supports determination of isControlled().
2746
+ // Controlled input accepts its current value as a prop.
2747
+ //
2748
+ // @see https://facebook.github.io/react/docs/forms.html#controlled-components
2749
+ // @param value
2750
+ // @returns {boolean} true if string (including '') or number (including zero)
2751
+ function hasValue(value) {
2752
+ return value != null && !(Array.isArray(value) && value.length === 0);
2753
+ } // Determine if field is empty or filled.
2754
+ // Response determines if label is presented above field or as placeholder.
2755
+ //
2756
+ // @param obj
2757
+ // @param SSR
2758
+ // @returns {boolean} False when not present or empty string.
2759
+ // True when any number or string with length.
2760
+
2761
+ function isFilled(obj) {
2762
+ var SSR = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2763
+ return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');
2764
+ } // Determine if an Input is adorned on start.
2765
+
2766
+ var styles$2 = function styles(theme) {
2767
+ var light = theme.palette.type === 'light';
2768
+ var placeholder = {
2769
+ color: 'currentColor',
2770
+ opacity: light ? 0.42 : 0.5,
2771
+ transition: theme.transitions.create('opacity', {
2772
+ duration: theme.transitions.duration.shorter
2773
+ })
2774
+ };
2775
+ var placeholderHidden = {
2776
+ opacity: '0 !important'
2777
+ };
2778
+ var placeholderVisible = {
2779
+ opacity: light ? 0.42 : 0.5
2780
+ };
2781
+ return {
2782
+ '@global': {
2783
+ '@keyframes mui-auto-fill': {},
2784
+ '@keyframes mui-auto-fill-cancel': {}
2785
+ },
2786
+
2787
+ /* Styles applied to the root element. */
2788
+ root: _extends({}, theme.typography.body1, {
2789
+ color: theme.palette.text.primary,
2790
+ lineHeight: '1.1876em',
2791
+ // Reset (19px), match the native input line-height
2792
+ boxSizing: 'border-box',
2793
+ // Prevent padding issue with fullWidth.
2794
+ position: 'relative',
2795
+ cursor: 'text',
2796
+ display: 'inline-flex',
2797
+ alignItems: 'center',
2798
+ '&$disabled': {
2799
+ color: theme.palette.text.disabled,
2800
+ cursor: 'default'
2801
+ }
2802
+ }),
2803
+
2804
+ /* Styles applied to the root element if the component is a descendant of `FormControl`. */
2805
+ formControl: {},
2806
+
2807
+ /* Styles applied to the root element if the component is focused. */
2808
+ focused: {},
2809
+
2810
+ /* Styles applied to the root element if `disabled={true}`. */
2811
+ disabled: {},
2812
+
2813
+ /* Styles applied to the root element if `startAdornment` is provided. */
2814
+ adornedStart: {},
2815
+
2816
+ /* Styles applied to the root element if `endAdornment` is provided. */
2817
+ adornedEnd: {},
2818
+
2819
+ /* Pseudo-class applied to the root element if `error={true}`. */
2820
+ error: {},
2821
+
2822
+ /* Styles applied to the `input` element if `margin="dense"`. */
2823
+ marginDense: {},
2824
+
2825
+ /* Styles applied to the root element if `multiline={true}`. */
2826
+ multiline: {
2827
+ padding: "".concat(8 - 2, "px 0 ").concat(8 - 1, "px"),
2828
+ '&$marginDense': {
2829
+ paddingTop: 4 - 1
2830
+ }
2831
+ },
2832
+
2833
+ /* Styles applied to the root element if the color is secondary. */
2834
+ colorSecondary: {},
2835
+
2836
+ /* Styles applied to the root element if `fullWidth={true}`. */
2837
+ fullWidth: {
2838
+ width: '100%'
2839
+ },
2840
+
2841
+ /* Styles applied to the `input` element. */
2842
+ input: {
2843
+ font: 'inherit',
2844
+ letterSpacing: 'inherit',
2845
+ color: 'currentColor',
2846
+ padding: "".concat(8 - 2, "px 0 ").concat(8 - 1, "px"),
2847
+ border: 0,
2848
+ boxSizing: 'content-box',
2849
+ background: 'none',
2850
+ height: '1.1876em',
2851
+ // Reset (19px), match the native input line-height
2852
+ margin: 0,
2853
+ // Reset for Safari
2854
+ WebkitTapHighlightColor: 'transparent',
2855
+ display: 'block',
2856
+ // Make the flex item shrink with Firefox
2857
+ minWidth: 0,
2858
+ width: '100%',
2859
+ // Fix IE 11 width issue
2860
+ animationName: 'mui-auto-fill-cancel',
2861
+ animationDuration: '10ms',
2862
+ '&::-webkit-input-placeholder': placeholder,
2863
+ '&::-moz-placeholder': placeholder,
2864
+ // Firefox 19+
2865
+ '&:-ms-input-placeholder': placeholder,
2866
+ // IE 11
2867
+ '&::-ms-input-placeholder': placeholder,
2868
+ // Edge
2869
+ '&:focus': {
2870
+ outline: 0
2871
+ },
2872
+ // Reset Firefox invalid required input style
2873
+ '&:invalid': {
2874
+ boxShadow: 'none'
2875
+ },
2876
+ '&::-webkit-search-decoration': {
2877
+ // Remove the padding when type=search.
2878
+ '-webkit-appearance': 'none'
2879
+ },
2880
+ // Show and hide the placeholder logic
2881
+ 'label[data-shrink=false] + $formControl &': {
2882
+ '&::-webkit-input-placeholder': placeholderHidden,
2883
+ '&::-moz-placeholder': placeholderHidden,
2884
+ // Firefox 19+
2885
+ '&:-ms-input-placeholder': placeholderHidden,
2886
+ // IE 11
2887
+ '&::-ms-input-placeholder': placeholderHidden,
2888
+ // Edge
2889
+ '&:focus::-webkit-input-placeholder': placeholderVisible,
2890
+ '&:focus::-moz-placeholder': placeholderVisible,
2891
+ // Firefox 19+
2892
+ '&:focus:-ms-input-placeholder': placeholderVisible,
2893
+ // IE 11
2894
+ '&:focus::-ms-input-placeholder': placeholderVisible // Edge
2895
+
2896
+ },
2897
+ '&$disabled': {
2898
+ opacity: 1 // Reset iOS opacity
2899
+
2900
+ },
2901
+ '&:-webkit-autofill': {
2902
+ animationDuration: '5000s',
2903
+ animationName: 'mui-auto-fill'
2904
+ }
2905
+ },
2906
+
2907
+ /* Styles applied to the `input` element if `margin="dense"`. */
2908
+ inputMarginDense: {
2909
+ paddingTop: 4 - 1
2910
+ },
2911
+
2912
+ /* Styles applied to the `input` element if `multiline={true}`. */
2913
+ inputMultiline: {
2914
+ height: 'auto',
2915
+ resize: 'none',
2916
+ padding: 0
2917
+ },
2918
+
2919
+ /* Styles applied to the `input` element if `type="search"`. */
2920
+ inputTypeSearch: {
2921
+ // Improve type search style.
2922
+ '-moz-appearance': 'textfield',
2923
+ '-webkit-appearance': 'textfield'
2924
+ },
2925
+
2926
+ /* Styles applied to the `input` element if `startAdornment` is provided. */
2927
+ inputAdornedStart: {},
2928
+
2929
+ /* Styles applied to the `input` element if `endAdornment` is provided. */
2930
+ inputAdornedEnd: {},
2931
+
2932
+ /* Styles applied to the `input` element if `hiddenLabel={true}`. */
2933
+ inputHiddenLabel: {}
2934
+ };
2935
+ };
2936
+ var useEnhancedEffect = typeof window === 'undefined' ? React$2.useEffect : React$2.useLayoutEffect;
2937
+ /**
2938
+ * `InputBase` contains as few styles as possible.
2939
+ * It aims to be a simple building block for creating an input.
2940
+ * It contains a load of style reset and some state logic.
2941
+ */
2942
+
2943
+ var InputBase = /*#__PURE__*/React$2.forwardRef(function InputBase(props, ref) {
2944
+ var ariaDescribedby = props['aria-describedby'],
2945
+ autoComplete = props.autoComplete,
2946
+ autoFocus = props.autoFocus,
2947
+ classes = props.classes,
2948
+ className = props.className;
2949
+ props.color;
2950
+ var defaultValue = props.defaultValue,
2951
+ disabled = props.disabled,
2952
+ endAdornment = props.endAdornment;
2953
+ props.error;
2954
+ var _props$fullWidth = props.fullWidth,
2955
+ fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
2956
+ id = props.id,
2957
+ _props$inputComponent = props.inputComponent,
2958
+ inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent,
2959
+ _props$inputProps = props.inputProps,
2960
+ inputPropsProp = _props$inputProps === void 0 ? {} : _props$inputProps,
2961
+ inputRefProp = props.inputRef;
2962
+ props.margin;
2963
+ var _props$multiline = props.multiline,
2964
+ multiline = _props$multiline === void 0 ? false : _props$multiline,
2965
+ name = props.name,
2966
+ onBlur = props.onBlur,
2967
+ onChange = props.onChange,
2968
+ onClick = props.onClick,
2969
+ onFocus = props.onFocus,
2970
+ onKeyDown = props.onKeyDown,
2971
+ onKeyUp = props.onKeyUp,
2972
+ placeholder = props.placeholder,
2973
+ readOnly = props.readOnly,
2974
+ renderSuffix = props.renderSuffix,
2975
+ rows = props.rows,
2976
+ rowsMax = props.rowsMax,
2977
+ rowsMin = props.rowsMin,
2978
+ maxRows = props.maxRows,
2979
+ minRows = props.minRows,
2980
+ startAdornment = props.startAdornment,
2981
+ _props$type = props.type,
2982
+ type = _props$type === void 0 ? 'text' : _props$type,
2983
+ valueProp = props.value,
2984
+ other = _objectWithoutProperties(props, ["aria-describedby", "autoComplete", "autoFocus", "classes", "className", "color", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "startAdornment", "type", "value"]);
2985
+
2986
+ var value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
2987
+
2988
+ var _React$useRef = React$2.useRef(value != null),
2989
+ isControlled = _React$useRef.current;
2990
+
2991
+ var inputRef = React$2.useRef();
2992
+ var handleInputRefWarning = React$2.useCallback(function (instance) {
2993
+ }, []);
2994
+ var handleInputPropsRefProp = useForkRef(inputPropsProp.ref, handleInputRefWarning);
2995
+ var handleInputRefProp = useForkRef(inputRefProp, handleInputPropsRefProp);
2996
+ var handleInputRef = useForkRef(inputRef, handleInputRefProp);
2997
+
2998
+ var _React$useState = React$2.useState(false),
2999
+ focused = _React$useState[0],
3000
+ setFocused = _React$useState[1];
3001
+
3002
+ var muiFormControl = useFormControl$1();
3003
+
3004
+ var fcs = formControlState({
3005
+ props: props,
3006
+ muiFormControl: muiFormControl,
3007
+ states: ['color', 'disabled', 'error', 'hiddenLabel', 'margin', 'required', 'filled']
3008
+ });
3009
+ fcs.focused = muiFormControl ? muiFormControl.focused : focused; // The blur won't fire when the disabled state is set on a focused input.
3010
+ // We need to book keep the focused state manually.
3011
+
3012
+ React$2.useEffect(function () {
3013
+ if (!muiFormControl && disabled && focused) {
3014
+ setFocused(false);
3015
+
3016
+ if (onBlur) {
3017
+ onBlur();
3018
+ }
3019
+ }
3020
+ }, [muiFormControl, disabled, focused, onBlur]);
3021
+ var onFilled = muiFormControl && muiFormControl.onFilled;
3022
+ var onEmpty = muiFormControl && muiFormControl.onEmpty;
3023
+ var checkDirty = React$2.useCallback(function (obj) {
3024
+ if (isFilled(obj)) {
3025
+ if (onFilled) {
3026
+ onFilled();
3027
+ }
3028
+ } else if (onEmpty) {
3029
+ onEmpty();
3030
+ }
3031
+ }, [onFilled, onEmpty]);
3032
+ useEnhancedEffect(function () {
3033
+ if (isControlled) {
3034
+ checkDirty({
3035
+ value: value
3036
+ });
3037
+ }
3038
+ }, [value, checkDirty, isControlled]);
3039
+
3040
+ var handleFocus = function handleFocus(event) {
3041
+ // Fix a bug with IE 11 where the focus/blur events are triggered
3042
+ // while the input is disabled.
3043
+ if (fcs.disabled) {
3044
+ event.stopPropagation();
3045
+ return;
3046
+ }
3047
+
3048
+ if (onFocus) {
3049
+ onFocus(event);
3050
+ }
3051
+
3052
+ if (inputPropsProp.onFocus) {
3053
+ inputPropsProp.onFocus(event);
3054
+ }
3055
+
3056
+ if (muiFormControl && muiFormControl.onFocus) {
3057
+ muiFormControl.onFocus(event);
3058
+ } else {
3059
+ setFocused(true);
3060
+ }
3061
+ };
3062
+
3063
+ var handleBlur = function handleBlur(event) {
3064
+ if (onBlur) {
3065
+ onBlur(event);
3066
+ }
3067
+
3068
+ if (inputPropsProp.onBlur) {
3069
+ inputPropsProp.onBlur(event);
3070
+ }
3071
+
3072
+ if (muiFormControl && muiFormControl.onBlur) {
3073
+ muiFormControl.onBlur(event);
3074
+ } else {
3075
+ setFocused(false);
3076
+ }
3077
+ };
3078
+
3079
+ var handleChange = function handleChange(event) {
3080
+ if (!isControlled) {
3081
+ var element = event.target || inputRef.current;
3082
+
3083
+ if (element == null) {
3084
+ throw new Error(formatMuiErrorMessage(1));
3085
+ }
3086
+
3087
+ checkDirty({
3088
+ value: element.value
3089
+ });
3090
+ }
3091
+
3092
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3093
+ args[_key - 1] = arguments[_key];
3094
+ }
3095
+
3096
+ if (inputPropsProp.onChange) {
3097
+ inputPropsProp.onChange.apply(inputPropsProp, [event].concat(args));
3098
+ } // Perform in the willUpdate
3099
+
3100
+
3101
+ if (onChange) {
3102
+ onChange.apply(void 0, [event].concat(args));
3103
+ }
3104
+ }; // Check the input state on mount, in case it was filled by the user
3105
+ // or auto filled by the browser before the hydration (for SSR).
3106
+
3107
+
3108
+ React$2.useEffect(function () {
3109
+ checkDirty(inputRef.current);
3110
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
3111
+
3112
+ var handleClick = function handleClick(event) {
3113
+ if (inputRef.current && event.currentTarget === event.target) {
3114
+ inputRef.current.focus();
3115
+ }
3116
+
3117
+ if (onClick) {
3118
+ onClick(event);
3119
+ }
3120
+ };
3121
+
3122
+ var InputComponent = inputComponent;
3123
+
3124
+ var inputProps = _extends({}, inputPropsProp, {
3125
+ ref: handleInputRef
3126
+ });
3127
+
3128
+ if (typeof InputComponent !== 'string') {
3129
+ inputProps = _extends({
3130
+ // Rename ref to inputRef as we don't know the
3131
+ // provided `inputComponent` structure.
3132
+ inputRef: handleInputRef,
3133
+ type: type
3134
+ }, inputProps, {
3135
+ ref: null
3136
+ });
3137
+ } else if (multiline) {
3138
+ if (rows && !maxRows && !minRows && !rowsMax && !rowsMin) {
3139
+ InputComponent = 'textarea';
3140
+ } else {
3141
+ inputProps = _extends({
3142
+ minRows: rows || minRows,
3143
+ rowsMax: rowsMax,
3144
+ maxRows: maxRows
3145
+ }, inputProps);
3146
+ InputComponent = TextareaAutosize;
3147
+ }
3148
+ } else {
3149
+ inputProps = _extends({
3150
+ type: type
3151
+ }, inputProps);
3152
+ }
3153
+
3154
+ var handleAutoFill = function handleAutoFill(event) {
3155
+ // Provide a fake value as Chrome might not let you access it for security reasons.
3156
+ checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
3157
+ value: 'x'
3158
+ });
3159
+ };
3160
+
3161
+ React$2.useEffect(function () {
3162
+ if (muiFormControl) {
3163
+ muiFormControl.setAdornedStart(Boolean(startAdornment));
3164
+ }
3165
+ }, [muiFormControl, startAdornment]);
3166
+ return /*#__PURE__*/React$2.createElement("div", _extends({
3167
+ className: clsx(classes.root, classes["color".concat(capitalize(fcs.color || 'primary'))], className, fcs.disabled && classes.disabled, fcs.error && classes.error, fullWidth && classes.fullWidth, fcs.focused && classes.focused, muiFormControl && classes.formControl, multiline && classes.multiline, startAdornment && classes.adornedStart, endAdornment && classes.adornedEnd, fcs.margin === 'dense' && classes.marginDense),
3168
+ onClick: handleClick,
3169
+ ref: ref
3170
+ }, other), startAdornment, /*#__PURE__*/React$2.createElement(FormControlContext.Provider, {
3171
+ value: null
3172
+ }, /*#__PURE__*/React$2.createElement(InputComponent, _extends({
3173
+ "aria-invalid": fcs.error,
3174
+ "aria-describedby": ariaDescribedby,
3175
+ autoComplete: autoComplete,
3176
+ autoFocus: autoFocus,
3177
+ defaultValue: defaultValue,
3178
+ disabled: fcs.disabled,
3179
+ id: id,
3180
+ onAnimationStart: handleAutoFill,
3181
+ name: name,
3182
+ placeholder: placeholder,
3183
+ readOnly: readOnly,
3184
+ required: fcs.required,
3185
+ rows: rows,
3186
+ value: value,
3187
+ onKeyDown: onKeyDown,
3188
+ onKeyUp: onKeyUp
3189
+ }, inputProps, {
3190
+ className: clsx(classes.input, inputPropsProp.className, fcs.disabled && classes.disabled, multiline && classes.inputMultiline, fcs.hiddenLabel && classes.inputHiddenLabel, startAdornment && classes.inputAdornedStart, endAdornment && classes.inputAdornedEnd, type === 'search' && classes.inputTypeSearch, fcs.margin === 'dense' && classes.inputMarginDense),
3191
+ onBlur: handleBlur,
3192
+ onChange: handleChange,
3193
+ onFocus: handleFocus
3194
+ }))), endAdornment, renderSuffix ? renderSuffix(_extends({}, fcs, {
3195
+ startAdornment: startAdornment
3196
+ })) : null);
3197
+ });
3198
+ var InputBase$1 = withStyles(styles$2, {
3199
+ name: 'MuiInputBase'
3200
+ })(InputBase);
3201
+
3202
+ var styles$1 = function styles(theme) {
3203
+ var light = theme.palette.type === 'light';
3204
+ var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
3205
+ return {
3206
+ /* Styles applied to the root element. */
3207
+ root: {
3208
+ position: 'relative'
3209
+ },
3210
+
3211
+ /* Styles applied to the root element if the component is a descendant of `FormControl`. */
3212
+ formControl: {
3213
+ 'label + &': {
3214
+ marginTop: 16
3215
+ }
3216
+ },
3217
+
3218
+ /* Styles applied to the root element if the component is focused. */
3219
+ focused: {},
3220
+
3221
+ /* Styles applied to the root element if `disabled={true}`. */
3222
+ disabled: {},
3223
+
3224
+ /* Styles applied to the root element if color secondary. */
3225
+ colorSecondary: {
3226
+ '&$underline:after': {
3227
+ borderBottomColor: theme.palette.secondary.main
3228
+ }
3229
+ },
3230
+
3231
+ /* Styles applied to the root element if `disableUnderline={false}`. */
3232
+ underline: {
3233
+ '&:after': {
3234
+ borderBottom: "2px solid ".concat(theme.palette.primary.main),
3235
+ left: 0,
3236
+ bottom: 0,
3237
+ // Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
3238
+ content: '""',
3239
+ position: 'absolute',
3240
+ right: 0,
3241
+ transform: 'scaleX(0)',
3242
+ transition: theme.transitions.create('transform', {
3243
+ duration: theme.transitions.duration.shorter,
3244
+ easing: theme.transitions.easing.easeOut
3245
+ }),
3246
+ pointerEvents: 'none' // Transparent to the hover style.
3247
+
3248
+ },
3249
+ '&$focused:after': {
3250
+ transform: 'scaleX(1)'
3251
+ },
3252
+ '&$error:after': {
3253
+ borderBottomColor: theme.palette.error.main,
3254
+ transform: 'scaleX(1)' // error is always underlined in red
3255
+
3256
+ },
3257
+ '&:before': {
3258
+ borderBottom: "1px solid ".concat(bottomLineColor),
3259
+ left: 0,
3260
+ bottom: 0,
3261
+ // Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
3262
+ content: '"\\00a0"',
3263
+ position: 'absolute',
3264
+ right: 0,
3265
+ transition: theme.transitions.create('border-bottom-color', {
3266
+ duration: theme.transitions.duration.shorter
3267
+ }),
3268
+ pointerEvents: 'none' // Transparent to the hover style.
3269
+
3270
+ },
3271
+ '&:hover:not($disabled):before': {
3272
+ borderBottom: "2px solid ".concat(theme.palette.text.primary),
3273
+ // Reset on touch devices, it doesn't add specificity
3274
+ '@media (hover: none)': {
3275
+ borderBottom: "1px solid ".concat(bottomLineColor)
3276
+ }
3277
+ },
3278
+ '&$disabled:before': {
3279
+ borderBottomStyle: 'dotted'
3280
+ }
3281
+ },
3282
+
3283
+ /* Pseudo-class applied to the root element if `error={true}`. */
3284
+ error: {},
3285
+
3286
+ /* Styles applied to the `input` element if `margin="dense"`. */
3287
+ marginDense: {},
3288
+
3289
+ /* Styles applied to the root element if `multiline={true}`. */
3290
+ multiline: {},
3291
+
3292
+ /* Styles applied to the root element if `fullWidth={true}`. */
3293
+ fullWidth: {},
3294
+
3295
+ /* Styles applied to the `input` element. */
3296
+ input: {},
3297
+
3298
+ /* Styles applied to the `input` element if `margin="dense"`. */
3299
+ inputMarginDense: {},
3300
+
3301
+ /* Styles applied to the `input` element if `multiline={true}`. */
3302
+ inputMultiline: {},
3303
+
3304
+ /* Styles applied to the `input` element if `type="search"`. */
3305
+ inputTypeSearch: {}
3306
+ };
3307
+ };
3308
+ var Input = /*#__PURE__*/React$2.forwardRef(function Input(props, ref) {
3309
+ var disableUnderline = props.disableUnderline,
3310
+ classes = props.classes,
3311
+ _props$fullWidth = props.fullWidth,
3312
+ fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
3313
+ _props$inputComponent = props.inputComponent,
3314
+ inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent,
3315
+ _props$multiline = props.multiline,
3316
+ multiline = _props$multiline === void 0 ? false : _props$multiline,
3317
+ _props$type = props.type,
3318
+ type = _props$type === void 0 ? 'text' : _props$type,
3319
+ other = _objectWithoutProperties(props, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]);
3320
+
3321
+ return /*#__PURE__*/React$2.createElement(InputBase$1, _extends({
3322
+ classes: _extends({}, classes, {
3323
+ root: clsx(classes.root, !disableUnderline && classes.underline),
3324
+ underline: null
3325
+ }),
3326
+ fullWidth: fullWidth,
3327
+ inputComponent: inputComponent,
3328
+ multiline: multiline,
3329
+ ref: ref,
3330
+ type: type
3331
+ }, other));
3332
+ });
3333
+ Input.muiName = 'Input';
3334
+ var Input$1 = withStyles(styles$1, {
3335
+ name: 'MuiInput'
3336
+ })(Input);
3337
+
3338
+ var styles = function styles(theme) {
3339
+ return {
3340
+ /* Styles applied to the select component `root` class. */
3341
+ root: {},
3342
+
3343
+ /* Styles applied to the select component `select` class. */
3344
+ select: {
3345
+ '-moz-appearance': 'none',
3346
+ // Reset
3347
+ '-webkit-appearance': 'none',
3348
+ // Reset
3349
+ // When interacting quickly, the text can end up selected.
3350
+ // Native select can't be selected either.
3351
+ userSelect: 'none',
3352
+ borderRadius: 0,
3353
+ // Reset
3354
+ minWidth: 16,
3355
+ // So it doesn't collapse.
3356
+ cursor: 'pointer',
3357
+ '&:focus': {
3358
+ // Show that it's not an text input
3359
+ backgroundColor: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)',
3360
+ borderRadius: 0 // Reset Chrome style
3361
+
3362
+ },
3363
+ // Remove IE 11 arrow
3364
+ '&::-ms-expand': {
3365
+ display: 'none'
3366
+ },
3367
+ '&$disabled': {
3368
+ cursor: 'default'
3369
+ },
3370
+ '&[multiple]': {
3371
+ height: 'auto'
3372
+ },
3373
+ '&:not([multiple]) option, &:not([multiple]) optgroup': {
3374
+ backgroundColor: theme.palette.background.paper
3375
+ },
3376
+ '&&': {
3377
+ paddingRight: 24
3378
+ }
3379
+ },
3380
+
3381
+ /* Styles applied to the select component if `variant="filled"`. */
3382
+ filled: {
3383
+ '&&': {
3384
+ paddingRight: 32
3385
+ }
3386
+ },
3387
+
3388
+ /* Styles applied to the select component if `variant="outlined"`. */
3389
+ outlined: {
3390
+ borderRadius: theme.shape.borderRadius,
3391
+ '&&': {
3392
+ paddingRight: 32
3393
+ }
3394
+ },
3395
+
3396
+ /* Styles applied to the select component `selectMenu` class. */
3397
+ selectMenu: {
3398
+ height: 'auto',
3399
+ // Resets for multpile select with chips
3400
+ minHeight: '1.1876em',
3401
+ // Required for select\text-field height consistency
3402
+ textOverflow: 'ellipsis',
3403
+ whiteSpace: 'nowrap',
3404
+ overflow: 'hidden'
3405
+ },
3406
+
3407
+ /* Pseudo-class applied to the select component `disabled` class. */
3408
+ disabled: {},
3409
+
3410
+ /* Styles applied to the icon component. */
3411
+ icon: {
3412
+ // We use a position absolute over a flexbox in order to forward the pointer events
3413
+ // to the input and to support wrapping tags..
3414
+ position: 'absolute',
3415
+ right: 0,
3416
+ top: 'calc(50% - 12px)',
3417
+ // Center vertically
3418
+ pointerEvents: 'none',
3419
+ // Don't block pointer events on the select under the icon.
3420
+ color: theme.palette.action.active,
3421
+ '&$disabled': {
3422
+ color: theme.palette.action.disabled
3423
+ }
3424
+ },
3425
+
3426
+ /* Styles applied to the icon component if the popup is open. */
3427
+ iconOpen: {
3428
+ transform: 'rotate(180deg)'
3429
+ },
3430
+
3431
+ /* Styles applied to the icon component if `variant="filled"`. */
3432
+ iconFilled: {
3433
+ right: 7
3434
+ },
3435
+
3436
+ /* Styles applied to the icon component if `variant="outlined"`. */
3437
+ iconOutlined: {
3438
+ right: 7
3439
+ },
3440
+
3441
+ /* Styles applied to the underlying native input component. */
3442
+ nativeInput: {
3443
+ bottom: 0,
3444
+ left: 0,
3445
+ position: 'absolute',
3446
+ opacity: 0,
3447
+ pointerEvents: 'none',
3448
+ width: '100%'
3449
+ }
3450
+ };
3451
+ };
3452
+ var defaultInput = /*#__PURE__*/React$2.createElement(Input$1, null);
3453
+ /**
3454
+ * An alternative to `<Select native />` with a much smaller bundle size footprint.
3455
+ */
3456
+
3457
+ var NativeSelect = /*#__PURE__*/React$2.forwardRef(function NativeSelect(props, ref) {
3458
+ var children = props.children,
3459
+ classes = props.classes,
3460
+ _props$IconComponent = props.IconComponent,
3461
+ IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon : _props$IconComponent,
3462
+ _props$input = props.input,
3463
+ input = _props$input === void 0 ? defaultInput : _props$input,
3464
+ inputProps = props.inputProps;
3465
+ props.variant;
3466
+ var other = _objectWithoutProperties(props, ["children", "classes", "IconComponent", "input", "inputProps", "variant"]);
3467
+
3468
+ var muiFormControl = useFormControl();
3469
+ var fcs = formControlState({
3470
+ props: props,
3471
+ muiFormControl: muiFormControl,
3472
+ states: ['variant']
3473
+ });
3474
+ return /*#__PURE__*/React$2.cloneElement(input, _extends({
3475
+ // Most of the logic is implemented in `NativeSelectInput`.
3476
+ // The `Select` component is a simple API wrapper to expose something better to play with.
3477
+ inputComponent: NativeSelectInput,
3478
+ inputProps: _extends({
3479
+ children: children,
3480
+ classes: classes,
3481
+ IconComponent: IconComponent,
3482
+ variant: fcs.variant,
3483
+ type: undefined
3484
+ }, inputProps, input ? input.props.inputProps : {}),
3485
+ ref: ref
3486
+ }, other));
3487
+ });
3488
+ NativeSelect.muiName = 'Select';
3489
+ var NativeSelect$1 = withStyles(styles, {
3490
+ name: 'MuiNativeSelect'
3491
+ })(NativeSelect);
3492
+
3493
+ var ArrowLeft = {};
3494
+
3495
+ var _interopRequireDefault$1 = interopRequireDefault.exports;
3496
+
3497
+ var _interopRequireWildcard$1 = interopRequireWildcard.exports;
3498
+
3499
+ Object.defineProperty(ArrowLeft, "__esModule", {
3500
+ value: true
3501
+ });
3502
+ var default_1$1 = ArrowLeft.default = void 0;
3503
+
3504
+ var React$1 = _interopRequireWildcard$1(React__default);
3505
+
3506
+ var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon());
3507
+
3508
+ var _default$1 = (0, _createSvgIcon$1.default)( /*#__PURE__*/React$1.createElement("path", {
3509
+ d: "M14 7l-5 5 5 5V7z"
3510
+ }), 'ArrowLeft');
3511
+
3512
+ default_1$1 = ArrowLeft.default = _default$1;
3513
+
3514
+ var ArrowRight = {};
3515
+
3516
+ var _interopRequireDefault = interopRequireDefault.exports;
3517
+
3518
+ var _interopRequireWildcard = interopRequireWildcard.exports;
3519
+
3520
+ Object.defineProperty(ArrowRight, "__esModule", {
3521
+ value: true
3522
+ });
3523
+ var default_1 = ArrowRight.default = void 0;
3524
+
3525
+ var React = _interopRequireWildcard(React__default);
3526
+
3527
+ var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
3528
+
3529
+ var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
3530
+ d: "M10 17l5-5-5-5v10z"
3531
+ }), 'ArrowRight');
3532
+
3533
+ default_1 = ArrowRight.default = _default;
3534
+
3535
+ var css_248z = ".ntml-pagination__center {\n display: flex;\n justify-content: center;\n}\n.ntml-pagination__center .MuiSvgIcon-colorSecondary {\n color: #509891;\n}\n.ntml-pagination .MuiPaginationItem-root {\n font-size: 1.5rem;\n}\n.ntml-pagination .MuiNativeSelect-select.MuiNativeSelect-select {\n font-size: 1.5rem;\n}\n.ntml-pagination__rightSide {\n position: relative;\n float: right;\n top: -36px;\n}\n.ntml-pagination__rightSide-showTotal {\n display: flex;\n align-items: center;\n font-size: 1.5rem;\n}\n.ntml-pagination__rightSide-showTotal .MuiInput-root {\n width: 90px;\n height: 34px;\n margin: 0 8px;\n padding: 2px 8px 3px 20px;\n border-radius: 17px;\n background-color: rgba(222, 219, 202, 0.4);\n border: 0px;\n}\n.ntml-pagination__rightSide-showTotal .MuiNativeSelect-icon {\n color: #509891;\n}\n.ntml-pagination__rightSide-showTotal .MuiNativeSelect-select:not([multiple]) option,\n.ntml-pagination__rightSide-showTotal .MuiNativeSelect-select:not([multiple]) optgroup {\n background-color: rgba(222, 219, 202, 0.4);\n}\n\n@media only screen and (max-width: 1200px) {\n .ntml-pagination__center-page {\n width: 48px;\n height: 48px;\n display: flex;\n background-color: rgba(222, 219, 202, 0.4);\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n }\n\n .ntml-pagination__rightSide {\n position: relative;\n float: initial;\n top: 0;\n display: flex;\n justify-content: center;\n margin-top: 28px;\n }\n}";
3536
+ styleInject(css_248z);
3537
+
3538
+ var _excluded = ["className", "pageSize", "total", "onChange"];
3539
+ var Pagination = function Pagination(_ref) {
3540
+ var className = _ref.className,
3541
+ pageSize = _ref.pageSize,
3542
+ total = _ref.total,
3543
+ _onChange = _ref.onChange,
3544
+ props = _objectWithoutProperties$1(_ref, _excluded);
3545
+ var count = Math.ceil(total / pageSize);
3546
+ var pages = Array.from(Array(count).keys(), function (x) {
3547
+ return x + 1;
3548
+ });
3549
+
3550
+ // eslint-disable-next-line react/destructuring-assignment
3551
+ var current = Number.parseInt(props.current, 10) || 1;
3552
+ // eslint-disable-next-line react/destructuring-assignment
3553
+ var defaultCurrent = Number.parseInt(props.defaultCurrent, 10) || 1;
3554
+ var handlePageSelected = function handlePageSelected(event) {
3555
+ var page = Number.parseInt(event.target.value, 10);
3556
+ _onChange(page);
3557
+ };
3558
+ return /*#__PURE__*/React__default.createElement("div", {
3559
+ className: classNames('ntml-pagination', className)
3560
+ }, /*#__PURE__*/React__default.createElement("div", {
3561
+ className: "ntml-pagination__center"
3562
+ }, /*#__PURE__*/React__default.createElement("div", {
3563
+ style: {
3564
+ display: 'flex',
3565
+ alignItems: 'center'
3566
+ }
3567
+ }, /*#__PURE__*/React__default.createElement(IconButton, {
3568
+ disabled: current === 1,
3569
+ onClick: function onClick() {
3570
+ return _onChange(current - 1);
3571
+ }
3572
+ }, /*#__PURE__*/React__default.createElement(default_1$1, {
3573
+ color: "secondary"
3574
+ })), /*#__PURE__*/React__default.createElement(MUIPagination, {
3575
+ color: "secondary",
3576
+ count: count,
3577
+ boundaryCount: 1,
3578
+ siblingCount: 0,
3579
+ page: current,
3580
+ defaultPage: defaultCurrent,
3581
+ hideNextButton: true,
3582
+ hidePrevButton: true,
3583
+ onChange: function onChange(event, value) {
3584
+ return _onChange(value);
3585
+ }
3586
+ }), /*#__PURE__*/React__default.createElement(IconButton, {
3587
+ disabled: current === count,
3588
+ onClick: function onClick() {
3589
+ return _onChange(current + 1);
3590
+ }
3591
+ }, /*#__PURE__*/React__default.createElement(default_1, {
3592
+ color: "secondary"
3593
+ })))), /*#__PURE__*/React__default.createElement("div", {
3594
+ className: "ntml-pagination__rightSide"
3595
+ }, /*#__PURE__*/React__default.createElement("div", {
3596
+ className: "ntml-pagination__rightSide-showTotal"
3597
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u76EE\u524D\u5728\u7B2C"), /*#__PURE__*/React__default.createElement(NativeSelect$1, {
3598
+ value: current,
3599
+ onChange: handlePageSelected
3600
+ }, pages.map(function (page, idx) {
3601
+ return /*#__PURE__*/React__default.createElement("option", {
3602
+ value: page,
3603
+ key: idx.toString()
3604
+ }, page);
3605
+ })), /*#__PURE__*/React__default.createElement("span", null, "\u9801\uFF0C\u5171"), count, /*#__PURE__*/React__default.createElement("span", null, "\u9801"))));
3606
+ };
3607
+ Pagination.defaultProps = {
3608
+ className: undefined,
3609
+ current: undefined,
3610
+ defaultCurrent: 1,
3611
+ pageSize: 10,
3612
+ total: undefined,
3613
+ onChange: undefined
3614
+ };
3615
+
3616
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
3617
+ Pagination.propTypes = {
3618
+ /** Css Name */
3619
+ className: PropTypes.string,
3620
+ /** 当前页数 */
3621
+ current: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
3622
+ /** 默认的当前页数 */
3623
+ defaultCurrent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
3624
+ /** 每页条数 */
3625
+ pageSize: PropTypes.number,
3626
+ /** 数据总数 */
3627
+ total: PropTypes.number,
3628
+ /** 页码或 pageSize 改变的回调,参数是改变后的页码及每页条数 */
3629
+ onChange: PropTypes.func
3630
+ };
3631
+
3632
+ export { Pagination as default };