@redneckz/wildless-cms-uni-blocks 0.14.294 → 0.14.295
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.14.257.js +21 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +100 -68
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Tabs/TabsContent.d.ts +1 -1
- package/bundle/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/bundle/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/bundle/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/bundle/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/bundle/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/dist/components/Tabs/TabsContent.d.ts +1 -1
- package/dist/components/Tabs/renderTabs.js +0 -2
- package/dist/components/Tabs/renderTabs.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayout.js +39 -16
- package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/dist/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/dist/components/TabsLayout/renderTabsLayout.js +19 -0
- package/dist/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabsControl.js +1 -1
- package/dist/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/dist/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/dist/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/dist/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/dist/ui-kit/TabsControl/renderTabItemInner.js +23 -0
- package/dist/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Tabs/Tabs.fixture.d.ts +0 -1
- package/lib/components/Tabs/Tabs.fixture.mobile.d.ts +0 -1
- package/lib/components/Tabs/TabsContent.d.ts +1 -1
- package/lib/components/Tabs/renderTabs.js +0 -2
- package/lib/components/Tabs/renderTabs.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayout.fixture.d.ts +2 -0
- package/lib/components/TabsLayout/TabsLayout.fixture.mobile.d.ts +2 -0
- package/lib/components/TabsLayout/TabsLayout.js +40 -17
- package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/lib/components/TabsLayout/renderTabsLayout.d.ts +10 -0
- package/lib/components/TabsLayout/renderTabsLayout.js +16 -0
- package/lib/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabsControl.fixture.d.ts +1 -1
- package/lib/ui-kit/TabsControl/TabsControl.js +1 -1
- package/lib/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/lib/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/lib/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/lib/ui-kit/TabsControl/renderTabItemInner.d.ts +10 -0
- package/lib/ui-kit/TabsControl/renderTabItemInner.js +20 -0
- package/lib/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +109 -77
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Tabs/TabsContent.d.ts +1 -1
- package/mobile/bundle/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/mobile/bundle/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/mobile/bundle/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/mobile/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/mobile/bundle/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/mobile/bundle/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/mobile/dist/components/Tabs/TabsContent.d.ts +1 -1
- package/mobile/dist/components/Tabs/renderTabs.js +0 -2
- package/mobile/dist/components/Tabs/renderTabs.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayout.js +39 -16
- package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/mobile/dist/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/mobile/dist/components/TabsLayout/renderTabsLayout.js +19 -0
- package/mobile/dist/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/mobile/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabsControl.js +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/mobile/dist/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/mobile/dist/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.js +23 -0
- package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Tabs/TabsContent.d.ts +1 -1
- package/mobile/lib/components/Tabs/renderTabs.js +0 -2
- package/mobile/lib/components/Tabs/renderTabs.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayout.js +40 -17
- package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/mobile/lib/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/mobile/lib/components/TabsLayout/renderTabsLayout.js +16 -0
- package/mobile/lib/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/mobile/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabsControl.js +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/mobile/lib/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/mobile/lib/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.js +20 -0
- package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/mobile/src/components/Tabs/TabsContent.ts +1 -1
- package/mobile/src/components/Tabs/renderTabs.tsx +0 -10
- package/mobile/src/components/TabsLayout/TabsLayout.example.json +4 -3
- package/mobile/src/components/TabsLayout/TabsLayout.tsx +56 -57
- package/mobile/src/components/TabsLayout/TabsLayoutContent.ts +36 -8
- package/mobile/src/components/TabsLayout/renderTabsLayout.tsx +32 -0
- package/mobile/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +28 -5
- package/mobile/src/ui-kit/TabsControl/TabItem.tsx +5 -5
- package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +21 -15
- package/mobile/src/ui-kit/TabsControl/TabsControl.tsx +4 -1
- package/mobile/src/ui-kit/TabsControl/TabsControlProps.ts +12 -2
- package/mobile/src/ui-kit/TabsControl/renderTab.tsx +3 -3
- package/mobile/src/ui-kit/TabsControl/renderTabItemInner.tsx +63 -0
- package/package.json +1 -1
- package/src/components/Tabs/Tabs.fixture.mobile.tsx +0 -16
- package/src/components/Tabs/Tabs.fixture.tsx +0 -19
- package/src/components/Tabs/TabsContent.ts +1 -1
- package/src/components/Tabs/renderTabs.tsx +0 -10
- package/src/components/TabsLayout/TabsLayout.example.json +4 -3
- package/src/components/TabsLayout/TabsLayout.fixture.mobile.tsx +51 -30
- package/src/components/TabsLayout/TabsLayout.fixture.tsx +61 -30
- package/src/components/TabsLayout/TabsLayout.tsx +56 -57
- package/src/components/TabsLayout/TabsLayoutContent.ts +36 -8
- package/src/components/TabsLayout/renderTabsLayout.tsx +32 -0
- package/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +28 -5
- package/src/ui-kit/TabsControl/TabItem.tsx +5 -5
- package/src/ui-kit/TabsControl/TabItemInner.tsx +21 -15
- package/src/ui-kit/TabsControl/TabsControl.fixture.tsx +7 -20
- package/src/ui-kit/TabsControl/TabsControl.tsx +4 -1
- package/src/ui-kit/TabsControl/TabsControlProps.ts +12 -2
- package/src/ui-kit/TabsControl/renderTab.tsx +3 -3
- package/src/ui-kit/TabsControl/renderTabItemInner.tsx +63 -0
- package/bundle/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/bundle/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/bundle/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/bundle/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/dist/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/dist/components/TabsLayout/TabsLayoutButton.js +0 -24
- package/dist/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/dist/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/dist/components/TabsLayout/TabsLayoutRedirectSection.js +0 -27
- package/dist/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/dist/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/dist/components/TabsLayout/alignTabStyle.js +0 -8
- package/dist/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/dist/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/dist/components/TabsLayout/useScrollToTab.js +0 -17
- package/dist/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/lib/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/lib/components/TabsLayout/TabsLayoutButton.js +0 -22
- package/lib/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/lib/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/lib/components/TabsLayout/TabsLayoutRedirectSection.js +0 -25
- package/lib/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/lib/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/lib/components/TabsLayout/alignTabStyle.js +0 -6
- package/lib/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/lib/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/lib/components/TabsLayout/useScrollToTab.js +0 -14
- package/lib/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/mobile/bundle/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/mobile/bundle/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/mobile/bundle/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/mobile/bundle/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js +0 -24
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.js +0 -27
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/mobile/dist/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/mobile/dist/components/TabsLayout/alignTabStyle.js +0 -8
- package/mobile/dist/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/mobile/dist/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/mobile/dist/components/TabsLayout/useScrollToTab.js +0 -17
- package/mobile/dist/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js +0 -22
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.js +0 -25
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/mobile/lib/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/mobile/lib/components/TabsLayout/alignTabStyle.js +0 -6
- package/mobile/lib/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/mobile/lib/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/mobile/lib/components/TabsLayout/useScrollToTab.js +0 -14
- package/mobile/lib/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/mobile/src/components/TabsLayout/TabsLayoutButton.tsx +0 -63
- package/mobile/src/components/TabsLayout/TabsLayoutRedirectSection.tsx +0 -32
- package/mobile/src/components/TabsLayout/alignTabStyle.ts +0 -7
- package/mobile/src/components/TabsLayout/useScrollToTab.ts +0 -16
- package/src/components/TabsLayout/TabsLayoutButton.tsx +0 -63
- package/src/components/TabsLayout/TabsLayoutRedirectSection.tsx +0 -32
- package/src/components/TabsLayout/alignTabStyle.ts +0 -7
- package/src/components/TabsLayout/useScrollToTab.ts +0 -16
package/bundle/bundle.umd.js
CHANGED
|
@@ -4749,31 +4749,54 @@
|
|
|
4749
4749
|
};
|
|
4750
4750
|
};
|
|
4751
4751
|
|
|
4752
|
+
const getButtonClassNames = (isActive) => ({
|
|
4753
|
+
btn: `w-96 ${isActive ? 'p-m border-none bg-primary-main text-white' : 'p-s ease-in duration-300 bg-white'}`,
|
|
4754
|
+
text: isActive ? 'mb-xs text-xl' : 'mb-2xs text-l text-primary-text',
|
|
4755
|
+
desc: `font-light ${isActive ? 'text-l text-white' : 'text-m text-secondary-text'}`,
|
|
4756
|
+
icon: isActive ? '' : 'text-primary-main',
|
|
4757
|
+
iconVersion: (isActive ? 'white' : 'normal'),
|
|
4758
|
+
oldText: 'text-m text-center',
|
|
4759
|
+
oldDesc: 'text-m-light',
|
|
4760
|
+
});
|
|
4761
|
+
const renderTabItemInner = ({ text, description, icon, isActive, type, }) => {
|
|
4762
|
+
const buttonClassNames = getButtonClassNames(isActive);
|
|
4763
|
+
return (jsxs("div", { className: style('cursor-pointer text-left border-b-0 flex gap-2xs'), "aria-label": text, role: "tab", children: [icon ? (jsx(Img, { className: style('h-6 w-6 min-w-6 min-h-6', buttonClassNames.icon), image: {
|
|
4764
|
+
...icon,
|
|
4765
|
+
iconVersion: icon?.iconVersion ?? buttonClassNames.iconVersion,
|
|
4766
|
+
}, width: "24", height: "24", alt: text })) : null, jsxs("div", { className: "border-0", children: [jsx("div", { className: type === 'animated' ? buttonClassNames.text : buttonClassNames.oldText, children: text }), jsx("div", { className: type === 'animated' ? buttonClassNames.desc : buttonClassNames.oldDesc, children: description })] })] }));
|
|
4767
|
+
};
|
|
4768
|
+
|
|
4752
4769
|
const tabPaddingStyleMap = {
|
|
4753
4770
|
default: 'px-xs',
|
|
4754
4771
|
underlined: 'px-m',
|
|
4755
|
-
|
|
4772
|
+
animated: 'px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs',
|
|
4756
4773
|
};
|
|
4757
4774
|
const tabTextStyle = 'text-secondary-text hover:text-primary-main';
|
|
4758
4775
|
const activeTabTextStyleMap = {
|
|
4759
4776
|
default: 'text-black sm:text-white',
|
|
4760
4777
|
underlined: 'text-primary-main border-b-2',
|
|
4761
|
-
|
|
4778
|
+
animated: 'text-white sm:text-white',
|
|
4762
4779
|
};
|
|
4763
4780
|
const tabBgStyleMap = {
|
|
4764
4781
|
default: 'bg-white',
|
|
4765
4782
|
underlined: 'bg-white',
|
|
4766
|
-
|
|
4783
|
+
animated: 'p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96',
|
|
4767
4784
|
};
|
|
4768
4785
|
const activeTabBgStyleMap = {
|
|
4769
4786
|
default: 'sm:bg-primary-main',
|
|
4770
4787
|
underlined: 'bg-white',
|
|
4771
|
-
|
|
4788
|
+
animated: 'p-2 border-none bg-primary-main text-white h-20 w-96',
|
|
4772
4789
|
};
|
|
4773
|
-
const TabItemInner = JSX(({ tag = 'div', item = {}, isActive, type = 'default', onClick }) => {
|
|
4790
|
+
const TabItemInner = JSX(({ tag = 'div', item = {}, isActive = false, type = 'default', onClick }) => {
|
|
4774
4791
|
const Tag = tag;
|
|
4775
|
-
const { text, appendRight, ...link } = item;
|
|
4776
|
-
return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "
|
|
4792
|
+
const { text, description, icon, appendRight, ...link } = item;
|
|
4793
|
+
return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tablist", onClick: onClick, ...link, children: jsxs("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: [renderTabItemInner({
|
|
4794
|
+
text,
|
|
4795
|
+
description,
|
|
4796
|
+
icon,
|
|
4797
|
+
isActive,
|
|
4798
|
+
type,
|
|
4799
|
+
}), appendRight ? jsx("div", { className: "ml-xs", children: appendRight }) : null] }) }));
|
|
4777
4800
|
});
|
|
4778
4801
|
|
|
4779
4802
|
const TabItem = JSX((props) => props?.item?.href ? jsx(LinkTabItem, { ...props }) : jsx(ButtonTabItem, { ...props }));
|
|
@@ -4795,7 +4818,7 @@
|
|
|
4795
4818
|
|
|
4796
4819
|
const renderTab = (activeTab, onClick, type) => (tab, i) => (jsx(TabItem, { isActive: tab === activeTab, onClick: onClick, type: type, item: tab }, String(i)));
|
|
4797
4820
|
|
|
4798
|
-
const TabsControl = JSX(({ className, tabsType = 'default', items = [], value, onChange }) => (jsx("div", { className: style('flex gap-x-2xs overflow-x-auto no-scrollbar', className), role: "
|
|
4821
|
+
const TabsControl = JSX(({ className, tabsType = 'default', items = [], value, onChange }) => (jsx("div", { className: style('flex gap-x-2xs overflow-x-auto no-scrollbar', className), role: "tabpanel", children: items.map(renderTab(value, onChange, tabsType)) })));
|
|
4799
4822
|
|
|
4800
4823
|
const initialFiltrationState = {
|
|
4801
4824
|
categories: [],
|
|
@@ -5594,20 +5617,30 @@
|
|
|
5594
5617
|
|
|
5595
5618
|
const SwipeListControlBlock = UniBlock(({ listType, showDots, options, version, ...rest }) => (jsx(BlockWrapper, { version: version, defaultPadding: "p-0", ...rest, children: jsx(SwipeListControl, { listType: listType, showDots: showDots, version: version, children: renderChildren({ ...rest, options }) }) })), { childrenTypes: { exclude: ['SwipeListControlBlock'] } });
|
|
5596
5619
|
|
|
5597
|
-
const scrollButtonStyle = 'hidden sm:flex absolute z-40
|
|
5598
|
-
const
|
|
5620
|
+
const scrollButtonStyle = 'hidden sm:flex absolute z-40';
|
|
5621
|
+
const scrollStyleType = {
|
|
5622
|
+
animated: {
|
|
5623
|
+
itemClassName: 'flex',
|
|
5624
|
+
gap: 8,
|
|
5625
|
+
buttonTop: 'top-5',
|
|
5626
|
+
},
|
|
5627
|
+
underlined: {
|
|
5628
|
+
itemClassName: '',
|
|
5629
|
+
gap: 0,
|
|
5630
|
+
buttonTop: 'top-0',
|
|
5631
|
+
},
|
|
5632
|
+
};
|
|
5633
|
+
const ScrollableTabsControl = JSX(({ className, items = [], value, onChange, tabsType = 'default' }) => {
|
|
5599
5634
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
5600
5635
|
itemCount: items?.length || 0,
|
|
5601
5636
|
});
|
|
5602
|
-
return (jsxs("div", { className: style('relative overflow-x-auto no-scrollbar', className),
|
|
5637
|
+
return (jsxs("div", { className: style('relative overflow-x-auto no-scrollbar', className), children: [jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, itemClassName: scrollStyleType[tabsType].itemClassName, gap: scrollStyleType[tabsType].gap, children: items.map(renderTab(value, onChange, tabsType)) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: style('left-6', scrollButtonStyle, scrollStyleType[tabsType].buttonTop), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: style('right-6', scrollButtonStyle, scrollStyleType[tabsType].buttonTop), onClick: scroll.scrollRight })) : null] }));
|
|
5603
5638
|
});
|
|
5604
5639
|
|
|
5605
5640
|
const renderTabs = ({ tabsMode, ...props }) => {
|
|
5606
5641
|
switch (tabsMode) {
|
|
5607
5642
|
case 'wideScreen':
|
|
5608
5643
|
return jsx(TabsControl, { ...props });
|
|
5609
|
-
case 'centered':
|
|
5610
|
-
return (jsx("div", { className: "flex", children: jsx(TabsControl, { className: "m-auto p-xs rounded-md bg-main-gray", tabsType: "rounded", ...props }) }));
|
|
5611
5644
|
case 'scrollable':
|
|
5612
5645
|
return (jsx("div", { className: "flex", children: jsx(ScrollableTabsControl, { className: "m-auto", tabsType: "underlined", ...props }) }));
|
|
5613
5646
|
default:
|
|
@@ -5615,7 +5648,7 @@
|
|
|
5615
5648
|
}
|
|
5616
5649
|
};
|
|
5617
5650
|
|
|
5618
|
-
const TAB_QUERY_PARAM_KEY = 'tab';
|
|
5651
|
+
const TAB_QUERY_PARAM_KEY$1 = 'tab';
|
|
5619
5652
|
const Tabs = JSX(({ className = '', isSticky, tabs = [], tabsMode, ...rest }) => {
|
|
5620
5653
|
const router = useRouter();
|
|
5621
5654
|
const { isReady } = router;
|
|
@@ -5625,8 +5658,8 @@
|
|
|
5625
5658
|
if (!tabs || !tabs[0]) {
|
|
5626
5659
|
return;
|
|
5627
5660
|
}
|
|
5628
|
-
const defaultTabIndex = router.query[TAB_QUERY_PARAM_KEY]
|
|
5629
|
-
? tabs.findIndex((_) => _.type === 'group' && _.ref === router.query[TAB_QUERY_PARAM_KEY]) || 0
|
|
5661
|
+
const defaultTabIndex = router.query[TAB_QUERY_PARAM_KEY$1]
|
|
5662
|
+
? tabs.findIndex((_) => _.type === 'group' && _.ref === router.query[TAB_QUERY_PARAM_KEY$1]) || 0
|
|
5630
5663
|
: 0;
|
|
5631
5664
|
const defaultTab = tabs[defaultTabIndex] || tabs[0];
|
|
5632
5665
|
setActiveTabIndex(defaultTabIndex);
|
|
@@ -5645,10 +5678,10 @@
|
|
|
5645
5678
|
const updateUrlSearchTabParam = (_) => {
|
|
5646
5679
|
const searchParams = new URLSearchParams(router.query);
|
|
5647
5680
|
if (_.name) {
|
|
5648
|
-
searchParams.set(TAB_QUERY_PARAM_KEY, _.name);
|
|
5681
|
+
searchParams.set(TAB_QUERY_PARAM_KEY$1, _.name);
|
|
5649
5682
|
}
|
|
5650
5683
|
else {
|
|
5651
|
-
searchParams.delete(TAB_QUERY_PARAM_KEY);
|
|
5684
|
+
searchParams.delete(TAB_QUERY_PARAM_KEY$1);
|
|
5652
5685
|
}
|
|
5653
5686
|
router.replace(`${router.pathname}?${searchParams}`, '', { scroll: false });
|
|
5654
5687
|
};
|
|
@@ -5678,67 +5711,66 @@
|
|
|
5678
5711
|
};
|
|
5679
5712
|
const normalizeTab = (_) => _?.type === 'group' ? { text: _.title, name: _.ref } : _;
|
|
5680
5713
|
|
|
5681
|
-
const
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5714
|
+
const renderTabsLayout = ({ tabsType = 'animated', ...props }) => {
|
|
5715
|
+
switch (tabsType) {
|
|
5716
|
+
case 'default':
|
|
5717
|
+
return jsx(TabsControl, { ...props });
|
|
5718
|
+
case 'underlined':
|
|
5719
|
+
return (jsx("div", { className: "flex", children: jsx(TabsControl, { className: "m-auto", tabsType: "underlined", ...props }) }));
|
|
5720
|
+
case 'animated':
|
|
5721
|
+
return (jsx("div", { className: "border-b-8 border-primary-main", children: jsx(ScrollableTabsControl, { className: "m-auto", ...props, tabsType: "animated" }) }));
|
|
5722
|
+
default:
|
|
5723
|
+
return null;
|
|
5724
|
+
}
|
|
5685
5725
|
};
|
|
5686
5726
|
|
|
5687
|
-
const
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
title: isActive ? 'mb-xs text-xl' : 'mb-2xs text-l',
|
|
5692
|
-
desc: `font-light ${isActive ? 'text-l text-white' : 'text-m text-secondary-text'}`,
|
|
5693
|
-
icon: isActive ? '' : 'text-primary-main',
|
|
5694
|
-
iconVersion: (isActive ? 'white' : 'normal'),
|
|
5695
|
-
});
|
|
5696
|
-
const TabsLayoutButton = JSX(({ tab, className, onClick, isActive }) => {
|
|
5697
|
-
const buttonClassNames = getButtonClassNames(isActive);
|
|
5698
|
-
return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: style('border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs', buttonClassNames.btn, className), ...getAspectsAttributes(tab?.data), children: [tab?.icon ? (jsx(Img, { className: style('h-6 w-6 min-w-6 min-h-6', buttonClassNames.icon), image: {
|
|
5699
|
-
...tab?.icon,
|
|
5700
|
-
iconVersion: tab?.icon?.iconVersion ?? buttonClassNames.iconVersion,
|
|
5701
|
-
}, width: "24", height: "24" })) : null, jsxs("div", { className: "border-0", children: [tab?.title ? jsx("div", { className: buttonClassNames.title, children: tab.title }) : null, tab?.description ? jsx("div", { className: buttonClassNames.desc, children: tab.description }) : null] })] }));
|
|
5702
|
-
});
|
|
5703
|
-
|
|
5704
|
-
const REDIRECT_DELAY = 0.8 * 1000;
|
|
5705
|
-
const TabsLayoutRedirectSection = JSX(({ tab }) => {
|
|
5706
|
-
const link = useLink();
|
|
5707
|
-
const { onClick } = link({
|
|
5708
|
-
...tab,
|
|
5709
|
-
onClick: () => {
|
|
5710
|
-
/**
|
|
5711
|
-
* In the current implementation of useLink, there is no follow-by-link method,
|
|
5712
|
-
* and default routing won't work if the link is external.
|
|
5713
|
-
*/
|
|
5714
|
-
if (tab.href && !isLocalURL(tab.href)) {
|
|
5715
|
-
globalThis.location.href = tab.href;
|
|
5716
|
-
}
|
|
5717
|
-
},
|
|
5718
|
-
});
|
|
5719
|
-
useDebouncedEffect(onClick, [], REDIRECT_DELAY);
|
|
5720
|
-
return jsx(Shimmer, { className: "col-span-12 p-xl", size: 5 });
|
|
5721
|
-
});
|
|
5722
|
-
|
|
5723
|
-
const TabsLayout = UniBlock(({ className = '', tabs = [], block, tabAlign, ...rest }) => {
|
|
5727
|
+
const TAB_QUERY_PARAM_KEY = 'tab';
|
|
5728
|
+
const TabsLayout = UniBlock(({ className = '', tabs = [], block, tabsType, ...rest }) => {
|
|
5729
|
+
const router = useRouter();
|
|
5730
|
+
const { isReady } = router;
|
|
5724
5731
|
const [activeTabIndex, setActiveTabIndex] = useState(getInitSelectedIndex(tabs));
|
|
5732
|
+
const defaultSelectedTab = tabs.findIndex((_) => Boolean(_.selected));
|
|
5733
|
+
useEffect(() => {
|
|
5734
|
+
const defaultTabIndex = router.query[TAB_QUERY_PARAM_KEY]
|
|
5735
|
+
? tabs.findIndex((_, index) => _.type === 'group' && String(index) === router.query[TAB_QUERY_PARAM_KEY])
|
|
5736
|
+
: defaultSelectedTab;
|
|
5737
|
+
setActiveTabIndex(defaultTabIndex === -1 ? 0 : defaultTabIndex);
|
|
5738
|
+
}, [isReady, defaultSelectedTab]);
|
|
5725
5739
|
const slotName = getSlotName(tabs[activeTabIndex], activeTabIndex);
|
|
5726
|
-
const
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5740
|
+
const updateUrlSearchTabParam = (_, index) => {
|
|
5741
|
+
const searchParams = new URLSearchParams(router.query);
|
|
5742
|
+
if (_.text) {
|
|
5743
|
+
searchParams.set(TAB_QUERY_PARAM_KEY, String(index));
|
|
5744
|
+
}
|
|
5745
|
+
else {
|
|
5746
|
+
searchParams.delete(TAB_QUERY_PARAM_KEY);
|
|
5747
|
+
}
|
|
5748
|
+
router.replace(`${router.pathname}?${searchParams}`, '', { scroll: false });
|
|
5749
|
+
};
|
|
5750
|
+
const handleChange = useCallback((_) => {
|
|
5751
|
+
const index = tabs.indexOf(_);
|
|
5752
|
+
const tab = tabs[index];
|
|
5753
|
+
setActiveTabIndex(index);
|
|
5754
|
+
if (tab.type === 'group') {
|
|
5755
|
+
updateUrlSearchTabParam(_, index);
|
|
5756
|
+
}
|
|
5757
|
+
}, [tabs]);
|
|
5758
|
+
return (jsxs(BlockWrapper, { className: style(className), defaultPadding: "p-0", ...rest, children: [renderTabsLayout({
|
|
5759
|
+
items: tabs,
|
|
5760
|
+
value: tabs[activeTabIndex],
|
|
5761
|
+
tabsType,
|
|
5762
|
+
onChange: handleChange,
|
|
5763
|
+
}), jsx("div", { className: "space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: renderBlocksList(block?.slots?.[slotName], {
|
|
5730
5764
|
...rest?.options,
|
|
5731
|
-
key: `${slotName}-${block?.type}`,
|
|
5732
5765
|
slotName,
|
|
5733
5766
|
parent: block,
|
|
5734
|
-
})
|
|
5767
|
+
}) })] }));
|
|
5735
5768
|
}, {
|
|
5736
5769
|
slots: ({ tabs }) => tabs?.filter((_) => !_.href).map(getSlotName) || [],
|
|
5737
5770
|
childrenTypes: { exclude: ['TabsLayout'] }, // TODO: fix this on wcms
|
|
5738
5771
|
});
|
|
5739
|
-
const getSlotName = (tab, index) => tab?.
|
|
5772
|
+
const getSlotName = (tab, index) => tab?.text || `Слот №${index}`;
|
|
5740
5773
|
const getInitSelectedIndex = (tabs) => tabs.reduce((selectedIndex, tab, i) => (tab.selected ? i : selectedIndex), 0);
|
|
5741
|
-
const renderTabButton = (activeTabIndex, onClick, tabAlign = 'start') => (tab, i) => (jsx(TabsLayoutButton, { className: alignTabStyle[tabAlign], tab: tab, isActive: activeTabIndex === i, onClick: () => onClick(i) }, String(i)));
|
|
5742
5774
|
|
|
5743
5775
|
const dividerStyle = '@4xl:border-main-divider @4xl:border-b';
|
|
5744
5776
|
const firstCellStyle = 'w-80 flex-shrink-0';
|
|
@@ -6170,7 +6202,7 @@
|
|
|
6170
6202
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6171
6203
|
});
|
|
6172
6204
|
|
|
6173
|
-
const packageVersion = "0.14.
|
|
6205
|
+
const packageVersion = "0.14.294";
|
|
6174
6206
|
|
|
6175
6207
|
exports.Blocks = Blocks;
|
|
6176
6208
|
exports.ContentPage = ContentPage;
|