@salutejs/plasma-new-hope 0.81.0-canary.1203.9111654116.0 → 0.81.0-canary.1206.9109080964.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Calendar/Calendar.types.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -3
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -4
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/hooks/useDays.js +3 -6
- package/cjs/components/Calendar/hooks/useDays.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +1 -2
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
- package/es/components/Calendar/Calendar.types.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -3
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -4
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/hooks/useDays.js +3 -6
- package/es/components/Calendar/hooks/useDays.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +1 -2
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -3
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -4
- package/styled-components/cjs/components/Calendar/hooks/useDays.js +3 -6
- package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +1 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +6 -18
- package/styled-components/cjs/examples/plasma_web/components/Calendar/Calendar.stories.tsx +6 -18
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +6 -18
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -3
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -4
- package/styled-components/es/components/Calendar/hooks/useDays.js +3 -6
- package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +1 -2
- package/styled-components/es/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +6 -18
- package/styled-components/es/examples/plasma_web/components/Calendar/Calendar.stories.tsx +6 -18
- package/styled-components/es/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +6 -18
- package/types/components/Calendar/Calendar.types.d.ts +0 -4
- package/types/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts.map +1 -1
- package/types/components/Calendar/hooks/useDays.d.ts +1 -1
- package/types/components/Calendar/hooks/useDays.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.types.d.ts +0 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.types.d.ts.map +1 -1
@@ -79,7 +79,7 @@ const baseEvents = [
|
|
79
79
|
];
|
80
80
|
|
81
81
|
const StoryDefault = (args: CalendarProps) => {
|
82
|
-
const { isRange, isDouble, min, max, date
|
82
|
+
const { isRange, isDouble, min, max, date } = args;
|
83
83
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
84
84
|
const [valueRange, setValueRange] = useState<[Date, Date?]>([new Date(2023, 10, 16), new Date(2023, 10, 23)]);
|
85
85
|
|
@@ -110,7 +110,6 @@ const StoryDefault = (args: CalendarProps) => {
|
|
110
110
|
disabledList={disabledDays}
|
111
111
|
min={min}
|
112
112
|
max={max}
|
113
|
-
includeEdgeDates={includeEdgeDates}
|
114
113
|
onChangeValue={(isRange ? handleOnRangeChange : handleOnChange) as (value: Date | [Date, Date?]) => void}
|
115
114
|
/>
|
116
115
|
);
|
@@ -122,13 +121,12 @@ export const Default: StoryObj<CalendarProps> = {
|
|
122
121
|
max: new Date(2023, 11, 24),
|
123
122
|
isDouble: false,
|
124
123
|
isRange: false,
|
125
|
-
includeEdgeDates: false,
|
126
124
|
},
|
127
125
|
render: (args) => <StoryDefault {...args} />,
|
128
126
|
};
|
129
127
|
|
130
128
|
const StoryBase = (args: CalendarBaseProps) => {
|
131
|
-
const { min, max, type
|
129
|
+
const { min, max, type } = args;
|
132
130
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
133
131
|
|
134
132
|
const handleOnChange = useCallback((newValue: Date) => {
|
@@ -152,7 +150,6 @@ const StoryBase = (args: CalendarBaseProps) => {
|
|
152
150
|
disabledList={disabledDays}
|
153
151
|
min={min}
|
154
152
|
max={max}
|
155
|
-
includeEdgeDates={includeEdgeDates}
|
156
153
|
type={type}
|
157
154
|
onChangeValue={handleOnChange}
|
158
155
|
/>
|
@@ -171,14 +168,13 @@ export const Base: StoryObj<CalendarBaseProps> = {
|
|
171
168
|
args: {
|
172
169
|
min: new Date(2023, 10, 1),
|
173
170
|
max: new Date(2023, 11, 24),
|
174
|
-
includeEdgeDates: false,
|
175
171
|
type: 'Days',
|
176
172
|
},
|
177
173
|
render: (args) => <StoryBase {...args} />,
|
178
174
|
};
|
179
175
|
|
180
176
|
const StoryDouble = (args: CalendarDoubleProps) => {
|
181
|
-
const { min, max
|
177
|
+
const { min, max } = args;
|
182
178
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
183
179
|
const handleOnChange = useCallback((newValue: Date) => {
|
184
180
|
setValue(newValue);
|
@@ -201,7 +197,6 @@ const StoryDouble = (args: CalendarDoubleProps) => {
|
|
201
197
|
disabledList={disabledDays}
|
202
198
|
min={min}
|
203
199
|
max={max}
|
204
|
-
includeEdgeDates={includeEdgeDates}
|
205
200
|
onChangeValue={handleOnChange}
|
206
201
|
/>
|
207
202
|
);
|
@@ -211,13 +206,12 @@ export const Double: StoryObj<CalendarDoubleProps> = {
|
|
211
206
|
args: {
|
212
207
|
min: new Date(2023, 10, 1),
|
213
208
|
max: new Date(2023, 11, 24),
|
214
|
-
includeEdgeDates: false,
|
215
209
|
},
|
216
210
|
render: (args) => <StoryDouble {...args} />,
|
217
211
|
};
|
218
212
|
|
219
213
|
const StoryRange = (args: CalendarBaseRangeProps) => {
|
220
|
-
const { min, max, type
|
214
|
+
const { min, max, type } = args;
|
221
215
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
222
216
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
223
217
|
onChangeValue(newValue);
|
@@ -243,7 +237,6 @@ const StoryRange = (args: CalendarBaseRangeProps) => {
|
|
243
237
|
disabledList={disabledList}
|
244
238
|
min={min}
|
245
239
|
max={max}
|
246
|
-
includeEdgeDates={includeEdgeDates}
|
247
240
|
type={type}
|
248
241
|
onChangeValue={handleOnChange}
|
249
242
|
/>
|
@@ -262,14 +255,13 @@ export const Range: StoryObj<CalendarBaseRangeProps> = {
|
|
262
255
|
args: {
|
263
256
|
min: new Date(2023, 10, 1),
|
264
257
|
max: new Date(2023, 11, 24),
|
265
|
-
includeEdgeDates: false,
|
266
258
|
type: 'Days',
|
267
259
|
},
|
268
260
|
render: (args) => <StoryRange {...args} />,
|
269
261
|
};
|
270
262
|
|
271
263
|
const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
272
|
-
const { min, max
|
264
|
+
const { min, max } = args;
|
273
265
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
274
266
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
275
267
|
onChangeValue(newValue);
|
@@ -295,7 +287,6 @@ const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
|
295
287
|
disabledList={disabledList}
|
296
288
|
min={min}
|
297
289
|
max={max}
|
298
|
-
includeEdgeDates={includeEdgeDates}
|
299
290
|
onChangeValue={handleOnChange}
|
300
291
|
/>
|
301
292
|
);
|
@@ -305,13 +296,12 @@ export const RangeDouble: StoryObj<CalendarBaseRangeProps> = {
|
|
305
296
|
args: {
|
306
297
|
min: new Date(2023, 10, 1),
|
307
298
|
max: new Date(2023, 11, 24),
|
308
|
-
includeEdgeDates: false,
|
309
299
|
},
|
310
300
|
render: (args) => <StoryRangeDouble {...args} />,
|
311
301
|
};
|
312
302
|
|
313
303
|
const StoryWithPopover = (args: CalendarProps) => {
|
314
|
-
const { isDouble, min, max
|
304
|
+
const { isDouble, min, max } = args;
|
315
305
|
const [isOpen, setIsOpen] = useState(false);
|
316
306
|
const [textValue, setTextValue] = useState('2023-10-16');
|
317
307
|
const [value, setValue] = useState(new Date(textValue));
|
@@ -350,7 +340,6 @@ const StoryWithPopover = (args: CalendarProps) => {
|
|
350
340
|
disabledList={disabledDays}
|
351
341
|
min={min}
|
352
342
|
max={max}
|
353
|
-
includeEdgeDates={includeEdgeDates}
|
354
343
|
isDouble={isDouble}
|
355
344
|
isRange={false}
|
356
345
|
onChangeValue={handleOnChange}
|
@@ -364,7 +353,6 @@ export const WithPopover: StoryObj<CalendarProps> = {
|
|
364
353
|
min: new Date(2023, 9, 1),
|
365
354
|
max: new Date(2023, 11, 24),
|
366
355
|
isDouble: false,
|
367
|
-
includeEdgeDates: false,
|
368
356
|
},
|
369
357
|
render: (args) => <StoryWithPopover {...args} />,
|
370
358
|
};
|
@@ -79,7 +79,7 @@ const baseEvents = [
|
|
79
79
|
];
|
80
80
|
|
81
81
|
const StoryDefault = (args: CalendarProps) => {
|
82
|
-
const { isRange, isDouble, min, max, date
|
82
|
+
const { isRange, isDouble, min, max, date } = args;
|
83
83
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
84
84
|
const [valueRange, setValueRange] = useState<[Date, Date?]>([new Date(2023, 10, 16), new Date(2023, 10, 23)]);
|
85
85
|
|
@@ -110,7 +110,6 @@ const StoryDefault = (args: CalendarProps) => {
|
|
110
110
|
disabledList={disabledDays}
|
111
111
|
min={min}
|
112
112
|
max={max}
|
113
|
-
includeEdgeDates={includeEdgeDates}
|
114
113
|
onChangeValue={(isRange ? handleOnRangeChange : handleOnChange) as (value: Date | [Date, Date?]) => void}
|
115
114
|
/>
|
116
115
|
);
|
@@ -122,13 +121,12 @@ export const Default: StoryObj<CalendarProps> = {
|
|
122
121
|
max: new Date(2023, 11, 24),
|
123
122
|
isDouble: false,
|
124
123
|
isRange: false,
|
125
|
-
includeEdgeDates: false,
|
126
124
|
},
|
127
125
|
render: (args) => <StoryDefault {...args} />,
|
128
126
|
};
|
129
127
|
|
130
128
|
const StoryBase = (args: CalendarBaseProps) => {
|
131
|
-
const { min, max, type
|
129
|
+
const { min, max, type } = args;
|
132
130
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
133
131
|
|
134
132
|
const handleOnChange = useCallback((newValue: Date) => {
|
@@ -152,7 +150,6 @@ const StoryBase = (args: CalendarBaseProps) => {
|
|
152
150
|
disabledList={disabledDays}
|
153
151
|
min={min}
|
154
152
|
max={max}
|
155
|
-
includeEdgeDates={includeEdgeDates}
|
156
153
|
type={type}
|
157
154
|
onChangeValue={handleOnChange}
|
158
155
|
/>
|
@@ -171,14 +168,13 @@ export const Base: StoryObj<CalendarBaseProps> = {
|
|
171
168
|
args: {
|
172
169
|
min: new Date(2023, 10, 1),
|
173
170
|
max: new Date(2023, 11, 24),
|
174
|
-
includeEdgeDates: false,
|
175
171
|
type: 'Days',
|
176
172
|
},
|
177
173
|
render: (args) => <StoryBase {...args} />,
|
178
174
|
};
|
179
175
|
|
180
176
|
const StoryDouble = (args: CalendarDoubleProps) => {
|
181
|
-
const { min, max
|
177
|
+
const { min, max } = args;
|
182
178
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
183
179
|
const handleOnChange = useCallback((newValue: Date) => {
|
184
180
|
setValue(newValue);
|
@@ -201,7 +197,6 @@ const StoryDouble = (args: CalendarDoubleProps) => {
|
|
201
197
|
disabledList={disabledDays}
|
202
198
|
min={min}
|
203
199
|
max={max}
|
204
|
-
includeEdgeDates={includeEdgeDates}
|
205
200
|
onChangeValue={handleOnChange}
|
206
201
|
/>
|
207
202
|
);
|
@@ -211,13 +206,12 @@ export const Double: StoryObj<CalendarDoubleProps> = {
|
|
211
206
|
args: {
|
212
207
|
min: new Date(2023, 10, 1),
|
213
208
|
max: new Date(2023, 11, 24),
|
214
|
-
includeEdgeDates: false,
|
215
209
|
},
|
216
210
|
render: (args) => <StoryDouble {...args} />,
|
217
211
|
};
|
218
212
|
|
219
213
|
const StoryRange = (args: CalendarBaseRangeProps) => {
|
220
|
-
const { min, max, type
|
214
|
+
const { min, max, type } = args;
|
221
215
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
222
216
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
223
217
|
onChangeValue(newValue);
|
@@ -243,7 +237,6 @@ const StoryRange = (args: CalendarBaseRangeProps) => {
|
|
243
237
|
disabledList={disabledList}
|
244
238
|
min={min}
|
245
239
|
max={max}
|
246
|
-
includeEdgeDates={includeEdgeDates}
|
247
240
|
type={type}
|
248
241
|
onChangeValue={handleOnChange}
|
249
242
|
/>
|
@@ -262,14 +255,13 @@ export const Range: StoryObj<CalendarBaseRangeProps> = {
|
|
262
255
|
args: {
|
263
256
|
min: new Date(2023, 10, 1),
|
264
257
|
max: new Date(2023, 11, 24),
|
265
|
-
includeEdgeDates: false,
|
266
258
|
type: 'Days',
|
267
259
|
},
|
268
260
|
render: (args) => <StoryRange {...args} />,
|
269
261
|
};
|
270
262
|
|
271
263
|
const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
272
|
-
const { min, max
|
264
|
+
const { min, max } = args;
|
273
265
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
274
266
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
275
267
|
onChangeValue(newValue);
|
@@ -295,7 +287,6 @@ const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
|
295
287
|
disabledList={disabledList}
|
296
288
|
min={min}
|
297
289
|
max={max}
|
298
|
-
includeEdgeDates={includeEdgeDates}
|
299
290
|
onChangeValue={handleOnChange}
|
300
291
|
/>
|
301
292
|
);
|
@@ -305,13 +296,12 @@ export const RangeDouble: StoryObj<CalendarBaseRangeProps> = {
|
|
305
296
|
args: {
|
306
297
|
min: new Date(2023, 10, 1),
|
307
298
|
max: new Date(2023, 11, 24),
|
308
|
-
includeEdgeDates: false,
|
309
299
|
},
|
310
300
|
render: (args) => <StoryRangeDouble {...args} />,
|
311
301
|
};
|
312
302
|
|
313
303
|
const StoryWithPopover = (args: CalendarProps) => {
|
314
|
-
const { isDouble, min, max
|
304
|
+
const { isDouble, min, max } = args;
|
315
305
|
const [isOpen, setIsOpen] = useState(false);
|
316
306
|
const [textValue, setTextValue] = useState('2023-10-16');
|
317
307
|
const [value, setValue] = useState(new Date(textValue));
|
@@ -350,7 +340,6 @@ const StoryWithPopover = (args: CalendarProps) => {
|
|
350
340
|
disabledList={disabledDays}
|
351
341
|
min={min}
|
352
342
|
max={max}
|
353
|
-
includeEdgeDates={includeEdgeDates}
|
354
343
|
isDouble={isDouble}
|
355
344
|
isRange={false}
|
356
345
|
onChangeValue={handleOnChange}
|
@@ -364,7 +353,6 @@ export const WithPopover: StoryObj<CalendarProps> = {
|
|
364
353
|
min: new Date(2023, 9, 1),
|
365
354
|
max: new Date(2023, 11, 24),
|
366
355
|
isDouble: false,
|
367
|
-
includeEdgeDates: false,
|
368
356
|
},
|
369
357
|
render: (args) => <StoryWithPopover {...args} />,
|
370
358
|
};
|
package/styled-components/cjs/examples/sds_engineer/components/Calendar/Calendar.stories.tsx
CHANGED
@@ -79,7 +79,7 @@ const baseEvents = [
|
|
79
79
|
];
|
80
80
|
|
81
81
|
const StoryDefault = (args: CalendarProps) => {
|
82
|
-
const { isRange, isDouble, min, max, date
|
82
|
+
const { isRange, isDouble, min, max, date } = args;
|
83
83
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
84
84
|
const [valueRange, setValueRange] = useState<[Date, Date?]>([new Date(2023, 10, 16), new Date(2023, 10, 23)]);
|
85
85
|
|
@@ -110,7 +110,6 @@ const StoryDefault = (args: CalendarProps) => {
|
|
110
110
|
disabledList={disabledDays}
|
111
111
|
min={min}
|
112
112
|
max={max}
|
113
|
-
includeEdgeDates={includeEdgeDates}
|
114
113
|
onChangeValue={(isRange ? handleOnRangeChange : handleOnChange) as (value: Date | [Date, Date?]) => void}
|
115
114
|
/>
|
116
115
|
);
|
@@ -122,13 +121,12 @@ export const Default: StoryObj<CalendarProps> = {
|
|
122
121
|
max: new Date(2023, 11, 24),
|
123
122
|
isDouble: false,
|
124
123
|
isRange: false,
|
125
|
-
includeEdgeDates: false,
|
126
124
|
},
|
127
125
|
render: (args) => <StoryDefault {...args} />,
|
128
126
|
};
|
129
127
|
|
130
128
|
const StoryBase = (args: CalendarBaseProps) => {
|
131
|
-
const { min, max, type
|
129
|
+
const { min, max, type } = args;
|
132
130
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
133
131
|
|
134
132
|
const handleOnChange = useCallback((newValue: Date) => {
|
@@ -152,7 +150,6 @@ const StoryBase = (args: CalendarBaseProps) => {
|
|
152
150
|
disabledList={disabledDays}
|
153
151
|
min={min}
|
154
152
|
max={max}
|
155
|
-
includeEdgeDates={includeEdgeDates}
|
156
153
|
type={type}
|
157
154
|
onChangeValue={handleOnChange}
|
158
155
|
/>
|
@@ -171,14 +168,13 @@ export const Base: StoryObj<CalendarBaseProps> = {
|
|
171
168
|
args: {
|
172
169
|
min: new Date(2023, 10, 1),
|
173
170
|
max: new Date(2023, 11, 24),
|
174
|
-
includeEdgeDates: false,
|
175
171
|
type: 'Days',
|
176
172
|
},
|
177
173
|
render: (args) => <StoryBase {...args} />,
|
178
174
|
};
|
179
175
|
|
180
176
|
const StoryDouble = (args: CalendarDoubleProps) => {
|
181
|
-
const { min, max
|
177
|
+
const { min, max } = args;
|
182
178
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
183
179
|
const handleOnChange = useCallback((newValue: Date) => {
|
184
180
|
setValue(newValue);
|
@@ -201,7 +197,6 @@ const StoryDouble = (args: CalendarDoubleProps) => {
|
|
201
197
|
disabledList={disabledDays}
|
202
198
|
min={min}
|
203
199
|
max={max}
|
204
|
-
includeEdgeDates={includeEdgeDates}
|
205
200
|
onChangeValue={handleOnChange}
|
206
201
|
/>
|
207
202
|
);
|
@@ -211,13 +206,12 @@ export const Double: StoryObj<CalendarDoubleProps> = {
|
|
211
206
|
args: {
|
212
207
|
min: new Date(2023, 10, 1),
|
213
208
|
max: new Date(2023, 11, 24),
|
214
|
-
includeEdgeDates: false,
|
215
209
|
},
|
216
210
|
render: (args) => <StoryDouble {...args} />,
|
217
211
|
};
|
218
212
|
|
219
213
|
const StoryRange = (args: CalendarBaseRangeProps) => {
|
220
|
-
const { min, max, type
|
214
|
+
const { min, max, type } = args;
|
221
215
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
222
216
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
223
217
|
onChangeValue(newValue);
|
@@ -243,7 +237,6 @@ const StoryRange = (args: CalendarBaseRangeProps) => {
|
|
243
237
|
disabledList={disabledList}
|
244
238
|
min={min}
|
245
239
|
max={max}
|
246
|
-
includeEdgeDates={includeEdgeDates}
|
247
240
|
type={type}
|
248
241
|
onChangeValue={handleOnChange}
|
249
242
|
/>
|
@@ -262,14 +255,13 @@ export const Range: StoryObj<CalendarBaseRangeProps> = {
|
|
262
255
|
args: {
|
263
256
|
min: new Date(2023, 10, 1),
|
264
257
|
max: new Date(2023, 11, 24),
|
265
|
-
includeEdgeDates: false,
|
266
258
|
type: 'Days',
|
267
259
|
},
|
268
260
|
render: (args) => <StoryRange {...args} />,
|
269
261
|
};
|
270
262
|
|
271
263
|
const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
272
|
-
const { min, max
|
264
|
+
const { min, max } = args;
|
273
265
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
274
266
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
275
267
|
onChangeValue(newValue);
|
@@ -295,7 +287,6 @@ const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
|
295
287
|
disabledList={disabledList}
|
296
288
|
min={min}
|
297
289
|
max={max}
|
298
|
-
includeEdgeDates={includeEdgeDates}
|
299
290
|
onChangeValue={handleOnChange}
|
300
291
|
/>
|
301
292
|
);
|
@@ -305,13 +296,12 @@ export const RangeDouble: StoryObj<CalendarBaseRangeProps> = {
|
|
305
296
|
args: {
|
306
297
|
min: new Date(2023, 10, 1),
|
307
298
|
max: new Date(2023, 11, 24),
|
308
|
-
includeEdgeDates: false,
|
309
299
|
},
|
310
300
|
render: (args) => <StoryRangeDouble {...args} />,
|
311
301
|
};
|
312
302
|
|
313
303
|
const StoryWithPopover = (args: CalendarProps) => {
|
314
|
-
const { isDouble, min, max
|
304
|
+
const { isDouble, min, max } = args;
|
315
305
|
const [isOpen, setIsOpen] = useState(false);
|
316
306
|
const [textValue, setTextValue] = useState('2023-10-16');
|
317
307
|
const [value, setValue] = useState(new Date(textValue));
|
@@ -350,7 +340,6 @@ const StoryWithPopover = (args: CalendarProps) => {
|
|
350
340
|
disabledList={disabledDays}
|
351
341
|
min={min}
|
352
342
|
max={max}
|
353
|
-
includeEdgeDates={includeEdgeDates}
|
354
343
|
isDouble={isDouble}
|
355
344
|
isRange={false}
|
356
345
|
onChangeValue={handleOnChange}
|
@@ -364,7 +353,6 @@ export const WithPopover: StoryObj<CalendarProps> = {
|
|
364
353
|
min: new Date(2023, 9, 1),
|
365
354
|
max: new Date(2023, 11, 24),
|
366
355
|
isDouble: false,
|
367
|
-
includeEdgeDates: false,
|
368
356
|
},
|
369
357
|
render: (args) => <StoryWithPopover {...args} />,
|
370
358
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["value", "min", "max", "
|
1
|
+
var _excluded = ["value", "min", "max", "type", "eventList", "disabledList", "onChangeValue"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -25,7 +25,6 @@ export var calendarBaseRoot = function calendarBaseRoot(Root) {
|
|
25
25
|
var externalValue = _ref.value,
|
26
26
|
min = _ref.min,
|
27
27
|
max = _ref.max,
|
28
|
-
includeEdgeDates = _ref.includeEdgeDates,
|
29
28
|
_ref$type = _ref.type,
|
30
29
|
type = _ref$type === void 0 ? 'Days' : _ref$type,
|
31
30
|
eventList = _ref.eventList,
|
@@ -234,7 +233,6 @@ export var calendarBaseRoot = function calendarBaseRoot(Root) {
|
|
234
233
|
disabledList: disabledList,
|
235
234
|
min: min,
|
236
235
|
max: max,
|
237
|
-
includeEdgeDates: includeEdgeDates,
|
238
236
|
value: externalValue,
|
239
237
|
date: date,
|
240
238
|
hoveredDay: hoveredDay,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var _StyledSeparator;
|
2
|
-
var _excluded = ["value", "min", "max", "
|
2
|
+
var _excluded = ["value", "min", "max", "eventList", "disabledList", "onChangeValue"];
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -23,7 +23,6 @@ export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
|
23
23
|
var externalValue = _ref.value,
|
24
24
|
min = _ref.min,
|
25
25
|
max = _ref.max,
|
26
|
-
includeEdgeDates = _ref.includeEdgeDates,
|
27
26
|
eventList = _ref.eventList,
|
28
27
|
disabledList = _ref.disabledList,
|
29
28
|
onChangeValue = _ref.onChangeValue,
|
@@ -147,7 +146,6 @@ export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
|
147
146
|
disabledList: disabledList,
|
148
147
|
min: min,
|
149
148
|
max: max,
|
150
|
-
includeEdgeDates: includeEdgeDates,
|
151
149
|
value: externalValue,
|
152
150
|
date: firstDate,
|
153
151
|
hoveredDay: hoveredDay,
|
@@ -164,7 +162,6 @@ export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
|
164
162
|
disabledList: disabledList,
|
165
163
|
min: min,
|
166
164
|
max: max,
|
167
|
-
includeEdgeDates: includeEdgeDates,
|
168
165
|
value: externalValue,
|
169
166
|
date: secondDate,
|
170
167
|
hoveredDay: hoveredDay,
|
@@ -182,7 +182,6 @@ var getDaysWithModifications = function getDaysWithModifications(days) {
|
|
182
182
|
var disabledList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
183
183
|
var min = arguments.length > 3 ? arguments[3] : undefined;
|
184
184
|
var max = arguments.length > 4 ? arguments[4] : undefined;
|
185
|
-
var includeEdgeDates = arguments.length > 5 ? arguments[5] : undefined;
|
186
185
|
var eventsMap = getPropsMap(eventList);
|
187
186
|
var disabledDaysMap = getPropsMap(disabledList);
|
188
187
|
var daysList = days.filter(function (_ref3) {
|
@@ -200,9 +199,7 @@ var getDaysWithModifications = function getDaysWithModifications(days) {
|
|
200
199
|
day = date.day;
|
201
200
|
var keyDay = "".concat(year, "-").concat(monthIndex, "-").concat(day);
|
202
201
|
var currentDate = new Date(year, monthIndex, day);
|
203
|
-
var
|
204
|
-
var maxValue = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
205
|
-
var isOutOfMinMaxRange = minValue || maxValue;
|
202
|
+
var isOutOfMinMaxRange = min && min >= currentDate || max && max <= currentDate;
|
206
203
|
dayItem.events = eventsMap.get(keyDay);
|
207
204
|
dayItem.disabled = disabledDaysMap.has(keyDay) || isOutOfMinMaxRange;
|
208
205
|
dayItem.isOutOfMinMaxRange = isOutOfMinMaxRange;
|
@@ -215,7 +212,7 @@ var getDaysWithModifications = function getDaysWithModifications(days) {
|
|
215
212
|
/**
|
216
213
|
* Хук для получения списка дней.
|
217
214
|
*/
|
218
|
-
export var useDays = function useDays(date, value, eventList, disabledList, min, max
|
215
|
+
export var useDays = function useDays(date, value, eventList, disabledList, min, max) {
|
219
216
|
return useMemo(function () {
|
220
217
|
var monthIndex = date.monthIndex,
|
221
218
|
year = date.year;
|
@@ -223,7 +220,7 @@ export var useDays = function useDays(date, value, eventList, disabledList, min,
|
|
223
220
|
var offsetDayInWeek = getOffsetDayInWeek(monthIndex, year);
|
224
221
|
var days = [].concat(_toConsumableArray(getDaysInPrevMonth(date, offsetDayInWeek, value)), _toConsumableArray(getDaysInCurrentMonth(date, daysInMonth, value)), _toConsumableArray(getDaysInNextMonth(date, daysInMonth, offsetDayInWeek, value)));
|
225
222
|
if (eventList !== null && eventList !== void 0 && eventList.length || disabledList !== null && disabledList !== void 0 && disabledList.length || max || min) {
|
226
|
-
var modifiedDays = getDaysWithModifications(days, eventList, disabledList, min, max
|
223
|
+
var modifiedDays = getDaysWithModifications(days, eventList, disabledList, min, max);
|
227
224
|
return getMatrix(modifiedDays);
|
228
225
|
}
|
229
226
|
return getMatrix(days);
|
@@ -20,7 +20,6 @@ export var CalendarDays = function CalendarDays(_ref) {
|
|
20
20
|
disabledList = _ref.disabledList,
|
21
21
|
min = _ref.min,
|
22
22
|
max = _ref.max,
|
23
|
-
includeEdgeDates = _ref.includeEdgeDates,
|
24
23
|
hoveredDay = _ref.hoveredDay,
|
25
24
|
selectIndexes = _ref.selectIndexes,
|
26
25
|
isDouble = _ref.isDouble,
|
@@ -30,7 +29,7 @@ export var CalendarDays = function CalendarDays(_ref) {
|
|
30
29
|
onHoverDay = _ref.onHoverDay,
|
31
30
|
onSetSelected = _ref.onSetSelected,
|
32
31
|
onKeyDown = _ref.onKeyDown;
|
33
|
-
var _useDays = useDays(currentDate, value, eventList, disabledList, min, max
|
32
|
+
var _useDays = useDays(currentDate, value, eventList, disabledList, min, max),
|
34
33
|
_useDays2 = _slicedToArray(_useDays, 2),
|
35
34
|
days = _useDays2[0],
|
36
35
|
selected = _useDays2[1];
|
@@ -79,7 +79,7 @@ const baseEvents = [
|
|
79
79
|
];
|
80
80
|
|
81
81
|
const StoryDefault = (args: CalendarProps) => {
|
82
|
-
const { isRange, isDouble, min, max, date
|
82
|
+
const { isRange, isDouble, min, max, date } = args;
|
83
83
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
84
84
|
const [valueRange, setValueRange] = useState<[Date, Date?]>([new Date(2023, 10, 16), new Date(2023, 10, 23)]);
|
85
85
|
|
@@ -110,7 +110,6 @@ const StoryDefault = (args: CalendarProps) => {
|
|
110
110
|
disabledList={disabledDays}
|
111
111
|
min={min}
|
112
112
|
max={max}
|
113
|
-
includeEdgeDates={includeEdgeDates}
|
114
113
|
onChangeValue={(isRange ? handleOnRangeChange : handleOnChange) as (value: Date | [Date, Date?]) => void}
|
115
114
|
/>
|
116
115
|
);
|
@@ -122,13 +121,12 @@ export const Default: StoryObj<CalendarProps> = {
|
|
122
121
|
max: new Date(2023, 11, 24),
|
123
122
|
isDouble: false,
|
124
123
|
isRange: false,
|
125
|
-
includeEdgeDates: false,
|
126
124
|
},
|
127
125
|
render: (args) => <StoryDefault {...args} />,
|
128
126
|
};
|
129
127
|
|
130
128
|
const StoryBase = (args: CalendarBaseProps) => {
|
131
|
-
const { min, max, type
|
129
|
+
const { min, max, type } = args;
|
132
130
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
133
131
|
|
134
132
|
const handleOnChange = useCallback((newValue: Date) => {
|
@@ -152,7 +150,6 @@ const StoryBase = (args: CalendarBaseProps) => {
|
|
152
150
|
disabledList={disabledDays}
|
153
151
|
min={min}
|
154
152
|
max={max}
|
155
|
-
includeEdgeDates={includeEdgeDates}
|
156
153
|
type={type}
|
157
154
|
onChangeValue={handleOnChange}
|
158
155
|
/>
|
@@ -171,14 +168,13 @@ export const Base: StoryObj<CalendarBaseProps> = {
|
|
171
168
|
args: {
|
172
169
|
min: new Date(2023, 10, 1),
|
173
170
|
max: new Date(2023, 11, 24),
|
174
|
-
includeEdgeDates: false,
|
175
171
|
type: 'Days',
|
176
172
|
},
|
177
173
|
render: (args) => <StoryBase {...args} />,
|
178
174
|
};
|
179
175
|
|
180
176
|
const StoryDouble = (args: CalendarDoubleProps) => {
|
181
|
-
const { min, max
|
177
|
+
const { min, max } = args;
|
182
178
|
const [value, setValue] = useState(new Date(2023, 10, 16));
|
183
179
|
const handleOnChange = useCallback((newValue: Date) => {
|
184
180
|
setValue(newValue);
|
@@ -201,7 +197,6 @@ const StoryDouble = (args: CalendarDoubleProps) => {
|
|
201
197
|
disabledList={disabledDays}
|
202
198
|
min={min}
|
203
199
|
max={max}
|
204
|
-
includeEdgeDates={includeEdgeDates}
|
205
200
|
onChangeValue={handleOnChange}
|
206
201
|
/>
|
207
202
|
);
|
@@ -211,13 +206,12 @@ export const Double: StoryObj<CalendarDoubleProps> = {
|
|
211
206
|
args: {
|
212
207
|
min: new Date(2023, 10, 1),
|
213
208
|
max: new Date(2023, 11, 24),
|
214
|
-
includeEdgeDates: false,
|
215
209
|
},
|
216
210
|
render: (args) => <StoryDouble {...args} />,
|
217
211
|
};
|
218
212
|
|
219
213
|
const StoryRange = (args: CalendarBaseRangeProps) => {
|
220
|
-
const { min, max, type
|
214
|
+
const { min, max, type } = args;
|
221
215
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
222
216
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
223
217
|
onChangeValue(newValue);
|
@@ -243,7 +237,6 @@ const StoryRange = (args: CalendarBaseRangeProps) => {
|
|
243
237
|
disabledList={disabledList}
|
244
238
|
min={min}
|
245
239
|
max={max}
|
246
|
-
includeEdgeDates={includeEdgeDates}
|
247
240
|
type={type}
|
248
241
|
onChangeValue={handleOnChange}
|
249
242
|
/>
|
@@ -262,14 +255,13 @@ export const Range: StoryObj<CalendarBaseRangeProps> = {
|
|
262
255
|
args: {
|
263
256
|
min: new Date(2023, 10, 1),
|
264
257
|
max: new Date(2023, 11, 24),
|
265
|
-
includeEdgeDates: false,
|
266
258
|
type: 'Days',
|
267
259
|
},
|
268
260
|
render: (args) => <StoryRange {...args} />,
|
269
261
|
};
|
270
262
|
|
271
263
|
const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
272
|
-
const { min, max
|
264
|
+
const { min, max } = args;
|
273
265
|
const [values, setValue] = useState<[Date, Date?]>([new Date(2023, 10, 15), new Date(2023, 10, 24)]);
|
274
266
|
const handleOnChange = useCallback((newValue: [Date, Date?]) => {
|
275
267
|
onChangeValue(newValue);
|
@@ -295,7 +287,6 @@ const StoryRangeDouble = (args: CalendarBaseRangeProps) => {
|
|
295
287
|
disabledList={disabledList}
|
296
288
|
min={min}
|
297
289
|
max={max}
|
298
|
-
includeEdgeDates={includeEdgeDates}
|
299
290
|
onChangeValue={handleOnChange}
|
300
291
|
/>
|
301
292
|
);
|
@@ -305,13 +296,12 @@ export const RangeDouble: StoryObj<CalendarBaseRangeProps> = {
|
|
305
296
|
args: {
|
306
297
|
min: new Date(2023, 10, 1),
|
307
298
|
max: new Date(2023, 11, 24),
|
308
|
-
includeEdgeDates: false,
|
309
299
|
},
|
310
300
|
render: (args) => <StoryRangeDouble {...args} />,
|
311
301
|
};
|
312
302
|
|
313
303
|
const StoryWithPopover = (args: CalendarProps) => {
|
314
|
-
const { isDouble, min, max
|
304
|
+
const { isDouble, min, max } = args;
|
315
305
|
const [isOpen, setIsOpen] = useState(false);
|
316
306
|
const [textValue, setTextValue] = useState('2023-10-16');
|
317
307
|
const [value, setValue] = useState(new Date(textValue));
|
@@ -350,7 +340,6 @@ const StoryWithPopover = (args: CalendarProps) => {
|
|
350
340
|
disabledList={disabledDays}
|
351
341
|
min={min}
|
352
342
|
max={max}
|
353
|
-
includeEdgeDates={includeEdgeDates}
|
354
343
|
isDouble={isDouble}
|
355
344
|
isRange={false}
|
356
345
|
onChangeValue={handleOnChange}
|
@@ -364,7 +353,6 @@ export const WithPopover: StoryObj<CalendarProps> = {
|
|
364
353
|
min: new Date(2023, 9, 1),
|
365
354
|
max: new Date(2023, 11, 24),
|
366
355
|
isDouble: false,
|
367
|
-
includeEdgeDates: false,
|
368
356
|
},
|
369
357
|
render: (args) => <StoryWithPopover {...args} />,
|
370
358
|
};
|