@splunk/react-ui 4.22.1 → 4.23.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/CHANGELOG.md +15 -0
- package/Color.js +289 -293
- package/DualListbox.js +2 -2
- package/File.js +15 -15
- package/JSONTree.js +204 -219
- package/MIGRATION.mdx +14 -0
- package/Multiselect.js +168 -168
- package/Select.js +390 -390
- package/package.json +5 -4
- package/types/src/Dropdown/Dropdown.d.ts +2 -2
- package/types/src/JSONTree/JSONTree.d.ts +22 -13
- package/types/src/JSONTree/TreeNode.d.ts +4 -3
- package/types/src/JSONTree/docs/examples/ExpandChildrenOnShiftKey.d.ts +1 -0
- package/types/src/Multiselect/Compact.d.ts +1 -1
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/Select/SelectBase.d.ts +1 -1
- package/types/src/JSONTree/docs/examples/WithShiftModifier.d.ts +0 -1
- /package/types/src/Card/docs/examples/{prisma/Actions.d.ts → Actions.d.ts} +0 -0
package/Color.js
CHANGED
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
default: () => /* reexport */
|
|
65
|
-
defaultPalette: () => /* reexport */
|
|
66
|
-
isValidHEX: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ Ue,
|
|
65
|
+
defaultPalette: () => /* reexport */ Ae,
|
|
66
|
+
isValidHEX: () => /* reexport */ ze
|
|
67
67
|
});
|
|
68
68
|
// CONCATENATED MODULE: external "react"
|
|
69
69
|
const r = require("react");
|
|
@@ -71,129 +71,126 @@
|
|
|
71
71
|
// CONCATENATED MODULE: external "prop-types"
|
|
72
72
|
const a = require("prop-types");
|
|
73
73
|
var o = e.n(a);
|
|
74
|
-
// CONCATENATED MODULE: external "lodash/debounce"
|
|
75
|
-
const l = require("lodash/debounce");
|
|
76
|
-
var i = e.n(l);
|
|
77
74
|
// CONCATENATED MODULE: external "lodash/has"
|
|
78
|
-
const
|
|
79
|
-
var
|
|
75
|
+
const l = require("lodash/has");
|
|
76
|
+
var i = e.n(l);
|
|
80
77
|
// CONCATENATED MODULE: external "lodash/includes"
|
|
81
|
-
const
|
|
82
|
-
var
|
|
78
|
+
const s = require("lodash/includes");
|
|
79
|
+
var u = e.n(s);
|
|
83
80
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
84
|
-
const
|
|
85
|
-
var
|
|
81
|
+
const c = require("lodash/keys");
|
|
82
|
+
var p = e.n(c);
|
|
86
83
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
87
|
-
const
|
|
88
|
-
var
|
|
84
|
+
const d = require("lodash/omit");
|
|
85
|
+
var f = e.n(d);
|
|
89
86
|
// CONCATENATED MODULE: external "lodash/slice"
|
|
90
|
-
const
|
|
91
|
-
var
|
|
87
|
+
const v = require("lodash/slice");
|
|
88
|
+
var h = e.n(v);
|
|
92
89
|
// CONCATENATED MODULE: external "lodash/startsWith"
|
|
93
|
-
const
|
|
94
|
-
var
|
|
90
|
+
const m = require("lodash/startsWith");
|
|
91
|
+
var y = e.n(m);
|
|
95
92
|
// CONCATENATED MODULE: external "lodash/toLower"
|
|
96
|
-
const
|
|
97
|
-
var
|
|
93
|
+
const b = require("lodash/toLower");
|
|
94
|
+
var g = e.n(b);
|
|
98
95
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
99
|
-
const
|
|
100
|
-
var
|
|
96
|
+
const x = require("lodash/memoize");
|
|
97
|
+
var w = e.n(x);
|
|
101
98
|
// CONCATENATED MODULE: external "tinycolor2"
|
|
102
|
-
const
|
|
103
|
-
var
|
|
99
|
+
const S = require("tinycolor2");
|
|
100
|
+
var k = e.n(S);
|
|
104
101
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
105
|
-
const
|
|
106
|
-
var
|
|
102
|
+
const C = require("@splunk/react-ui/Dropdown");
|
|
103
|
+
var E = e.n(C);
|
|
107
104
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
108
|
-
const
|
|
105
|
+
const P = require("@splunk/themes");
|
|
109
106
|
// CONCATENATED MODULE: external "@splunk/ui-utils/color"
|
|
110
|
-
const
|
|
107
|
+
const O = require("@splunk/ui-utils/color");
|
|
111
108
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
112
|
-
const
|
|
109
|
+
const _ = require("@splunk/ui-utils/i18n");
|
|
113
110
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
114
|
-
const
|
|
111
|
+
const q = require("@splunk/ui-utils/keyboard");
|
|
115
112
|
// CONCATENATED MODULE: external "styled-components"
|
|
116
|
-
const
|
|
117
|
-
var
|
|
113
|
+
const I = require("styled-components");
|
|
114
|
+
var j = e.n(I);
|
|
118
115
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
119
|
-
const
|
|
120
|
-
var
|
|
116
|
+
const T = require("@splunk/react-ui/Text");
|
|
117
|
+
var R = e.n(T);
|
|
121
118
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
122
|
-
const
|
|
123
|
-
var
|
|
119
|
+
const B = require("@splunk/react-ui/ScreenReaderContent");
|
|
120
|
+
var V = e.n(B);
|
|
124
121
|
// CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
|
|
125
|
-
const
|
|
126
|
-
var
|
|
122
|
+
const A = require("@splunk/react-icons/Checkmark");
|
|
123
|
+
var D = e.n(A);
|
|
127
124
|
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
128
|
-
const
|
|
129
|
-
var
|
|
125
|
+
const N = require("@splunk/react-ui/Clickable");
|
|
126
|
+
var $ = e.n(N);
|
|
130
127
|
// CONCATENATED MODULE: ./src/Color/SwatchStyles.ts
|
|
131
|
-
var
|
|
132
|
-
enterprise:
|
|
128
|
+
var H = (0, P.pick)({
|
|
129
|
+
enterprise: P.variables.gray80,
|
|
133
130
|
prisma: "rgba(0, 0, 0, 0.2)"
|
|
134
131
|
});
|
|
135
|
-
var
|
|
136
|
-
|
|
132
|
+
var z = (0, I.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:", ";" ], H, H, H, H, H, H, (0,
|
|
133
|
+
P.pick)({
|
|
137
134
|
enterprise: "transparent",
|
|
138
|
-
prisma:
|
|
135
|
+
prisma: P.variables.white
|
|
139
136
|
}));
|
|
140
|
-
var
|
|
137
|
+
var K = j()(D()).withConfig({
|
|
141
138
|
displayName: "SwatchStyles__StyledCheck",
|
|
142
139
|
componentId: "sc-1wxunhq-0"
|
|
143
140
|
})([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;" ]);
|
|
144
|
-
var
|
|
141
|
+
var F = j()($()).withConfig({
|
|
145
142
|
displayName: "SwatchStyles__StyledClickable",
|
|
146
143
|
componentId: "sc-1wxunhq-1"
|
|
147
144
|
})([ "display:block;flex:0 0 auto;border:", ";", ";", ";", ";", " &:focus{border-color:", ";box-shadow:", ";}", " ", " ", " &[disabled]{background-image:linear-gradient(rgba(255,255,255,0.8),rgba(255,255,255,0.8));}", " ", "" ], (0,
|
|
148
|
-
|
|
145
|
+
P.pick)({
|
|
149
146
|
enterprise: {
|
|
150
|
-
light: (0,
|
|
151
|
-
dark:
|
|
147
|
+
light: (0, I.css)([ "1px solid ", "" ], P.variables.gray60),
|
|
148
|
+
dark: P.variables.border
|
|
152
149
|
},
|
|
153
|
-
prisma: (0,
|
|
154
|
-
}), (0,
|
|
155
|
-
prisma: (0,
|
|
150
|
+
prisma: (0, I.css)([ "1px solid ", "" ], P.variables.interactiveColorBorder)
|
|
151
|
+
}), (0, P.pick)({
|
|
152
|
+
prisma: (0, I.css)([ "border-radius:2px;" ])
|
|
156
153
|
}), (function(e) {
|
|
157
154
|
var t = e.$value;
|
|
158
|
-
return t === null && (0,
|
|
159
|
-
|
|
155
|
+
return t === null && (0, I.css)([ "background-image:linear-gradient( to bottom right,transparent 48%,", ",transparent 52% );", ";" ], (0,
|
|
156
|
+
P.pick)({
|
|
160
157
|
enterprise: "#ed1e24",
|
|
161
|
-
prisma:
|
|
162
|
-
}), (0,
|
|
163
|
-
prisma: (0,
|
|
158
|
+
prisma: P.variables.accentColorNegative
|
|
159
|
+
}), (0, P.pick)({
|
|
160
|
+
prisma: (0, I.css)([ "background-color:", ";" ], P.variables.white)
|
|
164
161
|
}));
|
|
165
162
|
}), (function(e) {
|
|
166
163
|
var t = e.$value;
|
|
167
|
-
return t && (t === "transparent" ?
|
|
164
|
+
return t && (t === "transparent" ? z : "background-color: ".concat(t));
|
|
168
165
|
}), (function(e) {
|
|
169
166
|
var t = e.$noBorder;
|
|
170
|
-
return t && (0,
|
|
171
|
-
}),
|
|
167
|
+
return t && (0, I.css)([ "border:none;" ]);
|
|
168
|
+
}), P.variables.focusColor, P.variables.focusShadow, (0, P.pick)({
|
|
172
169
|
enterprise: {
|
|
173
|
-
comfortable: (0,
|
|
174
|
-
compact: (0,
|
|
170
|
+
comfortable: (0, I.css)([ "width:32px;height:32px;" ]),
|
|
171
|
+
compact: (0, I.css)([ "width:24px;height:24px;" ])
|
|
175
172
|
},
|
|
176
|
-
prisma: (0,
|
|
173
|
+
prisma: (0, I.css)([ "width:24px;height:24px;" ])
|
|
177
174
|
}), (function(e) {
|
|
178
175
|
var t = e.$prepend;
|
|
179
|
-
return t && (0,
|
|
176
|
+
return t && (0, I.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
|
|
180
177
|
}), (function(e) {
|
|
181
178
|
var t = e.$append;
|
|
182
|
-
return t && (0,
|
|
179
|
+
return t && (0, I.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
|
|
183
180
|
}), (function(e) {
|
|
184
181
|
var t = e.$hasError;
|
|
185
|
-
return t && (0,
|
|
186
|
-
|
|
187
|
-
enterprise:
|
|
188
|
-
prisma:
|
|
182
|
+
return t && (0, I.css)([ "box-shadow:inset 0 0 0 2px white;border-color:", ";" ], (0,
|
|
183
|
+
P.pick)({
|
|
184
|
+
enterprise: P.variables.errorColor,
|
|
185
|
+
prisma: P.variables.accentColorNegative
|
|
189
186
|
}));
|
|
190
187
|
}), (function(e) {
|
|
191
188
|
var t = e.$showSelected;
|
|
192
|
-
return t && (0,
|
|
189
|
+
return t && (0, I.css)([ "display:flex;align-items:center;justify-content:center;" ]);
|
|
193
190
|
}));
|
|
194
191
|
// CONCATENATED MODULE: ./src/Color/Swatch.tsx
|
|
195
|
-
function
|
|
196
|
-
|
|
192
|
+
function M() {
|
|
193
|
+
M = Object.assign || function(e) {
|
|
197
194
|
for (var t = 1; t < arguments.length; t++) {
|
|
198
195
|
var r = arguments[t];
|
|
199
196
|
for (var n in r) {
|
|
@@ -204,11 +201,11 @@
|
|
|
204
201
|
}
|
|
205
202
|
return e;
|
|
206
203
|
};
|
|
207
|
-
return
|
|
204
|
+
return M.apply(this, arguments);
|
|
208
205
|
}
|
|
209
|
-
function
|
|
206
|
+
function L(e, t) {
|
|
210
207
|
if (e == null) return {};
|
|
211
|
-
var r =
|
|
208
|
+
var r = U(e, t);
|
|
212
209
|
var n, a;
|
|
213
210
|
if (Object.getOwnPropertySymbols) {
|
|
214
211
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -221,7 +218,7 @@
|
|
|
221
218
|
}
|
|
222
219
|
return r;
|
|
223
220
|
}
|
|
224
|
-
function
|
|
221
|
+
function U(e, t) {
|
|
225
222
|
if (e == null) return {};
|
|
226
223
|
var r = {};
|
|
227
224
|
var n = Object.keys(e);
|
|
@@ -233,7 +230,7 @@
|
|
|
233
230
|
}
|
|
234
231
|
return r;
|
|
235
232
|
}
|
|
236
|
-
var
|
|
233
|
+
var W = {
|
|
237
234
|
append: o().bool,
|
|
238
235
|
elementRef: o().oneOfType([ o().func, o().object ]),
|
|
239
236
|
/** @private */
|
|
@@ -247,17 +244,17 @@
|
|
|
247
244
|
/** @private */
|
|
248
245
|
showSelected: o().bool
|
|
249
246
|
};
|
|
250
|
-
var
|
|
251
|
-
var r = 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 =
|
|
252
|
-
var d = s === null || s === undefined ? (0,
|
|
247
|
+
var Q = n().forwardRef((function(e, t) {
|
|
248
|
+
var r = 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 = L(e, [ "append", "error", "onClick", "prepend", "value", "noBorder", "showSelected" ]);
|
|
249
|
+
var d = s === null || s === undefined ? (0, _._)("No color") : s;
|
|
253
250
|
// Only valid hexadecimal strings, 'transparent' and `null` are allowed for background colors
|
|
254
251
|
// Invalid values are converted to `undefined`
|
|
255
252
|
var f = s;
|
|
256
|
-
if (!(typeof f === "string" && ((0,
|
|
253
|
+
if (!(typeof f === "string" && ((0, O.isValidHexColor)(f) || f === "transparent")) && f !== null && f !== undefined) {
|
|
257
254
|
f = undefined;
|
|
258
255
|
}
|
|
259
256
|
|
|
260
|
-
return n().createElement(
|
|
257
|
+
return n().createElement(F, M({
|
|
261
258
|
onClick: function e(t) {
|
|
262
259
|
return l === null || l === void 0 ? void 0 : l(t, {
|
|
263
260
|
value: s
|
|
@@ -272,136 +269,136 @@
|
|
|
272
269
|
$showSelected: c,
|
|
273
270
|
"data-test": "swatch",
|
|
274
271
|
"data-test-value": s
|
|
275
|
-
}, p), c && n().createElement(
|
|
276
|
-
"aria-label": (0,
|
|
272
|
+
}, p), c && n().createElement(K, {
|
|
273
|
+
"aria-label": (0, _._)("Selected"),
|
|
277
274
|
role: "presentation"
|
|
278
|
-
}), n().createElement(
|
|
275
|
+
}), n().createElement(V(), null, d));
|
|
279
276
|
}));
|
|
280
|
-
|
|
281
|
-
/* harmony default export */ const
|
|
277
|
+
Q.propTypes = W;
|
|
278
|
+
/* harmony default export */ const X = Q;
|
|
282
279
|
// CONCATENATED MODULE: ./src/Color/ColorStyles.ts
|
|
283
|
-
var
|
|
280
|
+
var G = j().div.withConfig({
|
|
284
281
|
displayName: "ColorStyles__StyledColor",
|
|
285
282
|
componentId: "jxrost-0"
|
|
286
|
-
})([ "", ";flex-direction:row;" ],
|
|
287
|
-
var
|
|
283
|
+
})([ "", ";flex-direction:row;" ], P.mixins.reset("flex"));
|
|
284
|
+
var J = j()(X).withConfig({
|
|
288
285
|
displayName: "ColorStyles__StyledInputSwatch",
|
|
289
286
|
componentId: "jxrost-1"
|
|
290
|
-
})([ "", "" ], (0,
|
|
291
|
-
compact: (0,
|
|
287
|
+
})([ "", "" ], (0, P.pick)({
|
|
288
|
+
compact: (0, I.css)([ "width:28px;height:28px;" ])
|
|
292
289
|
}));
|
|
293
|
-
var
|
|
290
|
+
var Y = j().div.withConfig({
|
|
294
291
|
displayName: "ColorStyles__StyledInput",
|
|
295
292
|
componentId: "jxrost-2"
|
|
296
|
-
})([ "", ";" ], (0,
|
|
297
|
-
enterprise: (0,
|
|
298
|
-
prisma: (0,
|
|
293
|
+
})([ "", ";" ], (0, P.pick)({
|
|
294
|
+
enterprise: (0, I.css)([ "display:flex;width:100%;" ]),
|
|
295
|
+
prisma: (0, I.css)([ "position:relative;", "" ], (function(e) {
|
|
299
296
|
var t = e.$inDropdown;
|
|
300
|
-
return t ? (0,
|
|
297
|
+
return t ? (0, I.css)([ "width:80px;" ]) : (0, I.css)([ "flex:0 1 auto;min-width:0;" ]);
|
|
301
298
|
}))
|
|
302
299
|
}));
|
|
303
|
-
var
|
|
300
|
+
var Z = j()(R()).withConfig({
|
|
304
301
|
displayName: "ColorStyles__StyledInputText",
|
|
305
302
|
componentId: "jxrost-3"
|
|
306
303
|
})([ "", "" ], (function(e) {
|
|
307
304
|
var t = e.$inDropdown;
|
|
308
|
-
return t && (0,
|
|
305
|
+
return t && (0, I.css)([ "font-size:12px;" ]);
|
|
309
306
|
}));
|
|
310
|
-
var
|
|
307
|
+
var ee = j()(X).withConfig({
|
|
311
308
|
displayName: "ColorStyles__StyledToggleSwatch",
|
|
312
309
|
componentId: "jxrost-4"
|
|
313
|
-
})([ "", "" ], (0,
|
|
310
|
+
})([ "", "" ], (0, P.pick)({
|
|
314
311
|
prisma: {
|
|
315
|
-
comfortable: (0,
|
|
316
|
-
compact: (0,
|
|
312
|
+
comfortable: (0, I.css)([ "width:40px;height:40px;" ]),
|
|
313
|
+
compact: (0, I.css)([ "width:32px;height:32px;" ])
|
|
317
314
|
},
|
|
318
315
|
enterprise: {
|
|
319
|
-
comfortable: (0,
|
|
320
|
-
compact: (0,
|
|
316
|
+
comfortable: (0, I.css)([ "width:32px;height:32px;" ]),
|
|
317
|
+
compact: (0, I.css)([ "width:28px;height:28px;" ])
|
|
321
318
|
}
|
|
322
319
|
}));
|
|
323
320
|
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronDown"
|
|
324
|
-
const
|
|
325
|
-
var
|
|
321
|
+
const te = require("@splunk/react-icons/ChevronDown");
|
|
322
|
+
var re = e.n(te);
|
|
326
323
|
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
327
|
-
const
|
|
328
|
-
var
|
|
324
|
+
const ne = require("@splunk/react-ui/Divider");
|
|
325
|
+
var ae = e.n(ne);
|
|
329
326
|
// CONCATENATED MODULE: ./src/Color/PaletteStyles.ts
|
|
330
|
-
var
|
|
327
|
+
var oe = j().div.withConfig({
|
|
331
328
|
displayName: "PaletteStyles__StyledPalette",
|
|
332
329
|
componentId: "qgv9v9-0"
|
|
333
|
-
})([ "width:220px;padding:", ";" ],
|
|
334
|
-
var
|
|
330
|
+
})([ "width:220px;padding:", ";" ], P.variables.spacingSmall);
|
|
331
|
+
var le = j().ul.withConfig({
|
|
335
332
|
displayName: "PaletteStyles__StyledSwatches",
|
|
336
333
|
componentId: "qgv9v9-1"
|
|
337
|
-
})([ "", ";margin-bottom:", ";" ],
|
|
338
|
-
var
|
|
334
|
+
})([ "", ";margin-bottom:", ";" ], P.mixins.reset("block"), P.variables.spacingQuarter);
|
|
335
|
+
var ie = j().li.withConfig({
|
|
339
336
|
displayName: "PaletteStyles__StyledSwatch",
|
|
340
337
|
componentId: "qgv9v9-2"
|
|
341
|
-
})([ "", ";margin-right:4px;margin-bottom:4px;vertical-align:top;", "" ],
|
|
342
|
-
|
|
338
|
+
})([ "", ";margin-right:4px;margin-bottom:4px;vertical-align:top;", "" ], P.mixins.reset("inline-block"), (0,
|
|
339
|
+
P.pick)({
|
|
343
340
|
enterprise: {
|
|
344
|
-
compact: (0,
|
|
341
|
+
compact: (0, I.css)([ "&:nth-child(8n){margin-right:0;}" ])
|
|
345
342
|
},
|
|
346
|
-
prisma: (0,
|
|
343
|
+
prisma: (0, I.css)([ "&:nth-child(8n){margin-right:0;}" ])
|
|
347
344
|
}));
|
|
348
|
-
var
|
|
345
|
+
var se = j().div.withConfig({
|
|
349
346
|
displayName: "PaletteStyles__StyledToolBar",
|
|
350
347
|
componentId: "qgv9v9-3"
|
|
351
|
-
})([ "position:relative;display:flex;align-items:center;padding:0;margin-top:", ";margin-bottom:", ";gap:4px;" ],
|
|
352
|
-
var
|
|
348
|
+
})([ "position:relative;display:flex;align-items:center;padding:0;margin-top:", ";margin-bottom:", ";gap:4px;" ], P.variables.spacingSmall, P.variables.spacingHalf);
|
|
349
|
+
var ue = j()($()).withConfig({
|
|
353
350
|
displayName: "PaletteStyles__StyledExpandButton",
|
|
354
351
|
componentId: "qgv9v9-4"
|
|
355
|
-
})([ "position:absolute;bottom:4px;right:4px;padding:2px 4px;border-radius:2px;&:focus{box-shadow:", ";}", "" ],
|
|
352
|
+
})([ "position:absolute;bottom:4px;right:4px;padding:2px 4px;border-radius:2px;&:focus{box-shadow:", ";}", "" ], P.variables.focusShadow, (function(e) {
|
|
356
353
|
var t = e.$expanded;
|
|
357
|
-
return t && (0,
|
|
354
|
+
return t && (0, I.css)([ "transform:rotate(180deg);" ]);
|
|
358
355
|
}));
|
|
359
|
-
var
|
|
356
|
+
var ce = j().div.withConfig({
|
|
360
357
|
displayName: "PaletteStyles__StyledSystemColorPickerWrapper",
|
|
361
358
|
componentId: "qgv9v9-5"
|
|
362
359
|
})([ "position:relative;" ]);
|
|
363
|
-
var
|
|
360
|
+
var pe = j().input.withConfig({
|
|
364
361
|
displayName: "PaletteStyles__StyledSystemColorPicker",
|
|
365
362
|
componentId: "qgv9v9-6"
|
|
366
363
|
})([ "box-sizing:border-box;", " border:", ";", ";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,
|
|
367
|
-
|
|
364
|
+
P.pick)({
|
|
368
365
|
enterprise: {
|
|
369
|
-
comfortable: (0,
|
|
370
|
-
compact: (0,
|
|
366
|
+
comfortable: (0, I.css)([ "width:32px;height:32px;" ]),
|
|
367
|
+
compact: (0, I.css)([ "width:24px;height:24px;" ])
|
|
371
368
|
},
|
|
372
|
-
prisma: (0,
|
|
373
|
-
}), (0,
|
|
369
|
+
prisma: (0, I.css)([ "width:24px;height:24px;" ])
|
|
370
|
+
}), (0, P.pick)({
|
|
374
371
|
enterprise: {
|
|
375
|
-
light: (0,
|
|
376
|
-
dark:
|
|
372
|
+
light: (0, I.css)([ "1px solid ", "" ], P.variables.gray60),
|
|
373
|
+
dark: P.variables.border
|
|
377
374
|
},
|
|
378
375
|
prisma: "none"
|
|
379
|
-
}), (0,
|
|
380
|
-
prisma: (0,
|
|
381
|
-
}), (0,
|
|
376
|
+
}), (0, P.pick)({
|
|
377
|
+
prisma: (0, I.css)([ "border-radius:2px;" ])
|
|
378
|
+
}), (0, P.pick)({
|
|
382
379
|
enterprise: {
|
|
383
|
-
comfortable: (0,
|
|
380
|
+
comfortable: (0, I.css)([ "padding:1px 14px;" ])
|
|
384
381
|
}
|
|
385
|
-
}),
|
|
386
|
-
var
|
|
382
|
+
}), P.variables.focusShadow);
|
|
383
|
+
var de = j()(D()).withConfig({
|
|
387
384
|
displayName: "PaletteStyles__StyledCheck",
|
|
388
385
|
componentId: "qgv9v9-7"
|
|
389
386
|
})([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;position:absolute;top:0;left:0;pointer-events:none;" ]);
|
|
390
387
|
// CONCATENATED MODULE: ./src/Color/Palette.tsx
|
|
391
|
-
function
|
|
392
|
-
var t = e.expanded, r = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand,
|
|
393
|
-
var d = (0,
|
|
394
|
-
var
|
|
395
|
-
return e &&
|
|
388
|
+
function fe(e) {
|
|
389
|
+
var t = e.expanded, r = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand, c = e.onSystemColorPickerChange, p = e.renderInput;
|
|
390
|
+
var d = (0, P.useSplunkTheme)(), f = d.isPrisma, v = d.isLight;
|
|
391
|
+
var m = u()(r.map((function(e) {
|
|
392
|
+
return e && g()(e);
|
|
396
393
|
})), a);
|
|
397
|
-
var
|
|
398
|
-
var r = e === null ? null :
|
|
394
|
+
var y = r.map((function(e, t) {
|
|
395
|
+
var r = e === null ? null : g()(e);
|
|
399
396
|
var i = r === a;
|
|
400
|
-
var s = !
|
|
397
|
+
var s = !m && t === 0 || m && i;
|
|
401
398
|
|
|
402
|
-
return n().createElement(
|
|
399
|
+
return n().createElement(ie, {
|
|
403
400
|
key: r || "null"
|
|
404
|
-
}, n().createElement(
|
|
401
|
+
}, n().createElement(X, {
|
|
405
402
|
value: r,
|
|
406
403
|
ref: s ? o : null,
|
|
407
404
|
onClick: l,
|
|
@@ -410,76 +407,76 @@
|
|
|
410
407
|
}));
|
|
411
408
|
}));
|
|
412
409
|
var b = function e() {
|
|
413
|
-
var t = !
|
|
410
|
+
var t = !m && a !== "#ffffff" && a !== "#000000" && a !== null && a !== "";
|
|
414
411
|
|
|
415
|
-
return n().createElement(
|
|
412
|
+
return n().createElement(se, {
|
|
416
413
|
"data-test": "tool-bar"
|
|
417
|
-
}, f && n().createElement(
|
|
414
|
+
}, f && n().createElement(P.SplunkThemeProvider, {
|
|
418
415
|
density: "compact"
|
|
419
|
-
},
|
|
416
|
+
}, p && p()), n().createElement(X, {
|
|
420
417
|
value: null,
|
|
421
418
|
ref: a === null ? o : null,
|
|
422
419
|
onClick: l,
|
|
423
420
|
noBorder: f && !v,
|
|
424
421
|
showSelected: a === null
|
|
425
|
-
}), n().createElement(
|
|
422
|
+
}), n().createElement(X, {
|
|
426
423
|
value: "#ffffff",
|
|
427
424
|
ref: a === "#ffffff" ? o : null,
|
|
428
425
|
onClick: l,
|
|
429
426
|
noBorder: f && !v,
|
|
430
427
|
showSelected: a === "#ffffff"
|
|
431
|
-
}), n().createElement(
|
|
428
|
+
}), n().createElement(X, {
|
|
432
429
|
value: "#000000",
|
|
433
430
|
ref: a === "#000000" ? o : null,
|
|
434
431
|
onClick: l,
|
|
435
432
|
noBorder: f,
|
|
436
433
|
showSelected: a === "#000000"
|
|
437
|
-
}), n().createElement(
|
|
434
|
+
}), n().createElement(ce, null, n().createElement(pe, {
|
|
438
435
|
type: "color",
|
|
439
436
|
value: a === null ? "" : a,
|
|
440
|
-
onChange:
|
|
437
|
+
onChange: c,
|
|
441
438
|
ref: t ? o : null
|
|
442
|
-
}), t && n().createElement(
|
|
443
|
-
"aria-label": (0,
|
|
439
|
+
}), t && n().createElement(de, {
|
|
440
|
+
"aria-label": (0, _._)("Selected"),
|
|
444
441
|
role: "presentation"
|
|
445
442
|
})));
|
|
446
443
|
};
|
|
447
|
-
var
|
|
448
|
-
var
|
|
449
|
-
var S =
|
|
444
|
+
var x = y.length === 8 ? 7 : 15;
|
|
445
|
+
var w = h()(y, 0, x);
|
|
446
|
+
var S = h()(y, x);
|
|
450
447
|
if (f) {
|
|
451
448
|
|
|
452
|
-
return n().createElement(
|
|
449
|
+
return n().createElement(oe, null, n().createElement("div", {
|
|
453
450
|
style: {
|
|
454
451
|
position: "relative"
|
|
455
452
|
}
|
|
456
|
-
}, n().createElement(
|
|
453
|
+
}, n().createElement(le, null, w, t && S), t && b(), n().createElement(ue, {
|
|
457
454
|
ref: i,
|
|
458
455
|
$expanded: t,
|
|
459
456
|
onClick: s,
|
|
460
457
|
"data-test": "expand-button"
|
|
461
|
-
}, n().createElement(
|
|
458
|
+
}, n().createElement(re(), null))));
|
|
462
459
|
}
|
|
463
460
|
|
|
464
|
-
return n().createElement(
|
|
461
|
+
return n().createElement(oe, null, n().createElement(le, null, y), n().createElement(ae(), null), b(), p && p());
|
|
465
462
|
}
|
|
466
|
-
/* harmony default export */ const
|
|
463
|
+
/* harmony default export */ const ve = fe;
|
|
467
464
|
// CONCATENATED MODULE: ./src/Color/Color.tsx
|
|
468
|
-
function
|
|
465
|
+
function he(e) {
|
|
469
466
|
"@babel/helpers - typeof";
|
|
470
467
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
471
|
-
|
|
468
|
+
he = function e(t) {
|
|
472
469
|
return typeof t;
|
|
473
470
|
};
|
|
474
471
|
} else {
|
|
475
|
-
|
|
472
|
+
he = function e(t) {
|
|
476
473
|
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
477
474
|
};
|
|
478
475
|
}
|
|
479
|
-
return
|
|
476
|
+
return he(e);
|
|
480
477
|
}
|
|
481
|
-
function
|
|
482
|
-
|
|
478
|
+
function me() {
|
|
479
|
+
me = Object.assign || function(e) {
|
|
483
480
|
for (var t = 1; t < arguments.length; t++) {
|
|
484
481
|
var r = arguments[t];
|
|
485
482
|
for (var n in r) {
|
|
@@ -490,38 +487,38 @@
|
|
|
490
487
|
}
|
|
491
488
|
return e;
|
|
492
489
|
};
|
|
493
|
-
return
|
|
490
|
+
return me.apply(this, arguments);
|
|
494
491
|
}
|
|
495
|
-
function
|
|
496
|
-
return
|
|
492
|
+
function ye(e) {
|
|
493
|
+
return we(e) || xe(e) || ge(e) || be();
|
|
497
494
|
}
|
|
498
|
-
function
|
|
495
|
+
function be() {
|
|
499
496
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
500
497
|
}
|
|
501
|
-
function
|
|
498
|
+
function ge(e, t) {
|
|
502
499
|
if (!e) return;
|
|
503
|
-
if (typeof e === "string") return
|
|
500
|
+
if (typeof e === "string") return Se(e, t);
|
|
504
501
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
505
502
|
if (r === "Object" && e.constructor) r = e.constructor.name;
|
|
506
503
|
if (r === "Map" || r === "Set") return Array.from(e);
|
|
507
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
504
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Se(e, t);
|
|
508
505
|
}
|
|
509
|
-
function
|
|
506
|
+
function xe(e) {
|
|
510
507
|
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
511
508
|
}
|
|
512
|
-
function
|
|
513
|
-
if (Array.isArray(e)) return
|
|
509
|
+
function we(e) {
|
|
510
|
+
if (Array.isArray(e)) return Se(e);
|
|
514
511
|
}
|
|
515
|
-
function
|
|
512
|
+
function Se(e, t) {
|
|
516
513
|
if (t == null || t > e.length) t = e.length;
|
|
517
514
|
for (var r = 0, n = new Array(t); r < t; r++) {
|
|
518
515
|
n[r] = e[r];
|
|
519
516
|
}
|
|
520
517
|
return n;
|
|
521
518
|
}
|
|
522
|
-
function
|
|
519
|
+
function ke(e, t) {
|
|
523
520
|
if (e == null) return {};
|
|
524
|
-
var r =
|
|
521
|
+
var r = Ce(e, t);
|
|
525
522
|
var n, a;
|
|
526
523
|
if (Object.getOwnPropertySymbols) {
|
|
527
524
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -534,7 +531,7 @@
|
|
|
534
531
|
}
|
|
535
532
|
return r;
|
|
536
533
|
}
|
|
537
|
-
function
|
|
534
|
+
function Ce(e, t) {
|
|
538
535
|
if (e == null) return {};
|
|
539
536
|
var r = {};
|
|
540
537
|
var n = Object.keys(e);
|
|
@@ -546,12 +543,12 @@
|
|
|
546
543
|
}
|
|
547
544
|
return r;
|
|
548
545
|
}
|
|
549
|
-
function
|
|
546
|
+
function Ee(e, t) {
|
|
550
547
|
if (!(e instanceof t)) {
|
|
551
548
|
throw new TypeError("Cannot call a class as a function");
|
|
552
549
|
}
|
|
553
550
|
}
|
|
554
|
-
function
|
|
551
|
+
function Pe(e, t) {
|
|
555
552
|
for (var r = 0; r < t.length; r++) {
|
|
556
553
|
var n = t[r];
|
|
557
554
|
n.enumerable = n.enumerable || false;
|
|
@@ -560,12 +557,12 @@
|
|
|
560
557
|
Object.defineProperty(e, n.key, n);
|
|
561
558
|
}
|
|
562
559
|
}
|
|
563
|
-
function
|
|
564
|
-
if (t)
|
|
565
|
-
if (r)
|
|
560
|
+
function Oe(e, t, r) {
|
|
561
|
+
if (t) Pe(e.prototype, t);
|
|
562
|
+
if (r) Pe(e, r);
|
|
566
563
|
return e;
|
|
567
564
|
}
|
|
568
|
-
function
|
|
565
|
+
function _e(e, t) {
|
|
569
566
|
if (typeof t !== "function" && t !== null) {
|
|
570
567
|
throw new TypeError("Super expression must either be null or a function");
|
|
571
568
|
}
|
|
@@ -576,41 +573,41 @@
|
|
|
576
573
|
configurable: true
|
|
577
574
|
}
|
|
578
575
|
});
|
|
579
|
-
if (t)
|
|
576
|
+
if (t) qe(e, t);
|
|
580
577
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
578
|
+
function qe(e, t) {
|
|
579
|
+
qe = Object.setPrototypeOf || function e(t, r) {
|
|
583
580
|
t.__proto__ = r;
|
|
584
581
|
return t;
|
|
585
582
|
};
|
|
586
|
-
return
|
|
583
|
+
return qe(e, t);
|
|
587
584
|
}
|
|
588
|
-
function
|
|
589
|
-
var t =
|
|
585
|
+
function Ie(e) {
|
|
586
|
+
var t = Re();
|
|
590
587
|
return function r() {
|
|
591
|
-
var n =
|
|
588
|
+
var n = Be(e), a;
|
|
592
589
|
if (t) {
|
|
593
|
-
var o =
|
|
590
|
+
var o = Be(this).constructor;
|
|
594
591
|
a = Reflect.construct(n, arguments, o);
|
|
595
592
|
} else {
|
|
596
593
|
a = n.apply(this, arguments);
|
|
597
594
|
}
|
|
598
|
-
return
|
|
595
|
+
return je(this, a);
|
|
599
596
|
};
|
|
600
597
|
}
|
|
601
|
-
function
|
|
602
|
-
if (t && (
|
|
598
|
+
function je(e, t) {
|
|
599
|
+
if (t && (he(t) === "object" || typeof t === "function")) {
|
|
603
600
|
return t;
|
|
604
601
|
}
|
|
605
|
-
return
|
|
602
|
+
return Te(e);
|
|
606
603
|
}
|
|
607
|
-
function
|
|
604
|
+
function Te(e) {
|
|
608
605
|
if (e === void 0) {
|
|
609
606
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
610
607
|
}
|
|
611
608
|
return e;
|
|
612
609
|
}
|
|
613
|
-
function
|
|
610
|
+
function Re() {
|
|
614
611
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
615
612
|
if (Reflect.construct.sham) return false;
|
|
616
613
|
if (typeof Proxy === "function") return true;
|
|
@@ -621,13 +618,13 @@
|
|
|
621
618
|
return false;
|
|
622
619
|
}
|
|
623
620
|
}
|
|
624
|
-
function
|
|
625
|
-
|
|
621
|
+
function Be(e) {
|
|
622
|
+
Be = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
626
623
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
627
624
|
};
|
|
628
|
-
return
|
|
625
|
+
return Be(e);
|
|
629
626
|
}
|
|
630
|
-
function
|
|
627
|
+
function Ve(e, t, r) {
|
|
631
628
|
if (t in e) {
|
|
632
629
|
Object.defineProperty(e, t, {
|
|
633
630
|
value: r,
|
|
@@ -641,8 +638,8 @@
|
|
|
641
638
|
return e;
|
|
642
639
|
}
|
|
643
640
|
// The default palette in Prisma theme.
|
|
644
|
-
var
|
|
645
|
-
var
|
|
641
|
+
var Ae = [ "#912344", "#D44C20", "#C0891E", "#26AA92", "#2F8AA7", "#2E49AA", "#602CA1", "#BA4ABD" ];
|
|
642
|
+
var De = w()((function(e) {
|
|
646
643
|
var t = [];
|
|
647
644
|
for (var r = 1; r <= e.length * 4; r += 1) {
|
|
648
645
|
var n = e[(r - 1) % e.length];
|
|
@@ -650,14 +647,14 @@
|
|
|
650
647
|
t.push(n);
|
|
651
648
|
} else {
|
|
652
649
|
var a = 40 - 10 * (r / e.length);
|
|
653
|
-
t.push(
|
|
650
|
+
t.push(k()(n).lighten(a).toString());
|
|
654
651
|
}
|
|
655
652
|
}
|
|
656
653
|
return t;
|
|
657
654
|
}));
|
|
658
655
|
// The tool palette in Prisma theme.
|
|
659
|
-
var
|
|
660
|
-
var
|
|
656
|
+
var Ne = [ "#ffffff", "#000000", null ];
|
|
657
|
+
var $e = {
|
|
661
658
|
append: o().bool,
|
|
662
659
|
defaultValue: o().string,
|
|
663
660
|
describedBy: o().string,
|
|
@@ -674,30 +671,30 @@
|
|
|
674
671
|
splunkTheme: o().object,
|
|
675
672
|
value: o().string
|
|
676
673
|
};
|
|
677
|
-
var
|
|
674
|
+
var He = {
|
|
678
675
|
append: false,
|
|
679
676
|
disabled: false,
|
|
680
677
|
error: false,
|
|
681
678
|
hideInput: false,
|
|
682
|
-
palette:
|
|
679
|
+
palette: De(Ae),
|
|
683
680
|
prepend: false
|
|
684
681
|
};
|
|
685
682
|
// TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
|
|
686
|
-
var
|
|
687
|
-
return (0,
|
|
683
|
+
var ze = function e(t) {
|
|
684
|
+
return (0, O.isValidHexColor)(t);
|
|
688
685
|
};
|
|
689
|
-
var
|
|
690
|
-
var
|
|
686
|
+
var Ke = "N/A";
|
|
687
|
+
var Fe = "n/a";
|
|
691
688
|
/*
|
|
692
689
|
* When the dropdown opens:
|
|
693
690
|
* 1. If palette contains the color and the color is selected, the dropdown focus the color.
|
|
694
691
|
* 2. If palette doesn't contain the color:
|
|
695
692
|
* 1. If the current theme `family` is `prisma` the input receives focus.
|
|
696
693
|
* 2. Otherwise the first color swatch receives focus.
|
|
697
|
-
*/ var
|
|
698
|
-
|
|
699
|
-
var t =
|
|
700
|
-
|
|
694
|
+
*/ var Me = function(e) {
|
|
695
|
+
_e(r, e);
|
|
696
|
+
var t = Ie(r);
|
|
697
|
+
Oe(r, null, [ {
|
|
701
698
|
key: "hasNull",
|
|
702
699
|
// @docs-props-type ColorPropsBase
|
|
703
700
|
value: function e(t) {
|
|
@@ -709,25 +706,25 @@
|
|
|
709
706
|
key: "hasTransparent",
|
|
710
707
|
value: function e(t) {
|
|
711
708
|
return t.some((function(e) {
|
|
712
|
-
return e !== null &&
|
|
709
|
+
return e !== null && g()(e) === "transparent";
|
|
713
710
|
}));
|
|
714
711
|
}
|
|
715
712
|
} ]);
|
|
716
713
|
function r(e) {
|
|
717
714
|
var a;
|
|
718
|
-
|
|
715
|
+
Ee(this, r);
|
|
719
716
|
a = t.call(this, e);
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
717
|
+
Ve(Te(a), "focusSwatch", void 0);
|
|
718
|
+
Ve(Te(a), "focusExpandButton", void 0);
|
|
719
|
+
Ve(Te(a), "controlledExternally", void 0);
|
|
720
|
+
Ve(Te(a), "dropdown", null);
|
|
721
|
+
Ve(Te(a), "handleSwatchClick", (function(e, t) {
|
|
725
722
|
var r = t.value;
|
|
726
723
|
e.preventDefault();
|
|
727
724
|
var n = a.props, o = n.name, l = n.onChange;
|
|
728
725
|
var i = a.getValue();
|
|
729
726
|
var s = r !== i;
|
|
730
|
-
var u = r === null ?
|
|
727
|
+
var u = r === null ? Ke : r;
|
|
731
728
|
if (!a.isControlled()) {
|
|
732
729
|
a.setState({
|
|
733
730
|
value: r
|
|
@@ -745,21 +742,21 @@
|
|
|
745
742
|
}
|
|
746
743
|
a.focus();
|
|
747
744
|
}));
|
|
748
|
-
|
|
745
|
+
Ve(Te(a), "handlePaletteExpand", (function() {
|
|
749
746
|
a.setState((function(e) {
|
|
750
747
|
return {
|
|
751
748
|
expanded: !e.expanded
|
|
752
749
|
};
|
|
753
750
|
}));
|
|
754
751
|
}));
|
|
755
|
-
|
|
752
|
+
Ve(Te(a), "handleTextChange", (function(e, t) {
|
|
756
753
|
var r = t.value;
|
|
757
754
|
a.setState({
|
|
758
755
|
displayValue: r
|
|
759
756
|
});
|
|
760
757
|
}));
|
|
761
|
-
|
|
762
|
-
if ((0,
|
|
758
|
+
Ve(Te(a), "handleTextKeyDown", (function(e) {
|
|
759
|
+
if ((0, q.keycode)(e.nativeEvent) === "enter") {
|
|
763
760
|
e.preventDefault();
|
|
764
761
|
a.handleRequestClose({
|
|
765
762
|
reason: "enterKey"
|
|
@@ -767,23 +764,23 @@
|
|
|
767
764
|
a.focus();
|
|
768
765
|
}
|
|
769
766
|
}));
|
|
770
|
-
|
|
767
|
+
Ve(Te(a), "handleButtonClick", (function(e) {
|
|
771
768
|
e.preventDefault();
|
|
772
769
|
a.handleRequestClose({
|
|
773
770
|
reason: "buttonClick"
|
|
774
771
|
});
|
|
775
772
|
a.focus();
|
|
776
773
|
}));
|
|
777
|
-
|
|
774
|
+
Ve(Te(a), "handleRequestClose", (function(e) {
|
|
778
775
|
var t = e.reason;
|
|
779
776
|
var r = a.state.displayValue;
|
|
780
777
|
var n = a.state.value;
|
|
781
|
-
if (
|
|
782
|
-
r =
|
|
778
|
+
if (g()(r) === Fe) {
|
|
779
|
+
r = Ke;
|
|
783
780
|
a.setState({
|
|
784
781
|
displayValue: r
|
|
785
782
|
});
|
|
786
|
-
} else if (
|
|
783
|
+
} else if (g()(r) === "transparent") {
|
|
787
784
|
r = "transparent";
|
|
788
785
|
a.setState({
|
|
789
786
|
displayValue: r
|
|
@@ -791,12 +788,12 @@
|
|
|
791
788
|
}
|
|
792
789
|
// If the user types in the hexadecimal number without # in front,
|
|
793
790
|
// we add # automatically.
|
|
794
|
-
if (r !==
|
|
791
|
+
if (r !== Ke && g()(r) !== "transparent" && !y()(r, "#")) {
|
|
795
792
|
r = "#".concat(r);
|
|
796
793
|
if (t === "escapeKey") {
|
|
797
794
|
if (n == null) {
|
|
798
795
|
a.setState({
|
|
799
|
-
displayValue:
|
|
796
|
+
displayValue: Ke
|
|
800
797
|
});
|
|
801
798
|
} else {
|
|
802
799
|
a.setState({
|
|
@@ -818,11 +815,11 @@
|
|
|
818
815
|
a.submitValue(r);
|
|
819
816
|
}
|
|
820
817
|
}));
|
|
821
|
-
|
|
818
|
+
Ve(Te(a), "handleRequestOpen", (function() {
|
|
822
819
|
var e = a.props, t = e.splunkTheme, r = e.palette;
|
|
823
820
|
var n = t.isPrisma;
|
|
824
821
|
var o = a.getValue();
|
|
825
|
-
var l = o === null ?
|
|
822
|
+
var l = o === null ? Ke : o;
|
|
826
823
|
a.setState({
|
|
827
824
|
displayValue: l,
|
|
828
825
|
open: true
|
|
@@ -831,24 +828,24 @@
|
|
|
831
828
|
a.focusSwatch.current.focus();
|
|
832
829
|
}
|
|
833
830
|
}));
|
|
834
|
-
var i = n ?
|
|
835
|
-
var s = !
|
|
836
|
-
return e &&
|
|
831
|
+
var i = n ? h()(r, 15) : r;
|
|
832
|
+
var s = !u()(r.map((function(e) {
|
|
833
|
+
return e && g()(e);
|
|
837
834
|
})), o);
|
|
838
|
-
var
|
|
839
|
-
return e &&
|
|
840
|
-
})), o) ||
|
|
841
|
-
if (
|
|
835
|
+
var c = s || u()(i.map((function(e) {
|
|
836
|
+
return e && g()(e);
|
|
837
|
+
})), o) || u()(Ne, o);
|
|
838
|
+
if (c && !a.state.expanded) {
|
|
842
839
|
a.setState({
|
|
843
840
|
expanded: true
|
|
844
841
|
});
|
|
845
842
|
}
|
|
846
843
|
}));
|
|
847
|
-
|
|
844
|
+
Ve(Te(a), "handleSystemColorPickerChange", (function(e) {
|
|
848
845
|
var t = a.getValue();
|
|
849
846
|
var r = e !== t;
|
|
850
847
|
var n = a.props.name;
|
|
851
|
-
var o = e === null ?
|
|
848
|
+
var o = e === null ? Ke : e;
|
|
852
849
|
if (!a.isControlled()) {
|
|
853
850
|
a.setState({
|
|
854
851
|
value: e
|
|
@@ -864,19 +861,18 @@
|
|
|
864
861
|
name: n
|
|
865
862
|
});
|
|
866
863
|
}
|
|
867
|
-
|
|
868
|
-
}), 200));
|
|
864
|
+
}));
|
|
869
865
|
a.focusSwatch = n().createRef();
|
|
870
866
|
a.focusExpandButton = n().createRef();
|
|
871
|
-
a.controlledExternally =
|
|
867
|
+
a.controlledExternally = i()(e, "value");
|
|
872
868
|
// value can be hexadecimal color, 'transparent' or null
|
|
873
|
-
var o = a.controlledExternally ? (0,
|
|
874
|
-
|
|
869
|
+
var o = a.controlledExternally ? (0, O.expandShortHandHex)(e.value) : (0,
|
|
870
|
+
O.expandShortHandHex)(e.defaultValue);
|
|
875
871
|
if (o !== null) {
|
|
876
|
-
o =
|
|
872
|
+
o = g()(o);
|
|
877
873
|
}
|
|
878
874
|
// displayValue can be hexadecimal color or 'transparent' to represent 'transparent' or 'N/A' to represent null
|
|
879
|
-
var l = o === null ?
|
|
875
|
+
var l = o === null ? Ke : o;
|
|
880
876
|
a.state = {
|
|
881
877
|
displayValue: l,
|
|
882
878
|
open: false,
|
|
@@ -889,7 +885,7 @@
|
|
|
889
885
|
}
|
|
890
886
|
return a;
|
|
891
887
|
}
|
|
892
|
-
|
|
888
|
+
Oe(r, [ {
|
|
893
889
|
key: "componentDidUpdate",
|
|
894
890
|
value: function e(t) {
|
|
895
891
|
if (false) {}
|
|
@@ -903,9 +899,9 @@
|
|
|
903
899
|
key: "getValue",
|
|
904
900
|
value: function e() {
|
|
905
901
|
var t = function e(t) {
|
|
906
|
-
return t === null ? null :
|
|
902
|
+
return t === null ? null : g()(t);
|
|
907
903
|
};
|
|
908
|
-
var r = (0,
|
|
904
|
+
var r = (0, O.expandShortHandHex)(this.props.value);
|
|
909
905
|
if (this.isControlled()) {
|
|
910
906
|
return t(r);
|
|
911
907
|
}
|
|
@@ -915,20 +911,20 @@
|
|
|
915
911
|
key: "submitValue",
|
|
916
912
|
value: function e(t) {
|
|
917
913
|
if (t) {
|
|
918
|
-
var n =
|
|
919
|
-
if (!n && t !== "transparent" && t !==
|
|
914
|
+
var n = ze(t);
|
|
915
|
+
if (!n && t !== "transparent" && t !== Ke) {
|
|
920
916
|
// eslint-disable-next-line no-console
|
|
921
917
|
console.warn('"'.concat(t, '" is not a valid hex color.'));
|
|
922
918
|
}
|
|
923
|
-
if (n || r.hasTransparent(this.props.palette) && t === "transparent" || t ===
|
|
924
|
-
var a = (0,
|
|
919
|
+
if (n || r.hasTransparent(this.props.palette) && t === "transparent" || t === Ke) {
|
|
920
|
+
var a = (0, O.expandShortHandHex)(t);
|
|
925
921
|
this.setState({
|
|
926
922
|
displayValue: a
|
|
927
923
|
});
|
|
928
|
-
var o = t !== (this.props.value &&
|
|
924
|
+
var o = t !== (this.props.value && g()(this.props.value));
|
|
929
925
|
var l = this.props.name;
|
|
930
|
-
var i = t ===
|
|
931
|
-
var s = (0,
|
|
926
|
+
var i = t === Ke ? null : t;
|
|
927
|
+
var s = (0, O.expandShortHandHex)(i);
|
|
932
928
|
if (t && !this.isControlled()) {
|
|
933
929
|
this.setState({
|
|
934
930
|
value: s
|
|
@@ -964,31 +960,31 @@
|
|
|
964
960
|
var s = this.props.splunkTheme;
|
|
965
961
|
var u = this.state.displayValue;
|
|
966
962
|
var c = s.isPrisma;
|
|
967
|
-
var p = r.hasTransparent(this.props.palette) &&
|
|
968
|
-
var d =
|
|
963
|
+
var p = r.hasTransparent(this.props.palette) && g()(u) === "transparent";
|
|
964
|
+
var d = g()(u) === Fe;
|
|
969
965
|
var f = u;
|
|
970
|
-
if (!
|
|
966
|
+
if (!y()(u, "#")) {
|
|
971
967
|
f = "#".concat(u);
|
|
972
968
|
}
|
|
973
969
|
f = p ? "transparent" : f;
|
|
974
970
|
f = d ? null : f;
|
|
975
971
|
|
|
976
|
-
return n().createElement(
|
|
972
|
+
return n().createElement(Y, {
|
|
977
973
|
$inDropdown: i
|
|
978
|
-
}, n().createElement(
|
|
974
|
+
}, n().createElement(Z, {
|
|
979
975
|
$inDropdown: i,
|
|
980
976
|
append: a,
|
|
981
977
|
autoCapitalize: "off",
|
|
982
978
|
autoComplete: "off",
|
|
983
979
|
autoCorrect: "off",
|
|
984
980
|
spellCheck: false,
|
|
985
|
-
"aria-label": (0,
|
|
981
|
+
"aria-label": (0, _._)("Hexadecimal color value"),
|
|
986
982
|
prepend: o,
|
|
987
983
|
inline: l,
|
|
988
984
|
onKeyDown: this.handleTextKeyDown,
|
|
989
985
|
onChange: this.handleTextChange,
|
|
990
986
|
value: u
|
|
991
|
-
}), !c && n().createElement(
|
|
987
|
+
}), !c && n().createElement(J, {
|
|
992
988
|
"data-test": "textbox-swatch",
|
|
993
989
|
onClick: this.handleButtonClick,
|
|
994
990
|
value: f,
|
|
@@ -1006,7 +1002,7 @@
|
|
|
1006
1002
|
var l = this.state.expanded;
|
|
1007
1003
|
var i = a.isPrisma;
|
|
1008
1004
|
|
|
1009
|
-
return n().createElement(
|
|
1005
|
+
return n().createElement(ve, {
|
|
1010
1006
|
palette: o,
|
|
1011
1007
|
value: this.getValue(),
|
|
1012
1008
|
swatchToFocusRef: this.focusSwatch,
|
|
@@ -1036,27 +1032,27 @@
|
|
|
1036
1032
|
key: "render",
|
|
1037
1033
|
value: function e() {
|
|
1038
1034
|
var t = this;
|
|
1039
|
-
var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef, u = a.error, c = a.hideInput,
|
|
1035
|
+
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, m = a.splunkTheme, y = ke(a, [ "append", "disabled", "describedBy", "elementRef", "error", "hideInput", "labelledBy", "name", "prepend", "splunkTheme" ]);
|
|
1040
1036
|
var b = m.isPrisma;
|
|
1041
1037
|
var g = this.getValue();
|
|
1042
1038
|
var x = this.state.displayValue;
|
|
1043
|
-
var w = n().createElement(
|
|
1039
|
+
var w = n().createElement(ee, me({
|
|
1044
1040
|
append: b && !c ? true : o,
|
|
1045
1041
|
"data-test": "color",
|
|
1046
1042
|
"data-test-value": x,
|
|
1047
1043
|
"aria-describedby": i,
|
|
1048
|
-
"aria-labelledby":
|
|
1044
|
+
"aria-labelledby": d,
|
|
1049
1045
|
"aria-invalid": u || undefined,
|
|
1050
1046
|
disabled: l,
|
|
1051
1047
|
error: u,
|
|
1052
1048
|
elementRef: s,
|
|
1053
|
-
name:
|
|
1054
|
-
prepend:
|
|
1049
|
+
name: v,
|
|
1050
|
+
prepend: h,
|
|
1055
1051
|
value: g
|
|
1056
|
-
},
|
|
1052
|
+
}, f()(y, [].concat(ye(p()(r.propTypes)), [ // TS: trick omit
|
|
1057
1053
|
"onChange" ]))));
|
|
1058
1054
|
|
|
1059
|
-
return n().createElement(
|
|
1055
|
+
return n().createElement(G, null, n().createElement(E(), {
|
|
1060
1056
|
closeReasons: [ "clickAway", "escapeKey", "offScreen", "toggleClick" ],
|
|
1061
1057
|
onRequestClose: this.handleRequestClose,
|
|
1062
1058
|
onRequestOpen: this.handleRequestOpen,
|
|
@@ -1077,12 +1073,12 @@
|
|
|
1077
1073
|
} ]);
|
|
1078
1074
|
return r;
|
|
1079
1075
|
}(r.Component);
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
var
|
|
1083
|
-
|
|
1076
|
+
Ve(Me, "propTypes", $e);
|
|
1077
|
+
Ve(Me, "defaultProps", He);
|
|
1078
|
+
var Le = (0, P.withSplunkTheme)(Me);
|
|
1079
|
+
Le.propTypes = Me.propTypes;
|
|
1084
1080
|
// TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
|
|
1085
|
-
/* harmony default export */ const
|
|
1081
|
+
/* harmony default export */ const Ue = Le;
|
|
1086
1082
|
// CONCATENATED MODULE: ./src/Color/index.ts
|
|
1087
1083
|
module.exports = t;
|
|
1088
1084
|
/******/})();
|