@redneckz/wildless-cms-uni-blocks 0.14.173 → 0.14.175
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.169.js +1 -1
- package/bin/migration-scripts/0.14.175.js +28 -0
- package/bundle/bundle.umd.js +2 -15
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
- package/dist/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayout.js +0 -2
- package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/lib/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
- package/lib/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayout.js +0 -2
- package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -15
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayout.js +0 -2
- package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayout.js +0 -2
- package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/src/components/ApplicationForm/renderAgreementWithSubmit.tsx +1 -1
- package/mobile/src/components/TabsLayout/TabsLayout.tsx +0 -3
- package/package.json +1 -1
- package/src/components/ApplicationForm/renderAgreementWithSubmit.tsx +1 -1
- package/src/components/TabsLayout/TabsLayout.tsx +0 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { traversePageBlocks } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export const description = 'v0.14.175';
|
|
4
|
+
|
|
5
|
+
export default traversePageBlocks(adjustApplicationFormBlock, adjustApplicationCustomFormBlock);
|
|
6
|
+
|
|
7
|
+
function adjustApplicationFormBlock(block) {
|
|
8
|
+
const content = block?.content;
|
|
9
|
+
const link = block?.content?.formBlock?.link;
|
|
10
|
+
if (content && block.type === 'ApplicationForm' && link?.text === 'условиями передачи данных') {
|
|
11
|
+
link.text = `Согласен с ${link.text}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function adjustApplicationCustomFormBlock(block) {
|
|
16
|
+
const content = block?.content;
|
|
17
|
+
if (
|
|
18
|
+
!content ||
|
|
19
|
+
block.type !== 'ApplicationFormCorruption' ||
|
|
20
|
+
block.type !== 'ApplicationFormAntiFraud'
|
|
21
|
+
) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const link = block?.content?.link;
|
|
25
|
+
if (link?.text?.indexOf('Согласен с') === -1) {
|
|
26
|
+
link.text = `Согласен с ${link.text}`;
|
|
27
|
+
}
|
|
28
|
+
}
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -1513,7 +1513,7 @@
|
|
|
1513
1513
|
});
|
|
1514
1514
|
const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
|
|
1515
1515
|
|
|
1516
|
-
const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, {
|
|
1516
|
+
const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, checkboxValidator).error)] }), renderSubmitButton(button)] }));
|
|
1517
1517
|
|
|
1518
1518
|
const formatDate = (date, toTimeStamp = false) => {
|
|
1519
1519
|
if (typeof date === 'string') {
|
|
@@ -5587,25 +5587,12 @@
|
|
|
5587
5587
|
return jsx(Shimmer, { className: "col-span-12 p-xl", size: 5 });
|
|
5588
5588
|
});
|
|
5589
5589
|
|
|
5590
|
-
const useScrollToTab = (activeTabIndex, scroll) => {
|
|
5591
|
-
const [initState, { setTrue: setInitStateTrue }] = useBool(false);
|
|
5592
|
-
useEffect(() => {
|
|
5593
|
-
scroll.scrollTo(activeTabIndex, {
|
|
5594
|
-
behavior: initState ? 'smooth' : 'auto',
|
|
5595
|
-
block: 'nearest',
|
|
5596
|
-
inline: 'center',
|
|
5597
|
-
});
|
|
5598
|
-
!initState && setInitStateTrue();
|
|
5599
|
-
}, [activeTabIndex, initState]);
|
|
5600
|
-
};
|
|
5601
|
-
|
|
5602
5590
|
const TabsLayout = UniBlock(({ className = '', tabs = [], block, tabAlign, ...rest }) => {
|
|
5603
5591
|
const [activeTabIndex, setActiveTabIndex] = useState(getInitSelectedIndex(tabs));
|
|
5604
5592
|
const slotName = getSlotName(tabs[activeTabIndex], activeTabIndex);
|
|
5605
5593
|
const itemCount = tabs.length;
|
|
5606
5594
|
const [activeSlideIndex, { inc: incActiveSlideIndex, dec: decActiveSlideIndex }] = useCarouselControls({ itemCount }, activeTabIndex);
|
|
5607
5595
|
const [containerRef, scroll] = useSwipeListScroll({ itemCount });
|
|
5608
|
-
useScrollToTab(activeTabIndex, scroll);
|
|
5609
5596
|
return (jsxs(BlockWrapper, { className: style(className), defaultPadding: "p-0", ...rest, children: [jsxs("div", { className: "relative border-b-8 border-primary-main", children: [jsx(SwipeListContainer, { itemClassName: "flex", containerRef: containerRef, snapAlign: "snap-end", gap: 8, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: tabs.map(renderTabButton(activeTabIndex, setActiveTabIndex, tabAlign)) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: true, onScrollLeft: decActiveSlideIndex, onScrollRight: incActiveSlideIndex, activeIndex: activeSlideIndex, itemCount: itemCount })] }), jsx("div", { className: "space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: tabs[activeTabIndex]?.href ? (jsx(TabsLayoutRedirectSection, { tab: tabs[activeTabIndex] })) : (renderBlocksList(block?.slots?.[slotName], {
|
|
5610
5597
|
...rest?.options,
|
|
5611
5598
|
slotName,
|
|
@@ -6027,7 +6014,7 @@
|
|
|
6027
6014
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6028
6015
|
});
|
|
6029
6016
|
|
|
6030
|
-
const packageVersion = "0.14.
|
|
6017
|
+
const packageVersion = "0.14.174";
|
|
6031
6018
|
|
|
6032
6019
|
exports.Blocks = Blocks;
|
|
6033
6020
|
exports.ContentPage = ContentPage;
|