@desynova-digital/components 9.1.11 → 9.1.13

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.
@@ -17,14 +17,14 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
17
17
  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); }
18
18
  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; }
19
19
  var StyledInput = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-family: SFUIText-Regular;\n font-size: 12px;\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 border-bottom:", ";\n padding-bottom: 1px; \n"])), function (props) {
20
- return props.isError ? '#FFFFFF' : '#FF6C56';
20
+ return props.isError ? '#FFFFFF' : props.errorStatement.length > 0 ? '#FF6C56' : '#FFFFFF';
21
21
  }, function (props) {
22
22
  return props.theme ? "".concat(_tokens.colors[props.theme].timeCodeInput.rgbthemeColor) : 'rgb(0 206 198)';
23
23
  }, function (props) {
24
24
  return props.width ? props.width : '72px';
25
25
  }, function (props) {
26
26
  var _props$name, _props$name2;
27
- return !props.isError && ((_props$name = props.name) === null || _props$name === void 0 ? void 0 : _props$name.length) > 0 ? '1px solid #FF6C56' : ((_props$name2 = props.name) === null || _props$name2 === void 0 ? void 0 : _props$name2.length) > 0 ? '1px solid #303F51' : '0px';
27
+ 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';
28
28
  });
29
29
  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"])));
30
30
  var StyledDiv = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n gap: 10px;\n"])));
@@ -99,12 +99,18 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
99
99
  if (selectedValueTime >= initialTime && selectedValueTime <= endTime && !customValidity) {
100
100
  setIsValid(true);
101
101
  return true;
102
- } else if (customValidity) {
102
+ }
103
+ if (customValidity) {
103
104
  var val = customValidityFn(inputFieldType, value);
104
105
  setIsValid(val);
105
106
  return val;
106
107
  }
107
108
  }
109
+ if (customValidity) {
110
+ var _val = customValidityFn(inputFieldType, value);
111
+ setIsValid(_val);
112
+ return _val;
113
+ }
108
114
  }
109
115
  setIsValid(false);
110
116
  return isValid;
@@ -139,8 +145,13 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
139
145
  var onChangeFn = function onChangeFn(e) {
140
146
  onTimePickerChange(e.target.value, e);
141
147
  checkIfTimeValid(e.target.value);
142
- if (checkIfTimeValid(e.target.value)) {
143
- updateFormDataExternally(inputFieldType, e.target.value);
148
+ // if(checkIfTimeValid(e.target.value)) {
149
+ updateFormDataExternally(inputFieldType, e.target.value);
150
+ // }
151
+ };
152
+ var timecodeBlur = function timecodeBlur(val) {
153
+ if (checkIfTimeValid(val)) {
154
+ // updateFormDataExternally(inputFieldType, val);
144
155
  }
145
156
  };
146
157
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(StyledDiv, null, inputTitle && /*#__PURE__*/_react["default"].createElement(InputHeading, null, inputTitle), showCross && /*#__PURE__*/_react["default"].createElement(CrossIconWrapper, {
@@ -156,13 +167,13 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
156
167
  ref: elementRef,
157
168
  value: customInputValue,
158
169
  onFocus: onFocus,
159
- onBlur: onBlur,
160
170
  onKeyDown: onKeyDown,
161
171
  onChange: function onChange(e) {
162
172
  return onChangeFn(e);
163
173
  },
164
174
  isError: isValid,
165
- maxLength: "11"
175
+ maxLength: "11",
176
+ errorStatement: errorStatement || ''
166
177
  }), showError && errorStatement.length > 0 && /*#__PURE__*/_react["default"].createElement(ErrorContainer, {
167
178
  inputFieldType: inputFieldType
168
179
  }, " ", errorStatement));
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "9.1.11",
3
+ "version": "9.1.13",
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.11",
10
+ "@desynova-digital/tokens": "9.1.13",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },