ab-ui-library 1.49.7 → 1.50.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.
|
@@ -70,7 +70,8 @@ var CardSelect = function CardSelect(props) {
|
|
|
70
70
|
icon = props.icon,
|
|
71
71
|
dataId = props.dataId,
|
|
72
72
|
popoverAddons = props.popoverAddons,
|
|
73
|
-
tooltipAddons = props.tooltipAddons
|
|
73
|
+
tooltipAddons = props.tooltipAddons,
|
|
74
|
+
actionAddons = props.actionAddons;
|
|
74
75
|
var elementId = (_ref = (_popoverAddons$id = popoverAddons === null || popoverAddons === void 0 ? void 0 : popoverAddons.id) !== null && _popoverAddons$id !== void 0 ? _popoverAddons$id : tooltipAddons === null || tooltipAddons === void 0 ? void 0 : tooltipAddons.id) !== null && _ref !== void 0 ? _ref : '';
|
|
75
76
|
var selected = cardValue === value;
|
|
76
77
|
var cardSelectStyle = classNames("card-select ".concat(disabled ? 'card-select--disabled' : selected ? 'card-select--selected' : ''), className);
|
|
@@ -89,6 +90,11 @@ var CardSelect = function CardSelect(props) {
|
|
|
89
90
|
handleCardSelectValue(cardValue);
|
|
90
91
|
}
|
|
91
92
|
};
|
|
93
|
+
var handleActionClick = function handleActionClick(e) {
|
|
94
|
+
var _actionAddons$onClick;
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
actionAddons === null || actionAddons === void 0 || (_actionAddons$onClick = actionAddons.onClick) === null || _actionAddons$onClick === void 0 || _actionAddons$onClick.call(actionAddons);
|
|
97
|
+
};
|
|
92
98
|
return /*#__PURE__*/React.createElement(React.Fragment, null, tooltipAddons ? /*#__PURE__*/React.createElement(Tooltip, tooltipAddons) : null, /*#__PURE__*/React.createElement("div", {
|
|
93
99
|
id: "".concat(elementId),
|
|
94
100
|
className: cardSelectStyle,
|
|
@@ -112,11 +118,16 @@ var CardSelect = function CardSelect(props) {
|
|
|
112
118
|
className: "flexbox justify-content--between align-items--start"
|
|
113
119
|
}, /*#__PURE__*/React.createElement("div", {
|
|
114
120
|
className: 'card-select__content__left'
|
|
121
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: 'flexbox align-items--center'
|
|
115
123
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
116
124
|
type: disabled ? 'disabled' : 'primary',
|
|
117
125
|
size: 'medium',
|
|
118
126
|
weight: 'bold'
|
|
119
|
-
},
|
|
127
|
+
}, title), actionAddons && actionAddons.icon.Component ? /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: 'card-select__action-icon ml-8',
|
|
129
|
+
onClick: handleActionClick
|
|
130
|
+
}, /*#__PURE__*/React.createElement(actionAddons.icon.Component, actionAddons.icon)) : null), subtext ? /*#__PURE__*/React.createElement(Text, {
|
|
120
131
|
type: disabled ? 'disabled' : 'secondary',
|
|
121
132
|
className: 'mt-8'
|
|
122
133
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, subtext)) : null), type === CARD_SELECT_TYPES.cardRadio ? /*#__PURE__*/React.createElement(Radio, {
|
|
@@ -126,10 +137,16 @@ var CardSelect = function CardSelect(props) {
|
|
|
126
137
|
className: 'ml-16'
|
|
127
138
|
}) : null), chips.length ? /*#__PURE__*/React.createElement(CardChips, {
|
|
128
139
|
chips: chips
|
|
129
|
-
}) : null, /*#__PURE__*/React.createElement(
|
|
140
|
+
}) : null, inputProps ? Array.isArray(inputProps) ? /*#__PURE__*/React.createElement(React.Fragment, null, inputProps.map(function (input, index) {
|
|
141
|
+
return /*#__PURE__*/React.createElement(CardInput, {
|
|
142
|
+
key: index,
|
|
143
|
+
inputProps: input,
|
|
144
|
+
disabled: disabled
|
|
145
|
+
});
|
|
146
|
+
})) : /*#__PURE__*/React.createElement(CardInput, {
|
|
130
147
|
inputProps: inputProps,
|
|
131
148
|
disabled: disabled
|
|
132
|
-
}), /*#__PURE__*/React.createElement(CardDescription, {
|
|
149
|
+
}) : null, /*#__PURE__*/React.createElement(CardDescription, {
|
|
133
150
|
description: description,
|
|
134
151
|
disabled: disabled
|
|
135
152
|
}), /*#__PURE__*/React.createElement(CardAdditionalInfo, {
|
|
@@ -10,7 +10,7 @@ export interface TCardSelectProps extends IFormCompProps {
|
|
|
10
10
|
subtext?: string;
|
|
11
11
|
description?: string;
|
|
12
12
|
chips?: TChipsProps[];
|
|
13
|
-
inputProps?: InputCustomProps;
|
|
13
|
+
inputProps?: InputCustomProps | InputCustomProps[];
|
|
14
14
|
className?: string;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
handleCardSelectValue?: (isChecked: boolean) => void;
|
|
@@ -25,6 +25,7 @@ export interface TCardSelectProps extends IFormCompProps {
|
|
|
25
25
|
icon?: TSelectIconProps;
|
|
26
26
|
popoverAddons?: TPopoverProps;
|
|
27
27
|
tooltipAddons?: TTooltipProps;
|
|
28
|
+
actionAddons?: TActionAddons;
|
|
28
29
|
}
|
|
29
30
|
export interface TCardSelectGroupProps extends IFormCompProps {
|
|
30
31
|
cards: TCardSelectProps[];
|
|
@@ -34,6 +35,10 @@ export interface TCardSelectGroupProps extends IFormCompProps {
|
|
|
34
35
|
cardsGroupType?: CARD_SELECT_TYPES;
|
|
35
36
|
className?: string;
|
|
36
37
|
}
|
|
38
|
+
export type TActionAddons = {
|
|
39
|
+
icon: TSelectIconProps;
|
|
40
|
+
onClick: () => void;
|
|
41
|
+
};
|
|
37
42
|
export type TInfoList = TInfoListItem[];
|
|
38
43
|
export type TInfoListItem = {
|
|
39
44
|
key: string;
|
|
@@ -193,7 +193,7 @@ var Select = function Select(props) {
|
|
|
193
193
|
};
|
|
194
194
|
var handleOutsideClick = function handleOutsideClick() {
|
|
195
195
|
var selected = getSelectedOption();
|
|
196
|
-
if (!searchValue && selected) {
|
|
196
|
+
if (!searchValue && selected && !isCreateOnOutsideClick) {
|
|
197
197
|
setCurrentSelectedLabel();
|
|
198
198
|
} else if (isCreateOnOutsideClick) {
|
|
199
199
|
setSelectedOption({
|