@unicom-cloud/ui 0.8.52 → 0.8.53

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 (130) hide show
  1. package/Affix.js +41 -40
  2. package/Alert.js +2 -2
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +3 -3
  5. package/Avatar.js +1 -1
  6. package/BackTop.js +2 -2
  7. package/Badge.js +2 -2
  8. package/Breadcrumb.js +2 -2
  9. package/Button.js +1 -1
  10. package/Calendar.js +3 -3
  11. package/Card.js +1 -1
  12. package/Carousel.js +1 -1
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +3 -3
  17. package/Comment.js +1 -1
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +1 -1
  20. package/DatePicker.js +1268 -1233
  21. package/Descriptions.js +1 -1
  22. package/Divider.js +1 -1
  23. package/Draggable.js +1 -1
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +1 -1
  26. package/Empty.js +1 -1
  27. package/Form.js +122 -117
  28. package/Grid.js +86 -83
  29. package/Icon.js +1 -1
  30. package/IconHover.js +1 -1
  31. package/Image.js +1 -1
  32. package/Input.js +1 -1
  33. package/InputNumber.js +2 -2
  34. package/InputTag.js +1 -1
  35. package/Layout.js +2 -2
  36. package/Link.js +1 -1
  37. package/List.js +3 -3
  38. package/Mentions.js +3 -3
  39. package/Menu.js +1 -1
  40. package/Message.js +2 -2
  41. package/Modal.js +1 -1
  42. package/Notice.js +1 -1
  43. package/Notification.js +2 -2
  44. package/OverflowEllipsis.js +1 -1
  45. package/PageHeader.js +1 -1
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +1 -1
  49. package/Popover.js +1 -1
  50. package/Progress.js +1 -1
  51. package/Radio.js +2 -2
  52. package/Rate.js +1 -1
  53. package/ResizeBox.js +33 -32
  54. package/Result.js +1 -1
  55. package/Select.js +1 -1
  56. package/SelectView.js +142 -141
  57. package/Skeleton.js +1 -1
  58. package/Slider.js +2 -2
  59. package/Space.js +1 -1
  60. package/Spin.js +1 -1
  61. package/Statistic.js +1 -1
  62. package/Steps.js +1 -1
  63. package/Switch.js +15 -14
  64. package/Table.js +141 -133
  65. package/Tabs.js +1 -1
  66. package/Tag.js +111 -82
  67. package/TimePicker.js +3 -3
  68. package/Timeline.js +1 -1
  69. package/Tooltip.js +1 -1
  70. package/Transfer.js +3 -3
  71. package/Tree.js +1 -1
  72. package/TreeSelect.js +1 -1
  73. package/Trigger.js +31 -30
  74. package/Typography.js +25 -25
  75. package/Upload.js +1 -1
  76. package/VerificationCode.js +1 -1
  77. package/Version.js +1 -1
  78. package/Watermark.js +1 -1
  79. package/chunk/{CoevJNNj.js → -sV-N67P.js} +1 -1
  80. package/chunk/{CkIWpIl6.js → 8hWViek4.js} +1 -1
  81. package/chunk/{Ct7mcZuW.js → B8IzaBdN.js} +1 -1
  82. package/chunk/{DCe3olyi.js → BEVtQ2QL.js} +101 -99
  83. package/chunk/{tkU8zIK4.js → BEiJmFHq.js} +1 -1
  84. package/chunk/{CQvJK4kb.js → BOUZ7hSf.js} +12 -12
  85. package/chunk/{DMeJAY1S.js → BYMRs7t5.js} +6 -5
  86. package/chunk/{DWGwYNvC.js → CBaVCRtG.js} +2 -2
  87. package/chunk/{5PpvDpEt.js → CLU6Le34.js} +2 -2
  88. package/chunk/{dhljdm11.js → COWsswcW.js} +64 -63
  89. package/chunk/{B9nYZhXo.js → CRxPui7e.js} +2 -2
  90. package/chunk/CYyPBcnp.js +970 -0
  91. package/chunk/{DfvdYCUz.js → CccPQyYX.js} +1 -1
  92. package/chunk/{DUX5Hw8l.js → CmEyvBdT.js} +3 -3
  93. package/chunk/{Cku5-xbe.js → Cwp65v9h.js} +47 -46
  94. package/chunk/{I0bfWb5y.js → CyVLxv_U.js} +95 -93
  95. package/chunk/{Cw63stMm.js → Cz65nXZD.js} +18 -18
  96. package/chunk/D3pUE3-b.js +445 -0
  97. package/chunk/{9AJ-uN8F.js → D6BMh1k4.js} +1 -1
  98. package/chunk/{BHWpeAbb.js → DGK45cuc.js} +1 -1
  99. package/chunk/{CfqAfcA3.js → DNyP-r9G.js} +2 -2
  100. package/chunk/DQ3uFRJD.js +892 -0
  101. package/chunk/{4XXtB4ZV.js → DY9WA4bf.js} +1 -1
  102. package/chunk/{DG5zSZDd.js → DdVbiC4t.js} +2 -2
  103. package/chunk/{n58kSv9T.js → DfMf16uZ.js} +11 -5
  104. package/chunk/{z7sBNzI4.js → Lyg-9NEt.js} +17 -17
  105. package/chunk/{BXZYc88i.js → PRN8SqRA.js} +3 -3
  106. package/chunk/bcn23eHi.js +277 -0
  107. package/index.js +408 -346
  108. package/package.json +1 -23
  109. package/style.css +1 -1
  110. package/types/color-picker/colors.d.ts +1 -1
  111. package/types/date-picker/Picker.d.ts +4 -3
  112. package/types/date-picker/PickerRange.d.ts +3 -7
  113. package/types/date-picker/interface.d.ts +9 -1
  114. package/types/grid/index.d.ts +2 -1
  115. package/types/index.d.ts +1 -0
  116. package/types/pagination/interface.d.ts +1 -0
  117. package/types/picker/InputRange.d.ts +1 -1
  118. package/types/select/Select.d.ts +1 -1
  119. package/types/tag/interface.d.ts +7 -3
  120. package/types/utils/CSSTransition.d.ts +2 -1
  121. package/types/utils/is.d.ts +4 -17
  122. package/types/version/index.d.ts +1 -1
  123. package/utils/CSSTransition.js +1 -1
  124. package/utils/contextHolder.js +1 -1
  125. package/utils/is.js +102 -104
  126. package/utils/reactDOM.js +19 -19
  127. package/chunk/C61BEbHK.js +0 -263
  128. package/chunk/DXMtLuTP.js +0 -443
  129. package/chunk/m3_n9fBe.js +0 -961
  130. package/chunk/uUGMUxt_.js +0 -474
@@ -0,0 +1,892 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import U from "@unicom-cloud/utils/dom-helpers/addClass";
3
+ import o from "prop-types";
4
+ import I from "@unicom-cloud/utils/dom-helpers/removeClass";
5
+ import d, { Children as _, isValidElement as O, cloneElement as N, useRef as w, useMemo as G } from "react";
6
+ import y from "react-dom";
7
+ import { supportRef as W } from "../utils/is.js";
8
+ import { findDOMNode as X, callbackOriginRef as H } from "../utils/reactDOM.js";
9
+ const q = {
10
+ disabled: !1
11
+ }, R = d.createContext(null);
12
+ var K = Object.defineProperty, z = (i, e, t) => e in i ? K(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, B = (i, e, t) => z(i, e + "", t);
13
+ const J = process.env.NODE_ENV !== "production" ? o.oneOfType([
14
+ o.number,
15
+ o.shape({
16
+ enter: o.number,
17
+ exit: o.number,
18
+ appear: o.number
19
+ }).isRequired
20
+ ]) : null, Q = process.env.NODE_ENV !== "production" ? o.oneOfType([
21
+ o.string,
22
+ o.shape({
23
+ enter: o.string,
24
+ exit: o.string,
25
+ active: o.string
26
+ }),
27
+ o.shape({
28
+ enter: o.string,
29
+ enterDone: o.string,
30
+ enterActive: o.string,
31
+ exit: o.string,
32
+ exitDone: o.string,
33
+ exitActive: o.string
34
+ })
35
+ ]) : null, V = (i) => i.scrollTop, S = "unmounted", x = "exited", c = "entering", h = "entered", k = "exiting";
36
+ class u extends d.Component {
37
+ constructor(e, t) {
38
+ super(e, t);
39
+ let n = t, s = n && !n.isMounting ? e.enter : e.appear, r;
40
+ this.appearStatus = null, e.in ? s ? (r = x, this.appearStatus = c) : r = h : e.unmountOnExit || e.mountOnEnter ? r = S : r = x, this.state = { status: r }, this.nextCallback = null;
41
+ }
42
+ static getDerivedStateFromProps({ in: e }, t) {
43
+ return e && t.status === S ? { status: x } : null;
44
+ }
45
+ // getSnapshotBeforeUpdate(prevProps) {
46
+ // let nextStatus = null
47
+ // if (prevProps !== this.props) {
48
+ // const { status } = this.state
49
+ // if (this.props.in) {
50
+ // if (status !== ENTERING && status !== ENTERED) {
51
+ // nextStatus = ENTERING
52
+ // }
53
+ // } else {
54
+ // if (status === ENTERING || status === ENTERED) {
55
+ // nextStatus = EXITING
56
+ // }
57
+ // }
58
+ // }
59
+ // return { nextStatus }
60
+ // }
61
+ componentDidMount() {
62
+ this.updateStatus(!0, this.appearStatus);
63
+ }
64
+ componentDidUpdate(e) {
65
+ let t = null;
66
+ if (e !== this.props) {
67
+ const { status: n } = this.state;
68
+ this.props.in ? n !== c && n !== h && (t = c) : (n === c || n === h) && (t = k);
69
+ }
70
+ this.updateStatus(!1, t);
71
+ }
72
+ componentWillUnmount() {
73
+ this.cancelNextCallback();
74
+ }
75
+ getTimeouts() {
76
+ const { timeout: e } = this.props;
77
+ let t, n, s;
78
+ return t = n = s = e, e != null && typeof e != "number" && (t = e.exit, n = e.enter, s = e.appear !== void 0 ? e.appear : n), { exit: t, enter: n, appear: s };
79
+ }
80
+ updateStatus(e = !1, t) {
81
+ if (t !== null)
82
+ if (this.cancelNextCallback(), t === c) {
83
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
84
+ const n = this.props.nodeRef ? this.props.nodeRef.current : y.findDOMNode(this);
85
+ n && V(n);
86
+ }
87
+ this.performEnter(e);
88
+ } else
89
+ this.performExit();
90
+ else this.props.unmountOnExit && this.state.status === x && this.setState({ status: S });
91
+ }
92
+ performEnter(e) {
93
+ const { enter: t } = this.props, n = this.context ? this.context.isMounting : e, [s, r] = this.props.nodeRef ? [n] : [y.findDOMNode(this), n], a = this.getTimeouts(), l = n ? a.appear : a.enter;
94
+ if (!e && !t || q.disabled) {
95
+ this.safeSetState({ status: h }, () => {
96
+ this.props.onEntered(s);
97
+ });
98
+ return;
99
+ }
100
+ this.props.onEnter(s, r), this.safeSetState({ status: c }, () => {
101
+ this.props.onEntering(s, r), this.onTransitionEnd(l, () => {
102
+ this.safeSetState({ status: h }, () => {
103
+ this.props.onEntered(s, r);
104
+ });
105
+ });
106
+ });
107
+ }
108
+ performExit() {
109
+ const { exit: e } = this.props, t = this.getTimeouts(), n = this.props.nodeRef ? void 0 : y.findDOMNode(this);
110
+ if (!e || q.disabled) {
111
+ this.safeSetState({ status: x }, () => {
112
+ this.props.onExited(n);
113
+ });
114
+ return;
115
+ }
116
+ this.props.onExit(n), this.safeSetState({ status: k }, () => {
117
+ this.props.onExiting(n), this.onTransitionEnd(t.exit, () => {
118
+ this.safeSetState({ status: x }, () => {
119
+ this.props.onExited(n);
120
+ });
121
+ });
122
+ });
123
+ }
124
+ cancelNextCallback() {
125
+ this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
126
+ }
127
+ safeSetState(e, t) {
128
+ t = this.setNextCallback(t), this.setState(e, t);
129
+ }
130
+ setNextCallback(e) {
131
+ let t = !0;
132
+ return this.nextCallback = (n) => {
133
+ t && (t = !1, this.nextCallback = null, e(n));
134
+ }, this.nextCallback.cancel = () => {
135
+ t = !1;
136
+ }, this.nextCallback;
137
+ }
138
+ onTransitionEnd(e, t) {
139
+ this.setNextCallback(t);
140
+ const n = this.props.nodeRef ? this.props.nodeRef.current : y.findDOMNode(this), s = e == null && !this.props.addEndListener;
141
+ if (!n || s) {
142
+ setTimeout(this.nextCallback, 0);
143
+ return;
144
+ }
145
+ if (this.props.addEndListener) {
146
+ const [r, a] = this.props.nodeRef ? [this.nextCallback] : [n, this.nextCallback];
147
+ this.props.addEndListener(r, a);
148
+ }
149
+ e != null && setTimeout(this.nextCallback, e);
150
+ }
151
+ render() {
152
+ const e = this.state.status;
153
+ if (e === S)
154
+ return null;
155
+ const {
156
+ children: t,
157
+ // filter props for `Transition`
158
+ in: n,
159
+ mountOnEnter: s,
160
+ unmountOnExit: r,
161
+ appear: a,
162
+ enter: l,
163
+ exit: E,
164
+ timeout: C,
165
+ addEndListener: T,
166
+ onEnter: Ee,
167
+ onEntering: me,
168
+ onEntered: fe,
169
+ onExit: xe,
170
+ onExiting: ge,
171
+ onExited: be,
172
+ nodeRef: ve,
173
+ ...j
174
+ } = this.props;
175
+ return (
176
+ // allows for nested Transitions
177
+ /* @__PURE__ */ m(R.Provider, { value: null, children: typeof t == "function" ? t(e, j) : d.cloneElement(d.Children.only(t), j) })
178
+ );
179
+ }
180
+ }
181
+ B(u, "contextType", R);
182
+ u.propTypes = {
183
+ /**
184
+ * A React reference to the DOM element that needs to transition:
185
+ * https://stackoverflow.com/a/51127130/4671932
186
+ *
187
+ * - This prop is optional, but recommended in order to avoid defaulting to
188
+ * [`ReactDOM.findDOMNode`](https://reactjs.org/docs/react-dom.html#finddomnode),
189
+ * which is deprecated in `StrictMode`
190
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
191
+ * (e.g. `onEnter`) because user already has direct access to the node.
192
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
193
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
194
+ * (see
195
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
196
+ */
197
+ nodeRef: o.shape({
198
+ current: typeof Element > "u" ? o.any : (i, e, t, n, s, r) => {
199
+ const a = i[e];
200
+ return o.instanceOf(
201
+ a && "ownerDocument" in a ? a.ownerDocument.defaultView.Element : Element
202
+ )(i, e, t, n, s, r);
203
+ }
204
+ }),
205
+ /**
206
+ * A `function` child can be used instead of a React element. This function is
207
+ * called with the current transition status (`'entering'`, `'entered'`,
208
+ * `'exiting'`, `'exited'`), which can be used to apply context
209
+ * specific props to a component.
210
+ *
211
+ * ```jsx
212
+ * <Transition nodeRef={nodeRef} in={this.state.in} timeout={150}>
213
+ * {state => (
214
+ * <MyComponent ref={nodeRef} className={`fade fade-${state}`} />
215
+ * )}
216
+ * </Transition>
217
+ * ```
218
+ */
219
+ children: o.oneOfType([
220
+ o.func.isRequired,
221
+ o.element.isRequired
222
+ ]).isRequired,
223
+ /**
224
+ * Show the component; triggers the enter or exit states
225
+ */
226
+ in: o.bool,
227
+ /**
228
+ * By default the child component is mounted immediately along with
229
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
230
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
231
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
232
+ */
233
+ mountOnEnter: o.bool,
234
+ /**
235
+ * By default the child component stays mounted after it reaches the `'exited'` state.
236
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
237
+ */
238
+ unmountOnExit: o.bool,
239
+ /**
240
+ * By default the child component does not perform the enter transition when
241
+ * it first mounts, regardless of the value of `in`. If you want this
242
+ * behavior, set both `appear` and `in` to `true`.
243
+ *
244
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
245
+ * > only adds an additional enter transition. However, in the
246
+ * > `<CSSTransition>` component that first enter transition does result in
247
+ * > additional `.appear-*` classes, that way you can choose to style it
248
+ * > differently.
249
+ */
250
+ appear: o.bool,
251
+ /**
252
+ * Enable or disable enter transitions.
253
+ */
254
+ enter: o.bool,
255
+ /**
256
+ * Enable or disable exit transitions.
257
+ */
258
+ exit: o.bool,
259
+ /**
260
+ * The duration of the transition, in milliseconds.
261
+ * Required unless `addEndListener` is provided.
262
+ *
263
+ * You may specify a single timeout for all transitions:
264
+ *
265
+ * ```jsx
266
+ * timeout={500}
267
+ * ```
268
+ *
269
+ * or individually:
270
+ *
271
+ * ```jsx
272
+ * timeout={{
273
+ * appear: 500,
274
+ * enter: 300,
275
+ * exit: 500,
276
+ * }}
277
+ * ```
278
+ *
279
+ * - `appear` defaults to the value of `enter`
280
+ * - `enter` defaults to `0`
281
+ * - `exit` defaults to `0`
282
+ *
283
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
284
+ */
285
+ timeout: (i, ...e) => {
286
+ let t = J;
287
+ return i.addEndListener || (t = t.isRequired), t(i, ...e);
288
+ },
289
+ /**
290
+ * Add a custom transition end trigger. Called with the transitioning
291
+ * DOM node and a `done` callback. Allows for more fine grained transition end
292
+ * logic. Timeouts are still used as a fallback if provided.
293
+ *
294
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `done` is being passed as the first argument.
295
+ *
296
+ * ```jsx
297
+ * addEndListener={(node, done) => {
298
+ * // use the css transitionend event to mark the finish of a transition
299
+ * node.addEventListener('transitionend', done, false);
300
+ * }}
301
+ * ```
302
+ */
303
+ addEndListener: o.func,
304
+ /**
305
+ * Callback fired before the "entering" status is applied. An extra parameter
306
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
307
+ *
308
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `isAppearing` is being passed as the first argument.
309
+ *
310
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
311
+ */
312
+ onEnter: o.func,
313
+ /**
314
+ * Callback fired after the "entering" status is applied. An extra parameter
315
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
316
+ *
317
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `isAppearing` is being passed as the first argument.
318
+ *
319
+ * @type Function(node: HtmlElement, isAppearing: bool)
320
+ */
321
+ onEntering: o.func,
322
+ /**
323
+ * Callback fired after the "entered" status is applied. An extra parameter
324
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
325
+ *
326
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `isAppearing` is being passed as the first argument.
327
+ *
328
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
329
+ */
330
+ onEntered: o.func,
331
+ /**
332
+ * Callback fired before the "exiting" status is applied.
333
+ *
334
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
335
+ *
336
+ * @type Function(node: HtmlElement) -> void
337
+ */
338
+ onExit: o.func,
339
+ /**
340
+ * Callback fired after the "exiting" status is applied.
341
+ *
342
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
343
+ *
344
+ * @type Function(node: HtmlElement) -> void
345
+ */
346
+ onExiting: o.func,
347
+ /**
348
+ * Callback fired after the "exited" status is applied.
349
+ *
350
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
351
+ *
352
+ * @type Function(node: HtmlElement) -> void
353
+ */
354
+ onExited: o.func
355
+ };
356
+ function b() {
357
+ }
358
+ u.defaultProps = {
359
+ in: !1,
360
+ mountOnEnter: !1,
361
+ unmountOnExit: !1,
362
+ appear: !1,
363
+ enter: !0,
364
+ exit: !0,
365
+ onEnter: b,
366
+ onEntering: b,
367
+ onEntered: b,
368
+ onExit: b,
369
+ onExiting: b,
370
+ onExited: b
371
+ };
372
+ u.UNMOUNTED = S;
373
+ u.EXITED = x;
374
+ u.ENTERING = c;
375
+ u.ENTERED = h;
376
+ u.EXITING = k;
377
+ var Y = Object.defineProperty, Z = (i, e, t) => e in i ? Y(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, p = (i, e, t) => Z(i, typeof e != "symbol" ? e + "" : e, t);
378
+ const ee = (i, e) => i && e && e.split(" ").forEach((t) => U(i, t)), D = (i, e) => i && e && e.split(" ").forEach((t) => I(i, t));
379
+ let P = class extends d.Component {
380
+ constructor() {
381
+ super(...arguments), p(this, "appliedClasses", {
382
+ appear: {},
383
+ enter: {},
384
+ exit: {}
385
+ }), p(this, "onEnter", (e, t) => {
386
+ const [n, s] = this.resolveArguments(e, t);
387
+ this.removeClasses(n, "exit"), this.addClass(n, s ? "appear" : "enter", "base"), this.props.onEnter && this.props.onEnter(e, t);
388
+ }), p(this, "onEntering", (e, t) => {
389
+ const [n, s] = this.resolveArguments(e, t), r = s ? "appear" : "enter";
390
+ this.addClass(n, r, "active"), this.props.onEntering && this.props.onEntering(e, t);
391
+ }), p(this, "onEntered", (e, t) => {
392
+ const [n, s] = this.resolveArguments(e, t), r = s ? "appear" : "enter";
393
+ this.removeClasses(n, r), this.addClass(n, r, "done"), this.props.onEntered && this.props.onEntered(e, t);
394
+ }), p(this, "onExit", (e) => {
395
+ const [t] = this.resolveArguments(e);
396
+ this.removeClasses(t, "appear"), this.removeClasses(t, "enter"), this.addClass(t, "exit", "base"), this.props.onExit && this.props.onExit(e);
397
+ }), p(this, "onExiting", (e) => {
398
+ const [t] = this.resolveArguments(e);
399
+ this.addClass(t, "exit", "active"), this.props.onExiting && this.props.onExiting(e);
400
+ }), p(this, "onExited", (e) => {
401
+ const [t] = this.resolveArguments(e);
402
+ this.removeClasses(t, "exit"), this.addClass(t, "exit", "done"), this.props.onExited && this.props.onExited(e);
403
+ }), p(this, "resolveArguments", (e, t) => this.props.nodeRef ? [this.props.nodeRef.current, e] : [e, t]), p(this, "getClassNames", (e) => {
404
+ const { classNames: t } = this.props, n = typeof t == "string", s = n && t ? `${t}-` : "";
405
+ let r = n ? `${s}${e}` : t[e], a = n ? `${r}-active` : t[`${e}Active`], l = n ? `${r}-done` : t[`${e}Done`];
406
+ return {
407
+ baseClassName: r,
408
+ activeClassName: a,
409
+ doneClassName: l
410
+ };
411
+ });
412
+ }
413
+ addClass(e, t, n) {
414
+ let s = this.getClassNames(t)[`${n}ClassName`];
415
+ const { doneClassName: r } = this.getClassNames("enter");
416
+ t === "appear" && n === "done" && r && (s += ` ${r}`), n === "active" && e && V(e), s && (this.appliedClasses[t][n] = s, ee(e, s));
417
+ }
418
+ removeClasses(e, t) {
419
+ const {
420
+ base: n,
421
+ active: s,
422
+ done: r
423
+ } = this.appliedClasses[t];
424
+ this.appliedClasses[t] = {}, n && D(e, n), s && D(e, s), r && D(e, r);
425
+ }
426
+ render() {
427
+ const { classNames: e, ...t } = this.props;
428
+ return /* @__PURE__ */ m(
429
+ u,
430
+ {
431
+ ...t,
432
+ onEnter: this.onEnter,
433
+ onEntered: this.onEntered,
434
+ onEntering: this.onEntering,
435
+ onExit: this.onExit,
436
+ onExiting: this.onExiting,
437
+ onExited: this.onExited
438
+ }
439
+ );
440
+ }
441
+ };
442
+ p(P, "defaultProps", {
443
+ classNames: ""
444
+ });
445
+ P.propTypes = {
446
+ ...u.propTypes,
447
+ /**
448
+ * The animation classNames applied to the component as it appears, enters,
449
+ * exits or has finished the transition. A single name can be provided, which
450
+ * will be suffixed for each stage, e.g. `classNames="fade"` applies:
451
+ *
452
+ * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
453
+ * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
454
+ * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
455
+ *
456
+ * A few details to note about how these classes are applied:
457
+ *
458
+ * 1. They are _joined_ with the ones that are already defined on the child
459
+ * component, so if you want to add some base styles, you can use
460
+ * `className` without worrying that it will be overridden.
461
+ *
462
+ * 2. If the transition component mounts with `in={false}`, no classes are
463
+ * applied yet. You might be expecting `*-exit-done`, but if you think
464
+ * about it, a component cannot finish exiting if it hasn't entered yet.
465
+ *
466
+ * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
467
+ * allows you to define different behavior for when appearing is done and
468
+ * when regular entering is done, using selectors like
469
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
470
+ * an epic entrance animation when element first appears in the DOM using
471
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
472
+ * simply use `fade-enter-done` for defining both cases.
473
+ *
474
+ * Each individual classNames can also be specified independently like:
475
+ *
476
+ * ```js
477
+ * classNames={{
478
+ * appear: 'my-appear',
479
+ * appearActive: 'my-active-appear',
480
+ * appearDone: 'my-done-appear',
481
+ * enter: 'my-enter',
482
+ * enterActive: 'my-active-enter',
483
+ * enterDone: 'my-done-enter',
484
+ * exit: 'my-exit',
485
+ * exitActive: 'my-active-exit',
486
+ * exitDone: 'my-done-exit',
487
+ * }}
488
+ * ```
489
+ *
490
+ * If you want to set these classes using CSS Modules:
491
+ *
492
+ * ```js
493
+ * import styles from './styles.css';
494
+ * ```
495
+ *
496
+ * you might want to use camelCase in your CSS file, that way could simply
497
+ * spread them instead of listing them one by one:
498
+ *
499
+ * ```js
500
+ * classNames={{ ...styles }}
501
+ * ```
502
+ *
503
+ * @type {string | {
504
+ * appear?: string,
505
+ * appearActive?: string,
506
+ * appearDone?: string,
507
+ * enter?: string,
508
+ * enterActive?: string,
509
+ * enterDone?: string,
510
+ * exit?: string,
511
+ * exitActive?: string,
512
+ * exitDone?: string,
513
+ * }}
514
+ */
515
+ classNames: Q,
516
+ /**
517
+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
518
+ * applied.
519
+ *
520
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `isAppearing` is being passed as the first argument.
521
+ *
522
+ * @type Function(node: HtmlElement, isAppearing: bool)
523
+ */
524
+ onEnter: o.func,
525
+ /**
526
+ * A `<Transition>` callback fired immediately after the 'enter-active' or
527
+ * 'appear-active' class is applied.
528
+ *
529
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `isAppearing` is being passed as the first argument.
530
+ *
531
+ * @type Function(node: HtmlElement, isAppearing: bool)
532
+ */
533
+ onEntering: o.func,
534
+ /**
535
+ * A `<Transition>` callback fired immediately after the 'enter' or
536
+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
537
+ *
538
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed, so `isAppearing` is being passed as the first argument.
539
+ *
540
+ * @type Function(node: HtmlElement, isAppearing: bool)
541
+ */
542
+ onEntered: o.func,
543
+ /**
544
+ * A `<Transition>` callback fired immediately after the 'exit' class is
545
+ * applied.
546
+ *
547
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
548
+ *
549
+ * @type Function(node: HtmlElement)
550
+ */
551
+ onExit: o.func,
552
+ /**
553
+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
554
+ *
555
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
556
+ *
557
+ * @type Function(node: HtmlElement)
558
+ */
559
+ onExiting: o.func,
560
+ /**
561
+ * A `<Transition>` callback fired immediately after the 'exit' classes
562
+ * are **removed** and the `exit-done` class is added to the DOM node.
563
+ *
564
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
565
+ *
566
+ * @type Function(node: HtmlElement)
567
+ */
568
+ onExited: o.func
569
+ };
570
+ function L(i, e) {
571
+ let t = (s) => e && O(s) ? e(s) : s, n = /* @__PURE__ */ Object.create(null);
572
+ return i && _.map(i, (s) => s).forEach((s) => {
573
+ n[s.key] = t(s);
574
+ }), n;
575
+ }
576
+ function te(i, e) {
577
+ i = i || {}, e = e || {};
578
+ function t(l) {
579
+ return l in e ? e[l] : i[l];
580
+ }
581
+ let n = /* @__PURE__ */ Object.create(null), s = [];
582
+ for (let l in i)
583
+ l in e ? s.length && (n[l] = s, s = []) : s.push(l);
584
+ let r, a = {};
585
+ for (let l in e) {
586
+ if (n[l])
587
+ for (r = 0; r < n[l].length; r++) {
588
+ let E = n[l][r];
589
+ a[n[l][r]] = t(E);
590
+ }
591
+ a[l] = t(l);
592
+ }
593
+ for (r = 0; r < s.length; r++)
594
+ a[s[r]] = t(s[r]);
595
+ return a;
596
+ }
597
+ function g(i, e, t) {
598
+ return t[e] != null ? t[e] : i.props[e];
599
+ }
600
+ function ne(i, e) {
601
+ return L(i.children, (t) => N(t, {
602
+ onExited: e.bind(null, t),
603
+ in: !0,
604
+ appear: g(t, "appear", i),
605
+ enter: g(t, "enter", i),
606
+ exit: g(t, "exit", i)
607
+ }));
608
+ }
609
+ function ie(i, e, t) {
610
+ let n = L(i.children), s = te(e, n);
611
+ return Object.keys(s).forEach((r) => {
612
+ let a = s[r];
613
+ if (!O(a)) return;
614
+ const l = r in e, E = r in n, C = e[r], T = O(C) && !C.props.in;
615
+ E && (!l || T) ? s[r] = N(a, {
616
+ onExited: t.bind(null, a),
617
+ in: !0,
618
+ exit: g(a, "exit", i),
619
+ enter: g(a, "enter", i)
620
+ }) : !E && l && !T ? s[r] = N(a, { in: !1 }) : E && l && O(C) && (s[r] = N(a, {
621
+ onExited: t.bind(null, a),
622
+ in: C.props.in,
623
+ exit: g(a, "exit", i),
624
+ enter: g(a, "enter", i)
625
+ }));
626
+ }), s;
627
+ }
628
+ const se = Object.values || ((i) => Object.keys(i).map((e) => i[e])), re = {
629
+ component: "div",
630
+ childFactory: (i) => i
631
+ };
632
+ class A extends d.Component {
633
+ constructor(e, t) {
634
+ super(e, t);
635
+ const n = this.handleExited.bind(this);
636
+ this.state = {
637
+ contextValue: { isMounting: !0 },
638
+ handleExited: n,
639
+ firstRender: !0
640
+ };
641
+ }
642
+ componentDidMount() {
643
+ this.mounted = !0, this.setState({
644
+ contextValue: { isMounting: !1 }
645
+ });
646
+ }
647
+ componentWillUnmount() {
648
+ this.mounted = !1;
649
+ }
650
+ static getDerivedStateFromProps(e, { children: t, handleExited: n, firstRender: s }) {
651
+ return {
652
+ children: s ? ne(e, n) : ie(e, t, n),
653
+ firstRender: !1
654
+ };
655
+ }
656
+ // node is `undefined` when user provided `nodeRef` prop
657
+ handleExited(e, t) {
658
+ let n = L(this.props.children);
659
+ e.key in n || (e.props.onExited && e.props.onExited(t), this.mounted && this.setState((s) => {
660
+ let r = { ...s.children };
661
+ return delete r[e.key], { children: r };
662
+ }));
663
+ }
664
+ render() {
665
+ const { component: e, childFactory: t, ...n } = this.props, { contextValue: s } = this.state, r = se(this.state.children).map(t);
666
+ return delete n.appear, delete n.enter, delete n.exit, e === null ? /* @__PURE__ */ m(R.Provider, { value: s, children: r }) : /* @__PURE__ */ m(R.Provider, { value: s, children: /* @__PURE__ */ m(e, { ...n, children: r }) });
667
+ }
668
+ }
669
+ A.propTypes = {
670
+ /**
671
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
672
+ * behavior by providing a `component` prop.
673
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
674
+ * you can pass in `component={null}`. This is useful if the wrapping div
675
+ * borks your css styles.
676
+ */
677
+ component: o.any,
678
+ /**
679
+ * A set of `<Transition>` components, that are toggled `in` and out as they
680
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
681
+ * remember to spread them through if you are wrapping the `<Transition>` as
682
+ * with our `<Fade>` example.
683
+ *
684
+ * While this component is meant for multiple `Transition` or `CSSTransition`
685
+ * children, sometimes you may want to have a single transition child with
686
+ * content that you want to be transitioned out and in when you change it
687
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
688
+ * the transition child as you change its content, this will cause
689
+ * `TransitionGroup` to transition the child out and back in.
690
+ */
691
+ children: o.node,
692
+ /**
693
+ * A convenience prop that enables or disables appear animations
694
+ * for all children. Note that specifying this will override any defaults set
695
+ * on individual children Transitions.
696
+ */
697
+ appear: o.bool,
698
+ /**
699
+ * A convenience prop that enables or disables enter animations
700
+ * for all children. Note that specifying this will override any defaults set
701
+ * on individual children Transitions.
702
+ */
703
+ enter: o.bool,
704
+ /**
705
+ * A convenience prop that enables or disables exit animations
706
+ * for all children. Note that specifying this will override any defaults set
707
+ * on individual children Transitions.
708
+ */
709
+ exit: o.bool,
710
+ /**
711
+ * You may need to apply reactive updates to a child as it is exiting.
712
+ * This is generally done by using `cloneElement` however in the case of an exiting
713
+ * child the element has already been removed and not accessible to the consumer.
714
+ *
715
+ * If you do need to update a child as it leaves you can provide a `childFactory`
716
+ * to wrap every child, even the ones that are leaving.
717
+ *
718
+ * @type Function(child: ReactElement) -> ReactElement
719
+ */
720
+ childFactory: o.func
721
+ };
722
+ A.defaultProps = re;
723
+ var oe = Object.defineProperty, ae = (i, e, t) => e in i ? oe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, v = (i, e, t) => ae(i, typeof e != "symbol" ? e + "" : e, t);
724
+ class le extends d.Component {
725
+ constructor() {
726
+ super(...arguments), v(this, "handleEnter", (...e) => this.handleLifecycle("onEnter", 0, e)), v(this, "handleEntering", (...e) => this.handleLifecycle("onEntering", 0, e)), v(this, "handleEntered", (...e) => this.handleLifecycle("onEntered", 0, e)), v(this, "handleExit", (...e) => this.handleLifecycle("onExit", 1, e)), v(this, "handleExiting", (...e) => this.handleLifecycle("onExiting", 1, e)), v(this, "handleExited", (...e) => this.handleLifecycle("onExited", 1, e));
727
+ }
728
+ handleLifecycle(e, t, n) {
729
+ const { children: s } = this.props, r = d.Children.toArray(s)[t];
730
+ if (r.props[e] && r.props[e](...n), this.props[e]) {
731
+ const a = r.props.nodeRef ? void 0 : y.findDOMNode(this);
732
+ this.props[e](a);
733
+ }
734
+ }
735
+ render() {
736
+ const { children: e, in: t, ...n } = this.props, [s, r] = d.Children.toArray(e);
737
+ return delete n.onEnter, delete n.onEntering, delete n.onEntered, delete n.onExit, delete n.onExiting, delete n.onExited, /* @__PURE__ */ m(A, { ...n, children: t ? d.cloneElement(s, {
738
+ key: "first",
739
+ onEnter: this.handleEnter,
740
+ onEntering: this.handleEntering,
741
+ onEntered: this.handleEntered
742
+ }) : d.cloneElement(r, {
743
+ key: "second",
744
+ onEnter: this.handleExit,
745
+ onEntering: this.handleExiting,
746
+ onEntered: this.handleExited
747
+ }) });
748
+ }
749
+ }
750
+ le.propTypes = {
751
+ in: o.bool.isRequired,
752
+ children(i, e) {
753
+ return d.Children.count(i[e]) !== 2 ? new Error(
754
+ `"${e}" must be exactly two transition components.`
755
+ ) : null;
756
+ }
757
+ };
758
+ var de = Object.defineProperty, ce = (i, e, t) => e in i ? de(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, M = (i, e, t) => ce(i, typeof e != "symbol" ? e + "" : e, t);
759
+ function pe(i, e) {
760
+ return !(i === e || d.isValidElement(i) && d.isValidElement(e) && i.key != null && i.key === e.key);
761
+ }
762
+ const f = {
763
+ out: "out-in",
764
+ in: "in-out"
765
+ }, $ = (i, e, t) => (...n) => {
766
+ var s, r;
767
+ (r = (s = i.props)[e]) == null || r.call(s, ...n), t();
768
+ }, he = {
769
+ [f.out]: ({ current: i, changeState: e }) => d.cloneElement(i, {
770
+ in: !1,
771
+ onExited: $(i, "onExited", () => {
772
+ e(c, null);
773
+ })
774
+ }),
775
+ [f.in]: ({ current: i, changeState: e, children: t }) => [
776
+ i,
777
+ d.cloneElement(t, {
778
+ in: !0,
779
+ onEntered: $(t, "onEntered", () => {
780
+ e(c);
781
+ })
782
+ })
783
+ ]
784
+ }, ue = {
785
+ [f.out]: ({ children: i, changeState: e }) => d.cloneElement(i, {
786
+ in: !0,
787
+ onEntered: $(i, "onEntered", () => {
788
+ e(h, d.cloneElement(i, { in: !0 }));
789
+ })
790
+ }),
791
+ [f.in]: ({ current: i, children: e, changeState: t }) => [
792
+ d.cloneElement(i, {
793
+ in: !1,
794
+ onExited: $(i, "onExited", () => {
795
+ t(h, d.cloneElement(e, { in: !0 }));
796
+ })
797
+ }),
798
+ d.cloneElement(e, {
799
+ in: !0
800
+ })
801
+ ]
802
+ };
803
+ class F extends d.Component {
804
+ constructor() {
805
+ super(...arguments), M(this, "state", {
806
+ status: h,
807
+ current: null
808
+ }), M(this, "appeared", !1), M(this, "changeState", (e, t = this.state.current) => {
809
+ this.setState({
810
+ status: e,
811
+ current: t
812
+ });
813
+ });
814
+ }
815
+ componentDidMount() {
816
+ this.appeared = !0;
817
+ }
818
+ static getDerivedStateFromProps(e, t) {
819
+ return e.children == null ? {
820
+ current: null
821
+ } : t.status === c && e.mode === f.in ? {
822
+ status: c
823
+ } : t.current && pe(t.current, e.children) ? {
824
+ status: k
825
+ } : {
826
+ current: d.cloneElement(e.children, {
827
+ in: !0
828
+ })
829
+ };
830
+ }
831
+ render() {
832
+ const {
833
+ props: { children: e, mode: t },
834
+ state: { status: n, current: s }
835
+ } = this, r = { children: e, current: s, changeState: this.changeState, status: n };
836
+ let a;
837
+ switch (n) {
838
+ case c:
839
+ a = ue[t](r);
840
+ break;
841
+ case k:
842
+ a = he[t](r);
843
+ break;
844
+ case h:
845
+ a = s;
846
+ }
847
+ return /* @__PURE__ */ m(R.Provider, { value: { isMounting: !this.appeared }, children: a });
848
+ }
849
+ }
850
+ F.propTypes = {
851
+ /**
852
+ * Transition modes.
853
+ * `out-in`: Current element transitions out first, then when complete, the new element transitions in.
854
+ * `in-out`: New element transitions in first, then when complete, the current element transitions out.
855
+ *
856
+ * @type {'out-in'|'in-out'}
857
+ */
858
+ mode: o.oneOf([f.in, f.out]),
859
+ /**
860
+ * Any `Transition` or `CSSTransition` component.
861
+ */
862
+ children: o.oneOfType([o.element.isRequired])
863
+ };
864
+ F.defaultProps = {
865
+ mode: f.out
866
+ };
867
+ function De(i) {
868
+ const { children: e, ...t } = i, n = w(), s = w(), r = G(() => i.nodeRef === void 0 && W(e) && O(e) ? (s.current = !0, N(e, {
869
+ ref: (a) => {
870
+ n.current = X(a), H(e, a);
871
+ }
872
+ })) : (s.current = !1, e), [e, i.nodeRef]);
873
+ return s.current && [
874
+ "onEnter",
875
+ "onEntering",
876
+ "onEntered",
877
+ "onExit",
878
+ "onExiting",
879
+ "onExited"
880
+ ].forEach((a) => {
881
+ i[a] && (t[a] = (l, ...E) => {
882
+ i[a](n.current, ...E);
883
+ });
884
+ }), /* @__PURE__ */ m(P, { ...t, nodeRef: s.current ? n : void 0, children: r });
885
+ }
886
+ export {
887
+ De as P,
888
+ A as b,
889
+ P as c,
890
+ F as h,
891
+ u
892
+ };