@esic-lab/data-core-ui 0.0.25 → 0.0.27

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.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference path="../node_modules/dayjs/locale/index.d.ts" />
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import react, { ReactNode } from 'react';
4
3
  import { ColumnsType } from 'antd/es/table';
@@ -221,505 +220,69 @@ interface ColorPickerProps {
221
220
  }
222
221
  declare function ColorPickerBasic({ value, onChange, require, title, bottomText, showError, errorMessage, disabled, allowClear, defaultFormat, className, placeholder }: ColorPickerProps): react_jsx_runtime.JSX.Element;
223
222
 
224
- declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs
225
-
226
- declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs
227
-
228
- declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs
229
-
230
- declare namespace dayjs {
231
- interface ConfigTypeMap {
232
- default: string | number | Date | Dayjs | null | undefined
233
- }
234
-
235
- export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap]
236
-
237
- export interface FormatObject { locale?: string, format?: string, utc?: boolean }
238
-
239
- export type OptionType = FormatObject | string | string[]
240
-
241
- export type UnitTypeShort = 'd' | 'D' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
242
-
243
- export type UnitTypeLong = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date'
244
-
245
- export type UnitTypeLongPlural = 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' | 'dates'
246
-
247
- export type UnitType = UnitTypeLong | UnitTypeLongPlural | UnitTypeShort;
248
-
249
- export type OpUnitType = UnitType | "week" | "weeks" | 'w';
250
- export type QUnitType = UnitType | "quarter" | "quarters" | 'Q';
251
- export type ManipulateType = Exclude<OpUnitType, 'date' | 'dates'>;
252
- class Dayjs {
253
- constructor (config?: ConfigType)
254
- /**
255
- * All Day.js objects are immutable. Still, `dayjs#clone` can create a clone of the current object if you need one.
256
- * ```
257
- * dayjs().clone()// => Dayjs
258
- * dayjs(dayjs('2019-01-25')) // passing a Dayjs object to a constructor will also clone it
259
- * ```
260
- * Docs: https://day.js.org/docs/en/parse/dayjs-clone
261
- */
262
- clone(): Dayjs
263
- /**
264
- * This returns a `boolean` indicating whether the Day.js object contains a valid date or not.
265
- * ```
266
- * dayjs().isValid()// => boolean
267
- * ```
268
- * Docs: https://day.js.org/docs/en/parse/is-valid
269
- */
270
- isValid(): boolean
271
- /**
272
- * Get the year.
273
- * ```
274
- * dayjs().year()// => 2020
275
- * ```
276
- * Docs: https://day.js.org/docs/en/get-set/year
277
- */
278
- year(): number
279
- /**
280
- * Set the year.
281
- * ```
282
- * dayjs().year(2000)// => Dayjs
283
- * ```
284
- * Docs: https://day.js.org/docs/en/get-set/year
285
- */
286
- year(value: number): Dayjs
287
- /**
288
- * Get the month.
289
- *
290
- * Months are zero indexed, so January is month 0.
291
- * ```
292
- * dayjs().month()// => 0-11
293
- * ```
294
- * Docs: https://day.js.org/docs/en/get-set/month
295
- */
296
- month(): number
297
- /**
298
- * Set the month.
299
- *
300
- * Months are zero indexed, so January is month 0.
301
- *
302
- * Accepts numbers from 0 to 11. If the range is exceeded, it will bubble up to the next year.
303
- * ```
304
- * dayjs().month(0)// => Dayjs
305
- * ```
306
- * Docs: https://day.js.org/docs/en/get-set/month
307
- */
308
- month(value: number): Dayjs
309
- /**
310
- * Get the date of the month.
311
- * ```
312
- * dayjs().date()// => 1-31
313
- * ```
314
- * Docs: https://day.js.org/docs/en/get-set/date
315
- */
316
- date(): number
317
- /**
318
- * Set the date of the month.
319
- *
320
- * Accepts numbers from 1 to 31. If the range is exceeded, it will bubble up to the next months.
321
- * ```
322
- * dayjs().date(1)// => Dayjs
323
- * ```
324
- * Docs: https://day.js.org/docs/en/get-set/date
325
- */
326
- date(value: number): Dayjs
327
- /**
328
- * Get the day of the week.
329
- *
330
- * Returns numbers from 0 (Sunday) to 6 (Saturday).
331
- * ```
332
- * dayjs().day()// 0-6
333
- * ```
334
- * Docs: https://day.js.org/docs/en/get-set/day
335
- */
336
- day(): 0 | 1 | 2 | 3 | 4 | 5 | 6
337
- /**
338
- * Set the day of the week.
339
- *
340
- * Accepts numbers from 0 (Sunday) to 6 (Saturday). If the range is exceeded, it will bubble up to next weeks.
341
- * ```
342
- * dayjs().day(0)// => Dayjs
343
- * ```
344
- * Docs: https://day.js.org/docs/en/get-set/day
345
- */
346
- day(value: number): Dayjs
347
- /**
348
- * Get the hour.
349
- * ```
350
- * dayjs().hour()// => 0-23
351
- * ```
352
- * Docs: https://day.js.org/docs/en/get-set/hour
353
- */
354
- hour(): number
355
- /**
356
- * Set the hour.
357
- *
358
- * Accepts numbers from 0 to 23. If the range is exceeded, it will bubble up to the next day.
359
- * ```
360
- * dayjs().hour(12)// => Dayjs
361
- * ```
362
- * Docs: https://day.js.org/docs/en/get-set/hour
363
- */
364
- hour(value: number): Dayjs
365
- /**
366
- * Get the minutes.
367
- * ```
368
- * dayjs().minute()// => 0-59
369
- * ```
370
- * Docs: https://day.js.org/docs/en/get-set/minute
371
- */
372
- minute(): number
373
- /**
374
- * Set the minutes.
375
- *
376
- * Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next hour.
377
- * ```
378
- * dayjs().minute(59)// => Dayjs
379
- * ```
380
- * Docs: https://day.js.org/docs/en/get-set/minute
381
- */
382
- minute(value: number): Dayjs
383
- /**
384
- * Get the seconds.
385
- * ```
386
- * dayjs().second()// => 0-59
387
- * ```
388
- * Docs: https://day.js.org/docs/en/get-set/second
389
- */
390
- second(): number
391
- /**
392
- * Set the seconds.
393
- *
394
- * Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next minutes.
395
- * ```
396
- * dayjs().second(1)// Dayjs
397
- * ```
398
- */
399
- second(value: number): Dayjs
400
- /**
401
- * Get the milliseconds.
402
- * ```
403
- * dayjs().millisecond()// => 0-999
404
- * ```
405
- * Docs: https://day.js.org/docs/en/get-set/millisecond
406
- */
407
- millisecond(): number
408
- /**
409
- * Set the milliseconds.
410
- *
411
- * Accepts numbers from 0 to 999. If the range is exceeded, it will bubble up to the next seconds.
412
- * ```
413
- * dayjs().millisecond(1)// => Dayjs
414
- * ```
415
- * Docs: https://day.js.org/docs/en/get-set/millisecond
416
- */
417
- millisecond(value: number): Dayjs
418
- /**
419
- * Generic setter, accepting unit as first argument, and value as second, returns a new instance with the applied changes.
420
- *
421
- * In general:
422
- * ```
423
- * dayjs().set(unit, value) === dayjs()[unit](value)
424
- * ```
425
- * Units are case insensitive, and support plural and short forms.
426
- * ```
427
- * dayjs().set('date', 1)
428
- * dayjs().set('month', 3) // April
429
- * dayjs().set('second', 30)
430
- * ```
431
- * Docs: https://day.js.org/docs/en/get-set/set
432
- */
433
- set(unit: UnitType, value: number): Dayjs
434
- /**
435
- * String getter, returns the corresponding information getting from Day.js object.
436
- *
437
- * In general:
438
- * ```
439
- * dayjs().get(unit) === dayjs()[unit]()
440
- * ```
441
- * Units are case insensitive, and support plural and short forms.
442
- * ```
443
- * dayjs().get('year')
444
- * dayjs().get('month') // start 0
445
- * dayjs().get('date')
446
- * ```
447
- * Docs: https://day.js.org/docs/en/get-set/get
448
- */
449
- get(unit: UnitType): number
450
- /**
451
- * Returns a cloned Day.js object with a specified amount of time added.
452
- * ```
453
- * dayjs().add(7, 'day')// => Dayjs
454
- * ```
455
- * Units are case insensitive, and support plural and short forms.
456
- *
457
- * Docs: https://day.js.org/docs/en/manipulate/add
458
- */
459
- add(value: number, unit?: ManipulateType): Dayjs
460
- /**
461
- * Returns a cloned Day.js object with a specified amount of time subtracted.
462
- * ```
463
- * dayjs().subtract(7, 'year')// => Dayjs
464
- * ```
465
- * Units are case insensitive, and support plural and short forms.
466
- *
467
- * Docs: https://day.js.org/docs/en/manipulate/subtract
468
- */
469
- subtract(value: number, unit?: ManipulateType): Dayjs
470
- /**
471
- * Returns a cloned Day.js object and set it to the start of a unit of time.
472
- * ```
473
- * dayjs().startOf('year')// => Dayjs
474
- * ```
475
- * Units are case insensitive, and support plural and short forms.
476
- *
477
- * Docs: https://day.js.org/docs/en/manipulate/start-of
478
- */
479
- startOf(unit: OpUnitType): Dayjs
480
- /**
481
- * Returns a cloned Day.js object and set it to the end of a unit of time.
482
- * ```
483
- * dayjs().endOf('month')// => Dayjs
484
- * ```
485
- * Units are case insensitive, and support plural and short forms.
486
- *
487
- * Docs: https://day.js.org/docs/en/manipulate/end-of
488
- */
489
- endOf(unit: OpUnitType): Dayjs
490
- /**
491
- * Get the formatted date according to the string of tokens passed in.
492
- *
493
- * To escape characters, wrap them in square brackets (e.g. [MM]).
494
- * ```
495
- * dayjs().format()// => current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'
496
- * dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]')// 'YYYYescape 2019-01-25T00:00:00-02:00Z'
497
- * dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
498
- * ```
499
- * Docs: https://day.js.org/docs/en/display/format
500
- */
501
- format(template?: string): string
502
- /**
503
- * This indicates the difference between two date-time in the specified unit.
504
- *
505
- * To get the difference in milliseconds, use `dayjs#diff`
506
- * ```
507
- * const date1 = dayjs('2019-01-25')
508
- * const date2 = dayjs('2018-06-05')
509
- * date1.diff(date2) // 20214000000 default milliseconds
510
- * date1.diff() // milliseconds to current time
511
- * ```
512
- *
513
- * To get the difference in another unit of measurement, pass that measurement as the second argument.
514
- * ```
515
- * const date1 = dayjs('2019-01-25')
516
- * date1.diff('2018-06-05', 'month') // 7
517
- * ```
518
- * Units are case insensitive, and support plural and short forms.
519
- *
520
- * Docs: https://day.js.org/docs/en/display/difference
521
- */
522
- diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
523
- /**
524
- * This returns the number of **milliseconds** since the Unix Epoch of the Day.js object.
525
- * ```
526
- * dayjs('2019-01-25').valueOf() // 1548381600000
527
- * +dayjs(1548381600000) // 1548381600000
528
- * ```
529
- * To get a Unix timestamp (the number of seconds since the epoch) from a Day.js object, you should use Unix Timestamp `dayjs#unix()`.
530
- *
531
- * Docs: https://day.js.org/docs/en/display/unix-timestamp-milliseconds
532
- */
533
- valueOf(): number
534
- /**
535
- * This returns the Unix timestamp (the number of **seconds** since the Unix Epoch) of the Day.js object.
536
- * ```
537
- * dayjs('2019-01-25').unix() // 1548381600
538
- * ```
539
- * This value is floored to the nearest second, and does not include a milliseconds component.
540
- *
541
- * Docs: https://day.js.org/docs/en/display/unix-timestamp
542
- */
543
- unix(): number
544
- /**
545
- * Get the number of days in the current month.
546
- * ```
547
- * dayjs('2019-01-25').daysInMonth() // 31
548
- * ```
549
- * Docs: https://day.js.org/docs/en/display/days-in-month
550
- */
551
- daysInMonth(): number
552
- /**
553
- * To get a copy of the native `Date` object parsed from the Day.js object use `dayjs#toDate`.
554
- * ```
555
- * dayjs('2019-01-25').toDate()// => Date
556
- * ```
557
- */
558
- toDate(): Date
559
- /**
560
- * To serialize as an ISO 8601 string.
561
- * ```
562
- * dayjs('2019-01-25').toJSON() // '2019-01-25T02:00:00.000Z'
563
- * ```
564
- * Docs: https://day.js.org/docs/en/display/as-json
565
- */
566
- toJSON(): string
567
- /**
568
- * To format as an ISO 8601 string.
569
- * ```
570
- * dayjs('2019-01-25').toISOString() // '2019-01-25T02:00:00.000Z'
571
- * ```
572
- * Docs: https://day.js.org/docs/en/display/as-iso-string
573
- */
574
- toISOString(): string
575
- /**
576
- * Returns a string representation of the date.
577
- * ```
578
- * dayjs('2019-01-25').toString() // 'Fri, 25 Jan 2019 02:00:00 GMT'
579
- * ```
580
- * Docs: https://day.js.org/docs/en/display/as-string
581
- */
582
- toString(): string
583
- /**
584
- * Get the UTC offset in minutes.
585
- * ```
586
- * dayjs().utcOffset()
587
- * ```
588
- * Docs: https://day.js.org/docs/en/manipulate/utc-offset
589
- */
590
- utcOffset(): number
591
- /**
592
- * This indicates whether the Day.js object is before the other supplied date-time.
593
- * ```
594
- * dayjs().isBefore(dayjs('2011-01-01')) // default milliseconds
595
- * ```
596
- * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
597
- * ```
598
- * dayjs().isBefore('2011-01-01', 'year')// => boolean
599
- * ```
600
- * Units are case insensitive, and support plural and short forms.
601
- *
602
- * Docs: https://day.js.org/docs/en/query/is-before
603
- */
604
- isBefore(date?: ConfigType, unit?: OpUnitType): boolean
605
- /**
606
- * This indicates whether the Day.js object is the same as the other supplied date-time.
607
- * ```
608
- * dayjs().isSame(dayjs('2011-01-01')) // default milliseconds
609
- * ```
610
- * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
611
- * ```
612
- * dayjs().isSame('2011-01-01', 'year')// => boolean
613
- * ```
614
- * Docs: https://day.js.org/docs/en/query/is-same
615
- */
616
- isSame(date?: ConfigType, unit?: OpUnitType): boolean
617
- /**
618
- * This indicates whether the Day.js object is after the other supplied date-time.
619
- * ```
620
- * dayjs().isAfter(dayjs('2011-01-01')) // default milliseconds
621
- * ```
622
- * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
623
- * ```
624
- * dayjs().isAfter('2011-01-01', 'year')// => boolean
625
- * ```
626
- * Units are case insensitive, and support plural and short forms.
627
- *
628
- * Docs: https://day.js.org/docs/en/query/is-after
629
- */
630
- isAfter(date?: ConfigType, unit?: OpUnitType): boolean
631
-
632
- locale(): string
633
-
634
- locale(preset: string | ILocale, object?: Partial<ILocale>): Dayjs
635
- }
636
-
637
- export type PluginFunc<T = unknown> = (option: T, c: typeof Dayjs, d: typeof dayjs) => void
638
-
639
- export function extend<T = unknown>(plugin: PluginFunc<T>, option?: T): Dayjs
640
-
641
- export function locale(preset?: string | ILocale, object?: Partial<ILocale>, isLocal?: boolean): string
642
-
643
- export function isDayjs(d: any): d is Dayjs
644
-
645
- export function unix(t: number): Dayjs
646
-
647
- const Ls : { [key: string] : ILocale }
648
- }
649
-
650
- type Dayjs$2 = dayjs.Dayjs;
651
-
652
223
  interface DatePickerBasicProps {
653
- value: Dayjs$2 | null;
654
- onChange: (day: Dayjs$2 | null) => void;
655
- require?: boolean;
656
- title?: string;
657
- bottomText?: string;
658
- showError?: boolean;
659
- errorMessage?: string;
224
+ value: Date | null;
225
+ onChange: (date: Date | null) => void;
226
+ required?: boolean;
227
+ label?: string;
228
+ error?: string;
660
229
  placeholder?: string;
661
230
  disabled?: boolean;
662
- defaultValue?: Dayjs$2 | null;
231
+ defaultValue?: Date | null;
663
232
  mode?: "time" | "date" | "month";
664
- minDate?: Dayjs$2 | undefined;
665
- maxDate?: Dayjs$2 | undefined;
666
- disabledDate?: (currentDate: Dayjs$2) => boolean;
233
+ minDate?: Date;
234
+ maxDate?: Date;
235
+ disabledDate?: (currentDate: Date) => boolean;
667
236
  className?: string;
668
237
  size?: "small" | "middle" | "large";
669
238
  }
670
- declare function DatePickerBasic({ value, onChange, require, title, bottomText, showError, errorMessage, placeholder, disabled, defaultValue, minDate, maxDate, disabledDate, className, size, }: DatePickerBasicProps): react_jsx_runtime.JSX.Element;
239
+ declare function DatePickerBasic({ value, onChange, required, label, error, placeholder, disabled, defaultValue, minDate, maxDate, disabledDate, className, size, }: DatePickerBasicProps): react_jsx_runtime.JSX.Element;
671
240
 
672
- type Dayjs$1 = dayjs.Dayjs;
673
241
  interface DatePickerRangePickerProps {
674
- value: [dayjs.Dayjs | null, dayjs.Dayjs | null] | null;
675
- onChange: (val: [dayjs.Dayjs | null, dayjs.Dayjs | null] | null) => void;
242
+ value: [Date | null, Date | null] | null;
243
+ onChange: (val: [Date | null, Date | null] | null) => void;
676
244
  placeholder?: [string, string];
677
- title?: string;
678
- require?: boolean;
679
- bottomText?: string;
680
- showError?: boolean;
681
- errorMessage?: string;
245
+ label?: string;
246
+ required?: boolean;
247
+ error?: string;
682
248
  disabled?: boolean;
683
- defaultValue?: [Dayjs$1, Dayjs$1] | null;
249
+ defaultValue?: [Date, Date] | null;
684
250
  mode?: "time" | "date" | "month";
685
- minDate?: Dayjs$1 | undefined;
686
- maxDate?: Dayjs$1 | undefined;
687
- disabledDate?: (currentDate: Dayjs$1) => boolean;
251
+ minDate?: Date | undefined;
252
+ maxDate?: Date | undefined;
253
+ disabledDate?: (currentDate: Date) => boolean;
688
254
  size?: "small" | "middle" | "large";
689
255
  className?: string;
690
256
  onOpenChange?: (open: boolean) => void;
691
- onCalendarChange?: (dates: [Dayjs$1 | null, Dayjs$1 | null], dateStrings: [string, string], info: any) => void;
257
+ onCalendarChange?: (dates: [Date | null, Date | null], dateStrings: [string, string], info: any) => void;
692
258
  }
693
- declare function DatePickerRangePicker({ value, onChange, placeholder, title, require, bottomText, showError, errorMessage, disabled, minDate, maxDate, disabledDate, size, className, onOpenChange, onCalendarChange, }: DatePickerRangePickerProps): react_jsx_runtime.JSX.Element;
259
+ declare function DatePickerRangePicker({ value, onChange, placeholder, label, required, error, disabled, minDate, maxDate, disabledDate, size, className, onOpenChange, onCalendarChange, }: DatePickerRangePickerProps): react_jsx_runtime.JSX.Element;
694
260
 
695
- type Dayjs = dayjs.Dayjs;
696
261
  interface TimePickerBasicProps {
697
- value: Dayjs | null;
698
- onChange: (time: Dayjs | null) => void;
699
- require?: boolean;
700
- title?: string;
262
+ value: Date | null;
263
+ onChange: (time: Date | null) => void;
264
+ required?: boolean;
265
+ label?: string;
701
266
  bottomText?: string;
702
267
  showError?: boolean;
703
- errorMessage?: string;
268
+ error?: string;
704
269
  placeholder?: string;
705
270
  disabled?: boolean;
706
271
  className?: string;
707
272
  }
708
- declare function TimePickerBasic({ value, onChange, require, title, bottomText, showError, errorMessage, placeholder, disabled, className }: TimePickerBasicProps): react_jsx_runtime.JSX.Element;
273
+ declare function TimePickerBasic({ value, onChange, required, label, error, placeholder, disabled, className, }: TimePickerBasicProps): react_jsx_runtime.JSX.Element;
709
274
 
710
275
  interface TimePickerRangePickerProps {
711
- value: [dayjs.Dayjs | null, dayjs.Dayjs | null] | null;
712
- onChange: (val: [dayjs.Dayjs | null, dayjs.Dayjs | null] | null) => void;
276
+ value: [Date | null, Date | null] | null;
277
+ onChange: (val: [Date | null, Date | null] | null) => void;
713
278
  placeholder?: [string, string];
714
- title?: string;
715
- require?: boolean;
716
- bottomText?: string;
717
- showError?: boolean;
718
- errorMessage?: string;
279
+ label?: string;
280
+ required?: boolean;
281
+ error?: string;
719
282
  disabled?: boolean;
720
283
  className?: string;
721
284
  }
722
- declare function TimePickerRangePicker({ value, onChange, placeholder, title, require, bottomText, showError, errorMessage, disabled, className }: TimePickerRangePickerProps): react_jsx_runtime.JSX.Element;
285
+ declare function TimePickerRangePicker({ value, onChange, placeholder, label, required, error, disabled, className, }: TimePickerRangePickerProps): react_jsx_runtime.JSX.Element;
723
286
 
724
287
  interface ColorPalettePickerBasicProps {
725
288
  value: string | null;