@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,90 @@
1
+ import { ITheme } from "@fluentui/react";
2
+ export declare const getTargetSelectorStyles: (theme: ITheme) => import("@fluentui/react").IProcessedStyleSet<{
3
+ targetSelector: {
4
+ display: string;
5
+ paddingLeft: number;
6
+ paddingRight: number;
7
+ paddingBottom: number;
8
+ gap: number;
9
+ paddingTop: number;
10
+ '>span': {
11
+ lineHeight: number;
12
+ minWidth: string;
13
+ color: string;
14
+ fontWeight: number;
15
+ };
16
+ };
17
+ targetSelectorLinks: {
18
+ display: string;
19
+ gap: number;
20
+ flexWrap: string;
21
+ };
22
+ targetSelectorLink: {
23
+ color: string;
24
+ '&[data-selected="true"]': {
25
+ color: string;
26
+ fontWeight: number;
27
+ };
28
+ };
29
+ }>;
30
+ export declare const getLookupStyles: (theme: ITheme, height: number, isSingleSelect: boolean) => import("@fluentui/react").IProcessedStyleSet<{
31
+ root: {
32
+ '[class*="TALXIS__tag-picker__search-btn"][class*="TALXIS__tag-picker__search-btn"]': {
33
+ top: number;
34
+ bottom: number;
35
+ margin: string;
36
+ right: number;
37
+ };
38
+ '[data-navigation-enabled="true"]': {
39
+ '> span > div > span': {
40
+ color: string;
41
+ cursor: string;
42
+ };
43
+ ':hover': {
44
+ textDecoration: string;
45
+ cursor: string;
46
+ };
47
+ };
48
+ '.ms-BasePicker-itemsWrapper .ms-CommandBar': {
49
+ height: number | undefined;
50
+ };
51
+ '.ms-BasePicker-text': {
52
+ minHeight: number;
53
+ height: string;
54
+ paddingRight: number | undefined;
55
+ alignItems: string;
56
+ input: {
57
+ alignSelf: string;
58
+ };
59
+ '.hover-only': {
60
+ animationName: string;
61
+ };
62
+ '::after': {
63
+ inset: string;
64
+ };
65
+ };
66
+ };
67
+ suggestions: {
68
+ '.ms-Suggestions-title': {
69
+ padding: number;
70
+ display: string;
71
+ flexDirection: string;
72
+ };
73
+ };
74
+ createRecordBtn: {
75
+ height: number;
76
+ width: string;
77
+ '.ms-Button-menuIcon': {
78
+ display: string;
79
+ };
80
+ '>.ms-Button-flexContainer.ms-Button-flexContainer': {
81
+ justifyContent: string;
82
+ };
83
+ '.ms-Button-textContainer': {
84
+ flexGrow: string;
85
+ '>span': {
86
+ fontWeight: number;
87
+ };
88
+ };
89
+ };
90
+ }>;
@@ -0,0 +1,2 @@
1
+ import { ILookupTranslations } from "./interfaces";
2
+ export declare const lookupTranslations: ILookupTranslations;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IMultiSelectOptionSet } from './interfaces';
3
+ export declare const MultiSelectOptionSet: (props: IMultiSelectOptionSet) => JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useComponent as o}from"../../hooks/useComponent.js";import{ComboBox as t}from"@talxis/react-components/dist/components/ComboBox";import{useRef as r,useEffect as l}from"react";import"fast-deep-equal/es6";import"merge-anything";import"liquidjs";const i=i=>{var a,n;const[s,d]=o("MultiSelectOptionSet",i),u=i.parameters,m=u.value,c=r(null),{Options:p}=u.value.attributes,v=i.context,g=p.map((e=>({key:e.Value.toString(),text:e.Label}))),f=e=>{if(!e)return void d({value:void 0});const o=e.key.toString(),t=new Set(m.raw||[]);e.selected?t.add(+o):t.delete(+o);const r=Array.from(t);d({value:r.map((e=>+e))})};return l((()=>{var e,o;(null===(e=u.AutoFocus)||void 0===e?void 0:e.raw)&&(null===(o=c.current)||void 0===o||o.focus(!0))}),[]),e(t,{componentRef:c,borderless:!1===(null===(a=u.EnableBorder)||void 0===a?void 0:a.raw),options:g,allowFreeInput:!0,multiSelect:!0,autoComplete:"on",autofill:!0===(null===(n=u.AutoFocus)||void 0===n?void 0:n.raw)?{autoFocus:!0}:void 0,readOnly:v.mode.isControlDisabled,errorMessage:m.errorMessage,selectedKey:m.raw?m.raw.map((e=>e.toString())):[-1],useComboBoxAsMenuWidth:!0,styles:{root:{height:v.mode.allocatedHeight||void 0,width:v.mode.allocatedWidth||void 0,display:"flex",alignItems:"center"},callout:{maxHeight:"300px !important"}},deleteButtonProps:{key:"delete",showOnlyOnHover:!1,iconProps:{iconName:"Delete"},onClick:(e,o)=>{f(null)}},onChange:(e,o)=>f(o)})};export{i as MultiSelectOptionSet};
@@ -0,0 +1,2 @@
1
+ export * from './MultiSelectOptionSet';
2
+ export * from './interfaces';
@@ -0,0 +1,11 @@
1
+ import { IMultiSelectOptionSetProperty } from "../../interfaces";
2
+ import { IComponent, IOutputs, ITranslations } from "../../interfaces/context";
3
+ import { IBaseParameters } from "../../interfaces/parameters";
4
+ export interface IMultiSelectOptionSet extends IComponent<IMultiSelectOptionSetParameters, IMultiSelectOptionSetOutputs, ITranslations> {
5
+ }
6
+ export interface IMultiSelectOptionSetParameters extends IBaseParameters {
7
+ value: IMultiSelectOptionSetProperty;
8
+ }
9
+ export interface IMultiSelectOptionSetOutputs extends IOutputs {
10
+ value?: number[];
11
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IOptionSet } from './interfaces';
3
+ export declare const OptionSet: (props: IOptionSet) => JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useComponent as o}from"../../hooks/useComponent.js";import{ComboBox as t}from"@talxis/react-components/dist/components/ComboBox";import{useRef as r,useEffect as i}from"react";import"fast-deep-equal/es6";import"merge-anything";import"liquidjs";const l=l=>{var n,a,s;const[d,m]=o("OptionSet",l),p=r(null),u=l.parameters,c=u.value,{Options:v}=u.value.attributes,h=l.context,g=v.map((e=>({key:e.Value.toString(),text:e.Label}))),x=e=>{let o;e&&(o=parseInt(e.key)),m({value:o})};return i((()=>{var e,o;(null===(e=u.AutoFocus)||void 0===e?void 0:e.raw)&&(null===(o=p.current)||void 0===o||o.focus(!0))}),[]),e(t,{componentRef:p,borderless:!1===(null===(n=u.EnableBorder)||void 0===n?void 0:n.raw),options:g,readOnly:h.mode.isControlDisabled,selectedKey:null!==(s=null===(a=c.raw)||void 0===a?void 0:a.toString())&&void 0!==s?s:-1,dropdownWidth:h.mode.allocatedWidth||void 0,errorMessage:c.errorMessage,useComboBoxAsMenuWidth:!0,styles:{root:{height:h.mode.allocatedHeight||void 0,width:h.mode.allocatedWidth||void 0,display:"flex",alignItems:"center"},callout:{maxHeight:"300px !important"}},deleteButtonProps:{key:"delete",showOnlyOnHover:!0,iconProps:{iconName:"Delete"},onClick:(e,o)=>{x(null)}},onChange:(e,o)=>x(o)})};export{l as OptionSet};
@@ -0,0 +1,2 @@
1
+ export * from './OptionSet';
2
+ export * from './interfaces';
@@ -0,0 +1,13 @@
1
+ import { IOptionSetProperty } from "../../interfaces";
2
+ import { IComponent, IOutputs, ITranslations } from "../../interfaces/context";
3
+ import { IBaseParameters } from "../../interfaces/parameters";
4
+ export interface IOptionSet extends IComponent<IOptionSetParameters, IOptionSetOutputs, IOptionSetTranslations> {
5
+ }
6
+ export interface IOptionSetParameters extends IBaseParameters {
7
+ value: IOptionSetProperty;
8
+ }
9
+ export interface IOptionSetOutputs extends IOutputs {
10
+ value?: number;
11
+ }
12
+ export interface IOptionSetTranslations extends ITranslations {
13
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ITextField } from './interfaces';
3
+ export declare const TextField: (props: ITextField) => JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{TextField as o}from"@talxis/react-components/dist/components/TextField";import{useRef as t,useState as r,useEffect as i}from"react";import{useInputBasedComponent as n}from"../../hooks/useInputBasedComponent.js";import"../../hooks/useComponent.js";import"fast-deep-equal/es6";import"merge-anything";import"liquidjs";const l=l=>{var s,a,d,u,v,c;const m=l.context,p=l.parameters,h=p.value,y=t(null),[w,x,b,g]=n("TextField",l),[f]=((e,o)=>{const n=t(!1),[l,s]=r(e.context.mode.allocatedHeight?e.context.mode.allocatedHeight:(null===(a=e.parameters.IsMultiLine)||void 0===a?void 0:a.raw)?80:void 0);var a;const d=t(!0);return i((()=>{var t,r;if(!(null===(t=e.parameters.IsMultiLine)||void 0===t?void 0:t.raw))return;const i=new ResizeObserver((()=>{d.current||n.current?d.current=!1:(n.current=!0,s(void 0))})),a=null===(r=o.current)||void 0===r?void 0:r.querySelector("textarea");return l&&a.setAttribute("style",`height: ${l}px`),i.observe(a),()=>{i.disconnect()}}),[]),[l]})(l,y);return e(o,{readOnly:m.mode.isControlDisabled,multiline:null===(s=p.IsMultiLine)||void 0===s?void 0:s.raw,resizable:null===(a=p.isResizable)||void 0===a?void 0:a.raw,autoFocus:null===(d=p.AutoFocus)||void 0===d?void 0:d.raw,elementRef:y,styles:{fieldGroup:{height:f,width:m.mode.allocatedWidth||void 0}},borderless:!1===(null===(u=p.EnableBorder)||void 0===u?void 0:u.raw),errorMessage:h.errorMessage,deleteButtonProps:!0===(null===(v=p.EnableDeleteButton)||void 0===v?void 0:v.raw)?{key:"delete",showOnlyOnHover:!0,iconProps:{iconName:"Delete"},onClick:()=>b(void 0)}:void 0,clickToCopyProps:!0===(null===(c=p.EnableCopyButton)||void 0===c?void 0:c.raw)?{key:"copy",showOnlyOnHover:!0,iconProps:{iconName:"Copy"}}:void 0,value:null!=w?w:"",onBlur:()=>{g({value:null!=w?w:void 0})},onChange:(e,o)=>{b(o)}})};export{l as TextField};
@@ -0,0 +1,2 @@
1
+ import { ITextField } from "../interfaces";
2
+ export declare const useTextField: (props: ITextField, ref: React.RefObject<HTMLDivElement>) => [number | undefined];
@@ -0,0 +1,2 @@
1
+ export * from './TextField';
2
+ export * from './interfaces';
@@ -0,0 +1,15 @@
1
+ import { IStringProperty, ITwoOptionsProperty } from "../../interfaces";
2
+ import { IComponent, IOutputs, ITranslations } from "../../interfaces/context";
3
+ import { IInputParameters } from "../../interfaces/parameters";
4
+ export interface ITextField extends IComponent<ITextFieldParameters, ITextFieldOutputs, ITextFieldTranslations> {
5
+ }
6
+ export interface ITextFieldParameters extends IInputParameters {
7
+ IsMultiLine?: ITwoOptionsProperty;
8
+ isResizable?: ITwoOptionsProperty;
9
+ value: IStringProperty;
10
+ }
11
+ export interface ITextFieldOutputs extends IOutputs {
12
+ value?: string;
13
+ }
14
+ export interface ITextFieldTranslations extends ITranslations {
15
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ITwoOptions } from './interfaces';
3
+ export declare const TwoOptions: (props: ITwoOptions) => JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{Toggle as o}from"@fluentui/react";import{useComponent as t}from"../../hooks/useComponent.js";import{useRef as i,useEffect as r}from"react";import"fast-deep-equal/es6";import"merge-anything";import"liquidjs";const n=n=>{var a,l;const u=n.parameters,d=u.value,m=d.attributes.Options,[s,c]=t("TwoOptions",n),p=n.context,f=i(null);r((()=>{var e;!0===(null===(e=u.AutoFocus)||void 0===e?void 0:e.raw)&&f.current.focus()}),[]);return e(o,{styles:{root:{height:p.mode.allocatedHeight||void 0,width:p.mode.allocatedWidth||void 0},container:{alignItems:"center"}},checked:d.raw,componentRef:f,inlineLabel:!0,onText:(null===(a=m.find((e=>1===e.Value)))||void 0===a?void 0:a.Label)||"Yes",offText:(null===(l=m.find((e=>0===e.Value)))||void 0===l?void 0:l.Label)||"No",onChange:(e,o)=>(e=>{c({value:e})})(o)})};export{n as TwoOptions};
@@ -0,0 +1,2 @@
1
+ export * from './TwoOptions';
2
+ export * from './interfaces';
@@ -0,0 +1,13 @@
1
+ import { ITwoOptionsProperty } from "../../interfaces";
2
+ import { IComponent, IOutputs, ITranslations } from "../../interfaces/context";
3
+ import { IBaseParameters } from "../../interfaces/parameters";
4
+ export interface ITwoOptions extends IComponent<ITwoOptionsParameters, ITwoOptionsOutputs, ITwoOptionsTranslations> {
5
+ }
6
+ export interface ITwoOptionsParameters extends IBaseParameters {
7
+ value: ITwoOptionsProperty;
8
+ }
9
+ export interface ITwoOptionsOutputs extends IOutputs {
10
+ value?: boolean;
11
+ }
12
+ export interface ITwoOptionsTranslations extends ITranslations {
13
+ }
@@ -0,0 +1 @@
1
+ export * from './useComponent';
@@ -0,0 +1 @@
1
+ export{useComponent}from"./useComponent.js";import"react";import"fast-deep-equal/es6";import"merge-anything";import"liquidjs";
@@ -0,0 +1,7 @@
1
+ import { IComponent, IOutputs, IParameters, ITranslations } from "../interfaces";
2
+ import { StringProps } from "../types";
3
+ /**
4
+ * Provides automatic checking if the given outputs are different from the provided inputs. Use the provided method any time you want
5
+ * to notify the framework that you wish to write changes. The hook will notify the framework only if the provided output differs from the current inputs.
6
+ */
7
+ export declare const useComponent: <TParameters extends IParameters, TOutputs extends IOutputs, TTranslations extends ITranslations>(name: string, props: IComponent<TParameters, TOutputs, TTranslations>, defaultTranslations?: TTranslations | undefined) => [Required<StringProps<TTranslations>>, (outputs: TOutputs) => void];
@@ -0,0 +1 @@
1
+ import{useRef as e,useMemo as n,useEffect as r}from"react";import t from"fast-deep-equal/es6";import{merge as o}from"merge-anything";import{Liquid as a}from"liquidjs";const l=(l,s,i)=>{const f=e(s.parameters),c=n((()=>new a),[]),u=n((()=>{var e;const n=o(null!=i?i:{},null!==(e=s.translations)&&void 0!==e?e:{});return new Proxy(n,{get:(e,r)=>e=>d(r,n,e)})}),[]);r((()=>{f.current=s.parameters}),[s.parameters]);const d=(e,n,r)=>{const t=e=>"string"==typeof e?e:JSON.stringify(e),o=n[e];if(!o)return console.error(`Translation for the ${e} label of the ${l} component has not been defined!`),e;if("string"==typeof o||Array.isArray(o))return t(o);let a=o[s.context.userSettings.languageId];return a||(console.info(`Translation for the ${e} label of the ${l} component has not been found. Using default Czech label instead.`),a=o[1029]),a||(console.error(`Translation for the ${e} label of the ${l} component does not exists neither for Czech language and current LCID.`),a=e),c.parseAndRenderSync(t(a),r)};return[u,e=>{var n,r;let o=!1;for(let[r,a]of Object.entries(e)){const e=null===(n=f.current[r])||void 0===n?void 0:n.raw;if(!t(e,a)){if(""===a&&(a=null),e==a)continue;o=!0;break}}o&&(null===(r=s.onNotifyOutputChanged)||void 0===r||r.call(s,e))}]};export{l as useComponent};
@@ -0,0 +1 @@
1
+ export declare const useFocusIn: (ref: React.RefObject<HTMLElement>) => boolean;
@@ -0,0 +1 @@
1
+ import{useState as e,useEffect as r}from"react";const n=n=>{const[t,o]=e(!1);return r((()=>{var e,r;const t=()=>{o(!0)},u=()=>{o(!1)};return null===(e=n.current)||void 0===e||e.addEventListener("focusin",t),null===(r=n.current)||void 0===r||r.addEventListener("focusout",u),()=>{var e,r;null===(e=n.current)||void 0===e||e.removeEventListener("focusin",t),null===(r=n.current)||void 0===r||r.removeEventListener("focusout",u)}}),[]),t};export{n as useFocusIn};
@@ -0,0 +1,32 @@
1
+ import { IComponent, IOutputs, ITranslations } from "../interfaces/context";
2
+ import { IInputParameters } from "../interfaces/parameters";
3
+ import { StringProps } from "../types";
4
+ /**
5
+ * Description
6
+ * @param {any} value:any
7
+ * @returns {any}
8
+ */
9
+ interface IComponentOptions<TTranslations> {
10
+ defaultTranslations?: TTranslations;
11
+ /**
12
+ * Formatting function that will format the bound value every time a new one comes from the props.
13
+ */
14
+ formatter?: (value: any) => any;
15
+ valueExtractor?: (value: any) => any;
16
+ }
17
+ /**
18
+ * Use when working with components that need to store value changes internally before triggering `notifyOutputChanged`.
19
+ * An example of this is a standard Decimal component - we do not want to trigger `notifyOutputChanged` on every value change,
20
+ * since this would trigger decimal validation on every keystroke which would result in a bad UX. In this case, the `notifyOutputChanged` should
21
+ * be triggered when the user looses focus on the component (`onBlur` event).
22
+ * @returns {[]} The hook returns an array with three props. First `value` prop is a value that will will always be in sync with the value that comes from the `value` parameter.
23
+ * Use this for displaying the up-to-date value to the user.
24
+ * Second prop contains the translations for this component.
25
+ *
26
+ * Third prop is a method that can be used to change the current value. The new value will get propagated to the `value` variable returned from this hook. This method wont propagate the value to the framework.
27
+ *
28
+ * The last prop is a method that will notify the framework that you wish to write changes.
29
+ * The method will notify the framework only if the provided output differs from the current inputs.
30
+ */
31
+ export declare const useInputBasedComponent: <TValue, TParameters extends IInputParameters, TOutputs extends IOutputs, TTranslations extends ITranslations>(name: string, props: IComponent<TParameters, TOutputs, TTranslations>, options?: IComponentOptions<TTranslations> | undefined) => [TValue, Required<StringProps<TTranslations>>, (value: TValue) => void, (outputs: TOutputs) => void];
32
+ export {};
@@ -0,0 +1 @@
1
+ import{useState as r,useRef as t,useEffect as n}from"react";import{useComponent as o}from"./useComponent.js";import"fast-deep-equal/es6";import"merge-anything";import"liquidjs";const e=(e,l,a)=>{var u;const{formatter:i,valueExtractor:s}=Object.assign({},a),m=l.parameters.value.raw,[v,d]=r(null!==(u=null==i?void 0:i(m))&&void 0!==u?u:m),p=t(m),[c,f]=o(e,l,null==a?void 0:a.defaultTranslations);return n((()=>{const r=null==i?void 0:i(m);d(null!=r?r:m)}),[m]),n((()=>{p.current=v}),[v]),n((()=>()=>{var r,t;!0===(null===(r=l.parameters.NotifyOutputChangedOnUnmount)||void 0===r?void 0:r.raw)&&f({value:null!==(t=null==s?void 0:s(p.current))&&void 0!==t?t:p.current})}),[]),[v,c,d,f]};export{e as useInputBasedComponent};
@@ -0,0 +1 @@
1
+ export declare const useMouseOver: (ref: React.RefObject<HTMLElement>) => boolean;
@@ -0,0 +1 @@
1
+ import{useState as e,useEffect as r}from"react";const n=n=>{const[t,o]=e(!1);return r((()=>{var e,r;const t=()=>{o(!0)},u=()=>{o(!1)};return null===(e=n.current)||void 0===e||e.addEventListener("mouseenter",t),null===(r=n.current)||void 0===r||r.addEventListener("mouseleave",u),()=>{var e,r;null===(e=n.current)||void 0===e||e.removeEventListener("mouseenter",t),null===(r=n.current)||void 0===r||r.removeEventListener("mouseleave",u)}}),[]),t};export{n as useMouseOver};
@@ -0,0 +1,40 @@
1
+ /// <reference types="@types/powerapps-component-framework" />
2
+ interface IComponent<TParameters, TOutputs, TTranslations> {
3
+ context: ComponentFramework.Context<TParameters>;
4
+ parameters: TParameters;
5
+ translations?: TTranslations;
6
+ state?: ComponentFramework.Dictionary;
7
+ /**
8
+ * Fires when the component changes the parameter value. It is usually fired directly after the change occurs in the value.
9
+ * Exceptions are input based component where it fires on the blur event.
10
+ */
11
+ onNotifyOutputChanged?: (outputs: TOutputs) => void;
12
+ }
13
+ interface ITranslations {
14
+ [key: string]: {
15
+ [LCID: number]: string | string[];
16
+ } | undefined;
17
+ }
18
+
19
+ type ExcludedProps = Pick<ComponentFramework.PropertyTypes.Property, 'formatted'>;
20
+ interface IProperty extends Omit<Partial<ComponentFramework.PropertyTypes.Property>, keyof ExcludedProps | 'attributes'> {
21
+ }
22
+
23
+ interface IOutputs {
24
+ [key: string]: any;
25
+ }
26
+ interface IParameters {
27
+ [key: string]: IProperty | undefined;
28
+ }
29
+
30
+ type StringProps<T> = {
31
+ [Property in keyof T]: (variables?: any) => string;
32
+ };
33
+
34
+ /**
35
+ * Provides automatic checking if the given outputs are different from the provided inputs. Use the provided method any time you want
36
+ * to notify the framework that you wish to write changes. The hook will notify the framework only if the provided output differs from the current inputs.
37
+ */
38
+ declare const useComponent: <TParameters extends IParameters, TOutputs extends IOutputs, TTranslations extends ITranslations>(name: string, props: IComponent<TParameters, TOutputs, TTranslations>, defaultTranslations?: TTranslations | undefined) => [Required<StringProps<TTranslations>>, (outputs: TOutputs) => void];
39
+
40
+ export { useComponent };
@@ -0,0 +1,20 @@
1
+ /// <reference types="@types/powerapps-component-framework" />
2
+ export interface IOutputs {
3
+ [key: string]: any;
4
+ }
5
+ export interface IComponent<TParameters, TOutputs, TTranslations> {
6
+ context: ComponentFramework.Context<TParameters>;
7
+ parameters: TParameters;
8
+ translations?: TTranslations;
9
+ state?: ComponentFramework.Dictionary;
10
+ /**
11
+ * Fires when the component changes the parameter value. It is usually fired directly after the change occurs in the value.
12
+ * Exceptions are input based component where it fires on the blur event.
13
+ */
14
+ onNotifyOutputChanged?: (outputs: TOutputs) => void;
15
+ }
16
+ export interface ITranslations {
17
+ [key: string]: {
18
+ [LCID: number]: string | string[];
19
+ } | undefined;
20
+ }
@@ -0,0 +1,9 @@
1
+ import { IProperty } from './property';
2
+ export * from './context';
3
+ export * from './property';
4
+ export interface IOutputs {
5
+ [key: string]: any;
6
+ }
7
+ export interface IParameters {
8
+ [key: string]: IProperty | undefined;
9
+ }
@@ -0,0 +1,23 @@
1
+ import { IProperty, ITwoOptionsProperty } from "./property";
2
+ export interface IParameters {
3
+ [key: string]: IProperty | undefined;
4
+ }
5
+ export interface IInputParameters extends IBaseParameters {
6
+ value: IProperty;
7
+ /**
8
+ * Tells the component to trigger `notifyOutputChanged` on it's unmount changes occured in bound parameter value.
9
+ * Should only be use in edge cases in input based components where the notifyOutputChanged cannot be called naturally via the blur event.
10
+ */
11
+ NotifyOutputChangedOnUnmount?: Omit<ITwoOptionsProperty, 'attributes'>;
12
+ EnableCopyButton?: Omit<ITwoOptionsProperty, 'attributes'>;
13
+ EnableDeleteButton?: Omit<ITwoOptionsProperty, 'attributes'>;
14
+ }
15
+ export interface IBaseParameters extends IParameters {
16
+ /** default `true` */
17
+ EnableBorder?: Omit<ITwoOptionsProperty, 'attributes'>;
18
+ /**
19
+ * Decides whether the input should get focus on first render.
20
+ */
21
+ AutoFocus?: Omit<ITwoOptionsProperty, 'attributes'>;
22
+ ForceDisable?: Omit<ITwoOptionsProperty, 'attributes'>;
23
+ }
@@ -0,0 +1,100 @@
1
+ /// <reference types="@types/powerapps-component-framework" />
2
+ import { IEntityColumn, IEntityRecord } from "../components/Grid/interfaces";
3
+ type ExcludedProps = Pick<ComponentFramework.PropertyTypes.Property, 'formatted'>;
4
+ export interface IProperty extends Omit<Partial<ComponentFramework.PropertyTypes.Property>, keyof ExcludedProps | 'attributes'> {
5
+ }
6
+ export interface IStringProperty extends IProperty, Partial<ComponentFramework.PropertyTypes.StringProperty> {
7
+ raw: string | null;
8
+ }
9
+ export interface ITwoOptionsProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.TwoOptionsProperty>, 'attributes'> {
10
+ raw: boolean;
11
+ attributes: Omit<Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.OptionSetMetadata>, 'DefaultValue'> & {
12
+ Options: [ComponentFramework.PropertyHelper.OptionMetadata, ComponentFramework.PropertyHelper.OptionMetadata];
13
+ };
14
+ }
15
+ export interface IDecimalNumberProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.DecimalNumberProperty>, 'attributes'> {
16
+ raw: number | null;
17
+ type: 'Whole.None' | 'Decimal' | 'Currency';
18
+ formatted?: string;
19
+ attributes?: Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.DecimalNumberMetadata>;
20
+ }
21
+ export interface IWholeNumberProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.WholeNumberProperty>, 'attributes'> {
22
+ raw: number | null;
23
+ }
24
+ export interface IDateTimeProperty extends IProperty, Partial<ComponentFramework.PropertyTypes.DateTimeProperty> {
25
+ raw: Date | null;
26
+ attributes: Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.DateTimeMetadata> & {
27
+ Behavior: ComponentFramework.FormattingApi.Types.DateTimeFieldBehavior;
28
+ Format: string;
29
+ };
30
+ }
31
+ export interface IOptionSetProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.OptionSetProperty>, 'attributes'> {
32
+ raw: number | null;
33
+ attributes: Omit<Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.OptionSetMetadata>, 'DefaultValue'> & {
34
+ Options: ComponentFramework.PropertyHelper.OptionMetadata[];
35
+ };
36
+ }
37
+ export interface ITwoOptionsProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.TwoOptionsProperty>, 'attributes'> {
38
+ raw: boolean;
39
+ attributes: Omit<Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.OptionSetMetadata>, 'DefaultValue'> & {
40
+ Options: [ComponentFramework.PropertyHelper.OptionMetadata, ComponentFramework.PropertyHelper.OptionMetadata];
41
+ };
42
+ }
43
+ export interface IMultiSelectOptionSetProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.MultiSelectOptionSetProperty>, 'attributes'> {
44
+ raw: number[] | null;
45
+ attributes: Omit<Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.OptionSetMetadata>, 'DefaultValue'> & {
46
+ Options: ComponentFramework.PropertyHelper.OptionMetadata[];
47
+ };
48
+ }
49
+ export interface ILookupProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.LookupProperty>, 'attributes' | 'getViewId'> {
50
+ raw: ComponentFramework.LookupValue[];
51
+ attributes: Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.LookupMetadata> & {
52
+ Targets: string[];
53
+ };
54
+ /**
55
+ * Returns the default lookup viewId. Works only for Microsoft PCF's
56
+ */
57
+ getDefaultViewId: (entityName: string) => string;
58
+ /**
59
+ * Gets all views for entity (including non-lookup ones).
60
+ */
61
+ getAllViews: (entityName: string) => Promise<{
62
+ isAvailableInOffline: boolean;
63
+ isDefault: boolean;
64
+ isPinned: boolean;
65
+ isUserView: boolean;
66
+ relatedEntityName: string;
67
+ viewId: string;
68
+ viewName: string;
69
+ fetchXml?: string;
70
+ }[]>;
71
+ }
72
+ export interface IDatasetProperty extends IProperty, Omit<ComponentFramework.PropertyTypes.DataSet, 'error' | 'errorMessage'> {
73
+ columns: IEntityColumn[];
74
+ records: {
75
+ [id: string]: IEntityRecord;
76
+ };
77
+ paging: ComponentFramework.PropertyHelper.DataSetApi.Paging & {
78
+ pageNumber: number;
79
+ };
80
+ retrieveRecordCommand: (recordIds: string[], specificCommands?: string[], filterByPriority?: boolean, useNestedFormat?: boolean, refreshAllRules?: boolean) => {
81
+ canExecute: boolean;
82
+ /**
83
+ * Seems to be always empty - buttons present in Flyout and SplitButton are put on first level (the array of buttons is flattened).
84
+ */
85
+ children: any[];
86
+ commandId: string;
87
+ commandButtonId: string;
88
+ controlType: any;
89
+ icon: string;
90
+ label: string;
91
+ shouldBeVisible: boolean;
92
+ tooltip: string;
93
+ /**
94
+ * Temp portal property
95
+ */
96
+ __isInline?: boolean;
97
+ execute: () => Promise<void>;
98
+ }[];
99
+ }
100
+ export {};
@@ -0,0 +1,3 @@
1
+ export type StringProps<T> = {
2
+ [Property in keyof T]: (variables?: any) => string;
3
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="@types/powerapps-component-framework" />
2
+ export declare class NumeralPCF {
3
+ static decimal(formatting: ComponentFramework.UserSettingApi.NumberFormattingInfo): void;
4
+ static currency(formatting: ComponentFramework.UserSettingApi.NumberFormattingInfo): void;
5
+ private static get _locales();
6
+ }
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <manifest>
3
+ <control namespace="TALXIS.PCF" constructor="Currency" version="0.0.1" display-name-key="Currency" description-key="Currency description" control-type="standard" >
4
+ <!--external-service-usage node declares whether this 3rd party PCF control is using external service or not, if yes, this control will be considered as premium and please also add the external domain it is using.
5
+ If it is not using any external service, please set the enabled="false" and DO NOT add any domain below. The "enabled" will be false by default.
6
+ Example1:
7
+ <external-service-usage enabled="true">
8
+ <domain>www.Microsoft.com</domain>
9
+ </external-service-usage>
10
+ Example2:
11
+ <external-service-usage enabled="false">
12
+ </external-service-usage>
13
+ -->
14
+ <external-service-usage enabled="false">
15
+ <!--UNCOMMENT TO ADD EXTERNAL DOMAINS
16
+ <domain></domain>
17
+ <domain></domain>
18
+ -->
19
+ </external-service-usage>
20
+ <!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
21
+ <property name="value" display-name-key="Property_Display_Key" description-key="Property_Desc_Key" of-type="Currency" usage="bound" required="true" />
22
+ <!--
23
+ Property node's of-type attribute can be of-type-group attribute.
24
+ Example:
25
+ <type-group name="numbers">
26
+ <type>Whole.None</type>
27
+ <type>Currency</type>
28
+ <type>FP</type>
29
+ <type>Decimal</type>
30
+ </type-group>
31
+ <property name="sampleProperty" display-name-key="Property_Display_Key" description-key="Property_Desc_Key" of-type-group="numbers" usage="bound" required="true" />
32
+ -->
33
+ <resources>
34
+ <code path="index.ts" order="1"/>
35
+ <!-- UNCOMMENT TO ADD MORE RESOURCES
36
+ <css path="css/Currency.css" order="1" />
37
+ <resx path="strings/Currency.1033.resx" version="1.0.0" />
38
+ -->
39
+ </resources>
40
+ <!-- UNCOMMENT TO ENABLE THE SPECIFIED API
41
+ <feature-usage>
42
+ <uses-feature name="Device.captureAudio" required="true" />
43
+ <uses-feature name="Device.captureImage" required="true" />
44
+ <uses-feature name="Device.captureVideo" required="true" />
45
+ <uses-feature name="Device.getBarcodeValue" required="true" />
46
+ <uses-feature name="Device.getCurrentPosition" required="true" />
47
+ <uses-feature name="Device.pickFile" required="true" />
48
+ <uses-feature name="Utility" required="true" />
49
+ <uses-feature name="WebAPI" required="true" />
50
+ </feature-usage>
51
+ -->
52
+ </control>
53
+ </manifest>
@@ -0,0 +1,66 @@
1
+ import { IInputs, IOutputs } from "./generated/ManifestTypes";
2
+ import * as ReactDOM from 'react-dom';
3
+ import * as React from 'react';
4
+ import { Decimal as DecimalComponent } from '../../../src/components/Decimal/Decimal';
5
+ import { IDecimal } from '../../../src/components/Decimal/interfaces';
6
+
7
+ export class Currency implements ComponentFramework.StandardControl<IInputs, IOutputs> {
8
+
9
+ private _notifyOutputChanged: () => void;
10
+ private _container: HTMLDivElement;
11
+ private _outputs: IOutputs = {};
12
+ constructor()
13
+ {
14
+
15
+ }
16
+
17
+ /**
18
+ * Used to initialize the control instance. Controls can kick off remote server calls and other initialization actions here.
19
+ * Data-set values are not initialized here, use updateView.
20
+ * @param context The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to property names defined in the manifest, as well as utility functions.
21
+ * @param notifyOutputChanged A callback method to alert the framework that the control has new outputs ready to be retrieved asynchronously.
22
+ * @param state A piece of data that persists in one session for a single user. Can be set at any point in a controls life cycle by calling 'setControlState' in the Mode interface.
23
+ * @param container If a control is marked control-type='standard', it will receive an empty div element within which it can render its content.
24
+ */
25
+ public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement): void
26
+ {
27
+ this._notifyOutputChanged = notifyOutputChanged;
28
+ this._container = container;
29
+ // Add control initialization code
30
+ }
31
+ /**
32
+ * Called when any value in the property bag has changed. This includes field values, data-sets, global values such as container height and width, offline status, control metadata values such as label, visible, etc.
33
+ * @param context The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to names defined in the manifest, as well as utility functions
34
+ */
35
+ public updateView(context: ComponentFramework.Context<IInputs>): void
36
+ {
37
+ ReactDOM.render(React.createElement(DecimalComponent as any, {
38
+ context: context,
39
+ parameters: {
40
+ value: context.parameters.value
41
+ },
42
+ onNotifyOutputChanged: (outputs) => {
43
+ this._outputs = outputs;
44
+ this._notifyOutputChanged();
45
+ }
46
+ } as IDecimal), this._container);
47
+ }
48
+
49
+ /**
50
+ * It is called by the framework prior to a control receiving new data.
51
+ * @returns an object based on nomenclature defined in manifest, expecting object[s] for property marked as "bound" or "output"
52
+ */
53
+ public getOutputs(): IOutputs
54
+ {
55
+ return this._outputs;
56
+ }
57
+
58
+ /**
59
+ * Called when the control is to be removed from the DOM tree. Controls should use this call for cleanup.
60
+ * i.e. cancelling any pending remote calls, removing listeners, etc.
61
+ */
62
+ public destroy(): void
63
+ {
64
+ // Add code to cleanup control if necessary
65
+ }
66
+ }