@alfalab/core-components-time-input 1.1.1 → 1.1.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.
@@ -13,15 +13,11 @@ var isValidTimeFormat = function (value) {
13
13
  }
14
14
  return true;
15
15
  };
16
- var isValidInputValue = function (inputValue) {
17
- return !inputValue || (isCompleteTimeInput(inputValue) && isValidTimeFormat(inputValue));
18
- };
19
- var format = function (value) {
20
- return value
21
- .replace(/^(\d\d)(\d)$/, '$1:$2') // 123 => 12:3
22
- .replace(/^(\d\d)(\d\d)/, '$1:$2') // 12345 => 12:45 (если вместо двоеточия введена цифра, она обратно заменяется на двоеточие)
23
- .replace(/^(\d):(\d\d)(\d)/, '$1:$2') // 1:234 => 1:23
24
- .replace(/\:$/, '');
25
- }; // 12: => 12 || : => void
16
+ var isValidInputValue = function (inputValue) { return !inputValue || (isCompleteTimeInput(inputValue) && isValidTimeFormat(inputValue)); };
17
+ var format = function (value) { return value
18
+ .replace(/^(\d\d)(\d)$/, '$1:$2') // 123 => 12:3
19
+ .replace(/^(\d\d)(\d\d)/, '$1:$2') // 12345 => 12:45 (если вместо двоеточия введена цифра, она обратно заменяется на двоеточие)
20
+ .replace(/^(\d):(\d\d)(\d)/, '$1:$2') // 1:234 => 1:23
21
+ .replace(/\:$/, ''); }; // 12: => 12 || : => void
26
22
 
27
23
  export { DATE_MASK, format, isCompleteTimeInput, isValidInputValue, isValidTimeFormat };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-time-input",
3
- "version": "1.1.1",
3
+ "version": "1.1.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": "^10.2.3",
19
- "@alfalab/core-components-icon-button": "^5.0.3"
18
+ "@alfalab/core-components-input": "^10.2.4",
19
+ "@alfalab/core-components-icon-button": "^5.0.5"
20
20
  }
21
21
  }