@itcase/ui 1.8.148 → 1.8.149
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/{DatePicker_cjs_BOPN9WVz.js → DatePicker_cjs_YWv3CCNF.js} +4 -10
- package/dist/{DatePicker_es_-aO8EkK8.js → DatePicker_es_CqKPt0Nw.js} +4 -10
- package/dist/cjs/components/DatePeriod.js +13 -6
- package/dist/cjs/components/DatePicker.js +1 -1
- package/dist/cjs/context/Notifications.js +4 -4
- package/dist/components/DatePeriod.js +13 -6
- package/dist/components/DatePicker.js +1 -1
- package/dist/context/Notifications.js +4 -4
- package/dist/types/components/DatePeriod/DatePeriod.interface.d.ts +4 -4
- package/dist/types/components/DatePicker/DatePicker.interface.d.ts +4 -4
- package/package.json +3 -3
|
@@ -100,8 +100,8 @@ function DatePickerInput(props) {
|
|
|
100
100
|
const { daySize, dayTextColor, dayTextShape, dayTextSize, iconFill, iconFillHover, iconFillSize, iconItemFill, iconLeft, iconRight, iconShape, monthTextColor, monthTextSize, monthTextWeight, popper, popperPlacement, sizeClass, widthClass, yearTextColor, yearTextSize, yearTextWeight, isClearable, } = propsGenerator;
|
|
101
101
|
const datepickerRef = React.useRef(null);
|
|
102
102
|
const [dateStart, dateEnd] = React.useMemo(() => {
|
|
103
|
-
let dateStart;
|
|
104
|
-
if (value) {
|
|
103
|
+
let dateStart = undefined;
|
|
104
|
+
if (value !== undefined) {
|
|
105
105
|
if (typeof value === 'string') {
|
|
106
106
|
dateStart = new Date(value);
|
|
107
107
|
}
|
|
@@ -109,11 +109,8 @@ function DatePickerInput(props) {
|
|
|
109
109
|
dateStart = value;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
let dateEnd;
|
|
116
|
-
if (endValue) {
|
|
112
|
+
let dateEnd = undefined;
|
|
113
|
+
if (endValue !== undefined) {
|
|
117
114
|
if (typeof endValue === 'string') {
|
|
118
115
|
dateEnd = new Date(endValue);
|
|
119
116
|
}
|
|
@@ -121,9 +118,6 @@ function DatePickerInput(props) {
|
|
|
121
118
|
dateEnd = endValue;
|
|
122
119
|
}
|
|
123
120
|
}
|
|
124
|
-
else {
|
|
125
|
-
dateEnd = undefined;
|
|
126
|
-
}
|
|
127
121
|
return [dateStart, dateEnd];
|
|
128
122
|
}, [value, endValue]);
|
|
129
123
|
const handleChange = React.useCallback((selected) => {
|
|
@@ -98,8 +98,8 @@ function DatePickerInput(props) {
|
|
|
98
98
|
const { daySize, dayTextColor, dayTextShape, dayTextSize, iconFill, iconFillHover, iconFillSize, iconItemFill, iconLeft, iconRight, iconShape, monthTextColor, monthTextSize, monthTextWeight, popper, popperPlacement, sizeClass, widthClass, yearTextColor, yearTextSize, yearTextWeight, isClearable, } = propsGenerator;
|
|
99
99
|
const datepickerRef = useRef(null);
|
|
100
100
|
const [dateStart, dateEnd] = useMemo(() => {
|
|
101
|
-
let dateStart;
|
|
102
|
-
if (value) {
|
|
101
|
+
let dateStart = undefined;
|
|
102
|
+
if (value !== undefined) {
|
|
103
103
|
if (typeof value === 'string') {
|
|
104
104
|
dateStart = new Date(value);
|
|
105
105
|
}
|
|
@@ -107,11 +107,8 @@ function DatePickerInput(props) {
|
|
|
107
107
|
dateStart = value;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
let dateEnd;
|
|
114
|
-
if (endValue) {
|
|
110
|
+
let dateEnd = undefined;
|
|
111
|
+
if (endValue !== undefined) {
|
|
115
112
|
if (typeof endValue === 'string') {
|
|
116
113
|
dateEnd = new Date(endValue);
|
|
117
114
|
}
|
|
@@ -119,9 +116,6 @@ function DatePickerInput(props) {
|
|
|
119
116
|
dateEnd = endValue;
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
|
-
else {
|
|
123
|
-
dateEnd = undefined;
|
|
124
|
-
}
|
|
125
119
|
return [dateStart, dateEnd];
|
|
126
120
|
}, [value, endValue]);
|
|
127
121
|
const handleChange = useCallback((selected) => {
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
|
+
var luxon = require('luxon');
|
|
6
7
|
var common = require('@itcase/common');
|
|
7
|
-
var DatePicker = require('../../
|
|
8
|
+
var DatePicker = require('../../DatePicker_cjs_YWv3CCNF.js');
|
|
8
9
|
var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
9
10
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
10
11
|
var ChipsGroup = require('../../ChipsGroup_cjs_BNfzAmhc.js');
|
|
@@ -119,8 +120,16 @@ function DatePeriod(props) {
|
|
|
119
120
|
const checkIsChipsActive = React.useCallback((targetPeriodItem) => {
|
|
120
121
|
const dateStartIso = targetPeriodItem.dateIntervalsList[0];
|
|
121
122
|
const dateEndIso = targetPeriodItem.dateIntervalsList[1];
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
let normalizedDatePeriodValueStart = null;
|
|
124
|
+
let normalizedDatePeriodValueEnd = null;
|
|
125
|
+
if (datePeriodValueStart) {
|
|
126
|
+
normalizedDatePeriodValueStart = luxon.DateTime.fromJSDate(new Date(datePeriodValueStart)).toISODate();
|
|
127
|
+
}
|
|
128
|
+
if (datePeriodValueEnd) {
|
|
129
|
+
normalizedDatePeriodValueEnd = luxon.DateTime.fromJSDate(new Date(datePeriodValueEnd)).toISODate();
|
|
130
|
+
}
|
|
131
|
+
return (dateStartIso === normalizedDatePeriodValueStart &&
|
|
132
|
+
dateEndIso === normalizedDatePeriodValueEnd);
|
|
124
133
|
}, [datePeriodValueEnd, datePeriodValueStart]);
|
|
125
134
|
// const onChangeDatePicker = useCallback(
|
|
126
135
|
// (dateStart: Date | null, dateEnd: Date | null) => {
|
|
@@ -151,9 +160,7 @@ function DatePeriod(props) {
|
|
|
151
160
|
fillHover: datePickerInputFillHover,
|
|
152
161
|
textSize: datePickerInputTextSize,
|
|
153
162
|
placeholder: 'Выбрать период',
|
|
154
|
-
}, value: datePeriodValueStart,
|
|
155
|
-
// onChange={onChangeDatePicker}
|
|
156
|
-
onChange: onChangeDatePeriod })] }) }));
|
|
163
|
+
}, value: datePeriodValueStart, onChange: onChangeDatePeriod })] }) }));
|
|
157
164
|
}
|
|
158
165
|
|
|
159
166
|
exports.DatePeriod = DatePeriod;
|
|
@@ -156,16 +156,16 @@ function createNotification(notification, onClose) {
|
|
|
156
156
|
}
|
|
157
157
|
switch (status) {
|
|
158
158
|
case 'success':
|
|
159
|
-
appearance = 'successPrimary';
|
|
159
|
+
appearance = 'successPrimary sizeM solid';
|
|
160
160
|
break;
|
|
161
161
|
case 'info':
|
|
162
|
-
appearance = 'infoPrimary';
|
|
162
|
+
appearance = 'infoPrimary sizeM solid';
|
|
163
163
|
break;
|
|
164
164
|
case 'error':
|
|
165
|
-
appearance = 'errorPrimary';
|
|
165
|
+
appearance = 'errorPrimary sizeM solid';
|
|
166
166
|
break;
|
|
167
167
|
case 'warning':
|
|
168
|
-
appearance = 'warningPrimary';
|
|
168
|
+
appearance = 'warningPrimary sizeM solid';
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
return {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { DateTime } from 'luxon';
|
|
4
5
|
import { DATE_PERIOD_INTERVALS } from '@itcase/common';
|
|
5
|
-
import { D as DatePickerInput } from '../
|
|
6
|
+
import { D as DatePickerInput } from '../DatePicker_es_CqKPt0Nw.js';
|
|
6
7
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
8
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
9
|
import { b as ChipsGroup, C as Chips } from '../ChipsGroup_es_UTiUhYs7.js';
|
|
@@ -117,8 +118,16 @@ function DatePeriod(props) {
|
|
|
117
118
|
const checkIsChipsActive = useCallback((targetPeriodItem) => {
|
|
118
119
|
const dateStartIso = targetPeriodItem.dateIntervalsList[0];
|
|
119
120
|
const dateEndIso = targetPeriodItem.dateIntervalsList[1];
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
let normalizedDatePeriodValueStart = null;
|
|
122
|
+
let normalizedDatePeriodValueEnd = null;
|
|
123
|
+
if (datePeriodValueStart) {
|
|
124
|
+
normalizedDatePeriodValueStart = DateTime.fromJSDate(new Date(datePeriodValueStart)).toISODate();
|
|
125
|
+
}
|
|
126
|
+
if (datePeriodValueEnd) {
|
|
127
|
+
normalizedDatePeriodValueEnd = DateTime.fromJSDate(new Date(datePeriodValueEnd)).toISODate();
|
|
128
|
+
}
|
|
129
|
+
return (dateStartIso === normalizedDatePeriodValueStart &&
|
|
130
|
+
dateEndIso === normalizedDatePeriodValueEnd);
|
|
122
131
|
}, [datePeriodValueEnd, datePeriodValueStart]);
|
|
123
132
|
// const onChangeDatePicker = useCallback(
|
|
124
133
|
// (dateStart: Date | null, dateEnd: Date | null) => {
|
|
@@ -149,9 +158,7 @@ function DatePeriod(props) {
|
|
|
149
158
|
fillHover: datePickerInputFillHover,
|
|
150
159
|
textSize: datePickerInputTextSize,
|
|
151
160
|
placeholder: 'Выбрать период',
|
|
152
|
-
}, value: datePeriodValueStart,
|
|
153
|
-
// onChange={onChangeDatePicker}
|
|
154
|
-
onChange: onChangeDatePeriod })] }) }));
|
|
161
|
+
}, value: datePeriodValueStart, onChange: onChangeDatePeriod })] }) }));
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
export { DatePeriod, datePeriodAppearance, datePeriodConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../
|
|
1
|
+
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../DatePicker_es_CqKPt0Nw.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -154,16 +154,16 @@ function createNotification(notification, onClose) {
|
|
|
154
154
|
}
|
|
155
155
|
switch (status) {
|
|
156
156
|
case 'success':
|
|
157
|
-
appearance = 'successPrimary';
|
|
157
|
+
appearance = 'successPrimary sizeM solid';
|
|
158
158
|
break;
|
|
159
159
|
case 'info':
|
|
160
|
-
appearance = 'infoPrimary';
|
|
160
|
+
appearance = 'infoPrimary sizeM solid';
|
|
161
161
|
break;
|
|
162
162
|
case 'error':
|
|
163
|
-
appearance = 'errorPrimary';
|
|
163
|
+
appearance = 'errorPrimary sizeM solid';
|
|
164
164
|
break;
|
|
165
165
|
case 'warning':
|
|
166
|
-
appearance = 'warningPrimary';
|
|
166
|
+
appearance = 'warningPrimary sizeM solid';
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
169
169
|
return {
|
|
@@ -20,14 +20,14 @@ type DatePeriodProps = DatePeriodThemeColor & StyleAttributes & {
|
|
|
20
20
|
chipsShape?: ShapeProps;
|
|
21
21
|
className?: string;
|
|
22
22
|
datePeriodIntervalsList: DatePeriodItem[];
|
|
23
|
-
datePeriodValueEnd: DateIso | null;
|
|
24
|
-
datePeriodValueStart: DateIso | null;
|
|
23
|
+
datePeriodValueEnd: Date | DateIso | null;
|
|
24
|
+
datePeriodValueStart: Date | DateIso | null;
|
|
25
25
|
datePickerAppearance?: CompositeAppearanceKey;
|
|
26
26
|
datePickerInputAppearance?: CompositeAppearanceKey;
|
|
27
27
|
datePickerInputFillHover?: FillHoverProps;
|
|
28
28
|
datePickerInputSize?: SizeOptionProps;
|
|
29
29
|
datePickerInputTextSize?: TextSizeProps;
|
|
30
30
|
isSkeleton?: boolean;
|
|
31
|
-
onChangeDatePeriod: (
|
|
31
|
+
onChangeDatePeriod: (dateStart: Date | null, dateEnd: Date | null) => void;
|
|
32
32
|
};
|
|
33
|
-
export type {
|
|
33
|
+
export type { DatePeriodAppearanceType, DatePeriodConfig, DatePeriodProps, DatePeriodThemeColor, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DatePickerProps } from 'react-datepicker';
|
|
3
|
-
import { AppearanceKeysDefault, FillHoverProps, FillProps, IconFillSizeProps, IconSizeProps, ItemColorProps, ShapeProps, SizeProps, TextColorHoverProps, TextColorProps, TextSizeProps, TextWeightProps } from '@itcase/types';
|
|
3
|
+
import { AppearanceKeysDefault, DateIso, FillHoverProps, FillProps, IconFillSizeProps, IconSizeProps, ItemColorProps, ShapeProps, SizeProps, TextColorHoverProps, TextColorProps, TextSizeProps, TextWeightProps } from '@itcase/types';
|
|
4
4
|
import { InputProps } from '../Input/Input.interface';
|
|
5
5
|
interface DatePickerProps extends DatePickerProps {
|
|
6
6
|
customTimeInput?: ReactNode;
|
|
@@ -64,11 +64,11 @@ export interface DatePickerInputProps extends DatePickerProps {
|
|
|
64
64
|
clearLabelTextColorHover?: TextColorHoverProps;
|
|
65
65
|
clearLabelTextSize?: TextSizeProps;
|
|
66
66
|
datePickerProps: DatePickerProps;
|
|
67
|
-
endValue?: string;
|
|
67
|
+
endValue?: string | Date | DateIso;
|
|
68
68
|
inputProps?: InputProps;
|
|
69
69
|
labelTextSize?: TextSizeProps;
|
|
70
|
-
value?: string;
|
|
71
|
-
onChange
|
|
70
|
+
value?: string | Date | DateIso;
|
|
71
|
+
onChange: (dateStart: Date | null, dateEnd: Date | null) => void;
|
|
72
72
|
}
|
|
73
73
|
export interface DatePickerCustomInput {
|
|
74
74
|
clearIcon?: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.149",
|
|
4
4
|
"description": "UI components (Modal, Loader, Popup, etc)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Modal",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"@itcase/tokens-palette": "^1.1.20",
|
|
110
110
|
"clsx": "^2.1.1",
|
|
111
111
|
"date-fns": "^4.1.0",
|
|
112
|
-
"framer-motion": "^12.23.
|
|
112
|
+
"framer-motion": "^12.23.23",
|
|
113
113
|
"js-cookie": "^3.0.5",
|
|
114
114
|
"lodash": "^4.17.21",
|
|
115
115
|
"luxon": "^3.7.2",
|
|
116
|
-
"motion": "^12.23.
|
|
116
|
+
"motion": "^12.23.23",
|
|
117
117
|
"rc-slider": "^11.1.9",
|
|
118
118
|
"react": "^18.3.1",
|
|
119
119
|
"react-dadata": "^2.27.4",
|