dhre-component-lib 0.5.0 → 0.5.1
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.
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import "./InputTextField.module.scss";
|
|
3
3
|
export interface CustomInputFieldProps {
|
|
4
4
|
label?: string;
|
|
5
|
-
value?:
|
|
5
|
+
value?: any;
|
|
6
6
|
type?: string;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -17,6 +17,7 @@ export interface CustomInputFieldProps {
|
|
|
17
17
|
checkValidation?: () => void;
|
|
18
18
|
name?: string;
|
|
19
19
|
min?: string;
|
|
20
|
+
disabled?: boolean;
|
|
20
21
|
}
|
|
21
22
|
declare const CustomInputField: React.FC<CustomInputFieldProps>;
|
|
22
23
|
export default CustomInputField;
|
package/dist/index.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ declare const CustomRadioButton: React.FC<RadioButtonProps>;
|
|
|
134
134
|
|
|
135
135
|
interface CustomInputFieldProps {
|
|
136
136
|
label?: string;
|
|
137
|
-
value?:
|
|
137
|
+
value?: any;
|
|
138
138
|
type?: string;
|
|
139
139
|
placeholder?: string;
|
|
140
140
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -149,6 +149,7 @@ interface CustomInputFieldProps {
|
|
|
149
149
|
checkValidation?: () => void;
|
|
150
150
|
name?: string;
|
|
151
151
|
min?: string;
|
|
152
|
+
disabled?: boolean;
|
|
152
153
|
}
|
|
153
154
|
declare const CustomInputField: React.FC<CustomInputFieldProps>;
|
|
154
155
|
|
package/dist/index.esm.js
CHANGED
|
@@ -160,7 +160,7 @@ const Typography = ({ variant = 'B1', weight = 'MEDIUM', children, className, ..
|
|
|
160
160
|
var css$h = ".label {\n position: absolute;\n z-index: 1;\n top: -10px;\n left: 11px;\n background: #ffffff;\n padding: 0 6px;\n transition: all 0.3s ease-out;\n}\n\n.inputContainer {\n position: relative;\n}\n\n.inputError:focus-visible {\n outline: 1px solid #eb0542 !important;\n}\n\n.inputContainer::placeholder {\n color: #686868;\n font-size: 16px;\n font-family: \"Meraas Aktiv\", sans-serif;\n font-weight: 400;\n line-height: 22.4px;\n}\n\n.astreik {\n color: #eb0542;\n}";
|
|
161
161
|
n(css$h,{});
|
|
162
162
|
|
|
163
|
-
const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placeholder = "", onChange, className = "", inputClassName = "", labelClassName = "", error, errorClassName = "", maxLength = 0, minLength = 0, checkValidation, name, min, ...rest }) => {
|
|
163
|
+
const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placeholder = "", onChange, className = "", inputClassName = "", labelClassName = "", error, errorClassName = "", maxLength = 0, minLength = 0, checkValidation, name, min, disabled = false, ...rest }) => {
|
|
164
164
|
const [showLabelOnBorder, setShowLabelOnBorder] = useState(false);
|
|
165
165
|
const handleInputValues = (e) => {
|
|
166
166
|
onChange?.(e);
|
|
@@ -185,7 +185,7 @@ const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placehol
|
|
|
185
185
|
placeholder.includes("*") && React__default.createElement("label", { className: 'astreik' }, "*")),
|
|
186
186
|
React__default.createElement("input", { type: type, value: value, name: name, placeholder: showLabelOnBorder ? "" : placeholder, onChange: handleInputValues, onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue,
|
|
187
187
|
// className={inputClassName}
|
|
188
|
-
className: `${inputClassName} ${error ? "inputError" : ''}`, maxLength: maxLength, minLength: minLength, min: min, ...rest }),
|
|
188
|
+
className: `${inputClassName} ${error ? "inputError" : ''}`, maxLength: maxLength, minLength: minLength, min: min, disabled: disabled, ...rest }),
|
|
189
189
|
error && (React__default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName }, error))));
|
|
190
190
|
};
|
|
191
191
|
|