@alfalab/core-components-date-input 4.1.6 → 4.1.7

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/Component.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var tslib = require('tslib');
3
4
  var React = require('react');
4
5
  var mergeRefs = require('react-merge-refs');
5
6
  var coreComponentsInput = require('@alfalab/core-components-input');
@@ -14,50 +15,11 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
14
15
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
15
16
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
16
17
 
17
- /******************************************************************************
18
- Copyright (c) Microsoft Corporation.
19
-
20
- Permission to use, copy, modify, and/or distribute this software for any
21
- purpose with or without fee is hereby granted.
22
-
23
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
24
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
26
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
27
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
28
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
29
- PERFORMANCE OF THIS SOFTWARE.
30
- ***************************************************************************** */
31
- var __assign = function () {
32
- __assign = Object.assign || function __assign(t) {
33
- for (var s, i = 1, n = arguments.length; i < n; i++) {
34
- s = arguments[i];
35
- for (var p in s)
36
- if (Object.prototype.hasOwnProperty.call(s, p))
37
- t[p] = s[p];
38
- }
39
- return t;
40
- };
41
- return __assign.apply(this, arguments);
42
- };
43
- function __rest(s, e) {
44
- var t = {};
45
- for (var p in s)
46
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
47
- t[p] = s[p];
48
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
49
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
50
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
51
- t[p[i]] = s[p[i]];
52
- }
53
- return t;
54
- }
55
-
56
- var styles = {"nativeInput":"date-input__nativeInput_io3rx"};
18
+ var styles = {"nativeInput":"date-input__nativeInput_w21tv"};
57
19
  require('./index.css')
58
20
 
59
21
  var DateInput = React.forwardRef(function (_a, ref) {
60
- var _b = _a.mobileMode, mobileMode = _b === void 0 ? 'input' : _b, _c = _a.defaultValue, defaultValue = _c === void 0 ? '' : _c, rightAddons = _a.rightAddons, error = _a.error, propValue = _a.value, onBlur = _a.onBlur, onChange = _a.onChange, onComplete = _a.onComplete, restProps = __rest(_a, ["mobileMode", "defaultValue", "rightAddons", "error", "value", "onBlur", "onChange", "onComplete"]);
22
+ var _b = _a.mobileMode, mobileMode = _b === void 0 ? 'input' : _b, _c = _a.defaultValue, defaultValue = _c === void 0 ? '' : _c, rightAddons = _a.rightAddons, error = _a.error, propValue = _a.value, onBlur = _a.onBlur, onChange = _a.onChange, onComplete = _a.onComplete, restProps = tslib.__rest(_a, ["mobileMode", "defaultValue", "rightAddons", "error", "value", "onBlur", "onChange", "onComplete"]);
61
23
  var inputRef = React.useRef(null);
62
24
  var _d = React.useState(false), shouldRenderNative = _d[0], setShouldRenderNative = _d[1];
63
25
  var _e = React.useState(propValue || defaultValue), value = _e[0], setValue = _e[1];
@@ -110,7 +72,7 @@ var DateInput = React.forwardRef(function (_a, ref) {
110
72
  }
111
73
  // eslint-disable-next-line react-hooks/exhaustive-deps
112
74
  }, [propValue]);
113
- return (React__default.default.createElement(coreComponentsInput.Input, __assign({}, restProps, { ref: mergeRefs__default.default([ref, inputRef]), value: value, inputMode: 'decimal', pattern: '[0-9\\.]*', onChange: handleChange, onBlur: handleBlur, placeholder: '\u0414\u0414.\u041C\u041C.\u0413\u0413\u0413\u0413', error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
75
+ return (React__default.default.createElement(coreComponentsInput.Input, tslib.__assign({}, restProps, { ref: mergeRefs__default.default([ref, inputRef]), value: value, inputMode: 'decimal', pattern: '[0-9\\.]*', onChange: handleChange, onBlur: handleBlur, placeholder: '\u0414\u0414.\u041C\u041C.\u0413\u0413\u0413\u0413', error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
114
76
  rightAddons,
115
77
  shouldRenderNative && (React__default.default.createElement("input", { type: 'date', ref: ref, defaultValue: defaultValue, onChange: handleNativeInputChange, className: styles.nativeInput }))) })));
116
78
  });
package/cssm/Component.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var tslib = require('tslib');
3
4
  var React = require('react');
4
5
  var mergeRefs = require('react-merge-refs');
5
6
  var coreComponentsInput = require('@alfalab/core-components-input/cssm');
@@ -16,47 +17,8 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
17
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
17
18
  var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
18
19
 
19
- /******************************************************************************
20
- Copyright (c) Microsoft Corporation.
21
-
22
- Permission to use, copy, modify, and/or distribute this software for any
23
- purpose with or without fee is hereby granted.
24
-
25
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
26
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
27
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
28
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
29
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31
- PERFORMANCE OF THIS SOFTWARE.
32
- ***************************************************************************** */
33
- var __assign = function () {
34
- __assign = Object.assign || function __assign(t) {
35
- for (var s, i = 1, n = arguments.length; i < n; i++) {
36
- s = arguments[i];
37
- for (var p in s)
38
- if (Object.prototype.hasOwnProperty.call(s, p))
39
- t[p] = s[p];
40
- }
41
- return t;
42
- };
43
- return __assign.apply(this, arguments);
44
- };
45
- function __rest(s, e) {
46
- var t = {};
47
- for (var p in s)
48
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49
- t[p] = s[p];
50
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
51
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53
- t[p[i]] = s[p[i]];
54
- }
55
- return t;
56
- }
57
-
58
20
  var DateInput = React.forwardRef(function (_a, ref) {
59
- var _b = _a.mobileMode, mobileMode = _b === void 0 ? 'input' : _b, _c = _a.defaultValue, defaultValue = _c === void 0 ? '' : _c, rightAddons = _a.rightAddons, error = _a.error, propValue = _a.value, onBlur = _a.onBlur, onChange = _a.onChange, onComplete = _a.onComplete, restProps = __rest(_a, ["mobileMode", "defaultValue", "rightAddons", "error", "value", "onBlur", "onChange", "onComplete"]);
21
+ var _b = _a.mobileMode, mobileMode = _b === void 0 ? 'input' : _b, _c = _a.defaultValue, defaultValue = _c === void 0 ? '' : _c, rightAddons = _a.rightAddons, error = _a.error, propValue = _a.value, onBlur = _a.onBlur, onChange = _a.onChange, onComplete = _a.onComplete, restProps = tslib.__rest(_a, ["mobileMode", "defaultValue", "rightAddons", "error", "value", "onBlur", "onChange", "onComplete"]);
60
22
  var inputRef = React.useRef(null);
61
23
  var _d = React.useState(false), shouldRenderNative = _d[0], setShouldRenderNative = _d[1];
62
24
  var _e = React.useState(propValue || defaultValue), value = _e[0], setValue = _e[1];
@@ -109,7 +71,7 @@ var DateInput = React.forwardRef(function (_a, ref) {
109
71
  }
110
72
  // eslint-disable-next-line react-hooks/exhaustive-deps
111
73
  }, [propValue]);
112
- return (React__default.default.createElement(coreComponentsInput.Input, __assign({}, restProps, { ref: mergeRefs__default.default([ref, inputRef]), value: value, inputMode: 'decimal', pattern: '[0-9\\.]*', onChange: handleChange, onBlur: handleBlur, placeholder: '\u0414\u0414.\u041C\u041C.\u0413\u0413\u0413\u0413', error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
74
+ return (React__default.default.createElement(coreComponentsInput.Input, tslib.__assign({}, restProps, { ref: mergeRefs__default.default([ref, inputRef]), value: value, inputMode: 'decimal', pattern: '[0-9\\.]*', onChange: handleChange, onBlur: handleBlur, placeholder: '\u0414\u0414.\u041C\u041C.\u0413\u0413\u0413\u0413', error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
113
75
  rightAddons,
114
76
  shouldRenderNative && (React__default.default.createElement("input", { type: 'date', ref: ref, defaultValue: defaultValue, onChange: handleNativeInputChange, className: styles__default.default.nativeInput }))) })));
115
77
  });
package/cssm/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var Component = require('./Component.js');
4
4
  var utils_format = require('./utils/format.js');
5
5
  var utils_nativeSupports = require('./utils/native-supports.js');
6
+ require('tslib');
6
7
  require('react');
7
8
  require('react-merge-refs');
8
9
  require('@alfalab/core-components-input/cssm');
package/esm/Component.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { __rest, __assign } from 'tslib';
1
2
  import React, { forwardRef, useRef, useState, useCallback, useEffect } from 'react';
2
3
  import mergeRefs from 'react-merge-refs';
3
4
  import { Input } from '@alfalab/core-components-input/esm';
@@ -7,46 +8,7 @@ import 'date-fns/format';
7
8
  import 'date-fns/isValid';
8
9
  import 'date-fns/parse';
9
10
 
10
- /******************************************************************************
11
- Copyright (c) Microsoft Corporation.
12
-
13
- Permission to use, copy, modify, and/or distribute this software for any
14
- purpose with or without fee is hereby granted.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
17
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
19
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
- PERFORMANCE OF THIS SOFTWARE.
23
- ***************************************************************************** */
24
- var __assign = function () {
25
- __assign = Object.assign || function __assign(t) {
26
- for (var s, i = 1, n = arguments.length; i < n; i++) {
27
- s = arguments[i];
28
- for (var p in s)
29
- if (Object.prototype.hasOwnProperty.call(s, p))
30
- t[p] = s[p];
31
- }
32
- return t;
33
- };
34
- return __assign.apply(this, arguments);
35
- };
36
- function __rest(s, e) {
37
- var t = {};
38
- for (var p in s)
39
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
40
- t[p] = s[p];
41
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
42
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
43
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
44
- t[p[i]] = s[p[i]];
45
- }
46
- return t;
47
- }
48
-
49
- var styles = {"nativeInput":"date-input__nativeInput_io3rx"};
11
+ var styles = {"nativeInput":"date-input__nativeInput_w21tv"};
50
12
  require('./index.css')
51
13
 
52
14
  var DateInput = forwardRef(function (_a, ref) {
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 115rl */
1
+ /* hash: 1hc2p */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -14,7 +14,7 @@
14
14
  } :root {
15
15
  } :root {
16
16
  } :root {
17
- } .date-input__nativeInput_io3rx {
17
+ } .date-input__nativeInput_w21tv {
18
18
  opacity: 0;
19
19
  position: absolute;
20
20
  top: 0;
@@ -24,8 +24,8 @@
24
24
  -webkit-appearance: none;
25
25
  appearance: none;
26
26
  z-index: 1
27
- } .date-input__nativeInput_io3rx::-webkit-calendar-picker-indicator {
27
+ } .date-input__nativeInput_w21tv::-webkit-calendar-picker-indicator {
28
28
  display: none;
29
- } .date-input__nativeInput_io3rx::-webkit-inner-spin-button {
29
+ } .date-input__nativeInput_w21tv::-webkit-inner-spin-button {
30
30
  display: none;
31
31
  }
package/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { DateInput } from './Component.js';
2
2
  export { DATE_FORMAT, DATE_MASK, NATIVE_DATE_FORMAT, format, formatDate, isCompleteDateInput, isValid, parseDateString } from './utils/format.js';
3
3
  export { isInputDateSupported } from './utils/native-supports.js';
4
+ import 'tslib';
4
5
  import 'react';
5
6
  import 'react-merge-refs';
6
7
  import '@alfalab/core-components-input/esm';
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 115rl */
1
+ /* hash: 1hc2p */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -14,7 +14,7 @@
14
14
  } :root {
15
15
  } :root {
16
16
  } :root {
17
- } .date-input__nativeInput_io3rx {
17
+ } .date-input__nativeInput_w21tv {
18
18
  opacity: 0;
19
19
  position: absolute;
20
20
  top: 0;
@@ -24,8 +24,8 @@
24
24
  -webkit-appearance: none;
25
25
  appearance: none;
26
26
  z-index: 1
27
- } .date-input__nativeInput_io3rx::-webkit-calendar-picker-indicator {
27
+ } .date-input__nativeInput_w21tv::-webkit-calendar-picker-indicator {
28
28
  display: none;
29
- } .date-input__nativeInput_io3rx::-webkit-inner-spin-button {
29
+ } .date-input__nativeInput_w21tv::-webkit-inner-spin-button {
30
30
  display: none;
31
31
  }
package/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var Component = require('./Component.js');
4
4
  var utils_format = require('./utils/format.js');
5
5
  var utils_nativeSupports = require('./utils/native-supports.js');
6
+ require('tslib');
6
7
  require('react');
7
8
  require('react-merge-refs');
8
9
  require('@alfalab/core-components-input');
@@ -7,7 +7,7 @@ import 'date-fns/format';
7
7
  import 'date-fns/isValid';
8
8
  import 'date-fns/parse';
9
9
 
10
- const styles = {"nativeInput":"date-input__nativeInput_io3rx"};
10
+ const styles = {"nativeInput":"date-input__nativeInput_w21tv"};
11
11
  require('./index.css')
12
12
 
13
13
  const DateInput = forwardRef(({ mobileMode = 'input', defaultValue = '', rightAddons, error, value: propValue, onBlur, onChange, onComplete, ...restProps }, ref) => {
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 115rl */
1
+ /* hash: 1hc2p */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -14,7 +14,7 @@
14
14
  } :root {
15
15
  } :root {
16
16
  } :root {
17
- } .date-input__nativeInput_io3rx {
17
+ } .date-input__nativeInput_w21tv {
18
18
  opacity: 0;
19
19
  position: absolute;
20
20
  top: 0;
@@ -24,8 +24,8 @@
24
24
  -webkit-appearance: none;
25
25
  appearance: none;
26
26
  z-index: 1
27
- } .date-input__nativeInput_io3rx::-webkit-calendar-picker-indicator {
27
+ } .date-input__nativeInput_w21tv::-webkit-calendar-picker-indicator {
28
28
  display: none;
29
- } .date-input__nativeInput_io3rx::-webkit-inner-spin-button {
29
+ } .date-input__nativeInput_w21tv::-webkit-inner-spin-button {
30
30
  display: none;
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-date-input",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -17,8 +17,9 @@
17
17
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@alfalab/core-components-input": "^11.1.6",
20
+ "@alfalab/core-components-input": "^11.1.7",
21
21
  "date-fns": "^2.16.1",
22
- "react-merge-refs": "^1.1.0"
22
+ "react-merge-refs": "^1.1.0",
23
+ "tslib": "^2.4.0"
23
24
  }
24
25
  }