@splunk/react-ui 4.38.0 → 4.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +28 -0
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1589 -1902
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +1077 -1345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +60 -68
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +14 -14
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Color.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/***/ (e, t, r) => {
|
|
7
7
|
// EXPORTS
|
|
8
8
|
r.d(t, {
|
|
9
|
-
default: () => /* reexport */
|
|
9
|
+
default: () => /* reexport */ b
|
|
10
10
|
});
|
|
11
11
|
// EXTERNAL MODULE: external "react"
|
|
12
12
|
var n = r(9497);
|
|
@@ -18,51 +18,43 @@
|
|
|
18
18
|
var i = r(232);
|
|
19
19
|
var s = r.n(i);
|
|
20
20
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
21
|
-
var
|
|
21
|
+
var u = r(3563);
|
|
22
22
|
// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts
|
|
23
|
-
var
|
|
23
|
+
var c = s().span.withConfig({
|
|
24
24
|
displayName: "ScreenReaderContentStyles__Styled",
|
|
25
25
|
componentId: "sc-1lnohwp-0"
|
|
26
|
-
})([ "", ";" ],
|
|
26
|
+
})([ "", ";" ], u.mixins.screenReaderContent());
|
|
27
27
|
// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContent.tsx
|
|
28
28
|
function p() {
|
|
29
|
-
p = Object.assign
|
|
29
|
+
return p = Object.assign ? Object.assign.bind() : function(e) {
|
|
30
30
|
for (var t = 1; t < arguments.length; t++) {
|
|
31
31
|
var r = arguments[t];
|
|
32
32
|
for (var n in r) {
|
|
33
|
-
|
|
34
|
-
e[n] = r[n];
|
|
35
|
-
}
|
|
33
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
return e;
|
|
39
|
-
};
|
|
40
|
-
return p.apply(this, arguments);
|
|
37
|
+
}, p.apply(null, arguments);
|
|
41
38
|
}
|
|
42
39
|
function d(e, t) {
|
|
43
|
-
if (
|
|
44
|
-
var r = f(e, t);
|
|
45
|
-
var n, a;
|
|
40
|
+
if (null == e) return {};
|
|
41
|
+
var r, n, a = f(e, t);
|
|
46
42
|
if (Object.getOwnPropertySymbols) {
|
|
47
43
|
var o = Object.getOwnPropertySymbols(e);
|
|
48
|
-
for (
|
|
49
|
-
|
|
50
|
-
if (t.indexOf(n) >= 0) continue;
|
|
51
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
52
|
-
r[n] = e[n];
|
|
44
|
+
for (n = 0; n < o.length; n++) {
|
|
45
|
+
r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
|
-
return
|
|
48
|
+
return a;
|
|
56
49
|
}
|
|
57
50
|
function f(e, t) {
|
|
58
|
-
if (
|
|
51
|
+
if (null == e) return {};
|
|
59
52
|
var r = {};
|
|
60
|
-
var n
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
r[a] = e[a];
|
|
53
|
+
for (var n in e) {
|
|
54
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
55
|
+
if (t.includes(n)) continue;
|
|
56
|
+
r[n] = e[n];
|
|
57
|
+
}
|
|
66
58
|
}
|
|
67
59
|
return r;
|
|
68
60
|
}
|
|
@@ -77,13 +69,13 @@
|
|
|
77
69
|
var t = e.children, r = e.elementRef, n = d(e, [ "children", "elementRef" ]);
|
|
78
70
|
// @docs-props-type ScreenReaderContentPropsBase
|
|
79
71
|
|
|
80
|
-
return a().createElement(
|
|
72
|
+
return a().createElement(c, p({
|
|
81
73
|
"data-test": "screen-reader-content",
|
|
82
74
|
ref: r
|
|
83
75
|
}, n), t);
|
|
84
76
|
}
|
|
85
77
|
h.propTypes = v;
|
|
86
|
-
/* harmony default export */ const
|
|
78
|
+
/* harmony default export */ const b = h;
|
|
87
79
|
} // CONCATENATED MODULE: ./src/ScreenReaderContent/index.ts
|
|
88
80
|
/***/ ,
|
|
89
81
|
/***/ 3563:
|
|
@@ -188,9 +180,9 @@
|
|
|
188
180
|
r.r(n);
|
|
189
181
|
// EXPORTS
|
|
190
182
|
r.d(n, {
|
|
191
|
-
default: () => /* reexport */
|
|
192
|
-
defaultPalette: () => /* reexport */
|
|
193
|
-
isValidHEX: () => /* reexport */
|
|
183
|
+
default: () => /* reexport */ Ze,
|
|
184
|
+
defaultPalette: () => /* reexport */ Ke,
|
|
185
|
+
isValidHEX: () => /* reexport */ We
|
|
194
186
|
});
|
|
195
187
|
// EXTERNAL MODULE: external "react"
|
|
196
188
|
var e = r(9497);
|
|
@@ -203,10 +195,10 @@
|
|
|
203
195
|
var i = r.n(l);
|
|
204
196
|
// CONCATENATED MODULE: external "lodash/includes"
|
|
205
197
|
const s = require("lodash/includes");
|
|
206
|
-
var
|
|
198
|
+
var u = r.n(s);
|
|
207
199
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
208
|
-
const
|
|
209
|
-
var p = r.n(
|
|
200
|
+
const c = require("lodash/keys");
|
|
201
|
+
var p = r.n(c);
|
|
210
202
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
211
203
|
const d = require("lodash/omit");
|
|
212
204
|
var f = r.n(d);
|
|
@@ -214,39 +206,39 @@
|
|
|
214
206
|
const v = require("lodash/slice");
|
|
215
207
|
var h = r.n(v);
|
|
216
208
|
// CONCATENATED MODULE: external "lodash/startsWith"
|
|
217
|
-
const
|
|
218
|
-
var m = r.n(
|
|
209
|
+
const b = require("lodash/startsWith");
|
|
210
|
+
var m = r.n(b);
|
|
219
211
|
// CONCATENATED MODULE: external "lodash/toLower"
|
|
220
|
-
const
|
|
221
|
-
var g = r.n(
|
|
212
|
+
const y = require("lodash/toLower");
|
|
213
|
+
var g = r.n(y);
|
|
222
214
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
223
215
|
const x = require("lodash/memoize");
|
|
224
216
|
var w = r.n(x);
|
|
225
217
|
// CONCATENATED MODULE: external "tinycolor2"
|
|
226
218
|
const S = require("tinycolor2");
|
|
227
|
-
var
|
|
219
|
+
var C = r.n(S);
|
|
228
220
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
229
|
-
const
|
|
230
|
-
var
|
|
221
|
+
const k = require("@splunk/react-ui/Dropdown");
|
|
222
|
+
var P = r.n(k);
|
|
231
223
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
232
224
|
var E = r(3563);
|
|
233
225
|
// CONCATENATED MODULE: external "@splunk/ui-utils/color"
|
|
234
|
-
const
|
|
226
|
+
const O = require("@splunk/ui-utils/color");
|
|
235
227
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
236
228
|
const I = require("@splunk/ui-utils/i18n");
|
|
237
229
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
238
230
|
const _ = require("@splunk/ui-utils/keyboard");
|
|
239
231
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
240
|
-
const
|
|
232
|
+
const q = require("@splunk/ui-utils/id");
|
|
241
233
|
// EXTERNAL MODULE: external "styled-components"
|
|
242
|
-
var
|
|
243
|
-
var
|
|
234
|
+
var j = r(232);
|
|
235
|
+
var T = r.n(j);
|
|
244
236
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
245
|
-
const
|
|
246
|
-
var B = r.n(
|
|
237
|
+
const R = require("@splunk/react-ui/Text");
|
|
238
|
+
var B = r.n(R);
|
|
247
239
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
248
|
-
const
|
|
249
|
-
var
|
|
240
|
+
const D = require("@splunk/react-ui/ScreenReaderContent");
|
|
241
|
+
var V = r.n(D);
|
|
250
242
|
// CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
|
|
251
243
|
const A = require("@splunk/react-icons/Checkmark");
|
|
252
244
|
var N = r.n(A);
|
|
@@ -258,16 +250,16 @@
|
|
|
258
250
|
enterprise: E.variables.gray80,
|
|
259
251
|
prisma: "rgba(0, 0, 0, 0.2)"
|
|
260
252
|
});
|
|
261
|
-
var K = (0,
|
|
253
|
+
var K = (0, j.css)([ "background-image:linear-gradient( 45deg,", " 25%,transparent 25%,transparent 75%,", " 75%,", " ),linear-gradient( 45deg,", " 25%,transparent 25%,transparent 75%,", " 75%,", " );background-size:10px 10px;background-position:0 0,5px 5px;background-color:", ";" ], z, z, z, z, z, z, (0,
|
|
262
254
|
E.pick)({
|
|
263
255
|
enterprise: "transparent",
|
|
264
256
|
prisma: E.variables.white
|
|
265
257
|
}));
|
|
266
|
-
var F =
|
|
258
|
+
var F = T()(N()).withConfig({
|
|
267
259
|
displayName: "SwatchStyles__StyledCheck",
|
|
268
260
|
componentId: "sc-1wxunhq-0"
|
|
269
261
|
})([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;" ]);
|
|
270
|
-
var M =
|
|
262
|
+
var M = T()(H()).withConfig({
|
|
271
263
|
displayName: "SwatchStyles__StyledClickable",
|
|
272
264
|
componentId: "sc-1wxunhq-1"
|
|
273
265
|
})([ "display:block;flex:0 0 auto;border:1px solid;border-color:", ";", ";", ";", ";", " &:focus{border-color:", ";box-shadow:", ";", "}", " ", " ", " &[disabled]{background-image:linear-gradient(rgba(255,255,255,0.8),rgba(255,255,255,0.8));}", " ", "" ], (0,
|
|
@@ -278,87 +270,79 @@
|
|
|
278
270
|
},
|
|
279
271
|
prisma: E.variables.interactiveColorBorder
|
|
280
272
|
}), (0, E.pick)({
|
|
281
|
-
prisma: (0,
|
|
273
|
+
prisma: (0, j.css)([ "border-radius:2px;" ])
|
|
282
274
|
}), (function(e) {
|
|
283
275
|
var t = e.$value;
|
|
284
|
-
return t === null && (0,
|
|
276
|
+
return t === null && (0, j.css)([ "background-image:linear-gradient( to bottom right,transparent 48%,", ",transparent 52% );", ";" ], (0,
|
|
285
277
|
E.pick)({
|
|
286
278
|
enterprise: "#ed1e24",
|
|
287
279
|
prisma: E.variables.accentColorNegative
|
|
288
280
|
}), (0, E.pick)({
|
|
289
|
-
prisma: (0,
|
|
281
|
+
prisma: (0, j.css)([ "background-color:", ";" ], E.variables.white)
|
|
290
282
|
}));
|
|
291
283
|
}), (function(e) {
|
|
292
284
|
var t = e.$value;
|
|
293
285
|
return t && (t === "transparent" ? K : "background-color: ".concat(t));
|
|
294
286
|
}), (function(e) {
|
|
295
287
|
var t = e.$noBorder;
|
|
296
|
-
return t && (0,
|
|
288
|
+
return t && (0, j.css)([ "border:none;" ]);
|
|
297
289
|
}), E.variables.focusColor, E.variables.focusShadow, (0, E.pick)({
|
|
298
290
|
// Fixes focus shadow being cut off by input (SUI-6401)
|
|
299
|
-
enterprise: (0,
|
|
291
|
+
enterprise: (0, j.css)([ "z-index:1;" ])
|
|
300
292
|
}), (0, E.pick)({
|
|
301
293
|
enterprise: {
|
|
302
|
-
comfortable: (0,
|
|
303
|
-
compact: (0,
|
|
294
|
+
comfortable: (0, j.css)([ "width:32px;height:32px;" ]),
|
|
295
|
+
compact: (0, j.css)([ "width:24px;height:24px;" ])
|
|
304
296
|
},
|
|
305
|
-
prisma: (0,
|
|
297
|
+
prisma: (0, j.css)([ "width:24px;height:24px;" ])
|
|
306
298
|
}), (function(e) {
|
|
307
299
|
var t = e.$prepend;
|
|
308
|
-
return t && (0,
|
|
300
|
+
return t && (0, j.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
|
|
309
301
|
}), (function(e) {
|
|
310
302
|
var t = e.$append;
|
|
311
|
-
return t && (0,
|
|
303
|
+
return t && (0, j.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
|
|
312
304
|
}), (function(e) {
|
|
313
305
|
var t = e.$hasError;
|
|
314
|
-
return t && (0,
|
|
306
|
+
return t && (0, j.css)([ "box-shadow:inset 0 0 0 2px white;border-color:", ";" ], (0,
|
|
315
307
|
E.pick)({
|
|
316
308
|
enterprise: E.variables.errorColor,
|
|
317
309
|
prisma: E.variables.accentColorNegative
|
|
318
310
|
}));
|
|
319
311
|
}), (function(e) {
|
|
320
312
|
var t = e.$showSelected;
|
|
321
|
-
return t && (0,
|
|
313
|
+
return t && (0, j.css)([ "display:flex;align-items:center;justify-content:center;" ]);
|
|
322
314
|
}));
|
|
323
315
|
// CONCATENATED MODULE: ./src/Color/Swatch.tsx
|
|
324
316
|
function L() {
|
|
325
|
-
L = Object.assign
|
|
317
|
+
return L = Object.assign ? Object.assign.bind() : function(e) {
|
|
326
318
|
for (var t = 1; t < arguments.length; t++) {
|
|
327
319
|
var r = arguments[t];
|
|
328
320
|
for (var n in r) {
|
|
329
|
-
|
|
330
|
-
e[n] = r[n];
|
|
331
|
-
}
|
|
321
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
332
322
|
}
|
|
333
323
|
}
|
|
334
324
|
return e;
|
|
335
|
-
};
|
|
336
|
-
return L.apply(this, arguments);
|
|
325
|
+
}, L.apply(null, arguments);
|
|
337
326
|
}
|
|
338
327
|
function U(e, t) {
|
|
339
|
-
if (
|
|
340
|
-
var r = W(e, t);
|
|
341
|
-
var n, a;
|
|
328
|
+
if (null == e) return {};
|
|
329
|
+
var r, n, a = W(e, t);
|
|
342
330
|
if (Object.getOwnPropertySymbols) {
|
|
343
331
|
var o = Object.getOwnPropertySymbols(e);
|
|
344
|
-
for (
|
|
345
|
-
|
|
346
|
-
if (t.indexOf(n) >= 0) continue;
|
|
347
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
348
|
-
r[n] = e[n];
|
|
332
|
+
for (n = 0; n < o.length; n++) {
|
|
333
|
+
r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
349
334
|
}
|
|
350
335
|
}
|
|
351
|
-
return
|
|
336
|
+
return a;
|
|
352
337
|
}
|
|
353
338
|
function W(e, t) {
|
|
354
|
-
if (
|
|
339
|
+
if (null == e) return {};
|
|
355
340
|
var r = {};
|
|
356
|
-
var n
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
r[a] = e[a];
|
|
341
|
+
for (var n in e) {
|
|
342
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
343
|
+
if (t.includes(n)) continue;
|
|
344
|
+
r[n] = e[n];
|
|
345
|
+
}
|
|
362
346
|
}
|
|
363
347
|
return r;
|
|
364
348
|
}
|
|
@@ -377,12 +361,12 @@
|
|
|
377
361
|
showSelected: o().bool
|
|
378
362
|
};
|
|
379
363
|
var G = t().forwardRef((function(e, r) {
|
|
380
|
-
var n = e.append, a = e.error, o = a === void 0 ? false : a, l = e.onClick, i = e.prepend, s = e.value,
|
|
364
|
+
var n = e.append, a = e.error, o = a === void 0 ? false : a, l = e.onClick, i = e.prepend, s = e.value, u = e.noBorder, c = e.showSelected, p = U(e, [ "append", "error", "onClick", "prepend", "value", "noBorder", "showSelected" ]);
|
|
381
365
|
var d = s === null || s === undefined ? (0, I._)("No color") : s;
|
|
382
|
-
|
|
366
|
+
// Only valid hexadecimal strings, 'transparent' and `null` are allowed for background colors
|
|
383
367
|
// Invalid values are converted to `undefined`
|
|
384
368
|
var f = s;
|
|
385
|
-
if (!(typeof f === "string" && ((0,
|
|
369
|
+
if (!(typeof f === "string" && ((0, O.isValidHexColor)(f) || f === "transparent")) && f !== null && f !== undefined) {
|
|
386
370
|
f = undefined;
|
|
387
371
|
}
|
|
388
372
|
|
|
@@ -397,59 +381,59 @@
|
|
|
397
381
|
$append: n,
|
|
398
382
|
$prepend: i,
|
|
399
383
|
$hasError: o,
|
|
400
|
-
$noBorder:
|
|
401
|
-
$showSelected:
|
|
384
|
+
$noBorder: u,
|
|
385
|
+
$showSelected: c,
|
|
402
386
|
"data-test": "swatch",
|
|
403
387
|
"data-test-value": s
|
|
404
|
-
}, p),
|
|
388
|
+
}, p), c && t().createElement(F, {
|
|
405
389
|
"aria-label": (0, I._)("Selected"),
|
|
406
390
|
role: "presentation"
|
|
407
|
-
}), t().createElement(
|
|
391
|
+
}), t().createElement(V(), null, d));
|
|
408
392
|
}));
|
|
409
393
|
G.propTypes = X;
|
|
410
394
|
/* harmony default export */ const J = G;
|
|
411
395
|
// CONCATENATED MODULE: ./src/Color/ColorStyles.ts
|
|
412
|
-
var Q =
|
|
396
|
+
var Q = T().div.withConfig({
|
|
413
397
|
displayName: "ColorStyles__StyledColor",
|
|
414
398
|
componentId: "jxrost-0"
|
|
415
399
|
})([ "", ";flex-direction:row;" ], E.mixins.reset("flex"));
|
|
416
|
-
var Y =
|
|
400
|
+
var Y = T()(J).withConfig({
|
|
417
401
|
displayName: "ColorStyles__StyledInputSwatch",
|
|
418
402
|
componentId: "jxrost-1"
|
|
419
403
|
})([ "", ";" ], (0, E.pick)({
|
|
420
|
-
compact: (0,
|
|
404
|
+
compact: (0, j.css)([ "width:28px;height:28px;" ])
|
|
421
405
|
}));
|
|
422
|
-
var Z =
|
|
406
|
+
var Z = T().div.withConfig({
|
|
423
407
|
displayName: "ColorStyles__StyledInput",
|
|
424
408
|
componentId: "jxrost-2"
|
|
425
409
|
})([ "", ";", "" ], (0, E.pick)({
|
|
426
|
-
enterprise: (0,
|
|
427
|
-
prisma: (0,
|
|
410
|
+
enterprise: (0, j.css)([ "display:flex;" ]),
|
|
411
|
+
prisma: (0, j.css)([ "position:relative;" ])
|
|
428
412
|
}), (function(e) {
|
|
429
413
|
var t = e.$inDropdown;
|
|
430
|
-
return t ? (0,
|
|
414
|
+
return t ? (0, j.css)([ "width:", ";" ], (0, E.pick)({
|
|
431
415
|
enterprise: "100%",
|
|
432
416
|
prisma: "80px"
|
|
433
|
-
})) : (0,
|
|
417
|
+
})) : (0, j.css)([ "flex:0 1 auto;min-width:0;" ]);
|
|
434
418
|
}));
|
|
435
|
-
var ee =
|
|
419
|
+
var ee = T()(B()).withConfig({
|
|
436
420
|
displayName: "ColorStyles__StyledInputText",
|
|
437
421
|
componentId: "jxrost-3"
|
|
438
422
|
})([ "", "" ], (function(e) {
|
|
439
423
|
var t = e.$inDropdown;
|
|
440
|
-
return t && (0,
|
|
424
|
+
return t && (0, j.css)([ "font-size:12px;" ]);
|
|
441
425
|
}));
|
|
442
|
-
var te =
|
|
426
|
+
var te = T()(J).withConfig({
|
|
443
427
|
displayName: "ColorStyles__StyledToggleSwatch",
|
|
444
428
|
componentId: "jxrost-4"
|
|
445
429
|
})([ "", "" ], (0, E.pick)({
|
|
446
430
|
prisma: {
|
|
447
|
-
comfortable: (0,
|
|
448
|
-
compact: (0,
|
|
431
|
+
comfortable: (0, j.css)([ "width:40px;height:40px;" ]),
|
|
432
|
+
compact: (0, j.css)([ "width:32px;height:32px;" ])
|
|
449
433
|
},
|
|
450
434
|
enterprise: {
|
|
451
|
-
comfortable: (0,
|
|
452
|
-
compact: (0,
|
|
435
|
+
comfortable: (0, j.css)([ "width:32px;height:32px;" ]),
|
|
436
|
+
compact: (0, j.css)([ "width:28px;height:28px;" ])
|
|
453
437
|
}
|
|
454
438
|
}));
|
|
455
439
|
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronDown"
|
|
@@ -459,109 +443,104 @@
|
|
|
459
443
|
const ae = require("@splunk/react-ui/Divider");
|
|
460
444
|
var oe = r.n(ae);
|
|
461
445
|
// CONCATENATED MODULE: ./src/Color/PaletteStyles.ts
|
|
462
|
-
var le =
|
|
446
|
+
var le = T().div.withConfig({
|
|
463
447
|
displayName: "PaletteStyles__StyledPalette",
|
|
464
448
|
componentId: "qgv9v9-0"
|
|
465
449
|
})([ "width:220px;padding:", ";" ], E.variables.spacingSmall);
|
|
466
|
-
var ie =
|
|
450
|
+
var ie = T().ul.withConfig({
|
|
467
451
|
displayName: "PaletteStyles__StyledSwatches",
|
|
468
452
|
componentId: "qgv9v9-1"
|
|
469
453
|
})([ "", ";", "" ], E.mixins.reset("block"), (0, E.pick)({
|
|
470
|
-
enterprise: (0,
|
|
454
|
+
enterprise: (0, j.css)([ "margin-bottom:", ";" ], E.variables.spacingXSmall)
|
|
471
455
|
}));
|
|
472
|
-
var se =
|
|
456
|
+
var se = T().li.withConfig({
|
|
473
457
|
displayName: "PaletteStyles__StyledSwatch",
|
|
474
458
|
componentId: "qgv9v9-2"
|
|
475
459
|
})([ "", ";margin-right:4px;margin-bottom:4px;vertical-align:top;", "" ], E.mixins.reset("inline-block"), (0,
|
|
476
460
|
E.pick)({
|
|
477
461
|
enterprise: {
|
|
478
|
-
compact: (0,
|
|
462
|
+
compact: (0, j.css)([ "&:nth-child(8n){margin-right:0;}" ])
|
|
479
463
|
},
|
|
480
|
-
prisma: (0,
|
|
464
|
+
prisma: (0, j.css)([ "&:nth-child(8n){margin-right:0;}" ])
|
|
481
465
|
}));
|
|
482
|
-
var
|
|
466
|
+
var ue = T().div.withConfig({
|
|
483
467
|
displayName: "PaletteStyles__StyledToolBar",
|
|
484
468
|
componentId: "qgv9v9-3"
|
|
485
469
|
})([ "position:relative;display:flex;align-items:center;padding:0;margin-top:", ";", " gap:4px;" ], E.variables.spacingSmall, (0,
|
|
486
470
|
E.pick)({
|
|
487
|
-
enterprise: (0,
|
|
471
|
+
enterprise: (0, j.css)([ "margin-bottom:", ";" ], E.variables.spacingSmall)
|
|
488
472
|
}));
|
|
489
|
-
var
|
|
473
|
+
var ce = T()(H()).withConfig({
|
|
490
474
|
displayName: "PaletteStyles__StyledExpandButton",
|
|
491
475
|
componentId: "qgv9v9-4"
|
|
492
476
|
})([ "position:absolute;bottom:4px;right:4px;padding:2px 4px;border-radius:2px;&:focus{box-shadow:", ";}", "" ], E.variables.focusShadow, (function(e) {
|
|
493
477
|
var t = e.$expanded;
|
|
494
|
-
return t && (0,
|
|
478
|
+
return t && (0, j.css)([ "transform:rotate(180deg);" ]);
|
|
495
479
|
}));
|
|
496
|
-
var pe =
|
|
480
|
+
var pe = T().div.withConfig({
|
|
497
481
|
displayName: "PaletteStyles__StyledSystemColorPickerWrapper",
|
|
498
482
|
componentId: "qgv9v9-5"
|
|
499
483
|
})([ "position:relative;" ]);
|
|
500
|
-
var de =
|
|
484
|
+
var de = T().input.withConfig({
|
|
501
485
|
displayName: "PaletteStyles__StyledSystemColorPicker",
|
|
502
486
|
componentId: "qgv9v9-6"
|
|
503
487
|
})([ "box-sizing:border-box;", " ", ";", ";outline:none;appearance:none;padding:1px 10px;", " margin:0;background:conic-gradient( #ef3434,#ef9a34,#deef34,#78ef34,#34ef56,#34efbc,#34bcef,#3456ef,#7834ef,#de34ef,#ef349a,#ef3434 );background-repeat:no-repeat;cursor:pointer;&::-webkit-color-swatch{border:none;border-radius:2px;}&::-moz-color-swatch{opacity:0;}&:focus{box-shadow:", ";}" ], (0,
|
|
504
488
|
E.pick)({
|
|
505
489
|
enterprise: {
|
|
506
|
-
comfortable: (0,
|
|
507
|
-
compact: (0,
|
|
490
|
+
comfortable: (0, j.css)([ "width:32px;height:32px;" ]),
|
|
491
|
+
compact: (0, j.css)([ "width:24px;height:24px;" ])
|
|
508
492
|
},
|
|
509
|
-
prisma: (0,
|
|
493
|
+
prisma: (0, j.css)([ "width:24px;height:24px;" ])
|
|
510
494
|
}), (0, E.pick)({
|
|
511
495
|
enterprise: {
|
|
512
|
-
light: (0,
|
|
513
|
-
dark: (0,
|
|
496
|
+
light: (0, j.css)([ "border:1px solid ", ";" ], E.variables.gray60),
|
|
497
|
+
dark: (0, j.css)([ "border:1px solid ", ";" ], E.variables.borderColor)
|
|
514
498
|
},
|
|
515
|
-
prisma: (0,
|
|
499
|
+
prisma: (0, j.css)([ "border:none;" ])
|
|
516
500
|
}), (0, E.pick)({
|
|
517
|
-
prisma: (0,
|
|
501
|
+
prisma: (0, j.css)([ "border-radius:2px;" ])
|
|
518
502
|
}), (0, E.pick)({
|
|
519
503
|
enterprise: {
|
|
520
|
-
comfortable: (0,
|
|
504
|
+
comfortable: (0, j.css)([ "padding:1px 14px;" ])
|
|
521
505
|
}
|
|
522
506
|
}), E.variables.focusShadow);
|
|
523
|
-
var fe =
|
|
507
|
+
var fe = T()(N()).withConfig({
|
|
524
508
|
displayName: "PaletteStyles__StyledCheck",
|
|
525
509
|
componentId: "qgv9v9-7"
|
|
526
510
|
})([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;position:absolute;top:0;left:0;pointer-events:none;" ]);
|
|
527
511
|
// CONCATENATED MODULE: ./src/Color/Palette.tsx
|
|
528
512
|
function ve(e, t) {
|
|
529
|
-
if (
|
|
530
|
-
var r = he(e, t);
|
|
531
|
-
var n, a;
|
|
513
|
+
if (null == e) return {};
|
|
514
|
+
var r, n, a = he(e, t);
|
|
532
515
|
if (Object.getOwnPropertySymbols) {
|
|
533
516
|
var o = Object.getOwnPropertySymbols(e);
|
|
534
|
-
for (
|
|
535
|
-
|
|
536
|
-
if (t.indexOf(n) >= 0) continue;
|
|
537
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
538
|
-
r[n] = e[n];
|
|
517
|
+
for (n = 0; n < o.length; n++) {
|
|
518
|
+
r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
539
519
|
}
|
|
540
520
|
}
|
|
541
|
-
return
|
|
521
|
+
return a;
|
|
542
522
|
}
|
|
543
523
|
function he(e, t) {
|
|
544
|
-
if (
|
|
524
|
+
if (null == e) return {};
|
|
545
525
|
var r = {};
|
|
546
|
-
var n
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
r[a] = e[a];
|
|
526
|
+
for (var n in e) {
|
|
527
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
528
|
+
if (t.includes(n)) continue;
|
|
529
|
+
r[n] = e[n];
|
|
530
|
+
}
|
|
552
531
|
}
|
|
553
532
|
return r;
|
|
554
533
|
}
|
|
555
|
-
function
|
|
556
|
-
var r = e.expanded, n = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand,
|
|
557
|
-
var
|
|
558
|
-
var
|
|
534
|
+
function be(e) {
|
|
535
|
+
var r = e.expanded, n = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand, c = e.onSystemColorPickerChange, p = e.renderInput, d = e.disabled, f = ve(e, [ "expanded", "palette", "value", "swatchToFocusRef", "onSwatchClick", "expandButtonRef", "onPaletteExpand", "onSystemColorPickerChange", "renderInput", "disabled" ]);
|
|
536
|
+
var v = (0, E.useSplunkTheme)(), b = v.isPrisma, m = v.isLight;
|
|
537
|
+
var y = u()(n.map((function(e) {
|
|
559
538
|
return e && g()(e);
|
|
560
539
|
})), a);
|
|
561
|
-
var
|
|
540
|
+
var x = n.map((function(e, r) {
|
|
562
541
|
var n = e === null ? null : g()(e);
|
|
563
542
|
var i = n === a;
|
|
564
|
-
var s = !
|
|
543
|
+
var s = !y && r === 0 || y && i;
|
|
565
544
|
|
|
566
545
|
return t().createElement(se, {
|
|
567
546
|
key: n || "null"
|
|
@@ -569,55 +548,60 @@
|
|
|
569
548
|
value: n,
|
|
570
549
|
ref: s ? o : null,
|
|
571
550
|
onClick: l,
|
|
572
|
-
noBorder:
|
|
573
|
-
showSelected: i
|
|
551
|
+
noBorder: b,
|
|
552
|
+
showSelected: i,
|
|
553
|
+
disabled: d
|
|
574
554
|
}));
|
|
575
555
|
}));
|
|
576
|
-
var
|
|
577
|
-
var r = !
|
|
556
|
+
var w = function e() {
|
|
557
|
+
var r = !y && a !== "#ffffff" && a !== "#000000" && a !== null && a !== "";
|
|
578
558
|
|
|
579
|
-
return t().createElement(
|
|
559
|
+
return t().createElement(ue, {
|
|
580
560
|
"data-test": "tool-bar"
|
|
581
|
-
},
|
|
561
|
+
}, b && t().createElement(E.SplunkThemeProvider, {
|
|
582
562
|
density: "compact"
|
|
583
563
|
}, p && p()), t().createElement(J, {
|
|
584
564
|
value: null,
|
|
585
565
|
ref: a === null ? o : null,
|
|
586
566
|
onClick: l,
|
|
587
|
-
noBorder:
|
|
588
|
-
showSelected: a === null
|
|
567
|
+
noBorder: b && !m,
|
|
568
|
+
showSelected: a === null,
|
|
569
|
+
disabled: d
|
|
589
570
|
}), t().createElement(J, {
|
|
590
571
|
value: "#ffffff",
|
|
591
572
|
ref: a === "#ffffff" ? o : null,
|
|
592
573
|
onClick: l,
|
|
593
|
-
noBorder:
|
|
594
|
-
showSelected: a === "#ffffff"
|
|
574
|
+
noBorder: b && !m,
|
|
575
|
+
showSelected: a === "#ffffff",
|
|
576
|
+
disabled: d
|
|
595
577
|
}), t().createElement(J, {
|
|
596
578
|
value: "#000000",
|
|
597
579
|
ref: a === "#000000" ? o : null,
|
|
598
580
|
onClick: l,
|
|
599
|
-
noBorder:
|
|
600
|
-
showSelected: a === "#000000"
|
|
581
|
+
noBorder: b,
|
|
582
|
+
showSelected: a === "#000000",
|
|
583
|
+
disabled: d
|
|
601
584
|
}), t().createElement(pe, null, t().createElement(de, {
|
|
602
585
|
type: "color",
|
|
603
586
|
value: a === null ? "" : a,
|
|
604
|
-
onChange:
|
|
605
|
-
ref: r ? o : null
|
|
587
|
+
onChange: c,
|
|
588
|
+
ref: r ? o : null,
|
|
589
|
+
disabled: d
|
|
606
590
|
}), r && t().createElement(fe, {
|
|
607
591
|
"aria-label": (0, I._)("Selected"),
|
|
608
592
|
role: "presentation"
|
|
609
593
|
})));
|
|
610
594
|
};
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var k = h()(
|
|
614
|
-
if (
|
|
595
|
+
var S = x.length === 8 ? 7 : 15;
|
|
596
|
+
var C = h()(x, 0, S);
|
|
597
|
+
var k = h()(x, S);
|
|
598
|
+
if (b) {
|
|
615
599
|
|
|
616
|
-
return t().createElement(le,
|
|
600
|
+
return t().createElement(le, f, t().createElement("div", {
|
|
617
601
|
style: {
|
|
618
602
|
position: "relative"
|
|
619
603
|
}
|
|
620
|
-
}, t().createElement(ie, null,
|
|
604
|
+
}, t().createElement(ie, null, C, r && k), r && w(), t().createElement(ce, {
|
|
621
605
|
ref: i,
|
|
622
606
|
$expanded: r,
|
|
623
607
|
onClick: s,
|
|
@@ -625,191 +609,170 @@
|
|
|
625
609
|
}, t().createElement(ne(), null))));
|
|
626
610
|
}
|
|
627
611
|
|
|
628
|
-
return t().createElement(le,
|
|
612
|
+
return t().createElement(le, f, t().createElement(ie, null, x), t().createElement(oe(), null), w(), p && p());
|
|
629
613
|
}
|
|
630
|
-
/* harmony default export */ const me =
|
|
614
|
+
/* harmony default export */ const me = be;
|
|
631
615
|
// EXTERNAL MODULE: ./src/ScreenReaderContent/index.ts + 2 modules
|
|
632
|
-
var
|
|
616
|
+
var ye = r(6165);
|
|
633
617
|
// CONCATENATED MODULE: ./src/Color/Color.tsx
|
|
634
618
|
function ge(e) {
|
|
635
619
|
"@babel/helpers - typeof";
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
ge = function e(t) {
|
|
642
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
return ge(e);
|
|
620
|
+
return ge = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
621
|
+
return typeof e;
|
|
622
|
+
} : function(e) {
|
|
623
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
624
|
+
}, ge(e);
|
|
646
625
|
}
|
|
647
626
|
function xe() {
|
|
648
|
-
xe = Object.assign
|
|
627
|
+
return xe = Object.assign ? Object.assign.bind() : function(e) {
|
|
649
628
|
for (var t = 1; t < arguments.length; t++) {
|
|
650
629
|
var r = arguments[t];
|
|
651
630
|
for (var n in r) {
|
|
652
|
-
|
|
653
|
-
e[n] = r[n];
|
|
654
|
-
}
|
|
631
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
655
632
|
}
|
|
656
633
|
}
|
|
657
634
|
return e;
|
|
658
|
-
};
|
|
659
|
-
return xe.apply(this, arguments);
|
|
635
|
+
}, xe.apply(null, arguments);
|
|
660
636
|
}
|
|
661
637
|
function we(e) {
|
|
662
|
-
return
|
|
638
|
+
return Pe(e) || ke(e) || Ce(e) || Se();
|
|
663
639
|
}
|
|
664
640
|
function Se() {
|
|
665
641
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
666
642
|
}
|
|
667
|
-
function
|
|
668
|
-
if (
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Ee(e, t);
|
|
643
|
+
function Ce(e, t) {
|
|
644
|
+
if (e) {
|
|
645
|
+
if ("string" == typeof e) return Ee(e, t);
|
|
646
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
647
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ee(e, t) : void 0;
|
|
648
|
+
}
|
|
674
649
|
}
|
|
675
|
-
function
|
|
676
|
-
if (typeof Symbol
|
|
650
|
+
function ke(e) {
|
|
651
|
+
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
677
652
|
}
|
|
678
|
-
function
|
|
653
|
+
function Pe(e) {
|
|
679
654
|
if (Array.isArray(e)) return Ee(e);
|
|
680
655
|
}
|
|
681
656
|
function Ee(e, t) {
|
|
682
|
-
|
|
683
|
-
for (var r = 0, n =
|
|
657
|
+
(null == t || t > e.length) && (t = e.length);
|
|
658
|
+
for (var r = 0, n = Array(t); r < t; r++) {
|
|
684
659
|
n[r] = e[r];
|
|
685
660
|
}
|
|
686
661
|
return n;
|
|
687
662
|
}
|
|
688
|
-
function
|
|
689
|
-
if (
|
|
690
|
-
var r = Ie(e, t);
|
|
691
|
-
var n, a;
|
|
663
|
+
function Oe(e, t) {
|
|
664
|
+
if (null == e) return {};
|
|
665
|
+
var r, n, a = Ie(e, t);
|
|
692
666
|
if (Object.getOwnPropertySymbols) {
|
|
693
667
|
var o = Object.getOwnPropertySymbols(e);
|
|
694
|
-
for (
|
|
695
|
-
|
|
696
|
-
if (t.indexOf(n) >= 0) continue;
|
|
697
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
698
|
-
r[n] = e[n];
|
|
668
|
+
for (n = 0; n < o.length; n++) {
|
|
669
|
+
r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
699
670
|
}
|
|
700
671
|
}
|
|
701
|
-
return
|
|
672
|
+
return a;
|
|
702
673
|
}
|
|
703
674
|
function Ie(e, t) {
|
|
704
|
-
if (
|
|
675
|
+
if (null == e) return {};
|
|
705
676
|
var r = {};
|
|
706
|
-
var n
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
r[a] = e[a];
|
|
677
|
+
for (var n in e) {
|
|
678
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
679
|
+
if (t.includes(n)) continue;
|
|
680
|
+
r[n] = e[n];
|
|
681
|
+
}
|
|
712
682
|
}
|
|
713
683
|
return r;
|
|
714
684
|
}
|
|
715
685
|
function _e(e, t) {
|
|
716
|
-
if (!(e instanceof t))
|
|
717
|
-
throw new TypeError("Cannot call a class as a function");
|
|
718
|
-
}
|
|
686
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
719
687
|
}
|
|
720
|
-
function
|
|
688
|
+
function qe(e, t) {
|
|
721
689
|
for (var r = 0; r < t.length; r++) {
|
|
722
690
|
var n = t[r];
|
|
723
|
-
n.enumerable = n.enumerable ||
|
|
724
|
-
n.
|
|
725
|
-
if ("value" in n) n.writable = true;
|
|
726
|
-
Object.defineProperty(e, n.key, n);
|
|
691
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
692
|
+
Object.defineProperty(e, He(n.key), n);
|
|
727
693
|
}
|
|
728
694
|
}
|
|
729
|
-
function
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
695
|
+
function je(e, t, r) {
|
|
696
|
+
return t && qe(e.prototype, t), r && qe(e, r), Object.defineProperty(e, "prototype", {
|
|
697
|
+
writable: !1
|
|
698
|
+
}), e;
|
|
733
699
|
}
|
|
734
|
-
function
|
|
735
|
-
if (typeof t !== "
|
|
736
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
737
|
-
}
|
|
700
|
+
function Te(e, t) {
|
|
701
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
738
702
|
e.prototype = Object.create(t && t.prototype, {
|
|
739
703
|
constructor: {
|
|
740
704
|
value: e,
|
|
741
|
-
writable:
|
|
742
|
-
configurable:
|
|
705
|
+
writable: !0,
|
|
706
|
+
configurable: !0
|
|
743
707
|
}
|
|
744
|
-
})
|
|
745
|
-
|
|
708
|
+
}), Object.defineProperty(e, "prototype", {
|
|
709
|
+
writable: !1
|
|
710
|
+
}), t && Re(e, t);
|
|
746
711
|
}
|
|
747
|
-
function
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
};
|
|
752
|
-
return Te(e, t);
|
|
712
|
+
function Re(e, t) {
|
|
713
|
+
return Re = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
714
|
+
return e.__proto__ = t, e;
|
|
715
|
+
}, Re(e, t);
|
|
753
716
|
}
|
|
754
717
|
function Be(e) {
|
|
755
718
|
var t = Ae();
|
|
756
|
-
return function
|
|
757
|
-
var n = Ne(e)
|
|
719
|
+
return function() {
|
|
720
|
+
var r, n = Ne(e);
|
|
758
721
|
if (t) {
|
|
759
|
-
var
|
|
760
|
-
|
|
761
|
-
} else
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
return Ve(this, a);
|
|
722
|
+
var a = Ne(this).constructor;
|
|
723
|
+
r = Reflect.construct(n, arguments, a);
|
|
724
|
+
} else r = n.apply(this, arguments);
|
|
725
|
+
return De(this, r);
|
|
765
726
|
};
|
|
766
727
|
}
|
|
767
|
-
function
|
|
768
|
-
if (t && (ge(t)
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return De(e);
|
|
728
|
+
function De(e, t) {
|
|
729
|
+
if (t && ("object" == ge(t) || "function" == typeof t)) return t;
|
|
730
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
731
|
+
return Ve(e);
|
|
772
732
|
}
|
|
773
|
-
function
|
|
774
|
-
if (
|
|
775
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
776
|
-
}
|
|
733
|
+
function Ve(e) {
|
|
734
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
777
735
|
return e;
|
|
778
736
|
}
|
|
779
737
|
function Ae() {
|
|
780
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
781
|
-
if (Reflect.construct.sham) return false;
|
|
782
|
-
if (typeof Proxy === "function") return true;
|
|
783
738
|
try {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
return
|
|
788
|
-
}
|
|
739
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
740
|
+
} catch (e) {}
|
|
741
|
+
return (Ae = function t() {
|
|
742
|
+
return !!e;
|
|
743
|
+
})();
|
|
789
744
|
}
|
|
790
745
|
function Ne(e) {
|
|
791
|
-
Ne = Object.setPrototypeOf ? Object.getPrototypeOf : function
|
|
792
|
-
return
|
|
793
|
-
};
|
|
794
|
-
return Ne(e);
|
|
746
|
+
return Ne = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
747
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
748
|
+
}, Ne(e);
|
|
795
749
|
}
|
|
796
750
|
function $e(e, t, r) {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
751
|
+
return (t = He(t)) in e ? Object.defineProperty(e, t, {
|
|
752
|
+
value: r,
|
|
753
|
+
enumerable: !0,
|
|
754
|
+
configurable: !0,
|
|
755
|
+
writable: !0
|
|
756
|
+
}) : e[t] = r, e;
|
|
757
|
+
}
|
|
758
|
+
function He(e) {
|
|
759
|
+
var t = ze(e, "string");
|
|
760
|
+
return "symbol" == ge(t) ? t : t + "";
|
|
761
|
+
}
|
|
762
|
+
function ze(e, t) {
|
|
763
|
+
if ("object" != ge(e) || !e) return e;
|
|
764
|
+
var r = e[Symbol.toPrimitive];
|
|
765
|
+
if (void 0 !== r) {
|
|
766
|
+
var n = r.call(e, t || "default");
|
|
767
|
+
if ("object" != ge(n)) return n;
|
|
768
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
806
769
|
}
|
|
807
|
-
return e;
|
|
770
|
+
return ("string" === t ? String : Number)(e);
|
|
808
771
|
}
|
|
809
772
|
/** @public */
|
|
810
773
|
// The default palette in Prisma theme.
|
|
811
|
-
var
|
|
812
|
-
var
|
|
774
|
+
var Ke = [ "#912344", "#D44C20", "#C0891E", "#26AA92", "#2F8AA7", "#2E49AA", "#602CA1", "#BA4ABD" ];
|
|
775
|
+
var Fe = w()((function(e) {
|
|
813
776
|
var t = [];
|
|
814
777
|
for (var r = 1; r <= e.length * 4; r += 1) {
|
|
815
778
|
var n = e[(r - 1) % e.length];
|
|
@@ -817,14 +780,14 @@
|
|
|
817
780
|
t.push(n);
|
|
818
781
|
} else {
|
|
819
782
|
var a = 40 - 10 * (r / e.length);
|
|
820
|
-
t.push(
|
|
783
|
+
t.push(C()(n).lighten(a).toString());
|
|
821
784
|
}
|
|
822
785
|
}
|
|
823
786
|
return t;
|
|
824
787
|
}));
|
|
825
|
-
|
|
826
|
-
var
|
|
827
|
-
var
|
|
788
|
+
// The tool palette in Prisma theme.
|
|
789
|
+
var Me = [ "#ffffff", "#000000", null ];
|
|
790
|
+
var Le = {
|
|
828
791
|
append: o().bool,
|
|
829
792
|
defaultValue: o().string,
|
|
830
793
|
describedBy: o().string,
|
|
@@ -843,29 +806,43 @@
|
|
|
843
806
|
splunkTheme: o().object,
|
|
844
807
|
value: o().string
|
|
845
808
|
};
|
|
846
|
-
var
|
|
809
|
+
var Ue = {
|
|
847
810
|
append: false,
|
|
848
811
|
disabled: false,
|
|
849
812
|
error: false,
|
|
850
|
-
palette:
|
|
813
|
+
palette: Fe(Ke),
|
|
851
814
|
prepend: false
|
|
852
815
|
};
|
|
853
816
|
// TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
|
|
854
|
-
var
|
|
855
|
-
return (0,
|
|
817
|
+
var We = function e(t) {
|
|
818
|
+
return (0, O.isValidHexColor)(t);
|
|
819
|
+
};
|
|
820
|
+
var Xe = "N/A";
|
|
821
|
+
var Ge = "n/a";
|
|
822
|
+
var Je = function e(t) {
|
|
823
|
+
if (g()(t) === Ge) {
|
|
824
|
+
return Xe;
|
|
825
|
+
}
|
|
826
|
+
if (g()(t) === "transparent") {
|
|
827
|
+
return "transparent";
|
|
828
|
+
}
|
|
829
|
+
// If the user types in the hexadecimal number without # in front,
|
|
830
|
+
// we add # automatically.
|
|
831
|
+
if (!m()(t, "#")) {
|
|
832
|
+
return (0, O.expandShortHandHex)("#".concat(t));
|
|
833
|
+
}
|
|
834
|
+
return (0, O.expandShortHandHex)(t);
|
|
856
835
|
};
|
|
857
|
-
var Ue = "N/A";
|
|
858
|
-
var We = "n/a";
|
|
859
836
|
/*
|
|
860
837
|
* When the dropdown opens:
|
|
861
838
|
* 1. If palette contains the color and the color is selected, the dropdown focus the color.
|
|
862
839
|
* 2. If palette doesn't contain the color:
|
|
863
840
|
* 1. If the current theme `family` is `prisma` the input receives focus.
|
|
864
841
|
* 2. Otherwise the first color swatch receives focus.
|
|
865
|
-
*/ var
|
|
866
|
-
|
|
842
|
+
*/ var Qe = function(e) {
|
|
843
|
+
Te(n, e);
|
|
867
844
|
var r = Be(n);
|
|
868
|
-
|
|
845
|
+
je(n, null, [ {
|
|
869
846
|
key: "hasNull",
|
|
870
847
|
// @docs-props-type ColorPropsBase
|
|
871
848
|
value: function e(t) {
|
|
@@ -885,26 +862,26 @@
|
|
|
885
862
|
var a;
|
|
886
863
|
_e(this, n);
|
|
887
864
|
a = r.call(this, e);
|
|
888
|
-
$e(
|
|
889
|
-
$e(
|
|
890
|
-
$e(
|
|
891
|
-
$e(
|
|
892
|
-
$e(
|
|
893
|
-
$e(
|
|
894
|
-
$e(
|
|
865
|
+
$e(Ve(a), "focusSwatch", void 0);
|
|
866
|
+
$e(Ve(a), "focusExpandButton", void 0);
|
|
867
|
+
$e(Ve(a), "controlledExternally", void 0);
|
|
868
|
+
$e(Ve(a), "dropdown", null);
|
|
869
|
+
$e(Ve(a), "swatchToggleReaderContentId", (0, q.createDOMID)("swatch-reader-content"));
|
|
870
|
+
$e(Ve(a), "hexInputReaderContentId", (0, q.createDOMID)("hex-input-reader-content"));
|
|
871
|
+
$e(Ve(a), "handleSwatchClick", (function(e, t) {
|
|
895
872
|
var r = t.value;
|
|
896
873
|
e.preventDefault();
|
|
897
874
|
var n = a.props, o = n.name, l = n.onChange;
|
|
898
875
|
var i = a.getValue();
|
|
899
876
|
var s = r !== i;
|
|
900
|
-
var
|
|
877
|
+
var u = r === null ? Xe : r;
|
|
901
878
|
if (!a.isControlled()) {
|
|
902
879
|
a.setState({
|
|
903
880
|
value: r
|
|
904
881
|
});
|
|
905
882
|
}
|
|
906
883
|
a.setState({
|
|
907
|
-
displayValue:
|
|
884
|
+
displayValue: u,
|
|
908
885
|
open: false
|
|
909
886
|
});
|
|
910
887
|
if (s) {
|
|
@@ -915,20 +892,20 @@
|
|
|
915
892
|
}
|
|
916
893
|
a.focus();
|
|
917
894
|
}));
|
|
918
|
-
$e(
|
|
895
|
+
$e(Ve(a), "handlePaletteExpand", (function() {
|
|
919
896
|
a.setState((function(e) {
|
|
920
897
|
return {
|
|
921
898
|
expanded: !e.expanded
|
|
922
899
|
};
|
|
923
900
|
}));
|
|
924
901
|
}));
|
|
925
|
-
$e(
|
|
902
|
+
$e(Ve(a), "handleTextChange", (function(e, t) {
|
|
926
903
|
var r = t.value;
|
|
927
904
|
a.setState({
|
|
928
905
|
displayValue: r
|
|
929
906
|
});
|
|
930
907
|
}));
|
|
931
|
-
$e(
|
|
908
|
+
$e(Ve(a), "handleTextKeyDown", (function(e) {
|
|
932
909
|
if ((0, _.keycode)(e.nativeEvent) === "enter") {
|
|
933
910
|
e.preventDefault();
|
|
934
911
|
a.handleRequestClose({
|
|
@@ -937,45 +914,25 @@
|
|
|
937
914
|
a.focus();
|
|
938
915
|
}
|
|
939
916
|
}));
|
|
940
|
-
$e(
|
|
917
|
+
$e(Ve(a), "handleButtonClick", (function(e) {
|
|
941
918
|
e.preventDefault();
|
|
942
919
|
a.handleRequestClose({
|
|
943
920
|
reason: "buttonClick"
|
|
944
921
|
});
|
|
945
922
|
a.focus();
|
|
946
923
|
}));
|
|
947
|
-
$e(
|
|
924
|
+
$e(Ve(a), "handleRequestClose", (function(e) {
|
|
948
925
|
var t = e.reason;
|
|
949
|
-
var r = a.state.displayValue;
|
|
950
|
-
var
|
|
951
|
-
if (
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
} else if (g()(r) === "transparent") {
|
|
957
|
-
r = "transparent";
|
|
958
|
-
a.setState({
|
|
959
|
-
displayValue: r
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
// If the user types in the hexadecimal number without # in front,
|
|
963
|
-
// we add # automatically.
|
|
964
|
-
if (r !== Ue && g()(r) !== "transparent" && !m()(r, "#")) {
|
|
965
|
-
r = "#".concat(r);
|
|
966
|
-
if (t === "escapeKey") {
|
|
967
|
-
if (n == null) {
|
|
968
|
-
a.setState({
|
|
969
|
-
displayValue: Ue
|
|
970
|
-
});
|
|
971
|
-
} else {
|
|
972
|
-
a.setState({
|
|
973
|
-
displayValue: n
|
|
974
|
-
});
|
|
975
|
-
}
|
|
926
|
+
var r = a.state, n = r.displayValue, o = r.value;
|
|
927
|
+
var l = Je(n);
|
|
928
|
+
if (t === "escapeKey") {
|
|
929
|
+
if (o == null) {
|
|
930
|
+
a.setState({
|
|
931
|
+
displayValue: Xe
|
|
932
|
+
});
|
|
976
933
|
} else {
|
|
977
934
|
a.setState({
|
|
978
|
-
displayValue:
|
|
935
|
+
displayValue: o
|
|
979
936
|
});
|
|
980
937
|
}
|
|
981
938
|
}
|
|
@@ -985,14 +942,17 @@
|
|
|
985
942
|
});
|
|
986
943
|
}
|
|
987
944
|
if (t !== "escapeKey") {
|
|
988
|
-
a.
|
|
945
|
+
a.setState({
|
|
946
|
+
displayValue: l
|
|
947
|
+
});
|
|
948
|
+
a.submitValue(l);
|
|
989
949
|
}
|
|
990
950
|
}));
|
|
991
|
-
$e(
|
|
951
|
+
$e(Ve(a), "handleRequestOpen", (function() {
|
|
992
952
|
var e = a.props, t = e.splunkTheme, r = e.palette;
|
|
993
953
|
var n = t.isPrisma;
|
|
994
954
|
var o = a.getValue();
|
|
995
|
-
var l = o === null ?
|
|
955
|
+
var l = o === null ? Xe : o;
|
|
996
956
|
a.setState({
|
|
997
957
|
displayValue: l,
|
|
998
958
|
open: true
|
|
@@ -1002,23 +962,23 @@
|
|
|
1002
962
|
}
|
|
1003
963
|
}));
|
|
1004
964
|
var i = n ? h()(r, 15) : r;
|
|
1005
|
-
var s = !
|
|
965
|
+
var s = !u()(r.map((function(e) {
|
|
1006
966
|
return e && g()(e);
|
|
1007
967
|
})), o);
|
|
1008
|
-
var
|
|
968
|
+
var c = s || u()(i.map((function(e) {
|
|
1009
969
|
return e && g()(e);
|
|
1010
|
-
})), o) ||
|
|
1011
|
-
if (
|
|
970
|
+
})), o) || u()(Me, o);
|
|
971
|
+
if (c && !a.state.expanded) {
|
|
1012
972
|
a.setState({
|
|
1013
973
|
expanded: true
|
|
1014
974
|
});
|
|
1015
975
|
}
|
|
1016
976
|
}));
|
|
1017
|
-
$e(
|
|
977
|
+
$e(Ve(a), "handleSystemColorPickerChange", (function(e) {
|
|
1018
978
|
var t = a.getValue();
|
|
1019
979
|
var r = e !== t;
|
|
1020
980
|
var n = a.props.name;
|
|
1021
|
-
var o = e === null ?
|
|
981
|
+
var o = e === null ? Xe : e;
|
|
1022
982
|
if (!a.isControlled()) {
|
|
1023
983
|
a.setState({
|
|
1024
984
|
value: e
|
|
@@ -1038,14 +998,14 @@
|
|
|
1038
998
|
a.focusSwatch = t().createRef();
|
|
1039
999
|
a.focusExpandButton = t().createRef();
|
|
1040
1000
|
a.controlledExternally = i()(e, "value");
|
|
1041
|
-
|
|
1042
|
-
var o = a.controlledExternally ? (0,
|
|
1043
|
-
|
|
1001
|
+
// value can be hexadecimal color, 'transparent' or null
|
|
1002
|
+
var o = a.controlledExternally ? (0, O.expandShortHandHex)(e.value) : (0,
|
|
1003
|
+
O.expandShortHandHex)(e.defaultValue);
|
|
1044
1004
|
if (o !== null) {
|
|
1045
1005
|
o = g()(o);
|
|
1046
1006
|
}
|
|
1047
|
-
|
|
1048
|
-
var l = o === null ?
|
|
1007
|
+
// displayValue can be hexadecimal color or 'transparent' to represent 'transparent' or 'N/A' to represent null
|
|
1008
|
+
var l = o === null ? Xe : o;
|
|
1049
1009
|
a.state = {
|
|
1050
1010
|
displayValue: l,
|
|
1051
1011
|
open: false,
|
|
@@ -1058,7 +1018,7 @@
|
|
|
1058
1018
|
}
|
|
1059
1019
|
return a;
|
|
1060
1020
|
}
|
|
1061
|
-
|
|
1021
|
+
je(n, [ {
|
|
1062
1022
|
key: "componentDidUpdate",
|
|
1063
1023
|
value: function e(t) {
|
|
1064
1024
|
if (false) {}
|
|
@@ -1074,7 +1034,7 @@
|
|
|
1074
1034
|
var t = function e(t) {
|
|
1075
1035
|
return t === null ? null : g()(t);
|
|
1076
1036
|
};
|
|
1077
|
-
var r = (0,
|
|
1037
|
+
var r = (0, O.expandShortHandHex)(this.props.value);
|
|
1078
1038
|
if (this.isControlled()) {
|
|
1079
1039
|
return t(r);
|
|
1080
1040
|
}
|
|
@@ -1084,30 +1044,26 @@
|
|
|
1084
1044
|
key: "submitValue",
|
|
1085
1045
|
value: function e(t) {
|
|
1086
1046
|
if (t) {
|
|
1087
|
-
var r =
|
|
1088
|
-
if (!r && t !== "transparent" && t !==
|
|
1047
|
+
var r = We(t);
|
|
1048
|
+
if (!r && t !== "transparent" && t !== Xe) {
|
|
1089
1049
|
// eslint-disable-next-line no-console
|
|
1090
1050
|
console.warn('"'.concat(t, '" is not a valid hex color.'));
|
|
1091
1051
|
}
|
|
1092
|
-
if (r || n.hasTransparent(this.props.palette) && t === "transparent" || t ===
|
|
1093
|
-
var a = (
|
|
1094
|
-
this.
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
var o = t !== (this.props.value && g()(this.props.value));
|
|
1098
|
-
var l = this.props.name;
|
|
1099
|
-
var i = t === Ue ? null : t;
|
|
1100
|
-
var s = (0, P.expandShortHandHex)(i);
|
|
1052
|
+
if (r || n.hasTransparent(this.props.palette) && t === "transparent" || t === Xe) {
|
|
1053
|
+
var a = t !== (this.props.value && g()(this.props.value));
|
|
1054
|
+
var o = this.props.name;
|
|
1055
|
+
var l = t === Xe ? null : t;
|
|
1056
|
+
var i = (0, O.expandShortHandHex)(l);
|
|
1101
1057
|
if (t && !this.isControlled()) {
|
|
1102
1058
|
this.setState({
|
|
1103
|
-
value:
|
|
1059
|
+
value: i
|
|
1104
1060
|
});
|
|
1105
1061
|
}
|
|
1106
|
-
if (
|
|
1107
|
-
var
|
|
1108
|
-
(
|
|
1109
|
-
value:
|
|
1110
|
-
name:
|
|
1062
|
+
if (a) {
|
|
1063
|
+
var s, u;
|
|
1064
|
+
(s = (u = this.props).onChange) === null || s === void 0 ? void 0 : s.call(u, {
|
|
1065
|
+
value: i,
|
|
1066
|
+
name: o
|
|
1111
1067
|
});
|
|
1112
1068
|
}
|
|
1113
1069
|
}
|
|
@@ -1130,21 +1086,21 @@
|
|
|
1130
1086
|
key: "renderInput",
|
|
1131
1087
|
value: function e(r) {
|
|
1132
1088
|
var a = r.textAppend, o = r.textPrepend, l = r.textInline, i = r.inDropdown;
|
|
1133
|
-
var s = this.props,
|
|
1134
|
-
var
|
|
1135
|
-
var
|
|
1136
|
-
var
|
|
1137
|
-
var
|
|
1138
|
-
var y =
|
|
1139
|
-
if (!m()(
|
|
1140
|
-
y = "#".concat(
|
|
1089
|
+
var s = this.props, u = s.splunkTheme, c = s.required, p = s.labelledBy, d = s.disabled;
|
|
1090
|
+
var f = this.state.displayValue;
|
|
1091
|
+
var v = u.isPrisma;
|
|
1092
|
+
var h = n.hasTransparent(this.props.palette) && g()(f) === "transparent";
|
|
1093
|
+
var b = g()(f) === Ge;
|
|
1094
|
+
var y = f;
|
|
1095
|
+
if (!m()(f, "#")) {
|
|
1096
|
+
y = "#".concat(f);
|
|
1141
1097
|
}
|
|
1142
|
-
y =
|
|
1143
|
-
y =
|
|
1098
|
+
y = h ? "transparent" : y;
|
|
1099
|
+
y = b ? null : y;
|
|
1144
1100
|
|
|
1145
1101
|
return t().createElement(Z, {
|
|
1146
1102
|
$inDropdown: i
|
|
1147
|
-
}, t().createElement(
|
|
1103
|
+
}, t().createElement(ye["default"], {
|
|
1148
1104
|
id: this.hexInputReaderContentId
|
|
1149
1105
|
}, (0, I._)("Hexadecimal color value")), t().createElement(ee, {
|
|
1150
1106
|
$inDropdown: i,
|
|
@@ -1156,11 +1112,12 @@
|
|
|
1156
1112
|
prepend: o,
|
|
1157
1113
|
onKeyDown: this.handleTextKeyDown,
|
|
1158
1114
|
onChange: this.handleTextChange,
|
|
1159
|
-
required:
|
|
1115
|
+
required: c,
|
|
1160
1116
|
spellCheck: false,
|
|
1161
|
-
value:
|
|
1162
|
-
labelledBy: p ? "".concat(p, " ").concat(this.hexInputReaderContentId) : this.hexInputReaderContentId
|
|
1163
|
-
|
|
1117
|
+
value: f,
|
|
1118
|
+
labelledBy: p ? "".concat(p, " ").concat(this.hexInputReaderContentId) : this.hexInputReaderContentId,
|
|
1119
|
+
disabled: d
|
|
1120
|
+
}), !v && i && t().createElement(Y, {
|
|
1164
1121
|
"data-test": "textbox-swatch",
|
|
1165
1122
|
onClick: this.handleButtonClick,
|
|
1166
1123
|
value: y,
|
|
@@ -1173,9 +1130,9 @@
|
|
|
1173
1130
|
key: "renderPalette",
|
|
1174
1131
|
value: function e() {
|
|
1175
1132
|
var r = this;
|
|
1176
|
-
var n = this.props, a = n.splunkTheme, o = n.palette;
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1133
|
+
var n = this.props, a = n.splunkTheme, o = n.palette, l = n.disabled;
|
|
1134
|
+
var i = this.state.expanded;
|
|
1135
|
+
var s = a.isPrisma;
|
|
1179
1136
|
|
|
1180
1137
|
return t().createElement(me, {
|
|
1181
1138
|
role: "dialog",
|
|
@@ -1184,7 +1141,7 @@
|
|
|
1184
1141
|
value: this.getValue(),
|
|
1185
1142
|
swatchToFocusRef: this.focusSwatch,
|
|
1186
1143
|
renderInput: function e() {
|
|
1187
|
-
return
|
|
1144
|
+
return s ? r.renderInput({
|
|
1188
1145
|
textAppend: false,
|
|
1189
1146
|
textPrepend: false,
|
|
1190
1147
|
textInline: true,
|
|
@@ -1198,43 +1155,45 @@
|
|
|
1198
1155
|
},
|
|
1199
1156
|
expandButtonRef: this.focusExpandButton,
|
|
1200
1157
|
onSwatchClick: this.handleSwatchClick,
|
|
1201
|
-
expanded:
|
|
1158
|
+
expanded: i,
|
|
1202
1159
|
onPaletteExpand: this.handlePaletteExpand,
|
|
1203
1160
|
onSystemColorPickerChange: function e(t) {
|
|
1204
1161
|
return r.handleSystemColorPickerChange(t.target.value);
|
|
1205
|
-
}
|
|
1162
|
+
},
|
|
1163
|
+
disabled: l
|
|
1206
1164
|
});
|
|
1207
1165
|
}
|
|
1208
1166
|
}, {
|
|
1209
1167
|
key: "render",
|
|
1210
1168
|
value: function e() {
|
|
1211
1169
|
var r = this;
|
|
1212
|
-
var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef,
|
|
1213
|
-
var
|
|
1170
|
+
var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef, u = a.error, c = a.hideInput, d = a.labelledBy, v = a.name, h = a.prepend, b = a.splunkTheme, m = Oe(a, [ "append", "disabled", "describedBy", "elementRef", "error", "hideInput", "labelledBy", "name", "prepend", "splunkTheme" ]);
|
|
1171
|
+
var y = b.isPrisma;
|
|
1214
1172
|
var g = this.getValue();
|
|
1215
1173
|
var x = this.state.displayValue;
|
|
1216
1174
|
// hideInput defaults to true in Enterprise if prop is not provided
|
|
1217
|
-
var w =
|
|
1218
|
-
var S =
|
|
1219
|
-
var
|
|
1175
|
+
var w = c !== null && c !== void 0 ? c : true;
|
|
1176
|
+
var S = y ? c : w;
|
|
1177
|
+
var C = t().createElement(te, xe({
|
|
1220
1178
|
append: !S ? true : o,
|
|
1221
1179
|
"data-test": "color",
|
|
1222
1180
|
"data-test-value": x,
|
|
1223
1181
|
"aria-describedby": i,
|
|
1224
1182
|
"aria-labelledby": d ? "".concat(d, " ").concat(this.swatchToggleReaderContentId) : this.swatchToggleReaderContentId,
|
|
1225
|
-
"aria-invalid":
|
|
1183
|
+
"aria-invalid": u || undefined,
|
|
1226
1184
|
disabled: l,
|
|
1227
|
-
error:
|
|
1185
|
+
error: u,
|
|
1228
1186
|
elementRef: s,
|
|
1229
1187
|
name: v,
|
|
1230
1188
|
prepend: h,
|
|
1231
1189
|
value: g
|
|
1232
|
-
}, f()(m, [].concat(we(p()(n.propTypes)), [
|
|
1190
|
+
}, f()(m, [].concat(we(p()(n.propTypes)), [
|
|
1191
|
+
// TS: trick omit
|
|
1233
1192
|
"onChange" ]))));
|
|
1234
1193
|
|
|
1235
|
-
return t().createElement(Q, null, t().createElement(
|
|
1194
|
+
return t().createElement(Q, null, t().createElement(ye["default"], {
|
|
1236
1195
|
id: this.swatchToggleReaderContentId
|
|
1237
|
-
}, (0, I._)("Color picker")), t().createElement(
|
|
1196
|
+
}, (0, I._)("Color picker")), t().createElement(P(), {
|
|
1238
1197
|
closeReasons: [ "clickAway", "escapeKey", "offScreen", "toggleClick" ],
|
|
1239
1198
|
onRequestClose: this.handleRequestClose,
|
|
1240
1199
|
onRequestOpen: this.handleRequestOpen,
|
|
@@ -1244,7 +1203,7 @@
|
|
|
1244
1203
|
},
|
|
1245
1204
|
retainFocus: true,
|
|
1246
1205
|
takeFocus: false,
|
|
1247
|
-
toggle:
|
|
1206
|
+
toggle: C
|
|
1248
1207
|
}, this.renderPalette()), !S && this.renderInput({
|
|
1249
1208
|
textAppend: false,
|
|
1250
1209
|
textPrepend: true,
|
|
@@ -1255,12 +1214,12 @@
|
|
|
1255
1214
|
} ]);
|
|
1256
1215
|
return n;
|
|
1257
1216
|
}(e.Component);
|
|
1258
|
-
$e(
|
|
1259
|
-
$e(
|
|
1260
|
-
var
|
|
1261
|
-
|
|
1217
|
+
$e(Qe, "propTypes", Le);
|
|
1218
|
+
$e(Qe, "defaultProps", Ue);
|
|
1219
|
+
var Ye = (0, E.withSplunkTheme)(Qe);
|
|
1220
|
+
Ye.propTypes = Qe.propTypes;
|
|
1262
1221
|
// TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
|
|
1263
|
-
/* harmony default export */ const
|
|
1222
|
+
/* harmony default export */ const Ze = Ye;
|
|
1264
1223
|
}) // CONCATENATED MODULE: ./src/Color/index.ts
|
|
1265
1224
|
();
|
|
1266
1225
|
module.exports = n;
|