@trafilea/afrodita-components 5.0.0-beta.97 → 5.0.0-beta.99
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 +3 -2
- package/build/index.esm.js +8 -11
- package/build/index.esm.js.map +1 -1
- package/build/index.js +8 -11
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ declare type Filter = {
|
|
|
107
107
|
checked?: boolean;
|
|
108
108
|
isLinkItem?: boolean;
|
|
109
109
|
link?: string;
|
|
110
|
-
|
|
110
|
+
blockUncheck?: boolean;
|
|
111
111
|
}>;
|
|
112
112
|
};
|
|
113
113
|
declare type FilterChange = {
|
|
@@ -1548,11 +1548,12 @@ interface CheckboxProps {
|
|
|
1548
1548
|
size?: ComponentSize.Large | ComponentSize.Medium | ComponentSize.Small;
|
|
1549
1549
|
text: string;
|
|
1550
1550
|
checked?: boolean;
|
|
1551
|
+
blockUncheck?: boolean;
|
|
1551
1552
|
id: string;
|
|
1552
1553
|
backgroundColor?: string;
|
|
1553
1554
|
variant: 'primary' | 'secondary';
|
|
1554
1555
|
}
|
|
1555
|
-
declare const Checkbox: ({ disabled, onChange, size, text, checked, id, variant, }: CheckboxProps) => JSX.Element;
|
|
1556
|
+
declare const Checkbox: ({ disabled, onChange, size, text, checked, id, variant, blockUncheck, }: CheckboxProps) => JSX.Element;
|
|
1556
1557
|
|
|
1557
1558
|
interface RadioGroupInputProps {
|
|
1558
1559
|
name: string;
|
package/build/index.esm.js
CHANGED
|
@@ -4568,16 +4568,16 @@ var Input$3 = newStyled.input(templateObject_2$O || (templateObject_2$O = __make
|
|
|
4568
4568
|
return (disabled ? 'not-allowed' : 'pointer');
|
|
4569
4569
|
});
|
|
4570
4570
|
var Checkbox = function (_a) {
|
|
4571
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, text = _a.text, _d = _a.checked, checked = _d === void 0 ? false : _d, id = _a.id, variant = _a.variant;
|
|
4571
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, text = _a.text, _d = _a.checked, checked = _d === void 0 ? false : _d, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck;
|
|
4572
4572
|
var theme = useTheme();
|
|
4573
4573
|
var _e = useState(checked), isChecked = _e[0], setIsChecked = _e[1];
|
|
4574
4574
|
var mounted = useRef(false);
|
|
4575
4575
|
var handleChange = useCallback(function () {
|
|
4576
|
-
if (disabled) {
|
|
4576
|
+
if (disabled || (isChecked && blockUncheck)) {
|
|
4577
4577
|
return;
|
|
4578
4578
|
}
|
|
4579
4579
|
setIsChecked(function (checked) { return !checked; });
|
|
4580
|
-
}, [disabled]);
|
|
4580
|
+
}, [blockUncheck, disabled, isChecked]);
|
|
4581
4581
|
useEffect(function () {
|
|
4582
4582
|
if (disabled || !mounted.current) {
|
|
4583
4583
|
return;
|
|
@@ -12928,7 +12928,7 @@ var SearchControl = function (_a) {
|
|
|
12928
12928
|
var theme = useTheme();
|
|
12929
12929
|
var isMobile = useWindowDimensions(theme.mediaQueries).isMobile;
|
|
12930
12930
|
if (showSearchIcon) {
|
|
12931
|
-
return (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
|
|
12931
|
+
return (jsx(SearchIconContainer, __assign$1({ onClick: onSearch }, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }), void 0));
|
|
12932
12932
|
}
|
|
12933
12933
|
else if (isMobile) {
|
|
12934
12934
|
return open ? (jsx(ClearButton, { onClick: onClose }, void 0)) : (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
|
|
@@ -17465,9 +17465,6 @@ var Filters = function (_a) {
|
|
|
17465
17465
|
if (checked) {
|
|
17466
17466
|
window.location.assign(currentFilterItem.link);
|
|
17467
17467
|
}
|
|
17468
|
-
else if (currentFilterItem === null || currentFilterItem === void 0 ? void 0 : currentFilterItem.uncheckedLink) {
|
|
17469
|
-
window.location.assign(currentFilterItem.uncheckedLink);
|
|
17470
|
-
}
|
|
17471
17468
|
return;
|
|
17472
17469
|
}
|
|
17473
17470
|
setCheckedItems(function (prev) {
|
|
@@ -17516,14 +17513,14 @@ var Filters = function (_a) {
|
|
|
17516
17513
|
.filter(function (filter) { return filter.isLinkOption; })
|
|
17517
17514
|
.map(function (option, index) { return (jsx$1(OptionContainer, { children: jsx$1(FilterLink, __assign$1({ color: option.color || theme.colors.shades['550'].color, href: option.link }, { children: option.title }), void 0) }, index)); }), filters
|
|
17518
17515
|
.filter(function (filter) { return !filter.isLinkOption; })
|
|
17519
|
-
.map(function (filter) { return (jsx$1(Accordion, __assign$1({ title: filter.title, isOpenByDefault: filter.isOpenByDefault }, { children: jsx$1(SectionContent, __assign$1({ cols: filter.columns }, { children: filter.items.map(function (item, itemIndex) { return (jsx$1(FilterCheckbox, { onChange: handleCheckboxClick, text: item.label === '$75 And Above' ? '+$75' : item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }) }, "".concat(item.checked, "-").concat(item.label))); }) }), void 0) }), filters.findIndex(function (filt) { return filt.title === filter.title; }))); }), isMobile && (jsxs$1(MobileFooter, __assign$1({ "data-testid": "MobileFooter" }, { children: [jsxs$1(MobileClearContainer, __assign$1({ onClick: handleClearAllClick }, { children: [jsx$1(MobileIconsContainer, { children: jsx$1(Icon.Actions.Trash, { fill: theme.colors.shades['700'].color }, void 0) }, void 0), jsx$1(ClearAll, __assign$1({ color: theme.colors.shades['700'].color }, { children: clearAllText }), void 0)] }), void 0), jsx$1(ButtonSecondary, { text: applyText, onClick: mobileApplyButtonClick }, void 0)] }), void 0))] }, void 0));
|
|
17516
|
+
.map(function (filter) { return (jsx$1(Accordion, __assign$1({ title: filter.title, isOpenByDefault: filter.isOpenByDefault }, { children: jsx$1(SectionContent, __assign$1({ cols: filter.columns }, { children: filter.items.map(function (item, itemIndex) { return (jsx$1(FilterCheckbox, { onChange: handleCheckboxClick, text: item.label === '$75 And Above' ? '+$75' : item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }), blockUncheck: item.blockUncheck }, "".concat(item.checked, "-").concat(item.label))); }) }), void 0) }), filters.findIndex(function (filt) { return filt.title === filter.title; }))); }), isMobile && (jsxs$1(MobileFooter, __assign$1({ "data-testid": "MobileFooter" }, { children: [jsxs$1(MobileClearContainer, __assign$1({ onClick: handleClearAllClick }, { children: [jsx$1(MobileIconsContainer, { children: jsx$1(Icon.Actions.Trash, { fill: theme.colors.shades['700'].color }, void 0) }, void 0), jsx$1(ClearAll, __assign$1({ color: theme.colors.shades['700'].color }, { children: clearAllText }), void 0)] }), void 0), jsx$1(ButtonSecondary, { text: applyText, onClick: mobileApplyButtonClick }, void 0)] }), void 0))] }, void 0));
|
|
17520
17517
|
};
|
|
17521
17518
|
var FilterCheckbox = function (_a) {
|
|
17522
|
-
var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked;
|
|
17519
|
+
var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked, blockUncheck = _a.blockUncheck;
|
|
17523
17520
|
var onChange = useCallback(function (checked) {
|
|
17524
17521
|
onChangeProp({ sectionIndex: sectionIndex, itemIndex: itemIndex, checked: checked });
|
|
17525
|
-
}, [sectionIndex, itemIndex
|
|
17526
|
-
return (jsx$1(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: ComponentSize.Small, variant: "secondary" }, itemIndex));
|
|
17522
|
+
}, [onChangeProp, sectionIndex, itemIndex]);
|
|
17523
|
+
return (jsx$1(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: ComponentSize.Small, variant: "secondary", blockUncheck: blockUncheck }, itemIndex));
|
|
17527
17524
|
};
|
|
17528
17525
|
|
|
17529
17526
|
var Container$7 = newStyled.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n padding: 0 1rem 1rem;\n"], ["\n display: flex;\n flex-wrap: wrap;\n padding: 0 1rem 1rem;\n"])));
|