widenarrow-ui 1.1.36 → 1.1.37
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/lib/index.esm.js
CHANGED
|
@@ -3133,6 +3133,15 @@ var s$5 = classNames.bind(styles$5);
|
|
|
3133
3133
|
var MultiActionButton = function (_a) {
|
|
3134
3134
|
var _b, _c, _d, _e, _f;
|
|
3135
3135
|
var className = _a.className, iconClassName = _a.iconClassName, innerClassName = _a.innerClassName, id = _a.id, _g = _a.type, type = _g === void 0 ? HierarchyTypes.PRIMARY : _g, _h = _a.size, size = _h === void 0 ? SizeTypes.MEDIUM : _h, sizeMd = _a.sizeMd, sizeLg = _a.sizeLg, sizeXl = _a.sizeXl, rotateLeftIconByDegree = _a.rotateLeftIconByDegree, rotateMiddleIconByDegree = _a.rotateMiddleIconByDegree, rotateRightIconByDegree = _a.rotateRightIconByDegree, text = _a.text, toolTip = _a.toolTip, iconSize = _a.iconSize, leftIcon = _a.leftIcon, middleIcon = _a.middleIcon, rightIcon = _a.rightIcon, withEllipsis = _a.withEllipsis, onRightClickCallback = _a.onRightClickCallback, onLeftClickCallback = _a.onLeftClickCallback, loading = _a.loading, disabled = _a.disabled, autoFocus = _a.autoFocus, leftAriaLabel = _a.leftAriaLabel, rightAriaLabel = _a.rightAriaLabel, tabIndex = _a.tabIndex;
|
|
3136
|
+
var getFallbackAriaLabel = function (position) {
|
|
3137
|
+
if (text) {
|
|
3138
|
+
return "".concat(text, " - ").concat(position, " button");
|
|
3139
|
+
}
|
|
3140
|
+
if (toolTip) {
|
|
3141
|
+
return "".concat(toolTip, " - ").concat(position, " button");
|
|
3142
|
+
}
|
|
3143
|
+
return "".concat(position, " button");
|
|
3144
|
+
};
|
|
3136
3145
|
var buttonMarkup = (jsxs("div", { role: 'group', className: s$5('container', (_b = {},
|
|
3137
3146
|
_b[className] = className,
|
|
3138
3147
|
_b)), children: [loading ? (jsx(SolidSpinner, { className: s$5('spinner'), type: type === HierarchyTypes.PRIMARY ? HierarchyTypes.QUATERNARY : HierarchyTypes.SECONDARY, size: SizeTypes.SMALL })) : null, jsxs("div", { className: s$5('innerContainer', (_c = {},
|
|
@@ -3150,9 +3159,9 @@ var MultiActionButton = function (_a) {
|
|
|
3150
3159
|
button_disabled: loading || disabled,
|
|
3151
3160
|
button_noButtonRight: !rightIcon,
|
|
3152
3161
|
button_withEllipsis: withEllipsis
|
|
3153
|
-
}), disabled: loading || disabled, onClick: !loading ? onLeftClickCallback : undefined, autoFocus: autoFocus, "aria-label": leftAriaLabel ||
|
|
3162
|
+
}), disabled: loading || disabled, onClick: !loading ? onLeftClickCallback : undefined, autoFocus: autoFocus, "aria-label": leftAriaLabel || getFallbackAriaLabel('left'), tabIndex: tabIndex, children: [leftIcon ? (jsx(Icon, { icon: leftIcon, size: iconSize, rotateIconByDegree: rotateLeftIconByDegree, className: s$5((_d = { icon: !iconSize, marginRight: !!text }, _d[iconClassName] = iconClassName, _d)) })) : null, jsx("span", { className: s$5('text', {
|
|
3154
3163
|
text_withEllipsis: withEllipsis
|
|
3155
|
-
}), children: text }), middleIcon ? (jsx(Icon, { icon: middleIcon, size: iconSize, rotateIconByDegree: rotateMiddleIconByDegree, className: s$5((_e = { icon: !iconSize, marginLeft: !!text }, _e[iconClassName] = iconClassName, _e)) })) : null] }), rightIcon ? (jsx("button", { className: s$5({ button: true, button_right: true, button_disabled: loading || disabled }), "aria-label": rightAriaLabel ||
|
|
3164
|
+
}), children: text }), middleIcon ? (jsx(Icon, { icon: middleIcon, size: iconSize, rotateIconByDegree: rotateMiddleIconByDegree, className: s$5((_e = { icon: !iconSize, marginLeft: !!text }, _e[iconClassName] = iconClassName, _e)) })) : null] }), rightIcon ? (jsx("button", { className: s$5({ button: true, button_right: true, button_disabled: loading || disabled }), "aria-label": rightAriaLabel || getFallbackAriaLabel('right'), onClick: onRightClickCallback, children: jsx(Icon, { icon: rightIcon, size: iconSize, className: s$5((_f = { icon: !iconSize }, _f[iconClassName] = iconClassName, _f)), rotateIconByDegree: rotateRightIconByDegree }) })) : null] })] }));
|
|
3156
3165
|
if (toolTip) {
|
|
3157
3166
|
return (jsx(ToolTip, { text: "".concat(toolTip), id: "".concat(id), withEllipsis: withEllipsis, children: buttonMarkup }));
|
|
3158
3167
|
}
|