@trafilea/afrodita-components 6.10.0 → 6.11.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/build/index.d.ts +2 -0
- package/build/index.esm.js +6 -6
- package/build/index.js +6 -6
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -2290,6 +2290,7 @@ declare type DropdownOption<T> = {
|
|
|
2290
2290
|
label: string;
|
|
2291
2291
|
value: T;
|
|
2292
2292
|
disabled: boolean;
|
|
2293
|
+
imageURL?: string;
|
|
2293
2294
|
};
|
|
2294
2295
|
declare type SizeOption = {
|
|
2295
2296
|
label: string;
|
|
@@ -2525,6 +2526,7 @@ declare type CommonProps<T> = {
|
|
|
2525
2526
|
testId?: string;
|
|
2526
2527
|
required?: string;
|
|
2527
2528
|
showRequiredPlaceholder?: boolean;
|
|
2529
|
+
imageURL?: string;
|
|
2528
2530
|
};
|
|
2529
2531
|
declare type ControlledProps<T> = {
|
|
2530
2532
|
value: Value<T>;
|
package/build/index.esm.js
CHANGED
|
@@ -4718,7 +4718,7 @@ var BaseDropdownButton = function (_a) {
|
|
|
4718
4718
|
alignItems: 'flex-start',
|
|
4719
4719
|
whiteSpace: 'nowrap',
|
|
4720
4720
|
overflowX: 'hidden',
|
|
4721
|
-
} }, { children: [jsx("div", __assign$1({ css: { fontSize: '0.75rem', fontWeight: 400, margin: '0.125rem 0' } }, { children: label }), void 0), children] }), void 0)) : (children), jsxs(StyledIcon$1, __assign$1({ open: open }, { children: [jsx(CloseIcon, { testId: "CloseIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0), jsx(OpenIcon, { testId: "OpenIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0)] }), void 0)] }), void 0));
|
|
4721
|
+
} }, { children: [jsx("div", __assign$1({ css: { fontSize: '0.75rem', fontWeight: 400, margin: '0.125rem 0' } }, { children: label }), void 0), children] }), void 0)) : (jsx(Fragment, { children: children }, void 0)), jsxs(StyledIcon$1, __assign$1({ open: open }, { children: [jsx(CloseIcon, { testId: "CloseIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0), jsx(OpenIcon, { testId: "OpenIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0)] }), void 0)] }), void 0));
|
|
4722
4722
|
} }), void 0));
|
|
4723
4723
|
};
|
|
4724
4724
|
var BaseDropdownButton$1 = React__default.memo(BaseDropdownButton);
|
|
@@ -4919,12 +4919,12 @@ var Checkbox = function (_a) {
|
|
|
4919
4919
|
var templateObject_1$1L, templateObject_2$1b;
|
|
4920
4920
|
|
|
4921
4921
|
var CustomOption = newStyled.li(function (_a) {
|
|
4922
|
-
var theme = _a.theme, selected = _a.selected, active = _a.active;
|
|
4922
|
+
var theme = _a.theme, selected = _a.selected, active = _a.active, hasImage = _a.hasImage;
|
|
4923
4923
|
return ({
|
|
4924
4924
|
listStyleType: 'none',
|
|
4925
4925
|
display: 'flex',
|
|
4926
4926
|
flexDirection: 'row',
|
|
4927
|
-
alignItems: 'flex-start',
|
|
4927
|
+
alignItems: hasImage ? 'center' : 'flex-start',
|
|
4928
4928
|
margin: 0,
|
|
4929
4929
|
cursor: 'pointer',
|
|
4930
4930
|
padding: theme.component.dropdown.optionPadding,
|
|
@@ -4939,11 +4939,11 @@ var CustomOption = newStyled.li(function (_a) {
|
|
|
4939
4939
|
});
|
|
4940
4940
|
});
|
|
4941
4941
|
function BaseDropdownOption(_a) {
|
|
4942
|
-
var value = _a.value, disabled = _a.disabled, children = _a.children, _b = _a.hasCheckbox, hasCheckbox = _b === void 0 ? false : _b, isSelected = _a.isSelected;
|
|
4942
|
+
var value = _a.value, disabled = _a.disabled, children = _a.children, _b = _a.hasCheckbox, hasCheckbox = _b === void 0 ? false : _b, isSelected = _a.isSelected, _c = _a.hasImage, hasImage = _c === void 0 ? false : _c;
|
|
4943
4943
|
var theme = useTheme();
|
|
4944
4944
|
return (jsx$1(BaseSelect$1.Option, __assign$1({ value: value, disabled: disabled, as: Fragment$1 }, { children: function (_a) {
|
|
4945
4945
|
var selected = _a.selected, active = _a.active;
|
|
4946
|
-
return (jsxs$1(CustomOption, __assign$1({ theme: theme, selected: isSelected || selected, active: active }, { children: [hasCheckbox && (jsx$1(Checkbox, { checked: isSelected || selected, text: "", id: value.key, onChange: console.log, size: ComponentSize.Small, variant: "primary" }, void 0)), children] }), void 0));
|
|
4946
|
+
return (jsxs$1(CustomOption, __assign$1({ theme: theme, selected: isSelected || selected, active: active, hasImage: hasImage }, { children: [hasCheckbox && (jsx$1(Checkbox, { checked: isSelected || selected, text: "", id: value.key, onChange: console.log, size: ComponentSize.Small, variant: "primary" }, void 0)), children] }), void 0));
|
|
4947
4947
|
} }), void 0));
|
|
4948
4948
|
}
|
|
4949
4949
|
|
|
@@ -4996,7 +4996,7 @@ function SimpleDropdown(_a) {
|
|
|
4996
4996
|
setSelectedValue(value);
|
|
4997
4997
|
}, [value, options, initialValue]);
|
|
4998
4998
|
var DropdownContainer = showRequiredPlaceholder ? Container$16 : Fragment$1;
|
|
4999
|
-
return (jsxs$1(DropdownContainer, { children: [jsxs$1(BaseDropdown$1, __assign$1({ value: selectedValue, onChange: onChangeHandler, disabled: disabled, wide: wide }, { children: [
|
|
4999
|
+
return (jsxs$1(DropdownContainer, { children: [jsxs$1(BaseDropdown$1, __assign$1({ value: selectedValue, onChange: onChangeHandler, disabled: disabled, wide: wide }, { children: [jsxs$1(BaseDropdown$1.Button, __assign$1({ label: label, OpenIcon: Icon.Arrows.ChevronDown, CloseIcon: Icon.Arrows.ChevronUp, wide: wide, isSortOrFilter: sort, testId: testId }, { children: [!!(selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.imageURL) && (jsx$1("img", { src: selectedValue.imageURL, alt: selectedValue.label, style: { paddingRight: 8 } }, void 0)), selectedOptionLabel] }), void 0), jsx$1(BaseDropdown$1.Options, { children: options.map(function (item) { return (jsxs$1(BaseDropdown$1.Option, __assign$1({ value: item, disabled: item.disabled, hasImage: !!item.imageURL }, { children: [!!item.imageURL && (jsx$1("img", { src: item.imageURL, alt: item.label, style: { paddingRight: 8 } }, void 0)), item.label] }), item.key)); }) }, void 0)] }), void 0), !!required && jsx$1(Error$1, { error: required }, void 0)] }, void 0));
|
|
5000
5000
|
}
|
|
5001
5001
|
var templateObject_1$1K, templateObject_2$1a;
|
|
5002
5002
|
|
package/build/index.js
CHANGED
|
@@ -4744,7 +4744,7 @@ var BaseDropdownButton = function (_a) {
|
|
|
4744
4744
|
alignItems: 'flex-start',
|
|
4745
4745
|
whiteSpace: 'nowrap',
|
|
4746
4746
|
overflowX: 'hidden',
|
|
4747
|
-
} }, { children: [jsx("div", __assign$1({ css: { fontSize: '0.75rem', fontWeight: 400, margin: '0.125rem 0' } }, { children: label }), void 0), children] }), void 0)) : (children), jsxs(StyledIcon$1, __assign$1({ open: open }, { children: [jsx(CloseIcon, { testId: "CloseIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0), jsx(OpenIcon, { testId: "OpenIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0)] }), void 0)] }), void 0));
|
|
4747
|
+
} }, { children: [jsx("div", __assign$1({ css: { fontSize: '0.75rem', fontWeight: 400, margin: '0.125rem 0' } }, { children: label }), void 0), children] }), void 0)) : (jsx(Fragment, { children: children }, void 0)), jsxs(StyledIcon$1, __assign$1({ open: open }, { children: [jsx(CloseIcon, { testId: "CloseIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0), jsx(OpenIcon, { testId: "OpenIcon", height: 0.875, width: 0.875, fill: "inherit" }, void 0)] }), void 0)] }), void 0));
|
|
4748
4748
|
} }), void 0));
|
|
4749
4749
|
};
|
|
4750
4750
|
var BaseDropdownButton$1 = React__default["default"].memo(BaseDropdownButton);
|
|
@@ -4945,12 +4945,12 @@ var Checkbox = function (_a) {
|
|
|
4945
4945
|
var templateObject_1$1L, templateObject_2$1b;
|
|
4946
4946
|
|
|
4947
4947
|
var CustomOption = newStyled.li(function (_a) {
|
|
4948
|
-
var theme = _a.theme, selected = _a.selected, active = _a.active;
|
|
4948
|
+
var theme = _a.theme, selected = _a.selected, active = _a.active, hasImage = _a.hasImage;
|
|
4949
4949
|
return ({
|
|
4950
4950
|
listStyleType: 'none',
|
|
4951
4951
|
display: 'flex',
|
|
4952
4952
|
flexDirection: 'row',
|
|
4953
|
-
alignItems: 'flex-start',
|
|
4953
|
+
alignItems: hasImage ? 'center' : 'flex-start',
|
|
4954
4954
|
margin: 0,
|
|
4955
4955
|
cursor: 'pointer',
|
|
4956
4956
|
padding: theme.component.dropdown.optionPadding,
|
|
@@ -4965,11 +4965,11 @@ var CustomOption = newStyled.li(function (_a) {
|
|
|
4965
4965
|
});
|
|
4966
4966
|
});
|
|
4967
4967
|
function BaseDropdownOption(_a) {
|
|
4968
|
-
var value = _a.value, disabled = _a.disabled, children = _a.children, _b = _a.hasCheckbox, hasCheckbox = _b === void 0 ? false : _b, isSelected = _a.isSelected;
|
|
4968
|
+
var value = _a.value, disabled = _a.disabled, children = _a.children, _b = _a.hasCheckbox, hasCheckbox = _b === void 0 ? false : _b, isSelected = _a.isSelected, _c = _a.hasImage, hasImage = _c === void 0 ? false : _c;
|
|
4969
4969
|
var theme = useTheme();
|
|
4970
4970
|
return (jsxRuntime.jsx(BaseSelect$1.Option, __assign$1({ value: value, disabled: disabled, as: React$2.Fragment }, { children: function (_a) {
|
|
4971
4971
|
var selected = _a.selected, active = _a.active;
|
|
4972
|
-
return (jsxRuntime.jsxs(CustomOption, __assign$1({ theme: theme, selected: isSelected || selected, active: active }, { children: [hasCheckbox && (jsxRuntime.jsx(Checkbox, { checked: isSelected || selected, text: "", id: value.key, onChange: console.log, size: exports.ComponentSize.Small, variant: "primary" }, void 0)), children] }), void 0));
|
|
4972
|
+
return (jsxRuntime.jsxs(CustomOption, __assign$1({ theme: theme, selected: isSelected || selected, active: active, hasImage: hasImage }, { children: [hasCheckbox && (jsxRuntime.jsx(Checkbox, { checked: isSelected || selected, text: "", id: value.key, onChange: console.log, size: exports.ComponentSize.Small, variant: "primary" }, void 0)), children] }), void 0));
|
|
4973
4973
|
} }), void 0));
|
|
4974
4974
|
}
|
|
4975
4975
|
|
|
@@ -5022,7 +5022,7 @@ function SimpleDropdown(_a) {
|
|
|
5022
5022
|
setSelectedValue(value);
|
|
5023
5023
|
}, [value, options, initialValue]);
|
|
5024
5024
|
var DropdownContainer = showRequiredPlaceholder ? Container$16 : React$2.Fragment;
|
|
5025
|
-
return (jsxRuntime.jsxs(DropdownContainer, { children: [jsxRuntime.jsxs(BaseDropdown$1, __assign$1({ value: selectedValue, onChange: onChangeHandler, disabled: disabled, wide: wide }, { children: [jsxRuntime.
|
|
5025
|
+
return (jsxRuntime.jsxs(DropdownContainer, { children: [jsxRuntime.jsxs(BaseDropdown$1, __assign$1({ value: selectedValue, onChange: onChangeHandler, disabled: disabled, wide: wide }, { children: [jsxRuntime.jsxs(BaseDropdown$1.Button, __assign$1({ label: label, OpenIcon: Icon.Arrows.ChevronDown, CloseIcon: Icon.Arrows.ChevronUp, wide: wide, isSortOrFilter: sort, testId: testId }, { children: [!!(selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.imageURL) && (jsxRuntime.jsx("img", { src: selectedValue.imageURL, alt: selectedValue.label, style: { paddingRight: 8 } }, void 0)), selectedOptionLabel] }), void 0), jsxRuntime.jsx(BaseDropdown$1.Options, { children: options.map(function (item) { return (jsxRuntime.jsxs(BaseDropdown$1.Option, __assign$1({ value: item, disabled: item.disabled, hasImage: !!item.imageURL }, { children: [!!item.imageURL && (jsxRuntime.jsx("img", { src: item.imageURL, alt: item.label, style: { paddingRight: 8 } }, void 0)), item.label] }), item.key)); }) }, void 0)] }), void 0), !!required && jsxRuntime.jsx(Error$1, { error: required }, void 0)] }, void 0));
|
|
5026
5026
|
}
|
|
5027
5027
|
var templateObject_1$1K, templateObject_2$1a;
|
|
5028
5028
|
|
package/package.json
CHANGED