albinasoft-ui-package 1.0.27 → 1.0.29
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.
@@ -26,9 +26,8 @@ interface CustomInputProps {
|
|
26
26
|
description?: string | null;
|
27
27
|
tooltip?: string;
|
28
28
|
style?: React.CSSProperties;
|
29
|
-
|
29
|
+
mainClass?: string;
|
30
30
|
className?: string;
|
31
|
-
valid?: boolean;
|
32
31
|
buttonOnClick?: () => void;
|
33
32
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
34
33
|
}
|
@@ -38,20 +38,19 @@ var InputType;
|
|
38
38
|
})(InputType || (InputType = {}));
|
39
39
|
exports.InputType = InputType;
|
40
40
|
var CustomInput = function (_a) {
|
41
|
-
var id = _a.id, name = _a.name, label = _a.label, _b = _a.inputType, inputType = _b === void 0 ? InputType.TEXT : _b, value = _a.value, placeholder = _a.placeholder, _c = _a.required, required = _c === void 0 ? false : _c, errorMessage = _a.errorMessage, _d = _a.conditionalErrorVisible, conditionalErrorVisible = _d === void 0 ? false : _d, conditionalErrorMessage = _a.conditionalErrorMessage, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, buttonIcon = _a.buttonIcon, buttonClass = _a.buttonClass, buttonTooltip = _a.buttonTooltip, description = _a.description, tooltip = _a.tooltip, style = _a.style,
|
42
|
-
var
|
41
|
+
var id = _a.id, name = _a.name, label = _a.label, _b = _a.inputType, inputType = _b === void 0 ? InputType.TEXT : _b, value = _a.value, placeholder = _a.placeholder, _c = _a.required, required = _c === void 0 ? false : _c, errorMessage = _a.errorMessage, _d = _a.conditionalErrorVisible, conditionalErrorVisible = _d === void 0 ? false : _d, conditionalErrorMessage = _a.conditionalErrorMessage, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, buttonIcon = _a.buttonIcon, buttonClass = _a.buttonClass, buttonTooltip = _a.buttonTooltip, description = _a.description, tooltip = _a.tooltip, style = _a.style, mainClass = _a.mainClass, className = _a.className, buttonOnClick = _a.buttonOnClick, onChange = _a.onChange;
|
42
|
+
var _g = (0, react_1.useState)(false), showPassword = _g[0], setShowPassword = _g[1];
|
43
43
|
var handleType = inputType === InputType.PASSWORD && showPassword ? InputType.TEXT : inputType;
|
44
|
-
var inputClass = "form-control ".concat(valid === true ? 'is-valid' : '', " ").concat(valid === false ? 'is-invalid' : '');
|
45
44
|
var togglePasswordVisibility = function () {
|
46
45
|
setShowPassword(function (prev) { return !prev; });
|
47
46
|
};
|
48
|
-
return (react_1.default.createElement("div", { className:
|
47
|
+
return (react_1.default.createElement("div", { className: mainClass },
|
49
48
|
react_1.default.createElement("div", { className: "form-group" },
|
50
49
|
react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
|
51
50
|
react_1.default.createElement("div", { className: "input-group position-relative" },
|
52
51
|
tooltip ? (react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(tooltip) }, tooltip) },
|
53
|
-
react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className:
|
54
|
-
}))) : (react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className:
|
52
|
+
react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className: "form-input ".concat(className), style: style, required: required, disabled: disabled, readOnly: readOnly, autoComplete: "new-password" // Modern tarayıcılarda autocomplete autofill engellemek için
|
53
|
+
}))) : (react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className: "form-input ".concat(className), style: style, required: required, disabled: disabled, readOnly: readOnly, autoComplete: "new-password" // Modern tarayıcılarda autocomplete autofill engellemek için
|
55
54
|
})),
|
56
55
|
inputType === InputType.PASSWORD && (react_1.default.createElement("button", { type: "button", onClick: togglePasswordVisibility, className: "btn btn-outline-secondary", title: showPassword ? "Parolayı Gizle" : "Parolayı Göster" }, showPassword ? react_1.default.createElement(fa_1.FaEyeSlash, null) : react_1.default.createElement(fa_1.FaEye, null))),
|
57
56
|
buttonIcon && buttonOnClick && (react_1.default.createElement("button", { type: "button", onClick: buttonOnClick, className: buttonClass || "btn btn-outline-secondary", title: buttonTooltip || "" }, buttonIcon)),
|