@splunk/react-ui 5.4.0 → 5.6.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/AnchorMenu.d.ts +2 -0
- package/AnchorMenu.js +286 -0
- package/Badge.d.ts +2 -0
- package/Badge.js +154 -0
- package/CHANGELOG.md +42 -0
- package/Code.js +1097 -500
- package/Color.js +142 -141
- package/ComboBox.js +6 -5
- package/Link.js +74 -44
- package/MIGRATION.md +32 -1
- package/Menu.js +41 -43
- package/Multiselect.js +615 -2156
- package/Number.js +3 -3
- package/PhoneNumber.d.ts +2 -0
- package/PhoneNumber.js +769 -0
- package/Popover.js +73 -75
- package/RadioList.js +166 -151
- package/ResultsMenu.js +27 -29
- package/Select.js +179 -1768
- package/SelectBase.d.ts +2 -0
- package/SelectBase.js +1714 -0
- package/Slider.js +358 -302
- package/SlidingPanels.js +55 -62
- package/Switch.js +42 -27
- package/TabBar.js +295 -294
- package/TabLayout.js +14 -14
- package/Table.js +1087 -1040
- package/TransitionOpen.js +65 -58
- package/cypress/support/commands.ts +40 -0
- package/cypress/support/component.ts +1 -1
- package/cypress/support/index.d.ts +22 -0
- package/docker-compose.yml +99 -52
- package/package.json +9 -5
- package/stubs-splunkui.d.ts +0 -86
- package/test-runner-jest.config.js +1 -0
- package/types/src/AnchorMenu/AnchorMenu.d.ts +36 -0
- package/types/src/AnchorMenu/AnchorMenuContext.d.ts +6 -0
- package/types/src/AnchorMenu/Item.d.ts +35 -0
- package/types/src/AnchorMenu/docs/examples/Basic.d.ts +6 -0
- package/types/src/AnchorMenu/index.d.ts +3 -0
- package/types/src/Badge/Badge.d.ts +29 -0
- package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
- package/types/src/Badge/docs/examples/Count.d.ts +6 -0
- package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
- package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
- package/types/src/Badge/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -3
- package/types/src/Code/index.d.ts +1 -0
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/LinkContext.d.ts +14 -0
- package/types/src/Link/docs/examples/Visited.d.ts +7 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +8 -1
- package/types/src/Multiselect/Multiselect.d.ts +8 -1
- package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
- package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/PhoneNumber/index.d.ts +2 -0
- package/types/src/PhoneNumber/utils.d.ts +47 -0
- package/types/src/RadioList/Option.d.ts +6 -1
- package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
- package/types/src/Select/Option.d.ts +8 -3
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
- package/types/src/{Select → SelectBase}/SelectBase.d.ts +11 -2
- package/types/src/SelectBase/index.d.ts +2 -0
- package/types/src/Slider/Slider.d.ts +7 -1
- package/types/src/Switch/Switch.d.ts +4 -1
- package/types/src/Table/Body.d.ts +6 -1
- package/types/src/Table/Cell.d.ts +5 -1
- package/types/src/Table/Head.d.ts +6 -2
- package/types/src/Table/HeadCell.d.ts +5 -1
- package/types/src/Table/Row.d.ts +5 -1
- package/types/src/Table/Table.d.ts +20 -1
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
- package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
- package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
- package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
- package/usePrevious.d.ts +2 -0
- package/useResizeObserver.js +59 -92
- package/useRovingFocus.js +96 -41
- /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/ComboBox.js
CHANGED
|
@@ -528,13 +528,14 @@
|
|
|
528
528
|
// Highlight Active
|
|
529
529
|
Ie.current = 0;
|
|
530
530
|
Ae.current = undefined;
|
|
531
|
-
var l =
|
|
531
|
+
var l = Re ? e : Ke();
|
|
532
|
+
var u = l ? (0, C.stringToKeywords)(l) : [];
|
|
532
533
|
return (i ? n : n.filter((function(e) {
|
|
533
534
|
if (e.props.label !== undefined) {
|
|
534
|
-
return (0, C.testPhrase)(e.props.label,
|
|
535
|
+
return (0, C.testPhrase)(e.props.label, u);
|
|
535
536
|
}
|
|
536
537
|
if (e.props.value !== undefined) {
|
|
537
|
-
return (0, C.testPhrase)(e.props.value,
|
|
538
|
+
return (0, C.testPhrase)(e.props.value, u);
|
|
538
539
|
}
|
|
539
540
|
return true;
|
|
540
541
|
// Keep all headers and non-interactive options
|
|
@@ -545,9 +546,9 @@
|
|
|
545
546
|
}
|
|
546
547
|
var a = Ie.current === fe;
|
|
547
548
|
Ie.current += 1;
|
|
548
|
-
var
|
|
549
|
+
var l = n.props.label !== undefined ? n.props.label : n.props.value;
|
|
549
550
|
var c = n.props.matchRanges;
|
|
550
|
-
var s = !i && e && (o || t > 0) ? (0, C.keywordLocations)(
|
|
551
|
+
var s = !i && e && (o || t > 0) ? (0, C.keywordLocations)(l, u) || undefined : undefined;
|
|
551
552
|
if (a) {
|
|
552
553
|
if (!n.props.disabled) {
|
|
553
554
|
Ae.current = n.props.value;
|
package/Link.js
CHANGED
|
@@ -61,48 +61,73 @@
|
|
|
61
61
|
e.r(n);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(n, {
|
|
64
|
-
|
|
64
|
+
LinkContext: () => /* reexport */ y,
|
|
65
|
+
LinkProvider: () => /* reexport */ m,
|
|
66
|
+
default: () => /* reexport */ j
|
|
65
67
|
});
|
|
66
68
|
// CONCATENATED MODULE: external "react"
|
|
67
69
|
const t = require("react");
|
|
68
70
|
var r = e.n(t);
|
|
69
71
|
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
-
const
|
|
71
|
-
var a = e.n(
|
|
72
|
+
const i = require("prop-types");
|
|
73
|
+
var a = e.n(i);
|
|
72
74
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
73
|
-
const
|
|
74
|
-
var l = e.n(
|
|
75
|
+
const o = require("@splunk/react-ui/ScreenReaderContent");
|
|
76
|
+
var l = e.n(o);
|
|
75
77
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
76
78
|
const s = require("@splunk/ui-utils/i18n");
|
|
77
79
|
// CONCATENATED MODULE: external "styled-components"
|
|
78
|
-
const
|
|
79
|
-
var
|
|
80
|
+
const d = require("styled-components");
|
|
81
|
+
var c = e.n(d);
|
|
80
82
|
// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
|
|
81
83
|
const u = require("@splunk/react-icons/ArrowSquareTopRightInset");
|
|
82
|
-
var
|
|
84
|
+
var f = e.n(u);
|
|
83
85
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
84
|
-
const
|
|
86
|
+
const v = require("@splunk/themes");
|
|
85
87
|
// CONCATENATED MODULE: ./src/Link/icons/External.tsx
|
|
86
|
-
var b =
|
|
88
|
+
var b = c()(f()).withConfig({
|
|
87
89
|
displayName: "External",
|
|
88
90
|
componentId: "sc-13bdx45-0"
|
|
89
|
-
})([ "vertical-align:text-bottom;margin-left:", ";" ],
|
|
90
|
-
/* harmony default export */ const
|
|
91
|
+
})([ "vertical-align:text-bottom;margin-left:", ";" ], v.variables.spacingXSmall);
|
|
92
|
+
/* harmony default export */ const p = b;
|
|
93
|
+
// CONCATENATED MODULE: ./src/Link/LinkContext.tsx
|
|
94
|
+
var g = {
|
|
95
|
+
enableVisitedStyling: false
|
|
96
|
+
};
|
|
97
|
+
var y = (0, t.createContext)(g);
|
|
98
|
+
/**
|
|
99
|
+
* Control behavior for all children Link components.
|
|
100
|
+
*/ var m = function e(n) {
|
|
101
|
+
var i = n.enableVisitedStyling, a = i === void 0 ? false : i, o = n.children;
|
|
102
|
+
// @docs-props-type LinkProviderProps
|
|
103
|
+
var l = (0, t.useMemo)((function() {
|
|
104
|
+
return {
|
|
105
|
+
enableVisitedStyling: a
|
|
106
|
+
};
|
|
107
|
+
}), [ a ]);
|
|
108
|
+
|
|
109
|
+
return r().createElement(y.Provider, {
|
|
110
|
+
value: l
|
|
111
|
+
}, o);
|
|
112
|
+
};
|
|
91
113
|
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
92
|
-
const
|
|
93
|
-
var
|
|
114
|
+
const h = require("@splunk/react-ui/Clickable");
|
|
115
|
+
var S = e.n(h);
|
|
94
116
|
// CONCATENATED MODULE: ./src/Link/LinkStyles.ts
|
|
95
|
-
var
|
|
117
|
+
var w = c()(S()).withConfig({
|
|
96
118
|
displayName: "LinkStyles__StyledClickable",
|
|
97
119
|
componentId: "sc-1hhltcf-0"
|
|
98
|
-
})([ "", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;color:", ";", " &:not([disabled],[aria-disabled='true']){cursor:pointer;&:hover,&:active,&:focus{color:", ";text-decoration:underline;text-decoration-thickness:2px;}&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}" ],
|
|
99
|
-
|
|
100
|
-
inline: (0,
|
|
101
|
-
standalone: (0,
|
|
102
|
-
}),
|
|
120
|
+
})([ "", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;color:", ";", " &:not([disabled],[aria-disabled='true']){cursor:pointer;&:hover,&:active,&:focus{color:", ";text-decoration:underline;text-decoration-thickness:2px;}&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}", "" ], v.mixins.reset("inline"), v.variables.contentColorLink, (0,
|
|
121
|
+
v.pickVariant)("$appearance", {
|
|
122
|
+
inline: (0, d.css)([ "text-decoration:underline;" ]),
|
|
123
|
+
standalone: (0, d.css)([ "font-weight:", ";" ], v.variables.fontWeightSemiBold)
|
|
124
|
+
}), v.variables.contentColorLink, v.variables.focusShadow, v.variables.contentColorLinkDisabled, (function(e) {
|
|
125
|
+
var n = e.$enableVisitedStyling;
|
|
126
|
+
return n && (0, d.css)([ "&:visited{color:", ";}&:where([disabled],[aria-disabled='true']):visited{color:", ";}" ], v.variables.contentColorLinkVisited, v.variables.contentColorLinkVisitedDisabled);
|
|
127
|
+
}));
|
|
103
128
|
// CONCATENATED MODULE: ./src/Link/Link.tsx
|
|
104
|
-
function
|
|
105
|
-
return
|
|
129
|
+
function x() {
|
|
130
|
+
return x = Object.assign ? Object.assign.bind() : function(e) {
|
|
106
131
|
for (var n = 1; n < arguments.length; n++) {
|
|
107
132
|
var t = arguments[n];
|
|
108
133
|
for (var r in t) {
|
|
@@ -110,20 +135,20 @@
|
|
|
110
135
|
}
|
|
111
136
|
}
|
|
112
137
|
return e;
|
|
113
|
-
},
|
|
138
|
+
}, x.apply(null, arguments);
|
|
114
139
|
}
|
|
115
|
-
function
|
|
140
|
+
function O(e, n) {
|
|
116
141
|
if (null == e) return {};
|
|
117
|
-
var t, r,
|
|
142
|
+
var t, r, i = k(e, n);
|
|
118
143
|
if (Object.getOwnPropertySymbols) {
|
|
119
144
|
var a = Object.getOwnPropertySymbols(e);
|
|
120
145
|
for (r = 0; r < a.length; r++) {
|
|
121
|
-
t = a[r], -1 === n.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (
|
|
146
|
+
t = a[r], -1 === n.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (i[t] = e[t]);
|
|
122
147
|
}
|
|
123
148
|
}
|
|
124
|
-
return
|
|
149
|
+
return i;
|
|
125
150
|
}
|
|
126
|
-
function
|
|
151
|
+
function k(e, n) {
|
|
127
152
|
if (null == e) return {};
|
|
128
153
|
var t = {};
|
|
129
154
|
for (var r in e) {
|
|
@@ -134,42 +159,47 @@
|
|
|
134
159
|
}
|
|
135
160
|
return t;
|
|
136
161
|
}
|
|
137
|
-
var
|
|
162
|
+
var C = {
|
|
138
163
|
appearance: a().oneOf([ "inline", "standalone" ]),
|
|
139
164
|
children: a().node,
|
|
140
165
|
disabled: a().bool,
|
|
141
166
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
167
|
+
enableVisitedStyling: a().bool,
|
|
142
168
|
openInNewContext: a().oneOfType([ a().bool, a().string ]),
|
|
143
169
|
to: a().string
|
|
144
170
|
};
|
|
145
|
-
var
|
|
171
|
+
var V = (0, s._)("(Opens new window)");
|
|
146
172
|
/**
|
|
147
173
|
* `Link` is a simple method for configuring `Button` for inline links. For more complex behaviors,
|
|
148
174
|
* see the `Button` documentation.
|
|
149
|
-
*/ var
|
|
175
|
+
*/ var P = r().forwardRef((function(e,
|
|
150
176
|
// SUI-7623 - needs to be specified for react-docgen versions less than 7.1.0
|
|
151
177
|
n) {
|
|
152
|
-
var
|
|
178
|
+
var i = e.appearance, a = i === void 0 ? "inline" : i, o = e.children, s = e.disabled, d = s === void 0 ? false : s, c = e.elementRef, u = e.enableVisitedStyling, f = e.openInNewContext, v = f === void 0 ? false : f, b = e.tag, g = b === void 0 ? "a" : b, m = e.to, h = O(e, [ "appearance", "children", "disabled", "elementRef", "enableVisitedStyling", "openInNewContext", "tag", "to" ]);
|
|
153
179
|
// @docs-props-type LinkPropsBase
|
|
154
|
-
var
|
|
180
|
+
var S = typeof v === "string" ? v : V;
|
|
155
181
|
// Ensure `Link` always renders as an `a` (unless overriden by `tag`) by passing a value to Clickable,
|
|
156
182
|
// using '' if disabled or the to is not passed.
|
|
157
|
-
var
|
|
183
|
+
var k = g !== "button" ? d && "" || m && m || "" : undefined;
|
|
184
|
+
// Allow the prop to override context
|
|
185
|
+
var C = (0, t.useContext)(y), P = C.enableVisitedStyling;
|
|
186
|
+
var j = u !== null && u !== void 0 ? u : P;
|
|
158
187
|
|
|
159
|
-
return r().createElement(
|
|
188
|
+
return r().createElement(w, x({
|
|
160
189
|
"data-test": "link",
|
|
161
|
-
disabled:
|
|
190
|
+
disabled: d ? "disabled" : undefined,
|
|
162
191
|
elementRef: c,
|
|
163
|
-
openInNewContext: !!
|
|
164
|
-
$appearance:
|
|
192
|
+
openInNewContext: !!v,
|
|
193
|
+
$appearance: a,
|
|
194
|
+
$enableVisitedStyling: j,
|
|
165
195
|
ref: n,
|
|
166
|
-
to:
|
|
167
|
-
},
|
|
168
|
-
tag:
|
|
169
|
-
}),
|
|
196
|
+
to: k
|
|
197
|
+
}, h, {
|
|
198
|
+
tag: g
|
|
199
|
+
}), o, v && r().createElement(r().Fragment, null, r().createElement(p, null), r().createElement(l(), null, S)));
|
|
170
200
|
}));
|
|
171
|
-
|
|
172
|
-
/* harmony default export */ const
|
|
201
|
+
P.propTypes = C;
|
|
202
|
+
/* harmony default export */ const j = P;
|
|
173
203
|
// forwardRef appears to prevent TS from inferring LinkProps in components that import Link
|
|
174
204
|
// so we need to export it separately to prevent the TS build from failing with:
|
|
175
205
|
// "... has or is using name 'LinkPropsBase' from external module "...packages/react-ui/src/Link/Link" but cannot be named."
|
package/MIGRATION.md
CHANGED
|
@@ -2,12 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
This document lists migration guidance for new features and breaking changes.
|
|
4
4
|
|
|
5
|
+
## 5.5.0
|
|
6
|
+
|
|
7
|
+
### Deprecated `Switch`'s `selectedLabel`, `someSelectedLabel`, and `unselectedLabel` props
|
|
8
|
+
|
|
9
|
+
#### Change
|
|
10
|
+
`Switch`'s `selectedLabel`, `someSelectedLabel`, and `unselectedLabel` props have been deprecated and will be removed in the next major version.
|
|
11
|
+
|
|
12
|
+
#### Context
|
|
13
|
+
`Switch`'s `selectedLabel`, `someSelectedLabel`, and `unselectedLabel` props have low usage and the same behavior can be achieved in other ways.
|
|
14
|
+
|
|
15
|
+
#### Migration steps
|
|
16
|
+
* Remove all usage of `Switch`'s `selectedLabel`, `someSelectedLabel`, and `unselectedLabel` props.
|
|
17
|
+
* Change the content depending on the `selected` prop's value and do any of the following:
|
|
18
|
+
* Set the `aria-label` prop to your content and pass the prop into `Switch`
|
|
19
|
+
* Use the `ScreenReaderContent` component
|
|
20
|
+
* Place content on screen
|
|
21
|
+
|
|
22
|
+
### Add new prop `horizontalOverflow` to `Table`
|
|
23
|
+
|
|
24
|
+
#### Change
|
|
25
|
+
* `Table` supports a new prop called `horizontalOverflow`.
|
|
26
|
+
|
|
27
|
+
#### Context
|
|
28
|
+
The `Table` component's default overflow behavior has changed between version v4 and v5:
|
|
29
|
+
|
|
30
|
+
- **v4**: When the `Table`'s container is smaller than the `Table` it will scroll horizontally. `HeadCell` content remains fully visible and `Cell` content wraps only at word breaks.
|
|
31
|
+
- **v5**: The `Table` has a responsive behavior. `HeadCell` content truncates when needed, `Cell` content wraps to fit available space, and horizontal scrolling occurs only when `Table`'s container is smaller than `Table`'s width.
|
|
32
|
+
|
|
33
|
+
#### Migration Steps
|
|
34
|
+
* To restore v4 behavior, use `horizontalOverflow="scroll"` prop. This enables horizontal scrolling when `Table` has overflow, keeps `HeadCell` content fully visible, and limits `Cell` content wrapping to word breaks only.
|
|
35
|
+
|
|
5
36
|
## 5.3.0
|
|
6
37
|
|
|
7
38
|
### `Switch`'s `appearance="checkbox"` prop has been deprecated in favor of new `Checkbox` component.
|
|
8
39
|
|
|
9
40
|
#### Change
|
|
10
|
-
|
|
41
|
+
`Switch`'s `appearance="checkbox"` prop has been deprecated and will be removed in the next major version.
|
|
11
42
|
|
|
12
43
|
#### Context
|
|
13
44
|
The `Switch` component combines two different components - a checkbox and a toggle. While superficially similar in that they both provide a boolean control, they are semantically different controls.
|
package/Menu.js
CHANGED
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
Divider: () => /* reexport */
|
|
64
|
+
Divider: () => /* reexport */ H,
|
|
65
65
|
Heading: () => /* reexport */ Z,
|
|
66
66
|
Item: () => /* reexport */ Se,
|
|
67
|
-
MenuContext: () => /* reexport */
|
|
67
|
+
MenuContext: () => /* reexport */ T,
|
|
68
68
|
default: () => /* reexport */ qe
|
|
69
69
|
});
|
|
70
70
|
// CONCATENATED MODULE: external "react"
|
|
@@ -180,10 +180,10 @@
|
|
|
180
180
|
role: "menu",
|
|
181
181
|
preventFocus: false
|
|
182
182
|
});
|
|
183
|
-
/* harmony default export */ const
|
|
183
|
+
/* harmony default export */ const T = D;
|
|
184
184
|
// CONCATENATED MODULE: ./src/Menu/Divider.tsx
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function N() {
|
|
186
|
+
return N = Object.assign ? Object.assign.bind() : function(e) {
|
|
187
187
|
for (var t = 1; t < arguments.length; t++) {
|
|
188
188
|
var r = arguments[t];
|
|
189
189
|
for (var n in r) {
|
|
@@ -191,16 +191,16 @@
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
return e;
|
|
194
|
-
},
|
|
194
|
+
}, N.apply(null, arguments);
|
|
195
195
|
}
|
|
196
196
|
var q = {};
|
|
197
197
|
/**
|
|
198
198
|
* A non-interactive menu item used to visually separate groups of items in the menu.
|
|
199
199
|
*/ function $(e) {
|
|
200
|
-
var t =
|
|
201
|
-
var a = (0, r.useContext)(
|
|
200
|
+
var t = N({}, e);
|
|
201
|
+
var a = (0, r.useContext)(T), i = a.role;
|
|
202
202
|
|
|
203
|
-
return n().createElement(A,
|
|
203
|
+
return n().createElement(A, N({
|
|
204
204
|
"aria-hidden": i === "listbox",
|
|
205
205
|
"data-test": "divider",
|
|
206
206
|
role: "separator"
|
|
@@ -211,16 +211,16 @@
|
|
|
211
211
|
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ $.filterConsecutive = true;
|
|
212
212
|
/* Remove the item if it is the last item after filtering. */ $.filterLast = true;
|
|
213
213
|
/* Tag the item as Divider */ $.as = "Divider";
|
|
214
|
-
/* harmony default export */ const
|
|
214
|
+
/* harmony default export */ const H = $;
|
|
215
215
|
// CONCATENATED MODULE: external "@splunk/react-ui/Heading"
|
|
216
|
-
const
|
|
217
|
-
var
|
|
216
|
+
const R = require("@splunk/react-ui/Heading");
|
|
217
|
+
var M = e.n(R);
|
|
218
218
|
// CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
|
|
219
|
-
var
|
|
219
|
+
var F = u().div.withConfig({
|
|
220
220
|
displayName: "HeadingStyles__Styled",
|
|
221
221
|
componentId: "mcd2ws-0"
|
|
222
222
|
})([ "", " border-top:1px solid transparent;padding:", " ", ";&:not(:first-child){border-top:1px solid ", ";margin-top:", ";}" ], p.mixins.reset("block"), p.variables.spacingSmall, p.variables.spacingLarge, p.variables.borderColor, p.variables.spacingSmall);
|
|
223
|
-
var L = u()(
|
|
223
|
+
var L = u()(M()).withConfig({
|
|
224
224
|
displayName: "HeadingStyles__StyledHeading",
|
|
225
225
|
componentId: "mcd2ws-1"
|
|
226
226
|
})([ "color:", ";" ], p.variables.contentColorDefault);
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
*/ function Y(e) {
|
|
320
320
|
var t = e.children, a = e.outerStyle, i = e.title, o = J(e, [ "children", "outerStyle", "title" ]);
|
|
321
321
|
// @docs-props-type HeadingPropsBase
|
|
322
|
-
var l = (0, r.useContext)(
|
|
322
|
+
var l = (0, r.useContext)(T), s = l.role;
|
|
323
323
|
var c = (0, r.useMemo)((function() {
|
|
324
324
|
return z(z({}, a), {}, {
|
|
325
325
|
margin: 0
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
// of items in the list if it contains a heading or divider
|
|
331
331
|
// so we set them to aria-hidden to prevent that
|
|
332
332
|
|
|
333
|
-
return n().createElement(
|
|
333
|
+
return n().createElement(F, {
|
|
334
334
|
"aria-hidden": s === "listbox" ? true : undefined
|
|
335
335
|
}, n().createElement(L, B({
|
|
336
336
|
style: c,
|
|
@@ -437,16 +437,16 @@
|
|
|
437
437
|
var ye = (0, se._)("(Opens new window)");
|
|
438
438
|
function he(e) {
|
|
439
439
|
var t;
|
|
440
|
-
var a = e.active, o = e.children, l = e.description, s = e.descriptionPosition, c = s === void 0 ? "bottom" : s, u = e.disabled, d = e.endAdornment, v = e.elementRef, p = e.hasSubmenu, f = e.itemKey, m = e.matchRanges, b = e.onClick, g = e.onFocus, y = e.openInNewContext, w = e.role, A = e.selectable, D = e.selectableAppearance,
|
|
440
|
+
var a = e.active, o = e.children, l = e.description, s = e.descriptionPosition, c = s === void 0 ? "bottom" : s, u = e.disabled, d = e.endAdornment, v = e.elementRef, p = e.hasSubmenu, f = e.itemKey, m = e.matchRanges, b = e.onClick, g = e.onFocus, y = e.openInNewContext, w = e.role, A = e.selectable, D = e.selectableAppearance, N = D === void 0 ? "checkmark" : D, q = e.selected, $ = e.startAdornment, H = e.to, R = e.truncate, M = me(e, [ "active", "children", "description", "descriptionPosition", "disabled", "endAdornment", "elementRef", "hasSubmenu", "itemKey", "matchRanges", "onClick", "onFocus", "openInNewContext", "role", "selectable", "selectableAppearance", "selected", "startAdornment", "to", "truncate" ]);
|
|
441
441
|
// @docs-props-type ItemPropsBase
|
|
442
|
-
var
|
|
442
|
+
var F = (0, r.useContext)(T), L = F.preventFocus;
|
|
443
443
|
// Use arguments[0] (raw props) to check if `selectableAppearance` was explicitly passed by the caller.
|
|
444
444
|
// This prevents the default value from incorrectly triggering the dev warning.
|
|
445
445
|
// eslint-disable-next-line prefer-rest-params
|
|
446
446
|
var K = (t = arguments[0]) === null || t === void 0 ? void 0 : t.selectableAppearance;
|
|
447
447
|
(0, r.useEffect)((function() {
|
|
448
448
|
if (false) {}
|
|
449
|
-
}), [
|
|
449
|
+
}), [ R, c, m, o, q, A, N, K ]);
|
|
450
450
|
var B = (0, r.useCallback)((function(e) {
|
|
451
451
|
g === null || g === void 0 ? void 0 : g(e, {
|
|
452
452
|
itemKey: f
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
nonselectable: "menuitem",
|
|
487
487
|
checkmark: "menuitemradio",
|
|
488
488
|
checkbox: "menuitemcheckbox"
|
|
489
|
-
}[X ?
|
|
489
|
+
}[X ? N : "nonselectable"];
|
|
490
490
|
var J = {
|
|
491
491
|
"aria-haspopup": p ? true : undefined
|
|
492
492
|
};
|
|
@@ -497,7 +497,7 @@
|
|
|
497
497
|
}
|
|
498
498
|
var Q = l && c === "right";
|
|
499
499
|
var U = l && !Q;
|
|
500
|
-
var Y = q &&
|
|
500
|
+
var Y = q && N === "checkmark" && n().createElement(O, null, n().createElement(ne(), {
|
|
501
501
|
"data-test": "selected-checkmark",
|
|
502
502
|
inline: true
|
|
503
503
|
}));
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
$active: a,
|
|
513
513
|
$isSelectable: X,
|
|
514
514
|
$preventFocus: L || false,
|
|
515
|
-
$selectableAppearance:
|
|
515
|
+
$selectableAppearance: N !== null && N !== void 0 ? N : false,
|
|
516
516
|
$selected: V,
|
|
517
517
|
"data-has-icon": !!$ || !!d,
|
|
518
518
|
"data-test": "item",
|
|
@@ -525,17 +525,17 @@
|
|
|
525
525
|
openInNewContext: Z,
|
|
526
526
|
role: G,
|
|
527
527
|
tabIndex: L ? -1 : undefined,
|
|
528
|
-
to:
|
|
529
|
-
title:
|
|
530
|
-
}, J, i()(
|
|
528
|
+
to: H,
|
|
529
|
+
title: R && te()(o) ? o : undefined
|
|
530
|
+
}, J, i()(M, "onFocus")), p && n().createElement(j, null, n().createElement(ie(), null)), n().createElement(I, null, A && N === "checkbox" && n().createElement(x, {
|
|
531
531
|
checked: q === "some" ? "indeterminate" : q,
|
|
532
532
|
disabled: !!u,
|
|
533
533
|
inert: true
|
|
534
534
|
}), $ && n().createElement(k, null, $), n().createElement(E, {
|
|
535
535
|
$descriptionBottom: !!U,
|
|
536
|
-
$truncate:
|
|
536
|
+
$truncate: R !== null && R !== void 0 ? R : false
|
|
537
537
|
}, n().createElement(_, {
|
|
538
|
-
$truncate:
|
|
538
|
+
$truncate: R !== null && R !== void 0 ? R : false,
|
|
539
539
|
"data-test": "label"
|
|
540
540
|
}, z, y && n().createElement(n().Fragment, null, n().createElement(pe, null), n().createElement(le(), null, ee))), U && n().createElement(h, {
|
|
541
541
|
"data-test": "description"
|
|
@@ -631,18 +631,18 @@
|
|
|
631
631
|
enableHomeEnd: true
|
|
632
632
|
};
|
|
633
633
|
};
|
|
634
|
-
var
|
|
634
|
+
var Te = function e(t) {
|
|
635
635
|
var r = t.key;
|
|
636
636
|
// Handle special case for tab navigation
|
|
637
|
-
if (r === "Tab" && (0, s.isTabKey)(t)) {
|
|
637
|
+
if (r === "Tab" && (0, s.isTabKey)(t.nativeEvent)) {
|
|
638
638
|
return t.shiftKey ? "tabShift" : "Tab";
|
|
639
639
|
}
|
|
640
640
|
return r;
|
|
641
641
|
};
|
|
642
|
-
function
|
|
642
|
+
function Ne(e) {
|
|
643
643
|
var t = e.children, a = e.elementRef, o = e.focusMode, l = o === void 0 ? "roving" : o, c = e.stopScrollPropagation, u = Pe(e, [ "children", "elementRef", "focusMode", "stopScrollPropagation" ]);
|
|
644
644
|
// @docs-props-type MenuPropsBase
|
|
645
|
-
var d = (0, r.useContext)(
|
|
645
|
+
var d = (0, r.useContext)(T), v = d.role, p = v === void 0 ? "menu" : v;
|
|
646
646
|
var f = (0, r.useRef)(null);
|
|
647
647
|
var m = r.Children.toArray(t).filter(r.isValidElement).reduce((function(e, t, r, n) {
|
|
648
648
|
/* Filter out initial Dividers
|
|
@@ -677,7 +677,7 @@
|
|
|
677
677
|
if (e.nativeEvent.metaKey) {
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
|
-
var t =
|
|
680
|
+
var t = Te(e);
|
|
681
681
|
var r = t === "Tab" || t === "tabShift";
|
|
682
682
|
var n = t === "Enter";
|
|
683
683
|
// Allow default behavior for the enter key.
|
|
@@ -693,11 +693,9 @@
|
|
|
693
693
|
ignoreTabIndex: true
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
|
-
var o =
|
|
697
|
-
var l =
|
|
698
|
-
|
|
699
|
-
var u = c ? i.indexOf(c) : -1;
|
|
700
|
-
(0, s.handleFocus)(t, i, u, g);
|
|
696
|
+
var o = e.target instanceof HTMLElement ? e.target : a === null || a === void 0 ? void 0 : a.querySelector(":focus");
|
|
697
|
+
var l = o instanceof HTMLElement ? i.indexOf(o) : -1;
|
|
698
|
+
(0, s.handleFocus)(t, i, l, g);
|
|
701
699
|
}), [ g ]);
|
|
702
700
|
var h = function e() {
|
|
703
701
|
return {
|
|
@@ -716,15 +714,15 @@
|
|
|
716
714
|
stopScrollPropagation: true
|
|
717
715
|
}, i()(u, "tagName")), m) : n().createElement(Ce, _e({}, w, {
|
|
718
716
|
ref: b
|
|
719
|
-
}, u), n().createElement(
|
|
717
|
+
}, u), n().createElement(T.Provider, {
|
|
720
718
|
value: h()
|
|
721
719
|
}, m));
|
|
722
720
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
/* harmony default export */ const qe =
|
|
721
|
+
Ne.propTypes = Ae;
|
|
722
|
+
Ne.Item = Se;
|
|
723
|
+
Ne.Divider = H;
|
|
724
|
+
Ne.Heading = Z;
|
|
725
|
+
/* harmony default export */ const qe = Ne;
|
|
728
726
|
// CONCATENATED MODULE: ./src/Menu/index.ts
|
|
729
727
|
module.exports = t;
|
|
730
728
|
/******/})();
|