@economic/taco 2.45.0-alpha.0 → 2.45.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. package/dist/components/Layout/components/Top.d.ts +3 -3
  2. package/dist/components/Popover/Popover.d.ts +1 -1
  3. package/dist/components/Provider/Localization.d.ts +2 -0
  4. package/dist/components/Report/Report.d.ts +1 -1
  5. package/dist/components/Select2/components/Search.d.ts +0 -6
  6. package/dist/components/Select2/utilities.d.ts +2 -0
  7. package/dist/components/Table3/Table3.d.ts +2 -14
  8. package/dist/components/Table3/components/Columns/Internal/EditingActionsMenu.d.ts +1 -2
  9. package/dist/components/Table3/components/Editing/DiscardChangesConfirmationDialog.d.ts +7 -0
  10. package/dist/components/Table3/components/Row/Editing/CreateNewRow.d.ts +14 -0
  11. package/dist/components/Table3/components/Row/Editing/TemporaryRow.d.ts +11 -0
  12. package/dist/components/Table3/features/useEditingState.d.ts +29 -0
  13. package/dist/components/Table3/features/useTableEditing.d.ts +26 -36
  14. package/dist/components/Table3/listeners/useTableEditingListener.d.ts +1 -1
  15. package/dist/components/Table3/types.d.ts +24 -8
  16. package/dist/components/Table3/useTable3.d.ts +6 -0
  17. package/dist/components/Table3/util/editing.d.ts +7 -1
  18. package/dist/esm/index.css +35 -4
  19. package/dist/esm/packages/taco/src/components/Layout/components/Top.js +2 -2
  20. package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
  21. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +2 -2
  22. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
  23. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Provider/Localization.js +5 -3
  25. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  26. package/dist/esm/packages/taco/src/components/Select2/Select2.js +50 -45
  27. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +1 -1
  29. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +3 -13
  31. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  32. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +19 -1
  33. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +1 -10
  35. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Select2/utilities.js +11 -1
  37. package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Switch/Switch.js +1 -1
  39. package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Table3/Table3.js +14 -6
  41. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  42. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +1 -2
  43. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
  44. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +33 -11
  45. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
  46. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +5 -37
  47. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +17 -12
  49. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
  50. package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js +34 -0
  51. package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js.map +1 -0
  52. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +103 -0
  53. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -0
  54. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +2 -14
  55. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
  56. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +96 -0
  57. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -0
  58. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +39 -6
  59. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
  60. package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +4 -17
  61. package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
  62. package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +519 -0
  63. package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +1 -0
  64. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +29 -406
  65. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
  66. package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +44 -33
  67. package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
  68. package/dist/esm/packages/taco/src/components/Table3/useTable3.js +34 -13
  69. package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -1
  70. package/dist/esm/packages/taco/src/components/Table3/util/editing.js +11 -23
  71. package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
  72. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +20 -4
  73. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
  74. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +0 -4
  75. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
  76. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +1 -0
  77. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
  78. package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +1 -3
  79. package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
  80. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js +9 -3
  81. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
  82. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js +9 -7
  83. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
  84. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
  85. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +2 -2
  86. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
  87. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +4 -2
  88. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
  89. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js +2 -1
  90. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js.map +1 -1
  91. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +8 -1
  92. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
  93. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +29 -7
  94. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
  95. package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +2 -2
  96. package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
  97. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  98. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +2 -1
  99. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
  100. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js +3 -3
  101. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -1
  102. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +1 -1
  103. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  104. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +11 -0
  105. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  106. package/dist/esm/packages/taco/src/utils/dom.js +23 -12
  107. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  108. package/dist/index.css +35 -4
  109. package/dist/primitives/Collection/components/Root.d.ts +3 -1
  110. package/dist/primitives/Table/Core/components/Columns/Internal/Actions.d.ts +3 -1
  111. package/dist/primitives/Table/Core/components/Footer/Footer.d.ts +1 -1
  112. package/dist/primitives/Table/Core/components/Row/RowContext.d.ts +1 -0
  113. package/dist/primitives/Table/Core/features/useTableRenderer.d.ts +2 -2
  114. package/dist/primitives/Table/Core/features/useTableStyle.d.ts +3 -3
  115. package/dist/primitives/Table/Core/types.d.ts +4 -0
  116. package/dist/primitives/Table/Core/useTable.d.ts +2 -2
  117. package/dist/primitives/Table/types.d.ts +2 -2
  118. package/dist/primitives/Table/useTableManager/useTableManager.d.ts +1 -1
  119. package/dist/taco.cjs.development.js +1130 -756
  120. package/dist/taco.cjs.development.js.map +1 -1
  121. package/dist/taco.cjs.production.min.js +1 -1
  122. package/dist/taco.cjs.production.min.js.map +1 -1
  123. package/dist/utils/dom.d.ts +2 -1
  124. package/package.json +16 -16
  125. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js +0 -90
  126. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","sources":["../../../../../../src/utils/dom.ts"],"sourcesContent":["// taken from react-aria\nconst FOCUSABLE_ELEMENTS = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]',\n '[tabindex]:not([tabindex=\"-1\"]):not([disabled])',\n 'details:not([disabled])',\n 'summary:not(:disabled)',\n];\n\nexport const hasFocusableElement = (element: HTMLElement | null) => {\n if (!element) {\n return null;\n }\n\n return !!element.querySelector(FOCUSABLE_ELEMENTS.join(','));\n};\n\nexport const isOverflowing = (element: HTMLElement | null) =>\n element !== null ? element.scrollWidth > element.offsetWidth : false;\n\nexport const getIndexOfFirstChildOverflowingParent = (element: HTMLElement, overscan = 0) => {\n let index = 0;\n let boundaryChildIndex: number | null = null;\n const clientRect = element.getBoundingClientRect();\n\n for (const child of Array.from(element.children)) {\n const right = child.getBoundingClientRect().right - clientRect.left;\n const width = clientRect.width - overscan;\n\n if (right > width) {\n boundaryChildIndex = index;\n break;\n }\n index++;\n }\n\n return boundaryChildIndex;\n};\n\nexport const getNextFocussableElement = (currentElement: HTMLElement | null) => {\n if (!currentElement) {\n return null;\n }\n\n const focussableElements = [...document.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENTS.join(','))];\n const currentElementIndex = focussableElements.indexOf(currentElement);\n\n // If the currentElement is not in the focussable elements list or it is the last element\n if (currentElementIndex !== -1 && currentElementIndex === focussableElements.length - 1) {\n return null;\n }\n\n return focussableElements[currentElementIndex + 1];\n};\n\nconst getOverlaySelector = (element: Element | null) => {\n switch (element?.getAttribute('role')) {\n case 'dialog':\n return `[aria-controls='${element.id}']`;\n\n case 'menu':\n return `#${element.getAttribute('aria-labelledby')}`;\n\n default:\n return undefined;\n }\n};\n\nexport function isElementInsideOrTriggeredFromContainer(element: Element | null, container: Element | null): boolean {\n const selector = getOverlaySelector(element) ?? getOverlaySelector(element?.closest('[role=dialog],[role=menu]') ?? null);\n\n if (selector) {\n if (container?.querySelector(selector)) {\n return true;\n }\n\n const elementInDocument = document.querySelector(selector);\n\n // if the element does exist, see if it is itself connected to somethng that was triggered from the container\n if (elementInDocument) {\n return isElementInsideOrTriggeredFromContainer(elementInDocument, container);\n }\n\n return false;\n }\n\n return !!container?.contains(element);\n}\n\nexport function isElementInsideOverlay(element: Element | null) {\n return !!element?.closest('[role=dialog],[role=menu]');\n}\n\nexport function isSiblingElementInsideSameParentOverlay(element: Element | null, sibling: Element | null) {\n return !!element?.closest('[role=dialog],[role=menu]')?.contains(sibling);\n}\n\nexport function isElementInteractive(element: Element | null) {\n if (!element) {\n return false;\n }\n\n return (\n ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'LABEL', 'OPTION'].includes(element.tagName) &&\n !(element as HTMLElement).hidden &&\n !(element as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement).disabled &&\n !(element as HTMLInputElement | HTMLTextAreaElement).readOnly\n );\n}\n\nexport function isElementInsideTable3OrReport(element: Element | null) {\n return !!element?.closest('[data-taco^=table]');\n}\n\nexport function setDataFocusAttribute(target: Element) {\n target.setAttribute('data-focus', 'programmatic');\n\n const cleanup = () => {\n target.removeAttribute('data-focus');\n target.removeEventListener('blur', cleanup);\n };\n\n target.addEventListener('blur', cleanup);\n}\n"],"names":["FOCUSABLE_ELEMENTS","hasFocusableElement","element","querySelector","join","getIndexOfFirstChildOverflowingParent","overscan","index","boundaryChildIndex","clientRect","getBoundingClientRect","child","Array","from","children","right","left","width","getNextFocussableElement","currentElement","focussableElements","document","querySelectorAll","currentElementIndex","indexOf","length","getOverlaySelector","getAttribute","id","undefined","isElementInsideOrTriggeredFromContainer","container","selector","_getOverlaySelector","_element$closest","closest","elementInDocument","contains","isElementInsideOverlay","isSiblingElementInsideSameParentOverlay","sibling","_element$closest2","isElementInteractive","includes","tagName","hidden","disabled","readOnly","isElementInsideTable3OrReport","setDataFocusAttribute","target","setAttribute","cleanup","removeAttribute","removeEventListener","addEventListener"],"mappings":"AAAA;AACA,MAAMA,kBAAkB,GAAG,CACvB,0CAA0C,EAC1C,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iDAAiD,EACjD,yBAAyB,EACzB,wBAAwB,CAC3B;MAEYC,mBAAmB,GAAIC,OAA2B;EAC3D,IAAI,CAACA,OAAO,EAAE;IACV,OAAO,IAAI;;EAGf,OAAO,CAAC,CAACA,OAAO,CAACC,aAAa,CAACH,kBAAkB,CAACI,IAAI,CAAC,GAAG,CAAC,CAAC;AAChE;MAKaC,qCAAqC,GAAGA,CAACH,OAAoB,EAAEI,QAAQ,GAAG,CAAC;EACpF,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,kBAAkB,GAAkB,IAAI;EAC5C,MAAMC,UAAU,GAAGP,OAAO,CAACQ,qBAAqB,EAAE;EAElD,KAAK,MAAMC,KAAK,IAAIC,KAAK,CAACC,IAAI,CAACX,OAAO,CAACY,QAAQ,CAAC,EAAE;IAC9C,MAAMC,KAAK,GAAGJ,KAAK,CAACD,qBAAqB,EAAE,CAACK,KAAK,GAAGN,UAAU,CAACO,IAAI;IACnE,MAAMC,KAAK,GAAGR,UAAU,CAACQ,KAAK,GAAGX,QAAQ;IAEzC,IAAIS,KAAK,GAAGE,KAAK,EAAE;MACfT,kBAAkB,GAAGD,KAAK;MAC1B;;IAEJA,KAAK,EAAE;;EAGX,OAAOC,kBAAkB;AAC7B;MAEaU,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,MAAM,CAACI,mBAAmB,CAAC,MAAM,EAAEF,OAAO,CAAC;GAC9C;EAEDF,MAAM,CAACK,gBAAgB,CAAC,MAAM,EAAEH,OAAO,CAAC;AAC5C;;;;"}
1
+ {"version":3,"file":"dom.js","sources":["../../../../../../src/utils/dom.ts"],"sourcesContent":["// taken from react-aria\nconst FOCUSABLE_ELEMENTS = [\n '[tabindex]:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]',\n 'details:not([disabled])',\n 'summary:not(:disabled)',\n];\n\nexport const hasFocusableElement = (element: HTMLElement | null) => {\n if (!element) {\n return null;\n }\n\n return !!element.querySelector(FOCUSABLE_ELEMENTS.join(','));\n};\n\nexport const isOverflowing = (element: HTMLElement | null) =>\n element !== null ? element.scrollWidth > element.offsetWidth : false;\n\nexport const getIndexOfFirstChildOverflowingParent = (element: HTMLElement, overscan = 0) => {\n let index = 0;\n let boundaryChildIndex: number | null = null;\n const clientRect = element.getBoundingClientRect();\n\n for (const child of Array.from(element.children)) {\n const right = child.getBoundingClientRect().right - clientRect.left;\n const width = clientRect.width - overscan;\n\n if (right > width) {\n boundaryChildIndex = index;\n break;\n }\n index++;\n }\n\n return boundaryChildIndex;\n};\n\nexport const getNextFocussableElement = (currentElement: HTMLElement | null) => {\n if (!currentElement) {\n return null;\n }\n\n let focussableElements = [...document.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENTS.join(','))];\n const currentElementIndex = focussableElements.indexOf(currentElement);\n\n if (currentElementIndex > -1) {\n focussableElements = focussableElements\n .slice(currentElementIndex + 1)\n .filter(element => element.getAttribute('tabindex') !== '-1');\n\n if (focussableElements.length) {\n focussableElements = focussableElements.filter(element => (element as any).checkVisibility?.() ?? true);\n return focussableElements[0] ?? null;\n }\n }\n\n return null;\n};\n\nconst getOverlaySelector = (element: Element | null) => {\n switch (element?.getAttribute('role')) {\n case 'dialog':\n return `[aria-controls='${element.id}']`;\n\n case 'menu':\n return `#${element.getAttribute('aria-labelledby')}`;\n\n default:\n return undefined;\n }\n};\n\nexport function isElementTriggeredFromContainer(element: Element | null, container: Element | null) {\n const selector = getOverlaySelector(element) ?? getOverlaySelector(element?.closest('[role=dialog],[role=menu]') ?? null);\n\n if (selector) {\n const escapedSelector = CSS.escape(selector);\n\n if (container?.querySelector(escapedSelector)) {\n return true;\n }\n\n const elementInDocument = document.querySelector(escapedSelector);\n\n // if the element does exist, see if it is itself connected to somethng that was triggered from the container\n if (elementInDocument) {\n return isElementTriggeredFromContainer(elementInDocument, container);\n }\n\n return false;\n }\n\n return false;\n}\n\nexport function isElementInsideOrTriggeredFromContainer(element: Element | null, container: Element | null) {\n return isElementTriggeredFromContainer(element, container) || !!container?.contains(element);\n}\n\nexport function isElementInsideOverlay(element: Element | null) {\n return !!element?.closest('[role=dialog],[role=menu]');\n}\n\nexport function isSiblingElementInsideSameParentOverlay(element: Element | null, sibling: Element | null) {\n return !!element?.closest('[role=dialog],[role=menu]')?.contains(sibling);\n}\n\nexport function isElementInteractive(element: Element | null) {\n if (!element) {\n return false;\n }\n\n return (\n ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'LABEL', 'OPTION'].includes(element.tagName) &&\n !(element as HTMLElement).hidden &&\n !(element as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement).disabled &&\n !(element as HTMLInputElement | HTMLTextAreaElement).readOnly\n );\n}\n\nexport function isElementInsideTable3OrReport(element: Element | null) {\n return !!element?.closest('[data-taco^=table]');\n}\n\nexport function setDataFocusAttribute(target: Element) {\n target.setAttribute('data-focus', 'programmatic');\n\n const cleanup = () => {\n target.removeAttribute('data-focus');\n target.removeEventListener('blur', cleanup);\n };\n\n target.addEventListener('blur', cleanup);\n}\n"],"names":["FOCUSABLE_ELEMENTS","hasFocusableElement","element","querySelector","join","getIndexOfFirstChildOverflowingParent","overscan","index","boundaryChildIndex","clientRect","getBoundingClientRect","child","Array","from","children","right","left","width","getNextFocussableElement","currentElement","focussableElements","document","querySelectorAll","currentElementIndex","indexOf","slice","filter","getAttribute","length","_focussableElements$","_element$checkVisibil","_element$checkVisibil2","checkVisibility","call","getOverlaySelector","id","undefined","isElementTriggeredFromContainer","container","selector","_getOverlaySelector","_element$closest","closest","escapedSelector","CSS","escape","elementInDocument","isElementInsideOrTriggeredFromContainer","contains","isElementInsideOverlay","isSiblingElementInsideSameParentOverlay","sibling","_element$closest2","isElementInteractive","includes","tagName","hidden","disabled","readOnly","isElementInsideTable3OrReport","setDataFocusAttribute","target","setAttribute","cleanup","removeAttribute","removeEventListener","addEventListener"],"mappings":"AAAA;AACA,MAAMA,kBAAkB,GAAG,CACvB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,CAC3B;MAEYC,mBAAmB,GAAIC,OAA2B;EAC3D,IAAI,CAACA,OAAO,EAAE;IACV,OAAO,IAAI;;EAGf,OAAO,CAAC,CAACA,OAAO,CAACC,aAAa,CAACH,kBAAkB,CAACI,IAAI,CAAC,GAAG,CAAC,CAAC;AAChE;MAKaC,qCAAqC,GAAGA,CAACH,OAAoB,EAAEI,QAAQ,GAAG,CAAC;EACpF,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,kBAAkB,GAAkB,IAAI;EAC5C,MAAMC,UAAU,GAAGP,OAAO,CAACQ,qBAAqB,EAAE;EAElD,KAAK,MAAMC,KAAK,IAAIC,KAAK,CAACC,IAAI,CAACX,OAAO,CAACY,QAAQ,CAAC,EAAE;IAC9C,MAAMC,KAAK,GAAGJ,KAAK,CAACD,qBAAqB,EA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AC,2BAA2B,CAAC;AAC1D;SAEgBQ,uCAAuCA,CAAChD,OAAuB,EAAEiD,OAAuB;;EACpG,OAAO,CAAC,EAACjD,OAAO,aAAPA,OAAO,gBAAAkD,iBAAA,GAAPlD,OAAO,CAAEwC,OAAO,CAAC,2BAA2B,CAAC,cAAAU,iBAAA,eAA7CA,iBAAA,CAA+CJ,QAAQ,CAACG,OAAO,CAAC;AAC7E;SAEgBE,oBAAoBA,CAACnD,OAAuB;EACxD,IAAI,CAACA,OAAO,EAAE;IACV,OAAO,KAAK;;EAGhB,OACI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAACoD,QAAQ,CAACpD,OAAO,CAACqD,OAAO,CAAC,IAC3F,CAAErD,OAAuB,CAACsD,MAAM,IAChC,CAAEtD,OAA0F,CAACuD,QAAQ,IACrG,CAAEvD,OAAkD,CAACwD,QAAQ;AAErE;SAEgBC,6BAA6BA,CAACzD,OAAuB;EACjE,OAAO,CAAC,EAACA,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEwC,OAAO,CAAC,oBAAoB,CAAC;AACnD;SAEgBkB,qBAAqBA,CAACC,MAAe;EACjDA,MAAM,CAACC,YAAY,CAAC,YAAY,EAAE,cAAc,CAAC;EAEjD,MAAMC,OAAO,GAAGA;IACZF,MAAM,CAACG,eAAe,CAAC,YAAY,CAAC;IACpCH,MAAM,CAACI,mBAAmB,CAAC,MAAM,EAAEF,OAAO,CAAC;GAC9C;EAEDF,MAAM,CAACK,gBAAgB,CAAC,MAAM,EAAEH,OAAO,CAAC;AAC5C;;;;"}
package/dist/index.css CHANGED
@@ -833,7 +833,7 @@ table[data-taco^='table'][data-table-font-size='small'] td [data-taco='tag'] {
833
833
  table[data-taco^='table'][data-table-font-size='small'] td [data-taco='select2-container'],
834
834
  table[data-taco^='table'][data-table-font-size='small'] td [data-taco='Select2'],
835
835
  table[data-taco^='table'][data-table-font-size='small'] td [data-taco='textarea'] {
836
- @apply !-mx-[7px] !-mt-[4px] !min-h-[theme(spacing.6)] !w-[calc(100%_+_14px)] text-xs focus:z-10;
836
+ @apply !-mx-[7px] !-my-[4px] !min-h-[theme(spacing.6)] !w-[calc(100%_+_14px)] text-xs focus:z-10;
837
837
  }
838
838
 
839
839
  table[data-taco^='table'][data-table-font-size='small'] td [data-taco='input-container']:has([data-taco='input']) {
@@ -923,7 +923,7 @@ table[data-taco^='table'][data-table-font-size='medium'] td [role='combobox'] [d
923
923
  table[data-taco^='table'][data-table-font-size='medium'] td [data-taco='select2-container'],
924
924
  table[data-taco^='table'][data-table-font-size='medium'] td [data-taco='Select2'],
925
925
  table[data-taco^='table'][data-table-font-size='medium'] td [data-taco='textarea'] {
926
- @apply !-mx-[9px] !-mt-[6px] !min-h-[theme(spacing.8)] !w-[calc(100%_+_16px)] focus:z-10;
926
+ @apply !-mx-[9px] !-my-[6px] !min-h-[theme(spacing.8)] !w-[calc(100%_+_16px)] focus:z-10;
927
927
  }
928
928
 
929
929
  table[data-taco^='table'][data-table-font-size='medium'] td [data-taco='input-container']:has([data-taco='input']) {
@@ -1294,17 +1294,25 @@ table[data-taco='table3'][data-table-editing-mode] tbody tr[data-row-editing-mov
1294
1294
 
1295
1295
  /* invalid rows */
1296
1296
 
1297
- table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true'] > td, table[data-taco='table3']:focus-within > tbody > tr[data-row-editing-invalid='true'] > td, table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true'] > td {
1297
+ table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true'] > td,
1298
+ table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true']:not([data-row-selected]):not([data-row-active]) > td,
1299
+ table[data-taco='table3']:focus-within > tbody > tr[data-row-editing-invalid='true'] > td,
1300
+ table[data-taco='table3']:focus-within > tbody > tr[data-row-editing-invalid='true']:not([data-row-selected]):not([data-row-active]) > td,
1301
+ table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true'] > td,
1302
+ table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true']:not([data-row-selected]):not([data-row-active]) > td {
1298
1303
  --table-row-actions-shadow: #ffe4de;
1299
1304
  @apply bg-[#ffede9];
1300
1305
  }
1301
1306
 
1302
1307
  table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true']:hover > td,
1303
1308
  table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true'][data-row-group] > td,
1309
+ table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true']:hover:not([data-row-selected]):not([data-row-active]) > td,
1304
1310
  table[data-taco='table3']:focus-within > tbody > tr[data-row-editing-invalid='true']:hover > td,
1305
1311
  table[data-taco='table3']:focus-within > tbody > tr[data-row-editing-invalid='true'][data-row-group] > td,
1312
+ table[data-taco='table3']:focus-within > tbody > tr[data-row-editing-invalid='true']:hover:not([data-row-selected]):not([data-row-active]) > td,
1306
1313
  table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true']:hover > td,
1307
- table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true'][data-row-group] > td {
1314
+ table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true'][data-row-group] > td,
1315
+ table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true']:hover:not([data-row-selected]):not([data-row-active]) > td {
1308
1316
  --table-row-actions-shadow: #ffe4de;
1309
1317
  @apply bg-[#ffe4de];
1310
1318
  }
@@ -1337,3 +1345,26 @@ table[data-taco='table3'] > tbody > tr[data-row-editing-invalid='true']:not([dat
1337
1345
  table[data-taco='table3'][data-table-pause-hover='true'] > tbody > tr[data-row-editing-invalid='true']:not([data-row-active='true']) td [data-taco='Select2'] {
1338
1346
  @apply !bg-transparent;
1339
1347
  }
1348
+
1349
+ table[data-taco^='table'][data-table-font-size='medium'] tr[data-row-create] td [data-taco='spinner'] {
1350
+ @apply !h-4 !w-4;
1351
+ }
1352
+
1353
+ table[data-taco^='table'] tr [data-row-move-indicator] {
1354
+ @apply wcag-blue-500 absolute left-0 z-10 ml-1 whitespace-nowrap px-1 py-1 text-xs font-bold;
1355
+ }
1356
+
1357
+ table[data-taco^='table'] tr[data-row-id^='temp-'] [data-row-move-indicator] {
1358
+ @apply bottom-full rounded-t-md;
1359
+ }
1360
+
1361
+ table[data-taco^='table'] tr:not([data-row-id^='temp-']) [data-row-move-indicator] {
1362
+ @apply top-full rounded-b-md;
1363
+ }
1364
+
1365
+ table[data-taco^='table'][data-table-row-height='short'] tr[data-row-create] td,
1366
+ table[data-taco^='table'][data-table-row-height='medium'] tr[data-row-create] td,
1367
+ table[data-taco^='table'][data-table-row-height='tall'] tr[data-row-create] td,
1368
+ table[data-taco^='table'][data-table-row-height='extra-tall'] tr[data-row-create] td {
1369
+ @apply !min-h-[41px] !pt-[10px];
1370
+ }
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
2
  export declare type CollectionProps = React.HTMLAttributes<HTMLDivElement> & {
3
3
  querySelector: string;
4
+ resetOnChange?: unknown;
4
5
  };
5
6
  export declare type CollectionRef = HTMLDivElement & {
6
- setActiveIndex: (option: HTMLDivElement) => void;
7
+ setActiveIndexByElement: (option: HTMLDivElement) => void;
7
8
  };
8
9
  export declare const Root: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
9
10
  querySelector: string;
11
+ resetOnChange?: unknown;
10
12
  } & React.RefAttributes<CollectionRef>>;
11
13
  export declare const getNextIndexFromKeycode: (event: React.KeyboardEvent, length: number, activeIndex: number | undefined) => number | undefined;
12
14
  export declare const getNextEnabledItem: (event: React.KeyboardEvent<HTMLElement>, options: NodeListOf<Element>, activeIndex: number | undefined, recurse?: boolean) => number | undefined;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
- import { TableRowActionRenderer } from '../../../../types';
2
+ import { Table as ReactTable } from '@tanstack/react-table';
3
3
  import { useTableManagerInternalColumn } from '../../../../useTableManager/types';
4
+ import { TableRowActionRenderer } from '../../../../types';
4
5
  export declare type ActionsProps<TType = unknown> = {
5
6
  actions: TableRowActionRenderer<TType>[];
6
7
  actionsLength: number;
7
8
  data: any;
8
9
  isActiveRow: boolean;
9
10
  rowId: string;
11
+ table: ReactTable<TType>;
10
12
  };
11
13
  export declare function Actions<TType = unknown>(props: ActionsProps<TType>): React.JSX.Element;
12
14
  export declare const renderer: useTableManagerInternalColumn;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Header as ReactTableHeader, Table as ReactTable } from '@tanstack/react-table';
3
- export declare type FootProps<TType = unknown> = {
3
+ export declare type FootProps<TType = unknown> = React.HTMLAttributes<HTMLTableSectionElement> & {
4
4
  table: ReactTable<TType>;
5
5
  };
6
6
  export declare function Foot<TType = unknown>(props: FootProps<TType>): React.JSX.Element;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  declare type RowContextValue = {
3
3
  isHovered: boolean;
4
4
  rowIndex: number;
5
+ hideRowActions: boolean;
5
6
  };
6
7
  export declare const RowContext: React.Context<RowContextValue>;
7
8
  export {};
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Table as ReactTable } from '@tanstack/react-table';
3
3
  import { ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';
4
- import { useTableRenderers } from '../types';
4
+ import { useTableRenderers, useTableRenderOptions } from '../types';
5
5
  import { TableRef } from '../../types';
6
- export declare function useTableRenderer<TType = unknown>(renderers: useTableRenderers<TType>, table: ReactTable<TType>, tableRef: React.RefObject<TableRef>, defaultRowActiveIndex?: number | undefined): {
6
+ export declare function useTableRenderer<TType = unknown>(renderers: useTableRenderers<TType>, table: ReactTable<TType>, tableRef: React.RefObject<TableRef>, defaultRowActiveIndex?: number | undefined, options?: useTableRenderOptions): {
7
7
  rows: (JSX.Element | null)[] | null;
8
8
  style: React.CSSProperties;
9
9
  scrollToIndex: (index: number, options?: ReactVirtualScrollToOptions) => void;
@@ -16,7 +16,7 @@ export declare function useTableStyle<TType = unknown>(tableId: string, table: R
16
16
  animationPlayState?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "paused" | "running" | undefined;
17
17
  animationTimeline?: (string & {}) | "auto" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | undefined;
18
18
  animationTimingFunction?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear" | undefined;
19
- appearance?: "auto" | "textarea" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "button" | "checkbox" | "listbox" | "menulist" | "meter" | "progress-bar" | "push-button" | "radio" | "searchfield" | "slider-horizontal" | "square-button" | "menulist-button" | "textfield" | undefined;
19
+ appearance?: "auto" | "checkbox" | "textarea" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "button" | "listbox" | "menulist" | "meter" | "progress-bar" | "push-button" | "radio" | "searchfield" | "slider-horizontal" | "square-button" | "menulist-button" | "textfield" | undefined;
20
20
  aspectRatio?: (string & {}) | "auto" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined;
21
21
  backdropFilter?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | undefined;
22
22
  backfaceVisibility?: "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "hidden" | "visible" | undefined;
@@ -414,7 +414,7 @@ export declare function useTableStyle<TType = unknown>(tableId: string, table: R
414
414
  MozAnimationName?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | undefined;
415
415
  MozAnimationPlayState?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "paused" | "running" | undefined;
416
416
  MozAnimationTimingFunction?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear" | undefined;
417
- MozAppearance?: "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "button" | "checkbox" | "listbox" | "menulist" | "radio" | "searchfield" | "menulist-button" | "textfield" | "-moz-mac-unified-toolbar" | "-moz-win-borderless-glass" | "-moz-win-browsertabbar-toolbox" | "-moz-win-communications-toolbox" | "-moz-win-communicationstext" | "-moz-win-exclude-glass" | "-moz-win-glass" | "-moz-win-media-toolbox" | "-moz-win-mediatext" | "-moz-window-button-box" | "-moz-window-button-box-maximized" | "-moz-window-button-close" | "-moz-window-button-maximize" | "-moz-window-button-minimize" | "-moz-window-button-restore" | "-moz-window-frame-bottom" | "-moz-window-frame-left" | "-moz-window-frame-right" | "-moz-window-titlebar" | "-moz-window-titlebar-maximized" | "button-arrow-down" | "button-arrow-next" | "button-arrow-previous" | "button-arrow-up" | "button-bevel" | "button-focus" | "caret" | "checkbox-container" | "checkbox-label" | "checkmenuitem" | "dualbutton" | "groupbox" | "listitem" | "menuarrow" | "menubar" | "menucheckbox" | "menuimage" | "menuitem" | "menuitemtext" | "menulist-text" | "menulist-textfield" | "menupopup" | "menuradio" | "menuseparator" | "meterbar" | "meterchunk" | "progressbar" | "progressbar-vertical" | "progresschunk" | "progresschunk-vertical" | "radio-container" | "radio-label" | "radiomenuitem" | "range" | "range-thumb" | "resizer" | "resizerpanel" | "scale-horizontal" | "scale-vertical" | "scalethumb-horizontal" | "scalethumb-vertical" | "scalethumbend" | "scalethumbstart" | "scalethumbtick" | "scrollbarbutton-down" | "scrollbarbutton-left" | "scrollbarbutton-right" | "scrollbarbutton-up" | "scrollbarthumb-horizontal" | "scrollbarthumb-vertical" | "scrollbartrack-horizontal" | "scrollbartrack-vertical" | "separator" | "sheet" | "spinner" | "spinner-downbutton" | "spinner-textfield" | "spinner-upbutton" | "splitter" | "statusbar" | "statusbarpanel" | "tab" | "tab-scroll-arrow-back" | "tab-scroll-arrow-forward" | "tabpanel" | "tabpanels" | "textfield-multiline" | "toolbar" | "toolbarbutton" | "toolbarbutton-dropdown" | "toolbargripper" | "toolbox" | "tooltip" | "treeheader" | "treeheadercell" | "treeheadersortarrow" | "treeitem" | "treeline" | "treetwisty" | "treetwistyopen" | "treeview" | undefined;
417
+ MozAppearance?: "checkbox" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "button" | "listbox" | "menulist" | "radio" | "searchfield" | "menulist-button" | "textfield" | "-moz-mac-unified-toolbar" | "-moz-win-borderless-glass" | "-moz-win-browsertabbar-toolbox" | "-moz-win-communications-toolbox" | "-moz-win-communicationstext" | "-moz-win-exclude-glass" | "-moz-win-glass" | "-moz-win-media-toolbox" | "-moz-win-mediatext" | "-moz-window-button-box" | "-moz-window-button-box-maximized" | "-moz-window-button-close" | "-moz-window-button-maximize" | "-moz-window-button-minimize" | "-moz-window-button-restore" | "-moz-window-frame-bottom" | "-moz-window-frame-left" | "-moz-window-frame-right" | "-moz-window-titlebar" | "-moz-window-titlebar-maximized" | "button-arrow-down" | "button-arrow-next" | "button-arrow-previous" | "button-arrow-up" | "button-bevel" | "button-focus" | "caret" | "checkbox-container" | "checkbox-label" | "checkmenuitem" | "dualbutton" | "groupbox" | "listitem" | "menuarrow" | "menubar" | "menucheckbox" | "menuimage" | "menuitem" | "menuitemtext" | "menulist-text" | "menulist-textfield" | "menupopup" | "menuradio" | "menuseparator" | "meterbar" | "meterchunk" | "progressbar" | "progressbar-vertical" | "progresschunk" | "progresschunk-vertical" | "radio-container" | "radio-label" | "radiomenuitem" | "range" | "range-thumb" | "resizer" | "resizerpanel" | "scale-horizontal" | "scale-vertical" | "scalethumb-horizontal" | "scalethumb-vertical" | "scalethumbend" | "scalethumbstart" | "scalethumbtick" | "scrollbarbutton-down" | "scrollbarbutton-left" | "scrollbarbutton-right" | "scrollbarbutton-up" | "scrollbarthumb-horizontal" | "scrollbarthumb-vertical" | "scrollbartrack-horizontal" | "scrollbartrack-vertical" | "separator" | "sheet" | "spinner" | "spinner-downbutton" | "spinner-textfield" | "spinner-upbutton" | "splitter" | "statusbar" | "statusbarpanel" | "tab" | "tab-scroll-arrow-back" | "tab-scroll-arrow-forward" | "tabpanel" | "tabpanels" | "textfield-multiline" | "toolbar" | "toolbarbutton" | "toolbarbutton-dropdown" | "toolbargripper" | "toolbox" | "tooltip" | "treeheader" | "treeheadercell" | "treeheadersortarrow" | "treeitem" | "treeline" | "treetwisty" | "treetwistyopen" | "treeview" | undefined;
418
418
  MozBackfaceVisibility?: "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "hidden" | "visible" | undefined;
419
419
  MozBorderBottomColors?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "grey" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "transparent" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonFace" | "ButtonHighlight" | "ButtonShadow" | "ButtonText" | "CaptionText" | "GrayText" | "Highlight" | "HighlightText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentcolor" | "none" | undefined;
420
420
  MozBorderEndColor?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "grey" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "transparent" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonFace" | "ButtonHighlight" | "ButtonShadow" | "ButtonText" | "CaptionText" | "GrayText" | "Highlight" | "HighlightText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "currentcolor" | undefined;
@@ -532,7 +532,7 @@ export declare function useTableStyle<TType = unknown>(tableId: string, table: R
532
532
  WebkitAnimationName?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | undefined;
533
533
  WebkitAnimationPlayState?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "paused" | "running" | undefined;
534
534
  WebkitAnimationTimingFunction?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear" | undefined;
535
- WebkitAppearance?: "textarea" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "button" | "checkbox" | "listbox" | "menulist" | "meter" | "progress-bar" | "push-button" | "radio" | "searchfield" | "slider-horizontal" | "square-button" | "menulist-button" | "textfield" | "button-bevel" | "caret" | "listitem" | "menulist-text" | "menulist-textfield" | "-apple-pay-button" | "default-button" | "inner-spin-button" | "media-controls-background" | "media-controls-fullscreen-background" | "media-current-time-display" | "media-enter-fullscreen-button" | "media-exit-fullscreen-button" | "media-fullscreen-button" | "media-mute-button" | "media-overlay-play-button" | "media-play-button" | "media-seek-back-button" | "media-seek-forward-button" | "media-slider" | "media-sliderthumb" | "media-time-remaining-display" | "media-toggle-closed-captions-button" | "media-volume-slider" | "media-volume-slider-container" | "media-volume-sliderthumb" | "progress-bar-value" | "searchfield-cancel-button" | "searchfield-decoration" | "searchfield-results-button" | "searchfield-results-decoration" | "slider-vertical" | "sliderthumb-horizontal" | "sliderthumb-vertical" | undefined;
535
+ WebkitAppearance?: "checkbox" | "textarea" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "button" | "listbox" | "menulist" | "meter" | "progress-bar" | "push-button" | "radio" | "searchfield" | "slider-horizontal" | "square-button" | "menulist-button" | "textfield" | "button-bevel" | "caret" | "listitem" | "menulist-text" | "menulist-textfield" | "-apple-pay-button" | "default-button" | "inner-spin-button" | "media-controls-background" | "media-controls-fullscreen-background" | "media-current-time-display" | "media-enter-fullscreen-button" | "media-exit-fullscreen-button" | "media-fullscreen-button" | "media-mute-button" | "media-overlay-play-button" | "media-play-button" | "media-seek-back-button" | "media-seek-forward-button" | "media-slider" | "media-sliderthumb" | "media-time-remaining-display" | "media-toggle-closed-captions-button" | "media-volume-slider" | "media-volume-slider-container" | "media-volume-sliderthumb" | "progress-bar-value" | "searchfield-cancel-button" | "searchfield-decoration" | "searchfield-results-button" | "searchfield-results-decoration" | "slider-vertical" | "sliderthumb-horizontal" | "sliderthumb-vertical" | undefined;
536
536
  WebkitBackdropFilter?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | undefined;
537
537
  WebkitBackfaceVisibility?: "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "hidden" | "visible" | undefined;
538
538
  WebkitBackgroundClip?: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "border-box" | "content-box" | "padding-box" | undefined;
@@ -1,11 +1,15 @@
1
1
  import React from 'react';
2
2
  import { Table as ReactTable, Row as ReactTableRow, Cell as ReactTableCell } from '@tanstack/react-table';
3
+ export declare type useTableRenderOptions = {
4
+ virtualiserPaddingEndOffset?: number;
5
+ };
3
6
  export declare type useTableRenderers<TType = unknown> = {
4
7
  row: TableRowRenderer<TType>;
5
8
  cell: TableCellRenderer<TType>;
6
9
  };
7
10
  export declare type TableRowRendererProps<TType = unknown> = {
8
11
  cellRenderer: TableCellRenderer<TType>;
12
+ hideRowActions?: boolean;
9
13
  index: number;
10
14
  measureRow: (size: number, expansionHeight?: number) => void;
11
15
  row: ReactTableRow<TType>;
@@ -3,7 +3,7 @@ import { Table as ReactTable, TableMeta as ReactTableMeta, TableState as ReactTa
3
3
  import { ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';
4
4
  import { TableCustomSettingsRenderer, TableEmptyStateRenderer, TableProps } from '../types';
5
5
  import { TableRef } from '../types';
6
- import { useTableRenderers } from './types';
6
+ import { useTableRenderers, useTableRenderOptions } from './types';
7
7
  export declare type useTableReturnValue<TType = unknown> = {
8
8
  id: string;
9
9
  instance: ReactTable<TType>;
@@ -25,4 +25,4 @@ export declare type useTableReturnValue<TType = unknown> = {
25
25
  stylesheet: string;
26
26
  state: ReactTableState;
27
27
  };
28
- export declare function useTable<TType = unknown, TMeta = {}>(props: TableProps<TType>, externalRef: React.Ref<TableRef>, renderers: useTableRenderers<TType>, meta?: Partial<ReactTableMeta<TType>> & TMeta): useTableReturnValue<TType>;
28
+ export declare function useTable<TType = unknown, TMeta = {}>(props: TableProps<TType>, externalRef: React.Ref<TableRef>, renderers: useTableRenderers<TType>, meta?: Partial<ReactTableMeta<TType>> & TMeta, options?: useTableRenderOptions): useTableReturnValue<TType>;
@@ -41,7 +41,7 @@ export declare type TableColumnFilter = ReactTableColumnFilter;
41
41
  export declare type TableColumnMenu = ((columnId: string) => React.ReactNode | null)[];
42
42
  export declare type TableColumnRenderer<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;
43
43
  export declare type TableColumnRendererAggregate<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;
44
- export declare type TableColumnRendererControl<TType = unknown> = ((props: TableColumnRendererControlProps, row?: TType) => JSX.Element) | 'datepicker' | 'input' | 'switch' | 'textarea';
44
+ export declare type TableColumnRendererControl<TType = unknown> = ((props: TableColumnRendererControlProps, row?: TType) => JSX.Element) | 'datepicker' | 'input' | 'switch' | 'checkbox' | 'textarea';
45
45
  export declare type TableColumnRendererControlProps = {
46
46
  className?: string;
47
47
  disabled?: boolean;
@@ -164,7 +164,7 @@ export declare type TableCommonProps<TType = unknown> = TableFeatureProps<TType>
164
164
  rowActionsForGroup?: TableRowActionGroupRenderer<TType>[];
165
165
  rowActionsLength?: number;
166
166
  rowExpansionRenderer?: TableRowExpansionRenderer<TType>;
167
- rowIdentityColumnId?: string;
167
+ rowIdentityAccessor?: keyof TType;
168
168
  shortcuts?: TableShortcuts<TType>;
169
169
  toolbarLeft?: JSX.Element;
170
170
  toolbarRight?: JSX.Element;
@@ -35,7 +35,7 @@ declare module '@tanstack/table-core' {
35
35
  rowGoto: ReturnType<typeof useTableRowGoto>;
36
36
  rowGroups: ReturnType<typeof useTableRowGroups>;
37
37
  rowHeight: ReturnType<typeof useTableRowHeight>;
38
- rowIdentityColumnId?: string;
38
+ rowIdentityAccessor: keyof TData;
39
39
  rowSelection: ReturnType<typeof useTableRowSelection>;
40
40
  search: ReturnType<typeof useTableSearch>;
41
41
  server: ReturnType<typeof useTableServerLoading>;