@splunk/react-ui 4.21.0 → 4.22.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 +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +24 -3
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1807 -2084
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1068 -1068
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +903 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1104 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3564 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +634 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +479 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +756 -650
- package/Select.js +2446 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +680 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +741 -680
- package/TabLayout.js +406 -322
- package/Table.js +4974 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +7 -7
- package/types/src/Color/Color.d.ts +0 -1
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/RadioBar/RadioBar.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
- package/types/src/Select/docs/examples/Icons.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -0
- package/types/src/TabBar/Tab.d.ts +10 -1
- package/types/src/TabBar/TabBar.d.ts +4 -2
- package/types/src/Table/Head.d.ts +7 -3
- package/types/src/Table/Table.d.ts +3 -2
- package/types/src/Table/TableContext.d.ts +2 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/ControlGroup.js
CHANGED
|
@@ -1,293 +1,463 @@
|
|
|
1
|
-
/******/ (() => {
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(t);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(t, {
|
|
64
|
+
ControlGroupContext: () => /* reexport */ T,
|
|
65
|
+
default: () => /* reexport */ se
|
|
66
|
+
});
|
|
67
|
+
// CONCATENATED MODULE: external "react"
|
|
68
|
+
const r = require("react");
|
|
69
|
+
var n = e.n(r);
|
|
70
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
+
const o = require("prop-types");
|
|
72
|
+
var i = e.n(o);
|
|
73
|
+
// CONCATENATED MODULE: external "lodash/find"
|
|
74
|
+
const l = require("lodash/find");
|
|
75
|
+
var a = e.n(l);
|
|
76
|
+
// CONCATENATED MODULE: external "lodash/isFinite"
|
|
77
|
+
const s = require("lodash/isFinite");
|
|
78
|
+
var p = e.n(s);
|
|
79
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
80
|
+
const c = require("@splunk/themes");
|
|
81
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
82
|
+
const u = require("@splunk/ui-utils/id");
|
|
83
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
84
|
+
const f = require("@splunk/react-ui/Box");
|
|
85
|
+
var d = e.n(f);
|
|
86
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
87
|
+
const y = require("@splunk/react-ui/ScreenReaderContent");
|
|
88
|
+
var b = e.n(y);
|
|
89
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
90
|
+
const h = require("styled-components");
|
|
91
|
+
var m = e.n(h);
|
|
92
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
|
|
93
|
+
const v = require("@splunk/react-ui/Tooltip");
|
|
94
|
+
var g = e.n(v);
|
|
95
|
+
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroupStyles.ts
|
|
96
|
+
var O = m()(d()).withConfig({
|
|
97
|
+
displayName: "ControlGroupStyles__StyledBox",
|
|
98
|
+
componentId: "wjnyif-0"
|
|
99
|
+
})([ "", " ", " max-width:600px;margin-bottom:", ";", " color:", ";", "" ], c.mixins.reset("block"), c.mixins.clearfix(), (0,
|
|
100
|
+
c.pick)({
|
|
101
|
+
enterprise: (0, h.css)([ "calc(", " * 0.75)" ], c.variables.spacing),
|
|
102
|
+
prisma: {
|
|
103
|
+
comfortable: "16px",
|
|
104
|
+
compact: "12px"
|
|
105
|
+
}
|
|
106
|
+
}), (0, c.pick)({
|
|
107
|
+
prisma: {
|
|
108
|
+
comfortable: (0, h.css)([ "&:first-child{margin-top:", ";}&:last-child{margin-bottom:", ";}" ], c.variables.spacingMedium, c.variables.spacingMedium),
|
|
109
|
+
compact: (0, h.css)([ "&:first-child{margin-top:", ";}&:last-child{margin-bottom:", ";}" ], c.variables.spacingSmall, c.variables.spacingSmall)
|
|
110
|
+
}
|
|
111
|
+
}), (0, c.pick)({
|
|
112
|
+
enterprise: c.variables.textColor,
|
|
113
|
+
prisma: c.variables.contentColorMuted
|
|
114
|
+
}), (function(e) {
|
|
115
|
+
var t = e.$error;
|
|
116
|
+
return t && (0, h.css)([ "color:", ";" ], (0, c.pick)({
|
|
117
|
+
enterprise: {
|
|
118
|
+
light: c.variables.errorColorD10,
|
|
119
|
+
dark: c.variables.errorColorL20
|
|
120
|
+
},
|
|
121
|
+
prisma: c.variables.accentColorNegative
|
|
122
|
+
}));
|
|
123
|
+
}));
|
|
124
|
+
var x = m()(d()).withConfig({
|
|
125
|
+
displayName: "ControlGroupStyles__StyledControlsStackBox",
|
|
126
|
+
componentId: "wjnyif-1"
|
|
127
|
+
})([ "flex-direction:column;" ]);
|
|
128
|
+
var S = m().div.withConfig({
|
|
129
|
+
displayName: "ControlGroupStyles__StyledLabelWrapper",
|
|
130
|
+
componentId: "wjnyif-2"
|
|
131
|
+
})([ "display:inline-flex;align-items:center;", " ", "" ], (0, c.pick)({
|
|
132
|
+
enterprise: (0, h.css)([ "justify-content:flex-end;" ])
|
|
133
|
+
}), (function(e) {
|
|
134
|
+
var t = e.$labelPosition;
|
|
135
|
+
return t === "top" ? (0, h.css)([ "", "" ], (0, c.pick)({
|
|
136
|
+
prisma: (0, h.css)([ "height:24px;padding-bottom:", ";" ], c.variables.spacingXSmall)
|
|
137
|
+
})) : (0, h.css)([ "", "" ], (0, c.pick)({
|
|
138
|
+
prisma: (0, h.css)([ "min-height:", ";" ], c.variables.inputHeight)
|
|
139
|
+
}));
|
|
140
|
+
}));
|
|
141
|
+
var I = m()(S).withConfig({
|
|
142
|
+
displayName: "ControlGroupStyles__StyledLabelWrapperLeft",
|
|
143
|
+
componentId: "wjnyif-3"
|
|
144
|
+
})([ "float:left;" ]);
|
|
145
|
+
var C = m().label.withConfig({
|
|
146
|
+
displayName: "ControlGroupStyles__StyledLabel",
|
|
147
|
+
componentId: "wjnyif-4"
|
|
148
|
+
})([ "padding:", ";word-wrap:break-word;color:inherit;text-align:", ";" ], (0, c.pick)({
|
|
149
|
+
enterprise: {
|
|
150
|
+
comfortable: "6px 0",
|
|
151
|
+
compact: "4px 0"
|
|
152
|
+
}
|
|
153
|
+
}), (0, c.pick)({
|
|
154
|
+
enterprise: "right",
|
|
155
|
+
prisma: "left"
|
|
156
|
+
}));
|
|
157
|
+
var k = m()(g()).withConfig({
|
|
158
|
+
displayName: "ControlGroupStyles__StyledTooltip",
|
|
159
|
+
componentId: "wjnyif-5"
|
|
160
|
+
})([ "", "" ], (function(e) {
|
|
161
|
+
var t = e.$labelPosition;
|
|
162
|
+
return t === "top" && (0, h.css)([ "button{", "}" ], (0, c.pick)({
|
|
163
|
+
prisma: (0, h.css)([ "svg{width:20px;height:20px;}padding:4px;" ])
|
|
164
|
+
}));
|
|
165
|
+
}));
|
|
166
|
+
var w = m().div.withConfig({
|
|
167
|
+
displayName: "ControlGroupStyles__StyledHelp",
|
|
168
|
+
componentId: "wjnyif-6"
|
|
169
|
+
})([ "", ";font-size:", ";color:", ";margin-top:", ";", "" ], c.mixins.reset("block"), c.variables.fontSizeSmall, c.variables.contentColorMuted, (0,
|
|
170
|
+
c.pick)({
|
|
171
|
+
enterprise: "2px",
|
|
172
|
+
prisma: "4px"
|
|
173
|
+
}), (function(e) {
|
|
174
|
+
var t = e.$error;
|
|
175
|
+
return t && (0, h.css)([ "color:inherit;" ]);
|
|
176
|
+
}));
|
|
177
|
+
var j = m().div.withConfig({
|
|
178
|
+
displayName: "ControlGroupStyles__StyledErrorText",
|
|
179
|
+
componentId: "wjnyif-7"
|
|
180
|
+
})([ "", ";font-size:", ";[aria-invalid] > &{color:inherit;}", "" ], c.mixins.reset("block"), c.variables.fontSizeSmall, (function(e) {
|
|
181
|
+
var t = e.$help;
|
|
182
|
+
return !t && (0, h.css)([ "margin-top:", ";" ], (0, c.pick)({
|
|
183
|
+
enterprise: "2px",
|
|
184
|
+
prisma: "4px"
|
|
185
|
+
}));
|
|
186
|
+
}));
|
|
187
|
+
var P = m().span.withConfig({
|
|
188
|
+
displayName: "ControlGroupStyles__StyledAsterisk",
|
|
189
|
+
componentId: "wjnyif-8"
|
|
190
|
+
})([ "color:inherit;margin-right:2px;" ]);
|
|
191
|
+
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroupContext.tsx
|
|
192
|
+
/**
|
|
189
193
|
* A React context used to inform subcomponets of ControlGroup of parent component values.
|
|
190
194
|
* The context interface is `ControlGroupContextValue`.
|
|
191
195
|
* Defaults to `'{}'`.
|
|
192
196
|
* @public
|
|
193
197
|
*/
|
|
194
|
-
var
|
|
195
|
-
/* harmony default export */
|
|
196
|
-
|
|
197
|
-
function
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
function
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
|
|
198
|
+
var _ = n().createContext({});
|
|
199
|
+
/* harmony default export */ const T = _;
|
|
200
|
+
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx
|
|
201
|
+
function L(e) {
|
|
202
|
+
"@babel/helpers - typeof";
|
|
203
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
204
|
+
L = function e(t) {
|
|
205
|
+
return typeof t;
|
|
206
|
+
};
|
|
207
|
+
} else {
|
|
208
|
+
L = function e(t) {
|
|
209
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return L(e);
|
|
213
|
+
}
|
|
214
|
+
function E() {
|
|
215
|
+
E = Object.assign || function(e) {
|
|
216
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
217
|
+
var r = arguments[t];
|
|
218
|
+
for (var n in r) {
|
|
219
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
220
|
+
e[n] = r[n];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return e;
|
|
225
|
+
};
|
|
226
|
+
return E.apply(this, arguments);
|
|
227
|
+
}
|
|
228
|
+
function D(e, t) {
|
|
229
|
+
var r = Object.keys(e);
|
|
230
|
+
if (Object.getOwnPropertySymbols) {
|
|
231
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
232
|
+
if (t) n = n.filter((function(t) {
|
|
233
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
234
|
+
}));
|
|
235
|
+
r.push.apply(r, n);
|
|
236
|
+
}
|
|
237
|
+
return r;
|
|
238
|
+
}
|
|
239
|
+
function q(e) {
|
|
240
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
241
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
242
|
+
if (t % 2) {
|
|
243
|
+
D(Object(r), true).forEach((function(t) {
|
|
244
|
+
Z(e, t, r[t]);
|
|
245
|
+
}));
|
|
246
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
247
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
|
|
248
|
+
} else {
|
|
249
|
+
D(Object(r)).forEach((function(t) {
|
|
250
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
251
|
+
}));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return e;
|
|
255
|
+
}
|
|
256
|
+
function M(e, t) {
|
|
257
|
+
if (e == null) return {};
|
|
258
|
+
var r = V(e, t);
|
|
259
|
+
var n, o;
|
|
260
|
+
if (Object.getOwnPropertySymbols) {
|
|
261
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
262
|
+
for (o = 0; o < i.length; o++) {
|
|
263
|
+
n = i[o];
|
|
264
|
+
if (t.indexOf(n) >= 0) continue;
|
|
265
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
266
|
+
r[n] = e[n];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return r;
|
|
270
|
+
}
|
|
271
|
+
function V(e, t) {
|
|
272
|
+
if (e == null) return {};
|
|
273
|
+
var r = {};
|
|
274
|
+
var n = Object.keys(e);
|
|
275
|
+
var o, i;
|
|
276
|
+
for (i = 0; i < n.length; i++) {
|
|
277
|
+
o = n[i];
|
|
278
|
+
if (t.indexOf(o) >= 0) continue;
|
|
279
|
+
r[o] = e[o];
|
|
280
|
+
}
|
|
281
|
+
return r;
|
|
282
|
+
}
|
|
283
|
+
function $(e, t) {
|
|
284
|
+
return z(e) || N(e, t) || G(e, t) || A();
|
|
285
|
+
}
|
|
286
|
+
function A() {
|
|
287
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
288
|
+
}
|
|
289
|
+
function G(e, t) {
|
|
290
|
+
if (!e) return;
|
|
291
|
+
if (typeof e === "string") return B(e, t);
|
|
292
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
293
|
+
if (r === "Object" && e.constructor) r = e.constructor.name;
|
|
294
|
+
if (r === "Map" || r === "Set") return Array.from(e);
|
|
295
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return B(e, t);
|
|
296
|
+
}
|
|
297
|
+
function B(e, t) {
|
|
298
|
+
if (t == null || t > e.length) t = e.length;
|
|
299
|
+
for (var r = 0, n = new Array(t); r < t; r++) {
|
|
300
|
+
n[r] = e[r];
|
|
301
|
+
}
|
|
302
|
+
return n;
|
|
303
|
+
}
|
|
304
|
+
function N(e, t) {
|
|
305
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
|
|
306
|
+
var r = [];
|
|
307
|
+
var n = true;
|
|
308
|
+
var o = false;
|
|
309
|
+
var i = undefined;
|
|
310
|
+
try {
|
|
311
|
+
for (var l = e[Symbol.iterator](), a; !(n = (a = l.next()).done); n = true) {
|
|
312
|
+
r.push(a.value);
|
|
313
|
+
if (t && r.length === t) break;
|
|
314
|
+
}
|
|
315
|
+
} catch (e) {
|
|
316
|
+
o = true;
|
|
317
|
+
i = e;
|
|
318
|
+
} finally {
|
|
319
|
+
try {
|
|
320
|
+
if (!n && l["return"] != null) l["return"]();
|
|
321
|
+
} finally {
|
|
322
|
+
if (o) throw i;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return r;
|
|
326
|
+
}
|
|
327
|
+
function z(e) {
|
|
328
|
+
if (Array.isArray(e)) return e;
|
|
329
|
+
}
|
|
330
|
+
function R(e, t) {
|
|
331
|
+
if (!(e instanceof t)) {
|
|
332
|
+
throw new TypeError("Cannot call a class as a function");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function W(e, t) {
|
|
336
|
+
for (var r = 0; r < t.length; r++) {
|
|
337
|
+
var n = t[r];
|
|
338
|
+
n.enumerable = n.enumerable || false;
|
|
339
|
+
n.configurable = true;
|
|
340
|
+
if ("value" in n) n.writable = true;
|
|
341
|
+
Object.defineProperty(e, n.key, n);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function F(e, t, r) {
|
|
345
|
+
if (t) W(e.prototype, t);
|
|
346
|
+
if (r) W(e, r);
|
|
347
|
+
return e;
|
|
348
|
+
}
|
|
349
|
+
function J(e, t) {
|
|
350
|
+
if (typeof t !== "function" && t !== null) {
|
|
351
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
352
|
+
}
|
|
353
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
354
|
+
constructor: {
|
|
355
|
+
value: e,
|
|
356
|
+
writable: true,
|
|
357
|
+
configurable: true
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
if (t) H(e, t);
|
|
361
|
+
}
|
|
362
|
+
function H(e, t) {
|
|
363
|
+
H = Object.setPrototypeOf || function e(t, r) {
|
|
364
|
+
t.__proto__ = r;
|
|
365
|
+
return t;
|
|
366
|
+
};
|
|
367
|
+
return H(e, t);
|
|
368
|
+
}
|
|
369
|
+
function U(e) {
|
|
370
|
+
var t = Q();
|
|
371
|
+
return function r() {
|
|
372
|
+
var n = Y(e), o;
|
|
373
|
+
if (t) {
|
|
374
|
+
var i = Y(this).constructor;
|
|
375
|
+
o = Reflect.construct(n, arguments, i);
|
|
376
|
+
} else {
|
|
377
|
+
o = n.apply(this, arguments);
|
|
378
|
+
}
|
|
379
|
+
return X(this, o);
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function X(e, t) {
|
|
383
|
+
if (t && (L(t) === "object" || typeof t === "function")) {
|
|
384
|
+
return t;
|
|
385
|
+
}
|
|
386
|
+
return K(e);
|
|
387
|
+
}
|
|
388
|
+
function K(e) {
|
|
389
|
+
if (e === void 0) {
|
|
390
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
391
|
+
}
|
|
392
|
+
return e;
|
|
393
|
+
}
|
|
394
|
+
function Q() {
|
|
395
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
396
|
+
if (Reflect.construct.sham) return false;
|
|
397
|
+
if (typeof Proxy === "function") return true;
|
|
398
|
+
try {
|
|
399
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
400
|
+
return true;
|
|
401
|
+
} catch (e) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function Y(e) {
|
|
406
|
+
Y = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
407
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
408
|
+
};
|
|
409
|
+
return Y(e);
|
|
410
|
+
}
|
|
411
|
+
function Z(e, t, r) {
|
|
412
|
+
if (t in e) {
|
|
413
|
+
Object.defineProperty(e, t, {
|
|
414
|
+
value: r,
|
|
415
|
+
enumerable: true,
|
|
416
|
+
configurable: true,
|
|
417
|
+
writable: true
|
|
418
|
+
});
|
|
419
|
+
} else {
|
|
420
|
+
e[t] = r;
|
|
421
|
+
}
|
|
422
|
+
return e;
|
|
423
|
+
}
|
|
424
|
+
// props ControlGroup may access and/or override on children
|
|
425
|
+
var ee = {
|
|
426
|
+
children: i().node,
|
|
427
|
+
controlsLayout: i().oneOf([ "fill", "fillJoin", "none", "stack" ]),
|
|
428
|
+
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
429
|
+
error: i().oneOfType([ i().bool, i().string ]),
|
|
430
|
+
help: i().node,
|
|
431
|
+
hideLabel: i().bool,
|
|
432
|
+
label: i().string.isRequired,
|
|
433
|
+
labelFor: i().string,
|
|
434
|
+
labelPosition: i().oneOf([ "left", "top" ]),
|
|
435
|
+
labelWidth: i().oneOfType([ i().number, i().string ]),
|
|
436
|
+
required: i().bool,
|
|
437
|
+
size: i().oneOf([ "small", "medium" ]),
|
|
438
|
+
/** @private */
|
|
439
|
+
splunkTheme: i().object,
|
|
440
|
+
tooltip: i().node,
|
|
441
|
+
tooltipDefaultPlacement: i().oneOf([ "above", "below", "left", "right", "theme" ])
|
|
442
|
+
};
|
|
443
|
+
var te = {
|
|
444
|
+
controlsLayout: "fill",
|
|
445
|
+
error: false,
|
|
446
|
+
hideLabel: false,
|
|
447
|
+
labelPosition: "left",
|
|
448
|
+
labelWidth: 120,
|
|
449
|
+
required: false,
|
|
450
|
+
size: "medium"
|
|
451
|
+
};
|
|
452
|
+
// Style cloned onto child elements when fill behavior set.
|
|
453
|
+
var re = {
|
|
454
|
+
flexGrow: 1
|
|
455
|
+
};
|
|
456
|
+
// Margin bootom values cloned onto child elements when the stacking behavior is needed.
|
|
457
|
+
var ne = "0";
|
|
458
|
+
var oe = "16px";
|
|
459
|
+
var ie = "12px";
|
|
460
|
+
/**
|
|
291
461
|
* `ControlGroup` places a label and optional help text around one or more controls. The `ControlGroup`
|
|
292
462
|
* will automatically add aria attributes to associate the controls with the labels and help text to
|
|
293
463
|
* address accessibility requirements.
|
|
@@ -304,313 +474,236 @@ var CHILD_MARGIN_BOTTOM_PRISMA_COMPACT = '12px';
|
|
|
304
474
|
* If the linked child supports an `inputId` prop and it's set, its value is used for the label's `for`
|
|
305
475
|
* attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't
|
|
306
476
|
* supported `id` is used. The `labelFor` prop may be used to override the `for` attribute.
|
|
307
|
-
*/
|
|
308
|
-
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
477
|
+
*/ var le = function(e) {
|
|
478
|
+
J(o, e);
|
|
479
|
+
var t = U(o);
|
|
480
|
+
// @docs-props-type ControlGroupPropsBase
|
|
481
|
+
function o(e) {
|
|
482
|
+
var r;
|
|
483
|
+
R(this, o);
|
|
484
|
+
r = t.call(this, e);
|
|
485
|
+
Z(K(r), "errorId", void 0);
|
|
486
|
+
Z(K(r), "helpId", void 0);
|
|
487
|
+
Z(K(r), "labelId", void 0);
|
|
488
|
+
Z(K(r), "contextValue", void 0);
|
|
489
|
+
Z(K(r), "childIds", void 0);
|
|
490
|
+
Z(K(r), "stackLayoutChildStyle", void 0);
|
|
491
|
+
Z(K(r), "getChildID", (function(e, t) {
|
|
492
|
+
var n = "".concat(e, "-").concat(t);
|
|
493
|
+
var o = r.childIds[n];
|
|
494
|
+
if (!o || !o.length) {
|
|
495
|
+
o = (0, u.createDOMID)(e);
|
|
496
|
+
r.childIds[n] = o;
|
|
497
|
+
}
|
|
498
|
+
return o;
|
|
499
|
+
}));
|
|
500
|
+
Z(K(r), "getStackLayoutChildStyle", (function(e, t) {
|
|
501
|
+
if (e) {
|
|
502
|
+
if (t) {
|
|
503
|
+
r.stackLayoutChildStyle.marginBottom = ie;
|
|
504
|
+
}
|
|
505
|
+
r.stackLayoutChildStyle.marginBottom = oe;
|
|
506
|
+
} else {
|
|
507
|
+
r.stackLayoutChildStyle.marginBottom = ne;
|
|
508
|
+
}
|
|
509
|
+
return r.stackLayoutChildStyle;
|
|
510
|
+
}));
|
|
511
|
+
Z(K(r), "hasInputId", (function(e) {
|
|
512
|
+
return e.type && e.type.propTypes && Object.prototype.hasOwnProperty.call(e.type.propTypes, "inputId");
|
|
513
|
+
}));
|
|
514
|
+
Z(K(r), "getLinkedId", (function(e) {
|
|
515
|
+
if (e.length === 0) {
|
|
516
|
+
return undefined;
|
|
517
|
+
}
|
|
518
|
+
var t = $(e, 1), n = t[0];
|
|
519
|
+
var o = a()(e, (function(e) {
|
|
520
|
+
return e.type && e.type.componentType === "Text";
|
|
521
|
+
}));
|
|
522
|
+
var i = r.hasInputId(n);
|
|
523
|
+
// see class doc block for details
|
|
524
|
+
if (e.length === 1 && n && n.props) {
|
|
525
|
+
return i ? n.props.inputId : n.props.id;
|
|
526
|
+
}
|
|
527
|
+
if (o && o.props) {
|
|
528
|
+
return o.props.inputId;
|
|
529
|
+
}
|
|
530
|
+
if (n.props) {
|
|
531
|
+
return i ? n.props.inputId : n.props.id;
|
|
532
|
+
}
|
|
533
|
+
return undefined;
|
|
534
|
+
}));
|
|
535
|
+
r.errorId = (0, u.createDOMID)("error");
|
|
536
|
+
r.helpId = (0, u.createDOMID)("help");
|
|
537
|
+
r.labelId = (0, u.createDOMID)("label");
|
|
538
|
+
r.contextValue = r.createContextValue();
|
|
539
|
+
r.childIds = {};
|
|
540
|
+
r.stackLayoutChildStyle = {};
|
|
541
|
+
if (false) {}
|
|
542
|
+
return r;
|
|
350
543
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
cloneProps.labelText = label;
|
|
518
|
-
}
|
|
519
|
-
} else {
|
|
520
|
-
cloneProps.labelText = label;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
if (count === 1 && (controlsLayout === 'fillJoin' || controlsLayout === 'fill')) {
|
|
524
|
-
// Some controls like Select do not grow by default, so flexGrow is applied
|
|
525
|
-
// The spread operator is used as css styles are not nested, so there is no need for a deep copy.
|
|
526
|
-
cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), FLEX_GROW_STYLE) : FLEX_GROW_STYLE;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
if (!labelFor && item) {
|
|
530
|
-
if (_this2.hasInputId(item)) {
|
|
531
|
-
cloneProps.inputId = item.props.inputId || _this2.getChildID('input-id', i);
|
|
532
|
-
} else {
|
|
533
|
-
cloneProps.id = item.props.id || _this2.getChildID('id', i);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, cloneProps);
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
var childrenFormatted = validChildren.map(cloneWithProps);
|
|
541
|
-
var defaultLinkedId = this.getLinkedId(childrenFormatted);
|
|
542
|
-
|
|
543
|
-
if (error) {
|
|
544
|
-
writableOtherProps['aria-invalid'] = true;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
var labelWidthStyle = labelPosition === 'left' ? {
|
|
548
|
-
width: labelWidth
|
|
549
|
-
} : undefined;
|
|
550
|
-
var labelWidthString = isFinite_default()(labelWidth) ? "".concat(labelWidth, "px") : labelWidth;
|
|
551
|
-
var labelMargin = isPrisma ? '16px' : '20px';
|
|
552
|
-
var contentMarginStyle = labelPosition === 'left' ? {
|
|
553
|
-
marginLeft: "calc(".concat(labelWidthString, " + ").concat(labelMargin, ")")
|
|
554
|
-
} : undefined;
|
|
555
|
-
var StyledControlsComponent = controlsLayout === 'stack' ? StyledControlsStackBox : (Box_default());
|
|
556
|
-
var StyledLabelWrapperComponent = labelPosition === 'left' ? StyledLabelWrapperLeft : StyledLabelWrapper;
|
|
557
|
-
var styledLabel = /*#__PURE__*/external_react_default().createElement(StyledLabelWrapperComponent, {
|
|
558
|
-
style: labelWidthStyle,
|
|
559
|
-
$labelPosition: labelPosition
|
|
560
|
-
}, /*#__PURE__*/external_react_default().createElement(StyledLabel, {
|
|
561
|
-
"data-size": size,
|
|
562
|
-
"data-test": "label",
|
|
563
|
-
id: this.labelId,
|
|
564
|
-
htmlFor: labelFor || defaultLinkedId,
|
|
565
|
-
$tooltip: !!tooltip
|
|
566
|
-
}, required && /*#__PURE__*/external_react_default().createElement(StyledAsterisk, {
|
|
567
|
-
"aria-hidden": "true"
|
|
568
|
-
}, "*"), label, !isPrisma && !hideLabel && tooltip && /*#__PURE__*/external_react_default().createElement("span", null, "\xA0"), !hideLabel && tooltip && /*#__PURE__*/external_react_default().createElement((ScreenReaderContent_default()), null, tooltip)), !hideLabel && tooltip && /*#__PURE__*/external_react_default().createElement(StyledTooltip, {
|
|
569
|
-
$labelPosition: labelPosition,
|
|
570
|
-
closeWhen: "notOnClick",
|
|
571
|
-
content: tooltip,
|
|
572
|
-
defaultPlacement: tooltipDefaultPlacement,
|
|
573
|
-
"aria-hidden": "true"
|
|
574
|
-
}));
|
|
575
|
-
var isError = typeof error === 'string' || error === true;
|
|
576
|
-
var isErrorBoolean = typeof error === 'boolean';
|
|
577
|
-
return /*#__PURE__*/external_react_default().createElement(StyledBox, _extends({
|
|
578
|
-
"data-test": "control-group",
|
|
579
|
-
$error: isError
|
|
580
|
-
}, writableOtherProps), /*#__PURE__*/external_react_default().createElement(ControlGroup_ControlGroupContext.Provider, {
|
|
581
|
-
value: this.getContextValue()
|
|
582
|
-
}, hideLabel ? /*#__PURE__*/external_react_default().createElement((ScreenReaderContent_default()), null, styledLabel) : styledLabel, /*#__PURE__*/external_react_default().createElement(StyledControlsComponent, {
|
|
583
|
-
"data-test": "controls",
|
|
584
|
-
flex: controlsLayout !== 'none',
|
|
585
|
-
style: contentMarginStyle
|
|
586
|
-
}, childrenFormatted), help && /*#__PURE__*/external_react_default().createElement(StyledHelp, {
|
|
587
|
-
"data-test": "help",
|
|
588
|
-
id: this.helpId,
|
|
589
|
-
style: contentMarginStyle,
|
|
590
|
-
$error: isError && isErrorBoolean
|
|
591
|
-
}, help), isError && !isErrorBoolean && /*#__PURE__*/external_react_default().createElement(StyledErrorText, {
|
|
592
|
-
"data-test": "error",
|
|
593
|
-
id: this.errorId,
|
|
594
|
-
style: contentMarginStyle,
|
|
595
|
-
$help: !!help
|
|
596
|
-
}, error)));
|
|
597
|
-
}
|
|
598
|
-
}]);
|
|
599
|
-
|
|
600
|
-
return ControlGroup;
|
|
601
|
-
}(external_react_namespaceObject.Component);
|
|
602
|
-
|
|
603
|
-
_defineProperty(ControlGroup, "propTypes", propTypes);
|
|
604
|
-
|
|
605
|
-
_defineProperty(ControlGroup, "defaultProps", defaultProps);
|
|
606
|
-
|
|
607
|
-
var ControlGroupWithTheme = (0,themes_namespaceObject.withSplunkTheme)(ControlGroup);
|
|
608
|
-
ControlGroupWithTheme.propTypes = ControlGroup.propTypes;
|
|
609
|
-
/* harmony default export */ const ControlGroup_ControlGroup = (ControlGroupWithTheme);
|
|
610
|
-
|
|
611
|
-
;// CONCATENATED MODULE: ./src/ControlGroup/index.ts
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
module.exports = __webpack_exports__;
|
|
615
|
-
/******/ })()
|
|
616
|
-
;
|
|
544
|
+
F(o, [ {
|
|
545
|
+
key: "shouldComponentUpdate",
|
|
546
|
+
value: function e(t) {
|
|
547
|
+
if (n().Children.count(t.children) !== n().Children.count(this.props.children)) {
|
|
548
|
+
this.childIds = {};
|
|
549
|
+
}
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
}, {
|
|
553
|
+
key: "createContextValue",
|
|
554
|
+
value: function e() {
|
|
555
|
+
return {
|
|
556
|
+
labelAttrs: {
|
|
557
|
+
text: this.props.label,
|
|
558
|
+
id: this.labelId
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
}, {
|
|
563
|
+
key: "getContextValue",
|
|
564
|
+
value: function e() {
|
|
565
|
+
var t, r;
|
|
566
|
+
if (this.props.label !== ((t = this.contextValue.labelAttrs) === null || t === void 0 ? void 0 : t.text) || this.labelId !== ((r = this.contextValue.labelAttrs) === null || r === void 0 ? void 0 : r.id)) {
|
|
567
|
+
this.contextValue = this.createContextValue();
|
|
568
|
+
}
|
|
569
|
+
return this.contextValue;
|
|
570
|
+
}
|
|
571
|
+
}, {
|
|
572
|
+
key: "render",
|
|
573
|
+
value: function e() {
|
|
574
|
+
var t = this;
|
|
575
|
+
var o = this.props, i = o.children, l = o.controlsLayout, a = o.error, s = o.help, c = o.hideLabel, u = o.label, f = o.labelFor, y = o.labelPosition, h = o.labelWidth, m = o.required, v = o.size, g = o.splunkTheme, _ = o.tooltip, L = o.tooltipDefaultPlacement, D = M(o, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "size", "splunkTheme", "tooltip", "tooltipDefaultPlacement" ]);
|
|
576
|
+
var V = g.isPrisma, $ = g.isCompact;
|
|
577
|
+
var A = r.Children.toArray(i).filter(r.isValidElement);
|
|
578
|
+
var G = A.length;
|
|
579
|
+
var B = D;
|
|
580
|
+
// Clean the Children
|
|
581
|
+
var N = function e(n, o) {
|
|
582
|
+
var i = {
|
|
583
|
+
key: n.key || o
|
|
584
|
+
};
|
|
585
|
+
if (l === "fillJoin") {
|
|
586
|
+
if (o > 0) {
|
|
587
|
+
i.prepend = true;
|
|
588
|
+
}
|
|
589
|
+
if (o < G - 1) {
|
|
590
|
+
i.append = true;
|
|
591
|
+
}
|
|
592
|
+
if (i.prepend || i.append) {
|
|
593
|
+
i.inline = false;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
if (l === "fill" && G > 1) {
|
|
597
|
+
i.inline = true;
|
|
598
|
+
}
|
|
599
|
+
if (l === "stack") {
|
|
600
|
+
i.inline = false;
|
|
601
|
+
if (o < G - 1) {
|
|
602
|
+
// The spread operator is used as css styles are not nested, so there is no need for a deep copy.
|
|
603
|
+
var a = t.getStackLayoutChildStyle(V, $);
|
|
604
|
+
i.style = n.props.style ? q(q({}, n.props.style), a) : a;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
i.labelledBy = t.labelId;
|
|
608
|
+
if (t.props.help && typeof t.props.error === "boolean") {
|
|
609
|
+
i.describedBy = t.helpId;
|
|
610
|
+
} else if (t.props.help && typeof t.props.error === "string") {
|
|
611
|
+
i.describedBy = "".concat(t.helpId, " ").concat(t.errorId);
|
|
612
|
+
} else if (!t.props.help && typeof t.props.error === "string") {
|
|
613
|
+
i.describedBy = t.errorId;
|
|
614
|
+
}
|
|
615
|
+
if (t.props.required) {
|
|
616
|
+
i.required = true;
|
|
617
|
+
}
|
|
618
|
+
// TODO: SUI-3402 refactor so that parent component doesn't have to know what it's child components are
|
|
619
|
+
if (n.type.componentType === "Multiselect") {
|
|
620
|
+
var s = n;
|
|
621
|
+
if (s.props.compact === false) {
|
|
622
|
+
i.labelText = u;
|
|
623
|
+
}
|
|
624
|
+
} else {
|
|
625
|
+
i.labelText = u;
|
|
626
|
+
}
|
|
627
|
+
if (G === 1 && (l === "fillJoin" || l === "fill")) {
|
|
628
|
+
// Some controls like Select do not grow by default, so flexGrow is applied
|
|
629
|
+
// The spread operator is used as css styles are not nested, so there is no need for a deep copy.
|
|
630
|
+
i.style = n.props.style ? q(q({}, n.props.style), re) : re;
|
|
631
|
+
}
|
|
632
|
+
if (!f && n) {
|
|
633
|
+
if (t.hasInputId(n)) {
|
|
634
|
+
i.inputId = n.props.inputId || t.getChildID("input-id", o);
|
|
635
|
+
} else {
|
|
636
|
+
i.id = n.props.id || t.getChildID("id", o);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return (0, r.cloneElement)(n, i);
|
|
641
|
+
};
|
|
642
|
+
var z = A.map(N);
|
|
643
|
+
var R = this.getLinkedId(z);
|
|
644
|
+
if (a) {
|
|
645
|
+
B["aria-invalid"] = true;
|
|
646
|
+
}
|
|
647
|
+
var W = y === "left" ? {
|
|
648
|
+
width: h
|
|
649
|
+
} : undefined;
|
|
650
|
+
var F = p()(h) ? "".concat(h, "px") : h;
|
|
651
|
+
var J = V ? "16px" : "20px";
|
|
652
|
+
var H = y === "left" ? {
|
|
653
|
+
marginLeft: "calc(".concat(F, " + ").concat(J, ")")
|
|
654
|
+
} : undefined;
|
|
655
|
+
var U = l === "stack" ? x : d();
|
|
656
|
+
var X = y === "left" ? I : S;
|
|
657
|
+
var K = n().createElement(X, {
|
|
658
|
+
style: W,
|
|
659
|
+
$labelPosition: y
|
|
660
|
+
}, n().createElement(C, {
|
|
661
|
+
"data-size": v,
|
|
662
|
+
"data-test": "label",
|
|
663
|
+
id: this.labelId,
|
|
664
|
+
htmlFor: f || R,
|
|
665
|
+
$tooltip: !!_
|
|
666
|
+
}, m && n().createElement(P, {
|
|
667
|
+
"aria-hidden": "true"
|
|
668
|
+
}, "*"), u, !V && !c && _ && n().createElement("span", null, " "), !c && _ && n().createElement(b(), null, _)), !c && _ && n().createElement(k, {
|
|
669
|
+
$labelPosition: y,
|
|
670
|
+
closeWhen: "notOnClick",
|
|
671
|
+
content: _,
|
|
672
|
+
defaultPlacement: L,
|
|
673
|
+
"aria-hidden": "true"
|
|
674
|
+
}));
|
|
675
|
+
var Q = typeof a === "string" || a === true;
|
|
676
|
+
var Y = typeof a === "boolean";
|
|
677
|
+
|
|
678
|
+
return n().createElement(O, E({
|
|
679
|
+
"data-test": "control-group",
|
|
680
|
+
$error: Q
|
|
681
|
+
}, B), n().createElement(T.Provider, {
|
|
682
|
+
value: this.getContextValue()
|
|
683
|
+
}, c ? n().createElement(b(), null, K) : K, n().createElement(U, {
|
|
684
|
+
"data-test": "controls",
|
|
685
|
+
flex: l !== "none",
|
|
686
|
+
style: H
|
|
687
|
+
}, z), s && n().createElement(w, {
|
|
688
|
+
"data-test": "help",
|
|
689
|
+
id: this.helpId,
|
|
690
|
+
style: H,
|
|
691
|
+
$error: Q && Y
|
|
692
|
+
}, s), Q && !Y && n().createElement(j, {
|
|
693
|
+
"data-test": "error",
|
|
694
|
+
id: this.errorId,
|
|
695
|
+
style: H,
|
|
696
|
+
$help: !!s
|
|
697
|
+
}, a)));
|
|
698
|
+
}
|
|
699
|
+
} ]);
|
|
700
|
+
return o;
|
|
701
|
+
}(r.Component);
|
|
702
|
+
Z(le, "propTypes", ee);
|
|
703
|
+
Z(le, "defaultProps", te);
|
|
704
|
+
var ae = (0, c.withSplunkTheme)(le);
|
|
705
|
+
ae.propTypes = le.propTypes;
|
|
706
|
+
/* harmony default export */ const se = ae;
|
|
707
|
+
// CONCATENATED MODULE: ./src/ControlGroup/index.ts
|
|
708
|
+
module.exports = t;
|
|
709
|
+
/******/})();
|