@desynova-digital/components 9.1.24 → 9.1.25
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/_helpers/utils.js
CHANGED
|
@@ -62,19 +62,17 @@ var convertHHMMSSFF_to_HHMMSSmmm = exports.convertHHMMSSFF_to_HHMMSSmmm = functi
|
|
|
62
62
|
_map2$4 = _map2[3],
|
|
63
63
|
ff = _map2$4 === void 0 ? 0 : _map2$4;
|
|
64
64
|
var totalMs = ff * (1000 / parseInt(fps));
|
|
65
|
-
var mmm = Math.min(upperLimit, Math.
|
|
65
|
+
var mmm = Math.min(upperLimit, Math.ceil(totalMs)).toString().padStart(3, "0");
|
|
66
66
|
return "".concat(hh.toString().padStart(2, "0"), ":").concat(mm.toString().padStart(2, "0"), ":").concat(ss.toString().padStart(2, "0"), ".").concat(mmm);
|
|
67
67
|
};
|
|
68
68
|
var convertHHMMSSmmm_to_HHMMSSFF = exports.convertHHMMSSmmm_to_HHMMSSFF = function convertHHMMSSmmm_to_HHMMSSFF(timecode) {
|
|
69
69
|
var fps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
|
|
70
70
|
if (!timecode) return "00:00:00:00";
|
|
71
|
-
|
|
72
|
-
// Split milliseconds if present
|
|
73
71
|
var _timecode$split3 = timecode.split("."),
|
|
74
72
|
_timecode$split4 = (0, _slicedToArray2["default"])(_timecode$split3, 2),
|
|
75
73
|
mainTime = _timecode$split4[0],
|
|
76
74
|
_timecode$split4$ = _timecode$split4[1],
|
|
77
|
-
msPart = _timecode$split4$ === void 0 ?
|
|
75
|
+
msPart = _timecode$split4$ === void 0 ? "000" : _timecode$split4$;
|
|
78
76
|
var parts = mainTime.split(":").map(Number);
|
|
79
77
|
var _parts = (0, _slicedToArray2["default"])(parts, 3),
|
|
80
78
|
_parts$ = _parts[0],
|
|
@@ -83,7 +81,7 @@ var convertHHMMSSmmm_to_HHMMSSFF = exports.convertHHMMSSmmm_to_HHMMSSFF = functi
|
|
|
83
81
|
mm = _parts$2 === void 0 ? 0 : _parts$2,
|
|
84
82
|
_parts$3 = _parts[2],
|
|
85
83
|
ss = _parts$3 === void 0 ? 0 : _parts$3;
|
|
86
|
-
var mmm = parseInt(msPart, 10); // ensure 3 digits
|
|
84
|
+
var mmm = parseInt(msPart.padEnd(3, "0").slice(0, 3), 10); // ensure exactly 3 digits
|
|
87
85
|
|
|
88
86
|
var clampedMs = Math.min(Math.max(mmm, 0), 999);
|
|
89
87
|
var frame = Math.ceil(clampedMs / 1000 * fps);
|
|
@@ -17,7 +17,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
17
17
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
20
|
-
var StyledInput = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-family: SFUIText-Regular;\n font-size: 12px;\n /* color: ", "; */\n color: ", ";\n text-align: left;\n padding: 0;\n border: none;\n outline: none;\n background: transparent;\n &:hover {\n color: ", ";\n }\n max-width:
|
|
20
|
+
var StyledInput = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-family: SFUIText-Regular;\n font-size: 12px;\n /* color: ", "; */\n color: ", ";\n text-align: left;\n padding: 0;\n border: none;\n outline: none;\n background: transparent;\n &:hover {\n color: ", ";\n }\n max-width: 79px;\n /* width: ", "; */\n border-bottom: ", ";\n padding-bottom: 1px;\n"])), function (props) {
|
|
21
21
|
return props.isValid ? "#FFFFFF" : props.errorStatement.length > 0 || props.checkBaiscErrorProp ? "#FF6C56" : "#FFFFFF";
|
|
22
22
|
}, function (props) {
|
|
23
23
|
return props.isValid ? "#FFFFFF" : "#FF6C56";
|
|
@@ -132,8 +132,13 @@ var TimeCodeMSInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
132
132
|
document.activeElement.blur();
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
+
var isHHMMSSmmm = /^\d{2}:\d{2}:\d{2}\.\d{1,3}$/.test(inputValue);
|
|
135
136
|
if (inputValue) {
|
|
136
|
-
|
|
137
|
+
if (isHHMMSSmmm) {
|
|
138
|
+
checkIfTimeValid((0, _utils.convertHHMMSSmmm_to_HHMMSSFF)(inputValue, frameRate));
|
|
139
|
+
} else {
|
|
140
|
+
checkIfTimeValid(inputValue);
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
143
|
setCustomInputValue((0, _utils.convertHHMMSSFF_to_HHMMSSmmm)(inputValue, frameRate));
|
|
139
144
|
document.addEventListener("keydown", handleEscapeKey);
|
|
@@ -140,8 +140,13 @@ var TimeCodeStandardInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
140
140
|
document.activeElement.blur();
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
+
var isHHMMSS = /^\d{2}:\d{2}:\d{2}$/.test(inputValue);
|
|
143
144
|
if (inputValue) {
|
|
144
|
-
|
|
145
|
+
if (isHHMMSS) {
|
|
146
|
+
checkIfTimeValid((0, _utils.convertHHMMSS_to_HHMMSSFF)(inputValue, frameRate));
|
|
147
|
+
} else {
|
|
148
|
+
checkIfTimeValid(inputValue);
|
|
149
|
+
}
|
|
145
150
|
}
|
|
146
151
|
setCustomInputValue((0, _utils.convertHHMMSSFF_to_HHMMSS)(inputValue, frameRate));
|
|
147
152
|
document.addEventListener("keydown", handleEscapeKey);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desynova-digital/components",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.25",
|
|
4
4
|
"description": "Components for Desynova Digital",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "desynova-digital",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "desynova-digital",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@desynova-digital/tokens": "9.1.
|
|
10
|
+
"@desynova-digital/tokens": "9.1.25",
|
|
11
11
|
"prop-types": "^15.7.2",
|
|
12
12
|
"styled-components": "^4.3.2"
|
|
13
13
|
},
|