kelt-ui-kit-react 1.3.7 → 1.3.9
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/form/input/Input.d.ts +1 -2
- package/dist/header/Header.d.ts +1 -1
- package/dist/header/header.interface.d.ts +2 -0
- package/dist/index.js +792 -780
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.tsx +1 -1
- package/src/form/input/Input.tsx +62 -57
- package/src/header/Header.tsx +11 -0
- package/src/header/Header.view.tsx +1 -1
- package/src/header/header.interface.tsx +2 -0
- package/src/select/select.css +1 -1
package/package.json
CHANGED
package/src/App.tsx
CHANGED
package/src/form/input/Input.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
1
|
+
import { forwardRef, useState } from "react";
|
|
2
2
|
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { TypeInputEnum } from "../form.enum";
|
|
4
4
|
import "./input.css";
|
|
@@ -18,7 +18,6 @@ export interface InputProps {
|
|
|
18
18
|
minLength?: number;
|
|
19
19
|
maxLength?: number;
|
|
20
20
|
autoComplete?: "on" | "off";
|
|
21
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
22
21
|
step?: string;
|
|
23
22
|
tabIndex?: number;
|
|
24
23
|
checked?: boolean;
|
|
@@ -26,58 +25,62 @@ export interface InputProps {
|
|
|
26
25
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
export const Input = (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
29
|
+
(
|
|
30
|
+
{
|
|
31
|
+
id,
|
|
32
|
+
name,
|
|
33
|
+
type = TypeInputEnum.TEXT,
|
|
34
|
+
value,
|
|
35
|
+
onInvalid,
|
|
36
|
+
placeholder,
|
|
37
|
+
className,
|
|
38
|
+
inputMode,
|
|
39
|
+
minLength,
|
|
40
|
+
maxLength,
|
|
41
|
+
autoFocus = false,
|
|
42
|
+
disabled = false,
|
|
43
|
+
required = false,
|
|
44
|
+
autoComplete = "off",
|
|
45
|
+
tabIndex = 0,
|
|
46
|
+
step,
|
|
47
|
+
checked,
|
|
48
|
+
onChange,
|
|
49
|
+
onBlur,
|
|
50
|
+
},
|
|
51
|
+
ref
|
|
52
|
+
) => {
|
|
53
|
+
// Si le type est password, on utilise l'input de type password
|
|
54
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div className="input-container">
|
|
58
|
+
<input name={`hide-${name}`} type="text" style={{ display: "none" }} />
|
|
59
|
+
|
|
60
|
+
<input
|
|
61
|
+
ref={ref} // 👈 le vrai ref est bien transmis au HTMLInputElement
|
|
62
|
+
id={id}
|
|
63
|
+
name={name}
|
|
64
|
+
inputMode={inputMode ?? (type === "number" ? "numeric" : "text")}
|
|
65
|
+
type={showPassword ? TypeInputEnum.TEXT : type}
|
|
66
|
+
spellCheck="false"
|
|
67
|
+
value={value}
|
|
68
|
+
placeholder={placeholder}
|
|
69
|
+
disabled={disabled}
|
|
70
|
+
required={required}
|
|
71
|
+
autoComplete={autoComplete === "off" ? "fake" : autoComplete}
|
|
72
|
+
step={step}
|
|
73
|
+
tabIndex={tabIndex}
|
|
74
|
+
autoFocus={autoFocus}
|
|
75
|
+
minLength={minLength}
|
|
76
|
+
maxLength={maxLength}
|
|
77
|
+
onChange={onChange}
|
|
78
|
+
checked={checked}
|
|
79
|
+
onBlur={onBlur}
|
|
80
|
+
className={`input-field ${className ?? ""}`}
|
|
81
|
+
onInvalid={onInvalid}
|
|
82
|
+
/>
|
|
56
83
|
|
|
57
|
-
<input
|
|
58
|
-
ref={ref}
|
|
59
|
-
id={id}
|
|
60
|
-
name={name}
|
|
61
|
-
inputMode={inputMode ?? (type === "number" ? "numeric" : "text")}
|
|
62
|
-
type={showPassword ? TypeInputEnum.TEXT : type}
|
|
63
|
-
spellCheck="false"
|
|
64
|
-
value={value}
|
|
65
|
-
placeholder={placeholder}
|
|
66
|
-
disabled={disabled}
|
|
67
|
-
required={required}
|
|
68
|
-
autoComplete={autoComplete === "off" ? "fake" : autoComplete}
|
|
69
|
-
step={step}
|
|
70
|
-
tabIndex={tabIndex}
|
|
71
|
-
autoFocus={autoFocus}
|
|
72
|
-
minLength={minLength}
|
|
73
|
-
maxLength={maxLength}
|
|
74
|
-
onChange={onChange}
|
|
75
|
-
checked={checked}
|
|
76
|
-
onBlur={onBlur}
|
|
77
|
-
className={`input-field ${className ?? ""}`}
|
|
78
|
-
onInvalid={onInvalid}
|
|
79
|
-
/>
|
|
80
|
-
<>
|
|
81
84
|
{type === TypeInputEnum.PASSWORD && (
|
|
82
85
|
<div
|
|
83
86
|
onClick={() => setShowPassword(!showPassword)}
|
|
@@ -86,7 +89,9 @@ export const Input = ({
|
|
|
86
89
|
<Icon classIcon={showPassword ? "bi-eye-slash" : "bi-eye"} />
|
|
87
90
|
</div>
|
|
88
91
|
)}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
Input.displayName = "Input";
|
package/src/header/Header.tsx
CHANGED
|
@@ -12,6 +12,8 @@ export const Header = ({
|
|
|
12
12
|
userChildren,
|
|
13
13
|
positionFixed,
|
|
14
14
|
onClickLogo,
|
|
15
|
+
showBackNavigation,
|
|
16
|
+
onClickBackNavigation,
|
|
15
17
|
}: HeaderInterface): JSX.Element => {
|
|
16
18
|
const refButton = useRef<HTMLDivElement>(null);
|
|
17
19
|
const [openOverlay, setOpenOverlay] = useState(false);
|
|
@@ -24,6 +26,15 @@ export const Header = ({
|
|
|
24
26
|
<span onClick={onClickMenu}>
|
|
25
27
|
<Icon size={IconSizeEnum.MEDIUM} classIcon="bi-list"></Icon>
|
|
26
28
|
</span>
|
|
29
|
+
{showBackNavigation && (
|
|
30
|
+
<span className="chevron-back" onClick={onClickBackNavigation}>
|
|
31
|
+
<Icon
|
|
32
|
+
size={IconSizeEnum.EXTRA_SMALL}
|
|
33
|
+
classIcon="bi-caret-left-fill"
|
|
34
|
+
></Icon>
|
|
35
|
+
</span>
|
|
36
|
+
)}
|
|
37
|
+
|
|
27
38
|
<span
|
|
28
39
|
className={`header-logo ${onClickLogo && "cursor-pointer"} `}
|
|
29
40
|
onClick={onClickLogo}
|