@talxis/base-controls 1.2406.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 (352) hide show
  1. package/.env +1 -0
  2. package/.eslintrc +117 -0
  3. package/.npmgitignore +9 -0
  4. package/.vscode/settings.json +3 -0
  5. package/.yalcignore +2 -0
  6. package/README.md +18 -0
  7. package/azure-pipelines.yml +44 -0
  8. package/dist/Lookup-eb1505b3.js +1 -0
  9. package/dist/NumeralPCF-a609b7be.js +1 -0
  10. package/dist/components/DateTime/DateTime.d.ts +3 -0
  11. package/dist/components/DateTime/DateTime.js +1 -0
  12. package/dist/components/DateTime/components/Calendar.d.ts +12 -0
  13. package/dist/components/DateTime/hooks/useDateTime.d.ts +6 -0
  14. package/dist/components/DateTime/index.d.ts +2 -0
  15. package/dist/components/DateTime/interfaces.d.ts +31 -0
  16. package/dist/components/DateTime/styles.d.ts +34 -0
  17. package/dist/components/DateTime/translations.d.ts +3 -0
  18. package/dist/components/Decimal/Decimal.d.ts +3 -0
  19. package/dist/components/Decimal/Decimal.js +1 -0
  20. package/dist/components/Decimal/index.d.ts +2 -0
  21. package/dist/components/Decimal/interfaces.d.ts +13 -0
  22. package/dist/components/Duration/Duration.d.ts +3 -0
  23. package/dist/components/Duration/Duration.js +1 -0
  24. package/dist/components/Duration/index.d.ts +2 -0
  25. package/dist/components/Duration/interfaces.d.ts +31 -0
  26. package/dist/components/Duration/translations.d.ts +2 -0
  27. package/dist/components/Grid/Grid.d.ts +5 -0
  28. package/dist/components/Grid/Grid.js +10 -0
  29. package/dist/components/Grid/core/components/AgGrid/AgGrid.d.ts +2 -0
  30. package/dist/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/EmptyRecords.d.ts +2 -0
  31. package/dist/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/styles.d.ts +18 -0
  32. package/dist/components/Grid/core/components/AgGrid/components/LoadingOverlay/LoadingOverlay.d.ts +2 -0
  33. package/dist/components/Grid/core/components/AgGrid/controllers/useAgGridController.d.ts +12 -0
  34. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +13 -0
  35. package/dist/components/Grid/core/components/AgGrid/styles.d.ts +69 -0
  36. package/dist/components/Grid/core/components/Cell/Commands/Commands.d.ts +7 -0
  37. package/dist/components/Grid/core/components/Cell/Commands/Icon.d.ts +7 -0
  38. package/dist/components/Grid/core/components/Cell/Commands/styles.d.ts +19 -0
  39. package/dist/components/Grid/core/components/Cell/Commands/useCommands.d.ts +5 -0
  40. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.d.ts +10 -0
  41. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +11 -0
  42. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +10 -0
  43. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.d.ts +22 -0
  44. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +47 -0
  45. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.d.ts +6 -0
  46. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.d.ts +2 -0
  47. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.d.ts +13 -0
  48. package/dist/components/Grid/core/components/ColumnHeader/styles.d.ts +37 -0
  49. package/dist/components/Grid/core/components/Component/Component.d.ts +11 -0
  50. package/dist/components/Grid/core/components/Component/controller/useComponentController.d.ts +9 -0
  51. package/dist/components/Grid/core/components/Component/model/Component.d.ts +10 -0
  52. package/dist/components/Grid/core/components/Dialog/Constants.d.ts +2 -0
  53. package/dist/components/Grid/core/components/Dialog/Styles.d.ts +2 -0
  54. package/dist/components/Grid/core/components/Dialog/index.d.ts +4 -0
  55. package/dist/components/Grid/core/components/Save/Save.d.ts +2 -0
  56. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.d.ts +3 -0
  57. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/RecordGrids/RecordGrids.d.ts +7 -0
  58. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/RecordGrids/styles.d.ts +48 -0
  59. package/dist/components/Grid/core/components/Save/components/ChangeEditor/styles.d.ts +31 -0
  60. package/dist/components/Grid/core/components/Save/hooks/useSave.d.ts +12 -0
  61. package/dist/components/Grid/core/components/Save/styles.d.ts +37 -0
  62. package/dist/components/Grid/core/controllers/useGridController.d.ts +9 -0
  63. package/dist/components/Grid/core/enums/ConditionOperator.d.ts +46 -0
  64. package/dist/components/Grid/core/enums/DataType.d.ts +24 -0
  65. package/dist/components/Grid/core/hooks/useGridInstance.d.ts +2 -0
  66. package/dist/components/Grid/core/hooks/useRefreshCallback.d.ts +2 -0
  67. package/dist/components/Grid/core/hooks/useRerender.d.ts +1 -0
  68. package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +18 -0
  69. package/dist/components/Grid/core/interfaces/IGridContext.d.ts +4 -0
  70. package/dist/components/Grid/core/model/Grid.d.ts +51 -0
  71. package/dist/components/Grid/core/model/GridDependency.d.ts +13 -0
  72. package/dist/components/Grid/core/model/Metadata.d.ts +7 -0
  73. package/dist/components/Grid/core/services/RecordUpdateService/controllers/useRecordUpdateServiceController.d.ts +14 -0
  74. package/dist/components/Grid/core/services/RecordUpdateService/model/RecordUpdateService.d.ts +30 -0
  75. package/dist/components/Grid/filtering/components/FilterCallout/FilterCallout.d.ts +8 -0
  76. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionOperator/ConditionOperator.d.ts +7 -0
  77. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.d.ts +7 -0
  78. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +30 -0
  79. package/dist/components/Grid/filtering/components/FilterCallout/styles.d.ts +35 -0
  80. package/dist/components/Grid/filtering/constants.d.ts +5 -0
  81. package/dist/components/Grid/filtering/controller/useColumnFilterConditionController.d.ts +19 -0
  82. package/dist/components/Grid/filtering/model/Condition.d.ts +47 -0
  83. package/dist/components/Grid/filtering/model/Filtering.d.ts +11 -0
  84. package/dist/components/Grid/filtering/utils/FilteringUtilts.d.ts +34 -0
  85. package/dist/components/Grid/interfaces.d.ts +254 -0
  86. package/dist/components/Grid/paging/components/Paging/Paging.d.ts +2 -0
  87. package/dist/components/Grid/paging/components/Paging/styles.d.ts +35 -0
  88. package/dist/components/Grid/paging/controllers/usePagingController.d.ts +16 -0
  89. package/dist/components/Grid/paging/model/Paging.d.ts +15 -0
  90. package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +11 -0
  91. package/dist/components/Grid/selection/model/Selection.d.ts +13 -0
  92. package/dist/components/Grid/sorting/Sorting.d.ts +9 -0
  93. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.d.ts +8 -0
  94. package/dist/components/Grid/sorting/components/SortingContextualMenu/styles.d.ts +9 -0
  95. package/dist/components/Grid/sorting/controllers/useColumnSortingController.d.ts +8 -0
  96. package/dist/components/Grid/translations.d.ts +2 -0
  97. package/dist/components/Grid/validation/controllers/useRecordValidationController.d.ts +8 -0
  98. package/dist/components/Grid/validation/model/ColumnValidation.d.ts +11 -0
  99. package/dist/components/Lookup/Lookup.d.ts +3 -0
  100. package/dist/components/Lookup/Lookup.js +1 -0
  101. package/dist/components/Lookup/components/RecordCreator.d.ts +10 -0
  102. package/dist/components/Lookup/components/TargetSelector.d.ts +10 -0
  103. package/dist/components/Lookup/hooks/useFetchXml.d.ts +3 -0
  104. package/dist/components/Lookup/hooks/useLoadedEntities.d.ts +6 -0
  105. package/dist/components/Lookup/hooks/useLookup.d.ts +8 -0
  106. package/dist/components/Lookup/index.d.ts +2 -0
  107. package/dist/components/Lookup/interfaces.d.ts +52 -0
  108. package/dist/components/Lookup/lib.d.ts +1164 -0
  109. package/dist/components/Lookup/styles.d.ts +90 -0
  110. package/dist/components/Lookup/translations.d.ts +2 -0
  111. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.d.ts +3 -0
  112. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js +1 -0
  113. package/dist/components/MultiSelectOptionSet/index.d.ts +2 -0
  114. package/dist/components/MultiSelectOptionSet/interfaces.d.ts +11 -0
  115. package/dist/components/OptionSet/OptionSet.d.ts +3 -0
  116. package/dist/components/OptionSet/OptionSet.js +1 -0
  117. package/dist/components/OptionSet/index.d.ts +2 -0
  118. package/dist/components/OptionSet/interfaces.d.ts +13 -0
  119. package/dist/components/TextField/TextField.d.ts +3 -0
  120. package/dist/components/TextField/TextField.js +1 -0
  121. package/dist/components/TextField/hooks/useTextField.d.ts +2 -0
  122. package/dist/components/TextField/index.d.ts +2 -0
  123. package/dist/components/TextField/interfaces.d.ts +15 -0
  124. package/dist/components/TwoOptions/TwoOptions.d.ts +3 -0
  125. package/dist/components/TwoOptions/TwoOptions.js +1 -0
  126. package/dist/components/TwoOptions/index.d.ts +2 -0
  127. package/dist/components/TwoOptions/interfaces.d.ts +13 -0
  128. package/dist/hooks/index.d.ts +1 -0
  129. package/dist/hooks/index.js +1 -0
  130. package/dist/hooks/useComponent.d.ts +7 -0
  131. package/dist/hooks/useComponent.js +1 -0
  132. package/dist/hooks/useFocusIn.d.ts +1 -0
  133. package/dist/hooks/useFocusIn.js +1 -0
  134. package/dist/hooks/useInputBasedComponent.d.ts +32 -0
  135. package/dist/hooks/useInputBasedComponent.js +1 -0
  136. package/dist/hooks/useMouseOver.d.ts +1 -0
  137. package/dist/hooks/useMouseOver.js +1 -0
  138. package/dist/index.d.ts +40 -0
  139. package/dist/interfaces/context.d.ts +20 -0
  140. package/dist/interfaces/index.d.ts +9 -0
  141. package/dist/interfaces/parameters.d.ts +23 -0
  142. package/dist/interfaces/property.d.ts +100 -0
  143. package/dist/types/index.d.ts +3 -0
  144. package/dist/utils/NumeralPCF.d.ts +6 -0
  145. package/examples/Currency/Currency/ControlManifest.Input.xml +53 -0
  146. package/examples/Currency/Currency/index.ts +66 -0
  147. package/examples/Currency/Currency.pcfproj +46 -0
  148. package/examples/Currency/package-lock.json +15900 -0
  149. package/examples/Currency/package.json +29 -0
  150. package/examples/Currency/pcfconfig.json +3 -0
  151. package/examples/Currency/tsconfig.json +7 -0
  152. package/examples/DateTime/DateTime/ControlManifest.Input.xml +58 -0
  153. package/examples/DateTime/DateTime/index.ts +69 -0
  154. package/examples/DateTime/DateTime.pcfproj +46 -0
  155. package/examples/DateTime/package-lock.json +15900 -0
  156. package/examples/DateTime/package.json +29 -0
  157. package/examples/DateTime/pcfconfig.json +3 -0
  158. package/examples/DateTime/tsconfig.json +7 -0
  159. package/examples/Decimal/Decimal/ControlManifest.Input.xml +66 -0
  160. package/examples/Decimal/Decimal/index.ts +66 -0
  161. package/examples/Decimal/Decimal.pcfproj +46 -0
  162. package/examples/Decimal/package-lock.json +15900 -0
  163. package/examples/Decimal/package.json +28 -0
  164. package/examples/Decimal/pcfconfig.json +3 -0
  165. package/examples/Decimal/tsconfig.json +7 -0
  166. package/examples/Duration/Duration/ControlManifest.Input.xml +53 -0
  167. package/examples/Duration/Duration/index.ts +66 -0
  168. package/examples/Duration/Duration.pcfproj +46 -0
  169. package/examples/Duration/package-lock.json +15900 -0
  170. package/examples/Duration/package.json +29 -0
  171. package/examples/Duration/pcfconfig.json +3 -0
  172. package/examples/Duration/tsconfig.json +7 -0
  173. package/examples/Grid/Grid/ControlManifest.Input.xml +28 -0
  174. package/examples/Grid/Grid/index.ts +100 -0
  175. package/examples/Grid/Grid.pcfproj +46 -0
  176. package/examples/Grid/package-lock.json +15901 -0
  177. package/examples/Grid/package.json +30 -0
  178. package/examples/Grid/pcfconfig.json +3 -0
  179. package/examples/Grid/tsconfig.json +7 -0
  180. package/examples/Lookup/Lookup/ControlManifest.Input.xml +51 -0
  181. package/examples/Lookup/Lookup/index.ts +90 -0
  182. package/examples/Lookup/Lookup.pcfproj +46 -0
  183. package/examples/Lookup/package-lock.json +15900 -0
  184. package/examples/Lookup/package.json +29 -0
  185. package/examples/Lookup/pcfconfig.json +3 -0
  186. package/examples/Lookup/tsconfig.json +8 -0
  187. package/examples/MultiSelectOptionSet/MultiSelectOptionSet/ControlManifest.Input.xml +53 -0
  188. package/examples/MultiSelectOptionSet/MultiSelectOptionSet/index.ts +86 -0
  189. package/examples/MultiSelectOptionSet/MultiSelectOptionSet.pcfproj +46 -0
  190. package/examples/MultiSelectOptionSet/package-lock.json +15900 -0
  191. package/examples/MultiSelectOptionSet/package.json +31 -0
  192. package/examples/MultiSelectOptionSet/pcfconfig.json +3 -0
  193. package/examples/MultiSelectOptionSet/tsconfig.json +7 -0
  194. package/examples/OptionSet/OptionSet/ControlManifest.Input.xml +53 -0
  195. package/examples/OptionSet/OptionSet/index.ts +70 -0
  196. package/examples/OptionSet/OptionSet.pcfproj +46 -0
  197. package/examples/OptionSet/package-lock.json +15900 -0
  198. package/examples/OptionSet/package.json +29 -0
  199. package/examples/OptionSet/pcfconfig.json +3 -0
  200. package/examples/OptionSet/tsconfig.json +7 -0
  201. package/examples/TwoOptions/TwoOptions/ControlManifest.Input.xml +53 -0
  202. package/examples/TwoOptions/TwoOptions/index.ts +69 -0
  203. package/examples/TwoOptions/TwoOptions.pcfproj +46 -0
  204. package/examples/TwoOptions/package-lock.json +15900 -0
  205. package/examples/TwoOptions/package.json +29 -0
  206. package/examples/TwoOptions/pcfconfig.json +3 -0
  207. package/examples/TwoOptions/tsconfig.json +7 -0
  208. package/package.json +94 -0
  209. package/public/index.html +43 -0
  210. package/public/manifest.json +25 -0
  211. package/rollup.config.js +44 -0
  212. package/src/components/DateTime/DateTime.tsx +97 -0
  213. package/src/components/DateTime/components/Calendar.tsx +80 -0
  214. package/src/components/DateTime/hooks/useDateTime.ts +144 -0
  215. package/src/components/DateTime/index.ts +2 -0
  216. package/src/components/DateTime/interfaces.ts +22 -0
  217. package/src/components/DateTime/styles.ts +37 -0
  218. package/src/components/DateTime/translations.ts +18 -0
  219. package/src/components/Decimal/Decimal.tsx +120 -0
  220. package/src/components/Decimal/index.ts +2 -0
  221. package/src/components/Decimal/interfaces.ts +20 -0
  222. package/src/components/Duration/Duration.tsx +143 -0
  223. package/src/components/Duration/index.ts +2 -0
  224. package/src/components/Duration/interfaces.ts +22 -0
  225. package/src/components/Duration/translations.ts +30 -0
  226. package/src/components/Grid/Grid.tsx +24 -0
  227. package/src/components/Grid/core/components/AgGrid/AgGrid.tsx +206 -0
  228. package/src/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/EmptyRecords.tsx +16 -0
  229. package/src/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/styles.ts +20 -0
  230. package/src/components/Grid/core/components/AgGrid/components/LoadingOverlay/LoadingOverlay.tsx +7 -0
  231. package/src/components/Grid/core/components/AgGrid/controllers/useAgGridController.ts +68 -0
  232. package/src/components/Grid/core/components/AgGrid/model/AgGrid.ts +100 -0
  233. package/src/components/Grid/core/components/AgGrid/styles.ts +72 -0
  234. package/src/components/Grid/core/components/Cell/Commands/Commands.tsx +32 -0
  235. package/src/components/Grid/core/components/Cell/Commands/Icon.tsx +17 -0
  236. package/src/components/Grid/core/components/Cell/Commands/styles.ts +21 -0
  237. package/src/components/Grid/core/components/Cell/Commands/useCommands.tsx +53 -0
  238. package/src/components/Grid/core/components/Cell/EditableCell/EditableCell.tsx +140 -0
  239. package/src/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.tsx +176 -0
  240. package/src/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.tsx +67 -0
  241. package/src/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.ts +24 -0
  242. package/src/components/Grid/core/components/Cell/ReadOnlyCell/styles.ts +56 -0
  243. package/src/components/Grid/core/components/ColumnHeader/ColumnHeader.tsx +71 -0
  244. package/src/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.tsx +31 -0
  245. package/src/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.ts +16 -0
  246. package/src/components/Grid/core/components/ColumnHeader/styles.ts +40 -0
  247. package/src/components/Grid/core/components/Component/Component.tsx +59 -0
  248. package/src/components/Grid/core/components/Component/controller/useComponentController.ts +39 -0
  249. package/src/components/Grid/core/components/Component/model/Component.ts +251 -0
  250. package/src/components/Grid/core/components/Dialog/Constants.tsx +8 -0
  251. package/src/components/Grid/core/components/Dialog/Styles.tsx +61 -0
  252. package/src/components/Grid/core/components/Dialog/index.tsx +22 -0
  253. package/src/components/Grid/core/components/Dialog/interfaces/index.d.ts +7 -0
  254. package/src/components/Grid/core/components/Save/Save.tsx +74 -0
  255. package/src/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.tsx +63 -0
  256. package/src/components/Grid/core/components/Save/components/ChangeEditor/components/RecordGrids/RecordGrids.tsx +153 -0
  257. package/src/components/Grid/core/components/Save/components/ChangeEditor/components/RecordGrids/styles.ts +52 -0
  258. package/src/components/Grid/core/components/Save/components/ChangeEditor/styles.ts +34 -0
  259. package/src/components/Grid/core/components/Save/hooks/useSave.ts +59 -0
  260. package/src/components/Grid/core/components/Save/styles.ts +41 -0
  261. package/src/components/Grid/core/controllers/useGridController.ts +46 -0
  262. package/src/components/Grid/core/enums/ConditionOperator.ts +46 -0
  263. package/src/components/Grid/core/enums/DataType.ts +25 -0
  264. package/src/components/Grid/core/hooks/useGridInstance.ts +7 -0
  265. package/src/components/Grid/core/hooks/useRefreshCallback.ts +20 -0
  266. package/src/components/Grid/core/hooks/useRerender.ts +15 -0
  267. package/src/components/Grid/core/interfaces/IGridColumn.ts +19 -0
  268. package/src/components/Grid/core/interfaces/IGridContext.ts +7 -0
  269. package/src/components/Grid/core/model/Grid.ts +250 -0
  270. package/src/components/Grid/core/model/GridDependency.ts +34 -0
  271. package/src/components/Grid/core/model/Metadata.ts +20 -0
  272. package/src/components/Grid/core/services/RecordUpdateService/controllers/useRecordUpdateServiceController.ts +36 -0
  273. package/src/components/Grid/core/services/RecordUpdateService/model/RecordUpdateService.ts +222 -0
  274. package/src/components/Grid/filtering/components/FilterCallout/FilterCallout.tsx +83 -0
  275. package/src/components/Grid/filtering/components/FilterCallout/components/ConditionOperator/ConditionOperator.tsx +66 -0
  276. package/src/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.tsx +48 -0
  277. package/src/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.ts +120 -0
  278. package/src/components/Grid/filtering/components/FilterCallout/styles.ts +37 -0
  279. package/src/components/Grid/filtering/constants.ts +48 -0
  280. package/src/components/Grid/filtering/controller/useColumnFilterConditionController.ts +63 -0
  281. package/src/components/Grid/filtering/model/Condition.ts +309 -0
  282. package/src/components/Grid/filtering/model/Filtering.ts +78 -0
  283. package/src/components/Grid/filtering/utils/FilteringUtilts.ts +190 -0
  284. package/src/components/Grid/interfaces.ts +109 -0
  285. package/src/components/Grid/paging/components/Paging/Paging.tsx +76 -0
  286. package/src/components/Grid/paging/components/Paging/styles.ts +38 -0
  287. package/src/components/Grid/paging/controllers/usePagingController.ts +34 -0
  288. package/src/components/Grid/paging/model/Paging.ts +49 -0
  289. package/src/components/Grid/selection/controllers/useSelectionController.ts +25 -0
  290. package/src/components/Grid/selection/model/Selection.ts +60 -0
  291. package/src/components/Grid/sorting/Sorting.ts +30 -0
  292. package/src/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.tsx +126 -0
  293. package/src/components/Grid/sorting/components/SortingContextualMenu/styles.ts +12 -0
  294. package/src/components/Grid/sorting/controllers/useColumnSortingController.ts +26 -0
  295. package/src/components/Grid/translations.ts +80 -0
  296. package/src/components/Grid/validation/controllers/useRecordValidationController.ts +31 -0
  297. package/src/components/Grid/validation/model/ColumnValidation.ts +81 -0
  298. package/src/components/Lookup/Lookup.tsx +199 -0
  299. package/src/components/Lookup/components/RecordCreator.tsx +53 -0
  300. package/src/components/Lookup/components/TargetSelector.tsx +43 -0
  301. package/src/components/Lookup/hooks/useFetchXml.ts +31 -0
  302. package/src/components/Lookup/hooks/useLoadedEntities.ts +23 -0
  303. package/src/components/Lookup/hooks/useLookup.ts +126 -0
  304. package/src/components/Lookup/index.ts +2 -0
  305. package/src/components/Lookup/interfaces.ts +45 -0
  306. package/src/components/Lookup/lib.ts +3110 -0
  307. package/src/components/Lookup/styles.ts +106 -0
  308. package/src/components/Lookup/translations.ts +28 -0
  309. package/src/components/MultiSelectOptionSet/MultiSelectOptionSet.tsx +83 -0
  310. package/src/components/MultiSelectOptionSet/index.ts +2 -0
  311. package/src/components/MultiSelectOptionSet/interfaces.ts +14 -0
  312. package/src/components/OptionSet/OptionSet.tsx +67 -0
  313. package/src/components/OptionSet/index.ts +2 -0
  314. package/src/components/OptionSet/interfaces.ts +17 -0
  315. package/src/components/TextField/TextField.tsx +58 -0
  316. package/src/components/TextField/hooks/useTextField.ts +42 -0
  317. package/src/components/TextField/index.ts +2 -0
  318. package/src/components/TextField/interfaces.ts +20 -0
  319. package/src/components/TwoOptions/TwoOptions.tsx +43 -0
  320. package/src/components/TwoOptions/index.ts +2 -0
  321. package/src/components/TwoOptions/interfaces.ts +17 -0
  322. package/src/hooks/index.ts +1 -0
  323. package/src/hooks/useComponent.ts +83 -0
  324. package/src/hooks/useFocusIn.ts +23 -0
  325. package/src/hooks/useInputBasedComponent.ts +71 -0
  326. package/src/hooks/useMouseOver.ts +23 -0
  327. package/src/index.tsx +12 -0
  328. package/src/interfaces/context.ts +21 -0
  329. package/src/interfaces/index.ts +12 -0
  330. package/src/interfaces/parameters.ts +26 -0
  331. package/src/interfaces/property.ts +111 -0
  332. package/src/sandbox/index.tsx +137 -0
  333. package/src/sandbox/mock/Context.ts +18 -0
  334. package/src/sandbox/mock/Formatting.ts +186 -0
  335. package/src/sandbox/mock/Mode.ts +25 -0
  336. package/src/sandbox/mock/UserSettings.ts +31 -0
  337. package/src/sandbox/mock/Utility.ts +14 -0
  338. package/src/sandbox/shared/durationList.tsx +24 -0
  339. package/src/sandbox/shared/multiSelectOptionList.tsx +5 -0
  340. package/src/sandbox/shared/optionList.tsx +5 -0
  341. package/src/stories/Introduction.stories.mdx +122 -0
  342. package/src/stories/assets/code-brackets.svg +1 -0
  343. package/src/stories/assets/colors.svg +1 -0
  344. package/src/stories/assets/comments.svg +1 -0
  345. package/src/stories/assets/direction.svg +1 -0
  346. package/src/stories/assets/flow.svg +1 -0
  347. package/src/stories/assets/plugin.svg +1 -0
  348. package/src/stories/assets/repo.svg +1 -0
  349. package/src/stories/assets/stackalt.svg +1 -0
  350. package/src/types/index.ts +3 -0
  351. package/src/utils/NumeralPCF.ts +62 -0
  352. package/tsconfig.json +28 -0
@@ -0,0 +1,309 @@
1
+ import { DatasetConditionOperator } from "../../core/enums/ConditionOperator";
2
+ import { DataType } from "../../core/enums/DataType";
3
+ import { IGridColumn } from "../../core/interfaces/IGridColumn";
4
+ import { Grid } from "../../core/model/Grid";
5
+ import { GridDependency } from "../../core/model/GridDependency";
6
+ import { ColumnValidation } from "../../validation/model/ColumnValidation";
7
+ import { FilteringUtils } from "../utils/FilteringUtilts";
8
+
9
+ export class Condition extends GridDependency {
10
+ private _column: IGridColumn;
11
+ private _isAppliedToDataset: boolean = false;
12
+ private _conditionExpression: ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression = {} as any;
13
+ private _isRemoved?: boolean;
14
+ private _conditionUtils = FilteringUtils.condition();
15
+ private _isValid: boolean = true;
16
+ private _inicializationPromise: Promise<boolean> | undefined;
17
+ private _initialized: boolean = false;
18
+
19
+ constructor(grid: Grid, column: IGridColumn) {
20
+ super(grid);
21
+ this._column = column;
22
+ return new Proxy(this, {
23
+ get: (target, prop) => {
24
+ if(prop !== 'init') {
25
+ if(!target._initialized) {
26
+ throw new Error('Condition has not been initialized. Make sure to call the init() method on the condition object before any operations.')
27
+ }
28
+ }
29
+ //@ts-ignore
30
+ if (typeof target[prop] === 'function') {
31
+ //@ts-ignore
32
+ return target[prop].bind(target);
33
+ }
34
+ //@ts-ignore
35
+ return target[prop];
36
+ }
37
+ })
38
+ }
39
+ public async init() {
40
+ if (!this._inicializationPromise) {
41
+ this._inicializationPromise = new Promise(async (resolve) => {
42
+ const [map, key] = await this._getConditionFromFilterExpression();
43
+ if(!key) {
44
+ this._conditionExpression = this._getDefault();
45
+ }
46
+ else {
47
+ this._isAppliedToDataset = true;
48
+ this._conditionExpression = map.get(key)!;
49
+ }
50
+ this._conditionExpression.conditionOperator = this._operatorDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value, true) as any;
51
+ this._conditionExpression.value = this._valueDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value, true);
52
+ this._conditionExpression.attributeName = await this._attributeNameDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.attributeName, true);
53
+ resolve(true);
54
+ this._initialized = true;
55
+ })
56
+ }
57
+ return this._inicializationPromise;
58
+ }
59
+ public get isRemoved() {
60
+ return this._isRemoved;
61
+ }
62
+
63
+ public get column() {
64
+ return this._column;
65
+ }
66
+
67
+ public get isAppliedToDataset() {
68
+ return this._isAppliedToDataset;
69
+ }
70
+
71
+ public get isValid() {
72
+ return this._isValid;
73
+ }
74
+
75
+ public async getExpression() {
76
+ const result = { ...this._conditionExpression };
77
+ result.conditionOperator = this._operatorDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value) as any;
78
+ result.value = this._valueDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.value);
79
+ result.attributeName = await this._attributeNameDecorator(this._conditionExpression.conditionOperator, this._conditionExpression.attributeName);
80
+ return result;
81
+
82
+ }
83
+ public async save(): Promise<boolean> {
84
+ if (!await this.value.isValid()) {
85
+ this._isValid = false;
86
+ this._triggerRefreshCallbacks();
87
+ return false;
88
+ }
89
+ const filterExpression = this._filterExpression;
90
+ if (this._isAppliedToDataset || this._isRemoved) {
91
+ const [map, key] = await this._getConditionFromFilterExpression();
92
+ map.delete(key);
93
+ filterExpression.conditions = [...map.values()];
94
+ }
95
+ if (!this._isRemoved) {
96
+ filterExpression.conditions.push(await this.getExpression());
97
+ }
98
+ this._dataset.filtering.setFilter(filterExpression);
99
+ return true;
100
+
101
+ }
102
+ public remove() {
103
+ this._isRemoved = true;
104
+ }
105
+ public clear() {
106
+ this._inicializationPromise = undefined;
107
+ }
108
+ public get operator() {
109
+ return {
110
+ get: () => this._get('operator') as DatasetConditionOperator,
111
+ set: (conditionOperator: DatasetConditionOperator) => {
112
+ const previousOperator = this._conditionExpression.conditionOperator
113
+ this._set("operator", conditionOperator, null);
114
+ const isCurrentEditable = this._conditionUtils.value(conditionOperator).isManuallyEditable;
115
+ const isPreviousEditable = this._conditionUtils.value(previousOperator).isManuallyEditable;
116
+
117
+ if (isCurrentEditable !== isPreviousEditable) {
118
+ // we are transitioning between editable and non-editable operators and the value of these data types needs to be set to null
119
+ // to prevent type incompability
120
+ switch (this._column.dataType) {
121
+ case DataType.MULTI_SELECT_OPTIONSET:
122
+ case DataType.OPTIONSET:
123
+ case DataType.TWO_OPTIONS:
124
+ case DataType.LOOKUP_SIMPLE:
125
+ case DataType.LOOKUP_OWNER:
126
+ case DataType.DATE_AND_TIME_DATE_AND_TIME:
127
+ case DataType.DATE_AND_TIME_DATE_ONLY: {
128
+ this._conditionExpression!.value = ""
129
+ break;
130
+ }
131
+ }
132
+ }
133
+ },
134
+ }
135
+ }
136
+
137
+ public get value() {
138
+ return {
139
+ get: () => this._get('value') as any,
140
+ set: (value: any) => this._set("value", undefined, value),
141
+ isValid: async () => {
142
+ if(this._conditionUtils.operator(this.operator.get()).doesNotAllowValue) {
143
+ return true;
144
+ }
145
+ const [result, errorMessage] = await new ColumnValidation(this._grid, this._column, true).validate(await this.value.get());
146
+ return result;
147
+ }
148
+ }
149
+ }
150
+ private _get(type: 'operator' | 'value'): DatasetConditionOperator | any {
151
+ if (type === 'operator') {
152
+ return this._conditionExpression.conditionOperator;
153
+ }
154
+ return this._conditionExpression.value;
155
+ }
156
+ private _set(type: 'operator' | 'value', conditionOperator?: DatasetConditionOperator, value?: any) {
157
+ this._isValid = true;
158
+ if (type === 'operator') {
159
+ this._conditionExpression.conditionOperator = conditionOperator as any;
160
+ }
161
+ else {
162
+ this._conditionExpression.value = value;
163
+ }
164
+ this._triggerRefreshCallbacks();
165
+ }
166
+
167
+ private async _attributeNameDecorator(conditionOperator: DatasetConditionOperator, attributeName: string, undecorate?: boolean) {
168
+ if (!this._conditionUtils.value(conditionOperator).isManuallyEditable) {
169
+ return attributeName;
170
+ }
171
+ switch (this._column.dataType) {
172
+ case DataType.OPTIONSET:
173
+ case DataType.TWO_OPTIONS:
174
+ case DataType.LOOKUP_OWNER:
175
+ case DataType.LOOKUP_SIMPLE: {
176
+ if (undecorate) {
177
+ if (attributeName.endsWith('name')) {
178
+ return attributeName.slice(0, -4);
179
+ }
180
+ return attributeName;
181
+ }
182
+ if (attributeName.endsWith('name')) {
183
+ return attributeName;
184
+ }
185
+ return `${attributeName}name`
186
+ }
187
+ /* case DataType.LOOKUP_OWNER:
188
+ case DataType.LOOKUP_SIMPLE: {
189
+ if (undecorate) {
190
+ return attributeName;
191
+ }
192
+ const metadata = await this._grid.metadata.get(this._column);
193
+ return `${this._column.attributeName}${metadata.PrimaryNameAttribute}`;
194
+ } */
195
+ default: {
196
+ return attributeName;
197
+ }
198
+ }
199
+ }
200
+ private _valueDecorator(conditionOperator: DatasetConditionOperator, value: any, undecorate?: boolean) {
201
+ switch (conditionOperator) {
202
+ case DatasetConditionOperator.BeginWith:
203
+ case DatasetConditionOperator.DoesNotBeginWith: {
204
+ if (undecorate) {
205
+ return value.slice(0, -1);
206
+ }
207
+ return `${value}%`;
208
+ }
209
+ case DatasetConditionOperator.EndsWith:
210
+ case DatasetConditionOperator.DoesNotEndWith: {
211
+ if (undecorate) {
212
+ return value.slice(1)
213
+ }
214
+ return `%${value}`;
215
+ }
216
+ case DatasetConditionOperator.Like:
217
+ case DatasetConditionOperator.NotLike: {
218
+ if (undecorate) {
219
+ return value.slice(1, -1)
220
+ }
221
+ return `%${value}%`;
222
+ }
223
+ default: {
224
+ return value;
225
+ }
226
+ }
227
+ }
228
+
229
+ private _operatorDecorator(conditionOperator: DatasetConditionOperator, value: any, undecorate?: boolean): DatasetConditionOperator {
230
+ switch (this._column.dataType) {
231
+ case DataType.MULTI_SELECT_OPTIONSET:
232
+ case DataType.OPTIONSET:
233
+ case DataType.TWO_OPTIONS:
234
+ case DataType.LOOKUP_OWNER:
235
+ case DataType.LOOKUP_SIMPLE: {
236
+ //we need to switch the operators based on the number of selected options
237
+ if (typeof value !== 'string') {
238
+ if(undecorate) {
239
+ switch(conditionOperator) {
240
+ case DatasetConditionOperator.In: {
241
+ return DatasetConditionOperator.Equal
242
+ }
243
+ case DatasetConditionOperator.NotIn: {
244
+ return DatasetConditionOperator.NotEqual;
245
+ }
246
+ }
247
+ }
248
+ switch (conditionOperator) {
249
+ case DatasetConditionOperator.Equal: {
250
+ return DatasetConditionOperator.In;
251
+ }
252
+ case DatasetConditionOperator.NotEqual: {
253
+ return DatasetConditionOperator.NotIn;
254
+ }
255
+ }
256
+ }
257
+ else {
258
+ switch (conditionOperator) {
259
+ case DatasetConditionOperator.In: {
260
+ return DatasetConditionOperator.Equal;
261
+ }
262
+ case DatasetConditionOperator.NotIn: {
263
+ return DatasetConditionOperator.NotEqual;
264
+ }
265
+ }
266
+ }
267
+ }
268
+ }
269
+ return conditionOperator;
270
+ }
271
+
272
+ private _getDefault(): ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression {
273
+ const cond: ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression = {
274
+ attributeName: this._column.attributeName,
275
+ conditionOperator: DatasetConditionOperator.Equal,
276
+ entityAliasName: this._column.entityAliasName,
277
+ value: ""
278
+ }
279
+ switch (this._column.dataType) {
280
+ case DataType.DATE_AND_TIME_DATE_AND_TIME:
281
+ case DataType.DATE_AND_TIME_DATE_ONLY: {
282
+ cond.conditionOperator = DatasetConditionOperator.On;
283
+ break;
284
+ }
285
+ case DataType.IMAGE:
286
+ case DataType.FILE: {
287
+ cond.conditionOperator = DatasetConditionOperator.NotNull as any;
288
+ break;
289
+ }
290
+ }
291
+ return cond;
292
+ }
293
+ private get _filterExpression() {
294
+ return structuredClone(this._dataset.filtering.getFilter()) ?? {
295
+ conditions: [],
296
+ filterOperator: 0
297
+ }
298
+ }
299
+ private async _getConditionFromFilterExpression(): Promise<[Map<string, ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression>, string]> {
300
+ const map = new Map<string, ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression>(this._filterExpression.conditions.map(x => [x.attributeName, x]));
301
+ for (const cond of map.values()) {
302
+ const conditionAttributeName = await this._attributeNameDecorator(cond.conditionOperator, cond.attributeName, true);
303
+ if(conditionAttributeName === this._column.attributeName) {
304
+ return [map, cond.attributeName]
305
+ }
306
+ }
307
+ return [map, ""];
308
+ }
309
+ }
@@ -0,0 +1,78 @@
1
+ import { IGridColumn } from "../../core/interfaces/IGridColumn";
2
+ import { GridDependency } from "../../core/model/GridDependency";
3
+ import { Condition } from "./Condition";
4
+
5
+ export class Filtering extends GridDependency {
6
+ private _conditions: Map<string, Condition> = new Map();
7
+
8
+ public async save(): Promise<boolean> {
9
+ const filterExpression = this._filterExpression;
10
+ for (const condition of this._conditions.values()) {
11
+ if(!condition.value.isValid()) {
12
+ return false;
13
+ }
14
+ const expression = await condition.getExpression();
15
+ if (condition.isAppliedToDataset || condition.isRemoved) {
16
+ filterExpression.conditions = this._filterExpression.conditions.filter(cond => this._getColumnKeyFromCondition(cond) !== condition.column.key);
17
+ }
18
+ if (!condition.isRemoved) {
19
+ filterExpression.conditions.push(expression)
20
+ }
21
+ }
22
+ this.clear();
23
+ this._dataset.filtering.setFilter(filterExpression);
24
+ this._dataset.refresh();
25
+ return true;
26
+ }
27
+
28
+ public clear() {
29
+ this._conditions.clear();
30
+ }
31
+
32
+ public async condition(column: IGridColumn): Promise<Condition> {
33
+ const columnKey = column.key
34
+ if (!this._conditions.get(columnKey)) {
35
+ this._conditions.set(columnKey, new Condition(this._grid, column))
36
+ }
37
+ const cond = new Proxy(this._conditions.get(columnKey)!, {
38
+ get: (target, prop) => {
39
+ if (prop === 'save') {
40
+ return async () => {
41
+ const saveResult = await target.save();
42
+ if (saveResult) {
43
+ this._conditions.delete(target.column.key);
44
+ this._dataset.refresh();
45
+ }
46
+ return saveResult;
47
+ };
48
+ }
49
+ if(prop === 'clear') {
50
+ this._conditions.delete(target.column.key);
51
+ }
52
+ //@ts-ignore
53
+ if (typeof target[prop] === 'function') {
54
+ //@ts-ignore
55
+ return target[prop].bind(target);
56
+ }
57
+ //@ts-ignore
58
+ return target[prop];
59
+ },
60
+ });
61
+ await cond.init();
62
+ return cond;
63
+ }
64
+
65
+ private get _filterExpression() {
66
+ return structuredClone(this._grid.dataset.filtering.getFilter()) ?? {
67
+ conditions: [],
68
+ filterOperator: 0
69
+ }
70
+ }
71
+
72
+ private _getColumnKeyFromCondition(condition: ComponentFramework.PropertyHelper.DataSetApi.ConditionExpression) {
73
+ if (condition.entityAliasName) {
74
+ return `${condition.entityAliasName}.${condition.attributeName}`;
75
+ }
76
+ return condition.attributeName;
77
+ }
78
+ }
@@ -0,0 +1,190 @@
1
+ import { DatasetConditionOperator } from "../../core/enums/ConditionOperator";
2
+ import { OPERATORS } from "../constants";
3
+
4
+
5
+ export class FilteringUtils {
6
+ public static condition() {
7
+ return {
8
+ operator: (conditionOperator?: DatasetConditionOperator) => {
9
+ return {
10
+ textFieldOperators: (() => {
11
+ return OPERATORS.filter(operator => {
12
+ switch (operator.type) {
13
+ case DatasetConditionOperator.Equal:
14
+ case DatasetConditionOperator.NotEqual:
15
+ case DatasetConditionOperator.Like:
16
+ case DatasetConditionOperator.NotLike:
17
+ case DatasetConditionOperator.BeginWith:
18
+ case DatasetConditionOperator.DoesNotBeginWith:
19
+ case DatasetConditionOperator.EndsWith:
20
+ case DatasetConditionOperator.DoesNotEndWith:
21
+ case DatasetConditionOperator.NotNull:
22
+ case DatasetConditionOperator.Null: {
23
+ return true;
24
+ }
25
+ default: {
26
+ return false;
27
+ }
28
+ }
29
+ });
30
+ })(),
31
+ numberOperators: (() => {
32
+ return OPERATORS.filter(operator => {
33
+ switch (operator.type) {
34
+ case DatasetConditionOperator.Equal:
35
+ case DatasetConditionOperator.NotEqual:
36
+ case DatasetConditionOperator.GreaterThan:
37
+ case DatasetConditionOperator.GreaterEqual:
38
+ case DatasetConditionOperator.LessThan:
39
+ case DatasetConditionOperator.LessEqual:
40
+ case DatasetConditionOperator.Null:
41
+ return true;
42
+ default:
43
+ return false;
44
+ }
45
+ });
46
+ })(),
47
+ dateOperators: (() => {
48
+ return OPERATORS.filter(operator => {
49
+ switch (operator.type) {
50
+ case DatasetConditionOperator.On:
51
+ case DatasetConditionOperator.OnOrAfter:
52
+ case DatasetConditionOperator.OnOrBefore:
53
+ case DatasetConditionOperator.Today:
54
+ case DatasetConditionOperator.Yesterday:
55
+ case DatasetConditionOperator.Tomorrow:
56
+ case DatasetConditionOperator.ThisWeek:
57
+ case DatasetConditionOperator.ThisMonth:
58
+ case DatasetConditionOperator.ThisYear:
59
+ case DatasetConditionOperator.Next7Days:
60
+ case DatasetConditionOperator.NextXDays:
61
+ case DatasetConditionOperator.NextXMonths:
62
+ case DatasetConditionOperator.LastWeek:
63
+ case DatasetConditionOperator.Last7Days:
64
+ case DatasetConditionOperator.LastMonth:
65
+ case DatasetConditionOperator.LastYear:
66
+ case DatasetConditionOperator.LastXDays:
67
+ case DatasetConditionOperator.LastXMonths:
68
+ case DatasetConditionOperator.Null:
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ });
74
+ })(),
75
+ multipleOptionSetOperators: (() => {
76
+ return OPERATORS.filter(operator => {
77
+ switch (operator.type) {
78
+ case DatasetConditionOperator.Equal:
79
+ case DatasetConditionOperator.NotEqual:
80
+ case DatasetConditionOperator.ContainValues:
81
+ case DatasetConditionOperator.DoesNotContainValues:
82
+ case DatasetConditionOperator.Null:
83
+ case DatasetConditionOperator.NotNull:
84
+ return true;
85
+ default:
86
+ return false;
87
+ }
88
+ });
89
+ })(),
90
+ fileOperators: (() => {
91
+ return OPERATORS.filter(operator => {
92
+ switch (operator.type) {
93
+ case DatasetConditionOperator.Null:
94
+ case DatasetConditionOperator.NotNull:
95
+ return true;
96
+ default:
97
+ return false;
98
+ }
99
+ })
100
+ })(),
101
+ allowsOnlyFreeText: (() => {
102
+ switch (conditionOperator) {
103
+ case DatasetConditionOperator.BeginWith:
104
+ case DatasetConditionOperator.DoesNotBeginWith:
105
+ case DatasetConditionOperator.EndsWith:
106
+ case DatasetConditionOperator.DoesNotEndWith:
107
+ case DatasetConditionOperator.Like:
108
+ case DatasetConditionOperator.NotLike: {
109
+ return true;
110
+ }
111
+ }
112
+ return false;
113
+ })(),
114
+ allowsOnlyNumber: (() => {
115
+ switch (conditionOperator) {
116
+ case DatasetConditionOperator.LastXDays:
117
+ case DatasetConditionOperator.LastXMonths:
118
+ case DatasetConditionOperator.NextXMonths:
119
+ case DatasetConditionOperator.NextXDays: {
120
+ return true;
121
+ }
122
+ }
123
+ return false;
124
+ })(),
125
+ doesNotAllowValue: (() => {
126
+ switch (conditionOperator) {
127
+ case DatasetConditionOperator.Null:
128
+ case DatasetConditionOperator.NotNull:
129
+ case DatasetConditionOperator.Today:
130
+ case DatasetConditionOperator.Yesterday:
131
+ case DatasetConditionOperator.Tomorrow:
132
+ case DatasetConditionOperator.ThisWeek:
133
+ case DatasetConditionOperator.ThisMonth:
134
+ case DatasetConditionOperator.ThisYear:
135
+ case DatasetConditionOperator.LastWeek:
136
+ case DatasetConditionOperator.Last7Days:
137
+ case DatasetConditionOperator.LastMonth:
138
+ case DatasetConditionOperator.LastYear:
139
+ return true;
140
+ default:
141
+ return false;
142
+ }
143
+ })()
144
+ }
145
+ },
146
+ value: (conditionOperator: DatasetConditionOperator) => {
147
+ return {
148
+ isEditable: (() => {
149
+ switch (conditionOperator) {
150
+ case DatasetConditionOperator.Null:
151
+ case DatasetConditionOperator.NotNull:
152
+ case DatasetConditionOperator.Today:
153
+ case DatasetConditionOperator.Yesterday:
154
+ case DatasetConditionOperator.Tomorrow:
155
+ case DatasetConditionOperator.ThisMonth:
156
+ case DatasetConditionOperator.ThisWeek:
157
+ case DatasetConditionOperator.InFiscalPeriodAndYear:
158
+ case DatasetConditionOperator.Next7Days:
159
+ case DatasetConditionOperator.LastWeek:
160
+ case DatasetConditionOperator.Last7Days:
161
+ case DatasetConditionOperator.LastMonth:
162
+ case DatasetConditionOperator.LastYear: {
163
+ return false;
164
+ }
165
+ }
166
+ return true;
167
+ })(),
168
+ isManuallyEditable: (() => {
169
+ switch (conditionOperator) {
170
+ case DatasetConditionOperator.Like:
171
+ case DatasetConditionOperator.NotLike:
172
+ case DatasetConditionOperator.BeginWith:
173
+ case DatasetConditionOperator.DoesNotBeginWith:
174
+ case DatasetConditionOperator.EndsWith:
175
+ case DatasetConditionOperator.DoesNotEndWith:
176
+ case DatasetConditionOperator.LastXDays:
177
+ case DatasetConditionOperator.LastXMonths:
178
+ case DatasetConditionOperator.NextXMonths:
179
+ case DatasetConditionOperator.NextXDays:
180
+ {
181
+ return true;
182
+ }
183
+ }
184
+ return false;
185
+ })()
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
@@ -0,0 +1,109 @@
1
+ import { IDatasetProperty, IParameters, IStringProperty, ITwoOptionsProperty } from "../../interfaces";
2
+ import { IComponent, IOutputs, ITranslations } from "../../interfaces/context";
3
+
4
+ export interface IGrid extends IComponent<IGridParameters, IGridOutputs, IGridTranslations> {
5
+
6
+ }
7
+
8
+ export interface IEntityColumn extends ComponentFramework.PropertyHelper.DataSetApi.Column {
9
+ isResizable?: boolean;
10
+ isFilterable?: boolean;
11
+ isEditable?: boolean;
12
+ isRequired?: boolean;
13
+ }
14
+ export interface IEntityRecord extends ComponentFramework.PropertyHelper.DataSetApi.EntityRecord {
15
+ setValue: (columnName: string, value: any) => void;
16
+ save: () => Promise<void>;
17
+ }
18
+
19
+ export interface IGridParameters extends IParameters {
20
+ EnableEditing?: Omit<ITwoOptionsProperty, 'attributes'>;
21
+ EnablePagination?: Omit<ITwoOptionsProperty, 'attributes'>;
22
+ EnableFiltering?: Omit<ITwoOptionsProperty, 'attributes'>;
23
+ EnableSorting?: Omit<ITwoOptionsProperty, 'attributes'>;
24
+ EnableNavigation?: Omit<ITwoOptionsProperty, 'attributes'>;
25
+ IsNested?: Omit<ITwoOptionsProperty, 'attributes'>;
26
+ SelectableRows?: ComponentFramework.PropertyTypes.EnumProperty<"none" | "single" | "multiple">;
27
+ Grid: IDatasetProperty;
28
+ }
29
+
30
+ export interface IGridOutputs extends IOutputs {
31
+
32
+ }
33
+ export interface IGridTranslations extends ITranslations {
34
+ "condition-none": { [LCID: number]: string };
35
+ "condition-equal": { [LCID: number]: string };
36
+ "condition-notequal": { [LCID: number]: string };
37
+ "condition-greaterthan": { [LCID: number]: string };
38
+ "condition-lessthan": { [LCID: number]: string };
39
+ "condition-greaterequal": { [LCID: number]: string };
40
+ "condition-lessequal": { [LCID: number]: string };
41
+ "condition-like": { [LCID: number]: string };
42
+ "condition-notlike": { [LCID: number]: string };
43
+ "condition-null": { [LCID: number]: string };
44
+ "condition-notnull": { [LCID: number]: string };
45
+ "condition-beginwith": { [LCID: number]: string };
46
+ "condition-doesnotbeginwith": { [LCID: number]: string };
47
+ "condition-endswith": { [LCID: number]: string };
48
+ "condition-doesnotendwith": { [LCID: number]: string };
49
+ "condition-yesterday": { [LCID: number]: string };
50
+ "condition-today": { [LCID: number]: string };
51
+ "condition-tomorrow": { [LCID: number]: string };
52
+ "condition-last7days": { [LCID: number]: string };
53
+ "condition-next7days": { [LCID: number]: string };
54
+ "condition-lastweek": { [LCID: number]: string };
55
+ "condition-thisweek": { [LCID: number]: string };
56
+ "condition-lastmonth": { [LCID: number]: string };
57
+ "condition-thismonth": { [LCID: number]: string };
58
+ "condition-on": { [LCID: number]: string };
59
+ "condition-onorbefore": { [LCID: number]: string };
60
+ "condition-onorafter": { [LCID: number]: string };
61
+ "condition-lastyear": { [LCID: number]: string };
62
+ "condition-thisyear": { [LCID: number]: string };
63
+ "condition-lastxdays": { [LCID: number]: string };
64
+ "condition-nextxdays": { [LCID: number]: string };
65
+ "condition-lastxmonths": { [LCID: number]: string };
66
+ "condition-nextxmonths": { [LCID: number]: string };
67
+ "condition-contains": { [LCID: number]: string };
68
+ "condition-infiscalperiodandyear": { [LCID: number]: string };
69
+ "condition-above": { [LCID: number]: string };
70
+ "condition-under": { [LCID: number]: string };
71
+ "condition-notunder": { [LCID: number]: string };
72
+ "condition-aboveorequal": { [LCID: number]: string };
73
+ "condition-underorequal": { [LCID: number]: string };
74
+ "condition-containvalues": { [LCID: number]: string };
75
+ "condition-doesnotcontainvalues": { [LCID: number]: string };
76
+ "filtermenu-filterby": { [LCID: number]: string };
77
+ "filtermenu-applybutton": { [LCID: number]: string };
78
+ "filtermenu-clearbutton": { [LCID: number]: string };
79
+ "filtersortmenu-sorttext-a-z": { [LCID: number]: string };
80
+ "filtersortmenu-sorttext-z-a": { [LCID: number]: string };
81
+ "filtersortmenu-sortdate-a-z": { [LCID: number]: string };
82
+ "filtersortmenu-sortdate-z-a": { [LCID: number]: string };
83
+ "filtersortmenu-sortnumber-a-z": { [LCID: number]: string };
84
+ "filtersortmenu-sortnumber-z-a": { [LCID: number]: string };
85
+ "filtersortmenu-sorttwooption-a-z": { [LCID: number]: string };
86
+ "filtersortmenu-sorttwooption-z-a": { [LCID: number]: string };
87
+ "filtersortmenu-sorttwooption-joint": { [LCID: number]: string };
88
+ "filtersortmenu-filterby": { [LCID: number]: string };
89
+ "filtersortmenu-clearfilter": { [LCID: number]: string };
90
+ "paging-pages": { [LCID: number]: string };
91
+ "paging-of": { [LCID: number]: string };
92
+ "paging-firstpage": { [LCID: number]: string };
93
+ "paging-previouspage": { [LCID: number]: string };
94
+ "paging-page": { [LCID: number]: string };
95
+ "paging-nextpage": { [LCID: number]: string };
96
+ "paging-lastpage": { [LCID: number]: string };
97
+ "norecordsfound": { [LCID: number]: string };
98
+ "saving-changenotification": { [LCID: number]: string };
99
+ "saving-save": { [LCID: number]: string };
100
+ "saving-saving": { [LCID: number]: string };
101
+ "saving-changepreview-title": { [LCID: number]: string };
102
+ "saving-validation-error": { [LCID: number]: string };
103
+ "validation-input-value": { [LCID: number]: string };
104
+ "validation-email": { [LCID: number]: string };
105
+ "validation-url": { [LCID: number]: string };
106
+ "validation-date": { [LCID: number]: string };
107
+ "validation-number": { [LCID: number]: string };
108
+ "no-name": { [LCID: number]: string };
109
+ }