@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.
Files changed (43) hide show
  1. package/bundle/EventBus/defaultEventBus.d.ts +2 -0
  2. package/bundle/bundle.umd.js +14 -4
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  5. package/dist/EventBus/defaultEventBus.d.ts +2 -0
  6. package/dist/EventBus/defaultEventBus.js.map +1 -1
  7. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
  8. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  9. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  10. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  11. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  12. package/lib/EventBus/defaultEventBus.d.ts +2 -0
  13. package/lib/EventBus/defaultEventBus.js.map +1 -1
  14. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
  15. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  16. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  17. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  18. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  19. package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -0
  20. package/mobile/bundle/bundle.umd.js +14 -4
  21. package/mobile/bundle/bundle.umd.min.js +1 -1
  22. package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  23. package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -0
  24. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
  25. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
  26. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  27. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  28. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  29. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  30. package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -0
  31. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
  32. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +15 -3
  33. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  34. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  35. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  36. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  37. package/mobile/src/EventBus/defaultEventBus.ts +2 -0
  38. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +40 -19
  39. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  40. package/package.json +1 -1
  41. package/src/EventBus/defaultEventBus.ts +2 -0
  42. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +40 -19
  43. 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 {};
@@ -3211,14 +3211,24 @@
3211
3211
  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)));
3212
3212
  };
3213
3213
 
3214
- const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], ...rest }) => {
3214
+ const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, ...rest }) => {
3215
3215
  const cellsNode = cardCells.map(renderCardInfo);
3216
3216
  const [visibleCells, hiddenCells] = visibleCellsCount > 0
3217
3217
  ? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
3218
3218
  : [cellsNode, []];
3219
- 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: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$3 : null })) : (jsx("div", { children: visibleCells }))] }));
3219
+ const [isVisible, setIsVisible] = useState(false);
3220
+ useEffect(() => defaultEventBus.subscribe('fold', (event) => {
3221
+ if (options?.parent !== undefined && event.parent === options?.parent) {
3222
+ setIsVisible(event.isUnfolded);
3223
+ }
3224
+ }), []);
3225
+ 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 }))] }));
3220
3226
  });
3221
- const renderFoldButton$3 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: onToggle, type: "button", children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
3227
+ const renderFoldButton$3 = (isUnfolded, parent) => () => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
3228
+ if (parent !== undefined) {
3229
+ defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
3230
+ }
3231
+ }, type: "button", children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
3222
3232
 
3223
3233
  const gradientStyle = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
3224
3234
  const borderStyle = 'border-gray border-solid border';
@@ -6039,7 +6049,7 @@
6039
6049
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6040
6050
  });
6041
6051
 
6042
- const packageVersion = "0.14.244";
6052
+ const packageVersion = "0.14.245";
6043
6053
 
6044
6054
  exports.Blocks = Blocks;
6045
6055
  exports.ContentPage = ContentPage;