@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/Button.js
CHANGED
|
@@ -1,471 +1,494 @@
|
|
|
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
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}), (0,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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 n = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(n, {
|
|
17
|
+
a: n
|
|
18
|
+
});
|
|
19
|
+
/******/ return n;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
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
|
+
enumerable: true,
|
|
31
|
+
get: n[r]
|
|
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
|
+
default: () => /* reexport */ U
|
|
65
|
+
});
|
|
66
|
+
// CONCATENATED MODULE: external "react"
|
|
67
|
+
const n = require("react");
|
|
68
|
+
var r = e.n(n);
|
|
69
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
+
const i = require("prop-types");
|
|
71
|
+
var a = e.n(i);
|
|
72
|
+
// CONCATENATED MODULE: external "lodash/isString"
|
|
73
|
+
const o = require("lodash/isString");
|
|
74
|
+
var l = e.n(o);
|
|
75
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
76
|
+
const c = require("@splunk/react-ui/Dropdown");
|
|
77
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/style"
|
|
78
|
+
const s = require("@splunk/ui-utils/style");
|
|
79
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
80
|
+
const p = require("styled-components");
|
|
81
|
+
var u = e.n(p);
|
|
82
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
|
|
83
|
+
const f = require("@splunk/react-ui/ButtonSimple");
|
|
84
|
+
var d = e.n(f);
|
|
85
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
86
|
+
const m = require("@splunk/themes");
|
|
87
|
+
// CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
|
|
88
|
+
var v = u().span.withConfig({
|
|
89
|
+
displayName: "ButtonStyles__StyledIcon",
|
|
90
|
+
componentId: "eqxqs2-0"
|
|
91
|
+
})([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", ";" ], (0,
|
|
92
|
+
m.pick)({
|
|
93
|
+
enterprise: "inherit",
|
|
94
|
+
prisma: {
|
|
95
|
+
comfortable: "21px",
|
|
96
|
+
compact: "16px"
|
|
97
|
+
}
|
|
98
|
+
}), (0, m.pickVariant)("$isIconOnly", {
|
|
99
|
+
false: {
|
|
100
|
+
enterprise: (0, p.css)([ "padding-right:3px;" ]),
|
|
101
|
+
prisma: (0, p.css)([ "padding-right:8px;" ])
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
var y = u()(d()).withConfig({
|
|
105
|
+
displayName: "ButtonStyles__StyledButtonSimple",
|
|
106
|
+
componentId: "eqxqs2-1"
|
|
107
|
+
})([ "text-align:center;vertical-align:middle;text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{display:inline-block;vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], m.variables.lineHeight, m.variables.inputHeight, (0,
|
|
108
|
+
m.pick)({
|
|
109
|
+
enterprise: {
|
|
110
|
+
comfortable: "5px 14px",
|
|
111
|
+
compact: "2px 14px"
|
|
112
|
+
},
|
|
113
|
+
prisma: {
|
|
114
|
+
comfortable: function e(t) {
|
|
115
|
+
var n = t.$hasPrismaIcon;
|
|
116
|
+
return n ? "7px 18px" : "9px 18px";
|
|
117
|
+
},
|
|
118
|
+
compact: function e(t) {
|
|
119
|
+
var n = t.$isMenu;
|
|
120
|
+
return n ? "5px 8px 5px 16px" : "5px 16px";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}), (function(e) {
|
|
124
|
+
var t = e.$inline, n = e.append, r = e.prepend;
|
|
125
|
+
return !t && !n && !r && (0, p.css)([ "width:100%;" ]);
|
|
126
|
+
}), (function(e) {
|
|
127
|
+
var t = e.$isIconOnly;
|
|
128
|
+
return t && (0, p.css)([ "box-sizing:border-box;padding:", ";width:", ";min-width:", ";" ], (0,
|
|
129
|
+
m.pick)({
|
|
130
|
+
enterprise: {
|
|
131
|
+
comfortable: "0 5px",
|
|
132
|
+
compact: "0 2px"
|
|
133
|
+
},
|
|
134
|
+
prisma: {
|
|
135
|
+
comfortable: (0, p.css)([ "0px calc(", " / 2 - 1px)" ], m.variables.inputHeight),
|
|
136
|
+
compact: (0, p.css)([ "0px calc(", " / 2 - 1px)" ], m.variables.inputHeight)
|
|
137
|
+
}
|
|
138
|
+
}), m.variables.inputHeight, m.variables.inputHeight);
|
|
139
|
+
}), (function(e) {
|
|
140
|
+
var t = e.$isIconOnly;
|
|
141
|
+
return t ? null : (0, p.css)([ "width:auto;" ]);
|
|
142
|
+
}), (function(e) {
|
|
143
|
+
var t = e.prepend;
|
|
144
|
+
return !t && (0, p.css)([ "margin-left:", ";" ], (0, m.pick)({
|
|
145
|
+
enterprise: m.variables.spacingHalf,
|
|
146
|
+
prisma: m.variables.spacingSmall
|
|
147
|
+
}));
|
|
148
|
+
}));
|
|
149
|
+
var b = u().span.withConfig({
|
|
150
|
+
displayName: "ButtonStyles__StyledContentWrapper",
|
|
151
|
+
componentId: "eqxqs2-2"
|
|
152
|
+
})([ "display:flex;flex-direction:row;justify-content:center;align-items:center;max-width:100%;padding:", ";" ], (0,
|
|
153
|
+
m.pick)({
|
|
154
|
+
enterprise: function e(t) {
|
|
155
|
+
var n = t.$error;
|
|
156
|
+
if (n) {
|
|
157
|
+
return "1px";
|
|
158
|
+
}
|
|
159
|
+
return (0, m.pickVariant)("$appearance", {
|
|
160
|
+
default: "0",
|
|
161
|
+
secondary: "0",
|
|
162
|
+
destructive: "1px",
|
|
163
|
+
primary: "1px",
|
|
164
|
+
pill: "0",
|
|
165
|
+
toggle: "0",
|
|
166
|
+
// === default
|
|
167
|
+
flat: "0"
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
prisma: (0, m.pickVariant)("$appearance", {
|
|
171
|
+
default: 0,
|
|
172
|
+
secondary: "1px 0",
|
|
173
|
+
primary: "1px 0",
|
|
174
|
+
destructive: "1px 0",
|
|
175
|
+
pill: "1px 0",
|
|
176
|
+
// === secondary
|
|
177
|
+
toggle: "0",
|
|
178
|
+
flat: "1px 0"
|
|
179
|
+
})
|
|
180
|
+
}));
|
|
181
|
+
var h = u().span.withConfig({
|
|
182
|
+
displayName: "ButtonStyles__StyledLabel",
|
|
183
|
+
componentId: "eqxqs2-3"
|
|
184
|
+
})([ "text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", "" ], (0,
|
|
185
|
+
m.pick)({
|
|
186
|
+
enterprise: "3px",
|
|
187
|
+
prisma: "10px"
|
|
188
|
+
}), (function(e) {
|
|
189
|
+
var t = e.$isMenu;
|
|
190
|
+
return t && (0, p.css)([ "flex:1 1 auto;text-align:left;" ]);
|
|
191
|
+
}));
|
|
192
|
+
var x = u().span.withConfig({
|
|
193
|
+
displayName: "ButtonStyles__StyledCaretWrapper",
|
|
194
|
+
componentId: "eqxqs2-4"
|
|
195
|
+
})([ "display:inline-flex;", "" ], (0, m.pickVariant)("$disabled", {
|
|
196
|
+
false: {
|
|
197
|
+
prisma: (0, m.pickVariant)("$primary", {
|
|
198
|
+
true: (0, p.css)([ "color:", ";" ], m.variables.contentColorInverted),
|
|
199
|
+
false: (0, p.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ], m.variables.contentColorDefault,
|
|
200
|
+
/* sc-sel */
|
|
201
|
+
y,
|
|
202
|
+
/* sc-sel */
|
|
203
|
+
y, m.variables.contentColorDefault)
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
}));
|
|
207
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
208
|
+
const g = require("@splunk/react-icons/CaretSmallDown");
|
|
209
|
+
var w = e.n(g);
|
|
210
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
211
|
+
const k = require("@splunk/react-icons/enterprise/Caret");
|
|
212
|
+
var S = e.n(k);
|
|
213
|
+
// CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
|
|
214
|
+
var C = function e() {
|
|
215
|
+
var t = (0, m.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
|
|
216
|
+
var a = i ? "20px" : "24px";
|
|
217
|
+
return n ? r().createElement(S(), {
|
|
218
|
+
screenReaderText: null,
|
|
219
|
+
hideDefaultTooltip: true,
|
|
220
|
+
size: .5
|
|
221
|
+
}) : r().createElement(w(), {
|
|
222
|
+
height: a,
|
|
223
|
+
width: a
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
/* harmony default export */ const O = C;
|
|
227
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
|
|
228
|
+
const q = require("@splunk/react-icons/ArrowSquareTopRightInset");
|
|
229
|
+
var _ = e.n(q);
|
|
230
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
|
|
231
|
+
const $ = require("@splunk/react-icons/enterprise/External");
|
|
232
|
+
var I = e.n($);
|
|
233
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
234
|
+
const E = require("@splunk/ui-utils/i18n");
|
|
235
|
+
// CONCATENATED MODULE: ./src/Button/icons/External.tsx
|
|
236
|
+
var P = (0, E._)("Open externally");
|
|
237
|
+
function j() {
|
|
238
|
+
var e = (0, m.useSplunkTheme)(), t = e.isEnterprise, n = e.isCompact;
|
|
239
|
+
var i = n ? "20px" : "24px";
|
|
240
|
+
return t ? r().createElement(I(), {
|
|
241
|
+
screenReaderText: P,
|
|
242
|
+
size: .8,
|
|
243
|
+
style: {
|
|
244
|
+
verticalAlign: "baseline"
|
|
245
|
+
}
|
|
246
|
+
}) : r().createElement(_(), {
|
|
247
|
+
"aria-label": P,
|
|
248
|
+
height: i,
|
|
249
|
+
width: i
|
|
250
|
+
}, r().createElement("title", null, P));
|
|
113
251
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
comfortable: (0,external_styled_components_namespaceObject.css)(["0px calc(", " / 2 - 1px)"], themes_namespaceObject.variables.inputHeight),
|
|
129
|
-
compact: (0,external_styled_components_namespaceObject.css)(["0px calc(", " / 2 - 1px)"], themes_namespaceObject.variables.inputHeight)
|
|
252
|
+
/* harmony default export */ const N = j;
|
|
253
|
+
// CONCATENATED MODULE: ./src/Button/Button.tsx
|
|
254
|
+
function M(e) {
|
|
255
|
+
"@babel/helpers - typeof";
|
|
256
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
257
|
+
M = function e(t) {
|
|
258
|
+
return typeof t;
|
|
259
|
+
};
|
|
260
|
+
} else {
|
|
261
|
+
M = function e(t) {
|
|
262
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
return M(e);
|
|
130
266
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
componentId: "eqxqs2-2"
|
|
145
|
-
})(["display:flex;flex-direction:row;justify-content:center;align-items:center;max-width:100%;padding:", ";"], (0,themes_namespaceObject.pick)({
|
|
146
|
-
enterprise: function enterprise(_ref7) {
|
|
147
|
-
var $error = _ref7.$error;
|
|
148
|
-
|
|
149
|
-
if ($error) {
|
|
150
|
-
return '1px';
|
|
267
|
+
function T() {
|
|
268
|
+
T = Object.assign || function(e) {
|
|
269
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
270
|
+
var n = arguments[t];
|
|
271
|
+
for (var r in n) {
|
|
272
|
+
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
273
|
+
e[r] = n[r];
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return e;
|
|
278
|
+
};
|
|
279
|
+
return T.apply(this, arguments);
|
|
151
280
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
destructive: '1px',
|
|
157
|
-
primary: '1px',
|
|
158
|
-
pill: '0',
|
|
159
|
-
toggle: '0',
|
|
160
|
-
// === default
|
|
161
|
-
flat: '0' // === default
|
|
162
|
-
|
|
163
|
-
});
|
|
164
|
-
},
|
|
165
|
-
prisma: (0,themes_namespaceObject.pickVariant)('$appearance', {
|
|
166
|
-
"default": 0,
|
|
167
|
-
secondary: '1px 0',
|
|
168
|
-
primary: '1px 0',
|
|
169
|
-
destructive: '1px 0',
|
|
170
|
-
pill: '1px 0',
|
|
171
|
-
// === secondary
|
|
172
|
-
toggle: '0',
|
|
173
|
-
flat: '1px 0'
|
|
174
|
-
})
|
|
175
|
-
}));
|
|
176
|
-
var StyledLabel = external_styled_components_default().span.withConfig({
|
|
177
|
-
displayName: "ButtonStyles__StyledLabel",
|
|
178
|
-
componentId: "eqxqs2-3"
|
|
179
|
-
})(["text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", ""], (0,themes_namespaceObject.pick)({
|
|
180
|
-
enterprise: '3px',
|
|
181
|
-
prisma: '10px'
|
|
182
|
-
}), function (_ref8) {
|
|
183
|
-
var $isMenu = _ref8.$isMenu;
|
|
184
|
-
return $isMenu && (0,external_styled_components_namespaceObject.css)(["flex:1 1 auto;text-align:left;"]);
|
|
185
|
-
});
|
|
186
|
-
var StyledCaretWrapper = external_styled_components_default().span.withConfig({
|
|
187
|
-
displayName: "ButtonStyles__StyledCaretWrapper",
|
|
188
|
-
componentId: "eqxqs2-4"
|
|
189
|
-
})(["display:inline-flex;", ""], (0,themes_namespaceObject.pickVariant)('$disabled', {
|
|
190
|
-
"false": {
|
|
191
|
-
prisma: (0,themes_namespaceObject.pickVariant)('$primary', {
|
|
192
|
-
"true": (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.contentColorInverted),
|
|
193
|
-
"false": (0,external_styled_components_namespaceObject.css)(["color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}"], themes_namespaceObject.variables.contentColorDefault,
|
|
194
|
-
/* sc-sel */
|
|
195
|
-
StyledButtonSimple,
|
|
196
|
-
/* sc-sel */
|
|
197
|
-
StyledButtonSimple, themes_namespaceObject.variables.contentColorDefault)
|
|
198
|
-
})
|
|
199
|
-
}
|
|
200
|
-
}));
|
|
201
|
-
|
|
202
|
-
;// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
203
|
-
const CaretSmallDown_namespaceObject = require("@splunk/react-icons/CaretSmallDown");
|
|
204
|
-
var CaretSmallDown_default = /*#__PURE__*/__webpack_require__.n(CaretSmallDown_namespaceObject);
|
|
205
|
-
;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
206
|
-
const Caret_namespaceObject = require("@splunk/react-icons/enterprise/Caret");
|
|
207
|
-
var Caret_default = /*#__PURE__*/__webpack_require__.n(Caret_namespaceObject);
|
|
208
|
-
;// CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var CaretSmallDown = function CaretSmallDown() {
|
|
215
|
-
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
216
|
-
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
217
|
-
isCompact = _useSplunkTheme.isCompact;
|
|
218
|
-
|
|
219
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
220
|
-
return isEnterprise ? /*#__PURE__*/external_react_default().createElement((Caret_default()), {
|
|
221
|
-
screenReaderText: null,
|
|
222
|
-
hideDefaultTooltip: true,
|
|
223
|
-
size: 0.5
|
|
224
|
-
}) : /*#__PURE__*/external_react_default().createElement((CaretSmallDown_default()), {
|
|
225
|
-
height: prismaSize,
|
|
226
|
-
width: prismaSize
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
/* harmony default export */ const icons_CaretSmallDown = (CaretSmallDown);
|
|
231
|
-
;// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
|
|
232
|
-
const ArrowSquareTopRightInset_namespaceObject = require("@splunk/react-icons/ArrowSquareTopRightInset");
|
|
233
|
-
var ArrowSquareTopRightInset_default = /*#__PURE__*/__webpack_require__.n(ArrowSquareTopRightInset_namespaceObject);
|
|
234
|
-
;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
|
|
235
|
-
const External_namespaceObject = require("@splunk/react-icons/enterprise/External");
|
|
236
|
-
var External_default = /*#__PURE__*/__webpack_require__.n(External_namespaceObject);
|
|
237
|
-
;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
238
|
-
const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
|
|
239
|
-
;// CONCATENATED MODULE: ./src/Button/icons/External.tsx
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
var label = (0,i18n_namespaceObject._)('Open externally');
|
|
247
|
-
|
|
248
|
-
function External() {
|
|
249
|
-
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
250
|
-
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
251
|
-
isCompact = _useSplunkTheme.isCompact;
|
|
252
|
-
|
|
253
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
254
|
-
return isEnterprise ? /*#__PURE__*/external_react_default().createElement((External_default()), {
|
|
255
|
-
screenReaderText: label,
|
|
256
|
-
size: 0.8,
|
|
257
|
-
style: {
|
|
258
|
-
verticalAlign: 'baseline'
|
|
281
|
+
function R(e, t) {
|
|
282
|
+
if (!(e instanceof t)) {
|
|
283
|
+
throw new TypeError("Cannot call a class as a function");
|
|
284
|
+
}
|
|
259
285
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
function
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
288
|
-
|
|
289
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
290
|
-
|
|
291
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
292
|
-
|
|
293
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
var propTypes = {
|
|
304
|
-
action: (external_prop_types_default()).string,
|
|
305
|
-
appearance: external_prop_types_default().oneOf(['default', 'secondary', 'primary', 'destructive', 'pill', 'toggle', 'flat']),
|
|
306
|
-
append: (external_prop_types_default()).bool,
|
|
307
|
-
children: (external_prop_types_default()).node,
|
|
308
|
-
|
|
309
|
-
/** @private An additional className to add to the button. */
|
|
310
|
-
classNamePrivate: (external_prop_types_default()).string,
|
|
311
|
-
disabled: (external_prop_types_default()).bool,
|
|
312
|
-
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
313
|
-
error: (external_prop_types_default()).bool,
|
|
314
|
-
icon: (external_prop_types_default()).node,
|
|
315
|
-
inline: (external_prop_types_default()).bool,
|
|
316
|
-
isMenu: (external_prop_types_default()).bool,
|
|
317
|
-
label: (external_prop_types_default()).node,
|
|
318
|
-
onClick: (external_prop_types_default()).func,
|
|
319
|
-
openInNewContext: (external_prop_types_default()).bool,
|
|
320
|
-
prepend: (external_prop_types_default()).bool,
|
|
321
|
-
selected: (external_prop_types_default()).bool,
|
|
322
|
-
to: (external_prop_types_default()).string,
|
|
323
|
-
value: (external_prop_types_default()).any
|
|
324
|
-
};
|
|
325
|
-
var defaultProps = {
|
|
326
|
-
appearance: 'default',
|
|
327
|
-
append: false,
|
|
328
|
-
disabled: false,
|
|
329
|
-
error: false,
|
|
330
|
-
inline: true,
|
|
331
|
-
isMenu: false,
|
|
332
|
-
openInNewContext: false,
|
|
333
|
-
prepend: false,
|
|
334
|
-
selected: false
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
var Button = /*#__PURE__*/function (_Component) {
|
|
338
|
-
_inherits(Button, _Component);
|
|
339
|
-
|
|
340
|
-
var _super = _createSuper(Button);
|
|
341
|
-
|
|
342
|
-
// @docs-props-type ButtonPropsBase
|
|
343
|
-
function Button(props) {
|
|
344
|
-
var _this;
|
|
345
|
-
|
|
346
|
-
_classCallCheck(this, Button);
|
|
347
|
-
|
|
348
|
-
_this = _super.call(this, props);
|
|
349
|
-
|
|
350
|
-
_defineProperty(_assertThisInitialized(_this), "component", null);
|
|
351
|
-
|
|
352
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
353
|
-
var _this$props = _this.props,
|
|
354
|
-
label = _this$props.label,
|
|
355
|
-
icon = _this$props.icon,
|
|
356
|
-
value = _this$props.value,
|
|
357
|
-
action = _this$props.action,
|
|
358
|
-
onClick = _this$props.onClick;
|
|
359
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
360
|
-
label: label,
|
|
361
|
-
icon: icon,
|
|
362
|
-
value: value,
|
|
363
|
-
action: action
|
|
364
|
-
});
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
_defineProperty(_assertThisInitialized(_this), "handleMount", function (c) {
|
|
368
|
-
_this.component = c;
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
if (false) {}
|
|
372
|
-
|
|
373
|
-
return _this;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
_createClass(Button, [{
|
|
377
|
-
key: "focus",
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Places focus on the button.
|
|
381
|
-
*/
|
|
382
|
-
value: function focus() {
|
|
383
|
-
var _this$component;
|
|
384
|
-
|
|
385
|
-
(_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.focus();
|
|
286
|
+
function B(e, t) {
|
|
287
|
+
for (var n = 0; n < t.length; n++) {
|
|
288
|
+
var r = t[n];
|
|
289
|
+
r.enumerable = r.enumerable || false;
|
|
290
|
+
r.configurable = true;
|
|
291
|
+
if ("value" in r) r.writable = true;
|
|
292
|
+
Object.defineProperty(e, r.key, r);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function D(e, t, n) {
|
|
296
|
+
if (t) B(e.prototype, t);
|
|
297
|
+
if (n) B(e, n);
|
|
298
|
+
return e;
|
|
299
|
+
}
|
|
300
|
+
function H(e, t) {
|
|
301
|
+
if (typeof t !== "function" && t !== null) {
|
|
302
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
303
|
+
}
|
|
304
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
305
|
+
constructor: {
|
|
306
|
+
value: e,
|
|
307
|
+
writable: true,
|
|
308
|
+
configurable: true
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
if (t) V(e, t);
|
|
386
312
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
append = _this$props2.append,
|
|
394
|
-
className = _this$props2.className,
|
|
395
|
-
classNamePrivate = _this$props2.classNamePrivate,
|
|
396
|
-
disabled = _this$props2.disabled,
|
|
397
|
-
error = _this$props2.error,
|
|
398
|
-
icon = _this$props2.icon,
|
|
399
|
-
inline = _this$props2.inline,
|
|
400
|
-
isMenu = _this$props2.isMenu,
|
|
401
|
-
onClick = _this$props2.onClick,
|
|
402
|
-
openInNewContext = _this$props2.openInNewContext,
|
|
403
|
-
prepend = _this$props2.prepend,
|
|
404
|
-
to = _this$props2.to,
|
|
405
|
-
value = _this$props2.value;
|
|
406
|
-
var _this$props3 = this.props,
|
|
407
|
-
children = _this$props3.children,
|
|
408
|
-
label = _this$props3.label;
|
|
409
|
-
|
|
410
|
-
if (!label && isString_default()(children)) {
|
|
411
|
-
label = children;
|
|
412
|
-
children = null;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
var isIconOnly = !!(icon && !label && !isMenu && !children);
|
|
416
|
-
var hasPrismaIcon = to && openInNewContext || isMenu || !!icon;
|
|
417
|
-
return /*#__PURE__*/external_react_default().createElement(StyledButtonSimple, _extends({
|
|
418
|
-
"aria-haspopup": isMenu || undefined,
|
|
419
|
-
"aria-invalid": error || undefined,
|
|
420
|
-
"data-test": "button"
|
|
421
|
-
}, this.props, {
|
|
422
|
-
className: (0,style_namespaceObject.toClassName)(className, classNamePrivate),
|
|
423
|
-
"data-action": action,
|
|
424
|
-
"data-inline": inline || null,
|
|
425
|
-
disabled: disabled,
|
|
426
|
-
append: append,
|
|
427
|
-
prepend: prepend,
|
|
428
|
-
$inline: inline,
|
|
429
|
-
$hasPrismaIcon: hasPrismaIcon,
|
|
430
|
-
$isIconOnly: isIconOnly,
|
|
431
|
-
$isMenu: isMenu // @ts-expect-error - this is problematic for two reasons:
|
|
432
|
-
// * value is only a valid attribute on button (not on a)
|
|
433
|
-
// * this component's value prop is of type any, which can result
|
|
434
|
-
// in "[object Object]" attribute values
|
|
435
|
-
,
|
|
436
|
-
value: value,
|
|
437
|
-
onClick: onClick ? this.handleClick : undefined,
|
|
438
|
-
ref: this.handleMount,
|
|
439
|
-
openInNewContext: openInNewContext,
|
|
440
|
-
appearance: appearance
|
|
441
|
-
}), /*#__PURE__*/external_react_default().createElement(StyledContentWrapper, {
|
|
442
|
-
$appearance: appearance,
|
|
443
|
-
$error: error
|
|
444
|
-
}, icon && /*#__PURE__*/external_react_default().createElement(StyledIcon, {
|
|
445
|
-
$isIconOnly: isIconOnly
|
|
446
|
-
}, icon), label && /*#__PURE__*/external_react_default().createElement(StyledLabel, {
|
|
447
|
-
"data-test": "label",
|
|
448
|
-
$isMenu: isMenu
|
|
449
|
-
}, label), children, isMenu && /*#__PURE__*/external_react_default().createElement(StyledCaretWrapper, {
|
|
450
|
-
$disabled: disabled,
|
|
451
|
-
$primary: appearance === 'primary'
|
|
452
|
-
}, /*#__PURE__*/external_react_default().createElement(icons_CaretSmallDown, null)), openInNewContext && /*#__PURE__*/external_react_default().createElement(icons_External, null)));
|
|
313
|
+
function V(e, t) {
|
|
314
|
+
V = Object.setPrototypeOf || function e(t, n) {
|
|
315
|
+
t.__proto__ = n;
|
|
316
|
+
return t;
|
|
317
|
+
};
|
|
318
|
+
return V(e, t);
|
|
453
319
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
;
|
|
320
|
+
function z(e) {
|
|
321
|
+
var t = L();
|
|
322
|
+
return function n() {
|
|
323
|
+
var r = F(e), i;
|
|
324
|
+
if (t) {
|
|
325
|
+
var a = F(this).constructor;
|
|
326
|
+
i = Reflect.construct(r, arguments, a);
|
|
327
|
+
} else {
|
|
328
|
+
i = r.apply(this, arguments);
|
|
329
|
+
}
|
|
330
|
+
return A(this, i);
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function A(e, t) {
|
|
334
|
+
if (t && (M(t) === "object" || typeof t === "function")) {
|
|
335
|
+
return t;
|
|
336
|
+
}
|
|
337
|
+
return W(e);
|
|
338
|
+
}
|
|
339
|
+
function W(e) {
|
|
340
|
+
if (e === void 0) {
|
|
341
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
342
|
+
}
|
|
343
|
+
return e;
|
|
344
|
+
}
|
|
345
|
+
function L() {
|
|
346
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
347
|
+
if (Reflect.construct.sham) return false;
|
|
348
|
+
if (typeof Proxy === "function") return true;
|
|
349
|
+
try {
|
|
350
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
351
|
+
return true;
|
|
352
|
+
} catch (e) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function F(e) {
|
|
357
|
+
F = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
358
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
359
|
+
};
|
|
360
|
+
return F(e);
|
|
361
|
+
}
|
|
362
|
+
function G(e, t, n) {
|
|
363
|
+
if (t in e) {
|
|
364
|
+
Object.defineProperty(e, t, {
|
|
365
|
+
value: n,
|
|
366
|
+
enumerable: true,
|
|
367
|
+
configurable: true,
|
|
368
|
+
writable: true
|
|
369
|
+
});
|
|
370
|
+
} else {
|
|
371
|
+
e[t] = n;
|
|
372
|
+
}
|
|
373
|
+
return e;
|
|
374
|
+
}
|
|
375
|
+
var J = {
|
|
376
|
+
action: a().string,
|
|
377
|
+
appearance: a().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat" ]),
|
|
378
|
+
append: a().bool,
|
|
379
|
+
children: a().node,
|
|
380
|
+
/** @private An additional className to add to the button. */
|
|
381
|
+
classNamePrivate: a().string,
|
|
382
|
+
disabled: a().bool,
|
|
383
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
384
|
+
error: a().bool,
|
|
385
|
+
icon: a().node,
|
|
386
|
+
inline: a().bool,
|
|
387
|
+
isMenu: a().bool,
|
|
388
|
+
label: a().node,
|
|
389
|
+
onClick: a().func,
|
|
390
|
+
openInNewContext: a().bool,
|
|
391
|
+
prepend: a().bool,
|
|
392
|
+
selected: a().bool,
|
|
393
|
+
to: a().string,
|
|
394
|
+
value: a().any
|
|
395
|
+
};
|
|
396
|
+
var K = {
|
|
397
|
+
appearance: "default",
|
|
398
|
+
append: false,
|
|
399
|
+
disabled: false,
|
|
400
|
+
error: false,
|
|
401
|
+
inline: true,
|
|
402
|
+
isMenu: false,
|
|
403
|
+
openInNewContext: false,
|
|
404
|
+
prepend: false,
|
|
405
|
+
selected: false
|
|
406
|
+
};
|
|
407
|
+
var Q = function(e) {
|
|
408
|
+
H(n, e);
|
|
409
|
+
var t = z(n);
|
|
410
|
+
// @docs-props-type ButtonPropsBase
|
|
411
|
+
function n(e) {
|
|
412
|
+
var r;
|
|
413
|
+
R(this, n);
|
|
414
|
+
r = t.call(this, e);
|
|
415
|
+
G(W(r), "component", null);
|
|
416
|
+
G(W(r), "handleClick", (function(e) {
|
|
417
|
+
var t = r.props, n = t.label, i = t.icon, a = t.value, o = t.action, l = t.onClick;
|
|
418
|
+
l === null || l === void 0 ? void 0 : l(e, {
|
|
419
|
+
label: n,
|
|
420
|
+
icon: i,
|
|
421
|
+
value: a,
|
|
422
|
+
action: o
|
|
423
|
+
});
|
|
424
|
+
}));
|
|
425
|
+
G(W(r), "handleMount", (function(e) {
|
|
426
|
+
r.component = e;
|
|
427
|
+
}));
|
|
428
|
+
if (false) {}
|
|
429
|
+
return r;
|
|
430
|
+
}
|
|
431
|
+
D(n, [ {
|
|
432
|
+
key: "focus",
|
|
433
|
+
/**
|
|
434
|
+
* Places focus on the button.
|
|
435
|
+
*/
|
|
436
|
+
value: function e() {
|
|
437
|
+
var t;
|
|
438
|
+
(t = this.component) === null || t === void 0 ? void 0 : t.focus();
|
|
439
|
+
}
|
|
440
|
+
}, {
|
|
441
|
+
key: "render",
|
|
442
|
+
value: function e() {
|
|
443
|
+
var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, c = t.classNamePrivate, p = t.disabled, u = t.error, f = t.icon, d = t.inline, m = t.isMenu, g = t.onClick, w = t.openInNewContext, k = t.prepend, S = t.to, C = t.value;
|
|
444
|
+
var q = this.props, _ = q.children, $ = q.label;
|
|
445
|
+
if (!$ && l()(_)) {
|
|
446
|
+
$ = _;
|
|
447
|
+
_ = null;
|
|
448
|
+
}
|
|
449
|
+
var I = !!(f && !$ && !m && !_);
|
|
450
|
+
var E = S && w || m || !!f;
|
|
451
|
+
|
|
452
|
+
return r().createElement(y, T({
|
|
453
|
+
"aria-haspopup": m || undefined,
|
|
454
|
+
"aria-invalid": u || undefined,
|
|
455
|
+
"data-test": "button"
|
|
456
|
+
}, this.props, {
|
|
457
|
+
className: (0, s.toClassName)(o, c),
|
|
458
|
+
"data-action": n,
|
|
459
|
+
"data-inline": d || null,
|
|
460
|
+
disabled: p,
|
|
461
|
+
append: a,
|
|
462
|
+
prepend: k,
|
|
463
|
+
$inline: d,
|
|
464
|
+
$hasPrismaIcon: E,
|
|
465
|
+
$isIconOnly: I,
|
|
466
|
+
$isMenu: m,
|
|
467
|
+
value: C,
|
|
468
|
+
onClick: g ? this.handleClick : undefined,
|
|
469
|
+
ref: this.handleMount,
|
|
470
|
+
openInNewContext: w,
|
|
471
|
+
appearance: i
|
|
472
|
+
}), r().createElement(b, {
|
|
473
|
+
$appearance: i,
|
|
474
|
+
$error: u
|
|
475
|
+
}, f && r().createElement(v, {
|
|
476
|
+
$isIconOnly: I
|
|
477
|
+
}, f), $ && r().createElement(h, {
|
|
478
|
+
"data-test": "label",
|
|
479
|
+
$isMenu: m
|
|
480
|
+
}, $), _, m && r().createElement(x, {
|
|
481
|
+
$disabled: p,
|
|
482
|
+
$primary: i === "primary"
|
|
483
|
+
}, r().createElement(O, null)), w && r().createElement(N, null)));
|
|
484
|
+
}
|
|
485
|
+
} ]);
|
|
486
|
+
return n;
|
|
487
|
+
}(n.Component);
|
|
488
|
+
G(Q, "propTypes", J);
|
|
489
|
+
G(Q, "defaultProps", K);
|
|
490
|
+
G(Q, c.legacyRefMode, true);
|
|
491
|
+
/* harmony default export */ const U = Q;
|
|
492
|
+
// CONCATENATED MODULE: ./src/Button/index.ts
|
|
493
|
+
module.exports = t;
|
|
494
|
+
/******/})();
|