@splunk/react-ui 4.37.0 → 4.39.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 +208 -219
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +50 -1
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +1107 -980
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +267 -305
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- 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 +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +512 -530
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1600 -1923
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- 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 +130 -94
- package/Scroll.js +209 -244
- package/Search.js +375 -384
- package/Select.js +1076 -1354
- package/SidePanel.js +122 -142
- package/Slider.js +192 -222
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +211 -236
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +401 -512
- 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 +60 -68
- 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 +17 -17
- package/types/src/Button/Button.d.ts +20 -6
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +5 -2
- package/types/src/Color/Palette.d.ts +6 -2
- 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 -3
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Link/Link.d.ts +3 -4
- package/types/src/Menu/Item.d.ts +24 -8
- 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/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 +16 -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 +2 -2
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/Select/SelectBase.d.ts +0 -1
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -3
- package/types/src/Slider/docs/examples/Error.d.ts +2 -0
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- 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/HeadDropdownCell.d.ts +2 -0
- 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 +6 -4
- package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
- 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/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/Button/docs/examples/Selected.d.ts +0 -2
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- 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/Slider/docs/examples/prisma/Error.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/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.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/CollapsiblePanel.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
64
|
SingleOpenPanelGroup: () => /* reexport */ ce,
|
|
65
|
-
default: () => /* reexport */
|
|
65
|
+
default: () => /* reexport */ _e
|
|
66
66
|
});
|
|
67
67
|
// CONCATENATED MODULE: external "react"
|
|
68
68
|
const n = require("react");
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
const m = require("@splunk/react-ui/usePrevious");
|
|
91
91
|
var y = e.n(m);
|
|
92
92
|
// CONCATENATED MODULE: external "styled-components"
|
|
93
|
-
const
|
|
94
|
-
var
|
|
93
|
+
const g = require("styled-components");
|
|
94
|
+
var h = e.n(g);
|
|
95
95
|
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
96
96
|
const k = require("@splunk/react-ui/Box");
|
|
97
97
|
var C = e.n(k);
|
|
@@ -100,12 +100,12 @@
|
|
|
100
100
|
var O = e.n(x);
|
|
101
101
|
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
102
102
|
const S = require("@splunk/react-ui/Clickable");
|
|
103
|
-
var
|
|
103
|
+
var w = e.n(S);
|
|
104
104
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
105
105
|
const P = require("@splunk/themes");
|
|
106
106
|
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
|
|
107
|
-
const
|
|
108
|
-
var j = e.n(
|
|
107
|
+
const I = require("@splunk/react-icons/ChevronRight");
|
|
108
|
+
var j = e.n(I);
|
|
109
109
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
110
110
|
const E = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
111
111
|
var _ = e.n(E);
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
var q = {
|
|
114
114
|
className: u().string
|
|
115
115
|
};
|
|
116
|
-
var
|
|
116
|
+
var A = function e(t) {
|
|
117
117
|
var n = t.className;
|
|
118
118
|
var a = (0, P.useSplunkTheme)(), o = a.isEnterprise;
|
|
119
119
|
return o ? r().createElement(_(), {
|
|
@@ -124,51 +124,51 @@
|
|
|
124
124
|
className: n
|
|
125
125
|
});
|
|
126
126
|
};
|
|
127
|
-
|
|
128
|
-
/* harmony default export */ const
|
|
127
|
+
A.propTypes = q;
|
|
128
|
+
/* harmony default export */ const R = A;
|
|
129
129
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanelStyles.ts
|
|
130
|
-
var
|
|
130
|
+
var T = h()(C()).withConfig({
|
|
131
131
|
displayName: "CollapsiblePanelStyles__StyledBox",
|
|
132
132
|
componentId: "sc-1phikbp-0"
|
|
133
133
|
})([ "display:flex;flex-direction:column;flex-shrink:1;", ";", ";& + &{margin-top:", ";}" ], (0,
|
|
134
134
|
P.pick)({
|
|
135
|
-
enterprise: (0,
|
|
135
|
+
enterprise: (0, g.css)([ "min-height:calc(", " + 12px);" ], P.variables.lineHeight),
|
|
136
136
|
prisma: {
|
|
137
|
-
comfortable: (0,
|
|
138
|
-
compact: (0,
|
|
137
|
+
comfortable: (0, g.css)([ "min-height:56px;" ]),
|
|
138
|
+
compact: (0, g.css)([ "min-height:48px;" ])
|
|
139
139
|
}
|
|
140
140
|
}), (0, P.pick)({
|
|
141
|
-
prisma: (0,
|
|
141
|
+
prisma: (0, g.css)([ "background-color:", ";" ], P.variables.backgroundColorSection)
|
|
142
142
|
}), (0, P.pick)({
|
|
143
143
|
enterprise: "2px",
|
|
144
144
|
prisma: "1px"
|
|
145
145
|
}));
|
|
146
|
-
var
|
|
146
|
+
var D = h()(C()).withConfig({
|
|
147
147
|
displayName: "CollapsiblePanelStyles__StyledSingleOpenPanelGroupBox",
|
|
148
148
|
componentId: "sc-1phikbp-1"
|
|
149
149
|
})([ "", ";flex-direction:column;margin-bottom:0;", "" ], P.mixins.reset("flex"), (0,
|
|
150
150
|
P.pick)({
|
|
151
|
-
enterprise: (0,
|
|
151
|
+
enterprise: (0, g.css)([ "background:", ";" ], P.variables.backgroundColor)
|
|
152
152
|
}));
|
|
153
153
|
/*
|
|
154
154
|
these styles are consistent for both regular and titleWithActions, but applied to different elements
|
|
155
155
|
* in regular mode, they're on the SVG's span wrapper
|
|
156
156
|
* in titleWithActionsMode, they're on the button
|
|
157
157
|
applying them directly to the icon wrapper doesn't work because Enterprise has 1px border around the button
|
|
158
|
-
*/ var N = (0,
|
|
158
|
+
*/ var N = (0, g.css)([ "min-width:", ";" ], (0, P.pick)({
|
|
159
159
|
enterprise: "20px",
|
|
160
160
|
prisma: "35px"
|
|
161
161
|
}));
|
|
162
|
-
var X =
|
|
162
|
+
var X = h().span.withConfig({
|
|
163
163
|
displayName: "CollapsiblePanelStyles__StyledIconWrapper",
|
|
164
164
|
componentId: "sc-1phikbp-2"
|
|
165
165
|
})([ "display:inline-block;flex:0 auto;", "" ], N);
|
|
166
|
-
var
|
|
166
|
+
var B = h().div.withConfig({
|
|
167
167
|
displayName: "CollapsiblePanelStyles__StyledTitleWithActions",
|
|
168
168
|
componentId: "sc-1phikbp-3"
|
|
169
169
|
})([ "display:flex;flex-shrink:0;border-bottom:0;position:relative;padding:", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;color:", ";", " ", "" ], (0,
|
|
170
170
|
P.pick)({
|
|
171
|
-
enterprise: (0,
|
|
171
|
+
enterprise: (0, g.css)([ "", " ", " ", " ", "" ], P.variables.spacingXSmall, P.variables.spacingSmall, P.variables.spacingXSmall, P.variables.spacingXSmall),
|
|
172
172
|
prisma: {
|
|
173
173
|
comfortable: "8px 10px 8px 11px",
|
|
174
174
|
compact: "8px 10px 8px 11px"
|
|
@@ -177,23 +177,23 @@
|
|
|
177
177
|
enterprise: P.variables.textColor,
|
|
178
178
|
prisma: P.variables.contentColorActive
|
|
179
179
|
}), (0, P.pick)({
|
|
180
|
-
prisma: (0,
|
|
180
|
+
prisma: (0, g.css)([ "background-color:", ";" ], P.variables.interactiveColorBackground),
|
|
181
181
|
enterprise: {
|
|
182
|
-
dark: (0,
|
|
183
|
-
light: (0,
|
|
182
|
+
dark: (0, g.css)([ "background-color:", ";" ], P.variables.gray45),
|
|
183
|
+
light: (0, g.css)([ "background-color:", ";" ], P.variables.gray96)
|
|
184
184
|
}
|
|
185
185
|
}), (function(e) {
|
|
186
186
|
var t = e.$disabled;
|
|
187
|
-
return t && (0,
|
|
187
|
+
return t && (0, g.css)([ "cursor:default;color:", ";" ], (0, P.pick)({
|
|
188
188
|
enterprise: P.variables.contentColorDefault,
|
|
189
189
|
prisma: P.variables.contentColorDisabled
|
|
190
190
|
}));
|
|
191
191
|
}));
|
|
192
|
-
var
|
|
192
|
+
var W = h()(O()).withConfig({
|
|
193
193
|
displayName: "CollapsiblePanelStyles__StyledToggleButton",
|
|
194
194
|
componentId: "sc-1phikbp-4"
|
|
195
195
|
})([ "flex:0 auto;padding:0;", "" ], N);
|
|
196
|
-
var L =
|
|
196
|
+
var L = h()(w()).withConfig({
|
|
197
197
|
displayName: "CollapsiblePanelStyles__StyledTitleClickable",
|
|
198
198
|
componentId: "sc-1phikbp-5"
|
|
199
199
|
})([ "width:100%;flex-shrink:0;border-bottom:0;cursor:pointer;position:relative;display:flex;transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;padding:", ";color:", ";", " ", " &[disabled]{cursor:default;color:", ";}&:focus:not([disabled]),&:active:not([disabled]){color:", ";box-shadow:", ";z-index:1;}&:hover:not([disabled]){color:", ";background-color:", ";}" ], (0,
|
|
@@ -207,12 +207,12 @@
|
|
|
207
207
|
enterprise: P.variables.textColor,
|
|
208
208
|
prisma: P.variables.contentColorActive
|
|
209
209
|
}), (0, P.pick)({
|
|
210
|
-
prisma: (0,
|
|
210
|
+
prisma: (0, g.css)([ "background-color:", ";" ], P.variables.interactiveColorBackground)
|
|
211
211
|
}), (0, P.pickVariant)("$open", {
|
|
212
212
|
false: {
|
|
213
213
|
enterprise: {
|
|
214
|
-
dark: (0,
|
|
215
|
-
light: (0,
|
|
214
|
+
dark: (0, g.css)([ "background-color:", ";" ], P.variables.gray45),
|
|
215
|
+
light: (0, g.css)([ "background-color:", ";" ], P.variables.gray96)
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
}), (0, P.pick)({
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
},
|
|
232
232
|
prisma: P.mixins.overlayColors(P.variables.interactiveColorBackground, P.variables.interactiveColorOverlayHover)
|
|
233
233
|
}));
|
|
234
|
-
var $ =
|
|
234
|
+
var $ = h().span.withConfig({
|
|
235
235
|
displayName: "CollapsiblePanelStyles__StyledHeadingContent",
|
|
236
236
|
componentId: "sc-1phikbp-6"
|
|
237
237
|
})([ "display:flex;justify-content:space-between;margin-left:", ";flex:1 1 auto;", " ", "" ], (0,
|
|
@@ -239,17 +239,17 @@
|
|
|
239
239
|
enterprise: "5px",
|
|
240
240
|
prisma: "6px"
|
|
241
241
|
}), (0, P.pick)({
|
|
242
|
-
prisma: (0,
|
|
242
|
+
prisma: (0, g.css)([ "font-weight:", ";" ], P.variables.fontWeightSemiBold)
|
|
243
243
|
}), (function(e) {
|
|
244
244
|
var t = e.$titleWithActions;
|
|
245
|
-
return t && (0,
|
|
245
|
+
return t && (0, g.css)([ "min-height:", ";" ], (0, P.pick)({
|
|
246
246
|
prisma: {
|
|
247
247
|
comfortable: P.variables.spacingXXXLarge,
|
|
248
248
|
compact: P.variables.spacingXXLarge
|
|
249
249
|
}
|
|
250
250
|
}));
|
|
251
251
|
}));
|
|
252
|
-
var M =
|
|
252
|
+
var M = h().span.withConfig({
|
|
253
253
|
displayName: "CollapsiblePanelStyles__StyledHeadingActions",
|
|
254
254
|
componentId: "sc-1phikbp-7"
|
|
255
255
|
})([ "min-height:", ";flex:1 0 auto;" ], (0, P.pick)({
|
|
@@ -258,14 +258,14 @@
|
|
|
258
258
|
compact: P.variables.spacingXXLarge
|
|
259
259
|
}
|
|
260
260
|
}));
|
|
261
|
-
var G =
|
|
261
|
+
var G = h().span.withConfig({
|
|
262
262
|
displayName: "CollapsiblePanelStyles__StyledDescription",
|
|
263
263
|
componentId: "sc-1phikbp-8"
|
|
264
264
|
})([ "font-size:", ";margin-left:", ";" ], P.variables.fontSizeSmall, (0, P.pick)({
|
|
265
265
|
enterprise: P.variables.spacingSmall,
|
|
266
266
|
prisma: P.variables.spacingLarge
|
|
267
267
|
}));
|
|
268
|
-
var H =
|
|
268
|
+
var H = h().div.withConfig({
|
|
269
269
|
displayName: "CollapsiblePanelStyles__StyledInsetWrapper",
|
|
270
270
|
componentId: "sc-1phikbp-9"
|
|
271
271
|
})([ "", ";padding:", ";" ], P.mixins.reset("block"), (0, P.pickVariant)("$inset", {
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
}),
|
|
282
282
|
false: 0
|
|
283
283
|
}));
|
|
284
|
-
var U =
|
|
284
|
+
var U = h()(R).withConfig({
|
|
285
285
|
displayName: "CollapsiblePanelStyles__StyledExpandPanelIcon",
|
|
286
286
|
componentId: "sc-1phikbp-10"
|
|
287
287
|
})([ "transition:transform ", ";", ";", " width:100%;vertical-align:", ";" ], (0,
|
|
@@ -289,14 +289,14 @@
|
|
|
289
289
|
enterprise: "300ms",
|
|
290
290
|
prisma: "200ms"
|
|
291
291
|
}), (0, P.pick)({
|
|
292
|
-
enterprise: (0,
|
|
292
|
+
enterprise: (0, g.css)([ "[disabled] &{color:", ";}" ], (0, P.pick)({
|
|
293
293
|
dark: P.variables.contentColorDefault,
|
|
294
294
|
light: P.variables.contentColorDisabled
|
|
295
295
|
})),
|
|
296
|
-
prisma: (0,
|
|
296
|
+
prisma: (0, g.css)([ "color:", ";[disabled] &{color:inherit;}" ], P.variables.contentColorDefault)
|
|
297
297
|
}), (function(e) {
|
|
298
298
|
var t = e.open;
|
|
299
|
-
return t && (0,
|
|
299
|
+
return t && (0, g.css)([ "transform:rotate(90deg);" ]);
|
|
300
300
|
}), (0, P.pick)({
|
|
301
301
|
enterprise: "baseline",
|
|
302
302
|
prisma: "text-bottom"
|
|
@@ -306,18 +306,15 @@
|
|
|
306
306
|
/* harmony default export */ const V = z;
|
|
307
307
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroup.tsx
|
|
308
308
|
function F() {
|
|
309
|
-
F = Object.assign
|
|
309
|
+
return F = Object.assign ? Object.assign.bind() : function(e) {
|
|
310
310
|
for (var t = 1; t < arguments.length; t++) {
|
|
311
311
|
var n = arguments[t];
|
|
312
312
|
for (var r in n) {
|
|
313
|
-
|
|
314
|
-
e[r] = n[r];
|
|
315
|
-
}
|
|
313
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
316
314
|
}
|
|
317
315
|
}
|
|
318
316
|
return e;
|
|
319
|
-
};
|
|
320
|
-
return F.apply(this, arguments);
|
|
317
|
+
}, F.apply(null, arguments);
|
|
321
318
|
}
|
|
322
319
|
function J(e) {
|
|
323
320
|
return Y(e) || Q(e) || te(e) || K();
|
|
@@ -326,7 +323,7 @@
|
|
|
326
323
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
327
324
|
}
|
|
328
325
|
function Q(e) {
|
|
329
|
-
if (typeof Symbol
|
|
326
|
+
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
330
327
|
}
|
|
331
328
|
function Y(e) {
|
|
332
329
|
if (Array.isArray(e)) return ne(e);
|
|
@@ -338,70 +335,63 @@
|
|
|
338
335
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
339
336
|
}
|
|
340
337
|
function te(e, t) {
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ne(e, t);
|
|
338
|
+
if (e) {
|
|
339
|
+
if ("string" == typeof e) return ne(e, t);
|
|
340
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
341
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ne(e, t) : void 0;
|
|
342
|
+
}
|
|
347
343
|
}
|
|
348
344
|
function ne(e, t) {
|
|
349
|
-
|
|
350
|
-
for (var n = 0, r =
|
|
345
|
+
(null == t || t > e.length) && (t = e.length);
|
|
346
|
+
for (var n = 0, r = Array(t); n < t; n++) {
|
|
351
347
|
r[n] = e[n];
|
|
352
348
|
}
|
|
353
349
|
return r;
|
|
354
350
|
}
|
|
355
351
|
function re(e, t) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
var a = false;
|
|
360
|
-
var o = undefined;
|
|
361
|
-
try {
|
|
362
|
-
for (var i = e[Symbol.iterator](), l; !(r = (l = i.next()).done); r = true) {
|
|
363
|
-
n.push(l.value);
|
|
364
|
-
if (t && n.length === t) break;
|
|
365
|
-
}
|
|
366
|
-
} catch (e) {
|
|
367
|
-
a = true;
|
|
368
|
-
o = e;
|
|
369
|
-
} finally {
|
|
352
|
+
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
353
|
+
if (null != n) {
|
|
354
|
+
var r, a, o, i, l = [], s = !0, c = !1;
|
|
370
355
|
try {
|
|
371
|
-
if (
|
|
356
|
+
if (o = (n = n.call(e)).next, 0 === t) {
|
|
357
|
+
if (Object(n) !== n) return;
|
|
358
|
+
s = !1;
|
|
359
|
+
} else for (;!(s = (r = o.call(n)).done) && (l.push(r.value), l.length !== t); s = !0) {
|
|
360
|
+
}
|
|
361
|
+
} catch (e) {
|
|
362
|
+
c = !0, a = e;
|
|
372
363
|
} finally {
|
|
373
|
-
|
|
364
|
+
try {
|
|
365
|
+
if (!s && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
366
|
+
} finally {
|
|
367
|
+
if (c) throw a;
|
|
368
|
+
}
|
|
374
369
|
}
|
|
370
|
+
return l;
|
|
375
371
|
}
|
|
376
|
-
return n;
|
|
377
372
|
}
|
|
378
373
|
function ae(e) {
|
|
379
374
|
if (Array.isArray(e)) return e;
|
|
380
375
|
}
|
|
381
376
|
function oe(e, t) {
|
|
382
|
-
if (
|
|
383
|
-
var n = ie(e, t);
|
|
384
|
-
var r, a;
|
|
377
|
+
if (null == e) return {};
|
|
378
|
+
var n, r, a = ie(e, t);
|
|
385
379
|
if (Object.getOwnPropertySymbols) {
|
|
386
380
|
var o = Object.getOwnPropertySymbols(e);
|
|
387
|
-
for (
|
|
388
|
-
|
|
389
|
-
if (t.indexOf(r) >= 0) continue;
|
|
390
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
|
|
391
|
-
n[r] = e[r];
|
|
381
|
+
for (r = 0; r < o.length; r++) {
|
|
382
|
+
n = o[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
|
|
392
383
|
}
|
|
393
384
|
}
|
|
394
|
-
return
|
|
385
|
+
return a;
|
|
395
386
|
}
|
|
396
387
|
function ie(e, t) {
|
|
397
|
-
if (
|
|
388
|
+
if (null == e) return {};
|
|
398
389
|
var n = {};
|
|
399
|
-
var r
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
n[a] = e[a];
|
|
390
|
+
for (var r in e) {
|
|
391
|
+
if ({}.hasOwnProperty.call(e, r)) {
|
|
392
|
+
if (t.includes(r)) continue;
|
|
393
|
+
n[r] = e[r];
|
|
394
|
+
}
|
|
405
395
|
}
|
|
406
396
|
return n;
|
|
407
397
|
}
|
|
@@ -419,9 +409,9 @@
|
|
|
419
409
|
var f = o()(e, "openPanelId");
|
|
420
410
|
var b = y()(a);
|
|
421
411
|
var v = !f ? a : undefined;
|
|
422
|
-
var m = (0, n.useState)(v),
|
|
412
|
+
var m = (0, n.useState)(v), g = Z(m, 2), h = g[0], k = g[1];
|
|
423
413
|
var C = function e() {
|
|
424
|
-
var t = f ? u :
|
|
414
|
+
var t = f ? u : h;
|
|
425
415
|
return t;
|
|
426
416
|
};
|
|
427
417
|
var x = (0, n.useCallback)((function(e, t) {
|
|
@@ -432,10 +422,10 @@
|
|
|
432
422
|
k(a);
|
|
433
423
|
}
|
|
434
424
|
p === null || p === void 0 ? void 0 : p(e, t);
|
|
435
|
-
}), [ u, f,
|
|
425
|
+
}), [ u, f, h, C, p ]);
|
|
436
426
|
(0, n.useEffect)((function() {
|
|
437
427
|
if (false) {}
|
|
438
|
-
|
|
428
|
+
// In this functional component, we want the dependencies to be [], but when we do that
|
|
439
429
|
// we get a linting error.
|
|
440
430
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
441
431
|
}), []);
|
|
@@ -450,12 +440,12 @@
|
|
|
450
440
|
var S = (0, n.useMemo)((function() {
|
|
451
441
|
return {
|
|
452
442
|
onChange: x,
|
|
453
|
-
openPanelId: f ? u :
|
|
443
|
+
openPanelId: f ? u : h,
|
|
454
444
|
inset: s
|
|
455
445
|
};
|
|
456
|
-
}), [ x, f, s, u,
|
|
446
|
+
}), [ x, f, s, u, h ]);
|
|
457
447
|
|
|
458
|
-
return r().createElement(
|
|
448
|
+
return r().createElement(D, F({
|
|
459
449
|
"data-test": "single-open-panel-group",
|
|
460
450
|
"data-test-open-panel-id": u,
|
|
461
451
|
elementRef: i
|
|
@@ -468,154 +458,134 @@
|
|
|
468
458
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanel.tsx
|
|
469
459
|
function pe(e) {
|
|
470
460
|
"@babel/helpers - typeof";
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
pe = function e(t) {
|
|
477
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
return pe(e);
|
|
461
|
+
return pe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
462
|
+
return typeof e;
|
|
463
|
+
} : function(e) {
|
|
464
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
465
|
+
}, pe(e);
|
|
481
466
|
}
|
|
482
467
|
function ue() {
|
|
483
|
-
ue = Object.assign
|
|
468
|
+
return ue = Object.assign ? Object.assign.bind() : function(e) {
|
|
484
469
|
for (var t = 1; t < arguments.length; t++) {
|
|
485
470
|
var n = arguments[t];
|
|
486
471
|
for (var r in n) {
|
|
487
|
-
|
|
488
|
-
e[r] = n[r];
|
|
489
|
-
}
|
|
472
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
490
473
|
}
|
|
491
474
|
}
|
|
492
475
|
return e;
|
|
493
|
-
};
|
|
494
|
-
return ue.apply(this, arguments);
|
|
476
|
+
}, ue.apply(null, arguments);
|
|
495
477
|
}
|
|
496
478
|
function de(e, t) {
|
|
497
479
|
var n = Object.keys(e);
|
|
498
480
|
if (Object.getOwnPropertySymbols) {
|
|
499
481
|
var r = Object.getOwnPropertySymbols(e);
|
|
500
|
-
|
|
482
|
+
t && (r = r.filter((function(t) {
|
|
501
483
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
502
|
-
}));
|
|
503
|
-
n.push.apply(n, r);
|
|
484
|
+
}))), n.push.apply(n, r);
|
|
504
485
|
}
|
|
505
486
|
return n;
|
|
506
487
|
}
|
|
507
488
|
function fe(e) {
|
|
508
489
|
for (var t = 1; t < arguments.length; t++) {
|
|
509
|
-
var n = arguments[t]
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
|
|
516
|
-
} else {
|
|
517
|
-
de(Object(n)).forEach((function(t) {
|
|
518
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
519
|
-
}));
|
|
520
|
-
}
|
|
490
|
+
var n = null != arguments[t] ? arguments[t] : {};
|
|
491
|
+
t % 2 ? de(Object(n), !0).forEach((function(t) {
|
|
492
|
+
Se(e, t, n[t]);
|
|
493
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : de(Object(n)).forEach((function(t) {
|
|
494
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
495
|
+
}));
|
|
521
496
|
}
|
|
522
497
|
return e;
|
|
523
498
|
}
|
|
524
499
|
function be(e, t) {
|
|
525
|
-
if (!(e instanceof t))
|
|
526
|
-
throw new TypeError("Cannot call a class as a function");
|
|
527
|
-
}
|
|
500
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
528
501
|
}
|
|
529
502
|
function ve(e, t) {
|
|
530
503
|
for (var n = 0; n < t.length; n++) {
|
|
531
504
|
var r = t[n];
|
|
532
|
-
r.enumerable = r.enumerable ||
|
|
533
|
-
r.
|
|
534
|
-
if ("value" in r) r.writable = true;
|
|
535
|
-
Object.defineProperty(e, r.key, r);
|
|
505
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
506
|
+
Object.defineProperty(e, we(r.key), r);
|
|
536
507
|
}
|
|
537
508
|
}
|
|
538
509
|
function me(e, t, n) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
510
|
+
return t && ve(e.prototype, t), n && ve(e, n), Object.defineProperty(e, "prototype", {
|
|
511
|
+
writable: !1
|
|
512
|
+
}), e;
|
|
542
513
|
}
|
|
543
514
|
function ye(e, t) {
|
|
544
|
-
if (typeof t !== "
|
|
545
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
546
|
-
}
|
|
515
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
547
516
|
e.prototype = Object.create(t && t.prototype, {
|
|
548
517
|
constructor: {
|
|
549
518
|
value: e,
|
|
550
|
-
writable:
|
|
551
|
-
configurable:
|
|
519
|
+
writable: !0,
|
|
520
|
+
configurable: !0
|
|
552
521
|
}
|
|
553
|
-
})
|
|
554
|
-
|
|
522
|
+
}), Object.defineProperty(e, "prototype", {
|
|
523
|
+
writable: !1
|
|
524
|
+
}), t && ge(e, t);
|
|
555
525
|
}
|
|
556
|
-
function
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
};
|
|
561
|
-
return he(e, t);
|
|
526
|
+
function ge(e, t) {
|
|
527
|
+
return ge = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
528
|
+
return e.__proto__ = t, e;
|
|
529
|
+
}, ge(e, t);
|
|
562
530
|
}
|
|
563
|
-
function
|
|
531
|
+
function he(e) {
|
|
564
532
|
var t = xe();
|
|
565
|
-
return function
|
|
566
|
-
var r = Oe(e)
|
|
533
|
+
return function() {
|
|
534
|
+
var n, r = Oe(e);
|
|
567
535
|
if (t) {
|
|
568
|
-
var
|
|
569
|
-
|
|
570
|
-
} else
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
return ke(this, a);
|
|
536
|
+
var a = Oe(this).constructor;
|
|
537
|
+
n = Reflect.construct(r, arguments, a);
|
|
538
|
+
} else n = r.apply(this, arguments);
|
|
539
|
+
return ke(this, n);
|
|
574
540
|
};
|
|
575
541
|
}
|
|
576
542
|
function ke(e, t) {
|
|
577
|
-
if (t && (pe(t)
|
|
578
|
-
|
|
579
|
-
}
|
|
543
|
+
if (t && ("object" == pe(t) || "function" == typeof t)) return t;
|
|
544
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
580
545
|
return Ce(e);
|
|
581
546
|
}
|
|
582
547
|
function Ce(e) {
|
|
583
|
-
if (
|
|
584
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
585
|
-
}
|
|
548
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
586
549
|
return e;
|
|
587
550
|
}
|
|
588
551
|
function xe() {
|
|
589
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
590
|
-
if (Reflect.construct.sham) return false;
|
|
591
|
-
if (typeof Proxy === "function") return true;
|
|
592
552
|
try {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
return
|
|
597
|
-
}
|
|
553
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
554
|
+
} catch (e) {}
|
|
555
|
+
return (xe = function t() {
|
|
556
|
+
return !!e;
|
|
557
|
+
})();
|
|
598
558
|
}
|
|
599
559
|
function Oe(e) {
|
|
600
|
-
Oe = Object.setPrototypeOf ? Object.getPrototypeOf : function
|
|
601
|
-
return
|
|
602
|
-
};
|
|
603
|
-
return Oe(e);
|
|
560
|
+
return Oe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
561
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
562
|
+
}, Oe(e);
|
|
604
563
|
}
|
|
605
564
|
function Se(e, t, n) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
565
|
+
return (t = we(t)) in e ? Object.defineProperty(e, t, {
|
|
566
|
+
value: n,
|
|
567
|
+
enumerable: !0,
|
|
568
|
+
configurable: !0,
|
|
569
|
+
writable: !0
|
|
570
|
+
}) : e[t] = n, e;
|
|
571
|
+
}
|
|
572
|
+
function we(e) {
|
|
573
|
+
var t = Pe(e, "string");
|
|
574
|
+
return "symbol" == pe(t) ? t : t + "";
|
|
575
|
+
}
|
|
576
|
+
function Pe(e, t) {
|
|
577
|
+
if ("object" != pe(e) || !e) return e;
|
|
578
|
+
var n = e[Symbol.toPrimitive];
|
|
579
|
+
if (void 0 !== n) {
|
|
580
|
+
var r = n.call(e, t || "default");
|
|
581
|
+
if ("object" != pe(r)) return r;
|
|
582
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
615
583
|
}
|
|
616
|
-
return e;
|
|
584
|
+
return ("string" === t ? String : Number)(e);
|
|
617
585
|
}
|
|
618
|
-
|
|
586
|
+
/** @public @deprecated Use `CollapsiblePanelChangeHandler` */
|
|
587
|
+
/** @public @deprecated Use `CollapsiblePanelChangeHandler` */
|
|
588
|
+
/** @public */ var Ie = {
|
|
619
589
|
innerBodyStyles: u().object,
|
|
620
590
|
actions: u().node,
|
|
621
591
|
children: u().node,
|
|
@@ -635,16 +605,16 @@
|
|
|
635
605
|
title: u().node.isRequired,
|
|
636
606
|
titleWithActions: u().bool
|
|
637
607
|
};
|
|
638
|
-
var
|
|
608
|
+
var je = {
|
|
639
609
|
disabled: false,
|
|
640
610
|
overflow: "auto",
|
|
641
611
|
renderChildrenWhenCollapsed: false,
|
|
642
612
|
titleWithActions: false,
|
|
643
613
|
inset: false
|
|
644
614
|
};
|
|
645
|
-
var
|
|
615
|
+
var Ee = function(e) {
|
|
646
616
|
ye(n, e);
|
|
647
|
-
var t =
|
|
617
|
+
var t = he(n);
|
|
648
618
|
// @docs-props-type CollapsiblePanelPropsBase
|
|
649
619
|
function n(e) {
|
|
650
620
|
var r;
|
|
@@ -690,7 +660,7 @@
|
|
|
690
660
|
reason: "toggleClick",
|
|
691
661
|
action: s
|
|
692
662
|
});
|
|
693
|
-
|
|
663
|
+
// Maintains backwards compatibility until the `handleRequestClose` and `handleRequestOpen` handlers are removed in SUI-5
|
|
694
664
|
if (l) {
|
|
695
665
|
r.handleRequestClose(e);
|
|
696
666
|
} else {
|
|
@@ -715,7 +685,7 @@
|
|
|
715
685
|
r.toggleId = "toggle-".concat((0, b.createGUID)());
|
|
716
686
|
return r;
|
|
717
687
|
}
|
|
718
|
-
|
|
688
|
+
// Only testing this in the scenario of a SingleOpenPanelGroup.
|
|
719
689
|
me(n, [ {
|
|
720
690
|
key: "componentDidMount",
|
|
721
691
|
value: function e() {
|
|
@@ -752,7 +722,7 @@
|
|
|
752
722
|
}, {
|
|
753
723
|
key: "render",
|
|
754
724
|
value: function e() {
|
|
755
|
-
var t = this.props, a = t.innerBodyStyles, o = t.actions, i = t.children, s = t.description, p = t.disabled, u = t.elementRef, d = t.headingLevel, m = t.overflow, y = t.renderChildrenWhenCollapsed,
|
|
725
|
+
var t = this.props, a = t.innerBodyStyles, o = t.actions, i = t.children, s = t.description, p = t.disabled, u = t.elementRef, d = t.headingLevel, m = t.overflow, y = t.renderChildrenWhenCollapsed, g = t.title, h = t.titleWithActions, k = t.inset;
|
|
756
726
|
var C = this.state.animating;
|
|
757
727
|
var x = (0, b.createDOMID)("panel-toggle");
|
|
758
728
|
var O = this.isOpen();
|
|
@@ -766,22 +736,22 @@
|
|
|
766
736
|
"data-test": "toggle"
|
|
767
737
|
};
|
|
768
738
|
|
|
769
|
-
return r().createElement(
|
|
739
|
+
return r().createElement(T, ue({
|
|
770
740
|
"data-test": "collapsible-panel",
|
|
771
741
|
elementRef: u
|
|
772
|
-
}, c()(this.props, l()(n.propTypes))),
|
|
742
|
+
}, c()(this.props, l()(n.propTypes))), h || o != null ? r().createElement(B, {
|
|
773
743
|
$disabled: p
|
|
774
|
-
}, r().createElement(
|
|
744
|
+
}, r().createElement(W, ue({
|
|
775
745
|
appearance: "subtle",
|
|
776
746
|
"aria-label": (0, v._)("Panel"),
|
|
777
747
|
"aria-labelledby": x
|
|
778
748
|
}, S), r().createElement(U, {
|
|
779
749
|
open: !!O
|
|
780
750
|
})), r().createElement($, {
|
|
781
|
-
$titleWithActions:
|
|
751
|
+
$titleWithActions: h,
|
|
782
752
|
"data-test": "title",
|
|
783
753
|
id: o != null ? x : undefined
|
|
784
|
-
},
|
|
754
|
+
}, g), o != null && r().createElement(M, null, o)) :
|
|
785
755
|
|
|
786
756
|
/* Clickable component is not allowed to have role="heading" so it is wrapped with a span */
|
|
787
757
|
r().createElement("span", {
|
|
@@ -792,7 +762,7 @@
|
|
|
792
762
|
open: !!O
|
|
793
763
|
})), r().createElement($, null, r().createElement("span", {
|
|
794
764
|
"data-test": "title"
|
|
795
|
-
},
|
|
765
|
+
}, g), s && r().createElement(G, {
|
|
796
766
|
"data-test": "description"
|
|
797
767
|
}, s)))), r().createElement(f(), {
|
|
798
768
|
outerId: this.containerId,
|
|
@@ -815,10 +785,10 @@
|
|
|
815
785
|
} ]);
|
|
816
786
|
return n;
|
|
817
787
|
}(n.Component);
|
|
818
|
-
Se(
|
|
819
|
-
Se(
|
|
820
|
-
Se(
|
|
821
|
-
/* harmony default export */ const
|
|
788
|
+
Se(Ee, "propTypes", Ie);
|
|
789
|
+
Se(Ee, "defaultProps", je);
|
|
790
|
+
Se(Ee, "contextType", V);
|
|
791
|
+
/* harmony default export */ const _e = Ee;
|
|
822
792
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/index.ts
|
|
823
793
|
module.exports = t;
|
|
824
794
|
/******/})();
|