@economic/taco 2.12.1 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. package/dist/components/Field/Field.d.ts +4 -2
  2. package/dist/components/Icon/components/Location.d.ts +3 -0
  3. package/dist/components/Icon/components/index.d.ts +1 -1
  4. package/dist/components/Input/Input.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/Provider/Localization.d.ts +1 -113
  9. package/dist/components/Select2/components/Option.d.ts +7 -5
  10. package/dist/components/Select2/components/Search.d.ts +1 -1
  11. package/dist/components/Table3/Table3.d.ts +9 -1
  12. package/dist/components/Table3/components/columns/header/Group.d.ts +15 -0
  13. package/dist/components/Table3/components/columns/header/Header.d.ts +5 -0
  14. package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
  15. package/dist/components/Table3/components/columns/styles.d.ts +2 -2
  16. package/dist/components/Table3/components/toolbar/Filter/filters/components/Filter.d.ts +4 -4
  17. package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts +3 -2
  18. package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts +3 -2
  19. package/dist/components/Table3/components/toolbar/FontSize.d.ts +4 -0
  20. package/dist/components/Table3/hooks/features/useHeaderOffsetStyle.d.ts +3 -0
  21. package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -1
  22. package/dist/components/Table3/hooks/useTable.d.ts +1 -1
  23. package/dist/components/Table3/types.d.ts +8 -1
  24. package/dist/components/Tag/Tag.d.ts +1 -1
  25. package/dist/esm/index.css +24 -6
  26. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +1 -1
  27. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Field/Field.js +6 -4
  29. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Icon/components/Location.js +17 -0
  31. package/dist/esm/packages/taco/src/components/Icon/components/Location.js.map +1 -0
  32. package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
  33. package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -110
  35. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
  37. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +13 -6
  39. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +1 -1
  41. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  42. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +7 -6
  43. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  44. package/dist/esm/packages/taco/src/components/Table3/Table3.js +29 -11
  45. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  46. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -5
  47. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +1 -4
  49. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  50. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  51. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +70 -0
  52. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -0
  53. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +26 -8
  54. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
  55. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +6 -1
  56. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
  57. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -2
  58. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  59. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +13 -9
  60. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
  61. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +14 -2
  62. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
  63. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +10 -7
  64. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
  65. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +15 -8
  66. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
  67. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +2 -2
  68. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
  69. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +25 -4
  70. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
  71. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +0 -1
  72. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
  73. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +5 -3
  74. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
  75. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js +2 -2
  76. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js.map +1 -1
  77. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +9 -4
  78. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
  79. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +2 -3
  80. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
  81. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -2
  82. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
  83. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
  84. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js +24 -0
  85. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js.map +1 -0
  86. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +6 -7
  87. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js.map +1 -1
  88. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +48 -0
  89. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
  90. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +34 -9
  91. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
  92. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +6 -5
  93. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
  94. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +11 -9
  95. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
  96. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
  97. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  98. package/dist/esm/packages/taco/src/index.js +1 -2
  99. package/dist/esm/packages/taco/src/index.js.map +1 -1
  100. package/dist/esm/packages/taco/src/utils/dom.js +1 -2
  101. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  102. package/dist/index.css +24 -6
  103. package/dist/index.d.ts +0 -1
  104. package/dist/taco.cjs.development.js +697 -4100
  105. package/dist/taco.cjs.development.js.map +1 -1
  106. package/dist/taco.cjs.production.min.js +1 -1
  107. package/dist/taco.cjs.production.min.js.map +1 -1
  108. package/package.json +2 -2
  109. package/tailwind.config.js +3 -0
  110. package/types.json +14334 -32345
  111. package/dist/components/Table2/Table2.d.ts +0 -130
  112. package/dist/components/Table2/components/BatchActionsMenu.d.ts +0 -10
  113. package/dist/components/Table2/components/ColumnSettingsButton.d.ts +0 -6
  114. package/dist/components/Table2/components/EditModeButton.d.ts +0 -8
  115. package/dist/components/Table2/components/RowDensityButton.d.ts +0 -7
  116. package/dist/components/Table2/components/Search.d.ts +0 -3
  117. package/dist/components/Table2/components/ShortcutsGuideButton.d.ts +0 -7
  118. package/dist/components/Table2/components/column/Base.d.ts +0 -14
  119. package/dist/components/Table2/components/column/Cell.d.ts +0 -15
  120. package/dist/components/Table2/components/column/Footer.d.ts +0 -9
  121. package/dist/components/Table2/components/column/Header.d.ts +0 -11
  122. package/dist/components/Table2/components/column/Indicator.d.ts +0 -17
  123. package/dist/components/Table2/components/column/ValidationError.d.ts +0 -5
  124. package/dist/components/Table2/components/column/utils.d.ts +0 -3
  125. package/dist/components/Table2/components/filters/FiltersButton.d.ts +0 -7
  126. package/dist/components/Table2/components/filters/components/Column.d.ts +0 -11
  127. package/dist/components/Table2/components/filters/components/ColumnFilter.d.ts +0 -10
  128. package/dist/components/Table2/components/filters/components/Comparator.d.ts +0 -11
  129. package/dist/components/Table2/components/filters/components/EmptyFilter.d.ts +0 -13
  130. package/dist/components/Table2/components/filters/components/InferredControl.d.ts +0 -10
  131. package/dist/components/Table2/components/row/Context.d.ts +0 -24
  132. package/dist/components/Table2/components/row/ExpandedRow.d.ts +0 -6
  133. package/dist/components/Table2/components/row/Row.d.ts +0 -2
  134. package/dist/components/Table2/hooks/listeners/useActiveCellStateListener.d.ts +0 -3
  135. package/dist/components/Table2/hooks/listeners/useActiveRowStateListener.d.ts +0 -3
  136. package/dist/components/Table2/hooks/listeners/useColumnOffsetStateListener.d.ts +0 -3
  137. package/dist/components/Table2/hooks/listeners/useFilterStateListener.d.ts +0 -3
  138. package/dist/components/Table2/hooks/listeners/useRowSelectionListener.d.ts +0 -3
  139. package/dist/components/Table2/hooks/listeners/useSettingsStateListener.d.ts +0 -3
  140. package/dist/components/Table2/hooks/useActiveCell.d.ts +0 -26
  141. package/dist/components/Table2/hooks/useActiveRow.d.ts +0 -10
  142. package/dist/components/Table2/hooks/useColumnDefinitions.d.ts +0 -37
  143. package/dist/components/Table2/hooks/useEditMode.d.ts +0 -28
  144. package/dist/components/Table2/hooks/useGridTemplate.d.ts +0 -2
  145. package/dist/components/Table2/hooks/useTable.d.ts +0 -46
  146. package/dist/components/Table2/hooks/useTableShortcuts.d.ts +0 -2
  147. package/dist/components/Table2/hooks/useVirtualiser.d.ts +0 -23
  148. package/dist/components/Table2/types.d.ts +0 -148
  149. package/dist/components/Table2/utilities/cell.d.ts +0 -14
  150. package/dist/components/Table2/utilities/columns.d.ts +0 -16
  151. package/dist/components/Table2/utilities/filterFn.d.ts +0 -3
  152. package/dist/esm/packages/taco/src/components/Table2/Table2.js +0 -422
  153. package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +0 -1
  154. package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js +0 -83
  155. package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js.map +0 -1
  156. package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js +0 -116
  157. package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js.map +0 -1
  158. package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js +0 -81
  159. package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js.map +0 -1
  160. package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js +0 -47
  161. package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js.map +0 -1
  162. package/dist/esm/packages/taco/src/components/Table2/components/Search.js +0 -62
  163. package/dist/esm/packages/taco/src/components/Table2/components/Search.js.map +0 -1
  164. package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js +0 -32
  165. package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js.map +0 -1
  166. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +0 -605
  167. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +0 -1
  168. package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js +0 -32
  169. package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js.map +0 -1
  170. package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js +0 -243
  171. package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js.map +0 -1
  172. package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +0 -73
  173. package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js.map +0 -1
  174. package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js +0 -30
  175. package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js.map +0 -1
  176. package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js +0 -39
  177. package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js.map +0 -1
  178. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +0 -155
  179. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js.map +0 -1
  180. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js +0 -31
  181. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js.map +0 -1
  182. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js +0 -129
  183. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js.map +0 -1
  184. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js +0 -68
  185. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js.map +0 -1
  186. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js +0 -63
  187. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js.map +0 -1
  188. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js +0 -99
  189. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js.map +0 -1
  190. package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js +0 -58
  191. package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js.map +0 -1
  192. package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js +0 -36
  193. package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js.map +0 -1
  194. package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +0 -44
  195. package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +0 -1
  196. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js +0 -19
  197. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js.map +0 -1
  198. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js +0 -28
  199. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js.map +0 -1
  200. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js +0 -12
  201. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js.map +0 -1
  202. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js +0 -18
  203. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js.map +0 -1
  204. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js +0 -25
  205. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js.map +0 -1
  206. package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js +0 -33
  207. package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js.map +0 -1
  208. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +0 -122
  209. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +0 -1
  210. package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js +0 -112
  211. package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js.map +0 -1
  212. package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js +0 -34
  213. package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js.map +0 -1
  214. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +0 -222
  215. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +0 -1
  216. package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js +0 -46
  217. package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js.map +0 -1
  218. package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js +0 -48
  219. package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js.map +0 -1
  220. package/dist/esm/packages/taco/src/components/Table2/types.js +0 -18
  221. package/dist/esm/packages/taco/src/components/Table2/types.js.map +0 -1
  222. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +0 -41
  223. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +0 -1
  224. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +0 -387
  225. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +0 -1
  226. package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js +0 -100
  227. package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js.map +0 -1
  228. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +0 -32
  229. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +0 -1
  230. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +0 -20
  231. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterFn.js","sources":["../../../../../../../../src/components/Table2/utilities/filterFn.ts"],"sourcesContent":["import { isDate, isAfter as isAfterDate, isBefore as isBeforeDate } from 'date-fns';\nimport { Table2Filter, Table2FilterComparator } from '../types';\nimport { isWeakEqual as isWeakEqualDate } from '../../../utils/date';\n\nconst toLowerCase = (value: string | number) => String(value ?? '').toLocaleLowerCase();\nconst isWeakContains = (left: string | number, right: string | number) => toLowerCase(left).includes(toLowerCase(right));\nconst isWeakEqual = (left: string | number, right: string | number) => toLowerCase(left) === toLowerCase(right);\n\nexport const globalFilterFn = (value: string, query: string) => isWeakContains(value, query);\n\n// the filter type is only settable on the column definition, which would re-render all columns\n// so instead we store it in the filter value, but that means we also have to destructure that\n// before we filter - that's why this custom filter function exists\nexport const columnFilterFn = (value: any, filter: Table2Filter) => {\n try {\n if (filter.comparator === Table2FilterComparator.IsEmpty || filter.comparator === Table2FilterComparator.IsNotEmpty) {\n const isEmpty = value === undefined || value === null || value === '';\n return filter.comparator === Table2FilterComparator.IsEmpty ? isEmpty : !isEmpty;\n }\n\n if (filter.value === undefined || filter.value === null || filter.value === '') {\n return true;\n }\n\n switch (filter.comparator) {\n case Table2FilterComparator.Contains:\n return isWeakContains(value, filter.value);\n\n case Table2FilterComparator.DoesNotContain:\n return !isWeakContains(value, filter.value);\n\n case Table2FilterComparator.IsEqualTo: {\n if (isDate(value)) {\n return isDate(filter.value) && isWeakEqualDate(value, filter.value);\n } else if (typeof filter.value === 'boolean') {\n return value === filter.value;\n }\n\n return isWeakEqual(value, filter.value);\n }\n\n case Table2FilterComparator.IsNotEqualTo: {\n if (isDate(value)) {\n return isDate(filter.value) && isWeakEqualDate(value, filter.value) === false;\n } else if (typeof filter.value === 'boolean') {\n return value !== filter.value;\n }\n\n return !isWeakEqual(value, filter.value);\n }\n\n case Table2FilterComparator.IsGreaterThan: {\n if (isDate(value)) {\n return isDate(filter.value) && isAfterDate(value, filter.value);\n } else {\n const valueAsNumber = parseInt(value);\n return !isNaN(valueAsNumber) && filter.value !== undefined && valueAsNumber > filter.value;\n }\n }\n\n case Table2FilterComparator.IsLessThan: {\n if (isDate(value)) {\n return isDate(filter.value) && isBeforeDate(value, filter.value);\n } else {\n const valueAsNumber = parseInt(value);\n return !isNaN(valueAsNumber) && filter.value !== undefined && valueAsNumber < filter.value;\n }\n }\n\n case Table2FilterComparator.IsBetween: {\n const [fromValue, toValue] = filter.value;\n\n if (isDate(value)) {\n if (isDate(fromValue) && isBeforeDate(value, fromValue)) {\n return false;\n } else if (isDate(toValue) && isAfterDate(value, toValue)) {\n return false;\n }\n\n return true;\n } else {\n const valueAsNumber = parseInt(value);\n\n if (isNaN(valueAsNumber)) {\n return false;\n }\n\n if (fromValue !== undefined && valueAsNumber < fromValue) {\n return false;\n } else if (toValue !== undefined && valueAsNumber > toValue) {\n return false;\n }\n\n return true;\n }\n }\n\n case Table2FilterComparator.IsOneOf:\n return Array.isArray(filter.value) ? filter.value.includes(value) : false;\n\n case Table2FilterComparator.IsNoneOf:\n return Array.isArray(filter.value) ? filter.value.includes(value) === false : false;\n\n case Table2FilterComparator.IsAllOf:\n return Array.isArray(filter.value) && Array.isArray(value)\n ? filter.value.filter(v => value.includes(v)).length === filter.value.length\n : false;\n }\n\n return false;\n } catch (e) {\n console.error(e);\n return true;\n }\n};\n"],"names":["toLowerCase","value","String","toLocaleLowerCase","isWeakContains","left","right","includes","isWeakEqual","globalFilterFn","query","columnFilterFn","filter","comparator","Table2FilterComparator","IsEmpty","IsNotEmpty","isEmpty","undefined","Contains","DoesNotContain","IsEqualTo","isDate","isWeakEqualDate","IsNotEqualTo","IsGreaterThan","isAfterDate","valueAsNumber","parseInt","isNaN","IsLessThan","isBeforeDate","IsBetween","fromValue","toValue","IsOneOf","Array","isArray","IsNoneOf","IsAllOf","v","length","e","console","error"],"mappings":";;;;AAIA,MAAMA,WAAW,GAAIC,KAAsB,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC,CAACE,iBAAiB,EAAE;AACvF,MAAMC,cAAc,GAAGA,CAACC,IAAqB,EAAEC,KAAsB,KAAKN,WAAW,CAACK,IAAI,CAAC,CAACE,QAAQ,CAACP,WAAW,CAACM,KAAK,CAAC,CAAC;AACxH,MAAME,WAAW,GAAGA,CAACH,IAAqB,EAAEC,KAAsB,KAAKN,WAAW,CAACK,IAAI,CAAC,KAAKL,WAAW,CAACM,KAAK,CAAC;MAElGG,cAAc,GAAGA,CAACR,KAAa,EAAES,KAAa,KAAKN,cAAc,CAACH,KAAK,EAAES,KAAK;AAE3F;AACA;AACA;MACaC,cAAc,GAAGA,CAACV,KAAU,EAAEW,MAAoB;EAC3D,IAAI;IACA,IAAIA,MAAM,CAACC,UAAU,KAAKC,sBAAsB,CAACC,OAAO,IAAIH,MAAM,CAACC,UAAU,KAAKC,sBAAsB,CAACE,UAAU,EAAE;MACjH,MAAMC,OAAO,GAAGhB,KAAK,KAAKiB,SAAS,IAAIjB,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,EAAE;MACrE,OAAOW,MAAM,CAACC,UAAU,KAAKC,sBAAsB,CAACC,OAAO,GAAGE,OAAO,GAAG,CAACA,OAAO;;IAGpF,IAAIL,MAAM,CAACX,KAAK,KAAKiB,SAAS,IAAIN,MAAM,CAACX,KAAK,KAAK,IAAI,IAAIW,MAAM,CAACX,KAAK,KAAK,EAAE,EAAE;MAC5E,OAAO,IAAI;;IAGf,QAAQW,MAAM,CAACC,UAAU;MACrB,KAAKC,sBAAsB,CAACK,QAAQ;QAChC,OAAOf,cAAc,CAACH,KAAK,EAAEW,MAAM,CAACX,KAAK,CAAC;MAE9C,KAAKa,sBAAsB,CAACM,c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N,KAAK,CAAC,GAAG,KAAK;MAE7E,KAAKa,sBAAsB,CAACwB,QAAQ;QAChC,OAAOF,KAAK,CAACC,OAAO,CAACzB,MAAM,CAACX,KAAK,CAAC,GAAGW,MAAM,CAACX,KAAK,CAACM,QAAQ,CAACN,KAAK,CAAC,KAAK,KAAK,GAAG,KAAK;MAEvF,KAAKa,sBAAsB,CAACyB,OAAO;QAC/B,OAAOH,KAAK,CAACC,OAAO,CAACzB,MAAM,CAACX,KAAK,CAAC,IAAImC,KAAK,CAACC,OAAO,CAACpC,KAAK,CAAC,GACpDW,MAAM,CAACX,KAAK,CAACW,MAAM,CAAC4B,CAAC,IAAIvC,KAAK,CAACM,QAAQ,CAACiC,CAAC,CAAC,CAAC,CAACC,MAAM,KAAK7B,MAAM,CAACX,KAAK,CAACwC,MAAM,GAC1E,KAAK;;IAGnB,OAAO,KAAK;GACf,CAAC,OAAOC,CAAC,EAAE;IACRC,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;IAChB,OAAO,IAAI;;AAEnB;;;;"}
@@ -1,32 +0,0 @@
1
- import React__default from 'react';
2
- import cn from 'classnames';
3
- import { Tooltip } from '../Tooltip/Tooltip.js';
4
- import { useTruncated } from '../../utils/hooks/useTruncated.js';
5
-
6
- const Truncate = ({
7
- tooltip,
8
- children
9
- }) => {
10
- const ref = React__default.useRef(null);
11
- const [mounted, setMounted] = React__default.useState(false);
12
- const {
13
- truncated
14
- } = useTruncated(ref.current, [mounted]);
15
- React__default.useEffect(() => {
16
- setMounted(true);
17
- return () => setMounted(false);
18
- }, []);
19
- const clonedChildrenWithRef = /*#__PURE__*/React__default.cloneElement(React__default.Children.only(children), {
20
- ref,
21
- className: cn(children.props.className, 'truncate')
22
- });
23
- if (truncated) {
24
- return /*#__PURE__*/React__default.createElement(Tooltip, {
25
- title: tooltip
26
- }, clonedChildrenWithRef);
27
- }
28
- return clonedChildrenWithRef;
29
- };
30
-
31
- export { Truncate };
32
- //# sourceMappingURL=Truncate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Truncate.js","sources":["../../../../../../../src/components/Truncate/Truncate.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { useTruncated } from '../../utils/hooks/useTruncated';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type TruncateProps = {\n tooltip: string;\n children: React.ReactElement;\n};\nexport const Truncate = ({ tooltip, children }: TruncateProps) => {\n const ref = React.useRef<HTMLElement>(null);\n const [mounted, setMounted] = React.useState(false);\n const { truncated } = useTruncated(ref.current, [mounted]);\n\n React.useEffect(() => {\n setMounted(true);\n\n return () => setMounted(false);\n }, []);\n\n const clonedChildrenWithRef = React.cloneElement(React.Children.only(children), {\n ref,\n className: cn(children.props.className, 'truncate'),\n });\n\n if (truncated) {\n return <Tooltip title={tooltip}>{clonedChildrenWithRef}</Tooltip>;\n }\n\n return clonedChildrenWithRef;\n};\n"],"names":["Truncate","tooltip","children","ref","React","useRef","mounted","setMounted","useState","truncated","useTruncated","current","useEffect","clonedChildrenWithRef","cloneElement","Children","only","className","cn","props","Tooltip","title"],"mappings":";;;;;MAUaA,QAAQ,GAAGA,CAAC;EAAEC,OAAO;EAAEC;CAAyB;EACzD,MAAMC,GAAG,GAAGC,cAAK,CAACC,MAAM,CAAc,IAAI,CAAC;EAC3C,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGH,cAAK,CAACI,QAAQ,CAAC,KAAK,CAAC;EACnD,MAAM;IAAEC;GAAW,GAAGC,YAAY,CAACP,GAAG,CAACQ,OAAO,EAAE,CAACL,OAAO,CAAC,CAAC;EAE1DF,cAAK,CAACQ,SAAS,CAAC;IACZL,UAAU,CAAC,IAAI,CAAC;IAEhB,OAAO,MAAMA,UAAU,CAAC,KAAK,CAAC;GACjC,EAAE,EAAE,CAAC;EAEN,MAAMM,qBAAqB,gBAAGT,cAAK,CAACU,YAAY,CAACV,cAAK,CAACW,QAAQ,CAACC,IAAI,CAACd,QAAQ,CAAC,EAAE;IAC5EC,GAAG;IACHc,SAAS,EAAEC,EAAE,CAAChB,QAAQ,CAACiB,KAAK,CAACF,SAAS,EAAE,UAAU;GACrD,CAAC;EAEF,IAAIR,SAAS,EAAE;IACX,oBAAOL,6BAACgB,OAAO;MAACC,KAAK,EAAEpB;OAAUY,qBAAqB,CAAW;;EAGrE,OAAOA,qBAAqB;AAChC;;;;"}
@@ -1,20 +0,0 @@
1
- import React__default from 'react';
2
-
3
- const isTruncated = targetElement => {
4
- if (targetElement !== null) {
5
- return targetElement.offsetWidth < targetElement.scrollWidth;
6
- }
7
- return false;
8
- };
9
- const useTruncated = (element, deps = []) => {
10
- const [truncated, setTruncated] = React__default.useState(isTruncated(element));
11
- React__default.useEffect(() => {
12
- setTruncated(isTruncated(element));
13
- }, [element, ...deps]);
14
- return {
15
- truncated
16
- };
17
- };
18
-
19
- export { useTruncated };
20
- //# sourceMappingURL=useTruncated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTruncated.js","sources":["../../../../../../../src/utils/hooks/useTruncated.tsx"],"sourcesContent":["import React from 'react';\n\nconst isTruncated = (targetElement: HTMLElement | null) => {\n if (targetElement !== null) {\n return targetElement.offsetWidth < targetElement.scrollWidth;\n }\n\n return false;\n};\n\nexport const useTruncated = (element: HTMLElement | null, deps: any[] = []) => {\n const [truncated, setTruncated] = React.useState<boolean>(isTruncated(element));\n\n React.useEffect(() => {\n setTruncated(isTruncated(element));\n }, [element, ...deps]);\n\n return { truncated };\n};\n"],"names":["isTruncated","targetElement","offsetWidth","scrollWidth","useTruncated","element","deps","truncated","setTruncated","React","useState","useEffect"],"mappings":";;AAEA,MAAMA,WAAW,GAAIC,aAAiC;EAClD,IAAIA,aAAa,KAAK,IAAI,EAAE;IACxB,OAAOA,aAAa,CAACC,WAAW,GAAGD,aAAa,CAACE,WAAW;;EAGhE,OAAO,KAAK;AAChB,CAAC;MAEYC,YAAY,GAAGA,CAACC,OAA2B,EAAEC,OAAc,EAAE;EACtE,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAUV,WAAW,CAACK,OAAO,CAAC,CAAC;EAE/EI,cAAK,CAACE,SAAS,CAAC;IACZH,YAAY,CAACR,WAAW,CAACK,OAAO,CAAC,CAAC;GACrC,EAAE,CAACA,OAAO,EAAE,GAAGC,IAAI,CAAC,CAAC;EAEtB,OAAO;IAAEC;GAAW;AACxB;;;;"}