@carbon/ibm-products 2.43.2-canary.11 → 2.43.2-canary.112

Sign up to get free protection for your applications and to get access to all the features.
Files changed (416) hide show
  1. package/css/config-dev.css +6 -1
  2. package/css/config-dev.css.map +1 -1
  3. package/css/config.css +6 -1
  4. package/css/config.css.map +1 -1
  5. package/css/index-full-carbon.css +1846 -499
  6. package/css/index-full-carbon.css.map +1 -1
  7. package/css/index-full-carbon.min.css +1 -1
  8. package/css/index-full-carbon.min.css.map +1 -1
  9. package/css/index-without-carbon-released-only.css +267 -65
  10. package/css/index-without-carbon-released-only.css.map +1 -1
  11. package/css/index-without-carbon-released-only.min.css +1 -1
  12. package/css/index-without-carbon-released-only.min.css.map +1 -1
  13. package/css/index-without-carbon.css +1455 -250
  14. package/css/index-without-carbon.css.map +1 -1
  15. package/css/index-without-carbon.min.css +1 -1
  16. package/css/index-without-carbon.min.css.map +1 -1
  17. package/css/index.css +1651 -369
  18. package/css/index.css.map +1 -1
  19. package/css/index.min.css +1 -1
  20. package/css/index.min.css.map +1 -1
  21. package/es/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
  22. package/es/components/ActionBar/ActionBar.d.ts +58 -2
  23. package/es/components/ActionBar/ActionBar.js +14 -9
  24. package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
  25. package/es/components/ActionBar/ActionBarItem.js +8 -5
  26. package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
  27. package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
  28. package/es/components/AddSelect/types/index.d.ts +6 -0
  29. package/es/components/Card/Card.d.ts +68 -2
  30. package/es/components/Card/Card.js +28 -35
  31. package/es/components/Card/CardFooter.d.ts +51 -48
  32. package/es/components/Card/CardFooter.js +4 -2
  33. package/es/components/Card/CardHeader.d.ts +67 -49
  34. package/es/components/Card/CardHeader.js +4 -2
  35. package/es/components/Coachmark/Coachmark.d.ts +6 -1
  36. package/es/components/Coachmark/Coachmark.js +47 -11
  37. package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
  38. package/es/components/Coachmark/utils/enums.d.ts +6 -0
  39. package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
  40. package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
  41. package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
  42. package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
  43. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
  44. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +90 -56
  45. package/es/components/ConditionBuilder/ConditionBuilder.js +82 -25
  46. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  47. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +154 -0
  48. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
  49. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +29 -13
  50. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
  51. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +35 -11
  52. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +18 -10
  53. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
  54. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
  55. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +83 -64
  56. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
  57. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
  58. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
  59. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +35 -24
  60. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +43 -36
  61. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +43 -36
  62. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
  63. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +114 -40
  64. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
  65. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
  66. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +27 -9
  67. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  68. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +114 -0
  69. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  70. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +71 -38
  71. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
  72. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +22 -9
  73. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  74. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
  75. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +131 -42
  76. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +5 -1
  77. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +51 -19
  78. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
  79. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +152 -42
  80. package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
  81. package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
  82. package/es/components/ConditionBuilder/utils/util.d.ts +6 -4
  83. package/es/components/ConditionBuilder/utils/util.js +42 -17
  84. package/es/components/CreateFullPage/CreateFullPage.js +2 -2
  85. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
  86. package/es/components/DataSpreadsheet/DataSpreadsheet.js +129 -53
  87. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +16 -0
  88. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +32 -7
  89. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  90. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
  91. package/es/components/DataSpreadsheet/types/index.d.ts +7 -0
  92. package/es/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
  93. package/es/components/Datagrid/Datagrid/Datagrid.js +4 -9
  94. package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
  95. package/es/components/Datagrid/Datagrid/DatagridContent.js +4 -3
  96. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
  97. package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
  98. package/es/components/Datagrid/Datagrid/DatagridRow.js +21 -8
  99. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -6
  100. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
  101. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
  102. package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
  103. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
  104. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  105. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  106. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +6 -3
  107. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +20 -12
  108. package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
  109. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  110. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +54 -17
  111. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
  112. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +75 -12
  113. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  114. package/es/components/Datagrid/common-column-ids.d.ts +6 -0
  115. package/es/components/Datagrid/types/index.d.ts +63 -9
  116. package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
  117. package/es/components/Datagrid/useActionsColumn.js +7 -6
  118. package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  119. package/es/components/Datagrid/useColumnRightAlign.js +4 -3
  120. package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  121. package/es/components/Datagrid/useCustomizeColumns.js +4 -3
  122. package/es/components/Datagrid/useDatagrid.d.ts +6 -0
  123. package/es/components/Datagrid/useDefaultStringRenderer.js +0 -1
  124. package/es/components/Datagrid/useDisableSelectRows.d.ts +8 -1
  125. package/es/components/Datagrid/useDisableSelectRows.js +27 -22
  126. package/es/components/Datagrid/useInlineEdit.js +12 -2
  127. package/es/components/Datagrid/useNestedRowExpander.js +1 -3
  128. package/es/components/Datagrid/useNestedRows.js +32 -13
  129. package/es/components/Datagrid/useRowExpander.js +1 -3
  130. package/es/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
  131. package/es/components/Datagrid/useSelectRows.js +2 -1
  132. package/es/components/Datagrid/useStickyColumn.d.ts +8 -1
  133. package/es/components/Datagrid/useStickyColumn.js +12 -9
  134. package/es/components/EditInPlace/EditInPlace.d.ts +4 -0
  135. package/es/components/EditInPlace/EditInPlace.js +21 -10
  136. package/es/components/EditTearsheet/EditTearsheet.d.ts +7 -2
  137. package/es/components/EditTearsheet/EditTearsheet.js +44 -10
  138. package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  139. package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
  140. package/es/components/EmptyStates/EmptyState.d.ts +72 -5
  141. package/es/components/EmptyStates/EmptyState.js +8 -5
  142. package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  143. package/es/components/EmptyStates/EmptyStateV2.js +3 -2
  144. package/es/components/FullPageError/FullPageError.d.ts +36 -2
  145. package/es/components/FullPageError/FullPageError.js +0 -3
  146. package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
  147. package/es/components/GetStartedCard/GetStartedCard.js +11 -10
  148. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  149. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  150. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  151. package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
  152. package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
  153. package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
  154. package/es/components/Nav/NavItem.js +12 -3
  155. package/es/components/OptionsTile/OptionsTile.js +11 -6
  156. package/es/components/PageHeader/PageHeader.js +1 -0
  157. package/es/components/PageHeader/PageHeaderUtils.js +1 -1
  158. package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
  159. package/es/components/RemoveModal/RemoveModal.js +7 -1
  160. package/es/components/SearchBar/SearchBar.d.ts +1 -1
  161. package/es/components/SearchBar/SearchBar.js +2 -2
  162. package/es/components/SidePanel/SidePanel.js +17 -21
  163. package/es/components/SidePanel/motion/variants.d.ts +4 -6
  164. package/es/components/SidePanel/motion/variants.js +10 -11
  165. package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
  166. package/es/components/StringFormatter/StringFormatter.js +14 -3
  167. package/es/components/StringFormatter/utils/enums.d.ts +20 -1
  168. package/es/components/StringFormatter/utils/enums.js +29 -2
  169. package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
  170. package/es/components/TagOverflow/TagOverflow.js +47 -64
  171. package/es/components/TagOverflow/TagOverflowModal.js +4 -6
  172. package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  173. package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
  174. package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
  175. package/es/components/Tearsheet/Tearsheet.js +9 -1
  176. package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  177. package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
  178. package/es/components/Tearsheet/TearsheetShell.d.ts +11 -1
  179. package/es/components/Tearsheet/TearsheetShell.js +28 -7
  180. package/es/components/Toolbar/ToolbarButton.js +1 -1
  181. package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
  182. package/es/components/UserAvatar/UserAvatar.js +7 -23
  183. package/es/components/WebTerminal/WebTerminal.js +10 -12
  184. package/es/components/index.d.ts +1 -1
  185. package/es/global/js/hooks/useFocus.d.ts +1 -0
  186. package/es/global/js/hooks/useFocus.js +5 -2
  187. package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
  188. package/es/global/js/package-settings.d.ts +1 -1
  189. package/es/global/js/package-settings.js +1 -1
  190. package/es/global/js/utils/scrollableAncestor.js +7 -0
  191. package/es/global/js/utils/uuidv4.d.ts +6 -0
  192. package/es/global/js/utils/uuidv4.js +2 -0
  193. package/es/global/js/utils/wait.d.ts +6 -0
  194. package/es/global/js/utils/wait.js +2 -0
  195. package/es/index.js +1 -0
  196. package/es/node_modules/@carbon/icon-helpers/es/index.js +49 -62
  197. package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
  198. package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
  199. package/es/settings.d.ts +1 -1
  200. package/flags.js +7 -0
  201. package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
  202. package/lib/components/ActionBar/ActionBar.d.ts +58 -2
  203. package/lib/components/ActionBar/ActionBar.js +14 -9
  204. package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
  205. package/lib/components/ActionBar/ActionBarItem.js +7 -4
  206. package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
  207. package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
  208. package/lib/components/AddSelect/types/index.d.ts +6 -0
  209. package/lib/components/Card/Card.d.ts +68 -2
  210. package/lib/components/Card/Card.js +28 -35
  211. package/lib/components/Card/CardFooter.d.ts +51 -48
  212. package/lib/components/Card/CardFooter.js +4 -2
  213. package/lib/components/Card/CardHeader.d.ts +67 -49
  214. package/lib/components/Card/CardHeader.js +4 -2
  215. package/lib/components/Coachmark/Coachmark.d.ts +6 -1
  216. package/lib/components/Coachmark/Coachmark.js +46 -10
  217. package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
  218. package/lib/components/Coachmark/utils/enums.d.ts +6 -0
  219. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
  220. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
  221. package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
  222. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
  223. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
  224. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +87 -53
  225. package/lib/components/ConditionBuilder/ConditionBuilder.js +82 -25
  226. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  227. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +163 -0
  228. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
  229. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +28 -11
  230. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
  231. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +33 -9
  232. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +16 -8
  233. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
  234. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
  235. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +81 -62
  236. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
  237. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
  238. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
  239. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +34 -24
  240. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +43 -36
  241. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +43 -36
  242. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
  243. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +112 -38
  244. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
  245. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
  246. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +28 -10
  247. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  248. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +122 -0
  249. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  250. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +68 -35
  251. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
  252. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +21 -8
  253. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  254. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
  255. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +128 -39
  256. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +5 -1
  257. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +50 -17
  258. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
  259. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +152 -41
  260. package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
  261. package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
  262. package/lib/components/ConditionBuilder/utils/util.d.ts +6 -4
  263. package/lib/components/ConditionBuilder/utils/util.js +44 -16
  264. package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
  265. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
  266. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +129 -53
  267. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +16 -0
  268. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +32 -7
  269. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  270. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
  271. package/lib/components/DataSpreadsheet/types/index.d.ts +7 -0
  272. package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
  273. package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -9
  274. package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
  275. package/lib/components/Datagrid/Datagrid/DatagridContent.js +4 -3
  276. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
  277. package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
  278. package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -8
  279. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -6
  280. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
  281. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
  282. package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
  283. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
  284. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  285. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  286. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +6 -3
  287. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +20 -12
  288. package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
  289. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  290. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +53 -16
  291. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
  292. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
  293. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  294. package/lib/components/Datagrid/common-column-ids.d.ts +6 -0
  295. package/lib/components/Datagrid/types/index.d.ts +63 -9
  296. package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
  297. package/lib/components/Datagrid/useActionsColumn.js +7 -6
  298. package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  299. package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
  300. package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  301. package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
  302. package/lib/components/Datagrid/useDatagrid.d.ts +6 -0
  303. package/lib/components/Datagrid/useDefaultStringRenderer.js +0 -1
  304. package/lib/components/Datagrid/useDisableSelectRows.d.ts +8 -1
  305. package/lib/components/Datagrid/useDisableSelectRows.js +27 -22
  306. package/lib/components/Datagrid/useInlineEdit.js +12 -2
  307. package/lib/components/Datagrid/useNestedRowExpander.js +1 -3
  308. package/lib/components/Datagrid/useNestedRows.js +32 -13
  309. package/lib/components/Datagrid/useRowExpander.js +1 -3
  310. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
  311. package/lib/components/Datagrid/useSelectRows.js +2 -1
  312. package/lib/components/Datagrid/useStickyColumn.d.ts +8 -1
  313. package/lib/components/Datagrid/useStickyColumn.js +12 -9
  314. package/lib/components/EditInPlace/EditInPlace.d.ts +4 -0
  315. package/lib/components/EditInPlace/EditInPlace.js +21 -10
  316. package/lib/components/EditTearsheet/EditTearsheet.d.ts +7 -2
  317. package/lib/components/EditTearsheet/EditTearsheet.js +43 -9
  318. package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  319. package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
  320. package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
  321. package/lib/components/EmptyStates/EmptyState.js +8 -5
  322. package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  323. package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
  324. package/lib/components/FullPageError/FullPageError.d.ts +36 -2
  325. package/lib/components/FullPageError/FullPageError.js +0 -3
  326. package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
  327. package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
  328. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  329. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  330. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  331. package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
  332. package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
  333. package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
  334. package/lib/components/Nav/NavItem.js +10 -1
  335. package/lib/components/OptionsTile/OptionsTile.js +11 -6
  336. package/lib/components/PageHeader/PageHeader.js +1 -0
  337. package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
  338. package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
  339. package/lib/components/RemoveModal/RemoveModal.js +7 -1
  340. package/lib/components/SearchBar/SearchBar.d.ts +1 -1
  341. package/lib/components/SearchBar/SearchBar.js +2 -2
  342. package/lib/components/SidePanel/SidePanel.js +16 -20
  343. package/lib/components/SidePanel/motion/variants.d.ts +4 -6
  344. package/lib/components/SidePanel/motion/variants.js +10 -11
  345. package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
  346. package/lib/components/StringFormatter/StringFormatter.js +13 -2
  347. package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
  348. package/lib/components/StringFormatter/utils/enums.js +30 -1
  349. package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
  350. package/lib/components/TagOverflow/TagOverflow.js +46 -63
  351. package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
  352. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  353. package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
  354. package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
  355. package/lib/components/Tearsheet/Tearsheet.js +9 -1
  356. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  357. package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
  358. package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -1
  359. package/lib/components/Tearsheet/TearsheetShell.js +26 -5
  360. package/lib/components/Toolbar/ToolbarButton.js +1 -1
  361. package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
  362. package/lib/components/UserAvatar/UserAvatar.js +7 -23
  363. package/lib/components/WebTerminal/WebTerminal.js +10 -12
  364. package/lib/components/index.d.ts +1 -1
  365. package/lib/global/js/hooks/useFocus.d.ts +1 -0
  366. package/lib/global/js/hooks/useFocus.js +5 -1
  367. package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
  368. package/lib/global/js/package-settings.d.ts +1 -1
  369. package/lib/global/js/package-settings.js +1 -1
  370. package/lib/global/js/utils/scrollableAncestor.js +7 -0
  371. package/lib/global/js/utils/uuidv4.d.ts +6 -0
  372. package/lib/global/js/utils/uuidv4.js +2 -0
  373. package/lib/global/js/utils/wait.d.ts +6 -0
  374. package/lib/global/js/utils/wait.js +2 -0
  375. package/lib/index.js +5 -0
  376. package/lib/node_modules/@carbon/icon-helpers/es/index.js +49 -62
  377. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
  378. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
  379. package/lib/settings.d.ts +1 -1
  380. package/package.json +8 -7
  381. package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
  382. package/scss/components/Coachmark/_coachmark.scss +5 -4
  383. package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
  384. package/scss/components/ConditionBuilder/_condition-builder.scss +8 -1
  385. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +38 -5
  386. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +68 -22
  387. package/scss/components/ConditionBuilder/styles/_index.scss +7 -0
  388. package/scss/components/CreateModal/_create-modal.scss +0 -4
  389. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +16 -2
  390. package/scss/components/Datagrid/_datagrid.scss +0 -4
  391. package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
  392. package/scss/components/Datagrid/styles/_useActionsColumn.scss +6 -7
  393. package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +6 -7
  394. package/scss/components/Datagrid/styles/_useExpandedRow.scss +6 -7
  395. package/scss/components/Datagrid/styles/_useInlineEdit.scss +19 -7
  396. package/scss/components/Datagrid/styles/_useNestedRows.scss +6 -7
  397. package/scss/components/Datagrid/styles/_useNestedTable.scss +6 -7
  398. package/scss/components/Datagrid/styles/_useStickyColumn.scss +6 -7
  399. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
  400. package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
  401. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +6 -7
  402. package/scss/components/HTTPErrors/_http-errors.scss +77 -0
  403. package/scss/components/OptionsTile/_options-tile.scss +6 -6
  404. package/scss/components/SidePanel/_side-panel.scss +1 -1
  405. package/scss/components/_index-released-only.scss +1 -0
  406. package/scss/config-dev.scss +7 -0
  407. package/scss/config.scss +7 -0
  408. package/telemetry.yml +32 -19
  409. package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  410. package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
  411. package/es/global/js/utils/window.d.ts +0 -2
  412. package/es/global/js/utils/window.js +0 -12
  413. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  414. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
  415. package/lib/global/js/utils/window.d.ts +0 -2
  416. package/lib/global/js/utils/window.js +0 -16
@@ -5,33 +5,34 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { useContext, useState, useEffect, useCallback } from 'react';
10
10
  import PropTypes from '../../../node_modules/prop-types/index.js';
11
11
  import { Button, Section, Heading } from '@carbon/react';
12
12
  import { Add, TextNewLine } from '@carbon/react/icons';
13
13
  import ConditionGroupBuilder from '../ConditionGroupBuilder/ConditionGroupBuilder.js';
14
14
  import { ConditionBuilderContext, emptyState } from '../ConditionBuilderContext/ConditionBuilderProvider.js';
15
- import { blockClass, translateWithId } from '../ConditionBuilderContext/DataConfigs.js';
15
+ import { blockClass } from '../ConditionBuilderContext/DataConfigs.js';
16
16
  import { ConditionBuilderButton } from '../ConditionBuilderButton/ConditionBuilderButton.js';
17
17
  import uuidv4 from '../../../global/js/utils/uuidv4.js';
18
18
  import ConditionPreview from '../ConditionPreview/ConditionPreview.js';
19
19
  import GroupConnector from '../ConditionBuilderConnector/GroupConnector.js';
20
+ import ConditionBuilderActions from '../ConditionBuilderActions/ConditionBuilderActions.js';
21
+ import { useTranslations } from '../utils/useTranslations.js';
20
22
 
21
- var _Heading, _GroupConnector, _ConditionPreview;
23
+ var _GroupConnector;
22
24
  var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
23
- var _rootState$groups2;
25
+ var _rootState$groups3;
24
26
  var startConditionLabel = _ref.startConditionLabel,
25
- conditionBuilderRef = _ref.conditionBuilderRef,
26
27
  getConditionState = _ref.getConditionState,
27
- initialState = _ref.initialState;
28
- // const { rootState, setRootState, variant, actionState } = useContext(
29
- // ConditionBuilderContext
30
- // );
28
+ getActionsState = _ref.getActionsState,
29
+ initialState = _ref.initialState,
30
+ actions = _ref.actions;
31
31
  var _useContext = useContext(ConditionBuilderContext),
32
32
  rootState = _useContext.rootState,
33
33
  setRootState = _useContext.setRootState,
34
- variant = _useContext.variant;
34
+ variant = _useContext.variant,
35
+ actionState = _useContext.actionState;
35
36
  var _useState = useState(false),
36
37
  _useState2 = _slicedToArray(_useState, 2),
37
38
  isConditionBuilderActive = _useState2[0],
@@ -40,6 +41,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
40
41
  _useState4 = _slicedToArray(_useState3, 2),
41
42
  showConditionGroupPreview = _useState4[0],
42
43
  setShowConditionGroupPreview = _useState4[1];
44
+ var _useTranslations = useTranslations(['addConditionGroupText', 'conditionHeadingText']),
45
+ _useTranslations2 = _slicedToArray(_useTranslations, 2),
46
+ addConditionGroupText = _useTranslations2[0],
47
+ conditionHeadingText = _useTranslations2[1];
48
+ var showConditionGroupPreviewHandler = function showConditionGroupPreviewHandler() {
49
+ setShowConditionGroupPreview(true);
50
+ };
51
+ var hideConditionGroupPreviewHandler = function hideConditionGroupPreviewHandler() {
52
+ setShowConditionGroupPreview(false);
53
+ };
43
54
  useEffect(function () {
44
55
  var _rootState$groups;
45
56
  if (rootState !== null && rootState !== void 0 && (_rootState$groups = rootState.groups) !== null && _rootState$groups !== void 0 && _rootState$groups.length) {
@@ -53,11 +64,10 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
53
64
 
54
65
  // eslint-disable-next-line react-hooks/exhaustive-deps
55
66
  }, [rootState]);
56
-
57
- // useEffect(() => {
58
- // getActionsState?.(actionState);
59
- // // eslint-disable-next-line react-hooks/exhaustive-deps
60
- // }, [actionState]);
67
+ useEffect(function () {
68
+ getActionsState === null || getActionsState === void 0 || getActionsState(actionState);
69
+ // eslint-disable-next-line react-hooks/exhaustive-deps
70
+ }, [actionState]);
61
71
  var onStartConditionBuilder = function onStartConditionBuilder() {
62
72
  //when add condition button is clicked.
63
73
  setIsConditionBuilderActive(true);
@@ -83,8 +93,6 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
83
93
  };
84
94
  var addConditionGroupHandler = function addConditionGroupHandler() {
85
95
  var newGroup = {
86
- groupSeparateOperator: 'and',
87
- // 'or'|'and'|'null',
88
96
  groupOperator: 'and',
89
97
  //'and|or',
90
98
  statement: 'if',
@@ -102,28 +110,31 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
102
110
  groups: [].concat(_toConsumableArray(rootState.groups), [newGroup])
103
111
  }));
104
112
  };
105
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isConditionBuilderActive && /*#__PURE__*/React__default.createElement(Button, {
106
- className: "".concat(blockClass, "__add-condition-button"),
107
- renderIcon: function renderIcon(props) {
108
- return /*#__PURE__*/React__default.createElement(Add, _extends({
109
- size: 16
110
- }, props));
111
- },
112
- iconDescription: startConditionLabel,
113
- kind: "ghost",
114
- size: "sm",
115
- onClick: onStartConditionBuilder
116
- }, startConditionLabel), isConditionBuilderActive &&
117
- /*#__PURE__*/
118
- // <h5 >Condition</h5>
119
- React__default.createElement(Section, {
113
+ var getColorIndex = function getColorIndex() {
114
+ var _rootState$groups$len, _rootState$groups2;
115
+ var groupLength = (_rootState$groups$len = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.length) !== null && _rootState$groups$len !== void 0 ? _rootState$groups$len : 0;
116
+ return groupLength % 5;
117
+ };
118
+ if (!isConditionBuilderActive) {
119
+ return /*#__PURE__*/React__default.createElement(Button, {
120
+ className: "".concat(blockClass, "__addConditionText-button"),
121
+ renderIcon: function renderIcon(props) {
122
+ return /*#__PURE__*/React__default.createElement(Add, props);
123
+ },
124
+ iconDescription: startConditionLabel,
125
+ kind: "ghost",
126
+ size: "sm",
127
+ onClick: onStartConditionBuilder
128
+ }, startConditionLabel);
129
+ }
130
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Section, {
120
131
  className: "".concat(blockClass, "__heading"),
121
132
  level: 4
122
- }, _Heading || (_Heading = /*#__PURE__*/React__default.createElement(Heading, null, "Condition"))), /*#__PURE__*/React__default.createElement("div", {
133
+ }, /*#__PURE__*/React__default.createElement(Heading, null, conditionHeadingText)), /*#__PURE__*/React__default.createElement("div", {
123
134
  className: "".concat(blockClass, "__content-container"),
124
135
  role: "treegrid",
125
136
  "aria-label": "condition builder tree"
126
- }, rootState && (rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.map(function (eachGroup, groupIndex) {
137
+ }, rootState && (rootState === null || rootState === void 0 || (_rootState$groups3 = rootState.groups) === null || _rootState$groups3 === void 0 ? void 0 : _rootState$groups3.map(function (eachGroup, groupIndex) {
127
138
  return /*#__PURE__*/React__default.createElement("div", {
128
139
  key: eachGroup.id,
129
140
  className: "".concat(blockClass, "__group-wrapper")
@@ -140,32 +151,38 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
140
151
  },
141
152
  onChange: function onChange(updatedGroup) {
142
153
  onChangeHandler(updatedGroup, groupIndex);
143
- },
144
- conditionBuilderRef: conditionBuilderRef
154
+ }
145
155
  }), groupIndex < rootState.groups.length - 1 && (_GroupConnector || (_GroupConnector = /*#__PURE__*/React__default.createElement(GroupConnector, null))));
146
- })), isConditionBuilderActive && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, variant == 'tree' && /*#__PURE__*/React__default.createElement("div", {
156
+ })), variant == 'tree' && /*#__PURE__*/React__default.createElement("div", {
147
157
  role: "row",
148
158
  tabIndex: -1,
149
- "aria-level": 1
159
+ "aria-level": 1,
160
+ className: "".concat(blockClass, "__add-group")
150
161
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, {
151
162
  renderIcon: TextNewLine,
152
163
  onClick: addConditionGroupHandler,
153
- onMouseEnter: function onMouseEnter() {
154
- setShowConditionGroupPreview(true);
155
- },
156
- onMouseLeave: function onMouseLeave() {
157
- setShowConditionGroupPreview(false);
158
- },
164
+ onMouseEnter: showConditionGroupPreviewHandler,
165
+ onMouseLeave: hideConditionGroupPreviewHandler,
166
+ onFocus: showConditionGroupPreviewHandler,
167
+ onBlur: hideConditionGroupPreviewHandler,
159
168
  className: "".concat(blockClass, "__add-condition-group "),
160
169
  hideLabel: true,
161
- label: translateWithId('add-condition-sub-group'),
170
+ label: addConditionGroupText,
162
171
  wrapperProps: {
163
172
  role: 'gridcell',
164
- 'aria-label': translateWithId('add-condition-sub-group')
173
+ 'aria-label': addConditionGroupText
174
+ }
175
+ })), showConditionGroupPreview && /*#__PURE__*/React__default.createElement(ConditionPreview, {
176
+ previewType: "newGroup",
177
+ colorIndex: getColorIndex(),
178
+ group: {
179
+ groupOperator: rootState.operator
165
180
  }
166
- })), showConditionGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default.createElement(ConditionPreview, {
167
- previewType: "newGroup"
168
- }))))));
181
+ })), actions && /*#__PURE__*/React__default.createElement(ConditionBuilderActions, {
182
+ actions: actions,
183
+ className: "".concat(blockClass, "__actions-container"),
184
+ variant: variant
185
+ }));
169
186
  };
170
187
  var ConditionBuilderContent$1 = ConditionBuilderContent;
171
188
  ConditionBuilderContent.propTypes = {
@@ -173,13 +190,9 @@ ConditionBuilderContent.propTypes = {
173
190
  * optional array of object that give the list of actions.
174
191
  */
175
192
  actions: PropTypes.arrayOf(PropTypes.shape({
176
- id: PropTypes.number,
177
- label: PropTypes.string
193
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
194
+ label: PropTypes.string.isRequired
178
195
  })),
179
- /**
180
- * ref of condition builder
181
- */
182
- conditionBuilderRef: PropTypes.object,
183
196
  /**
184
197
  * callback functions that will provide the updated action state back.
185
198
  */
@@ -193,15 +206,21 @@ ConditionBuilderContent.propTypes = {
193
206
  */
194
207
  initialState: PropTypes.shape({
195
208
  groups: PropTypes.arrayOf(PropTypes.shape({
196
- groupSeparateOperator: PropTypes.string,
197
- groupOperator: PropTypes.string,
198
- statement: PropTypes.string,
199
- conditions: PropTypes.arrayOf(PropTypes.shape({
200
- property: PropTypes.string,
201
- operator: PropTypes.string,
202
- value: PropTypes.string
203
- }))
204
- }))
209
+ groupOperator: PropTypes.string.isRequired,
210
+ statement: PropTypes.string.isRequired,
211
+ conditions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
212
+ property: PropTypes.string.isRequired,
213
+ operator: PropTypes.string.isRequired,
214
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.shape({
215
+ id: PropTypes.string,
216
+ label: PropTypes.string
217
+ })), PropTypes.shape({
218
+ id: PropTypes.string,
219
+ label: PropTypes.string
220
+ })])
221
+ }), PropTypes.object]))
222
+ })),
223
+ operator: PropTypes.string
205
224
  }),
206
225
  /* Provide a label to the button that starts condition builder
207
226
  */
@@ -1,7 +1,6 @@
1
1
  export namespace emptyState {
2
2
  let operator: string;
3
3
  let groups: {
4
- groupSeparateOperator: null;
5
4
  groupOperator: string;
6
5
  statement: string;
7
6
  id: any;
@@ -19,24 +18,31 @@ export function ConditionBuilderProvider(props: any): import("react/jsx-runtime"
19
18
  export namespace ConditionBuilderProvider {
20
19
  namespace propTypes {
21
20
  let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
21
+ let conditionBuilderRef: PropTypes.Requireable<object>;
22
22
  let getOptions: PropTypes.Requireable<(...args: any[]) => any>;
23
23
  let inputConfig: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
24
24
  properties: PropTypes.Requireable<(PropTypes.InferProps<{
25
- id: PropTypes.Requireable<string>;
26
- label: PropTypes.Requireable<string>;
25
+ id: PropTypes.Validator<string>;
26
+ label: PropTypes.Validator<string>;
27
27
  icon: PropTypes.Requireable<object>;
28
- type: PropTypes.Requireable<string>;
28
+ type: PropTypes.Validator<string>;
29
29
  config: PropTypes.Requireable<PropTypes.InferProps<{
30
30
  options: PropTypes.Requireable<(PropTypes.InferProps<{
31
- id: PropTypes.Requireable<string>;
32
- label: PropTypes.Requireable<string>;
31
+ id: PropTypes.Validator<string>;
32
+ label: PropTypes.Validator<string>;
33
33
  icon: PropTypes.Requireable<object>;
34
34
  }> | null | undefined)[]>;
35
- includeSearch: PropTypes.Requireable<boolean>;
35
+ component: PropTypes.Requireable<(...args: any[]) => any>;
36
+ operators: PropTypes.Requireable<(PropTypes.InferProps<{
37
+ id: PropTypes.Validator<string>;
38
+ label: PropTypes.Validator<string>;
39
+ }> | null | undefined)[]>;
40
+ long: PropTypes.Requireable<boolean>;
36
41
  }>>;
37
42
  }> | null | undefined)[]>;
38
43
  }>>>;
39
44
  let popOverSearchThreshold: PropTypes.Validator<number>;
45
+ let translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
40
46
  let variant: PropTypes.Validator<string>;
41
47
  }
42
48
  }
@@ -13,7 +13,6 @@ import uuidv4 from '../../../global/js/utils/uuidv4.js';
13
13
  var emptyState = {
14
14
  operator: 'or',
15
15
  groups: [{
16
- groupSeparateOperator: null,
17
16
  groupOperator: 'and',
18
17
  statement: 'if',
19
18
  id: uuidv4(),
@@ -50,14 +49,22 @@ var ConditionBuilderProvider = function ConditionBuilderProvider(props) {
50
49
  _useState2 = _slicedToArray(_useState, 2),
51
50
  rootState = _useState2[0],
52
51
  setRootState = _useState2[1];
52
+ var _useState3 = useState([]),
53
+ _useState4 = _slicedToArray(_useState3, 2),
54
+ actionState = _useState4[0],
55
+ setActionState = _useState4[1];
53
56
  return /*#__PURE__*/React__default.createElement(ConditionBuilderContext.Provider, {
54
57
  value: {
55
58
  rootState: rootState,
56
59
  setRootState: setRootState,
60
+ actionState: actionState,
61
+ setActionState: setActionState,
57
62
  inputConfig: props.inputConfig,
58
63
  popOverSearchThreshold: props.popOverSearchThreshold,
59
64
  getOptions: props.getOptions,
60
- variant: props.variant
65
+ variant: props.variant,
66
+ translateWithId: props.translateWithId,
67
+ conditionBuilderRef: props.conditionBuilderRef
61
68
  }
62
69
  },
63
70
  // eslint-disable-next-line react/prop-types
@@ -68,6 +75,10 @@ ConditionBuilderProvider.propTypes = {
68
75
  * Provide the contents of the ConditionBuilder.
69
76
  */
70
77
  children: PropTypes.node.isRequired,
78
+ /**
79
+ * ref of condition builder
80
+ */
81
+ conditionBuilderRef: PropTypes.object,
71
82
  /**
72
83
  * This is an optional callback function that will be triggered when options array is not passed in the inputConfig against a property.
73
84
  * This can be a asynchronous function that need to return a promise, so it will allow to fetch options from API call.
@@ -84,17 +95,22 @@ ConditionBuilderProvider.propTypes = {
84
95
  */
85
96
  inputConfig: PropTypes.shape({
86
97
  properties: PropTypes.arrayOf(PropTypes.shape({
87
- id: PropTypes.string,
88
- label: PropTypes.string,
98
+ id: PropTypes.string.isRequired,
99
+ label: PropTypes.string.isRequired,
89
100
  icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
90
- type: PropTypes.oneOf(['text', 'number', 'date', 'option', 'time']),
101
+ type: PropTypes.oneOf(['text', 'textarea', 'number', 'date', 'option', 'time', 'custom']).isRequired,
91
102
  config: PropTypes.shape({
92
103
  options: PropTypes.arrayOf(PropTypes.shape({
93
- id: PropTypes.string,
94
- label: PropTypes.string,
104
+ id: PropTypes.string.isRequired,
105
+ label: PropTypes.string.isRequired,
95
106
  icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
96
107
  })),
97
- includeSearch: PropTypes.bool
108
+ component: PropTypes.func,
109
+ operators: PropTypes.arrayOf(PropTypes.shape({
110
+ id: PropTypes.string.isRequired,
111
+ label: PropTypes.string.isRequired
112
+ })),
113
+ long: PropTypes.bool
98
114
  })
99
115
  }))
100
116
  }).isRequired,
@@ -102,6 +118,13 @@ ConditionBuilderProvider.propTypes = {
102
118
  * Provide an mandatory numeric value that will be used to enable search option in the popovers with list.
103
119
  */
104
120
  popOverSearchThreshold: PropTypes.number.isRequired,
121
+ /**
122
+ * Optional prop if you want to pass translation to the texts used . Otherwise this will the defined defaults.
123
+ * This callback function will receive the message id and you need to return the corresponding text for that id.
124
+ * The message key will be one of [ "ifText", "addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText", "invalidNumberWarnText"
125
+ ]
126
+ */
127
+ translateWithId: PropTypes.func,
105
128
  /**
106
129
  * Provide the condition builder variant: sentence/ tree
107
130
  */
@@ -1,22 +1,28 @@
1
1
  export const statementConfig: {
2
2
  label: string;
3
3
  id: string;
4
+ connector: string;
4
5
  }[];
5
6
  export const connectorConfig: {
6
7
  label: string;
7
8
  id: string;
8
9
  }[];
10
+ export const actionConfig: {
11
+ label: string;
12
+ id: string;
13
+ }[];
9
14
  export const operatorConfig: {
10
15
  label: string;
11
16
  id: string;
12
17
  type: string;
13
18
  }[];
14
19
  export const blockClass: string;
15
- export function translateWithId(key: any): any;
16
20
  export namespace valueRenderers {
17
21
  function text(val: any): any;
22
+ function textarea(val: any): any;
18
23
  function time(val: any): any;
19
- function number(val: any, config: any): any;
24
+ function number(val: any): any;
20
25
  function option(value: any): any;
21
26
  function date(value: any): any;
27
+ function custom(value: any): any;
22
28
  }
@@ -6,14 +6,15 @@
6
6
  */
7
7
 
8
8
  import { pkg } from '../../../settings.js';
9
- import { translationsObject } from './translationObject.js';
10
9
 
11
10
  var statementConfig = [{
12
11
  label: 'if',
13
- id: 'if'
12
+ id: 'if',
13
+ connector: 'and'
14
14
  }, {
15
15
  label: 'excl.if',
16
- id: 'excl.if'
16
+ id: 'excl_if',
17
+ connector: 'or'
17
18
  }];
18
19
  var connectorConfig = [{
19
20
  label: 'and',
@@ -22,7 +23,6 @@ var connectorConfig = [{
22
23
  label: 'or',
23
24
  id: 'or'
24
25
  }];
25
- //op types : option, text, number, date,
26
26
  var operatorConfig = [{
27
27
  label: 'is',
28
28
  id: 'is',
@@ -33,7 +33,7 @@ var operatorConfig = [{
33
33
  type: 'number'
34
34
  }, {
35
35
  label: 'is greater than or equal to',
36
- id: 'greater-equal',
36
+ id: 'greaterEqual',
37
37
  type: 'number'
38
38
  }, {
39
39
  label: 'is lower than',
@@ -41,23 +41,23 @@ var operatorConfig = [{
41
41
  type: 'number'
42
42
  }, {
43
43
  label: 'is lower than or equal to',
44
- id: 'lower-equal',
44
+ id: 'lowerEqual',
45
45
  type: 'number'
46
46
  }, {
47
47
  label: 'starts with',
48
- id: 'starts-with',
49
- type: 'text'
48
+ id: 'startsWith',
49
+ type: 'text,textarea'
50
50
  }, {
51
51
  label: 'ends with',
52
- id: 'ends-with',
53
- type: 'text'
52
+ id: 'endsWith',
53
+ type: 'text,textarea'
54
54
  }, {
55
55
  label: 'contains',
56
56
  id: 'contains',
57
- type: 'text'
57
+ type: 'text,textarea'
58
58
  }, {
59
59
  label: 'is one of',
60
- id: 'one-of',
60
+ id: 'oneOf',
61
61
  type: 'option'
62
62
  }, {
63
63
  label: 'is before',
@@ -80,33 +80,44 @@ var formatDate = function formatDate(date) {
80
80
  var year = date.getFullYear();
81
81
  return "".concat(day, "/").concat(month, "/").concat(year);
82
82
  };
83
- var translationsObjectCurrent = translationsObject['en']; // TO DO: need to discuss if language is to be passed as prop
84
- var translateWithId = function translateWithId(key) {
85
- var _translationsObjectCu;
86
- return (_translationsObjectCu = translationsObjectCurrent[key]) !== null && _translationsObjectCu !== void 0 ? _translationsObjectCu : key;
87
- };
83
+ //const translationsObjectCurrent = translationsObject['en']; // TO DO: need to discuss if language is to be passed as prop
84
+
88
85
  var valueRenderers = {
89
86
  text: function text(val) {
90
87
  return val;
91
88
  },
89
+ textarea: function textarea(val) {
90
+ return val;
91
+ },
92
92
  time: function time(val) {
93
93
  return val;
94
94
  },
95
- number: function number(val, config) {
96
- return config.unit && val ? "".concat(val, " ").concat(config.unit) : val;
95
+ number: function number(val) {
96
+ return val;
97
97
  },
98
98
  option: function option(value) {
99
- return Array.isArray(value) ? value.join(', ') : value;
99
+ if (value && typeof value !== 'string') {
100
+ var selectedValues = Array.isArray(value) ? value : [value];
101
+ return selectedValues.map(function (option) {
102
+ return option.label;
103
+ }).join(', ');
104
+ }
105
+ return value;
100
106
  },
101
107
  date: function date(value) {
102
108
  if (Array.isArray(value) && value.length > 1) {
103
- var start = value !== null && value !== void 0 && value[0] ? formatDate(new Date(value[0])) : '';
104
- var end = value !== null && value !== void 0 && value[1] ? formatDate(new Date(value[1])) : '';
109
+ var start = value !== null && value !== void 0 && value[0] && !isNaN(new Date(value[0])) ? formatDate(new Date(value[0])) : '';
110
+ var end = value !== null && value !== void 0 && value[1] && !isNaN(new Date(value[1])) ? formatDate(new Date(value[1])) : '';
105
111
  return "".concat(start, " To ").concat(end);
112
+ } else if (Array.isArray(value) && !isNaN(new Date(value[0]))) {
113
+ return formatDate(new Date(value[0]));
106
114
  } else {
107
- return value && new Date(value) ? formatDate(new Date(value)) : value;
115
+ return value;
108
116
  }
117
+ },
118
+ custom: function custom(value) {
119
+ return value;
109
120
  }
110
121
  };
111
122
 
112
- export { blockClass, connectorConfig, operatorConfig, statementConfig, translateWithId, valueRenderers };
123
+ export { blockClass, connectorConfig, operatorConfig, statementConfig, valueRenderers };
@@ -1,38 +1,45 @@
1
1
  export namespace translationsObject {
2
- let en: {
3
- if: string;
4
- 'excl-if': string;
5
- and: string;
6
- or: string;
7
- is: string;
8
- greater: string;
9
- 'greater-equal': string;
10
- lower: string;
11
- 'lower-equal': string;
12
- 'starts-with': string;
13
- 'ends-with': string;
14
- contains: string;
15
- 'one-of': string;
16
- before: string;
17
- after: string;
18
- between: string;
19
- 'add-condition': string;
20
- 'add-condition-group': string;
21
- 'add-condition-sub-group': string;
22
- condition: string;
23
- property: string;
24
- operator: string;
25
- value: string;
26
- connector: string;
27
- condition_row: string;
28
- remove_condition: string;
29
- add_condition_row: string;
30
- start: string;
31
- end: string;
32
- clear_search: string;
33
- actions: string;
34
- then: string;
35
- remove_action: string;
36
- add_action: string;
37
- };
2
+ let ifText: string;
3
+ let excl_if: string;
4
+ let and: string;
5
+ let or: string;
6
+ let is: string;
7
+ let greater: string;
8
+ let greaterEqual: string;
9
+ let lower: string;
10
+ let lowerEqual: string;
11
+ let startsWith: string;
12
+ let endsWith: string;
13
+ let contains: string;
14
+ let oneOf: string;
15
+ let before: string;
16
+ let after: string;
17
+ let between: string;
18
+ let addConditionText: string;
19
+ let addConditionGroupText: string;
20
+ let addSubgroupText: string;
21
+ let conditionText: string;
22
+ let propertyText: string;
23
+ let operatorText: string;
24
+ let valueText: string;
25
+ let connectorText: string;
26
+ let conditionRowText: string;
27
+ let conditionRowGroupText: string;
28
+ let removeConditionText: string;
29
+ let addConditionRowText: string;
30
+ let startText: string;
31
+ let endText: string;
32
+ let clearSearchText: string;
33
+ let actionsText: string;
34
+ let then: string;
35
+ let removeActionText: string;
36
+ let addActionText: string;
37
+ let invalidText: string;
38
+ let invalidNumberWarnText: string;
39
+ let conditionBuilderText: string;
40
+ let actionSectionText: string;
41
+ let conditionHeadingText: string;
42
+ let addPropertyText: string;
43
+ let addOperatorText: string;
44
+ let addValueText: string;
38
45
  }