next-helios-fe 1.8.39 → 1.8.40
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 +1 -1
- package/package.json +1 -1
- package/src/components/form/input/date.tsx +116 -121
package/package.json
CHANGED
@@ -158,127 +158,122 @@ export const Date: React.FC<DateProps> = ({
|
|
158
158
|
}
|
159
159
|
>
|
160
160
|
<div className="flex gap-2 w-fit overflow-auto md:overflow-clip">
|
161
|
-
{options?.enableSelectRange &&
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
>
|
278
|
-
Custom
|
279
|
-
</button>
|
280
|
-
</div>
|
281
|
-
)}
|
161
|
+
{options?.enableSelectRange && !options.disablePast && (
|
162
|
+
<div className="w-40">
|
163
|
+
<button
|
164
|
+
type="button"
|
165
|
+
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"
|
166
|
+
disabled={dateRangeLabel(tempValue) === "Today"}
|
167
|
+
onClick={() => {
|
168
|
+
setTempValue([
|
169
|
+
dayjs().startOf("day"),
|
170
|
+
dayjs().endOf("day"),
|
171
|
+
]);
|
172
|
+
if (rest.onChange) {
|
173
|
+
rest.onChange({
|
174
|
+
target: {
|
175
|
+
value: [dayjs().startOf("day"), dayjs().endOf("day")],
|
176
|
+
} as any,
|
177
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
178
|
+
}
|
179
|
+
}}
|
180
|
+
>
|
181
|
+
Today
|
182
|
+
</button>
|
183
|
+
<button
|
184
|
+
type="button"
|
185
|
+
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"
|
186
|
+
disabled={dateRangeLabel(tempValue) === "Yesterday"}
|
187
|
+
onClick={() => {
|
188
|
+
setTempValue([
|
189
|
+
dayjs().subtract(1, "days").startOf("day"),
|
190
|
+
dayjs().subtract(1, "days").endOf("day"),
|
191
|
+
]);
|
192
|
+
if (rest.onChange) {
|
193
|
+
rest.onChange({
|
194
|
+
target: {
|
195
|
+
value: [
|
196
|
+
dayjs().subtract(1, "days").startOf("day"),
|
197
|
+
dayjs().subtract(1, "days").endOf("day"),
|
198
|
+
],
|
199
|
+
} as any,
|
200
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
201
|
+
}
|
202
|
+
}}
|
203
|
+
>
|
204
|
+
Yesterday
|
205
|
+
</button>
|
206
|
+
<button
|
207
|
+
type="button"
|
208
|
+
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"
|
209
|
+
disabled={dateRangeLabel(tempValue) === "Last 7 days"}
|
210
|
+
onClick={() => {
|
211
|
+
setTempValue([
|
212
|
+
dayjs().subtract(7, "days").startOf("day"),
|
213
|
+
dayjs().endOf("day"),
|
214
|
+
]);
|
215
|
+
if (rest.onChange) {
|
216
|
+
rest.onChange({
|
217
|
+
target: {
|
218
|
+
value: [
|
219
|
+
dayjs().subtract(7, "days").startOf("day"),
|
220
|
+
dayjs().endOf("day"),
|
221
|
+
],
|
222
|
+
} as any,
|
223
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
224
|
+
}
|
225
|
+
}}
|
226
|
+
>
|
227
|
+
Last 7 days
|
228
|
+
</button>
|
229
|
+
<button
|
230
|
+
type="button"
|
231
|
+
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"
|
232
|
+
disabled={dateRangeLabel(tempValue) === "Last 30 days"}
|
233
|
+
onClick={() => {
|
234
|
+
setTempValue([
|
235
|
+
dayjs().subtract(1, "months").startOf("day"),
|
236
|
+
dayjs().endOf("day"),
|
237
|
+
]);
|
238
|
+
if (rest.onChange) {
|
239
|
+
rest.onChange({
|
240
|
+
target: {
|
241
|
+
value: [
|
242
|
+
dayjs().subtract(1, "months").startOf("day"),
|
243
|
+
dayjs().endOf("day"),
|
244
|
+
],
|
245
|
+
} as any,
|
246
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
247
|
+
}
|
248
|
+
}}
|
249
|
+
>
|
250
|
+
Last 30 days
|
251
|
+
</button>
|
252
|
+
<button
|
253
|
+
type="button"
|
254
|
+
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"
|
255
|
+
disabled={dateRangeLabel(tempValue) === "Custom"}
|
256
|
+
onClick={() => {
|
257
|
+
setTempValue([
|
258
|
+
dayjs().startOf("day"),
|
259
|
+
dayjs().add(1, "days").endOf("day"),
|
260
|
+
]);
|
261
|
+
if (rest.onChange) {
|
262
|
+
rest.onChange({
|
263
|
+
target: {
|
264
|
+
value: [
|
265
|
+
dayjs().add(1, "days").startOf("day"),
|
266
|
+
dayjs().add(1, "days").endOf("day"),
|
267
|
+
],
|
268
|
+
} as any,
|
269
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
270
|
+
}
|
271
|
+
}}
|
272
|
+
>
|
273
|
+
Custom
|
274
|
+
</button>
|
275
|
+
</div>
|
276
|
+
)}
|
282
277
|
<Calendar
|
283
278
|
options={{
|
284
279
|
enableSelectRange: options?.enableSelectRange ?? false,
|