@devtron-labs/devtron-fe-common-lib 0.0.45-beta-10 → 0.0.45-beta-11
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/dist/index.js +3 -11
- package/package.json +1 -1
- package/src/Common/CustomInput/CustomInput.tsx +16 -12
package/dist/index.js
CHANGED
|
@@ -26624,8 +26624,7 @@ function DevtronProgressing(_a) {
|
|
|
26624
26624
|
}
|
|
26625
26625
|
|
|
26626
26626
|
function CustomInput(_a) {
|
|
26627
|
-
var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange; _a.onBlur; var _c = _a.onFocus, onFocus = _c === void 0 ? function (e) { } : _c, _d = _a.label, label = _d === void 0 ? '' : _d, _e = _a.type, type = _e === void 0 ? 'text' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.labelClassName, labelClassName = _g === void 0 ? '' : _g, _h = _a.placeholder, placeholder = _h === void 0 ? '' : _h, _j = _a.tabIndex, tabIndex = _j === void 0 ? 1 : _j, _k = _a.dataTestid, dataTestid = _k === void 0 ? '' : _k, _l = _a.isRequiredField, isRequiredField = _l === void 0 ? false : _l, _m = _a.autoFocus, autoFocus = _m === void 0 ? true : _m, _o = _a.rootClassName, rootClassName = _o === void 0 ? '' : _o, _p = _a.autoComplete, autoComplete = _p === void 0 ? 'off' : _p, _q = _a.showLink, showLink = _q === void 0 ? false : _q, _r = _a.linkText, linkText = _r === void 0 ? '' : _r, _s = _a.link, link = _s === void 0 ? '' : _s, _t = _a.helperText, helperText = _t === void 0 ? '' : _t
|
|
26628
|
-
var _u = __read(React.useState(state), 2), stateForm = _u[0], setStateForm = _u[1];
|
|
26627
|
+
var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange; _a.onBlur; var _c = _a.onFocus, onFocus = _c === void 0 ? function (e) { } : _c, _d = _a.label, label = _d === void 0 ? '' : _d, _e = _a.type, type = _e === void 0 ? 'text' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.labelClassName, labelClassName = _g === void 0 ? '' : _g, _h = _a.placeholder, placeholder = _h === void 0 ? '' : _h, _j = _a.tabIndex, tabIndex = _j === void 0 ? 1 : _j, _k = _a.dataTestid, dataTestid = _k === void 0 ? '' : _k, _l = _a.isRequiredField, isRequiredField = _l === void 0 ? false : _l, _m = _a.autoFocus, autoFocus = _m === void 0 ? true : _m, _o = _a.rootClassName, rootClassName = _o === void 0 ? '' : _o, _p = _a.autoComplete, autoComplete = _p === void 0 ? 'off' : _p, _q = _a.showLink, showLink = _q === void 0 ? false : _q, _r = _a.linkText, linkText = _r === void 0 ? '' : _r, _s = _a.link, link = _s === void 0 ? '' : _s, _t = _a.helperText, helperText = _t === void 0 ? '' : _t; _a.state; var handleBlurChange = _a.handleBlurChange;
|
|
26629
26628
|
var renderLabelHelperText = function () {
|
|
26630
26629
|
return (jsxRuntime.jsx("span", { children: jsxRuntime.jsx("a", __assign({ target: "_blank", href: link, className: "cursor fs-13 onlink ml-4" }, { children: linkText })) }));
|
|
26631
26630
|
};
|
|
@@ -26639,16 +26638,9 @@ function CustomInput(_a) {
|
|
|
26639
26638
|
return error;
|
|
26640
26639
|
}
|
|
26641
26640
|
var handleOnBlur = function (event) {
|
|
26641
|
+
onChange(__assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: event.target.value.trim() }) }));
|
|
26642
26642
|
if (typeof handleBlurChange === 'function') {
|
|
26643
|
-
handleBlurChange(event);
|
|
26644
|
-
}
|
|
26645
|
-
console.log('event', event);
|
|
26646
|
-
if (stateForm) {
|
|
26647
|
-
console.log('stateForm', stateForm);
|
|
26648
|
-
setStateForm(function (prevState) {
|
|
26649
|
-
var _a;
|
|
26650
|
-
return (__assign(__assign({}, prevState), (_a = {}, _a[event.target.name] = event.target.value.trim(), _a)));
|
|
26651
|
-
});
|
|
26643
|
+
handleBlurChange(__assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: event.target.value.trim() }) }));
|
|
26652
26644
|
}
|
|
26653
26645
|
};
|
|
26654
26646
|
var renderFormError = function () {
|
package/package.json
CHANGED
|
@@ -28,7 +28,6 @@ export function CustomInput({
|
|
|
28
28
|
state,
|
|
29
29
|
handleBlurChange
|
|
30
30
|
}: CustomInputProps) {
|
|
31
|
-
const [stateForm, setStateForm] = useState(state)
|
|
32
31
|
|
|
33
32
|
const renderLabelHelperText = () => {
|
|
34
33
|
return (
|
|
@@ -53,17 +52,22 @@ export function CustomInput({
|
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
const handleOnBlur = (event) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
|
|
56
|
+
onChange({
|
|
57
|
+
...event,
|
|
58
|
+
target: {
|
|
59
|
+
...event.target,
|
|
60
|
+
value: event.target.value.trim(),
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
if (typeof handleBlurChange === 'function') {
|
|
64
|
+
handleBlurChange({
|
|
65
|
+
...event,
|
|
66
|
+
target: {
|
|
67
|
+
...event.target,
|
|
68
|
+
value: event.target.value.trim(),
|
|
69
|
+
},
|
|
70
|
+
})
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
}
|