react-frontend-common-components 0.0.83 → 0.0.85
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 +27 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +43 -40
- package/rollup.config.js +44 -44
- package/src/components/app-avatar/app-avatar.tsx +24 -24
- package/src/components/app-back-arrow/app-back-arrow.css +17 -17
- package/src/components/app-back-arrow/app-back-arrow.tsx +37 -37
- package/src/components/app-badge/app-badge.css +11 -11
- package/src/components/app-badge/app-badge.tsx +44 -44
- package/src/components/app-bread-crumb/app-bread-crumb.tsx +16 -16
- package/src/components/app-button/app-button.css +13 -13
- package/src/components/app-button/app-button.tsx +51 -51
- package/src/components/app-card/app-card.css +8 -8
- package/src/components/app-card/app-card.tsx +43 -43
- package/src/components/app-carousel/app-carousel.css +68 -68
- package/src/components/app-carousel/app-carousel.tsx +62 -62
- package/src/components/app-chart/app-chart.css +6 -6
- package/src/components/app-chart/app-chart.tsx +98 -98
- package/src/components/app-checkbox-text/app-checkbox-text.css +12 -12
- package/src/components/app-checkbox-text/app-checkbox-text.tsx +32 -32
- package/src/components/app-collapse/app-collapse.tsx +57 -57
- package/src/components/app-custom-loader/app-custom-loader.css +116 -116
- package/src/components/app-custom-loader/app-custom-loader.tsx +23 -23
- package/src/components/app-divider/app-divider.tsx +16 -16
- package/src/components/app-float-button/app-float-button.tsx +23 -23
- package/src/components/app-image-box/app-image-box.css +22 -22
- package/src/components/app-image-box/app-image-box.tsx +42 -42
- package/src/components/app-input/app-input.css +81 -81
- package/src/components/app-input/app-input.tsx +119 -119
- package/src/components/app-label/app-label.css +5 -5
- package/src/components/app-label/app-label.tsx +34 -34
- package/src/components/app-list/app-list.tsx +26 -26
- package/src/components/app-loader/app-loader.css +16 -16
- package/src/components/app-loader/app-loader.tsx +28 -28
- package/src/components/app-location-map/app-location-map.css +4 -4
- package/src/components/app-location-map/app-location-map.tsx +62 -62
- package/src/components/app-modal/app-modal.css +34 -34
- package/src/components/app-modal/app-modal.tsx +61 -61
- package/src/components/app-otp-field/app-otp-field.css +28 -28
- package/src/components/app-otp-field/app-otp-field.tsx +70 -70
- package/src/components/app-pagination/app-pagination.tsx +40 -40
- package/src/components/app-password-input/app-password-input.css +41 -41
- package/src/components/app-password-input/app-password-input.tsx +90 -90
- package/src/components/app-phone-input/app-phone-input.css +12 -12
- package/src/components/app-phone-input/app-phone-input.tsx +56 -56
- package/src/components/app-popover/app-popover.css +5 -5
- package/src/components/app-popover/app-popover.tsx +45 -45
- package/src/components/app-progress/app-progress.tsx +40 -40
- package/src/components/app-radio-group/app-radio-group.css +6 -6
- package/src/components/app-radio-group/app-radio-group.tsx +45 -45
- package/src/components/app-select/app-select.css +55 -55
- package/src/components/app-select/app-select.tsx +130 -130
- package/src/components/app-select-add/app-select-add.css +21 -21
- package/src/components/app-select-add/app-select-add.tsx +34 -34
- package/src/components/app-sidebar/app-sidebar.css +49 -49
- package/src/components/app-sidebar/app-sidebar.tsx +86 -87
- package/src/components/app-tab/app-tab.css +22 -22
- package/src/components/app-tab/app-tab.tsx +34 -34
- package/src/components/app-table/app-table.tsx +42 -42
- package/src/components/app-tag/app-tag.css +11 -11
- package/src/components/app-tag/app-tag.tsx +48 -48
- package/src/components/app-textarea/app-textarea.css +25 -25
- package/src/components/app-textarea/app-textarea.tsx +59 -59
- package/src/components/app-title/app-title.css +12 -12
- package/src/components/app-title/app-title.tsx +28 -28
- package/src/components/app-toggle-button/app-toggle-button.css +27 -27
- package/src/components/app-toggle-button/app-toggle-button.tsx +43 -43
- package/src/components/app-upload-image/app-upload-image.css +26 -26
- package/src/components/app-upload-image/app-upload-image.tsx +90 -90
- package/src/components/over-view-card/over-view-card.css +15 -15
- package/src/components/over-view-card/over-view-card.tsx +26 -26
- package/src/index.ts +38 -38
- package/src/themes/icons/icons.tsx +146 -146
- package/src/themes/images/profile-img.svg +14 -14
- package/tsconfig.json +20 -20
@@ -1,81 +1,81 @@
|
|
1
|
-
.placeHolder {
|
2
|
-
line-height: normal;
|
3
|
-
position: absolute;
|
4
|
-
bottom: 50%;
|
5
|
-
transform: translateY(50%);
|
6
|
-
left: 11px;
|
7
|
-
color: #000000;
|
8
|
-
z-index: 1 !important;
|
9
|
-
}
|
10
|
-
.requiredText {
|
11
|
-
opacity: 60%;
|
12
|
-
color: #686869 !important;
|
13
|
-
font-size: 14px;
|
14
|
-
font-weight: 500;
|
15
|
-
line-height: normal;
|
16
|
-
}
|
17
|
-
.star {
|
18
|
-
color: rgba(255, 40, 25, 1);
|
19
|
-
display: inline-block;
|
20
|
-
transform: translateX(1.5px);
|
21
|
-
}
|
22
|
-
|
23
|
-
.appInput {
|
24
|
-
font-size: var(--font-14);
|
25
|
-
font-weight: 500;
|
26
|
-
position: relative;
|
27
|
-
.ant-input::placeholder {
|
28
|
-
color: #202123 !important;
|
29
|
-
font-size: 14px;
|
30
|
-
font-weight: 500;
|
31
|
-
line-height: normal;
|
32
|
-
}
|
33
|
-
|
34
|
-
*:focus {
|
35
|
-
outline: 0 !important;
|
36
|
-
box-shadow: unset !important;
|
37
|
-
}
|
38
|
-
&:hover {
|
39
|
-
.ant-input {
|
40
|
-
border-color: #d9d9d9;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
&:has(.ant-input-affix-wrapper) {
|
45
|
-
.ant-input {
|
46
|
-
border: none !important;
|
47
|
-
height: unset !important;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
.ant-input-affix-wrapper {
|
51
|
-
height: 40px;
|
52
|
-
display: flex;
|
53
|
-
align-items: center;
|
54
|
-
.ant-input-outlined:focus-within {
|
55
|
-
box-shadow: unset !important;
|
56
|
-
}
|
57
|
-
|
58
|
-
*:focus {
|
59
|
-
outline: 0 !important;
|
60
|
-
box-shadow: unset !important;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
.ant-input-outlined {
|
64
|
-
height: 40px;
|
65
|
-
&:hover {
|
66
|
-
border-color: #d9d9d9;
|
67
|
-
}
|
68
|
-
&:focus {
|
69
|
-
box-shadow: unset;
|
70
|
-
}
|
71
|
-
&:focus-within {
|
72
|
-
box-shadow: unset;
|
73
|
-
border-color: #d9d9d9;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
77
|
-
.error {
|
78
|
-
color: red;
|
79
|
-
font-size: 0.875rem;
|
80
|
-
margin-top: 0.25rem;
|
81
|
-
}
|
1
|
+
.placeHolder {
|
2
|
+
line-height: normal;
|
3
|
+
position: absolute;
|
4
|
+
bottom: 50%;
|
5
|
+
transform: translateY(50%);
|
6
|
+
left: 11px;
|
7
|
+
color: #000000;
|
8
|
+
z-index: 1 !important;
|
9
|
+
}
|
10
|
+
.requiredText {
|
11
|
+
opacity: 60%;
|
12
|
+
color: #686869 !important;
|
13
|
+
font-size: 14px;
|
14
|
+
font-weight: 500;
|
15
|
+
line-height: normal;
|
16
|
+
}
|
17
|
+
.star {
|
18
|
+
color: rgba(255, 40, 25, 1);
|
19
|
+
display: inline-block;
|
20
|
+
transform: translateX(1.5px);
|
21
|
+
}
|
22
|
+
|
23
|
+
.appInput {
|
24
|
+
font-size: var(--font-14);
|
25
|
+
font-weight: 500;
|
26
|
+
position: relative;
|
27
|
+
.ant-input::placeholder {
|
28
|
+
color: #202123 !important;
|
29
|
+
font-size: 14px;
|
30
|
+
font-weight: 500;
|
31
|
+
line-height: normal;
|
32
|
+
}
|
33
|
+
|
34
|
+
*:focus {
|
35
|
+
outline: 0 !important;
|
36
|
+
box-shadow: unset !important;
|
37
|
+
}
|
38
|
+
&:hover {
|
39
|
+
.ant-input {
|
40
|
+
border-color: #d9d9d9;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
&:has(.ant-input-affix-wrapper) {
|
45
|
+
.ant-input {
|
46
|
+
border: none !important;
|
47
|
+
height: unset !important;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
.ant-input-affix-wrapper {
|
51
|
+
height: 40px;
|
52
|
+
display: flex;
|
53
|
+
align-items: center;
|
54
|
+
.ant-input-outlined:focus-within {
|
55
|
+
box-shadow: unset !important;
|
56
|
+
}
|
57
|
+
|
58
|
+
*:focus {
|
59
|
+
outline: 0 !important;
|
60
|
+
box-shadow: unset !important;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
.ant-input-outlined {
|
64
|
+
height: 40px;
|
65
|
+
&:hover {
|
66
|
+
border-color: #d9d9d9;
|
67
|
+
}
|
68
|
+
&:focus {
|
69
|
+
box-shadow: unset;
|
70
|
+
}
|
71
|
+
&:focus-within {
|
72
|
+
box-shadow: unset;
|
73
|
+
border-color: #d9d9d9;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
.error {
|
78
|
+
color: red;
|
79
|
+
font-size: 0.875rem;
|
80
|
+
margin-top: 0.25rem;
|
81
|
+
}
|
@@ -1,119 +1,119 @@
|
|
1
|
-
"use client";
|
2
|
-
|
3
|
-
import { Input, InputProps, InputRef } from "antd";
|
4
|
-
import {
|
5
|
-
ChangeEvent,
|
6
|
-
ChangeEventHandler,
|
7
|
-
KeyboardEventHandler,
|
8
|
-
MouseEventHandler,
|
9
|
-
useEffect,
|
10
|
-
useRef,
|
11
|
-
useState,
|
12
|
-
} from "react";
|
13
|
-
import "./app-input.css";
|
14
|
-
|
15
|
-
interface AppInputProps extends InputProps {
|
16
|
-
className?: string;
|
17
|
-
label?: string;
|
18
|
-
name?: string;
|
19
|
-
value?: string;
|
20
|
-
dataTestId?: string;
|
21
|
-
id?: string;
|
22
|
-
disabled?: boolean;
|
23
|
-
handleChange?: ChangeEventHandler<HTMLInputElement>;
|
24
|
-
onClick?: MouseEventHandler<HTMLElement>;
|
25
|
-
onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
|
26
|
-
defaultValue?: string;
|
27
|
-
isAutoFocus?: boolean;
|
28
|
-
triggerFocus?: boolean;
|
29
|
-
type?: string;
|
30
|
-
isOptional?: boolean;
|
31
|
-
errorMessage?: string;
|
32
|
-
suffixIcon?: React.ReactNode;
|
33
|
-
prefixIcon?: React.ReactNode;
|
34
|
-
required?: boolean;
|
35
|
-
}
|
36
|
-
|
37
|
-
const AppInput = ({
|
38
|
-
className,
|
39
|
-
label,
|
40
|
-
name,
|
41
|
-
value,
|
42
|
-
dataTestId,
|
43
|
-
type,
|
44
|
-
id,
|
45
|
-
disabled,
|
46
|
-
handleChange,
|
47
|
-
onClick,
|
48
|
-
defaultValue,
|
49
|
-
onPressEnter,
|
50
|
-
isAutoFocus,
|
51
|
-
triggerFocus,
|
52
|
-
isOptional,
|
53
|
-
errorMessage,
|
54
|
-
suffixIcon,
|
55
|
-
prefixIcon,
|
56
|
-
required,
|
57
|
-
...props
|
58
|
-
}: AppInputProps) => {
|
59
|
-
const inputRef = useRef<InputRef>(null);
|
60
|
-
const [inputValue, setInputValue] = useState<string>(value || "");
|
61
|
-
const [isTyping, setIsTyping] = useState(false);
|
62
|
-
|
63
|
-
useEffect(() => {
|
64
|
-
if (isAutoFocus && inputRef.current) {
|
65
|
-
inputRef.current.focus();
|
66
|
-
}
|
67
|
-
}, [triggerFocus, isAutoFocus]);
|
68
|
-
|
69
|
-
useEffect(() => {
|
70
|
-
if (value !== undefined) {
|
71
|
-
setInputValue(value);
|
72
|
-
}
|
73
|
-
}, [value]);
|
74
|
-
|
75
|
-
const placeholder = isOptional ? `${label} (optional)` : label;
|
76
|
-
|
77
|
-
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
78
|
-
setInputValue(e.target.value);
|
79
|
-
setIsTyping(e.target.value.length > 0);
|
80
|
-
handleChange?.(e);
|
81
|
-
};
|
82
|
-
|
83
|
-
return (
|
84
|
-
<div className={`appInput ${className}`}>
|
85
|
-
{/* Show placeholder only if user hasn't started typing */}
|
86
|
-
{required && !isTyping && !inputValue && (
|
87
|
-
<div className="placeHolder" onClick={() => inputRef.current?.focus()}>
|
88
|
-
<label className="requiredText" htmlFor={id}>
|
89
|
-
{placeholder}
|
90
|
-
</label>
|
91
|
-
<span className="star">*</span>
|
92
|
-
</div>
|
93
|
-
)}
|
94
|
-
|
95
|
-
<Input
|
96
|
-
type={type}
|
97
|
-
data-test-id={dataTestId}
|
98
|
-
id={id}
|
99
|
-
disabled={disabled}
|
100
|
-
name={name}
|
101
|
-
className={"input"}
|
102
|
-
value={inputValue}
|
103
|
-
onChange={handleInputChange}
|
104
|
-
onClick={onClick}
|
105
|
-
defaultValue={defaultValue}
|
106
|
-
onPressEnter={onPressEnter}
|
107
|
-
placeholder={`${required ? "" : placeholder}`}
|
108
|
-
ref={inputRef}
|
109
|
-
prefix={prefixIcon && prefixIcon}
|
110
|
-
suffix={suffixIcon && suffixIcon}
|
111
|
-
{...props}
|
112
|
-
/>
|
113
|
-
|
114
|
-
{errorMessage && <div className={"error"}>{errorMessage}</div>}
|
115
|
-
</div>
|
116
|
-
);
|
117
|
-
};
|
118
|
-
|
119
|
-
export default AppInput;
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
import { Input, InputProps, InputRef } from "antd";
|
4
|
+
import {
|
5
|
+
ChangeEvent,
|
6
|
+
ChangeEventHandler,
|
7
|
+
KeyboardEventHandler,
|
8
|
+
MouseEventHandler,
|
9
|
+
useEffect,
|
10
|
+
useRef,
|
11
|
+
useState,
|
12
|
+
} from "react";
|
13
|
+
import "./app-input.css";
|
14
|
+
|
15
|
+
interface AppInputProps extends InputProps {
|
16
|
+
className?: string;
|
17
|
+
label?: string;
|
18
|
+
name?: string;
|
19
|
+
value?: string;
|
20
|
+
dataTestId?: string;
|
21
|
+
id?: string;
|
22
|
+
disabled?: boolean;
|
23
|
+
handleChange?: ChangeEventHandler<HTMLInputElement>;
|
24
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
25
|
+
onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
|
26
|
+
defaultValue?: string;
|
27
|
+
isAutoFocus?: boolean;
|
28
|
+
triggerFocus?: boolean;
|
29
|
+
type?: string;
|
30
|
+
isOptional?: boolean;
|
31
|
+
errorMessage?: string;
|
32
|
+
suffixIcon?: React.ReactNode;
|
33
|
+
prefixIcon?: React.ReactNode;
|
34
|
+
required?: boolean;
|
35
|
+
}
|
36
|
+
|
37
|
+
const AppInput = ({
|
38
|
+
className,
|
39
|
+
label,
|
40
|
+
name,
|
41
|
+
value,
|
42
|
+
dataTestId,
|
43
|
+
type,
|
44
|
+
id,
|
45
|
+
disabled,
|
46
|
+
handleChange,
|
47
|
+
onClick,
|
48
|
+
defaultValue,
|
49
|
+
onPressEnter,
|
50
|
+
isAutoFocus,
|
51
|
+
triggerFocus,
|
52
|
+
isOptional,
|
53
|
+
errorMessage,
|
54
|
+
suffixIcon,
|
55
|
+
prefixIcon,
|
56
|
+
required,
|
57
|
+
...props
|
58
|
+
}: AppInputProps) => {
|
59
|
+
const inputRef = useRef<InputRef>(null);
|
60
|
+
const [inputValue, setInputValue] = useState<string>(value || "");
|
61
|
+
const [isTyping, setIsTyping] = useState(false);
|
62
|
+
|
63
|
+
useEffect(() => {
|
64
|
+
if (isAutoFocus && inputRef.current) {
|
65
|
+
inputRef.current.focus();
|
66
|
+
}
|
67
|
+
}, [triggerFocus, isAutoFocus]);
|
68
|
+
|
69
|
+
useEffect(() => {
|
70
|
+
if (value !== undefined) {
|
71
|
+
setInputValue(value);
|
72
|
+
}
|
73
|
+
}, [value]);
|
74
|
+
|
75
|
+
const placeholder = isOptional ? `${label} (optional)` : label;
|
76
|
+
|
77
|
+
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
78
|
+
setInputValue(e.target.value);
|
79
|
+
setIsTyping(e.target.value.length > 0);
|
80
|
+
handleChange?.(e);
|
81
|
+
};
|
82
|
+
|
83
|
+
return (
|
84
|
+
<div className={`appInput ${className}`}>
|
85
|
+
{/* Show placeholder only if user hasn't started typing */}
|
86
|
+
{required && !isTyping && !inputValue && (
|
87
|
+
<div className="placeHolder" onClick={() => inputRef.current?.focus()}>
|
88
|
+
<label className="requiredText" htmlFor={id}>
|
89
|
+
{placeholder}
|
90
|
+
</label>
|
91
|
+
<span className="star">*</span>
|
92
|
+
</div>
|
93
|
+
)}
|
94
|
+
|
95
|
+
<Input
|
96
|
+
type={type}
|
97
|
+
data-test-id={dataTestId}
|
98
|
+
id={id}
|
99
|
+
disabled={disabled}
|
100
|
+
name={name}
|
101
|
+
className={"input"}
|
102
|
+
value={inputValue}
|
103
|
+
onChange={handleInputChange}
|
104
|
+
onClick={onClick}
|
105
|
+
defaultValue={defaultValue}
|
106
|
+
onPressEnter={onPressEnter}
|
107
|
+
placeholder={`${required ? "" : placeholder}`}
|
108
|
+
ref={inputRef}
|
109
|
+
prefix={prefixIcon && prefixIcon}
|
110
|
+
suffix={suffixIcon && suffixIcon}
|
111
|
+
{...props}
|
112
|
+
/>
|
113
|
+
|
114
|
+
{errorMessage && <div className={"error"}>{errorMessage}</div>}
|
115
|
+
</div>
|
116
|
+
);
|
117
|
+
};
|
118
|
+
|
119
|
+
export default AppInput;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
.label {
|
2
|
-
display: inline-block;
|
3
|
-
font-weight: 500;
|
4
|
-
margin-bottom: 0.5rem;
|
5
|
-
}
|
1
|
+
.label {
|
2
|
+
display: inline-block;
|
3
|
+
font-weight: 500;
|
4
|
+
margin-bottom: 0.5rem;
|
5
|
+
}
|
@@ -1,34 +1,34 @@
|
|
1
|
-
import "./app-label.css";
|
2
|
-
|
3
|
-
interface AppLabelProps {
|
4
|
-
text: string;
|
5
|
-
htmlFor?: string;
|
6
|
-
color?: string;
|
7
|
-
fontSize?: string;
|
8
|
-
className?: string;
|
9
|
-
}
|
10
|
-
|
11
|
-
const AppLabel = ({
|
12
|
-
text,
|
13
|
-
htmlFor,
|
14
|
-
color = "inherit",
|
15
|
-
fontSize = "inherit",
|
16
|
-
className,
|
17
|
-
}: AppLabelProps) => {
|
18
|
-
const labelStyle = {
|
19
|
-
color,
|
20
|
-
fontSize,
|
21
|
-
};
|
22
|
-
|
23
|
-
return (
|
24
|
-
<label
|
25
|
-
htmlFor={htmlFor}
|
26
|
-
className={`label ${className}`}
|
27
|
-
style={labelStyle}
|
28
|
-
>
|
29
|
-
{text}
|
30
|
-
</label>
|
31
|
-
);
|
32
|
-
};
|
33
|
-
|
34
|
-
export default AppLabel;
|
1
|
+
import "./app-label.css";
|
2
|
+
|
3
|
+
interface AppLabelProps {
|
4
|
+
text: string;
|
5
|
+
htmlFor?: string;
|
6
|
+
color?: string;
|
7
|
+
fontSize?: string;
|
8
|
+
className?: string;
|
9
|
+
}
|
10
|
+
|
11
|
+
const AppLabel = ({
|
12
|
+
text,
|
13
|
+
htmlFor,
|
14
|
+
color = "inherit",
|
15
|
+
fontSize = "inherit",
|
16
|
+
className,
|
17
|
+
}: AppLabelProps) => {
|
18
|
+
const labelStyle = {
|
19
|
+
color,
|
20
|
+
fontSize,
|
21
|
+
};
|
22
|
+
|
23
|
+
return (
|
24
|
+
<label
|
25
|
+
htmlFor={htmlFor}
|
26
|
+
className={`label ${className}`}
|
27
|
+
style={labelStyle}
|
28
|
+
>
|
29
|
+
{text}
|
30
|
+
</label>
|
31
|
+
);
|
32
|
+
};
|
33
|
+
|
34
|
+
export default AppLabel;
|
@@ -1,26 +1,26 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { List, ListProps } from "antd";
|
3
|
-
|
4
|
-
interface AppListProps<T> extends ListProps<T> {
|
5
|
-
renderItem: (item: T, index: number) => React.ReactNode;
|
6
|
-
className?: string;
|
7
|
-
}
|
8
|
-
|
9
|
-
const AppList = <T extends unknown>({
|
10
|
-
renderItem,
|
11
|
-
dataSource,
|
12
|
-
className,
|
13
|
-
...props
|
14
|
-
}: AppListProps<T>) => {
|
15
|
-
return (
|
16
|
-
<div className={className}>
|
17
|
-
<List
|
18
|
-
dataSource={dataSource}
|
19
|
-
renderItem={(item, index) => renderItem(item, index)}
|
20
|
-
{...props}
|
21
|
-
/>
|
22
|
-
</div>
|
23
|
-
);
|
24
|
-
};
|
25
|
-
|
26
|
-
export default AppList;
|
1
|
+
import React from "react";
|
2
|
+
import { List, ListProps } from "antd";
|
3
|
+
|
4
|
+
interface AppListProps<T> extends ListProps<T> {
|
5
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
6
|
+
className?: string;
|
7
|
+
}
|
8
|
+
|
9
|
+
const AppList = <T extends unknown>({
|
10
|
+
renderItem,
|
11
|
+
dataSource,
|
12
|
+
className,
|
13
|
+
...props
|
14
|
+
}: AppListProps<T>) => {
|
15
|
+
return (
|
16
|
+
<div className={className}>
|
17
|
+
<List
|
18
|
+
dataSource={dataSource}
|
19
|
+
renderItem={(item, index) => renderItem(item, index)}
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
</div>
|
23
|
+
);
|
24
|
+
};
|
25
|
+
|
26
|
+
export default AppList;
|
@@ -1,16 +1,16 @@
|
|
1
|
-
.loader {
|
2
|
-
width: 100vw;
|
3
|
-
height: 100vh;
|
4
|
-
display: grid;
|
5
|
-
place-items: center;
|
6
|
-
|
7
|
-
position: fixed;
|
8
|
-
top: 0;
|
9
|
-
left: 0;
|
10
|
-
background-color: (0, 0, 0, 0.3);
|
11
|
-
backdrop-filter: blur(10px);
|
12
|
-
z-index: 99;
|
13
|
-
* {
|
14
|
-
transform: scale(1.5);
|
15
|
-
}
|
16
|
-
}
|
1
|
+
.loader {
|
2
|
+
width: 100vw;
|
3
|
+
height: 100vh;
|
4
|
+
display: grid;
|
5
|
+
place-items: center;
|
6
|
+
|
7
|
+
position: fixed;
|
8
|
+
top: 0;
|
9
|
+
left: 0;
|
10
|
+
background-color: (0, 0, 0, 0.3);
|
11
|
+
backdrop-filter: blur(10px);
|
12
|
+
z-index: 99;
|
13
|
+
* {
|
14
|
+
transform: scale(1.5);
|
15
|
+
}
|
16
|
+
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Spin, Skeleton } from "antd";
|
3
|
-
import "./app-loader.css";
|
4
|
-
|
5
|
-
type LoaderType = "spinner" | "skeleton" | "custom";
|
6
|
-
|
7
|
-
interface AppLoaderProps {
|
8
|
-
type?: LoaderType;
|
9
|
-
customLoader?: React.ReactNode;
|
10
|
-
className?: string;
|
11
|
-
}
|
12
|
-
|
13
|
-
const AppLoader = ({ type, customLoader, className }: AppLoaderProps) => {
|
14
|
-
const loaderType: LoaderType = customLoader ? "custom" : type || "spinner";
|
15
|
-
|
16
|
-
switch (loaderType) {
|
17
|
-
case "spinner":
|
18
|
-
return <Spin className={`loader ${className}`} />;
|
19
|
-
case "skeleton":
|
20
|
-
return <Skeleton active className={`loader ${className}`} />;
|
21
|
-
case "custom":
|
22
|
-
return customLoader || <Spin className={`loader ${className}`} />;
|
23
|
-
default:
|
24
|
-
return <Spin className={`loader ${className}`} />;
|
25
|
-
}
|
26
|
-
};
|
27
|
-
|
28
|
-
export default AppLoader;
|
1
|
+
import React from "react";
|
2
|
+
import { Spin, Skeleton } from "antd";
|
3
|
+
import "./app-loader.css";
|
4
|
+
|
5
|
+
type LoaderType = "spinner" | "skeleton" | "custom";
|
6
|
+
|
7
|
+
interface AppLoaderProps {
|
8
|
+
type?: LoaderType;
|
9
|
+
customLoader?: React.ReactNode;
|
10
|
+
className?: string;
|
11
|
+
}
|
12
|
+
|
13
|
+
const AppLoader = ({ type, customLoader, className }: AppLoaderProps) => {
|
14
|
+
const loaderType: LoaderType = customLoader ? "custom" : type || "spinner";
|
15
|
+
|
16
|
+
switch (loaderType) {
|
17
|
+
case "spinner":
|
18
|
+
return <Spin className={`loader ${className}`} />;
|
19
|
+
case "skeleton":
|
20
|
+
return <Skeleton active className={`loader ${className}`} />;
|
21
|
+
case "custom":
|
22
|
+
return customLoader || <Spin className={`loader ${className}`} />;
|
23
|
+
default:
|
24
|
+
return <Spin className={`loader ${className}`} />;
|
25
|
+
}
|
26
|
+
};
|
27
|
+
|
28
|
+
export default AppLoader;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.appLocationMap {
|
2
|
-
width: max-content;
|
3
|
-
height: max-content;
|
4
|
-
}
|
1
|
+
.appLocationMap {
|
2
|
+
width: max-content;
|
3
|
+
height: max-content;
|
4
|
+
}
|