@itcase/ui-web 1.9.110 → 1.9.112
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/dist/{Button_cjs_ConzdKae.js → Button_cjs_CDr9zTdB.js} +1 -1
- package/dist/{Button_es_Ob6KGKAf.js → Button_es_M2ryMLoI.js} +1 -1
- package/dist/DatePicker_cjs_Cd7wsJCG.js +1 -0
- package/dist/DatePicker_es_BhrZj2OP.js +1 -0
- package/dist/cjs/components/Button.js +1 -1
- package/dist/cjs/components/CookiesWarning.js +1 -1
- package/dist/cjs/components/DatePeriod.js +1 -1
- package/dist/cjs/components/DatePicker.js +1 -1
- package/dist/cjs/components/Dropzone.js +1 -1
- package/dist/cjs/components/InputNumber.js +1 -1
- package/dist/cjs/components/Notification.js +1 -1
- package/dist/cjs/components/Response.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/CookiesWarning.js +1 -1
- package/dist/components/DatePeriod.js +1 -1
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/Dropzone.js +1 -1
- package/dist/components/InputNumber.js +1 -1
- package/dist/components/Notification.js +1 -1
- package/dist/components/Response.js +1 -1
- package/dist/css/styles/bundles.css +18 -6
- package/dist/stories/DatePickerOverview.mdx +1 -1
- package/dist/types/components/Button/Button.js +1 -1
- package/dist/types/components/DatePicker/DatePicker.interface.d.ts +22 -28
- package/dist/types/components/DatePicker/DatePicker.js +3 -4
- package/dist/types/components/DatePicker/stories/DatePicker.stories.d.ts +10 -1
- package/dist/types/components/DatePicker/stories/DatePicker.stories.js +31 -33
- package/dist/types/components/DatePicker/stories/DatePickerClear.stories.d.ts +9 -1
- package/dist/types/components/DatePicker/stories/DatePickerClear.stories.js +20 -24
- package/dist/types/components/DatePicker/stories/DatePickerSize.stories.d.ts +8 -0
- package/dist/types/components/DatePicker/stories/DatePickerSize.stories.js +13 -24
- package/dist/types/components/DatePicker/stories/DatePickerStory.d.ts +2 -0
- package/dist/types/components/DatePicker/stories/DatePickerStory.js +18 -0
- package/dist/types/components/DatePicker/stories/DatePickerStyle.stories.d.ts +8 -0
- package/dist/types/components/DatePicker/stories/DatePickerStyle.stories.js +13 -29
- package/dist/types/components/DatePicker/stories/DatePickerWithButton.stories.d.ts +12 -1
- package/dist/types/components/DatePicker/stories/DatePickerWithButton.stories.js +30 -32
- package/package.json +2 -2
- package/dist/DatePicker_cjs_BnCUToKG.js +0 -1
- package/dist/DatePicker_es_CQ__CIKJ.js +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { DatePickerInput } from '../DatePicker';
|
|
4
|
+
export function createDatePickerStory(defaultArgs = {}) {
|
|
5
|
+
return function DatePickerStory(args) {
|
|
6
|
+
const [dates, setDates] = useState(() => ({
|
|
7
|
+
end: args.endValue ? new Date(args.endValue) : null,
|
|
8
|
+
start: args.value ? new Date(args.value) : null,
|
|
9
|
+
}));
|
|
10
|
+
return (_jsx(DatePickerInput, { ...defaultArgs, ...args, datePickerProps: {
|
|
11
|
+
...defaultArgs.datePickerProps,
|
|
12
|
+
...args.datePickerProps,
|
|
13
|
+
}, endValue: dates.end?.toISOString(), inputProps: {
|
|
14
|
+
...defaultArgs.inputProps,
|
|
15
|
+
...args.inputProps,
|
|
16
|
+
}, value: dates.start?.toISOString(), onChange: (start, end) => setDates({ end, start }) }));
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -5,6 +5,14 @@ declare const meta: {
|
|
|
5
5
|
component: typeof DatePickerInput;
|
|
6
6
|
args: {
|
|
7
7
|
width: "220px";
|
|
8
|
+
datePickerProps: {
|
|
9
|
+
appearance: "surfacePrimary sizeM solid rounded";
|
|
10
|
+
dateFormat: string;
|
|
11
|
+
placeholderText: string;
|
|
12
|
+
};
|
|
13
|
+
inputProps: {
|
|
14
|
+
appearance: "defaultPrimary sizeM solid rounded";
|
|
15
|
+
};
|
|
8
16
|
};
|
|
9
17
|
parameters: {
|
|
10
18
|
layout: string;
|
|
@@ -1,65 +1,49 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { DatePickerInput } from '../DatePicker';
|
|
2
|
+
import { createDatePickerStory } from './DatePickerStory';
|
|
3
3
|
const meta = {
|
|
4
4
|
title: 'Molecules / DatePicker / Style',
|
|
5
5
|
component: DatePickerInput,
|
|
6
6
|
args: {
|
|
7
7
|
width: '220px',
|
|
8
|
-
},
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
export const Solid = {
|
|
15
|
-
args: {
|
|
16
8
|
datePickerProps: {
|
|
17
9
|
appearance: 'surfacePrimary sizeM solid rounded',
|
|
10
|
+
dateFormat: 'dd.MM.yyyy',
|
|
11
|
+
placeholderText: 'Выберите дату',
|
|
18
12
|
},
|
|
19
13
|
inputProps: {
|
|
20
14
|
appearance: 'defaultPrimary sizeM solid rounded',
|
|
21
15
|
},
|
|
22
16
|
},
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'centered',
|
|
25
19
|
},
|
|
26
20
|
};
|
|
21
|
+
export default meta;
|
|
22
|
+
const DatePickerStory = createDatePickerStory(meta.args);
|
|
23
|
+
export const Solid = {
|
|
24
|
+
render: DatePickerStory,
|
|
25
|
+
};
|
|
27
26
|
export const Outlined = {
|
|
28
27
|
args: {
|
|
29
|
-
datePickerProps: {
|
|
30
|
-
appearance: 'surfacePrimary sizeM solid rounded',
|
|
31
|
-
},
|
|
32
28
|
inputProps: {
|
|
33
29
|
appearance: 'defaultPrimary sizeM outlined rounded',
|
|
34
30
|
},
|
|
35
31
|
},
|
|
36
|
-
render:
|
|
37
|
-
return _jsx(DatePickerInput, { ...args });
|
|
38
|
-
},
|
|
32
|
+
render: DatePickerStory,
|
|
39
33
|
};
|
|
40
34
|
export const Ghost = {
|
|
41
35
|
args: {
|
|
42
|
-
datePickerProps: {
|
|
43
|
-
appearance: 'surfacePrimary sizeM solid rounded',
|
|
44
|
-
},
|
|
45
36
|
inputProps: {
|
|
46
37
|
appearance: 'defaultPrimary sizeM ghost rounded',
|
|
47
38
|
},
|
|
48
39
|
},
|
|
49
|
-
render:
|
|
50
|
-
return _jsx(DatePickerInput, { ...args });
|
|
51
|
-
},
|
|
40
|
+
render: DatePickerStory,
|
|
52
41
|
};
|
|
53
42
|
export const Full = {
|
|
54
43
|
args: {
|
|
55
|
-
datePickerProps: {
|
|
56
|
-
appearance: 'surfacePrimary sizeM solid rounded',
|
|
57
|
-
},
|
|
58
44
|
inputProps: {
|
|
59
45
|
appearance: 'defaultPrimary sizeM full rounded',
|
|
60
46
|
},
|
|
61
47
|
},
|
|
62
|
-
render:
|
|
63
|
-
return _jsx(DatePickerInput, { ...args });
|
|
64
|
-
},
|
|
48
|
+
render: DatePickerStory,
|
|
65
49
|
};
|
|
@@ -5,6 +5,16 @@ declare const meta: {
|
|
|
5
5
|
component: typeof DatePickerInput;
|
|
6
6
|
args: {
|
|
7
7
|
width: "220px";
|
|
8
|
+
datePickerProps: {
|
|
9
|
+
appearance: "surfacePrimary sizeM solid rounded";
|
|
10
|
+
customTimeInput: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
dateFormat: string;
|
|
12
|
+
placeholderText: string;
|
|
13
|
+
showTimeInput: true;
|
|
14
|
+
};
|
|
15
|
+
inputProps: {
|
|
16
|
+
appearance: "defaultPrimary sizeM solid rounded";
|
|
17
|
+
};
|
|
8
18
|
};
|
|
9
19
|
parameters: {
|
|
10
20
|
layout: string;
|
|
@@ -12,6 +22,7 @@ declare const meta: {
|
|
|
12
22
|
};
|
|
13
23
|
export default meta;
|
|
14
24
|
type Story = StoryObj<typeof meta>;
|
|
15
|
-
export declare const
|
|
25
|
+
export declare const Default: Story;
|
|
26
|
+
export declare const WithInitialDate: Story;
|
|
16
27
|
export declare const DateTime: Story;
|
|
17
28
|
export declare const DateRange: Story;
|
|
@@ -1,68 +1,66 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../../Button';
|
|
3
3
|
import { DatePickerInput } from '../DatePicker';
|
|
4
|
+
import { createDatePickerStory } from './DatePickerStory';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Molecules / DatePicker / With Button',
|
|
6
7
|
component: DatePickerInput,
|
|
7
8
|
args: {
|
|
8
9
|
width: '220px',
|
|
9
|
-
},
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export default meta;
|
|
15
|
-
export const Date = {
|
|
16
|
-
args: {
|
|
17
10
|
datePickerProps: {
|
|
18
11
|
appearance: 'surfacePrimary sizeM solid rounded',
|
|
19
12
|
customTimeInput: (_jsx(Button, { appearance: "accentPrimary sizeL solid rounded", width: "fill", label: "OK" })),
|
|
20
|
-
dateFormat: 'dd
|
|
13
|
+
dateFormat: 'dd.MM.yyyy',
|
|
14
|
+
placeholderText: 'Выберите дату',
|
|
21
15
|
showTimeInput: true,
|
|
22
16
|
},
|
|
23
17
|
inputProps: {
|
|
24
18
|
appearance: 'defaultPrimary sizeM solid rounded',
|
|
25
19
|
},
|
|
26
20
|
},
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: 'centered',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
const DatePickerStory = createDatePickerStory(meta.args);
|
|
27
|
+
export const Default = {
|
|
28
|
+
render: DatePickerStory,
|
|
29
|
+
};
|
|
30
|
+
export const WithInitialDate = {
|
|
31
|
+
args: {
|
|
32
|
+
datePickerProps: {
|
|
33
|
+
placeholderText: 'Дата с начальным значением',
|
|
34
|
+
},
|
|
35
|
+
value: '2025-06-15',
|
|
29
36
|
},
|
|
37
|
+
render: DatePickerStory,
|
|
30
38
|
};
|
|
31
39
|
export const DateTime = {
|
|
32
40
|
args: {
|
|
33
41
|
datePickerProps: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
showTimeInput: true,
|
|
42
|
+
dateFormat: 'dd.MM.yyyy HH:mm',
|
|
43
|
+
placeholderText: 'Дата и время',
|
|
44
|
+
popperPlacement: 'bottom',
|
|
38
45
|
showTimeSelect: true,
|
|
39
46
|
timeCaption: 'Время',
|
|
40
|
-
timeFormat: '
|
|
47
|
+
timeFormat: 'HH:mm',
|
|
41
48
|
timeIntervals: 15,
|
|
42
49
|
},
|
|
43
|
-
|
|
44
|
-
appearance: 'defaultPrimary sizeM solid rounded',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
render: (args) => {
|
|
48
|
-
return _jsx(DatePickerInput, { ...args });
|
|
50
|
+
value: '2025-06-15T14:30:00',
|
|
49
51
|
},
|
|
52
|
+
render: DatePickerStory,
|
|
50
53
|
};
|
|
51
54
|
export const DateRange = {
|
|
52
55
|
args: {
|
|
56
|
+
width: '360px',
|
|
53
57
|
datePickerProps: {
|
|
54
|
-
appearance: 'surfacePrimary sizeM solid rounded',
|
|
55
|
-
customTimeInput: (_jsx(Button, { appearance: "accentPrimary sizeL solid rounded", width: "fill", label: "OK", shape: "rounded" })),
|
|
56
58
|
monthsShown: 2,
|
|
57
|
-
placeholderText: '
|
|
59
|
+
placeholderText: 'Начало – конец',
|
|
58
60
|
selectsRange: true,
|
|
59
|
-
showTimeInput: true,
|
|
60
61
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
render: (args) => {
|
|
66
|
-
return _jsx(DatePickerInput, { ...args });
|
|
62
|
+
endValue: '2025-06-20',
|
|
63
|
+
value: '2025-06-01',
|
|
67
64
|
},
|
|
65
|
+
render: DatePickerStory,
|
|
68
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui-web",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.112",
|
|
4
4
|
"description": "UI components",
|
|
5
5
|
"keywords": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"storybook": "^10.4.0",
|
|
115
115
|
"typescript": "^6.0.3"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "985b7cd49b2f7db7233d288d4561b5af826037f0"
|
|
118
118
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("clsx"),a=require("date-fns/locale"),i=require("react-datepicker"),o=require("@itcase/ui-core/hooks"),l=require("./Button_cjs_ConzdKae.js"),c=require("./primitives_cjs_ocTnUpml.js"),n=require("./Input_cjs_D9PxC_lJ.js"),s=require("./Label_cjs_DI2LmDIX.js"),p=require("./default_cjs_BMbs2it-.js");const u={surfacePrimary:{dayTextColor:"surfaceTextPrimary",dayTextShape:"rounded",iconFillHover:"surfaceSecondary",iconItemFill:"surfaceItemPrimary",iconShape:"circular",monthTextColor:"surfaceTextPrimary",monthTextWeight:"400",yearTextColor:"surfaceTextPrimary",yearTextWeight:"400"},...{sizeL:{size:"l",daySize:"xs",dayTextSize:"m",iconFillSize:"24",iconLeft:p.icons14.Arrow.ChevronLeft,iconRight:p.icons14.Arrow.ChevronRight},sizeM:{size:"m",daySize:"xxl",dayTextSize:"m",iconFillSize:"24",iconLeft:p.icons14.Arrow.ChevronLeft,iconRight:p.icons14.Arrow.ChevronRight,iconSize:"14",monthTextSize:"m",yearTextSize:"m"},sizeS:{size:"s",daySize:"xs",dayTextSize:"m",iconFillSize:"24",iconLeft:p.icons14.Arrow.ChevronLeft,iconRight:p.icons14.Arrow.ChevronRight}},solid:{inputProps:{borderColor:"none"}},outlined:{inputProps:{fill:"none"}},full:{},ghost:{inputProps:{fill:"none",borderColor:"none"}}},d=e=>{const t=e.getDay()||7,r=new Date(e);r.setDate(e.getDate()-(t-1));const a=new Date(r);return a.setDate(r.getDate()+6),{mondayDate:r,sundayDate:a}},m={appearance:u,setAppearance:e=>{m.appearance=e}};const x=t.forwardRef((a,i)=>{const{inputIcon:o,inputProps:l,value:c,isClearable:s}=a,p=t.useMemo(()=>{if(c){const e=c.split(" - ");return e[0]===e[1]?e[0]:c}return""},[c]);return e.jsxs(t.Fragment,{children:[e.jsx(n.Input,{...a,...l,className:r(l?.className,"datepicker__input"),ref:i,autocomplete:"off",value:p}),o&&e.jsx(S,{...l}),s&&e.jsx(h,{...l})]})});function h(a){const{clearIcon:i,clearIconFill:o,clearIconFillHover:l,clearIconFillSize:n,clearIconItemFill:p,clearIconItemFillHover:u,clearIconShape:d,clearIconSize:m,clearIconSrc:x,clearLabel:h,clearLabelTextColor:S,clearLabelTextColorHover:C,clearLabelTextSize:f,datepickerRef:y}=a,_=t.useCallback(e=>{y?.current?.onClearClick(e),y?.current?.handleFocus(e)},[]);return e.jsx(t.Fragment,{children:h?e.jsx(s.Label,{className:r("react-datepicker__clear-label","cursor_type_pointer"),label:h,labelTextColor:S,labelTextColorHover:C,labelTextSize:f,onClick:_}):(i||x)&&e.jsx(c.Icon,{className:r("react-datepicker__clear-icon","cursor_type_pointer"),size:m,fill:o,fillHover:l,fillSize:n,iconFill:p,iconFillHover:u,imageSrc:x,shape:d,SvgImage:i,onClick:_})})}function S(t){const{inputIcon:a,inputIconFill:i,inputIconFillHover:o,inputIconFillSize:l,inputIconItemFill:n,inputIconShape:s,inputIconSize:p,inputIconSrc:u,onClick:d}=t;return e.jsx(c.Icon,{className:r("react-datepicker__input-icon","cursor_type_pointer"),size:p,fill:i,fillHover:o,fillSize:l,iconFill:n,imageSrc:u,shape:s,SvgImage:a,onClick:()=>d&&d()})}exports.DatePickerInput=function(n){const{className:s,dataTestId:p,dataTour:u,datePickerProps:h={},endValue:S,inputProps:C={},value:f,onChange:y}=n,{appearance:_,customTimeInput:k,disablePastDays:g,monthsShown:z,selectsRange:I,showWeekNumbers:v,showWeekPicker:T}=h,b=o.useAppearanceConfig(_,m),j=o.useDevicePropsGenerator(h,b),{daySize:F,dayTextColor:D,dayTextShape:P,dayTextSize:w,iconFill:L,iconFillHover:N,iconFillSize:R,iconItemFill:H,iconLeft:q,iconRight:A,iconShape:W,monthTextColor:M,monthTextSize:$,monthTextWeight:B,popper:O,popperPlacement:U,sizeClass:G,widthClass:V,yearTextColor:E,yearTextSize:J,yearTextWeight:K,isClearable:Q}=j,X=t.useRef(null),[Y,Z]=t.useMemo(()=>{let e,t;return f&&(e="string"==typeof f?new Date(f):f),S&&(t="string"==typeof S?new Date(S):S),[e,t]},[f,S]),ee=t.useCallback(e=>{const t=Array.isArray(e)?e:[e],[r,a]=t;if(r&&T){const{mondayDate:e,sundayDate:t}=d(r);y?.(e,t)}else y?.(r,a)},[T,y]),te=t.useCallback(e=>{const{mondayDate:t,sundayDate:r}=d(e);y?.(t,r)},[y]),re=t.useCallback((t,r)=>e.jsx(l.Button,{className:"react-datepicker__day-button",size:F,label:r.getDate().toString(),labelTextColor:D,labelTextSize:w,shape:P}),[F,D,P,w]),ae=t.useCallback(({decreaseMonth:t,increaseMonth:r,monthDate:a})=>e.jsxs("div",{className:"react-datepicker__header--div",children:[q&&e.jsx(c.Icon,{className:"react-datepicker__icon",fill:L,fillHover:N,fillSize:R,iconFill:H,shape:W,SvgImage:q,onClick:t}),e.jsxs("div",{className:"react-datepicker__data",children:[e.jsx(c.Text,{className:"react-datepicker__month",size:$,textColor:M,textWeight:B,children:a.toLocaleString("ru-RU",{month:"long"})}),e.jsx(c.Text,{className:"react-datepicker__year",size:J,textColor:E,textWeight:K,children:a.toLocaleString("ru-RU",{year:"numeric"})})]}),A&&e.jsx(c.Icon,{className:"react-datepicker__icon",fill:L,fillHover:N,fillSize:R,iconFill:H,shape:W,SvgImage:A,onClick:r})]}),[L,N,R,H,q,A,W,M,$,B,E,J,K]),{styles:ie}=o.useStyles(n);return e.jsx("div",{className:r(s,"datepicker",z&&"datepicker_multiple-months",k&&"datepicker_button",G&&`datepicker_size_${G}`,V&&`datepicker_width_${V}`),"data-testid":p,"data-tour":u,style:ie,children:e.jsx(i,{ref:X,...h,minDate:g?new Date:void 0,customInput:e.jsx(x,{datepickerRef:X,inputProps:C,isClearable:Q}),endDate:I?Z:void 0,locale:a.ru,outsideClickIgnoreClass:"react-datepicker-popper",popperClassName:O&&`react-datepicker-popper-${O}`,popperPlacement:U,preventOpenOnFocus:!0,renderCustomHeader:ae,renderDayContents:re,selected:Y,startDate:Y,isClearable:!1,onChange:ee,onWeekSelect:v?te:void 0})})},exports.datePickerAppearance=u,exports.datePickerConfig=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useMemo as a,useCallback as i,useRef as o}from"react";import l from"clsx";import{ru as n}from"date-fns/locale";import c from"react-datepicker";import{useAppearanceConfig as s,useDevicePropsGenerator as p,useStyles as m}from"@itcase/ui-core/hooks";import{B as d}from"./Button_es_Ob6KGKAf.js";import{I as u,T as h}from"./primitives_es_BQqNcRQk.js";import{I as f}from"./Input_es_DabuPYuA.js";import{L as S}from"./Label_es_C4QnITZA.js";import{a as y}from"./default_es_CaWUd9iO.js";const _={surfacePrimary:{dayTextColor:"surfaceTextPrimary",dayTextShape:"rounded",iconFillHover:"surfaceSecondary",iconItemFill:"surfaceItemPrimary",iconShape:"circular",monthTextColor:"surfaceTextPrimary",monthTextWeight:"400",yearTextColor:"surfaceTextPrimary",yearTextWeight:"400"},...{sizeL:{size:"l",daySize:"xs",dayTextSize:"m",iconFillSize:"24",iconLeft:y.Arrow.ChevronLeft,iconRight:y.Arrow.ChevronRight},sizeM:{size:"m",daySize:"xxl",dayTextSize:"m",iconFillSize:"24",iconLeft:y.Arrow.ChevronLeft,iconRight:y.Arrow.ChevronRight,iconSize:"14",monthTextSize:"m",yearTextSize:"m"},sizeS:{size:"s",daySize:"xs",dayTextSize:"m",iconFillSize:"24",iconLeft:y.Arrow.ChevronLeft,iconRight:y.Arrow.ChevronRight}},solid:{inputProps:{borderColor:"none"}},outlined:{inputProps:{fill:"none"}},full:{},ghost:{inputProps:{fill:"none",borderColor:"none"}}},x=e=>{const t=e.getDay()||7,r=new Date(e);r.setDate(e.getDate()-(t-1));const a=new Date(r);return a.setDate(r.getDate()+6),{mondayDate:r,sundayDate:a}},C={appearance:_,setAppearance:e=>{C.appearance=e}};function z(r){const{className:f,dataTestId:S,dataTour:y,datePickerProps:_={},endValue:z,inputProps:k={},value:I,onChange:T}=r,{appearance:v,customTimeInput:F,disablePastDays:D,monthsShown:b,selectsRange:w,showWeekNumbers:P,showWeekPicker:L}=_,N=s(v,C),H=p(_,N),{daySize:R,dayTextColor:A,dayTextShape:W,dayTextSize:j,iconFill:M,iconFillHover:$,iconFillSize:B,iconItemFill:O,iconLeft:U,iconRight:V,iconShape:q,monthTextColor:E,monthTextSize:G,monthTextWeight:J,popper:K,popperPlacement:Q,sizeClass:X,widthClass:Y,yearTextColor:Z,yearTextSize:ee,yearTextWeight:te,isClearable:re}=H,ae=o(null),[ie,oe]=a(()=>{let e,t;return I&&(e="string"==typeof I?new Date(I):I),z&&(t="string"==typeof z?new Date(z):z),[e,t]},[I,z]),le=i(e=>{const t=Array.isArray(e)?e:[e],[r,a]=t;if(r&&L){const{mondayDate:e,sundayDate:t}=x(r);T?.(e,t)}else T?.(r,a)},[L,T]),ne=i(e=>{const{mondayDate:t,sundayDate:r}=x(e);T?.(t,r)},[T]),ce=i((e,r)=>t(d,{className:"react-datepicker__day-button",size:R,label:r.getDate().toString(),labelTextColor:A,labelTextSize:j,shape:W}),[R,A,W,j]),se=i(({decreaseMonth:r,increaseMonth:a,monthDate:i})=>e("div",{className:"react-datepicker__header--div",children:[U&&t(u,{className:"react-datepicker__icon",fill:M,fillHover:$,fillSize:B,iconFill:O,shape:q,SvgImage:U,onClick:r}),e("div",{className:"react-datepicker__data",children:[t(h,{className:"react-datepicker__month",size:G,textColor:E,textWeight:J,children:i.toLocaleString("ru-RU",{month:"long"})}),t(h,{className:"react-datepicker__year",size:ee,textColor:Z,textWeight:te,children:i.toLocaleString("ru-RU",{year:"numeric"})})]}),V&&t(u,{className:"react-datepicker__icon",fill:M,fillHover:$,fillSize:B,iconFill:O,shape:q,SvgImage:V,onClick:a})]}),[M,$,B,O,U,V,q,E,G,J,Z,ee,te]),{styles:pe}=m(r);return t("div",{className:l(f,"datepicker",b&&"datepicker_multiple-months",F&&"datepicker_button",X&&`datepicker_size_${X}`,Y&&`datepicker_width_${Y}`),"data-testid":S,"data-tour":y,style:pe,children:t(c,{ref:ae,..._,minDate:D?new Date:void 0,customInput:t(g,{datepickerRef:ae,inputProps:k,isClearable:re}),endDate:w?oe:void 0,locale:n,outsideClickIgnoreClass:"react-datepicker-popper",popperClassName:K&&`react-datepicker-popper-${K}`,popperPlacement:Q,preventOpenOnFocus:!0,renderCustomHeader:se,renderDayContents:ce,selected:ie,startDate:ie,isClearable:!1,onChange:le,onWeekSelect:P?ne:void 0})})}const g=r.forwardRef((i,o)=>{const{inputIcon:n,inputProps:c,value:s,isClearable:p}=i,m=a(()=>{if(s){const e=s.split(" - ");return e[0]===e[1]?e[0]:s}return""},[s]);return e(r.Fragment,{children:[t(f,{...i,...c,className:l(c?.className,"datepicker__input"),ref:o,autocomplete:"off",value:m}),n&&t(I,{...c}),p&&t(k,{...c})]})});function k(e){const{clearIcon:a,clearIconFill:o,clearIconFillHover:n,clearIconFillSize:c,clearIconItemFill:s,clearIconItemFillHover:p,clearIconShape:m,clearIconSize:d,clearIconSrc:h,clearLabel:f,clearLabelTextColor:y,clearLabelTextColorHover:_,clearLabelTextSize:x,datepickerRef:C}=e,z=i(e=>{C?.current?.onClearClick(e),C?.current?.handleFocus(e)},[]);return t(r.Fragment,{children:f?t(S,{className:l("react-datepicker__clear-label","cursor_type_pointer"),label:f,labelTextColor:y,labelTextColorHover:_,labelTextSize:x,onClick:z}):(a||h)&&t(u,{className:l("react-datepicker__clear-icon","cursor_type_pointer"),size:d,fill:o,fillHover:n,fillSize:c,iconFill:s,iconFillHover:p,imageSrc:h,shape:m,SvgImage:a,onClick:z})})}function I(e){const{inputIcon:r,inputIconFill:a,inputIconFillHover:i,inputIconFillSize:o,inputIconItemFill:n,inputIconShape:c,inputIconSize:s,inputIconSrc:p,onClick:m}=e;return t(u,{className:l("react-datepicker__input-icon","cursor_type_pointer"),size:s,fill:a,fillHover:i,fillSize:o,iconFill:n,imageSrc:p,shape:c,SvgImage:r,onClick:()=>m&&m()})}export{z as D,C as a,_ as d};
|