@splunk/react-ui 5.0.0-rc.2 → 5.1.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 +59 -59
- package/Avatar.js +20 -20
- package/Breadcrumbs.js +46 -46
- package/Button.js +24 -24
- package/CHANGELOG.md +380 -0
- package/Calendar.js +69 -69
- package/Card.js +68 -68
- package/Chip.js +16 -16
- package/Clickable.js +29 -29
- package/Code.js +654 -519
- package/CollapsiblePanel.js +112 -112
- package/Color.js +107 -107
- package/ColumnLayout.js +35 -35
- package/ComboBox.js +190 -206
- package/ControlGroup.js +129 -121
- package/Date.js +148 -146
- package/DefinitionList.js +26 -26
- package/Dropdown.js +9 -9
- package/DualListbox.js +701 -717
- package/File.js +403 -403
- package/FormRows.js +66 -63
- package/Image.js +15 -15
- package/JSONTree.js +458 -357
- package/Layer.js +60 -72
- package/MIGRATION.md +550 -1
- package/Markdown.js +66 -66
- package/Menu.js +44 -44
- package/Message.js +47 -43
- package/Modal.js +49 -49
- package/ModalLayer.js +21 -17
- package/Monogram.js +16 -16
- package/Multiselect.js +673 -669
- package/Number.js +100 -100
- package/Paginator.js +7 -7
- package/Popover.js +473 -424
- package/Progress.js +12 -12
- package/Prose.js +6 -6
- package/README.md +6 -6
- package/RadioBar.js +180 -166
- package/RadioList.js +80 -79
- package/ResultsMenu.js +129 -128
- package/Scroll.js +50 -50
- package/Search.js +148 -164
- package/Select.js +674 -674
- package/Slider.js +30 -30
- package/SlidingPanels.js +24 -24
- package/SplitButton.js +50 -50
- package/StepBar.js +100 -100
- package/Switch.js +45 -45
- package/TabBar.js +196 -196
- package/TabLayout.js +16 -16
- package/Table.js +1207 -1193
- package/Text.js +65 -65
- package/TextArea.js +108 -93
- package/Tooltip.js +203 -197
- package/TransitionOpen.js +4 -1
- package/Tree.js +464 -366
- package/package.json +11 -11
- package/stubs-dependencies.d.ts +0 -70
- package/stubs-splunkui.d.ts +4 -0
- package/types/src/Code/Code.d.ts +17 -1
- package/types/src/Code/LineHighlights.d.ts +11 -0
- package/types/src/Code/LineNumbers.d.ts +6 -0
- package/types/src/Code/docs/examples/LineHighlights.d.ts +3 -0
- package/types/src/Code/docs/examples/LineNumbers.d.ts +3 -0
- package/types/src/Code/docs/examples/LineNumbersCustomStart.d.ts +3 -0
- package/types/src/Date/Date.d.ts +6 -1
- package/types/src/DefinitionList/DefinitionList.d.ts +6 -6
- package/types/src/Dropdown/Dropdown.d.ts +1 -0
- package/types/src/FormRows/FormRows.d.ts +1 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +5 -2
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
- package/types/src/Markdown/renderers/index.d.ts +1 -1
- package/types/src/Popover/Popover.d.ts +8 -2
- package/types/src/RadioBar/Option.d.ts +1 -1
- package/types/src/RadioBar/RadioBar.d.ts +13 -6
- package/types/src/RadioBar/RadioBarContext.d.ts +4 -2
- package/types/src/RadioList/RadioList.d.ts +2 -1
- package/types/src/ResultsMenu/ResultsMenu.d.ts +2 -1
- package/types/src/ScreenReaderContent/docs/examples/SkipLink.d.ts +3 -0
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Slider/docs/examples/Controlled.d.ts +1 -1
- package/types/src/TabLayout/Panel.d.ts +0 -1
- package/types/src/Table/Head.d.ts +1 -0
- package/types/src/Table/HeadCell.d.ts +2 -3
- package/types/src/Table/HeadDropdownCell.d.ts +2 -2
- package/types/src/Table/HeadInner.d.ts +4 -4
- package/types/src/Table/KeyboardSensor.d.ts +1 -1
- package/types/src/Table/RowDragCell.d.ts +1 -1
- package/types/src/Tooltip/Tooltip.d.ts +10 -5
- package/types/src/Tree/Item.d.ts +63 -0
- package/types/src/Tree/Tree.d.ts +13 -6
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/types/src/Tree/index.d.ts +1 -1
- package/types/src/useControlled/useControlled.d.ts +3 -1
- package/useControlled.js +29 -13
- package/CHANGELOG.v5.md +0 -354
- package/MIGRATION.v5.md +0 -552
- package/types/src/Button/docs/examples/Truncated.d.ts +0 -3
- package/types/src/Tree/TreeItem.d.ts +0 -44
package/Layer.js
CHANGED
|
@@ -35,18 +35,6 @@
|
|
|
35
35
|
/******/ };
|
|
36
36
|
/******/ })();
|
|
37
37
|
/******/
|
|
38
|
-
/******/ /* webpack/runtime/global */
|
|
39
|
-
/******/ (() => {
|
|
40
|
-
/******/ e.g = function() {
|
|
41
|
-
/******/ if (typeof globalThis === "object") return globalThis;
|
|
42
|
-
/******/ try {
|
|
43
|
-
/******/ return this || new Function("return this")();
|
|
44
|
-
/******/ } catch (e) {
|
|
45
|
-
/******/ if (typeof window === "object") return window;
|
|
46
|
-
/******/ }
|
|
47
|
-
/******/ }();
|
|
48
|
-
/******/ })();
|
|
49
|
-
/******/
|
|
50
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
51
39
|
/******/ (() => {
|
|
52
40
|
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
@@ -81,20 +69,20 @@
|
|
|
81
69
|
// CONCATENATED MODULE: external "react"
|
|
82
70
|
const n = require("react");
|
|
83
71
|
var r = e.n(n);
|
|
84
|
-
// CONCATENATED MODULE: external "react-dom"
|
|
85
|
-
const o = require("react-dom");
|
|
86
|
-
// CONCATENATED MODULE: external "prop-types"
|
|
87
|
-
const a = require("prop-types");
|
|
88
|
-
var i = e.n(a);
|
|
89
72
|
// CONCATENATED MODULE: external "lodash/includes"
|
|
90
|
-
const
|
|
91
|
-
var
|
|
73
|
+
const o = require("lodash/includes");
|
|
74
|
+
var a = e.n(o);
|
|
92
75
|
// CONCATENATED MODULE: external "lodash/last"
|
|
93
|
-
const
|
|
94
|
-
var
|
|
76
|
+
const i = require("lodash/last");
|
|
77
|
+
var u = e.n(i);
|
|
95
78
|
// CONCATENATED MODULE: external "lodash/pull"
|
|
96
|
-
const
|
|
97
|
-
var
|
|
79
|
+
const l = require("lodash/pull");
|
|
80
|
+
var c = e.n(l);
|
|
81
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
82
|
+
const s = require("prop-types");
|
|
83
|
+
var f = e.n(s);
|
|
84
|
+
// CONCATENATED MODULE: external "react-dom"
|
|
85
|
+
const d = require("react-dom");
|
|
98
86
|
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
99
87
|
const v = require("@splunk/react-ui/EventListener");
|
|
100
88
|
var y = e.n(v);
|
|
@@ -104,6 +92,7 @@
|
|
|
104
92
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
105
93
|
const h = require("@splunk/ui-utils/id");
|
|
106
94
|
// CONCATENATED MODULE: ./src/Layer/LayerStack.tsx
|
|
95
|
+
/* global globalThis */
|
|
107
96
|
/**
|
|
108
97
|
* `LayerStackContext` is used to manage the array that `Layer` (and components that
|
|
109
98
|
* depend on it, such as `Modal`) uses to determine the order of open layers.
|
|
@@ -112,33 +101,32 @@
|
|
|
112
101
|
var g = r().createContext([]);
|
|
113
102
|
var b = r().createContext({});
|
|
114
103
|
var C = {
|
|
115
|
-
children:
|
|
116
|
-
name:
|
|
117
|
-
scope:
|
|
118
|
-
separateStackingContexts:
|
|
104
|
+
children: f().node,
|
|
105
|
+
name: f().string,
|
|
106
|
+
scope: f().object,
|
|
107
|
+
separateStackingContexts: f().bool
|
|
119
108
|
};
|
|
120
|
-
/* global global */
|
|
121
109
|
/**
|
|
122
110
|
* A `LayerStackContext` provider that stores a shared layer stack using a global variable.
|
|
123
111
|
* Applications should only use this provider if there's a known need to support multiple
|
|
124
112
|
* instances of this library on the same page.
|
|
125
|
-
*/ function E(
|
|
126
|
-
var
|
|
127
|
-
if (!
|
|
128
|
-
|
|
113
|
+
*/ function E(e) {
|
|
114
|
+
var t = e.children, o = e.name, a = o === void 0 ? "__splunkui_layer_instances__" : o, i = e.scope, u = i === void 0 ? typeof window !== "undefined" ? window : globalThis : i, l = e.separateStackingContexts, c = l === void 0 ? false : l;
|
|
115
|
+
if (!u[a]) {
|
|
116
|
+
u[a] = [];
|
|
129
117
|
// eslint-disable-line no-param-reassign
|
|
130
118
|
}
|
|
131
|
-
var
|
|
119
|
+
var s = (0, n.useMemo)((function() {
|
|
132
120
|
return {
|
|
133
|
-
separateStackingContexts:
|
|
121
|
+
separateStackingContexts: c
|
|
134
122
|
};
|
|
135
|
-
}), [
|
|
123
|
+
}), [ c ]);
|
|
136
124
|
|
|
137
125
|
return r().createElement(g.Provider, {
|
|
138
|
-
value:
|
|
126
|
+
value: u[a]
|
|
139
127
|
}, r().createElement(b.Provider, {
|
|
140
|
-
value:
|
|
141
|
-
},
|
|
128
|
+
value: s
|
|
129
|
+
}, t));
|
|
142
130
|
}
|
|
143
131
|
E.propTypes = C;
|
|
144
132
|
// CONCATENATED MODULE: external "styled-components"
|
|
@@ -273,15 +261,15 @@
|
|
|
273
261
|
clearTimeout(t);
|
|
274
262
|
}
|
|
275
263
|
};
|
|
276
|
-
function
|
|
264
|
+
function O() {
|
|
277
265
|
var e = typeof window !== "undefined" ? window : _;
|
|
278
266
|
return e;
|
|
279
267
|
}
|
|
280
|
-
var
|
|
281
|
-
/* harmony default export */ const
|
|
268
|
+
var P = O();
|
|
269
|
+
/* harmony default export */ const j = P;
|
|
282
270
|
// CONCATENATED MODULE: ./src/Layer/Layer.tsx
|
|
283
271
|
function M(e, t) {
|
|
284
|
-
return
|
|
272
|
+
return F(e) || D(e, t) || N(e, t) || I();
|
|
285
273
|
}
|
|
286
274
|
function I() {
|
|
287
275
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
@@ -300,7 +288,7 @@
|
|
|
300
288
|
}
|
|
301
289
|
return r;
|
|
302
290
|
}
|
|
303
|
-
function
|
|
291
|
+
function D(e, t) {
|
|
304
292
|
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
305
293
|
if (null != n) {
|
|
306
294
|
var r, o, a, i, u = [], l = !0, c = !1;
|
|
@@ -322,40 +310,40 @@
|
|
|
322
310
|
return u;
|
|
323
311
|
}
|
|
324
312
|
}
|
|
325
|
-
function
|
|
313
|
+
function F(e) {
|
|
326
314
|
if (Array.isArray(e)) return e;
|
|
327
315
|
}
|
|
328
316
|
/** @public */
|
|
329
317
|
/** @public */ var K = [ "clickAway", "escapeKey" ];
|
|
330
318
|
var $ = {
|
|
331
|
-
children:
|
|
332
|
-
closeReasons:
|
|
333
|
-
onRequestClose:
|
|
334
|
-
open:
|
|
319
|
+
children: f().node,
|
|
320
|
+
closeReasons: f().arrayOf(f().oneOf(K)),
|
|
321
|
+
onRequestClose: f().func,
|
|
322
|
+
open: f().bool
|
|
335
323
|
};
|
|
336
324
|
var z = {
|
|
337
325
|
passive: true
|
|
338
326
|
};
|
|
339
327
|
// we need a custom type here in order to set layerContainer as a property
|
|
340
328
|
var B = function e(t) {
|
|
341
|
-
var
|
|
329
|
+
var o = t.children, i = t.closeReasons, l = i === void 0 ? K : i, s = t.open, f = t.onRequestClose;
|
|
342
330
|
var v = (0, n.useContext)(b), p = v.separateStackingContexts;
|
|
343
331
|
var C = (0, n.useContext)(g);
|
|
344
332
|
var E = (0, n.useRef)(null);
|
|
345
333
|
var S = (0, n.useState)((0, h.createGUID)()), k = M(S, 1), w = k[0];
|
|
346
|
-
var q = m()(
|
|
334
|
+
var q = m()(s);
|
|
347
335
|
(0, n.useEffect)((function() {
|
|
348
|
-
if (
|
|
336
|
+
if (s && !q) {
|
|
349
337
|
C.push(w);
|
|
350
|
-
} else if (q && !
|
|
351
|
-
|
|
338
|
+
} else if (q && !s) {
|
|
339
|
+
c()(C, w);
|
|
352
340
|
}
|
|
353
|
-
}), [ w, C,
|
|
341
|
+
}), [ w, C, s, q ]);
|
|
354
342
|
// it is not part of the previous useEffect because it needs to be equivalent to componentWillUnmount
|
|
355
343
|
// the previous useEffect will get re-run every time open and prevOpen change which is not what we want
|
|
356
344
|
(0, n.useEffect)((function() {
|
|
357
345
|
return function() {
|
|
358
|
-
|
|
346
|
+
c()(C, w);
|
|
359
347
|
};
|
|
360
348
|
}), [ w, C ]);
|
|
361
349
|
if (!e.layerContainer) {
|
|
@@ -378,56 +366,56 @@
|
|
|
378
366
|
}
|
|
379
367
|
}
|
|
380
368
|
}), []);
|
|
381
|
-
var
|
|
369
|
+
var O = (0, n.useCallback)((function(e) {
|
|
382
370
|
var t = e.nativeEvent;
|
|
383
371
|
E.current = t;
|
|
384
372
|
}), []);
|
|
385
|
-
var
|
|
373
|
+
var P = (0, n.useCallback)((function(e) {
|
|
386
374
|
// clicks inside the layer should not be considered clickAways
|
|
387
|
-
if (!
|
|
375
|
+
if (!s || !a()(l, "clickAway") || E.current === e) {
|
|
388
376
|
return;
|
|
389
377
|
}
|
|
390
378
|
f === null || f === void 0 ? void 0 : f({
|
|
391
379
|
event: e,
|
|
392
380
|
reason: "clickAway"
|
|
393
381
|
});
|
|
394
|
-
}), [
|
|
382
|
+
}), [ l, s, f ]);
|
|
395
383
|
var I = (0, n.useCallback)((function(e) {
|
|
396
|
-
if (
|
|
384
|
+
if (s && e.key === "Escape" && u()(C) === w && a()(l, "escapeKey")) {
|
|
397
385
|
f === null || f === void 0 ? void 0 : f({
|
|
398
386
|
event: e,
|
|
399
387
|
reason: "escapeKey"
|
|
400
388
|
});
|
|
401
389
|
}
|
|
402
|
-
}), [
|
|
390
|
+
}), [ l, w, C, s, f ]);
|
|
403
391
|
var N = r().createElement(y(), {
|
|
404
|
-
target:
|
|
392
|
+
target: j,
|
|
405
393
|
eventType: "fullscreenchange",
|
|
406
394
|
listener: _,
|
|
407
395
|
key: "fullScreenChange"
|
|
408
396
|
});
|
|
409
|
-
if (
|
|
410
|
-
var R = (0,
|
|
397
|
+
if (s) {
|
|
398
|
+
var R = (0, d.createPortal)( r().createElement(T, {
|
|
411
399
|
$separateStackingContexts: p,
|
|
412
400
|
"data-test": "layer",
|
|
413
|
-
onMouseDown:
|
|
414
|
-
onTouchStart:
|
|
415
|
-
},
|
|
401
|
+
onMouseDown: O,
|
|
402
|
+
onTouchStart: O
|
|
403
|
+
}, o), e.layerContainer);
|
|
416
404
|
|
|
417
405
|
return r().createElement(r().Fragment, null, r().createElement(y(), {
|
|
418
|
-
target:
|
|
406
|
+
target: j,
|
|
419
407
|
eventType: "keydown",
|
|
420
408
|
listener: I,
|
|
421
409
|
key: "eventListenerKeydown"
|
|
422
410
|
}), r().createElement(y(), {
|
|
423
|
-
target:
|
|
411
|
+
target: j,
|
|
424
412
|
eventType: "mousedown",
|
|
425
|
-
listener:
|
|
413
|
+
listener: P,
|
|
426
414
|
key: "eventListenerMouseDown"
|
|
427
415
|
}), r().createElement(y(), {
|
|
428
|
-
target:
|
|
416
|
+
target: j,
|
|
429
417
|
eventType: "touchstart",
|
|
430
|
-
listener:
|
|
418
|
+
listener: P,
|
|
431
419
|
key: "eventListenerTouchStart",
|
|
432
420
|
options: z
|
|
433
421
|
}), N, R);
|