@splunk/react-ui 4.38.0 → 4.40.0
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.
- package/Accordion.js +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +49 -0
- package/Calendar.js +353 -414
- package/Card.js +186 -244
- package/CardLayout.js +86 -83
- package/Chip.js +136 -146
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +178 -210
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +123 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +197 -207
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +3137 -3433
- package/Number.js +164 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +450 -442
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +2085 -2345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.d.ts +2 -0
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +235 -268
- package/TabLayout.js +122 -141
- package/Table.js +2103 -2261
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +61 -69
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +15 -15
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/Card/Card.d.ts +1 -0
- package/types/src/Card/Footer.d.ts +1 -0
- package/types/src/Chip/Chip.d.ts +3 -6
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/ComboBox.d.ts +1 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +1 -1
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/Multiselect/Normal.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +4 -2
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/Select/SelectBase.d.ts +104 -66
- package/types/src/Select/docs/examples/Appearance.d.ts +0 -2
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/Cell.d.ts +0 -2
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/HeadInner.d.ts +5 -1
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/types/src/WaitSpinner/WaitSpinner.d.ts +0 -1
- package/types/src/useControlled/index.d.ts +2 -0
- package/types/src/useControlled/useControlled.d.ts +21 -0
- package/types/src/useResizeObserver/index.d.ts +2 -0
- package/types/src/useResizeObserver/useResizeObserver.d.ts +12 -0
- package/useControlled.js +112 -0
- package/useForceUpdate.js +30 -32
- package/useKeyPress.d.ts +2 -0
- package/useKeyPress.js +1 -1
- package/useResizeObserver.d.ts +2 -0
- package/useResizeObserver.js +137 -0
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/Chip/docs/examples/Basic.d.ts +0 -2
- package/types/src/Chip/docs/examples/prisma/Appearance.d.ts +0 -2
- package/types/src/Color/docs/examples/prisma/Controlled.d.ts +0 -2
- package/types/src/Color/docs/examples/prisma/ThemeVariables.d.ts +0 -1
- package/types/src/Color/docs/examples/prisma/Uncontrolled.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/Basic.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/BasicMenu.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/ControlledDropdown.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/Dialog.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/OtherToggles.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/ScrollingMenu.d.ts +0 -2
- package/types/src/File/docs/examples/prisma/Disabled.d.ts +0 -12
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/Message/docs/examples/prisma/Title.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- package/types/src/WaitSpinner/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Color/docs/examples/{prisma/CustomizedPalette.d.ts → CustomizedPalette.d.ts} +0 -0
- /package/types/src/Color/docs/examples/{prisma/HideInput.d.ts → HideInput.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/TransitionOpen.js
CHANGED
|
@@ -61,213 +61,191 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
default: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ A
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
67
|
const n = require("react");
|
|
68
68
|
var r = e.n(n);
|
|
69
69
|
// CONCATENATED MODULE: external "prop-types"
|
|
70
70
|
const o = require("prop-types");
|
|
71
|
-
var
|
|
71
|
+
var i = e.n(o);
|
|
72
72
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
73
|
-
const
|
|
74
|
-
var s = e.n(
|
|
73
|
+
const a = require("lodash/keys");
|
|
74
|
+
var s = e.n(a);
|
|
75
75
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
76
76
|
const l = require("lodash/omit");
|
|
77
77
|
var u = e.n(l);
|
|
78
78
|
// CONCATENATED MODULE: external "@splunk/react-ui/Animation"
|
|
79
79
|
const c = require("@splunk/react-ui/Animation");
|
|
80
80
|
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
81
|
-
const
|
|
81
|
+
const p = require("@splunk/ui-utils/focus");
|
|
82
82
|
// CONCATENATED MODULE: external "@splunk/ui-utils/style"
|
|
83
|
-
const
|
|
83
|
+
const f = require("@splunk/ui-utils/style");
|
|
84
84
|
// CONCATENATED MODULE: external "react-spring"
|
|
85
85
|
const d = require("react-spring");
|
|
86
86
|
// CONCATENATED MODULE: external "styled-components"
|
|
87
87
|
const m = require("styled-components");
|
|
88
88
|
var y = e.n(m);
|
|
89
89
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
90
|
-
const
|
|
90
|
+
const v = require("@splunk/themes");
|
|
91
91
|
// CONCATENATED MODULE: ./src/TransitionOpen/TransitionOpenStyles.ts
|
|
92
|
-
var
|
|
92
|
+
var b = y()(d.animated.div).withConfig({
|
|
93
93
|
displayName: "TransitionOpenStyles__Styled",
|
|
94
94
|
componentId: "sc-1x58s0g-0"
|
|
95
|
-
})([ "", ";", ";" ],
|
|
95
|
+
})([ "", ";", ";" ], v.mixins.reset("block"), (function(e) {
|
|
96
96
|
var t = e.$hideOverflow;
|
|
97
97
|
return t && (0, m.css)([ "overflow:hidden;" ]);
|
|
98
98
|
}));
|
|
99
|
-
var
|
|
99
|
+
var h = y()(d.animated.div).withConfig({
|
|
100
100
|
displayName: "TransitionOpenStyles__StyledInner",
|
|
101
101
|
componentId: "sc-1x58s0g-1"
|
|
102
|
-
})([ "", ";", ";width:100%;" ],
|
|
102
|
+
})([ "", ";", ";width:100%;" ], v.mixins.reset("table"), v.mixins.clearfix());
|
|
103
103
|
// CONCATENATED MODULE: ./src/TransitionOpen/TransitionOpen.tsx
|
|
104
104
|
function g(e) {
|
|
105
105
|
"@babel/helpers - typeof";
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
g = function e(t) {
|
|
112
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return g(e);
|
|
106
|
+
return g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
107
|
+
return typeof e;
|
|
108
|
+
} : function(e) {
|
|
109
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
110
|
+
}, g(e);
|
|
116
111
|
}
|
|
117
112
|
function O() {
|
|
118
|
-
O = Object.assign
|
|
113
|
+
return O = Object.assign ? Object.assign.bind() : function(e) {
|
|
119
114
|
for (var t = 1; t < arguments.length; t++) {
|
|
120
115
|
var n = arguments[t];
|
|
121
116
|
for (var r in n) {
|
|
122
|
-
|
|
123
|
-
e[r] = n[r];
|
|
124
|
-
}
|
|
117
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
125
118
|
}
|
|
126
119
|
}
|
|
127
120
|
return e;
|
|
128
|
-
};
|
|
129
|
-
return O.apply(this, arguments);
|
|
121
|
+
}, O.apply(null, arguments);
|
|
130
122
|
}
|
|
131
123
|
function w(e, t) {
|
|
132
124
|
var n = Object.keys(e);
|
|
133
125
|
if (Object.getOwnPropertySymbols) {
|
|
134
126
|
var r = Object.getOwnPropertySymbols(e);
|
|
135
|
-
|
|
127
|
+
t && (r = r.filter((function(t) {
|
|
136
128
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
137
|
-
}));
|
|
138
|
-
n.push.apply(n, r);
|
|
129
|
+
}))), n.push.apply(n, r);
|
|
139
130
|
}
|
|
140
131
|
return n;
|
|
141
132
|
}
|
|
142
|
-
function
|
|
133
|
+
function j(e) {
|
|
143
134
|
for (var t = 1; t < arguments.length; t++) {
|
|
144
|
-
var n = arguments[t]
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
|
|
151
|
-
} else {
|
|
152
|
-
w(Object(n)).forEach((function(t) {
|
|
153
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
135
|
+
var n = null != arguments[t] ? arguments[t] : {};
|
|
136
|
+
t % 2 ? w(Object(n), !0).forEach((function(t) {
|
|
137
|
+
R(e, t, n[t]);
|
|
138
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : w(Object(n)).forEach((function(t) {
|
|
139
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
140
|
+
}));
|
|
156
141
|
}
|
|
157
142
|
return e;
|
|
158
143
|
}
|
|
159
|
-
function
|
|
160
|
-
if (!(e instanceof t))
|
|
161
|
-
throw new TypeError("Cannot call a class as a function");
|
|
162
|
-
}
|
|
144
|
+
function S(e, t) {
|
|
145
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
163
146
|
}
|
|
164
|
-
function
|
|
147
|
+
function P(e, t) {
|
|
165
148
|
for (var n = 0; n < t.length; n++) {
|
|
166
149
|
var r = t[n];
|
|
167
|
-
r.enumerable = r.enumerable ||
|
|
168
|
-
r.
|
|
169
|
-
if ("value" in r) r.writable = true;
|
|
170
|
-
Object.defineProperty(e, r.key, r);
|
|
150
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
151
|
+
Object.defineProperty(e, q(r.key), r);
|
|
171
152
|
}
|
|
172
153
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
154
|
+
function F(e, t, n) {
|
|
155
|
+
return t && P(e.prototype, t), n && P(e, n), Object.defineProperty(e, "prototype", {
|
|
156
|
+
writable: !1
|
|
157
|
+
}), e;
|
|
177
158
|
}
|
|
178
|
-
function
|
|
179
|
-
if (typeof t !== "
|
|
180
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
181
|
-
}
|
|
159
|
+
function T(e, t) {
|
|
160
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
182
161
|
e.prototype = Object.create(t && t.prototype, {
|
|
183
162
|
constructor: {
|
|
184
163
|
value: e,
|
|
185
|
-
writable:
|
|
186
|
-
configurable:
|
|
164
|
+
writable: !0,
|
|
165
|
+
configurable: !0
|
|
187
166
|
}
|
|
188
|
-
})
|
|
189
|
-
|
|
167
|
+
}), Object.defineProperty(e, "prototype", {
|
|
168
|
+
writable: !1
|
|
169
|
+
}), t && x(e, t);
|
|
190
170
|
}
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
};
|
|
196
|
-
return T(e, t);
|
|
171
|
+
function x(e, t) {
|
|
172
|
+
return x = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
173
|
+
return e.__proto__ = t, e;
|
|
174
|
+
}, x(e, t);
|
|
197
175
|
}
|
|
198
176
|
function k(e) {
|
|
199
177
|
var t = _();
|
|
200
|
-
return function
|
|
201
|
-
var r = N(e)
|
|
178
|
+
return function() {
|
|
179
|
+
var n, r = N(e);
|
|
202
180
|
if (t) {
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
} else
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
return E(this, o);
|
|
181
|
+
var o = N(this).constructor;
|
|
182
|
+
n = Reflect.construct(r, arguments, o);
|
|
183
|
+
} else n = r.apply(this, arguments);
|
|
184
|
+
return E(this, n);
|
|
209
185
|
};
|
|
210
186
|
}
|
|
211
187
|
function E(e, t) {
|
|
212
|
-
if (t && (g(t)
|
|
213
|
-
|
|
214
|
-
}
|
|
188
|
+
if (t && ("object" == g(t) || "function" == typeof t)) return t;
|
|
189
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
215
190
|
return C(e);
|
|
216
191
|
}
|
|
217
192
|
function C(e) {
|
|
218
|
-
if (
|
|
219
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
220
|
-
}
|
|
193
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
221
194
|
return e;
|
|
222
195
|
}
|
|
223
196
|
function _() {
|
|
224
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
225
|
-
if (Reflect.construct.sham) return false;
|
|
226
|
-
if (typeof Proxy === "function") return true;
|
|
227
197
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return
|
|
232
|
-
}
|
|
198
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
199
|
+
} catch (e) {}
|
|
200
|
+
return (_ = function t() {
|
|
201
|
+
return !!e;
|
|
202
|
+
})();
|
|
233
203
|
}
|
|
234
204
|
function N(e) {
|
|
235
|
-
N = Object.setPrototypeOf ? Object.getPrototypeOf : function
|
|
236
|
-
return
|
|
237
|
-
};
|
|
238
|
-
return N(e);
|
|
205
|
+
return N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
206
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
207
|
+
}, N(e);
|
|
239
208
|
}
|
|
240
209
|
function R(e, t, n) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
210
|
+
return (t = q(t)) in e ? Object.defineProperty(e, t, {
|
|
211
|
+
value: n,
|
|
212
|
+
enumerable: !0,
|
|
213
|
+
configurable: !0,
|
|
214
|
+
writable: !0
|
|
215
|
+
}) : e[t] = n, e;
|
|
216
|
+
}
|
|
217
|
+
function q(e) {
|
|
218
|
+
var t = D(e, "string");
|
|
219
|
+
return "symbol" == g(t) ? t : t + "";
|
|
220
|
+
}
|
|
221
|
+
function D(e, t) {
|
|
222
|
+
if ("object" != g(e) || !e) return e;
|
|
223
|
+
var n = e[Symbol.toPrimitive];
|
|
224
|
+
if (void 0 !== n) {
|
|
225
|
+
var r = n.call(e, t || "default");
|
|
226
|
+
if ("object" != g(r)) return r;
|
|
227
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
250
228
|
}
|
|
251
|
-
return e;
|
|
229
|
+
return ("string" === t ? String : Number)(e);
|
|
252
230
|
}
|
|
253
|
-
var
|
|
254
|
-
animation:
|
|
255
|
-
animateOnMount:
|
|
256
|
-
children:
|
|
257
|
-
className:
|
|
258
|
-
id:
|
|
259
|
-
innerClassName:
|
|
260
|
-
innerStyle:
|
|
261
|
-
onAnimationEnd:
|
|
262
|
-
open:
|
|
263
|
-
outerClassName:
|
|
264
|
-
outerId:
|
|
265
|
-
outerStyle:
|
|
266
|
-
renderChildrenWhenCollapsed:
|
|
267
|
-
retainFocus:
|
|
268
|
-
takeFocus:
|
|
231
|
+
var M = {
|
|
232
|
+
animation: i().oneOf([ "slideFromTop", "slideFromRight", "slideFromBottom", "slideFromLeft", "expandHeight", "expandWidth", "none" ]),
|
|
233
|
+
animateOnMount: i().bool,
|
|
234
|
+
children: i().node,
|
|
235
|
+
className: i().string,
|
|
236
|
+
id: i().string,
|
|
237
|
+
innerClassName: i().string,
|
|
238
|
+
innerStyle: i().object,
|
|
239
|
+
onAnimationEnd: i().func,
|
|
240
|
+
open: i().bool,
|
|
241
|
+
outerClassName: i().string,
|
|
242
|
+
outerId: i().string,
|
|
243
|
+
outerStyle: i().object,
|
|
244
|
+
renderChildrenWhenCollapsed: i().bool,
|
|
245
|
+
retainFocus: i().bool,
|
|
246
|
+
takeFocus: i().bool
|
|
269
247
|
};
|
|
270
|
-
var
|
|
248
|
+
var W = {
|
|
271
249
|
animation: "expandHeight",
|
|
272
250
|
animateOnMount: false,
|
|
273
251
|
innerStyle: {},
|
|
@@ -277,13 +255,25 @@
|
|
|
277
255
|
retainFocus: false,
|
|
278
256
|
takeFocus: false
|
|
279
257
|
};
|
|
280
|
-
var
|
|
281
|
-
|
|
258
|
+
var I = function(e) {
|
|
259
|
+
T(n, e);
|
|
282
260
|
var t = k(n);
|
|
283
|
-
|
|
284
|
-
|
|
261
|
+
F(n, null, [ {
|
|
262
|
+
key: "getDerivedStateFromProps",
|
|
263
|
+
// @docs-props-type TransitionOpenPropsBase
|
|
264
|
+
value: function e(t, n) {
|
|
265
|
+
if (t.open !== n.prevOpen) {
|
|
266
|
+
return {
|
|
267
|
+
animating: true,
|
|
268
|
+
prevOpen: t.open
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
} ]);
|
|
274
|
+
function n(e) {
|
|
285
275
|
var o;
|
|
286
|
-
|
|
276
|
+
S(this, n);
|
|
287
277
|
o = t.call(this, e);
|
|
288
278
|
R(C(o), "allowAnimationUpdates", true);
|
|
289
279
|
R(C(o), "getValue", (function(e) {
|
|
@@ -291,7 +281,7 @@
|
|
|
291
281
|
var n = 0;
|
|
292
282
|
if (e) {
|
|
293
283
|
if (o.props.takeFocus) {
|
|
294
|
-
(0,
|
|
284
|
+
(0, p.takeFocus)(e, "container");
|
|
295
285
|
}
|
|
296
286
|
switch (t) {
|
|
297
287
|
case "slideFromTop":
|
|
@@ -331,41 +321,41 @@
|
|
|
331
321
|
}));
|
|
332
322
|
R(C(o), "handleTab", (function(e) {
|
|
333
323
|
if (o.state.innerEl) {
|
|
334
|
-
(0,
|
|
324
|
+
(0, p.handleTab)(o.state.innerEl, e);
|
|
335
325
|
}
|
|
336
326
|
}));
|
|
337
327
|
R(C(o), "internalRender", (function(e) {
|
|
338
|
-
var t = e.value,
|
|
339
|
-
var
|
|
340
|
-
var
|
|
341
|
-
var
|
|
342
|
-
if (
|
|
328
|
+
var t = e.value, i = e.transform;
|
|
329
|
+
var a = o.props, l = a.animation, c = a.className, p = a.children, d = a.id, m = a.innerClassName, y = a.innerStyle, v = a.open, g = a.outerClassName, w = a.outerId, S = a.outerStyle, P = a.renderChildrenWhenCollapsed;
|
|
330
|
+
var F = o.state.animating;
|
|
331
|
+
var T;
|
|
332
|
+
if (F) {
|
|
343
333
|
switch (l) {
|
|
344
334
|
case "slideFromTop":
|
|
345
335
|
case "slideFromBottom":
|
|
346
336
|
case "expandHeight":
|
|
347
337
|
case "none":
|
|
348
|
-
|
|
338
|
+
T = "height";
|
|
349
339
|
break;
|
|
350
340
|
|
|
351
341
|
case "slideFromLeft":
|
|
352
342
|
case "slideFromRight":
|
|
353
343
|
case "expandWidth":
|
|
354
|
-
|
|
344
|
+
T = "width";
|
|
355
345
|
break;
|
|
356
346
|
|
|
357
347
|
default:
|
|
358
348
|
// Intentionally left empty.
|
|
359
349
|
}
|
|
360
350
|
}
|
|
361
|
-
if (!
|
|
351
|
+
if (!v && !F && P) {
|
|
362
352
|
|
|
363
|
-
return r().createElement(
|
|
353
|
+
return r().createElement(b, {
|
|
364
354
|
$hideOverflow: false,
|
|
365
|
-
className: (0,
|
|
366
|
-
style:
|
|
355
|
+
className: (0, f.toClassName)(c, g),
|
|
356
|
+
style: j(j({}, S), T && R({}, T, t)),
|
|
367
357
|
id: w
|
|
368
|
-
}, r().createElement(
|
|
358
|
+
}, r().createElement(h, O({
|
|
369
359
|
"data-test": "transition-open"
|
|
370
360
|
}, u()(o.props, s()(n.propTypes)), {
|
|
371
361
|
ref: o.handleMount,
|
|
@@ -373,19 +363,19 @@
|
|
|
373
363
|
className: m,
|
|
374
364
|
id: d,
|
|
375
365
|
onKeyDown: o.props.retainFocus ? o.handleTab : undefined,
|
|
376
|
-
style:
|
|
377
|
-
transform:
|
|
366
|
+
style: j(j({}, y), {}, {
|
|
367
|
+
transform: i,
|
|
378
368
|
display: "none"
|
|
379
369
|
})
|
|
380
|
-
}),
|
|
370
|
+
}), p));
|
|
381
371
|
}
|
|
382
372
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
383
|
-
return r().createElement(
|
|
384
|
-
$hideOverflow: !
|
|
385
|
-
className: (0,
|
|
386
|
-
style:
|
|
373
|
+
return r().createElement(b, {
|
|
374
|
+
$hideOverflow: !v || F,
|
|
375
|
+
className: (0, f.toClassName)(c, g),
|
|
376
|
+
style: j(j({}, S), T && R({}, T, t)),
|
|
387
377
|
id: w
|
|
388
|
-
}, (
|
|
378
|
+
}, (v || F) && r().createElement(h, O({
|
|
389
379
|
"data-test": "transition-open"
|
|
390
380
|
}, u()(o.props, s()(n.propTypes)), {
|
|
391
381
|
ref: o.handleMount,
|
|
@@ -393,18 +383,18 @@
|
|
|
393
383
|
className: m,
|
|
394
384
|
id: d,
|
|
395
385
|
onKeyDown: o.props.retainFocus ? o.handleTab : undefined,
|
|
396
|
-
style:
|
|
397
|
-
transform:
|
|
386
|
+
style: j(j({}, y), {}, {
|
|
387
|
+
transform: i
|
|
398
388
|
})
|
|
399
|
-
}),
|
|
389
|
+
}), p));
|
|
400
390
|
}));
|
|
401
391
|
R(C(o), "getSpringTransition", (function() {
|
|
402
392
|
var e = o.props, t = e.open, n = e.animation;
|
|
403
393
|
var r = o.state.value;
|
|
404
|
-
var
|
|
394
|
+
var i = {
|
|
405
395
|
value: t ? r : 0
|
|
406
396
|
};
|
|
407
|
-
var
|
|
397
|
+
var a = {
|
|
408
398
|
value: t ? 0 : r
|
|
409
399
|
};
|
|
410
400
|
var s = {
|
|
@@ -414,34 +404,34 @@
|
|
|
414
404
|
// Expansion doesn't require a valid value; the subsequent render animates it.
|
|
415
405
|
if (n === "expandWidth" || n === "expandHeight" || n === "none") {
|
|
416
406
|
return {
|
|
417
|
-
to:
|
|
407
|
+
to: i,
|
|
418
408
|
config: s
|
|
419
409
|
};
|
|
420
410
|
}
|
|
421
|
-
|
|
411
|
+
// Slide transitions require a valid value, render without transition first.
|
|
422
412
|
if (!r) {
|
|
423
413
|
return null;
|
|
424
414
|
}
|
|
425
415
|
if (n !== "slideFromTop" && n !== "slideFromLeft") {
|
|
426
416
|
// Return the standard transition if not using a transform.
|
|
427
417
|
return {
|
|
428
|
-
to:
|
|
429
|
-
from:
|
|
418
|
+
to: i,
|
|
419
|
+
from: a,
|
|
430
420
|
config: s
|
|
431
421
|
};
|
|
432
422
|
}
|
|
433
|
-
|
|
423
|
+
// The top and left directions require an additional transform of their inner content to match the outer dimension animation.
|
|
434
424
|
// This is needed to achieve a clipping effect from the outer div, rather than the consumer providing their own.
|
|
435
425
|
var l = n === "slideFromTop" ? "Y" : "X";
|
|
436
426
|
var u = "translate".concat(l, "(").concat(t ? 0 : -r, "px)");
|
|
437
427
|
var c = "translate".concat(l, "(").concat(t ? -r : 0, "px)");
|
|
438
428
|
return {
|
|
439
|
-
to:
|
|
429
|
+
to: j({
|
|
440
430
|
transform: u
|
|
441
|
-
},
|
|
442
|
-
from:
|
|
431
|
+
}, i),
|
|
432
|
+
from: j({
|
|
443
433
|
transform: c
|
|
444
|
-
},
|
|
434
|
+
}, a)
|
|
445
435
|
};
|
|
446
436
|
}));
|
|
447
437
|
o.state = {
|
|
@@ -451,7 +441,7 @@
|
|
|
451
441
|
};
|
|
452
442
|
return o;
|
|
453
443
|
}
|
|
454
|
-
|
|
444
|
+
F(n, [ {
|
|
455
445
|
key: "componentDidUpdate",
|
|
456
446
|
value: function e() {
|
|
457
447
|
var t = this.getValue(this.state.innerEl);
|
|
@@ -475,24 +465,16 @@
|
|
|
475
465
|
return r().createElement(c.Spring, O({}, this.getSpringTransition(), {
|
|
476
466
|
immediate: t === "none",
|
|
477
467
|
onRest: this.handleRest
|
|
478
|
-
}),
|
|
468
|
+
}),
|
|
469
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
479
470
|
this.internalRender);
|
|
480
471
|
}
|
|
481
472
|
} ]);
|
|
482
473
|
return n;
|
|
483
474
|
}(n.Component);
|
|
484
|
-
R(
|
|
485
|
-
R(
|
|
486
|
-
|
|
487
|
-
if (e.open !== t.prevOpen) {
|
|
488
|
-
return {
|
|
489
|
-
animating: true,
|
|
490
|
-
prevOpen: e.open
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
return null;
|
|
494
|
-
}));
|
|
495
|
-
/* harmony default export */ const W = M;
|
|
475
|
+
R(I, "propTypes", M);
|
|
476
|
+
R(I, "defaultProps", W);
|
|
477
|
+
/* harmony default export */ const A = I;
|
|
496
478
|
// CONCATENATED MODULE: ./src/TransitionOpen/index.ts
|
|
497
479
|
module.exports = t;
|
|
498
480
|
/******/})();
|