@redneckz/wildless-cms-uni-blocks 0.9.10 → 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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +15 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
- 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/lib/common.css +1 -1
- 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/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
- 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/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/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/RichTextBlock/RichTextBlock.example.json +1 -1
- package/package.json +1 -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/RichTextBlock/RichTextBlock.example.json +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -2612,15 +2612,18 @@
|
|
|
2612
2612
|
|
|
2613
2613
|
const ICONS = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
2614
2614
|
const resultsGridStyle = 'grid grid-cols-12 gap-1 border-box';
|
|
2615
|
-
const FiltrationInner = JSX(({ label = '', filtrationState = {}, topItemsCount = 0, block, ...rest }) => {
|
|
2615
|
+
const FiltrationInner = JSX(({ label = '', filtrationState = {}, topItemsCount = 0, block, notFound, ...rest }) => {
|
|
2616
2616
|
const blocksToRender = block?.blocks?.filter((b) => checkShouldRenderBlock(filtrationState, b.content || {})) || [];
|
|
2617
2617
|
const [visibleBlocks, hiddenBlocks] = topItemsCount > 0
|
|
2618
2618
|
? [blocksToRender.slice(0, topItemsCount), blocksToRender.slice(topItemsCount)]
|
|
2619
2619
|
: [blocksToRender, []];
|
|
2620
|
-
return (jsxs("div", { children: [jsx("div", { className: style(blocksToRender.length ? 'hidden' : ''), children:
|
|
2621
|
-
return (jsx(FoldableSection, { className: resultsGridStyle, isUnfolded: isUnfolded, children: renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }) }));
|
|
2622
|
-
}, 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 })) })] })] }));
|
|
2623
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
|
+
}
|
|
2624
2627
|
|
|
2625
2628
|
const SlideCheckboxGroup = JSX(({ value, onChange, items = [], multiple }) => {
|
|
2626
2629
|
const handleChange = (newValue) => {
|
|
@@ -2640,20 +2643,21 @@
|
|
|
2640
2643
|
const item = filtrationSchema[key];
|
|
2641
2644
|
const type = item?.type;
|
|
2642
2645
|
switch (type) {
|
|
2643
|
-
case '
|
|
2644
|
-
return
|
|
2646
|
+
case 'array':
|
|
2647
|
+
return renderCheckboxes(key, register)(item);
|
|
2645
2648
|
default:
|
|
2646
2649
|
return null;
|
|
2647
2650
|
}
|
|
2648
2651
|
};
|
|
2649
|
-
const
|
|
2650
|
-
const options = item?.enum?.map((e, i) => ({ value: e, title: item?.enumNames?.[i] || '' })) ||
|
|
2651
|
-
|
|
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));
|
|
2652
2656
|
};
|
|
2653
2657
|
|
|
2654
2658
|
const Filtration = JSX(({ className, filtrationSchema = {}, resetButton, ...rest }) => {
|
|
2655
2659
|
const { formState, register, resetForm } = useForm();
|
|
2656
|
-
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 })] }));
|
|
2657
2661
|
});
|
|
2658
2662
|
Filtration.childrenTypes = ['ProductTile'];
|
|
2659
2663
|
Filtration.childSchema = (content) => content?.filtrationSchema || {};
|
|
@@ -4885,7 +4889,7 @@
|
|
|
4885
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" }) }));
|
|
4886
4890
|
}
|
|
4887
4891
|
|
|
4888
|
-
const packageVersion = "0.9.
|
|
4892
|
+
const packageVersion = "0.9.11";
|
|
4889
4893
|
|
|
4890
4894
|
exports.Blocks = Blocks;
|
|
4891
4895
|
exports.ContentPage = ContentPage;
|