@economic/taco 2.15.0 → 2.16.0

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 (75) hide show
  1. package/dist/components/Drawer/Drawer.d.ts +5 -1
  2. package/dist/components/Provider/Localization.d.ts +19 -0
  3. package/dist/components/SearchInput2/SearchInput2.d.ts +1 -0
  4. package/dist/components/Table3/components/alert/ErrorAlert.d.ts +10 -0
  5. package/dist/components/Table3/components/columns/cell/DisplayCell.d.ts +5 -2
  6. package/dist/components/Table3/components/columns/cell/EditingCell.d.ts +3 -0
  7. package/dist/components/Table3/components/columns/cell/Highlight.d.ts +2 -0
  8. package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
  9. package/dist/components/Table3/components/rows/Row.d.ts +2 -0
  10. package/dist/components/Table3/components/rows/RowContext.d.ts +1 -0
  11. package/dist/components/Table3/hooks/features/useEditing.d.ts +12 -11
  12. package/dist/components/Table3/hooks/features/usePauseShortcuts.d.ts +5 -0
  13. package/dist/components/Table3/hooks/features/useSearch.d.ts +2 -0
  14. package/dist/components/Table3/hooks/features/useValidation.d.ts +13 -0
  15. package/dist/components/Table3/hooks/useTable.d.ts +4 -0
  16. package/dist/components/Table3/types.d.ts +26 -1
  17. package/dist/components/Table3/util/editing.d.ts +6 -0
  18. package/dist/esm/index.css +108 -33
  19. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +7 -2
  20. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
  21. package/dist/esm/packages/taco/src/components/Provider/Localization.js +19 -0
  22. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  23. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +4 -0
  24. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
  25. package/dist/esm/packages/taco/src/components/Table3/Table3.js +7 -1
  26. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  27. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +154 -0
  28. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -0
  29. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +51 -6
  30. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +1 -1
  31. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +7 -55
  32. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
  33. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +69 -37
  34. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  35. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +17 -17
  36. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  37. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js +41 -0
  38. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js.map +1 -0
  39. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +21 -12
  40. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
  41. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +1 -1
  42. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +1 -1
  43. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +57 -17
  44. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
  45. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +39 -31
  46. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
  47. package/dist/esm/packages/taco/src/components/Table3/components/rows/RowContext.js +2 -1
  48. package/dist/esm/packages/taco/src/components/Table3/components/rows/RowContext.js.map +1 -1
  49. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +8 -1
  50. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
  51. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +48 -1
  52. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
  53. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js +185 -101
  54. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js.map +1 -1
  55. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseShortcuts.js +12 -0
  56. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseShortcuts.js.map +1 -0
  57. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js +4 -1
  58. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js.map +1 -1
  59. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useValidation.js +178 -0
  60. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useValidation.js.map +1 -0
  61. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +1 -1
  62. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
  63. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +8 -2
  64. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
  65. package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js +1 -1
  66. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  67. package/dist/esm/packages/taco/src/components/Table3/util/editing.js +21 -1
  68. package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
  69. package/dist/index.css +108 -33
  70. package/dist/taco.cjs.development.js +2605 -1970
  71. package/dist/taco.cjs.development.js.map +1 -1
  72. package/dist/taco.cjs.production.min.js +1 -1
  73. package/dist/taco.cjs.production.min.js.map +1 -1
  74. package/package.json +2 -2
  75. package/types.json +10973 -7880
package/dist/index.css CHANGED
@@ -705,94 +705,108 @@
705
705
  }
706
706
 
707
707
  /* normal rows */
708
- [role='row']:not([data-selected='true']):not([data-error='true']) [role='cell'] {
708
+ [role='row']:not([data-selected='true']):not([data-invalid='true']) [role='cell'] {
709
709
  @apply bg-white;
710
710
  }
711
- [role='row']:not([data-selected='true']):not([data-error='true']):hover [role='cell'] {
711
+ [role='row']:not([data-selected='true']):not([data-invalid='true']):hover [role='cell'] {
712
712
  --table3-row-actions-shadow: theme(colors.grey.100);
713
713
  @apply bg-grey-100;
714
714
  }
715
- [role='row']:not([data-selected='true']):not([data-error='true'])[data-current='true'] [role='cell'] {
715
+ [role='row']:not([data-selected='true']):not([data-invalid='true'])[data-current='true'] [role='cell'] {
716
716
  --table3-row-actions-shadow: theme(colors.grey.100);
717
717
  @apply bg-grey-100;
718
718
  }
719
- [role='row']:not([data-selected='true']):not([data-error='true'])[data-current='true']:hover [role='cell'] {
719
+ [role='row']:not([data-selected='true']):not([data-invalid='true'])[data-current='true']:hover [role='cell'] {
720
720
  --table3-row-actions-shadow: theme(colors.grey.100);
721
721
  @apply bg-grey-100;
722
722
  }
723
+ /* Fields shouldn’t have white background when not in current row and hovered*/
724
+ [role='row']:not([data-selected='true']):not([data-invalid='true'])[data-current='false']:hover [role='cell'] .bg-white {
725
+ @apply !bg-grey-100;
726
+ }
723
727
  /* normal rows when focus is inside the table */
724
728
  [data-taco='table2']:focus-within
725
- [role='row'][data-current='true']:not([data-selected='true']):not([data-error='true'])
729
+ [role='row'][data-current='true']:not([data-selected='true']):not([data-invalid='true'])
726
730
  [role='cell'] {
727
731
  --table3-row-actions-shadow: theme(colors.grey.200);
728
732
  @apply bg-grey-200;
729
733
  }
730
734
  /* normal rows when hover is paused */
731
- [data-pause-hover='true'] [role='row']:not([data-selected='true']):not([data-error='true']):hover:not([data-current='true']) [role='cell'] {
735
+ [data-pause-hover='true'] [role='row']:not([data-selected='true']):not([data-invalid='true']):hover:not([data-current='true']) [role='cell'] {
732
736
  --table3-row-actions-shadow: theme(colors.white);
733
737
  @apply !bg-white;
734
738
  }
735
- [data-pause-hover='true'] [role='row']:not([data-selected='true']):not([data-error='true']):hover[data-current='true'] [role='cell'] {
739
+ [data-pause-hover='true'] [role='row']:not([data-selected='true']):not([data-invalid='true']):hover[data-current='true'] [role='cell'] {
736
740
  --table3-row-actions-shadow: theme(colors.grey.200);
737
741
  @apply !bg-grey-200;
738
742
  }
739
743
 
740
744
  /* selected rows */
741
- [role='row'][data-selected='true']:not([data-error='true']) [role='cell'] {
745
+ [role='row'][data-selected='true']:not([data-invalid='true']) [role='cell'] {
742
746
  @apply bg-blue-100;
743
747
  }
744
- [role='row'][data-selected='true']:not([data-error='true']):hover [role='cell'] {
748
+ [role='row'][data-selected='true']:not([data-invalid='true']):hover [role='cell'] {
745
749
  --table3-row-actions-shadow: #d6e3f6;
746
750
  @apply bg-[#D6E3F6];
747
751
  }
748
- [role='row'][data-selected='true']:not([data-error='true'])[data-current='true']:hover [role='cell'],
752
+ [role='row'][data-selected='true']:not([data-invalid='true'])[data-current='true']:hover [role='cell'],
749
753
 
750
- [role='row'][data-selected='true']:not([data-error='true'])[data-current='true'] [role='cell'] {
754
+ [role='row'][data-selected='true']:not([data-invalid='true'])[data-current='true'] [role='cell'] {
751
755
  --table3-row-actions-shadow: #d6e3f6;
752
756
  @apply bg-[#D6E3F6];
753
757
  }
754
758
  /* selected rows when focus is inside the table */
755
- [data-taco='table2']:focus-within [role='row'][data-current='true'][data-selected='true']:not([data-error='true']) [role='cell'] {
759
+ [data-taco='table2']:focus-within
760
+ [role='row'][data-current='true'][data-selected='true']:not([data-invalid='true'])
761
+ [role='cell'] {
756
762
  --table3-row-actions-shadow: #ccd8eb;
757
763
  @apply bg-[#CCD8EB];
758
764
  }
759
765
  /* selected rows when hover is paused */
760
- [data-pause-hover='true'] [role='row'][data-selected='true']:not([data-error='true']):hover:not([data-current='true']) [role='cell'] {
766
+ [data-pause-hover='true'] [role='row'][data-selected='true']:not([data-invalid='true']):hover:not([data-current='true']) [role='cell'] {
761
767
  --table3-row-actions-shadow: theme(colors.blue.100);
762
768
  @apply !bg-blue-100;
763
769
  }
764
- [data-pause-hover='true'] [role='row'][data-selected='true']:not([data-error='true']):hover[data-current='true'] [role='cell'] {
770
+ [data-pause-hover='true'] [role='row'][data-selected='true']:not([data-invalid='true']):hover[data-current='true'] [role='cell'] {
765
771
  --table3-row-actions-shadow: #ccd8eb;
766
772
  @apply !bg-[#CCD8EB];
767
773
  }
768
774
 
769
775
  /* error rows */
770
- [role='row'][data-error='true'] [role='cell'] {
776
+ [role='row'][data-invalid='true'] [role='cell'] {
771
777
  @apply bg-[#FFEDE9];
772
778
  }
773
- [role='row'][data-error='true']:hover [role='cell'] {
779
+ [role='row'][data-invalid='true']:hover [role='cell'] {
774
780
  --table3-row-actions-shadow: #ffe4de;
775
781
  @apply bg-[#FFE4DE];
776
782
  }
777
- [role='row'][data-error='true'][data-current='true'] [role='cell'] {
783
+ [role='row'][data-invalid='true'][data-current='true'] [role='cell'] {
778
784
  --table3-row-actions-shadow: theme(colors.red.100);
779
785
  @apply bg-red-100;
780
786
  }
781
- [role='row'][data-error='true'][data-current='true']:hover [role='cell'] {
787
+ [role='row'][data-invalid='true'][data-current='true']:hover [role='cell'] {
782
788
  --table3-row-actions-shadow: #ffe4de;
783
789
  @apply bg-[#FFE4DE];
784
790
  }
791
+ /* Fields with errors shouldn’t have white background when not in current row */
792
+ [role='row'][data-invalid='true'][data-current='false'] [role='cell'] .bg-white {
793
+ @apply !bg-[#FFEDE9];
794
+ }
795
+ /* Request from UX: In error state, input backgroud color should be the same as row background color */
796
+ [role='row'][data-invalid='true'][data-current='false']:hover [role='cell'] .bg-white {
797
+ @apply !bg-[#FFE4DE];
798
+ }
785
799
  /* error rows when focus is inside the table */
786
- [data-taco='table2']:focus-within [role='row'][data-current='true'][data-error='true'] [role='cell'] {
800
+ [data-taco='table2']:focus-within [role='row'][data-current='true'][data-invalid='true'] [role='cell'] {
787
801
  --table3-row-actions-shadow: theme(colors.red.100);
788
802
  @apply bg-red-100;
789
803
  }
790
804
  /* error rows when hover is paused */
791
- [data-pause-hover='true'] [role='row'][data-error='true']:hover:not([data-current='true']) [role='cell'] {
805
+ [data-pause-hover='true'] [role='row'][data-invalid='true']:hover:not([data-current='true']) [role='cell'] {
792
806
  --table3-row-actions-shadow: #ffede9;
793
807
  @apply !bg-[#FFEDE9];
794
808
  }
795
- [data-pause-hover='true'] [role='row'][data-error='true']:hover[data-current='true'] [role='cell'] {
809
+ [data-pause-hover='true'] [role='row'][data-invalid='true']:hover[data-current='true'] [role='cell'] {
796
810
  --table3-row-actions-shadow: theme(colors.red.100);
797
811
  @apply !bg-red-100;
798
812
  }
@@ -806,6 +820,12 @@
806
820
  @apply !wcag-blue-500;
807
821
  }
808
822
 
823
+ /* error row */
824
+ /*!!!!*/
825
+ [data-taco='table2-body'] [role='row'][data-invalid='true'] [role='cell'] {
826
+ /*@apply !bg-[#FFF5F2];*/
827
+ }
828
+
809
829
  /* cell component overrides */
810
830
 
811
831
  /* small font size */
@@ -824,7 +844,9 @@
824
844
  }
825
845
 
826
846
  [data-font-size='small'] [role='cell'] [data-taco='badge'],
827
- [data-font-size='small'] [role='cell'] [data-taco='badge-icon'] {
847
+ [data-font-size='small'] [role='cell'] [data-taco='badge-icon'],
848
+ [data-font-size='small'] [role='cell'] [data-taco='icon'],
849
+ [data-font-size='small'] [role='cell'] [data-taco='spinner'] {
828
850
  @apply !-my-0.5 !text-xs;
829
851
  }
830
852
 
@@ -832,11 +854,21 @@
832
854
  @apply !-my-1;
833
855
  }
834
856
 
835
- [data-font-size='small'] [role='cell'] [data-taco='input-container'],
836
- [data-font-size='small'] [role='cell'] [data-taco='Select2'] {
857
+ [data-font-size='small'] [role='cell'] [data-taco='Select2'],
858
+ [data-font-size='small'] [role='cell'] [data-taco='input-container'] {
837
859
  @apply !-my-[3px];
838
860
  }
839
861
 
862
+ /* from validation */
863
+ [data-font-size='small'] [role='row'][data-invalid='true'] [role='cell'] [data-taco='Select2'],
864
+ [data-font-size='small'] [role='row'][data-invalid='true'] [role='cell'] [data-taco='input-container'],
865
+ [data-font-size='small'] [role='row'] [role='cell'][data-invalid='true'] [data-taco='Select2'],
866
+ [data-font-size='small'] [role='row'] [role='cell'][data-invalid='true'] [data-taco='input-container'] {
867
+ @apply !-mt-1;
868
+ @apply !mb-0;
869
+ }
870
+ /*---*/
871
+
840
872
  [data-font-size='small'] [role='cell'] [data-taco='input'],
841
873
  [data-font-size='small'] [role='cell'] [data-taco='Select2'],
842
874
  [data-font-size='small'] [role='cell'] [data-taco='textarea'] {
@@ -863,9 +895,18 @@
863
895
  @apply !my-0;
864
896
  }
865
897
 
866
- [data-font-size='small'] [role='cell'][data-editable] {
867
- @apply px-[calc(var(--table3-cell-padding-x)_-_6px)];
868
- }
898
+ /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself */
899
+
900
+ [data-font-size='small'] [role='cell'][data-editable]:not([data-highlighted='true']) {
901
+ @apply px-[calc(var(--table3-cell-padding-x)_-_6px)];
902
+ }
903
+
904
+ /* When cell is editable and highlighted, the padding should apply to highlight wrapper,
905
+ because it should take all the available space in the cell */
906
+
907
+ [data-font-size='small'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
908
+ @apply px-[calc(var(--table3-cell-padding-x)_-_6px)];
909
+ }
869
910
 
870
911
  [data-font-size='small'] [role='cell'][data-editable] [data-taco='checkbox'],
871
912
  [data-font-size='small'] [role='cell'][data-editable] [data-taco='checkbox-container'],
@@ -893,9 +934,18 @@
893
934
  @apply !-my-[5px];
894
935
  }
895
936
 
896
- [data-font-size='medium'] [role='cell'][data-editable] {
897
- @apply px-[calc(var(--table3-cell-padding-x)_-_8px)];
898
- }
937
+ /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself */
938
+
939
+ [data-font-size='medium'] [role='cell'][data-editable]:not([data-highlighted='true']) {
940
+ @apply px-[calc(var(--table3-cell-padding-x)_-_8px)];
941
+ }
942
+
943
+ /* When cell is editable and highlighted, the padding should apply to highlight wrapper,
944
+ because it should take all the available space in the cell */
945
+
946
+ [data-font-size='medium'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
947
+ @apply px-[calc(var(--table3-cell-padding-x)_-_8px)];
948
+ }
899
949
 
900
950
  [data-font-size='medium'] [role='cell'][data-editable] [data-taco='checkbox'],
901
951
  [data-font-size='medium'] [role='cell'][data-editable] [data-taco='checkbox-container'],
@@ -904,6 +954,14 @@
904
954
  @apply !mx-[calc(var(--table3-cell-padding-x)_-_3px)] !mt-px;
905
955
  }
906
956
 
957
+ [data-font-size='medium'] [role='row'][data-invalid='true'] [role='cell'] [data-taco='Select2'],
958
+ [data-font-size='medium'] [role='row'][data-invalid='true'] [role='cell'] [data-taco='input-container'],
959
+ [data-font-size='medium'] [role='row'] [role='cell'][data-invalid='true'] [data-taco='Select2'],
960
+ [data-font-size='medium'] [role='row'] [role='cell'][data-invalid='true'] [data-taco='input-container'] {
961
+ @apply !-mt-1.5;
962
+ @apply !mb-0;
963
+ }
964
+
907
965
  /* large font size */
908
966
  [data-font-size='large'] [role='cell'] > [data-taco='button'],
909
967
  [data-font-size='large'] [role='cell'] > [data-taco='icon-button'] {
@@ -923,6 +981,14 @@
923
981
  @apply !-my-[7.5px];
924
982
  }
925
983
 
984
+ [data-font-size='large'] [role='row'][data-invalid='true'] [role='cell'] [data-taco='Select2'],
985
+ [data-font-size='large'] [role='row'][data-invalid='true'] [role='cell'] [data-taco='input-container'],
986
+ [data-font-size='large'] [role='row'] [role='cell'][data-invalid='true'] [data-taco='Select2'],
987
+ [data-font-size='large'] [role='row'] [role='cell'][data-invalid='true'] [data-taco='input-container'] {
988
+ @apply !-mt-2;
989
+ @apply !mb-0;
990
+ }
991
+
926
992
  [data-font-size='large'] [role='cell'] [data-taco='input'],
927
993
  [data-font-size='large'] [role='cell'] [data-taco='Select2'],
928
994
  [data-font-size='large'] [role='cell'] [data-taco='textarea'] {
@@ -937,9 +1003,18 @@
937
1003
  @apply !h-6 !w-6;
938
1004
  }
939
1005
 
940
- [data-font-size='large'] [role='cell'][data-editable] {
941
- @apply px-[calc(var(--table3-cell-padding-x)_-_10px)];
942
- }
1006
+ /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself */
1007
+
1008
+ [data-font-size='large'] [role='cell'][data-editable]:not([data-highlighted='true']) {
1009
+ @apply px-[calc(var(--table3-cell-padding-x)_-_10px)];
1010
+ }
1011
+
1012
+ /* When cell is editable and highlighted, the padding should apply to highlight wrapper,
1013
+ because it should take all the available space in the cell */
1014
+
1015
+ [data-font-size='large'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
1016
+ @apply px-[calc(var(--table3-cell-padding-x)_-_10px)];
1017
+ }
943
1018
 
944
1019
  [data-font-size='large'] [role='cell'][data-editable] [data-taco='checkbox'],
945
1020
  [data-font-size='large'] [role='cell'][data-editable] [data-taco='checkbox-container'],