@atls-ui-parts/datepicker 0.0.14 → 0.0.16
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.
|
@@ -14,8 +14,8 @@ exports.default = {
|
|
|
14
14
|
};
|
|
15
15
|
const CustomInput = (0, react_2.forwardRef)(({ value, onClick, customValue }, ref) => (react_1.default.createElement(input_1.Input, { ref: ref, value: customValue, onClick: onClick })));
|
|
16
16
|
const Datepicker = (props) => {
|
|
17
|
-
const [startDate, setStartDate] = (0, react_3.useState)(new Date('2021/06/07'));
|
|
18
17
|
const [endDate, setEndDate] = (0, react_3.useState)(new Date('2021/06/17'));
|
|
18
|
+
const [startDate, setStartDate] = (0, react_3.useState)(new Date('2021/06/07'));
|
|
19
19
|
const handleDateChange = (date) => {
|
|
20
20
|
if (date.getTime() > endDate.getTime()) {
|
|
21
21
|
setStartDate(endDate);
|
|
@@ -25,7 +25,7 @@ const Datepicker = (props) => {
|
|
|
25
25
|
setStartDate(date);
|
|
26
26
|
};
|
|
27
27
|
const dateRangeValue = `${Intl.DateTimeFormat('ru').format(startDate)}-${Intl.DateTimeFormat('ru').format(endDate)}`;
|
|
28
|
-
return (react_1.default.createElement(datepicker_component_1.Datepicker, { isClearable: true,
|
|
28
|
+
return (react_1.default.createElement(datepicker_component_1.Datepicker, { isClearable: true, dateFormat: 'dd.MM.yy', strictParsing: true, startDate: startDate, endDate: endDate, selected: startDate, onChange: handleDateChange, customInput: react_1.default.createElement(CustomInput, { customValue: dateRangeValue }), ...props }));
|
|
29
29
|
};
|
|
30
30
|
exports.Datepicker = Datepicker;
|
|
31
31
|
exports.Datepicker.args = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DatepickerStyles } from './datepicker-styles.interfaces';
|
|
2
2
|
export declare const injectBaseStyles: () => void;
|
|
3
|
-
export declare const createAndInjectDatepickerStyles: ({ arrowColor, arrowHoverColor, cellColor, cellFontColor,
|
|
3
|
+
export declare const createAndInjectDatepickerStyles: ({ arrowColor, arrowHoverColor, cellColor, cellFontColor, cellActiveFontColor, cellActiveColor, cellHoverColor, cellHoverFontColor, cellInRangeColor, cellInRangeFontColor, cellInRangeHoverColor, cellInRangeHoverFontColor, cellInRangeBorderRadius, cellMargin, cellPadding, cellBorderRadius, dividerPosition, dividerWidth, dividerColor, fontSize, fontFamily, fontStyle, fontWeight, headerBackgroundColor, inputBackgroundColor, inputBorderColor, inputBorderRadius, inputActiveBorderColor, inputSize, inputBorderWidth, inputPadding, currentMonthPadding, currentMonthFontFamily, currentMonthFontSize, currentMonthFontStyle, currentMonthFontWeight, currentMonthFontColor, dayNameFontFamily, dayNameFontWeight, dayNameFontStyle, dayNameFontColor, }: DatepickerStyles) => void;
|
|
@@ -6,7 +6,7 @@ const appearance_1 = require("./appearance");
|
|
|
6
6
|
const base_1 = require("./base");
|
|
7
7
|
const shape_1 = require("./shape");
|
|
8
8
|
exports.injectBaseStyles = (0, base_1.createInjectableBaseStyles)();
|
|
9
|
-
const createAndInjectDatepickerStyles = ({ arrowColor, arrowHoverColor, cellColor, cellFontColor,
|
|
9
|
+
const createAndInjectDatepickerStyles = ({ arrowColor, arrowHoverColor, cellColor, cellFontColor, cellActiveFontColor, cellActiveColor, cellHoverColor, cellHoverFontColor, cellInRangeColor, cellInRangeFontColor, cellInRangeHoverColor, cellInRangeHoverFontColor, cellInRangeBorderRadius, cellMargin, cellPadding, cellBorderRadius, dividerPosition, dividerWidth, dividerColor, fontSize, fontFamily, fontStyle, fontWeight, headerBackgroundColor, inputBackgroundColor, inputBorderColor, inputBorderRadius, inputActiveBorderColor, inputSize, inputBorderWidth, inputPadding, currentMonthPadding, currentMonthFontFamily, currentMonthFontSize, currentMonthFontStyle, currentMonthFontWeight, currentMonthFontColor, dayNameFontFamily, dayNameFontWeight, dayNameFontStyle, dayNameFontColor, }) => {
|
|
10
10
|
(0, exports.injectBaseStyles)();
|
|
11
11
|
(0, css_1.injectGlobal)((0, appearance_1.createAppearanceStyles)({
|
|
12
12
|
arrowColor,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atls-ui-parts/datepicker",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -13,23 +13,23 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"date-fns": "2.22.1",
|
|
16
|
-
"react-datepicker": "4.
|
|
16
|
+
"react-datepicker": "4.16.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@atls-ui-proto/input": "0.0.
|
|
20
|
-
"@emotion/css": "
|
|
21
|
-
"@emotion/styled": "
|
|
22
|
-
"@types/react": "
|
|
23
|
-
"@types/react-datepicker": "
|
|
24
|
-
"@types/styled-system": "
|
|
25
|
-
"react": "
|
|
26
|
-
"styled-system": "
|
|
19
|
+
"@atls-ui-proto/input": "0.0.15",
|
|
20
|
+
"@emotion/css": "11.9.3",
|
|
21
|
+
"@emotion/styled": "11.9.3",
|
|
22
|
+
"@types/react": "18.2.21",
|
|
23
|
+
"@types/react-datepicker": "4.15.0",
|
|
24
|
+
"@types/styled-system": "5.1.17",
|
|
25
|
+
"react": "18.2.0",
|
|
26
|
+
"styled-system": "5.1.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@emotion/css": "
|
|
30
|
-
"@emotion/styled": "
|
|
31
|
-
"react": "
|
|
32
|
-
"styled-system": "
|
|
29
|
+
"@emotion/css": "11.9.3",
|
|
30
|
+
"@emotion/styled": "11.9.3",
|
|
31
|
+
"react": "18.2.0",
|
|
32
|
+
"styled-system": "5.1.5"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public",
|