@redneckz/wildless-cms-uni-blocks 0.14.294 → 0.14.295

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 (215) hide show
  1. package/bin/migration-scripts/0.14.257.js +21 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +100 -68
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Tabs/TabsContent.d.ts +1 -1
  6. package/bundle/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
  7. package/bundle/components/TabsLayout/renderTabsLayout.d.ts +11 -0
  8. package/bundle/ui-kit/TabsControl/TabItem.d.ts +5 -4
  9. package/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
  10. package/bundle/ui-kit/TabsControl/renderTab.d.ts +3 -3
  11. package/bundle/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
  12. package/dist/components/Tabs/TabsContent.d.ts +1 -1
  13. package/dist/components/Tabs/renderTabs.js +0 -2
  14. package/dist/components/Tabs/renderTabs.js.map +1 -1
  15. package/dist/components/TabsLayout/TabsLayout.js +39 -16
  16. package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  17. package/dist/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
  18. package/dist/components/TabsLayout/renderTabsLayout.d.ts +11 -0
  19. package/dist/components/TabsLayout/renderTabsLayout.js +19 -0
  20. package/dist/components/TabsLayout/renderTabsLayout.js.map +1 -0
  21. package/dist/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
  22. package/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  23. package/dist/ui-kit/TabsControl/TabItem.d.ts +5 -4
  24. package/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
  25. package/dist/ui-kit/TabsControl/TabItemInner.js +14 -8
  26. package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  27. package/dist/ui-kit/TabsControl/TabsControl.js +1 -1
  28. package/dist/ui-kit/TabsControl/TabsControl.js.map +1 -1
  29. package/dist/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
  30. package/dist/ui-kit/TabsControl/renderTab.d.ts +3 -3
  31. package/dist/ui-kit/TabsControl/renderTab.js.map +1 -1
  32. package/dist/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
  33. package/dist/ui-kit/TabsControl/renderTabItemInner.js +23 -0
  34. package/dist/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
  35. package/lib/common.css +1 -1
  36. package/lib/components/Tabs/Tabs.fixture.d.ts +0 -1
  37. package/lib/components/Tabs/Tabs.fixture.mobile.d.ts +0 -1
  38. package/lib/components/Tabs/TabsContent.d.ts +1 -1
  39. package/lib/components/Tabs/renderTabs.js +0 -2
  40. package/lib/components/Tabs/renderTabs.js.map +1 -1
  41. package/lib/components/TabsLayout/TabsLayout.fixture.d.ts +2 -0
  42. package/lib/components/TabsLayout/TabsLayout.fixture.mobile.d.ts +2 -0
  43. package/lib/components/TabsLayout/TabsLayout.js +40 -17
  44. package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  45. package/lib/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
  46. package/lib/components/TabsLayout/renderTabsLayout.d.ts +10 -0
  47. package/lib/components/TabsLayout/renderTabsLayout.js +16 -0
  48. package/lib/components/TabsLayout/renderTabsLayout.js.map +1 -0
  49. package/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
  50. package/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  51. package/lib/ui-kit/TabsControl/TabItem.d.ts +5 -4
  52. package/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
  53. package/lib/ui-kit/TabsControl/TabItemInner.js +14 -8
  54. package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  55. package/lib/ui-kit/TabsControl/TabsControl.fixture.d.ts +1 -1
  56. package/lib/ui-kit/TabsControl/TabsControl.js +1 -1
  57. package/lib/ui-kit/TabsControl/TabsControl.js.map +1 -1
  58. package/lib/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
  59. package/lib/ui-kit/TabsControl/renderTab.d.ts +3 -3
  60. package/lib/ui-kit/TabsControl/renderTab.js.map +1 -1
  61. package/lib/ui-kit/TabsControl/renderTabItemInner.d.ts +10 -0
  62. package/lib/ui-kit/TabsControl/renderTabItemInner.js +20 -0
  63. package/lib/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
  64. package/mobile/bundle/bundle.umd.js +109 -77
  65. package/mobile/bundle/bundle.umd.min.js +1 -1
  66. package/mobile/bundle/components/Tabs/TabsContent.d.ts +1 -1
  67. package/mobile/bundle/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
  68. package/mobile/bundle/components/TabsLayout/renderTabsLayout.d.ts +11 -0
  69. package/mobile/bundle/ui-kit/TabsControl/TabItem.d.ts +5 -4
  70. package/mobile/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
  71. package/mobile/bundle/ui-kit/TabsControl/renderTab.d.ts +3 -3
  72. package/mobile/bundle/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
  73. package/mobile/dist/components/Tabs/TabsContent.d.ts +1 -1
  74. package/mobile/dist/components/Tabs/renderTabs.js +0 -2
  75. package/mobile/dist/components/Tabs/renderTabs.js.map +1 -1
  76. package/mobile/dist/components/TabsLayout/TabsLayout.js +39 -16
  77. package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  78. package/mobile/dist/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
  79. package/mobile/dist/components/TabsLayout/renderTabsLayout.d.ts +11 -0
  80. package/mobile/dist/components/TabsLayout/renderTabsLayout.js +19 -0
  81. package/mobile/dist/components/TabsLayout/renderTabsLayout.js.map +1 -0
  82. package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
  83. package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  84. package/mobile/dist/ui-kit/TabsControl/TabItem.d.ts +5 -4
  85. package/mobile/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
  86. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +14 -8
  87. package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  88. package/mobile/dist/ui-kit/TabsControl/TabsControl.js +1 -1
  89. package/mobile/dist/ui-kit/TabsControl/TabsControl.js.map +1 -1
  90. package/mobile/dist/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
  91. package/mobile/dist/ui-kit/TabsControl/renderTab.d.ts +3 -3
  92. package/mobile/dist/ui-kit/TabsControl/renderTab.js.map +1 -1
  93. package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
  94. package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.js +23 -0
  95. package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
  96. package/mobile/lib/common.css +1 -1
  97. package/mobile/lib/components/Tabs/TabsContent.d.ts +1 -1
  98. package/mobile/lib/components/Tabs/renderTabs.js +0 -2
  99. package/mobile/lib/components/Tabs/renderTabs.js.map +1 -1
  100. package/mobile/lib/components/TabsLayout/TabsLayout.js +40 -17
  101. package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  102. package/mobile/lib/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
  103. package/mobile/lib/components/TabsLayout/renderTabsLayout.d.ts +11 -0
  104. package/mobile/lib/components/TabsLayout/renderTabsLayout.js +16 -0
  105. package/mobile/lib/components/TabsLayout/renderTabsLayout.js.map +1 -0
  106. package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
  107. package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
  108. package/mobile/lib/ui-kit/TabsControl/TabItem.d.ts +5 -4
  109. package/mobile/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
  110. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +14 -8
  111. package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
  112. package/mobile/lib/ui-kit/TabsControl/TabsControl.js +1 -1
  113. package/mobile/lib/ui-kit/TabsControl/TabsControl.js.map +1 -1
  114. package/mobile/lib/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
  115. package/mobile/lib/ui-kit/TabsControl/renderTab.d.ts +3 -3
  116. package/mobile/lib/ui-kit/TabsControl/renderTab.js.map +1 -1
  117. package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
  118. package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.js +20 -0
  119. package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
  120. package/mobile/src/components/Tabs/TabsContent.ts +1 -1
  121. package/mobile/src/components/Tabs/renderTabs.tsx +0 -10
  122. package/mobile/src/components/TabsLayout/TabsLayout.example.json +4 -3
  123. package/mobile/src/components/TabsLayout/TabsLayout.tsx +56 -57
  124. package/mobile/src/components/TabsLayout/TabsLayoutContent.ts +36 -8
  125. package/mobile/src/components/TabsLayout/renderTabsLayout.tsx +32 -0
  126. package/mobile/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +28 -5
  127. package/mobile/src/ui-kit/TabsControl/TabItem.tsx +5 -5
  128. package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +21 -15
  129. package/mobile/src/ui-kit/TabsControl/TabsControl.tsx +4 -1
  130. package/mobile/src/ui-kit/TabsControl/TabsControlProps.ts +12 -2
  131. package/mobile/src/ui-kit/TabsControl/renderTab.tsx +3 -3
  132. package/mobile/src/ui-kit/TabsControl/renderTabItemInner.tsx +63 -0
  133. package/package.json +1 -1
  134. package/src/components/Tabs/Tabs.fixture.mobile.tsx +0 -16
  135. package/src/components/Tabs/Tabs.fixture.tsx +0 -19
  136. package/src/components/Tabs/TabsContent.ts +1 -1
  137. package/src/components/Tabs/renderTabs.tsx +0 -10
  138. package/src/components/TabsLayout/TabsLayout.example.json +4 -3
  139. package/src/components/TabsLayout/TabsLayout.fixture.mobile.tsx +51 -30
  140. package/src/components/TabsLayout/TabsLayout.fixture.tsx +61 -30
  141. package/src/components/TabsLayout/TabsLayout.tsx +56 -57
  142. package/src/components/TabsLayout/TabsLayoutContent.ts +36 -8
  143. package/src/components/TabsLayout/renderTabsLayout.tsx +32 -0
  144. package/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +28 -5
  145. package/src/ui-kit/TabsControl/TabItem.tsx +5 -5
  146. package/src/ui-kit/TabsControl/TabItemInner.tsx +21 -15
  147. package/src/ui-kit/TabsControl/TabsControl.fixture.tsx +7 -20
  148. package/src/ui-kit/TabsControl/TabsControl.tsx +4 -1
  149. package/src/ui-kit/TabsControl/TabsControlProps.ts +12 -2
  150. package/src/ui-kit/TabsControl/renderTab.tsx +3 -3
  151. package/src/ui-kit/TabsControl/renderTabItemInner.tsx +63 -0
  152. package/bundle/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
  153. package/bundle/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
  154. package/bundle/components/TabsLayout/alignTabStyle.d.ts +0 -2
  155. package/bundle/components/TabsLayout/useScrollToTab.d.ts +0 -2
  156. package/dist/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
  157. package/dist/components/TabsLayout/TabsLayoutButton.js +0 -24
  158. package/dist/components/TabsLayout/TabsLayoutButton.js.map +0 -1
  159. package/dist/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
  160. package/dist/components/TabsLayout/TabsLayoutRedirectSection.js +0 -27
  161. package/dist/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
  162. package/dist/components/TabsLayout/alignTabStyle.d.ts +0 -2
  163. package/dist/components/TabsLayout/alignTabStyle.js +0 -8
  164. package/dist/components/TabsLayout/alignTabStyle.js.map +0 -1
  165. package/dist/components/TabsLayout/useScrollToTab.d.ts +0 -2
  166. package/dist/components/TabsLayout/useScrollToTab.js +0 -17
  167. package/dist/components/TabsLayout/useScrollToTab.js.map +0 -1
  168. package/lib/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
  169. package/lib/components/TabsLayout/TabsLayoutButton.js +0 -22
  170. package/lib/components/TabsLayout/TabsLayoutButton.js.map +0 -1
  171. package/lib/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
  172. package/lib/components/TabsLayout/TabsLayoutRedirectSection.js +0 -25
  173. package/lib/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
  174. package/lib/components/TabsLayout/alignTabStyle.d.ts +0 -2
  175. package/lib/components/TabsLayout/alignTabStyle.js +0 -6
  176. package/lib/components/TabsLayout/alignTabStyle.js.map +0 -1
  177. package/lib/components/TabsLayout/useScrollToTab.d.ts +0 -2
  178. package/lib/components/TabsLayout/useScrollToTab.js +0 -14
  179. package/lib/components/TabsLayout/useScrollToTab.js.map +0 -1
  180. package/mobile/bundle/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
  181. package/mobile/bundle/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
  182. package/mobile/bundle/components/TabsLayout/alignTabStyle.d.ts +0 -2
  183. package/mobile/bundle/components/TabsLayout/useScrollToTab.d.ts +0 -2
  184. package/mobile/dist/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
  185. package/mobile/dist/components/TabsLayout/TabsLayoutButton.js +0 -24
  186. package/mobile/dist/components/TabsLayout/TabsLayoutButton.js.map +0 -1
  187. package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
  188. package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.js +0 -27
  189. package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
  190. package/mobile/dist/components/TabsLayout/alignTabStyle.d.ts +0 -2
  191. package/mobile/dist/components/TabsLayout/alignTabStyle.js +0 -8
  192. package/mobile/dist/components/TabsLayout/alignTabStyle.js.map +0 -1
  193. package/mobile/dist/components/TabsLayout/useScrollToTab.d.ts +0 -2
  194. package/mobile/dist/components/TabsLayout/useScrollToTab.js +0 -17
  195. package/mobile/dist/components/TabsLayout/useScrollToTab.js.map +0 -1
  196. package/mobile/lib/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
  197. package/mobile/lib/components/TabsLayout/TabsLayoutButton.js +0 -22
  198. package/mobile/lib/components/TabsLayout/TabsLayoutButton.js.map +0 -1
  199. package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
  200. package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.js +0 -25
  201. package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
  202. package/mobile/lib/components/TabsLayout/alignTabStyle.d.ts +0 -2
  203. package/mobile/lib/components/TabsLayout/alignTabStyle.js +0 -6
  204. package/mobile/lib/components/TabsLayout/alignTabStyle.js.map +0 -1
  205. package/mobile/lib/components/TabsLayout/useScrollToTab.d.ts +0 -2
  206. package/mobile/lib/components/TabsLayout/useScrollToTab.js +0 -14
  207. package/mobile/lib/components/TabsLayout/useScrollToTab.js.map +0 -1
  208. package/mobile/src/components/TabsLayout/TabsLayoutButton.tsx +0 -63
  209. package/mobile/src/components/TabsLayout/TabsLayoutRedirectSection.tsx +0 -32
  210. package/mobile/src/components/TabsLayout/alignTabStyle.ts +0 -7
  211. package/mobile/src/components/TabsLayout/useScrollToTab.ts +0 -16
  212. package/src/components/TabsLayout/TabsLayoutButton.tsx +0 -63
  213. package/src/components/TabsLayout/TabsLayoutRedirectSection.tsx +0 -32
  214. package/src/components/TabsLayout/alignTabStyle.ts +0 -7
  215. package/src/components/TabsLayout/useScrollToTab.ts +0 -16
@@ -33,7 +33,7 @@ export declare type TabData = GroupTabData | LinkTabData;
33
33
  * "По центру"
34
34
  * ]
35
35
  */
36
- export declare type TabsMode = 'wideScreen' | 'scrollable' | 'centered';
36
+ export declare type TabsMode = 'wideScreen' | 'scrollable';
37
37
  /**
38
38
  * @title Вкладки
39
39
  */
@@ -1,22 +1,47 @@
1
- import { type Align } from '../../model/Align';
2
1
  import { type AspectsProps } from '../../model/AspectsProps';
3
- import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
4
- import { type LinkCommonProps } from '../../model/LinkProps';
2
+ import { type DescriptionProps } from '../../model/HeadlineType';
3
+ import { type LinkProps } from '../../model/LinkProps';
5
4
  import { type IconProps } from '../../model/Picture';
5
+ import { type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
6
6
  import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
7
7
  /**
8
8
  * @title Таб
9
9
  */
10
- export declare type Tab = TitleProps & DescriptionProps & IconProps & LinkCommonProps & AspectsProps & {
10
+ export declare type TabBase = DescriptionProps & IconProps & LinkProps & AspectsProps & {
11
11
  /** @title Вкладка выбрана по-умолчанию */
12
12
  selected?: boolean;
13
13
  };
14
+ /**
15
+ * @title Группа
16
+ */
17
+ export declare type GroupTab = TabBase & {
18
+ /** @default group */
19
+ type: 'group';
20
+ };
21
+ /**
22
+ * @title Ссылка
23
+ */
24
+ export declare type LinkTab = TabBase & LinkProps & {
25
+ /** @default link */
26
+ type: 'link';
27
+ };
28
+ /**
29
+ * @title Таб
30
+ * @default {
31
+ * "type": "group"
32
+ * }
33
+ */
34
+ export declare type Tab = GroupTab | LinkTab;
14
35
  /**
15
36
  * @title Табы
16
37
  */
17
38
  export declare type TabsLayoutContent = UniBlockContent & {
18
- /** @title Выравнивание табов */
19
- tabAlign?: Align;
20
39
  /** @title Список табов */
21
40
  tabs?: Tab[];
41
+ /** @title Режим отображения */
42
+ tabsType?: TabsType;
43
+ /** @title Закрепить сверху */
44
+ isSticky?: boolean;
45
+ /** @title Показывать счетчик блоков во вкладках */
46
+ showCounter?: boolean;
22
47
  };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type TabItemBase } from '../../ui-kit/TabsControl/TabItem';
3
+ import { type TabsControlProps, type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
4
+ interface RenderTabsProps {
5
+ items: TabItemBase[];
6
+ value: TabItemBase;
7
+ onChange: TabsControlProps['onChange'];
8
+ tabsType?: TabsType;
9
+ }
10
+ export declare const renderTabsLayout: ({ tabsType, ...props }: RenderTabsProps) => JSX.Element | null;
11
+ export {};
@@ -1,15 +1,16 @@
1
+ import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
1
2
  import { type LinkProps } from '../../model/LinkProps';
3
+ import { type IconProps } from '../../model/Picture';
2
4
  import { type VNode } from '../../model/VNode';
3
- import { type TabsControlProps } from './TabsControlProps';
4
- export interface TabItemBase extends LinkProps {
5
+ import { type TabsControlProps, type TabsType } from './TabsControlProps';
6
+ export interface TabItemBase extends LinkProps, TitleProps, DescriptionProps, IconProps {
5
7
  name?: string;
6
8
  appendRight?: VNode;
7
9
  }
8
- export declare type TabType = 'default' | 'underlined' | 'rounded';
9
10
  export interface TabItemProps {
10
11
  item?: TabItemBase;
11
12
  isActive?: boolean;
12
- type?: TabType;
13
+ type?: TabsType;
13
14
  onClick?: TabsControlProps['onChange'];
14
15
  }
15
16
  export declare const TabItem: import("@redneckz/uni-jsx").UNIComponent<TabItemProps, any, any>;
@@ -1,6 +1,15 @@
1
1
  import { type ListControlProps } from '../ListControlProps';
2
- import { type TabItemBase, type TabType } from './TabItem';
2
+ import { type TabItemBase } from './TabItem';
3
+ /**
4
+ * @title Тип вкладки
5
+ * @enumNames [
6
+ * "По ширине экрана",
7
+ * "С прокруткой",
8
+ * "Кнопка с анимацией",
9
+ * ]
10
+ */
11
+ export declare type TabsType = 'default' | 'underlined' | 'animated';
3
12
  export interface TabsControlProps extends ListControlProps<TabItemBase> {
4
13
  className?: string;
5
- tabsType?: TabType;
14
+ tabsType?: TabsType;
6
15
  }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { type TabItemBase, type TabType } from './TabItem';
3
- import { type TabsControlProps } from './TabsControlProps';
4
- export declare const renderTab: (activeTab?: TabItemBase, onClick?: TabsControlProps['onChange'], type?: TabType) => (tab: TabItemBase, i: number) => JSX.Element;
2
+ import { type TabItemBase } from './TabItem';
3
+ import { type TabsControlProps, type TabsType } from './TabsControlProps';
4
+ export declare const renderTab: (activeTab?: TabItemBase, onClick?: TabsControlProps['onChange'], type?: TabsType) => (tab: TabItemBase, i: number) => JSX.Element;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type Picture } from '../../model/Picture';
3
+ interface TabsLayoutButtonProps {
4
+ isActive: boolean;
5
+ description?: string;
6
+ icon?: Picture;
7
+ type: string;
8
+ text?: string;
9
+ }
10
+ export declare const renderTabItemInner: ({ text, description, icon, isActive, type, }: TabsLayoutButtonProps) => JSX.Element;
11
+ export {};
@@ -33,7 +33,7 @@ export declare type TabData = GroupTabData | LinkTabData;
33
33
  * "По центру"
34
34
  * ]
35
35
  */
36
- export declare type TabsMode = 'wideScreen' | 'scrollable' | 'centered';
36
+ export declare type TabsMode = 'wideScreen' | 'scrollable';
37
37
  /**
38
38
  * @title Вкладки
39
39
  */
@@ -7,8 +7,6 @@ const renderTabs = ({ tabsMode, ...props }) => {
7
7
  switch (tabsMode) {
8
8
  case 'wideScreen':
9
9
  return (0, jsx_runtime_1.jsx)(TabsControl_1.TabsControl, { ...props });
10
- case 'centered':
11
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex", children: (0, jsx_runtime_1.jsx)(TabsControl_1.TabsControl, { className: "m-auto p-xs rounded-md bg-main-gray", tabsType: "rounded", ...props }) }));
12
10
  case 'scrollable':
13
11
  return ((0, jsx_runtime_1.jsx)("div", { className: "flex", children: (0, jsx_runtime_1.jsx)(ScrollableTabsControl_1.ScrollableTabsControl, { className: "m-auto", tabsType: "underlined", ...props }) }));
14
12
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"renderTabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/renderTabs.tsx"],"names":[],"mappings":";;;AAAA,0FAAuF;AAEvF,sEAAmE;AAW5D,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IACpE,QAAQ,QAAQ,EAAE;QAChB,KAAK,YAAY;YACf,OAAO,uBAAC,yBAAW,OAAK,KAAK,GAAI,CAAC;QACpC,KAAK,UAAU;YACb,OAAO,CACL,gCAAK,SAAS,EAAC,MAAM,YACnB,uBAAC,yBAAW,IACV,SAAS,EAAC,qCAAqC,EAC/C,QAAQ,EAAC,SAAS,KACd,KAAK,GACT,GACE,CACP,CAAC;QACJ,KAAK,YAAY;YACf,OAAO,CACL,gCAAK,SAAS,EAAC,MAAM,YACnB,uBAAC,6CAAqB,IAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAC,YAAY,KAAK,KAAK,GAAI,GACzE,CACP,CAAC;QACJ;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AAvBW,QAAA,UAAU,cAuBrB"}
1
+ {"version":3,"file":"renderTabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/renderTabs.tsx"],"names":[],"mappings":";;;AAAA,0FAAuF;AAEvF,sEAAmE;AAW5D,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IACpE,QAAQ,QAAQ,EAAE;QAChB,KAAK,YAAY;YACf,OAAO,uBAAC,yBAAW,OAAK,KAAK,GAAI,CAAC;QACpC,KAAK,YAAY;YACf,OAAO,CACL,gCAAK,SAAS,EAAC,MAAM,YACnB,uBAAC,6CAAqB,IAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAC,YAAY,KAAK,KAAK,GAAI,GACzE,CACP,CAAC;QACJ;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
@@ -3,33 +3,56 @@ exports.TabsLayout = void 0;
3
3
  const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
5
5
  const renderBlockList_1 = require("../../BlockRenderer/renderBlockList");
6
- const useCarouselControls_1 = require("../../hooks/useCarouselControls");
6
+ const useRouter_1 = require("../../hooks/useRouter");
7
7
  const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
8
- const SwipeListContainer_1 = require("../../ui-kit/SwipeListControl/SwipeListContainer");
9
- const useSwipeListScroll_1 = require("../../ui-kit/SwipeListControl/useSwipeListScroll");
10
8
  const UniBlock_1 = require("../../UniBlock/UniBlock");
11
9
  const style_1 = require("../../utils/style");
12
- const CarouselScrollButtons_1 = require("../Carousel/CarouselScrollButtons");
13
- const alignTabStyle_1 = require("./alignTabStyle");
14
- const TabsLayoutButton_1 = require("./TabsLayoutButton");
15
- const TabsLayoutRedirectSection_1 = require("./TabsLayoutRedirectSection");
16
- exports.TabsLayout = (0, UniBlock_1.UniBlock)(({ className = '', tabs = [], block, tabAlign, ...rest }) => {
10
+ const renderTabsLayout_1 = require("./renderTabsLayout");
11
+ const TAB_QUERY_PARAM_KEY = 'tab';
12
+ exports.TabsLayout = (0, UniBlock_1.UniBlock)(({ className = '', tabs = [], block, tabsType, ...rest }) => {
13
+ const router = (0, useRouter_1.useRouter)();
14
+ const { isReady } = router;
17
15
  const [activeTabIndex, setActiveTabIndex] = (0, hooks_1.useState)(getInitSelectedIndex(tabs));
16
+ const defaultSelectedTab = tabs.findIndex((_) => Boolean(_.selected));
17
+ (0, hooks_1.useEffect)(() => {
18
+ const defaultTabIndex = router.query[TAB_QUERY_PARAM_KEY]
19
+ ? tabs.findIndex((_, index) => _.type === 'group' && String(index) === router.query[TAB_QUERY_PARAM_KEY])
20
+ : defaultSelectedTab;
21
+ setActiveTabIndex(defaultTabIndex === -1 ? 0 : defaultTabIndex);
22
+ }, [isReady, defaultSelectedTab]);
18
23
  const slotName = getSlotName(tabs[activeTabIndex], activeTabIndex);
19
- const itemCount = tabs.length;
20
- const [activeSlideIndex, { inc: incActiveSlideIndex, dec: decActiveSlideIndex }] = (0, useCarouselControls_1.useCarouselControls)({ itemCount }, activeTabIndex);
21
- const [containerRef, scroll] = (0, useSwipeListScroll_1.useSwipeListScroll)({ itemCount });
22
- return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)(className), defaultPadding: "p-0", ...rest, children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative border-b-8 border-primary-main", children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { itemClassName: "flex", containerRef: containerRef, snapAlign: "snap-end", gap: 8, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: tabs.map(renderTabButton(activeTabIndex, setActiveTabIndex, tabAlign)) }), (0, jsx_runtime_1.jsx)(CarouselScrollButtons_1.CarouselScrollButtons, { scroll: scroll, arrowsPadded: true, onScrollLeft: decActiveSlideIndex, onScrollRight: incActiveSlideIndex, activeIndex: activeSlideIndex, itemCount: itemCount })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: tabs[activeTabIndex]?.href ? ((0, jsx_runtime_1.jsx)(TabsLayoutRedirectSection_1.TabsLayoutRedirectSection, { tab: tabs[activeTabIndex] })) : ((0, renderBlockList_1.renderBlocksList)(block?.slots?.[slotName], {
24
+ const updateUrlSearchTabParam = (_, index) => {
25
+ const searchParams = new URLSearchParams(router.query);
26
+ if (_.text) {
27
+ searchParams.set(TAB_QUERY_PARAM_KEY, String(index));
28
+ }
29
+ else {
30
+ searchParams.delete(TAB_QUERY_PARAM_KEY);
31
+ }
32
+ router.replace(`${router.pathname}?${searchParams}`, '', { scroll: false });
33
+ };
34
+ const handleChange = (0, hooks_1.useCallback)((_) => {
35
+ const index = tabs.indexOf(_);
36
+ const tab = tabs[index];
37
+ setActiveTabIndex(index);
38
+ if (tab.type === 'group') {
39
+ updateUrlSearchTabParam(_, index);
40
+ }
41
+ }, [tabs]);
42
+ return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)(className), defaultPadding: "p-0", ...rest, children: [(0, renderTabsLayout_1.renderTabsLayout)({
43
+ items: tabs,
44
+ value: tabs[activeTabIndex],
45
+ tabsType,
46
+ onChange: handleChange,
47
+ }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: (0, renderBlockList_1.renderBlocksList)(block?.slots?.[slotName], {
23
48
  ...rest?.options,
24
- key: `${slotName}-${block?.type}`,
25
49
  slotName,
26
50
  parent: block,
27
- })) })] }));
51
+ }) })] }));
28
52
  }, {
29
53
  slots: ({ tabs }) => tabs?.filter((_) => !_.href).map(getSlotName) || [],
30
54
  childrenTypes: { exclude: ['TabsLayout'] }, // TODO: fix this on wcms
31
55
  });
32
- const getSlotName = (tab, index) => tab?.title || `Слот №${index}`;
56
+ const getSlotName = (tab, index) => tab?.text || `Слот №${index}`;
33
57
  const getInitSelectedIndex = (tabs) => tabs.reduce((selectedIndex, tab, i) => (tab.selected ? i : selectedIndex), 0);
34
- const renderTabButton = (activeTabIndex, onClick, tabAlign = 'start') => (tab, i) => ((0, jsx_runtime_1.jsx)(TabsLayoutButton_1.TabsLayoutButton, { className: alignTabStyle_1.alignTabStyle[tabAlign], tab: tab, isActive: activeTabIndex === i, onClick: () => onClick(i) }, String(i)));
35
58
  //# sourceMappingURL=TabsLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabsLayout.js","sourceRoot":"","sources":["../../../src/components/TabsLayout/TabsLayout.tsx"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,yEAAuE;AACvE,yEAAsE;AAEtE,4DAAyD;AACzD,yFAAsF;AACtF,yFAAsF;AACtF,sDAAmD;AAEnD,6CAA0C;AAC1C,6EAA0E;AAC1E,mDAAgD;AAChD,yDAAsD;AAEtD,2EAAwE;AAI3D,QAAA,UAAU,GAAG,IAAA,mBAAQ,EAChC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC1D,MA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3B,QAAQ;gBACR,QAAQ,EAAE,YAAY;aACvB,CAAC,EACF,gCAAK,SAAS,EAAC,oEAAoE,YAChF,IAAA,kCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE;oBAC1C,GAAG,IAAI,EAAE,OAAO;oBAChB,QAAQ;oBACR,MAAM,EAAE,KAAK;iBACd,CAAC,GACE,IACO,CAChB,CAAC;AACJ,CAAC,EACD;IACE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE;IACxE,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,yBAAyB;CACtE,CACF,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,KAAa,EAAU,EAAE,CAAC,GAAG,EAAE,IAAI,IAAI,SAAS,KAAK,EAAE,CAAC;AAEvF,MAAM,oBAAoB,GAAG,CAAC,IAAW,EAAE,EAAE,CAC3C,IAAI,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -1,22 +1,47 @@
1
- import { type Align } from '../../model/Align';
2
1
  import { type AspectsProps } from '../../model/AspectsProps';
3
- import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
4
- import { type LinkCommonProps } from '../../model/LinkProps';
2
+ import { type DescriptionProps } from '../../model/HeadlineType';
3
+ import { type LinkProps } from '../../model/LinkProps';
5
4
  import { type IconProps } from '../../model/Picture';
5
+ import { type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
6
6
  import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
7
7
  /**
8
8
  * @title Таб
9
9
  */
10
- export declare type Tab = TitleProps & DescriptionProps & IconProps & LinkCommonProps & AspectsProps & {
10
+ export declare type TabBase = DescriptionProps & IconProps & LinkProps & AspectsProps & {
11
11
  /** @title Вкладка выбрана по-умолчанию */
12
12
  selected?: boolean;
13
13
  };
14
+ /**
15
+ * @title Группа
16
+ */
17
+ export declare type GroupTab = TabBase & {
18
+ /** @default group */
19
+ type: 'group';
20
+ };
21
+ /**
22
+ * @title Ссылка
23
+ */
24
+ export declare type LinkTab = TabBase & LinkProps & {
25
+ /** @default link */
26
+ type: 'link';
27
+ };
28
+ /**
29
+ * @title Таб
30
+ * @default {
31
+ * "type": "group"
32
+ * }
33
+ */
34
+ export declare type Tab = GroupTab | LinkTab;
14
35
  /**
15
36
  * @title Табы
16
37
  */
17
38
  export declare type TabsLayoutContent = UniBlockContent & {
18
- /** @title Выравнивание табов */
19
- tabAlign?: Align;
20
39
  /** @title Список табов */
21
40
  tabs?: Tab[];
41
+ /** @title Режим отображения */
42
+ tabsType?: TabsType;
43
+ /** @title Закрепить сверху */
44
+ isSticky?: boolean;
45
+ /** @title Показывать счетчик блоков во вкладках */
46
+ showCounter?: boolean;
22
47
  };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type TabItemBase } from '../../ui-kit/TabsControl/TabItem';
3
+ import { type TabsControlProps, type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
4
+ interface RenderTabsProps {
5
+ items: TabItemBase[];
6
+ value: TabItemBase;
7
+ onChange: TabsControlProps['onChange'];
8
+ tabsType?: TabsType;
9
+ }
10
+ export declare const renderTabsLayout: ({ tabsType, ...props }: RenderTabsProps) => JSX.Element | null;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.renderTabsLayout = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const ScrollableTabsControl_1 = require("../../ui-kit/TabsControl/ScrollableTabsControl");
5
+ const TabsControl_1 = require("../../ui-kit/TabsControl/TabsControl");
6
+ const renderTabsLayout = ({ tabsType = 'animated', ...props }) => {
7
+ switch (tabsType) {
8
+ case 'default':
9
+ return (0, jsx_runtime_1.jsx)(TabsControl_1.TabsControl, { ...props });
10
+ case 'underlined':
11
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex", children: (0, jsx_runtime_1.jsx)(TabsControl_1.TabsControl, { className: "m-auto", tabsType: "underlined", ...props }) }));
12
+ case 'animated':
13
+ return ((0, jsx_runtime_1.jsx)("div", { className: "border-b-8 border-primary-main", children: (0, jsx_runtime_1.jsx)(ScrollableTabsControl_1.ScrollableTabsControl, { className: "m-auto", ...props, tabsType: "animated" }) }));
14
+ default:
15
+ return null;
16
+ }
17
+ };
18
+ exports.renderTabsLayout = renderTabsLayout;
19
+ //# sourceMappingURL=renderTabsLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderTabsLayout.js","sourceRoot":"","sources":["../../../src/components/TabsLayout/renderTabsLayout.tsx"],"names":[],"mappings":";;;AAAA,0FAAuF;AAEvF,sEAAmE;AAU5D,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,GAAG,UAAU,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IACvF,QAAQ,QAAQ,EAAE;QAChB,KAAK,SAAS;YACZ,OAAO,uBAAC,yBAAW,OAAK,KAAK,GAAI,CAAC;QACpC,KAAK,YAAY;YACf,OAAO,CACL,gCAAK,SAAS,EAAC,MAAM,YACnB,uBAAC,yBAAW,IAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAC,YAAY,KAAK,KAAK,GAAI,GAC/D,CACP,CAAC;QACJ,KAAK,UAAU;YACb,OAAO,CACL,gCAAK,SAAS,EAAC,gCAAgC,YAC7C,uBAAC,6CAAqB,IAAC,SAAS,EAAC,QAAQ,KAAK,KAAK,EAAE,QAAQ,EAAC,UAAU,GAAG,GACvE,CACP,CAAC;QACJ;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AAnBW,QAAA,gBAAgB,oBAmB3B"}
@@ -7,11 +7,23 @@ const ArrowButton_1 = require("../LinkButton/ArrowButton");
7
7
  const SwipeListContainer_1 = require("../SwipeListControl/SwipeListContainer");
8
8
  const useSwipeListScroll_1 = require("../SwipeListControl/useSwipeListScroll");
9
9
  const renderTab_1 = require("./renderTab");
10
- const scrollButtonStyle = 'hidden sm:flex absolute z-40 top-0';
11
- exports.ScrollableTabsControl = (0, uni_jsx_1.JSX)(({ className, items = [], value, onChange, tabsType }) => {
10
+ const scrollButtonStyle = 'hidden sm:flex absolute z-40';
11
+ const scrollStyleType = {
12
+ animated: {
13
+ itemClassName: 'flex',
14
+ gap: 8,
15
+ buttonTop: 'top-5',
16
+ },
17
+ underlined: {
18
+ itemClassName: '',
19
+ gap: 0,
20
+ buttonTop: 'top-0',
21
+ },
22
+ };
23
+ exports.ScrollableTabsControl = (0, uni_jsx_1.JSX)(({ className, items = [], value, onChange, tabsType = 'default' }) => {
12
24
  const [containerRef, scroll] = (0, useSwipeListScroll_1.useSwipeListScroll)({
13
25
  itemCount: items?.length || 0,
14
26
  });
15
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('relative overflow-x-auto no-scrollbar', className), role: "tablist", children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: items.map((0, renderTab_1.renderTab)(value, onChange, tabsType)) }), scroll.canScrollLeft ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ScrollLeftButton, { className: (0, style_1.style)('left-6', scrollButtonStyle), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ScrollRightButton, { className: (0, style_1.style)('right-6', scrollButtonStyle), onClick: scroll.scrollRight })) : null] }));
27
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('relative overflow-x-auto no-scrollbar', className), children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, itemClassName: scrollStyleType[tabsType].itemClassName, gap: scrollStyleType[tabsType].gap, children: items.map((0, renderTab_1.renderTab)(value, onChange, tabsType)) }), scroll.canScrollLeft ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ScrollLeftButton, { className: (0, style_1.style)('left-6', scrollButtonStyle, scrollStyleType[tabsType].buttonTop), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ScrollRightButton, { className: (0, style_1.style)('right-6', scrollButtonStyle, scrollStyleType[tabsType].buttonTop), onClick: scroll.scrollRight })) : null] }));
16
28
  });
17
29
  //# sourceMappingURL=ScrollableTabsControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollableTabsControl.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/ScrollableTabsControl.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,6CAA0C;AAC1C,2DAAgF;AAChF,+EAA4E;AAC5E,+EAA4E;AAC5E,2CAAwC;AAGxC,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAElD,QAAA,qBAAqB,GAAG,IAAA,aAAG,EACtC,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvD,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,IAAA,uCAAkB,EAAiB;QAChE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,iCAAK,SAAS,EAAE,IAAA,aAAK,EAAC,uCAAuC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,SAAS,aACvF,uBA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G,SAAS,EAAE,EAAE,EAAE;IACnE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,IAAA,uCAAkB,EAAiB;QAChE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,iCAAK,SAAS,EAAE,IAAA,aAAK,EAAC,uCAAuC,EAAE,SAAS,CAAC,aACvE,uBAAC,uCAAkB,IACjB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAC,YAAY,EACtB,sBAAsB,EAAE,MAAM,CAAC,0BAA0B,EACzD,aAAa,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,aAAa,EACtD,GAAG,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,GAAG,YAEjC,KAAK,CAAC,GAAG,CAAC,IAAA,qBAAS,EAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,GAC7B,EACpB,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CACtB,uBAAC,8BAAgB,IACf,SAAS,EAAE,IAAA,aAAK,EACd,QAAQ,EACR,iBAAiB,EACjB,eAAe,CAAC,QAAQ,CAAC,CAAC,SAAmB,CAC9C,EACD,OAAO,EAAE,MAAM,CAAC,UAAU,GAC1B,CACH,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CACvB,uBAAC,+BAAiB,IAChB,SAAS,EAAE,IAAA,aAAK,EACd,SAAS,EACT,iBAAiB,EACjB,eAAe,CAAC,QAAQ,CAAC,CAAC,SAAmB,CAC9C,EACD,OAAO,EAAE,MAAM,CAAC,WAAW,GAC3B,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,15 +1,16 @@
1
+ import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
1
2
  import { type LinkProps } from '../../model/LinkProps';
3
+ import { type IconProps } from '../../model/Picture';
2
4
  import { type VNode } from '../../model/VNode';
3
- import { type TabsControlProps } from './TabsControlProps';
4
- export interface TabItemBase extends LinkProps {
5
+ import { type TabsControlProps, type TabsType } from './TabsControlProps';
6
+ export interface TabItemBase extends LinkProps, TitleProps, DescriptionProps, IconProps {
5
7
  name?: string;
6
8
  appendRight?: VNode;
7
9
  }
8
- export declare type TabType = 'default' | 'underlined' | 'rounded';
9
10
  export interface TabItemProps {
10
11
  item?: TabItemBase;
11
12
  isActive?: boolean;
12
- type?: TabType;
13
+ type?: TabsType;
13
14
  onClick?: TabsControlProps['onChange'];
14
15
  }
15
16
  export declare const TabItem: import("@redneckz/uni-jsx").UNIComponent<TabItemProps, any, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"TabItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,iDAA8C;AAG9C,iDAA8C;AAgBjC,QAAA,OAAO,GAAG,IAAA,aAAG,EAAe,CAAC,KAAK,EAAE,EAAE,CACjD,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,uBAAC,WAAW,OAAK,KAAK,GAAI,CAAC,CAAC,CAAC,uBAAC,aAAa,OAAK,KAAK,GAAI,CAC9E,CAAC;AAEF,MAAM,WAAW,GAAG,IAAA,aAAG,EAAe,CAAC,KAAK,EAAE,EAAE;IAC9C,MAAM,IAAI,GAAG,IAAA,iBAAO,GAAE,CAAC;IAEvB,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACnC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,CA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IAAI,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAE3E,OAAO,uBAAC,2BAAY,OAAK,KAAK,EAAE,GAAG,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AAC3E,CAAC,CAAC,CAAC;AAEH,mDAAmD;AACnD,MAAM,aAAa,GAAG,IAAA,aAAG,EAAe,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC1E,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,uBAAC,2BAAY,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,KAAM,IAAI,GAAI,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -3,31 +3,37 @@ exports.TabItemInner = 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
5
  const style_1 = require("../../utils/style");
6
- const Text_1 = require("../Text/Text");
6
+ const renderTabItemInner_1 = require("./renderTabItemInner");
7
7
  const tabPaddingStyleMap = {
8
8
  default: 'px-xs',
9
9
  underlined: 'px-m',
10
- rounded: 'px-lg rounded-md',
10
+ animated: 'px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs',
11
11
  };
12
12
  const tabTextStyle = 'text-secondary-text hover:text-primary-main';
13
13
  const activeTabTextStyleMap = {
14
14
  default: 'text-black sm:text-white',
15
15
  underlined: 'text-primary-main border-b-2',
16
- rounded: 'text-white',
16
+ animated: 'text-white sm:text-white',
17
17
  };
18
18
  const tabBgStyleMap = {
19
19
  default: 'bg-white',
20
20
  underlined: 'bg-white',
21
- rounded: 'bg-transparent',
21
+ animated: 'p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96',
22
22
  };
23
23
  const activeTabBgStyleMap = {
24
24
  default: 'sm:bg-primary-main',
25
25
  underlined: 'bg-white',
26
- rounded: 'bg-primary-main',
26
+ animated: 'p-2 border-none bg-primary-main text-white h-20 w-96',
27
27
  };
28
- exports.TabItemInner = (0, uni_jsx_1.JSX)(({ tag = 'div', item = {}, isActive, type = 'default', onClick }) => {
28
+ exports.TabItemInner = (0, uni_jsx_1.JSX)(({ tag = 'div', item = {}, isActive = false, type = 'default', onClick }) => {
29
29
  const Tag = tag;
30
- const { text, appendRight, ...link } = item;
31
- return ((0, jsx_runtime_1.jsx)(Tag, { className: (0, style_1.style)('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tab", "aria-selected": isActive, onClick: onClick, ...link, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-m", children: text }), appendRight ? (0, jsx_runtime_1.jsx)("div", { className: "ml-xs", children: appendRight }) : null] }) }));
30
+ const { text, description, icon, appendRight, ...link } = item;
31
+ return ((0, jsx_runtime_1.jsx)(Tag, { className: (0, style_1.style)('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tablist", onClick: onClick, ...link, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: [(0, renderTabItemInner_1.renderTabItemInner)({
32
+ text,
33
+ description,
34
+ icon,
35
+ isActive,
36
+ type,
37
+ }), appendRight ? (0, jsx_runtime_1.jsx)("div", { className: "ml-xs", children: appendRight }) : null] }) }));
32
38
  });
33
39
  //# sourceMappingURL=TabItemInner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabItemInner.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItemInner.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,6CAA0C;AAC1C,uCAAoC;AAGpC,MAAM,kBAAkB,GAA4B;IAClD,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,kBAAkB;CAC5B,CAAC;AAEF,MAAM,YAAY,GAAG,6CAA6C,CAAC;AAEnE,MAAM,qBAAqB,GAA4B;IACrD,OAAO,EAAE,0BAA0B;IACnC,UAAU,EAAE,8BAA8B;IAC1C,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,aAAa,GAA4B;IAC7C,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,gBAAgB;CAC1B,CAAC;AAEF,MAAM,mBAAmB,GAA4B;IACnD,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AAMW,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAClE,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAE5C,OAAO,CACL,uBAAC,GAAG,IACF,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C7B,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,sDAAsD;CACjE,CAAC;AAMW,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,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,uBAAC,GAAG,IACF,SAAS,EAAE,IAAA,aAAK,EACd,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,kBAAkB,CAAC,IAAI,CAAC,EACxB,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAC3D,EACD,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,OAAO,KACZ,IAAI,YAER,iCACE,SAAS,EAAE,IAAA,aAAK,EACd,QAAQ,EACR,kCAAkC,EAClC,+BAA+B,EAC/B,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CACtD,aAEA,IAAA,uCAAkB,EAAC;oBAClB,IAAI;oBACJ,WAAW;oBACX,IAAI;oBACJ,QAAQ;oBACR,IAAI;iBACL,CAAC,EACD,WAAW,CAAC,CAAC,CAAC,gCAAK,SAAS,EAAC,OAAO,YAAE,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,IAC5D,GACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -4,5 +4,5 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const style_1 = require("../../utils/style");
6
6
  const renderTab_1 = require("./renderTab");
7
- exports.TabsControl = (0, uni_jsx_1.JSX)(({ className, tabsType = 'default', items = [], value, onChange }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('flex gap-x-2xs overflow-x-auto no-scrollbar', className), role: "tablist", children: items.map((0, renderTab_1.renderTab)(value, onChange, tabsType)) })));
7
+ exports.TabsControl = (0, uni_jsx_1.JSX)(({ className, tabsType = 'default', items = [], value, onChange }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('flex gap-x-2xs overflow-x-auto no-scrollbar', className), role: "tabpanel", children: items.map((0, renderTab_1.renderTab)(value, onChange, tabsType)) })));
8
8
  //# sourceMappingURL=TabsControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabsControl.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabsControl.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,6CAA0C;AAC1C,2CAAwC;AAG3B,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpE,gCAAK,SAAS,EAAE,IAAA,aAAK,EAAC,6CAA6C,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,SAAS,YAC5F,KAAK,CAAC,GAAG,CAAC,IAAA,qBAAS,EAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,GAC5C,CACP,CACF,CAAC"}
1
+ {"version":3,"file":"TabsControl.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabsControl.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,6CAA0C;AAC1C,2CAAwC;AAG3B,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpE,gCACE,SAAS,EAAE,IAAA,aAAK,EAAC,6CAA6C,EAAE,SAAS,CAAC,EAC1E,IAAI,EAAC,UAAU,YAEd,KAAK,CAAC,GAAG,CAAC,IAAA,qBAAS,EAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,GAC5C,CACP,CACF,CAAC"}
@@ -1,6 +1,15 @@
1
1
  import { type ListControlProps } from '../ListControlProps';
2
- import { type TabItemBase, type TabType } from './TabItem';
2
+ import { type TabItemBase } from './TabItem';
3
+ /**
4
+ * @title Тип вкладки
5
+ * @enumNames [
6
+ * "По ширине экрана",
7
+ * "С прокруткой",
8
+ * "Кнопка с анимацией",
9
+ * ]
10
+ */
11
+ export declare type TabsType = 'default' | 'underlined' | 'animated';
3
12
  export interface TabsControlProps extends ListControlProps<TabItemBase> {
4
13
  className?: string;
5
- tabsType?: TabType;
14
+ tabsType?: TabsType;
6
15
  }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { type TabItemBase, type TabType } from './TabItem';
3
- import { type TabsControlProps } from './TabsControlProps';
4
- export declare const renderTab: (activeTab?: TabItemBase, onClick?: TabsControlProps['onChange'], type?: TabType) => (tab: TabItemBase, i: number) => JSX.Element;
2
+ import { type TabItemBase } from './TabItem';
3
+ import { type TabsControlProps, type TabsType } from './TabsControlProps';
4
+ export declare const renderTab: (activeTab?: TabItemBase, onClick?: TabsControlProps['onChange'], type?: TabsType) => (tab: TabItemBase, i: number) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"renderTab.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/renderTab.tsx"],"names":[],"mappings":";;;AAAA,uCAAoE;AAG7D,MAAM,SAAS,GACpB,CAAC,SAAuB,EAAE,OAAsC,EAAE,IAAc,EAAE,EAAE,CACpF,CAAC,GAAgB,EAAE,CAAS,EAAE,EAAE,CAC9B,CACE,uBAAC,iBAAO,IACN,QAAQ,EAAE,GAAG,KAAK,SAAS,EAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EAEV,IAAI,EAAE,GAAG,IADJ,MAAM,CAAC,CAAC,CAAC,CAEd,CACH,CAAC;AAXO,QAAA,SAAS,aAWhB"}
1
+ {"version":3,"file":"renderTab.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/renderTab.tsx"],"names":[],"mappings":";;;AAAA,uCAAsD;AAG/C,MAAM,SAAS,GACpB,CAAC,SAAuB,EAAE,OAAsC,EAAE,IAAe,EAAE,EAAE,CACrF,CAAC,GAAgB,EAAE,CAAS,EAAE,EAAE,CAC9B,CACE,uBAAC,iBAAO,IACN,QAAQ,EAAE,GAAG,KAAK,SAAS,EAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EAEV,IAAI,EAAE,GAAG,IADJ,MAAM,CAAC,CAAC,CAAC,CAEd,CACH,CAAC;AAXO,QAAA,SAAS,aAWhB"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type Picture } from '../../model/Picture';
3
+ interface TabsLayoutButtonProps {
4
+ isActive: boolean;
5
+ description?: string;
6
+ icon?: Picture;
7
+ type: string;
8
+ text?: string;
9
+ }
10
+ export declare const renderTabItemInner: ({ text, description, icon, isActive, type, }: TabsLayoutButtonProps) => JSX.Element;
11
+ export {};
@@ -0,0 +1,23 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.renderTabItemInner = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const style_1 = require("../../utils/style");
5
+ const Img_1 = require("../Img/Img");
6
+ const getButtonClassNames = (isActive) => ({
7
+ btn: `w-96 ${isActive ? 'p-m border-none bg-primary-main text-white' : 'p-s ease-in duration-300 bg-white'}`,
8
+ text: isActive ? 'mb-xs text-xl' : 'mb-2xs text-l text-primary-text',
9
+ desc: `font-light ${isActive ? 'text-l text-white' : 'text-m text-secondary-text'}`,
10
+ icon: isActive ? '' : 'text-primary-main',
11
+ iconVersion: (isActive ? 'white' : 'normal'),
12
+ oldText: 'text-m text-center',
13
+ oldDesc: 'text-m-light',
14
+ });
15
+ const renderTabItemInner = ({ text, description, icon, isActive, type, }) => {
16
+ const buttonClassNames = getButtonClassNames(isActive);
17
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('cursor-pointer text-left border-b-0 flex gap-2xs'), "aria-label": text, role: "tab", children: [icon ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { className: (0, style_1.style)('h-6 w-6 min-w-6 min-h-6', buttonClassNames.icon), image: {
18
+ ...icon,
19
+ iconVersion: icon?.iconVersion ?? buttonClassNames.iconVersion,
20
+ }, width: "24", height: "24", alt: text })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "border-0", children: [(0, jsx_runtime_1.jsx)("div", { className: type === 'animated' ? buttonClassNames.text : buttonClassNames.oldText, children: text }), (0, jsx_runtime_1.jsx)("div", { className: type === 'animated' ? buttonClassNames.desc : buttonClassNames.oldDesc, children: description })] })] }));
21
+ };
22
+ exports.renderTabItemInner = renderTabItemInner;
23
+ //# sourceMappingURL=renderTabItemInner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderTabItemInner.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/renderTabItemInner.tsx"],"names":[],"mappings":";;;AAEA,6CAA0C;AAC1C,oCAAiC;AAEjC,MAAM,mBAAmB,GAAG,CAAC,QAAiB,EAAE,EAAE,CAAC,CAAC;IAClD,GAAG,EAAE,QACH,QAAQ,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,mCAC5D,EAAE;IACF,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iCAAiC;IACpE,IAAI,EAAE,cAAc,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,4BAA4B,EAAE;IACnF,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,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