@desynova-digital/components 9.1.21 → 9.1.23

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
@@ -44,7 +44,7 @@ var convertHHMMSSFF_to_HHMMSS = exports.convertHHMMSSFF_to_HHMMSS = function con
44
44
  };
45
45
  var convertHHMMSSFF_to_HHMMSSmmm = exports.convertHHMMSSFF_to_HHMMSSmmm = function convertHHMMSSFF_to_HHMMSSmmm(timecode) {
46
46
  var fps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
47
- if (!timecode) return "00:00:00:000";
47
+ if (!timecode) return "00:00:00.000";
48
48
  var singleFrameMilliseocnds = 1000 / parseInt(fps);
49
49
  var upperLimit = 999 % parseInt(fps) * singleFrameMilliseocnds;
50
50
  var parts = timecode.split(":").map(Number);
@@ -63,25 +63,28 @@ var convertHHMMSSFF_to_HHMMSSmmm = exports.convertHHMMSSFF_to_HHMMSSmmm = functi
63
63
  ff = _map2$4 === void 0 ? 0 : _map2$4;
64
64
  var totalMs = ff * (1000 / parseInt(fps));
65
65
  var mmm = Math.min(upperLimit, Math.floor(totalMs)).toString().padStart(3, "0");
66
- return "".concat(hh.toString().padStart(2, "0"), ":").concat(mm.toString().padStart(2, "0"), ":").concat(ss.toString().padStart(2, "0"), ":").concat(mmm);
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
- var parts = timecode.split(":").map(Number);
72
- var _map3 = [0, 0, 0, 0].map(function (_, i) {
73
- var _parts$i2;
74
- return (_parts$i2 = parts[i]) !== null && _parts$i2 !== void 0 ? _parts$i2 : 0;
75
- }),
76
- _map4 = (0, _slicedToArray2["default"])(_map3, 4),
77
- _map4$ = _map4[0],
78
- hh = _map4$ === void 0 ? 0 : _map4$,
79
- _map4$2 = _map4[1],
80
- mm = _map4$2 === void 0 ? 0 : _map4$2,
81
- _map4$3 = _map4[2],
82
- ss = _map4$3 === void 0 ? 0 : _map4$3,
83
- _map4$4 = _map4[3],
84
- mmm = _map4$4 === void 0 ? 0 : _map4$4;
71
+
72
+ // Split milliseconds if present
73
+ var _timecode$split3 = timecode.split("."),
74
+ _timecode$split4 = (0, _slicedToArray2["default"])(_timecode$split3, 2),
75
+ mainTime = _timecode$split4[0],
76
+ _timecode$split4$ = _timecode$split4[1],
77
+ msPart = _timecode$split4$ === void 0 ? "0" : _timecode$split4$;
78
+ var parts = mainTime.split(":").map(Number);
79
+ var _parts = (0, _slicedToArray2["default"])(parts, 3),
80
+ _parts$ = _parts[0],
81
+ hh = _parts$ === void 0 ? 0 : _parts$,
82
+ _parts$2 = _parts[1],
83
+ mm = _parts$2 === void 0 ? 0 : _parts$2,
84
+ _parts$3 = _parts[2],
85
+ ss = _parts$3 === void 0 ? 0 : _parts$3;
86
+ var mmm = parseInt(msPart.padEnd(3, "0").slice(0, 3), 10); // ensure 3 digits
87
+
85
88
  var clampedMs = Math.min(Math.max(mmm, 0), 999);
86
89
  var frame = Math.ceil(clampedMs / 1000 * fps);
87
90
  var ff = frame.toString().padStart(2, "0");
@@ -14,7 +14,7 @@ var _timeCodeDisplay = _interopRequireDefault(require("./timeCodeDisplay"));
14
14
  timecode: "00:00:00:00"
15
15
  }), /*#__PURE__*/_react["default"].createElement(_timeCodeDisplay["default"], {
16
16
  fps: "25",
17
- selectedTimecodeFormat: "HH:MM:SS:mmm",
17
+ selectedTimecodeFormat: "HH:MM:SS.mmm",
18
18
  timecode: "00:00:00:00"
19
19
  }), /*#__PURE__*/_react["default"].createElement(_timeCodeDisplay["default"], {
20
20
  fps: "25",
@@ -21,7 +21,7 @@ var TimeCodeDisplay = function TimeCodeDisplay(_ref) {
21
21
  case "HH:MM:SS:FF":
22
22
  displayValue = timecode;
23
23
  break;
24
- case "HH:MM:SS:mmm":
24
+ case "HH:MM:SS.mmm":
25
25
  displayValue = (0, _utils.convertHHMMSSFF_to_HHMMSSmmm)(timecode, fps);
26
26
  break;
27
27
  default:
@@ -23,7 +23,7 @@ var _timeCodeInput = _interopRequireDefault(require("./timeCodeInput"));
23
23
  theme: "nexc",
24
24
  inputValue: "01:00:00:00" //time code input value
25
25
  ,
26
- timeCodeFormatType: "HH:MM:SS:mmm",
26
+ timeCodeFormatType: "HH:MM:SS.mmm",
27
27
  onFocus: function onFocus() {
28
28
  //perform your function here eg pause the video that is playing
29
29
  },
@@ -27,7 +27,7 @@ var TimeCodeInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
27
27
  }, rest, {
28
28
  ref: ref
29
29
  }));
30
- case "HH:MM:SS:mmm":
30
+ case "HH:MM:SS.mmm":
31
31
  return /*#__PURE__*/_react["default"].createElement(_timeCodeMSInput["default"], (0, _extends2["default"])({
32
32
  key: timeCodeFormatType
33
33
  }, rest, {
@@ -27,7 +27,7 @@ var StyledInput = _styledComponents["default"].input(_templateObject || (_templa
27
27
  return props.width ? props.width : "102px";
28
28
  }, function (props) {
29
29
  var _props$name, _props$name2;
30
- return !props.isError && ((_props$name = props.name) === null || _props$name === void 0 ? void 0 : _props$name.length) > 0 ? props.errorStatement.length > 0 ? "1px solid #FF6C56" : "1px solid #303F51" : ((_props$name2 = props.name) === null || _props$name2 === void 0 ? void 0 : _props$name2.length) > 0 ? "1px solid #303F51" : "0px";
30
+ return !props.isValid && ((_props$name = props.name) === null || _props$name === void 0 ? void 0 : _props$name.length) > 0 ? props.errorStatement.length > 0 ? "1px solid #FF6C56" : "1px solid #303F51" : ((_props$name2 = props.name) === null || _props$name2 === void 0 ? void 0 : _props$name2.length) > 0 ? "1px solid #303F51" : "0px";
31
31
  });
32
32
  var CrossIconWrapper = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin-top: 5px;\n width: fit-content;\n &:hover {\n cursor: pointer;\n }\n svg path {\n fill: #ff6c56;\n }\n"])));
33
33
  var StyledDiv = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n gap: 10px;\n"])));
@@ -200,7 +200,7 @@ var TimeCodeMainInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
200
200
  return onChangeFn(e);
201
201
  },
202
202
  onBlur: onBlurFn,
203
- isError: isValid,
203
+ isValid: isValid,
204
204
  maxLength: "11",
205
205
  checkBaiscErrorProp: checkBaiscError || false,
206
206
  errorStatement: errorStatement || ""
@@ -18,7 +18,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
18
18
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
19
19
  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); }
20
20
  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; }
21
- 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 /* width: ", "; */\n max-width: 53px;\n border-bottom: ", ";\n padding-bottom: 1px;\n"])), function (props) {
21
+ 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 /* width: ", "; */\n max-width: 53px;\nborder-bottom: ", ";\n padding-bottom: 1px;\n"])), function (props) {
22
22
  return props.isError ? "#FFFFFF" : props.errorStatement.length > 0 || props.checkBaiscErrorProp ? "#FF6C56" : "#FFFFFF";
23
23
  }, function (props) {
24
24
  return props.isValid ? "#FFFFFF" : "#FF6C56";
@@ -28,7 +28,7 @@ var StyledInput = _styledComponents["default"].input(_templateObject || (_templa
28
28
  return props.width ? props.width : "102px";
29
29
  }, function (props) {
30
30
  var _props$name, _props$name2;
31
- return !props.isError && ((_props$name = props.name) === null || _props$name === void 0 ? void 0 : _props$name.length) > 0 ? props.errorStatement.length > 0 ? "1px solid #FF6C56" : "1px solid #303F51" : ((_props$name2 = props.name) === null || _props$name2 === void 0 ? void 0 : _props$name2.length) > 0 ? "1px solid #303F51" : "0px";
31
+ return !props.isValid && ((_props$name = props.name) === null || _props$name === void 0 ? void 0 : _props$name.length) > 0 ? props.errorStatement.length > 0 ? "1px solid #FF6C56" : "1px solid #303F51" : ((_props$name2 = props.name) === null || _props$name2 === void 0 ? void 0 : _props$name2.length) > 0 ? "1px solid #303F51" : "0px";
32
32
  });
33
33
  var CrossIconWrapper = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin-top: 5px;\n width: fit-content;\n &:hover {\n cursor: pointer;\n }\n svg path {\n fill: #ff6c56;\n }\n"])));
34
34
  var StyledDiv = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n gap: 10px;\n"])));
@@ -198,7 +198,7 @@ var TimeCodeStandardInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
198
198
  onBlur: onBlurFn
199
199
  }, "ref", ref), "onKeyDown", onKeyDownFn), "onChange", function onChange(e) {
200
200
  return onChangeFn(e);
201
- }), "isError", isValid), "maxLength", "8"), "checkBaiscErrorProp", checkBaiscError || false), "errorStatement", errorStatement || "")), showError && errorStatement.length > 0 && /*#__PURE__*/_react["default"].createElement(ErrorContainer, {
201
+ }), "isValid", isValid), "maxLength", "8"), "checkBaiscErrorProp", checkBaiscError || false), "errorStatement", errorStatement || "")), showError && errorStatement.length > 0 && /*#__PURE__*/_react["default"].createElement(ErrorContainer, {
202
202
  inputFieldType: inputFieldType
203
203
  }, " ", errorStatement));
204
204
  });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "9.1.21",
3
+ "version": "9.1.23",
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.21",
10
+ "@desynova-digital/tokens": "9.1.23",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },