x4js 2.3.28 → 2.3.30

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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/aicontext.md +385 -21
  3. package/package.json +8 -3
  4. package/src/components/assets/icons.ts +2 -0
  5. package/src/components/bargraph/bargraph.module.scss +44 -0
  6. package/src/components/bargraph/bargraph.ts +362 -0
  7. package/src/components/base.scss +71 -1
  8. package/src/components/calendar/calendar.module.scss +6 -5
  9. package/src/components/calendar/calendar.ts +14 -8
  10. package/src/components/canvas/canvas.ts +5 -4
  11. package/src/components/carousel/carousel.module.scss +165 -0
  12. package/src/components/carousel/carousel.ts +423 -0
  13. package/src/components/chart/chart.module.scss +8 -0
  14. package/src/components/chart/chart.ts +170 -12
  15. package/src/components/combobox/combobox.module.scss +2 -1
  16. package/src/components/components.ts +3 -0
  17. package/src/components/dialog/dialog.module.scss +2 -0
  18. package/src/components/dialog/dialog.ts +1 -0
  19. package/src/components/gantt/gantt.module.scss +462 -0
  20. package/src/components/gantt/gantt.ts +1254 -0
  21. package/src/components/knob/knob.module.scss +113 -0
  22. package/src/components/knob/knob.ts +355 -0
  23. package/src/components/mapview/mapview.module.scss +177 -0
  24. package/src/components/mapview/mapview.ts +764 -0
  25. package/src/components/menu/menu.module.scss +4 -6
  26. package/src/components/menu/menu.ts +4 -2
  27. package/src/components/planner/planner.module.scss +688 -0
  28. package/src/components/planner/planner.ts +1792 -0
  29. package/src/components/popup/popup.ts +29 -3
  30. package/src/components/radio/radio.module.scss +4 -1
  31. package/src/components/shared.scss +2 -1
  32. package/src/components/slider/slider.module.scss +22 -20
  33. package/src/components/switch/switch.module.scss +68 -44
  34. package/src/components/switch/switch.ts +6 -3
  35. package/src/components/tag/tag.module.scss +4 -4
  36. package/src/components/textedit/textedit.module.scss +5 -2
  37. package/src/components/themes.scss +27 -6
  38. package/src/components/tooltips/tooltips.scss +8 -0
  39. package/src/components/tooltips/tooltips.ts +31 -0
  40. package/src/core/core_i18n.ts +65 -0
  41. package/src/core/core_tools.ts +44 -0
  42. package/src/x4doc.ts +3 -0
  43. package/src/components/menu/caret-right-solid.svg +0 -1
@@ -379,6 +379,23 @@ let fr = {
379
379
  warning: '{0} avertissement',
380
380
  warnings: '{0} avertissements',
381
381
  },
382
+
383
+ carousel: {
384
+ carousel: 'carrousel',
385
+ slide: 'diapositive',
386
+ prev: 'Précédent',
387
+ next: 'Suivant',
388
+ position: '{0} sur {1}',
389
+ },
390
+
391
+ // the titles of the columns of a Gantt, by their id
392
+ gantt: {
393
+ title: 'Tâche',
394
+ start: 'Début',
395
+ end: 'Fin',
396
+ duration: 'Durée',
397
+ progress: 'Avancement',
398
+ },
382
399
  }
383
400
  };
384
401
 
@@ -457,6 +474,22 @@ let en = {
457
474
  warning: '{0} warning',
458
475
  warnings: '{0} warnings',
459
476
  },
477
+
478
+ carousel: {
479
+ carousel: 'carousel',
480
+ slide: 'slide',
481
+ prev: 'Previous',
482
+ next: 'Next',
483
+ position: '{0} of {1}',
484
+ },
485
+
486
+ gantt: {
487
+ title: 'Task',
488
+ start: 'Start',
489
+ end: 'End',
490
+ duration: 'Duration',
491
+ progress: 'Progress',
492
+ },
460
493
  }
461
494
  };
462
495
 
@@ -535,6 +568,22 @@ let es = {
535
568
  warning: '{0} advertencia',
536
569
  warnings: '{0} advertencias',
537
570
  },
571
+
572
+ carousel: {
573
+ carousel: 'carrusel',
574
+ slide: 'diapositiva',
575
+ prev: 'Anterior',
576
+ next: 'Siguiente',
577
+ position: '{0} de {1}',
578
+ },
579
+
580
+ gantt: {
581
+ title: 'Tarea',
582
+ start: 'Inicio',
583
+ end: 'Fin',
584
+ duration: 'Duración',
585
+ progress: 'Progreso',
586
+ },
538
587
  }
539
588
  };
540
589
 
@@ -613,6 +662,22 @@ let de = {
613
662
  warning: '{0} Warnung',
614
663
  warnings: '{0} Warnungen',
615
664
  },
665
+
666
+ carousel: {
667
+ carousel: 'Karussell',
668
+ slide: 'Folie',
669
+ prev: 'Zurück',
670
+ next: 'Weiter',
671
+ position: '{0} von {1}',
672
+ },
673
+
674
+ gantt: {
675
+ title: 'Aufgabe',
676
+ start: 'Beginn',
677
+ end: 'Ende',
678
+ duration: 'Dauer',
679
+ progress: 'Fortschritt',
680
+ },
616
681
  }
617
682
  };
618
683
 
@@ -609,6 +609,31 @@ export function formatMoney( value: number ): string {
609
609
  return numberFormat( "m" + currency, { style: "currency", currency } ).format( value );
610
610
  }
611
611
 
612
+ /**
613
+ * a percent as text in the current locale: 89 gives "89 %" in fr-FR, "89%" in en-US
614
+ * @param value - from 0 to 100, as a column percent of Gridview
615
+ * @param decimals - the most decimals shown
616
+ */
617
+
618
+ export function formatPercent( value: number, decimals = 0 ): string {
619
+ return numberFormat( "p" + decimals, { style: "percent", maximumFractionDigits: decimals } ).format( value / 100 );
620
+ }
621
+
622
+ /**
623
+ * a value and its unit, short, in the current locale: "12 j", "3 h" in fr-FR, "12 days", "3 hr" in en-US
624
+ * @param unit - a unit of Intl: "day", "hour", "minute", "kilometer"...
625
+ * @param decimals - the most decimals shown (Intl: 3 when not given)
626
+ */
627
+
628
+ export function formatUnit( value: number, unit: string, decimals?: number ): string {
629
+ const options: Intl.NumberFormatOptions = { style: "unit", unit, unitDisplay: "short" };
630
+ if( decimals!==undefined ) {
631
+ options.maximumFractionDigits = decimals;
632
+ }
633
+
634
+ return numberFormat( "u" + unit + decimals, options ).format( value );
635
+ }
636
+
612
637
  /**
613
638
  * a date as text in the current locale: "22/10/2026" in fr-FR, "10/22/2026" in en-US
614
639
  */
@@ -714,6 +739,25 @@ export function date_calc_weeknum(date: Date): number {
714
739
  return Math.ceil( ( ( d.getTime( ) - jan1 ) / 86400000 + 1 ) / 7 );
715
740
  }
716
741
 
742
+ /**
743
+ * the monday of the week of a date (the date itself on a monday), at the same time: a new date
744
+ */
745
+
746
+ export function date_week_start( date: Date ): Date {
747
+ return date_add_days( date, -( ( date.getDay( ) + 6 ) % 7 ) ); // monday 0 .. sunday 6
748
+ }
749
+
750
+ /**
751
+ * a date some days after (before when days < 0), at the same time: a new date. A day of 23 or
752
+ * 25 hours (summer time) counts as one
753
+ */
754
+
755
+ export function date_add_days( date: Date, days: number ): Date {
756
+ const result = date_clone( date );
757
+ result.setDate( result.getDate( ) + days );
758
+ return result;
759
+ }
760
+
717
761
 
718
762
 
719
763
  /**
package/src/x4doc.ts CHANGED
@@ -21,3 +21,6 @@
21
21
 
22
22
  export * from "./x4.js"
23
23
  export * from "./components/monaco/monaco.js"
24
+ export * from "./components/gantt/gantt.js"
25
+ export * from "./components/planner/planner.js"
26
+ export * from "./components/mapview/mapview.js"
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" fill="var(--color-gray-8)"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"/></svg>