albinasoft-ui-package 1.0.26 → 1.0.28
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-select ".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-select ".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)),
|
@@ -19,8 +19,9 @@ interface CustomSelectProps {
|
|
19
19
|
description?: string | null;
|
20
20
|
disabled?: boolean;
|
21
21
|
className?: string;
|
22
|
+
mainClass?: string;
|
22
23
|
style?: React.CSSProperties;
|
23
|
-
|
24
|
+
mainStyle?: React.CSSProperties;
|
24
25
|
onChange: (value: string | string[]) => void;
|
25
26
|
}
|
26
27
|
declare const CustomSelect: React.FC<CustomSelectProps>;
|
@@ -7,19 +7,19 @@ var react_1 = __importDefault(require("react"));
|
|
7
7
|
var react_bootstrap_1 = require("react-bootstrap");
|
8
8
|
var fa_1 = require("react-icons/fa");
|
9
9
|
var CustomSelect = function (_a) {
|
10
|
-
var id = _a.id, name = _a.name, label = _a.label, options = _a.options, value = _a.value, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, errorMessage = _a.errorMessage, conditionalErrorVisible = _a.conditionalErrorVisible, conditionalErrorMessage = _a.conditionalErrorMessage, tooltip = _a.tooltip, description = _a.description, _d = _a.disabled, disabled = _d === void 0 ? false : _d, className = _a.className, style = _a.style,
|
10
|
+
var id = _a.id, name = _a.name, label = _a.label, options = _a.options, value = _a.value, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, errorMessage = _a.errorMessage, conditionalErrorVisible = _a.conditionalErrorVisible, conditionalErrorMessage = _a.conditionalErrorMessage, tooltip = _a.tooltip, description = _a.description, _d = _a.disabled, disabled = _d === void 0 ? false : _d, className = _a.className, mainClass = _a.mainClass, style = _a.style, mainStyle = _a.mainStyle, onChange = _a.onChange;
|
11
11
|
var handleChange = function (e) {
|
12
12
|
var selectedOptions = multiple
|
13
13
|
? Array.from(e.target.selectedOptions).map(function (option) { return option.value; })
|
14
14
|
: e.target.value;
|
15
15
|
onChange(selectedOptions); // Pass string or string[] as needed
|
16
16
|
};
|
17
|
-
return (react_1.default.createElement("div", { className:
|
17
|
+
return (react_1.default.createElement("div", { className: mainClass, style: mainStyle },
|
18
18
|
react_1.default.createElement("div", { className: "form-group" },
|
19
19
|
react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
|
20
20
|
react_1.default.createElement("div", { className: "select-container" },
|
21
21
|
react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: tooltip ? (react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(id || name) }, tooltip)) : react_1.default.createElement(react_1.default.Fragment, null) },
|
22
|
-
react_1.default.createElement("select", { id: id, name: name, className: "form-select", value: value, multiple: multiple, required: required, disabled: disabled, style: style, onChange: handleChange },
|
22
|
+
react_1.default.createElement("select", { id: id, name: name, className: "form-select ".concat(className), value: value, multiple: multiple, required: required, disabled: disabled, style: style, onChange: handleChange },
|
23
23
|
!multiple && (react_1.default.createElement("option", { value: "", disabled: true }, "Se\u00E7iniz")),
|
24
24
|
options.map(function (option) { return (react_1.default.createElement("option", { key: option.id, value: option.value }, option.label)); }))),
|
25
25
|
react_1.default.createElement("div", { className: "invalid-feedback text-danger mt-2" },
|