@snack-uikit/chips 0.27.20 → 0.27.21-preview-9e1e07bc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -248,7 +248,7 @@ import { PlaceholderSVG } from '@snack-uikit/icons';
248
248
  | defaultValue | `Date` | - | Значение компонента по-умолчанию |
249
249
  | onChange | `(value: Date) => void` | - | Колбек смены значения |
250
250
  | valueRender | `(value?: Date) => ReactNode` | - | Колбек формирующий строковое представление выбранного значения. Принимает выбранное значение |
251
- | mode | "date" \| "month" \| "date-time" | - | |
251
+ | mode | "date" \| "month" \| "date-time" \| "year" | - | |
252
252
  | buildCalendarCellProps | `BuildCellPropsFunction` | - | Колбек свойств для управления ячейками календаря |
253
253
  | showSeconds | `boolean` | - | |
254
254
  ## ChipChoice.DateRange
@@ -18,7 +18,7 @@ export type ChipChoiceDateProps = ChipChoiceCommonProps & {
18
18
  /** Колбек свойств для управления ячейками календаря */
19
19
  buildCalendarCellProps?: CalendarProps['buildCellProps'];
20
20
  } & (ChipChoiceDateWithSeconds | {
21
- mode?: 'date' | 'month';
21
+ mode?: 'date' | 'month' | 'year';
22
22
  });
23
23
  export declare function ChipChoiceDate({ size, value, defaultValue, onChange, valueRender, dropDownClassName, mode, placement, widthStrategy, buildCalendarCellProps, onClearButtonClick, open: openProp, onOpenChange, ...rest }: ChipChoiceDateProps): import("react/jsx-runtime").JSX.Element;
24
24
  export {};
@@ -80,7 +80,7 @@ function ChipChoiceDate(_a) {
80
80
  }
81
81
  return date.toLocaleDateString(constants_2.DEFAULT_LOCALE, {
82
82
  year: 'numeric',
83
- month: 'numeric',
83
+ month: mode === 'date' || mode === 'month' ? 'numeric' : undefined,
84
84
  day: mode === 'date' ? 'numeric' : undefined
85
85
  });
86
86
  }, [mode, selectedValue, showSeconds, t, valueRender]);
@@ -18,7 +18,7 @@ export type ChipChoiceDateProps = ChipChoiceCommonProps & {
18
18
  /** Колбек свойств для управления ячейками календаря */
19
19
  buildCalendarCellProps?: CalendarProps['buildCellProps'];
20
20
  } & (ChipChoiceDateWithSeconds | {
21
- mode?: 'date' | 'month';
21
+ mode?: 'date' | 'month' | 'year';
22
22
  });
23
23
  export declare function ChipChoiceDate({ size, value, defaultValue, onChange, valueRender, dropDownClassName, mode, placement, widthStrategy, buildCalendarCellProps, onClearButtonClick, open: openProp, onOpenChange, ...rest }: ChipChoiceDateProps): import("react/jsx-runtime").JSX.Element;
24
24
  export {};
@@ -52,7 +52,7 @@ export function ChipChoiceDate(_a) {
52
52
  }
53
53
  return date.toLocaleDateString(DEFAULT_LOCALE, {
54
54
  year: 'numeric',
55
- month: 'numeric',
55
+ month: mode === 'date' || mode === 'month' ? 'numeric' : undefined,
56
56
  day: mode === 'date' ? 'numeric' : undefined,
57
57
  });
58
58
  }, [mode, selectedValue, showSeconds, t, valueRender]);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Chips",
7
- "version": "0.27.20",
7
+ "version": "0.27.21-preview-9e1e07bc.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -37,7 +37,7 @@
37
37
  "scripts": {},
38
38
  "dependencies": {
39
39
  "@snack-uikit/button": "0.19.15",
40
- "@snack-uikit/calendar": "0.12.20",
40
+ "@snack-uikit/calendar": "0.12.21-preview-9e1e07bc.0",
41
41
  "@snack-uikit/divider": "3.2.9",
42
42
  "@snack-uikit/dropdown": "0.5.2",
43
43
  "@snack-uikit/icons": "0.27.2",
@@ -57,5 +57,5 @@
57
57
  "peerDependencies": {
58
58
  "@snack-uikit/locale": "*"
59
59
  },
60
- "gitHead": "f40ab395048226e33e85848bbc5ad7e5964b4b5d"
60
+ "gitHead": "f7a3163712030cc723c102a8936a75a88a441227"
61
61
  }
@@ -32,7 +32,7 @@ export type ChipChoiceDateProps = ChipChoiceCommonProps & {
32
32
  } & (
33
33
  | ChipChoiceDateWithSeconds
34
34
  | {
35
- mode?: 'date' | 'month';
35
+ mode?: 'date' | 'month' | 'year';
36
36
  }
37
37
  );
38
38
 
@@ -90,7 +90,7 @@ export function ChipChoiceDate({
90
90
 
91
91
  return date.toLocaleDateString(DEFAULT_LOCALE, {
92
92
  year: 'numeric',
93
- month: 'numeric',
93
+ month: mode === 'date' || mode === 'month' ? 'numeric' : undefined,
94
94
  day: mode === 'date' ? 'numeric' : undefined,
95
95
  });
96
96
  }, [mode, selectedValue, showSeconds, t, valueRender]);