@redneckz/wildless-cms-uni-blocks 0.14.336 → 0.14.337

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 (115) hide show
  1. package/bin/migration-scripts/0.14.213.js +1 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +57 -42
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/ui-kit/TabsControl/TabItem.d.ts +1 -2
  6. package/bundle/ui-kit/TabsControl/TabItemInner.d.ts +1 -0
  7. package/bundle/utils/getVersion.d.ts +1 -0
  8. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -2
  9. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  10. package/dist/components/TabsLayout/TabsLayout.js +16 -10
  11. package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  12. package/dist/components/TabsLayout/renderTabsLayout.js +14 -12
  13. package/dist/components/TabsLayout/renderTabsLayout.js.map +1 -1
  14. package/dist/ui-kit/Badge/Badge.js +1 -3
  15. package/dist/ui-kit/Badge/Badge.js.map +1 -1
  16. package/dist/ui-kit/BaseFiltration/useHotFilters.js +3 -3
  17. package/dist/ui-kit/BaseFiltration/useHotFilters.js.map +1 -1
  18. package/dist/ui-kit/TabsControl/ScrollableTabsControl.js +9 -4
  19. package/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  20. package/dist/ui-kit/TabsControl/TabItem.d.ts +1 -2
  21. package/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
  22. package/dist/ui-kit/TabsControl/TabItemInner.d.ts +1 -0
  23. package/dist/ui-kit/TabsControl/TabItemInner.js +4 -2
  24. package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  25. package/dist/utils/getVersion.d.ts +1 -0
  26. package/dist/utils/getVersion.js +5 -0
  27. package/dist/utils/getVersion.js.map +1 -0
  28. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -2
  29. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  30. package/lib/components/TabsLayout/TabsLayout.fixture.d.ts +4 -3
  31. package/lib/components/TabsLayout/TabsLayout.fixture.mobile.d.ts +4 -2
  32. package/lib/components/TabsLayout/TabsLayout.js +16 -10
  33. package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  34. package/lib/components/TabsLayout/renderTabsLayout.js +14 -12
  35. package/lib/components/TabsLayout/renderTabsLayout.js.map +1 -1
  36. package/lib/ui-kit/Badge/Badge.js +1 -3
  37. package/lib/ui-kit/Badge/Badge.js.map +1 -1
  38. package/lib/ui-kit/BaseFiltration/useHotFilters.js +3 -3
  39. package/lib/ui-kit/BaseFiltration/useHotFilters.js.map +1 -1
  40. package/lib/ui-kit/TabsControl/ScrollableTabsControl.js +9 -4
  41. package/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  42. package/lib/ui-kit/TabsControl/TabItem.d.ts +1 -2
  43. package/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
  44. package/lib/ui-kit/TabsControl/TabItemInner.d.ts +1 -0
  45. package/lib/ui-kit/TabsControl/TabItemInner.js +4 -2
  46. package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  47. package/lib/utils/getVersion.d.ts +1 -0
  48. package/lib/utils/getVersion.js +2 -0
  49. package/lib/utils/getVersion.js.map +1 -0
  50. package/mobile/bundle/bundle.umd.js +57 -42
  51. package/mobile/bundle/bundle.umd.min.js +1 -1
  52. package/mobile/bundle/ui-kit/TabsControl/TabItem.d.ts +1 -2
  53. package/mobile/bundle/ui-kit/TabsControl/TabItemInner.d.ts +1 -0
  54. package/mobile/bundle/utils/getVersion.d.ts +1 -0
  55. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -2
  56. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  57. package/mobile/dist/components/TabsLayout/TabsLayout.js +16 -10
  58. package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  59. package/mobile/dist/components/TabsLayout/renderTabsLayout.js +14 -12
  60. package/mobile/dist/components/TabsLayout/renderTabsLayout.js.map +1 -1
  61. package/mobile/dist/ui-kit/Badge/Badge.js +1 -3
  62. package/mobile/dist/ui-kit/Badge/Badge.js.map +1 -1
  63. package/mobile/dist/ui-kit/BaseFiltration/useHotFilters.js +3 -3
  64. package/mobile/dist/ui-kit/BaseFiltration/useHotFilters.js.map +1 -1
  65. package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js +9 -4
  66. package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  67. package/mobile/dist/ui-kit/TabsControl/TabItem.d.ts +1 -2
  68. package/mobile/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
  69. package/mobile/dist/ui-kit/TabsControl/TabItemInner.d.ts +1 -0
  70. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +4 -2
  71. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  72. package/mobile/dist/utils/getVersion.d.ts +1 -0
  73. package/mobile/dist/utils/getVersion.js +5 -0
  74. package/mobile/dist/utils/getVersion.js.map +1 -0
  75. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -2
  76. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  77. package/mobile/lib/components/TabsLayout/TabsLayout.js +16 -10
  78. package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  79. package/mobile/lib/components/TabsLayout/renderTabsLayout.js +14 -12
  80. package/mobile/lib/components/TabsLayout/renderTabsLayout.js.map +1 -1
  81. package/mobile/lib/ui-kit/Badge/Badge.js +1 -3
  82. package/mobile/lib/ui-kit/Badge/Badge.js.map +1 -1
  83. package/mobile/lib/ui-kit/BaseFiltration/useHotFilters.js +3 -3
  84. package/mobile/lib/ui-kit/BaseFiltration/useHotFilters.js.map +1 -1
  85. package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js +9 -4
  86. package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  87. package/mobile/lib/ui-kit/TabsControl/TabItem.d.ts +1 -2
  88. package/mobile/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
  89. package/mobile/lib/ui-kit/TabsControl/TabItemInner.d.ts +1 -0
  90. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +4 -2
  91. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  92. package/mobile/lib/utils/getVersion.d.ts +1 -0
  93. package/mobile/lib/utils/getVersion.js +2 -0
  94. package/mobile/lib/utils/getVersion.js.map +1 -0
  95. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +3 -2
  96. package/mobile/src/components/TabsLayout/TabsLayout.tsx +20 -10
  97. package/mobile/src/components/TabsLayout/renderTabsLayout.tsx +24 -20
  98. package/mobile/src/ui-kit/Badge/Badge.tsx +13 -15
  99. package/mobile/src/ui-kit/BaseFiltration/useHotFilters.tsx +3 -7
  100. package/mobile/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +13 -16
  101. package/mobile/src/ui-kit/TabsControl/TabItem.tsx +1 -2
  102. package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +9 -2
  103. package/mobile/src/utils/getVersion.ts +1 -0
  104. package/package.json +1 -1
  105. package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +3 -2
  106. package/src/components/TabsLayout/TabsLayout.fixture.mobile.tsx +70 -24
  107. package/src/components/TabsLayout/TabsLayout.fixture.tsx +33 -29
  108. package/src/components/TabsLayout/TabsLayout.tsx +20 -10
  109. package/src/components/TabsLayout/renderTabsLayout.tsx +24 -20
  110. package/src/ui-kit/Badge/Badge.tsx +13 -15
  111. package/src/ui-kit/BaseFiltration/useHotFilters.tsx +3 -7
  112. package/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +13 -16
  113. package/src/ui-kit/TabsControl/TabItem.tsx +1 -2
  114. package/src/ui-kit/TabsControl/TabItemInner.tsx +9 -2
  115. package/src/utils/getVersion.ts +1 -0
@@ -6,14 +6,19 @@ import { SwipeListContainer } from '../SwipeListControl/SwipeListContainer.js';
6
6
  import { useSwipeListScroll } from '../SwipeListControl/useSwipeListScroll.js';
7
7
  import { renderTab } from './renderTab.js';
8
8
  const scrollButtonStyle = 'hidden sm:flex absolute z-40';
9
- const scrollStyleType = {
9
+ const scrollStyle = {
10
+ default: {
11
+ item: 'flex-1',
12
+ gap: 0,
13
+ buttonTop: 'top-0',
14
+ },
10
15
  animated: {
11
- itemClassName: 'flex',
16
+ item: 'flex',
12
17
  gap: 8,
13
18
  buttonTop: 'top-5',
14
19
  },
15
20
  underlined: {
16
- itemClassName: '',
21
+ item: '',
17
22
  gap: 0,
18
23
  buttonTop: 'top-0',
19
24
  },
@@ -22,6 +27,6 @@ export const ScrollableTabsControl = JSX(({ className, items = [], value, onChan
22
27
  const [containerRef, scroll] = useSwipeListScroll({
23
28
  itemCount: items?.length || 0,
24
29
  });
25
- return (_jsxs("div", { className: style('relative overflow-x-auto no-scrollbar', className), children: [_jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, itemClassName: scrollStyleType[tabsType].itemClassName, gap: scrollStyleType[tabsType].gap, children: items.map(renderTab(value, onChange, tabsType)) }), scroll.canScrollLeft ? (_jsx(ScrollLeftButton, { className: style('left-6', scrollButtonStyle, scrollStyleType[tabsType].buttonTop), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (_jsx(ScrollRightButton, { className: style('right-6', scrollButtonStyle, scrollStyleType[tabsType].buttonTop), onClick: scroll.scrollRight })) : null] }));
30
+ return (_jsxs("div", { className: style('relative overflow-x-auto no-scrollbar', className), children: [_jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, itemClassName: scrollStyle[tabsType].item, gap: scrollStyle[tabsType].gap, children: items.map(renderTab(value, onChange, tabsType)) }), scroll.canScrollLeft ? (_jsx(ScrollLeftButton, { className: style('left-6', scrollButtonStyle, scrollStyle[tabsType].buttonTop), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (_jsx(ScrollRightButton, { className: style('right-6', scrollButtonStyle, scrollStyle[tabsType].buttonTop), onClick: scroll.scrollRight })) : null] }));
26
31
  });
27
32
  //# sourceMappingURL=ScrollableTabsControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollableTabsControl.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/ScrollableTabsControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;AAEzD,MAAM,eAAe,GAAG;IACtB,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM;QACrB,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,OAAO;KACnB;IACD,UAAU,EAAE;QACV,aAAa,EAAE,EAAE;QACjB,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,OAAO;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CACtC,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAAE,EAAE,EAAE;IACnE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,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C,aAAa,CAAC,CAAC,CAAC,CACtB,KAAC,gBAAgB,IACf,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC9E,OAAO,EAAE,MAAM,CAAC,UAAU,GAC1B,CACH,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CACvB,KAAC,iBAAiB,IAChB,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC/E,OAAO,EAAE,MAAM,CAAC,WAAW,GAC3B,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
2
2
  import { type LinkProps } from '../../model/LinkProps';
3
3
  import { type IconProps } from '../../model/Picture';
4
- import { type VNode } from '../../model/VNode';
5
4
  import { type TabsControlProps, type TabsType } from './TabsControlProps';
6
5
  export interface TabItemBase extends LinkProps, TitleProps, DescriptionProps, IconProps {
7
6
  name?: string;
8
- appendRight?: VNode;
7
+ count?: number;
9
8
  }
10
9
  export interface TabItemProps {
11
10
  item?: TabItemBase;
@@ -1 +1 @@
1
- {"version":3,"file":"TabItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAc9C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAe,CAAC,KAAK,EAAE,EAAE,CACjD,KAAK,EAAE,IAAI,EAA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AAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,KAAM,IAAI,GAAI,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { type TabItemProps } from './TabItem';
2
2
  interface TabItemInnerProps extends TabItemProps {
3
3
  tag?: string;
4
+ count?: number;
4
5
  }
5
6
  export declare const TabItemInner: import("@redneckz/uni-jsx").UNIComponent<TabItemInnerProps, any, any>;
6
7
  export {};
@@ -1,6 +1,8 @@
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 { getVersion } from '../../utils/getVersion.js';
3
4
  import { style } from '../../utils/style.js';
5
+ import { Badge } from '../Badge/Badge.js';
4
6
  import { renderTabItemInner } from './renderTabItemInner.js';
5
7
  const tabPaddingStyleMap = {
6
8
  default: 'px-xs',
@@ -25,13 +27,13 @@ const activeTabBgStyleMap = {
25
27
  };
26
28
  export const TabItemInner = JSX(({ tag = 'div', item = {}, isActive = false, type = 'default', onClick }) => {
27
29
  const Tag = tag;
28
- const { text, description, icon, appendRight, ...link } = item;
30
+ const { text, description, icon, count, ...link } = item;
29
31
  return (_jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tablist", onClick: onClick, ...link, children: _jsxs("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: [renderTabItemInner({
30
32
  text,
31
33
  description,
32
34
  icon,
33
35
  isActive,
34
36
  type,
35
- }), appendRight ? _jsx("div", { className: "ml-xs", children: appendRight }) : null] }) }));
37
+ }), Number.isInteger(count) ? (_jsx("div", { className: "ml-xs", children: _jsx(Badge, { count: count, version: getVersion(isActive) }) })) : null] }) }));
36
38
  });
37
39
  //# sourceMappingURL=TabItemInner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabItemInner.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItemInner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI1D,MAAM,kBAAkB,GAA6B;IACnD,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,kFAAkF;CAC7F,CAAC;AAEF,MAAM,YAAY,GAAG,6CAA6C,CAAC;AAEnE,MAAM,qBAAqB,GAA6B;IACtD,OAAO,EAAE,0BAA0B;IACnC,UAAU,EAAE,8BAA8B;IAC1C,QAAQ,EAAE,0BAA0B;CACrC,CAAC;AAEF,MAAM,aAAa,GAA6B;IAC9C,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,mEAAmE;CAC9E,CAAC;AAEF,MAAM,mBAAmB,GAA6B;IACpD,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,sDAAsD;CACjE,CAAC;AAMF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,QAAQ,GAAG,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1E,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAE/D,OAAO,CACL,KA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AAC,OAAO,YACpB,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAI,GAClD,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const getVersion: (isPrimary: boolean) => "primary" | "secondary";
@@ -0,0 +1,2 @@
1
+ export const getVersion = (isPrimary) => (isPrimary ? 'primary' : 'secondary');
2
+ //# sourceMappingURL=getVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../../src/utils/getVersion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAkB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
@@ -7,6 +7,7 @@ import { ClientOnly } from '../../ui-kit/ClientOnly';
7
7
  import { Heading } from '../../ui-kit/Heading/Heading';
8
8
  import { Text } from '../../ui-kit/Text/Text';
9
9
  import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
10
+ import { getVersion } from '../../utils/getVersion';
10
11
  import { style } from '../../utils/style';
11
12
  import { type AtmsDef } from './OfficesAtmsMapContent';
12
13
  import { type Atm, type Branch, type RemoteWorkplace } from './OfficesAtmsMapProps';
@@ -117,9 +118,9 @@ const renderButtonsGroup = (
117
118
  activeButton: string,
118
119
  onButtonClick: (item: string) => void,
119
120
  ) => {
120
- const allButtonVersion = activeButton === 'all' ? 'primary' : 'secondary';
121
+ const allButtonVersion = getVersion(activeButton === 'all');
121
122
 
122
- const businessButtonVersion = activeButton === 'business' ? 'primary' : 'secondary';
123
+ const businessButtonVersion = getVersion(activeButton === 'business');
123
124
 
124
125
  const handleClick = (e: any, key: string, branches: Branch[]) => {
125
126
  if (e.currentTarget === e.target && key === 'business') {
@@ -11,21 +11,31 @@ import { type Tab, type TabsLayoutContent } from './TabsLayoutContent';
11
11
 
12
12
  const TAB_QUERY_PARAM_KEY = 'tab';
13
13
 
14
+ type TabCountedProps = Tab & {
15
+ count?: number;
16
+ };
14
17
  export interface TabsLayoutProps extends TabsLayoutContent, UniBlockProps {}
15
18
 
16
19
  export const TabsLayout = UniBlock<TabsLayoutProps>(
17
- ({ className = '', tabs = [], block, tabsType, ...rest }) => {
20
+ ({ className = '', tabs = [], block, tabsType, showCounter = false, ...rest }) => {
18
21
  const router = useRouter();
19
22
 
23
+ const tabsCounted: TabCountedProps[] = showCounter
24
+ ? tabs.map((_) => ({
25
+ ..._,
26
+ count: block?.slots?.[_?.text ?? '']?.length ?? 0,
27
+ }))
28
+ : tabs;
29
+
20
30
  const { isReady } = router;
21
31
 
22
- const [activeTabIndex, setActiveTabIndex] = useState(getInitSelectedIndex(tabs));
32
+ const [activeTabIndex, setActiveTabIndex] = useState(getInitSelectedIndex(tabsCounted));
23
33
 
24
- const defaultSelectedTab = tabs.findIndex((_) => Boolean(_.selected));
34
+ const defaultSelectedTab = tabsCounted.findIndex((_) => Boolean(_.selected));
25
35
 
26
36
  useEffect(() => {
27
37
  const defaultTabIndex = router.query[TAB_QUERY_PARAM_KEY]
28
- ? tabs.findIndex(
38
+ ? tabsCounted.findIndex(
29
39
  (_, index) => _.type === 'group' && String(index) === router.query[TAB_QUERY_PARAM_KEY],
30
40
  )
31
41
  : defaultSelectedTab;
@@ -33,7 +43,7 @@ export const TabsLayout = UniBlock<TabsLayoutProps>(
33
43
  setActiveTabIndex(defaultTabIndex === -1 ? 0 : defaultTabIndex);
34
44
  }, [isReady, defaultSelectedTab]);
35
45
 
36
- const slotName = getSlotName(tabs[activeTabIndex], activeTabIndex);
46
+ const slotName = getSlotName(tabsCounted[activeTabIndex], activeTabIndex);
37
47
 
38
48
  const updateUrlSearchTabParam = (_: TabItemBase, index: number) => {
39
49
  const searchParams = new URLSearchParams(router.query as Record<string, string>);
@@ -47,8 +57,8 @@ export const TabsLayout = UniBlock<TabsLayoutProps>(
47
57
 
48
58
  const handleChange = useCallback(
49
59
  (_: TabItemBase) => {
50
- const index = tabs.indexOf(_ as Tab);
51
- const tab = tabs[index];
60
+ const index = tabsCounted.indexOf(_ as Tab);
61
+ const tab = tabsCounted[index];
52
62
 
53
63
  setActiveTabIndex(index);
54
64
 
@@ -56,14 +66,14 @@ export const TabsLayout = UniBlock<TabsLayoutProps>(
56
66
  updateUrlSearchTabParam(_, index);
57
67
  }
58
68
  },
59
- [tabs],
69
+ [tabsCounted],
60
70
  );
61
71
 
62
72
  return (
63
73
  <BlockWrapper className={style(className)} defaultPadding="p-0" {...rest}>
64
74
  {renderTabsLayout({
65
- items: tabs,
66
- value: tabs[activeTabIndex],
75
+ items: tabsCounted,
76
+ value: tabsCounted[activeTabIndex],
67
77
  tabsType,
68
78
  onChange: handleChange,
69
79
  })}
@@ -1,6 +1,5 @@
1
1
  import { ScrollableTabsControl } from '../../ui-kit/TabsControl/ScrollableTabsControl';
2
2
  import { type TabItemBase } from '../../ui-kit/TabsControl/TabItem';
3
- import { TabsControl } from '../../ui-kit/TabsControl/TabsControl';
4
3
  import { type TabsControlProps, type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
5
4
 
6
5
  interface RenderTabsProps {
@@ -10,23 +9,28 @@ interface RenderTabsProps {
10
9
  tabsType?: TabsType;
11
10
  }
12
11
 
13
- export const renderTabsLayout = ({ tabsType = 'animated', ...props }: RenderTabsProps) => {
14
- switch (tabsType) {
15
- case 'default':
16
- return <TabsControl {...props} />;
17
- case 'underlined':
18
- return (
19
- <div className="flex">
20
- <TabsControl className="m-auto" tabsType="underlined" {...props} />
21
- </div>
22
- );
23
- case 'animated':
24
- return (
25
- <div className="border-b-8 border-primary-main">
26
- <ScrollableTabsControl className="m-auto" {...props} tabsType="animated" />
27
- </div>
28
- );
29
- default:
30
- return null;
31
- }
12
+ const tabsStyle: Record<TabsType, { wrapper: string; component: string }> = {
13
+ default: {
14
+ wrapper: '',
15
+ component: '',
16
+ },
17
+ animated: {
18
+ wrapper: 'border-b-8 border-primary-main bg-white',
19
+ component: 'm-auto',
20
+ },
21
+ underlined: {
22
+ wrapper: 'flex',
23
+ component: 'm-auto',
24
+ },
32
25
  };
26
+
27
+ export const renderTabsLayout = ({ tabsType = 'animated', ...props }: RenderTabsProps) =>
28
+ tabsType ? (
29
+ <div className={tabsStyle[tabsType].wrapper}>
30
+ <ScrollableTabsControl
31
+ className={tabsStyle[tabsType].component}
32
+ tabsType={tabsType}
33
+ {...props}
34
+ />
35
+ </div>
36
+ ) : null;
@@ -18,18 +18,16 @@ const badgeTextColorStyleMap: Record<string, TextColor> = {
18
18
  secondary: 'text-secondary-text',
19
19
  };
20
20
 
21
- export const Badge = JSX<BadgeProps>(({ count, version = 'secondary' }) => {
22
- return (
23
- <div
24
- className={style(
25
- 'w-6 h-6 rounded-full flex items-center justify-center',
26
- badgeBgStyleMap[version],
27
- )}
28
- role="status"
29
- >
30
- <Text size="text-xs" color={badgeTextColorStyleMap[version]}>
31
- {count}
32
- </Text>
33
- </div>
34
- );
35
- });
21
+ export const Badge = JSX<BadgeProps>(({ count, version = 'secondary' }) => (
22
+ <div
23
+ className={style(
24
+ 'w-6 h-6 rounded-full flex items-center justify-center',
25
+ badgeBgStyleMap[version],
26
+ )}
27
+ role="status"
28
+ >
29
+ <Text size="text-xs" color={badgeTextColorStyleMap[version]}>
30
+ {count}
31
+ </Text>
32
+ </div>
33
+ ));
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
2
2
  import { type BlockDef } from '../../model/ContentPageDef';
3
- import { Badge } from '../Badge/Badge';
3
+ import { getVersion } from '../../utils/getVersion';
4
4
  import { type TabItemBase } from '../TabsControl/TabItem';
5
5
  import { type TabsControlProps } from '../TabsControl/TabsControlProps';
6
6
  import { getBadgeCount } from './getBadgeCount';
@@ -40,12 +40,8 @@ export const useHotFilters = ({
40
40
  () =>
41
41
  hotFilters.map((_) => ({
42
42
  text: _.text,
43
- appendRight: (
44
- <Badge
45
- version={_ === hotFilters[activeItemIndex] ? 'primary' : 'secondary'}
46
- count={getBadgeCount(blocks, _.filter)}
47
- />
48
- ),
43
+ count: getBadgeCount(blocks, _.filter),
44
+ version: getVersion(_ === hotFilters[activeItemIndex]),
49
45
  })),
50
46
  [hotFilters, blocks, activeItemIndex],
51
47
  );
@@ -4,18 +4,23 @@ import { ScrollLeftButton, ScrollRightButton } from '../LinkButton/ArrowButton';
4
4
  import { SwipeListContainer } from '../SwipeListControl/SwipeListContainer';
5
5
  import { useSwipeListScroll } from '../SwipeListControl/useSwipeListScroll';
6
6
  import { renderTab } from './renderTab';
7
- import { type TabsControlProps } from './TabsControlProps';
7
+ import { type TabsControlProps, type TabsType } from './TabsControlProps';
8
8
 
9
9
  const scrollButtonStyle = 'hidden sm:flex absolute z-40';
10
10
 
11
- const scrollStyleType = {
11
+ const scrollStyle: Record<TabsType, { item: string; gap: number; buttonTop: string }> = {
12
+ default: {
13
+ item: 'flex-1',
14
+ gap: 0,
15
+ buttonTop: 'top-0',
16
+ },
12
17
  animated: {
13
- itemClassName: 'flex',
18
+ item: 'flex',
14
19
  gap: 8,
15
20
  buttonTop: 'top-5',
16
21
  },
17
22
  underlined: {
18
- itemClassName: '',
23
+ item: '',
19
24
  gap: 0,
20
25
  buttonTop: 'top-0',
21
26
  },
@@ -33,28 +38,20 @@ export const ScrollableTabsControl = JSX<TabsControlProps>(
33
38
  containerRef={containerRef}
34
39
  snapAlign="snap-start"
35
40
  onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
36
- itemClassName={scrollStyleType[tabsType].itemClassName}
37
- gap={scrollStyleType[tabsType].gap}
41
+ itemClassName={scrollStyle[tabsType].item}
42
+ gap={scrollStyle[tabsType].gap}
38
43
  >
39
44
  {items.map(renderTab(value, onChange, tabsType))}
40
45
  </SwipeListContainer>
41
46
  {scroll.canScrollLeft ? (
42
47
  <ScrollLeftButton
43
- className={style(
44
- 'left-6',
45
- scrollButtonStyle,
46
- scrollStyleType[tabsType].buttonTop as string,
47
- )}
48
+ className={style('left-6', scrollButtonStyle, scrollStyle[tabsType].buttonTop)}
48
49
  onClick={scroll.scrollLeft}
49
50
  />
50
51
  ) : null}
51
52
  {scroll.canScrollRight ? (
52
53
  <ScrollRightButton
53
- className={style(
54
- 'right-6',
55
- scrollButtonStyle,
56
- scrollStyleType[tabsType].buttonTop as string,
57
- )}
54
+ className={style('right-6', scrollButtonStyle, scrollStyle[tabsType].buttonTop)}
58
55
  onClick={scroll.scrollRight}
59
56
  />
60
57
  ) : null}
@@ -4,12 +4,11 @@ import { useLink } from '../../hooks/useLink';
4
4
  import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
5
5
  import { type LinkProps } from '../../model/LinkProps';
6
6
  import { type IconProps } from '../../model/Picture';
7
- import { type VNode } from '../../model/VNode';
8
7
  import { TabItemInner } from './TabItemInner';
9
8
  import { type TabsControlProps, type TabsType } from './TabsControlProps';
10
9
  export interface TabItemBase extends LinkProps, TitleProps, DescriptionProps, IconProps {
11
10
  name?: string;
12
- appendRight?: VNode;
11
+ count?: number;
13
12
  }
14
13
 
15
14
  export interface TabItemProps {
@@ -1,5 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { getVersion } from '../../utils/getVersion';
2
3
  import { style } from '../../utils/style';
4
+ import { Badge } from '../Badge/Badge';
3
5
  import { renderTabItemInner } from './renderTabItemInner';
4
6
  import { type TabItemProps } from './TabItem';
5
7
  import { type TabsType } from './TabsControlProps';
@@ -32,13 +34,14 @@ const activeTabBgStyleMap: Record<TabsType, string> = {
32
34
 
33
35
  interface TabItemInnerProps extends TabItemProps {
34
36
  tag?: string;
37
+ count?: number;
35
38
  }
36
39
 
37
40
  export const TabItemInner = JSX<TabItemInnerProps>(
38
41
  ({ tag = 'div', item = {}, isActive = false, type = 'default', onClick }) => {
39
42
  const Tag: any = tag;
40
43
 
41
- const { text, description, icon, appendRight, ...link } = item;
44
+ const { text, description, icon, count, ...link } = item;
42
45
 
43
46
  return (
44
47
  <Tag
@@ -68,7 +71,11 @@ export const TabItemInner = JSX<TabItemInnerProps>(
68
71
  isActive,
69
72
  type,
70
73
  })}
71
- {appendRight ? <div className="ml-xs">{appendRight}</div> : null}
74
+ {Number.isInteger(count) ? (
75
+ <div className="ml-xs">
76
+ <Badge count={count} version={getVersion(isActive)} />
77
+ </div>
78
+ ) : null}
72
79
  </div>
73
80
  </Tag>
74
81
  );
@@ -0,0 +1 @@
1
+ export const getVersion = (isPrimary: boolean) => (isPrimary ? 'primary' : 'secondary');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.336",
3
+ "version": "0.14.337",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -7,6 +7,7 @@ import { ClientOnly } from '../../ui-kit/ClientOnly';
7
7
  import { Heading } from '../../ui-kit/Heading/Heading';
8
8
  import { Text } from '../../ui-kit/Text/Text';
9
9
  import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
10
+ import { getVersion } from '../../utils/getVersion';
10
11
  import { style } from '../../utils/style';
11
12
  import { type AtmsDef } from './OfficesAtmsMapContent';
12
13
  import { type Atm, type Branch, type RemoteWorkplace } from './OfficesAtmsMapProps';
@@ -117,9 +118,9 @@ const renderButtonsGroup = (
117
118
  activeButton: string,
118
119
  onButtonClick: (item: string) => void,
119
120
  ) => {
120
- const allButtonVersion = activeButton === 'all' ? 'primary' : 'secondary';
121
+ const allButtonVersion = getVersion(activeButton === 'all');
121
122
 
122
- const businessButtonVersion = activeButton === 'business' ? 'primary' : 'secondary';
123
+ const businessButtonVersion = getVersion(activeButton === 'business');
123
124
 
124
125
  const handleClick = (e: any, key: string, branches: Branch[]) => {
125
126
  if (e.currentTarget === e.target && key === 'business') {
@@ -9,8 +9,40 @@ const options: BlockRendererOptions = {
9
9
  };
10
10
 
11
11
  const TABS: Tab[] = [
12
- { text: 'Первый таб', description: 'Описание первого таба', type: 'group' },
13
- { text: 'Второй таб', description: 'Описание второго таба', type: 'group' },
12
+ {
13
+ type: 'group',
14
+ description: 'Описание первого таб группа',
15
+ text: 'Первый таб',
16
+ selected: false,
17
+ },
18
+ {
19
+ type: 'group',
20
+ description: 'Описание первого таб группа',
21
+ text: 'Второй таб',
22
+ selected: false,
23
+ },
24
+ {
25
+ type: 'group',
26
+ description: 'Описание первого таб группа',
27
+ text: 'Третий таб и с очень длинным текстом',
28
+ selected: false,
29
+ },
30
+ ];
31
+ const TabsWithIcon: Tab[] = [
32
+ {
33
+ type: 'group',
34
+ description: 'Описание первого таба',
35
+ text: 'Первый таб',
36
+ selected: false,
37
+ icon: { icon: 'CalendarIcon' },
38
+ },
39
+ {
40
+ type: 'group',
41
+ description: 'Описание второго таба',
42
+ text: 'Второй таб',
43
+ selected: false,
44
+ icon: { icon: 'BankIcon' },
45
+ },
14
46
  ];
15
47
 
16
48
  const TEXT_BLOCK_DESCRIPTION = {
@@ -22,52 +54,66 @@ const TEXT_BLOCK_DESCRIPTION = {
22
54
  style: ['col-span-12'],
23
55
  };
24
56
 
57
+ const slots = {
58
+ 'Первый таб': [TEXT_BLOCK_DESCRIPTION],
59
+ 'Второй таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
60
+ 'Третий таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
61
+ };
62
+
25
63
  export default {
26
64
  default: (
27
65
  <div className="container grid grid-cols-12">
28
66
  <TabsLayout
29
67
  className="col-span-12"
30
68
  tabs={TABS}
69
+ tabsType="default"
31
70
  options={options}
71
+ block={{ slots }}
72
+ />
73
+ </div>
74
+ ),
75
+ animated: (
76
+ <div className="container grid grid-cols-12">
77
+ <TabsLayout
78
+ className="col-span-12"
79
+ tabs={TABS}
32
80
  tabsType="animated"
33
- block={{
34
- slots: {
35
- 'Первый таб': [TEXT_BLOCK_DESCRIPTION],
36
- 'Второй таб': [TEXT_BLOCK_DESCRIPTION],
37
- },
38
- }}
81
+ options={options}
82
+ block={{ slots }}
39
83
  />
40
84
  </div>
41
85
  ),
42
- wide: (
86
+ underlined: (
43
87
  <div className="container grid grid-cols-12">
44
88
  <TabsLayout
45
89
  className="col-span-12"
46
90
  tabs={TABS}
91
+ tabsType="underlined"
47
92
  options={options}
48
- tabsType="default"
49
- block={{
50
- slots: {
51
- 'Первый таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
52
- 'Второй таб': [TEXT_BLOCK_DESCRIPTION],
53
- },
54
- }}
93
+ block={{ slots }}
94
+ />
95
+ </div>
96
+ ),
97
+ animatedIcons: (
98
+ <div className="container grid grid-cols-12">
99
+ <TabsLayout
100
+ className="col-span-12"
101
+ tabs={TabsWithIcon}
102
+ tabsType="animated"
103
+ options={options}
104
+ block={{ slots }}
55
105
  />
56
106
  </div>
57
107
  ),
58
- scrollable: (
108
+ defaultCounter: (
59
109
  <div className="container grid grid-cols-12">
60
110
  <TabsLayout
61
111
  className="col-span-12"
62
112
  tabs={TABS}
113
+ tabsType="default"
63
114
  options={options}
64
- tabsType="underlined"
65
- block={{
66
- slots: {
67
- 'Первый таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
68
- 'Второй таб': [TEXT_BLOCK_DESCRIPTION],
69
- },
70
- }}
115
+ block={{ slots }}
116
+ showCounter={true}
71
117
  />
72
118
  </div>
73
119
  ),