@talxis/base-controls 1.2501.10 → 1.2503.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/dist/components/DatasetControl/DatasetControl.js +21 -34
  2. package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
  3. package/dist/components/DatasetControl/ErrorBoundary.js +33 -0
  4. package/dist/components/DatasetControl/ErrorBoundary.js.map +1 -0
  5. package/dist/components/DatasetControl/QuickFind/QuickFind.d.ts +10 -0
  6. package/dist/components/DatasetControl/QuickFind/QuickFind.js +38 -0
  7. package/dist/components/DatasetControl/QuickFind/QuickFind.js.map +1 -0
  8. package/dist/components/DatasetControl/styles.d.ts +3 -1
  9. package/dist/components/DatasetControl/styles.js +2 -2
  10. package/dist/components/DatasetControl/styles.js.map +1 -1
  11. package/dist/components/DatasetControl/translations.d.ts +8 -0
  12. package/dist/components/DatasetControl/translations.js +3 -1
  13. package/dist/components/DatasetControl/translations.js.map +1 -1
  14. package/dist/components/DateTime/DateTime.js +2 -1
  15. package/dist/components/DateTime/DateTime.js.map +1 -1
  16. package/dist/components/DateTime/components/Calendar.d.ts +2 -1
  17. package/dist/components/DateTime/components/Calendar.js +4 -4
  18. package/dist/components/DateTime/components/Calendar.js.map +1 -1
  19. package/dist/components/DateTime/hooks/useDateTime.js +18 -17
  20. package/dist/components/DateTime/hooks/useDateTime.js.map +1 -1
  21. package/dist/components/DateTime/translations.d.ts +1 -1
  22. package/dist/components/Decimal/Decimal.js +5 -1
  23. package/dist/components/Decimal/Decimal.js.map +1 -1
  24. package/dist/components/Duration/Duration.js +49 -26
  25. package/dist/components/Duration/Duration.js.map +1 -1
  26. package/dist/components/Duration/durationOptions.d.ts +1 -1
  27. package/dist/components/Grid/Grid.js +1 -1
  28. package/dist/components/Grid/Grid.js.map +1 -1
  29. package/dist/components/Grid/core/components/AgGrid/AgGrid.js +78 -174
  30. package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
  31. package/dist/components/Grid/core/components/AgGrid/context.d.ts +3 -0
  32. package/dist/components/Grid/core/components/AgGrid/context.js +6 -0
  33. package/dist/components/Grid/core/components/AgGrid/context.js.map +1 -0
  34. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +41 -6
  35. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +235 -49
  36. package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -1
  37. package/dist/components/Grid/core/components/AgGrid/model/Comparator.d.ts +9 -0
  38. package/dist/components/Grid/core/components/AgGrid/model/Comparator.js +86 -0
  39. package/dist/components/Grid/core/components/AgGrid/model/Comparator.js.map +1 -0
  40. package/dist/components/Grid/core/components/AgGrid/styles.d.ts +28 -32
  41. package/dist/components/Grid/core/components/AgGrid/styles.js +31 -35
  42. package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -1
  43. package/dist/components/Grid/core/components/Cell/Cell.d.ts +13 -0
  44. package/dist/components/Grid/core/components/Cell/Cell.js +145 -0
  45. package/dist/components/Grid/core/components/Cell/Cell.js.map +1 -0
  46. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.d.ts +3 -0
  47. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js +212 -0
  48. package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js.map +1 -0
  49. package/dist/components/Grid/core/components/Cell/CellContent/styles.d.ts +33 -0
  50. package/dist/components/Grid/core/components/Cell/CellContent/styles.js +39 -0
  51. package/dist/components/Grid/core/components/Cell/CellContent/styles.js.map +1 -0
  52. package/dist/components/Grid/core/components/Cell/Commands/Commands.js.map +1 -1
  53. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.d.ts +12 -0
  54. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js +112 -0
  55. package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js.map +1 -0
  56. package/dist/components/Grid/core/components/Cell/Notifications/styles.d.ts +39 -0
  57. package/dist/components/Grid/core/components/Cell/Notifications/styles.js +46 -0
  58. package/dist/components/Grid/core/components/Cell/Notifications/styles.js.map +1 -0
  59. package/dist/components/Grid/core/components/Cell/styles.d.ts +40 -0
  60. package/dist/components/Grid/core/components/Cell/styles.js +59 -0
  61. package/dist/components/Grid/core/components/Cell/styles.js.map +1 -0
  62. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +3 -2
  63. package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -1
  64. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js +31 -13
  65. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js.map +1 -1
  66. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.d.ts +3 -2
  67. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js +5 -4
  68. package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js.map +1 -1
  69. package/dist/components/Grid/core/components/ColumnHeader/styles.d.ts +3 -1
  70. package/dist/components/Grid/core/components/ColumnHeader/styles.js +4 -2
  71. package/dist/components/Grid/core/components/ColumnHeader/styles.js.map +1 -1
  72. package/dist/components/Grid/core/components/Save/Save.js +5 -6
  73. package/dist/components/Grid/core/components/Save/Save.js.map +1 -1
  74. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js +10 -7
  75. package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js.map +1 -1
  76. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.d.ts +1 -0
  77. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +26 -7
  78. package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -1
  79. package/dist/components/Grid/core/controllers/useGridController.js +8 -2
  80. package/dist/components/Grid/core/controllers/useGridController.js.map +1 -1
  81. package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +2 -0
  82. package/dist/components/Grid/core/model/Grid.d.ts +17 -8
  83. package/dist/components/Grid/core/model/Grid.js +229 -45
  84. package/dist/components/Grid/core/model/Grid.js.map +1 -1
  85. package/dist/components/Grid/core/model/GridDependency.d.ts +1 -1
  86. package/dist/components/Grid/core/model/Metadata.d.ts +3 -2
  87. package/dist/components/Grid/core/services/KeyListener.d.ts +2 -0
  88. package/dist/components/Grid/core/services/KeyListener.js +6 -3
  89. package/dist/components/Grid/core/services/KeyListener.js.map +1 -1
  90. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js +3 -3
  91. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js.map +1 -1
  92. package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +19 -7
  93. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.d.ts +2 -2
  94. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.js +9 -9
  95. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.js.map +1 -0
  96. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.d.ts +2 -2
  97. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.js +1 -1
  98. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.js.map +1 -0
  99. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.d.ts +2 -2
  100. package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.js +15 -19
  101. package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.js.map +1 -0
  102. package/dist/components/Grid/filtering/model/Condition.d.ts +1 -1
  103. package/dist/components/Grid/filtering/model/Condition.js +1 -1
  104. package/dist/components/Grid/filtering/model/Condition.js.map +1 -1
  105. package/dist/components/Grid/interfaces.d.ts +1 -1
  106. package/dist/components/Grid/selection/model/Selection.d.ts +3 -4
  107. package/dist/components/Grid/selection/model/Selection.js +8 -26
  108. package/dist/components/Grid/selection/model/Selection.js.map +1 -1
  109. package/dist/components/Grid/sorting/Sorting.d.ts +1 -1
  110. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +1 -1
  111. package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -1
  112. package/dist/components/Grid/sorting/controllers/useColumnSortingController.d.ts +1 -1
  113. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.d.ts +2 -0
  114. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js +11 -0
  115. package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js.map +1 -0
  116. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.d.ts +1 -0
  117. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js +2 -0
  118. package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js.map +1 -0
  119. package/dist/components/GridCellRenderer/GridCellRenderer.d.ts +3 -0
  120. package/dist/components/GridCellRenderer/GridCellRenderer.js +252 -0
  121. package/dist/components/GridCellRenderer/GridCellRenderer.js.map +1 -0
  122. package/dist/components/GridCellRenderer/OptionSet/OptionSet.d.ts +5 -0
  123. package/dist/components/GridCellRenderer/OptionSet/OptionSet.js +69 -0
  124. package/dist/components/GridCellRenderer/OptionSet/OptionSet.js.map +1 -0
  125. package/dist/components/GridCellRenderer/OptionSet/index.d.ts +1 -0
  126. package/dist/components/GridCellRenderer/OptionSet/index.js +2 -0
  127. package/dist/components/GridCellRenderer/OptionSet/index.js.map +1 -0
  128. package/dist/components/{Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet → GridCellRenderer/OptionSet}/styles.d.ts +10 -12
  129. package/dist/components/GridCellRenderer/OptionSet/styles.js +29 -0
  130. package/dist/components/GridCellRenderer/OptionSet/styles.js.map +1 -0
  131. package/dist/components/GridCellRenderer/index.d.ts +1 -0
  132. package/dist/components/GridCellRenderer/index.js +2 -0
  133. package/dist/components/GridCellRenderer/index.js.map +1 -0
  134. package/dist/components/GridCellRenderer/interfaces.d.ts +53 -0
  135. package/dist/components/GridCellRenderer/styles.d.ts +72 -0
  136. package/dist/components/GridCellRenderer/styles.js +105 -0
  137. package/dist/components/GridCellRenderer/styles.js.map +1 -0
  138. package/dist/components/GridCellRenderer/translations.d.ts +6 -0
  139. package/dist/components/GridCellRenderer/translations.js +11 -0
  140. package/dist/components/GridCellRenderer/translations.js.map +1 -0
  141. package/dist/components/GridCellRenderer/useComponentProps.d.ts +6 -0
  142. package/dist/components/GridCellRenderer/useComponentProps.js +10 -0
  143. package/dist/components/GridCellRenderer/useComponentProps.js.map +1 -0
  144. package/dist/components/Lookup/Lookup.js +8 -3
  145. package/dist/components/Lookup/Lookup.js.map +1 -1
  146. package/dist/components/Lookup/hooks/useFetchXml.d.ts +1 -1
  147. package/dist/components/Lookup/hooks/useLookup.d.ts +1 -1
  148. package/dist/components/Lookup/interfaces.d.ts +1 -1
  149. package/dist/components/Lookup/styles.d.ts +19 -7
  150. package/dist/components/Lookup/styles.js +22 -8
  151. package/dist/components/Lookup/styles.js.map +1 -1
  152. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js +51 -28
  153. package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js.map +1 -1
  154. package/dist/components/NestedControlRenderer/NestedControl.d.ts +86 -0
  155. package/dist/components/NestedControlRenderer/NestedControl.js +456 -0
  156. package/dist/components/NestedControlRenderer/NestedControl.js.map +1 -0
  157. package/dist/components/NestedControlRenderer/NestedControlError.d.ts +4 -0
  158. package/dist/components/NestedControlRenderer/NestedControlError.js +13 -0
  159. package/dist/components/NestedControlRenderer/NestedControlError.js.map +1 -0
  160. package/dist/components/NestedControlRenderer/NestedControlRenderer.d.ts +3 -0
  161. package/dist/components/NestedControlRenderer/NestedControlRenderer.js +194 -0
  162. package/dist/components/NestedControlRenderer/NestedControlRenderer.js.map +1 -0
  163. package/dist/components/NestedControlRenderer/index.d.ts +1 -0
  164. package/dist/components/NestedControlRenderer/index.js +2 -0
  165. package/dist/components/NestedControlRenderer/index.js.map +1 -0
  166. package/dist/components/NestedControlRenderer/interfaces.d.ts +118 -0
  167. package/dist/components/NestedControlRenderer/manifest/Control.d.ts +16 -0
  168. package/dist/components/NestedControlRenderer/manifest/Control.js +40 -0
  169. package/dist/components/NestedControlRenderer/manifest/Control.js.map +1 -0
  170. package/dist/components/NestedControlRenderer/manifest/Manifest.d.ts +5 -0
  171. package/dist/components/NestedControlRenderer/manifest/Manifest.js +12 -0
  172. package/dist/components/NestedControlRenderer/manifest/Manifest.js.map +1 -0
  173. package/dist/components/NestedControlRenderer/manifest/TypeGroup.d.ts +6 -0
  174. package/dist/components/NestedControlRenderer/manifest/TypeGroup.js +13 -0
  175. package/dist/components/NestedControlRenderer/manifest/TypeGroup.js.map +1 -0
  176. package/dist/components/NestedControlRenderer/manifest/index.d.ts +1 -0
  177. package/dist/components/NestedControlRenderer/manifest/index.js +2 -0
  178. package/dist/components/NestedControlRenderer/manifest/index.js.map +1 -0
  179. package/dist/components/NestedControlRenderer/manifest/property/Property.d.ts +16 -0
  180. package/dist/components/NestedControlRenderer/manifest/property/Property.js +34 -0
  181. package/dist/components/NestedControlRenderer/manifest/property/Property.js.map +1 -0
  182. package/dist/components/NestedControlRenderer/manifest/property/Value.d.ts +8 -0
  183. package/dist/components/NestedControlRenderer/manifest/property/Value.js +12 -0
  184. package/dist/components/NestedControlRenderer/manifest/property/Value.js.map +1 -0
  185. package/dist/components/NestedControlRenderer/properties/DateProperty.d.ts +5 -0
  186. package/dist/components/NestedControlRenderer/properties/DateProperty.js +22 -0
  187. package/dist/components/NestedControlRenderer/properties/DateProperty.js.map +1 -0
  188. package/dist/components/NestedControlRenderer/properties/FileProperty.d.ts +5 -0
  189. package/dist/components/NestedControlRenderer/properties/FileProperty.js +16 -0
  190. package/dist/components/NestedControlRenderer/properties/FileProperty.js.map +1 -0
  191. package/dist/components/NestedControlRenderer/properties/LookupProperty.d.ts +6 -0
  192. package/dist/components/NestedControlRenderer/properties/LookupProperty.js +36 -0
  193. package/dist/components/NestedControlRenderer/properties/LookupProperty.js.map +1 -0
  194. package/dist/components/NestedControlRenderer/properties/NumberProperty.d.ts +5 -0
  195. package/dist/components/NestedControlRenderer/properties/NumberProperty.js +17 -0
  196. package/dist/components/NestedControlRenderer/properties/NumberProperty.js.map +1 -0
  197. package/dist/components/NestedControlRenderer/properties/OptionSetProperty.d.ts +5 -0
  198. package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js +23 -0
  199. package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js.map +1 -0
  200. package/dist/components/NestedControlRenderer/properties/Property.d.ts +16 -0
  201. package/dist/components/NestedControlRenderer/properties/Property.js +41 -0
  202. package/dist/components/NestedControlRenderer/properties/Property.js.map +1 -0
  203. package/dist/components/NestedControlRenderer/properties/TextProperty.d.ts +5 -0
  204. package/dist/components/NestedControlRenderer/properties/TextProperty.js +15 -0
  205. package/dist/components/NestedControlRenderer/properties/TextProperty.js.map +1 -0
  206. package/dist/components/NestedControlRenderer/styles.d.ts +14 -0
  207. package/dist/components/NestedControlRenderer/styles.js +21 -0
  208. package/dist/components/NestedControlRenderer/styles.js.map +1 -0
  209. package/dist/components/NestedControlRenderer/translations.d.ts +14 -0
  210. package/dist/components/NestedControlRenderer/translations.js +19 -0
  211. package/dist/components/NestedControlRenderer/translations.js.map +1 -0
  212. package/dist/components/OptionSet/OptionSet.js +3 -3
  213. package/dist/components/OptionSet/OptionSet.js.map +1 -1
  214. package/dist/components/OptionSet/useComboBoxTheme.js +17 -17
  215. package/dist/components/OptionSet/useComboBoxTheme.js.map +1 -1
  216. package/dist/components/TextField/TextField.js.map +1 -1
  217. package/dist/components/TextField/interfaces.d.ts +2 -2
  218. package/dist/components/TwoOptions/TwoOptions.js +2 -1
  219. package/dist/components/TwoOptions/TwoOptions.js.map +1 -1
  220. package/dist/components/index.d.ts +13 -0
  221. package/dist/components/index.js +15 -0
  222. package/dist/components/index.js.map +1 -0
  223. package/dist/hooks/index.d.ts +1 -0
  224. package/dist/hooks/index.js +1 -0
  225. package/dist/hooks/index.js.map +1 -1
  226. package/dist/hooks/useControl.d.ts +1 -7
  227. package/dist/hooks/useControl.js +12 -40
  228. package/dist/hooks/useControl.js.map +1 -1
  229. package/dist/hooks/useControlLabels.d.ts +14 -0
  230. package/dist/hooks/useControlLabels.js +47 -0
  231. package/dist/hooks/useControlLabels.js.map +1 -0
  232. package/dist/hooks/useControlSizing.d.ts +1 -1
  233. package/dist/hooks/useInputBasedControl.d.ts +2 -1
  234. package/dist/hooks/useInputBasedControl.js +3 -5
  235. package/dist/hooks/useInputBasedControl.js.map +1 -1
  236. package/dist/hooks/usePrevious.d.ts +1 -0
  237. package/dist/index.d.ts +453 -141
  238. package/dist/index.js +7 -2
  239. package/dist/index.js.map +1 -1
  240. package/dist/interfaces/context.d.ts +3 -2
  241. package/dist/interfaces/index.d.ts +1 -1
  242. package/dist/interfaces/property.d.ts +6 -1
  243. package/dist/utils/BaseControls.d.ts +16 -0
  244. package/dist/utils/BaseControls.js +82 -0
  245. package/dist/utils/BaseControls.js.map +1 -0
  246. package/dist/utils/index.d.ts +1 -0
  247. package/dist/utils/index.js +2 -0
  248. package/dist/utils/index.js.map +1 -1
  249. package/dist/utils/theme/ControlTheme.d.ts +2 -2
  250. package/dist/utils/theme/ControlTheme.js +1 -1
  251. package/dist/utils/theme/ControlTheme.js.map +1 -1
  252. package/dist/utils/theme/components/ThemeWrapper.d.ts +9 -0
  253. package/dist/utils/theme/components/ThemeWrapper.js +11 -0
  254. package/dist/utils/theme/components/ThemeWrapper.js.map +1 -0
  255. package/dist/utils/theme/components/index.d.ts +1 -0
  256. package/dist/utils/theme/components/index.js +2 -0
  257. package/dist/utils/theme/components/index.js.map +1 -0
  258. package/dist/utils/theme/hooks/useControlTheme.d.ts +1 -1
  259. package/dist/utils/theme/hooks/useControlTheme.js.map +1 -1
  260. package/dist/utils/theme/index.d.ts +1 -0
  261. package/dist/utils/theme/index.js +1 -0
  262. package/dist/utils/theme/index.js.map +1 -1
  263. package/package.json +3 -3
  264. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.d.ts +0 -10
  265. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js +0 -82
  266. package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js.map +0 -1
  267. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts +0 -11
  268. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js +0 -93
  269. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map +0 -1
  270. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.d.ts +0 -36
  271. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js +0 -42
  272. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js.map +0 -1
  273. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +0 -11
  274. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js +0 -221
  275. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js.map +0 -1
  276. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +0 -10
  277. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js +0 -49
  278. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js.map +0 -1
  279. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js +0 -27
  280. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js.map +0 -1
  281. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +0 -99
  282. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js +0 -123
  283. package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js.map +0 -1
  284. package/dist/components/Grid/core/components/Component/Component.js.map +0 -1
  285. package/dist/components/Grid/core/components/Component/controller/useComponentController.js.map +0 -1
  286. package/dist/components/Grid/core/components/Component/model/Component.js.map +0 -1
  287. package/dist/components/Grid/core/model/Metadata.js +0 -26
  288. package/dist/components/Grid/core/model/Metadata.js.map +0 -1
  289. package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +0 -11
  290. package/dist/components/Grid/selection/controllers/useSelectionController.js +0 -21
  291. package/dist/components/Grid/selection/controllers/useSelectionController.js.map +0 -1
  292. package/dist/hooks/useRerender.d.ts +0 -1
  293. package/dist/hooks/useRerender.js +0 -9
  294. package/dist/hooks/useRerender.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Lookup.js","sources":["../../../src/components/Lookup/Lookup.tsx"],"sourcesContent":["\nimport { ILayout, ILookup, IMetadata } from \"./interfaces\";\nimport { useLookup } from \"./hooks/useLookup\";\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ThemeProvider } from \"@fluentui/react\";\nimport { IItemProps, TagPicker } from \"@talxis/react-components\";\nimport { TargetSelector } from \"./components/TargetSelector\";\nimport { useMouseOver } from \"../../hooks/useMouseOver\";\nimport { getLookupStyles } from \"./styles\";\nimport { IBasePicker } from \"@fluentui/react/lib/components/pickers/BasePicker.types\";\nimport { ITag } from \"@fluentui/react/lib/components/pickers/TagPicker/TagPicker.types\";\nimport { RecordCreator } from \"./components/RecordCreator\";\nimport { useFocusIn } from \"../../hooks/useFocusIn\";\nimport { useControlSizing } from \"../../hooks/useControlSizing\";\nimport dayjs from \"dayjs\";\n\nexport const Lookup = (props: ILookup) => {\n const context = props.context;\n const ref = useRef<HTMLDivElement>(null);\n const componentRef = useRef<IBasePicker<ITag>>(null);\n const itemLimit = props.parameters.MultipleEnabled?.raw === true ? Infinity : 1\n const { height } = useControlSizing(props.context.mode);\n const [value, entities, labels, records, selectEntity, getSearchResults, theme] = useLookup(props);\n const styles = getLookupStyles(theme, itemLimit === 1, height);\n const mouseOver = useMouseOver(ref);\n const isFocused = useFocusIn(ref, 100);\n const firstRenderRef = useRef(true);\n const shouldFocusRef = useRef(false);\n const [placeholder, setPlaceholder] = useState('---');\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n\n\n useEffect(() => {\n if (firstRenderRef.current) {\n firstRenderRef.current = false;\n return;\n }\n //@ts-ignore\n if (componentRef.current.state.suggestionsVisible) {\n //if the suggestions callout is open and the selected target changes, refresh the results\n forceSearch();\n }\n }, [entities])\n\n useEffect(() => {\n const onKeyPress = (ev: KeyboardEvent) => {\n if (context.mode.isControlDisabled) {\n return;\n }\n if (ev.key === 'Backspace') {\n const picker = ref.current?.querySelector('[class*=\"TALXIS__tag-picker__root\"]');\n if ((document.activeElement === picker) && value.length === 1) {\n records.select(undefined);\n setTimeout(() => {\n componentRef.current?.focusInput()\n }, 200)\n }\n }\n }\n document.addEventListener('keydown', onKeyPress)\n return () => {\n document.removeEventListener('keydown', onKeyPress);\n }\n }, [value]);\n\n useEffect(() => {\n if (props.parameters.AutoFocus?.raw === true) {\n focus();\n }\n }, []);\n\n const focus = () => {\n if (componentRef.current?.items?.length === itemLimit) {\n const el = ref.current?.querySelector(':scope>div') as HTMLDivElement;\n el?.click();\n el?.focus();\n return;\n }\n componentRef.current?.focusInput();\n }\n\n const forceSearch = async () => {\n //@ts-ignore - We need to use internal methods to show and fill the suggestions on entity change\n componentRef.current.suggestionStore.updateSuggestions([]);\n //@ts-ignore - ^^same as above\n componentRef.current.setState({\n suggestionsVisible: true,\n suggestionsLoading: true,\n });\n //@ts-ignore - ^^same as above\n const results = await onResolveSuggestions(componentRef.current.input.current.value)\n //@ts-ignore - ^^same as above\n componentRef.current.updateSuggestionsList(results);\n //@ts-ignore - ^^same above\n componentRef.current.setState({\n isMostRecentlyUsedVisible: false,\n suggestionsVisible: true,\n moreSuggestionsAvailable: false,\n });\n }\n\n const isComponentActive = () => {\n return mouseOver || isFocused;\n }\n\n const getSecondaryName = (result: ComponentFramework.LookupValue & {\n entityData: {\n [key: string]: any;\n };\n layout: ILayout;\n }, metadata?: IMetadata) => {\n //polymorphic, selected all\n if (!entities.find(x => x.selected)) {\n return metadata?.DisplayName;\n }\n else {\n let text: string | undefined = result.entityData[result.layout?.Rows?.[0]?.Cells?.[1]?.Name];\n const dateRegex = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z/;\n if(typeof text === 'string' && text.match(dateRegex)) {\n text = props.context.formatting.formatTime(dayjs(text).toDate(), 1);\n }\n return text;\n }\n }\n\n const onResolveSuggestions = async (filter: string, selectedItems?: IItemProps[] | undefined): Promise<IItemProps[]> => {\n //TODO: onResolveSuggestions gets called when the record gets selected resulting in unnecessary call\n const results = await getSearchResults(filter);\n const suggestions: IItemProps[] = [];\n for (const result of results) {\n if (selectedItems?.find(x => x.key === result.id)) {\n continue;\n }\n const metadata = await entities.find(x => x.entityName === result.entityType)?.metadata;\n suggestions.push({\n key: result.id,\n text: result.name,\n secondaryText: getSecondaryName(result, metadata),\n 'data-entity': result.entityType\n })\n }\n return suggestions;\n }\n const componentProps = onOverrideComponentProps({\n ref: componentRef,\n readOnly: context.mode.isControlDisabled,\n resolveDelay: 200,\n stackItems: itemLimit === 1,\n errorMessage: props.parameters.value.errorMessage,\n hideErrorMessage: !props.parameters.ShowErrorMessage?.raw,\n pickerCalloutProps: {\n layerProps: {\n eventBubblingEnabled: true\n },\n className: styles.suggestions\n },\n\n inputProps: {\n placeholder: placeholder,\n onMouseEnter: () => {\n if (context.mode.isControlDisabled) {\n return;\n }\n setPlaceholder(`${labels.placeholder()} ${props.parameters.value.attributes.DisplayName}`);\n },\n onMouseLeave: () => {\n setPlaceholder(\"---\");\n }\n },\n pickerSuggestionsProps: {\n loadingText: labels.searching(),\n noResultsFoundText: labels.noRecordsFound(),\n // @ts-ignore\n suggestionsHeaderText: (\n <>\n {props.parameters.IsInlineNewEnabled?.raw !== false && (\n <RecordCreator labels={labels} entities={entities} onCreateRecord={records.create} />\n )}\n {props.parameters.value.attributes.Targets.length > 1 && (\n <TargetSelector\n labels={labels}\n entities={entities}\n onEntitySelected={(entityName) => {\n selectEntity(entityName);\n }}\n />\n )}\n </>\n )\n },\n transparent: itemLimit === 1,\n onChange: (items) => {\n records.select(\n items?.map((item) => {\n return {\n entityType: item['data-entity'],\n id: item.key,\n name: item.text\n };\n })\n );\n },\n searchBtnProps: {\n key: 'search',\n iconProps: {\n iconName: 'Search'\n },\n showOnlyOnHover: true\n },\n selectedItems: value.map((lookup) => {\n return {\n key: lookup.id,\n text: lookup.name || labels.noName(),\n 'data-entity': lookup.entityType,\n 'data-navigation-enabled': props.parameters.EnableNavigation?.raw !== false,\n onClick: () => {\n if (props.parameters.EnableNavigation?.raw === false) {\n return;\n }\n context.navigation.openForm({\n entityName: lookup.entityType,\n entityId: lookup.id\n });\n },\n deleteButtonProps:\n isComponentActive() || itemLimit > 1\n ? {\n key: 'delete',\n iconProps: {\n iconName: 'Cancel',\n },\n onClick: () => {\n shouldFocusRef.current = false;\n records.deselect(lookup);\n setTimeout(() => {\n focus();\n }, 200);\n }\n }\n : undefined\n };\n }),\n itemLimit: itemLimit,\n onEmptyResolveSuggestions: !context.mode.isControlDisabled ? (selectedItems) => onResolveSuggestions(\"\", selectedItems as IItemProps[]) as any : undefined,\n onResolveSuggestions: onResolveSuggestions\n });\n\n return (\n <ThemeProvider applyTo=\"none\" theme={theme} className={`talxis__lookupControl ${styles.root}`} ref={ref}>\n <TagPicker {...componentProps} />\n </ThemeProvider>\n );\n};"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;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D,oBAAA,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;wBACxB,UAAU,EAAE,MAAM,CAAC,UAAU;wBAC7B,QAAQ,EAAE,MAAM,CAAC,EAAE;AACtB,qBAAA,CAAC,CAAC;iBACN;AACD,gBAAA,iBAAiB,EACb,iBAAiB,EAAE,IAAI,SAAS,GAAG,CAAC;AAChC,sBAAE;AACE,wBAAA,GAAG,EAAE,QAAQ;AACb,wBAAA,SAAS,EAAE;AACP,4BAAA,QAAQ,EAAE,QAAQ;AACrB,yBAAA;wBACD,OAAO,EAAE,MAAK;AACV,4BAAA,cAAc,CAAC,OAAO,GAAG,KAAK,CAAC;AAC/B,4BAAA,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BACzB,UAAU,CAAC,MAAK;AACZ,gCAAA,KAAK,EAAE,CAAC;6BACX,EAAE,GAAG,CAAC,CAAC;yBACX;AACJ,qBAAA;AACD,sBAAE,SAAS;aACtB,CAAC;AACN,SAAC,CAAC;AACF,QAAA,SAAS,EAAE,SAAS;QACpB,yBAAyB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,aAAa,KAAK,oBAAoB,CAAC,EAAE,EAAE,aAA6B,CAAQ,GAAG,SAAS;AAC1J,QAAA,oBAAoB,EAAE,oBAAoB;AAC7C,KAAA,CAAC,CAAC;AAEH,IAAA,QACIA,GAAA,CAAC,aAAa,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAE,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EACnGA,GAAC,CAAA,SAAS,EAAK,EAAA,GAAA,cAAc,EAAI,CAAA,EAAA,CACrB,EAClB;AACN;;;;"}
1
+ {"version":3,"file":"Lookup.js","sources":["../../../src/components/Lookup/Lookup.tsx"],"sourcesContent":["\nimport { ILayout, ILookup, IMetadata } from \"./interfaces\";\nimport { useLookup } from \"./hooks/useLookup\";\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { ThemeProvider } from \"@fluentui/react\";\nimport { IItemProps, TagPicker } from \"@talxis/react-components\";\nimport { TargetSelector } from \"./components/TargetSelector\";\nimport { useMouseOver } from \"../../hooks/useMouseOver\";\nimport { getLookupStyles, getSuggestionsCalloutStyles } from \"./styles\";\nimport { IBasePicker } from \"@fluentui/react/lib/components/pickers/BasePicker.types\";\nimport { ITag } from \"@fluentui/react/lib/components/pickers/TagPicker/TagPicker.types\";\nimport { RecordCreator } from \"./components/RecordCreator\";\nimport { useFocusIn } from \"../../hooks/useFocusIn\";\nimport { useControlSizing } from \"../../hooks/useControlSizing\";\nimport dayjs from \"dayjs\";\n\nexport const Lookup = (props: ILookup) => {\n const context = props.context;\n const ref = useRef<HTMLDivElement>(null);\n const componentRef = useRef<IBasePicker<ITag>>(null);\n const itemLimit = props.parameters.MultipleEnabled?.raw === true ? Infinity : 1\n const { height } = useControlSizing(props.context.mode);\n const [value, entities, labels, records, selectEntity, getSearchResults, theme] = useLookup(props);\n const styles = getLookupStyles(theme, itemLimit === 1, height);\n const suggestionsCalloutTheme = props.context.fluentDesignLanguage?.applicationTheme ?? theme;\n const suggestionsCalloutStyles = useMemo(() => getSuggestionsCalloutStyles(suggestionsCalloutTheme), [suggestionsCalloutTheme])\n const mouseOver = useMouseOver(ref);\n const isFocused = useFocusIn(ref, 100);\n const firstRenderRef = useRef(true);\n const shouldFocusRef = useRef(false);\n const [placeholder, setPlaceholder] = useState('---');\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n\n\n useEffect(() => {\n if (firstRenderRef.current) {\n firstRenderRef.current = false;\n return;\n }\n //@ts-ignore\n if (componentRef.current.state.suggestionsVisible) {\n //if the suggestions callout is open and the selected target changes, refresh the results\n forceSearch();\n }\n }, [entities])\n\n useEffect(() => {\n const onKeyPress = (ev: KeyboardEvent) => {\n if (context.mode.isControlDisabled) {\n return;\n }\n if (ev.key === 'Backspace') {\n const picker = ref.current?.querySelector('[class*=\"TALXIS__tag-picker__root\"]');\n if ((document.activeElement === picker) && value.length === 1) {\n records.select(undefined);\n setTimeout(() => {\n componentRef.current?.focusInput()\n }, 200)\n }\n }\n }\n document.addEventListener('keydown', onKeyPress)\n return () => {\n document.removeEventListener('keydown', onKeyPress);\n }\n }, [value]);\n\n useEffect(() => {\n if (props.parameters.AutoFocus?.raw === true) {\n focus();\n }\n }, []);\n\n const focus = () => {\n if (componentRef.current?.items?.length === itemLimit) {\n const el = ref.current?.querySelector(':scope>div') as HTMLDivElement;\n el?.click();\n el?.focus();\n return;\n }\n componentRef.current?.focusInput();\n }\n\n const forceSearch = async () => {\n //@ts-ignore - We need to use internal methods to show and fill the suggestions on entity change\n componentRef.current.suggestionStore.updateSuggestions([]);\n //@ts-ignore - ^^same as above\n componentRef.current.setState({\n suggestionsVisible: true,\n suggestionsLoading: true,\n });\n //@ts-ignore - ^^same as above\n const results = await onResolveSuggestions(componentRef.current.input.current.value)\n //@ts-ignore - ^^same as above\n componentRef.current.updateSuggestionsList(results);\n //@ts-ignore - ^^same above\n componentRef.current.setState({\n isMostRecentlyUsedVisible: false,\n suggestionsVisible: true,\n moreSuggestionsAvailable: false,\n });\n }\n\n const isComponentActive = () => {\n return mouseOver || isFocused;\n }\n\n const getSecondaryName = (result: ComponentFramework.LookupValue & {\n entityData: {\n [key: string]: any;\n };\n layout: ILayout;\n }, metadata?: IMetadata) => {\n //polymorphic, selected all\n if (!entities.find(x => x.selected)) {\n return metadata?.DisplayName;\n }\n else {\n let text: string | undefined = result.entityData[result.layout?.Rows?.[0]?.Cells?.[1]?.Name];\n const dateRegex = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z/;\n if(typeof text === 'string' && text.match(dateRegex)) {\n text = props.context.formatting.formatTime(dayjs(text).toDate(), 1);\n }\n return text;\n }\n }\n\n const onResolveSuggestions = async (filter: string, selectedItems?: IItemProps[] | undefined): Promise<IItemProps[]> => {\n //TODO: onResolveSuggestions gets called when the record gets selected resulting in unnecessary call\n const results = await getSearchResults(filter);\n const suggestions: IItemProps[] = [];\n for (const result of results) {\n if (selectedItems?.find(x => x.key === result.id)) {\n continue;\n }\n const metadata = await entities.find(x => x.entityName === result.entityType)?.metadata;\n suggestions.push({\n key: result.id,\n text: result.name,\n secondaryText: getSecondaryName(result, metadata),\n 'data-entity': result.entityType\n })\n }\n return suggestions;\n }\n const componentProps = onOverrideComponentProps({\n ref: componentRef,\n readOnly: context.mode.isControlDisabled,\n resolveDelay: 200,\n stackItems: itemLimit === 1,\n errorMessage: props.parameters.value.errorMessage,\n hideErrorMessage: !props.parameters.ShowErrorMessage?.raw,\n pickerCalloutProps: {\n layerProps: {\n eventBubblingEnabled: true\n },\n className: suggestionsCalloutStyles.suggestionsCallout,\n theme: suggestionsCalloutTheme,\n \n },\n inputProps: {\n placeholder: placeholder,\n onMouseEnter: () => {\n if (context.mode.isControlDisabled) {\n return;\n }\n setPlaceholder(`${labels.placeholder()} ${props.parameters.value.attributes.DisplayName}`);\n },\n onMouseLeave: () => {\n setPlaceholder(\"---\");\n }\n\n },\n pickerSuggestionsProps: {\n loadingText: labels.searching(),\n theme: suggestionsCalloutTheme,\n noResultsFoundText: labels.noRecordsFound(),\n className: suggestionsCalloutStyles.suggestionsContainer,\n // @ts-ignore\n suggestionsHeaderText: (\n <>\n {props.parameters.IsInlineNewEnabled?.raw !== false && (\n <RecordCreator labels={labels} entities={entities} onCreateRecord={records.create} />\n )}\n {props.parameters.value.attributes.Targets.length > 1 && (\n <TargetSelector\n labels={labels}\n entities={entities}\n onEntitySelected={(entityName) => {\n selectEntity(entityName);\n }}\n />\n )}\n </>\n )\n },\n transparent: itemLimit === 1,\n onChange: (items) => {\n records.select(\n items?.map((item) => {\n return {\n entityType: item['data-entity'],\n id: item.key,\n name: item.text\n };\n })\n );\n },\n searchBtnProps: {\n key: 'search',\n iconProps: {\n iconName: 'Search'\n },\n showOnlyOnHover: true\n },\n selectedItems: value.map((lookup) => {\n return {\n key: lookup.id,\n text: lookup.name || labels.noName(),\n 'data-entity': lookup.entityType,\n 'data-navigation-enabled': props.parameters.EnableNavigation?.raw !== false,\n onClick: () => {\n if (props.parameters.EnableNavigation?.raw === false) {\n return;\n }\n context.navigation.openForm({\n entityName: lookup.entityType,\n entityId: lookup.id\n });\n },\n deleteButtonProps:\n isComponentActive() || itemLimit > 1\n ? {\n key: 'delete',\n iconProps: {\n iconName: 'Cancel',\n },\n onClick: () => {\n shouldFocusRef.current = false;\n records.deselect(lookup);\n setTimeout(() => {\n focus();\n }, 200);\n }\n }\n : undefined\n };\n }),\n itemLimit: itemLimit,\n onEmptyResolveSuggestions: !context.mode.isControlDisabled ? (selectedItems) => onResolveSuggestions(\"\", selectedItems as IItemProps[]) as any : undefined,\n onResolveSuggestions: onResolveSuggestions\n });\n\n return (\n <ThemeProvider applyTo=\"none\" theme={theme} className={`talxis__lookupControl ${styles.root}`} ref={ref}>\n <TagPicker {...componentProps} />\n </ThemeProvider>\n );\n};"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;AAgBa,MAAA,MAAM,GAAG,CAAC,KAAc,KAAI;AACrC,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,IAAA,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AACzC,IAAA,MAAM,YAAY,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;AACrD,IAAA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,GAAG,KAAK,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAA;AAC/E,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,E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S,GAAG,CAAC;AAChC,sBAAE;AACE,wBAAA,GAAG,EAAE,QAAQ;AACb,wBAAA,SAAS,EAAE;AACP,4BAAA,QAAQ,EAAE,QAAQ;AACrB,yBAAA;wBACD,OAAO,EAAE,MAAK;AACV,4BAAA,cAAc,CAAC,OAAO,GAAG,KAAK,CAAC;AAC/B,4BAAA,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BACzB,UAAU,CAAC,MAAK;AACZ,gCAAA,KAAK,EAAE,CAAC;6BACX,EAAE,GAAG,CAAC,CAAC;yBACX;AACJ,qBAAA;AACD,sBAAE,SAAS;aACtB,CAAC;AACN,SAAC,CAAC;AACF,QAAA,SAAS,EAAE,SAAS;QACpB,yBAAyB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,aAAa,KAAK,oBAAoB,CAAC,EAAE,EAAE,aAA6B,CAAQ,GAAG,SAAS;AAC1J,QAAA,oBAAoB,EAAE,oBAAoB;AAC7C,KAAA,CAAC,CAAC;AAEH,IAAA,QACIA,GAAA,CAAC,aAAa,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAE,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EACnGA,GAAC,CAAA,SAAS,EAAK,EAAA,GAAA,cAAc,EAAI,CAAA,EAAA,CACrB,EAClB;AACN;;;;"}
@@ -1,4 +1,4 @@
1
- /// <reference types="powerapps-component-framework" />
1
+ /// <reference types="@types/powerapps-component-framework" />
2
2
  import { IEntity } from "../interfaces";
3
3
  export declare const useFetchXml: (context: ComponentFramework.Context<any>) => [(viewId: string) => Promise<{
4
4
  fetchxml: string;
@@ -1,4 +1,4 @@
1
- /// <reference types="powerapps-component-framework" />
1
+ /// <reference types="@types/powerapps-component-framework" />
2
2
  import { ITranslation } from "../../../hooks";
3
3
  import { IEntity, ILayout, ILookup } from "../interfaces";
4
4
  import { ITheme } from "@talxis/react-components";
@@ -1,4 +1,4 @@
1
- /// <reference types="powerapps-component-framework" />
1
+ /// <reference types="@types/powerapps-component-framework" />
2
2
  import { ITagPickerProps } from "@talxis/react-components";
3
3
  import { ILookupProperty, ITwoOptionsProperty } from "../../interfaces";
4
4
  import { IControl, IOutputs, ITranslations } from "../../interfaces/context";
@@ -57,13 +57,6 @@ export declare const getLookupStyles: (theme: ITheme, isSingleSelect: boolean, h
57
57
  height: string | 0 | undefined;
58
58
  };
59
59
  };
60
- suggestions: {
61
- '.ms-Suggestions-title': {
62
- padding: number;
63
- display: string;
64
- flexDirection: string;
65
- };
66
- };
67
60
  createRecordBtn: {
68
61
  height: number;
69
62
  width: string;
@@ -81,3 +74,22 @@ export declare const getLookupStyles: (theme: ITheme, isSingleSelect: boolean, h
81
74
  };
82
75
  };
83
76
  }>;
77
+ export declare const getSuggestionsCalloutStyles: (theme: ITheme) => import("@fluentui/react").IProcessedStyleSet<{
78
+ suggestionsCallout: {
79
+ '.ms-Suggestions-title': {
80
+ padding: number;
81
+ display: string;
82
+ flexDirection: string;
83
+ };
84
+ };
85
+ suggestionsContainer: {
86
+ '.ms-Suggestions-item': {
87
+ ':hover': {
88
+ backgroundColor: string;
89
+ };
90
+ '>.ms-Button--command[aria-selected="true"]': {
91
+ backgroundColor: string;
92
+ };
93
+ };
94
+ };
95
+ }>;
@@ -68,13 +68,6 @@ const getLookupStyles = (theme, isSingleSelect, height) => {
68
68
  height: _height && `${_height - 3}px !important`
69
69
  }
70
70
  },
71
- suggestions: {
72
- '.ms-Suggestions-title': {
73
- padding: 0,
74
- display: 'flex',
75
- flexDirection: 'column',
76
- }
77
- },
78
71
  createRecordBtn: {
79
72
  height: 38,
80
73
  width: '100%',
@@ -93,6 +86,27 @@ const getLookupStyles = (theme, isSingleSelect, height) => {
93
86
  }
94
87
  });
95
88
  };
89
+ const getSuggestionsCalloutStyles = (theme) => {
90
+ return mergeStyleSets({
91
+ suggestionsCallout: {
92
+ '.ms-Suggestions-title': {
93
+ padding: 0,
94
+ display: 'flex',
95
+ flexDirection: 'column',
96
+ }
97
+ },
98
+ suggestionsContainer: {
99
+ '.ms-Suggestions-item': {
100
+ ':hover': {
101
+ backgroundColor: theme.semanticColors.buttonBackgroundHovered
102
+ },
103
+ '>.ms-Button--command[aria-selected="true"]': {
104
+ backgroundColor: theme.semanticColors.buttonBackgroundPressed
105
+ }
106
+ }
107
+ },
108
+ });
109
+ };
96
110
 
97
- export { getLookupStyles, getTargetSelectorStyles };
111
+ export { getLookupStyles, getSuggestionsCalloutStyles, getTargetSelectorStyles };
98
112
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../src/components/Lookup/styles.ts"],"sourcesContent":["import { ITheme, mergeStyleSets } from \"@fluentui/react\";\n\nexport const getTargetSelectorStyles = (theme: ITheme) => {\n return mergeStyleSets({\n targetSelector: {\n display: 'flex',\n paddingLeft: 8,\n paddingRight: 8,\n paddingBottom: 8,\n gap: 8,\n paddingTop: 8,\n '>span': {\n lineHeight: 15,\n minWidth: 'fit-content',\n color: theme.semanticColors.listText,\n fontWeight: 600\n }\n },\n targetSelectorLinks: {\n display: 'flex',\n gap: 5,\n flexWrap: 'wrap'\n },\n targetSelectorLink: {\n color: theme.palette.blackTranslucent40,\n '&[data-selected=\"true\"]': {\n color: theme.semanticColors.link,\n fontWeight: 600\n }\n },\n })\n}\n\nconst getHeight = (height?: number) => {\n if(height === -1 || height === 0) {\n return undefined;\n }\n return height;\n}\n\nexport const getLookupStyles = (theme: ITheme, isSingleSelect: boolean, height?: number) => {\n const _height = getHeight(height);\n return mergeStyleSets({\n displayName: 'talxis__lookupControl',\n root: {\n '[data-navigation-enabled=\"true\"]': {\n '.ms-Button-label': {\n color: `${theme.semanticColors.link} !important`,\n fontWeight: 600,\n marginLeft: 2\n },\n ':hover': {\n textDecoration: 'underline',\n cursor: 'pointer !important'\n }\n },\n '.ms-BasePicker-itemsWrapper .ms-CommandBar.ms-CommandBar': {\n height: _height && isSingleSelect ? _height - 6 : undefined\n },\n '.ms-BasePicker-text': {\n minHeight: _height ?? 32,\n height: 'min-content',\n paddingRight: !isSingleSelect ? 36 : undefined,\n alignItems: 'baseline',\n\n 'input': {\n alignSelf: 'center'\n },\n },\n '.TALXIS__input-buttons__root': {\n height: _height && `${_height - 3}px !important`\n }\n },\n suggestions: {\n '.ms-Suggestions-title': {\n padding: 0,\n display: 'flex',\n flexDirection: 'column',\n }\n },\n createRecordBtn: {\n height: 38,\n width: '100%',\n '.ms-Button-menuIcon': {\n display: 'none'\n },\n '>.ms-Button-flexContainer.ms-Button-flexContainer': {\n justifyContent: 'flex-start'\n },\n '.ms-Button-textContainer': {\n flexGrow: 'initial',\n '>span': {\n fontWeight: 600,\n }\n }\n }\n });\n}"],"names":[],"mappings":";;AAEa,MAAA,uBAAuB,GAAG,CAAC,KAAa,KAAI;AACrD,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,cAAc,EAAE;AACZ,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,aAAa,EAAE,CAAC;AAChB,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,UAAU,EAAE,CAAC;AACb,YAAA,OAAO,EAAE;AACL,gBAAA,UAAU,EAAE,EAAE;AACd,gBAAA,QAAQ,EAAE,aAAa;AACvB,gBAAA,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ;AACpC,gBAAA,UAAU,EAAE,GAAG;AAClB,aAAA;AACJ,SAAA;AACD,QAAA,mBAAmB,EAAE;AACjB,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,QAAQ,EAAE,MAAM;AACnB,SAAA;AACD,QAAA,kBAAkB,EAAE;AAChB,YAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,kBAAkB;AACvC,YAAA,yBAA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A,SAAS,EAAE,QAAQ;AACtB,iBAAA;AACJ,aAAA;AACD,YAAA,8BAA8B,EAAE;AAC5B,gBAAA,MAAM,EAAE,OAAO,IAAI,GAAG,OAAO,GAAG,CAAC,CAAe,aAAA,CAAA;AACnD,aAAA;AACJ,SAAA;AACD,QAAA,WAAW,EAAE;AACT,YAAA,uBAAuB,EAAE;AACrB,gBAAA,OAAO,EAAE,CAAC;AACV,gBAAA,OAAO,EAAE,MAAM;AACf,gBAAA,aAAa,EAAE,QAAQ;AAC1B,aAAA;AACJ,SAAA;AACD,QAAA,eAAe,EAAE;AACb,YAAA,MAAM,EAAE,EAAE;AACV,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,qBAAqB,EAAE;AACnB,gBAAA,OAAO,EAAE,MAAM;AAClB,aAAA;AACD,YAAA,mDAAmD,EAAE;AACjD,gBAAA,cAAc,EAAE,YAAY;AAC/B,aAAA;AACD,YAAA,0BAA0B,EAAE;AACxB,gBAAA,QAAQ,EAAE,SAAS;AACnB,gBAAA,OAAO,EAAE;AACL,oBAAA,UAAU,EAAE,GAAG;AAClB,iBAAA;AACJ,aAAA;AACJ,SAAA;AACJ,KAAA,CAAC,CAAC;AACP;;;;"}
1
+ {"version":3,"file":"styles.js","sources":["../../../src/components/Lookup/styles.ts"],"sourcesContent":["import { ITheme, mergeStyleSets } from \"@fluentui/react\";\n\nexport const getTargetSelectorStyles = (theme: ITheme) => {\n return mergeStyleSets({\n targetSelector: {\n display: 'flex',\n paddingLeft: 8,\n paddingRight: 8,\n paddingBottom: 8,\n gap: 8,\n paddingTop: 8,\n '>span': {\n lineHeight: 15,\n minWidth: 'fit-content',\n color: theme.semanticColors.listText,\n fontWeight: 600\n }\n },\n targetSelectorLinks: {\n display: 'flex',\n gap: 5,\n flexWrap: 'wrap'\n },\n targetSelectorLink: {\n color: theme.palette.blackTranslucent40,\n '&[data-selected=\"true\"]': {\n color: theme.semanticColors.link,\n fontWeight: 600\n }\n },\n })\n}\n\nconst getHeight = (height?: number) => {\n if(height === -1 || height === 0) {\n return undefined;\n }\n return height;\n}\n\nexport const getLookupStyles = (theme: ITheme, isSingleSelect: boolean, height?: number) => {\n const _height = getHeight(height);\n return mergeStyleSets({\n displayName: 'talxis__lookupControl',\n root: {\n '[data-navigation-enabled=\"true\"]': {\n '.ms-Button-label': {\n color: `${theme.semanticColors.link} !important`,\n fontWeight: 600,\n marginLeft: 2\n },\n ':hover': {\n textDecoration: 'underline',\n cursor: 'pointer !important'\n }\n },\n '.ms-BasePicker-itemsWrapper .ms-CommandBar.ms-CommandBar': {\n height: _height && isSingleSelect ? _height - 6 : undefined\n },\n '.ms-BasePicker-text': {\n minHeight: _height ?? 32,\n height: 'min-content',\n paddingRight: !isSingleSelect ? 36 : undefined,\n alignItems: 'baseline',\n\n 'input': {\n alignSelf: 'center'\n },\n },\n '.TALXIS__input-buttons__root': {\n height: _height && `${_height - 3}px !important`\n }\n },\n createRecordBtn: {\n height: 38,\n width: '100%',\n '.ms-Button-menuIcon': {\n display: 'none'\n },\n '>.ms-Button-flexContainer.ms-Button-flexContainer': {\n justifyContent: 'flex-start'\n },\n '.ms-Button-textContainer': {\n flexGrow: 'initial',\n '>span': {\n fontWeight: 600,\n }\n }\n }\n });\n}\n\nexport const getSuggestionsCalloutStyles = (theme: ITheme) => {\n return mergeStyleSets({\n suggestionsCallout: {\n '.ms-Suggestions-title': {\n padding: 0,\n display: 'flex',\n flexDirection: 'column',\n }\n },\n suggestionsContainer: {\n '.ms-Suggestions-item': {\n ':hover': {\n backgroundColor: theme.semanticColors.buttonBackgroundHovered\n },\n '>.ms-Button--command[aria-selected=\"true\"]': {\n backgroundColor: theme.semanticColors.buttonBackgroundPressed\n }\n }\n },\n })\n} "],"names":[],"mappings":";;AAEa,MAAA,uBAAuB,GAAG,CAAC,KAAa,KAAI;AACrD,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,cAAc,EAAE;AACZ,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,WAAW,EAAE,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YAAA,uBAAuB,EAAE;AACrB,gBAAA,OAAO,EAAE,CAAC;AACV,gBAAA,OAAO,EAAE,MAAM;AACf,gBAAA,aAAa,EAAE,QAAQ;AAC1B,aAAA;AACJ,SAAA;AACD,QAAA,oBAAoB,EAAE;AAClB,YAAA,sBAAsB,EAAE;AACpB,gBAAA,QAAQ,EAAE;AACN,oBAAA,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,uBAAuB;AAChE,iBAAA;AACD,gBAAA,4CAA4C,EAAE;AAC1C,oBAAA,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,uBAAuB;AAChE,iBAAA;AACJ,aAAA;AACJ,SAAA;AACJ,KAAA,CAAC,CAAA;AACN;;;;"}
@@ -11,6 +11,8 @@ const MultiSelectOptionSet = (props) => {
11
11
  const componentRef = useRef(null);
12
12
  const { Options } = parameters.value.attributes;
13
13
  const context = props.context;
14
+ const applicationTheme = props.context.fluentDesignLanguage?.applicationTheme;
15
+ const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);
14
16
  const comboBoxOptions = Options.map(option => ({
15
17
  key: option.Value.toString(),
16
18
  text: option.Label,
@@ -40,34 +42,55 @@ const MultiSelectOptionSet = (props) => {
40
42
  componentRef.current?.focus(true);
41
43
  }
42
44
  }, []);
43
- return (jsx(ThemeProvider, { theme: theme, applyTo: "none", children: jsx(ComboBox, { componentRef: componentRef, options: comboBoxOptions, allowFreeInput: true, multiSelect: true, autoComplete: "on", theme: theme, autofill: parameters.AutoFocus?.raw === true ? {
44
- autoFocus: true
45
- } : undefined, readOnly: context.mode.isControlDisabled, errorMessage: boundValue.errorMessage, selectedKey: boundValue.raw ? boundValue.raw.map(key => key.toString()) : null, useComboBoxAsMenuWidth: true, hideErrorMessage: !parameters.ShowErrorMessage?.raw, styles: {
46
- root: {
47
- height: sizing.height,
48
- width: sizing.width,
49
- display: 'flex',
50
- alignItems: 'center',
51
- },
52
- callout: {
53
- maxHeight: '300px !important'
54
- }
55
- }, clickToCopyProps: parameters.EnableCopyButton?.raw === true ? {
56
- key: 'copy',
57
- showOnlyOnHover: true,
58
- iconProps: {
59
- iconName: 'Copy'
60
- }
61
- } : undefined, deleteButtonProps: props.parameters.EnableDeleteButton?.raw === true ? {
62
- key: 'delete',
63
- showOnlyOnHover: true,
64
- iconProps: {
65
- iconName: 'Cancel'
66
- },
67
- onClick: (e, value) => {
68
- handleChange(null);
69
- }
70
- } : undefined, onChange: (e, option) => handleChange(option) }) }));
45
+ const componentProps = onOverrideComponentProps({
46
+ componentRef: componentRef,
47
+ options: comboBoxOptions,
48
+ allowFreeInput: true,
49
+ multiSelect: true,
50
+ autoComplete: "on",
51
+ autofill: parameters.AutoFocus?.raw === true ? {
52
+ autoFocus: true
53
+ } : undefined,
54
+ onRenderContainer: (containerProps, defaultRender) => jsx(ThemeProvider, { theme: props.context.fluentDesignLanguage?.applicationTheme, children: defaultRender?.(containerProps) }),
55
+ calloutProps: applicationTheme ? {
56
+ theme: applicationTheme
57
+ } : undefined,
58
+ readOnly: context.mode.isControlDisabled,
59
+ errorMessage: boundValue.errorMessage,
60
+ selectedKey: boundValue.raw ? boundValue.raw.map(key => key.toString()) : null,
61
+ useComboBoxAsMenuWidth: true,
62
+ hideErrorMessage: !parameters.ShowErrorMessage?.raw,
63
+ styles: {
64
+ root: {
65
+ height: sizing.height,
66
+ width: sizing.width,
67
+ display: 'flex',
68
+ alignItems: 'center',
69
+ },
70
+ callout: {
71
+ maxHeight: '300px !important'
72
+ }
73
+ },
74
+ clickToCopyProps: parameters.EnableCopyButton?.raw === true ? {
75
+ key: 'copy',
76
+ showOnlyOnHover: true,
77
+ iconProps: {
78
+ iconName: 'Copy'
79
+ }
80
+ } : undefined,
81
+ deleteButtonProps: parameters.EnableDeleteButton?.raw === true ? {
82
+ key: 'delete',
83
+ showOnlyOnHover: true,
84
+ iconProps: {
85
+ iconName: 'Cancel'
86
+ },
87
+ onClick: (e, value) => {
88
+ handleChange(null);
89
+ }
90
+ } : undefined,
91
+ onChange: (e, option) => handleChange(option),
92
+ });
93
+ return (jsx(ThemeProvider, { theme: theme, applyTo: "none", children: jsx(ComboBox, { ...componentProps }) }));
71
94
  };
72
95
 
73
96
  export { MultiSelectOptionSet };
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelectOptionSet.js","sources":["../../../src/components/MultiSelectOptionSet/MultiSelectOptionSet.tsx"],"sourcesContent":["\nimport { IMultiSelectOptionSet } from './interfaces';\nimport { useControl } from '../../hooks';\nimport { ComboBox } from \"@talxis/react-components\";\nimport { IComboBox, IComboBoxOption, ThemeProvider } from '@fluentui/react';\nimport React, { useEffect, useRef } from 'react';\n\nexport const MultiSelectOptionSet = (props: IMultiSelectOptionSet) => {\n const { sizing, onNotifyOutputChanged, theme } = useControl('MultiSelectOptionSet', props);\n const parameters = props.parameters;\n const boundValue = parameters.value;\n const componentRef = useRef<IComboBox>(null);\n const { Options } = parameters.value.attributes;\n const context = props.context;\n const comboBoxOptions: IComboBoxOption[] = Options.map(option => ({\n key: option.Value.toString(),\n text: option.Label,\n }));\n\n const handleChange = (option?: IComboBoxOption | null): void => {\n if (!option) {\n onNotifyOutputChanged({\n value: undefined\n });\n return;\n }\n const optionKey = option.key.toString();\n const updatedSelectedKeys = new Set(boundValue.raw || []);\n if (option.selected) {\n updatedSelectedKeys.add(+optionKey);\n } else {\n updatedSelectedKeys.delete(+optionKey);\n }\n const updatedSelectedKeysArray = Array.from(updatedSelectedKeys);\n\n onNotifyOutputChanged({\n value: updatedSelectedKeysArray.map(key => +key)\n });\n };\n\n useEffect(() => {\n if (parameters.AutoFocus?.raw) {\n componentRef.current?.focus(true);\n }\n }, []);\n\n return (\n <ThemeProvider theme={theme} applyTo=\"none\">\n <ComboBox\n componentRef={componentRef}\n options={comboBoxOptions}\n allowFreeInput={true}\n multiSelect\n autoComplete=\"on\"\n theme={theme}\n autofill={parameters.AutoFocus?.raw === true ? {\n autoFocus: true\n } : undefined}\n readOnly={context.mode.isControlDisabled}\n errorMessage={boundValue.errorMessage}\n selectedKey={boundValue.raw ? boundValue.raw.map(key => key.toString()) : null}\n useComboBoxAsMenuWidth\n hideErrorMessage={!parameters.ShowErrorMessage?.raw}\n styles={{\n root: {\n height: sizing.height,\n width: sizing.width,\n display: 'flex',\n alignItems: 'center',\n },\n callout: {\n maxHeight: '300px !important'\n }\n }}\n clickToCopyProps={parameters.EnableCopyButton?.raw === true ? {\n key: 'copy',\n showOnlyOnHover: true,\n iconProps: {\n iconName: 'Copy'\n }\n } : undefined}\n deleteButtonProps={props.parameters.EnableDeleteButton?.raw === true ? {\n key: 'delete',\n showOnlyOnHover: true,\n iconProps: {\n iconName: 'Cancel'\n },\n onClick: (e, value) => {\n handleChange(null);\n }\n } : undefined}\n onChange={(e, option) => handleChange(option)} />\n </ThemeProvider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAOa,MAAA,oBAAoB,GAAG,CAAC,KAA4B,KAAI;AACjE,IAAA,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC3F,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AACpC,IAAA,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;AACpC,IAAA,MAAM,YAAY,GAAG,MAAM,CAAY,IAAI,CAAC,CAAC;IAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,MAAM,eAAe,GAAsB,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK;AAC9D,QAAA,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE;QAC5B,IAAI,EAAE,MAAM,CAAC,KAAK;AACrB,KAAA,CAAC,CAAC,CAAC;AAEJ,IAAA,MAAM,YAAY,GAAG,CAAC,MAA+B,KAAU;QAC3D,IAA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CACzC,EAClB;AACN;;;;"}
1
+ {"version":3,"file":"MultiSelectOptionSet.js","sources":["../../../src/components/MultiSelectOptionSet/MultiSelectOptionSet.tsx"],"sourcesContent":["\nimport { IMultiSelectOptionSet } from './interfaces';\nimport { useControl } from '../../hooks';\nimport { ComboBox } from \"@talxis/react-components\";\nimport { IComboBox, IComboBoxOption, ThemeProvider } from '@fluentui/react';\nimport React, { useEffect, useRef } from 'react';\n\nexport const MultiSelectOptionSet = (props: IMultiSelectOptionSet) => {\n const { sizing, onNotifyOutputChanged, theme } = useControl('MultiSelectOptionSet', props);\n const parameters = props.parameters;\n const boundValue = parameters.value;\n const componentRef = useRef<IComboBox>(null);\n const { Options } = parameters.value.attributes;\n const context = props.context;\n const applicationTheme = props.context.fluentDesignLanguage?.applicationTheme;\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n\n const comboBoxOptions: IComboBoxOption[] = Options.map(option => ({\n key: option.Value.toString(),\n text: option.Label,\n }));\n\n const handleChange = (option?: IComboBoxOption | null): void => {\n if (!option) {\n onNotifyOutputChanged({\n value: undefined\n });\n return;\n }\n const optionKey = option.key.toString();\n const updatedSelectedKeys = new Set(boundValue.raw || []);\n if (option.selected) {\n updatedSelectedKeys.add(+optionKey);\n } else {\n updatedSelectedKeys.delete(+optionKey);\n }\n const updatedSelectedKeysArray = Array.from(updatedSelectedKeys);\n\n onNotifyOutputChanged({\n value: updatedSelectedKeysArray.map(key => +key)\n });\n };\n\n useEffect(() => {\n if (parameters.AutoFocus?.raw) {\n componentRef.current?.focus(true);\n }\n }, []);\n\n const componentProps = onOverrideComponentProps({\n componentRef: componentRef,\n options: comboBoxOptions,\n allowFreeInput: true,\n multiSelect: true,\n autoComplete: \"on\",\n autofill: parameters.AutoFocus?.raw === true ? {\n autoFocus: true\n } : undefined,\n onRenderContainer: (containerProps, defaultRender) => <ThemeProvider theme={props.context.fluentDesignLanguage?.applicationTheme}>{defaultRender?.(containerProps)}</ThemeProvider>,\n calloutProps: applicationTheme ? {\n theme: applicationTheme\n } : undefined,\n readOnly: context.mode.isControlDisabled,\n errorMessage: boundValue.errorMessage,\n selectedKey: boundValue.raw ? boundValue.raw.map(key => key.toString()) : null,\n useComboBoxAsMenuWidth: true,\n hideErrorMessage: !parameters.ShowErrorMessage?.raw,\n styles: {\n root: {\n height: sizing.height,\n width: sizing.width,\n display: 'flex',\n alignItems: 'center',\n },\n callout: {\n maxHeight: '300px !important'\n }\n },\n clickToCopyProps: parameters.EnableCopyButton?.raw === true ? {\n key: 'copy',\n showOnlyOnHover: true,\n iconProps: {\n iconName: 'Copy'\n }\n } : undefined,\n deleteButtonProps: parameters.EnableDeleteButton?.raw === true ? {\n key: 'delete',\n showOnlyOnHover: true,\n iconProps: {\n iconName: 'Cancel'\n },\n onClick: (e, value) => {\n handleChange(null);\n }\n } : undefined,\n onChange: (e, option) => handleChange(option),\n });\n\n return (\n <ThemeProvider theme={theme} applyTo=\"none\">\n <ComboBox {...componentProps}/>\n </ThemeProvider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAOa,MAAA,oBAAoB,GAAG,CAAC,KAA4B,KAAI;AACjE,IAAA,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC3F,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AACpC,IAAA,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;AACpC,IAAA,MAAM,YAAY,GAAG,MAAM,CAAY,IAAI,CAAC,CAAC;IAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;AAC9E,IAAA,MAAM,wBAAwB,GAAG,KAAK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,GAAG,EAAE,MAAM;AACX,YAAA,eAAe,EAAE,IAAI;AACrB,YAAA,SAAS,EAAE;AACP,gBAAA,QAAQ,EAAE,MAAM;AACnB,aAAA;SACJ,GAAG,SAAS;QACb,iBAAiB,EAAE,UAAU,CAAC,kBAAkB,EAAE,GAAG,KAAK,IAAI,GAAG;AAC7D,YAAA,GAAG,EAAE,QAAQ;AACb,YAAA,eAAe,EAAE,IAAI;AACrB,YAAA,SAAS,EAAE;AACP,gBAAA,QAAQ,EAAE,QAAQ;AACrB,aAAA;AACD,YAAA,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,KAAI;gBAClB,YAAY,CAAC,IAAI,CAAC,CAAC;aACtB;SACJ,GAAG,SAAS;QACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,YAAY,CAAC,MAAM,CAAC;AAChD,KAAA,CAAC,CAAC;AAEH,IAAA,QACIA,GAAC,CAAA,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,MAAM,EAAA,QAAA,EACvCA,IAAC,QAAQ,EAAA,EAAA,GAAK,cAAc,EAAG,CAAA,EAAA,CACnB,EAClB;AACN;;;;"}
@@ -0,0 +1,86 @@
1
+ /// <reference types="@types/powerapps-component-framework" />
2
+ import { IControl, IParameters, IProperty } from "../../interfaces";
3
+ import { IBinding, IControlStates } from "./interfaces";
4
+ export interface IOptions {
5
+ onGetBindings: () => {
6
+ [key: string]: IBinding;
7
+ };
8
+ /**
9
+ * PCF Context of parent control using this class. It will be used as base for nested control PCF context.
10
+ */
11
+ parentPcfContext: ComponentFramework.Context<any, any>;
12
+ /**
13
+ * Custom PCF to be rendered, if not provided you will get Base Control props.
14
+ */
15
+ /**
16
+ * Container element into which the control will be rendered in.
17
+ */
18
+ onGetContainerElement?: () => HTMLDivElement;
19
+ onGetControlName?: () => string;
20
+ callbacks?: {
21
+ onInit?: (instance: NestedControl) => void;
22
+ onGetControlStates?: () => IControlStates | undefined;
23
+ onNotifyOutputChanged?: (ouputs: any) => void;
24
+ /**
25
+ * Triggers when the control changes a state that should be visible in control renderer UI (for example loading)
26
+ */
27
+ onControlStateChanged?: () => void;
28
+ };
29
+ overrides?: {
30
+ onGetProps?: (props: IControl<any, any, any, any>) => IControl<any, any, any, any>;
31
+ onRender?: (control: NestedControl, defaultRender: () => Promise<void>) => void;
32
+ onUnmount?: (control: NestedControl, defaultUnmount: () => void) => void;
33
+ };
34
+ }
35
+ export declare class NestedControl {
36
+ private _options;
37
+ private _pendingInitialRender;
38
+ private _errorMessage;
39
+ private _properties;
40
+ private _lastRenderedControlName;
41
+ private _hasCustomPcfBeenMounted;
42
+ private _customControlInstance;
43
+ private _customControlId;
44
+ private _manifest;
45
+ private _loading;
46
+ private _props;
47
+ private _mutationObserver;
48
+ private _destroyed;
49
+ private _initialized;
50
+ private _container;
51
+ private _hasControlBeenPatched;
52
+ constructor(options: IOptions);
53
+ getProps(): IControl<IParameters, any, any, any>;
54
+ refreshProps(): any;
55
+ getParameters(): {
56
+ [name: string]: IProperty;
57
+ };
58
+ isLoading(): boolean;
59
+ setLoading(loading: boolean): void;
60
+ getOptions(): IOptions;
61
+ render(): Promise<void>;
62
+ unmount(softUnmount?: boolean): void;
63
+ getErrorMessage(): string;
64
+ setError(message?: string): void;
65
+ isMountedPcfComponent(): boolean;
66
+ getContainer(): HTMLDivElement;
67
+ getControlName(): string;
68
+ getBindings(): {
69
+ [key: string]: IBinding;
70
+ };
71
+ getCustomControlId(): string;
72
+ private _overrideDecorator;
73
+ private _unmount;
74
+ private _render;
75
+ private _getCustomControlNameWithoutPrefix;
76
+ private _checkIfControlLoadedToDom;
77
+ private _getPropertiesFromBindings;
78
+ private _getPropertyInstance;
79
+ private _getPrimaryBindingName;
80
+ private _getManifestPrimaryBinding;
81
+ private _getManifest;
82
+ private _getCustomControlParameters;
83
+ private _patchUpdateView;
84
+ private _patchContext;
85
+ private _getFluentDesignLanguage;
86
+ }