@splunk/react-ui 4.38.0 → 4.39.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 +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +28 -0
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1589 -1902
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +1077 -1345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +60 -68
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +14 -14
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Clickable.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/ e.n =
|
|
12
|
-
/******/ var
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = n => {
|
|
12
|
+
/******/ var t = n && n.__esModule ?
|
|
13
|
+
/******/ () => n["default"]
|
|
14
|
+
/******/ : () => n
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(t, {
|
|
17
|
+
a: t
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return t;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (
|
|
27
|
-
/******/ for (var r in
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (n, t) => {
|
|
27
|
+
/******/ for (var r in t) {
|
|
28
|
+
/******/ if (e.o(t, r) && !e.o(n, r)) {
|
|
29
|
+
/******/ Object.defineProperty(n, r, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get:
|
|
31
|
+
get: t[r]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/******/
|
|
38
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
39
|
/******/ (() => {
|
|
40
|
-
/******/ e.o = (e,
|
|
40
|
+
/******/ e.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var n = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(n);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
63
|
+
e.d(n, {
|
|
64
64
|
NavigationContext: () => /* reexport */ h,
|
|
65
65
|
NavigationProvider: () => /* reexport */ m,
|
|
66
|
-
default: () => /* reexport */
|
|
67
|
-
isInternalLink: () => /* reexport */
|
|
68
|
-
isRootRelativeLink: () => /* reexport */
|
|
66
|
+
default: () => /* reexport */ J,
|
|
67
|
+
isInternalLink: () => /* reexport */ H,
|
|
68
|
+
isRootRelativeLink: () => /* reexport */ B
|
|
69
69
|
});
|
|
70
70
|
// CONCATENATED MODULE: external "react"
|
|
71
|
-
const
|
|
72
|
-
var r = e.n(
|
|
71
|
+
const t = require("react");
|
|
72
|
+
var r = e.n(t);
|
|
73
73
|
// CONCATENATED MODULE: external "prop-types"
|
|
74
74
|
const o = require("prop-types");
|
|
75
75
|
var i = e.n(o);
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
var u = e.n(a);
|
|
81
81
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
82
82
|
const c = require("lodash/omit");
|
|
83
|
-
var
|
|
83
|
+
var s = e.n(c);
|
|
84
84
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
85
|
-
const
|
|
85
|
+
const f = require("@splunk/react-ui/Dropdown");
|
|
86
86
|
// CONCATENATED MODULE: external "styled-components"
|
|
87
87
|
const p = require("styled-components");
|
|
88
88
|
var d = e.n(p);
|
|
@@ -107,19 +107,20 @@
|
|
|
107
107
|
* Used to provide an override for the `onClick` for links for single page applications so that
|
|
108
108
|
* internal links can navigate without a page reload.
|
|
109
109
|
*/ function m(e) {
|
|
110
|
-
var
|
|
110
|
+
var n = e.children, o = e.onClick, i = e.onLinkClick, l = e.prefix, a = e.transformUrl;
|
|
111
111
|
// @docs-props-type NavigationProviderProps
|
|
112
|
-
var u = (0,
|
|
112
|
+
var u = (0, t.useMemo)((function() {
|
|
113
113
|
var e;
|
|
114
114
|
if (a != null) {
|
|
115
115
|
if (false) {}
|
|
116
116
|
e = a;
|
|
117
117
|
} else if (l != null) {
|
|
118
118
|
if (false) {}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var n = arguments.length >
|
|
122
|
-
|
|
119
|
+
// eslint-disable-next-line default-param-last
|
|
120
|
+
e = function e() {
|
|
121
|
+
var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
122
|
+
var t = arguments.length > 1 ? arguments[1] : undefined, r = t.isInternal, o = t.isRootRelative;
|
|
123
|
+
return l != null && r && o ? "".concat(l).concat(n) : n;
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
126
|
return {
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
|
|
132
133
|
return r().createElement(h.Provider, {
|
|
133
134
|
value: u
|
|
134
|
-
},
|
|
135
|
+
}, n);
|
|
135
136
|
}
|
|
136
137
|
m.propTypes = y;
|
|
137
138
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
@@ -141,14 +142,14 @@
|
|
|
141
142
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
142
143
|
* @param current - The new value of the ref.
|
|
143
144
|
*/
|
|
144
|
-
function k(e,
|
|
145
|
+
function k(e, n) {
|
|
145
146
|
if (e) {
|
|
146
147
|
if (typeof e === "function") {
|
|
147
|
-
e(
|
|
148
|
+
e(n);
|
|
148
149
|
} else {
|
|
149
150
|
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
150
151
|
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
151
|
-
e.current =
|
|
152
|
+
e.current = n;
|
|
152
153
|
// eslint-disable-line no-param-reassign
|
|
153
154
|
}
|
|
154
155
|
}
|
|
@@ -156,162 +157,142 @@
|
|
|
156
157
|
// CONCATENATED MODULE: ./src/Clickable/Clickable.tsx
|
|
157
158
|
function g(e) {
|
|
158
159
|
"@babel/helpers - typeof";
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
g = function e(t) {
|
|
165
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
return g(e);
|
|
160
|
+
return g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
161
|
+
return typeof e;
|
|
162
|
+
} : function(e) {
|
|
163
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
164
|
+
}, g(e);
|
|
169
165
|
}
|
|
170
166
|
function C() {
|
|
171
|
-
C = Object.assign
|
|
172
|
-
for (var
|
|
173
|
-
var
|
|
174
|
-
for (var r in
|
|
175
|
-
|
|
176
|
-
e[r] = n[r];
|
|
177
|
-
}
|
|
167
|
+
return C = Object.assign ? Object.assign.bind() : function(e) {
|
|
168
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
169
|
+
var t = arguments[n];
|
|
170
|
+
for (var r in t) {
|
|
171
|
+
({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
178
172
|
}
|
|
179
173
|
}
|
|
180
174
|
return e;
|
|
181
|
-
};
|
|
182
|
-
return C.apply(this, arguments);
|
|
175
|
+
}, C.apply(null, arguments);
|
|
183
176
|
}
|
|
184
|
-
function O(e,
|
|
185
|
-
if (
|
|
186
|
-
var
|
|
187
|
-
var r, o;
|
|
177
|
+
function O(e, n) {
|
|
178
|
+
if (null == e) return {};
|
|
179
|
+
var t, r, o = w(e, n);
|
|
188
180
|
if (Object.getOwnPropertySymbols) {
|
|
189
181
|
var i = Object.getOwnPropertySymbols(e);
|
|
190
|
-
for (
|
|
191
|
-
|
|
192
|
-
if (t.indexOf(r) >= 0) continue;
|
|
193
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
|
|
194
|
-
n[r] = e[r];
|
|
182
|
+
for (r = 0; r < i.length; r++) {
|
|
183
|
+
t = i[r], n.includes(t) || {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
|
|
195
184
|
}
|
|
196
185
|
}
|
|
197
|
-
return
|
|
186
|
+
return o;
|
|
198
187
|
}
|
|
199
|
-
function w(e,
|
|
200
|
-
if (
|
|
201
|
-
var
|
|
202
|
-
var r
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
n[o] = e[o];
|
|
188
|
+
function w(e, n) {
|
|
189
|
+
if (null == e) return {};
|
|
190
|
+
var t = {};
|
|
191
|
+
for (var r in e) {
|
|
192
|
+
if ({}.hasOwnProperty.call(e, r)) {
|
|
193
|
+
if (n.includes(r)) continue;
|
|
194
|
+
t[r] = e[r];
|
|
195
|
+
}
|
|
208
196
|
}
|
|
209
|
-
return
|
|
197
|
+
return t;
|
|
210
198
|
}
|
|
211
|
-
function
|
|
212
|
-
if (!(e instanceof
|
|
213
|
-
throw new TypeError("Cannot call a class as a function");
|
|
214
|
-
}
|
|
199
|
+
function j(e, n) {
|
|
200
|
+
if (!(e instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
215
201
|
}
|
|
216
|
-
function
|
|
217
|
-
for (var
|
|
218
|
-
var r = t
|
|
219
|
-
r.enumerable = r.enumerable ||
|
|
220
|
-
r.
|
|
221
|
-
if ("value" in r) r.writable = true;
|
|
222
|
-
Object.defineProperty(e, r.key, r);
|
|
202
|
+
function P(e, n) {
|
|
203
|
+
for (var t = 0; t < n.length; t++) {
|
|
204
|
+
var r = n[t];
|
|
205
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
206
|
+
Object.defineProperty(e, M(r.key), r);
|
|
223
207
|
}
|
|
224
208
|
}
|
|
225
|
-
function
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
209
|
+
function S(e, n, t) {
|
|
210
|
+
return n && P(e.prototype, n), t && P(e, t), Object.defineProperty(e, "prototype", {
|
|
211
|
+
writable: !1
|
|
212
|
+
}), e;
|
|
229
213
|
}
|
|
230
|
-
function
|
|
231
|
-
if (typeof
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
214
|
+
function x(e, n) {
|
|
215
|
+
if ("function" != typeof n && null !== n) throw new TypeError("Super expression must either be null or a function");
|
|
216
|
+
e.prototype = Object.create(n && n.prototype, {
|
|
235
217
|
constructor: {
|
|
236
218
|
value: e,
|
|
237
|
-
writable:
|
|
238
|
-
configurable:
|
|
219
|
+
writable: !0,
|
|
220
|
+
configurable: !0
|
|
239
221
|
}
|
|
240
|
-
})
|
|
241
|
-
|
|
222
|
+
}), Object.defineProperty(e, "prototype", {
|
|
223
|
+
writable: !1
|
|
224
|
+
}), n && R(e, n);
|
|
242
225
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
};
|
|
248
|
-
return S(e, t);
|
|
226
|
+
function R(e, n) {
|
|
227
|
+
return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, n) {
|
|
228
|
+
return e.__proto__ = n, e;
|
|
229
|
+
}, R(e, n);
|
|
249
230
|
}
|
|
250
|
-
function
|
|
251
|
-
var
|
|
252
|
-
return function
|
|
253
|
-
var r =
|
|
254
|
-
if (
|
|
255
|
-
var
|
|
256
|
-
|
|
257
|
-
} else
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
return T(this, o);
|
|
231
|
+
function T(e) {
|
|
232
|
+
var n = N();
|
|
233
|
+
return function() {
|
|
234
|
+
var t, r = E(e);
|
|
235
|
+
if (n) {
|
|
236
|
+
var o = E(this).constructor;
|
|
237
|
+
t = Reflect.construct(r, arguments, o);
|
|
238
|
+
} else t = r.apply(this, arguments);
|
|
239
|
+
return _(this, t);
|
|
261
240
|
};
|
|
262
241
|
}
|
|
263
|
-
function
|
|
264
|
-
if (
|
|
265
|
-
|
|
266
|
-
}
|
|
242
|
+
function _(e, n) {
|
|
243
|
+
if (n && ("object" == g(n) || "function" == typeof n)) return n;
|
|
244
|
+
if (void 0 !== n) throw new TypeError("Derived constructors may only return object or undefined");
|
|
267
245
|
return I(e);
|
|
268
246
|
}
|
|
269
247
|
function I(e) {
|
|
270
|
-
if (
|
|
271
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
272
|
-
}
|
|
248
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
273
249
|
return e;
|
|
274
250
|
}
|
|
275
|
-
function
|
|
276
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
277
|
-
if (Reflect.construct.sham) return false;
|
|
278
|
-
if (typeof Proxy === "function") return true;
|
|
251
|
+
function N() {
|
|
279
252
|
try {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
return
|
|
284
|
-
}
|
|
253
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
254
|
+
} catch (e) {}
|
|
255
|
+
return (N = function n() {
|
|
256
|
+
return !!e;
|
|
257
|
+
})();
|
|
285
258
|
}
|
|
286
|
-
function
|
|
287
|
-
|
|
288
|
-
return
|
|
289
|
-
};
|
|
290
|
-
return N(e);
|
|
259
|
+
function E(e) {
|
|
260
|
+
return E = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
261
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
262
|
+
}, E(e);
|
|
291
263
|
}
|
|
292
|
-
function
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
264
|
+
function L(e, n, t) {
|
|
265
|
+
return (n = M(n)) in e ? Object.defineProperty(e, n, {
|
|
266
|
+
value: t,
|
|
267
|
+
enumerable: !0,
|
|
268
|
+
configurable: !0,
|
|
269
|
+
writable: !0
|
|
270
|
+
}) : e[n] = t, e;
|
|
271
|
+
}
|
|
272
|
+
function M(e) {
|
|
273
|
+
var n = q(e, "string");
|
|
274
|
+
return "symbol" == g(n) ? n : n + "";
|
|
275
|
+
}
|
|
276
|
+
function q(e, n) {
|
|
277
|
+
if ("object" != g(e) || !e) return e;
|
|
278
|
+
var t = e[Symbol.toPrimitive];
|
|
279
|
+
if (void 0 !== t) {
|
|
280
|
+
var r = t.call(e, n || "default");
|
|
281
|
+
if ("object" != g(r)) return r;
|
|
282
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
302
283
|
}
|
|
303
|
-
return e;
|
|
284
|
+
return ("string" === n ? String : Number)(e);
|
|
304
285
|
}
|
|
305
|
-
var
|
|
306
|
-
var
|
|
307
|
-
var
|
|
308
|
-
var
|
|
309
|
-
return
|
|
286
|
+
var U = /^[a-z0-9]+:/;
|
|
287
|
+
var D = /^\/\//;
|
|
288
|
+
var z = /^\//;
|
|
289
|
+
var B = function e(n) {
|
|
290
|
+
return n != null && z.test(n);
|
|
310
291
|
};
|
|
311
|
-
var
|
|
312
|
-
return
|
|
292
|
+
var H = function e(n) {
|
|
293
|
+
return n != null && !U.test(n) && !D.test(n);
|
|
313
294
|
};
|
|
314
|
-
var
|
|
295
|
+
var K = {
|
|
315
296
|
/** @private */
|
|
316
297
|
allowDisabledLink: i().bool,
|
|
317
298
|
children: i().node,
|
|
@@ -322,34 +303,34 @@
|
|
|
322
303
|
navigationLabel: i().string,
|
|
323
304
|
to: i().string
|
|
324
305
|
};
|
|
325
|
-
var
|
|
306
|
+
var A = {
|
|
326
307
|
disabled: false,
|
|
327
308
|
openInNewContext: false
|
|
328
309
|
};
|
|
329
|
-
function
|
|
310
|
+
function F(e) {
|
|
330
311
|
return !!e.to && !e.disabled;
|
|
331
312
|
}
|
|
332
313
|
/**
|
|
333
314
|
* `Clickable` renders as a `button` element, or as an `a` element if the `to` prop is set
|
|
334
315
|
* and the `disabled` prop is `false`. This is called link mode.
|
|
335
|
-
*/ var
|
|
336
|
-
|
|
337
|
-
var
|
|
316
|
+
*/ var G = function(e) {
|
|
317
|
+
x(t, e);
|
|
318
|
+
var n = T(t);
|
|
338
319
|
// @docs-props-type ClickablePropsBase
|
|
339
320
|
// should use ClickablePropsBase but fails on refs - observe
|
|
340
|
-
function
|
|
321
|
+
function t(e) {
|
|
341
322
|
var r;
|
|
342
|
-
|
|
343
|
-
r =
|
|
344
|
-
|
|
345
|
-
|
|
323
|
+
j(this, t);
|
|
324
|
+
r = n.call(this, e);
|
|
325
|
+
L(I(r), "el", null);
|
|
326
|
+
L(I(r), "handleMount", (function(e) {
|
|
346
327
|
r.el = e;
|
|
347
328
|
k(r.props.elementRef, e);
|
|
348
329
|
}));
|
|
349
|
-
|
|
350
|
-
var e = r.context,
|
|
330
|
+
L(I(r), "createHandleOnClick", (function() {
|
|
331
|
+
var e = r.context, n = e.onClick, t = e.onLinkClick;
|
|
351
332
|
return function(e) {
|
|
352
|
-
if (
|
|
333
|
+
if (F(r.props)) {
|
|
353
334
|
// when user command-click on mac or ctrl-click on other platforms, and
|
|
354
335
|
// Tag is an <a>, let the click pass through, let the <a> to achieve user's
|
|
355
336
|
// intent of 'open in new context'
|
|
@@ -363,8 +344,8 @@
|
|
|
363
344
|
if (r.props.onClick) {
|
|
364
345
|
r.props.onClick(e);
|
|
365
346
|
}
|
|
366
|
-
var o = r.props.onClick == null &&
|
|
367
|
-
if (
|
|
347
|
+
var o = r.props.onClick == null && n != null;
|
|
348
|
+
if (F(r.props) && (o || t != null)) {
|
|
368
349
|
var i = r.props.navigationLabel;
|
|
369
350
|
if (!i && u()(r.props.children)) {
|
|
370
351
|
i = r.props.children;
|
|
@@ -376,40 +357,41 @@
|
|
|
376
357
|
label: i
|
|
377
358
|
};
|
|
378
359
|
if (o) {
|
|
379
|
-
|
|
360
|
+
n(e, l);
|
|
380
361
|
}
|
|
381
|
-
|
|
362
|
+
t === null || t === void 0 ? void 0 : t(e, l);
|
|
382
363
|
}
|
|
383
364
|
};
|
|
384
365
|
}));
|
|
385
|
-
|
|
386
|
-
var
|
|
387
|
-
return
|
|
388
|
-
isInternal:
|
|
389
|
-
isRootRelative:
|
|
366
|
+
L(I(r), "getTransformedUrl", (function(e) {
|
|
367
|
+
var n = r.context.transformUrl;
|
|
368
|
+
return n != null ? n(e, {
|
|
369
|
+
isInternal: H(e),
|
|
370
|
+
isRootRelative: B(e)
|
|
390
371
|
}) : e;
|
|
391
372
|
}));
|
|
392
373
|
if (false) {}
|
|
393
374
|
return r;
|
|
394
375
|
}
|
|
395
|
-
|
|
376
|
+
S(t, [ {
|
|
396
377
|
key: "focus",
|
|
397
378
|
/**
|
|
398
379
|
* Place focus on the element.
|
|
399
380
|
*/
|
|
381
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
400
382
|
value: function e() {
|
|
401
|
-
var
|
|
402
|
-
(
|
|
383
|
+
var n;
|
|
384
|
+
(n = this.el) === null || n === void 0 ? void 0 : n.focus();
|
|
403
385
|
}
|
|
404
386
|
}, {
|
|
405
387
|
key: "render",
|
|
406
388
|
value: function e() {
|
|
407
|
-
var
|
|
408
|
-
|
|
409
|
-
if (
|
|
410
|
-
var
|
|
389
|
+
var n = this.createHandleOnClick();
|
|
390
|
+
// Only set the href attribute when enabled, and therefore using an <a> tag
|
|
391
|
+
if (F(this.props)) {
|
|
392
|
+
var t = this.props, o = t.children, i = t.openInNewContext, l = t.to, a = O(t, [ "children", "openInNewContext", "to" ]);
|
|
411
393
|
var u = i ? "_blank" : undefined;
|
|
412
|
-
var c = i &&
|
|
394
|
+
var c = i && H(l) ? "noopener noreferrer" : undefined;
|
|
413
395
|
|
|
414
396
|
return r().createElement(v, C({
|
|
415
397
|
"data-test": "clickable",
|
|
@@ -417,11 +399,11 @@
|
|
|
417
399
|
href: this.getTransformedUrl(this.props.to),
|
|
418
400
|
target: u,
|
|
419
401
|
rel: c,
|
|
420
|
-
onClick:
|
|
421
|
-
},
|
|
402
|
+
onClick: n
|
|
403
|
+
}, s()(a, "disabled", "elementRef", "onClick")), o);
|
|
422
404
|
}
|
|
423
405
|
if (this.props.allowDisabledLink) {
|
|
424
|
-
var
|
|
406
|
+
var f = this.props, p = f.children, d = O(f, [ "children" ]);
|
|
425
407
|
if (this.props.disabled && this.props.to != null) {
|
|
426
408
|
|
|
427
409
|
return r().createElement(v, C({
|
|
@@ -429,10 +411,10 @@
|
|
|
429
411
|
ref: this.handleMount,
|
|
430
412
|
role: "link",
|
|
431
413
|
"aria-disabled": "true"
|
|
432
|
-
},
|
|
414
|
+
}, s()(d, "href", "to", "elementRef", "onClick", "disabled")), p);
|
|
433
415
|
}
|
|
434
416
|
}
|
|
435
|
-
|
|
417
|
+
// button variant
|
|
436
418
|
var b = this.props, y = b.children, h = b.onClick, m = b.disabled, k = b.type, g = O(b, [ "children", "onClick", "disabled", "type" ]);
|
|
437
419
|
|
|
438
420
|
return r().createElement(v, C({
|
|
@@ -442,17 +424,17 @@
|
|
|
442
424
|
ref: this.handleMount,
|
|
443
425
|
type: k || "button",
|
|
444
426
|
disabled: m === true,
|
|
445
|
-
onClick: h && !m ?
|
|
446
|
-
},
|
|
427
|
+
onClick: h && !m ? n : undefined
|
|
428
|
+
}, s()(g, "elementRef", "openInNewContext", "to")), y);
|
|
447
429
|
}
|
|
448
430
|
} ]);
|
|
449
|
-
return
|
|
450
|
-
}(
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
/* harmony default export */ const
|
|
431
|
+
return t;
|
|
432
|
+
}(t.Component);
|
|
433
|
+
L(G, "contextType", h);
|
|
434
|
+
L(G, "propTypes", K);
|
|
435
|
+
L(G, "defaultProps", A);
|
|
436
|
+
L(G, f.legacyRefMode, true);
|
|
437
|
+
/* harmony default export */ const J = G;
|
|
456
438
|
// CONCATENATED MODULE: ./src/Clickable/index.ts
|
|
457
|
-
module.exports =
|
|
439
|
+
module.exports = n;
|
|
458
440
|
/******/})();
|