@redneckz/wildless-cms-uni-blocks 0.9.9 → 0.9.11
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/bin/migration-scripts/0.9.9.js +0 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +30 -24
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
- package/bundle/components/Footer/SocialMedia.d.ts +1 -1
- package/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/dist/components/Filtration/Filtration.js +1 -1
- package/dist/components/Filtration/Filtration.js.map +1 -1
- package/dist/components/Filtration/FiltrationContent.d.ts +18 -8
- package/dist/components/Filtration/FiltrationInner.js +9 -5
- package/dist/components/Filtration/FiltrationInner.js.map +1 -1
- package/dist/components/Filtration/renderFormItem.js +6 -5
- package/dist/components/Filtration/renderFormItem.js.map +1 -1
- package/dist/components/Footer/MediaButton.js +6 -7
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Footer/SocialMedia.d.ts +1 -1
- package/dist/components/Footer/SocialMedia.js +2 -2
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +2 -10
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.fixture.d.ts +2 -0
- package/lib/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/lib/components/Filtration/Filtration.js +1 -1
- package/lib/components/Filtration/Filtration.js.map +1 -1
- package/lib/components/Filtration/FiltrationContent.d.ts +18 -8
- package/lib/components/Filtration/FiltrationInner.js +9 -5
- package/lib/components/Filtration/FiltrationInner.js.map +1 -1
- package/lib/components/Filtration/renderFormItem.js +6 -5
- package/lib/components/Filtration/renderFormItem.js.map +1 -1
- package/lib/components/Footer/MediaButton.js +6 -7
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Footer/SocialMedia.d.ts +1 -1
- package/lib/components/Footer/SocialMedia.js +2 -2
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/bundle/bundle.umd.js +7 -8
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/mobile/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
- package/mobile/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/mobile/dist/components/Filtration/Filtration.js +1 -1
- package/mobile/dist/components/Filtration/Filtration.js.map +1 -1
- package/mobile/dist/components/Filtration/FiltrationContent.d.ts +18 -8
- package/mobile/dist/components/Filtration/FiltrationInner.js +9 -5
- package/mobile/dist/components/Filtration/FiltrationInner.js.map +1 -1
- package/mobile/dist/components/Filtration/renderFormItem.js +6 -5
- package/mobile/dist/components/Filtration/renderFormItem.js.map +1 -1
- package/mobile/dist/components/Footer/MediaButton.js +6 -7
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/mobile/lib/components/Filtration/Filtration.js +1 -1
- package/mobile/lib/components/Filtration/Filtration.js.map +1 -1
- package/mobile/lib/components/Filtration/FiltrationContent.d.ts +18 -8
- package/mobile/lib/components/Filtration/FiltrationInner.js +9 -5
- package/mobile/lib/components/Filtration/FiltrationInner.js.map +1 -1
- package/mobile/lib/components/Filtration/renderFormItem.js +6 -5
- package/mobile/lib/components/Filtration/renderFormItem.js.map +1 -1
- package/mobile/lib/components/Footer/MediaButton.js +6 -7
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +2 -4
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +2 -2
- package/mobile/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +3 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +3 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +5 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +4 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +4 -2
- package/mobile/src/components/ErrorBlock/ErrorBlock.example.json +3 -1
- package/mobile/src/components/Filtration/Filtration.example.json +39 -19
- package/mobile/src/components/Filtration/Filtration.tsx +3 -8
- package/mobile/src/components/Filtration/FiltrationContent.ts +19 -8
- package/mobile/src/components/Filtration/FiltrationInner.tsx +31 -12
- package/mobile/src/components/Filtration/renderFormItem.tsx +20 -20
- package/mobile/src/components/Footer/MediaButton.tsx +7 -10
- package/mobile/src/components/MobileAppTile/MobileAppTile.example.json +3 -1
- package/mobile/src/components/PictureText/PictureText.example.json +3 -1
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +3 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +3 -1
- package/mobile/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
- package/mobile/src/components/Tile/Tile.example.json +3 -1
- package/mobile/src/components/VerticalLayout/VerticalLayoutContent.ts +0 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
- package/src/components/Carousel/Carousel.fixture.tsx +18 -5
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +2 -9
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +2 -4
- package/src/components/CarouselEventCard/CarouselEventCard.tsx +2 -2
- package/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +3 -1
- package/src/components/CarouselProductCard/CarouselProductCard.example.json +3 -1
- package/src/components/CarouselProductCard/CarouselProductCard.fixture.tsx +10 -0
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +5 -1
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +4 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +4 -2
- package/src/components/ErrorBlock/ErrorBlock.example.json +3 -1
- package/src/components/Filtration/Filtration.example.json +39 -19
- package/src/components/Filtration/Filtration.fixture.tsx +36 -20
- package/src/components/Filtration/Filtration.tsx +3 -8
- package/src/components/Filtration/FiltrationContent.ts +19 -8
- package/src/components/Filtration/FiltrationInner.tsx +31 -12
- package/src/components/Filtration/renderFormItem.tsx +20 -20
- package/src/components/Footer/MediaButton.tsx +7 -10
- package/src/components/Footer/SocialMedia.tsx +3 -11
- package/src/components/MobileAppTile/MobileAppTile.example.json +3 -1
- package/src/components/PictureText/PictureText.example.json +3 -1
- package/src/components/ProductBlock/ProductBlock.example.json +3 -1
- package/src/components/ProductTile/ProductTile.example.json +3 -1
- package/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
- package/src/components/Tile/Tile.example.json +3 -1
- package/src/components/VerticalLayout/VerticalLayoutContent.ts +0 -2
package/bundle/bundle.umd.js
CHANGED
|
@@ -929,7 +929,7 @@
|
|
|
929
929
|
partnerComments,
|
|
930
930
|
}));
|
|
931
931
|
};
|
|
932
|
-
return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u0440\u0435\u0434\u0438\u0442\u0430", className: "text-center mb-4" }), renderCreditParameters({ amount, term, handleChange }), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderDataOrganization$2({ fullName, inn, name, phone, mail, annualRevenue, handleChange }), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \
|
|
932
|
+
return (jsxs("form", { onSubmit: onSubmit, className: "container", children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u0440\u0435\u0434\u0438\u0442\u0430", className: "text-center mb-4" }), renderCreditParameters({ amount, term, handleChange }), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "text-center mb-4" }), renderDataOrganization$2({ fullName, inn, name, phone, mail, annualRevenue, handleChange }), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \u0411\u0430\u043D\u043A\u0430", className: "text-center mb-4" }), renderBankOffices({
|
|
933
933
|
regions,
|
|
934
934
|
region: selectedRegion,
|
|
935
935
|
branches,
|
|
@@ -2074,7 +2074,7 @@
|
|
|
2074
2074
|
const CarouselBankHistoryCard = JSX(({ title, description, blocksLength = 0, activeIndex, options }) => {
|
|
2075
2075
|
const orderNumber = Number(options?.key?.split('-').slice(-1)[0]) || 0;
|
|
2076
2076
|
const isActive = orderNumber === activeIndex;
|
|
2077
|
-
return (jsx(BlockWrapper, { className: "flex h-[485px]", children: isActive ? (jsx("div", { className: "relative flex items-center w-full", children: jsx(Headline, { headlineVersion: "
|
|
2077
|
+
return (jsx(BlockWrapper, { className: "flex h-[485px]", children: isActive ? (jsx("div", { className: "relative flex items-center w-full", children: jsx(Headline, { headlineVersion: "M", title: title, description: description, align: "text-left", className: style('absolute z-10 h-[385px] w-[440px] p-8 text-white shadow-dark-blue', getActiveBlockPosition(orderNumber, blocksLength), getBackgroundColor(orderNumber)) }) })) : (jsx("div", { className: "flex w-full items-center justify-center", children: jsx("div", { className: style('flex justify-center items-center h-[300px] w-[340px] font-mohave text-title-large tracking-[-0.03em]', getBackgroundColor(orderNumber)), children: jsx("span", { className: getTextColor(orderNumber), children: title }) }) })) }));
|
|
2078
2078
|
});
|
|
2079
2079
|
const getBackgroundColor = (orderNumber) => {
|
|
2080
2080
|
const division = orderNumber % 3;
|
|
@@ -2139,7 +2139,7 @@
|
|
|
2139
2139
|
});
|
|
2140
2140
|
|
|
2141
2141
|
const CarouselEventCard = JSX(({ className = '', icon, title, description, href, target, ...rest }) => {
|
|
2142
|
-
return (jsx(BlockWrapper, { className: style('w-[365px]', className), ...rest, children: jsxs(LinkWrapper, { className: "flex flex-col", href: href, target: target, children: [icon?.icon ? jsx(ImgInner, { image: getIconWithVersion(icon), asSVG: true }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-2", title: title })) : null, description ? (jsx("div", { className: "mb-4", children: jsx(Text, { font: "font-light", size: "text-
|
|
2142
|
+
return (jsx(BlockWrapper, { className: style('w-[365px]', className), ...rest, children: jsxs(LinkWrapper, { className: "flex flex-col", href: href, target: target, children: [icon?.icon ? jsx(ImgInner, { image: getIconWithVersion(icon), asSVG: true }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left pt-3 mb-2", title: title })) : null, description ? (jsx("div", { className: "mb-4", children: jsx(Text, { font: "font-light", size: "text-m", color: "text-secondary-text", children: description }) })) : null] }) }));
|
|
2143
2143
|
});
|
|
2144
2144
|
|
|
2145
2145
|
const BaseTile = JSX(({ className = '', title = '', buttons, image, children }) => (jsxs("div", { className: `font-sans flex flex-col grow h-full items-start ${className}`, children: [title, jsxs("div", { className: "flex grow w-full justify-between", children: [jsxs("div", { className: "flex flex-col justify-between w-full", children: [jsx("div", { className: "h-full", children: children }), buttons ? jsx("div", { className: "mt-auto pt-8", children: buttons }) : null] }), image] })] })));
|
|
@@ -2204,8 +2204,11 @@
|
|
|
2204
2204
|
};
|
|
2205
2205
|
const List = JSX(({ className = '', hasIndent, isDotted, itemClassName = '', items, listItemSize = 'M' }) => items?.length ? (jsx("section", { className: `text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text ${TEXT_SIZE_MAP[listItemSize]} ${hasIndent ? ITEM_INDENT_MAP[listItemSize] : ''} ${className}`, role: "list", children: items.map((item, i) => (jsx(ListItem, { className: itemClassName, isDotted: isDotted, size: listItemSize, children: item }, String(i)))) })) : null);
|
|
2206
2206
|
|
|
2207
|
-
const CarouselProductCard = JSX(({ additionalDescription, align = 'text-center', button = {}, className = '', description, headlineSmallVersion = 'H6', href, icon, isDotted = true, items = [], target, title, version = 'primary', ...rest }) => {
|
|
2208
|
-
return (jsxs(BlockWrapper, { className: style('h-full flex flex-col justify-between min-w-[260px]', 'box-border border-solid border border-gray', align, className), version: version, ...rest, children: [jsxs(LinkWrapper, { className: "p-6", href: href, target: target, children: [renderImage$3(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$3(description, title), renderItems(items, isDotted, version), renderAdditionalDescription$1(additionalDescription)] }), renderButtonsSection([button], {
|
|
2207
|
+
const CarouselProductCard = JSX(({ additionalDescription, align = 'text-center', button = {}, className = '', description, headlineSmallVersion = 'H6', href, icon, isDotted = true, isFullWidth = true, items = [], target, title, version = 'primary', ...rest }) => {
|
|
2208
|
+
return (jsxs(BlockWrapper, { className: style('h-full flex flex-col justify-between min-w-[260px]', 'box-border border-solid border border-gray', align, className), version: version, ...rest, children: [jsxs(LinkWrapper, { className: "p-6", href: href, target: target, children: [renderImage$3(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$3(description, title), renderItems(items, isDotted, version), renderAdditionalDescription$1(additionalDescription)] }), renderButtonsSection([button], {
|
|
2209
|
+
className: style('p-6 pt-0', isFullWidth ? '' : 'justify-center'),
|
|
2210
|
+
isVertical: isFullWidth ? true : false,
|
|
2211
|
+
})] }));
|
|
2209
2212
|
});
|
|
2210
2213
|
const renderImage$3 = (image) => (jsxs("div", { className: "flex justify-center", children: [image?.src ? jsx(ImgInner, { className: "mb-5", image: image }) : null, image?.icon ? (jsx(ImgInner, { className: `w-[32px] h-[32px] min-w-[32px] mb-5 rounded-full`, image: image, asSVG: true })) : null] }));
|
|
2211
2214
|
const renderCardTitle = (headlineSmallVersion, title) => title ? (jsx("div", { children: jsx(Text, { size: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) })) : null;
|
|
@@ -2257,17 +2260,16 @@
|
|
|
2257
2260
|
const buttonStylesWithText = (text, buttonSize) => text
|
|
2258
2261
|
? ''
|
|
2259
2262
|
: `group/media flex items-center justify-center box-border ${buttonSizeStyles[buttonSize]}`;
|
|
2260
|
-
const MediaButton = JSX(({
|
|
2261
|
-
const { href, version, text
|
|
2263
|
+
const MediaButton = JSX(({ buttonSize = 'default', rounded = false, icon, ...rest }) => {
|
|
2264
|
+
const { href, version, text = '' } = rest;
|
|
2262
2265
|
const { iconMapped, label } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
2263
|
-
const iconCustom = icon ?? iconMapped;
|
|
2264
|
-
const iconWithVersion = iconCustom
|
|
2265
|
-
|
|
2266
|
-
: undefined;
|
|
2267
|
-
return (jsx(Button, { className: style(rounded ? 'rounded-full' : 'rounded-md', 'border border-solid hover:border-transparent', 'group-data-primary:border-main-divider', 'hover:bg-primary-main hover:text-black', 'group-data-secondary:bg-white border-main-divider group-data-secondary:hover:bg-secondary-hover', 'group-data-gray:border-green', buttonStylesWithText(text, buttonSize)), aboveText: aboveText, appendLeft: appendLeft, appendRight: appendRight, "aria-label": label, rel: "noopener noreferrer", target: "_blank", text: text, version: version, ...rest, children: iconWithVersion && !text ? (jsx(ImgInner, { image: iconWithVersion, imageClassName: "group-hover/media:text-white", width: "24", height: "24", asSVG: true })) : null }));
|
|
2266
|
+
const iconCustom = getFilteredIcon(icon) ?? iconMapped;
|
|
2267
|
+
const iconWithVersion = iconCustom ? getIconWithVersion(iconCustom) : undefined;
|
|
2268
|
+
return (jsx(Button, { className: style(rounded ? 'rounded-full' : 'rounded-md', 'border border-solid hover:border-transparent', 'group-data-primary:border-main-divider', 'hover:bg-primary-main hover:text-black', 'group-data-secondary:bg-white border-main-divider group-data-secondary:hover:bg-secondary-hover', 'group-data-gray:border-green', buttonStylesWithText(text, buttonSize)), "aria-label": label, rel: "noopener noreferrer", target: "_blank", text: text, version: version, ...rest, children: iconWithVersion && !text ? (jsx(ImgInner, { image: iconWithVersion, imageClassName: "group-hover/media:text-white", width: "24", height: "24", asSVG: true })) : null }));
|
|
2268
2269
|
});
|
|
2270
|
+
const getFilteredIcon = (icon) => (icon?.src || icon?.icon ? icon : undefined);
|
|
2269
2271
|
|
|
2270
|
-
const SocialMedia = JSX(({ className = '', media, children, buttonSize }) => (jsxs("div", { className: "font-sans", children: [jsx("div", { className: `flex gap-1 ${className}`, children: media?.map((_, index) => (jsx(MediaButton, {
|
|
2272
|
+
const SocialMedia = JSX(({ className = '', media, children, buttonSize }) => (jsxs("div", { className: "font-sans", children: [jsx("div", { className: `flex gap-1 ${className}`, children: media?.map((_, index) => (jsx(MediaButton, { buttonSize: buttonSize, ..._ }, String(index)))) }), jsx(Text, { size: "text-s-light", color: "text-secondary-text", children: children })] })));
|
|
2271
2273
|
|
|
2272
2274
|
const BORDER_STYLE = 'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider';
|
|
2273
2275
|
const CarouselRecommendationCard = JSX(({ className = '', description, href, icon, items = [], socialMedia = [], target, title, align = 'text-left', version = 'primary', ...rest }) => {
|
|
@@ -2610,15 +2612,18 @@
|
|
|
2610
2612
|
|
|
2611
2613
|
const ICONS = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
2612
2614
|
const resultsGridStyle = 'grid grid-cols-12 gap-1 border-box';
|
|
2613
|
-
const FiltrationInner = JSX(({ label = '', filtrationState = {}, topItemsCount = 0, block, ...rest }) => {
|
|
2615
|
+
const FiltrationInner = JSX(({ label = '', filtrationState = {}, topItemsCount = 0, block, notFound, ...rest }) => {
|
|
2614
2616
|
const blocksToRender = block?.blocks?.filter((b) => checkShouldRenderBlock(filtrationState, b.content || {})) || [];
|
|
2615
2617
|
const [visibleBlocks, hiddenBlocks] = topItemsCount > 0
|
|
2616
2618
|
? [blocksToRender.slice(0, topItemsCount), blocksToRender.slice(topItemsCount)]
|
|
2617
2619
|
: [blocksToRender, []];
|
|
2618
|
-
return (jsxs("div", { children: [jsx("div", { className: style(blocksToRender.length ? 'hidden' : ''), children:
|
|
2619
|
-
return (jsx(FoldableSection, { className: resultsGridStyle, isUnfolded: isUnfolded, children: renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }) }));
|
|
2620
|
-
}, renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { className: style(
|
|
2620
|
+
return (jsxs("div", { children: [jsx("div", { className: style(blocksToRender.length ? 'hidden' : 'block'), children: notFound ? renderNotFound(notFound) : null }), jsxs("div", { className: style(blocksToRender.length ? '' : 'hidden'), children: [jsx("div", { className: style('mb-1', resultsGridStyle), children: renderBlocksList(visibleBlocks, { ...rest.options, parent: block }) }), jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => {
|
|
2621
|
+
return (jsx(FoldableSection, { className: style(resultsGridStyle, isUnfolded ? 'mb-1' : ''), isUnfolded: isUnfolded, children: renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }) }));
|
|
2622
|
+
}, renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { className: style(topItemsCount < 1 ? 'hidden' : ''), disabled: !hiddenBlocks?.length, label: label, icon: ICONS[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
|
|
2621
2623
|
});
|
|
2624
|
+
function renderNotFound({ title, description }) {
|
|
2625
|
+
return (jsxs("div", { className: "bg-white py-20", children: [title ? (jsx("div", { className: "mb-2", children: jsx(Paragraph, { align: "text-center", children: jsx(Text, { size: "text-h4", children: title }) }) })) : null, description ? (jsx(Paragraph, { size: "text-xl", font: "font-light", align: "text-center", children: description })) : null] }));
|
|
2626
|
+
}
|
|
2622
2627
|
|
|
2623
2628
|
const SlideCheckboxGroup = JSX(({ value, onChange, items = [], multiple }) => {
|
|
2624
2629
|
const handleChange = (newValue) => {
|
|
@@ -2638,20 +2643,21 @@
|
|
|
2638
2643
|
const item = filtrationSchema[key];
|
|
2639
2644
|
const type = item?.type;
|
|
2640
2645
|
switch (type) {
|
|
2641
|
-
case '
|
|
2642
|
-
return
|
|
2646
|
+
case 'array':
|
|
2647
|
+
return renderCheckboxes(key, register)(item);
|
|
2643
2648
|
default:
|
|
2644
2649
|
return null;
|
|
2645
2650
|
}
|
|
2646
2651
|
};
|
|
2647
|
-
const
|
|
2648
|
-
const options = item?.enum?.map((e, i) => ({ value: e, title: item?.enumNames?.[i] || '' })) ||
|
|
2649
|
-
|
|
2652
|
+
const renderCheckboxes = (key, register) => (item) => {
|
|
2653
|
+
const options = item?.items?.enum?.map((e, i) => ({ value: e, title: item?.items?.enumNames?.[i] || '' })) ||
|
|
2654
|
+
[];
|
|
2655
|
+
return (jsxs("div", { children: [item?.title ? (jsx("div", { className: "mb-4", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: item.title }) })) : null, jsx(SlideCheckboxGroup, { items: options, multiple: true, ...register(key) })] }, key));
|
|
2650
2656
|
};
|
|
2651
2657
|
|
|
2652
2658
|
const Filtration = JSX(({ className, filtrationSchema = {}, resetButton, ...rest }) => {
|
|
2653
2659
|
const { formState, register, resetForm } = useForm();
|
|
2654
|
-
return (jsxs(BlockWrapper, { className: style(
|
|
2660
|
+
return (jsxs(BlockWrapper, { className: style(className), version: "transparent", ...rest, children: [jsxs("form", { className: "flex justify-between bg-white p-9 mb-1", children: [jsx("div", { className: "flex gap-11", children: Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, register)) }), resetButton ? (jsx("div", { children: jsx(Button, { className: "w-72", onClick: resetForm, ...resetButton }) })) : null] }), jsx(FiltrationInner, { filtrationState: formState, ...rest })] }));
|
|
2655
2661
|
});
|
|
2656
2662
|
Filtration.childrenTypes = ['ProductTile'];
|
|
2657
2663
|
Filtration.childSchema = (content) => content?.filtrationSchema || {};
|
|
@@ -4883,7 +4889,7 @@
|
|
|
4883
4889
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
4884
4890
|
}
|
|
4885
4891
|
|
|
4886
|
-
const packageVersion = "0.9.
|
|
4892
|
+
const packageVersion = "0.9.11";
|
|
4887
4893
|
|
|
4888
4894
|
exports.Blocks = Blocks;
|
|
4889
4895
|
exports.ContentPage = ContentPage;
|