intelicoreact 0.1.12 → 0.1.15
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.
|
@@ -13,7 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
17
17
|
|
|
18
18
|
var _reactInputMask = _interopRequireDefault(require("react-input-mask"));
|
|
19
19
|
|
|
@@ -52,10 +52,10 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
52
52
|
setIsOpened = _useState2[1];
|
|
53
53
|
|
|
54
54
|
var calendarRef = (0, _react.useRef)(null);
|
|
55
|
-
var formatedMinDate = (0,
|
|
56
|
-
var formatedMaxDate = (0,
|
|
57
|
-
var momentMinDate = (0,
|
|
58
|
-
var momentMaxDate = (0,
|
|
55
|
+
var formatedMinDate = (0, _momentTimezone.default)(minDate, format).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(minDate, format).format(format) : null;
|
|
56
|
+
var formatedMaxDate = (0, _momentTimezone.default)(maxDate, format).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(maxDate, format).format(format) : null;
|
|
57
|
+
var momentMinDate = (0, _momentTimezone.default)(formatedMinDate, format).startOf('day');
|
|
58
|
+
var momentMaxDate = (0, _momentTimezone.default)(formatedMaxDate, format).startOf('day');
|
|
59
59
|
(0, _useClickOutside.useClickOutside)(calendarRef, function () {
|
|
60
60
|
return setIsOpened(false);
|
|
61
61
|
});
|
|
@@ -69,14 +69,14 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
var getCalendarValue = function getCalendarValue(value) {
|
|
72
|
-
var date = (0,
|
|
72
|
+
var date = (0, _momentTimezone.default)(value).format('L');
|
|
73
73
|
if (date !== 'Invalid date') return date;
|
|
74
|
-
return (0,
|
|
74
|
+
return (0, _momentTimezone.default)(new Date()).format('L');
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
var handleBlur = function handleBlur(e) {
|
|
78
78
|
var value = e.target.value;
|
|
79
|
-
if ((0,
|
|
79
|
+
if ((0, _momentTimezone.default)(value, format).format(format) === 'Invalid date') onChange('');else if ((0, _momentTimezone.default)(value, format).startOf('day').isBefore(momentMinDate, 'days')) onChange(formatedMinDate);else if ((0, _momentTimezone.default)(value, format).endOf('day').isAfter(momentMaxDate, 'days')) onChange(formatedMaxDate);else onChange((0, _momentTimezone.default)(value, format).format(format));
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -72,7 +72,7 @@ var Template = function Template(args) {
|
|
|
72
72
|
var CalendarTemplate = Template.bind({});
|
|
73
73
|
exports.CalendarTemplate = CalendarTemplate;
|
|
74
74
|
CalendarTemplate.args = {
|
|
75
|
-
minDate: '01/10/
|
|
75
|
+
minDate: '01/10/1990',
|
|
76
76
|
maxDate: '04/20/2022' // isDontLimitFuture: true,
|
|
77
77
|
// isListTop: true,
|
|
78
78
|
|
|
@@ -34,7 +34,7 @@ var Button = function Button(_ref) {
|
|
|
34
34
|
var noRenderIcon = noIcon || variant === "ellipse-apply" || variant === "ellipse-cancel";
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
36
36
|
style: style,
|
|
37
|
-
className: (0, _classnames.default)(className, RC, (_cn = {}, (0, _defineProperty2.default)(_cn, "".concat(RC, "_").concat(variant), variant), (0, _defineProperty2.default)(_cn, 'button_icon-right', isIconRight), _cn)),
|
|
37
|
+
className: (0, _classnames.default)(className, RC, (_cn = {}, (0, _defineProperty2.default)(_cn, "".concat(RC, "_").concat(variant), variant), (0, _defineProperty2.default)(_cn, 'button_icon-left', icon && !isIconRight), (0, _defineProperty2.default)(_cn, 'button_icon-right', icon && isIconRight), _cn)),
|
|
38
38
|
onClick: onClick,
|
|
39
39
|
disabled: disabled
|
|
40
40
|
}, !noRenderIcon && icon, label && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -92,7 +92,6 @@
|
|
|
92
92
|
|
|
93
93
|
&__text {
|
|
94
94
|
width: 100%;
|
|
95
|
-
margin-left: 5px;
|
|
96
95
|
display: flex;
|
|
97
96
|
justify-content: center;
|
|
98
97
|
align-items: center;
|
|
@@ -108,6 +107,12 @@
|
|
|
108
107
|
min-width: 15px;
|
|
109
108
|
}
|
|
110
109
|
|
|
110
|
+
&_icon-left {
|
|
111
|
+
.button__text {
|
|
112
|
+
margin-left: 5px;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
111
116
|
&_icon-right {
|
|
112
117
|
.button__text {
|
|
113
118
|
order: 1;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intelicoreact",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "add postfix in dropdown",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"files": ["dist/*"],
|
|
6
|
+
"files": ["dist/*", "node_modules/anme/*", "node_modules/moment/*", "node_modules/moment-timezone/*"],
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"build": "babel src --out-dir dist --copy-files"
|