@splunk/react-ui 4.37.0 → 4.38.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/Button.js +139 -132
- package/CHANGELOG.md +22 -1
- package/Color.js +1145 -977
- package/ComboBox.js +1 -2
- package/Menu.js +161 -153
- package/Multiselect.js +17 -27
- package/ScreenReaderContent.js +138 -94
- package/Search.js +45 -42
- package/Select.js +89 -99
- package/Slider.js +128 -145
- package/Switch.js +122 -118
- package/Text.js +202 -199
- package/package.json +4 -4
- package/types/src/Button/Button.d.ts +15 -5
- package/types/src/Color/Color.d.ts +3 -0
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/Date/Date.d.ts +0 -1
- package/types/src/Link/Link.d.ts +3 -4
- package/types/src/Menu/Item.d.ts +6 -3
- package/types/src/Search/Option.d.ts +7 -0
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectBase.d.ts +0 -1
- package/types/src/Slider/Slider.d.ts +0 -1
- package/types/src/Slider/docs/examples/Error.d.ts +2 -0
- package/types/src/Switch/Switch.d.ts +1 -0
- package/types/src/Text/Text.d.ts +6 -4
- package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Button/docs/examples/Selected.d.ts +0 -2
- package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
- /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
package/Multiselect.js
CHANGED
|
@@ -311,13 +311,12 @@
|
|
|
311
311
|
var t = this.props, n = t.value, o = t.children, a = t.label, i = t.multiple, l = v(t, [ "value", "children", "label", "multiple" ]);
|
|
312
312
|
|
|
313
313
|
return r().createElement(p.Item, d({
|
|
314
|
-
"aria-selected": this.props.selected,
|
|
315
314
|
"data-test-value": n,
|
|
316
315
|
"data-test": "option",
|
|
317
316
|
ref: this.handleMount
|
|
318
317
|
}, l, {
|
|
319
318
|
selectable: true,
|
|
320
|
-
selectableAppearance: i ? "checkbox" :
|
|
319
|
+
selectableAppearance: i ? "checkbox" : "checkmark",
|
|
321
320
|
onClick: this.handleClick,
|
|
322
321
|
role: "option",
|
|
323
322
|
value: n.toString()
|
|
@@ -1450,7 +1449,6 @@
|
|
|
1450
1449
|
Jt($t(a), "dropdown", null);
|
|
1451
1450
|
Jt($t(a), "firstSelectedEnabledOption", null);
|
|
1452
1451
|
Jt($t(a), "firstSelectedOptionIndex", void 0);
|
|
1453
|
-
Jt($t(a), "menuId", void 0);
|
|
1454
1452
|
Jt($t(a), "menuListboxId", void 0);
|
|
1455
1453
|
Jt($t(a), "previousActiveIndex", null);
|
|
1456
1454
|
Jt($t(a), "selectedOptionCount", void 0);
|
|
@@ -1744,35 +1742,26 @@
|
|
|
1744
1742
|
k = E;
|
|
1745
1743
|
// only apply prefix / suffix if the label is not empty
|
|
1746
1744
|
if (k.length > 0) {
|
|
1745
|
+
// If there's more than one item selected, read out the selected total
|
|
1746
|
+
// rather than reading out each selected item
|
|
1747
|
+
I = a.wrapLabel({
|
|
1748
|
+
prefixLabel: O,
|
|
1749
|
+
label: k.length > 1 ? [ "".concat(_.length, " items selected") ] : I,
|
|
1750
|
+
suffixLabel: S
|
|
1751
|
+
});
|
|
1747
1752
|
k = a.wrapLabel({
|
|
1748
1753
|
prefixLabel: O,
|
|
1749
1754
|
label: k,
|
|
1750
1755
|
suffixLabel: S
|
|
1751
1756
|
});
|
|
1752
1757
|
}
|
|
1753
|
-
// single <Select> behaviour is to show the placeholder if all parts of the
|
|
1758
|
+
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
1754
1759
|
// are empty strings so we replicate this behaviour here
|
|
1755
1760
|
if (k.length === 0 || !m && k.every((function(e) {
|
|
1756
1761
|
return e === "";
|
|
1757
1762
|
}))) {
|
|
1758
1763
|
k = Qt(g);
|
|
1759
|
-
|
|
1760
|
-
I = Qt(g);
|
|
1761
|
-
}
|
|
1762
|
-
// If there's more than one item selected, read out the selected total
|
|
1763
|
-
// rather than reading out each selected item
|
|
1764
|
-
if (k.length > 1) {
|
|
1765
|
-
I = a.wrapLabel({
|
|
1766
|
-
prefixLabel: O,
|
|
1767
|
-
label: [ "".concat(_.length, " items selected") ],
|
|
1768
|
-
suffixLabel: S
|
|
1769
|
-
});
|
|
1770
|
-
} else {
|
|
1771
|
-
I = a.wrapLabel({
|
|
1772
|
-
prefixLabel: O,
|
|
1773
|
-
label: I,
|
|
1774
|
-
suffixLabel: S
|
|
1775
|
-
});
|
|
1764
|
+
I = k;
|
|
1776
1765
|
}
|
|
1777
1766
|
var M = Gt({
|
|
1778
1767
|
"aria-describedby": p,
|
|
@@ -1781,6 +1770,7 @@
|
|
|
1781
1770
|
"aria-required": w,
|
|
1782
1771
|
"data-select-appearance": l,
|
|
1783
1772
|
"data-test": m ? "multiselect" : "select",
|
|
1773
|
+
role: "combobox",
|
|
1784
1774
|
disabled: f,
|
|
1785
1775
|
elementRef: d,
|
|
1786
1776
|
error: v
|
|
@@ -1810,8 +1800,6 @@
|
|
|
1810
1800
|
icon: x,
|
|
1811
1801
|
inline: h,
|
|
1812
1802
|
isMenu: true,
|
|
1813
|
-
"aria-haspopup": "listbox",
|
|
1814
|
-
"aria-owns": a.menuId,
|
|
1815
1803
|
onClick: a.props.onClick
|
|
1816
1804
|
}, pe()(a.props, o.invalidLinkAppearanceProps)), !!_.length && m && r().createElement(bt, {
|
|
1817
1805
|
"data-role": "count"
|
|
@@ -2066,7 +2054,6 @@
|
|
|
2066
2054
|
if (false) {}
|
|
2067
2055
|
if (false) {}
|
|
2068
2056
|
o.validateAppearance(e);
|
|
2069
|
-
a.menuId = (0, be.createDOMID)("menu");
|
|
2070
2057
|
a.menuListboxId = (0, be.createDOMID)("menu-listbox");
|
|
2071
2058
|
a.activeItemId = (0, be.createDOMID)("active-item");
|
|
2072
2059
|
return a;
|
|
@@ -2197,7 +2184,9 @@
|
|
|
2197
2184
|
role: "combobox",
|
|
2198
2185
|
"aria-expanded": "true",
|
|
2199
2186
|
"aria-controls": this.menuListboxId,
|
|
2187
|
+
"aria-owns": n ? this.activeItemId : undefined,
|
|
2200
2188
|
"aria-label": (0, u._)("Filter"),
|
|
2189
|
+
"aria-autocomplete": "list",
|
|
2201
2190
|
"aria-activedescendant": this.state.textHasFocus && n ? this.activeItemId : undefined,
|
|
2202
2191
|
inputRef: s,
|
|
2203
2192
|
inputId: l,
|
|
@@ -2234,10 +2223,11 @@
|
|
|
2234
2223
|
"aria-multiselectable": c || undefined,
|
|
2235
2224
|
childrenStart: o.renderControls({
|
|
2236
2225
|
placement: i,
|
|
2237
|
-
hasChildren:
|
|
2226
|
+
hasChildren: b.some((function(e) {
|
|
2227
|
+
return tn(e);
|
|
2228
|
+
}))
|
|
2238
2229
|
}),
|
|
2239
2230
|
focusMode: o.hasFilter() ? "never" : undefined,
|
|
2240
|
-
id: o.menuId,
|
|
2241
2231
|
isLoading: o.props.isLoadingOptions,
|
|
2242
2232
|
menuId: o.menuListboxId,
|
|
2243
2233
|
onScrollBottom: o.props.onScrollBottom ? o.handleScrollBottom : undefined,
|
|
@@ -2269,7 +2259,7 @@
|
|
|
2269
2259
|
canCoverAnchor: xt().innerHeight < 500,
|
|
2270
2260
|
ref: this.handleDropdownMount,
|
|
2271
2261
|
retainFocus: false,
|
|
2272
|
-
takeFocus: d.length === 0 || d.length > 0 && !h ||
|
|
2262
|
+
takeFocus: d.length === 0 || d.length > 0 && !h || f
|
|
2273
2263
|
}, m);
|
|
2274
2264
|
}
|
|
2275
2265
|
} ]);
|
package/ScreenReaderContent.js
CHANGED
|
@@ -1,34 +1,75 @@
|
|
|
1
1
|
/******/ (() => {
|
|
2
2
|
// webpackBootstrap
|
|
3
3
|
/******/ "use strict";
|
|
4
|
-
/******/
|
|
5
|
-
|
|
4
|
+
/******/ var e = {
|
|
5
|
+
/***/ 3563:
|
|
6
|
+
/***/ e => {
|
|
7
|
+
e.exports = require("@splunk/themes");
|
|
8
|
+
/***/ },
|
|
9
|
+
/***/ 23:
|
|
10
|
+
/***/ e => {
|
|
11
|
+
e.exports = require("prop-types");
|
|
12
|
+
/***/ },
|
|
13
|
+
/***/ 9497:
|
|
14
|
+
/***/ e => {
|
|
15
|
+
e.exports = require("react");
|
|
16
|
+
/***/ },
|
|
17
|
+
/***/ 232:
|
|
18
|
+
/***/ e => {
|
|
19
|
+
e.exports = require("styled-components");
|
|
20
|
+
/***/
|
|
21
|
+
/******/ }
|
|
22
|
+
};
|
|
23
|
+
/************************************************************************/
|
|
24
|
+
/******/ // The module cache
|
|
25
|
+
/******/ var r = {};
|
|
26
|
+
/******/
|
|
27
|
+
/******/ // The require function
|
|
28
|
+
/******/ function t(n) {
|
|
29
|
+
/******/ // Check if module is in cache
|
|
30
|
+
/******/ var o = r[n];
|
|
31
|
+
/******/ if (o !== undefined) {
|
|
32
|
+
/******/ return o.exports;
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ // Create a new module (and put it into the cache)
|
|
35
|
+
/******/ var a = r[n] = {
|
|
36
|
+
/******/ // no module.id needed
|
|
37
|
+
/******/ // no module.loaded needed
|
|
38
|
+
/******/ exports: {}
|
|
39
|
+
/******/ };
|
|
40
|
+
/******/
|
|
41
|
+
/******/ // Execute the module function
|
|
42
|
+
/******/ e[n](a, a.exports, t);
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // Return the exports of the module
|
|
45
|
+
/******/ return a.exports;
|
|
46
|
+
/******/ }
|
|
6
47
|
/******/
|
|
7
48
|
/************************************************************************/
|
|
8
49
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
50
|
/******/ (() => {
|
|
10
51
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/
|
|
12
|
-
/******/ var
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
52
|
+
/******/ t.n = e => {
|
|
53
|
+
/******/ var r = e && e.__esModule ?
|
|
54
|
+
/******/ () => e["default"]
|
|
55
|
+
/******/ : () => e
|
|
15
56
|
/******/;
|
|
16
|
-
|
|
17
|
-
a:
|
|
57
|
+
t.d(r, {
|
|
58
|
+
a: r
|
|
18
59
|
});
|
|
19
|
-
/******/ return
|
|
60
|
+
/******/ return r;
|
|
20
61
|
/******/ };
|
|
21
62
|
/******/ })();
|
|
22
63
|
/******/
|
|
23
64
|
/******/ /* webpack/runtime/define property getters */
|
|
24
65
|
/******/ (() => {
|
|
25
66
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/
|
|
27
|
-
/******/ for (var n in
|
|
28
|
-
/******/ if (
|
|
29
|
-
/******/ Object.defineProperty(
|
|
67
|
+
/******/ t.d = (e, r) => {
|
|
68
|
+
/******/ for (var n in r) {
|
|
69
|
+
/******/ if (t.o(r, n) && !t.o(e, n)) {
|
|
70
|
+
/******/ Object.defineProperty(e, n, {
|
|
30
71
|
enumerable: true,
|
|
31
|
-
get:
|
|
72
|
+
get: r[n]
|
|
32
73
|
});
|
|
33
74
|
/******/ }
|
|
34
75
|
/******/ }
|
|
@@ -37,14 +78,14 @@
|
|
|
37
78
|
/******/
|
|
38
79
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
80
|
/******/ (() => {
|
|
40
|
-
/******/
|
|
81
|
+
/******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
|
|
41
82
|
/******/;
|
|
42
83
|
})();
|
|
43
84
|
/******/
|
|
44
85
|
/******/ /* webpack/runtime/make namespace object */
|
|
45
86
|
/******/ (() => {
|
|
46
87
|
/******/ // define __esModule on exports
|
|
47
|
-
/******/
|
|
88
|
+
/******/ t.r = e => {
|
|
48
89
|
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
90
|
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
91
|
value: "Module"
|
|
@@ -56,89 +97,92 @@
|
|
|
56
97
|
/******/ };
|
|
57
98
|
/******/ })();
|
|
58
99
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
for (var
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
/************************************************************************/ var n = {};
|
|
101
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
102
|
+
(() => {
|
|
103
|
+
// ESM COMPAT FLAG
|
|
104
|
+
t.r(n);
|
|
105
|
+
// EXPORTS
|
|
106
|
+
t.d(n, {
|
|
107
|
+
default: () => /* reexport */ y
|
|
108
|
+
});
|
|
109
|
+
// EXTERNAL MODULE: external "react"
|
|
110
|
+
var e = t(9497);
|
|
111
|
+
var r = t.n(e);
|
|
112
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
113
|
+
var o = t(23);
|
|
114
|
+
var a = t.n(o);
|
|
115
|
+
// EXTERNAL MODULE: external "styled-components"
|
|
116
|
+
var i = t(232);
|
|
117
|
+
var u = t.n(i);
|
|
118
|
+
// EXTERNAL MODULE: external "@splunk/themes"
|
|
119
|
+
var l = t(3563);
|
|
120
|
+
// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts
|
|
121
|
+
var p = u().span.withConfig({
|
|
122
|
+
displayName: "ScreenReaderContentStyles__Styled",
|
|
123
|
+
componentId: "sc-1lnohwp-0"
|
|
124
|
+
})([ "", ";" ], l.mixins.screenReaderContent());
|
|
125
|
+
// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContent.tsx
|
|
126
|
+
function c() {
|
|
127
|
+
c = Object.assign || function(e) {
|
|
128
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
129
|
+
var t = arguments[r];
|
|
130
|
+
for (var n in t) {
|
|
131
|
+
if (Object.prototype.hasOwnProperty.call(t, n)) {
|
|
132
|
+
e[n] = t[n];
|
|
133
|
+
}
|
|
90
134
|
}
|
|
91
135
|
}
|
|
136
|
+
return e;
|
|
137
|
+
};
|
|
138
|
+
return c.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
function f(e, r) {
|
|
141
|
+
if (e == null) return {};
|
|
142
|
+
var t = s(e, r);
|
|
143
|
+
var n, o;
|
|
144
|
+
if (Object.getOwnPropertySymbols) {
|
|
145
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
146
|
+
for (o = 0; o < a.length; o++) {
|
|
147
|
+
n = a[o];
|
|
148
|
+
if (r.indexOf(n) >= 0) continue;
|
|
149
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
150
|
+
t[n] = e[n];
|
|
151
|
+
}
|
|
92
152
|
}
|
|
93
|
-
return
|
|
94
|
-
};
|
|
95
|
-
return f.apply(this, arguments);
|
|
96
|
-
}
|
|
97
|
-
function s(e, r) {
|
|
98
|
-
if (e == null) return {};
|
|
99
|
-
var t = p(e, r);
|
|
100
|
-
var n, o;
|
|
101
|
-
if (Object.getOwnPropertySymbols) {
|
|
102
|
-
var a = Object.getOwnPropertySymbols(e);
|
|
103
|
-
for (o = 0; o < a.length; o++) {
|
|
104
|
-
n = a[o];
|
|
105
|
-
if (r.indexOf(n) >= 0) continue;
|
|
106
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
107
|
-
t[n] = e[n];
|
|
108
|
-
}
|
|
153
|
+
return t;
|
|
109
154
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
t
|
|
155
|
+
function s(e, r) {
|
|
156
|
+
if (e == null) return {};
|
|
157
|
+
var t = {};
|
|
158
|
+
var n = Object.keys(e);
|
|
159
|
+
var o, a;
|
|
160
|
+
for (a = 0; a < n.length; a++) {
|
|
161
|
+
o = n[a];
|
|
162
|
+
if (r.indexOf(o) >= 0) continue;
|
|
163
|
+
t[o] = e[o];
|
|
164
|
+
}
|
|
165
|
+
return t;
|
|
121
166
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
167
|
+
var d = {
|
|
168
|
+
children: a().node.isRequired,
|
|
169
|
+
elementRef: a().oneOfType([ a().func, a().object ])
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
129
172
|
* The screen reader text is used to wrap content that
|
|
130
173
|
* is only accessible through screen readers.
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// CONCATENATED MODULE: ./src/ScreenReaderContent/index.ts
|
|
143
|
-
|
|
174
|
+
*/ function v(e) {
|
|
175
|
+
var t = e.children, n = e.elementRef, o = f(e, [ "children", "elementRef" ]);
|
|
176
|
+
// @docs-props-type ScreenReaderContentPropsBase
|
|
177
|
+
|
|
178
|
+
return r().createElement(p, c({
|
|
179
|
+
"data-test": "screen-reader-content",
|
|
180
|
+
ref: n
|
|
181
|
+
}, o), t);
|
|
182
|
+
}
|
|
183
|
+
v.propTypes = d;
|
|
184
|
+
/* harmony default export */ const y = v;
|
|
185
|
+
}) // CONCATENATED MODULE: ./src/ScreenReaderContent/index.ts
|
|
186
|
+
();
|
|
187
|
+
module.exports = n;
|
|
144
188
|
/******/})();
|