@redneckz/wildless-cms-uni-blocks 0.14.742 → 0.14.743
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/bundle.umd.js +109 -153
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/{renderFiltrationForm.d.ts → FiltrationForm.d.ts} +2 -2
- package/bundle/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
- package/bundle/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
- package/bundle/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
- package/bundle/ui-kit/Button/IconButton.d.ts +10 -0
- package/bundle/ui-kit/Foldable/Foldable.d.ts +0 -6
- package/bundle/utils/capitalize.d.ts +1 -0
- package/bundle/utils/dataAttributes.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/GroupedConsents.js +6 -7
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/{lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts → dist/components/OfficesAtmsMap/FiltrationForm.d.ts} +2 -2
- package/dist/components/OfficesAtmsMap/FiltrationForm.js +24 -0
- package/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
- package/dist/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
- package/dist/components/OfficesAtmsMap/FoldableCardContent.js +13 -0
- package/dist/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderAtmCard.js +6 -12
- package/dist/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderFoldButton.js +2 -4
- package/dist/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
- package/dist/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
- package/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
- package/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
- package/dist/components/RollupItem/RollupItem.js +17 -13
- package/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTable.js +3 -1
- package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/FilteredBlocks.js +2 -2
- package/dist/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
- package/dist/ui-kit/BaseFiltration/{renderGridBlocks.js → GridBlocks.js} +8 -7
- package/dist/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
- package/dist/ui-kit/Button/IconButton.d.ts +10 -0
- package/dist/ui-kit/Button/IconButton.js +13 -0
- package/dist/ui-kit/Button/IconButton.js.map +1 -0
- package/dist/ui-kit/Foldable/DefaultFoldButton.js +1 -5
- package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/dist/ui-kit/Foldable/Foldable.d.ts +0 -6
- package/dist/ui-kit/Foldable/Foldable.js +3 -10
- package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/dist/utils/capitalize.d.ts +1 -0
- package/dist/utils/capitalize.js +5 -0
- package/dist/utils/capitalize.js.map +1 -0
- package/dist/utils/dataAttributes.d.ts +2 -2
- package/dist/utils/dataAttributes.js +1 -6
- package/dist/utils/dataAttributes.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js +7 -8
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/{dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts → lib/components/OfficesAtmsMap/FiltrationForm.d.ts} +2 -2
- package/lib/components/OfficesAtmsMap/FiltrationForm.js +21 -0
- package/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
- package/lib/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
- package/lib/components/OfficesAtmsMap/FoldableCardContent.js +11 -0
- package/lib/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderAtmCard.js +6 -12
- package/lib/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderFoldButton.js +3 -5
- package/lib/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
- package/lib/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
- package/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
- package/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
- package/lib/components/RollupItem/RollupItem.js +18 -14
- package/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTable.js +3 -1
- package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/FilteredBlocks.js +3 -3
- package/lib/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
- package/{mobile/lib/ui-kit/BaseFiltration/renderGridBlocks.js → lib/ui-kit/BaseFiltration/GridBlocks.js} +7 -5
- package/lib/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
- package/lib/ui-kit/Button/IconButton.d.ts +10 -0
- package/lib/ui-kit/Button/IconButton.js +11 -0
- package/lib/ui-kit/Button/IconButton.js.map +1 -0
- package/lib/ui-kit/Foldable/DefaultFoldButton.js +1 -5
- package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/lib/ui-kit/Foldable/Foldable.d.ts +0 -6
- package/lib/ui-kit/Foldable/Foldable.js +4 -11
- package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/lib/utils/capitalize.d.ts +1 -0
- package/lib/utils/capitalize.js +2 -0
- package/lib/utils/capitalize.js.map +1 -0
- package/lib/utils/dataAttributes.d.ts +2 -2
- package/lib/utils/dataAttributes.js +1 -6
- package/lib/utils/dataAttributes.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +109 -153
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/{renderFiltrationForm.d.ts → FiltrationForm.d.ts} +2 -2
- package/mobile/bundle/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
- package/mobile/bundle/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
- package/mobile/bundle/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
- package/mobile/bundle/ui-kit/Button/IconButton.d.ts +10 -0
- package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +0 -6
- package/mobile/bundle/utils/capitalize.d.ts +1 -0
- package/mobile/bundle/utils/dataAttributes.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +6 -7
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.d.ts +13 -0
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js +24 -0
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
- package/mobile/dist/components/OfficesAtmsMap/FoldableCardContent.js +13 -0
- package/mobile/dist/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderAtmCard.js +6 -12
- package/mobile/dist/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.js +2 -4
- package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
- package/mobile/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
- package/mobile/dist/components/RollupItem/RollupItem.js +17 -13
- package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTable.js +3 -1
- package/mobile/dist/components/TariffsTable/TariffsTable.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/FilteredBlocks.js +2 -2
- package/mobile/dist/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
- package/mobile/dist/ui-kit/BaseFiltration/{renderGridBlocks.js → GridBlocks.js} +8 -7
- package/mobile/dist/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
- package/mobile/dist/ui-kit/Button/IconButton.d.ts +10 -0
- package/mobile/dist/ui-kit/Button/IconButton.js +13 -0
- package/mobile/dist/ui-kit/Button/IconButton.js.map +1 -0
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +1 -5
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +0 -6
- package/mobile/dist/ui-kit/Foldable/Foldable.js +3 -10
- package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/dist/utils/capitalize.d.ts +1 -0
- package/mobile/dist/utils/capitalize.js +5 -0
- package/mobile/dist/utils/capitalize.js.map +1 -0
- package/mobile/dist/utils/dataAttributes.d.ts +2 -2
- package/mobile/dist/utils/dataAttributes.js +1 -6
- package/mobile/dist/utils/dataAttributes.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +7 -8
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.d.ts +13 -0
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js +21 -0
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
- package/mobile/lib/components/OfficesAtmsMap/FoldableCardContent.js +11 -0
- package/mobile/lib/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderAtmCard.js +6 -12
- package/mobile/lib/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.js +3 -5
- package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
- package/mobile/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
- package/mobile/lib/components/RollupItem/RollupItem.js +18 -14
- package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTable.js +3 -1
- package/mobile/lib/components/TariffsTable/TariffsTable.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/FilteredBlocks.js +3 -3
- package/mobile/lib/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
- package/{lib/ui-kit/BaseFiltration/renderGridBlocks.js → mobile/lib/ui-kit/BaseFiltration/GridBlocks.js} +7 -5
- package/mobile/lib/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
- package/mobile/lib/ui-kit/Button/IconButton.d.ts +10 -0
- package/mobile/lib/ui-kit/Button/IconButton.js +11 -0
- package/mobile/lib/ui-kit/Button/IconButton.js.map +1 -0
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +1 -5
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +0 -6
- package/mobile/lib/ui-kit/Foldable/Foldable.js +4 -11
- package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/lib/utils/capitalize.d.ts +1 -0
- package/mobile/lib/utils/capitalize.js +2 -0
- package/mobile/lib/utils/capitalize.js.map +1 -0
- package/mobile/lib/utils/dataAttributes.d.ts +2 -2
- package/mobile/lib/utils/dataAttributes.js +1 -6
- package/mobile/lib/utils/dataAttributes.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +26 -44
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +21 -36
- package/mobile/src/components/OfficesAtmsMap/FiltrationForm.tsx +79 -0
- package/mobile/src/components/OfficesAtmsMap/FoldableCardContent.tsx +16 -0
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +7 -9
- package/mobile/src/components/OfficesAtmsMap/renderAtmCard.tsx +12 -27
- package/mobile/src/components/OfficesAtmsMap/renderFoldButton.tsx +6 -12
- package/mobile/src/components/OfficesAtmsMap/renderOfficeCard.tsx +9 -56
- package/mobile/src/components/OfficesAtmsMap/renderRemoteWorkplaceCard.tsx +4 -21
- package/mobile/src/components/RollupItem/RollupItem.tsx +29 -27
- package/mobile/src/components/TariffsTable/TariffsTable.tsx +10 -9
- package/mobile/src/ui-kit/BaseFiltration/FilteredBlocks.tsx +2 -2
- package/mobile/src/ui-kit/BaseFiltration/{renderGridBlocks.tsx → GridBlocks.tsx} +29 -32
- package/mobile/src/ui-kit/Button/IconButton.tsx +36 -0
- package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +7 -12
- package/mobile/src/ui-kit/Foldable/Foldable.tsx +7 -37
- package/mobile/src/utils/capitalize.ts +2 -0
- package/mobile/src/utils/dataAttributes.ts +1 -7
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +26 -44
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +21 -36
- package/src/components/OfficesAtmsMap/FiltrationForm.tsx +79 -0
- package/src/components/OfficesAtmsMap/FoldableCardContent.tsx +16 -0
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +7 -9
- package/src/components/OfficesAtmsMap/renderAtmCard.tsx +12 -27
- package/src/components/OfficesAtmsMap/renderFoldButton.tsx +6 -12
- package/src/components/OfficesAtmsMap/renderOfficeCard.tsx +9 -56
- package/src/components/OfficesAtmsMap/renderRemoteWorkplaceCard.tsx +4 -21
- package/src/components/RollupItem/RollupItem.tsx +29 -27
- package/src/components/TariffsTable/TariffsTable.tsx +10 -9
- package/src/icons/IconName.ts +4 -4
- package/src/ui-kit/BaseFiltration/FilteredBlocks.tsx +2 -2
- package/src/ui-kit/BaseFiltration/{renderGridBlocks.tsx → GridBlocks.tsx} +29 -32
- package/src/ui-kit/Button/IconButton.tsx +36 -0
- package/src/ui-kit/Foldable/DefaultFoldButton.tsx +7 -12
- package/src/ui-kit/Foldable/Foldable.tsx +7 -37
- package/src/utils/capitalize.ts +2 -0
- package/src/utils/dataAttributes.ts +1 -7
- package/bundle/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
- package/dist/components/OfficesAtmsMap/renderFiltrationForm.js +0 -26
- package/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
- package/dist/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
- package/dist/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
- package/lib/components/OfficesAtmsMap/renderFiltrationForm.js +0 -22
- package/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
- package/lib/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
- package/lib/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
- package/mobile/bundle/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
- package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts +0 -13
- package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js +0 -26
- package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
- package/mobile/dist/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
- package/mobile/dist/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
- package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +0 -13
- package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js +0 -22
- package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
- package/mobile/lib/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
- package/mobile/lib/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
- package/mobile/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +0 -87
- package/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +0 -87
|
@@ -2,14 +2,13 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type AspectsDef } from '../../model/AspectsProps';
|
|
4
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
+
import { IconButton } from '../../ui-kit/Button/IconButton';
|
|
5
6
|
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
6
7
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
7
8
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
8
|
-
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
9
9
|
import { Img } from '../../ui-kit/Img/Img';
|
|
10
10
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
11
11
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
12
|
-
import { getAspectsAttributes } from '../../utils/dataAttributes';
|
|
13
12
|
import { isIcon } from '../../utils/isIcon';
|
|
14
13
|
import { style } from '../../utils/style';
|
|
15
14
|
import { type CarouselTariffsCardContent } from './CarouselTariffsCardContent';
|
|
@@ -49,7 +48,7 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
49
48
|
[options?.parent],
|
|
50
49
|
);
|
|
51
50
|
|
|
52
|
-
const
|
|
51
|
+
const handleFold = useCallback(() => {
|
|
53
52
|
carouselTariffsCardEventBus.fire('fold', {
|
|
54
53
|
type: 'fold',
|
|
55
54
|
isUnfolded: !isVisible,
|
|
@@ -69,19 +68,15 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
69
68
|
) : null}
|
|
70
69
|
{button?.text ? <LinkButton className="w-full mt-m mb-lg" {...button} /> : null}
|
|
71
70
|
{hiddenCells.length ? (
|
|
72
|
-
<Foldable
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<FoldButton data={data} isUnfolded={isVisible} onClick={toggle} />
|
|
82
|
-
) : null
|
|
83
|
-
}
|
|
84
|
-
/>
|
|
71
|
+
<Foldable>
|
|
72
|
+
<div>
|
|
73
|
+
{visibleCells}
|
|
74
|
+
<FoldableSection isUnfolded={isVisible}>{hiddenCells}</FoldableSection>
|
|
75
|
+
</div>
|
|
76
|
+
{cardCells.length >= visibleCellsCount ? (
|
|
77
|
+
<FoldButton isUnfolded={isVisible} data={data} onClick={handleFold} />
|
|
78
|
+
) : null}
|
|
79
|
+
</Foldable>
|
|
85
80
|
) : (
|
|
86
81
|
<div>{visibleCells}</div>
|
|
87
82
|
)}
|
|
@@ -90,24 +85,14 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
90
85
|
},
|
|
91
86
|
);
|
|
92
87
|
|
|
93
|
-
const FoldButton = JSX<{
|
|
94
|
-
data
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onClick={onClick}
|
|
102
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
103
|
-
{...(isUnfolded ? getAspectsAttributes(data) : {})}
|
|
104
|
-
>
|
|
105
|
-
<div>{isUnfolded ? 'Скрыть' : 'Подробнее о тарифе'}</div>
|
|
106
|
-
<Icon
|
|
107
|
-
className="text-primary-text"
|
|
108
|
-
name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
109
|
-
width="16"
|
|
110
|
-
height="16"
|
|
88
|
+
const FoldButton = JSX<{ isUnfolded?: boolean; data?: AspectsDef[]; onClick?: () => void }>(
|
|
89
|
+
({ data, isUnfolded, onClick }) => (
|
|
90
|
+
<IconButton
|
|
91
|
+
className="w-full"
|
|
92
|
+
{...(isUnfolded
|
|
93
|
+
? { name: 'ArrowUpIcon', text: 'Скрыть', data }
|
|
94
|
+
: { name: 'ArrowDownIcon', text: 'Подробнее о тарифе' })}
|
|
95
|
+
onClick={onClick}
|
|
111
96
|
/>
|
|
112
|
-
|
|
113
|
-
)
|
|
97
|
+
),
|
|
98
|
+
);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
|
+
import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
4
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
5
|
+
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
6
|
+
import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
|
|
7
|
+
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
8
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
9
|
+
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
10
|
+
|
|
11
|
+
const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
|
|
12
|
+
|
|
13
|
+
export interface RenderFiltrationFormProps {
|
|
14
|
+
filters: string[];
|
|
15
|
+
field: { field: FormFieldRegisterer<any>; reset: () => void };
|
|
16
|
+
onlyOffice?: boolean;
|
|
17
|
+
labels: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const FiltrationForm = JSX<RenderFiltrationFormProps>(
|
|
21
|
+
({ filters, field: { field, reset }, onlyOffice, labels }) => {
|
|
22
|
+
const visibleFiltersNum = onlyOffice ? 5 : 6;
|
|
23
|
+
|
|
24
|
+
const filtersCheckbox = (filters || []).map((key) => (
|
|
25
|
+
<Checkbox key={key} text={labels[key]} {...field(key)} />
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
const [visibleFilters, hiddenFilters] =
|
|
29
|
+
visibleFiltersNum > 0
|
|
30
|
+
? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
|
|
31
|
+
: [filtersCheckbox, []];
|
|
32
|
+
|
|
33
|
+
const [isUnfolded, { toggle }] = useBool(false);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div>
|
|
37
|
+
{filters?.length ? (
|
|
38
|
+
<div>
|
|
39
|
+
<Foldable>
|
|
40
|
+
<div>
|
|
41
|
+
<div className={COMMON_FILTERS_STYLES}>{visibleFilters}</div>
|
|
42
|
+
<FoldableSection className={COMMON_FILTERS_STYLES} isUnfolded={isUnfolded}>
|
|
43
|
+
{hiddenFilters}
|
|
44
|
+
</FoldableSection>
|
|
45
|
+
</div>
|
|
46
|
+
{renderFoldButton(reset, onlyOffice)({ isUnfolded, onToggle: toggle })}
|
|
47
|
+
</Foldable>
|
|
48
|
+
</div>
|
|
49
|
+
) : null}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// TODO Столько разных кнопок с иконками, но эта самая творчески-ударённая реализация))
|
|
56
|
+
export const renderFoldButton =
|
|
57
|
+
(reset: () => void, onlyOffice = false) =>
|
|
58
|
+
({ isUnfolded, onToggle }: FoldablePartProps) =>
|
|
59
|
+
(
|
|
60
|
+
<div className="flex space-x-lg">
|
|
61
|
+
{onlyOffice ? (
|
|
62
|
+
<LinkButton
|
|
63
|
+
version="transparent"
|
|
64
|
+
className="text-secondary-text [&>*]:p-0"
|
|
65
|
+
appendRight={
|
|
66
|
+
<Icon name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'} width="16" height="16" />
|
|
67
|
+
}
|
|
68
|
+
text={isUnfolded ? 'Меньше фильтров' : 'Больше фильтров'}
|
|
69
|
+
onClick={onToggle}
|
|
70
|
+
/>
|
|
71
|
+
) : null}
|
|
72
|
+
<LinkButton version="transparent" className="text-secondary-text [&>*]:p-0" onClick={reset}>
|
|
73
|
+
<div className="flex items-center">
|
|
74
|
+
Очистить фильтр
|
|
75
|
+
<Icon name="CloseIcon" width="16" height="16" className="ml-2xs" />
|
|
76
|
+
</div>
|
|
77
|
+
</LinkButton>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
|
+
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
4
|
+
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
5
|
+
import { renderFoldButton } from './renderFoldButton';
|
|
6
|
+
|
|
7
|
+
export const FoldableCardContent = JSX(({ children }) => {
|
|
8
|
+
const [isUnfolded, { toggle }] = useBool(false);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Foldable className="block sm:hidden">
|
|
12
|
+
<FoldableSection isUnfolded={isUnfolded}>{children}</FoldableSection>
|
|
13
|
+
{renderFoldButton({ isUnfolded, onToggle: toggle })}
|
|
14
|
+
</Foldable>
|
|
15
|
+
);
|
|
16
|
+
});
|
|
@@ -6,11 +6,11 @@ import { ClientOnly } from '../../ui-kit/ClientOnly';
|
|
|
6
6
|
import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
|
|
7
7
|
import { style } from '../../utils/style';
|
|
8
8
|
import { FILTRATION_LABELS, FILTRATION_PREDICATES, INITIAL_FILTRATION_STATE } from './filters';
|
|
9
|
+
import { FiltrationForm } from './FiltrationForm';
|
|
9
10
|
import { type AtmsDef } from './OfficesAtmsMapContent';
|
|
10
11
|
import { type Atm, type Branch, type RemoteWorkplace } from './OfficesAtmsMapProps';
|
|
11
12
|
import { renderButtonsGroup } from './renderButtonsGroup';
|
|
12
13
|
import { renderDescriptionBlock } from './renderDescriptionBlock';
|
|
13
|
-
import { renderFiltrationForm, type RenderFiltrationFormOptions } from './renderFiltrationForm';
|
|
14
14
|
import { renderHeading } from './renderHeading';
|
|
15
15
|
import { useOfficesAtmsMapData } from './useOfficesAtmsMapData';
|
|
16
16
|
import { type BalloonContent } from './YandexMapProps';
|
|
@@ -63,13 +63,6 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
63
63
|
|
|
64
64
|
const [activeButton, setActiveButton] = useState('all');
|
|
65
65
|
|
|
66
|
-
const filterOptions: RenderFiltrationFormOptions = {
|
|
67
|
-
filters: getFiltersWithNonEmptyData([...data, ...remoteWorkplaces]),
|
|
68
|
-
field: { field, reset },
|
|
69
|
-
onlyOffice,
|
|
70
|
-
labels: FILTRATION_LABELS,
|
|
71
|
-
};
|
|
72
|
-
|
|
73
66
|
return (
|
|
74
67
|
<div className={style('space-y-1', className)}>
|
|
75
68
|
<div className="bg-white">
|
|
@@ -78,7 +71,12 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
78
71
|
{descriptionData ? renderDescriptionBlock(descriptionData) : null}
|
|
79
72
|
{onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton)}
|
|
80
73
|
<div className={style('pb-3xl', filtersVisibleStyles(activeButton))}>
|
|
81
|
-
|
|
74
|
+
<FiltrationForm
|
|
75
|
+
filters={getFiltersWithNonEmptyData([...data, ...remoteWorkplaces])}
|
|
76
|
+
field={{ field, reset }}
|
|
77
|
+
onlyOffice={onlyOffice}
|
|
78
|
+
labels={FILTRATION_LABELS}
|
|
79
|
+
/>
|
|
82
80
|
</div>
|
|
83
81
|
</div>
|
|
84
82
|
<div className="h-[600px]">
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
2
|
-
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
3
1
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
|
+
import { capitalize } from '../../utils/capitalize';
|
|
5
4
|
import { Badge } from './Badge';
|
|
6
|
-
import { CardCell } from './CardCell';
|
|
5
|
+
import { CardCell, type CardCellProps } from './CardCell';
|
|
7
6
|
import { CardRow } from './CardRow';
|
|
7
|
+
import { FoldableCardContent } from './FoldableCardContent';
|
|
8
8
|
import { type Atm } from './OfficesAtmsMapProps';
|
|
9
|
-
import { renderFoldButton } from './renderFoldButton';
|
|
10
9
|
|
|
11
10
|
export const renderAtmCard = (
|
|
12
11
|
{
|
|
@@ -21,10 +20,10 @@ export const renderAtmCard = (
|
|
|
21
20
|
}: Atm,
|
|
22
21
|
i: number,
|
|
23
22
|
) => {
|
|
24
|
-
const additionalInfo = [
|
|
23
|
+
const additionalInfo: CardCellProps[] = [
|
|
25
24
|
{
|
|
26
25
|
label: 'Устройство',
|
|
27
|
-
value:
|
|
26
|
+
value: capitalize(terminalType),
|
|
28
27
|
},
|
|
29
28
|
{ label: 'Модуль приема наличных', value: billAcceptorEnable ? 'Да' : 'Нет' },
|
|
30
29
|
{
|
|
@@ -42,7 +41,7 @@ export const renderAtmCard = (
|
|
|
42
41
|
<div key={String(i)} className="bg-white col-span-12 p-3xl sm:border-green sm:border">
|
|
43
42
|
<div className="sm:flex sm:justify-between">
|
|
44
43
|
<div>
|
|
45
|
-
<Text size="text-h4">{
|
|
44
|
+
<Text size="text-h4">{capitalize(location)}</Text>
|
|
46
45
|
{address ? (
|
|
47
46
|
<div className="flex pb-xl pt-xs gap-2xs">
|
|
48
47
|
<Icon name="GeolocationIcon" width="24" height="24" />
|
|
@@ -51,38 +50,24 @@ export const renderAtmCard = (
|
|
|
51
50
|
) : null}
|
|
52
51
|
</div>
|
|
53
52
|
<div className="whitespace-nowrap">
|
|
54
|
-
<Badge color="green">{
|
|
53
|
+
<Badge color="green">{capitalize(workTime)}</Badge>
|
|
55
54
|
</div>
|
|
56
55
|
</div>
|
|
57
56
|
<div className="hidden sm:block">
|
|
58
57
|
<CardRow className="flex-wrap">{additionalInfo?.map(renderInfo)}</CardRow>
|
|
59
58
|
</div>
|
|
60
|
-
<
|
|
61
|
-
className="
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<FoldableSection isUnfolded={isUnfolded}>
|
|
65
|
-
<CardRow className="flex-wrap">{additionalInfo?.map(renderInfo)}</CardRow>
|
|
66
|
-
</FoldableSection>
|
|
67
|
-
);
|
|
68
|
-
}}
|
|
69
|
-
//** TODO: Remove styles with refactoring DefaultFoldButton*/
|
|
70
|
-
renderFoldButton={({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle })}
|
|
71
|
-
/>
|
|
59
|
+
<FoldableCardContent>
|
|
60
|
+
<CardRow className="flex-wrap">{additionalInfo?.map(renderInfo)}</CardRow>
|
|
61
|
+
</FoldableCardContent>
|
|
72
62
|
</div>
|
|
73
63
|
);
|
|
74
64
|
};
|
|
75
65
|
|
|
76
66
|
export const getAtmPoint = ({ address = '', terminalType, atmCode = '' }: Atm) => {
|
|
77
|
-
const header = `${
|
|
67
|
+
const header = `${capitalize(terminalType)} №${atmCode}`;
|
|
78
68
|
const body = address.toUpperCase();
|
|
79
69
|
|
|
80
70
|
return { header, body };
|
|
81
71
|
};
|
|
82
72
|
|
|
83
|
-
const renderInfo = (item:
|
|
84
|
-
<CardCell key={String(i)} {...item} />
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const capitalizedFirstLetter = (text?: string) =>
|
|
88
|
-
text ? `${text?.charAt(0)?.toUpperCase()}${text?.slice(1)}` : '';
|
|
73
|
+
const renderInfo = (item: CardCellProps, i: number) => <CardCell key={String(i)} {...item} />;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { type IconName } from '../../icons/IconName';
|
|
2
1
|
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { IconButton } from '../../ui-kit/Button/IconButton';
|
|
3
3
|
import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
|
|
4
|
-
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
5
|
-
|
|
6
|
-
const ICONS: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
7
|
-
const labels = ['Подробнее', 'Скрыть'];
|
|
8
4
|
|
|
9
5
|
export const renderFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps): VNode => (
|
|
10
|
-
<
|
|
11
|
-
className="w-full
|
|
6
|
+
<IconButton
|
|
7
|
+
className="w-full border-b border-solid border-main-divider"
|
|
8
|
+
name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
9
|
+
text={isUnfolded ? 'Скрыть' : 'Подробнее'}
|
|
12
10
|
onClick={onToggle}
|
|
13
|
-
|
|
14
|
-
>
|
|
15
|
-
<div className="pr-m">{labels[Number(isUnfolded)]}</div>
|
|
16
|
-
<Icon className="text-primary-text" name={ICONS[Number(isUnfolded)]} width="16" height="16" />
|
|
17
|
-
</button>
|
|
11
|
+
/>
|
|
18
12
|
);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
2
|
-
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
3
1
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
5
3
|
import { CardCell } from './CardCell';
|
|
6
4
|
import { CardRow } from './CardRow';
|
|
5
|
+
import { FoldableCardContent } from './FoldableCardContent';
|
|
7
6
|
import { getScheduleDescription } from './getScheduleDescription';
|
|
8
7
|
import { getWorkScheduleWeek } from './getWorkScheduleWeek';
|
|
9
8
|
import { type Branch } from './OfficesAtmsMapProps';
|
|
@@ -11,77 +10,31 @@ import { renderAlternativeDay, renderBusinessSchedule } from './renderBusinessSc
|
|
|
11
10
|
import { renderCurrency } from './renderCurrency';
|
|
12
11
|
import { renderCurrentDaySchedule } from './renderCurrentDaySchedule';
|
|
13
12
|
import { renderDay } from './renderDay';
|
|
14
|
-
import { renderFoldButton } from './renderFoldButton';
|
|
15
13
|
import { renderWorkSchedule } from './renderWorkSchedule';
|
|
16
14
|
|
|
17
|
-
export const renderOfficeCard = (
|
|
18
|
-
{
|
|
19
|
-
name,
|
|
20
|
-
address,
|
|
21
|
-
phone,
|
|
22
|
-
fax,
|
|
23
|
-
phoneBusiness,
|
|
24
|
-
phoneNatural,
|
|
25
|
-
phoneCallCentre,
|
|
26
|
-
phoneCurrencyControl,
|
|
27
|
-
workSchedule,
|
|
28
|
-
exchangeRate,
|
|
29
|
-
}: Branch,
|
|
30
|
-
i: number,
|
|
31
|
-
) => {
|
|
32
|
-
if (!workSchedule) {
|
|
15
|
+
export const renderOfficeCard = (branch: Branch, i: number) => {
|
|
16
|
+
if (!branch.workSchedule) {
|
|
33
17
|
return null;
|
|
34
18
|
}
|
|
35
19
|
|
|
36
|
-
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
20
|
+
const workScheduleWeek = getWorkScheduleWeek(branch.workSchedule);
|
|
37
21
|
|
|
38
22
|
return (
|
|
39
23
|
<div key={String(i)} className="bg-white col-span-12 p-3xl sm:border-green sm:border">
|
|
40
24
|
<div className="sm:flex sm:justify-between">
|
|
41
25
|
<div>
|
|
42
|
-
<Text size="text-h4">{name}</Text>
|
|
43
|
-
{address ? (
|
|
26
|
+
<Text size="text-h4">{branch.name}</Text>
|
|
27
|
+
{branch.address ? (
|
|
44
28
|
<div className="flex pb-xl pt-xs gap-2xs">
|
|
45
29
|
<Icon name="GeolocationIcon" width="24" height="24" />
|
|
46
|
-
<Text size="text-l">{address}</Text>
|
|
30
|
+
<Text size="text-l">{branch.address}</Text>
|
|
47
31
|
</div>
|
|
48
32
|
) : null}
|
|
49
33
|
</div>
|
|
50
34
|
{renderCurrentDaySchedule(workScheduleWeek)}
|
|
51
35
|
</div>
|
|
52
|
-
<div className="hidden sm:block">
|
|
53
|
-
|
|
54
|
-
phone,
|
|
55
|
-
fax,
|
|
56
|
-
phoneBusiness,
|
|
57
|
-
phoneNatural,
|
|
58
|
-
phoneCallCentre,
|
|
59
|
-
phoneCurrencyControl,
|
|
60
|
-
workSchedule,
|
|
61
|
-
exchangeRate,
|
|
62
|
-
})}
|
|
63
|
-
</div>
|
|
64
|
-
<Foldable
|
|
65
|
-
className="block sm:hidden"
|
|
66
|
-
renderFoldableSection={({ isUnfolded }) => {
|
|
67
|
-
return (
|
|
68
|
-
<FoldableSection isUnfolded={isUnfolded}>
|
|
69
|
-
{renderCardContent({
|
|
70
|
-
phone,
|
|
71
|
-
fax,
|
|
72
|
-
phoneBusiness,
|
|
73
|
-
phoneNatural,
|
|
74
|
-
phoneCallCentre,
|
|
75
|
-
phoneCurrencyControl,
|
|
76
|
-
workSchedule,
|
|
77
|
-
exchangeRate,
|
|
78
|
-
})}
|
|
79
|
-
</FoldableSection>
|
|
80
|
-
);
|
|
81
|
-
}}
|
|
82
|
-
//** TODO: remove styles with refactoring DefaultFoldButton*/
|
|
83
|
-
renderFoldButton={({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle })}
|
|
84
|
-
/>
|
|
36
|
+
<div className="hidden sm:block">{renderCardContent(branch)}</div>
|
|
37
|
+
<FoldableCardContent>{renderCardContent(branch)}</FoldableCardContent>
|
|
85
38
|
</div>
|
|
86
39
|
);
|
|
87
40
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
2
|
-
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
3
1
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
5
3
|
import { CardCell } from './CardCell';
|
|
6
4
|
import { CardRow } from './CardRow';
|
|
5
|
+
import { FoldableCardContent } from './FoldableCardContent';
|
|
7
6
|
import { type RemoteWorkplace } from './OfficesAtmsMapProps';
|
|
8
|
-
import { renderFoldButton } from './renderFoldButton';
|
|
9
7
|
|
|
10
8
|
export const renderRemoteWorkplaceCard = (
|
|
11
9
|
{ address, workScheduleDescription }: RemoteWorkplace,
|
|
@@ -28,28 +26,13 @@ export const renderRemoteWorkplaceCard = (
|
|
|
28
26
|
) : null}
|
|
29
27
|
</div>
|
|
30
28
|
</div>
|
|
31
|
-
<div className="hidden sm:block">
|
|
32
|
-
|
|
33
|
-
workScheduleDescription,
|
|
34
|
-
})}
|
|
35
|
-
</div>
|
|
36
|
-
<Foldable
|
|
37
|
-
className="block sm:hidden"
|
|
38
|
-
renderFoldableSection={({ isUnfolded }) => (
|
|
39
|
-
<FoldableSection isUnfolded={isUnfolded}>
|
|
40
|
-
{renderCardContent({
|
|
41
|
-
workScheduleDescription,
|
|
42
|
-
})}
|
|
43
|
-
</FoldableSection>
|
|
44
|
-
)}
|
|
45
|
-
//** TODO: remove styles with refactoring DefaultFoldButton*/
|
|
46
|
-
renderFoldButton={({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle })}
|
|
47
|
-
/>
|
|
29
|
+
<div className="hidden sm:block">{renderCardContent(workScheduleDescription)}</div>
|
|
30
|
+
<FoldableCardContent>{renderCardContent(workScheduleDescription)}</FoldableCardContent>
|
|
48
31
|
</div>
|
|
49
32
|
);
|
|
50
33
|
};
|
|
51
34
|
|
|
52
|
-
const renderCardContent = (
|
|
35
|
+
const renderCardContent = (workScheduleDescription?: string) => {
|
|
53
36
|
return (
|
|
54
37
|
<div>
|
|
55
38
|
<CardRow className="flex">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
1
2
|
import { renderChildren } from '../../BlockRenderer/renderChildren';
|
|
2
3
|
import { useMobileMode } from '../../hooks/useMobileMode';
|
|
3
4
|
import { type Picture } from '../../model/Picture';
|
|
@@ -37,6 +38,29 @@ export const RollupItem = UniBlock<RollupItemProps>(
|
|
|
37
38
|
}) => {
|
|
38
39
|
const isMobile = useMobileMode();
|
|
39
40
|
|
|
41
|
+
const [isUnfolded, { toggle }] = useBool(isExpanded);
|
|
42
|
+
|
|
43
|
+
const foldableSection = (
|
|
44
|
+
<FoldableSection
|
|
45
|
+
className={style('gap-lg', getFoldableStyles(isMobile))}
|
|
46
|
+
isUnfolded={isUnfolded}
|
|
47
|
+
>
|
|
48
|
+
{renderChildren({
|
|
49
|
+
...rest,
|
|
50
|
+
extraProps: { className: 'w-full', padding: 'p-0' },
|
|
51
|
+
})}
|
|
52
|
+
</FoldableSection>
|
|
53
|
+
);
|
|
54
|
+
const foldButton = renderFoldButton({
|
|
55
|
+
foldButtonVersion,
|
|
56
|
+
label,
|
|
57
|
+
labelIcon,
|
|
58
|
+
labelIconBgVersion,
|
|
59
|
+
isMobile,
|
|
60
|
+
isUnfolded,
|
|
61
|
+
onToggle: toggle,
|
|
62
|
+
});
|
|
63
|
+
|
|
40
64
|
return (
|
|
41
65
|
<BlockWrapper
|
|
42
66
|
className={style(
|
|
@@ -49,32 +73,10 @@ export const RollupItem = UniBlock<RollupItemProps>(
|
|
|
49
73
|
role={role}
|
|
50
74
|
{...rest}
|
|
51
75
|
>
|
|
52
|
-
<Foldable
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<FoldableSection
|
|
57
|
-
className={style('gap-lg', getFoldableStyles(isMobile))}
|
|
58
|
-
isUnfolded={isUnfolded}
|
|
59
|
-
>
|
|
60
|
-
{renderChildren({
|
|
61
|
-
...rest,
|
|
62
|
-
extraProps: { className: 'w-full', padding: 'p-0' },
|
|
63
|
-
})}
|
|
64
|
-
</FoldableSection>
|
|
65
|
-
)}
|
|
66
|
-
renderFoldButton={({ isUnfolded, onToggle }) =>
|
|
67
|
-
renderFoldButton({
|
|
68
|
-
foldButtonVersion,
|
|
69
|
-
label,
|
|
70
|
-
labelIcon,
|
|
71
|
-
labelIconBgVersion,
|
|
72
|
-
isUnfolded,
|
|
73
|
-
onToggle,
|
|
74
|
-
isMobile,
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
/>
|
|
76
|
+
<Foldable>
|
|
77
|
+
{isFoldButtonOnTop ? foldButton : foldableSection}
|
|
78
|
+
{isFoldButtonOnTop ? foldableSection : foldButton}
|
|
79
|
+
</Foldable>
|
|
78
80
|
</BlockWrapper>
|
|
79
81
|
);
|
|
80
82
|
},
|
|
@@ -98,8 +100,8 @@ const renderFoldButton = ({
|
|
|
98
100
|
labelIcon,
|
|
99
101
|
labelIconBgVersion,
|
|
100
102
|
isUnfolded,
|
|
101
|
-
onToggle,
|
|
102
103
|
isMobile = false,
|
|
104
|
+
onToggle,
|
|
103
105
|
}: FoldButtonProps) => {
|
|
104
106
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
105
107
|
const icon = getIconName(isUnfolded, isMobile);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
2
3
|
import { useCarouselControls } from '../../hooks/useCarouselControls';
|
|
3
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
5
|
import { renderDefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
|
|
@@ -40,6 +41,8 @@ export const TariffsTable = JSX<TariffsTableProps>(
|
|
|
40
41
|
const [visibleRows, hiddenRows] =
|
|
41
42
|
hiddenRowsNum > 0 ? [rows.slice(0, -hiddenRowsNum), rows.slice(-hiddenRowsNum)] : [rows, []];
|
|
42
43
|
|
|
44
|
+
const [isUnfolded, { toggle }] = useBool(false);
|
|
45
|
+
|
|
43
46
|
return (
|
|
44
47
|
<BlockWrapper
|
|
45
48
|
className={style('relative space-y-6xl @4xl:space-y-xl', className)}
|
|
@@ -55,15 +58,13 @@ export const TariffsTable = JSX<TariffsTableProps>(
|
|
|
55
58
|
/>
|
|
56
59
|
<div className="space-y-m overflow-hidden">
|
|
57
60
|
{hiddenRowsNum > 0 ? (
|
|
58
|
-
<Foldable
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
renderFoldButton={renderDefaultFoldButton}
|
|
66
|
-
/>
|
|
61
|
+
<Foldable>
|
|
62
|
+
<TariffsTableWrapper controls={controls}>
|
|
63
|
+
{visibleRows}
|
|
64
|
+
<FoldableSection isUnfolded={isUnfolded}>{hiddenRows}</FoldableSection>
|
|
65
|
+
</TariffsTableWrapper>
|
|
66
|
+
{renderDefaultFoldButton({ isUnfolded, onToggle: toggle })}
|
|
67
|
+
</Foldable>
|
|
67
68
|
) : (
|
|
68
69
|
<TariffsTableWrapper controls={controls}>{rows}</TariffsTableWrapper>
|
|
69
70
|
)}
|