next-helios-fe 1.8.3 → 1.8.5
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/package.json
CHANGED
@@ -112,6 +112,8 @@ export const Date: React.FC<DateProps> = ({
|
|
112
112
|
<input
|
113
113
|
type="text"
|
114
114
|
className={`w-full ps-4 pe-14 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-slate-300 focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-slate-400 ${height}`}
|
115
|
+
disabled={rest.disabled}
|
116
|
+
readOnly
|
115
117
|
value={
|
116
118
|
dateRangeLabel(tempValue) === "Custom" ||
|
117
119
|
!options?.enableSelectRange
|
@@ -123,7 +125,6 @@ export const Date: React.FC<DateProps> = ({
|
|
123
125
|
} - ${dayjs(tempValue[1]).format("DD MMM YYYY")}`
|
124
126
|
: dateRangeLabel(tempValue)
|
125
127
|
}
|
126
|
-
disabled={rest.disabled}
|
127
128
|
/>
|
128
129
|
<button
|
129
130
|
type="button"
|
@@ -158,6 +159,7 @@ export const Date: React.FC<DateProps> = ({
|
|
158
159
|
!options.disableFuture && (
|
159
160
|
<div className="w-40">
|
160
161
|
<button
|
162
|
+
type="button"
|
161
163
|
className="w-40 my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
162
164
|
disabled={dateRangeLabel(tempValue) === "Today"}
|
163
165
|
onClick={() => {
|
@@ -180,6 +182,7 @@ export const Date: React.FC<DateProps> = ({
|
|
180
182
|
Today
|
181
183
|
</button>
|
182
184
|
<button
|
185
|
+
type="button"
|
183
186
|
className="w-40 my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
184
187
|
disabled={dateRangeLabel(tempValue) === "Yesterday"}
|
185
188
|
onClick={() => {
|
@@ -202,6 +205,7 @@ export const Date: React.FC<DateProps> = ({
|
|
202
205
|
Yesterday
|
203
206
|
</button>
|
204
207
|
<button
|
208
|
+
type="button"
|
205
209
|
className="w-40 my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
206
210
|
disabled={dateRangeLabel(tempValue) === "Last 7 days"}
|
207
211
|
onClick={() => {
|
@@ -224,6 +228,7 @@ export const Date: React.FC<DateProps> = ({
|
|
224
228
|
Last 7 days
|
225
229
|
</button>
|
226
230
|
<button
|
231
|
+
type="button"
|
227
232
|
className="w-40 my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
228
233
|
disabled={dateRangeLabel(tempValue) === "Last 30 days"}
|
229
234
|
onClick={() => {
|
@@ -246,6 +251,7 @@ export const Date: React.FC<DateProps> = ({
|
|
246
251
|
Last 30 days
|
247
252
|
</button>
|
248
253
|
<button
|
254
|
+
type="button"
|
249
255
|
className="w-40 my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
250
256
|
disabled={dateRangeLabel(tempValue) === "Custom"}
|
251
257
|
onClick={() => {
|
@@ -2,7 +2,8 @@
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
3
3
|
import { Icon } from "@iconify/react";
|
4
4
|
|
5
|
-
export interface RatingProps
|
5
|
+
export interface RatingProps
|
6
|
+
extends React.InputHTMLAttributes<HTMLInputElement> {
|
6
7
|
label?: string;
|
7
8
|
description?: string;
|
8
9
|
options?: {
|
@@ -112,8 +113,9 @@ export const Rating: React.FC<RatingProps> = ({
|
|
112
113
|
<input
|
113
114
|
type="text"
|
114
115
|
className={`absolute top-0 w-full border-0 bg-transparent text-transparent caret-transparent pointer-events-none focus:ring-0 ${height}`}
|
115
|
-
value={tempValue}
|
116
116
|
required={rest.required}
|
117
|
+
readOnly
|
118
|
+
value={tempValue}
|
117
119
|
/>
|
118
120
|
</div>
|
119
121
|
</div>
|
@@ -14,6 +14,7 @@ export interface SelectProps
|
|
14
14
|
label?: string;
|
15
15
|
placeholder?: string;
|
16
16
|
description?: string;
|
17
|
+
labelComponent?: (e?: any) => React.ReactNode;
|
17
18
|
options?: {
|
18
19
|
width?: "full" | "fit";
|
19
20
|
height?: "short" | "medium" | "high";
|
@@ -21,11 +22,12 @@ export interface SelectProps
|
|
21
22
|
}
|
22
23
|
|
23
24
|
export const Select: React.FC<SelectProps> = ({
|
24
|
-
options,
|
25
25
|
label,
|
26
26
|
menus,
|
27
27
|
placeholder,
|
28
28
|
description,
|
29
|
+
labelComponent,
|
30
|
+
options,
|
29
31
|
...rest
|
30
32
|
}) => {
|
31
33
|
const [tempValue, setTempValue] = useState("");
|
@@ -96,6 +98,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
96
98
|
placeholder={placeholder}
|
97
99
|
required={rest.required}
|
98
100
|
disabled={rest.disabled}
|
101
|
+
readOnly
|
99
102
|
value={
|
100
103
|
tempValue
|
101
104
|
? menus.find((item) => item.value === tempValue)?.label
|
@@ -151,7 +154,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
151
154
|
<button
|
152
155
|
key={index}
|
153
156
|
type="button"
|
154
|
-
className="min-w-40 w-full my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
157
|
+
className="flex justify-between items-center min-w-40 w-full my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:bg-primary-transparent disabled:text-primary"
|
155
158
|
disabled
|
156
159
|
onClick={() => {
|
157
160
|
setTempValue(item.value);
|
@@ -162,7 +165,8 @@ export const Select: React.FC<SelectProps> = ({
|
|
162
165
|
}
|
163
166
|
}}
|
164
167
|
>
|
165
|
-
{item.label}
|
168
|
+
<span>{item.label}</span>
|
169
|
+
{labelComponent ? labelComponent(item) : ""}
|
166
170
|
</button>
|
167
171
|
);
|
168
172
|
} else {
|
@@ -170,7 +174,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
170
174
|
<button
|
171
175
|
key={index}
|
172
176
|
type="button"
|
173
|
-
className="min-w-40 w-full my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:text-slate-400"
|
177
|
+
className="flex justify-between items-center min-w-40 w-full my-0.5 px-4 py-2 rounded-md text-sm text-left hover:bg-secondary-light disabled:text-slate-400"
|
174
178
|
disabled={item.disabled}
|
175
179
|
onClick={() => {
|
176
180
|
setTempValue(item.value);
|
@@ -181,7 +185,8 @@ export const Select: React.FC<SelectProps> = ({
|
|
181
185
|
}
|
182
186
|
}}
|
183
187
|
>
|
184
|
-
{item.label}
|
188
|
+
<span>{item.label}</span>
|
189
|
+
{labelComponent ? labelComponent(item) : ""}
|
185
190
|
</button>
|
186
191
|
);
|
187
192
|
}
|