@talxis/base-controls 1.2502.1 → 1.2503.2

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 (283) hide show
  1. package/dist/components/DatasetControl/DatasetControl.js +21 -34
  2. package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
  3. package/dist/components/DatasetControl/ErrorBoundary.js +33 -0
  4. package/dist/components/DatasetControl/ErrorBoundary.js.map +1 -0
  5. package/dist/components/DatasetControl/QuickFind/QuickFind.d.ts +10 -0
  6. package/dist/components/DatasetControl/QuickFind/QuickFind.js +38 -0
  7. package/dist/components/DatasetControl/QuickFind/QuickFind.js.map +1 -0
  8. package/dist/components/DatasetControl/styles.d.ts +3 -1
  9. package/dist/components/DatasetControl/styles.js +2 -2
  10. package/dist/components/DatasetControl/styles.js.map +1 -1
  11. package/dist/components/DatasetControl/translations.d.ts +8 -0
  12. package/dist/components/DatasetControl/translations.js +3 -1
  13. package/dist/components/DatasetControl/translations.js.map +1 -1
  14. package/dist/components/DateTime/DateTime.js +2 -1
  15. package/dist/components/DateTime/DateTime.js.map +1 -1
  16. package/dist/components/DateTime/components/Calendar.d.ts +2 -1
  17. package/dist/components/DateTime/components/Calendar.js +4 -4
  18. package/dist/components/DateTime/components/Calendar.js.map +1 -1
  19. package/dist/components/DateTime/hooks/useDateTime.js +18 -17
  20. package/dist/components/DateTime/hooks/useDateTime.js.map +1 -1
  21. package/dist/components/Decimal/Decimal.js +5 -1
  22. package/dist/components/Decimal/Decimal.js.map +1 -1
  23. package/dist/components/Duration/Duration.js +49 -26
  24. package/dist/components/Duration/Duration.js.map +1 -1
  25. package/dist/components/Grid/Grid.js +1 -1
  26. package/dist/components/Grid/Grid.js.map +1 -1
  27. package/dist/components/Grid/core/components/AgGrid/AgGrid.js +78 -174
  28. package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
  29. package/dist/components/Grid/core/components/AgGrid/context.d.ts +3 -0
  30. package/dist/components/Grid/core/components/AgGrid/context.js +6 -0
  31. package/dist/components/Grid/core/components/AgGrid/context.js.map +1 -0
  32. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +40 -5
  33. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +235 -49
  34. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -1
  35. package/dist/components/Grid/core/components/AgGrid/model/Comparator.d.ts +9 -0
  36. package/dist/components/Grid/core/components/AgGrid/model/Comparator.js +86 -0
  37. package/dist/components/Grid/core/components/AgGrid/model/Comparator.js.map +1 -0
  38. package/dist/components/Grid/core/components/AgGrid/styles.d.ts +28 -32
  39. package/dist/components/Grid/core/components/AgGrid/styles.js +31 -35
  40. package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -1
  41. package/dist/components/Grid/core/components/Cell/Cell.d.ts +13 -0
  42. package/dist/components/Grid/core/components/Cell/Cell.js +145 -0
  43. package/dist/components/Grid/core/components/Cell/Cell.js.map +1 -0
  44. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.d.ts +3 -0
  45. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js +212 -0
  46. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js.map +1 -0
  47. package/dist/components/Grid/core/components/Cell/CellContent/styles.d.ts +33 -0
  48. package/dist/components/Grid/core/components/Cell/CellContent/styles.js +39 -0
  49. package/dist/components/Grid/core/components/Cell/CellContent/styles.js.map +1 -0
  50. package/dist/components/Grid/core/components/Cell/Commands/Commands.js.map +1 -1
  51. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.d.ts +12 -0
  52. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js +112 -0
  53. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js.map +1 -0
  54. package/dist/components/Grid/core/components/Cell/Notifications/styles.d.ts +39 -0
  55. package/dist/components/Grid/core/components/Cell/Notifications/styles.js +46 -0
  56. package/dist/components/Grid/core/components/Cell/Notifications/styles.js.map +1 -0
  57. package/dist/components/Grid/core/components/Cell/styles.d.ts +40 -0
  58. package/dist/components/Grid/core/components/Cell/styles.js +59 -0
  59. package/dist/components/Grid/core/components/Cell/styles.js.map +1 -0
  60. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +3 -2
  61. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -1
  62. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js +31 -13
  63. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js.map +1 -1
  64. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.d.ts +3 -2
  65. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js +5 -4
  66. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js.map +1 -1
  67. package/dist/components/Grid/core/components/ColumnHeader/styles.d.ts +3 -1
  68. package/dist/components/Grid/core/components/ColumnHeader/styles.js +4 -2
  69. package/dist/components/Grid/core/components/ColumnHeader/styles.js.map +1 -1
  70. package/dist/components/Grid/core/components/Save/Save.js +5 -6
  71. package/dist/components/Grid/core/components/Save/Save.js.map +1 -1
  72. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js +10 -7
  73. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js.map +1 -1
  74. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.d.ts +1 -0
  75. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +26 -7
  76. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -1
  77. package/dist/components/Grid/core/controllers/useGridController.js +8 -2
  78. package/dist/components/Grid/core/controllers/useGridController.js.map +1 -1
  79. package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +2 -0
  80. package/dist/components/Grid/core/model/Grid.d.ts +16 -7
  81. package/dist/components/Grid/core/model/Grid.js +230 -45
  82. package/dist/components/Grid/core/model/Grid.js.map +1 -1
  83. package/dist/components/Grid/core/model/Metadata.d.ts +2 -1
  84. package/dist/components/Grid/core/services/KeyListener.d.ts +2 -0
  85. package/dist/components/Grid/core/services/KeyListener.js +6 -3
  86. package/dist/components/Grid/core/services/KeyListener.js.map +1 -1
  87. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js +3 -3
  88. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js.map +1 -1
  89. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +19 -7
  90. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.d.ts +2 -2
  91. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.js +9 -9
  92. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.js.map +1 -0
  93. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.d.ts +2 -2
  94. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.js +1 -1
  95. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.js.map +1 -0
  96. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.d.ts +2 -2
  97. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.js +15 -19
  98. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.js.map +1 -0
  99. package/dist/components/Grid/filtering/model/Condition.js +1 -1
  100. package/dist/components/Grid/filtering/model/Condition.js.map +1 -1
  101. package/dist/components/Grid/selection/model/Selection.d.ts +3 -4
  102. package/dist/components/Grid/selection/model/Selection.js +8 -26
  103. package/dist/components/Grid/selection/model/Selection.js.map +1 -1
  104. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +1 -1
  105. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -1
  106. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.d.ts +2 -0
  107. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js +11 -0
  108. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js.map +1 -0
  109. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.d.ts +1 -0
  110. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js +2 -0
  111. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js.map +1 -0
  112. package/dist/components/GridCellRenderer/GridCellRenderer.d.ts +3 -0
  113. package/dist/components/GridCellRenderer/GridCellRenderer.js +252 -0
  114. package/dist/components/GridCellRenderer/GridCellRenderer.js.map +1 -0
  115. package/dist/components/GridCellRenderer/OptionSet/OptionSet.d.ts +5 -0
  116. package/dist/components/GridCellRenderer/OptionSet/OptionSet.js +69 -0
  117. package/dist/components/GridCellRenderer/OptionSet/OptionSet.js.map +1 -0
  118. package/dist/components/GridCellRenderer/OptionSet/index.d.ts +1 -0
  119. package/dist/components/GridCellRenderer/OptionSet/index.js +2 -0
  120. package/dist/components/GridCellRenderer/OptionSet/index.js.map +1 -0
  121. package/dist/components/{Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet → GridCellRenderer/OptionSet}/styles.d.ts +10 -12
  122. package/dist/components/GridCellRenderer/OptionSet/styles.js +29 -0
  123. package/dist/components/GridCellRenderer/OptionSet/styles.js.map +1 -0
  124. package/dist/components/GridCellRenderer/index.d.ts +1 -0
  125. package/dist/components/GridCellRenderer/index.js +2 -0
  126. package/dist/components/GridCellRenderer/index.js.map +1 -0
  127. package/dist/components/GridCellRenderer/interfaces.d.ts +53 -0
  128. package/dist/components/GridCellRenderer/styles.d.ts +72 -0
  129. package/dist/components/GridCellRenderer/styles.js +105 -0
  130. package/dist/components/GridCellRenderer/styles.js.map +1 -0
  131. package/dist/components/GridCellRenderer/translations.d.ts +6 -0
  132. package/dist/components/GridCellRenderer/translations.js +11 -0
  133. package/dist/components/GridCellRenderer/translations.js.map +1 -0
  134. package/dist/components/GridCellRenderer/useComponentProps.d.ts +6 -0
  135. package/dist/components/GridCellRenderer/useComponentProps.js +10 -0
  136. package/dist/components/GridCellRenderer/useComponentProps.js.map +1 -0
  137. package/dist/components/Lookup/Lookup.js +8 -3
  138. package/dist/components/Lookup/Lookup.js.map +1 -1
  139. package/dist/components/Lookup/styles.d.ts +19 -7
  140. package/dist/components/Lookup/styles.js +22 -8
  141. package/dist/components/Lookup/styles.js.map +1 -1
  142. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js +51 -28
  143. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js.map +1 -1
  144. package/dist/components/NestedControlRenderer/NestedControl.d.ts +86 -0
  145. package/dist/components/NestedControlRenderer/NestedControl.js +456 -0
  146. package/dist/components/NestedControlRenderer/NestedControl.js.map +1 -0
  147. package/dist/components/NestedControlRenderer/NestedControlError.d.ts +4 -0
  148. package/dist/components/NestedControlRenderer/NestedControlError.js +13 -0
  149. package/dist/components/NestedControlRenderer/NestedControlError.js.map +1 -0
  150. package/dist/components/NestedControlRenderer/NestedControlRenderer.d.ts +3 -0
  151. package/dist/components/NestedControlRenderer/NestedControlRenderer.js +194 -0
  152. package/dist/components/NestedControlRenderer/NestedControlRenderer.js.map +1 -0
  153. package/dist/components/NestedControlRenderer/index.d.ts +1 -0
  154. package/dist/components/NestedControlRenderer/index.js +2 -0
  155. package/dist/components/NestedControlRenderer/index.js.map +1 -0
  156. package/dist/components/NestedControlRenderer/interfaces.d.ts +122 -0
  157. package/dist/components/NestedControlRenderer/manifest/Control.d.ts +16 -0
  158. package/dist/components/NestedControlRenderer/manifest/Control.js +40 -0
  159. package/dist/components/NestedControlRenderer/manifest/Control.js.map +1 -0
  160. package/dist/components/NestedControlRenderer/manifest/Manifest.d.ts +5 -0
  161. package/dist/components/NestedControlRenderer/manifest/Manifest.js +12 -0
  162. package/dist/components/NestedControlRenderer/manifest/Manifest.js.map +1 -0
  163. package/dist/components/NestedControlRenderer/manifest/TypeGroup.d.ts +6 -0
  164. package/dist/components/NestedControlRenderer/manifest/TypeGroup.js +13 -0
  165. package/dist/components/NestedControlRenderer/manifest/TypeGroup.js.map +1 -0
  166. package/dist/components/NestedControlRenderer/manifest/index.d.ts +1 -0
  167. package/dist/components/NestedControlRenderer/manifest/index.js +2 -0
  168. package/dist/components/NestedControlRenderer/manifest/index.js.map +1 -0
  169. package/dist/components/NestedControlRenderer/manifest/property/Property.d.ts +16 -0
  170. package/dist/components/NestedControlRenderer/manifest/property/Property.js +34 -0
  171. package/dist/components/NestedControlRenderer/manifest/property/Property.js.map +1 -0
  172. package/dist/components/NestedControlRenderer/manifest/property/Value.d.ts +8 -0
  173. package/dist/components/NestedControlRenderer/manifest/property/Value.js +12 -0
  174. package/dist/components/NestedControlRenderer/manifest/property/Value.js.map +1 -0
  175. package/dist/components/NestedControlRenderer/properties/DateProperty.d.ts +5 -0
  176. package/dist/components/NestedControlRenderer/properties/DateProperty.js +20 -0
  177. package/dist/components/NestedControlRenderer/properties/DateProperty.js.map +1 -0
  178. package/dist/components/NestedControlRenderer/properties/FileProperty.d.ts +5 -0
  179. package/dist/components/NestedControlRenderer/properties/FileProperty.js +14 -0
  180. package/dist/components/NestedControlRenderer/properties/FileProperty.js.map +1 -0
  181. package/dist/components/NestedControlRenderer/properties/LookupProperty.d.ts +6 -0
  182. package/dist/components/NestedControlRenderer/properties/LookupProperty.js +35 -0
  183. package/dist/components/NestedControlRenderer/properties/LookupProperty.js.map +1 -0
  184. package/dist/components/NestedControlRenderer/properties/NumberProperty.d.ts +5 -0
  185. package/dist/components/NestedControlRenderer/properties/NumberProperty.js +15 -0
  186. package/dist/components/NestedControlRenderer/properties/NumberProperty.js.map +1 -0
  187. package/dist/components/NestedControlRenderer/properties/OptionSetProperty.d.ts +5 -0
  188. package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js +22 -0
  189. package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js.map +1 -0
  190. package/dist/components/NestedControlRenderer/properties/Property.d.ts +17 -0
  191. package/dist/components/NestedControlRenderer/properties/Property.js +46 -0
  192. package/dist/components/NestedControlRenderer/properties/Property.js.map +1 -0
  193. package/dist/components/NestedControlRenderer/properties/TextProperty.d.ts +5 -0
  194. package/dist/components/NestedControlRenderer/properties/TextProperty.js +15 -0
  195. package/dist/components/NestedControlRenderer/properties/TextProperty.js.map +1 -0
  196. package/dist/components/NestedControlRenderer/styles.d.ts +14 -0
  197. package/dist/components/NestedControlRenderer/styles.js +21 -0
  198. package/dist/components/NestedControlRenderer/styles.js.map +1 -0
  199. package/dist/components/NestedControlRenderer/translations.d.ts +14 -0
  200. package/dist/components/NestedControlRenderer/translations.js +19 -0
  201. package/dist/components/NestedControlRenderer/translations.js.map +1 -0
  202. package/dist/components/OptionSet/OptionSet.js +3 -3
  203. package/dist/components/OptionSet/OptionSet.js.map +1 -1
  204. package/dist/components/OptionSet/useComboBoxTheme.js +17 -17
  205. package/dist/components/OptionSet/useComboBoxTheme.js.map +1 -1
  206. package/dist/components/TextField/TextField.js.map +1 -1
  207. package/dist/components/TextField/interfaces.d.ts +2 -2
  208. package/dist/components/TwoOptions/TwoOptions.js +2 -1
  209. package/dist/components/TwoOptions/TwoOptions.js.map +1 -1
  210. package/dist/components/index.d.ts +13 -0
  211. package/dist/components/index.js +15 -0
  212. package/dist/components/index.js.map +1 -0
  213. package/dist/hooks/index.d.ts +1 -0
  214. package/dist/hooks/index.js +1 -0
  215. package/dist/hooks/index.js.map +1 -1
  216. package/dist/hooks/useControl.d.ts +1 -7
  217. package/dist/hooks/useControl.js +12 -40
  218. package/dist/hooks/useControl.js.map +1 -1
  219. package/dist/hooks/useControlLabels.d.ts +14 -0
  220. package/dist/hooks/useControlLabels.js +47 -0
  221. package/dist/hooks/useControlLabels.js.map +1 -0
  222. package/dist/hooks/useInputBasedControl.d.ts +2 -1
  223. package/dist/hooks/useInputBasedControl.js +3 -5
  224. package/dist/hooks/useInputBasedControl.js.map +1 -1
  225. package/dist/hooks/usePrevious.d.ts +1 -0
  226. package/dist/index.d.ts +456 -140
  227. package/dist/index.js +7 -2
  228. package/dist/index.js.map +1 -1
  229. package/dist/interfaces/context.d.ts +2 -1
  230. package/dist/interfaces/index.d.ts +1 -1
  231. package/dist/interfaces/property.d.ts +5 -0
  232. package/dist/utils/BaseControls.d.ts +16 -0
  233. package/dist/utils/BaseControls.js +82 -0
  234. package/dist/utils/BaseControls.js.map +1 -0
  235. package/dist/utils/index.d.ts +1 -0
  236. package/dist/utils/index.js +2 -0
  237. package/dist/utils/index.js.map +1 -1
  238. package/dist/utils/theme/ControlTheme.d.ts +1 -1
  239. package/dist/utils/theme/ControlTheme.js +1 -1
  240. package/dist/utils/theme/ControlTheme.js.map +1 -1
  241. package/dist/utils/theme/components/ThemeWrapper.d.ts +9 -0
  242. package/dist/utils/theme/components/ThemeWrapper.js +11 -0
  243. package/dist/utils/theme/components/ThemeWrapper.js.map +1 -0
  244. package/dist/utils/theme/components/index.d.ts +1 -0
  245. package/dist/utils/theme/components/index.js +2 -0
  246. package/dist/utils/theme/components/index.js.map +1 -0
  247. package/dist/utils/theme/hooks/useControlTheme.d.ts +1 -1
  248. package/dist/utils/theme/hooks/useControlTheme.js.map +1 -1
  249. package/dist/utils/theme/index.d.ts +1 -0
  250. package/dist/utils/theme/index.js +1 -0
  251. package/dist/utils/theme/index.js.map +1 -1
  252. package/package.json +3 -3
  253. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.d.ts +0 -10
  254. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js +0 -82
  255. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js.map +0 -1
  256. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts +0 -11
  257. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js +0 -93
  258. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map +0 -1
  259. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.d.ts +0 -36
  260. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js +0 -42
  261. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js.map +0 -1
  262. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +0 -11
  263. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js +0 -221
  264. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js.map +0 -1
  265. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +0 -10
  266. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js +0 -49
  267. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js.map +0 -1
  268. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js +0 -27
  269. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js.map +0 -1
  270. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +0 -99
  271. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js +0 -123
  272. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js.map +0 -1
  273. package/dist/components/Grid/core/components/Component/Component.js.map +0 -1
  274. package/dist/components/Grid/core/components/Component/controller/useComponentController.js.map +0 -1
  275. package/dist/components/Grid/core/components/Component/model/Component.js.map +0 -1
  276. package/dist/components/Grid/core/model/Metadata.js +0 -26
  277. package/dist/components/Grid/core/model/Metadata.js.map +0 -1
  278. package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +0 -11
  279. package/dist/components/Grid/selection/controllers/useSelectionController.js +0 -21
  280. package/dist/components/Grid/selection/controllers/useSelectionController.js.map +0 -1
  281. package/dist/hooks/useRerender.d.ts +0 -1
  282. package/dist/hooks/useRerender.js +0 -9
  283. package/dist/hooks/useRerender.js.map +0 -1
@@ -1 +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\";\n\nexport class Condition extends GridDependency {\n private _column: IGridColumn;\n private _isAppliedToDataset: boolean = false;\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\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._isAppliedToDataset = true;\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._isAppliedToDataset;\n }\n\n public get isValid() {\n return this._isValid;\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 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 },\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 memoryProvider = new MemoryDataProvider([{\n id: 'id',\n [this._column.name]: await this.value.get() ?? undefined\n }])\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 memoryProvider.setMetadata({\n PrimaryIdAttribute: 'id'\n })\n const record = memoryProvider.refresh()[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":";;;;;;AAQM,MAAO,SAAU,SAAQ,cAAc,CAAA;IAUzC,WAAY,CAAA,IAAU,EAAE,MAAmB,EAAA;QACvC,KAAK,CAAC,IAAI,CAAC,CAAC;QATR,IAAmB,CAAA,mBAAA,GAAY,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J,SAAA;AACD,QAAA,OAAO,IAAI,CAAC;KACf;AACD,IAAA,IAAY,iBAAiB,GAAA;QACzB,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI;AAC3D,YAAA,UAAU,EAAE,EAAE;AACd,YAAA,cAAc,EAAE,CAAC;SACpB,CAAA;KACJ;AACO,IAAA,MAAO,iCAAiC,GAAA;QAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,CAA2E,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,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;;;;"}
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\";\n\nexport class Condition extends GridDependency {\n private _column: IGridColumn;\n private _isAppliedToDataset: boolean = false;\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\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._isAppliedToDataset = true;\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._isAppliedToDataset;\n }\n\n public get isValid() {\n return this._isValid;\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 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 },\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 memoryProvider = new MemoryDataProvider([{\n id: 'id',\n [this._column.name]: await this.value.get() ?? undefined\n }])\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 memoryProvider.setMetadata({\n PrimaryIdAttribute: 'id'\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":";;;;;;AAQM,MAAO,SAAU,SAAQ,cAAc,CAAA;IAUzC,WAAY,CAAA,IAAU,EAAE,MAAmB,EAAA;QACvC,KAAK,CAAC,IAAI,CAAC,CAAC;QATR,IAAmB,CAAA,mBAAA,GAAY,KAAK,CAAC;QACrC,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;AAIlC,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,KA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pE,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;;;;"}
@@ -1,12 +1,11 @@
1
- import { IRecord } from "@talxis/client-libraries";
2
1
  import { GridDependency } from "../../core/model/GridDependency";
3
2
  export declare class Selection extends GridDependency {
4
3
  private _selectedRecordIdsSet;
5
- private debounceTimer;
6
- toggle(record: IRecord, newState: boolean, clearExistingSelection?: boolean, disableDebounce?: boolean): Promise<void>;
4
+ toggle(recordId: string, clearExistingSelection?: boolean): void;
5
+ setSelectedRecordIds(ids: string[]): void;
7
6
  get selectedRecordIds(): string[];
8
7
  get allRecordsSelected(): boolean;
9
- get type(): "multiple" | "single" | undefined;
8
+ get type(): "single" | "multiple" | undefined;
10
9
  clear(): void;
11
10
  selectAll(): void;
12
11
  private _setSelectedRecords;
@@ -4,38 +4,22 @@ class Selection extends GridDependency {
4
4
  constructor() {
5
5
  super(...arguments);
6
6
  this._selectedRecordIdsSet = new Set();
7
- this.debounceTimer = null;
8
7
  }
9
- async toggle(record, newState, clearExistingSelection, disableDebounce) {
10
- const recordId = record.getRecordId();
11
- if (!this.debounceTimer) {
12
- this._selectedRecordIdsSet = new Set(this.selectedRecordIds);
13
- }
14
- if (clearExistingSelection) {
8
+ toggle(recordId, clearExistingSelection) {
9
+ this._selectedRecordIdsSet = new Set(this.selectedRecordIds);
10
+ if (clearExistingSelection || this.type === 'single') {
15
11
  this._selectedRecordIdsSet.clear();
16
12
  }
17
- if (newState === false) {
13
+ if (this._selectedRecordIdsSet.has(recordId)) {
18
14
  this._selectedRecordIdsSet.delete(recordId);
19
15
  }
20
16
  else {
21
- if (this.type === 'single') {
22
- this._selectedRecordIdsSet.clear();
23
- }
24
17
  this._selectedRecordIdsSet.add(recordId);
25
18
  }
26
- if (this.debounceTimer !== null) {
27
- clearTimeout(this.debounceTimer);
28
- }
29
- if (disableDebounce) {
30
- this._setSelectedRecords();
31
- return;
32
- }
33
- return new Promise((resolve) => {
34
- this.debounceTimer = setTimeout(() => {
35
- this._setSelectedRecords();
36
- resolve();
37
- }, 0);
38
- });
19
+ this._setSelectedRecords();
20
+ }
21
+ setSelectedRecordIds(ids) {
22
+ this._dataset.setSelectedRecordIds(ids);
39
23
  }
40
24
  get selectedRecordIds() {
41
25
  return this._dataset.getSelectedRecordIds();
@@ -63,8 +47,6 @@ class Selection extends GridDependency {
63
47
  }
64
48
  _setSelectedRecords() {
65
49
  this._grid.dataset.setSelectedRecordIds([...this._selectedRecordIdsSet.values()]);
66
- this.debounceTimer = null; // Reset debounce timer after execution
67
- this._selectedRecordIdsSet = new Set();
68
50
  }
69
51
  }
70
52
 
@@ -1 +1 @@
1
- {"version":3,"file":"Selection.js","sources":["../../../../../src/components/Grid/selection/model/Selection.ts"],"sourcesContent":["import { IRecord } from \"@talxis/client-libraries\";\nimport { GridDependency } from \"../../core/model/GridDependency\";\n\nexport class Selection extends GridDependency {\n private _selectedRecordIdsSet: Set<string> = new Set<string>();\n private debounceTimer: ReturnType<typeof setTimeout> | null = null;\n\n public async toggle(record: IRecord, newState: boolean, clearExistingSelection?: boolean, disableDebounce?: boolean): Promise<void> {\n const recordId = record.getRecordId();\n if(!this.debounceTimer) {\n this._selectedRecordIdsSet = new Set(this.selectedRecordIds);\n }\n if (clearExistingSelection) {\n this._selectedRecordIdsSet.clear();\n }\n if (newState === false) {\n this._selectedRecordIdsSet.delete(recordId);\n }\n else {\n if (this.type === 'single') {\n this._selectedRecordIdsSet.clear();\n }\n this._selectedRecordIdsSet.add(recordId);\n }\n\n if (this.debounceTimer !== null) {\n clearTimeout(this.debounceTimer);\n }\n if(disableDebounce) {\n this._setSelectedRecords();\n return;\n }\n return new Promise((resolve) => {\n this.debounceTimer = setTimeout(() => {\n this._setSelectedRecords();\n resolve();\n }, 0);\n })\n }\n public get selectedRecordIds() {\n return this._dataset.getSelectedRecordIds();\n }\n public get allRecordsSelected() {\n return this.selectedRecordIds.length === this._dataset.sortedRecordIds.length;\n }\n public get type() {\n switch(this._grid.props.parameters.SelectableRows?.raw) {\n case undefined:\n case null: {\n return 'multiple'\n }\n case 'none': {\n return undefined;\n }\n default: return this._grid.props.parameters.SelectableRows?.raw;\n }\n }\n\n public clear() {\n this._grid.dataset.setSelectedRecordIds([]);\n }\n public selectAll() {\n this._grid.dataset.setSelectedRecordIds(this._dataset.sortedRecordIds)\n }\n private _setSelectedRecords() {\n this._grid.dataset.setSelectedRecordIds([...this._selectedRecordIdsSet.values()]);\n this.debounceTimer = null; // Reset debounce timer after execution\n this._selectedRecordIdsSet = new Set();\n }\n}"],"names":[],"mappings":";;AAGM,MAAO,SAAU,SAAQ,cAAc,CAAA;AAA7C,IAAA,WAAA,GAAA;;AACY,QAAA,IAAA,CAAA,qBAAqB,GAAgB,IAAI,GAAG,EAAU,CAAC;QACvD,IAAa,CAAA,aAAA,GAAyC,IAAI,CAAC;KAgEtE;IA9DU,MAAM,MAAM,CAAC,MAAe,EAAE,QAAiB,EAAE,sBAAgC,EAAE,eAAyB,EAAA;AAC/G,QAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;AACtC,QAAA,IAAG,CAAC,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAChE,SAAA;AACD,QAAA,IAAI,sBAAsB,EAAE;AACxB,YAAA,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC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AACpB,aAAA;YACD,KAAK,MAAM,EAAE;AACT,gBAAA,OAAO,SAAS,CAAC;AACpB,aAAA;AACD,YAAA,SAAS,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,CAAC;AACnE,SAAA;KACJ;IAEM,KAAK,GAAA;QACR,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;KAC/C;IACM,SAAS,GAAA;AACZ,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;KACzE;IACO,mBAAmB,GAAA;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAClF,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;AAC1B,QAAA,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,EAAE,CAAC;KAC1C;AACJ;;;;"}
1
+ {"version":3,"file":"Selection.js","sources":["../../../../../src/components/Grid/selection/model/Selection.ts"],"sourcesContent":["import { GridDependency } from \"../../core/model/GridDependency\";\n\nexport class Selection extends GridDependency {\n private _selectedRecordIdsSet: Set<string> = new Set<string>();\n\n public toggle(recordId: string, clearExistingSelection?: boolean) {\n this._selectedRecordIdsSet = new Set(this.selectedRecordIds);\n if(clearExistingSelection || this.type === 'single') {\n this._selectedRecordIdsSet.clear()\n }\n if(this._selectedRecordIdsSet.has(recordId)) {\n this._selectedRecordIdsSet.delete(recordId);\n }\n else {\n this._selectedRecordIdsSet.add(recordId);\n }\n this._setSelectedRecords();\n }\n\n public setSelectedRecordIds(ids: string[]) {\n this._dataset.setSelectedRecordIds(ids);\n }\n\n public get selectedRecordIds() {\n return this._dataset.getSelectedRecordIds();\n }\n public get allRecordsSelected() {\n return this.selectedRecordIds.length === this._dataset.sortedRecordIds.length;\n }\n public get type() {\n switch(this._grid.props.parameters.SelectableRows?.raw) {\n case undefined:\n case null: {\n return 'multiple'\n }\n case 'none': {\n return undefined;\n }\n default: return this._grid.props.parameters.SelectableRows?.raw;\n }\n }\n\n public clear() {\n this._grid.dataset.setSelectedRecordIds([]);\n }\n public selectAll() {\n this._grid.dataset.setSelectedRecordIds(this._dataset.sortedRecordIds)\n }\n private _setSelectedRecords() {\n this._grid.dataset.setSelectedRecordIds([...this._selectedRecordIdsSet.values()]);\n }\n}"],"names":[],"mappings":";;AAEM,MAAO,SAAU,SAAQ,cAAc,CAAA;AAA7C,IAAA,WAAA,GAAA;;AACY,QAAA,IAAA,CAAA,qBAAqB,GAAgB,IAAI,GAAG,EAAU,CAAC;KAgDlE;IA9CU,MAAM,CAAC,QAAgB,EAAE,sBAAgC,EAAA;QAC5D,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC7D,QAAA,IAAG,sBAAsB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;AACjD,YAAA,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAA;AACrC,SAAA;QACD,IAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AACzC,YAAA,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC/C,SAAA;AACI,aAAA;AACD,YAAA,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC5C,SAAA;QACD,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC9B;AAEM,IAAA,oBAAoB,CAAC,GAAa,EAAA;AACrC,QAAA,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;KAC3C;AAED,IAAA,IAAW,iBAAiB,GAAA;AACxB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;KAC/C;AACD,IAAA,IAAW,kBAAkB,GAAA;AACzB,QAAA,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,KAAK,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC;KACjF;AACD,IAAA,IAAW,IAAI,GAAA;QACX,QAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG;AAClD,YAAA,KAAK,SAAS,CAAC;YACf,KAAK,IAAI,EAAE;AACP,gBAAA,OAAO,UAAU,CAAA;AACpB,aAAA;YACD,KAAK,MAAM,EAAE;AACT,gBAAA,OAAO,SAAS,CAAC;AACpB,aAAA;AACD,YAAA,SAAS,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,CAAC;AACnE,SAAA;KACJ;IAEM,KAAK,GAAA;QACR,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;KAC/C;IACM,SAAS,GAAA;AACZ,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;KACzE;IACO,mBAAmB,GAAA;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;KACrF;AACJ;;;;"}
@@ -21,7 +21,7 @@ const SortingContextualMenu = (props) => {
21
21
  })();
22
22
  }, [condition]);
23
23
  const getTwoOptionsSortLabel = async (isDesc) => {
24
- const [defaultValue, options] = await grid.metadata.getOptions(column.name);
24
+ const options = column.metadata?.OptionSet ?? [];
25
25
  if (!isDesc) {
26
26
  return `${options[0].Label} ${labels['filtersortmenu-sorttwooption-joint']()} ${options[1].Label}`;
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SortingContextualMenu.js","sources":["../../../../../../src/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { ContextualMenu, ContextualMenuItemType, IContextualMenuItem, IContextualMenuProps, useTheme } from '@fluentui/react';\nimport { IGridColumn } from '../../../core/interfaces/IGridColumn';\nimport { DataType } from '../../../core/enums/DataType';\nimport { getColumnHeaderContextualMenuStyles } from './styles';\nimport { useGridInstance } from '../../../core/hooks/useGridInstance';\nimport { useColumnSortingController } from '../../controllers/useColumnSortingController';\nimport { useColumnFilterConditionController } from '../../../filtering/controller/useColumnFilterConditionController';\n\nexport interface ISortingContextualMenu extends Omit<IContextualMenuProps, 'items'> {\n column: IGridColumn;\n onDismiss: (e?: Event | React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>, dismissAll?: boolean, showFilterCallout?: boolean) => void;\n}\n\nexport const SortingContextualMenu = (props: ISortingContextualMenu) => {\n const grid = useGridInstance();\n const labels = grid.labels;\n const styles = getColumnHeaderContextualMenuStyles(useTheme());\n const {column, onDismiss} = {...props};\n const sorting = useColumnSortingController(column);\n const condition = useColumnFilterConditionController(column);\n const [items, setItems] = useState<IContextualMenuItem[]>([]);\n\n useEffect(() => {\n (async() => {\n setItems(await getItems())\n })();\n }, [condition]);\n\n const getTwoOptionsSortLabel = async (isDesc?: boolean) => {\n const [defaultValue, options] = await grid.metadata.getOptions(column.name);\n if(!isDesc) {\n return `${options[0].Label} ${labels['filtersortmenu-sorttwooption-joint']()} ${options[1].Label}`\n }\n return `${options[1].Label} ${labels['filtersortmenu-sorttwooption-joint']()} ${options[0].Label}`\n }\n const getLabel = async (isDesc?: boolean) => {\n switch (column.dataType) {\n case DataType.WHOLE_NONE:\n case DataType.DECIMAL:\n case DataType.FP:\n case DataType.CURRENCY: {\n if (!isDesc) {\n return labels['filtersortmenu-sortnumber-a-z']()\n }\n return labels['filtersortmenu-sortnumber-z-a']()\n }\n case DataType.DATE_AND_TIME_DATE_AND_TIME:\n case DataType.DATE_AND_TIME_DATE_ONLY: {\n if (!isDesc) {\n return labels['filtersortmenu-sortdate-a-z']()\n }\n return labels['filtersortmenu-sortdate-z-a']()\n }\n case DataType.TWO_OPTIONS: {\n return getTwoOptionsSortLabel(isDesc);\n }\n default: {\n if (!isDesc) {\n return labels['filtersortmenu-sorttext-a-z']()\n }\n return labels['filtersortmenu-sorttext-z-a']()\n }\n }\n }\n\n const getItems = async (): Promise<IContextualMenuItem[]> => {\n if(!condition) {\n return []\n }\n const items: IContextualMenuItem[] = [\n {\n key: 'sort_asc',\n checked: column.isSorted && !column.isSortedDescending,\n disabled: column.disableSorting || column.dataType === DataType.MULTI_SELECT_OPTIONSET,\n text: await getLabel(),\n className: styles.item,\n iconProps: {\n iconName: 'SortUp'\n },\n onClick: () => sorting.sort(0)\n },\n {\n key: 'sort_desc',\n checked: column.isSorted && column.isSortedDescending,\n disabled: column.disableSorting || column.dataType === DataType.MULTI_SELECT_OPTIONSET,\n text: await getLabel(true),\n className: styles.item,\n iconProps: {\n iconName: 'SortDown'\n },\n onClick: () => sorting.sort(1)\n },\n {\n key: 'divider',\n itemType: ContextualMenuItemType.Divider\n },\n {\n key: 'filter',\n className: styles.item,\n disabled: !column.isFilterable,\n text: labels['filtermenu-filterby'](),\n iconProps: {\n iconName: 'Filter'\n },\n onClick: (e) => onDismiss(e, false, true)\n }\n ];\n if (condition.isAppliedToDataset) {\n items.push({\n key: 'clearFilter',\n text: labels['filtersortmenu-clearfilter'](),\n iconProps: {\n iconName: 'ClearFilter'\n },\n onClick: () => {\n condition.remove();\n condition.save();\n }\n });\n }\n return items\n }\n return <ContextualMenu {...props} items={items} />;\n};"],"names":["_jsx"],"mappings":";;;;;;;;;AAca,MAAA,qBAAqB,GAAG,CAAC,KAA6B,KAAI;AACnE,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;AAC/B,IAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,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C5C,gBAAA,SAAS,EAAE;AACP,oBAAA,QAAQ,EAAE,aAAa;AAC1B,iBAAA;gBACD,OAAO,EAAE,MAAK;oBACV,SAAS,CAAC,MAAM,EAAE,CAAC;oBACnB,SAAS,CAAC,IAAI,EAAE,CAAC;iBACpB;AACJ,aAAA,CAAC,CAAC;AACN,SAAA;AACD,QAAA,OAAO,KAAK,CAAA;AAChB,KAAC,CAAA;IACD,OAAOA,GAAA,CAAC,cAAc,EAAK,EAAA,GAAA,KAAK,EAAE,KAAK,EAAE,KAAK,EAAA,CAAI,CAAC;AACvD;;;;"}
1
+ {"version":3,"file":"SortingContextualMenu.js","sources":["../../../../../../src/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { ContextualMenu, ContextualMenuItemType, IContextualMenuItem, IContextualMenuProps, useTheme } from '@fluentui/react';\nimport { IGridColumn } from '../../../core/interfaces/IGridColumn';\nimport { DataType } from '../../../core/enums/DataType';\nimport { getColumnHeaderContextualMenuStyles } from './styles';\nimport { useGridInstance } from '../../../core/hooks/useGridInstance';\nimport { useColumnSortingController } from '../../controllers/useColumnSortingController';\nimport { useColumnFilterConditionController } from '../../../filtering/controller/useColumnFilterConditionController';\n\nexport interface ISortingContextualMenu extends Omit<IContextualMenuProps, 'items'> {\n column: IGridColumn;\n onDismiss: (e?: Event | React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>, dismissAll?: boolean, showFilterCallout?: boolean) => void;\n}\n\nexport const SortingContextualMenu = (props: ISortingContextualMenu) => {\n const grid = useGridInstance();\n const labels = grid.labels;\n const styles = getColumnHeaderContextualMenuStyles(useTheme());\n const {column, onDismiss} = {...props};\n const sorting = useColumnSortingController(column);\n const condition = useColumnFilterConditionController(column);\n const [items, setItems] = useState<IContextualMenuItem[]>([]);\n\n useEffect(() => {\n (async() => {\n setItems(await getItems())\n })();\n }, [condition]);\n\n const getTwoOptionsSortLabel = async (isDesc?: boolean) => {\n const options = column.metadata?.OptionSet ?? [];\n if(!isDesc) {\n return `${options[0].Label} ${labels['filtersortmenu-sorttwooption-joint']()} ${options[1].Label}`\n }\n return `${options[1].Label} ${labels['filtersortmenu-sorttwooption-joint']()} ${options[0].Label}`\n }\n const getLabel = async (isDesc?: boolean) => {\n switch (column.dataType) {\n case DataType.WHOLE_NONE:\n case DataType.DECIMAL:\n case DataType.FP:\n case DataType.CURRENCY: {\n if (!isDesc) {\n return labels['filtersortmenu-sortnumber-a-z']()\n }\n return labels['filtersortmenu-sortnumber-z-a']()\n }\n case DataType.DATE_AND_TIME_DATE_AND_TIME:\n case DataType.DATE_AND_TIME_DATE_ONLY: {\n if (!isDesc) {\n return labels['filtersortmenu-sortdate-a-z']()\n }\n return labels['filtersortmenu-sortdate-z-a']()\n }\n case DataType.TWO_OPTIONS: {\n return getTwoOptionsSortLabel(isDesc);\n }\n default: {\n if (!isDesc) {\n return labels['filtersortmenu-sorttext-a-z']()\n }\n return labels['filtersortmenu-sorttext-z-a']()\n }\n }\n }\n\n const getItems = async (): Promise<IContextualMenuItem[]> => {\n if(!condition) {\n return []\n }\n const items: IContextualMenuItem[] = [\n {\n key: 'sort_asc',\n checked: column.isSorted && !column.isSortedDescending,\n disabled: column.disableSorting || column.dataType === DataType.MULTI_SELECT_OPTIONSET,\n text: await getLabel(),\n className: styles.item,\n iconProps: {\n iconName: 'SortUp'\n },\n onClick: () => sorting.sort(0)\n },\n {\n key: 'sort_desc',\n checked: column.isSorted && column.isSortedDescending,\n disabled: column.disableSorting || column.dataType === DataType.MULTI_SELECT_OPTIONSET,\n text: await getLabel(true),\n className: styles.item,\n iconProps: {\n iconName: 'SortDown'\n },\n onClick: () => sorting.sort(1)\n },\n {\n key: 'divider',\n itemType: ContextualMenuItemType.Divider\n },\n {\n key: 'filter',\n className: styles.item,\n disabled: !column.isFilterable,\n text: labels['filtermenu-filterby'](),\n iconProps: {\n iconName: 'Filter'\n },\n onClick: (e) => onDismiss(e, false, true)\n }\n ];\n if (condition.isAppliedToDataset) {\n items.push({\n key: 'clearFilter',\n text: labels['filtersortmenu-clearfilter'](),\n iconProps: {\n iconName: 'ClearFilter'\n },\n onClick: () => {\n condition.remove();\n condition.save();\n }\n });\n }\n return items\n }\n return <ContextualMenu {...props} items={items} />;\n};"],"names":["_jsx"],"mappings":";;;;;;;;;AAca,MAAA,qBAAqB,GAAG,CAAC,KAA6B,KAAI;AACnE,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;AAC/B,IAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAA,MAAM,MAAM,GAAG,mCAAmC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/D,MAAM,EAAC,MAAM,EAAE,SAAS,EAAC,GAAG,EAAC,GAAG,KAAK,EAAC,CAAC;AACvC,IAAA,MAAM,OAAO,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;AACnD,IAAA,MAAM,SAAS,GAAG,kCAAkC,CAAC,MAAM,CAAC,CAAC;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAwB,EAAE,CAAC,CAAC;IAE9D,SAAS,CAAC,MAAK;QACX,CAAC,YAAU;AACP,YAAA,QAAQ,CAAC,MAAM,QAAQ,EAAE,CAAC,CAAA;SAC7B,GAAG,CAAC;AACT,KAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AAEhB,IAAA,MAAM,sBAAsB,GAAG,OAAO,MAAgB,KAAI;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,EAAE,CAAC;QACjD,IAAG,CAAC,MAAM,EAAE;YACR,OAAO,CAAA,EAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,oCAAoC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA,CAAE,CAAA;AACrG,SAAA;QACD,OAAO,CAAA,EAA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,EAAE,QAAQ;AACrB,iBAAA;AACD,gBAAA,OAAO,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;AAC5C,aAAA;SACJ,CAAC;QACF,IAAI,SAAS,CAAC,kBAAkB,EAAE;YAC9B,KAAK,CAAC,IAAI,CAAC;AACP,gBAAA,GAAG,EAAE,aAAa;AAClB,gBAAA,IAAI,EAAE,MAAM,CAAC,4BAA4B,CAAC,EAAE;AAC5C,gBAAA,SAAS,EAAE;AACP,oBAAA,QAAQ,EAAE,aAAa;AAC1B,iBAAA;gBACD,OAAO,EAAE,MAAK;oBACV,SAAS,CAAC,MAAM,EAAE,CAAC;oBACnB,SAAS,CAAC,IAAI,EAAE,CAAC;iBACpB;AACJ,aAAA,CAAC,CAAC;AACN,SAAA;AACD,QAAA,OAAO,KAAK,CAAA;AAChB,KAAC,CAAA;IACD,OAAOA,GAAA,CAAC,cAAc,EAAK,EAAA,GAAA,KAAK,EAAE,KAAK,EAAE,KAAK,EAAA,CAAI,CAAC;AACvD;;;;"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const DefaultContentRenderer: () => JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentProps } from '../useComponentProps.js';
3
+ import { Text } from '@fluentui/react';
4
+
5
+ const DefaultContentRenderer = () => {
6
+ const componentProps = useComponentProps();
7
+ return jsx(Text, { ...componentProps.textProps, children: componentProps.textProps.children });
8
+ };
9
+
10
+ export { DefaultContentRenderer };
11
+ //# sourceMappingURL=DefaultContentRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultContentRenderer.js","sources":["../../../../src/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.tsx"],"sourcesContent":["import { useComponentProps } from \"../useComponentProps\";\nimport { Text } from '@fluentui/react';\n\nexport const DefaultContentRenderer = () => {\n const componentProps = useComponentProps();\n return <Text {...componentProps.textProps}>\n {componentProps.textProps.children}\n </Text>\n}"],"names":["_jsx"],"mappings":";;;;AAGO,MAAM,sBAAsB,GAAG,MAAK;AACvC,IAAA,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;AAC3C,IAAA,OAAOA,GAAC,CAAA,IAAI,EAAK,EAAA,GAAA,cAAc,CAAC,SAAS,EACpC,QAAA,EAAA,cAAc,CAAC,SAAS,CAAC,QAAQ,GAC/B,CAAA;AACX;;;;"}
@@ -0,0 +1 @@
1
+ export * from './DefaultContentRenderer';
@@ -0,0 +1,2 @@
1
+ export { DefaultContentRenderer } from './DefaultContentRenderer.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IGridCellRenderer } from "./interfaces";
3
+ export declare const GridCellRenderer: (props: IGridCellRenderer) => JSX.Element;
@@ -0,0 +1,252 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { SpinnerSize, ThemeProvider, Icon, Link, Image } from '@fluentui/react';
3
+ import { useMemo, useState } from 'react';
4
+ import { getGridCellLabelStyles, getDefaultContentRendererStyles } from './styles.js';
5
+ import { Client, DataTypes, Sanitizer, FetchXmlDataProvider, FileAttribute, Attribute } from '@talxis/client-libraries';
6
+ import { getDefaultGridRendererTranslations } from './translations.js';
7
+ import { ComponentPropsContext } from './useComponentProps.js';
8
+ import { getClassNames, Spinner } from '@talxis/react-components';
9
+ import { OptionSet } from './OptionSet/OptionSet.js';
10
+ import { useControl } from '../../hooks/useControl.js';
11
+ import { DefaultContentRenderer } from './DefaultContentRenderer/DefaultContentRenderer.js';
12
+
13
+ const client = new Client();
14
+ const GridCellRenderer = (props) => {
15
+ const dataset = props.parameters.Dataset.raw;
16
+ const context = props.context;
17
+ const record = props.parameters.Record.raw;
18
+ const column = props.parameters.Column.raw;
19
+ const columnAlignment = props.parameters.ColumnAlignment.raw;
20
+ const dataType = props.parameters.value.type;
21
+ const { theme, sizing } = useControl('GridCellLabel', props, getDefaultGridRendererTranslations());
22
+ const styles = useMemo(() => getGridCellLabelStyles(columnAlignment ?? 'left', dataType, sizing.height, theme), [columnAlignment, dataType, sizing.height, theme]);
23
+ const defaultContentRendererStyles = useMemo(() => getDefaultContentRendererStyles(theme, dataType, sizing.height), [theme, dataType, sizing.height]);
24
+ const value = props.parameters.value.raw;
25
+ const formattedValue = props.parameters.value.formatted;
26
+ const isNavigationEnabled = props.parameters.EnableNavigation.raw;
27
+ const prefixIcon = props.parameters.PrefixIcon?.raw;
28
+ const suffixIcon = props.parameters.SuffixIcon?.raw;
29
+ const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);
30
+ const [downloadInProgress, setIsDownloadInProgress] = useState(false);
31
+ const getLinkProps = () => {
32
+ const props = {
33
+ title: formattedValue,
34
+ className: styles.link,
35
+ rel: 'noopener noreferrer',
36
+ children: formattedValue,
37
+ disabled: downloadInProgress
38
+ };
39
+ switch (dataType) {
40
+ case DataTypes.SingleLineEmail: {
41
+ props.href = `mailto:${value}`;
42
+ break;
43
+ }
44
+ case DataTypes.SingleLinePhone: {
45
+ props.href = `tel:${value}`;
46
+ break;
47
+ }
48
+ case DataTypes.SingleLineUrl: {
49
+ props.href = value;
50
+ props.target = '_blank';
51
+ break;
52
+ }
53
+ case DataTypes.Image:
54
+ case DataTypes.File: {
55
+ props.href = value.fileUrl;
56
+ props.download = value.fileName;
57
+ if (dataType === 'Image') {
58
+ props.title = value.fileName;
59
+ props.children = value.fileName;
60
+ }
61
+ if (shouldUsePortalDownload()) {
62
+ props.onClick = (e) => downloadPortalFile(e);
63
+ }
64
+ break;
65
+ }
66
+ case DataTypes.LookupCustomer:
67
+ case DataTypes.LookupOwner:
68
+ case DataTypes.LookupSimple:
69
+ case DataTypes.LookupRegarding: {
70
+ props.onClick = () => {
71
+ dataset.openDatasetItem(Sanitizer.Lookup.getEntityReference(value[0]));
72
+ };
73
+ break;
74
+ }
75
+ //primary navigation link
76
+ default: {
77
+ props.onClick = () => {
78
+ dataset.openDatasetItem(record.getNamedReference());
79
+ };
80
+ }
81
+ }
82
+ return props;
83
+ };
84
+ //matching could be improved
85
+ const getIconNameForMimeType = (mimeType) => {
86
+ if (!mimeType) {
87
+ return 'Attach';
88
+ }
89
+ const icon_classes = {
90
+ image: "Photo2",
91
+ audio: "MusicNote",
92
+ video: "Video",
93
+ "application/pdf": "PDF",
94
+ "application/msword": "WordDocument",
95
+ "application/vnd.ms-word": "WordDocument",
96
+ "application/vnd.oasis.opendocument.text": "WordDocument",
97
+ "application/vnd.openxmlformats-officedocument.wordprocessingml": "WordDocument",
98
+ "application/vnd.ms-excel": "ExcelDocument",
99
+ "application/vnd.openxmlformats-officedocument.spreadsheetml": "ExcelDocument",
100
+ "application/vnd.oasis.opendocument.spreadsheet": "ExcelDocument",
101
+ "application/vnd.ms-powerpoint": "PowerPointDocument",
102
+ "application/vnd.openxmlformats-officedocument.presentationml": "PowerPointDocument",
103
+ "application/vnd.oasis.opendocument.presentation": "PowerPointDocument",
104
+ "text/plain": "TextDocument",
105
+ "text/html": "FileCode",
106
+ "application/json": "FileCode",
107
+ // Archives
108
+ "application/gzip": "ZipFolder",
109
+ "application/zip": "ZipFolder"
110
+ };
111
+ if (icon_classes[mimeType]) {
112
+ return icon_classes[mimeType];
113
+ }
114
+ else if (icon_classes[mimeType.split("/")[0]]) {
115
+ return icon_classes[mimeType.split("/")[0]];
116
+ }
117
+ return 'Attach';
118
+ };
119
+ const renderContent = () => {
120
+ if (!formattedValue) {
121
+ return jsx(DefaultContentRenderer, {});
122
+ }
123
+ if (column.isPrimary && isNavigationEnabled) {
124
+ return jsx(Link, { ...componentProps.onGetLinkProps(getLinkProps()), children: formattedValue });
125
+ }
126
+ switch (dataType) {
127
+ case DataTypes.SingleLineEmail:
128
+ case DataTypes.SingleLinePhone:
129
+ case DataTypes.SingleLineUrl:
130
+ case DataTypes.LookupCustomer:
131
+ case DataTypes.LookupOwner:
132
+ case DataTypes.LookupSimple:
133
+ case DataTypes.LookupRegarding: {
134
+ const linkProps = componentProps.onGetLinkProps(getLinkProps());
135
+ return jsx(Link, { ...linkProps, children: linkProps.children });
136
+ }
137
+ case DataTypes.OptionSet:
138
+ case DataTypes.MultiSelectOptionSet:
139
+ case DataTypes.TwoOptions: {
140
+ return jsx(OptionSet, { context: props.context, parameters: { ...props.parameters } });
141
+ }
142
+ case DataTypes.File:
143
+ case DataTypes.Image: {
144
+ return renderFileLink(dataType === 'Image');
145
+ }
146
+ }
147
+ return jsx(DefaultContentRenderer, {});
148
+ };
149
+ const shouldUsePortalDownload = () => {
150
+ const isFetchXmlDataProvider = dataset.getDataProvider() instanceof FetchXmlDataProvider;
151
+ //only use portal download if within portal, uses fetch xml provider and is not virtual column
152
+ if (client.isTalxisPortal() && isFetchXmlDataProvider && !column.name.endsWith('__virtual')) {
153
+ return true;
154
+ }
155
+ return false;
156
+ };
157
+ const renderFileLink = (isImage) => {
158
+ const linkProps = componentProps.onGetLinkProps(getLinkProps());
159
+ return (jsxs("div", { ...componentProps.fileProps.containerProps, children: [!downloadInProgress &&
160
+ jsxs(Fragment, { children: [!isImage &&
161
+ jsx(Icon, { ...componentProps.fileProps.iconProps, iconName: componentProps.fileProps.iconProps.onGetIconName(getIconNameForMimeType(value.mimeType)) }), isImage &&
162
+ jsx(Image, { ...componentProps.fileProps.imageProps, src: getThumbnailUrl() })] }), downloadInProgress &&
163
+ jsx(Spinner, { ...componentProps.fileProps.loadingProps.spinnerProps }), jsx(Link, { ...linkProps, children: linkProps.children })] }));
164
+ };
165
+ const getIconProps = (json) => {
166
+ if (!json) {
167
+ return undefined;
168
+ }
169
+ return JSON.parse(json);
170
+ };
171
+ const getThumbnailUrl = () => {
172
+ let src = value.thumbnailUrl;
173
+ if (client.isTalxisPortal()) {
174
+ src = `data:${value.mimeType};base64,${value.fileContent}`;
175
+ }
176
+ return componentProps.fileProps.imageProps.onGetSrc(src);
177
+ };
178
+ const downloadPortalFile = async (e) => {
179
+ e.preventDefault();
180
+ setIsDownloadInProgress(true);
181
+ const storage = new FileAttribute(context.webAPI);
182
+ let entityName = dataset.getTargetEntityType();
183
+ let recordId = record.getRecordId();
184
+ let attributeName = Attribute.GetNameFromAlias(column.name);
185
+ const entityAliasName = Attribute.GetLinkedEntityAlias(column.name);
186
+ if (entityAliasName) {
187
+ entityName = dataset.linking.getLinkedEntities().find(x => x.alias === entityAliasName).name;
188
+ const entityMetadata = await context.utils.getEntityMetadata(entityName, []);
189
+ recordId = record.getRawData()[`${entityAliasName}.${entityMetadata.PrimaryIdAttribute}`];
190
+ }
191
+ await storage.downloadFileFromAttribute({
192
+ entityName: entityName,
193
+ recordId: recordId,
194
+ fileAttribute: attributeName
195
+ }, true, undefined, {
196
+ fileName: value.fileName,
197
+ fileSizeInBytes: value.fileSize
198
+ });
199
+ setIsDownloadInProgress(false);
200
+ };
201
+ const componentProps = onOverrideComponentProps({
202
+ onGetLinkProps: (props) => props,
203
+ onGetOptionSetProps: (props) => props,
204
+ rootContainerProps: {
205
+ theme: theme,
206
+ className: styles.root
207
+ },
208
+ contentWrapperProps: {
209
+ className: styles.contentWrapper,
210
+ },
211
+ textProps: {
212
+ className: getClassNames([defaultContentRendererStyles.content, !formattedValue ? defaultContentRendererStyles.placeholder : undefined]),
213
+ title: formattedValue,
214
+ children: column.type === 'action' ? '' : (formattedValue || '---')
215
+ },
216
+ fileProps: {
217
+ containerProps: {
218
+ className: styles.fileWrapper
219
+ },
220
+ iconProps: {
221
+ className: styles.fileIcon,
222
+ onGetIconName: (iconName) => iconName
223
+ },
224
+ imageProps: {
225
+ className: styles.fileImage,
226
+ onGetSrc: (src) => src
227
+ },
228
+ loadingProps: {
229
+ spinnerProps: {
230
+ size: SpinnerSize.small,
231
+ styles: {
232
+ circle: styles.loadingSpinnerCircle
233
+ }
234
+ }
235
+ }
236
+ }
237
+ });
238
+ const componentPropsProviderValue = useMemo(() => {
239
+ return {
240
+ current: componentProps
241
+ };
242
+ }, []);
243
+ componentPropsProviderValue.current = componentProps;
244
+ //this allows to add prefix/sufix icon without the need of cell customizer
245
+ //it can cover a lot of cases where otherwise custom PCF would be needed
246
+ const prefixIconProps = getIconProps(prefixIcon);
247
+ const suffixIconProps = getIconProps(suffixIcon);
248
+ return jsx(ThemeProvider, { ...componentProps.rootContainerProps, children: jsxs(ComponentPropsContext.Provider, { value: componentPropsProviderValue, children: [prefixIconProps && jsx(Icon, { ...prefixIconProps, className: getClassNames([prefixIconProps.className, styles.icon]) }), jsx("div", { ...componentProps.contentWrapperProps, children: componentProps.contentWrapperProps.children ?? renderContent() }), suffixIconProps && jsx(Icon, { ...suffixIconProps, className: getClassNames([suffixIconProps.className, styles.icon]) })] }) });
249
+ };
250
+
251
+ export { GridCellRenderer };
252
+ //# sourceMappingURL=GridCellRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridCellRenderer.js","sources":["../../../src/components/GridCellRenderer/GridCellRenderer.tsx"],"sourcesContent":["import { Icon, IIconProps, ILinkProps, Image, Link, SpinnerSize, ThemeProvider } from \"@fluentui/react\";\nimport { useControl } from \"../../hooks\";\nimport { useMemo, useState } from \"react\";\nimport { getDefaultContentRendererStyles, getGridCellLabelStyles } from \"./styles\";\nimport { Attribute, Client, DataType, DataTypes, FetchXmlDataProvider, FileAttribute, IRecord, Sanitizer } from \"@talxis/client-libraries\";\nimport { OptionSet } from './OptionSet';\nimport { IGridCellRenderer } from \"./interfaces\";\nimport { getDefaultGridRendererTranslations } from \"./translations\";\nimport { ComponentPropsContext } from \"./useComponentProps\";\nimport { DefaultContentRenderer } from \"./DefaultContentRenderer\";\nimport { getClassNames, Spinner } from \"@talxis/react-components\";\n\nconst client = new Client();\n\nexport const GridCellRenderer = (props: IGridCellRenderer) => {\n const dataset = props.parameters.Dataset.raw;\n const context = props.context;\n const record: IRecord = props.parameters.Record.raw;\n const column = props.parameters.Column.raw;\n const columnAlignment = props.parameters.ColumnAlignment.raw;\n const dataType: DataType = props.parameters.value.type as DataType;\n const { theme, sizing } = useControl('GridCellLabel', props, getDefaultGridRendererTranslations());\n const styles = useMemo(() => getGridCellLabelStyles(columnAlignment ?? 'left', dataType, sizing.height!, theme), [columnAlignment, dataType, sizing.height, theme]);\n const defaultContentRendererStyles = useMemo(() => getDefaultContentRendererStyles(theme, dataType, sizing.height!), [theme, dataType, sizing.height]);\n const value = props.parameters.value.raw;\n const formattedValue: string = props.parameters.value.formatted;\n const isNavigationEnabled = props.parameters.EnableNavigation.raw;\n const prefixIcon = props.parameters.PrefixIcon?.raw\n const suffixIcon = props.parameters.SuffixIcon?.raw;\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n const [downloadInProgress, setIsDownloadInProgress] = useState(false);\n\n const getLinkProps = (): ILinkProps => {\n const props: ILinkProps = {\n title: formattedValue,\n className: styles.link,\n rel: 'noopener noreferrer',\n children: formattedValue,\n disabled: downloadInProgress\n }\n switch (dataType) {\n case DataTypes.SingleLineEmail: {\n props.href = `mailto:${value}`;\n break;\n }\n case DataTypes.SingleLinePhone: {\n props.href = `tel:${value}`;\n break;\n }\n case DataTypes.SingleLineUrl: {\n props.href = value;\n props.target = '_blank';\n break;\n }\n case DataTypes.Image:\n case DataTypes.File: {\n props.href = value.fileUrl;\n props.download = value.fileName;\n if (dataType === 'Image') {\n props.title = value.fileName;\n props.children = value.fileName;\n }\n if (shouldUsePortalDownload()) {\n props.onClick = (e) => downloadPortalFile(e);\n }\n break;\n }\n case DataTypes.LookupCustomer:\n case DataTypes.LookupOwner:\n case DataTypes.LookupSimple:\n case DataTypes.LookupRegarding: {\n props.onClick = () => {\n dataset.openDatasetItem(Sanitizer.Lookup.getEntityReference(value[0]))\n }\n break;\n }\n //primary navigation link\n default: {\n props.onClick = () => {\n dataset.openDatasetItem(record.getNamedReference());\n }\n }\n }\n return props;\n }\n\n\n //matching could be improved\n const getIconNameForMimeType = (mimeType?: string) => {\n if (!mimeType) {\n return 'Attach';\n }\n const icon_classes: any = {\n image: \"Photo2\",\n audio: \"MusicNote\",\n video: \"Video\",\n \"application/pdf\": \"PDF\",\n \"application/msword\": \"WordDocument\",\n \"application/vnd.ms-word\": \"WordDocument\",\n \"application/vnd.oasis.opendocument.text\": \"WordDocument\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml\": \"WordDocument\",\n \"application/vnd.ms-excel\": \"ExcelDocument\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml\": \"ExcelDocument\",\n \"application/vnd.oasis.opendocument.spreadsheet\": \"ExcelDocument\",\n \"application/vnd.ms-powerpoint\": \"PowerPointDocument\",\n \"application/vnd.openxmlformats-officedocument.presentationml\": \"PowerPointDocument\",\n \"application/vnd.oasis.opendocument.presentation\": \"PowerPointDocument\",\n \"text/plain\": \"TextDocument\",\n \"text/html\": \"FileCode\",\n \"application/json\": \"FileCode\",\n // Archives\n \"application/gzip\": \"ZipFolder\",\n \"application/zip\": \"ZipFolder\"\n };\n\n if (icon_classes[mimeType]) {\n return icon_classes[mimeType];\n }\n else if (icon_classes[mimeType.split(\"/\")[0]]) {\n return icon_classes[mimeType.split(\"/\")[0]];\n }\n return 'Attach';\n }\n\n const renderContent = () => {\n if (!formattedValue) {\n return <DefaultContentRenderer />\n }\n if (column.isPrimary && isNavigationEnabled) {\n return <Link {...componentProps.onGetLinkProps(getLinkProps())}>{formattedValue}</Link>\n }\n switch (dataType) {\n case DataTypes.SingleLineEmail:\n case DataTypes.SingleLinePhone:\n case DataTypes.SingleLineUrl:\n case DataTypes.LookupCustomer:\n case DataTypes.LookupOwner:\n case DataTypes.LookupSimple:\n case DataTypes.LookupRegarding: {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return <Link {...linkProps}>{linkProps.children}</Link>\n }\n case DataTypes.OptionSet:\n case DataTypes.MultiSelectOptionSet:\n case DataTypes.TwoOptions: {\n return <OptionSet context={props.context} parameters={{ ...props.parameters }} />\n }\n case DataTypes.File:\n case DataTypes.Image: {\n return renderFileLink(dataType === 'Image');\n }\n }\n return <DefaultContentRenderer />\n }\n\n const shouldUsePortalDownload = () => {\n const isFetchXmlDataProvider = dataset.getDataProvider() instanceof FetchXmlDataProvider;\n //only use portal download if within portal, uses fetch xml provider and is not virtual column\n if(client.isTalxisPortal() && isFetchXmlDataProvider && !column.name.endsWith('__virtual')) {\n return true;\n }\n return false;\n }\n\n const renderFileLink = (isImage?: boolean) => {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return (<div {...componentProps.fileProps.containerProps}>\n {!downloadInProgress &&\n <>\n {!isImage &&\n <Icon {...componentProps.fileProps.iconProps} iconName={componentProps.fileProps.iconProps.onGetIconName(getIconNameForMimeType(value.mimeType))} />\n }\n {isImage &&\n <Image {...componentProps.fileProps.imageProps} src={getThumbnailUrl()} />\n }\n </>\n }\n {downloadInProgress &&\n <Spinner {...componentProps.fileProps.loadingProps.spinnerProps} />\n }\n <Link {...linkProps}>{linkProps.children}</Link>\n </div>);\n }\n\n const getIconProps = (json?: string | null): IIconProps | undefined => {\n if (!json) {\n return undefined;\n }\n return JSON.parse(json);\n }\n\n const getThumbnailUrl = () => {\n let src = value.thumbnailUrl;\n if (client.isTalxisPortal()) {\n src = `data:${value.mimeType};base64,${value.fileContent}`\n }\n return componentProps.fileProps.imageProps.onGetSrc(src);\n }\n\n const downloadPortalFile = async (e: React.MouseEvent<HTMLAnchorElement | HTMLElement | HTMLButtonElement, MouseEvent>) => {\n e.preventDefault();\n setIsDownloadInProgress(true);\n const storage = new FileAttribute(context.webAPI);\n let entityName = dataset.getTargetEntityType();\n let recordId = record.getRecordId();\n let attributeName = Attribute.GetNameFromAlias(column.name);\n const entityAliasName = Attribute.GetLinkedEntityAlias(column.name);\n\n if (entityAliasName) {\n entityName = dataset.linking.getLinkedEntities().find(x => x.alias === entityAliasName)!.name;\n const entityMetadata = await context.utils.getEntityMetadata(entityName, []);\n recordId = record.getRawData()![`${entityAliasName}.${entityMetadata.PrimaryIdAttribute}`];\n }\n await storage.downloadFileFromAttribute({\n entityName: entityName,\n recordId: recordId,\n fileAttribute: attributeName\n }, true, undefined, {\n fileName: value.fileName,\n fileSizeInBytes: value.fileSize\n })\n setIsDownloadInProgress(false);\n }\n\n const componentProps = onOverrideComponentProps({\n onGetLinkProps: (props) => props,\n onGetOptionSetProps: (props) => props,\n rootContainerProps: {\n theme: theme,\n className: styles.root\n },\n contentWrapperProps: {\n className: styles.contentWrapper,\n },\n textProps: {\n className: getClassNames([defaultContentRendererStyles.content, !formattedValue ? defaultContentRendererStyles.placeholder : undefined]),\n title: formattedValue,\n children: column.type === 'action' ? '' : (formattedValue || '---')\n },\n fileProps: {\n containerProps: {\n className: styles.fileWrapper\n },\n iconProps: {\n className: styles.fileIcon,\n onGetIconName: (iconName) => iconName\n },\n imageProps: {\n className: styles.fileImage,\n onGetSrc: (src) => src\n },\n loadingProps: {\n spinnerProps: {\n size: SpinnerSize.small,\n styles: {\n circle: styles.loadingSpinnerCircle\n }\n }\n }\n }\n });\n\n const componentPropsProviderValue = useMemo(() => {\n return {\n current: componentProps\n }\n }, []);\n componentPropsProviderValue.current = componentProps;\n\n //this allows to add prefix/sufix icon without the need of cell customizer\n //it can cover a lot of cases where otherwise custom PCF would be needed\n const prefixIconProps = getIconProps(prefixIcon);\n const suffixIconProps = getIconProps(suffixIcon)\n\n return <ThemeProvider {...componentProps.rootContainerProps}>\n <ComponentPropsContext.Provider value={componentPropsProviderValue}>\n {prefixIconProps && <Icon {...prefixIconProps} className={getClassNames([prefixIconProps.className, styles.icon])} />}\n <div {...componentProps.contentWrapperProps}>\n {componentProps.contentWrapperProps.children ?? renderContent()}\n </div>\n {suffixIconProps && <Icon {...suffixIconProps} className={getClassNames([suffixIconProps.className, styles.icon])} />}\n </ComponentPropsContext.Provider>\n </ThemeProvider>\n}\n\n\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;AAYA,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAA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AAA,MAAM,EAAE;wBACJ,MAAM,EAAE,MAAM,CAAC,oBAAoB;AACtC,qBAAA;AACJ,iBAAA;AACJ,aAAA;AACJ,SAAA;AACJ,KAAA,CAAC,CAAC;AAEH,IAAA,MAAM,2BAA2B,GAAG,OAAO,CAAC,MAAK;QAC7C,OAAO;AACH,YAAA,OAAO,EAAE,cAAc;SAC1B,CAAA;KACJ,EAAE,EAAE,CAAC,CAAC;AACP,IAAA,2BAA2B,CAAC,OAAO,GAAG,cAAc,CAAC;;;AAIrD,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;AACjD,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;AAEhD,IAAA,OAAOA,IAAC,aAAa,EAAA,EAAA,GAAK,cAAc,CAAC,kBAAkB,EACvD,QAAA,EAAAC,IAAA,CAAC,qBAAqB,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,2BAA2B,aAC7D,eAAe,IAAID,GAAC,CAAA,IAAI,OAAK,eAAe,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAI,CAAA,EACrHA,GAAS,CAAA,KAAA,EAAA,EAAA,GAAA,cAAc,CAAC,mBAAmB,EAAA,QAAA,EACtC,cAAc,CAAC,mBAAmB,CAAC,QAAQ,IAAI,aAAa,EAAE,EAC7D,CAAA,EACL,eAAe,IAAIA,IAAC,IAAI,EAAA,EAAA,GAAK,eAAe,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAI,CAAA,CAAA,EAAA,CACxF,GACrB,CAAA;AACpB;;;;"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { IOptionSet } from "../../OptionSet";
3
+ import { IMultiSelectOptionSet } from "../../MultiSelectOptionSet";
4
+ import { ITwoOptions } from "../../TwoOptions";
5
+ export declare const OptionSet: (props: IOptionSet | IMultiSelectOptionSet | ITwoOptions) => JSX.Element;