@redneckz/wildless-cms-uni-blocks 0.14.245 → 0.14.246
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/EventBus/defaultEventBus.d.ts +2 -0
- package/bundle/bundle.umd.js +14 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
- package/dist/EventBus/defaultEventBus.d.ts +2 -0
- package/dist/EventBus/defaultEventBus.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
- package/lib/EventBus/defaultEventBus.d.ts +2 -0
- package/lib/EventBus/defaultEventBus.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
- package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +14 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
- package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -0
- package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
- package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -0
- package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
- package/mobile/src/EventBus/defaultEventBus.ts +2 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +40 -19
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
- package/package.json +1 -1
- package/src/EventBus/defaultEventBus.ts +2 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +40 -19
- package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CarouselTariffsCardAction } from '../components/CarouselTariffsCard/CarouselTariffsCardAction';
|
|
1
2
|
import { type TabActivationEvent } from '../components/Tabs/TabActivationEvent';
|
|
2
3
|
import { type Region } from '../hooks/useRegions';
|
|
3
4
|
import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
|
|
@@ -8,6 +9,7 @@ interface GlobalEventMap {
|
|
|
8
9
|
dialog: DialogAction;
|
|
9
10
|
popup: PopupAction;
|
|
10
11
|
tab: TabActivationEvent;
|
|
12
|
+
fold: CarouselTariffsCardAction;
|
|
11
13
|
}
|
|
12
14
|
export declare const defaultEventBus: EventBus<GlobalEventMap>;
|
|
13
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultEventBus.js","sourceRoot":"","sources":["../../src/EventBus/defaultEventBus.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"defaultEventBus.js","sourceRoot":"","sources":["../../src/EventBus/defaultEventBus.ts"],"names":[],"mappings":";;AAKA,yCAAsC;AAUzB,QAAA,eAAe,GAAG,IAAI,mBAAQ,EAAkB,CAAC"}
|
|
@@ -2,6 +2,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.CarouselTariffsCard = 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 hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
6
|
+
const defaultEventBus_1 = require("../../EventBus/defaultEventBus");
|
|
5
7
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
6
8
|
const Foldable_1 = require("../../ui-kit/Foldable/Foldable");
|
|
7
9
|
const FoldableSection_1 = require("../../ui-kit/Foldable/FoldableSection");
|
|
@@ -12,12 +14,22 @@ const LinkButton_1 = require("../../ui-kit/LinkButton/LinkButton");
|
|
|
12
14
|
const isIcon_1 = require("../../utils/isIcon");
|
|
13
15
|
const style_1 = require("../../utils/style");
|
|
14
16
|
const renderCardInfo_1 = require("./renderCardInfo");
|
|
15
|
-
exports.CarouselTariffsCard = (0, uni_jsx_1.JSX)(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], ...rest }) => {
|
|
17
|
+
exports.CarouselTariffsCard = (0, uni_jsx_1.JSX)(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, ...rest }) => {
|
|
16
18
|
const cellsNode = cardCells.map(renderCardInfo_1.renderCardInfo);
|
|
17
19
|
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
18
20
|
? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
|
|
19
21
|
: [cellsNode, []];
|
|
20
|
-
|
|
22
|
+
const [isVisible, setIsVisible] = (0, hooks_1.useState)(false);
|
|
23
|
+
(0, hooks_1.useEffect)(() => defaultEventBus_1.defaultEventBus.subscribe('fold', (event) => {
|
|
24
|
+
if (options?.parent !== undefined && event.parent === options?.parent) {
|
|
25
|
+
setIsVisible(event.isUnfolded);
|
|
26
|
+
}
|
|
27
|
+
}), []);
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [(0, isIcon_1.isIcon)(icon) ? ((0, jsx_runtime_1.jsx)("div", { className: "self-center", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { image: icon }) })) : null, title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: (0, style_1.style)('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? (0, jsx_runtime_1.jsx)(LinkButton_1.LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? ((0, jsx_runtime_1.jsx)(Foldable_1.Foldable, { renderFoldableSection: () => ((0, jsx_runtime_1.jsxs)("div", { children: [visibleCells, (0, jsx_runtime_1.jsx)(FoldableSection_1.FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton(isVisible, options?.parent) : null })) : ((0, jsx_runtime_1.jsx)("div", { children: visibleCells }))] }));
|
|
21
29
|
});
|
|
22
|
-
const renderFoldButton = (
|
|
30
|
+
const renderFoldButton = (isUnfolded, parent) => () => ((0, jsx_runtime_1.jsxs)("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
|
|
31
|
+
if (parent !== undefined) {
|
|
32
|
+
defaultEventBus_1.defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
|
|
33
|
+
}
|
|
34
|
+
}, type: "button", 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" })] }));
|
|
23
35
|
//# 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,uDAAkE;AAClE,oEAAiE;AAGjE,4DAAyD;AACzD,6DAA0D;AAC1D,2EAAwE;AACxE,0DAAuD;AACvD,iDAA8C;AAC9C,8CAA2C;AAC3C,mEAAgE;AAEhE,+CAA4C;AAC5C,6CAA0C;AAE1C,qDAAkD;AAMrC,QAAA,mBAAmB,GAAG,IAAA,aAAG,EACpC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,KAAK,GAAG,aAAa,EACrB,IAAI,EACJ,MAAM,EACN,iBAAiB,GAAG,CAAC,EACrB,SAAS,GAAG,EAAE,EACd,OAAO,EACP,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,+BAAc,CAAC,CAAC;IAEhD,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,GAC/B,iBAAiB,GAAG,CAAC;QACnB,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACtB,MAAM,CA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AC,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAE5E,CACH,CAAC,CAAC,CAAC,CACF,0CAAM,YAAY,GAAO,CAC1B,IACY,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,UAAoB,EAAE,MAAa,EAAE,EAAE,CAAC,GAAU,EAAE,CAC5E,CACE,oCACE,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,iCAAe,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;SACjF;IACH,CAAC,EACD,IAAI,EAAC,QAAQ,aAEb,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,GACX,IACK,CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselTariffsCardAction.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CarouselTariffsCardAction } from '../components/CarouselTariffsCard/CarouselTariffsCardAction';
|
|
1
2
|
import { type TabActivationEvent } from '../components/Tabs/TabActivationEvent';
|
|
2
3
|
import { type Region } from '../hooks/useRegions';
|
|
3
4
|
import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
|
|
@@ -8,6 +9,7 @@ interface GlobalEventMap {
|
|
|
8
9
|
dialog: DialogAction;
|
|
9
10
|
popup: PopupAction;
|
|
10
11
|
tab: TabActivationEvent;
|
|
12
|
+
fold: CarouselTariffsCardAction;
|
|
11
13
|
}
|
|
12
14
|
export declare const defaultEventBus: EventBus<GlobalEventMap>;
|
|
13
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultEventBus.js","sourceRoot":"","sources":["../../src/EventBus/defaultEventBus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultEventBus.js","sourceRoot":"","sources":["../../src/EventBus/defaultEventBus.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,QAAQ,EAAkB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
+
import { defaultEventBus } from '../../EventBus/defaultEventBus.js';
|
|
3
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
4
6
|
import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
|
|
5
7
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
|
|
@@ -10,12 +12,22 @@ import { LinkButton } from '../../ui-kit/LinkButton/LinkButton.js';
|
|
|
10
12
|
import { isIcon } from '../../utils/isIcon.js';
|
|
11
13
|
import { style } from '../../utils/style.js';
|
|
12
14
|
import { renderCardInfo } from './renderCardInfo.js';
|
|
13
|
-
export const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], ...rest }) => {
|
|
15
|
+
export const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, ...rest }) => {
|
|
14
16
|
const cellsNode = cardCells.map(renderCardInfo);
|
|
15
17
|
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
16
18
|
? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
|
|
17
19
|
: [cellsNode, []];
|
|
18
|
-
|
|
20
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
21
|
+
useEffect(() => defaultEventBus.subscribe('fold', (event) => {
|
|
22
|
+
if (options?.parent !== undefined && event.parent === options?.parent) {
|
|
23
|
+
setIsVisible(event.isUnfolded);
|
|
24
|
+
}
|
|
25
|
+
}), []);
|
|
26
|
+
return (_jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (_jsx("div", { className: "self-center", children: _jsx(Img, { image: icon }) })) : null, title ? (_jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? _jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (_jsx(Foldable, { renderFoldableSection: () => (_jsxs("div", { children: [visibleCells, _jsx(FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton(isVisible, options?.parent) : null })) : (_jsx("div", { children: visibleCells }))] }));
|
|
19
27
|
});
|
|
20
|
-
const renderFoldButton = (
|
|
28
|
+
const renderFoldButton = (isUnfolded, parent) => () => (_jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
|
|
29
|
+
if (parent !== undefined) {
|
|
30
|
+
defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
|
|
31
|
+
}
|
|
32
|
+
}, type: "button", children: [_jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), _jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
21
33
|
//# 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,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,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,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,KAAK,GAAG,aAAa,EACrB,IAAI,EACJ,MAAM,EACN,iBAAiB,GAAG,CAAC,EACrB,SAAS,GAAG,EAAE,EACd,OAAO,EACP,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,SAAS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C,CAAC,CAAC,IAAI,EAC9E,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CACpB,KAAC,QAAQ,IACP,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAC3B,0BACG,YAAY,EACb,KAAC,eAAe,IAAC,UAAU,EAAE,SAAS,YAAG,WAAW,GAAmB,IACnE,CACP,EACD,gBAAgB,EACd,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAE5E,CACH,CAAC,CAAC,CAAC,CACF,wBAAM,YAAY,GAAO,CAC1B,IACY,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,UAAoB,EAAE,MAAa,EAAE,EAAE,CAAC,GAAU,EAAE,CAC5E,CACE,kBACE,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;SACjF;IACH,CAAC,EACD,IAAI,EAAC,QAAQ,aAEb,wBAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB,GAAO,EACzD,KAAC,IAAI,IACH,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,GACX,IACK,CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselTariffsCardAction.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CarouselTariffsCardAction } from '../components/CarouselTariffsCard/CarouselTariffsCardAction';
|
|
1
2
|
import { type TabActivationEvent } from '../components/Tabs/TabActivationEvent';
|
|
2
3
|
import { type Region } from '../hooks/useRegions';
|
|
3
4
|
import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
|
|
@@ -8,6 +9,7 @@ interface GlobalEventMap {
|
|
|
8
9
|
dialog: DialogAction;
|
|
9
10
|
popup: PopupAction;
|
|
10
11
|
tab: TabActivationEvent;
|
|
12
|
+
fold: CarouselTariffsCardAction;
|
|
11
13
|
}
|
|
12
14
|
export declare const defaultEventBus: EventBus<GlobalEventMap>;
|
|
13
15
|
export {};
|
|
@@ -3174,14 +3174,24 @@
|
|
|
3174
3174
|
return (jsxs("div", { className: "py-lg border-b border-main-divider", children: [title ? (jsx("div", { className: "opacity-80", children: jsx(Text, { size: "text-m", color: "text-secondary-text", children: title }) })) : null, description ? (jsx("div", { className: "mt-2xs", children: jsx(Text, { size: "text-xl", color: "text-primary-text", children: description }) })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
|
|
3175
3175
|
};
|
|
3176
3176
|
|
|
3177
|
-
const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], ...rest }) => {
|
|
3177
|
+
const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, ...rest }) => {
|
|
3178
3178
|
const cellsNode = cardCells.map(renderCardInfo);
|
|
3179
3179
|
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
3180
3180
|
? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
|
|
3181
3181
|
: [cellsNode, []];
|
|
3182
|
-
|
|
3182
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
3183
|
+
useEffect(() => defaultEventBus.subscribe('fold', (event) => {
|
|
3184
|
+
if (options?.parent !== undefined && event.parent === options?.parent) {
|
|
3185
|
+
setIsVisible(event.isUnfolded);
|
|
3186
|
+
}
|
|
3187
|
+
}), []);
|
|
3188
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsx(Foldable, { renderFoldableSection: () => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$3(isVisible, options?.parent) : null })) : (jsx("div", { children: visibleCells }))] }));
|
|
3183
3189
|
});
|
|
3184
|
-
const renderFoldButton$3 = (
|
|
3190
|
+
const renderFoldButton$3 = (isUnfolded, parent) => () => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
|
|
3191
|
+
if (parent !== undefined) {
|
|
3192
|
+
defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
|
|
3193
|
+
}
|
|
3194
|
+
}, type: "button", children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
3185
3195
|
|
|
3186
3196
|
const gradientStyle = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
3187
3197
|
const dividerStyle$1 = 'border-main-divider border-b';
|
|
@@ -5661,7 +5671,7 @@
|
|
|
5661
5671
|
|
|
5662
5672
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
5663
5673
|
|
|
5664
|
-
const packageVersion = "0.14.
|
|
5674
|
+
const packageVersion = "0.14.245";
|
|
5665
5675
|
|
|
5666
5676
|
exports.Blocks = Blocks;
|
|
5667
5677
|
exports.ContentPage = ContentPage;
|