@talxis/base-controls 1.2509.1-alpha.6 → 1.2509.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (467) hide show
  1. package/dist/components/DatasetControl/DatasetControl.js +55 -59
  2. package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
  3. package/dist/components/DatasetControl/Paging/DatasetPaging.d.ts +3 -0
  4. package/dist/components/DatasetControl/Paging/DatasetPaging.js +69 -0
  5. package/dist/components/DatasetControl/Paging/DatasetPaging.js.map +1 -0
  6. package/dist/components/DatasetControl/Paging/Paging.d.ts +26 -0
  7. package/dist/components/DatasetControl/Paging/Paging.js +80 -0
  8. package/dist/components/DatasetControl/Paging/Paging.js.map +1 -0
  9. package/dist/components/DatasetControl/Paging/index.d.ts +3 -0
  10. package/dist/components/DatasetControl/Paging/index.js +3 -0
  11. package/dist/components/DatasetControl/Paging/index.js.map +1 -0
  12. package/dist/components/DatasetControl/Paging/interfaces.d.ts +16 -0
  13. package/dist/components/DatasetControl/Paging/styles.d.ts +35 -0
  14. package/dist/components/DatasetControl/Paging/styles.js +41 -0
  15. package/dist/components/DatasetControl/Paging/styles.js.map +1 -0
  16. package/dist/components/DatasetControl/Paging/translations.d.ts +38 -0
  17. package/dist/components/DatasetControl/Paging/translations.js +14 -0
  18. package/dist/components/DatasetControl/Paging/translations.js.map +1 -0
  19. package/dist/components/DatasetControl/QuickFind/QuickFind.d.ts +12 -4
  20. package/dist/components/DatasetControl/QuickFind/QuickFind.js +32 -36
  21. package/dist/components/DatasetControl/QuickFind/QuickFind.js.map +1 -1
  22. package/dist/components/DatasetControl/QuickFind/styles.d.ts +1 -1
  23. package/dist/components/DatasetControl/QuickFind/styles.js +2 -2
  24. package/dist/components/DatasetControl/QuickFind/styles.js.map +1 -1
  25. package/dist/components/DatasetControl/index.d.ts +1 -0
  26. package/dist/components/DatasetControl/index.js +2 -0
  27. package/dist/components/DatasetControl/index.js.map +1 -1
  28. package/dist/components/DatasetControl/interfaces.d.ts +20 -54
  29. package/dist/components/DatasetControl/styles.d.ts +11 -4
  30. package/dist/components/DatasetControl/styles.js +11 -5
  31. package/dist/components/DatasetControl/styles.js.map +1 -1
  32. package/dist/components/DatasetControl/translations.d.ts +0 -44
  33. package/dist/components/DatasetControl/translations.js +1 -15
  34. package/dist/components/DatasetControl/translations.js.map +1 -1
  35. package/dist/components/Grid/Grid.d.ts +3 -0
  36. package/dist/components/Grid/Grid.js +37 -0
  37. package/dist/components/Grid/Grid.js.map +1 -0
  38. package/dist/components/Grid/GridContext.d.ts +3 -0
  39. package/dist/components/Grid/GridContext.js.map +1 -0
  40. package/dist/components/Grid/aggregation/Aggregation.d.ts +18 -0
  41. package/dist/components/Grid/aggregation/Aggregation.js +129 -0
  42. package/dist/components/Grid/aggregation/Aggregation.js.map +1 -0
  43. package/dist/components/Grid/{grid/Grid.d.ts → core/components/AgGrid/AgGrid.d.ts} +2 -2
  44. package/dist/components/Grid/core/components/AgGrid/AgGrid.js +203 -0
  45. package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -0
  46. package/dist/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/EmptyRecords.js +12 -0
  47. package/dist/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/EmptyRecords.js.map +1 -0
  48. package/dist/components/Grid/{overlays/empty-records → core/components/AgGrid/components/EmptyRecordsOverlay}/styles.d.ts +1 -1
  49. package/dist/components/Grid/{overlays/empty-records → core/components/AgGrid/components/EmptyRecordsOverlay}/styles.js +1 -1
  50. package/dist/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/styles.js.map +1 -0
  51. package/dist/components/Grid/core/components/AgGrid/components/LoadingOverlay/LoadingOverlay.js.map +1 -0
  52. package/dist/components/Grid/{grid/ag-grid/AgGridContext.d.ts → core/components/AgGrid/context.d.ts} +2 -2
  53. package/dist/components/Grid/{grid/ag-grid/AgGridContext.js → core/components/AgGrid/context.js} +1 -1
  54. package/dist/components/Grid/core/components/AgGrid/context.js.map +1 -0
  55. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +52 -0
  56. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +343 -0
  57. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -0
  58. package/dist/components/Grid/{grid/ValueComparator.d.ts → core/components/AgGrid/model/Comparator.d.ts} +1 -1
  59. package/dist/components/Grid/{grid/ValueComparator.js → core/components/AgGrid/model/Comparator.js} +1 -7
  60. package/dist/components/Grid/core/components/AgGrid/model/Comparator.js.map +1 -0
  61. package/dist/components/Grid/{grid → core/components/AgGrid}/styles.d.ts +4 -24
  62. package/dist/components/Grid/{grid → core/components/AgGrid}/styles.js +6 -37
  63. package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -0
  64. package/dist/components/Grid/{cells/cell → core/components/Cell}/Cell.d.ts +3 -3
  65. package/dist/components/Grid/core/components/Cell/Cell.js +158 -0
  66. package/dist/components/Grid/core/components/Cell/Cell.js.map +1 -0
  67. package/dist/components/Grid/{cells/cell/content → core/components/Cell/CellContent}/CellContent.d.ts +2 -2
  68. package/dist/components/Grid/{cells/cell/content → core/components/Cell/CellContent}/CellContent.js +31 -40
  69. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js.map +1 -0
  70. package/dist/components/Grid/core/components/Cell/CellContent/styles.js.map +1 -0
  71. package/dist/components/Grid/{cells/cell/notifications → core/components/Cell/Notifications}/Notifications.d.ts +1 -1
  72. package/dist/components/Grid/{cells/cell/notifications → core/components/Cell/Notifications}/Notifications.js +5 -5
  73. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js.map +1 -0
  74. package/dist/components/Grid/{cells/cell/notifications → core/components/Cell/Notifications}/styles.js +1 -1
  75. package/dist/components/Grid/core/components/Cell/Notifications/styles.js.map +1 -0
  76. package/dist/components/Grid/{cells/cell → core/components/Cell}/styles.d.ts +3 -34
  77. package/dist/components/Grid/core/components/Cell/styles.js +59 -0
  78. package/dist/components/Grid/core/components/Cell/styles.js.map +1 -0
  79. package/dist/components/Grid/{column-headers/column-header → core/components/ColumnHeader}/ColumnHeader.d.ts +1 -1
  80. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +61 -0
  81. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -0
  82. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.d.ts +2 -0
  83. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js +50 -0
  84. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js.map +1 -0
  85. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js.map +1 -0
  86. package/dist/components/Grid/core/components/ColumnHeader/styles.d.ts +42 -0
  87. package/dist/components/Grid/core/components/ColumnHeader/styles.js +48 -0
  88. package/dist/components/Grid/core/components/ColumnHeader/styles.js.map +1 -0
  89. package/dist/components/Grid/core/components/Dialog/Constants.d.ts +2 -0
  90. package/dist/components/Grid/core/components/Dialog/Constants.js +9 -0
  91. package/dist/components/Grid/core/components/Dialog/Constants.js.map +1 -0
  92. package/dist/components/Grid/core/components/Dialog/Styles.d.ts +2 -0
  93. package/dist/components/Grid/core/components/Dialog/Styles.js +61 -0
  94. package/dist/components/Grid/core/components/Dialog/Styles.js.map +1 -0
  95. package/dist/components/Grid/core/components/Dialog/index.d.ts +4 -0
  96. package/dist/components/Grid/core/components/Dialog/index.js +16 -0
  97. package/dist/components/Grid/core/components/Dialog/index.js.map +1 -0
  98. package/dist/components/Grid/core/components/Dialog/interfaces/index.d.ts +6 -0
  99. package/dist/components/Grid/core/components/Dialog/interfaces/index.js +2 -0
  100. package/dist/components/Grid/core/components/Dialog/interfaces/index.js.map +1 -0
  101. package/dist/components/Grid/core/components/Save/Save.d.ts +2 -0
  102. package/dist/components/Grid/core/components/Save/Save.js +59 -0
  103. package/dist/components/Grid/core/components/Save/Save.js.map +1 -0
  104. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.d.ts +7 -0
  105. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js +73 -0
  106. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js.map +1 -0
  107. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.d.ts +11 -0
  108. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +231 -0
  109. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -0
  110. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/styles.d.ts +39 -0
  111. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/styles.js +45 -0
  112. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/styles.js.map +1 -0
  113. package/dist/components/Grid/core/components/Save/components/ChangeEditor/styles.d.ts +31 -0
  114. package/dist/components/Grid/core/components/Save/components/ChangeEditor/styles.js +37 -0
  115. package/dist/components/Grid/core/components/Save/components/ChangeEditor/styles.js.map +1 -0
  116. package/dist/components/Grid/core/components/Save/styles.d.ts +35 -0
  117. package/dist/components/Grid/core/components/Save/styles.js +42 -0
  118. package/dist/components/Grid/core/components/Save/styles.js.map +1 -0
  119. package/dist/components/Grid/core/controllers/useGridController.d.ts +7 -0
  120. package/dist/components/Grid/core/controllers/useGridController.js +29 -0
  121. package/dist/components/Grid/core/controllers/useGridController.js.map +1 -0
  122. package/dist/components/Grid/core/enums/ConditionOperator.d.ts +48 -0
  123. package/dist/components/Grid/core/enums/ConditionOperator.js +52 -0
  124. package/dist/components/Grid/core/enums/ConditionOperator.js.map +1 -0
  125. package/dist/components/Grid/core/enums/DataType.d.ts +25 -0
  126. package/dist/components/Grid/core/enums/DataType.js +30 -0
  127. package/dist/components/Grid/core/enums/DataType.js.map +1 -0
  128. package/dist/components/Grid/core/hooks/useGridInstance.d.ts +2 -0
  129. package/dist/components/Grid/{grid → core/hooks}/useGridInstance.js +2 -2
  130. package/dist/components/Grid/core/hooks/useGridInstance.js.map +1 -0
  131. package/dist/components/Grid/core/hooks/useRefreshCallback.d.ts +2 -0
  132. package/dist/components/Grid/core/hooks/useRefreshCallback.js +20 -0
  133. package/dist/components/Grid/core/hooks/useRefreshCallback.js.map +1 -0
  134. package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +13 -0
  135. package/dist/components/Grid/core/interfaces/IGridContext.d.ts +4 -0
  136. package/dist/components/Grid/core/model/Grid.d.ts +83 -0
  137. package/dist/components/Grid/core/model/Grid.js +528 -0
  138. package/dist/components/Grid/core/model/Grid.js.map +1 -0
  139. package/dist/components/Grid/core/model/GridDependency.d.ts +13 -0
  140. package/dist/components/Grid/core/model/GridDependency.js +28 -0
  141. package/dist/components/Grid/core/model/GridDependency.js.map +1 -0
  142. package/dist/components/Grid/core/services/KeyListener.d.ts +12 -0
  143. package/dist/components/Grid/core/services/KeyListener.js +31 -0
  144. package/dist/components/Grid/core/services/KeyListener.js.map +1 -0
  145. package/dist/components/Grid/{column-headers/column-header → filtering/components/FilterCallout}/FilterCallout.d.ts +1 -1
  146. package/dist/components/Grid/filtering/components/FilterCallout/FilterCallout.js +59 -0
  147. package/dist/components/Grid/filtering/components/FilterCallout/FilterCallout.js.map +1 -0
  148. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionOperator/ConditionOperator.d.ts +7 -0
  149. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionOperator/ConditionOperator.js +56 -0
  150. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionOperator/ConditionOperator.js.map +1 -0
  151. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.d.ts +7 -0
  152. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js +73 -0
  153. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js.map +1 -0
  154. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValueBetween.d.ts +7 -0
  155. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValueBetween.js +90 -0
  156. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValueBetween.js.map +1 -0
  157. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +48 -0
  158. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.js +146 -0
  159. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.js.map +1 -0
  160. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.d.ts +11 -0
  161. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.js +53 -0
  162. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.js.map +1 -0
  163. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.d.ts +9 -0
  164. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.js +31 -0
  165. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.js.map +1 -0
  166. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.d.ts +10 -0
  167. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.js +294 -0
  168. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.js.map +1 -0
  169. package/dist/components/Grid/filtering/components/FilterCallout/styles.d.ts +35 -0
  170. package/dist/components/Grid/{column-headers/column-header → filtering/components/FilterCallout}/styles.js +11 -20
  171. package/dist/components/Grid/filtering/components/FilterCallout/styles.js.map +1 -0
  172. package/dist/components/Grid/filtering/constants.d.ts +5 -0
  173. package/dist/components/Grid/filtering/constants.js +53 -0
  174. package/dist/components/Grid/filtering/constants.js.map +1 -0
  175. package/dist/components/Grid/filtering/controller/useColumnFilterConditionController.d.ts +21 -0
  176. package/dist/components/Grid/filtering/controller/useColumnFilterConditionController.js +44 -0
  177. package/dist/components/Grid/filtering/controller/useColumnFilterConditionController.js.map +1 -0
  178. package/dist/components/Grid/filtering/model/Condition.d.ts +49 -0
  179. package/dist/components/Grid/filtering/model/Condition.js +347 -0
  180. package/dist/components/Grid/filtering/model/Condition.js.map +1 -0
  181. package/dist/components/Grid/filtering/model/Filtering.d.ts +11 -0
  182. package/dist/components/Grid/filtering/model/Filtering.js +78 -0
  183. package/dist/components/Grid/filtering/model/Filtering.js.map +1 -0
  184. package/dist/components/Grid/filtering/utils/FilteringUtilts.d.ts +34 -0
  185. package/dist/components/Grid/filtering/utils/FilteringUtilts.js +195 -0
  186. package/dist/components/Grid/filtering/utils/FilteringUtilts.js.map +1 -0
  187. package/dist/components/Grid/index.d.ts +1 -1
  188. package/dist/components/Grid/index.js +1 -1
  189. package/dist/components/Grid/interfaces.d.ts +0 -9
  190. package/dist/components/Grid/selection/model/Selection.d.ts +12 -0
  191. package/dist/components/Grid/selection/model/Selection.js +55 -0
  192. package/dist/components/Grid/selection/model/Selection.js.map +1 -0
  193. package/dist/components/Grid/sorting/Sorting.d.ts +10 -0
  194. package/dist/components/Grid/sorting/Sorting.js +31 -0
  195. package/dist/components/Grid/sorting/Sorting.js.map +1 -0
  196. package/dist/components/Grid/{column-headers/column-header/ColumnHeaderContextualMenu.d.ts → sorting/components/SortingContextualMenu/SortingContextualMenu.d.ts} +3 -3
  197. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +157 -0
  198. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -0
  199. package/dist/components/Grid/sorting/components/SortingContextualMenu/styles.d.ts +9 -0
  200. package/dist/components/Grid/sorting/components/SortingContextualMenu/styles.js +15 -0
  201. package/dist/components/Grid/sorting/components/SortingContextualMenu/styles.js.map +1 -0
  202. package/dist/components/Grid/sorting/controllers/useColumnSortingController.d.ts +9 -0
  203. package/dist/components/Grid/sorting/controllers/useColumnSortingController.js +22 -0
  204. package/dist/components/Grid/sorting/controllers/useColumnSortingController.js.map +1 -0
  205. package/dist/components/Grid/translations.d.ts +180 -20
  206. package/dist/components/Grid/translations.js +48 -5
  207. package/dist/components/Grid/translations.js.map +1 -1
  208. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.d.ts +2 -0
  209. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js +11 -0
  210. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js.map +1 -0
  211. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.d.ts +1 -0
  212. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js +2 -0
  213. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js.map +1 -0
  214. package/dist/components/GridCellRenderer/GridCellRenderer.js +282 -99
  215. package/dist/components/GridCellRenderer/GridCellRenderer.js.map +1 -1
  216. package/dist/components/GridCellRenderer/OptionSet/OptionSet.d.ts +5 -0
  217. package/dist/components/GridCellRenderer/OptionSet/OptionSet.js +75 -0
  218. package/dist/components/GridCellRenderer/OptionSet/OptionSet.js.map +1 -0
  219. package/dist/components/GridCellRenderer/OptionSet/index.d.ts +1 -0
  220. package/dist/components/GridCellRenderer/OptionSet/index.js +2 -0
  221. package/dist/components/GridCellRenderer/OptionSet/index.js.map +1 -0
  222. package/dist/components/GridCellRenderer/OptionSet/styles.d.ts +20 -0
  223. package/dist/components/GridCellRenderer/OptionSet/styles.js +29 -0
  224. package/dist/components/GridCellRenderer/OptionSet/styles.js.map +1 -0
  225. package/dist/components/GridCellRenderer/RecordCommands/Icon.d.ts +7 -0
  226. package/dist/components/GridCellRenderer/RecordCommands/Icon.js +32 -0
  227. package/dist/components/GridCellRenderer/RecordCommands/Icon.js.map +1 -0
  228. package/dist/components/GridCellRenderer/RecordCommands/RecordCommands.d.ts +13 -0
  229. package/dist/components/GridCellRenderer/RecordCommands/RecordCommands.js +103 -0
  230. package/dist/components/GridCellRenderer/RecordCommands/RecordCommands.js.map +1 -0
  231. package/dist/components/GridCellRenderer/RecordCommands/styles.d.ts +13 -0
  232. package/dist/components/GridCellRenderer/RecordCommands/styles.js +32 -0
  233. package/dist/components/GridCellRenderer/RecordCommands/styles.js.map +1 -0
  234. package/dist/components/GridCellRenderer/interfaces.d.ts +42 -53
  235. package/dist/components/GridCellRenderer/styles.d.ts +60 -34
  236. package/dist/components/GridCellRenderer/styles.js +77 -69
  237. package/dist/components/GridCellRenderer/styles.js.map +1 -1
  238. package/dist/components/GridCellRenderer/translations.d.ts +1 -1
  239. package/dist/components/GridCellRenderer/translations.js +32 -30
  240. package/dist/components/GridCellRenderer/translations.js.map +1 -1
  241. package/dist/components/GridCellRenderer/useComponentProps.d.ts +6 -0
  242. package/dist/components/GridCellRenderer/useComponentProps.js +10 -0
  243. package/dist/components/GridCellRenderer/useComponentProps.js.map +1 -0
  244. package/dist/components/Lookup/Lookup.js +1 -1
  245. package/dist/components/Lookup/Lookup.js.map +1 -1
  246. package/dist/components/Lookup/hooks/useLookup.js +2 -2
  247. package/dist/components/Lookup/hooks/useLookup.js.map +1 -1
  248. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js +2 -2
  249. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js.map +1 -1
  250. package/dist/components/NestedControlRenderer/NestedControl.d.ts +0 -2
  251. package/dist/components/NestedControlRenderer/NestedControl.js +2 -5
  252. package/dist/components/NestedControlRenderer/NestedControl.js.map +1 -1
  253. package/dist/components/NestedControlRenderer/NestedControlRenderer.js +6 -11
  254. package/dist/components/NestedControlRenderer/NestedControlRenderer.js.map +1 -1
  255. package/dist/components/NestedControlRenderer/interfaces.d.ts +0 -4
  256. package/dist/components/NestedControlRenderer/properties/FileProperty.js +1 -1
  257. package/dist/components/NestedControlRenderer/properties/FileProperty.js.map +1 -1
  258. package/dist/components/OptionSet/OptionSet.js +4 -5
  259. package/dist/components/OptionSet/OptionSet.js.map +1 -1
  260. package/dist/components/TextField/TextField.js +1 -1
  261. package/dist/components/TextField/TextField.js.map +1 -1
  262. package/dist/components/index.js +3 -1
  263. package/dist/components/index.js.map +1 -1
  264. package/dist/hooks/useControl.d.ts +0 -1
  265. package/dist/hooks/useControl.js +0 -1
  266. package/dist/hooks/useControl.js.map +1 -1
  267. package/dist/hooks/useInputBasedControl.js +1 -2
  268. package/dist/hooks/useInputBasedControl.js.map +1 -1
  269. package/dist/index.d.ts +299 -162
  270. package/dist/index.js +3 -1
  271. package/dist/index.js.map +1 -1
  272. package/dist/interfaces/property.d.ts +1 -1
  273. package/dist/utils/BaseControls.d.ts +1 -2
  274. package/dist/utils/BaseControls.js +1 -5
  275. package/dist/utils/BaseControls.js.map +1 -1
  276. package/dist/utils/dataset/adapters/VirtualDatasetAdapter.d.ts +16 -12
  277. package/dist/utils/dataset/adapters/VirtualDatasetAdapter.js +72 -27
  278. package/dist/utils/dataset/adapters/VirtualDatasetAdapter.js.map +1 -1
  279. package/dist/utils/theme/components/ThemeWrapper.d.ts +1 -1
  280. package/dist/utils/theme/components/ThemeWrapper.js.map +1 -1
  281. package/dist/utils/theme/hooks/useControlTheme.js +1 -2
  282. package/dist/utils/theme/hooks/useControlTheme.js.map +1 -1
  283. package/package.json +5 -9
  284. package/dist/components/DatasetControl/DatasetControlModel.d.ts +0 -37
  285. package/dist/components/DatasetControl/DatasetControlModel.js +0 -110
  286. package/dist/components/DatasetControl/DatasetControlModel.js.map +0 -1
  287. package/dist/components/DatasetControl/Filtering/DatasetColumnFiltering.d.ts +0 -3
  288. package/dist/components/DatasetControl/Filtering/DatasetColumnFiltering.js +0 -166
  289. package/dist/components/DatasetControl/Filtering/DatasetColumnFiltering.js.map +0 -1
  290. package/dist/components/DatasetControl/Filtering/DatasetColumnFilteringModel.d.ts +0 -15
  291. package/dist/components/DatasetControl/Filtering/DatasetColumnFilteringModel.js +0 -59
  292. package/dist/components/DatasetControl/Filtering/DatasetColumnFilteringModel.js.map +0 -1
  293. package/dist/components/DatasetControl/Filtering/interfaces.d.ts +0 -31
  294. package/dist/components/DatasetControl/Filtering/styles.d.ts +0 -16
  295. package/dist/components/DatasetControl/Filtering/styles.js +0 -23
  296. package/dist/components/DatasetControl/Filtering/styles.js.map +0 -1
  297. package/dist/components/DatasetControl/Filtering/translations.d.ts +0 -154
  298. package/dist/components/DatasetControl/Filtering/translations.js +0 -43
  299. package/dist/components/DatasetControl/Filtering/translations.js.map +0 -1
  300. package/dist/components/DatasetControl/Header/Header.d.ts +0 -5
  301. package/dist/components/DatasetControl/Header/Header.js +0 -89
  302. package/dist/components/DatasetControl/Header/Header.js.map +0 -1
  303. package/dist/components/DatasetControl/Header/styles.d.ts +0 -22
  304. package/dist/components/DatasetControl/Header/styles.js +0 -29
  305. package/dist/components/DatasetControl/Header/styles.js.map +0 -1
  306. package/dist/components/DatasetControl/Pagination/Pagination.d.ts +0 -5
  307. package/dist/components/DatasetControl/Pagination/Pagination.js +0 -91
  308. package/dist/components/DatasetControl/Pagination/Pagination.js.map +0 -1
  309. package/dist/components/DatasetControl/Pagination/PaginationModel.d.ts +0 -10
  310. package/dist/components/DatasetControl/Pagination/PaginationModel.js +0 -45
  311. package/dist/components/DatasetControl/Pagination/PaginationModel.js.map +0 -1
  312. package/dist/components/DatasetControl/Pagination/styles.d.ts +0 -23
  313. package/dist/components/DatasetControl/Pagination/styles.js +0 -29
  314. package/dist/components/DatasetControl/Pagination/styles.js.map +0 -1
  315. package/dist/components/DatasetControl/useModel.d.ts +0 -4
  316. package/dist/components/DatasetControl/useModel.js +0 -9
  317. package/dist/components/DatasetControl/useModel.js.map +0 -1
  318. package/dist/components/Grid/cells/cell/Cell.js +0 -302
  319. package/dist/components/Grid/cells/cell/Cell.js.map +0 -1
  320. package/dist/components/Grid/cells/cell/content/CellContent.js.map +0 -1
  321. package/dist/components/Grid/cells/cell/content/styles.js.map +0 -1
  322. package/dist/components/Grid/cells/cell/notifications/Notifications.js.map +0 -1
  323. package/dist/components/Grid/cells/cell/notifications/styles.js.map +0 -1
  324. package/dist/components/Grid/cells/cell/styles.js +0 -78
  325. package/dist/components/Grid/cells/cell/styles.js.map +0 -1
  326. package/dist/components/Grid/column-headers/column-header/ColumnHeader.js +0 -83
  327. package/dist/components/Grid/column-headers/column-header/ColumnHeader.js.map +0 -1
  328. package/dist/components/Grid/column-headers/column-header/ColumnHeaderContextualMenu.js +0 -115
  329. package/dist/components/Grid/column-headers/column-header/ColumnHeaderContextualMenu.js.map +0 -1
  330. package/dist/components/Grid/column-headers/column-header/FilterCallout.js +0 -103
  331. package/dist/components/Grid/column-headers/column-header/FilterCallout.js.map +0 -1
  332. package/dist/components/Grid/column-headers/column-header/styles.d.ts +0 -84
  333. package/dist/components/Grid/column-headers/column-header/styles.js.map +0 -1
  334. package/dist/components/Grid/column-headers/record-selection-checkbox/RecordSelectionCheckbox.d.ts +0 -2
  335. package/dist/components/Grid/column-headers/record-selection-checkbox/RecordSelectionCheckbox.js +0 -50
  336. package/dist/components/Grid/column-headers/record-selection-checkbox/RecordSelectionCheckbox.js.map +0 -1
  337. package/dist/components/Grid/column-headers/record-selection-checkbox/styles.js.map +0 -1
  338. package/dist/components/Grid/errors/FullWidthCellRendererError/FullWidthCellRendererError.d.ts +0 -6
  339. package/dist/components/Grid/errors/FullWidthCellRendererError/FullWidthCellRendererError.js +0 -15
  340. package/dist/components/Grid/errors/FullWidthCellRendererError/FullWidthCellRendererError.js.map +0 -1
  341. package/dist/components/Grid/errors/FullWidthCellRendererError/styles.d.ts +0 -6
  342. package/dist/components/Grid/errors/FullWidthCellRendererError/styles.js +0 -13
  343. package/dist/components/Grid/errors/FullWidthCellRendererError/styles.js.map +0 -1
  344. package/dist/components/Grid/grid/Grid.js +0 -64
  345. package/dist/components/Grid/grid/Grid.js.map +0 -1
  346. package/dist/components/Grid/grid/GridContext.d.ts +0 -3
  347. package/dist/components/Grid/grid/GridContext.js.map +0 -1
  348. package/dist/components/Grid/grid/GridModel.d.ts +0 -117
  349. package/dist/components/Grid/grid/GridModel.js +0 -787
  350. package/dist/components/Grid/grid/GridModel.js.map +0 -1
  351. package/dist/components/Grid/grid/ValueComparator.js.map +0 -1
  352. package/dist/components/Grid/grid/ag-grid/AgGridContext.js.map +0 -1
  353. package/dist/components/Grid/grid/ag-grid/AgGridModel.d.ts +0 -88
  354. package/dist/components/Grid/grid/ag-grid/AgGridModel.js +0 -565
  355. package/dist/components/Grid/grid/ag-grid/AgGridModel.js.map +0 -1
  356. package/dist/components/Grid/grid/ag-grid/ServerSideDatasource.d.ts +0 -7
  357. package/dist/components/Grid/grid/ag-grid/ServerSideDatasource.js +0 -38
  358. package/dist/components/Grid/grid/ag-grid/ServerSideDatasource.js.map +0 -1
  359. package/dist/components/Grid/grid/ag-grid/useAgGridInstance.d.ts +0 -2
  360. package/dist/components/Grid/grid/ag-grid/useAgGridInstance.js +0 -9
  361. package/dist/components/Grid/grid/ag-grid/useAgGridInstance.js.map +0 -1
  362. package/dist/components/Grid/grid/styles.js.map +0 -1
  363. package/dist/components/Grid/grid/useGridInstance.d.ts +0 -2
  364. package/dist/components/Grid/grid/useGridInstance.js.map +0 -1
  365. package/dist/components/Grid/loading/full-row/FullRowLoading.d.ts +0 -3
  366. package/dist/components/Grid/loading/full-row/FullRowLoading.js +0 -33
  367. package/dist/components/Grid/loading/full-row/FullRowLoading.js.map +0 -1
  368. package/dist/components/Grid/loading/full-row/styles.d.ts +0 -9
  369. package/dist/components/Grid/loading/full-row/styles.js +0 -16
  370. package/dist/components/Grid/loading/full-row/styles.js.map +0 -1
  371. package/dist/components/Grid/overlays/empty-records/EmptyRecordsOverlay.js +0 -13
  372. package/dist/components/Grid/overlays/empty-records/EmptyRecordsOverlay.js.map +0 -1
  373. package/dist/components/Grid/overlays/empty-records/styles.js.map +0 -1
  374. package/dist/components/Grid/overlays/loading/LoadingOverlay.js.map +0 -1
  375. package/dist/components/GridCellRenderer/GridCellRendererModel.d.ts +0 -51
  376. package/dist/components/GridCellRenderer/GridCellRendererModel.js +0 -211
  377. package/dist/components/GridCellRenderer/GridCellRendererModel.js.map +0 -1
  378. package/dist/components/GridCellRenderer/ValueRenderer/ColorfulOptionSetValueRenderer/ColorfulOptionSetValueRenderer.d.ts +0 -9
  379. package/dist/components/GridCellRenderer/ValueRenderer/ColorfulOptionSetValueRenderer/ColorfulOptionSetValueRenderer.js +0 -53
  380. package/dist/components/GridCellRenderer/ValueRenderer/ColorfulOptionSetValueRenderer/ColorfulOptionSetValueRenderer.js.map +0 -1
  381. package/dist/components/GridCellRenderer/ValueRenderer/ColorfulOptionSetValueRenderer/styles.d.ts +0 -20
  382. package/dist/components/GridCellRenderer/ValueRenderer/ColorfulOptionSetValueRenderer/styles.js +0 -29
  383. package/dist/components/GridCellRenderer/ValueRenderer/ColorfulOptionSetValueRenderer/styles.js.map +0 -1
  384. package/dist/components/GridCellRenderer/ValueRenderer/FileRenderer/FileRenderer.d.ts +0 -7
  385. package/dist/components/GridCellRenderer/ValueRenderer/FileRenderer/FileRenderer.js +0 -76
  386. package/dist/components/GridCellRenderer/ValueRenderer/FileRenderer/FileRenderer.js.map +0 -1
  387. package/dist/components/GridCellRenderer/ValueRenderer/FileRenderer/styles.d.ts +0 -18
  388. package/dist/components/GridCellRenderer/ValueRenderer/FileRenderer/styles.js +0 -25
  389. package/dist/components/GridCellRenderer/ValueRenderer/FileRenderer/styles.js.map +0 -1
  390. package/dist/components/GridCellRenderer/ValueRenderer/ValueRenderer.d.ts +0 -3
  391. package/dist/components/GridCellRenderer/ValueRenderer/ValueRenderer.js +0 -52
  392. package/dist/components/GridCellRenderer/ValueRenderer/ValueRenderer.js.map +0 -1
  393. package/dist/components/GridCellRenderer/ValueRenderer/styles.d.ts +0 -1666
  394. package/dist/components/GridCellRenderer/ValueRenderer/styles.js +0 -31
  395. package/dist/components/GridCellRenderer/ValueRenderer/styles.js.map +0 -1
  396. package/dist/components/GridCellRenderer/properties/Email.d.ts +0 -5
  397. package/dist/components/GridCellRenderer/properties/Email.js +0 -15
  398. package/dist/components/GridCellRenderer/properties/Email.js.map +0 -1
  399. package/dist/components/GridCellRenderer/properties/File.d.ts +0 -19
  400. package/dist/components/GridCellRenderer/properties/File.js +0 -99
  401. package/dist/components/GridCellRenderer/properties/File.js.map +0 -1
  402. package/dist/components/GridCellRenderer/properties/Image.d.ts +0 -4
  403. package/dist/components/GridCellRenderer/properties/Image.js +0 -15
  404. package/dist/components/GridCellRenderer/properties/Image.js.map +0 -1
  405. package/dist/components/GridCellRenderer/properties/Lookup.d.ts +0 -6
  406. package/dist/components/GridCellRenderer/properties/Lookup.js +0 -19
  407. package/dist/components/GridCellRenderer/properties/Lookup.js.map +0 -1
  408. package/dist/components/GridCellRenderer/properties/MultiSelectOptionSet.d.ts +0 -5
  409. package/dist/components/GridCellRenderer/properties/MultiSelectOptionSet.js +0 -11
  410. package/dist/components/GridCellRenderer/properties/MultiSelectOptionSet.js.map +0 -1
  411. package/dist/components/GridCellRenderer/properties/MultilineText.d.ts +0 -4
  412. package/dist/components/GridCellRenderer/properties/MultilineText.js +0 -10
  413. package/dist/components/GridCellRenderer/properties/MultilineText.js.map +0 -1
  414. package/dist/components/GridCellRenderer/properties/OptionSet.d.ts +0 -5
  415. package/dist/components/GridCellRenderer/properties/OptionSet.js +0 -11
  416. package/dist/components/GridCellRenderer/properties/OptionSet.js.map +0 -1
  417. package/dist/components/GridCellRenderer/properties/OptionSetBase.d.ts +0 -7
  418. package/dist/components/GridCellRenderer/properties/OptionSetBase.js +0 -19
  419. package/dist/components/GridCellRenderer/properties/OptionSetBase.js.map +0 -1
  420. package/dist/components/GridCellRenderer/properties/Phone.d.ts +0 -9
  421. package/dist/components/GridCellRenderer/properties/Phone.js +0 -15
  422. package/dist/components/GridCellRenderer/properties/Phone.js.map +0 -1
  423. package/dist/components/GridCellRenderer/properties/Property.d.ts +0 -19
  424. package/dist/components/GridCellRenderer/properties/Property.js +0 -54
  425. package/dist/components/GridCellRenderer/properties/Property.js.map +0 -1
  426. package/dist/components/GridCellRenderer/properties/TwoOptions.d.ts +0 -5
  427. package/dist/components/GridCellRenderer/properties/TwoOptions.js +0 -11
  428. package/dist/components/GridCellRenderer/properties/TwoOptions.js.map +0 -1
  429. package/dist/components/GridCellRenderer/properties/Url.d.ts +0 -5
  430. package/dist/components/GridCellRenderer/properties/Url.js +0 -15
  431. package/dist/components/GridCellRenderer/properties/Url.js.map +0 -1
  432. package/dist/components/GridCellRenderer/useModel.d.ts +0 -4
  433. package/dist/components/GridCellRenderer/useModel.js +0 -9
  434. package/dist/components/GridCellRenderer/useModel.js.map +0 -1
  435. package/dist/components/GridColumnHeader/GridColumnHeader.d.ts +0 -3
  436. package/dist/components/GridColumnHeader/GridColumnHeader.js +0 -134
  437. package/dist/components/GridColumnHeader/GridColumnHeader.js.map +0 -1
  438. package/dist/components/GridColumnHeader/GridColumnHeaderModel.d.ts +0 -26
  439. package/dist/components/GridColumnHeader/GridColumnHeaderModel.js +0 -87
  440. package/dist/components/GridColumnHeader/GridColumnHeaderModel.js.map +0 -1
  441. package/dist/components/GridColumnHeader/interfaces.d.ts +0 -45
  442. package/dist/components/GridColumnHeader/styles.d.ts +0 -37
  443. package/dist/components/GridColumnHeader/styles.js +0 -55
  444. package/dist/components/GridColumnHeader/styles.js.map +0 -1
  445. package/dist/components/GridColumnHeader/translations.d.ts +0 -26
  446. package/dist/components/GridColumnHeader/translations.js +0 -29
  447. package/dist/components/GridColumnHeader/translations.js.map +0 -1
  448. package/dist/components/Ribbon/Ribbon.d.ts +0 -3
  449. package/dist/components/Ribbon/Ribbon.js +0 -97
  450. package/dist/components/Ribbon/Ribbon.js.map +0 -1
  451. package/dist/components/Ribbon/RibbonModel.d.ts +0 -4
  452. package/dist/components/Ribbon/interfaces.d.ts +0 -19
  453. package/dist/components/Ribbon/styles.d.ts +0 -11
  454. package/dist/components/Ribbon/styles.js +0 -18
  455. package/dist/components/Ribbon/styles.js.map +0 -1
  456. package/dist/hooks/useEventEmitter.d.ts +0 -2
  457. package/dist/hooks/useEventEmitter.js +0 -18
  458. package/dist/hooks/useEventEmitter.js.map +0 -1
  459. /package/dist/components/Grid/{grid/GridContext.js → GridContext.js} +0 -0
  460. /package/dist/components/Grid/{overlays/empty-records/EmptyRecordsOverlay.d.ts → core/components/AgGrid/components/EmptyRecordsOverlay/EmptyRecords.d.ts} +0 -0
  461. /package/dist/components/Grid/{overlays/loading → core/components/AgGrid/components/LoadingOverlay}/LoadingOverlay.d.ts +0 -0
  462. /package/dist/components/Grid/{overlays/loading → core/components/AgGrid/components/LoadingOverlay}/LoadingOverlay.js +0 -0
  463. /package/dist/components/Grid/{cells/cell/content → core/components/Cell/CellContent}/styles.d.ts +0 -0
  464. /package/dist/components/Grid/{cells/cell/content → core/components/Cell/CellContent}/styles.js +0 -0
  465. /package/dist/components/Grid/{cells/cell/notifications → core/components/Cell/Notifications}/styles.d.ts +0 -0
  466. /package/dist/components/Grid/{column-headers/record-selection-checkbox → core/components/ColumnHeader/components/GlobalCheckbox}/styles.d.ts +0 -0
  467. /package/dist/components/Grid/{column-headers/record-selection-checkbox → core/components/ColumnHeader/components/GlobalCheckbox}/styles.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/Grid/filtering/constants.ts"],"sourcesContent":["import { DatasetConditionOperator } from \"../core/enums/ConditionOperator\";\n\nexport const OPERATORS = [\n { type: DatasetConditionOperator.None, key: 'condition-none' },\n { type: DatasetConditionOperator.Equal, key: 'condition-equal' },\n { type: DatasetConditionOperator.NotEqual, key: 'condition-notequal' },\n { type: DatasetConditionOperator.GreaterThan, key: 'condition-greaterthan' },\n { type: DatasetConditionOperator.LessThan, key: 'condition-lessthan' },\n { type: DatasetConditionOperator.GreaterEqual, key: 'condition-greaterequal' },\n { type: DatasetConditionOperator.LessEqual, key: 'condition-lessequal' },\n { type: DatasetConditionOperator.Like, key: 'condition-like' },\n { type: DatasetConditionOperator.NotLike, key: 'condition-notlike' },\n { type: DatasetConditionOperator.In, key: 'condition-in' },\n { type: DatasetConditionOperator.NotIn, key: 'condition-notin' },\n { type: DatasetConditionOperator.Between, key: 'condition-between' },\n { type: DatasetConditionOperator.NotBetween, key: 'condition-notbetween' },\n { type: DatasetConditionOperator.Null, key: 'condition-null' },\n { type: DatasetConditionOperator.NotNull, key: 'condition-notnull' },\n { type: DatasetConditionOperator.Yesterday, key: 'condition-yesterday' },\n { type: DatasetConditionOperator.Today, key: 'condition-today' },\n { type: DatasetConditionOperator.Tomorrow, key: 'condition-tomorrow' },\n { type: DatasetConditionOperator.Last7Days, key: 'condition-last7days' },\n { type: DatasetConditionOperator.Next7Days, key: 'condition-next7days' },\n { type: DatasetConditionOperator.LastWeek, key: 'condition-lastweek' },\n { type: DatasetConditionOperator.ThisWeek, key: 'condition-thisweek' },\n { type: DatasetConditionOperator.LastMonth, key: 'condition-lastmonth' },\n { type: DatasetConditionOperator.ThisMonth, key: 'condition-thismonth' },\n { type: DatasetConditionOperator.On, key: 'condition-on' },\n { type: DatasetConditionOperator.OnOrBefore, key: 'condition-onorbefore' },\n { type: DatasetConditionOperator.OnOrAfter, key: 'condition-onorafter' },\n { type: DatasetConditionOperator.LastYear, key: 'condition-lastyear' },\n { type: DatasetConditionOperator.ThisYear, key: 'condition-thisyear' },\n { type: DatasetConditionOperator.LastXDays, key: 'condition-lastxdays' },\n { type: DatasetConditionOperator.NextXDays, key: 'condition-nextxdays' },\n { type: DatasetConditionOperator.LastXMonths, key: 'condition-lastxmonths' },\n { type: DatasetConditionOperator.NextXMonths, key: 'condition-nextxmonths' },\n { type: DatasetConditionOperator.Contains, key: 'condition-contains' },\n { type: DatasetConditionOperator.BeginWith, key: 'condition-beginwith' },\n { type: DatasetConditionOperator.DoesNotBeginWith, key: 'condition-doesnotbeginwith' },\n { type: DatasetConditionOperator.EndsWith, key: 'condition-endswith' },\n { type: DatasetConditionOperator.DoesNotEndWith, key: 'condition-doesnotendwith' },\n { type: DatasetConditionOperator.InFiscalPeriodAndYear, key: 'condition-infiscalperiodandyear' },\n { type: DatasetConditionOperator.Above, key: 'condition-above' },\n { type: DatasetConditionOperator.Under, key: 'condition-under' },\n { type: DatasetConditionOperator.NotUnder, key: 'condition-notunder' },\n { type: DatasetConditionOperator.AboveOrEqual, key: 'condition-aboveorequal' },\n { type: DatasetConditionOperator.UnderOrEqual, key: 'condition-underorequal' },\n { type: DatasetConditionOperator.ContainValues, key: 'condition-containvalues' },\n { type: DatasetConditionOperator.DoesNotContainValues, key: 'condition-doesnotcontainvalues' }, // Added missing operator\n];"],"names":[],"mappings":";;AAEa,MAAA,SAAS,GAAG;IACrB,EAAE,IAAI,EAAE,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,EAAE;IAC9D,EAAE,IAAI,EAAE,wBAAwB,CAAC,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE;IAChE,EAAE,IAAI,EAAE,wBAAwB,CAAC,QAAQ,EAAE,GAAG,EAAE,oBAAoB,EAAE;IACtE,EAAE,IAAI,EAAE,wBAAwB,CAAC,WAAW,EAAE,GAAG,EAAE,uBAAuB,EAAE;IAC5E,EAAE,IAAI,EAAE,wBAAwB,CAAC,QAAQ,EAAE,GAAG,EAAE,oBAAoB,EAAE;IACtE,EAAE,IAAI,EAAE,wBAAwB,CAAC,YAAY,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAC9E,EAAE,IAAI,EAAE,wBAAwB,CAAC,SAAS,EAAE,GAAG,EAAE,qBAAqB,EAAE;IACxE,EAAE,IAAI,EAAE,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,EAAE;IAC9D,EAAE,IAAI,EAAE,wBAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE;IACpE,EAAE,IAAI,EAAE,wBAAwB,CAAC,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE;IAC1D,EAAE,IAAI,EAAE,wBAAwB,CAAC,KAAK,EA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AwB,CAAC,YAAY,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAC9E,EAAE,IAAI,EAAE,wBAAwB,CAAC,YAAY,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAC9E,EAAE,IAAI,EAAE,wBAAwB,CAAC,aAAa,EAAE,GAAG,EAAE,yBAAyB,EAAE;IAChF,EAAE,IAAI,EAAE,wBAAwB,CAAC,oBAAoB,EAAE,GAAG,EAAE,gCAAgC,EAAE;;;;;"}
@@ -0,0 +1,21 @@
1
+ import { DatasetConditionOperator } from "../../core/enums/ConditionOperator";
2
+ import { IGridColumn } from "../../core/interfaces/IGridColumn";
3
+ export interface IColumnFilterConditionController {
4
+ isAppliedToDataset: boolean;
5
+ column: IGridColumn;
6
+ value: {
7
+ valid: boolean;
8
+ get: () => any;
9
+ set: (value: any) => void;
10
+ };
11
+ operator: {
12
+ get: () => DatasetConditionOperator | undefined;
13
+ set: (operator: DatasetConditionOperator) => void;
14
+ };
15
+ remove: () => void;
16
+ save: () => Promise<boolean>;
17
+ clear: () => void;
18
+ setShouldShowError: (shouldShowError: boolean) => void;
19
+ shouldShowError: () => boolean;
20
+ }
21
+ export declare const useColumnFilterConditionController: (column: IGridColumn) => IColumnFilterConditionController | null;
@@ -0,0 +1,44 @@
1
+ import { useMemo, useState, useEffect } from 'react';
2
+ import { useGridInstance } from '../../core/hooks/useGridInstance.js';
3
+ import { useRefreshCallback } from '../../core/hooks/useRefreshCallback.js';
4
+
5
+ const useColumnFilterConditionController = (column) => {
6
+ const filtering = useGridInstance().filtering;
7
+ const conditionPromise = useMemo(() => filtering.condition(column), []);
8
+ const [controller, setController] = useState();
9
+ const refresh = async () => {
10
+ const condition = await conditionPromise;
11
+ setController(prevState => ({
12
+ ...prevState,
13
+ isAppliedToDataset: condition.isAppliedToDataset,
14
+ column: condition?.column,
15
+ operator: {
16
+ get: () => condition.operator.get(),
17
+ set: (operator) => condition.operator.set(operator)
18
+ },
19
+ value: {
20
+ valid: condition.isValid,
21
+ get: () => condition.value.get(),
22
+ set: (value) => condition.value.set(value)
23
+ },
24
+ remove: () => condition?.remove(),
25
+ save: () => condition?.save(),
26
+ clear: () => condition?.clear(),
27
+ setShouldShowError: (shouldShowError) => condition?.setShouldShowError(shouldShowError),
28
+ shouldShowError: () => condition?.shouldShowError()
29
+ }));
30
+ };
31
+ useRefreshCallback(conditionPromise, refresh);
32
+ useEffect(() => {
33
+ (async () => {
34
+ refresh();
35
+ })();
36
+ }, []);
37
+ if (!controller) {
38
+ return null;
39
+ }
40
+ return controller;
41
+ };
42
+
43
+ export { useColumnFilterConditionController };
44
+ //# sourceMappingURL=useColumnFilterConditionController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColumnFilterConditionController.js","sources":["../../../../../src/components/Grid/filtering/controller/useColumnFilterConditionController.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport { DatasetConditionOperator } from \"../../core/enums/ConditionOperator\";\nimport { useGridInstance } from \"../../core/hooks/useGridInstance\"\nimport { useRefreshCallback } from \"../../core/hooks/useRefreshCallback\";\nimport { IGridColumn } from \"../../core/interfaces/IGridColumn\";\n\nexport interface IColumnFilterConditionController {\n isAppliedToDataset: boolean,\n column: IGridColumn,\n value: {\n valid: boolean;\n get: () => any;\n set: (value: any) => void;\n }\n operator: {\n get: () => DatasetConditionOperator | undefined;\n set: (operator: DatasetConditionOperator) => void;\n },\n remove: () => void;\n save: () => Promise<boolean>;\n clear: () => void;\n setShouldShowError: (shouldShowError: boolean) => void;\n shouldShowError: () => boolean;\n}\n\nexport const useColumnFilterConditionController = (column: IGridColumn): IColumnFilterConditionController | null => {\n const filtering = useGridInstance().filtering;\n const conditionPromise = useMemo(() => filtering.condition(column), []);\n const [controller, setController] = useState<IColumnFilterConditionController>();\n \n const refresh = async () => {\n const condition = await conditionPromise;\n setController(prevState => ({\n ...prevState,\n isAppliedToDataset: condition.isAppliedToDataset,\n column: condition?.column,\n operator: {\n get: () => condition.operator.get(),\n set: (operator) => condition.operator.set(operator)\n },\n value: {\n valid: condition.isValid,\n get: () => condition.value.get(),\n set: (value) => condition.value.set(value)\n },\n remove: () => condition?.remove(),\n save: () => condition?.save(),\n clear: () => condition?.clear(),\n setShouldShowError: (shouldShowError: boolean) => condition?.setShouldShowError(shouldShowError),\n shouldShowError: () => condition?.shouldShowError()\n }))\n }\n useRefreshCallback(conditionPromise, refresh);\n useEffect(() => {\n (async () => {\n refresh();\n })();\n }, []);\n\n\n if(!controller) {\n return null;\n }\n return controller;\n}"],"names":[],"mappings":";;;;AAyBa,MAAA,kCAAkC,GAAG,CAAC,MAAmB,KAA6C;AAC/G,IAAA,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC,SAAS,CAAC;AAC9C,IAAA,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,EAAoC,CAAC;AAEjF,IAAA,MAAM,OAAO,GAAG,YAAW;AACvB,QAAA,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC;AACzC,QAAA,aAAa,CAAC,SAAS,KAAK;AACxB,YAAA,GAAG,SAAS;YACZ,kBAAkB,EAAE,SAAS,CAAC,kBAAkB;YAChD,MAAM,EAAE,SAAS,EAAE,MAAM;AACzB,YAAA,QAAQ,EAAE;gBACN,GAAG,EAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE;AACnC,gBAAA,GAAG,EAAE,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtD,aAAA;AACD,YAAA,KAAK,EAAE;gBACH,KAAK,EAAE,SAAS,CAAC,OAAO;gBACxB,GAAG,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;AAChC,gBAAA,GAAG,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;AAC7C,aAAA;AACD,YAAA,MAAM,EAAE,MAAM,SAAS,EAAE,MAAM,EAAE;AACjC,YAAA,IAAI,EAAE,MAAM,SAAS,EAAE,IAAI,EAAE;AAC7B,YAAA,KAAK,EAAE,MAAM,SAAS,EAAE,KAAK,EAAE;YAC/B,kBAAkB,EAAE,CAAC,eAAwB,KAAK,SAAS,EAAE,kBAAkB,CAAC,eAAe,CAAC;AAChG,YAAA,eAAe,EAAE,MAAM,SAAS,EAAE,eAAe,EAAE;AACtD,SAAA,CAAC,CAAC,CAAA;AACP,KAAC,CAAA;AACD,IAAA,kBAAkB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC9C,SAAS,CAAC,MAAK;QACX,CAAC,YAAW;AACR,YAAA,OAAO,EAAE,CAAC;SACb,GAAG,CAAC;KACR,EAAE,EAAE,CAAC,CAAC;IAGP,IAAG,CAAC,UAAU,EAAE;AACZ,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AACD,IAAA,OAAO,UAAU,CAAC;AACtB;;;;"}
@@ -0,0 +1,49 @@
1
+ /// <reference types="@types/powerapps-component-framework" />
2
+ import { DatasetConditionOperator } from "../../core/enums/ConditionOperator";
3
+ import { IGridColumn } from "../../core/interfaces/IGridColumn";
4
+ import { Grid } from "../../core/model/Grid";
5
+ import { GridDependency } from "../../core/model/GridDependency";
6
+ export declare class Condition extends GridDependency {
7
+ private _column;
8
+ private _conditionExpression;
9
+ private _isRemoved?;
10
+ private _conditionUtils;
11
+ private _isValid;
12
+ private _inicializationPromise;
13
+ private _initialized;
14
+ private _shouldShowError;
15
+ constructor(grid: Grid, column: IGridColumn);
16
+ init(): Promise<boolean>;
17
+ get isRemoved(): boolean | undefined;
18
+ get column(): IGridColumn;
19
+ get isAppliedToDataset(): boolean;
20
+ get isValid(): boolean;
21
+ setShouldShowError(value: boolean): void;
22
+ shouldShowError(): boolean;
23
+ getExpression(): Promise<{
24
+ attributeName: string;
25
+ conditionOperator: ComponentFramework.PropertyHelper.DataSetApi.Types.ConditionOperator;
26
+ value: string | string[];
27
+ entityAliasName?: string | undefined;
28
+ }>;
29
+ save(): Promise<boolean>;
30
+ remove(): void;
31
+ clear(): void;
32
+ get operator(): {
33
+ get: () => DatasetConditionOperator;
34
+ set: (conditionOperator: DatasetConditionOperator) => void;
35
+ };
36
+ get value(): {
37
+ get: () => any;
38
+ set: (value: any) => void;
39
+ isValid: () => Promise<boolean>;
40
+ };
41
+ private _get;
42
+ private _set;
43
+ private _attributeNameDecorator;
44
+ private _valueDecorator;
45
+ private _operatorDecorator;
46
+ private _getDefault;
47
+ private get _filterExpression();
48
+ private _getConditionFromFilterExpression;
49
+ }
@@ -0,0 +1,347 @@
1
+ import { MemoryDataProvider, Attribute } from '@talxis/client-libraries';
2
+ import { DatasetConditionOperator } from '../../core/enums/ConditionOperator.js';
3
+ import { DataType } from '../../core/enums/DataType.js';
4
+ import { GridDependency } from '../../core/model/GridDependency.js';
5
+ import { FilteringUtils } from '../utils/FilteringUtilts.js';
6
+ import dayjs from 'dayjs';
7
+
8
+ class Condition extends GridDependency {
9
+ constructor(grid, column) {
10
+ super(grid);
11
+ this._conditionExpression = {};
12
+ this._conditionUtils = FilteringUtils.condition();
13
+ this._isValid = true;
14
+ this._initialized = false;
15
+ this._shouldShowError = false;
16
+ this._column = { ...column };
17
+ switch (this._column.dataType) {
18
+ //this will skip regex validation since it is not desirable during filtering (we have contains and stuff)
19
+ case DataType.SINGLE_LINE_EMAIL:
20
+ case DataType.SINGLE_LINE_URL: {
21
+ this._column.dataType = DataType.SINGLE_LINE_TEXT;
22
+ }
23
+ }
24
+ return new Proxy(this, {
25
+ get: (target, prop) => {
26
+ if (prop !== 'init') {
27
+ if (!target._initialized) {
28
+ throw new Error('Condition has not been initialized. Make sure to call the init() method on the condition object before any operations.');
29
+ }
30
+ }
31
+ //@ts-ignore
32
+ if (typeof target[prop] === 'function') {
33
+ //@ts-ignore
34
+ return target[prop].bind(target);
35
+ }
36
+ //@ts-ignore
37
+ return target[prop];
38
+ }
39
+ });
40
+ }
41
+ async init() {
42
+ if (!this._inicializationPromise) {
43
+ this._inicializationPromise = new Promise(async (resolve) => {
44
+ const [map, key] = await this._getConditionFromFilterExpression();
45
+ if (!key) {
46
+ this._conditionExpression = this._getDefault();
47
+ }
48
+ else {
49
+ this._conditionExpression = map.get(key);
50
+ }
51
+ this._conditionExpression.conditionOperator = this._operatorDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value, true);
52
+ this._conditionExpression.value = this._valueDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value, true);
53
+ this._conditionExpression.attributeName = await this._attributeNameDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.attributeName, true);
54
+ resolve(true);
55
+ this._initialized = true;
56
+ });
57
+ }
58
+ return this._inicializationPromise;
59
+ }
60
+ get isRemoved() {
61
+ return this._isRemoved;
62
+ }
63
+ get column() {
64
+ return this._column;
65
+ }
66
+ get isAppliedToDataset() {
67
+ return !!this._dataset.filtering.getFilter()?.conditions.find(cond => {
68
+ const attributeName = cond.entityAliasName ? `${cond.entityAliasName}.${cond.attributeName}` : cond.attributeName;
69
+ if (attributeName === this._column.name) {
70
+ return true;
71
+ }
72
+ if (attributeName === `${this._column.name}name`) {
73
+ return true;
74
+ }
75
+ return false;
76
+ });
77
+ }
78
+ get isValid() {
79
+ return this._isValid;
80
+ }
81
+ setShouldShowError(value) {
82
+ this._shouldShowError = value;
83
+ }
84
+ shouldShowError() {
85
+ return this._shouldShowError;
86
+ }
87
+ async getExpression() {
88
+ const result = { ...this._conditionExpression };
89
+ result.conditionOperator = this._operatorDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value);
90
+ result.value = this._valueDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value);
91
+ result.attributeName = await this._attributeNameDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.attributeName);
92
+ return result;
93
+ }
94
+ async save() {
95
+ this._shouldShowError = true;
96
+ if (!await this.value.isValid()) {
97
+ this._isValid = false;
98
+ this._triggerRefreshCallbacks();
99
+ return false;
100
+ }
101
+ const filterExpression = this._filterExpression;
102
+ if (this.isAppliedToDataset || this._isRemoved) {
103
+ const [map, key] = await this._getConditionFromFilterExpression();
104
+ map.delete(key);
105
+ filterExpression.conditions = [...map.values()];
106
+ }
107
+ if (!this._isRemoved) {
108
+ filterExpression.conditions.push(await this.getExpression());
109
+ }
110
+ this._dataset.filtering.setFilter(filterExpression);
111
+ return true;
112
+ }
113
+ remove() {
114
+ this._isRemoved = true;
115
+ }
116
+ clear() {
117
+ this._inicializationPromise = undefined;
118
+ }
119
+ get operator() {
120
+ return {
121
+ get: () => this._get('operator'),
122
+ set: (conditionOperator) => {
123
+ const previousOperator = this._conditionExpression.conditionOperator;
124
+ this._set("operator", conditionOperator, null);
125
+ const isCurrentEditable = this._conditionUtils.value(conditionOperator).isManuallyEditable;
126
+ const isPreviousEditable = this._conditionUtils.value(previousOperator).isManuallyEditable;
127
+ if (isCurrentEditable !== isPreviousEditable) {
128
+ // we are transitioning between editable and non-editable operators and the value of these data types needs to be set to null
129
+ // to prevent type incompability
130
+ switch (this._column.dataType) {
131
+ case DataType.MULTI_SELECT_OPTIONSET:
132
+ case DataType.OPTIONSET:
133
+ case DataType.TWO_OPTIONS:
134
+ case DataType.LOOKUP_SIMPLE:
135
+ case DataType.LOOKUP_OWNER:
136
+ case DataType.LOOKUP_CUSTOMER:
137
+ case DataType.DATE_AND_TIME_DATE_AND_TIME:
138
+ case DataType.DATE_AND_TIME_DATE_ONLY: {
139
+ this._conditionExpression.value = "";
140
+ break;
141
+ }
142
+ }
143
+ }
144
+ //@ts-ignore - going from between/not between to other operators
145
+ if ((previousOperator === 10 || previousOperator === 11) && (conditionOperator !== 10 && conditionOperator !== 11)) {
146
+ this._conditionExpression.value = "";
147
+ }
148
+ //@ts-ignore - going from other operators to between/not between
149
+ if ((conditionOperator === 10 || conditionOperator === 11) && (previousOperator !== 10 && previousOperator !== 11)) {
150
+ this._conditionExpression.value = [];
151
+ }
152
+ },
153
+ };
154
+ }
155
+ get value() {
156
+ return {
157
+ get: () => this._get('value'),
158
+ set: (value) => this._set("value", undefined, value),
159
+ isValid: async () => {
160
+ if (this._conditionUtils.operator(this.operator.get()).doesNotAllowValue) {
161
+ return true;
162
+ }
163
+ const operator = this.operator.get();
164
+ if (operator === DatasetConditionOperator.Between || operator === DatasetConditionOperator.NotBetween) {
165
+ // undefined causes dayjs to use today
166
+ const date1 = dayjs(this.value.get()?.[0] ?? '---');
167
+ const date2 = dayjs(this.value.get()?.[1] ?? '---');
168
+ if (date1.isValid() && date2.isValid()) {
169
+ return true;
170
+ }
171
+ return false;
172
+ }
173
+ const memoryProvider = new MemoryDataProvider([{
174
+ id: 'id',
175
+ [this._column.name]: await this.value.get() ?? undefined
176
+ }], { PrimaryIdAttribute: "id" });
177
+ memoryProvider.setColumns([{ ...this._column, metadata: { ...this._column.metadata, RequiredLevel: 0 } }, {
178
+ name: 'id',
179
+ displayName: '',
180
+ dataType: DataType.SINGLE_LINE_TEXT,
181
+ alias: 'id',
182
+ order: 0,
183
+ visualSizeFactor: 0
184
+ }]);
185
+ const record = memoryProvider.refreshSync()[0];
186
+ record.expressions?.setRequiredLevelExpression(this._column.name, () => 'required');
187
+ return !record.getColumnInfo(this._column.name).error;
188
+ }
189
+ };
190
+ }
191
+ _get(type) {
192
+ if (type === 'operator') {
193
+ return this._conditionExpression.conditionOperator;
194
+ }
195
+ return this._conditionExpression.value;
196
+ }
197
+ _set(type, conditionOperator, value) {
198
+ this._isValid = true;
199
+ if (type === 'operator') {
200
+ this._conditionExpression.conditionOperator = conditionOperator;
201
+ }
202
+ else {
203
+ this._conditionExpression.value = value;
204
+ }
205
+ this._triggerRefreshCallbacks();
206
+ }
207
+ async _attributeNameDecorator(conditionOperator, attributeName, undecorate) {
208
+ if (!this._conditionUtils.value(conditionOperator).isManuallyEditable) {
209
+ return attributeName;
210
+ }
211
+ switch (this._column.dataType) {
212
+ case DataType.OPTIONSET:
213
+ case DataType.TWO_OPTIONS:
214
+ case DataType.LOOKUP_OWNER:
215
+ case DataType.LOOKUP_SIMPLE:
216
+ case DataType.LOOKUP_CUSTOMER: {
217
+ if (undecorate) {
218
+ if (attributeName.endsWith('name')) {
219
+ return attributeName.slice(0, -4);
220
+ }
221
+ return attributeName;
222
+ }
223
+ if (attributeName.endsWith('name')) {
224
+ return attributeName;
225
+ }
226
+ return `${attributeName}name`;
227
+ }
228
+ default: {
229
+ return attributeName;
230
+ }
231
+ }
232
+ }
233
+ _valueDecorator(conditionOperator, value, undecorate) {
234
+ switch (conditionOperator) {
235
+ case DatasetConditionOperator.BeginWith:
236
+ case DatasetConditionOperator.DoesNotBeginWith: {
237
+ if (undecorate) {
238
+ return value.slice(0, -1);
239
+ }
240
+ return `${value}%`;
241
+ }
242
+ case DatasetConditionOperator.EndsWith:
243
+ case DatasetConditionOperator.DoesNotEndWith: {
244
+ if (undecorate) {
245
+ return value.slice(1);
246
+ }
247
+ return `%${value}`;
248
+ }
249
+ case DatasetConditionOperator.Like:
250
+ case DatasetConditionOperator.NotLike: {
251
+ if (undecorate) {
252
+ return value.slice(1, -1);
253
+ }
254
+ return `%${value}%`;
255
+ }
256
+ default: {
257
+ return value;
258
+ }
259
+ }
260
+ }
261
+ _operatorDecorator(conditionOperator, value, undecorate) {
262
+ switch (this._column.dataType) {
263
+ case DataType.MULTI_SELECT_OPTIONSET:
264
+ case DataType.OPTIONSET:
265
+ case DataType.TWO_OPTIONS:
266
+ case DataType.LOOKUP_OWNER:
267
+ case DataType.LOOKUP_SIMPLE:
268
+ case DataType.LOOKUP_CUSTOMER: {
269
+ //we need to switch the operators based on the number of selected options
270
+ if (typeof value !== 'string') {
271
+ if (undecorate) {
272
+ switch (conditionOperator) {
273
+ case DatasetConditionOperator.In: {
274
+ return DatasetConditionOperator.Equal;
275
+ }
276
+ case DatasetConditionOperator.NotIn: {
277
+ return DatasetConditionOperator.NotEqual;
278
+ }
279
+ }
280
+ }
281
+ switch (conditionOperator) {
282
+ case DatasetConditionOperator.Equal: {
283
+ return DatasetConditionOperator.In;
284
+ }
285
+ case DatasetConditionOperator.NotEqual: {
286
+ return DatasetConditionOperator.NotIn;
287
+ }
288
+ }
289
+ }
290
+ else {
291
+ switch (conditionOperator) {
292
+ case DatasetConditionOperator.In: {
293
+ return DatasetConditionOperator.Equal;
294
+ }
295
+ case DatasetConditionOperator.NotIn: {
296
+ return DatasetConditionOperator.NotEqual;
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+ return conditionOperator;
303
+ }
304
+ _getDefault() {
305
+ const entityAliasName = Attribute.GetLinkedEntityAlias(this._column.name);
306
+ const attributeName = Attribute.GetNameFromAlias(this._column.name);
307
+ const cond = {
308
+ attributeName: attributeName,
309
+ conditionOperator: DatasetConditionOperator.Equal,
310
+ entityAliasName: entityAliasName ?? "",
311
+ value: ""
312
+ };
313
+ switch (this._column.dataType) {
314
+ case DataType.DATE_AND_TIME_DATE_AND_TIME:
315
+ case DataType.DATE_AND_TIME_DATE_ONLY: {
316
+ cond.conditionOperator = DatasetConditionOperator.On;
317
+ break;
318
+ }
319
+ case DataType.IMAGE:
320
+ case DataType.FILE: {
321
+ cond.conditionOperator = DatasetConditionOperator.NotNull;
322
+ break;
323
+ }
324
+ }
325
+ return cond;
326
+ }
327
+ get _filterExpression() {
328
+ return structuredClone(this._dataset.filtering.getFilter()) ?? {
329
+ conditions: [],
330
+ filterOperator: 0
331
+ };
332
+ }
333
+ async _getConditionFromFilterExpression() {
334
+ const map = new Map(this._filterExpression.conditions.map(x => [x.attributeName, x]));
335
+ const attributeName = Attribute.GetNameFromAlias(this._column.name);
336
+ for (const cond of map.values()) {
337
+ const conditionAttributeName = await this._attributeNameDecorator(cond.conditionOperator, cond.attributeName, true);
338
+ if (conditionAttributeName === attributeName) {
339
+ return [map, cond.attributeName];
340
+ }
341
+ }
342
+ return [map, ""];
343
+ }
344
+ }
345
+
346
+ export { Condition };
347
+ //# sourceMappingURL=Condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Condition.js","sources":["../../../../../src/components/Grid/filtering/model/Condition.ts"],"sourcesContent":["import { Attribute, MemoryDataProvider } from \"@talxis/client-libraries\";\nimport { DatasetConditionOperator } from \"../../core/enums/ConditionOperator\";\nimport { DataType } from \"../../core/enums/DataType\";\nimport { IGridColumn } from \"../../core/interfaces/IGridColumn\";\nimport { Grid } from \"../../core/model/Grid\";\nimport { GridDependency } from \"../../core/model/GridDependency\";\nimport { FilteringUtils } from \"../utils/FilteringUtilts\";\nimport dayjs from \"dayjs\";\n\nexport class Condition extends GridDependency {\n private _column: IGridColumn;\n private _conditionExpression: ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression = {} as any;\n private _isRemoved?: boolean;\n private _conditionUtils = FilteringUtils.condition();\n private _isValid: boolean = true;\n private _inicializationPromise: Promise<boolean> | undefined;\n private _initialized: boolean = false;\n private _shouldShowError: boolean = false;\n\n constructor(grid: Grid, column: IGridColumn) {\n super(grid);\n this._column = {...column};\n switch(this._column.dataType) {\n //this will skip regex validation since it is not desirable during filtering (we have contains and stuff)\n case DataType.SINGLE_LINE_EMAIL:\n case DataType.SINGLE_LINE_URL: {\n this._column.dataType = DataType.SINGLE_LINE_TEXT;\n }\n }\n return new Proxy(this, {\n get: (target, prop) => {\n if(prop !== 'init') {\n if(!target._initialized) {\n throw new Error('Condition has not been initialized. Make sure to call the init() method on the condition object before any operations.')\n }\n }\n //@ts-ignore\n if (typeof target[prop] === 'function') {\n //@ts-ignore\n return target[prop].bind(target);\n }\n //@ts-ignore\n return target[prop];\n }\n })\n }\n public async init() {\n if (!this._inicializationPromise) {\n this._inicializationPromise = new Promise(async (resolve) => {\n const [map, key] = await this._getConditionFromFilterExpression();\n if(!key) {\n this._conditionExpression = this._getDefault();\n }\n else {\n this._conditionExpression = map.get(key)!;\n }\n this._conditionExpression.conditionOperator = this._operatorDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value, true) as any;\n this._conditionExpression.value = this._valueDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value, true);\n this._conditionExpression.attributeName = await this._attributeNameDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.attributeName, true);\n resolve(true);\n this._initialized = true;\n })\n }\n return this._inicializationPromise;\n }\n public get isRemoved() {\n return this._isRemoved;\n }\n\n public get column() {\n return this._column;\n }\n\n public get isAppliedToDataset() {\n return !!this._dataset.filtering.getFilter()?.conditions.find(cond => {\n const attributeName = cond.entityAliasName ? `${cond.entityAliasName}.${cond.attributeName}` : cond.attributeName;\n if(attributeName === this._column.name) {\n return true;\n }\n if(attributeName === `${this._column.name}name`) {\n return true;\n }\n return false;\n })\n }\n\n public get isValid() {\n return this._isValid;\n }\n\n public setShouldShowError(value: boolean) {\n this._shouldShowError = value;\n }\n\n public shouldShowError() {\n return this._shouldShowError;\n }\n\n public async getExpression() {\n const result = { ...this._conditionExpression };\n result.conditionOperator = this._operatorDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value) as any;\n result.value = this._valueDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value);\n result.attributeName = await this._attributeNameDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.attributeName);\n return result;\n\n }\n public async save(): Promise<boolean> {\n this._shouldShowError = true;\n if (!await this.value.isValid()) {\n this._isValid = false;\n this._triggerRefreshCallbacks();\n return false;\n }\n const filterExpression = this._filterExpression;\n if (this.isAppliedToDataset || this._isRemoved) {\n const [map, key] = await this._getConditionFromFilterExpression();\n map.delete(key);\n filterExpression.conditions = [...map.values()];\n }\n if (!this._isRemoved) {\n filterExpression.conditions.push(await this.getExpression());\n }\n this._dataset.filtering.setFilter(filterExpression);\n return true;\n\n }\n public remove() {\n this._isRemoved = true;\n }\n public clear() {\n this._inicializationPromise = undefined;\n }\n public get operator() {\n return {\n get: () => this._get('operator') as DatasetConditionOperator,\n set: (conditionOperator: DatasetConditionOperator) => {\n const previousOperator = this._conditionExpression.conditionOperator\n this._set(\"operator\", conditionOperator, null);\n const isCurrentEditable = this._conditionUtils.value(conditionOperator).isManuallyEditable;\n const isPreviousEditable = this._conditionUtils.value(previousOperator).isManuallyEditable;\n\n if (isCurrentEditable !== isPreviousEditable) {\n // we are transitioning between editable and non-editable operators and the value of these data types needs to be set to null\n // to prevent type incompability\n switch (this._column.dataType) {\n case DataType.MULTI_SELECT_OPTIONSET:\n case DataType.OPTIONSET:\n case DataType.TWO_OPTIONS:\n case DataType.LOOKUP_SIMPLE:\n case DataType.LOOKUP_OWNER:\n case DataType.LOOKUP_CUSTOMER:\n case DataType.DATE_AND_TIME_DATE_AND_TIME:\n case DataType.DATE_AND_TIME_DATE_ONLY: {\n this._conditionExpression!.value = \"\"\n break;\n }\n }\n }\n //@ts-ignore - going from between/not between to other operators\n if((previousOperator === 10 || previousOperator === 11) && (conditionOperator !== 10 && conditionOperator !== 11)) {\n this._conditionExpression.value = \"\";\n }\n //@ts-ignore - going from other operators to between/not between\n if((conditionOperator === 10 || conditionOperator === 11) && (previousOperator !== 10 && previousOperator !== 11)) {\n this._conditionExpression.value = []\n }\n },\n }\n }\n\n public get value() {\n return {\n get: () => this._get('value') as any,\n set: (value: any) => this._set(\"value\", undefined, value),\n isValid: async () => {\n if(this._conditionUtils.operator(this.operator.get()).doesNotAllowValue) {\n return true;\n }\n const operator = this.operator.get();\n if(operator === DatasetConditionOperator.Between || operator === DatasetConditionOperator.NotBetween) {\n // undefined causes dayjs to use today\n const date1 = dayjs(this.value.get()?.[0] ?? '---');\n const date2 = dayjs(this.value.get()?.[1] ?? '---');\n if(date1.isValid() && date2.isValid()) {\n return true;\n }\n return false;\n }\n const memoryProvider = new MemoryDataProvider([{\n id: 'id',\n [this._column.name]: await this.value.get() ?? undefined\n }], {PrimaryIdAttribute: \"id\"})\n memoryProvider.setColumns([{...this._column, metadata: {...this._column.metadata as any, RequiredLevel: 0}}, {\n name: 'id',\n displayName: '',\n dataType: DataType.SINGLE_LINE_TEXT,\n alias: 'id',\n order: 0,\n visualSizeFactor: 0\n }]);\n const record = memoryProvider.refreshSync()[0];\n record.expressions?.setRequiredLevelExpression(this._column.name, () => 'required');\n return !record.getColumnInfo(this._column.name).error\n }\n }\n }\n private _get(type: 'operator' | 'value'): DatasetConditionOperator | any {\n if (type === 'operator') {\n return this._conditionExpression.conditionOperator;\n }\n return this._conditionExpression.value;\n }\n private _set(type: 'operator' | 'value', conditionOperator?: DatasetConditionOperator, value?: any) {\n this._isValid = true;\n if (type === 'operator') {\n this._conditionExpression.conditionOperator = conditionOperator as any;\n }\n else {\n this._conditionExpression.value = value;\n }\n this._triggerRefreshCallbacks();\n }\n\n private async _attributeNameDecorator(conditionOperator: DatasetConditionOperator, attributeName: string, undecorate?: boolean) {\n if (!this._conditionUtils.value(conditionOperator).isManuallyEditable) {\n return attributeName;\n }\n switch (this._column.dataType) {\n case DataType.OPTIONSET:\n case DataType.TWO_OPTIONS:\n case DataType.LOOKUP_OWNER:\n case DataType.LOOKUP_SIMPLE:\n case DataType.LOOKUP_CUSTOMER: {\n if (undecorate) {\n if (attributeName.endsWith('name')) {\n return attributeName.slice(0, -4);\n }\n return attributeName;\n }\n if (attributeName.endsWith('name')) {\n return attributeName;\n }\n return `${attributeName}name`\n }\n default: {\n return attributeName;\n }\n }\n }\n private _valueDecorator(conditionOperator: DatasetConditionOperator, value: any, undecorate?: boolean) {\n switch (conditionOperator) {\n case DatasetConditionOperator.BeginWith:\n case DatasetConditionOperator.DoesNotBeginWith: {\n if (undecorate) {\n return value.slice(0, -1);\n }\n return `${value}%`;\n }\n case DatasetConditionOperator.EndsWith:\n case DatasetConditionOperator.DoesNotEndWith: {\n if (undecorate) {\n return value.slice(1)\n }\n return `%${value}`;\n }\n case DatasetConditionOperator.Like:\n case DatasetConditionOperator.NotLike: {\n if (undecorate) {\n return value.slice(1, -1)\n }\n return `%${value}%`;\n }\n default: {\n return value;\n }\n }\n }\n\n private _operatorDecorator(conditionOperator: DatasetConditionOperator, value: any, undecorate?: boolean): DatasetConditionOperator {\n switch (this._column.dataType) {\n case DataType.MULTI_SELECT_OPTIONSET:\n case DataType.OPTIONSET:\n case DataType.TWO_OPTIONS:\n case DataType.LOOKUP_OWNER:\n case DataType.LOOKUP_SIMPLE:\n case DataType.LOOKUP_CUSTOMER: {\n //we need to switch the operators based on the number of selected options\n if (typeof value !== 'string') {\n if(undecorate) {\n switch(conditionOperator) {\n case DatasetConditionOperator.In: {\n return DatasetConditionOperator.Equal\n }\n case DatasetConditionOperator.NotIn: {\n return DatasetConditionOperator.NotEqual;\n }\n }\n }\n switch (conditionOperator) {\n case DatasetConditionOperator.Equal: {\n return DatasetConditionOperator.In;\n }\n case DatasetConditionOperator.NotEqual: {\n return DatasetConditionOperator.NotIn;\n }\n }\n }\n else {\n switch (conditionOperator) {\n case DatasetConditionOperator.In: {\n return DatasetConditionOperator.Equal;\n }\n case DatasetConditionOperator.NotIn: {\n return DatasetConditionOperator.NotEqual;\n }\n }\n }\n }\n }\n return conditionOperator;\n }\n\n private _getDefault(): ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression {\n const entityAliasName = Attribute.GetLinkedEntityAlias(this._column.name);\n const attributeName = Attribute.GetNameFromAlias(this._column.name);\n const cond: ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression = {\n attributeName: attributeName,\n conditionOperator: DatasetConditionOperator.Equal,\n entityAliasName: entityAliasName ?? \"\",\n value: \"\"\n }\n switch (this._column.dataType) {\n case DataType.DATE_AND_TIME_DATE_AND_TIME:\n case DataType.DATE_AND_TIME_DATE_ONLY: {\n cond.conditionOperator = DatasetConditionOperator.On;\n break;\n }\n case DataType.IMAGE:\n case DataType.FILE: {\n cond.conditionOperator = DatasetConditionOperator.NotNull as any;\n break;\n }\n }\n return cond;\n }\n private get _filterExpression() {\n return structuredClone(this._dataset.filtering.getFilter()) ?? {\n conditions: [],\n filterOperator: 0\n }\n }\n private async _getConditionFromFilterExpression(): Promise<[Map<string, ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression>, string]> {\n const map = new Map<string, ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression>(this._filterExpression.conditions.map(x => [x.attributeName, x]));\n const attributeName = Attribute.GetNameFromAlias(this._column.name);\n for (const cond of map.values()) {\n const conditionAttributeName = await this._attributeNameDecorator(cond.conditionOperator, cond.attributeName, true);\n if(conditionAttributeName === attributeName) {\n return [map, cond.attributeName]\n }\n }\n return [map, \"\"];\n }\n}"],"names":[],"mappings":";;;;;;;AASM,MAAO,SAAU,SAAQ,cAAc,CAAA;IAUzC,WAAY,CAAA,IAAU,EAAE,MAAmB,EAAA;QACvC,KAAK,CAAC,IAAI,CAAC,CAAC;QATR,IAAoB,CAAA,oBAAA,GAAqE,EAAS,CAAC;AAEnG,QAAA,IAAA,CAAA,eAAe,GAAG,cAAc,CAAC,SAAS,EAAE,CAAC;QAC7C,IAAQ,CAAA,QAAA,GAAY,IAAI,CAAC;QAEzB,IAAY,CAAA,YAAA,GAAY,KAAK,CAAC;QAC9B,IAAgB,CAAA,gBAAA,GAAY,KAAK,CAAC;AAItC,QAAA,IAAI,CAAC,OAAO,GAAG,EAAC,GAAG,MAAM,EAAC,CAAC;AAC3B,QAAA,QAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;;YAExB,KAAK,QAAQ,CAAC,iBAAiB,CAAC;AAChC,YAAA,KAAK,QAAQ,CAAC,eAAe,EAAE;gBAC3B,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC;AACrD,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;AACnB,YAAA,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,KAAI;gBAClB,IAAG,IAAI,KAAK,MAAM,EAAE;AAChB,oBAAA,IAAG,CAAC,MAAM,CAAC,YAAY,EAAE;AACrB,wBAAA,MAAM,IAAI,KAAK,CAAC,wHAAwH,CAAC,CAAA;AAC5I,qBAAA;AACJ,iBAAA;;AAED,gBAAA,IAA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a,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAChK,QAAA,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpE,QAAA,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE;AAC7B,YAAA,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;YACpH,IAAG,sBAAsB,KAAK,aAAa,EAAE;AACzC,gBAAA,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;AACnC,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;KACpB;AACJ;;;;"}
@@ -0,0 +1,11 @@
1
+ import { IGridColumn } from "../../core/interfaces/IGridColumn";
2
+ import { GridDependency } from "../../core/model/GridDependency";
3
+ import { Condition } from "./Condition";
4
+ export declare class Filtering extends GridDependency {
5
+ private _conditions;
6
+ save(): Promise<boolean>;
7
+ clear(): void;
8
+ condition(column: IGridColumn): Promise<Condition>;
9
+ private get _filterExpression();
10
+ private _getColumnKeyFromCondition;
11
+ }
@@ -0,0 +1,78 @@
1
+ import { GridDependency } from '../../core/model/GridDependency.js';
2
+ import { Condition } from './Condition.js';
3
+
4
+ class Filtering extends GridDependency {
5
+ constructor() {
6
+ super(...arguments);
7
+ this._conditions = new Map();
8
+ }
9
+ async save() {
10
+ const filterExpression = this._filterExpression;
11
+ for (const condition of this._conditions.values()) {
12
+ if (!condition.value.isValid()) {
13
+ return false;
14
+ }
15
+ const expression = await condition.getExpression();
16
+ if (condition.isAppliedToDataset || condition.isRemoved) {
17
+ filterExpression.conditions = this._filterExpression.conditions.filter(cond => this._getColumnKeyFromCondition(cond) !== condition.column.name);
18
+ }
19
+ if (!condition.isRemoved) {
20
+ filterExpression.conditions.push(expression);
21
+ }
22
+ }
23
+ this.clear();
24
+ this._dataset.filtering.setFilter(filterExpression);
25
+ this._dataset.refresh();
26
+ return true;
27
+ }
28
+ clear() {
29
+ this._conditions.clear();
30
+ }
31
+ async condition(column) {
32
+ const columnKey = column.name;
33
+ if (!this._conditions.get(columnKey)) {
34
+ this._conditions.set(columnKey, new Condition(this._grid, column));
35
+ }
36
+ const cond = new Proxy(this._conditions.get(columnKey), {
37
+ get: (target, prop) => {
38
+ if (prop === 'save') {
39
+ return async () => {
40
+ const saveResult = await target.save();
41
+ if (saveResult) {
42
+ this._conditions.delete(target.column.name);
43
+ this._dataset.refresh();
44
+ }
45
+ return saveResult;
46
+ };
47
+ }
48
+ if (prop === 'clear') {
49
+ this._conditions.delete(target.column.name);
50
+ }
51
+ //@ts-ignore
52
+ if (typeof target[prop] === 'function') {
53
+ //@ts-ignore
54
+ return target[prop].bind(target);
55
+ }
56
+ //@ts-ignore
57
+ return target[prop];
58
+ },
59
+ });
60
+ await cond.init();
61
+ return cond;
62
+ }
63
+ get _filterExpression() {
64
+ return structuredClone(this._grid.dataset.filtering.getFilter()) ?? {
65
+ conditions: [],
66
+ filterOperator: 0
67
+ };
68
+ }
69
+ _getColumnKeyFromCondition(condition) {
70
+ if (condition.entityAliasName) {
71
+ return `${condition.entityAliasName}.${condition.attributeName}`;
72
+ }
73
+ return condition.attributeName;
74
+ }
75
+ }
76
+
77
+ export { Filtering };
78
+ //# sourceMappingURL=Filtering.js.map