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

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.
@@ -35,6 +35,10 @@ export declare type FieldCommonDef = FieldDefaultDef & {
35
35
  /** @default "common" */
36
36
  fieldType: 'common';
37
37
  };
38
+ /**
39
+ * @title Значение по умолчанию
40
+ * @enumNames ["Валютный контроль","Документарные операции","Конверсионные операции","Иные вопросы ВЭД"]
41
+ */
38
42
  declare type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactions' | 'otherIssues';
39
43
  /**
40
44
  * @title Поле ввода ВЭД
@@ -43,7 +47,6 @@ declare type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTr
43
47
  export declare type FieldVedDef = FieldDefaultDef & {
44
48
  /** @default "ved" */
45
49
  fieldType: 'ved';
46
- /** @title Значение по умолчанию */
47
50
  defaultValue?: VedTypes;
48
51
  };
49
52
  /**
@@ -35,6 +35,10 @@ export declare type FieldCommonDef = FieldDefaultDef & {
35
35
  /** @default "common" */
36
36
  fieldType: 'common';
37
37
  };
38
+ /**
39
+ * @title Значение по умолчанию
40
+ * @enumNames ["Валютный контроль","Документарные операции","Конверсионные операции","Иные вопросы ВЭД"]
41
+ */
38
42
  declare type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactions' | 'otherIssues';
39
43
  /**
40
44
  * @title Поле ввода ВЭД
@@ -43,7 +47,6 @@ declare type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTr
43
47
  export declare type FieldVedDef = FieldDefaultDef & {
44
48
  /** @default "ved" */
45
49
  fieldType: 'ved';
46
- /** @title Значение по умолчанию */
47
50
  defaultValue?: VedTypes;
48
51
  };
49
52
  /**
@@ -35,6 +35,10 @@ export declare type FieldCommonDef = FieldDefaultDef & {
35
35
  /** @default "common" */
36
36
  fieldType: 'common';
37
37
  };
38
+ /**
39
+ * @title Значение по умолчанию
40
+ * @enumNames ["Валютный контроль","Документарные операции","Конверсионные операции","Иные вопросы ВЭД"]
41
+ */
38
42
  declare type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactions' | 'otherIssues';
39
43
  /**
40
44
  * @title Поле ввода ВЭД
@@ -43,7 +47,6 @@ declare type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTr
43
47
  export declare type FieldVedDef = FieldDefaultDef & {
44
48
  /** @default "ved" */
45
49
  fieldType: 'ved';
46
- /** @title Значение по умолчанию */
47
50
  defaultValue?: VedTypes;
48
51
  };
49
52
  /**
@@ -76,6 +76,10 @@ export type FieldCommonDef = FieldDefaultDef & {
76
76
  fieldType: 'common';
77
77
  };
78
78
 
79
+ /**
80
+ * @title Значение по умолчанию
81
+ * @enumNames ["Валютный контроль","Документарные операции","Конверсионные операции","Иные вопросы ВЭД"]
82
+ */
79
83
  type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactions' | 'otherIssues';
80
84
 
81
85
  /**
@@ -85,7 +89,6 @@ type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactio
85
89
  export type FieldVedDef = FieldDefaultDef & {
86
90
  /** @default "ved" */
87
91
  fieldType: 'ved';
88
- /** @title Значение по умолчанию */
89
92
  defaultValue?: VedTypes;
90
93
  };
91
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.334",
3
+ "version": "0.14.336",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -76,6 +76,10 @@ export type FieldCommonDef = FieldDefaultDef & {
76
76
  fieldType: 'common';
77
77
  };
78
78
 
79
+ /**
80
+ * @title Значение по умолчанию
81
+ * @enumNames ["Валютный контроль","Документарные операции","Конверсионные операции","Иные вопросы ВЭД"]
82
+ */
79
83
  type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactions' | 'otherIssues';
80
84
 
81
85
  /**
@@ -85,7 +89,6 @@ type VedTypes = 'currencyControl' | 'documentOperations' | 'conversionTransactio
85
89
  export type FieldVedDef = FieldDefaultDef & {
86
90
  /** @default "ved" */
87
91
  fieldType: 'ved';
88
- /** @title Значение по умолчанию */
89
92
  defaultValue?: VedTypes;
90
93
  };
91
94
 
@@ -1,21 +1,30 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
1
  import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
2
  import { BaseProductTile } from '../../ui-kit/BaseProductTile/BaseProductTile';
4
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
+ import { ScrollLeftButton, ScrollRightButton } from '../../ui-kit/LinkButton/ArrowButton';
5
+ import { SwipeListContainer } from '../../ui-kit/SwipeListControl/SwipeListContainer';
6
+ import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll';
7
+ import { UniBlock } from '../../UniBlock/UniBlock';
5
8
  import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
6
9
  import { style } from '../../utils/style';
7
10
  import { type ProductGalleryContent, type ProductSlide } from './ProductGalleryContent';
8
11
 
9
12
  export interface ProductGalleryProps extends ProductGalleryContent, UniBlockProps {}
10
13
 
11
- export const ProductGallery = JSX<ProductGalleryProps>(
14
+ const scrollButtonStyle = 'hidden sm:flex absolute z-40 top-10';
15
+
16
+ export const ProductGallery = UniBlock<ProductGalleryProps>(
12
17
  ({ className = '', padding, slides = [], ...rest }) => {
13
18
  const [activeSlideIndex, setActiveSlideIndex] = useState(0);
14
19
 
20
+ const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({
21
+ itemCount: slides?.length || 0,
22
+ });
23
+
15
24
  return (
16
25
  <BlockWrapper
17
26
  className={style('box-border overflow-hidden', className)}
18
- defaultPadding="py-6xl"
27
+ defaultPadding="pt-6xl"
19
28
  padding={padding}
20
29
  {...rest}
21
30
  >
@@ -36,8 +45,29 @@ export const ProductGallery = JSX<ProductGalleryProps>(
36
45
  </div>
37
46
  ))}
38
47
  </div>
39
- <div className="h-28 px-xs mt-m -mb-m flex gap-xs box-border">
40
- {slides.map(renderNavButton({ activeSlideIndex, onClick: setActiveSlideIndex }))}
48
+
49
+ <div className="relative pr-xs mt-m -mb-m flex gap-xs box-border">
50
+ <SwipeListContainer
51
+ containerRef={containerRef}
52
+ snapAlign="snap-start"
53
+ onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
54
+ itemClassName={'h-40 flex items-stretch w-screen'}
55
+ gap={8}
56
+ >
57
+ {slides.map(renderNavButton({ activeSlideIndex, onClick: setActiveSlideIndex }))}
58
+ </SwipeListContainer>
59
+ {scroll.canScrollLeft ? (
60
+ <ScrollLeftButton
61
+ className={style('left-6', scrollButtonStyle)}
62
+ onClick={scroll.scrollLeft}
63
+ />
64
+ ) : null}
65
+ {scroll.canScrollRight ? (
66
+ <ScrollRightButton
67
+ className={style('right-6', scrollButtonStyle)}
68
+ onClick={scroll.scrollRight}
69
+ />
70
+ ) : null}
41
71
  </div>
42
72
  </BlockWrapper>
43
73
  );
@@ -55,7 +85,7 @@ const renderNavButton =
55
85
  const isActive = i === activeSlideIndex;
56
86
  const btnClassName = isActive
57
87
  ? 'min-w-[350px] bg-white shadow-dark-blue border-none p-6'
58
- : 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:py-xl backdrop-blur';
88
+ : 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur';
59
89
  const btnTitleClassName = isActive
60
90
  ? 'text-primary-text text-h6 py-xs'
61
91
  : 'text-l pb-2xs text-secondary-text group-data-secondary:text-white';
@@ -70,7 +100,7 @@ const renderNavButton =
70
100
  onClick={() => onClick(i)}
71
101
  aria-label={nav?.title}
72
102
  className={style(
73
- 'relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50',
103
+ 'max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50',
74
104
  btnClassName,
75
105
  )}
76
106
  >