@redneckz/wildless-cms-uni-blocks 0.6.50 → 0.7.1
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 +71 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/bundle/utils/style.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/dist/ui-kit/BlockWrapper.js +1 -1
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/dist/utils/style.d.ts +1 -0
- package/dist/utils/style.js +5 -0
- package/dist/utils/style.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/lib/ui-kit/BlockWrapper.js +1 -1
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/lib/utils/style.d.ts +1 -0
- package/lib/utils/style.js +2 -0
- package/lib/utils/style.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +25 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/bundle/utils/style.d.ts +1 -0
- package/mobile/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/dist/utils/style.d.ts +1 -0
- package/mobile/dist/utils/style.js +5 -0
- package/mobile/dist/utils/style.js.map +1 -0
- package/mobile/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/lib/utils/style.d.ts +1 -0
- package/mobile/lib/utils/style.js +2 -0
- package/mobile/lib/utils/style.js.map +1 -0
- package/mobile/src/common.css +11 -0
- package/mobile/src/components/Carousel/Carousel.ui.json +8 -0
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/mobile/src/utils/style.ts +2 -0
- package/package.json +2 -2
- package/src/common.css +11 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Carousel/Carousel.ui.json +8 -0
- package/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +3 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +27 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/src/icons/IconName.ts +333 -6
- package/src/ui-kit/BlockWrapper.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +6 -1
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/src/utils/style.ts +2 -0
|
@@ -6,20 +6,23 @@ const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
|
6
6
|
const Button_1 = require("../../ui-kit/Button/Button");
|
|
7
7
|
const Foldable_1 = require("../../ui-kit/Foldable/Foldable");
|
|
8
8
|
const FoldableSection_1 = require("../../ui-kit/Foldable/FoldableSection");
|
|
9
|
+
const getIconWithVersion_1 = require("../../utils/getIconWithVersion");
|
|
9
10
|
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
10
11
|
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
11
12
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
13
|
+
const Paragraph_1 = require("../../ui-kit/Paragraph/Paragraph");
|
|
14
|
+
const VISIBLE_CELLS_COUNT = 1;
|
|
15
|
+
exports.CarouselTariffsCard = (0, uni_jsx_1.JSX)(({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
|
|
16
|
+
const cellsNode = cardCells.map(renderCardInfo);
|
|
17
|
+
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
18
|
+
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `font-sans relative bg-white border border-gray min-w-[322px] p-8 flex flex-col
|
|
18
20
|
${getHitStyle(isHighlighting)}
|
|
19
|
-
${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null,
|
|
21
|
+
${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock(icon), title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: "text-primary-text text-center pt-2", headingType: "h5", title: title })) : null, button ? (0, jsx_runtime_1.jsx)(Button_1.Button, { className: "w-full mt-4", ...button }) : null, cardCells.length ? ((0, jsx_runtime_1.jsx)(Foldable_1.Foldable, { renderFoldableSection: ({ isUnfolded }) => ((0, jsx_runtime_1.jsxs)("div", { children: [visibleCells, (0, jsx_runtime_1.jsx)(FoldableSection_1.FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton : null })) : null] }));
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const renderIconBlock = (icon) => ((0, jsx_runtime_1.jsxs)("div", { className: "w-[267px] min-w-[267px] self-center", children: [icon?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { image: icon }) : null, icon?.icon ? (0, jsx_runtime_1.jsx)(Img_1.Img, { image: (0, getIconWithVersion_1.getIconWithVersion)(icon), asSVG: true }) : null] }));
|
|
24
|
+
const getHitStyle = (isHighlighting) => isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-7';
|
|
22
25
|
const renderFoldButton = ({ isUnfolded, onToggle }) => ((0, jsx_runtime_1.jsxs)("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [(0, jsx_runtime_1.jsx)("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16", asSVG: true })] }));
|
|
23
26
|
const renderCardInfo = (cell, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "py-5 border-b border-main-divider", children: [cell?.title ? ((0, jsx_runtime_1.jsx)("div", { className: "text-secondary-text text-m-light opacity-80", children: cell.title })) : null, cell?.description ? ((0, jsx_runtime_1.jsx)("div", { className: "text-primary-text text-h6 mt-1", children: cell.description })) : null] }, String(i)));
|
|
24
|
-
const renderHitIcon = () => ((0, jsx_runtime_1.jsxs)("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), (0, jsx_runtime_1.jsx)("
|
|
27
|
+
const renderHitIcon = () => ((0, jsx_runtime_1.jsxs)("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), (0, jsx_runtime_1.jsx)(Paragraph_1.Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
|
|
25
28
|
//# sourceMappingURL=CarouselTariffsCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselTariffsCard.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CarouselTariffsCard.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"CarouselTariffsCard.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CarouselTariffsCard.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,4DAAyD;AACzD,uDAAoD;AACpD,6DAA0D;AAE1D,2EAAwE;AACxE,uEAAoE;AACpE,0DAAuD;AACvD,iDAA8C;AAC9C,8CAA2C;AAC3C,gEAA6D;AAS7D,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAEjB,QAAA,mBAAmB,GAAG,IAAA,aAAG,EACpC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACnF,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAEzD,OAAO,CACL,wBAAC,2BAAY,IACX,SAAS,EAAE;UACT,WAAW,CAAC,cAAc,CAAC;UAC3B,SAAS,EAAE,KACT,IAAI,aAEP,cAAc,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,EACvC,eAAe,CAAC,IAAI,CAAC,EACrB,KAAK,CAAC,CAA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C,gFAAgF,EAC1F,OAAO,EAAE,QAAQ,aAEjB,0CAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB,GAAO,EACzD,uBAAC,WAAI,IACH,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,KAAK,SACL,IACK,CACV,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,IAAyB,EAAE,CAAS,EAAS,EAAE,CAAC,CACtE,iCAAqB,SAAS,EAAC,mCAAmC,aAC/D,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CACb,gCAAK,SAAS,EAAC,6CAA6C,YAAE,IAAI,CAAC,KAAK,GAAO,CAChF,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CACnB,gCAAK,SAAS,EAAC,gCAAgC,YAAE,IAAI,CAAC,WAAW,GAAO,CACzE,CAAC,CAAC,CAAC,IAAI,KANA,MAAM,CAAC,CAAC,CAAC,CAOb,CACP,CAAC;AAEF,MAAM,aAAa,GAAG,GAAU,EAAE,CAAC,CACjC,iCAAK,SAAS,EAAC,+IAA+I,aAC5J,uBAAC,WAAI,IAAC,WAAW,EAAC,OAAO,EAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,SAAG,EAC1E,uBAAC,qBAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,aAAa,EAAC,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,mBAAmB,mCAE7E,IACR,CACP,CAAC"}
|
|
@@ -39,5 +39,9 @@ export declare type LinkDocsContent = HeadlineCommonProps & {
|
|
|
39
39
|
/** @title Отображать элементы в моб. версии (прокрутка shift+mouseScroll) */
|
|
40
40
|
orientation?: ListOrientation;
|
|
41
41
|
/** @title Рамка элементов (моб.) */ hasBorder?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @title Выравнивание
|
|
44
|
+
* @default text-center
|
|
45
|
+
*/
|
|
42
46
|
align?: TextAlign;
|
|
43
47
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
|
|
2
|
+
import type { SwipeListControlBlockContent } from './SwipeListControlBlockContent';
|
|
3
|
+
interface SwipeListControlBlockProps extends SwipeListControlBlockContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const SwipeListControlBlock: JSXBlock<SwipeListControlBlockProps>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.SwipeListControlBlock = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const renderChildren_1 = require("../../BlockRenderer/renderChildren");
|
|
6
|
+
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
7
|
+
const SwipeListControl_1 = require("../../ui-kit/SwipeListControl/SwipeListControl");
|
|
8
|
+
exports.SwipeListControlBlock = (0, uni_jsx_1.JSX)(({ gap, listType, padding, showDots, options, ...rest }) => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { ...rest, children: (0, jsx_runtime_1.jsx)(SwipeListControl_1.SwipeListControl, { gap: gap, listType: listType, padding: padding, showDots: showDots, children: (0, renderChildren_1.renderChildren)({ ...rest, options }) }) }));
|
|
10
|
+
});
|
|
11
|
+
exports.SwipeListControlBlock.childrenTypes = {
|
|
12
|
+
exclude: ['SwipeListControlBlock'],
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=SwipeListControlBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwipeListControlBlock.js","sourceRoot":"","sources":["../../../src/components/SwipeListControlBlock/SwipeListControlBlock.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uEAAoE;AAEpE,4DAAyD;AACzD,qFAAkF;AAKrE,QAAA,qBAAqB,GAChC,IAAA,aAAG,EAA6B,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzF,OAAO,CACL,uBAAC,2BAAY,OAAK,IAAI,YACpB,uBAAC,mCAAgB,IAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,YACjF,IAAA,+BAAc,EAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GACpB,GACN,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,6BAAqB,CAAC,aAAa,GAAG;IACpC,OAAO,EAAE,CAAC,uBAAuB,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwipeListControlBlockContent.js","sourceRoot":"","sources":["../../../src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts"],"names":[],"mappings":""}
|
|
@@ -5,7 +5,7 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
|
5
5
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
6
6
|
const EventBus_1 = require("../EventBus/EventBus");
|
|
7
7
|
const useBlockIntersectionObserver_1 = require("../services/BlockRouter/useBlockIntersectionObserver");
|
|
8
|
-
exports.BlockWrapper = (0, uni_jsx_1.JSX)(({ className, block, tag = 'section', role, children }) => {
|
|
8
|
+
exports.BlockWrapper = (0, uni_jsx_1.JSX)(({ className = '', block, tag = 'section', role, children }) => {
|
|
9
9
|
const Tag = tag;
|
|
10
10
|
const ref = (0, useBlockIntersectionObserver_1.useBlockIntersectionObserver)(block);
|
|
11
11
|
const [isVisible, setVisible] = (0, hooks_1.useState)(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAClE,mDAAgD;AAEhD,uGAAoG;AAOvF,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAClE,mDAAgD;AAEhD,uGAAoG;AAOvF,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7D,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,GAAG,GAAG,IAAA,2DAA4B,EAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAC/C,IAAA,iBAAS,EACP,GAAG,EAAE,CACH,mBAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;YAC1B,MAAM,WAAW,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,CAAC;YAC3D,UAAU,CACR,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACnF,CAAC;SACH;aAAM;YACL,UAAU,CAAC,IAAI,CAAC,CAAC;SAClB;IACH,CAAC,CAAC,EACJ,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,uBAAC,GAAG,IAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,KAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YACxF,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SwipeContainerProps } from './SwipeListControlProps';
|
|
1
|
+
import type { SwipeContainerProps, SwipeListControlType } from './SwipeListControlProps';
|
|
2
2
|
declare type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
|
|
3
3
|
declare type SwipeListItemWidthAuto = 0;
|
|
4
4
|
/**
|
|
@@ -14,6 +14,7 @@ interface SwipeListContainerProps extends SwipeContainerProps {
|
|
|
14
14
|
snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
|
|
15
15
|
onVisibleItemsChange?: (itemsVisibilityList: ItemsVisibilityList) => void;
|
|
16
16
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
17
|
+
listType?: SwipeListControlType;
|
|
17
18
|
}
|
|
18
19
|
export declare const SwipeListContainer: import("@redneckz/uni-jsx").UNIComponent<SwipeListContainerProps, any, any>;
|
|
19
20
|
export {};
|
|
@@ -4,9 +4,10 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
6
6
|
const mapChildren_1 = require("../../utils/mapChildren");
|
|
7
|
+
const style_1 = require("../../utils/style");
|
|
7
8
|
const SwipeListItem_1 = require("./SwipeListItem");
|
|
8
9
|
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
9
|
-
exports.SwipeListContainer = (0, uni_jsx_1.JSX)(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
10
|
+
exports.SwipeListContainer = (0, uni_jsx_1.JSX)(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
10
11
|
const observerOptions = {
|
|
11
12
|
sensitivity: 1,
|
|
12
13
|
rootRef: containerRef,
|
|
@@ -20,10 +21,12 @@ exports.SwipeListContainer = (0, uni_jsx_1.JSX)(({ className = '', containerRef,
|
|
|
20
21
|
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
21
22
|
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
22
23
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const isHorizontalList = listType === 'horizontal-list';
|
|
25
|
+
const containerStyle = {
|
|
26
|
+
...(isHorizontalList ? getContainerStyle(padding, additionPadding) : {}),
|
|
27
|
+
gap: `${gap}px`,
|
|
28
|
+
};
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: (0, mapChildren_1.mapChildren)((child, idx) => ((0, jsx_runtime_1.jsx)(SwipeListItem_1.SwipeListItem, { className: (0, style_1.style)(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', listType === 'vertical-list' ? 'h-full' : ''), style: isHorizontalList ? getContainerStyle(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
27
30
|
});
|
|
28
31
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
29
32
|
const getContainerStyle = (padding, additionalPadding = 0) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAElE,yDAAsD;
|
|
1
|
+
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAElE,yDAAsD;AACtD,6CAA0C;AAE1C,mDAAgD;AAoBhD,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAE1E,QAAA,kBAAkB,GAAG,IAAA,aAAG,EACnC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,GAAG,CAAC,EACpB,GAAG,GAAG,CAAC,EACP,OAAO,GAAG,CAAC,EACX,QAAQ,GAAG,iBAAiB,EAC5B,SAAS,GAAG,aAAa,EACzB,QAAQ,EACR,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,EAAE;IACH,MAAM,eAAe,GAAgC;QACnD,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,YAAY;KACtB,CAAC;IAEF,MAAM,sBAAsB,GAAG,IAAA,cAAM,EAAsB,EAAE,CAAC,CAAC;IAC/D,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EACpC,CAAC,GAAW,EAAE,KAAgC,EAA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AAC,CAAC,EAAE,CAC7C,EACD,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAC7D,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,kBAAkB,YAEjC,KAAK,IAZD,MAAM,CAAC,GAAG,CAAC,CAaF,CACjB,CAAC,CAAC,QAAQ,CAAC,GACR,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,iBAAiB,GAAG,CAAC,EAA0B,EAAE,CAAC,CAAC;IAC7F,UAAU,EAAE,GAAG,CAAC,OAAO,IAAI;IAC3B,WAAW,EAAE,GAAG,CAAC,OAAO,IAAI;IAC5B,WAAW,EAAE,GAAG,OAAO,IAAI;IAC3B,YAAY,EAAE,GAAG,OAAO,GAAG,iBAAiB,IAAI;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,mBAAwC,EAAE,EAAE,CACrE,mBAAmB;KAChB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAmD,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACtE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,IAAI,GAAG,CAAC;KAChD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.SwipeListControl = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const style_1 = require("../../utils/style");
|
|
5
6
|
const SwipeListContainer_1 = require("./SwipeListContainer");
|
|
6
7
|
const SwipeListControlDots_1 = require("./SwipeListControlDots");
|
|
7
8
|
const useSwipeListScroll_1 = require("./useSwipeListScroll");
|
|
@@ -12,13 +13,13 @@ const DEFAULT_GAP = 14;
|
|
|
12
13
|
and get rid of a clipping effect caused by overflow: hidden.
|
|
13
14
|
*/
|
|
14
15
|
const DEFAULT_PADDING = 16;
|
|
15
|
-
exports.SwipeListControl = (0, uni_jsx_1.JSX)(({ className, gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, }) => {
|
|
16
|
+
exports.SwipeListControl = (0, uni_jsx_1.JSX)(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
|
|
16
17
|
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
17
18
|
const [containerRef, scroll] = (0, useSwipeListScroll_1.useSwipeListScroll)({
|
|
18
19
|
itemCount,
|
|
19
20
|
onVisibleIndicesChange,
|
|
20
21
|
});
|
|
21
22
|
const [activeIndex] = scroll.visibleIndicesRange;
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: children }), showDots ? ((0, jsx_runtime_1.jsx)(SwipeListControlDots_1.SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount })) : null] }));
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? ((0, jsx_runtime_1.jsx)(SwipeListControlDots_1.SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
|
|
23
24
|
});
|
|
24
25
|
//# sourceMappingURL=SwipeListControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListControl.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControl.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,6DAA0D;AAC1D,iEAA8D;AAE9D,6DAA0D;AAE1D,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;GAIG;AACH,MAAM,eAAe,GAAG,EAAE,CAAC;AAEd,QAAA,gBAAgB,GAAG,IAAA,aAAG,EACjC,CAAC,EACC,SAAS,
|
|
1
|
+
{"version":3,"file":"SwipeListControl.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControl.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,6CAA0C;AAC1C,6DAA0D;AAC1D,iEAA8D;AAE9D,6DAA0D;AAE1D,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;GAIG;AACH,MAAM,eAAe,GAAG,EAAE,CAAC;AAEd,QAAA,gBAAgB,GAAG,IAAA,aAAG,EACjC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,GAAG,GAAG,WAAW,EACjB,OAAO,GAAG,eAAe,EACzB,QAAQ,GAAG,IAAI,EACf,QAAQ,EACR,sBAAsB,EACtB,QAAQ,GAAG,iBAAiB,GAC7B,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,IAAA,uCAAkB,EAAiB;QAChE,SAAS;QACT,sBAAsB;KACvB,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAEjD,OAAO,CACL,iCAAK,SAAS,EAAE,IAAA,aAAK,EAAC,SAAS,EAAE,QAAQ,KAAK,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,aACrF,uBAAC,uCAAkB,IACjB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,CAAC,EACnB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,sBAAsB,EAAE,MAAM,CAAC,0BAA0B,EACzD,QAAQ,EAAE,QAAQ,YAEjB,QAAQ,GACU,EACpB,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,2CAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { SwipeListControlType } from './SwipeListControlProps';
|
|
1
2
|
interface SwipeListControlDotsProps {
|
|
2
3
|
containerRef?: {
|
|
3
4
|
current: HTMLDivElement | null;
|
|
4
5
|
};
|
|
5
6
|
activeIndex?: number;
|
|
6
7
|
dotCount?: number;
|
|
8
|
+
listType?: SwipeListControlType;
|
|
7
9
|
}
|
|
8
10
|
export declare const SwipeListControlDots: import("@redneckz/uni-jsx").UNIComponent<SwipeListControlDotsProps, any, any>;
|
|
9
11
|
export {};
|
|
@@ -2,8 +2,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.SwipeListControlDots = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const containerStyles = {
|
|
6
|
+
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
7
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
8
|
+
};
|
|
9
|
+
const activeDotStyles = {
|
|
10
|
+
'horizontal-list': 'w-6',
|
|
11
|
+
'vertical-list': 'h-6',
|
|
12
|
+
};
|
|
13
|
+
const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300';
|
|
14
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
15
|
+
exports.SwipeListControlDots = (0, uni_jsx_1.JSX)(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list' }) => {
|
|
7
16
|
const handleClick = (idx) => {
|
|
8
17
|
if (idx !== activeIndex && containerRef?.current) {
|
|
9
18
|
containerRef.current.children[idx]?.scrollIntoView({
|
|
@@ -12,6 +21,6 @@ exports.SwipeListControlDots = (0, uni_jsx_1.JSX)(({ containerRef, activeIndex,
|
|
|
12
21
|
});
|
|
13
22
|
}
|
|
14
23
|
};
|
|
15
|
-
return dotCount ? ((0, jsx_runtime_1.jsx)("div", { className:
|
|
24
|
+
return dotCount ? ((0, jsx_runtime_1.jsx)("div", { className: `flex gap-2 ${containerStyles[listType]}`, children: new Array(dotCount).fill(null).map((_, idx) => ((0, jsx_runtime_1.jsx)("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
16
25
|
});
|
|
17
26
|
//# sourceMappingURL=SwipeListControlDots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListControlDots.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControlDots.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"SwipeListControlDots.js","sourceRoot":"","sources":["../../../src/ui-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AOhB,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title Вид
|
|
3
|
+
* @enumNames ["Горизонтальный", "Вертикальный"]
|
|
4
|
+
*/
|
|
5
|
+
export declare type SwipeListControlType = 'horizontal-list' | 'vertical-list';
|
|
1
6
|
/**
|
|
2
7
|
* @title Контейнер
|
|
3
8
|
*/
|
|
@@ -14,5 +19,7 @@ export interface SwipeListControlProps extends SwipeContainerProps {
|
|
|
14
19
|
className?: string;
|
|
15
20
|
/** @title Точки-индикаторы */
|
|
16
21
|
showDots?: boolean;
|
|
22
|
+
/** @hidden */
|
|
17
23
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
24
|
+
listType?: SwipeListControlType;
|
|
18
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: (...atoms: (string | null | undefined)[]) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/utils/style.ts"],"names":[],"mappings":";;AAAO,MAAM,KAAK,GAAG,CAAC,GAAG,KAAoC,EAAU,EAAE,CACvE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AADrB,QAAA,KAAK,SACgB"}
|
|
@@ -4,8 +4,8 @@ import { renderButton } from '../../ui-kit/Button/ButtonSection.js';
|
|
|
4
4
|
import { Headline } from '../Headline/Headline.js';
|
|
5
5
|
const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
|
|
6
6
|
const CARD_WIDTH_MAP = {
|
|
7
|
-
normal: 'min-w-[
|
|
7
|
+
normal: 'min-w-[970px]',
|
|
8
8
|
mini: 'min-w-[355px]',
|
|
9
9
|
};
|
|
10
|
-
export const CarouselCard = JSX(({ className = '', button, description, title, version = 'normal' }) => (_jsx("section", { className: `flex pb-9 pl-12 ${CARD_WIDTH_MAP[version]} ${className}`, children: _jsxs("div", { className: "relative w-full", children: [_jsx("div", { className: `${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark` }), _jsx("div", { className: `${BLOCK_CLASSES} z-10 top-6 right-8 bg-green` }), _jsx("div", { className: `${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light` }), _jsxs("div", { className: "relative bg-white z-10
|
|
10
|
+
export const CarouselCard = JSX(({ className = '', button, description, title, version = 'normal' }) => (_jsx("section", { className: `flex pb-9 pl-12 border-box ${CARD_WIDTH_MAP[version]} ${className}`, children: _jsxs("div", { className: "relative w-full", children: [_jsx("div", { className: `${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark` }), _jsx("div", { className: `${BLOCK_CLASSES} z-10 top-6 right-8 bg-green` }), _jsx("div", { className: `${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light` }), _jsxs("div", { className: "relative bg-white z-10 p-10 border border-solid border-green-light", children: [_jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "L", align: "text-left" }), button ? _jsx("div", { className: "mt-14", children: renderButton({ button }) }) : null] })] }) })));
|
|
11
11
|
//# sourceMappingURL=CarouselCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselCard.js","sourceRoot":"","sources":["../../../src/components/CarouselCard/CarouselCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,MAAM,aAAa,GAAG,wDAAwD,CAAC;AAE/E,MAAM,cAAc,GAAwC;IAC1D,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"CarouselCard.js","sourceRoot":"","sources":["../../../src/components/CarouselCard/CarouselCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,MAAM,aAAa,GAAG,wDAAwD,CAAC;AAE/E,MAAM,cAAc,GAAwC;IAC1D,MAAM,EAAE,eAAe;IACvB,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC,CACtE,kBAAS,SAAS,EAAE,8BAA8B,cAAc,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,YACtF,eAAK,SAAS,EAAC,iBAAiB,aAC9B,cAAK,SAAS,EAAE,GAAG,aAAa,oCAAoC,GAAI,EACxE,cAAK,SAAS,EAAE,GAAG,aAAa,8BAA8B,GAAI,EAClE,cAAK,SAAS,EAAE,GAAG,aAAa,oCAAoC,GAAI,EACxE,eAAK,SAAS,EAAC,oEAAoE,aACjF,KAAC,QAAQ,IACP,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,eAAe,EAAC,GAAG,EACnB,KAAK,EAAC,WAAW,GACjB,EACD,MAAM,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,OAAO,YAAE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,GAAO,CAAC,CAAC,CAAC,IAAI,IACpE,IACF,GACE,CACX,CACF,CAAC"}
|
|
@@ -5,6 +5,6 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
7
7
|
import { getIconWithVersion } from '../../utils/getIconWithVersion.js';
|
|
8
|
-
export const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], version = 'primary', ...rest }) => (_jsxs(BlockWrapper, { className: `font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`, ...rest, children: [_jsxs("div", { className: "w-[200px] min-w-[200px] self-
|
|
8
|
+
export const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], version = 'primary', ...rest }) => (_jsxs(BlockWrapper, { className: `font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`, ...rest, children: [_jsxs("div", { className: "w-[200px] min-w-[200px] self-center", children: [icon?.icon ? _jsx(Img, { image: getIconWithVersion(icon), asSVG: true }) : null, icon?.src ? _jsx(Img, { image: icon }) : null] }), _jsxs("div", { className: "p-8 pl-3 w-full", children: [title ? _jsx(Heading, { className: " mb-3.5", headingType: "h5", title: title }) : null, list.length ? _jsx("div", { className: "flex flex-col gap-3", children: list?.map(renderList) }) : null] })] })));
|
|
9
9
|
const renderList = (_, i) => (_jsxs("div", { className: "break-words", children: [_.title ? _jsx("div", { className: `text-h6`, children: _.title }) : null, _.description ? _jsx("span", { className: "text-l-light mt-1", children: _.description }) : null] }, String(i)));
|
|
10
10
|
//# sourceMappingURL=CarouselProgramsCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselProgramsCard.js","sourceRoot":"","sources":["../../../src/components/CarouselProgramsCard/CarouselProgramsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,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AE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IACpC,EACN,eAAK,SAAS,EAAC,iBAAiB,aAC7B,KAAK,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,SAAS,EAAC,SAAS,EAAC,WAAW,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,EAC7E,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,qBAAqB,YAAE,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,GAAO,CAAC,CAAC,CAAC,IAAI,IACpF,IACO,CAChB,CACF,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,CAAsB,EAAE,CAAS,EAAE,EAAE,CAAC,CACxD,eAAqB,SAAS,EAAC,aAAa,aACzC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,SAAS,YAAG,CAAC,CAAC,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAC3D,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,mBAAmB,YAAE,CAAC,CAAC,WAAW,GAAQ,CAAC,CAAC,CAAC,IAAI,KAF1E,MAAM,CAAC,CAAC,CAAC,CAGb,CACP,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
2
1
|
import type { CarouselTariffsCardContent } from './CarouselTariffsCardContent';
|
|
2
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
3
3
|
export interface CarouselTariffsCardProps extends CarouselTariffsCardContent, UniBlockProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const CarouselTariffsCard: import("@redneckz/uni-jsx").UNIComponent<CarouselTariffsCardProps, any, any>;
|
|
@@ -4,20 +4,23 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
|
4
4
|
import { Button } from '../../ui-kit/Button/Button.js';
|
|
5
5
|
import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
|
|
6
6
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
|
|
7
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion.js';
|
|
7
8
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
8
9
|
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
9
10
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
11
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph.js';
|
|
12
|
+
const VISIBLE_CELLS_COUNT = 1;
|
|
13
|
+
export const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
|
|
14
|
+
const cellsNode = cardCells.map(renderCardInfo);
|
|
15
|
+
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
16
|
+
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
17
|
+
return (_jsxs(BlockWrapper, { className: `font-sans relative bg-white border border-gray min-w-[322px] p-8 flex flex-col
|
|
16
18
|
${getHitStyle(isHighlighting)}
|
|
17
|
-
${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null,
|
|
19
|
+
${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock(icon), title ? (_jsx(Heading, { className: "text-primary-text text-center pt-2", headingType: "h5", title: title })) : null, button ? _jsx(Button, { className: "w-full mt-4", ...button }) : null, cardCells.length ? (_jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (_jsxs("div", { children: [visibleCells, _jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton : null })) : null] }));
|
|
18
20
|
});
|
|
19
|
-
const
|
|
21
|
+
const renderIconBlock = (icon) => (_jsxs("div", { className: "w-[267px] min-w-[267px] self-center", children: [icon?.src ? _jsx(Img, { image: icon }) : null, icon?.icon ? _jsx(Img, { image: getIconWithVersion(icon), asSVG: true }) : null] }));
|
|
22
|
+
const getHitStyle = (isHighlighting) => isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-7';
|
|
20
23
|
const renderFoldButton = ({ isUnfolded, onToggle }) => (_jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [_jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), _jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16", asSVG: true })] }));
|
|
21
24
|
const renderCardInfo = (cell, i) => (_jsxs("div", { className: "py-5 border-b border-main-divider", children: [cell?.title ? (_jsx("div", { className: "text-secondary-text text-m-light opacity-80", children: cell.title })) : null, cell?.description ? (_jsx("div", { className: "text-primary-text text-h6 mt-1", children: cell.description })) : null] }, String(i)));
|
|
22
|
-
const renderHitIcon = () => (_jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [_jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), _jsx("
|
|
25
|
+
const renderHitIcon = () => (_jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [_jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), _jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
|
|
23
26
|
//# sourceMappingURL=CarouselTariffsCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselTariffsCard.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CarouselTariffsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CarouselTariffsCard.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CarouselTariffsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAS7D,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACnF,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAEzD,OAAO,CACL,MAAC,YAAY,IACX,SAAS,EAAE;UACT,WAAW,CAAC,cAAc,CAAC;UAC3B,SAAS,EAAE,KACT,IAAI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& {
|
|
|
39
39
|
/** @title Отображать элементы в моб. версии (прокрутка shift+mouseScroll) */
|
|
40
40
|
orientation?: ListOrientation;
|
|
41
41
|
/** @title Рамка элементов (моб.) */ hasBorder?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @title Выравнивание
|
|
44
|
+
* @default text-center
|
|
45
|
+
*/
|
|
42
46
|
align?: TextAlign;
|
|
43
47
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
|
|
2
|
+
import type { SwipeListControlBlockContent } from './SwipeListControlBlockContent';
|
|
3
|
+
interface SwipeListControlBlockProps extends SwipeListControlBlockContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const SwipeListControlBlock: JSXBlock<SwipeListControlBlockProps>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { renderChildren } from '../../BlockRenderer/renderChildren.js';
|
|
4
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
5
|
+
import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl.js';
|
|
6
|
+
export const SwipeListControlBlock = JSX(({ gap, listType, padding, showDots, options, ...rest }) => {
|
|
7
|
+
return (_jsx(BlockWrapper, { ...rest, children: _jsx(SwipeListControl, { gap: gap, listType: listType, padding: padding, showDots: showDots, children: renderChildren({ ...rest, options }) }) }));
|
|
8
|
+
});
|
|
9
|
+
SwipeListControlBlock.childrenTypes = {
|
|
10
|
+
exclude: ['SwipeListControlBlock'],
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=SwipeListControlBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwipeListControlBlock.js","sourceRoot":"","sources":["../../../src/components/SwipeListControlBlock/SwipeListControlBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAKlF,MAAM,CAAC,MAAM,qBAAqB,GAChC,GAAG,CAA6B,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzF,OAAO,CACL,KAAC,YAAY,OAAK,IAAI,YACpB,KAAC,gBAAgB,IAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,YACjF,cAAc,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GACpB,GACN,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,qBAAqB,CAAC,aAAa,GAAG;IACpC,OAAO,EAAE,CAAC,uBAAuB,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwipeListControlBlockContent.js","sourceRoot":"","sources":["../../../src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts"],"names":[],"mappings":""}
|
|
@@ -3,7 +3,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { EventBus } from '../EventBus/EventBus.js';
|
|
5
5
|
import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver.js';
|
|
6
|
-
export const BlockWrapper = JSX(({ className, block, tag = 'section', role, children }) => {
|
|
6
|
+
export const BlockWrapper = JSX(({ className = '', block, tag = 'section', role, children }) => {
|
|
7
7
|
const Tag = tag;
|
|
8
8
|
const ref = useBlockIntersectionObserver(block);
|
|
9
9
|
const [isVisible, setVisible] = useState(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AAOpG,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AAOpG,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7D,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,GAAG,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/C,SAAS,CACP,GAAG,EAAE,CACH,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;YAC1B,MAAM,WAAW,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,CAAC;YAC3D,UAAU,CACR,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACnF,CAAC;SACH;aAAM;YACL,UAAU,CAAC,IAAI,CAAC,CAAC;SAClB;IACH,CAAC,CAAC,EACJ,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,KAAC,GAAG,IAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,KAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YACxF,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SwipeContainerProps } from './SwipeListControlProps';
|
|
1
|
+
import type { SwipeContainerProps, SwipeListControlType } from './SwipeListControlProps';
|
|
2
2
|
declare type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
|
|
3
3
|
declare type SwipeListItemWidthAuto = 0;
|
|
4
4
|
/**
|
|
@@ -14,6 +14,7 @@ interface SwipeListContainerProps extends SwipeContainerProps {
|
|
|
14
14
|
snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
|
|
15
15
|
onVisibleItemsChange?: (itemsVisibilityList: ItemsVisibilityList) => void;
|
|
16
16
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
17
|
+
listType?: SwipeListControlType;
|
|
17
18
|
}
|
|
18
19
|
export declare const SwipeListContainer: import("@redneckz/uni-jsx").UNIComponent<SwipeListContainerProps, any, any>;
|
|
19
20
|
export {};
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { mapChildren } from '../../utils/mapChildren.js';
|
|
5
|
+
import { style } from '../../utils/style.js';
|
|
5
6
|
import { SwipeListItem } from './SwipeListItem.js';
|
|
6
7
|
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
7
|
-
export const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
8
|
+
export const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
8
9
|
const observerOptions = {
|
|
9
10
|
sensitivity: 1,
|
|
10
11
|
rootRef: containerRef,
|
|
@@ -18,10 +19,12 @@ export const SwipeListContainer = JSX(({ className = '', containerRef, activeInd
|
|
|
18
19
|
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
19
20
|
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
20
21
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const isHorizontalList = listType === 'horizontal-list';
|
|
23
|
+
const containerStyle = {
|
|
24
|
+
...(isHorizontalList ? getContainerStyle(padding, additionPadding) : {}),
|
|
25
|
+
gap: `${gap}px`,
|
|
26
|
+
};
|
|
27
|
+
return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', listType === 'vertical-list' ? 'h-full' : ''), style: isHorizontalList ? getContainerStyle(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
25
28
|
});
|
|
26
29
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
27
30
|
const getContainerStyle = (padding, additionalPadding = 0) => ({
|