@splunk/react-ui 4.35.0 → 4.37.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/CHANGELOG.md +30 -3
- package/Calendar.js +2 -2
- package/CollapsiblePanel.js +1 -1
- package/ComboBox.js +2 -2
- package/ControlGroup.js +48 -49
- package/Date.js +21 -24
- package/FormRows.js +2 -2
- package/JSONTree.js +260 -227
- package/MIGRATION.mdx +17 -0
- package/Modal.js +1 -1
- package/Multiselect.js +28 -10
- package/Paginator.js +1 -1
- package/Progress.js +202 -149
- package/RadioBar.js +164 -194
- package/Resize.js +133 -113
- package/Slider.js +9 -3
- package/StaticContent.js +48 -46
- package/Switch.js +1 -1
- package/TabBar.js +125 -110
- package/TextArea.js +21 -19
- package/package.json +3 -2
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -0
- package/types/src/ComboBox/ComboBox.d.ts +8 -4
- package/types/src/ControlGroup/ControlGroup.d.ts +9 -5
- package/types/src/ControlGroup/docs/examples/Error.d.ts +2 -2
- package/types/src/Date/docs/examples/Error.d.ts +2 -0
- package/types/src/JSONTree/JSONTreeItem.d.ts +2 -2
- package/types/src/JSONTree/renderTreeItems.d.ts +2 -2
- package/types/src/Multiselect/Normal.d.ts +1 -0
- package/types/src/Progress/Progress.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +1 -1
- package/types/src/Resize/Resize.d.ts +4 -2
- package/types/src/StaticContent/StaticContent.d.ts +4 -1
- /package/types/src/Progress/docs/examples/{prisma/Type.d.ts → Type.d.ts} +0 -0
package/TabBar.js
CHANGED
|
@@ -74,20 +74,20 @@
|
|
|
74
74
|
const o = require("@splunk/ui-utils/keyboard");
|
|
75
75
|
// CONCATENATED MODULE: external "styled-components"
|
|
76
76
|
const l = require("styled-components");
|
|
77
|
-
var
|
|
77
|
+
var c = e.n(l);
|
|
78
78
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
79
|
-
const
|
|
79
|
+
const s = require("@splunk/themes");
|
|
80
80
|
// CONCATENATED MODULE: ./src/TabBar/TabBarStyles.ts
|
|
81
|
-
var u =
|
|
81
|
+
var u = c().div.withConfig({
|
|
82
82
|
displayName: "TabBarStyles__Styled",
|
|
83
83
|
componentId: "sc-1t85fen-0"
|
|
84
|
-
})([ "", " position:relative;&::before{content:'';display:block;position:absolute;left:0;top:0;right:0;bottom:0;border:0 solid ", ";}", ";" ],
|
|
85
|
-
|
|
86
|
-
enterprise:
|
|
87
|
-
prisma:
|
|
88
|
-
}), (0,
|
|
84
|
+
})([ "", " position:relative;&::before{content:'';display:block;position:absolute;left:0;top:0;right:0;bottom:0;border:0 solid ", ";}", ";" ], s.mixins.reset("flex"), (0,
|
|
85
|
+
s.pick)({
|
|
86
|
+
enterprise: s.variables.borderLightColor,
|
|
87
|
+
prisma: s.variables.neutral200
|
|
88
|
+
}), (0, s.pickVariant)("$layout", {
|
|
89
89
|
horizontal: {
|
|
90
|
-
prisma: (0,
|
|
90
|
+
prisma: (0, s.pickVariant)("$withUnderline", {
|
|
91
91
|
/* context appearance is only supported for Prisma */
|
|
92
92
|
true: (0, l.css)([ "&::before{border-bottom-width:1px;}" ])
|
|
93
93
|
}),
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
const O = require("@splunk/react-ui/Clickable");
|
|
122
122
|
var T = e.n(O);
|
|
123
123
|
// CONCATENATED MODULE: ./src/TabBar/TabStyles.ts
|
|
124
|
-
var I = (0,
|
|
125
|
-
prisma: (0, l.css)([ "color:", ";" ],
|
|
124
|
+
var I = (0, s.pick)({
|
|
125
|
+
prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
|
|
126
126
|
});
|
|
127
|
-
var j = (0,
|
|
127
|
+
var j = (0, s.pickVariant)("$layout", {
|
|
128
128
|
horizontal: {
|
|
129
129
|
enterprise: (0, l.css)([ "height:3px;" ])
|
|
130
130
|
},
|
|
@@ -132,25 +132,25 @@
|
|
|
132
132
|
enterprise: (0, l.css)([ "width:3px;" ])
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
-
var z =
|
|
135
|
+
var z = c()(T()).withConfig({
|
|
136
136
|
displayName: "TabStyles__StyledClickable",
|
|
137
137
|
componentId: "sc-1ry8mzj-0"
|
|
138
138
|
})([ "flex:0 1 auto;display:flow-root;position:relative;line-height:", ";text-align:center;white-space:nowrap;color:", ";&::after{display:block;content:attr(data-title);font-weight:", ";height:0;color:transparent;overflow:hidden;visibility:hidden;}", ";&[aria-selected='true']{cursor:default;", "}&[aria-selected='false']{box-shadow:none;font-weight:", ";&:hover:not([disabled]){", "}&[aria-haspopup='true']{", "}}&:focus{box-shadow:", ";", "}" ], (0,
|
|
139
|
-
|
|
139
|
+
s.pick)({
|
|
140
140
|
enterprise: "24px",
|
|
141
141
|
prisma: "20px"
|
|
142
|
-
}),
|
|
143
|
-
horizontal: (0, l.css)([ "padding:", ";margin-bottom:1px;" ], (0,
|
|
144
|
-
enterprise: (0,
|
|
142
|
+
}), s.variables.contentColorDefault, s.variables.fontWeightBold, (0, s.pickVariant)("$layout", {
|
|
143
|
+
horizontal: (0, l.css)([ "padding:", ";margin-bottom:1px;" ], (0, s.pick)({
|
|
144
|
+
enterprise: (0, s.pickVariant)("$hasMenu", {
|
|
145
145
|
true: "3px 4px 3px 16px",
|
|
146
146
|
false: "3px 20px"
|
|
147
147
|
}),
|
|
148
148
|
prisma: {
|
|
149
|
-
comfortable: (0,
|
|
149
|
+
comfortable: (0, s.pickVariant)("$hasMenu", {
|
|
150
150
|
true: "0px 8px 0px 16px",
|
|
151
151
|
false: "0px 20px"
|
|
152
152
|
}),
|
|
153
|
-
compact: (0,
|
|
153
|
+
compact: (0, s.pickVariant)("$hasMenu", {
|
|
154
154
|
true: "0px 8px 0px 12px",
|
|
155
155
|
false: "0 16px"
|
|
156
156
|
})
|
|
@@ -161,48 +161,48 @@
|
|
|
161
161
|
var t = e.$icon;
|
|
162
162
|
return t && (0, l.css)([ "text-align:center;" ]);
|
|
163
163
|
})),
|
|
164
|
-
prisma: (0, l.css)([ "width:100%;right:1px;padding:", ";" ], (0,
|
|
164
|
+
prisma: (0, l.css)([ "width:100%;right:1px;padding:", ";" ], (0, s.pick)({
|
|
165
165
|
comfortable: "0 20px",
|
|
166
166
|
compact: "0 16px"
|
|
167
167
|
}))
|
|
168
168
|
}
|
|
169
|
-
}), (0,
|
|
170
|
-
enterprise: (0, l.css)([ "font-weight:", ";" ],
|
|
171
|
-
prisma: (0, l.css)([ "color:", ";font-weight:", ";" ],
|
|
172
|
-
}), (0,
|
|
169
|
+
}), (0, s.pick)({
|
|
170
|
+
enterprise: (0, l.css)([ "font-weight:", ";" ], s.variables.fontWeightBold),
|
|
171
|
+
prisma: (0, l.css)([ "color:", ";font-weight:", ";" ], s.variables.contentColorActive, s.variables.fontWeightBold)
|
|
172
|
+
}), (0, s.pick)({
|
|
173
173
|
enterprise: "normal",
|
|
174
|
-
prisma:
|
|
175
|
-
}), I, I,
|
|
176
|
-
prisma: (0, l.css)([ "color:", ";" ],
|
|
174
|
+
prisma: s.variables.fontWeightSemiBold
|
|
175
|
+
}), I, I, s.variables.focusShadowInset, (0, s.pick)({
|
|
176
|
+
prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
|
|
177
177
|
}));
|
|
178
|
-
var
|
|
178
|
+
var E = c().div.withConfig({
|
|
179
179
|
displayName: "TabStyles__StyledUnderline",
|
|
180
180
|
componentId: "sc-1ry8mzj-1"
|
|
181
181
|
})([ "position:absolute;", " ", ";[aria-selected='true'] > &&{background-color:", ";", ";}", ":hover:not([disabled]) > &&{", ";}[aria-selected='false'][aria-haspopup='true'] > &&{", "}" ], (0,
|
|
182
|
-
|
|
183
|
-
enterprise: (0, l.css)([ "background:", ";" ],
|
|
184
|
-
}), (0,
|
|
182
|
+
s.pick)({
|
|
183
|
+
enterprise: (0, l.css)([ "background:", ";" ], s.variables.borderLightColor)
|
|
184
|
+
}), (0, s.pickVariant)("$layout", {
|
|
185
185
|
horizontal: (0, l.css)([ "height:0;box-sizing:border-box;width:", ";", " transition:height 0.2s;" ], (0,
|
|
186
|
-
|
|
186
|
+
s.pick)({
|
|
187
187
|
enterprise: "calc(100% - 20px * 2)",
|
|
188
188
|
prisma: {
|
|
189
189
|
comfortable: "calc(100% - 20px * 2)",
|
|
190
190
|
compact: "calc(100% - 16px * 2)"
|
|
191
191
|
}
|
|
192
|
-
}), (0,
|
|
192
|
+
}), (0, s.pick)({
|
|
193
193
|
enterprise: (0, l.css)([ "bottom:-1px;" ])
|
|
194
194
|
})),
|
|
195
195
|
vertical: {
|
|
196
196
|
enterprise: (0, l.css)([ "width:0;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;" ]),
|
|
197
197
|
prisma: (0, l.css)([ "width:1px;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;box-sizing:border-box;" ])
|
|
198
198
|
}
|
|
199
|
-
}), (0,
|
|
200
|
-
enterprise:
|
|
201
|
-
prisma:
|
|
202
|
-
}), (0,
|
|
199
|
+
}), (0, s.pick)({
|
|
200
|
+
enterprise: s.variables.accentColor,
|
|
201
|
+
prisma: s.variables.contentColorActive
|
|
202
|
+
}), (0, s.pickVariant)("$layout", {
|
|
203
203
|
horizontal: {
|
|
204
204
|
enterprise: (0, l.css)([ "height:3px;" ]),
|
|
205
|
-
prisma: (0,
|
|
205
|
+
prisma: (0, s.pickVariant)("$withUnderline", {
|
|
206
206
|
// context appearance is only supported for Prisma
|
|
207
207
|
true: (0, l.css)([ "height:1px;" ])
|
|
208
208
|
})
|
|
@@ -214,22 +214,22 @@
|
|
|
214
214
|
}),
|
|
215
215
|
/* sc-sel */
|
|
216
216
|
z, j, j);
|
|
217
|
-
var
|
|
217
|
+
var M = c().span.withConfig({
|
|
218
218
|
displayName: "TabStyles__StyledMenu",
|
|
219
219
|
componentId: "sc-1ry8mzj-2"
|
|
220
|
-
})([ "display:inline-block;> svg{transform:translateY(-1px);}border-radius:", ";cursor:pointer;", " &:hover{", "}", "[aria-haspopup='true'] &,", ":hover &,", ":focus &{visibility:visible;}" ],
|
|
221
|
-
|
|
220
|
+
})([ "display:inline-block;> svg{transform:translateY(-1px);}border-radius:", ";cursor:pointer;", " &:hover{", "}", "[aria-haspopup='true'] &,", ":hover &,", ":focus &{visibility:visible;}" ], s.variables.borderRadius, (0,
|
|
221
|
+
s.pickVariant)("$active", {
|
|
222
222
|
false: (0, l.css)([ "visibility:hidden;" ])
|
|
223
|
-
}), (0,
|
|
223
|
+
}), (0, s.pick)({
|
|
224
224
|
enterprise: (0, l.css)([ "color:", ";background-color:", ";border-color:", ";" ], (0,
|
|
225
|
-
|
|
226
|
-
light:
|
|
227
|
-
dark:
|
|
228
|
-
}),
|
|
229
|
-
light:
|
|
230
|
-
dark:
|
|
225
|
+
s.pick)({
|
|
226
|
+
light: s.variables.linkColor,
|
|
227
|
+
dark: s.variables.white
|
|
228
|
+
}), s.variables.backgroundColorHover, (0, s.pick)({
|
|
229
|
+
light: s.variables.gray60,
|
|
230
|
+
dark: s.variables.borderColor
|
|
231
231
|
})),
|
|
232
|
-
prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ],
|
|
232
|
+
prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ], s.variables.interactiveColorOverlayHover, s.variables.interactiveColorBorderHover, s.variables.hoverShadow)
|
|
233
233
|
}),
|
|
234
234
|
/* sc-sel */
|
|
235
235
|
z,
|
|
@@ -237,56 +237,56 @@
|
|
|
237
237
|
z,
|
|
238
238
|
/* sc-sel */
|
|
239
239
|
z);
|
|
240
|
-
var
|
|
240
|
+
var _ = c().span.withConfig({
|
|
241
241
|
displayName: "TabStyles__StyledIcon",
|
|
242
242
|
componentId: "sc-1ry8mzj-3"
|
|
243
|
-
})([ "", ";" ], (0,
|
|
243
|
+
})([ "", ";" ], (0, s.pickVariant)("$iconSize", {
|
|
244
244
|
inline: (0, l.css)([ "", " text-align:left;padding-right:", ";> svg{transform:translateY(-1px);}" ], (0,
|
|
245
|
-
|
|
245
|
+
s.pick)({
|
|
246
246
|
prisma: (0, l.css)([ "display:inline-block;width:16px;height:16px;" ])
|
|
247
|
-
}), (0,
|
|
247
|
+
}), (0, s.pick)({
|
|
248
248
|
enterprise: "0.4em",
|
|
249
249
|
prisma: "8px"
|
|
250
250
|
})),
|
|
251
251
|
small: (0, l.css)([ "font-size:24px;height:24px;text-align:center;display:block;padding:4px 0;" ]),
|
|
252
252
|
large: (0, l.css)([ "font-size:48px;height:48px;text-align:center;display:block;padding:8px 0 0;" ])
|
|
253
253
|
}));
|
|
254
|
-
var P =
|
|
254
|
+
var P = c().div.withConfig({
|
|
255
255
|
displayName: "TabStyles__StyledLabelAndMenuContainer",
|
|
256
256
|
componentId: "sc-1ry8mzj-4"
|
|
257
257
|
})([ "display:flex;align-items:center;justify-content:center;gap:8px;" ]);
|
|
258
|
-
var $ =
|
|
258
|
+
var $ = c().div.withConfig({
|
|
259
259
|
displayName: "TabStyles__StyledLabel",
|
|
260
260
|
componentId: "sc-1ry8mzj-5"
|
|
261
261
|
})([ "overflow:hidden;text-overflow:ellipsis;min-width:10px;margin:", ";" ], (0,
|
|
262
|
-
|
|
262
|
+
s.pick)({
|
|
263
263
|
enterprise: "0",
|
|
264
264
|
prisma: {
|
|
265
265
|
comfortable: "16px 0",
|
|
266
266
|
compact: "10px 0"
|
|
267
267
|
}
|
|
268
268
|
}));
|
|
269
|
-
var
|
|
269
|
+
var R = c().span.withConfig({
|
|
270
270
|
displayName: "TabStyles__StyledCount",
|
|
271
271
|
componentId: "sc-1ry8mzj-6"
|
|
272
|
-
})([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ],
|
|
273
|
-
|
|
272
|
+
})([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ], s.variables.contentColorDefault, (0,
|
|
273
|
+
s.pick)({
|
|
274
274
|
enterprise: "inherit",
|
|
275
275
|
prisma: "10px"
|
|
276
|
-
}), (0,
|
|
276
|
+
}), (0, s.pick)({
|
|
277
277
|
enterprise: "0.4em 0.3em",
|
|
278
278
|
prisma: "0.4em 0.6em"
|
|
279
|
-
}), (0,
|
|
279
|
+
}), (0, s.pick)({
|
|
280
280
|
enterprise: "0",
|
|
281
281
|
prisma: "0.3em"
|
|
282
|
-
}), (0,
|
|
282
|
+
}), (0, s.pick)({
|
|
283
283
|
enterprise: (0, l.css)([ "&::before{content:'(';}&::after{content:')';}" ]),
|
|
284
|
-
prisma: (0, l.css)([ "background:", ";" ],
|
|
285
|
-
}),
|
|
286
|
-
var
|
|
284
|
+
prisma: (0, l.css)([ "background:", ";" ], s.variables.neutral100)
|
|
285
|
+
}), s.variables.contentColorDisabled);
|
|
286
|
+
var D = c().div.withConfig({
|
|
287
287
|
displayName: "TabStyles__StyledTooltipContent",
|
|
288
288
|
componentId: "sc-1ry8mzj-7"
|
|
289
|
-
})([ "padding:8px;font-size:", ";" ],
|
|
289
|
+
})([ "padding:8px;font-size:", ";" ], s.variables.fontSizeSmall);
|
|
290
290
|
// CONCATENATED MODULE: ./src/TabBar/TabBarContext.tsx
|
|
291
291
|
var q = function e() {
|
|
292
292
|
return undefined;
|
|
@@ -579,7 +579,7 @@
|
|
|
579
579
|
}, {
|
|
580
580
|
key: "render",
|
|
581
581
|
value: function e() {
|
|
582
|
-
var t = this.props, r = t.active, i = t.ariaControls, a = t.count, o = t.disabled, l = t.icon,
|
|
582
|
+
var t = this.props, r = t.active, i = t.ariaControls, a = t.count, o = t.disabled, l = t.icon, c = t.label, s = t.tabId, u = t.maxCount, p = t.splunkTheme, v = t.to, h = t.tooltip, m = t.menu, x = t.tabKey, w = U(t, [ "active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "splunkTheme", "to", "tooltip", "menu", "tabKey" ]);
|
|
583
583
|
var C = this.state, O = C.anchor, T = C.open;
|
|
584
584
|
var I = this.context, j = I.appearance, q = I.disabled, A = I.iconSize, V = I.layout, B = I.width, F = I.onMenuOpen, W = I.onMenuClose, L = I.isMenuOpen, H = I.focusedTabKey;
|
|
585
585
|
var Y = w.style;
|
|
@@ -590,7 +590,7 @@
|
|
|
590
590
|
width: B
|
|
591
591
|
} : Y;
|
|
592
592
|
var Z = p.isEnterprise;
|
|
593
|
-
var ee =
|
|
593
|
+
var ee = c ? c.toString() : "";
|
|
594
594
|
var te = a === 0 || a ? "".concat(a === null || a === void 0 ? void 0 : a.toString()) : "";
|
|
595
595
|
// title is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
|
|
596
596
|
var re;
|
|
@@ -602,7 +602,7 @@
|
|
|
602
602
|
re = "".concat(ee, " ").concat(te);
|
|
603
603
|
}
|
|
604
604
|
var ie = H === x && L && !!m;
|
|
605
|
-
var ae = n().createElement(
|
|
605
|
+
var ae = n().createElement(M, {
|
|
606
606
|
$active: r,
|
|
607
607
|
"data-test": "menu-toggle",
|
|
608
608
|
tabIndex: -1,
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
"aria-describedby": m ? this.menuDescription : undefined,
|
|
636
636
|
"aria-haspopup": ie,
|
|
637
637
|
"data-test": "tab",
|
|
638
|
-
"data-test-tab-id":
|
|
638
|
+
"data-test-tab-id": s,
|
|
639
639
|
"data-test-popover-id": h ? this.popoverId : undefined,
|
|
640
640
|
$layout: Q,
|
|
641
641
|
$icon: l && J !== "inline" ? true : undefined,
|
|
@@ -656,15 +656,15 @@
|
|
|
656
656
|
}), oe( n().createElement($, {
|
|
657
657
|
"data-test": "label",
|
|
658
658
|
$withUnderline: j === "navigation"
|
|
659
|
-
}, l && n().createElement(
|
|
659
|
+
}, l && n().createElement(_, {
|
|
660
660
|
$iconSize: J
|
|
661
|
-
}, l),
|
|
661
|
+
}, l), c, !m && (a === 0 || a) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(R, {
|
|
662
662
|
"data-test": "count",
|
|
663
663
|
disabled: G
|
|
664
664
|
}, u ? K(a, u) : a)), !!m && n().createElement(S(), {
|
|
665
665
|
"aria-hidden": true,
|
|
666
666
|
id: this.menuDescription
|
|
667
|
-
}, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(
|
|
667
|
+
}, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(E, {
|
|
668
668
|
$layout: Q,
|
|
669
669
|
$withUnderline: j === "navigation"
|
|
670
670
|
}), !o && h && n().createElement(k(), {
|
|
@@ -679,7 +679,7 @@
|
|
|
679
679
|
id: this.popoverId,
|
|
680
680
|
open: !!O && T,
|
|
681
681
|
align: "center"
|
|
682
|
-
}, n().createElement(
|
|
682
|
+
}, n().createElement(D, null, h)), h && n().createElement(S(), {
|
|
683
683
|
"aria-hidden": "true",
|
|
684
684
|
id: this.ariaId
|
|
685
685
|
}, h));
|
|
@@ -690,12 +690,12 @@
|
|
|
690
690
|
re(ae, "propTypes", ne);
|
|
691
691
|
re(ae, "defaultProps", ie);
|
|
692
692
|
re(ae, "contextType", V);
|
|
693
|
-
var oe = (0,
|
|
693
|
+
var oe = (0, s.withSplunkTheme)(ae);
|
|
694
694
|
oe.propTypes = ae.propTypes;
|
|
695
695
|
/* harmony default export */ const le = oe;
|
|
696
696
|
// CONCATENATED MODULE: ./src/utils/navigateList.ts
|
|
697
697
|
// A utility for keyboard navigation of lists
|
|
698
|
-
function
|
|
698
|
+
function ce(e, t, r) {
|
|
699
699
|
for (var n = 0; n < e.length; n += 1) {
|
|
700
700
|
var i;
|
|
701
701
|
var a = (n + r) % e.length;
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
}
|
|
706
706
|
return e[t];
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function se(e, t, r) {
|
|
709
709
|
for (var n = e.length; n > 0; n -= 1) {
|
|
710
710
|
var i;
|
|
711
711
|
var a = (n + r) % e.length;
|
|
@@ -819,40 +819,46 @@
|
|
|
819
819
|
tabWidth: a().number
|
|
820
820
|
};
|
|
821
821
|
function ke(e) {
|
|
822
|
-
var t = e.activeTabId, i = e.autoActivate, a = e.appearance, l = a === void 0 ? "navigation" : a,
|
|
822
|
+
var t = e.activeTabId, i = e.autoActivate, a = e.appearance, l = a === void 0 ? "navigation" : a, c = e.children, s = e.disabled, p = s === void 0 ? false : s, d = e.elementRef, f = e.iconSize, v = f === void 0 ? "inline" : f, b = e.layout, h = b === void 0 ? "horizontal" : b, y = e.onChange, m = e.tabWidth, g = ye(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
|
|
823
823
|
// @docs-props-type TabBarPropsBase
|
|
824
824
|
var x = (0, r.useState)(false), k = pe(x, 2), w = k[0], S = k[1];
|
|
825
825
|
var C = (0, r.useState)(0), O = pe(C, 2), T = O[0], I = O[1];
|
|
826
|
-
var j = (0, r.useRef)(
|
|
827
|
-
|
|
828
|
-
var
|
|
829
|
-
var
|
|
826
|
+
var j = (0, r.useRef)(T);
|
|
827
|
+
j.current = T;
|
|
828
|
+
var z = (0, r.useRef)("");
|
|
829
|
+
var E = (0, r.useRef)([]);
|
|
830
|
+
var M = h === "vertical" ? "down" : "right";
|
|
831
|
+
var _ = h === "vertical" ? "up" : "left";
|
|
832
|
+
var P = (0, r.useCallback)((function(e, t) {
|
|
830
833
|
var r = t.tabKey, n = t.tabId;
|
|
831
834
|
if (r != null) {
|
|
832
835
|
I(r);
|
|
833
836
|
}
|
|
837
|
+
if (n != null) {
|
|
838
|
+
z.current = n;
|
|
839
|
+
}
|
|
834
840
|
if (i) {
|
|
835
841
|
y === null || y === void 0 ? void 0 : y(e, {
|
|
836
842
|
selectedTabId: n
|
|
837
843
|
});
|
|
838
844
|
}
|
|
839
845
|
}), [ i, y ]);
|
|
840
|
-
var
|
|
846
|
+
var $ = (0, r.useCallback)((function(e, t) {
|
|
841
847
|
y === null || y === void 0 ? void 0 : y(e, {
|
|
842
848
|
selectedTabId: t.tabId
|
|
843
849
|
});
|
|
844
850
|
}), [ y ]);
|
|
845
|
-
var
|
|
851
|
+
var R = (0, r.useMemo)((function() {
|
|
846
852
|
var e = 0;
|
|
847
853
|
// reset tabRefs since children are changed
|
|
848
|
-
|
|
849
|
-
return r.Children.toArray(
|
|
854
|
+
E.current = [];
|
|
855
|
+
return r.Children.toArray(c).filter(r.isValidElement).map((function(i) {
|
|
850
856
|
// <TabBar> allows non-<Tab> children, pass them through without any modification
|
|
851
857
|
if (typeof i.type === "string" || i.type.name !== le.name) {
|
|
852
858
|
return i;
|
|
853
859
|
}
|
|
854
860
|
var a = n().createRef();
|
|
855
|
-
|
|
861
|
+
E.current.push(a);
|
|
856
862
|
var o = {
|
|
857
863
|
active: t === i.props.tabId,
|
|
858
864
|
tabKey: e,
|
|
@@ -862,25 +868,34 @@
|
|
|
862
868
|
|
|
863
869
|
return (0, r.cloneElement)(i, o);
|
|
864
870
|
}));
|
|
865
|
-
}), [ t,
|
|
866
|
-
|
|
867
|
-
|
|
871
|
+
}), [ t, c ]);
|
|
872
|
+
(0, r.useEffect)((function() {
|
|
873
|
+
R.forEach((function(e, t) {
|
|
874
|
+
// if the focused tab has changed order in the tab bar,
|
|
875
|
+
// then we want to update the focusedTabKey to the new position of the focused tab
|
|
876
|
+
if (z.current != null && z.current === e.props.tabId && j.current !== t) {
|
|
877
|
+
I(t);
|
|
878
|
+
}
|
|
879
|
+
}));
|
|
880
|
+
}), [ R ]);
|
|
881
|
+
var D = m && m > ge ? m : null;
|
|
882
|
+
var q = (0, r.useCallback)((function(e) {
|
|
868
883
|
var t = (0, o.keycode)(e.nativeEvent);
|
|
869
884
|
var r;
|
|
870
|
-
if (t ===
|
|
871
|
-
r =
|
|
872
|
-
} else if (t ===
|
|
873
|
-
r =
|
|
885
|
+
if (t === M) {
|
|
886
|
+
r = ce(E.current, T, T + 1);
|
|
887
|
+
} else if (t === _) {
|
|
888
|
+
r = se(E.current, T, T - 1);
|
|
874
889
|
} else if (t === "home") {
|
|
875
|
-
r =
|
|
890
|
+
r = ce(E.current, T, 0);
|
|
876
891
|
} else if (t === "end") {
|
|
877
|
-
r =
|
|
892
|
+
r = se(E.current, T, E.current.length - 1);
|
|
878
893
|
} else if (h === "horizontal" && e.shiftKey && t === "f10") {
|
|
879
894
|
S((function(e) {
|
|
880
895
|
if (e) {
|
|
881
896
|
var t;
|
|
882
897
|
// if we're closing, we want to shift focus to the tab
|
|
883
|
-
var r =
|
|
898
|
+
var r = E.current[T];
|
|
884
899
|
r === null || r === void 0 ? void 0 : (t = r.current) === null || t === void 0 ? void 0 : t.focus();
|
|
885
900
|
}
|
|
886
901
|
return !e;
|
|
@@ -893,33 +908,33 @@
|
|
|
893
908
|
(n = r.current) === null || n === void 0 ? void 0 : n.focus();
|
|
894
909
|
e.preventDefault();
|
|
895
910
|
}
|
|
896
|
-
}), [ T, h,
|
|
897
|
-
var
|
|
911
|
+
}), [ T, h, M, _ ]);
|
|
912
|
+
var A = (0, r.useCallback)((function(e) {
|
|
898
913
|
// prevent clicking on the menu icon from changing the active tab
|
|
899
914
|
e.stopPropagation();
|
|
900
915
|
S(true);
|
|
901
916
|
}), []);
|
|
902
|
-
var
|
|
917
|
+
var K = (0, r.useCallback)((function(e) {
|
|
903
918
|
var t = e.event;
|
|
904
919
|
// prevent content clicks/enter key from changing the active tab
|
|
905
920
|
t === null || t === void 0 ? void 0 : t.stopPropagation();
|
|
906
921
|
S(false);
|
|
907
922
|
}), []);
|
|
908
|
-
var
|
|
923
|
+
var B = (0, r.useMemo)((function() {
|
|
909
924
|
return {
|
|
910
925
|
appearance: l,
|
|
911
926
|
disabled: p,
|
|
912
927
|
iconSize: v,
|
|
913
928
|
layout: h,
|
|
914
|
-
onClick:
|
|
915
|
-
onFocus:
|
|
916
|
-
width:
|
|
917
|
-
onMenuOpen:
|
|
918
|
-
onMenuClose:
|
|
929
|
+
onClick: $,
|
|
930
|
+
onFocus: P,
|
|
931
|
+
width: D,
|
|
932
|
+
onMenuOpen: A,
|
|
933
|
+
onMenuClose: K,
|
|
919
934
|
isMenuOpen: w,
|
|
920
935
|
focusedTabKey: T
|
|
921
936
|
};
|
|
922
|
-
}), [ l, p, T, v, w, h,
|
|
937
|
+
}), [ l, p, T, v, w, h, K, A, $, P, D ]);
|
|
923
938
|
|
|
924
939
|
return n().createElement(u, ue({
|
|
925
940
|
"data-tab-layout": h,
|
|
@@ -929,10 +944,10 @@
|
|
|
929
944
|
ref: d,
|
|
930
945
|
$layout: h,
|
|
931
946
|
$withUnderline: l === "navigation",
|
|
932
|
-
onKeyDown:
|
|
947
|
+
onKeyDown: q
|
|
933
948
|
}, g), n().createElement(V.Provider, {
|
|
934
|
-
value:
|
|
935
|
-
},
|
|
949
|
+
value: B
|
|
950
|
+
}, R));
|
|
936
951
|
}
|
|
937
952
|
ke.propTypes = xe;
|
|
938
953
|
ke.Tab = le;
|
package/TextArea.js
CHANGED
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
const s = require("lodash/has");
|
|
77
77
|
var c = e.n(s);
|
|
78
78
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
79
|
-
const
|
|
80
|
-
var
|
|
79
|
+
const p = require("lodash/keys");
|
|
80
|
+
var d = e.n(p);
|
|
81
81
|
// CONCATENATED MODULE: external "lodash/noop"
|
|
82
82
|
const u = require("lodash/noop");
|
|
83
83
|
var f = e.n(u);
|
|
@@ -269,9 +269,11 @@
|
|
|
269
269
|
var V = M()(H).withConfig({
|
|
270
270
|
displayName: "TextAreaStyles__StyledTextAreaShadow",
|
|
271
271
|
componentId: "gfy8yp-5"
|
|
272
|
-
})([ "position:absolute;overflow:hidden;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;", "
|
|
272
|
+
})([ "position:absolute;overflow:hidden;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;", "" ], (function(e) {
|
|
273
273
|
var t = e.$startAdornmentWidth, r = e.$endAdornmentWidth;
|
|
274
|
-
|
|
274
|
+
var n = t ? "".concat(t, "px") : B;
|
|
275
|
+
var a = r ? "".concat(r, "px") : z;
|
|
276
|
+
return (0, T.css)([ "width:calc(100% - ", " - ", ");" ], n, a);
|
|
275
277
|
}));
|
|
276
278
|
var K = (0, k.pick)({
|
|
277
279
|
enterprise: {
|
|
@@ -423,9 +425,9 @@
|
|
|
423
425
|
var l = parseInt(o, 10);
|
|
424
426
|
var s = parseInt(i.getPropertyValue("padding-top"), 10);
|
|
425
427
|
var c = parseInt(i.getPropertyValue("padding-bottom"), 10);
|
|
426
|
-
var
|
|
427
|
-
var
|
|
428
|
-
var u = a.scrollHeight +
|
|
428
|
+
var p = parseInt(i.getPropertyValue("border-top-width"), 10);
|
|
429
|
+
var d = parseInt(i.getPropertyValue("border-bottom-width"), 10);
|
|
430
|
+
var u = a.scrollHeight + p + d + 1;
|
|
429
431
|
// need one extra.
|
|
430
432
|
/* eslint-disable no-restricted-globals */
|
|
431
433
|
// Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
|
|
@@ -434,11 +436,11 @@
|
|
|
434
436
|
return false;
|
|
435
437
|
}
|
|
436
438
|
/* eslint-enable no-restricted-globals */ if (r >= n) {
|
|
437
|
-
var f = r * l + s + c +
|
|
439
|
+
var f = r * l + s + c + p + d + 1;
|
|
438
440
|
// need one extra.
|
|
439
441
|
u = Math.min(f, u);
|
|
440
442
|
}
|
|
441
|
-
var h = n * l + s + c +
|
|
443
|
+
var h = n * l + s + c + p + d + 1;
|
|
442
444
|
// need one extra.
|
|
443
445
|
u = Math.max(h, u);
|
|
444
446
|
if (t !== u) {
|
|
@@ -495,7 +497,7 @@
|
|
|
495
497
|
return oe.apply(this, arguments);
|
|
496
498
|
}
|
|
497
499
|
function le(e) {
|
|
498
|
-
return
|
|
500
|
+
return de(e) || pe(e) || ce(e) || se();
|
|
499
501
|
}
|
|
500
502
|
function se() {
|
|
501
503
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
@@ -508,10 +510,10 @@
|
|
|
508
510
|
if (r === "Map" || r === "Set") return Array.from(e);
|
|
509
511
|
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return ue(e, t);
|
|
510
512
|
}
|
|
511
|
-
function
|
|
513
|
+
function pe(e) {
|
|
512
514
|
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
513
515
|
}
|
|
514
|
-
function
|
|
516
|
+
function de(e) {
|
|
515
517
|
if (Array.isArray(e)) return ue(e);
|
|
516
518
|
}
|
|
517
519
|
function ue(e, t) {
|
|
@@ -868,14 +870,14 @@
|
|
|
868
870
|
Ie(Se(a), "renderEndAdornment", (function() {
|
|
869
871
|
var e;
|
|
870
872
|
var t = a.props, r = t.appearance, i = t.endAdornment, o = t.disabled, l = t.canClear, s = t.splunkTheme;
|
|
871
|
-
var c = s.isPrisma,
|
|
873
|
+
var c = s.isPrisma, p = s.isEnterprise;
|
|
872
874
|
if (i) {
|
|
873
875
|
return a.renderAdornment(i, "end");
|
|
874
876
|
}
|
|
875
|
-
var
|
|
876
|
-
var u = (e =
|
|
877
|
+
var d = a.context;
|
|
878
|
+
var u = (e = d.labelAttrs) === null || e === void 0 ? void 0 : e.text;
|
|
877
879
|
var f = u ? (0, S._)("Clear ".concat(u, " text field")) : (0, S._)("Clear text field");
|
|
878
|
-
if (
|
|
880
|
+
if (p && r === "search") {
|
|
879
881
|
/* Both icons are rendered, and StyledBox toggles visibility based on :focus-within */
|
|
880
882
|
return a.renderAdornment( n().createElement(n().Fragment, null, n().createElement(Q, {
|
|
881
883
|
"aria-label": f,
|
|
@@ -965,7 +967,7 @@
|
|
|
965
967
|
}, {
|
|
966
968
|
key: "render",
|
|
967
969
|
value: function e() {
|
|
968
|
-
var t = this.props, r = t.append, a = t.autoCapitalize, i = t.autoComplete, o = t.autoCorrect, l = t.autoFocus, s = t.children, c = t.className,
|
|
970
|
+
var t = this.props, r = t.append, a = t.autoCapitalize, i = t.autoComplete, o = t.autoCorrect, l = t.autoFocus, s = t.children, c = t.className, p = t.classNamePrivate, u = t.disabled, h = t.describedBy, m = t.elementRef, y = t.error, g = t.inline, x = t.inputClassName, w = t.inputId, k = t.labelledBy, S = t.maxLength, O = t.name, I = t.placeholder, j = t.prepend, E = t.required, T = t.rowsMin, M = t.spellCheck, P = t.tabIndex, $ = t.title, _ = ve(t, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "maxLength", "name", "placeholder", "prepend", "required", "rowsMin", "spellCheck", "tabIndex", "title" ]);
|
|
969
971
|
var D = he(he({}, b()(_, (function(e, t) {
|
|
970
972
|
return t === "role" || t.indexOf("aria-") === 0;
|
|
971
973
|
}))), {}, {
|
|
@@ -973,7 +975,7 @@
|
|
|
973
975
|
"aria-labelledby": k,
|
|
974
976
|
"aria-invalid": y || undefined
|
|
975
977
|
});
|
|
976
|
-
var q = v()(_, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick" ].concat(le(
|
|
978
|
+
var q = v()(_, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick" ].concat(le(d()(D))));
|
|
977
979
|
var W = this.getDisplayValue();
|
|
978
980
|
var N = {
|
|
979
981
|
className: (0, A.toClassName)(c, x),
|
|
@@ -1016,7 +1018,7 @@
|
|
|
1016
1018
|
|
|
1017
1019
|
return n().createElement(R, oe({
|
|
1018
1020
|
tabIndex: -1,
|
|
1019
|
-
className: (0, A.toClassName)(c,
|
|
1021
|
+
className: (0, A.toClassName)(c, p),
|
|
1020
1022
|
"data-test": "text-area",
|
|
1021
1023
|
"data-test-value": W,
|
|
1022
1024
|
elementRef: m,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.37.0",
|
|
4
4
|
"description": "Library of React components that implement the Splunk design language",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"eslint:fix": "yarn run eslint --fix",
|
|
16
16
|
"eslint:ci": "yarn run eslint -f junit -o test-reports/lint-results.xml",
|
|
17
17
|
"lint": "yarn run eslint && yarn run stylelint",
|
|
18
|
+
"lint:quiet": "yarn run eslint --quiet && yarn run stylelint",
|
|
18
19
|
"lint:ci": "yarn run eslint:ci && yarn run stylelint",
|
|
19
20
|
"start": "cross-env NODE_ENV=development webpack --watch",
|
|
20
21
|
"storybook": "sb dev -p 6006",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"@splunk/babel-preset": "^4.0.0",
|
|
64
65
|
"@splunk/docs-gen": "1.0.0-beta.13",
|
|
65
66
|
"@splunk/eslint-config": "^4.0.0",
|
|
66
|
-
"@splunk/react-docs": "1.0.0-beta.
|
|
67
|
+
"@splunk/react-docs": "1.0.0-beta.18",
|
|
67
68
|
"@splunk/stylelint-config": "^5.0.0",
|
|
68
69
|
"@splunk/test-runner-utils": "^0.4.1",
|
|
69
70
|
"@splunk/webpack-configs": "^7.0.2",
|