@useblu/ocean-react 1.119.0 → 1.123.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 +29 -0
- package/CardGroup/CardGroup.d.ts +1 -1
- package/CardGroup/CardGroup.d.ts.map +1 -1
- package/CardGroup/Header.d.ts.map +1 -1
- package/CardListItem/CardListItem.d.ts +2 -1
- package/CardListItem/CardListItem.d.ts.map +1 -1
- package/Chips/Chips.d.ts +5 -5
- package/Chips/Chips.d.ts.map +1 -1
- package/Chips/MultipleChoiceOptions.d.ts +19 -0
- package/Chips/MultipleChoiceOptions.d.ts.map +1 -0
- package/Chips/hooks/useChip.d.ts +4 -0
- package/Chips/hooks/useChip.d.ts.map +1 -0
- package/Chips/stories/WithAmount.d.ts +8 -0
- package/Chips/stories/WithAmount.d.ts.map +1 -0
- package/Chips/stories/WithoutOptions.d.ts +3 -0
- package/Chips/stories/WithoutOptions.d.ts.map +1 -0
- package/Chips/types.d.ts +33 -0
- package/Chips/types.d.ts.map +1 -0
- package/ContextualMenu/ContextualMenu.d.ts +13 -0
- package/ContextualMenu/ContextualMenu.d.ts.map +1 -0
- package/ContextualMenu/ContextualMenuItem.d.ts +21 -0
- package/ContextualMenu/ContextualMenuItem.d.ts.map +1 -0
- package/ContextualMenu/index.d.ts +5 -0
- package/ContextualMenu/index.d.ts.map +1 -0
- package/ContextualMenu/stories/ContextualMenuTrigger.d.ts +7 -0
- package/ContextualMenu/stories/ContextualMenuTrigger.d.ts.map +1 -0
- package/InternalContextualHero/InternalContextualHero.d.ts +20 -0
- package/InternalContextualHero/InternalContextualHero.d.ts.map +1 -0
- package/InternalContextualHero/index.d.ts +3 -0
- package/InternalContextualHero/index.d.ts.map +1 -0
- package/ListReadOnly/ListReadOnly.d.ts +32 -0
- package/ListReadOnly/ListReadOnly.d.ts.map +1 -0
- package/ListReadOnly/index.d.ts +3 -0
- package/ListReadOnly/index.d.ts.map +1 -0
- package/ListSettings/ListSettings.d.ts +44 -0
- package/ListSettings/ListSettings.d.ts.map +1 -0
- package/ListSettings/index.d.ts +3 -0
- package/ListSettings/index.d.ts.map +1 -0
- package/index.d.ts +11 -3
- package/index.d.ts.map +1 -1
- package/index.es.js +365 -100
- package/index.es.js.map +1 -1
- package/index.js +370 -100
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/Chips/Options.d.ts +0 -15
- package/Chips/Options.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -282,12 +282,6 @@ var Tag = e.forwardRef(function (_a, ref) {
|
|
|
282
282
|
});
|
|
283
283
|
Tag.displayName = 'Tag';
|
|
284
284
|
|
|
285
|
-
var List = e.forwardRef(function (_a, ref) {
|
|
286
|
-
var children = _a.children, className = _a.className, rest = __rest$1(_a, ["children", "className"]);
|
|
287
|
-
return (e.createElement("div", __assign$1({ ref: ref, className: classNames('ods-list', className) }, rest), children));
|
|
288
|
-
});
|
|
289
|
-
List.displayName = 'List';
|
|
290
|
-
|
|
291
285
|
var SubHeader = e.forwardRef(function (_a, ref) {
|
|
292
286
|
var children = _a.children, subtitle = _a.subtitle, className = _a.className, rest = __rest$1(_a, ["children", "subtitle", "className"]);
|
|
293
287
|
return (e.createElement("div", __assign$1({ ref: ref, className: classNames('ods-sub-header', className) }, rest),
|
|
@@ -296,6 +290,12 @@ var SubHeader = e.forwardRef(function (_a, ref) {
|
|
|
296
290
|
});
|
|
297
291
|
SubHeader.displayName = 'SubHeader';
|
|
298
292
|
|
|
293
|
+
var List = e.forwardRef(function (_a, ref) {
|
|
294
|
+
var children = _a.children, className = _a.className, rest = __rest$1(_a, ["children", "className"]);
|
|
295
|
+
return (e.createElement("div", __assign$1({ ref: ref, className: classNames('ods-list', className) }, rest), children));
|
|
296
|
+
});
|
|
297
|
+
List.displayName = 'List';
|
|
298
|
+
|
|
299
299
|
var TransactionListItem = e.forwardRef(function (_a, ref) {
|
|
300
300
|
var children = _a.children, level2 = _a.level2, level3 = _a.level3, level4 = _a.level4, icon = _a.icon, value = _a.value, positive = _a.positive, tags = _a.tags, time = _a.time, subItens = _a.subItens, className = _a.className, withChevron = _a.withChevron, readOnly = _a.readOnly, isLoading = _a.isLoading, rest = __rest$1(_a, ["children", "level2", "level3", "level4", "icon", "value", "positive", "tags", "time", "subItens", "className", "withChevron", "readOnly", "isLoading"]);
|
|
301
301
|
return (e.createElement("div", __assign$1({ ref: ref, className: classNames('ods-transaction-list-item', { 'ods-transaction-list-item--chevron': withChevron }, { 'ods-transaction-list-item--readonly': readOnly }, { 'ods-transaction-list-item--isloading': isLoading }, className) }, rest),
|
|
@@ -469,7 +469,9 @@ Badge.displayName = 'Badge';
|
|
|
469
469
|
|
|
470
470
|
var Header = function (_a) {
|
|
471
471
|
var title = _a.title, subtitle = _a.subtitle, count = _a.count, tag = _a.tag;
|
|
472
|
-
return (e.createElement("div", { className:
|
|
472
|
+
return (e.createElement("div", { className: classNames('ods-card-group__header', {
|
|
473
|
+
'ods-card-group__header--without-subtitle': !subtitle,
|
|
474
|
+
}) },
|
|
473
475
|
e.createElement("div", { className: "ods-card-group__header--content" },
|
|
474
476
|
e.createElement("div", { className: "container-line" },
|
|
475
477
|
e.createElement("p", { className: "ods-typography ods-typography__heading4" }, title),
|
|
@@ -493,9 +495,7 @@ var CardGroup = e.forwardRef(function (_a, ref) {
|
|
|
493
495
|
var title = _a.title, subtitle = _a.subtitle, actionLabel = _a.actionLabel, actionCount = _a.actionCount, actionClick = _a.actionClick, count = _a.count, tag = _a.tag, children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'minimal' : _b, rest = __rest$1(_a, ["title", "subtitle", "actionLabel", "actionCount", "actionClick", "count", "tag", "children", "variant"]);
|
|
494
496
|
return (e.createElement("div", __assign$1({ ref: ref }, rest, { "data-testid": "card-group", className: classNames('ods-card-group', "ods-card-group--".concat(variant)) }),
|
|
495
497
|
(title || subtitle) && (e.createElement(Header, { title: title, subtitle: subtitle, count: count, tag: tag })),
|
|
496
|
-
children && variant !== 'header' &&
|
|
497
|
-
(title || subtitle) && e.createElement("hr", { className: "ods-divider" }),
|
|
498
|
-
e.createElement("div", null, children))),
|
|
498
|
+
children && variant !== 'header' && e.createElement("div", null, children),
|
|
499
499
|
actionLabel && variant !== 'header' && (e.createElement(ActionButton, { actionLabel: actionLabel, actionCount: actionCount, actionClick: actionClick }))));
|
|
500
500
|
});
|
|
501
501
|
CardGroup.displayName = 'CardGroup';
|
|
@@ -5118,6 +5118,59 @@ var Carousel = function (_a) {
|
|
|
5118
5118
|
e.createElement(Slider, __assign$1({}, settings), e.Children.toArray(children).map(function (child, index) { return (e.createElement("div", { key: index }, child)); }))));
|
|
5119
5119
|
};
|
|
5120
5120
|
|
|
5121
|
+
var ContextualMenuItem = function (_a) {
|
|
5122
|
+
var _b;
|
|
5123
|
+
var label = _a.label, value = _a.value, icon = _a.icon, onClick = _a.onClick, type = _a.type, disabled = _a.disabled, blocked = _a.blocked, tag = _a.tag, id = _a.id, selectedValue = _a.selectedValue;
|
|
5124
|
+
var handleClick = function (e) {
|
|
5125
|
+
e.stopPropagation();
|
|
5126
|
+
onClick();
|
|
5127
|
+
};
|
|
5128
|
+
var isSelected = selectedValue === value;
|
|
5129
|
+
return (e.createElement("button", { type: "button", onClick: handleClick, disabled: disabled, id: id, className: classNames('ods-contextual-menu__item__button', "ods-contextual-menu__item__button--".concat(type), (_b = {},
|
|
5130
|
+
_b["ods-contextual-menu__item__button--".concat(type, "-selected")] = isSelected,
|
|
5131
|
+
_b['ods-contextual-menu__item__button--blocked'] = blocked,
|
|
5132
|
+
_b['ods-contextual-menu__item__button--with-icon'] = icon,
|
|
5133
|
+
_b)) },
|
|
5134
|
+
icon && (e.createElement("span", { className: classNames('ods-contextual-menu__item__button__icon', "ods-contextual-menu__item__button__icon--".concat(type), {
|
|
5135
|
+
'ods-contextual-menu__item__button__icon--disabled': disabled,
|
|
5136
|
+
'ods-contextual-menu__item__button__icon--blocked': blocked,
|
|
5137
|
+
}) }, icon)),
|
|
5138
|
+
e.createElement("div", { className: "ods-contextual-menu__item__button__content" },
|
|
5139
|
+
e.createElement("p", { className: "ods-typography ods-typography__description" }, label),
|
|
5140
|
+
blocked && e.createElement(At, { size: 16 }),
|
|
5141
|
+
tag && e.createElement(Tag, __assign$1({ size: "small", setIconOff: true }, tag)))));
|
|
5142
|
+
};
|
|
5143
|
+
|
|
5144
|
+
function IconButtonBase(_a, ref) {
|
|
5145
|
+
var children = _a.children, className = _a.className, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, component = _a.component, rest = __rest$1(_a, ["children", "className", "size", "disabled", "component"]);
|
|
5146
|
+
return e.createElement(component || 'button', __assign$1({ ref: ref, className: classNames('ods-icon-btn', "ods-icon-btn--".concat(size), disabled && 'ods-icon-btn--disabled', className) }, rest), children);
|
|
5147
|
+
}
|
|
5148
|
+
var IconButton = e.forwardRef(IconButtonBase);
|
|
5149
|
+
|
|
5150
|
+
var ContextualMenu = function (_a) {
|
|
5151
|
+
var items = _a.items, open = _a.open, onOpenChange = _a.onOpenChange, onSelect = _a.onSelect, selectedValue = _a.selectedValue, className = _a.className;
|
|
5152
|
+
var handleClose = function () {
|
|
5153
|
+
onOpenChange(false);
|
|
5154
|
+
};
|
|
5155
|
+
return (e.createElement(e.Fragment, null,
|
|
5156
|
+
e.createElement("div", { className: classNames('ods-contextual-menu__overlay', {
|
|
5157
|
+
'ods-contextual-menu__overlay--after-open': open,
|
|
5158
|
+
'ods-contextual-menu__overlay--before-close': !open,
|
|
5159
|
+
}), onClick: handleClose, "aria-hidden": "true", "data-testid": "contextual-menu-overlay" }),
|
|
5160
|
+
e.createElement("ul", { className: classNames('ods-contextual-menu', className, {
|
|
5161
|
+
'ods-contextual-menu--after-open': open,
|
|
5162
|
+
'ods-contextual-menu--before-close': !open,
|
|
5163
|
+
}) },
|
|
5164
|
+
e.createElement("li", { className: "ods-contextual-menu__header" },
|
|
5165
|
+
e.createElement(IconButton, { size: "sm", onClick: handleClose, "aria-label": "Fechar menu" },
|
|
5166
|
+
e.createElement(Wa, null))),
|
|
5167
|
+
items.map(function (item, index) { return (e.createElement("li", { key: item.id || item.value || index, className: "ods-contextual-menu__item" },
|
|
5168
|
+
e.createElement(ContextualMenuItem, __assign$1({}, item, { onClick: function () {
|
|
5169
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(item.value);
|
|
5170
|
+
onOpenChange(false);
|
|
5171
|
+
}, selectedValue: selectedValue })))); }))));
|
|
5172
|
+
};
|
|
5173
|
+
|
|
5121
5174
|
function useInputFilled(_a) {
|
|
5122
5175
|
var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange;
|
|
5123
5176
|
var _b = e.useState(Boolean(value || defaultValue)), filled = _b[0], setFilled = _b[1];
|
|
@@ -8800,12 +8853,6 @@ var Divider = e.forwardRef(function (_a, ref) {
|
|
|
8800
8853
|
});
|
|
8801
8854
|
Divider.displayName = 'Divider';
|
|
8802
8855
|
|
|
8803
|
-
function IconButtonBase(_a, ref) {
|
|
8804
|
-
var children = _a.children, className = _a.className, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, component = _a.component, rest = __rest$1(_a, ["children", "className", "size", "disabled", "component"]);
|
|
8805
|
-
return e.createElement(component || 'button', __assign$1({ ref: ref, className: classNames('ods-icon-btn', "ods-icon-btn--".concat(size), disabled && 'ods-icon-btn--disabled', className) }, rest), children);
|
|
8806
|
-
}
|
|
8807
|
-
var IconButton = e.forwardRef(IconButtonBase);
|
|
8808
|
-
|
|
8809
8856
|
var Search = e.forwardRef(function (_a, ref) {
|
|
8810
8857
|
var className = _a.className, id = _a.id, disabled = _a.disabled, value = _a.value, defaultValue = _a.defaultValue, placeholder = _a.placeholder, onChange = _a.onChange, rest = __rest$1(_a, ["className", "id", "disabled", "value", "defaultValue", "placeholder", "onChange"]);
|
|
8811
8858
|
var _b = useInputFilled({
|
|
@@ -46975,14 +47022,18 @@ var Shortcut = function (_a) {
|
|
|
46975
47022
|
|
|
46976
47023
|
var CardListItem = e.forwardRef(function (_a, ref) {
|
|
46977
47024
|
var title = _a.title, description = _a.description, caption = _a.caption, leadingIcon = _a.leadingIcon, actionIcon = _a.actionIcon, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, onClick = _a.onClick, loading = _a.loading, tag = _a.tag, rest = __rest$1(_a, ["title", "description", "caption", "leadingIcon", "actionIcon", "size", "disabled", "fullWidth", "onClick", "loading", "tag"]);
|
|
46978
|
-
|
|
46979
|
-
|
|
46980
|
-
}) }
|
|
46981
|
-
|
|
46982
|
-
|
|
46983
|
-
e.createElement("div", { className: "ods-card-list-
|
|
46984
|
-
e.createElement("div", { className: "ods-card-list-
|
|
46985
|
-
|
|
47025
|
+
var tagElement = typeof tag === 'string' ? (e.createElement(Tag, { variant: "highlight", type: "important" }, tag)) : (e.createElement(Tag, __assign$1({}, tag)));
|
|
47026
|
+
if (loading) {
|
|
47027
|
+
return (e.createElement("div", __assign$1({ ref: ref }, rest, { "data-testid": "card-list-item", className: classNames('ods-card-list-item', "ods-card-list-item--size-".concat(size), { 'ods-card-list-item--full-width': fullWidth }, {
|
|
47028
|
+
'ods-card-list-item--loading': loading,
|
|
47029
|
+
}) }),
|
|
47030
|
+
e.createElement("div", { className: "ods-card-list-item__circle" }),
|
|
47031
|
+
e.createElement("div", { className: "ods-card-list-item__lines" },
|
|
47032
|
+
e.createElement("div", { className: "ods-card-list-item__lines__line1" }),
|
|
47033
|
+
e.createElement("div", { className: "ods-card-list-item__lines__line2" }),
|
|
47034
|
+
size === 'medium' && (e.createElement("div", { className: "ods-card-list-item__lines__line3" })))));
|
|
47035
|
+
}
|
|
47036
|
+
return (e.createElement("div", __assign$1({ ref: ref }, rest, { "data-testid": "card-list-item", className: classNames('ods-card-list-item', "ods-card-list-item--size-".concat(size), { 'ods-card-list-item--disabled': disabled }, { 'ods-card-list-item--full-width': fullWidth }), onClick: function () {
|
|
46986
47037
|
if (!disabled && onClick)
|
|
46987
47038
|
onClick();
|
|
46988
47039
|
} }),
|
|
@@ -46992,49 +47043,94 @@ var CardListItem = e.forwardRef(function (_a, ref) {
|
|
|
46992
47043
|
description && (e.createElement("div", { className: "ods-card-list-item__content__description" }, description)),
|
|
46993
47044
|
caption && size === 'medium' && (e.createElement("div", { className: "ods-card-list-item__content__caption" }, caption))),
|
|
46994
47045
|
e.createElement("div", { className: "ods-card-list-item__wrapper" },
|
|
46995
|
-
tag &&
|
|
47046
|
+
tag && tagElement,
|
|
46996
47047
|
actionIcon && (e.createElement("div", { className: "ods-card-list-item__action" }, actionIcon)))));
|
|
46997
47048
|
});
|
|
46998
47049
|
CardListItem.displayName = 'CardListItem';
|
|
46999
47050
|
|
|
47000
|
-
var
|
|
47001
|
-
var options = _a.options, selectedOptions = _a.selectedOptions, clearLabel = _a.clearLabel, filterLabel = _a.filterLabel, multiChoice = _a.multiChoice, onSelect = _a.onSelect, filterOptions = _a.filterOptions,
|
|
47002
|
-
var
|
|
47003
|
-
var
|
|
47004
|
-
|
|
47005
|
-
|
|
47006
|
-
|
|
47007
|
-
|
|
47008
|
-
|
|
47009
|
-
|
|
47010
|
-
|
|
47011
|
-
|
|
47012
|
-
|
|
47051
|
+
var MultipleChoiceOptions = function (_a) {
|
|
47052
|
+
var options = _a.options, selectedOptions = _a.selectedOptions, clearLabel = _a.clearLabel, filterLabel = _a.filterLabel, multiChoice = _a.multiChoice, onSelect = _a.onSelect, clearOptions = _a.clearOptions, filterOptions = _a.filterOptions, headerOptions = _a.headerOptions, selectionIsOpen = _a.selectionIsOpen, handleContextMenuOpenChange = _a.handleContextMenuOpenChange, selectAllOptions = _a.selectAllOptions;
|
|
47053
|
+
var isMobile = useMedia$1('(max-width: 768px)');
|
|
47054
|
+
var selectedArray = Array.isArray(selectedOptions) ? selectedOptions : [];
|
|
47055
|
+
var selectedValues = selectedArray.map(function (option) { return option.value; });
|
|
47056
|
+
var allOptionsSelected = selectedValues.length === options.length && options.length > 0;
|
|
47057
|
+
var someOptionsSelected = selectedValues.length > 0 && selectedValues.length < options.length;
|
|
47058
|
+
var handleSelectAllOptions = function () {
|
|
47059
|
+
if (!Array.isArray(selectedOptions)) {
|
|
47060
|
+
return;
|
|
47061
|
+
}
|
|
47062
|
+
if (allOptionsSelected) {
|
|
47063
|
+
selectedArray.forEach(function (_a) {
|
|
47064
|
+
var label = _a.label, value = _a.value;
|
|
47065
|
+
onSelect(label, value);
|
|
47066
|
+
});
|
|
47067
|
+
return;
|
|
47068
|
+
}
|
|
47069
|
+
options.forEach(function (option) {
|
|
47070
|
+
if (!selectedValues.includes(option.value)) {
|
|
47071
|
+
onSelect(option.label, option.value);
|
|
47013
47072
|
}
|
|
47014
|
-
|
|
47015
|
-
|
|
47016
|
-
|
|
47017
|
-
|
|
47018
|
-
|
|
47019
|
-
|
|
47020
|
-
|
|
47021
|
-
|
|
47073
|
+
});
|
|
47074
|
+
};
|
|
47075
|
+
if (!multiChoice) {
|
|
47076
|
+
return null;
|
|
47077
|
+
}
|
|
47078
|
+
var isMultiArray = Array.isArray(selectedOptions);
|
|
47079
|
+
var contextualOverlayClasses = classNames('ods-contextual-menu__overlay', {
|
|
47080
|
+
'ods-contextual-menu__overlay--after-open': selectionIsOpen,
|
|
47081
|
+
'ods-contextual-menu__overlay--before-close': !selectionIsOpen,
|
|
47082
|
+
});
|
|
47083
|
+
var responsivePrimaryBtnClasses = isMobile
|
|
47084
|
+
? 'ods-btn ods-btn--md ods-btn--primary'
|
|
47085
|
+
: 'ods-btn ods-btn--sm ods-btn--primary';
|
|
47086
|
+
var responsiveSecondaryBtnClasses = isMobile
|
|
47087
|
+
? 'ods-btn ods-btn--md ods-btn--secondary'
|
|
47088
|
+
: 'ods-btn ods-btn--sm ods-btn--secondary';
|
|
47089
|
+
return (e.createElement(e.Fragment, null,
|
|
47090
|
+
e.createElement("div", { className: contextualOverlayClasses, onClick: function () { return handleContextMenuOpenChange(false); }, "aria-hidden": "true", "data-testid": "ods-chips-multiselect-overlay" }),
|
|
47091
|
+
e.createElement("div", { className: "ods-chips__options", "data-testid": "ods-chips-option" },
|
|
47092
|
+
e.createElement("div", { className: "ods-chips__options__responsive-header" },
|
|
47093
|
+
e.createElement(IconButton, { size: "sm", onClick: function () { return handleContextMenuOpenChange(false); }, "aria-label": "Fechar menu" },
|
|
47094
|
+
e.createElement(Wa, null))),
|
|
47095
|
+
selectAllOptions && (e.createElement("div", { className: "ods-chips__options__select-all" },
|
|
47096
|
+
e.createElement(ListSelectable, { status: "highlight", type: "text", title: "Selecionar todos", checkbox: {
|
|
47097
|
+
id: 'select-all',
|
|
47098
|
+
checked: allOptionsSelected || someOptionsSelected,
|
|
47099
|
+
indeterminate: someOptionsSelected,
|
|
47100
|
+
onChange: function () { return handleSelectAllOptions(); },
|
|
47101
|
+
}, platform: isMobile ? 'app' : 'web' }))),
|
|
47102
|
+
headerOptions && (e.createElement("div", { className: "ods-chips__options__header" }, headerOptions)),
|
|
47103
|
+
options.map(function (_a, index) {
|
|
47104
|
+
var label = _a.label, value = _a.value, indicator = _a.indicator, disabled = _a.disabled, indeterminate = _a.indeterminate;
|
|
47105
|
+
var isSelected = Array.isArray(selectedOptions)
|
|
47106
|
+
? selectedOptions.some(function (option) { return option.value === value; })
|
|
47107
|
+
: selectedOptions.value === value;
|
|
47108
|
+
return (e.createElement("div", { key: value },
|
|
47109
|
+
e.createElement(ListSelectable, { inverted: true, indicator: indicator, type: "text", title: label, showDivider: index !== options.length - 1, platform: isMobile ? 'app' : 'web', checkbox: {
|
|
47110
|
+
id: "chips-option-".concat(value),
|
|
47111
|
+
checked: isSelected,
|
|
47112
|
+
onClick: function () { return onSelect(label, value); },
|
|
47113
|
+
readOnly: true,
|
|
47114
|
+
disabled: disabled,
|
|
47115
|
+
indeterminate: indeterminate || false,
|
|
47116
|
+
} })));
|
|
47117
|
+
}),
|
|
47118
|
+
e.createElement("div", { className: "ods-chips__options--footer" },
|
|
47119
|
+
e.createElement("button", { type: "button", onClick: clearOptions, className: responsiveSecondaryBtnClasses, disabled: !isMultiArray || selectedOptions.length === 0 }, clearLabel),
|
|
47120
|
+
e.createElement("button", { type: "button", onClick: filterOptions, className: responsivePrimaryBtnClasses }, filterLabel)))));
|
|
47022
47121
|
};
|
|
47023
47122
|
|
|
47024
|
-
var
|
|
47025
|
-
|
|
47123
|
+
var shouldDefaultToEmpty = function (defaultValue, multiChoice) { return Boolean(defaultValue) || Boolean(multiChoice); };
|
|
47124
|
+
var useChip = function (_a) {
|
|
47125
|
+
var defaultValue = _a.defaultValue, _b = _a.multiChoice, multiChoice = _b === void 0 ? false : _b, onChange = _a.onChange, onClean = _a.onClean, onConfirm = _a.onConfirm, onClose = _a.onClose, onClick = _a.onClick, _c = _a.options, options = _c === void 0 ? [] : _c, selectedValue = _a.selectedValue;
|
|
47026
47126
|
var wrapperRef = e.useRef(null);
|
|
47027
|
-
var
|
|
47028
|
-
var
|
|
47029
|
-
var
|
|
47030
|
-
|
|
47031
|
-
|
|
47032
|
-
|
|
47033
|
-
|
|
47034
|
-
if (onClose && selectionIsOpen)
|
|
47035
|
-
onClose();
|
|
47036
|
-
}
|
|
47037
|
-
}
|
|
47127
|
+
var _d = e.useState(0), counter = _d[0], setCounter = _d[1];
|
|
47128
|
+
var _e = e.useState(false), selectionIsOpen = _e[0], setSelectionIsOpen = _e[1];
|
|
47129
|
+
var _f = e.useState(function () {
|
|
47130
|
+
return shouldDefaultToEmpty(defaultValue, multiChoice)
|
|
47131
|
+
? []
|
|
47132
|
+
: { label: '', value: '' };
|
|
47133
|
+
}), selectedOptions = _f[0], setSelectedOptions = _f[1];
|
|
47038
47134
|
e.useEffect(function () {
|
|
47039
47135
|
if (selectedValue && selectedValue !== selectedOptions) {
|
|
47040
47136
|
setSelectedOptions(selectedValue);
|
|
@@ -47044,84 +47140,166 @@ var Chips = function (_a) {
|
|
|
47044
47140
|
}
|
|
47045
47141
|
}, [selectedValue]);
|
|
47046
47142
|
e.useEffect(function () {
|
|
47143
|
+
var handleClickOutside = function (event) {
|
|
47144
|
+
var target = event.target;
|
|
47145
|
+
if (wrapperRef.current && !wrapperRef.current.contains(target)) {
|
|
47146
|
+
setSelectionIsOpen(false);
|
|
47147
|
+
if (onClose && selectionIsOpen) {
|
|
47148
|
+
onClose();
|
|
47149
|
+
}
|
|
47150
|
+
}
|
|
47151
|
+
};
|
|
47047
47152
|
document.addEventListener('mousedown', handleClickOutside);
|
|
47048
47153
|
return function () {
|
|
47049
47154
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
47050
47155
|
};
|
|
47051
|
-
}, [
|
|
47052
|
-
var handleClickChips = function () {
|
|
47053
|
-
if (options
|
|
47054
|
-
setSelectionIsOpen(!
|
|
47156
|
+
}, [onClose, selectionIsOpen]);
|
|
47157
|
+
var handleClickChips = e.useCallback(function () {
|
|
47158
|
+
if (options.length > 0) {
|
|
47159
|
+
setSelectionIsOpen(function (prev) { return !prev; });
|
|
47055
47160
|
}
|
|
47056
47161
|
if (onClick) {
|
|
47057
47162
|
onClick();
|
|
47058
47163
|
}
|
|
47059
|
-
};
|
|
47060
|
-
var handleSelectOption = function (labelProp, value) {
|
|
47164
|
+
}, [options.length, onClick]);
|
|
47165
|
+
var handleSelectOption = e.useCallback(function (labelProp, value) {
|
|
47061
47166
|
if (!multiChoice) {
|
|
47062
|
-
|
|
47167
|
+
var nextSelection = { label: labelProp, value: value };
|
|
47168
|
+
setSelectedOptions(nextSelection);
|
|
47063
47169
|
setSelectionIsOpen(false);
|
|
47064
|
-
if (onClose)
|
|
47065
|
-
onClose();
|
|
47066
47170
|
if (onChange) {
|
|
47067
|
-
onChange(
|
|
47171
|
+
onChange(nextSelection);
|
|
47068
47172
|
}
|
|
47069
47173
|
return;
|
|
47070
47174
|
}
|
|
47071
|
-
|
|
47072
|
-
|
|
47073
|
-
|
|
47175
|
+
setSelectedOptions(function (prev) {
|
|
47176
|
+
if (!Array.isArray(prev)) {
|
|
47177
|
+
return prev;
|
|
47178
|
+
}
|
|
47179
|
+
var copyOptions = __spreadArray$1([], prev, true);
|
|
47180
|
+
if (copyOptions.find(function (option) { return option.value === value; })) {
|
|
47074
47181
|
copyOptions = copyOptions.filter(function (option) { return option.value !== value; });
|
|
47075
47182
|
}
|
|
47076
47183
|
else {
|
|
47077
|
-
|
|
47184
|
+
var matchedOption = options.find(function (option) { return option.value === value; });
|
|
47185
|
+
copyOptions.push(matchedOption !== null && matchedOption !== void 0 ? matchedOption : { label: labelProp, value: value });
|
|
47078
47186
|
}
|
|
47079
47187
|
setCounter(copyOptions.length);
|
|
47080
|
-
setSelectedOptions(copyOptions);
|
|
47081
47188
|
if (onChange) {
|
|
47082
47189
|
onChange(copyOptions);
|
|
47083
47190
|
}
|
|
47084
|
-
|
|
47085
|
-
|
|
47086
|
-
|
|
47087
|
-
|
|
47088
|
-
return selectedOptions.value ? selectedOptions.label : label;
|
|
47089
|
-
}
|
|
47090
|
-
return label;
|
|
47091
|
-
};
|
|
47092
|
-
var clearOptions = function () {
|
|
47191
|
+
return copyOptions;
|
|
47192
|
+
});
|
|
47193
|
+
}, [multiChoice, onChange, options]);
|
|
47194
|
+
var clearOptions = e.useCallback(function () {
|
|
47093
47195
|
setSelectedOptions([]);
|
|
47094
47196
|
setCounter(0);
|
|
47095
47197
|
setSelectionIsOpen(false);
|
|
47096
|
-
if (onChange)
|
|
47198
|
+
if (onChange) {
|
|
47097
47199
|
onChange([]);
|
|
47098
|
-
|
|
47200
|
+
}
|
|
47201
|
+
if (onClean) {
|
|
47099
47202
|
onClean();
|
|
47100
|
-
|
|
47203
|
+
}
|
|
47204
|
+
if (onClose) {
|
|
47101
47205
|
onClose();
|
|
47102
|
-
|
|
47103
|
-
|
|
47206
|
+
}
|
|
47207
|
+
}, [onChange, onClean, onClose]);
|
|
47208
|
+
var filterOptions = e.useCallback(function () {
|
|
47104
47209
|
setSelectionIsOpen(false);
|
|
47105
|
-
if (onConfirm)
|
|
47210
|
+
if (onConfirm) {
|
|
47106
47211
|
onConfirm(selectedOptions);
|
|
47107
|
-
|
|
47212
|
+
}
|
|
47213
|
+
if (onClose) {
|
|
47214
|
+
onClose();
|
|
47215
|
+
}
|
|
47216
|
+
}, [onConfirm, onClose, selectedOptions]);
|
|
47217
|
+
var handleContextMenuOpenChange = e.useCallback(function (open) {
|
|
47218
|
+
if (!open && selectionIsOpen && onClose) {
|
|
47108
47219
|
onClose();
|
|
47220
|
+
}
|
|
47221
|
+
setSelectionIsOpen(open);
|
|
47222
|
+
}, [onClose, selectionIsOpen]);
|
|
47223
|
+
return {
|
|
47224
|
+
clearOptions: clearOptions,
|
|
47225
|
+
counter: counter,
|
|
47226
|
+
filterOptions: filterOptions,
|
|
47227
|
+
handleClickChips: handleClickChips,
|
|
47228
|
+
handleContextMenuOpenChange: handleContextMenuOpenChange,
|
|
47229
|
+
handleSelectOption: handleSelectOption,
|
|
47230
|
+
selectionIsOpen: selectionIsOpen,
|
|
47231
|
+
selectedOptions: selectedOptions,
|
|
47232
|
+
wrapperRef: wrapperRef,
|
|
47109
47233
|
};
|
|
47234
|
+
};
|
|
47235
|
+
|
|
47236
|
+
var Chips = function (_a) {
|
|
47237
|
+
var label = _a.label, icon = _a.icon, disabled = _a.disabled, defaultValue = _a.defaultValue, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.multiChoice, multiChoice = _c === void 0 ? false : _c, _d = _a.clearLabel, clearLabel = _d === void 0 ? 'Limpar' : _d, _e = _a.filterLabel, filterLabel = _e === void 0 ? 'Filtrar' : _e, initialCounter = _a.initialCounter, actived = _a.actived, selectedValue = _a.selectedValue, onClick = _a.onClick, onChange = _a.onChange, onClose = _a.onClose, onConfirm = _a.onConfirm, onClean = _a.onClean, headerOptions = _a.headerOptions, _f = _a.selectAllOptions, selectAllOptions = _f === void 0 ? false : _f;
|
|
47238
|
+
var _g = useChip({
|
|
47239
|
+
defaultValue: defaultValue,
|
|
47240
|
+
multiChoice: multiChoice,
|
|
47241
|
+
onChange: onChange,
|
|
47242
|
+
onClean: onClean,
|
|
47243
|
+
onConfirm: onConfirm,
|
|
47244
|
+
onClose: onClose,
|
|
47245
|
+
onClick: onClick,
|
|
47246
|
+
options: options,
|
|
47247
|
+
selectedValue: selectedValue,
|
|
47248
|
+
}), clearOptions = _g.clearOptions, counter = _g.counter, filterOptions = _g.filterOptions, handleClickChips = _g.handleClickChips, handleContextMenuOpenChange = _g.handleContextMenuOpenChange, handleSelectOption = _g.handleSelectOption, selectedOptions = _g.selectedOptions, selectionIsOpen = _g.selectionIsOpen, wrapperRef = _g.wrapperRef;
|
|
47249
|
+
var displayValue = function () {
|
|
47250
|
+
if (!Array.isArray(selectedOptions)) {
|
|
47251
|
+
return selectedOptions.value ? selectedOptions.label : label;
|
|
47252
|
+
}
|
|
47253
|
+
return label;
|
|
47254
|
+
};
|
|
47255
|
+
var contextualMenuItems = e.useMemo(function () {
|
|
47256
|
+
return multiChoice
|
|
47257
|
+
? []
|
|
47258
|
+
: options.map(function (_a) {
|
|
47259
|
+
var optionLabel = _a.label, value = _a.value, indicator = _a.indicator, optionDisabled = _a.disabled, tag = _a.tag;
|
|
47260
|
+
return ({
|
|
47261
|
+
label: optionLabel,
|
|
47262
|
+
value: value,
|
|
47263
|
+
icon: indicator,
|
|
47264
|
+
disabled: optionDisabled,
|
|
47265
|
+
tag: tag,
|
|
47266
|
+
id: "chips-option-".concat(value),
|
|
47267
|
+
type: 'neutral',
|
|
47268
|
+
});
|
|
47269
|
+
});
|
|
47270
|
+
}, [multiChoice, options]);
|
|
47271
|
+
var handleContextualMenuSelect = function (value) {
|
|
47272
|
+
var option = options.find(function (item) { return item.value === value; });
|
|
47273
|
+
if (option) {
|
|
47274
|
+
handleSelectOption(option.label, option.value);
|
|
47275
|
+
}
|
|
47276
|
+
};
|
|
47277
|
+
var contextualMenuSelectedValue = !Array.isArray(selectedOptions) && (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.value)
|
|
47278
|
+
? selectedOptions.value
|
|
47279
|
+
: undefined;
|
|
47280
|
+
var hasOptions = options && (options === null || options === void 0 ? void 0 : options.length) > 0;
|
|
47281
|
+
var shouldRenderOptions = selectionIsOpen && hasOptions;
|
|
47282
|
+
var renderOptions = function () {
|
|
47283
|
+
if (multiChoice) {
|
|
47284
|
+
return (e.createElement(MultipleChoiceOptions, { options: options, onSelect: handleSelectOption, selectedOptions: selectedOptions, clearLabel: clearLabel, filterLabel: filterLabel, multiChoice: multiChoice, clearOptions: clearOptions, filterOptions: filterOptions, headerOptions: headerOptions, selectionIsOpen: selectionIsOpen, handleContextMenuOpenChange: handleContextMenuOpenChange, selectAllOptions: selectAllOptions }));
|
|
47285
|
+
}
|
|
47286
|
+
return (e.createElement(ContextualMenu, { items: contextualMenuItems, open: selectionIsOpen, onOpenChange: handleContextMenuOpenChange, onSelect: handleContextualMenuSelect, selectedValue: contextualMenuSelectedValue, className: "ods-chips__contextual-menu" }));
|
|
47287
|
+
};
|
|
47288
|
+
var badgeCount = initialCounter !== null && initialCounter !== void 0 ? initialCounter : counter;
|
|
47110
47289
|
return (e.createElement("div", { className: "ods-chips", ref: wrapperRef },
|
|
47111
47290
|
e.createElement("button", { type: "button", onClick: handleClickChips, disabled: disabled, className: classNames('ods-chips__button', {
|
|
47112
47291
|
'ods-chips__button--disabled': disabled,
|
|
47113
|
-
'ods-chips__button--
|
|
47114
|
-
|
|
47115
|
-
|
|
47116
|
-
|
|
47117
|
-
actived,
|
|
47292
|
+
'ods-chips__button--no-options': !hasOptions,
|
|
47293
|
+
'ods-chips__button--active': (Array.isArray(selectedOptions)
|
|
47294
|
+
? selectedOptions.length > 0
|
|
47295
|
+
: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.value) || actived,
|
|
47118
47296
|
}) },
|
|
47119
47297
|
icon || undefined,
|
|
47120
47298
|
e.createElement("p", { className: "ods-chips__label" }, displayValue()),
|
|
47121
|
-
|
|
47122
|
-
|
|
47123
|
-
|
|
47124
|
-
|
|
47299
|
+
badgeCount > 0 && (e.createElement(Badge, { color: "brand", className: "ods-chips__badge", count: initialCounter !== null && initialCounter !== void 0 ? initialCounter : counter })),
|
|
47300
|
+
hasOptions && !selectionIsOpen && e.createElement(ee, null),
|
|
47301
|
+
hasOptions && selectionIsOpen && e.createElement(ae, null)),
|
|
47302
|
+
shouldRenderOptions && renderOptions()));
|
|
47125
47303
|
};
|
|
47126
47304
|
Chips.displayName = 'Chips';
|
|
47127
47305
|
|
|
@@ -47538,6 +47716,31 @@ var ListAction = e.forwardRef(function (_a, ref) {
|
|
|
47538
47716
|
});
|
|
47539
47717
|
ListAction.displayName = 'ListAction';
|
|
47540
47718
|
|
|
47719
|
+
var ListReadOnly = e.forwardRef(function (_a, ref) {
|
|
47720
|
+
var _b;
|
|
47721
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, icon = _a.icon, indicator = _a.indicator, _c = _a.type, type = _c === void 0 ? 'card' : _c, _d = _a.status, status = _d === void 0 ? 'default' : _d, _e = _a.inverted, inverted = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, className = _a.className, _h = _a.showDivider, showDivider = _h === void 0 ? false : _h, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "icon", "indicator", "type", "status", "inverted", "disabled", "loading", "className", "showDivider"]);
|
|
47722
|
+
var renderLoadingContent = function () { return (e.createElement("div", { className: 'ods-list-readonly__skeleton' },
|
|
47723
|
+
e.createElement(SkeletonBar, { width: '40%', height: '16px' }),
|
|
47724
|
+
e.createElement(SkeletonBar, { width: '100%', height: '16px' }))); };
|
|
47725
|
+
var renderContent = function () { return (e.createElement(e.Fragment, null,
|
|
47726
|
+
icon && (e.createElement("div", { className: classNames('ods-list-readonly__icon', {
|
|
47727
|
+
'ods-list-readonly__icon--inactive': status === 'inactive',
|
|
47728
|
+
}) }, icon)),
|
|
47729
|
+
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: status }),
|
|
47730
|
+
indicator && (e.createElement("div", { className: 'ods-list-readonly__trailing' },
|
|
47731
|
+
e.createElement("div", { className: 'ods-list-readonly__indicator' }, indicator))))); };
|
|
47732
|
+
var cardClassName = classNames('ods-list-readonly', className, (_b = {
|
|
47733
|
+
'ods-list-readonly--loading': loading,
|
|
47734
|
+
'ods-list-readonly--disabled': disabled
|
|
47735
|
+
},
|
|
47736
|
+
_b["ods-list-readonly--".concat(type)] = type,
|
|
47737
|
+
_b));
|
|
47738
|
+
return (e.createElement("div", { className: 'ods-list-readonly__container' },
|
|
47739
|
+
e.createElement("div", __assign$1({ ref: ref, "data-testid": 'card-list-readonly', className: cardClassName }, rest), loading ? renderLoadingContent() : renderContent()),
|
|
47740
|
+
showDivider && type === 'text' && (e.createElement("div", { className: 'ods-list-readonly__divider' }))));
|
|
47741
|
+
});
|
|
47742
|
+
ListReadOnly.displayName = 'ListReadOnly';
|
|
47743
|
+
|
|
47541
47744
|
var ListExpandable = e.forwardRef(function (_a, ref) {
|
|
47542
47745
|
var _b;
|
|
47543
47746
|
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.loading, loading = _f === void 0 ? false : _f, icon = _a.icon, indicator = _a.indicator, controlledExpanded = _a.expanded, _g = _a.defaultExpanded, defaultExpanded = _g === void 0 ? false : _g, onToggle = _a.onToggle, children = _a.children, className = _a.className, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.showDivider, showDivider = _j === void 0 ? false : _j, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "loading", "icon", "indicator", "expanded", "defaultExpanded", "onToggle", "children", "className", "disabled", "showDivider"]);
|
|
@@ -47576,13 +47779,74 @@ var ListExpandable = e.forwardRef(function (_a, ref) {
|
|
|
47576
47779
|
});
|
|
47577
47780
|
ListExpandable.displayName = 'ListExpandable';
|
|
47578
47781
|
|
|
47782
|
+
var isListItemString = function (item) {
|
|
47783
|
+
return typeof item === 'object' && item !== null && 'description' in item;
|
|
47784
|
+
};
|
|
47785
|
+
var InternalContextualHero = e.forwardRef(function (_a, ref) {
|
|
47786
|
+
var title = _a.title, description = _a.description, image = _a.image, listItems = _a.listItems, actions = _a.actions, className = _a.className;
|
|
47787
|
+
var renderImage = function () {
|
|
47788
|
+
if (typeof image === 'string') {
|
|
47789
|
+
return e.createElement("img", { src: image, alt: title });
|
|
47790
|
+
}
|
|
47791
|
+
return image;
|
|
47792
|
+
};
|
|
47793
|
+
return (e.createElement("div", { "data-testid": "internal-contextual-hero", className: classNames('ods-internal-contextual-hero', className), ref: ref },
|
|
47794
|
+
e.createElement("div", { className: 'ods-internal-contextual-hero__body' },
|
|
47795
|
+
e.createElement("div", { className: 'ods-internal-contextual-hero__content' },
|
|
47796
|
+
e.createElement("div", { className: 'ods-internal-contextual-hero__header' },
|
|
47797
|
+
e.createElement(Typography, { variant: "heading3" }, title),
|
|
47798
|
+
e.createElement(Typography, { variant: "description" }, description)),
|
|
47799
|
+
actions && actions.length > 0 && (e.createElement("div", { className: 'ods-internal-contextual-hero__actions' },
|
|
47800
|
+
e.createElement(Button$1, { variant: 'primary', size: 'sm', onClick: actions[0].onClick }, actions[0].label),
|
|
47801
|
+
actions[1] && (e.createElement(Button$1, { variant: 'tertiary', size: 'sm', onClick: actions[1].onClick }, actions[1].label))))),
|
|
47802
|
+
e.createElement("div", { className: 'ods-internal-contextual-hero__list' }, listItems === null || listItems === void 0 ? void 0 : listItems.map(function (item) {
|
|
47803
|
+
return isListItemString(item) ? (e.createElement("div", { key: item.description, className: 'ods-internal-contextual-hero__list-item' },
|
|
47804
|
+
item.icon && e.createElement("div", null, item.icon),
|
|
47805
|
+
e.createElement(Typography, { variant: "description" }, item.description))) : (item);
|
|
47806
|
+
}))),
|
|
47807
|
+
image && (e.createElement("div", { className: 'ods-internal-contextual-hero__image' }, renderImage()))));
|
|
47808
|
+
});
|
|
47809
|
+
InternalContextualHero.displayName = 'InternalContextualHero';
|
|
47810
|
+
|
|
47811
|
+
var ListSettings = e.forwardRef(function (_a, ref) {
|
|
47812
|
+
var _b;
|
|
47813
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, icon = _a.icon, _h = _a.actionType, actionType = _h === void 0 ? 'button' : _h, _j = _a.buttonLabel, buttonLabel = _j === void 0 ? 'Label' : _j, _k = _a.buttonSize, buttonSize = _k === void 0 ? 'sm' : _k, _l = _a.buttonVariant, buttonVariant = _l === void 0 ? 'primary' : _l, _m = _a.toggleChecked, toggleChecked = _m === void 0 ? false : _m, onButtonClick = _a.onButtonClick, onToggleChange = _a.onToggleChange, _o = _a.showDivider, showDivider = _o === void 0 ? false : _o, className = _a.className, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "disabled", "loading", "icon", "actionType", "buttonLabel", "buttonSize", "buttonVariant", "toggleChecked", "onButtonClick", "onToggleChange", "showDivider", "className"]);
|
|
47814
|
+
var renderActionElement = function () {
|
|
47815
|
+
if (actionType === 'button') {
|
|
47816
|
+
return (e.createElement(Button$1, { variant: buttonVariant, size: buttonSize, onClick: onButtonClick, disabled: disabled }, buttonLabel));
|
|
47817
|
+
}
|
|
47818
|
+
if (actionType === 'toggle') {
|
|
47819
|
+
return (e.createElement(Switch, { checked: toggleChecked, disabled: disabled, onChange: function (e) { return onToggleChange === null || onToggleChange === void 0 ? void 0 : onToggleChange(e.target.checked); } }));
|
|
47820
|
+
}
|
|
47821
|
+
return null;
|
|
47822
|
+
};
|
|
47823
|
+
var renderLoadingContent = function () { return (e.createElement("div", { className: "ods-list-settings__skeleton" },
|
|
47824
|
+
e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
|
|
47825
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" }))); };
|
|
47826
|
+
var renderContent = function () { return (e.createElement(e.Fragment, null,
|
|
47827
|
+
icon && (e.createElement("div", { className: classNames('ods-list-settings__icon', {
|
|
47828
|
+
'ods-list-settings__icon--inactive': status === 'inactive',
|
|
47829
|
+
}) }, icon)),
|
|
47830
|
+
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: status }),
|
|
47831
|
+
e.createElement("div", { className: "ods-list-settings__action" }, renderActionElement()))); };
|
|
47832
|
+
var containerClassName = classNames('ods-list-settings', className, (_b = {
|
|
47833
|
+
'ods-list-settings--loading': loading,
|
|
47834
|
+
'ods-list-settings--disabled': disabled
|
|
47835
|
+
},
|
|
47836
|
+
_b["ods-list-settings--".concat(type)] = type,
|
|
47837
|
+
_b));
|
|
47838
|
+
return (e.createElement("div", { className: "ods-list-settings__container" },
|
|
47839
|
+
e.createElement("div", __assign$1({ ref: ref, "data-testid": "list-settings", className: containerClassName }, rest), loading ? renderLoadingContent() : renderContent()),
|
|
47840
|
+
showDivider && type === 'text' && (e.createElement("div", { className: "ods-list-settings__divider" }))));
|
|
47841
|
+
});
|
|
47842
|
+
ListSettings.displayName = 'ListSettings';
|
|
47843
|
+
|
|
47579
47844
|
exports.Accordion = Accordion;
|
|
47580
47845
|
exports.Alert = Alert;
|
|
47581
47846
|
exports.Badge = Badge;
|
|
47582
47847
|
exports.Breadcrumb = Breadcrumb;
|
|
47583
47848
|
exports.Button = Button$1;
|
|
47584
47849
|
exports.CardGroup = CardGroup;
|
|
47585
|
-
exports.CardListExpandable = ListExpandable;
|
|
47586
47850
|
exports.CardListItem = CardListItem;
|
|
47587
47851
|
exports.Carousel = Carousel;
|
|
47588
47852
|
exports.Chart = DoughnutChart;
|
|
@@ -47590,6 +47854,8 @@ exports.Checkbox = Checkbox;
|
|
|
47590
47854
|
exports.Chips = Chips;
|
|
47591
47855
|
exports.Col = Col;
|
|
47592
47856
|
exports.Container = Container;
|
|
47857
|
+
exports.ContextualMenu = ContextualMenu;
|
|
47858
|
+
exports.ContextualMenuItem = ContextualMenuItem;
|
|
47593
47859
|
exports.CrossSellCard = CrossSellCard;
|
|
47594
47860
|
exports.DatePicker = DatePickerSingle;
|
|
47595
47861
|
exports.DateRange = DatePickerRange;
|
|
@@ -47599,10 +47865,14 @@ exports.Drawer = Drawer;
|
|
|
47599
47865
|
exports.Grid = index$1;
|
|
47600
47866
|
exports.IconButton = IconButton;
|
|
47601
47867
|
exports.Input = Input;
|
|
47868
|
+
exports.InternalContextualHero = InternalContextualHero;
|
|
47602
47869
|
exports.Link = Link;
|
|
47603
47870
|
exports.List = List;
|
|
47604
47871
|
exports.ListAction = ListAction;
|
|
47872
|
+
exports.ListExpandable = ListExpandable;
|
|
47873
|
+
exports.ListReadOnly = ListReadOnly;
|
|
47605
47874
|
exports.ListSelectable = ListSelectable;
|
|
47875
|
+
exports.ListSettings = ListSettings;
|
|
47606
47876
|
exports.Modal = Modal;
|
|
47607
47877
|
exports.Progress = Progress;
|
|
47608
47878
|
exports.Radio = Radio;
|