@splunk/react-ui 4.20.0 → 4.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +425 -441
- package/Anchor.js +147 -193
- package/Animation.js +142 -166
- package/AnimationToggle.js +197 -253
- package/Box.js +145 -194
- package/Breadcrumbs.js +288 -298
- package/Button.js +488 -613
- package/ButtonGroup.js +160 -212
- package/ButtonSimple.js +543 -562
- package/CHANGELOG.md +26 -0
- package/Calendar.js +1107 -1195
- package/Card.js +771 -746
- package/CardLayout.js +205 -223
- package/Chip.js +509 -612
- package/Clickable.js +416 -472
- package/CloseButton.js +165 -250
- package/Code.js +1808 -2172
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -675
- package/Color.js +1066 -1297
- package/ColumnLayout.js +402 -465
- package/ComboBox.js +892 -969
- package/Concertina.js +998 -963
- package/ControlGroup.js +687 -718
- package/Date.js +567 -697
- package/DefinitionList.js +308 -310
- package/Divider.js +149 -194
- package/Dropdown.js +459 -558
- package/DualListbox.js +1480 -1735
- package/EventListener.js +94 -165
- package/File.js +1051 -1173
- package/FormRows.js +885 -880
- package/Heading.js +216 -263
- package/Image.js +446 -558
- package/JSONTree.js +690 -699
- package/Layer.js +442 -582
- package/Link.js +336 -361
- package/List.js +213 -237
- package/Markdown.js +510 -612
- package/Menu.js +1109 -1331
- package/Message.js +474 -629
- package/MessageBar.js +387 -561
- package/Modal.js +810 -798
- package/ModalLayer.js +326 -343
- package/Monogram.js +308 -368
- package/Multiselect.js +3558 -3998
- package/Number.js +729 -843
- package/Paginator.js +510 -615
- package/Paragraph.js +145 -188
- package/Popover.js +1470 -1693
- package/Progress.js +301 -362
- package/RadioBar.js +610 -651
- package/RadioList.js +483 -544
- package/Resize.js +530 -623
- package/ResultsMenu.js +494 -597
- package/ScreenReaderContent.js +142 -187
- package/Scroll.js +595 -598
- package/ScrollContainerContext.js +197 -278
- package/Search.js +745 -817
- package/Select.js +2441 -2746
- package/SidePanel.js +390 -392
- package/Slider.js +668 -825
- package/SlidingPanels.js +639 -645
- package/SplitButton.js +464 -499
- package/StaticContent.js +161 -217
- package/StepBar.js +386 -466
- package/Switch.js +710 -764
- package/TabBar.js +724 -815
- package/TabLayout.js +406 -438
- package/Table.js +4842 -5121
- package/Text.js +1169 -1351
- package/TextArea.js +1097 -1307
- package/Tooltip.js +624 -721
- package/TransitionOpen.js +489 -546
- package/Typography.js +176 -229
- package/WaitSpinner.js +230 -298
- package/package.json +14 -15
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/Link/Link.d.ts +7 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +112 -146
- package/useKeyPress.js +74 -128
- package/usePrevious.js +65 -129
- package/useRovingFocus.js +122 -218
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/useRovingFocus.js
CHANGED
|
@@ -1,129 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
/******/
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/******/
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/
|
|
32
|
-
/******/
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/******/
|
|
42
|
-
/******/
|
|
43
|
-
/******/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 246);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
89
|
-
|
|
90
|
-
/***/ 2:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("react");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 246:
|
|
98
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
|
-
|
|
100
|
-
"use strict";
|
|
101
|
-
// ESM COMPAT FLAG
|
|
102
|
-
__webpack_require__.r(__webpack_exports__);
|
|
103
|
-
|
|
104
|
-
// EXPORTS
|
|
105
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ useRovingFocus_useRovingFocus; });
|
|
106
|
-
|
|
107
|
-
// EXTERNAL MODULE: external "react"
|
|
108
|
-
var external_react_ = __webpack_require__(2);
|
|
109
|
-
|
|
110
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/focus"
|
|
111
|
-
var focus_ = __webpack_require__(31);
|
|
112
|
-
|
|
113
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
114
|
-
var keyboard_ = __webpack_require__(7);
|
|
115
|
-
|
|
116
|
-
// CONCATENATED MODULE: ./src/useRovingFocus/useRovingFocus.tsx
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
function focusElement(element) {
|
|
122
|
-
if (element instanceof HTMLElement && element.focus) {
|
|
123
|
-
element.focus();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/define property getters */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // define getter functions for harmony exports
|
|
11
|
+
/******/ e.d = (t, r) => {
|
|
12
|
+
/******/ for (var n in r) {
|
|
13
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
14
|
+
/******/ Object.defineProperty(t, n, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: r[n]
|
|
17
|
+
});
|
|
18
|
+
/******/ }
|
|
19
|
+
/******/ }
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
26
|
+
/******/;
|
|
27
|
+
})();
|
|
28
|
+
/******/
|
|
29
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
30
|
+
/******/ (() => {
|
|
31
|
+
/******/ // define __esModule on exports
|
|
32
|
+
/******/ e.r = e => {
|
|
33
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
34
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
35
|
+
value: "Module"
|
|
36
|
+
});
|
|
37
|
+
/******/ }
|
|
38
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
|
41
|
+
/******/ };
|
|
42
|
+
/******/ })();
|
|
43
|
+
/******/
|
|
44
|
+
/************************************************************************/ var t = {};
|
|
45
|
+
// ESM COMPAT FLAG
|
|
46
|
+
e.r(t);
|
|
47
|
+
// EXPORTS
|
|
48
|
+
e.d(t, {
|
|
49
|
+
default: () => /* reexport */ a
|
|
50
|
+
});
|
|
51
|
+
// CONCATENATED MODULE: external "react"
|
|
52
|
+
const r = require("react");
|
|
53
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
54
|
+
const n = require("@splunk/ui-utils/focus");
|
|
55
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
56
|
+
const u = require("@splunk/ui-utils/keyboard");
|
|
57
|
+
// CONCATENATED MODULE: ./src/useRovingFocus/useRovingFocus.tsx
|
|
58
|
+
function i(e) {
|
|
59
|
+
if (e instanceof HTMLElement && e.focus) {
|
|
60
|
+
e.focus();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
127
64
|
* This is a private hook not intended for use outside @splunk/react-ui
|
|
128
65
|
*
|
|
129
66
|
* Handles "roving focus" for a group of elements inside a containing element.
|
|
@@ -142,96 +79,63 @@ function focusElement(element) {
|
|
|
142
79
|
* <button type="button">second</button>
|
|
143
80
|
* </div>
|
|
144
81
|
* ```
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (newIndex >= 0) {
|
|
201
|
-
e.preventDefault();
|
|
202
|
-
focusElement(actionItemsRef.current[newIndex]);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
82
|
+
*/ function o() {
|
|
83
|
+
var e = (0, r.useRef)(0);
|
|
84
|
+
var t = (0, r.useRef)([]);
|
|
85
|
+
var o = function r(n) {
|
|
86
|
+
e.current = n;
|
|
87
|
+
t.current.forEach((function(t, r) {
|
|
88
|
+
return r === e.current ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", "-1");
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
var a = function r(u) {
|
|
92
|
+
t.current = u != null ? (0, n.getSortedTabbableElements)(u, {
|
|
93
|
+
ignoreTabIndex: true
|
|
94
|
+
}) : [];
|
|
95
|
+
o(e.current);
|
|
96
|
+
};
|
|
97
|
+
var f = function e(r) {
|
|
98
|
+
var n = r.relatedTarget instanceof Element && t.current.includes(r.relatedTarget);
|
|
99
|
+
if (!n) {
|
|
100
|
+
o(0);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var c = function e(r) {
|
|
104
|
+
var n = r.target instanceof Element ? t.current.indexOf(r.target) : -1;
|
|
105
|
+
if (n >= 0) {
|
|
106
|
+
o(n);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var l = function e(r) {
|
|
110
|
+
if (r.nativeEvent.target instanceof HTMLElement) {
|
|
111
|
+
var n = t.current.indexOf(r.nativeEvent.target);
|
|
112
|
+
if (n >= 0) {
|
|
113
|
+
var o = (0, u.keycode)(r.nativeEvent);
|
|
114
|
+
var a = -1;
|
|
115
|
+
if (o === "left") {
|
|
116
|
+
a = n - 1;
|
|
117
|
+
} else if (o === "right") {
|
|
118
|
+
a = n + 1;
|
|
119
|
+
} else if (o === "home") {
|
|
120
|
+
a = 0;
|
|
121
|
+
} else if (o === "end") {
|
|
122
|
+
a = t.current.length - 1;
|
|
123
|
+
}
|
|
124
|
+
if (a >= 0) {
|
|
125
|
+
r.preventDefault();
|
|
126
|
+
i(t.current[a]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
return {
|
|
132
|
+
ref: a,
|
|
133
|
+
onBlur: f,
|
|
134
|
+
onFocus: c,
|
|
135
|
+
onKeyDown: l
|
|
136
|
+
};
|
|
205
137
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
onBlur: handleBlur,
|
|
211
|
-
onFocus: handleFocus,
|
|
212
|
-
onKeyDown: handleKeyDown
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/* harmony default export */ var useRovingFocus_useRovingFocus = (useRovingFocus);
|
|
217
|
-
// CONCATENATED MODULE: ./src/useRovingFocus/index.ts
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
/***/ }),
|
|
222
|
-
|
|
223
|
-
/***/ 31:
|
|
224
|
-
/***/ (function(module, exports) {
|
|
225
|
-
|
|
226
|
-
module.exports = require("@splunk/ui-utils/focus");
|
|
227
|
-
|
|
228
|
-
/***/ }),
|
|
229
|
-
|
|
230
|
-
/***/ 7:
|
|
231
|
-
/***/ (function(module, exports) {
|
|
232
|
-
|
|
233
|
-
module.exports = require("@splunk/ui-utils/keyboard");
|
|
234
|
-
|
|
235
|
-
/***/ })
|
|
236
|
-
|
|
237
|
-
/******/ });
|
|
138
|
+
/* harmony default export */ const a = o;
|
|
139
|
+
// CONCATENATED MODULE: ./src/useRovingFocus/index.ts
|
|
140
|
+
module.exports = t;
|
|
141
|
+
/******/})();
|
|
File without changes
|
/package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts}
RENAMED
|
File without changes
|