next-helios-fe 1.8.38 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.8.38",
3
+ "version": "1.8.40",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,9 +33,6 @@ export const Item: React.FC<ItemProps> = ({
33
33
  className={`h-min rounded-md overflow-hidden ${
34
34
  options?.border && "border"
35
35
  }`}
36
- onClick={() => {
37
- onClick && onClick();
38
- }}
39
36
  >
40
37
  <div
41
38
  className={`grid w-full overflow-hidden duration-300 ${
@@ -49,6 +46,7 @@ export const Item: React.FC<ItemProps> = ({
49
46
  }`}
50
47
  onClick={() => {
51
48
  setOpen(!open);
49
+ onClick && onClick();
52
50
  }}
53
51
  >
54
52
  <div className="flex-1 flex flex-col items-start">
@@ -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
- !options.disablePast &&
163
- !options.disableFuture && (
164
- <div className="w-40">
165
- <button
166
- type="button"
167
- 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"
168
- disabled={dateRangeLabel(tempValue) === "Today"}
169
- onClick={() => {
170
- setTempValue([
171
- dayjs().startOf("day"),
172
- dayjs().endOf("day"),
173
- ]);
174
- if (rest.onChange) {
175
- rest.onChange({
176
- target: {
177
- value: [
178
- dayjs().startOf("day"),
179
- dayjs().endOf("day"),
180
- ],
181
- } as any,
182
- } as React.ChangeEvent<HTMLInputElement>);
183
- }
184
- }}
185
- >
186
- Today
187
- </button>
188
- <button
189
- type="button"
190
- 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"
191
- disabled={dateRangeLabel(tempValue) === "Yesterday"}
192
- onClick={() => {
193
- setTempValue([
194
- dayjs().subtract(1, "days").startOf("day"),
195
- dayjs().subtract(1, "days").endOf("day"),
196
- ]);
197
- if (rest.onChange) {
198
- rest.onChange({
199
- target: {
200
- value: [
201
- dayjs().subtract(1, "days").startOf("day"),
202
- dayjs().subtract(1, "days").endOf("day"),
203
- ],
204
- } as any,
205
- } as React.ChangeEvent<HTMLInputElement>);
206
- }
207
- }}
208
- >
209
- Yesterday
210
- </button>
211
- <button
212
- type="button"
213
- 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"
214
- disabled={dateRangeLabel(tempValue) === "Last 7 days"}
215
- onClick={() => {
216
- setTempValue([
217
- dayjs().subtract(7, "days").startOf("day"),
218
- dayjs().endOf("day"),
219
- ]);
220
- if (rest.onChange) {
221
- rest.onChange({
222
- target: {
223
- value: [
224
- dayjs().subtract(7, "days").startOf("day"),
225
- dayjs().endOf("day"),
226
- ],
227
- } as any,
228
- } as React.ChangeEvent<HTMLInputElement>);
229
- }
230
- }}
231
- >
232
- Last 7 days
233
- </button>
234
- <button
235
- type="button"
236
- 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"
237
- disabled={dateRangeLabel(tempValue) === "Last 30 days"}
238
- onClick={() => {
239
- setTempValue([
240
- dayjs().subtract(1, "months").startOf("day"),
241
- dayjs().endOf("day"),
242
- ]);
243
- if (rest.onChange) {
244
- rest.onChange({
245
- target: {
246
- value: [
247
- dayjs().subtract(1, "months").startOf("day"),
248
- dayjs().endOf("day"),
249
- ],
250
- } as any,
251
- } as React.ChangeEvent<HTMLInputElement>);
252
- }
253
- }}
254
- >
255
- Last 30 days
256
- </button>
257
- <button
258
- type="button"
259
- 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"
260
- disabled={dateRangeLabel(tempValue) === "Custom"}
261
- onClick={() => {
262
- setTempValue([
263
- dayjs().startOf("day"),
264
- dayjs().add(1, "days").endOf("day"),
265
- ]);
266
- if (rest.onChange) {
267
- rest.onChange({
268
- target: {
269
- value: [
270
- dayjs().add(1, "days").startOf("day"),
271
- dayjs().add(1, "days").endOf("day"),
272
- ],
273
- } as any,
274
- } as React.ChangeEvent<HTMLInputElement>);
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,