@economic/taco 2.28.1 → 2.29.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/dist/components/Icon/components/Phone.d.ts +3 -0
  2. package/dist/components/Icon/components/index.d.ts +1 -1
  3. package/dist/components/Input/Input.d.ts +1 -1
  4. package/dist/components/List/components/Item.d.ts +1 -1
  5. package/dist/components/Menu/components/Item.d.ts +1 -1
  6. package/dist/components/Menu/components/Link.d.ts +1 -1
  7. package/dist/components/Navigation2/components/Link.d.ts +1 -1
  8. package/dist/components/Select2/components/Option.d.ts +2 -2
  9. package/dist/components/Select2/components/Search.d.ts +1 -1
  10. package/dist/components/Tag/Tag.d.ts +1 -1
  11. package/dist/esm/index.css +11 -7
  12. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +59 -43
  13. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +1 -1
  15. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/Icon/components/Phone.js +17 -0
  17. package/dist/esm/packages/taco/src/components/Icon/components/Phone.js.map +1 -0
  18. package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
  19. package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
  20. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +1 -1
  21. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
  22. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +9 -2
  23. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +4 -1
  25. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
  26. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js +3 -7
  27. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
  28. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +1 -1
  29. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
  30. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +11 -9
  31. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
  32. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +7 -6
  33. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
  34. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js +4 -2
  35. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
  36. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +9 -8
  37. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
  38. package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js +2 -2
  39. package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js.map +1 -1
  40. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +7 -1
  41. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
  42. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +15 -11
  43. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  44. package/dist/esm/packages/taco/src/utils/date.js +3 -3
  45. package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
  46. package/dist/index.css +11 -7
  47. package/dist/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.d.ts +1 -3
  48. package/dist/primitives/Table/Core/util/rows.d.ts +1 -1
  49. package/dist/primitives/Table/useTableManager/util/columns.d.ts +1 -1
  50. package/dist/taco.cjs.development.js +146 -94
  51. package/dist/taco.cjs.development.js.map +1 -1
  52. package/dist/taco.cjs.production.min.js +1 -1
  53. package/dist/taco.cjs.production.min.js.map +1 -1
  54. package/dist/utils/date.d.ts +1 -1
  55. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sources":["../../../../../../src/utils/date.ts"],"sourcesContent":["import { isDate, toDate, isValid } from 'date-fns';\n\nexport const isWeakEqual = (leftDate: Date, rightDate: Date) => {\n return (\n leftDate.getFullYear() === rightDate.getFullYear() &&\n leftDate.getMonth() === rightDate.getMonth() &&\n leftDate.getDay() === rightDate.getDay()\n );\n};\n\nexport const format = (date: Date | undefined, mask = 'dd.mm.yy'): string | undefined => {\n if (!date) {\n return undefined;\n }\n\n const value = isDate(date) ? date : toDate(date);\n\n if (!isValid(value)) {\n return undefined;\n }\n\n const pad = (v: number): string => (String(v).length === 1 ? `0${v}` : v.toString());\n\n return mask\n .replace('dd', pad(value.getDate()))\n .replace('mm', pad(value.getMonth() + 1))\n .replace('yy', String(value.getFullYear()).slice(2));\n};\n\nexport const parseFromCustomString = (\n date = '',\n mask = 'dd.mm.yy',\n defaultYear: number | undefined = undefined\n): Date | undefined => {\n if (!date || !date.length) {\n return undefined;\n }\n\n const sanitizedMask = mask.split(/[^dmy]/);\n const dd = sanitizedMask.findIndex(x => x === 'dd');\n const mm = sanitizedMask.findIndex(x => x === 'mm');\n const yy = sanitizedMask.findIndex(x => x === 'yy' || x === 'yyyy');\n\n let day;\n let month;\n let year;\n\n const getFullYear = (y: string): string => {\n if (y && y.length === 2) {\n const z = Number.parseInt(y, 10);\n\n return z > 50 ? `19${y}` : `20${y}`;\n }\n\n return y;\n };\n\n const inputParts = date.split(/\\D/);\n\n if (inputParts.length === 1) {\n const fullDate = inputParts[0];\n const unseparatedMask = mask.replace(/[^dmy]/g, '');\n\n day = fullDate.slice(unseparatedMask.indexOf('d'), unseparatedMask.lastIndexOf('d') + 1);\n month = fullDate.slice(unseparatedMask.indexOf('m'), unseparatedMask.lastIndexOf('m') + 1);\n year = getFullYear(fullDate.slice(unseparatedMask.indexOf('y'), unseparatedMask.lastIndexOf('y') + 3)); // account for full years\n } else {\n day = inputParts[dd];\n month = inputParts[mm];\n year = getFullYear(inputParts[yy]);\n }\n\n day = Number.parseInt(day, 10);\n month = Number.parseInt(month, 10);\n year = Number.parseInt(year, 10);\n\n const currentDate = new Date();\n\n return new Date(\n /* year */ Object.is(year, NaN) ? defaultYear ?? currentDate.getFullYear() : year,\n /* month */ Object.is(month, NaN) ? currentDate.getMonth() : month - 1, // months are zero based in javascript, so subtract a day\n /* day */ Object.is(day, NaN) ? currentDate.getDate() : day,\n /* hours */ 12,\n /* minutes */ 0 // set to midday to avoid UTC offset causing dates to be mismatched server side\n );\n};\n\nexport const parseFromISOString = (date: string): Date | undefined => {\n const tempDate = new Date(date);\n return isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;\n};\n"],"names":["isWeakEqual","leftDate","rightDate","getFullYear","getMonth","getDay","format","date","mask","undefined","value","isDate","toDate","isValid","pad","v","String","length","toString","replace","getDate","slice","parseFromCustomString","defaultYear","sanitizedMask","split","dd","findIndex","x","mm","yy","day","month","year","y","z","Number","parseInt","inputParts","fullDate","unseparatedMask","indexOf","lastIndexOf","currentDate","Date","Object","is","NaN","parseFromISOString","tempDate"],"mappings":";;MAEaA,WAAW,GAAGA,CAACC,QAAc,EAAEC,SAAe;EACvD,OACID,QAAQ,CAACE,WAAW,EAAE,KAAKD,SAAS,CAACC,WAAW,EAAE,IAClDF,QAAQ,CAACG,QAAQ,EAAE,KAAKF,SAAS,CAACE,QAAQ,EAAE,IAC5CH,QAAQ,CAACI,MAAM,EAAE,KAAKH,SAAS,CAACG,MAAM,EAAE;AAEhD;MAEaC,MAAM,GAAGA,CAACC,IAAsB,EAAEC,IAAI,GAAG,UAAU;EAC5D,IAAI,CAACD,IAAI,EAAE;IACP,OAAOE,SAAS;;EAGpB,MAAMC,KAAK,GAAG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C,IAAI,GAAGG,MAAM,CAACC,QAAQ,CAACJ,IAAI,EAAE,EAAE,CAAC;EAEhC,MAAMU,WAAW,GAAG,IAAIC,IAAI,EAAE;EAE9B,OAAO,IAAIA,IAAI,YACAC,MAAM,CAACC,EAAE,CAACb,IAAI,EAAEc,GAAG,CAAC,GAAGxB,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAIoB,WAAW,CAACxC,WAAW,EAAE,GAAG8B,IAAI,aACrEY,MAAM,CAACC,EAAE,CAACd,KAAK,EAAEe,GAAG,CAAC,GAAGJ,WAAW,CAACvC,QAAQ,EAAE,GAAG4B,KAAK,GAAG,CAAC;;;EAC5Da,MAAM,CAACC,EAAE,CAACf,GAAG,EAAEgB,GAAG,CAAC,GAAGJ,WAAW,CAACvB,OAAO,EAAE,GAAGW,GAAG,aAC/C,EAAE,eACA,CAAC;GAClB;AACL;MAEaiB,kBAAkB,GAAIzC,IAAY;EAC3C,MAAM0C,QAAQ,GAAG,IAAIL,IAAI,CAACrC,IAAI,CAAC;EAC/B,OAAOM,OAAO,CAACoC,QAAQ,CAAC,GAAG3B,qBAAqB,CAAChB,MAAM,CAAC,IAAIsC,IAAI,CAACrC,IAAI,CAAC,CAAC,CAAC,GAAGE,SAAS;AACxF;;;;"}
1
+ {"version":3,"file":"date.js","sources":["../../../../../../src/utils/date.ts"],"sourcesContent":["import { isDate, toDate, isValid } from 'date-fns';\n\nexport const isWeakEqual = (leftDate: Date, rightDate: Date) => {\n return (\n leftDate.getFullYear() === rightDate.getFullYear() &&\n leftDate.getMonth() === rightDate.getMonth() &&\n leftDate.getDate() === rightDate.getDate()\n );\n};\n\nexport const format = (date: Date | undefined, mask = 'dd.mm.yy'): string | undefined => {\n if (!date) {\n return undefined;\n }\n\n const value = isDate(date) ? date : toDate(date);\n\n if (!isValid(value)) {\n return undefined;\n }\n\n const pad = (v: number): string => (String(v).length === 1 ? `0${v}` : v.toString());\n\n return mask\n .replace('dd', pad(value.getDate()))\n .replace('mm', pad(value.getMonth() + 1))\n .replace('yy', String(value.getFullYear()).slice(2));\n};\n\nexport const parseFromCustomString = (\n date = '',\n mask = 'dd.mm.yy',\n defaultMonth: number | undefined = undefined,\n defaultYear: number | undefined = undefined\n): Date | undefined => {\n if (!date || !date.length) {\n return undefined;\n }\n\n const sanitizedMask = mask.split(/[^dmy]/);\n const dd = sanitizedMask.findIndex(x => x === 'dd');\n const mm = sanitizedMask.findIndex(x => x === 'mm');\n const yy = sanitizedMask.findIndex(x => x === 'yy' || x === 'yyyy');\n\n let day;\n let month;\n let year;\n\n const getFullYear = (y: string): string => {\n if (y && y.length === 2) {\n const z = Number.parseInt(y, 10);\n\n return z > 50 ? `19${y}` : `20${y}`;\n }\n\n return y;\n };\n\n const inputParts = date.split(/\\D/);\n\n if (inputParts.length === 1) {\n const fullDate = inputParts[0];\n const unseparatedMask = mask.replace(/[^dmy]/g, '');\n\n day = fullDate.slice(unseparatedMask.indexOf('d'), unseparatedMask.lastIndexOf('d') + 1);\n month = fullDate.slice(unseparatedMask.indexOf('m'), unseparatedMask.lastIndexOf('m') + 1);\n year = getFullYear(fullDate.slice(unseparatedMask.indexOf('y'), unseparatedMask.lastIndexOf('y') + 3)); // account for full years\n } else {\n day = inputParts[dd];\n month = inputParts[mm];\n year = getFullYear(inputParts[yy]);\n }\n\n day = Number.parseInt(day, 10);\n month = Number.parseInt(month, 10);\n year = Number.parseInt(year, 10);\n\n const currentDate = new Date();\n\n return new Date(\n /* year */ Object.is(year, NaN) ? defaultYear ?? currentDate.getFullYear() : year,\n /* month */ Object.is(month, NaN) ? defaultMonth ?? currentDate.getMonth() : month - 1, // months are zero based in javascript, so subtract a day\n /* day */ Object.is(day, NaN) ? currentDate.getDate() : day,\n /* hours */ 12,\n /* minutes */ 0 // set to midday to avoid UTC offset causing dates to be mismatched server side\n );\n};\n\nexport const parseFromISOString = (date: string): Date | undefined => {\n const tempDate = new Date(date);\n return isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;\n};\n"],"names":["isWeakEqual","leftDate","rightDate","getFullYear","getMonth","getDate","format","date","mask","undefined","value","isDate","toDate","isValid","pad","v","String","length","toString","replace","slice","parseFromCustomString","defaultMonth","defaultYear","sanitizedMask","split","dd","findIndex","x","mm","yy","day","month","year","y","z","Number","parseInt","inputParts","fullDate","unseparatedMask","indexOf","lastIndexOf","currentDate","Date","Object","is","NaN","parseFromISOString","tempDate"],"mappings":";;MAEaA,WAAW,GAAGA,CAACC,QAAc,EAAEC,SAAe;EACvD,OACID,QAAQ,CAACE,WAAW,EAAE,KAAKD,SAAS,CAACC,WAAW,EAAE,IAClDF,QAAQ,CAACG,QAAQ,EAAE,KAAKF,SAAS,CAACE,QAAQ,EAAE,IAC5CH,QAAQ,CAACI,OAAO,EAAE,KAAKH,SAAS,CAACG,OAAO,EAAE;AAElD;MAEaC,MAAM,GAAGA,CAACC,IAAsB,EAAEC,IAAI,GAAG,UAAU;EAC5D,IAAI,CAACD,IAAI,EAAE;IACP,OAAOE,SAAS;;EAGpB,MAAMC,KAAK,GAAGC,MAAM,CAACJ,IAAI,CAAC,GAAGA,IAAI,GAAGK,MAAM,CAACL,IAAI,CAAC;EAEhD,IAAI,CAACM,OAAO,CAACH,KAAK,CAAC,EAAE;IACjB,OAAOD,SAAS;;EAGpB,MAAMK,GAAG,GAAIC,CAAS,IAAcC,MAAM,CAACD,CAAC,CAAC,CAACE,MAAM,KAAK,CAAC,OAAOF,GAAG,GAAGA,CAAC,CAACG,QAAQ,EAAG;EAEpF,OAAOV,IAAI,CACNW,OAAO,CAAC,IAAI,EAAEL,GAAG,CAACJ,KAAK,CAACL,OAAO,EAAE,CAAC,CAAC,CACnCc,OAAO,CAAC,IAAI,EAAEL,GAAG,CAACJ,KAAK,CAACN,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CACxCe,OAAO,CAAC,IAAI,EAAEH,MAAM,CAACN,KAAK,CAACP,WAAW,EAAE,CAAC,CAACiB,KAAK,CAAC,CAAC,CAAC,CAAC;AA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E,eACA,CAAC;GAClB;AACL;MAEaiB,kBAAkB,GAAIzC,IAAY;EAC3C,MAAM0C,QAAQ,GAAG,IAAIL,IAAI,CAACrC,IAAI,CAAC;EAC/B,OAAOM,OAAO,CAACoC,QAAQ,CAAC,GAAG5B,qBAAqB,CAACf,MAAM,CAAC,IAAIsC,IAAI,CAACrC,IAAI,CAAC,CAAC,CAAC,GAAGE,SAAS;AACxF;;;;"}
package/dist/index.css CHANGED
@@ -550,6 +550,8 @@ table[data-taco^='table'] {
550
550
  @apply grid;
551
551
  /* print */
552
552
  @apply print:float-left print:h-max print:w-full print:overflow-visible print:border-0;
553
+ /* resolves a virtualisation resizing issue */
554
+ overflow-anchor: none;
553
555
  }
554
556
 
555
557
  table[data-taco^='table'] thead {
@@ -639,6 +641,10 @@ table[data-taco^='table'] tr:first-child td {
639
641
  @apply !border-t-0;
640
642
  }
641
643
 
644
+ table[data-taco^='table'] tr:last-child td {
645
+ @apply !border-b-0;
646
+ }
647
+
642
648
  table[data-taco^='table'] tr[aria-grabbed='true'] td {
643
649
  @apply !wcag-blue-500;
644
650
  }
@@ -715,12 +721,15 @@ table[data-taco^='table'] td:not([data-cell-truncate='true']) {
715
721
 
716
722
  /* FOOTER */
717
723
  table[data-taco^='table'] tfoot td {
718
- /*
724
+ /*
719
725
  * Since footer has sticky position, the top and bottom padding ensures that the inner content doesn't come over
720
726
  * the border of the footer row.
721
727
  */
722
728
  @apply border-b-0 !py-1 font-bold;
723
729
  }
730
+ table[data-taco^='table'] tfoot td:first-child {
731
+ @apply z-30 !pb-0 !pt-[2px];
732
+ }
724
733
 
725
734
  table[data-taco^='table'] tfoot td:before {
726
735
  @apply bg-grey-300 absolute left-0 right-0 top-0 h-[2px] content-[''];
@@ -983,7 +992,7 @@ table[data-taco^='table'][data-table-font-size='large'] td [data-taco='textarea'
983
992
  }
984
993
 
985
994
  table[data-taco^='table'][data-table-font-size='large'] td [data-taco='input-container'] [data-affix-type='postfix'] button {
986
- @apply !-mr-[19px] !h-10 !w-10;
995
+ @apply z-10 !-mr-[19px] !h-10 !w-10;
987
996
  }
988
997
 
989
998
  table[data-taco^='table'][data-table-font-size='large']
@@ -1085,11 +1094,6 @@ table[data-taco^='table'] tbody tr[data-row-meta-layout='item']:not([data-row-gr
1085
1094
  @apply !border-b-0;
1086
1095
  }
1087
1096
 
1088
- /* printing */
1089
- table[data-taco^='table'] [data-cell-id^='__'] {
1090
- @apply print:hidden;
1091
- }
1092
-
1093
1097
  /* rows */
1094
1098
  .yt-table__row {
1095
1099
  @apply border-grey-300 flex border-b;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { Table as ReactTable, Row as ReactTableRow } from '@tanstack/react-table';
3
3
  export declare type RowProps<TType = unknown> = {
4
4
  index: number;
@@ -6,5 +6,3 @@ export declare type RowProps<TType = unknown> = {
6
6
  table: ReactTable<TType>;
7
7
  };
8
8
  export declare function SkeletonRow<TType = unknown>(props: RowProps<TType>): JSX.Element;
9
- export declare function RowWithServerLoading<TType = unknown>(props: RowProps<TType>): JSX.Element;
10
- export declare const Skeleton: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLTableRowElement>>;
@@ -4,4 +4,4 @@ export declare const ROW_HEIGHT_ESTIMATES: {
4
4
  tall: number;
5
5
  'extra-tall': number;
6
6
  };
7
- export declare const HEADER_ROW_HEIGHT_ESTIMATE: number;
7
+ export declare const HEADER_FOOTER_ROW_HEIGHT_ESTIMATE: number;
@@ -5,6 +5,6 @@ export declare function isInternalColumn(id: string | undefined): boolean | unde
5
5
  export declare const getCellMinWidth: (fontSize?: FontSize) => 57 | 83 | 72;
6
6
  export declare function isCellHighlighted(query: string, value: unknown, dataType?: TableColumnDataType): boolean;
7
7
  export declare function getCellValueAsString(value: unknown, dataType?: TableColumnDataType): string;
8
- export declare function ensureOrdering<TType = unknown>(columns: ReactTableColumnDef<TType>[], settingsOrder: string[] | undefined, internalColumnsPinnedToTheRight?: string[]): string[];
8
+ export declare function ensureOrdering<TType = unknown>(columns: ReactTableColumnDef<TType>[], settingsOrder: string[] | undefined, pinnedOrder?: string[] | undefined, internalColumnsPinnedToTheRight?: string[]): string[];
9
9
  export declare function unfreezeAllExternalColumns(leftPinnedState?: string[]): string[];
10
10
  export declare function freezeUptoExternalColumn(index: number, columns: string[]): string[];
@@ -2569,6 +2569,19 @@ function IconPhoneSolid(props, svgRef) {
2569
2569
  }
2570
2570
  var PhoneSolid = /*#__PURE__*/React.forwardRef(IconPhoneSolid);
2571
2571
 
2572
+ function IconPhone(props, svgRef) {
2573
+ return /*#__PURE__*/React.createElement("svg", Object.assign({
2574
+ fill: "none",
2575
+ xmlns: "http://www.w3.org/2000/svg",
2576
+ viewBox: "0 0 24 24",
2577
+ ref: svgRef
2578
+ }, props), /*#__PURE__*/React.createElement("path", {
2579
+ d: "M4.742 3.998l1.036-.641a2.75 2.75 0 013.58.6l1.39 1.703a2.75 2.75 0 01.2 3.196l-1.082 1.732a.25.25 0 00-.035.17c.06.396.52 1.073 1.397 1.95.638.638 1.174 1.062 1.59 1.27.289.144.43.154.48.123l1.783-1.114a2.75 2.75 0 013.195.201l1.696 1.383a2.75 2.75 0 01.606 3.57l-.639 1.04a3.75 3.75 0 01-3.234 1.788c-2.86-.03-5.846-1.636-8.974-4.763-3.133-3.133-4.739-6.124-4.764-8.986a3.75 3.75 0 011.775-3.222zm.79 1.276a2.25 2.25 0 00-1.065 1.932c.021 2.408 1.445 5.06 4.324 7.939 2.876 2.876 5.524 4.3 7.93 4.324a2.25 2.25 0 001.94-1.072l.639-1.04a1.25 1.25 0 00-.276-1.623l-1.696-1.383a1.25 1.25 0 00-1.452-.092l-1.787 1.117c-1.04.64-2.31.005-3.922-1.607-1.086-1.087-1.698-1.988-1.82-2.786a1.75 1.75 0 01.247-1.19l1.083-1.732a1.25 1.25 0 00-.092-1.453l-1.39-1.704a1.25 1.25 0 00-1.627-.272l-1.036.642z",
2580
+ fill: "currentColor"
2581
+ }));
2582
+ }
2583
+ var Phone = /*#__PURE__*/React.forwardRef(IconPhone);
2584
+
2572
2585
  function IconPlay(props, svgRef) {
2573
2586
  return /*#__PURE__*/React.createElement("svg", Object.assign({
2574
2587
  xmlns: "http://www.w3.org/2000/svg",
@@ -3572,6 +3585,7 @@ const icons = {
3572
3585
  'person-plus': PersonPlus,
3573
3586
  'person-tick': PersonTick,
3574
3587
  'phone-solid': PhoneSolid,
3588
+ phone: Phone,
3575
3589
  play: Play,
3576
3590
  'plus-minus': PlusMinus,
3577
3591
  print: Print,
@@ -5809,58 +5823,74 @@ const useCombobox = ({
5809
5823
  }
5810
5824
  };
5811
5825
  const handleInputKeyDown = event => {
5826
+ var _inputRef$current;
5812
5827
  event.persist();
5813
- switch (event.key) {
5814
- case 'Backspace':
5815
- {
5816
- return;
5817
- }
5818
- case 'Escape':
5819
- {
5820
- event.preventDefault();
5821
- setInputValue(convertToInputValue(value));
5822
- setOpen(false);
5823
- return;
5824
- }
5825
- case 'Tab':
5826
- case 'Enter':
5827
- {
5828
- if (event.key !== 'Tab') {
5828
+ const insideTheTable = !!((_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.closest('table, [role="rowgroup"]'));
5829
+ if (!event.ctrlKey && !event.metaKey) {
5830
+ switch (event.key) {
5831
+ case 'Backspace':
5832
+ {
5833
+ return;
5834
+ }
5835
+ case 'Escape':
5836
+ {
5829
5837
  event.preventDefault();
5838
+ setInputValue(convertToInputValue(value));
5839
+ setOpen(false);
5840
+ return;
5830
5841
  }
5831
- setCurrentValue(currentIndex);
5832
- setOpen(false);
5833
- return;
5834
- }
5835
- case 'ArrowDown':
5836
- if (open) {
5837
- event.preventDefault();
5838
- } else {
5839
- if (!inline && buttonRef.current) {
5840
- buttonRef.current.click();
5842
+ case 'Tab':
5843
+ {
5844
+ setCurrentValue(currentIndex);
5845
+ setOpen(false);
5846
+ return;
5841
5847
  }
5842
- }
5843
- break;
5844
- case 'ArrowUp':
5845
- case 'Home':
5846
- case 'End':
5847
- {
5848
+ case 'Enter':
5849
+ {
5850
+ if (insideTheTable) {
5851
+ event.preventDefault();
5852
+ if (inline && !open) {
5853
+ setOpen(true);
5854
+ } else if (buttonRef.current && !open) {
5855
+ buttonRef.current.click();
5856
+ }
5857
+ }
5858
+ if (open) {
5859
+ setCurrentValue(currentIndex);
5860
+ setOpen(false);
5861
+ }
5862
+ return;
5863
+ }
5864
+ case 'ArrowDown':
5848
5865
  if (open) {
5849
5866
  event.preventDefault();
5867
+ } else {
5868
+ if (!inline && buttonRef.current && !insideTheTable) {
5869
+ buttonRef.current.click();
5870
+ }
5850
5871
  }
5851
5872
  break;
5873
+ case 'ArrowUp':
5874
+ case 'Home':
5875
+ case 'End':
5876
+ {
5877
+ if (open) {
5878
+ event.preventDefault();
5879
+ }
5880
+ break;
5881
+ }
5882
+ }
5883
+ // we aren't focused on the list, so manually forward the keydown event to it
5884
+ if (listRef.current) {
5885
+ listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
5886
+ }
5887
+ if (inline && !open) {
5888
+ if ((event.key === 'ArrowUp' || event.key === 'ArrowDown') && !insideTheTable) {
5889
+ event.preventDefault();
5890
+ const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;
5891
+ setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);
5892
+ setOpen(true);
5852
5893
  }
5853
- }
5854
- // we aren't focused on the list, so manually forward the keydown event to it
5855
- if (listRef.current) {
5856
- listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
5857
- }
5858
- if (inline && !open) {
5859
- if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
5860
- event.preventDefault();
5861
- const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;
5862
- setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);
5863
- setOpen(true);
5864
5894
  }
5865
5895
  }
5866
5896
  if (!event.isDefaultPrevented() && onKeyDown) {
@@ -6007,7 +6037,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
6007
6037
  });
6008
6038
 
6009
6039
  const isWeakEqual = (leftDate, rightDate) => {
6010
- return leftDate.getFullYear() === rightDate.getFullYear() && leftDate.getMonth() === rightDate.getMonth() && leftDate.getDay() === rightDate.getDay();
6040
+ return leftDate.getFullYear() === rightDate.getFullYear() && leftDate.getMonth() === rightDate.getMonth() && leftDate.getDate() === rightDate.getDate();
6011
6041
  };
6012
6042
  const format = (date, mask = 'dd.mm.yy') => {
6013
6043
  if (!date) {
@@ -6020,7 +6050,7 @@ const format = (date, mask = 'dd.mm.yy') => {
6020
6050
  const pad = v => String(v).length === 1 ? `0${v}` : v.toString();
6021
6051
  return mask.replace('dd', pad(value.getDate())).replace('mm', pad(value.getMonth() + 1)).replace('yy', String(value.getFullYear()).slice(2));
6022
6052
  };
6023
- const parseFromCustomString = (date = '', mask = 'dd.mm.yy', defaultYear = undefined) => {
6053
+ const parseFromCustomString = (date = '', mask = 'dd.mm.yy', defaultMonth = undefined, defaultYear = undefined) => {
6024
6054
  if (!date || !date.length) {
6025
6055
  return undefined;
6026
6056
  }
@@ -6054,7 +6084,7 @@ const parseFromCustomString = (date = '', mask = 'dd.mm.yy', defaultYear = undef
6054
6084
  month = Number.parseInt(month, 10);
6055
6085
  year = Number.parseInt(year, 10);
6056
6086
  const currentDate = new Date();
6057
- return new Date( /* year */Object.is(year, NaN) ? defaultYear !== null && defaultYear !== void 0 ? defaultYear : currentDate.getFullYear() : year, /* month */Object.is(month, NaN) ? currentDate.getMonth() : month - 1,
6087
+ return new Date( /* year */Object.is(year, NaN) ? defaultYear !== null && defaultYear !== void 0 ? defaultYear : currentDate.getFullYear() : year, /* month */Object.is(month, NaN) ? defaultMonth !== null && defaultMonth !== void 0 ? defaultMonth : currentDate.getMonth() : month - 1,
6058
6088
  // months are zero based in javascript, so subtract a day
6059
6089
  /* day */
6060
6090
  Object.is(day, NaN) ? currentDate.getDate() : day, /* hours */12, /* minutes */0 // set to midday to avoid UTC offset causing dates to be mismatched server side
@@ -6092,7 +6122,7 @@ const useDatepicker = ({
6092
6122
  // event handlers
6093
6123
  const handleInputBlur = event => {
6094
6124
  event.persist();
6095
- const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value === null || value === void 0 ? void 0 : value.getFullYear());
6125
+ const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value === null || value === void 0 ? void 0 : value.getMonth(), value === null || value === void 0 ? void 0 : value.getFullYear());
6096
6126
  const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
6097
6127
  event.target.value = formattedValue;
6098
6128
  if (onChange) {
@@ -9587,7 +9617,7 @@ function orderColumn(column, {
9587
9617
  }
9588
9618
  }
9589
9619
  // ordering
9590
- function ensureOrdering(columns, settingsOrder, internalColumnsPinnedToTheRight = ['__actions']) {
9620
+ function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumnsPinnedToTheRight = ['__actions']) {
9591
9621
  // internal columns come with a defined order
9592
9622
  const internalColumns = columns.filter(column => isInternalColumn(column.id) && !internalColumnsPinnedToTheRight.includes(String(column.id))).map(column => column.id);
9593
9623
  // columns with ordering disabled should be moved to the front
@@ -9623,6 +9653,12 @@ function ensureOrdering(columns, settingsOrder, internalColumnsPinnedToTheRight
9623
9653
  // Append absent columns at the end
9624
9654
  .concat(columnsAbsentInSettingsOrder);
9625
9655
  }
9656
+ // if pinned columns are defined, make sure they are sorted first, this ensures state matches the freezing "upto" behaviour
9657
+ if (Array.isArray(pinnedOrder)) {
9658
+ orderingEnabled.sort(
9659
+ // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
9660
+ (a, b) => (pinnedOrder.indexOf(a) >>> 0) - (pinnedOrder.indexOf(b) >>> 0));
9661
+ }
9626
9662
  const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
9627
9663
  // actions should always be last, enforce that
9628
9664
  internalColumnsPinnedToTheRight.forEach(id => {
@@ -9867,16 +9903,18 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
9867
9903
  if (defaultWidth) {
9868
9904
  defaultSizing[id] = defaultWidth;
9869
9905
  }
9870
- if (child.props.sort !== undefined) {
9906
+ const isGrouped = defaultRowGroupColumnId === id;
9907
+ if (child.props.sort !== undefined || isGrouped) {
9871
9908
  defaultSorting.push({
9872
9909
  id,
9873
9910
  desc: sort === 'desc'
9874
9911
  });
9875
9912
  }
9876
- const isGrouped = defaultRowGroupColumnId === id;
9877
9913
  const column = {
9878
9914
  id,
9879
9915
  accessorKey,
9916
+ // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure
9917
+ accessorFn: row => row === null || row === void 0 ? void 0 : row[accessorKey],
9880
9918
  header: header,
9881
9919
  // features
9882
9920
  enableColumnFilter,
@@ -9976,14 +10014,14 @@ function mapTableChildrenToColumns(props, settings, options, internalColumns) {
9976
10014
  const column = createInternalColumn('__select', internalColumns.rowSelection, defaultSizing);
9977
10015
  columns.unshift(column);
9978
10016
  }
9979
- if (options.enableRowActions && (_props$rowActions = props.rowActions) !== null && _props$rowActions !== void 0 && _props$rowActions.length && internalColumns.rowActions) {
9980
- const column = createInternalColumn('__actions', internalColumns.rowActions, defaultSizing);
9981
- columns.push(column);
9982
- }
9983
10017
  if (options.enableRowDrag && props.onRowDrag && internalColumns.rowDrag) {
9984
10018
  const column = createInternalColumn('__drag', internalColumns.rowDrag, defaultSizing);
9985
10019
  columns.unshift(column);
9986
10020
  }
10021
+ if (options.enableRowActions && (_props$rowActions = props.rowActions) !== null && _props$rowActions !== void 0 && _props$rowActions.length && internalColumns.rowActions) {
10022
+ const column = createInternalColumn('__actions', internalColumns.rowActions, defaultSizing);
10023
+ columns.push(column);
10024
+ }
9987
10025
  }
9988
10026
  return {
9989
10027
  columns,
@@ -10057,12 +10095,14 @@ function configureReactTableOptions(options, props) {
10057
10095
  }
10058
10096
  function useReactTableInitialState(props, columns, persistedSettings, defaults) {
10059
10097
  return React__default.useMemo(() => {
10060
- var _persistedSettings$co, _props$defaultSetting, _ref, _persistedSettings$co2, _props$defaultSetting2, _columnPinning$left, _ref2, _persistedSettings$co3, _props$defaultSetting3, _ref3, _ref4, _persistedSettings$co4, _props$defaultSetting4, _ref5, _ref6, _persistedSettings$co5, _props$defaultSetting5, _persistedSettings$se, _props$defaultSetting6, _props$defaultSetting7, _props$defaultSetting8;
10098
+ var _ref, _persistedSettings$co, _props$defaultSetting, _persistedSettings$co2, _props$defaultSetting2, _columnPinning$left, _ref2, _persistedSettings$co3, _props$defaultSetting3, _ref3, _ref4, _persistedSettings$co4, _props$defaultSetting4, _ref5, _ref6, _persistedSettings$co5, _props$defaultSetting5, _persistedSettings$se, _props$defaultSetting6, _props$defaultSetting7, _props$defaultSetting8;
10061
10099
  const ignoreNotDefinedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);
10062
- const columnOrder = ensureOrdering(columns, (_persistedSettings$co = persistedSettings.columnOrder) !== null && _persistedSettings$co !== void 0 ? _persistedSettings$co : (_props$defaultSetting = props.defaultSettings) === null || _props$defaultSetting === void 0 ? void 0 : _props$defaultSetting.columnOrder);
10063
- const columnPinning = (_ref = (_persistedSettings$co2 = persistedSettings.columnPinning) !== null && _persistedSettings$co2 !== void 0 ? _persistedSettings$co2 : (_props$defaultSetting2 = props.defaultSettings) === null || _props$defaultSetting2 === void 0 ? void 0 : _props$defaultSetting2.columnPinning) !== null && _ref !== void 0 ? _ref : {};
10064
- // ensure internal columns are pinned
10065
- if (!(columnPinning !== null && columnPinning !== void 0 && (_columnPinning$left = columnPinning.left) !== null && _columnPinning$left !== void 0 && _columnPinning$left.length)) {
10100
+ const columnPinning = (_ref = (_persistedSettings$co = persistedSettings.columnPinning) !== null && _persistedSettings$co !== void 0 ? _persistedSettings$co : (_props$defaultSetting = props.defaultSettings) === null || _props$defaultSetting === void 0 ? void 0 : _props$defaultSetting.columnPinning) !== null && _ref !== void 0 ? _ref : {};
10101
+ const columnOrder = ensureOrdering(columns, (_persistedSettings$co2 = persistedSettings.columnOrder) !== null && _persistedSettings$co2 !== void 0 ? _persistedSettings$co2 : (_props$defaultSetting2 = props.defaultSettings) === null || _props$defaultSetting2 === void 0 ? void 0 : _props$defaultSetting2.columnOrder, columnPinning.left);
10102
+ // ensure internal columns are pinned, and are pinned in the correct order
10103
+ if (columnPinning !== null && columnPinning !== void 0 && (_columnPinning$left = columnPinning.left) !== null && _columnPinning$left !== void 0 && _columnPinning$left.length) {
10104
+ columnPinning.left = freezeUptoExternalColumn(columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]), columnOrder);
10105
+ } else {
10066
10106
  if (props.defaultColumnFreezingIndex) {
10067
10107
  columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);
10068
10108
  } else {
@@ -11219,7 +11259,7 @@ function useTableStyleGrid(tableId, table, fontSize) {
11219
11259
  // header body ?footer
11220
11260
  const gridTemplateRows = table.getRowModel().rows.length ? 'min-content 1fr min-content' : 'min-content 1fr';
11221
11261
  return React__default.useMemo(() => {
11222
- let printGridTemplateColumns = '';
11262
+ let printGridTemplateColumns = 0;
11223
11263
  const printHiddenColumns = [];
11224
11264
  const gridTemplateColumns = allVisibleColumns.reduce((accum, column, index) => {
11225
11265
  var _column$columnDef$min, _column$columnDef$met;
@@ -11229,7 +11269,6 @@ function useTableStyleGrid(tableId, table, fontSize) {
11229
11269
  const minSize = (_column$columnDef$min = column.columnDef.minSize) !== null && _column$columnDef$min !== void 0 ? _column$columnDef$min : globalMinSize;
11230
11270
  const width = columnSizing[column.id];
11231
11271
  let size;
11232
- let printSize;
11233
11272
  if (isInternalColumn(column.id)) {
11234
11273
  if (column.id === '__actions') {
11235
11274
  const minWidth = tableMeta.rowActions.rowActionsLength * 32 + 8; /* button margins l+r */
@@ -11253,22 +11292,24 @@ function useTableStyleGrid(tableId, table, fontSize) {
11253
11292
  } else {
11254
11293
  size = `minmax(max-content, auto)`;
11255
11294
  }
11295
+ // printing
11256
11296
  if (((_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.enablePrinting) === false) {
11257
- printSize = '';
11258
11297
  printHiddenColumns.push(column.id);
11259
11298
  } else {
11260
- printSize = 'auto';
11299
+ printGridTemplateColumns++;
11261
11300
  }
11262
- printGridTemplateColumns = `${printGridTemplateColumns} ${printSize}`.trim();
11263
11301
  return `${accum} ${size}`.trim();
11264
11302
  }, '');
11265
- // we have to be specific so that nested tables don't inherit the same css
11266
- const hiddenColumns = printHiddenColumns.map(id => `table[data-taco^='table']#${tableId} > thead > tr > th[data-cell-id='${id}']\n,table[data-taco^='table']#${tableId} > tbody > tr > td[data-cell-id='${id}']\n`).join(',');
11303
+ // normal grid
11267
11304
  const style = {
11268
11305
  gridTemplateColumns,
11269
11306
  gridTemplateRows
11270
11307
  };
11271
- const stylesheet = `@media print { table[data-taco^='table']#${tableId} { grid-template-columns: ${printGridTemplateColumns}; } ${hiddenColumns ? `${hiddenColumns} { display: none; }` : ''}}`;
11308
+ // printing grid
11309
+ // we have to be specific so that nested tables don't inherit the same css
11310
+ const hiddenColumns = printHiddenColumns.map(id => `table[data-taco^='table']#${tableId} > thead > tr > th[data-cell-id='${id}']\n,table[data-taco^='table']#${tableId} > tbody > tr > td[data-cell-id='${id}']\n`).join(',');
11311
+ const stylesheet = `@media print { table[data-taco^='table']#${tableId} { grid-template-columns: repeat(${printGridTemplateColumns}, auto) !important; }
11312
+ table[data-taco^='table']#${tableId} [data-cell-id^='__']${hiddenColumns ? `, ${hiddenColumns}` : ''} { display: none; }}`;
11272
11313
  return {
11273
11314
  style,
11274
11315
  stylesheet
@@ -11298,7 +11339,8 @@ function useTableStyleColumnFreezing(tableId, table) {
11298
11339
  // add right border, hide the header seperator and add shadow when scrolled
11299
11340
  // we have to be specific so that nested tables don't inherit the same css
11300
11341
  styles.push(`table[data-taco^='table']#${tableId} > thead > tr > th:nth-child(${index + 1}),
11301
- table[data-taco^='table']#${tableId} > tbody > tr > td:nth-child(${index + 1}) {
11342
+ table[data-taco^='table']#${tableId} > tbody > tr > td:nth-child(${index + 1}),
11343
+ table[data-taco^='table']#${tableId} > tfoot > tr > td:nth-child(${index + 1}):not([data-cell-id^="__"]) {
11302
11344
  border-right-width: 1px;
11303
11345
  }\ntable[data-taco^='table']#${tableId} > thead > tr > th:nth-child(${index + 1})[data-cell-id^="__"],
11304
11346
  table[data-taco^='table']#${tableId} > tbody > tr > td:nth-child(${index + 1})[data-cell-id^="__"] {
@@ -11306,7 +11348,8 @@ function useTableStyleColumnFreezing(tableId, table) {
11306
11348
  }\ntable[data-taco^='table']#${tableId} > thead > tr > th:nth-child(${index + 1}):after {
11307
11349
  content: none;
11308
11350
  }\ntable[data-taco^='table'][data-table-horizontally-scrolled="true"]#${tableId} > thead > tr > th:nth-child(${index + 1}),
11309
- table[data-taco^='table'][data-table-horizontally-scrolled="true"]#${tableId} > tbody > tr > td:nth-child(${index + 1}) {
11351
+ table[data-taco^='table'][data-table-horizontally-scrolled="true"]#${tableId} > tbody > tr > td:nth-child(${index + 1}),
11352
+ table[data-taco^='table'][data-table-horizontally-scrolled="true"]#${tableId} > tfoot > tr > td:nth-child(${index + 1}) {
11310
11353
  border-right-color: rgb(221, 221, 221);
11311
11354
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 6px 0px 6px rgb(0 0 0/8%);
11312
11355
  }`);
@@ -11456,7 +11499,7 @@ const ROW_HEIGHT_ESTIMATES = {
11456
11499
  tall: 49,
11457
11500
  'extra-tall': 57
11458
11501
  };
11459
- const HEADER_ROW_HEIGHT_ESTIMATE = ROW_HEIGHT_ESTIMATES.medium + 2; // header includes 2px border
11502
+ const HEADER_FOOTER_ROW_HEIGHT_ESTIMATE = ROW_HEIGHT_ESTIMATES.medium + 2; // header includes 2px border
11460
11503
 
11461
11504
  function SkeletonRow(props) {
11462
11505
  const {
@@ -11471,11 +11514,11 @@ function SkeletonRow(props) {
11471
11514
  }));
11472
11515
  }
11473
11516
  return /*#__PURE__*/React__default.createElement(Skeleton, {
11474
- id: row.id,
11475
- cells: row.getVisibleCells()
11517
+ cellsCount: row.getVisibleCells().length
11476
11518
  });
11477
11519
  }
11478
11520
  function RowWithServerLoading(props) {
11521
+ var _table$getState$group, _table$getState;
11479
11522
  const {
11480
11523
  index,
11481
11524
  row,
@@ -11497,22 +11540,24 @@ function RowWithServerLoading(props) {
11497
11540
  (_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadPage) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, pageIndex, table.getState().sorting, table.getState().columnFilters, table.getState().globalFilter);
11498
11541
  }
11499
11542
  }, [inView]);
11543
+ const groupedCellCount = (_table$getState$group = (_table$getState = table.getState()) === null || _table$getState === void 0 ? void 0 : _table$getState.grouping.length) !== null && _table$getState$group !== void 0 ? _table$getState$group : 0;
11544
+ const ungroupedCellCount = row.getVisibleCells().length - groupedCellCount;
11500
11545
  return /*#__PURE__*/React__default.createElement(Skeleton, {
11501
- cells: row.getVisibleCells(),
11546
+ cellsCount: ungroupedCellCount,
11502
11547
  ref: ref
11503
11548
  });
11504
11549
  }
11505
11550
  const Skeleton = /*#__PURE__*/React__default.forwardRef(function Skeleton(props, ref) {
11506
11551
  const {
11507
- cells
11552
+ cellsCount
11508
11553
  } = props;
11509
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tr", {
11554
+ return /*#__PURE__*/React__default.createElement("tr", {
11510
11555
  ref: ref
11511
- }, cells.map(cell => ( /*#__PURE__*/React__default.createElement("td", {
11512
- key: cell.id
11556
+ }, Array(cellsCount).fill(null).map((_, index) => ( /*#__PURE__*/React__default.createElement("td", {
11557
+ key: index
11513
11558
  }, /*#__PURE__*/React__default.createElement("span", {
11514
11559
  className: "bg-grey-100 text-grey-700 h-4 w-full text-center text-xs"
11515
- }))))));
11560
+ })))));
11516
11561
  });
11517
11562
 
11518
11563
  const RowContext = /*#__PURE__*/React__default.createContext({
@@ -11545,13 +11590,14 @@ function Row(props) {
11545
11590
  }
11546
11591
 
11547
11592
  const TABLE_SCROLL_PADDING_BOTTOM = 36;
11548
- const TABLE_PADDING_BOTTOM = 120;
11593
+ const TABLE_PADDING_BOTTOM = 0;
11549
11594
  function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
11550
11595
  var _table$getState$group, _ref, _virtualItems$padding, _virtualItems$padding2, _ref2, _virtualItems;
11551
11596
  const tableMeta = table.options.meta;
11552
11597
  const rows = table.getRowModel().rows;
11553
- const HEADER_OFFSET_TOTAL = HEADER_ROW_HEIGHT_ESTIMATE * table.getHeaderGroups().length;
11598
+ const HEADER_OFFSET_TOTAL = HEADER_FOOTER_ROW_HEIGHT_ESTIMATE * table.getHeaderGroups().length;
11554
11599
  const isTableGrouped = !!((_table$getState$group = table.getState().grouping) !== null && _table$getState$group !== void 0 && _table$getState$group.length);
11600
+ const FOOTER_OFFSET_TOTAL = tableMeta.footer.isEnabled ? HEADER_FOOTER_ROW_HEIGHT_ESTIMATE : 0;
11555
11601
  // expanded rows
11556
11602
  const {
11557
11603
  createRowMeasurer,
@@ -11565,7 +11611,7 @@ function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
11565
11611
  getScrollElement: () => tableRef.current,
11566
11612
  overscan: tableMeta.printing.isPrinting ? rows.length : undefined,
11567
11613
  rangeExtractor,
11568
- scrollPaddingStart: isTableGrouped ? HEADER_ROW_HEIGHT_ESTIMATE : undefined,
11614
+ scrollPaddingStart: isTableGrouped ? HEADER_FOOTER_ROW_HEIGHT_ESTIMATE : undefined,
11569
11615
  scrollPaddingEnd: HEADER_OFFSET_TOTAL + TABLE_SCROLL_PADDING_BOTTOM,
11570
11616
  paddingEnd: TABLE_PADDING_BOTTOM
11571
11617
  });
@@ -11618,7 +11664,7 @@ function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
11618
11664
  let content = null;
11619
11665
  if (rows.length) {
11620
11666
  style = {
11621
- height: `${virtualiser.getTotalSize()}px`,
11667
+ height: `${virtualiser.getTotalSize() - HEADER_OFFSET_TOTAL + FOOTER_OFFSET_TOTAL}px`,
11622
11668
  paddingBottom,
11623
11669
  paddingTop
11624
11670
  };
@@ -11697,7 +11743,7 @@ function useRowGroupVirtualisation(table) {
11697
11743
  });
11698
11744
  }
11699
11745
  return indexes;
11700
- }, []);
11746
+ }, [rows]);
11701
11747
  // this is taken from the react-virtual docs/examples
11702
11748
  const rangeExtractor = React__default.useCallback(range => {
11703
11749
  var _reverse$find;
@@ -12412,23 +12458,20 @@ function DisplayCell(props) {
12412
12458
  isHighlighted,
12413
12459
  ...cellAttributes
12414
12460
  } = props;
12415
- const {
12416
- isHovered
12417
- } = React__default.useContext(RowContext);
12418
12461
  const columnMeta = cell.column.columnDef.meta;
12419
12462
  const attributes = getCellAttributes(cell, index, isHighlighted);
12420
12463
  const isTruncated = !!columnMeta.enableTruncate;
12464
+ const value = cell.getValue();
12421
12465
  let content;
12422
12466
  if (isInternalColumn(cell.column.id)) {
12423
12467
  content = reactTable.flexRender(cell.column.columnDef.cell, cell.getContext());
12424
12468
  } else {
12425
12469
  var _ref, _columnMeta$renderer, _columnMeta$renderer2;
12426
- content = (_ref = (_columnMeta$renderer = (_columnMeta$renderer2 = columnMeta.renderer) === null || _columnMeta$renderer2 === void 0 ? void 0 : _columnMeta$renderer2.call(columnMeta, cell.getValue(), cell.row.original)) !== null && _columnMeta$renderer !== void 0 ? _columnMeta$renderer : cell.getValue()) !== null && _ref !== void 0 ? _ref : null;
12470
+ content = (_ref = (_columnMeta$renderer = (_columnMeta$renderer2 = columnMeta.renderer) === null || _columnMeta$renderer2 === void 0 ? void 0 : _columnMeta$renderer2.call(columnMeta, value, cell.row.original)) !== null && _columnMeta$renderer !== void 0 ? _columnMeta$renderer : value) !== null && _ref !== void 0 ? _ref : null;
12427
12471
  }
12428
12472
  return /*#__PURE__*/React__default.createElement(MemoedDisplayCell, Object.assign({}, cellAttributes, attributes, {
12429
12473
  cellRef: cellRef,
12430
- isTruncated: isTruncated,
12431
- key: `${cell.id}_${isHovered}`
12474
+ isTruncated: isTruncated
12432
12475
  }), content);
12433
12476
  }
12434
12477
  const MemoedDisplayCell = /*#__PURE__*/React__default.memo(function MemoedDisplayCell(props) {
@@ -13144,7 +13187,7 @@ const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(prop
13144
13187
  const style = {};
13145
13188
  if (isPinned) {
13146
13189
  // pinned columns should be offset from either the left or right
13147
- style[isPinned] = `${footer.column.getStart(isPinned) - 1}px`;
13190
+ style[isPinned] = `${footer.column.getStart(isPinned)}px`;
13148
13191
  }
13149
13192
  let content;
13150
13193
  let align;
@@ -17745,7 +17788,9 @@ function useTableEditing(isEnabled = false, handleSave, validator) {
17745
17788
  const pendingChangesFns = usePendingChanges(isEnabled, handleSave, validator);
17746
17789
  // if focus leaves the table in any way, trigger a save
17747
17790
  const handleBlur = React__default.useCallback(event => {
17748
- if (event.relatedTarget !== event.currentTarget && !isElementInsideOrTriggeredFromContainer(event.relatedTarget, event.currentTarget)) {
17791
+ // custom event from datepicker, and it doesn't have the relatedTarget property set.
17792
+ const isClosingDatepicker = dateFns.isDate(event.detail);
17793
+ if (event.relatedTarget !== event.currentTarget && !isElementInsideOrTriggeredFromContainer(event.relatedTarget, event.currentTarget) && !isClosingDatepicker) {
17749
17794
  pendingChangesFns.saveChanges();
17750
17795
  }
17751
17796
  }, [pendingChangesFns.saveChanges]);
@@ -18279,8 +18324,15 @@ function useEditingCellAutofocus(props) {
18279
18324
  const tableElement = (_props$cellRef$curren3 = props.cellRef.current) === null || _props$cellRef$curren3 === void 0 ? void 0 : _props$cellRef$curren3.closest('table');
18280
18325
  if (tableElement && table.getIsSomeColumnsPinned() && !props.cell.column.getIsPinned()) {
18281
18326
  const columnFreezingOffset = table.getLeftTotalSize();
18282
- const leftOffsetFromScrollContainer = event.currentTarget.getBoundingClientRect().left - tableElement.getBoundingClientRect().left;
18283
- if (leftOffsetFromScrollContainer < columnFreezingOffset) {
18327
+ const targetRect = event.currentTarget.getBoundingClientRect();
18328
+ const tableRect = tableElement.getBoundingClientRect();
18329
+ const leftOffsetFromScrollContainer = targetRect.left - tableRect.left;
18330
+ const scrollbarWidth = tableElement.offsetWidth - tableElement.clientWidth; // the width of table vertical scrollbar
18331
+ if (
18332
+ // When pinned column overlaps the focused cell
18333
+ leftOffsetFromScrollContainer < columnFreezingOffset ||
18334
+ // When focused cell goes behidn the edge of the table
18335
+ leftOffsetFromScrollContainer + targetRect.width > tableRect.width - scrollbarWidth) {
18284
18336
  tableElement.scrollTo(props.cell.column.getStart() - columnFreezingOffset, tableElement.scrollTop);
18285
18337
  }
18286
18338
  }
@@ -18449,7 +18501,7 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
18449
18501
  if (type === 'datepicker') {
18450
18502
  const handleChange = event => {
18451
18503
  const newDate = event.detail;
18452
- if (dateFns.isDate(value) && dateFns.isDate(newDate) && !isWeakEqual(value, newDate)) {
18504
+ if (!value || dateFns.isDate(value) && dateFns.isDate(newDate) && !isWeakEqual(value, newDate)) {
18453
18505
  props.onChange(event.detail);
18454
18506
  }
18455
18507
  };