oolib 2.129.5 → 2.129.7

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.
@@ -103,7 +103,7 @@ var TextInput = function (props) {
103
103
  actionBtn = props.actionBtn, clearBtn = props.clearBtn, className = props.className, maxLength = props.maxLength, DEPRECATED_maxNumLimiter = props.maxNumLimiter, forceFocus = props.forceFocus, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
104
104
  _d = props.validateOnlyOnBlur, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
105
105
  validateOnlyOnBlur = _d === void 0 ? false : _d, //for example, in the login form we want validation to only run, once the text input is blurred. else it can be irritating
106
- _validationStatus = props.validationStatus, _e = props.displayValidationMsg, displayValidationMsg = _e === void 0 ? true : _e, content = props.content, passValidationErrorToFormValidation = props.passValidationErrorToFormValidation;
106
+ _validationStatus = props.validationStatus, _e = props.displayValidationMsg, displayValidationMsg = _e === void 0 ? true : _e, content = props.content, passValidationErrorToFormValidation = props.passValidationErrorToFormValidation, plugin = props.plugin;
107
107
  var theme = (0, styled_components_1.useTheme)();
108
108
  var _f = (0, react_1.useState)(_validationStatus), validationStatus = _f[0], setValidationStatus = _f[1];
109
109
  (0, react_1.useEffect)(function () {
@@ -115,9 +115,8 @@ var TextInput = function (props) {
115
115
  var clearBtnEnabled = !!value && (type !== "url" ? true : (validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type) === "success");
116
116
  var handleValidate = function (e, onBlur) { return __awaiter(void 0, void 0, void 0, function () {
117
117
  var value, res, validationPlugin, pluginResponse;
118
- var _a, _b;
119
- return __generator(this, function (_c) {
120
- switch (_c.label) {
118
+ return __generator(this, function (_a) {
119
+ switch (_a.label) {
121
120
  case 0:
122
121
  onBlur && onBlur(e);
123
122
  value = e.target.value;
@@ -128,13 +127,13 @@ var TextInput = function (props) {
128
127
  if (!handleValidation) return [3 /*break*/, 2];
129
128
  return [4 /*yield*/, handleValidation(value)];
130
129
  case 1:
131
- res = _c.sent();
130
+ res = _a.sent();
132
131
  setValidationStatus(res);
133
- _c.label = 2;
132
+ _a.label = 2;
134
133
  case 2:
135
- validationPlugin = (theme.componentPluginConfigs &&
136
- theme.getTenant &&
137
- ((_b = (_a = theme.componentPluginConfigs[theme.getTenant()]) === null || _a === void 0 ? void 0 : _a.TextInput) === null || _b === void 0 ? void 0 : _b.validationPlugin));
134
+ validationPlugin = ((plugin === null || plugin === void 0 ? void 0 : plugin.validation) &&
135
+ theme.pluginConfigs &&
136
+ theme.pluginConfigs.tplBlockPlugins[plugin.validation]);
138
137
  if (!validationPlugin) return [3 /*break*/, 4];
139
138
  setValidationStatus('loading');
140
139
  return [4 /*yield*/, validationPlugin({
@@ -143,11 +142,10 @@ var TextInput = function (props) {
143
142
  passValidationErrorToFormValidation: passValidationErrorToFormValidation,
144
143
  })];
145
144
  case 3:
146
- pluginResponse = _c.sent();
145
+ pluginResponse = _a.sent();
146
+ setValidationStatus(pluginResponse);
147
147
  console.log({ pluginResponse: pluginResponse });
148
- if (pluginResponse)
149
- return [2 /*return*/, pluginResponse];
150
- _c.label = 4;
148
+ _a.label = 4;
151
149
  case 4: return [2 /*return*/];
152
150
  }
153
151
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.129.5",
3
+ "version": "2.129.7",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",