@alfalab/core-components-time-input 2.0.1 → 2.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-time-input",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,7 +15,7 @@
15
15
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@alfalab/core-components-input": "^11.0.1",
19
- "@alfalab/core-components-icon-button": "^6.0.0"
18
+ "@alfalab/core-components-input": "^11.0.2",
19
+ "@alfalab/core-components-icon-button": "^6.0.1"
20
20
  }
21
21
  }
package/send-stats.js CHANGED
@@ -55,7 +55,7 @@ async function main() {
55
55
  };
56
56
 
57
57
  return new Promise((resolve, reject) => {
58
- const req = http.request(options, res => {
58
+ const req = http.request(options, (res) => {
59
59
  res.on('end', () => {
60
60
  resolve();
61
61
  });
package/utils/format.js CHANGED
@@ -17,16 +17,12 @@ var isValidTimeFormat = function (value) {
17
17
  }
18
18
  return true;
19
19
  };
20
- var isValidInputValue = function (inputValue) {
21
- return !inputValue || (isCompleteTimeInput(inputValue) && isValidTimeFormat(inputValue));
22
- };
23
- var format = function (value) {
24
- return value
25
- .replace(/^(\d\d)(\d)$/, '$1:$2') // 123 => 12:3
26
- .replace(/^(\d\d)(\d\d)/, '$1:$2') // 12345 => 12:45 (если вместо двоеточия введена цифра, она обратно заменяется на двоеточие)
27
- .replace(/^(\d):(\d\d)(\d)/, '$1:$2') // 1:234 => 1:23
28
- .replace(/\:$/, '');
29
- }; // 12: => 12 || : => void
20
+ var isValidInputValue = function (inputValue) { return !inputValue || (isCompleteTimeInput(inputValue) && isValidTimeFormat(inputValue)); };
21
+ var format = function (value) { return value
22
+ .replace(/^(\d\d)(\d)$/, '$1:$2') // 123 => 12:3
23
+ .replace(/^(\d\d)(\d\d)/, '$1:$2') // 12345 => 12:45 (если вместо двоеточия введена цифра, она обратно заменяется на двоеточие)
24
+ .replace(/^(\d):(\d\d)(\d)/, '$1:$2') // 1:234 => 1:23
25
+ .replace(/\:$/, ''); }; // 12: => 12 || : => void
30
26
 
31
27
  exports.DATE_MASK = DATE_MASK;
32
28
  exports.format = format;