@splunk/react-ui 4.26.0 → 4.27.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 +195 -212
- package/CHANGELOG.md +26 -3
- package/CollapsiblePanel.js +554 -325
- package/Color.js +3 -1
- package/ControlGroup.js +1 -0
- package/MIGRATION.mdx +30 -0
- package/Modal.js +15 -6
- package/Table.js +898 -866
- package/Text.js +30 -40
- package/TextArea.js +152 -236
- package/package.json +4 -2
- package/types/src/Accordion/Accordion.d.ts +2 -2
- package/types/src/Accordion/AccordionContext.d.ts +2 -3
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +49 -15
- package/types/src/CollapsiblePanel/SingleOpenPanelGroup.d.ts +62 -0
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +9 -0
- package/types/src/CollapsiblePanel/docs/examples/MultiControlled.d.ts +2 -2
- package/types/src/CollapsiblePanel/docs/examples/SingleOpenPanelGroupControlled.d.ts +2 -0
- package/types/src/CollapsiblePanel/docs/examples/SingleOpenPanelGroupUncontrolled.d.ts +2 -0
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +7 -5
- package/types/src/Table/Cell.d.ts +3 -1
- package/types/src/Table/Head.d.ts +2 -2
- package/types/src/Table/HeadCell.d.ts +2 -0
- package/types/src/Table/Row.d.ts +4 -2
- package/types/src/Table/Table.d.ts +1 -1
- package/types/src/Table/Toggle.d.ts +4 -4
- package/types/src/fixtures/text.d.ts +1 -0
- package/types/src/CollapsiblePanel/docs/examples/prisma/BasicControlled.d.ts +0 -2
- package/types/src/CollapsiblePanel/docs/examples/prisma/BasicUncontrolled.d.ts +0 -2
- package/types/src/CollapsiblePanel/docs/examples/prisma/Content.d.ts +0 -1
- package/types/src/CollapsiblePanel/docs/examples/prisma/MultiControlled.d.ts +0 -2
- package/types/src/CollapsiblePanel/docs/examples/prisma/MultiUncontrolled.d.ts +0 -2
package/CollapsiblePanel.js
CHANGED
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
11
|
/******/ e.n = t => {
|
|
12
|
-
/******/ var
|
|
12
|
+
/******/ var n = t && t.__esModule ?
|
|
13
13
|
/******/ () => t["default"]
|
|
14
14
|
/******/ : () => t
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(n, {
|
|
17
|
+
a: n
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return n;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (t,
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(t,
|
|
26
|
+
/******/ e.d = (t, n) => {
|
|
27
|
+
/******/ for (var r in n) {
|
|
28
|
+
/******/ if (e.o(n, r) && !e.o(t, r)) {
|
|
29
|
+
/******/ Object.defineProperty(t, r, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: r
|
|
31
|
+
get: n[r]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -61,297 +61,479 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
|
|
64
|
+
SingleOpenPanelGroup: () => /* reexport */ se,
|
|
65
|
+
default: () => /* reexport */ we
|
|
65
66
|
});
|
|
66
67
|
// CONCATENATED MODULE: external "react"
|
|
67
|
-
const
|
|
68
|
-
var
|
|
69
|
-
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
-
const n = require("prop-types");
|
|
71
|
-
var i = e.n(n);
|
|
68
|
+
const n = require("react");
|
|
69
|
+
var r = e.n(n);
|
|
72
70
|
// CONCATENATED MODULE: external "lodash/has"
|
|
73
|
-
const
|
|
74
|
-
var
|
|
71
|
+
const o = require("lodash/has");
|
|
72
|
+
var a = e.n(o);
|
|
75
73
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
76
|
-
const
|
|
77
|
-
var
|
|
74
|
+
const i = require("lodash/keys");
|
|
75
|
+
var l = e.n(i);
|
|
78
76
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
79
|
-
const
|
|
80
|
-
var
|
|
81
|
-
// CONCATENATED MODULE: external "
|
|
82
|
-
const
|
|
77
|
+
const s = require("lodash/omit");
|
|
78
|
+
var c = e.n(s);
|
|
79
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
80
|
+
const p = require("prop-types");
|
|
81
|
+
var u = e.n(p);
|
|
83
82
|
// CONCATENATED MODULE: external "@splunk/react-ui/TransitionOpen"
|
|
84
83
|
const f = require("@splunk/react-ui/TransitionOpen");
|
|
85
|
-
var
|
|
86
|
-
// CONCATENATED MODULE: external "
|
|
87
|
-
const
|
|
84
|
+
var d = e.n(f);
|
|
85
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
86
|
+
const b = require("@splunk/ui-utils/id");
|
|
87
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
88
|
+
const v = require("@splunk/react-ui/usePrevious");
|
|
88
89
|
var m = e.n(v);
|
|
90
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
91
|
+
const y = require("styled-components");
|
|
92
|
+
var h = e.n(y);
|
|
89
93
|
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
90
|
-
const
|
|
91
|
-
var y = e.n(h);
|
|
92
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
93
|
-
const g = require("@splunk/react-ui/Clickable");
|
|
94
|
+
const g = require("@splunk/react-ui/Box");
|
|
94
95
|
var k = e.n(g);
|
|
96
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
|
|
97
|
+
const C = require("@splunk/react-ui/ButtonSimple");
|
|
98
|
+
var x = e.n(C);
|
|
99
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
100
|
+
const S = require("@splunk/react-ui/Clickable");
|
|
101
|
+
var O = e.n(S);
|
|
95
102
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
96
|
-
const
|
|
103
|
+
const I = require("@splunk/themes");
|
|
104
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
|
|
105
|
+
const P = require("@splunk/react-icons/ChevronRight");
|
|
106
|
+
var w = e.n(P);
|
|
107
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
108
|
+
const j = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
109
|
+
var E = e.n(j);
|
|
110
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
111
|
+
const _ = require("@splunk/ui-utils/i18n");
|
|
112
|
+
// CONCATENATED MODULE: ./src/CollapsiblePanel/icons/ExpandPanel.tsx
|
|
113
|
+
var q = {
|
|
114
|
+
className: u().string,
|
|
115
|
+
open: u().bool
|
|
116
|
+
};
|
|
117
|
+
var R = function e(t) {
|
|
118
|
+
var n = t.className, o = t.open;
|
|
119
|
+
var a = (0, I.useSplunkTheme)(), i = a.isEnterprise;
|
|
120
|
+
var l = o ? (0, _._)("Panel is open") : (0, _._)("Panel is closed");
|
|
121
|
+
return i ? r().createElement(E(), {
|
|
122
|
+
className: n,
|
|
123
|
+
hideDefaultTooltip: true,
|
|
124
|
+
screenReaderText: l
|
|
125
|
+
}) : r().createElement(w(), {
|
|
126
|
+
"aria-label": l,
|
|
127
|
+
className: n
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
R.propTypes = q;
|
|
131
|
+
/* harmony default export */ const A = R;
|
|
97
132
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanelStyles.ts
|
|
98
|
-
var
|
|
133
|
+
var T = h()(k()).withConfig({
|
|
99
134
|
displayName: "CollapsiblePanelStyles__StyledBox",
|
|
100
135
|
componentId: "sc-1phikbp-0"
|
|
101
|
-
})([ "display:flex;flex-direction:column;min-height:", ";", ";& + &{margin-top:", ";}" ], (0,
|
|
102
|
-
|
|
103
|
-
enterprise: (0,
|
|
136
|
+
})([ "display:flex;flex-direction:column;flex-shrink:1;min-height:", ";", ";& + &{margin-top:", ";}" ], (0,
|
|
137
|
+
I.pick)({
|
|
138
|
+
enterprise: (0, y.css)([ "calc(", " + 12px)" ], I.variables.lineHeight),
|
|
104
139
|
prisma: {
|
|
105
140
|
comfortable: "56px",
|
|
106
141
|
compact: "48px"
|
|
107
142
|
}
|
|
108
|
-
}), (0,
|
|
109
|
-
prisma: (0,
|
|
110
|
-
}), (0,
|
|
143
|
+
}), (0, I.pick)({
|
|
144
|
+
prisma: (0, y.css)([ "background-color:", ";" ], I.variables.backgroundColorSection)
|
|
145
|
+
}), (0, I.pick)({
|
|
111
146
|
enterprise: "2px",
|
|
112
147
|
prisma: "1px"
|
|
113
148
|
}));
|
|
114
|
-
var
|
|
115
|
-
displayName: "
|
|
149
|
+
var D = h()(k()).withConfig({
|
|
150
|
+
displayName: "CollapsiblePanelStyles__StyledSingleOpenPanelGroupBox",
|
|
116
151
|
componentId: "sc-1phikbp-1"
|
|
117
|
-
})([ "
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}), (0, C.pick)({
|
|
121
|
-
enterprise: "300ms",
|
|
122
|
-
prisma: "200ms"
|
|
123
|
-
}), (0, C.pick)({
|
|
124
|
-
prisma: (0, v.css)([ "color:", ";display:flex;top:", ";[disabled] > &{color:inherit;}" ], C.variables.contentColorDefault, (0,
|
|
125
|
-
C.pick)({
|
|
126
|
-
comfortable: "20px",
|
|
127
|
-
compact: "16px"
|
|
128
|
-
}))
|
|
152
|
+
})([ "", ";flex-direction:column;margin-bottom:0;", "" ], I.mixins.reset("flex"), (0,
|
|
153
|
+
I.pick)({
|
|
154
|
+
enterprise: (0, y.css)([ "background:", ";" ], I.variables.backgroundColor)
|
|
129
155
|
}));
|
|
130
|
-
|
|
131
|
-
|
|
156
|
+
/*
|
|
157
|
+
these styles are consistent for both regular and titleWithActions, but applied to different elements
|
|
158
|
+
* in regular mode, they're on the SVG's span wrapper
|
|
159
|
+
* in titleWithActionsMode, they're on the button
|
|
160
|
+
applying them directly to the icon wrapper doesn't work because Enterprise has 1px border around the button
|
|
161
|
+
*/ var N = (0, y.css)([ "min-width:", ";" ], (0, I.pick)({
|
|
162
|
+
enterprise: "20px",
|
|
163
|
+
prisma: "35px"
|
|
164
|
+
}));
|
|
165
|
+
var W = h().span.withConfig({
|
|
166
|
+
displayName: "CollapsiblePanelStyles__StyledIconWrapper",
|
|
132
167
|
componentId: "sc-1phikbp-2"
|
|
133
|
-
})([ "
|
|
134
|
-
|
|
135
|
-
|
|
168
|
+
})([ "display:inline-block;flex:0 auto;", "" ], N);
|
|
169
|
+
var B = h().div.withConfig({
|
|
170
|
+
displayName: "CollapsiblePanelStyles__StyledTitleWithActions",
|
|
171
|
+
componentId: "sc-1phikbp-3"
|
|
172
|
+
})([ "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,
|
|
173
|
+
I.pick)({
|
|
174
|
+
enterprise: (0, y.css)([ "", " ", " ", " ", "" ], I.variables.spacingXSmall, I.variables.spacingSmall, I.variables.spacingXSmall, I.variables.spacingXSmall),
|
|
136
175
|
prisma: {
|
|
137
|
-
comfortable: "8px 10px 8px
|
|
138
|
-
compact: "8px 10px 8px
|
|
176
|
+
comfortable: "8px 10px 8px 11px",
|
|
177
|
+
compact: "8px 10px 8px 11px"
|
|
139
178
|
}
|
|
140
|
-
}), (0,
|
|
141
|
-
enterprise:
|
|
142
|
-
prisma:
|
|
143
|
-
}), (0,
|
|
144
|
-
prisma: (0,
|
|
179
|
+
}), (0, I.pick)({
|
|
180
|
+
enterprise: I.variables.textColor,
|
|
181
|
+
prisma: I.variables.contentColorActive
|
|
182
|
+
}), (0, I.pick)({
|
|
183
|
+
prisma: (0, y.css)([ "background-color:", ";" ], I.variables.interactiveColorBackground),
|
|
145
184
|
enterprise: {
|
|
146
|
-
dark: (0,
|
|
147
|
-
light: (0,
|
|
185
|
+
dark: (0, y.css)([ "background-color:", ";" ], I.variables.gray45),
|
|
186
|
+
light: (0, y.css)([ "background-color:", ";" ], I.variables.gray96)
|
|
148
187
|
}
|
|
149
188
|
}), (function(e) {
|
|
150
189
|
var t = e.$disabled;
|
|
151
|
-
return t && (0,
|
|
152
|
-
enterprise:
|
|
153
|
-
prisma:
|
|
190
|
+
return t && (0, y.css)([ "cursor:default;color:", ";" ], (0, I.pick)({
|
|
191
|
+
enterprise: I.variables.contentColorDefault,
|
|
192
|
+
prisma: I.variables.contentColorDisabled
|
|
154
193
|
}));
|
|
155
194
|
}));
|
|
156
|
-
var
|
|
157
|
-
displayName: "
|
|
158
|
-
componentId: "sc-1phikbp-3"
|
|
159
|
-
})([ "position:absolute;left:", ";padding:", ";top:8px;& > svg{transition:transform ", ";}", ";", " &:focus:not([disabled]),&:active:not([disabled]){color:", ";box-shadow:", ";}&:hover:not([disabled]){color:", ";background-color:", ";}" ], (0,
|
|
160
|
-
C.pick)({
|
|
161
|
-
enterprise: "4px",
|
|
162
|
-
prisma: "8px"
|
|
163
|
-
}), (0, C.pick)({
|
|
164
|
-
enterprise: {
|
|
165
|
-
comfortable: "2px 8px",
|
|
166
|
-
compact: "0px 8px"
|
|
167
|
-
},
|
|
168
|
-
prisma: {
|
|
169
|
-
comfortable: "14px",
|
|
170
|
-
compact: "8px"
|
|
171
|
-
}
|
|
172
|
-
}), (0, C.pick)({
|
|
173
|
-
enterprise: "300ms",
|
|
174
|
-
prisma: "200ms"
|
|
175
|
-
}), (0, C.pick)({
|
|
176
|
-
prisma: (0, v.css)([ "color:", ";display:flex;[disabled] > &{color:inherit;}" ], C.variables.contentColorDefault)
|
|
177
|
-
}), (0, C.pickVariant)("$open", {
|
|
178
|
-
true: (0, v.css)([ "& > svg{transform:rotate(90deg);}" ])
|
|
179
|
-
}), (0, C.pick)({
|
|
180
|
-
enterprise: C.variables.textColor,
|
|
181
|
-
prisma: C.variables.contentColorActive
|
|
182
|
-
}), C.variables.focusShadowInset, (0, C.pick)({
|
|
183
|
-
enterprise: C.variables.textColor,
|
|
184
|
-
prisma: C.variables.contentColorActive
|
|
185
|
-
}), (0, C.pick)({
|
|
186
|
-
enterprise: {
|
|
187
|
-
light: C.variables.gray92,
|
|
188
|
-
dark: C.variables.gray30
|
|
189
|
-
},
|
|
190
|
-
prisma: C.mixins.overlayColors(C.variables.interactiveColorBackground, C.variables.interactiveColorOverlayHover)
|
|
191
|
-
}));
|
|
192
|
-
var P = m()(k()).withConfig({
|
|
193
|
-
displayName: "CollapsiblePanelStyles__StyledTitleClickable",
|
|
195
|
+
var $ = h()(x()).withConfig({
|
|
196
|
+
displayName: "CollapsiblePanelStyles__StyledToggleButton",
|
|
194
197
|
componentId: "sc-1phikbp-4"
|
|
195
|
-
})([ "
|
|
196
|
-
|
|
197
|
-
|
|
198
|
+
})([ "flex:0 auto;padding:0;", "" ], N);
|
|
199
|
+
var M = h()(O()).withConfig({
|
|
200
|
+
displayName: "CollapsiblePanelStyles__StyledTitleClickable",
|
|
201
|
+
componentId: "sc-1phikbp-5"
|
|
202
|
+
})([ "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:", ";}&:hover:not([disabled]){color:", ";background-color:", ";}" ], (0,
|
|
203
|
+
I.pick)({
|
|
204
|
+
enterprise: "6px 30px 6px 5px",
|
|
198
205
|
prisma: {
|
|
199
|
-
comfortable: "18px 20px 18px
|
|
200
|
-
compact: "14px 20px 14px
|
|
206
|
+
comfortable: "18px 20px 18px 11px",
|
|
207
|
+
compact: "14px 20px 14px 11px"
|
|
201
208
|
}
|
|
202
|
-
}), (0,
|
|
203
|
-
enterprise:
|
|
204
|
-
prisma:
|
|
205
|
-
}), (0,
|
|
206
|
-
prisma: (0,
|
|
207
|
-
}), (0,
|
|
208
|
-
true: (0, v.css)([ "", "{transform:rotate(90deg);}" ],
|
|
209
|
-
/* sc-sel */
|
|
210
|
-
O),
|
|
209
|
+
}), (0, I.pick)({
|
|
210
|
+
enterprise: I.variables.textColor,
|
|
211
|
+
prisma: I.variables.contentColorActive
|
|
212
|
+
}), (0, I.pick)({
|
|
213
|
+
prisma: (0, y.css)([ "background-color:", ";" ], I.variables.interactiveColorBackground)
|
|
214
|
+
}), (0, I.pickVariant)("$open", {
|
|
211
215
|
false: {
|
|
212
216
|
enterprise: {
|
|
213
|
-
dark: (0,
|
|
214
|
-
light: (0,
|
|
217
|
+
dark: (0, y.css)([ "background-color:", ";" ], I.variables.gray45),
|
|
218
|
+
light: (0, y.css)([ "background-color:", ";" ], I.variables.gray96)
|
|
215
219
|
}
|
|
216
220
|
}
|
|
217
|
-
}), (0,
|
|
218
|
-
enterprise:
|
|
219
|
-
prisma:
|
|
220
|
-
}), (0,
|
|
221
|
-
enterprise:
|
|
222
|
-
prisma:
|
|
223
|
-
}),
|
|
224
|
-
enterprise:
|
|
225
|
-
prisma:
|
|
226
|
-
}), (0,
|
|
221
|
+
}), (0, I.pick)({
|
|
222
|
+
enterprise: I.variables.contentColorDefault,
|
|
223
|
+
prisma: I.variables.contentColorDisabled
|
|
224
|
+
}), (0, I.pick)({
|
|
225
|
+
enterprise: I.variables.textColor,
|
|
226
|
+
prisma: I.variables.contentColorActive
|
|
227
|
+
}), I.variables.focusShadowInset, (0, I.pick)({
|
|
228
|
+
enterprise: I.variables.textColor,
|
|
229
|
+
prisma: I.variables.contentColorActive
|
|
230
|
+
}), (0, I.pick)({
|
|
227
231
|
enterprise: {
|
|
228
|
-
light:
|
|
229
|
-
dark:
|
|
232
|
+
light: I.variables.gray92,
|
|
233
|
+
dark: I.variables.gray30
|
|
230
234
|
},
|
|
231
|
-
prisma:
|
|
235
|
+
prisma: I.mixins.overlayColors(I.variables.interactiveColorBackground, I.variables.interactiveColorOverlayHover)
|
|
232
236
|
}));
|
|
233
|
-
var
|
|
237
|
+
var H = h().span.withConfig({
|
|
234
238
|
displayName: "CollapsiblePanelStyles__StyledHeadingContent",
|
|
235
|
-
componentId: "sc-1phikbp-
|
|
236
|
-
})([ "display:flex;justify-content:space-between;", " ", "" ], (0,
|
|
237
|
-
|
|
239
|
+
componentId: "sc-1phikbp-6"
|
|
240
|
+
})([ "display:flex;justify-content:space-between;margin-left:", ";flex:1 1 auto;", " ", "" ], (0,
|
|
241
|
+
I.pick)({
|
|
242
|
+
enterprise: "5px",
|
|
243
|
+
prisma: "6px"
|
|
244
|
+
}), (0, I.pick)({
|
|
245
|
+
prisma: (0, y.css)([ "font-weight:", ";" ], I.variables.fontWeightSemiBold)
|
|
238
246
|
}), (function(e) {
|
|
239
247
|
var t = e.$titleWithActions;
|
|
240
|
-
return t && (0,
|
|
248
|
+
return t && (0, y.css)([ "min-height:", ";" ], (0, I.pick)({
|
|
241
249
|
prisma: {
|
|
242
250
|
comfortable: "40px",
|
|
243
251
|
compact: "32px"
|
|
244
252
|
}
|
|
245
253
|
}));
|
|
246
254
|
}));
|
|
247
|
-
var
|
|
255
|
+
var L = h().span.withConfig({
|
|
248
256
|
displayName: "CollapsiblePanelStyles__StyledDescription",
|
|
249
|
-
componentId: "sc-1phikbp-
|
|
250
|
-
})([ "font-size:", ";margin-left:", ";" ],
|
|
251
|
-
enterprise:
|
|
252
|
-
prisma:
|
|
257
|
+
componentId: "sc-1phikbp-7"
|
|
258
|
+
})([ "font-size:", ";margin-left:", ";" ], I.variables.fontSizeSmall, (0, I.pick)({
|
|
259
|
+
enterprise: I.variables.spacingHalf,
|
|
260
|
+
prisma: I.variables.spacingLarge
|
|
253
261
|
}));
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
262
|
+
var G = h().div.withConfig({
|
|
263
|
+
displayName: "CollapsiblePanelStyles__StyledInsetWrapper",
|
|
264
|
+
componentId: "sc-1phikbp-8"
|
|
265
|
+
})([ "", ";padding:", ";" ], I.mixins.reset("block"), (0, I.pickVariant)("$inset", {
|
|
266
|
+
true: (0, I.pick)({
|
|
267
|
+
enterprise: {
|
|
268
|
+
compact: I.variables.spacingQuarter,
|
|
269
|
+
comfortable: I.variables.spacingHalf
|
|
270
|
+
},
|
|
271
|
+
prisma: {
|
|
272
|
+
compact: I.variables.spacingMedium,
|
|
273
|
+
comfortable: I.variables.spacingXLarge
|
|
274
|
+
}
|
|
275
|
+
}),
|
|
276
|
+
false: 0
|
|
277
|
+
}));
|
|
278
|
+
var U = h()(A).withConfig({
|
|
279
|
+
displayName: "CollapsiblePanelStyles__StyledExpandPanelIcon",
|
|
280
|
+
componentId: "sc-1phikbp-9"
|
|
281
|
+
})([ "transition:transform ", ";", ";", " width:100%;vertical-align:", ";" ], (0,
|
|
282
|
+
I.pick)({
|
|
283
|
+
enterprise: "300ms",
|
|
284
|
+
prisma: "200ms"
|
|
285
|
+
}), (0, I.pick)({
|
|
286
|
+
prisma: (0, y.css)([ "color:", ";[disabled] &{color:inherit;}" ], I.variables.contentColorDefault)
|
|
287
|
+
}), (function(e) {
|
|
288
|
+
var t = e.open;
|
|
289
|
+
return t && (0, y.css)([ "transform:rotate(90deg);" ]);
|
|
290
|
+
}), (0, I.pick)({
|
|
291
|
+
enterprise: "baseline",
|
|
292
|
+
prisma: "text-bottom"
|
|
293
|
+
}));
|
|
294
|
+
// CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroupContext.tsx
|
|
295
|
+
var X = (0, n.createContext)({});
|
|
296
|
+
/* harmony default export */ const V = X;
|
|
297
|
+
// CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroup.tsx
|
|
298
|
+
function z() {
|
|
299
|
+
z = Object.assign || function(e) {
|
|
300
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
301
|
+
var n = arguments[t];
|
|
302
|
+
for (var r in n) {
|
|
303
|
+
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
304
|
+
e[r] = n[r];
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return e;
|
|
309
|
+
};
|
|
310
|
+
return z.apply(this, arguments);
|
|
311
|
+
}
|
|
312
|
+
function Q(e) {
|
|
313
|
+
return K(e) || J(e) || ee(e) || F();
|
|
314
|
+
}
|
|
315
|
+
function F() {
|
|
316
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
317
|
+
}
|
|
318
|
+
function J(e) {
|
|
319
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
320
|
+
}
|
|
321
|
+
function K(e) {
|
|
322
|
+
if (Array.isArray(e)) return te(e);
|
|
323
|
+
}
|
|
324
|
+
function Y(e, t) {
|
|
325
|
+
return re(e) || ne(e, t) || ee(e, t) || Z();
|
|
326
|
+
}
|
|
327
|
+
function Z() {
|
|
328
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
329
|
+
}
|
|
330
|
+
function ee(e, t) {
|
|
331
|
+
if (!e) return;
|
|
332
|
+
if (typeof e === "string") return te(e, t);
|
|
333
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
334
|
+
if (n === "Object" && e.constructor) n = e.constructor.name;
|
|
335
|
+
if (n === "Map" || n === "Set") return Array.from(e);
|
|
336
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return te(e, t);
|
|
337
|
+
}
|
|
338
|
+
function te(e, t) {
|
|
339
|
+
if (t == null || t > e.length) t = e.length;
|
|
340
|
+
for (var n = 0, r = new Array(t); n < t; n++) {
|
|
341
|
+
r[n] = e[n];
|
|
342
|
+
}
|
|
343
|
+
return r;
|
|
344
|
+
}
|
|
345
|
+
function ne(e, t) {
|
|
346
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
|
|
347
|
+
var n = [];
|
|
348
|
+
var r = true;
|
|
349
|
+
var o = false;
|
|
350
|
+
var a = undefined;
|
|
351
|
+
try {
|
|
352
|
+
for (var i = e[Symbol.iterator](), l; !(r = (l = i.next()).done); r = true) {
|
|
353
|
+
n.push(l.value);
|
|
354
|
+
if (t && n.length === t) break;
|
|
355
|
+
}
|
|
356
|
+
} catch (e) {
|
|
357
|
+
o = true;
|
|
358
|
+
a = e;
|
|
359
|
+
} finally {
|
|
360
|
+
try {
|
|
361
|
+
if (!r && i["return"] != null) i["return"]();
|
|
362
|
+
} finally {
|
|
363
|
+
if (o) throw a;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return n;
|
|
367
|
+
}
|
|
368
|
+
function re(e) {
|
|
369
|
+
if (Array.isArray(e)) return e;
|
|
370
|
+
}
|
|
371
|
+
function oe(e, t) {
|
|
372
|
+
if (e == null) return {};
|
|
373
|
+
var n = ae(e, t);
|
|
374
|
+
var r, o;
|
|
375
|
+
if (Object.getOwnPropertySymbols) {
|
|
376
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
377
|
+
for (o = 0; o < a.length; o++) {
|
|
378
|
+
r = a[o];
|
|
379
|
+
if (t.indexOf(r) >= 0) continue;
|
|
380
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
|
|
381
|
+
n[r] = e[r];
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return n;
|
|
385
|
+
}
|
|
386
|
+
function ae(e, t) {
|
|
387
|
+
if (e == null) return {};
|
|
388
|
+
var n = {};
|
|
389
|
+
var r = Object.keys(e);
|
|
390
|
+
var o, a;
|
|
391
|
+
for (a = 0; a < r.length; a++) {
|
|
392
|
+
o = r[a];
|
|
393
|
+
if (t.indexOf(o) >= 0) continue;
|
|
394
|
+
n[o] = e[o];
|
|
395
|
+
}
|
|
396
|
+
return n;
|
|
397
|
+
}
|
|
398
|
+
/** @public */ var ie = {
|
|
399
|
+
children: u().node,
|
|
400
|
+
defaultOpenPanelId: u().any,
|
|
401
|
+
elementRef: u().oneOfType([ u().func, u().object ]),
|
|
402
|
+
inset: u().bool,
|
|
403
|
+
onChange: u().func,
|
|
404
|
+
openPanelId: u().any
|
|
276
405
|
};
|
|
277
|
-
|
|
278
|
-
|
|
406
|
+
function le(e) {
|
|
407
|
+
// @docs-props-type SingleOpenPanelGroupPropsBase
|
|
408
|
+
var t = e.children, o = e.defaultOpenPanelId, i = e.elementRef, l = e.inset, s = l === void 0 ? false : l, p = e.onChange, u = e.openPanelId, f = oe(e, [ "children", "defaultOpenPanelId", "elementRef", "inset", "onChange", "openPanelId" ]);
|
|
409
|
+
var d = a()(e, "openPanelId");
|
|
410
|
+
var b = m()(o);
|
|
411
|
+
var v = !d ? o : undefined;
|
|
412
|
+
var y = (0, n.useState)(v), h = Y(y, 2), g = h[0], k = h[1];
|
|
413
|
+
var C = function e() {
|
|
414
|
+
var t = d ? u : g;
|
|
415
|
+
return t;
|
|
416
|
+
};
|
|
417
|
+
var x = (0, n.useCallback)((function(e, t) {
|
|
418
|
+
var n = t.panelId, r = t.reason;
|
|
419
|
+
var o = C();
|
|
420
|
+
var a = o === n ? null : n;
|
|
421
|
+
if (!d) {
|
|
422
|
+
k(a);
|
|
423
|
+
}
|
|
424
|
+
p === null || p === void 0 ? void 0 : p(e, {
|
|
425
|
+
openPanelId: a,
|
|
426
|
+
reason: r
|
|
427
|
+
});
|
|
428
|
+
}), [ u, d, g, C, p ]);
|
|
429
|
+
(0, n.useEffect)((function() {
|
|
430
|
+
if (false) {}
|
|
431
|
+
// In this functional component, we want the dependencies to be [], but when we do that
|
|
432
|
+
// we get a linting error.
|
|
433
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
434
|
+
}), []);
|
|
435
|
+
(0, n.useEffect)((function() {
|
|
436
|
+
if (false) {}
|
|
437
|
+
}), [ b, d ]);
|
|
438
|
+
(0, n.useEffect)((function() {
|
|
439
|
+
if (false) {}
|
|
440
|
+
}), [ b, o ]);
|
|
441
|
+
var S = n.Children.toArray(t).filter(n.isValidElement);
|
|
442
|
+
// remove false, null, 0, etc
|
|
443
|
+
var O = (0, n.useMemo)((function() {
|
|
444
|
+
return {
|
|
445
|
+
onChange: x,
|
|
446
|
+
openPanelId: d ? u : g,
|
|
447
|
+
inset: s
|
|
448
|
+
};
|
|
449
|
+
}), [ x, d, s, u, g ]);
|
|
450
|
+
|
|
451
|
+
return r().createElement(D, z({
|
|
452
|
+
"data-test": "single-open-panel-group",
|
|
453
|
+
"data-test-open-panel-id": u,
|
|
454
|
+
elementRef: i
|
|
455
|
+
}, c().apply(void 0, [ f ].concat(Q(Object.keys(ie))))), r().createElement(V.Provider, {
|
|
456
|
+
value: O
|
|
457
|
+
}, S));
|
|
458
|
+
}
|
|
459
|
+
le.propTypes = ie;
|
|
460
|
+
/* harmony default export */ const se = le;
|
|
279
461
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanel.tsx
|
|
280
|
-
function
|
|
462
|
+
function ce(e) {
|
|
281
463
|
"@babel/helpers - typeof";
|
|
282
464
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
283
|
-
|
|
465
|
+
ce = function e(t) {
|
|
284
466
|
return typeof t;
|
|
285
467
|
};
|
|
286
468
|
} else {
|
|
287
|
-
|
|
469
|
+
ce = function e(t) {
|
|
288
470
|
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
289
471
|
};
|
|
290
472
|
}
|
|
291
|
-
return
|
|
473
|
+
return ce(e);
|
|
292
474
|
}
|
|
293
|
-
function
|
|
294
|
-
|
|
475
|
+
function pe() {
|
|
476
|
+
pe = Object.assign || function(e) {
|
|
295
477
|
for (var t = 1; t < arguments.length; t++) {
|
|
296
|
-
var
|
|
297
|
-
for (var
|
|
298
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
299
|
-
e[
|
|
478
|
+
var n = arguments[t];
|
|
479
|
+
for (var r in n) {
|
|
480
|
+
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
481
|
+
e[r] = n[r];
|
|
300
482
|
}
|
|
301
483
|
}
|
|
302
484
|
}
|
|
303
485
|
return e;
|
|
304
486
|
};
|
|
305
|
-
return
|
|
487
|
+
return pe.apply(this, arguments);
|
|
306
488
|
}
|
|
307
|
-
function
|
|
308
|
-
var
|
|
489
|
+
function ue(e, t) {
|
|
490
|
+
var n = Object.keys(e);
|
|
309
491
|
if (Object.getOwnPropertySymbols) {
|
|
310
|
-
var
|
|
311
|
-
if (t)
|
|
492
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
493
|
+
if (t) r = r.filter((function(t) {
|
|
312
494
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
313
495
|
}));
|
|
314
|
-
|
|
496
|
+
n.push.apply(n, r);
|
|
315
497
|
}
|
|
316
|
-
return
|
|
498
|
+
return n;
|
|
317
499
|
}
|
|
318
|
-
function
|
|
500
|
+
function fe(e) {
|
|
319
501
|
for (var t = 1; t < arguments.length; t++) {
|
|
320
|
-
var
|
|
502
|
+
var n = arguments[t] != null ? arguments[t] : {};
|
|
321
503
|
if (t % 2) {
|
|
322
|
-
|
|
323
|
-
|
|
504
|
+
ue(Object(n), true).forEach((function(t) {
|
|
505
|
+
Se(e, t, n[t]);
|
|
324
506
|
}));
|
|
325
507
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
326
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
508
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
|
|
327
509
|
} else {
|
|
328
|
-
|
|
329
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(
|
|
510
|
+
ue(Object(n)).forEach((function(t) {
|
|
511
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
330
512
|
}));
|
|
331
513
|
}
|
|
332
514
|
}
|
|
333
515
|
return e;
|
|
334
516
|
}
|
|
335
|
-
function
|
|
517
|
+
function de(e, t) {
|
|
336
518
|
if (!(e instanceof t)) {
|
|
337
519
|
throw new TypeError("Cannot call a class as a function");
|
|
338
520
|
}
|
|
339
521
|
}
|
|
340
|
-
function
|
|
341
|
-
for (var
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
if ("value" in
|
|
346
|
-
Object.defineProperty(e,
|
|
522
|
+
function be(e, t) {
|
|
523
|
+
for (var n = 0; n < t.length; n++) {
|
|
524
|
+
var r = t[n];
|
|
525
|
+
r.enumerable = r.enumerable || false;
|
|
526
|
+
r.configurable = true;
|
|
527
|
+
if ("value" in r) r.writable = true;
|
|
528
|
+
Object.defineProperty(e, r.key, r);
|
|
347
529
|
}
|
|
348
530
|
}
|
|
349
|
-
function
|
|
350
|
-
if (t)
|
|
351
|
-
if (
|
|
531
|
+
function ve(e, t, n) {
|
|
532
|
+
if (t) be(e.prototype, t);
|
|
533
|
+
if (n) be(e, n);
|
|
352
534
|
return e;
|
|
353
535
|
}
|
|
354
|
-
function
|
|
536
|
+
function me(e, t) {
|
|
355
537
|
if (typeof t !== "function" && t !== null) {
|
|
356
538
|
throw new TypeError("Super expression must either be null or a function");
|
|
357
539
|
}
|
|
@@ -362,41 +544,41 @@
|
|
|
362
544
|
configurable: true
|
|
363
545
|
}
|
|
364
546
|
});
|
|
365
|
-
if (t)
|
|
547
|
+
if (t) ye(e, t);
|
|
366
548
|
}
|
|
367
|
-
function
|
|
368
|
-
|
|
369
|
-
t.__proto__ =
|
|
549
|
+
function ye(e, t) {
|
|
550
|
+
ye = Object.setPrototypeOf || function e(t, n) {
|
|
551
|
+
t.__proto__ = n;
|
|
370
552
|
return t;
|
|
371
553
|
};
|
|
372
|
-
return
|
|
554
|
+
return ye(e, t);
|
|
373
555
|
}
|
|
374
|
-
function
|
|
375
|
-
var t =
|
|
376
|
-
return function
|
|
377
|
-
var
|
|
556
|
+
function he(e) {
|
|
557
|
+
var t = Ce();
|
|
558
|
+
return function n() {
|
|
559
|
+
var r = xe(e), o;
|
|
378
560
|
if (t) {
|
|
379
|
-
var
|
|
380
|
-
|
|
561
|
+
var a = xe(this).constructor;
|
|
562
|
+
o = Reflect.construct(r, arguments, a);
|
|
381
563
|
} else {
|
|
382
|
-
|
|
564
|
+
o = r.apply(this, arguments);
|
|
383
565
|
}
|
|
384
|
-
return
|
|
566
|
+
return ge(this, o);
|
|
385
567
|
};
|
|
386
568
|
}
|
|
387
|
-
function
|
|
388
|
-
if (t && (
|
|
569
|
+
function ge(e, t) {
|
|
570
|
+
if (t && (ce(t) === "object" || typeof t === "function")) {
|
|
389
571
|
return t;
|
|
390
572
|
}
|
|
391
|
-
return
|
|
573
|
+
return ke(e);
|
|
392
574
|
}
|
|
393
|
-
function
|
|
575
|
+
function ke(e) {
|
|
394
576
|
if (e === void 0) {
|
|
395
577
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
396
578
|
}
|
|
397
579
|
return e;
|
|
398
580
|
}
|
|
399
|
-
function
|
|
581
|
+
function Ce() {
|
|
400
582
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
401
583
|
if (Reflect.construct.sham) return false;
|
|
402
584
|
if (typeof Proxy === "function") return true;
|
|
@@ -407,102 +589,135 @@
|
|
|
407
589
|
return false;
|
|
408
590
|
}
|
|
409
591
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
592
|
+
function xe(e) {
|
|
593
|
+
xe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
412
594
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
413
595
|
};
|
|
414
|
-
return
|
|
596
|
+
return xe(e);
|
|
415
597
|
}
|
|
416
|
-
function
|
|
598
|
+
function Se(e, t, n) {
|
|
417
599
|
if (t in e) {
|
|
418
600
|
Object.defineProperty(e, t, {
|
|
419
|
-
value:
|
|
601
|
+
value: n,
|
|
420
602
|
enumerable: true,
|
|
421
603
|
configurable: true,
|
|
422
604
|
writable: true
|
|
423
605
|
});
|
|
424
606
|
} else {
|
|
425
|
-
e[t] =
|
|
607
|
+
e[t] = n;
|
|
426
608
|
}
|
|
427
609
|
return e;
|
|
428
610
|
}
|
|
429
|
-
|
|
430
|
-
innerBodyStyles:
|
|
431
|
-
children:
|
|
432
|
-
defaultOpen:
|
|
433
|
-
description:
|
|
434
|
-
disabled:
|
|
435
|
-
elementRef:
|
|
436
|
-
headingLevel:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
611
|
+
var Oe = {
|
|
612
|
+
innerBodyStyles: u().object,
|
|
613
|
+
children: u().node,
|
|
614
|
+
defaultOpen: u().bool,
|
|
615
|
+
description: u().string,
|
|
616
|
+
disabled: u().bool,
|
|
617
|
+
elementRef: u().oneOfType([ u().func, u().object ]),
|
|
618
|
+
headingLevel: u().number,
|
|
619
|
+
inset: u().bool,
|
|
620
|
+
onRequestClose: u().func,
|
|
621
|
+
onRequestOpen: u().func,
|
|
622
|
+
onChange: u().func,
|
|
623
|
+
open: u().bool,
|
|
624
|
+
overflow: u().string,
|
|
625
|
+
panelId: u().any,
|
|
626
|
+
renderChildrenWhenCollapsed: u().bool,
|
|
627
|
+
title: u().node.isRequired,
|
|
628
|
+
titleWithActions: u().bool
|
|
445
629
|
};
|
|
446
|
-
var
|
|
630
|
+
var Ie = {
|
|
447
631
|
disabled: false,
|
|
448
632
|
overflow: "auto",
|
|
449
633
|
renderChildrenWhenCollapsed: false,
|
|
450
|
-
titleWithActions: false
|
|
634
|
+
titleWithActions: false,
|
|
635
|
+
inset: false
|
|
451
636
|
};
|
|
452
|
-
var
|
|
453
|
-
|
|
454
|
-
var t =
|
|
637
|
+
var Pe = function(e) {
|
|
638
|
+
me(n, e);
|
|
639
|
+
var t = he(n);
|
|
455
640
|
// @docs-props-type CollapsiblePanelPropsBase
|
|
456
|
-
function
|
|
457
|
-
var
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
var t =
|
|
465
|
-
|
|
641
|
+
function n(e) {
|
|
642
|
+
var r;
|
|
643
|
+
de(this, n);
|
|
644
|
+
r = t.call(this, e);
|
|
645
|
+
Se(ke(r), "controlledExternally", void 0);
|
|
646
|
+
Se(ke(r), "containerId", void 0);
|
|
647
|
+
Se(ke(r), "toggleId", void 0);
|
|
648
|
+
Se(ke(r), "handleRequestClose", (function(e) {
|
|
649
|
+
var t = r.props, n = t.panelId, o = t.onRequestClose;
|
|
650
|
+
o === null || o === void 0 ? void 0 : o({
|
|
466
651
|
event: e,
|
|
467
|
-
panelId:
|
|
652
|
+
panelId: n,
|
|
468
653
|
reason: "toggleClick"
|
|
469
654
|
});
|
|
470
|
-
|
|
655
|
+
r.setState(fe({
|
|
471
656
|
animating: true
|
|
472
|
-
}, !
|
|
657
|
+
}, !r.isControlled() ? {
|
|
473
658
|
open: false
|
|
474
659
|
} : {}));
|
|
475
660
|
}));
|
|
476
|
-
|
|
477
|
-
var t =
|
|
478
|
-
|
|
661
|
+
Se(ke(r), "handleRequestOpen", (function(e) {
|
|
662
|
+
var t = r.props, n = t.panelId, o = t.onRequestOpen;
|
|
663
|
+
o === null || o === void 0 ? void 0 : o({
|
|
479
664
|
event: e,
|
|
480
|
-
panelId:
|
|
665
|
+
panelId: n,
|
|
481
666
|
reason: "toggleClick"
|
|
482
667
|
});
|
|
483
|
-
|
|
668
|
+
r.setState(fe({
|
|
484
669
|
animating: true
|
|
485
|
-
}, !
|
|
670
|
+
}, !r.isControlled() ? {
|
|
486
671
|
open: true
|
|
487
672
|
} : {}));
|
|
488
673
|
}));
|
|
489
|
-
|
|
490
|
-
o.
|
|
674
|
+
Se(ke(r), "handleChange", (function(e) {
|
|
675
|
+
var t = r.props, n = t.panelId, o = t.open, a = t.onChange;
|
|
676
|
+
var i = r.isControlled() ? o : !r.state.open;
|
|
677
|
+
a === null || a === void 0 ? void 0 : a(e, {
|
|
678
|
+
panelId: n,
|
|
679
|
+
reason: "toggleClick"
|
|
680
|
+
});
|
|
681
|
+
if (!r.isControlled()) {
|
|
682
|
+
r.setState({
|
|
683
|
+
animating: true,
|
|
684
|
+
open: i
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
if (r.context.onChange) {
|
|
688
|
+
r.context.onChange(e, {
|
|
689
|
+
panelId: n,
|
|
690
|
+
reason: "toggleClick"
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
// Maintains backwards compatibility until the `handleRequestClose` and `handleRequestOpen` handlers are removed in SUI-5
|
|
694
|
+
var l = r.props.open ? r.handleRequestClose : r.handleRequestOpen;
|
|
695
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
696
|
+
l;
|
|
697
|
+
}));
|
|
698
|
+
Se(ke(r), "handleAnimationEnd", (function() {
|
|
699
|
+
r.setState({
|
|
491
700
|
animating: false
|
|
492
701
|
});
|
|
493
702
|
}));
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
animating: false
|
|
497
|
-
}, !o.isControlled() ? {
|
|
703
|
+
r.controlledExternally = a()(e, "open");
|
|
704
|
+
r.state = fe(fe({}, !r.isControlled() ? {
|
|
498
705
|
open: e.defaultOpen || false
|
|
499
|
-
} : undefined)
|
|
706
|
+
} : undefined), {}, {
|
|
707
|
+
animating: false
|
|
708
|
+
});
|
|
500
709
|
if (false) {}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
return
|
|
710
|
+
r.containerId = "container-".concat((0, b.createGUID)());
|
|
711
|
+
r.toggleId = "toggle-".concat((0, b.createGUID)());
|
|
712
|
+
return r;
|
|
504
713
|
}
|
|
505
|
-
|
|
714
|
+
// Only testing this in the scenario of a SingleOpenPanelGroup.
|
|
715
|
+
ve(n, [ {
|
|
716
|
+
key: "componentDidMount",
|
|
717
|
+
value: function e() {
|
|
718
|
+
if (false) {}
|
|
719
|
+
}
|
|
720
|
+
}, {
|
|
506
721
|
key: "componentDidUpdate",
|
|
507
722
|
value: function e(t) {
|
|
508
723
|
if (this.props.open !== t.open) {
|
|
@@ -514,7 +729,8 @@
|
|
|
514
729
|
if (false) {}
|
|
515
730
|
if (false) {}
|
|
516
731
|
}
|
|
517
|
-
|
|
732
|
+
// Using all three handlers: `handleRequestClose` and `handleRequestOpen` and `handleChange` to test interoperability and maintain backwards compatibility until the open/close handlers are removed in SUI-5
|
|
733
|
+
}, {
|
|
518
734
|
key: "isControlled",
|
|
519
735
|
value: function e() {
|
|
520
736
|
return this.controlledExternally;
|
|
@@ -522,70 +738,83 @@
|
|
|
522
738
|
}, {
|
|
523
739
|
key: "render",
|
|
524
740
|
value: function e() {
|
|
525
|
-
var t = this.props,
|
|
741
|
+
var t = this.props, o = t.innerBodyStyles, a = t.children, i = t.description, s = t.disabled, p = t.elementRef, u = t.headingLevel, f = t.overflow, b = t.renderChildrenWhenCollapsed, v = t.title, m = t.titleWithActions, y = t.inset;
|
|
526
742
|
var h = this.state.animating;
|
|
527
|
-
var
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
743
|
+
var g;
|
|
744
|
+
if (this.context.openPanelId !== undefined) {
|
|
745
|
+
// SingleOpenPanelGroup controlled & uncontrolled
|
|
746
|
+
/**
|
|
747
|
+
* SingleOpenPanelGroup already takes into account if it is controlled or not in determining openPanelId
|
|
748
|
+
* so this.context.openPanelId is used for both the controlled and uncontrolled case.
|
|
749
|
+
*/
|
|
750
|
+
var k = this.context.openPanelId === this.props.panelId;
|
|
751
|
+
g = k;
|
|
752
|
+
} else if (this.isControlled()) {
|
|
753
|
+
// CollapsiblePanel controlled
|
|
754
|
+
g = this.props.open;
|
|
755
|
+
} else {
|
|
756
|
+
// CollapsiblePanel uncontrolled
|
|
757
|
+
g = this.state.open;
|
|
758
|
+
}
|
|
759
|
+
var C = {
|
|
760
|
+
disabled: s,
|
|
761
|
+
onClick: this.handleChange,
|
|
537
762
|
id: this.toggleId,
|
|
538
763
|
"aria-controls": this.containerId,
|
|
539
|
-
"aria-expanded":
|
|
540
|
-
$open: !!
|
|
764
|
+
"aria-expanded": g,
|
|
765
|
+
$open: !!g,
|
|
541
766
|
"data-test": "toggle"
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
return r().createElement(T, pe({
|
|
770
|
+
"data-test": "collapsible-panel",
|
|
771
|
+
elementRef: p
|
|
772
|
+
}, c()(this.props, l()(n.propTypes))), m ? r().createElement(B, {
|
|
773
|
+
$disabled: s
|
|
774
|
+
}, r().createElement($, pe({}, C, {
|
|
775
|
+
appearance: "pill"
|
|
776
|
+
}), r().createElement(U, {
|
|
777
|
+
open: !!g
|
|
778
|
+
})), r().createElement(H, {
|
|
545
779
|
$titleWithActions: m,
|
|
546
780
|
"data-test": "title"
|
|
547
781
|
}, v)) :
|
|
548
782
|
|
|
549
783
|
/* Clickable component is not allowed to have role="heading" so it is wrapped with a span */
|
|
550
|
-
|
|
784
|
+
r().createElement("span", {
|
|
551
785
|
"data-test": "heading",
|
|
552
|
-
role:
|
|
553
|
-
"aria-level":
|
|
554
|
-
},
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
id: this.toggleId,
|
|
558
|
-
"aria-controls": this.containerId,
|
|
559
|
-
"aria-expanded": y,
|
|
560
|
-
$open: !!y,
|
|
561
|
-
"data-test": "toggle"
|
|
562
|
-
}, o().createElement(O, null, o().createElement(W, {
|
|
563
|
-
open: y
|
|
564
|
-
})), o().createElement(I, null, o().createElement("span", {
|
|
786
|
+
role: u ? "heading" : undefined,
|
|
787
|
+
"aria-level": u
|
|
788
|
+
}, r().createElement(M, C, r().createElement(W, null, r().createElement(U, {
|
|
789
|
+
open: !!g
|
|
790
|
+
})), r().createElement(H, null, r().createElement("span", {
|
|
565
791
|
"data-test": "title"
|
|
566
|
-
}, v),
|
|
792
|
+
}, v), i && r().createElement(L, {
|
|
567
793
|
"data-test": "description"
|
|
568
|
-
},
|
|
794
|
+
}, i)))), r().createElement(d(), {
|
|
569
795
|
outerId: this.containerId,
|
|
570
796
|
"aria-labelledby": this.toggleId,
|
|
571
797
|
"data-test": "body",
|
|
572
798
|
outerStyle: {
|
|
573
|
-
overflow: h ? "hidden" :
|
|
799
|
+
overflow: h ? "hidden" : f
|
|
574
800
|
},
|
|
575
|
-
innerStyle:
|
|
801
|
+
innerStyle: fe({
|
|
576
802
|
tableLayout: "fixed"
|
|
577
|
-
},
|
|
578
|
-
open:
|
|
803
|
+
}, o),
|
|
804
|
+
open: g,
|
|
579
805
|
onAnimationEnd: this.handleAnimationEnd,
|
|
580
|
-
renderChildrenWhenCollapsed:
|
|
581
|
-
},
|
|
806
|
+
renderChildrenWhenCollapsed: b
|
|
807
|
+
}, r().createElement(G, {
|
|
808
|
+
$inset: y
|
|
809
|
+
}, a)));
|
|
582
810
|
}
|
|
583
811
|
} ]);
|
|
584
|
-
return
|
|
585
|
-
}(
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
812
|
+
return n;
|
|
813
|
+
}(n.Component);
|
|
814
|
+
Se(Pe, "propTypes", Oe);
|
|
815
|
+
Se(Pe, "defaultProps", Ie);
|
|
816
|
+
Se(Pe, "contextType", V);
|
|
817
|
+
/* harmony default export */ const we = Pe;
|
|
589
818
|
// CONCATENATED MODULE: ./src/CollapsiblePanel/index.ts
|
|
590
819
|
module.exports = t;
|
|
591
820
|
/******/})();
|