@geotab/zenith 3.1.1-beta.5 → 3.2.0-beta.0

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 (442) hide show
  1. package/README.md +20 -0
  2. package/dist/advancedGroupsFilter/advancedGroupsFilter.js +136 -30
  3. package/dist/advancedGroupsFilter/advancedGroupsFilterForm.js +139 -34
  4. package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +352 -87
  5. package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.d.ts +0 -1
  6. package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +83 -9
  7. package/dist/alertRaw/alertRaw.js +175 -54
  8. package/dist/banner/bannerMultipLine.js +131 -23
  9. package/dist/banner/bannerSingleLine.js +110 -16
  10. package/dist/betaPill/betaPill.js +111 -20
  11. package/dist/bookmark/bookmark.js +95 -28
  12. package/dist/bulkEditControl/bulkEditControl.js +167 -34
  13. package/dist/calendar/calendar.js +943 -273
  14. package/dist/calendar/calendarUtils.js +157 -85
  15. package/dist/card/card.js +268 -123
  16. package/dist/chart/accessibleChart/accessibleChartNarrative.js +648 -555
  17. package/dist/chart/accessibleChart/accessibleChartTable.js +245 -86
  18. package/dist/chart/chart.js +36 -21
  19. package/dist/chart/chartAxis/chartAxis.js +85 -7
  20. package/dist/checkboxListWithAction/checkboxListWithAction.js +224 -69
  21. package/dist/chip/chip.js +195 -91
  22. package/dist/columnsSelector/columnsSelector.js +97 -12
  23. package/dist/columnsSelector/columnsTab/columnsTab.js +59 -15
  24. package/dist/columnsSelector/columnsTabGroup/columnsTabGroup.js +81 -34
  25. package/dist/comboboxSelected/comboboxSelected.js +1 -3
  26. package/dist/dataFeed/feedExpandControl/feedExpandControl.js +25 -10
  27. package/dist/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +92 -11
  28. package/dist/dataGrid/dataGrid.js +227 -117
  29. package/dist/dataGrid/emptySearchList/emptySearchList.js +56 -9
  30. package/dist/dataGrid/entitiesListActions/actions/columnsListButton.js +51 -7
  31. package/dist/dataGrid/entitiesListActions/actions/fullscreenButton.js +64 -18
  32. package/dist/dataGrid/withFlexibleColumns/components/columnSettings.js +84 -10
  33. package/dist/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +48 -16
  34. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +223 -32
  35. package/dist/dataGrid/withSelectableRows/withSelectableRows.js +286 -213
  36. package/dist/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +178 -95
  37. package/dist/dateInputInner/dateInputInner.js +791 -476
  38. package/dist/dateInputInner/dateInputInnerControlBlock.js +125 -22
  39. package/dist/dateInputRaw/dateInputRaw.js +315 -104
  40. package/dist/dateInputRaw/utils/getLabel.js +38 -7
  41. package/dist/dateRangeInner/dateRangeInner.js +172 -58
  42. package/dist/dateRangeRaw/dateRangeRaw.js +601 -239
  43. package/dist/dateRangeRaw/utils/dateRangeUtils.js +629 -241
  44. package/dist/dateSelectionWrapper/dateSelectionWrapper.js +152 -14
  45. package/dist/dialog/dialogContent.js +123 -40
  46. package/dist/dropdownRaw/dropdownHelper.d.ts +2 -2
  47. package/dist/dropdownRaw/dropdownHelper.js +9 -9
  48. package/dist/dropdownRaw/dropdownList.js +447 -78
  49. package/dist/dropdownRaw/dropdownPopup.js +218 -20
  50. package/dist/dropdownRaw/dropdownRaw.js +866 -506
  51. package/dist/dropdownRaw/dropdownSearchableTrigger.js +223 -46
  52. package/dist/dropdownRaw/stateReducer/stateAction.d.ts +5 -1
  53. package/dist/dropdownRaw/stateReducer/stateActionType.d.ts +2 -1
  54. package/dist/dropdownRaw/stateReducer/stateActionType.js +1 -0
  55. package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +6 -1
  56. package/dist/dropdownRaw/stateReducer/stateReducer.js +24 -12
  57. package/dist/dropdownRaw/stateReducer/stateReducerHelper.d.ts +2 -0
  58. package/dist/dropdownRaw/stateReducer/stateReducerHelper.js +20 -1
  59. package/dist/dropdownRaw/stateReducer/stateReducerTestData.d.ts +39 -0
  60. package/dist/dropdownRaw/stateReducer/stateReducerTestData.js +74 -0
  61. package/dist/dropdownRaw/types.d.ts +1 -0
  62. package/dist/favoriteButton/favoriteButton.js +59 -10
  63. package/dist/filters/components/filtersContainer.js +151 -64
  64. package/dist/filters/components/filtersEmptySelectedList.js +30 -4
  65. package/dist/filters/components/filtersSaveModal.js +140 -42
  66. package/dist/filters/components/filtersSavedChipComponent.js +318 -108
  67. package/dist/filters/components/filtersSearchItemData.js +127 -47
  68. package/dist/filters/components/filtersSearchList.js +381 -179
  69. package/dist/filters/components/filtersSelect.js +128 -61
  70. package/dist/filters/components/filtersSelectListItem.js +125 -13
  71. package/dist/filters/components/filtersSidePanel.js +510 -178
  72. package/dist/filters/filters.js +445 -268
  73. package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +729 -272
  74. package/dist/filtersBar/components/resetComponentButton.js +45 -5
  75. package/dist/filtersBar/filtersBarActions/filtersBarActions.js +126 -15
  76. package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +155 -49
  77. package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +360 -104
  78. package/dist/filtersBar/filtersContainer/filtersContainer.js +204 -134
  79. package/dist/formField/components/formFieldWithLabel.d.ts +2 -1
  80. package/dist/formField/components/formFieldWithLabel.js +3 -2
  81. package/dist/formField/components/formFieldWithoutLabel.d.ts +2 -1
  82. package/dist/formField/components/formFieldWithoutLabel.js +3 -3
  83. package/dist/formField/components/trailingComponent.d.ts +8 -0
  84. package/dist/formField/components/trailingComponent.js +11 -0
  85. package/dist/formField/formField.d.ts +0 -1
  86. package/dist/formField/formField.js +15 -16
  87. package/dist/formField/hooks/useError.js +100 -36
  88. package/dist/formGroup/components/reviewListToggle/reviewListToggle.js +72 -7
  89. package/dist/formGroup/hooks/useToggle.js +37 -11
  90. package/dist/formGroup/utils/getControls.js +8 -7
  91. package/dist/formLayout/hooks/useError.js +55 -15
  92. package/dist/formLayout/hooks/useFormButtons.js +128 -27
  93. package/dist/formSection/components/formSectionModal.js +1 -1
  94. package/dist/formSection/formSection.js +1 -1
  95. package/dist/formSection/hooks/useError.js +70 -22
  96. package/dist/formStepper/components/formStep.js +65 -10
  97. package/dist/formStepper/formStepper.js +129 -33
  98. package/dist/formStepperButtons/formStepperButtons.js +184 -38
  99. package/dist/groupsFilter/groupsFilterTestData.d.ts +37 -0
  100. package/dist/groupsFilter/groupsFilterTestData.js +7 -0
  101. package/dist/groupsFilter/groupsHelper.d.ts +24 -1
  102. package/dist/groupsFilter/groupsHelper.js +25 -15
  103. package/dist/groupsFilterRaw/groupsFilterAdjustmentState.js +162 -17
  104. package/dist/groupsFilterRaw/groupsFilterBox.js +137 -32
  105. package/dist/groupsFilterRaw/groupsFilterCommon.js +75 -8
  106. package/dist/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +184 -25
  107. package/dist/groupsFilterRaw/groupsFilterHelper.d.ts +2 -1
  108. package/dist/groupsFilterRaw/groupsFilterHelper.js +284 -168
  109. package/dist/groupsFilterRaw/groupsFilterInitialState.js +266 -18
  110. package/dist/groupsFilterRaw/groupsFilterMenu.js +124 -9
  111. package/dist/groupsFilterRaw/groupsFilterRaw.d.ts +1 -0
  112. package/dist/groupsFilterRaw/groupsFilterRaw.js +816 -308
  113. package/dist/groupsFilterRaw/groupsFilterTestData.d.ts +155 -2
  114. package/dist/groupsFilterRaw/groupsFilterTestData.js +153 -58
  115. package/dist/groupsFilterRaw/groupsFilterTrigger.js +139 -35
  116. package/dist/groupsFilterRaw/groupsHelper.js +739 -208
  117. package/dist/groupsFilterRaw/stateReducer/stateReducerHelper.js +3 -1
  118. package/dist/groupsFilterRaw/types.d.ts +1 -0
  119. package/dist/header/components/collapsedItemsControl/collapsedItemsControl.js +107 -52
  120. package/dist/header/components/mobileFilterControl/mobileFilterControl.js +62 -9
  121. package/dist/header/components/mobileSearchControl/mobileSearchControl.js +119 -14
  122. package/dist/header/headerBack.js +64 -20
  123. package/dist/index.css +110 -71
  124. package/dist/index.d.ts +2 -1
  125. package/dist/index.js +5 -2
  126. package/dist/list/itemData/itemDataInternal.js +216 -51
  127. package/dist/list/listItem/listItem.js +168 -55
  128. package/dist/menu/components/menuErrorItem.js +33 -5
  129. package/dist/mobileSheet/mobileSheet.js +195 -69
  130. package/dist/modal/modal.js +300 -142
  131. package/dist/nav/nav.js +1 -1
  132. package/dist/nav/navFooter/navFooter.js +82 -39
  133. package/dist/nav/navFooter/navFooterAction/navFooterAction.js +52 -13
  134. package/dist/nav/navHeader/navHeader.js +86 -36
  135. package/dist/nav/navHeader/navHeaderSearch/navHeaderSearch.js +88 -29
  136. package/dist/nav/navItem/navItem.d.ts +3 -3
  137. package/dist/nav/navItem/navItem.js +35 -33
  138. package/dist/nav/navMobileBar/navMobileBar.js +67 -21
  139. package/dist/notification/notification.js +124 -21
  140. package/dist/pagination/paginationArrow.js +81 -11
  141. package/dist/pagination/paginationText/paginationText.js +45 -11
  142. package/dist/pill/components/pillNonActionable/pillNonActionable.js +93 -24
  143. package/dist/pillBox/components/pillBoxItem.js +52 -9
  144. package/dist/pillBox/pillBox.js +121 -20
  145. package/dist/pillExpandable/pillExpandable.js +333 -139
  146. package/dist/rangeRaw/rangeRaw.js +486 -141
  147. package/dist/rangeRaw/utils/rangeHelper.js +209 -39
  148. package/dist/searchInputRaw/searchInputRaw.js +180 -65
  149. package/dist/skeleton/skeleton.js +51 -6
  150. package/dist/sortControl/sortControl.js +152 -42
  151. package/dist/stepperRaw/stepperRaw.js +116 -42
  152. package/dist/summary/summary.js +94 -8
  153. package/dist/table/actions/actionsMenu.js +171 -78
  154. package/dist/table/flexible/columnSettings.js +80 -10
  155. package/dist/table/flexible/columnsList.js +110 -43
  156. package/dist/table/flexible/columnsPopup.js +77 -20
  157. package/dist/table/nested/useNestedRows.js +167 -77
  158. package/dist/table/selectable/selectableHeader.js +180 -41
  159. package/dist/table/selectable/useSelectableRows.js +270 -191
  160. package/dist/table/sortable/sortableHeader.js +153 -75
  161. package/dist/tabs/tabs.js +227 -118
  162. package/dist/timePickerRaw/timePickerRaw.js +278 -58
  163. package/dist/toastRaw/toastRaw.js +138 -32
  164. package/dist/toggleButton/toggleButton.d.ts +0 -1
  165. package/dist/toggleButtonRaw/toggleButtonRaw.d.ts +1 -0
  166. package/dist/toggleButtonRaw/toggleButtonRaw.js +146 -40
  167. package/dist/utils/formatDate.js +1001 -117
  168. package/{esm/utils/localization/translations/cs-json.js → dist/utils/localization/translations/cs.json} +11 -12
  169. package/{esm/utils/localization/translations/da-DK-json.js → dist/utils/localization/translations/da-DK.json} +31 -23
  170. package/{esm/utils/localization/translations/de-json.js → dist/utils/localization/translations/de.json} +12 -13
  171. package/dist/utils/localization/translations/en.json +308 -0
  172. package/{esm/utils/localization/translations/es-json.js → dist/utils/localization/translations/es.json} +11 -12
  173. package/{esm/utils/localization/translations/fi-FI-json.js → dist/utils/localization/translations/fi-FI.json} +31 -23
  174. package/{esm/utils/localization/translations/fr-FR-json.js → dist/utils/localization/translations/fr-FR.json} +12 -12
  175. package/{esm/utils/localization/translations/fr-json.js → dist/utils/localization/translations/fr.json} +11 -12
  176. package/{esm/utils/localization/translations/hu-HU-json.js → dist/utils/localization/translations/hu-HU.json} +31 -23
  177. package/{esm/utils/localization/translations/id-json.js → dist/utils/localization/translations/id.json} +11 -13
  178. package/{esm/utils/localization/translations/it-json.js → dist/utils/localization/translations/it.json} +11 -12
  179. package/{esm/utils/localization/translations/ja-json.js → dist/utils/localization/translations/ja.json} +11 -12
  180. package/{esm/utils/localization/translations/ko-KR-json.js → dist/utils/localization/translations/ko-KR.json} +24 -23
  181. package/{esm/utils/localization/translations/ms-json.js → dist/utils/localization/translations/ms.json} +11 -12
  182. package/{esm/utils/localization/translations/nb-NO-json.js → dist/utils/localization/translations/nb-NO.json} +31 -23
  183. package/{esm/utils/localization/translations/nl-json.js → dist/utils/localization/translations/nl.json} +11 -12
  184. package/{esm/utils/localization/translations/pl-json.js → dist/utils/localization/translations/pl.json} +11 -12
  185. package/{esm/utils/localization/translations/pt-BR-json.js → dist/utils/localization/translations/pt-BR.json} +11 -12
  186. package/{esm/utils/localization/translations/sk-SK-json.js → dist/utils/localization/translations/sk-SK.json} +31 -23
  187. package/{esm/utils/localization/translations/sv-json.js → dist/utils/localization/translations/sv.json} +11 -12
  188. package/{esm/utils/localization/translations/th-json.js → dist/utils/localization/translations/th.json} +11 -12
  189. package/{esm/utils/localization/translations/tr-json.js → dist/utils/localization/translations/tr.json} +11 -12
  190. package/{esm/utils/localization/translations/zh-Hans-json.js → dist/utils/localization/translations/zh-Hans.json} +11 -12
  191. package/{esm/utils/localization/translations/zh-TW-json.js → dist/utils/localization/translations/zh-TW.json} +11 -23
  192. package/dist/utils/localization/translationsDictionary.d.ts +2 -0
  193. package/dist/utils/localization/translationsDictionary.js +63 -0
  194. package/dist/utils/localization/useLanguage.js +2 -74
  195. package/esm/advancedGroupsFilter/advancedGroupsFilter.js +130 -29
  196. package/esm/advancedGroupsFilter/advancedGroupsFilterForm.js +133 -33
  197. package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +317 -65
  198. package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.d.ts +0 -1
  199. package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +77 -8
  200. package/esm/alertRaw/alertRaw.js +165 -51
  201. package/esm/banner/bannerMultipLine.js +121 -20
  202. package/esm/banner/bannerSingleLine.js +100 -13
  203. package/esm/betaPill/betaPill.js +105 -19
  204. package/esm/bookmark/bookmark.js +89 -27
  205. package/esm/bulkEditControl/bulkEditControl.js +161 -33
  206. package/esm/calendar/calendar.js +937 -272
  207. package/esm/calendar/calendarUtils.js +151 -84
  208. package/esm/card/card.js +233 -101
  209. package/esm/chart/accessibleChart/accessibleChartNarrative.js +642 -554
  210. package/esm/chart/accessibleChart/accessibleChartTable.js +239 -85
  211. package/esm/chart/chart.js +30 -20
  212. package/esm/chart/chartAxis/chartAxis.js +79 -6
  213. package/esm/checkboxListWithAction/checkboxListWithAction.js +218 -68
  214. package/esm/chip/chip.js +189 -90
  215. package/esm/columnsSelector/columnsSelector.js +91 -11
  216. package/esm/columnsSelector/columnsTab/columnsTab.js +53 -14
  217. package/esm/columnsSelector/columnsTabGroup/columnsTabGroup.js +75 -33
  218. package/esm/comboboxSelected/comboboxSelected.js +1 -3
  219. package/esm/dataFeed/feedExpandControl/feedExpandControl.js +21 -9
  220. package/esm/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +86 -10
  221. package/esm/dataGrid/dataGrid.js +221 -116
  222. package/esm/dataGrid/emptySearchList/emptySearchList.js +50 -8
  223. package/esm/dataGrid/entitiesListActions/actions/columnsListButton.js +45 -6
  224. package/esm/dataGrid/entitiesListActions/actions/fullscreenButton.js +58 -17
  225. package/esm/dataGrid/withFlexibleColumns/components/columnSettings.js +78 -9
  226. package/esm/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +44 -15
  227. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +217 -31
  228. package/esm/dataGrid/withSelectableRows/withSelectableRows.js +280 -212
  229. package/esm/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +172 -94
  230. package/esm/dateInputInner/dateInputInner.js +785 -475
  231. package/esm/dateInputInner/dateInputInnerControlBlock.js +119 -21
  232. package/esm/dateInputRaw/dateInputRaw.js +309 -103
  233. package/esm/dateInputRaw/utils/getLabel.js +32 -6
  234. package/esm/dateRangeInner/dateRangeInner.js +166 -57
  235. package/esm/dateRangeRaw/dateRangeRaw.js +595 -238
  236. package/esm/dateRangeRaw/utils/dateRangeUtils.js +622 -239
  237. package/esm/dateSelectionWrapper/dateSelectionWrapper.js +146 -13
  238. package/esm/dialog/dialogContent.js +117 -39
  239. package/esm/dropdownRaw/dropdownHelper.d.ts +2 -2
  240. package/esm/dropdownRaw/dropdownHelper.js +10 -10
  241. package/esm/dropdownRaw/dropdownList.js +412 -56
  242. package/esm/dropdownRaw/dropdownPopup.js +212 -19
  243. package/esm/dropdownRaw/dropdownRaw.js +862 -507
  244. package/esm/dropdownRaw/dropdownSearchableTrigger.js +217 -45
  245. package/esm/dropdownRaw/stateReducer/stateAction.d.ts +5 -1
  246. package/esm/dropdownRaw/stateReducer/stateActionType.d.ts +2 -1
  247. package/esm/dropdownRaw/stateReducer/stateActionType.js +1 -0
  248. package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +6 -1
  249. package/esm/dropdownRaw/stateReducer/stateReducer.js +24 -12
  250. package/esm/dropdownRaw/stateReducer/stateReducerHelper.d.ts +2 -0
  251. package/esm/dropdownRaw/stateReducer/stateReducerHelper.js +18 -0
  252. package/esm/dropdownRaw/stateReducer/stateReducerTestData.d.ts +39 -0
  253. package/esm/dropdownRaw/stateReducer/stateReducerTestData.js +71 -0
  254. package/esm/dropdownRaw/types.d.ts +1 -0
  255. package/esm/favoriteButton/favoriteButton.js +53 -9
  256. package/esm/filters/components/filtersContainer.js +141 -61
  257. package/esm/filters/components/filtersEmptySelectedList.js +24 -3
  258. package/esm/filters/components/filtersSaveModal.js +134 -41
  259. package/esm/filters/components/filtersSavedChipComponent.js +312 -107
  260. package/esm/filters/components/filtersSearchItemData.js +121 -46
  261. package/esm/filters/components/filtersSearchList.js +375 -178
  262. package/esm/filters/components/filtersSelect.js +122 -60
  263. package/esm/filters/components/filtersSelectListItem.js +119 -12
  264. package/esm/filters/components/filtersSidePanel.js +504 -177
  265. package/esm/filters/filters.js +435 -265
  266. package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +722 -270
  267. package/esm/filtersBar/components/resetComponentButton.js +39 -4
  268. package/esm/filtersBar/filtersBarActions/filtersBarActions.js +120 -14
  269. package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +149 -48
  270. package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +354 -103
  271. package/esm/filtersBar/filtersContainer/filtersContainer.js +198 -133
  272. package/esm/formField/components/formFieldWithLabel.d.ts +2 -1
  273. package/esm/formField/components/formFieldWithLabel.js +3 -2
  274. package/esm/formField/components/formFieldWithoutLabel.d.ts +2 -1
  275. package/esm/formField/components/formFieldWithoutLabel.js +3 -3
  276. package/esm/formField/components/trailingComponent.d.ts +8 -0
  277. package/esm/formField/components/trailingComponent.js +7 -0
  278. package/esm/formField/formField.d.ts +0 -1
  279. package/esm/formField/formField.js +15 -16
  280. package/esm/formField/hooks/useError.js +94 -35
  281. package/esm/formGroup/components/reviewListToggle/reviewListToggle.js +66 -6
  282. package/esm/formGroup/hooks/useToggle.js +31 -10
  283. package/esm/formGroup/utils/getControls.js +8 -7
  284. package/esm/formLayout/hooks/useError.js +49 -14
  285. package/esm/formLayout/hooks/useFormButtons.js +122 -26
  286. package/esm/formSection/components/formSectionModal.js +1 -1
  287. package/esm/formSection/formSection.js +1 -1
  288. package/esm/formSection/hooks/useError.js +64 -21
  289. package/esm/formStepper/components/formStep.js +59 -9
  290. package/esm/formStepper/formStepper.js +123 -32
  291. package/esm/formStepperButtons/formStepperButtons.js +178 -37
  292. package/esm/groupsFilter/groupsFilterTestData.d.ts +37 -0
  293. package/esm/groupsFilter/groupsFilterTestData.js +4 -0
  294. package/esm/groupsFilter/groupsHelper.d.ts +24 -1
  295. package/esm/groupsFilter/groupsHelper.js +24 -1
  296. package/esm/groupsFilterRaw/groupsFilterAdjustmentState.js +152 -14
  297. package/esm/groupsFilterRaw/groupsFilterBox.js +131 -31
  298. package/esm/groupsFilterRaw/groupsFilterCommon.js +69 -7
  299. package/esm/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +178 -24
  300. package/esm/groupsFilterRaw/groupsFilterHelper.d.ts +2 -1
  301. package/esm/groupsFilterRaw/groupsFilterHelper.js +279 -168
  302. package/esm/groupsFilterRaw/groupsFilterInitialState.js +260 -17
  303. package/esm/groupsFilterRaw/groupsFilterMenu.js +118 -8
  304. package/esm/groupsFilterRaw/groupsFilterRaw.d.ts +1 -0
  305. package/esm/groupsFilterRaw/groupsFilterRaw.js +811 -308
  306. package/esm/groupsFilterRaw/groupsFilterTestData.d.ts +155 -2
  307. package/esm/groupsFilterRaw/groupsFilterTestData.js +152 -57
  308. package/esm/groupsFilterRaw/groupsFilterTrigger.js +133 -34
  309. package/esm/groupsFilterRaw/groupsHelper.js +733 -207
  310. package/esm/groupsFilterRaw/stateReducer/stateReducerHelper.js +3 -1
  311. package/esm/groupsFilterRaw/types.d.ts +1 -0
  312. package/esm/header/components/collapsedItemsControl/collapsedItemsControl.js +101 -51
  313. package/esm/header/components/mobileFilterControl/mobileFilterControl.js +56 -8
  314. package/esm/header/components/mobileSearchControl/mobileSearchControl.js +113 -13
  315. package/esm/header/headerBack.js +58 -19
  316. package/esm/index.d.ts +2 -1
  317. package/esm/index.js +2 -1
  318. package/esm/list/itemData/itemDataInternal.js +210 -50
  319. package/esm/list/listItem/listItem.js +162 -54
  320. package/esm/menu/components/menuErrorItem.js +27 -4
  321. package/esm/mobileSheet/mobileSheet.js +189 -68
  322. package/esm/modal/modal.js +265 -120
  323. package/esm/nav/nav.js +1 -1
  324. package/esm/nav/navFooter/navFooter.js +76 -38
  325. package/esm/nav/navFooter/navFooterAction/navFooterAction.js +46 -12
  326. package/esm/nav/navHeader/navHeader.js +80 -35
  327. package/esm/nav/navHeader/navHeaderSearch/navHeaderSearch.js +82 -28
  328. package/esm/nav/navItem/navItem.d.ts +3 -3
  329. package/esm/nav/navItem/navItem.js +35 -33
  330. package/esm/nav/navMobileBar/navMobileBar.js +61 -20
  331. package/esm/notification/notification.js +114 -18
  332. package/esm/pagination/paginationArrow.js +75 -10
  333. package/esm/pagination/paginationText/paginationText.js +39 -10
  334. package/esm/pill/components/pillNonActionable/pillNonActionable.js +87 -23
  335. package/esm/pillBox/components/pillBoxItem.js +46 -8
  336. package/esm/pillBox/pillBox.js +115 -19
  337. package/esm/pillExpandable/pillExpandable.js +327 -138
  338. package/esm/rangeRaw/rangeRaw.js +480 -140
  339. package/esm/rangeRaw/utils/rangeHelper.js +203 -38
  340. package/esm/searchInputRaw/searchInputRaw.js +145 -43
  341. package/esm/skeleton/skeleton.js +45 -5
  342. package/esm/sortControl/sortControl.js +146 -41
  343. package/esm/stepperRaw/stepperRaw.js +112 -41
  344. package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/EntitiesListAction.js +178 -19
  345. package/esm/summary/summary.js +88 -7
  346. package/esm/table/actions/actionsMenu.js +165 -77
  347. package/esm/table/flexible/columnSettings.js +74 -9
  348. package/esm/table/flexible/columnsList.js +104 -42
  349. package/esm/table/flexible/columnsPopup.js +71 -19
  350. package/esm/table/nested/useNestedRows.js +161 -76
  351. package/esm/table/selectable/selectableHeader.js +174 -40
  352. package/esm/table/selectable/useSelectableRows.js +264 -190
  353. package/esm/table/sortable/sortableHeader.js +147 -74
  354. package/esm/tabs/tabs.js +221 -117
  355. package/esm/timePickerRaw/timePickerRaw.js +272 -57
  356. package/esm/toastRaw/toastRaw.js +132 -31
  357. package/esm/toggleButton/toggleButton.d.ts +0 -1
  358. package/esm/toggleButtonRaw/toggleButtonRaw.d.ts +1 -0
  359. package/esm/toggleButtonRaw/toggleButtonRaw.js +111 -18
  360. package/esm/utils/formatDate.js +995 -116
  361. package/{dist/utils/localization/translations/cs-json.js → esm/utils/localization/translations/cs.json} +11 -15
  362. package/{dist/utils/localization/translations/da-DK-json.js → esm/utils/localization/translations/da-DK.json} +31 -26
  363. package/{dist/utils/localization/translations/de-json.js → esm/utils/localization/translations/de.json} +12 -16
  364. package/esm/utils/localization/translations/en.json +308 -0
  365. package/{dist/utils/localization/translations/es-json.js → esm/utils/localization/translations/es.json} +11 -15
  366. package/{dist/utils/localization/translations/fi-FI-json.js → esm/utils/localization/translations/fi-FI.json} +31 -26
  367. package/{dist/utils/localization/translations/fr-FR-json.js → esm/utils/localization/translations/fr-FR.json} +12 -15
  368. package/{dist/utils/localization/translations/fr-json.js → esm/utils/localization/translations/fr.json} +11 -15
  369. package/{dist/utils/localization/translations/hu-HU-json.js → esm/utils/localization/translations/hu-HU.json} +31 -26
  370. package/{dist/utils/localization/translations/id-json.js → esm/utils/localization/translations/id.json} +11 -16
  371. package/{dist/utils/localization/translations/it-json.js → esm/utils/localization/translations/it.json} +11 -15
  372. package/{dist/utils/localization/translations/ja-json.js → esm/utils/localization/translations/ja.json} +11 -15
  373. package/{dist/utils/localization/translations/ko-KR-json.js → esm/utils/localization/translations/ko-KR.json} +24 -26
  374. package/{dist/utils/localization/translations/ms-json.js → esm/utils/localization/translations/ms.json} +11 -15
  375. package/{dist/utils/localization/translations/nb-NO-json.js → esm/utils/localization/translations/nb-NO.json} +31 -26
  376. package/{dist/utils/localization/translations/nl-json.js → esm/utils/localization/translations/nl.json} +11 -15
  377. package/{dist/utils/localization/translations/pl-json.js → esm/utils/localization/translations/pl.json} +11 -15
  378. package/{dist/utils/localization/translations/pt-BR-json.js → esm/utils/localization/translations/pt-BR.json} +11 -15
  379. package/{dist/utils/localization/translations/sk-SK-json.js → esm/utils/localization/translations/sk-SK.json} +31 -26
  380. package/{dist/utils/localization/translations/sv-json.js → esm/utils/localization/translations/sv.json} +11 -15
  381. package/{dist/utils/localization/translations/th-json.js → esm/utils/localization/translations/th.json} +11 -15
  382. package/{dist/utils/localization/translations/tr-json.js → esm/utils/localization/translations/tr.json} +11 -15
  383. package/{dist/utils/localization/translations/zh-Hans-json.js → esm/utils/localization/translations/zh-Hans.json} +11 -15
  384. package/{dist/utils/localization/translations/zh-TW-json.js → esm/utils/localization/translations/zh-TW.json} +11 -26
  385. package/esm/utils/localization/translationsDictionary.d.ts +2 -0
  386. package/esm/utils/localization/translationsDictionary.js +59 -0
  387. package/esm/utils/localization/useLanguage.js +1 -50
  388. package/package.json +17 -10
  389. package/dist/formField/hooks/useClasses.d.ts +0 -8
  390. package/dist/formField/hooks/useClasses.js +0 -25
  391. package/dist/utils/localization/translations/cs-json.d.ts +0 -251
  392. package/dist/utils/localization/translations/da-DK-json.d.ts +0 -252
  393. package/dist/utils/localization/translations/de-json.d.ts +0 -251
  394. package/dist/utils/localization/translations/en-json.d.ts +0 -314
  395. package/dist/utils/localization/translations/en-json.js +0 -317
  396. package/dist/utils/localization/translations/es-json.d.ts +0 -251
  397. package/dist/utils/localization/translations/fi-FI-json.d.ts +0 -252
  398. package/dist/utils/localization/translations/fr-FR-json.d.ts +0 -250
  399. package/dist/utils/localization/translations/fr-json.d.ts +0 -251
  400. package/dist/utils/localization/translations/hu-HU-json.d.ts +0 -252
  401. package/dist/utils/localization/translations/id-json.d.ts +0 -252
  402. package/dist/utils/localization/translations/it-json.d.ts +0 -251
  403. package/dist/utils/localization/translations/ja-json.d.ts +0 -251
  404. package/dist/utils/localization/translations/ko-KR-json.d.ts +0 -258
  405. package/dist/utils/localization/translations/ms-json.d.ts +0 -251
  406. package/dist/utils/localization/translations/nb-NO-json.d.ts +0 -252
  407. package/dist/utils/localization/translations/nl-json.d.ts +0 -251
  408. package/dist/utils/localization/translations/pl-json.d.ts +0 -251
  409. package/dist/utils/localization/translations/pt-BR-json.d.ts +0 -251
  410. package/dist/utils/localization/translations/sk-SK-json.d.ts +0 -251
  411. package/dist/utils/localization/translations/sv-json.d.ts +0 -251
  412. package/dist/utils/localization/translations/th-json.d.ts +0 -251
  413. package/dist/utils/localization/translations/tr-json.d.ts +0 -251
  414. package/dist/utils/localization/translations/zh-Hans-json.d.ts +0 -251
  415. package/dist/utils/localization/translations/zh-TW-json.d.ts +0 -271
  416. package/esm/formField/hooks/useClasses.d.ts +0 -8
  417. package/esm/formField/hooks/useClasses.js +0 -21
  418. package/esm/utils/localization/translations/cs-json.d.ts +0 -251
  419. package/esm/utils/localization/translations/da-DK-json.d.ts +0 -252
  420. package/esm/utils/localization/translations/de-json.d.ts +0 -251
  421. package/esm/utils/localization/translations/en-json.d.ts +0 -314
  422. package/esm/utils/localization/translations/en-json.js +0 -314
  423. package/esm/utils/localization/translations/es-json.d.ts +0 -251
  424. package/esm/utils/localization/translations/fi-FI-json.d.ts +0 -252
  425. package/esm/utils/localization/translations/fr-FR-json.d.ts +0 -250
  426. package/esm/utils/localization/translations/fr-json.d.ts +0 -251
  427. package/esm/utils/localization/translations/hu-HU-json.d.ts +0 -252
  428. package/esm/utils/localization/translations/id-json.d.ts +0 -252
  429. package/esm/utils/localization/translations/it-json.d.ts +0 -251
  430. package/esm/utils/localization/translations/ja-json.d.ts +0 -251
  431. package/esm/utils/localization/translations/ko-KR-json.d.ts +0 -258
  432. package/esm/utils/localization/translations/ms-json.d.ts +0 -251
  433. package/esm/utils/localization/translations/nb-NO-json.d.ts +0 -252
  434. package/esm/utils/localization/translations/nl-json.d.ts +0 -251
  435. package/esm/utils/localization/translations/pl-json.d.ts +0 -251
  436. package/esm/utils/localization/translations/pt-BR-json.d.ts +0 -251
  437. package/esm/utils/localization/translations/sk-SK-json.d.ts +0 -251
  438. package/esm/utils/localization/translations/sv-json.d.ts +0 -251
  439. package/esm/utils/localization/translations/th-json.d.ts +0 -251
  440. package/esm/utils/localization/translations/tr-json.d.ts +0 -251
  441. package/esm/utils/localization/translations/zh-Hans-json.d.ts +0 -251
  442. package/esm/utils/localization/translations/zh-TW-json.d.ts +0 -271
@@ -1,10 +1,208 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ const {
4
+ injectString
5
+ } = require("../utils/localization/translationsDictionary");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
3
9
  exports.TRANSLATIONS = exports.GroupsFilterRaw = void 0;
4
10
  const jsx_runtime_1 = require("react/jsx-runtime");
5
11
  const react_1 = require("react");
6
12
  const groupsFilterInterfaces_1 = require("./groupsFilterInterfaces");
7
13
  const groupsFilterMenu_1 = require("./groupsFilterMenu");
14
+ injectString("cs", "Groups", "Skupiny");
15
+ injectString("da-DK", "Groups", "Grupper");
16
+ injectString("de", "Groups", "Gruppen");
17
+ injectString("en", "Groups", "Groups");
18
+ injectString("es", "Groups", "Grupos");
19
+ injectString("fi-FI", "Groups", "Ryhm\xE4t");
20
+ injectString("fr", "Groups", "Groupes");
21
+ injectString("fr-FR", "Groups", "Groupes");
22
+ injectString("hu-HU", "Groups", "Csoportok");
23
+ injectString("id", "Groups", "Grup");
24
+ injectString("it", "Groups", "Gruppi");
25
+ injectString("ja", "Groups", "\u30B0\u30EB\u30FC\u30D7");
26
+ injectString("ko-KR", "Groups", "\uADF8\uB8F9");
27
+ injectString("ms", "Groups", "Kumpulan");
28
+ injectString("nb-NO", "Groups", "Grupper");
29
+ injectString("nl", "Groups", "Groepen");
30
+ injectString("pl", "Groups", "Grupy");
31
+ injectString("pt-BR", "Groups", "Grupos");
32
+ injectString("sk-SK", "Groups", "Skupiny");
33
+ injectString("sv", "Groups", "Grupper");
34
+ injectString("th", "Groups", "\u0E01\u0E25\u0E38\u0E48\u0E21");
35
+ injectString("tr", "Groups", "Gruplar");
36
+ injectString("zh-Hans", "Groups", "\u7EC4");
37
+ injectString("zh-TW", "Groups", "\u7FA4\u7D44");
38
+ injectString("cs", "Or", "Nebo");
39
+ injectString("da-DK", "Or", "Eller");
40
+ injectString("de", "Or", "Oder");
41
+ injectString("en", "Or", "Or");
42
+ injectString("es", "Or", "O");
43
+ injectString("fi-FI", "Or", "Tai");
44
+ injectString("fr", "Or", "Ou");
45
+ injectString("fr-FR", "Or", "Ou");
46
+ injectString("hu-HU", "Or", "Vagy");
47
+ injectString("id", "Or", "Atau");
48
+ injectString("it", "Or", "O");
49
+ injectString("ja", "Or", "\u307E\u305F\u306F");
50
+ injectString("ko-KR", "Or", "\uB610\uB294");
51
+ injectString("ms", "Or", "Atau");
52
+ injectString("nb-NO", "Or", "Eller");
53
+ injectString("nl", "Or", "Of");
54
+ injectString("pl", "Or", "Lub");
55
+ injectString("pt-BR", "Or", "Ou");
56
+ injectString("sk-SK", "Or", "Alebo");
57
+ injectString("sv", "Or", "Eller");
58
+ injectString("th", "Or", "\u0E2B\u0E23\u0E37\u0E2D");
59
+ injectString("tr", "Or", "Veya");
60
+ injectString("zh-Hans", "Or", "\u6216");
61
+ injectString("zh-TW", "Or", "\u6216");
62
+ injectString("cs", "And", "A");
63
+ injectString("da-DK", "And", "Og");
64
+ injectString("de", "And", "Und");
65
+ injectString("en", "And", "And");
66
+ injectString("es", "And", "Y");
67
+ injectString("fi-FI", "And", "Ja");
68
+ injectString("fr", "And", "Et");
69
+ injectString("fr-FR", "And", "Et");
70
+ injectString("hu-HU", "And", "\xC9s");
71
+ injectString("id", "And", "Dan");
72
+ injectString("it", "And", "E");
73
+ injectString("ja", "And", "\u3068");
74
+ injectString("ko-KR", "And", "\uADF8\uB9AC\uACE0");
75
+ injectString("ms", "And", "Dan");
76
+ injectString("nb-NO", "And", "Og");
77
+ injectString("nl", "And", "En");
78
+ injectString("pl", "And", "Oraz");
79
+ injectString("pt-BR", "And", "E");
80
+ injectString("sk-SK", "And", "A");
81
+ injectString("sv", "And", "Och");
82
+ injectString("th", "And", "\u0E41\u0E25\u0E30");
83
+ injectString("tr", "And", "Ve");
84
+ injectString("zh-Hans", "And", "\u548C");
85
+ injectString("zh-TW", "And", "\u548C");
86
+ injectString("cs", "Filter by group", "Filtrovat podle skupiny");
87
+ injectString("da-DK", "Filter by group", "Filtrer efter gruppe");
88
+ injectString("de", "Filter by group", "Nach Gruppe filtern");
89
+ injectString("en", "Filter by group", "Filter by group");
90
+ injectString("es", "Filter by group", "Filtrar por grupo");
91
+ injectString("fi-FI", "Filter by group", "Suodata ryhm\xE4n mukaan");
92
+ injectString("fr", "Filter by group", "Filtrer par groupe");
93
+ injectString("fr-FR", "Filter by group", "Filtrer par groupe");
94
+ injectString("hu-HU", "Filter by group", "Sz\u0171rd csoport alapj\xE1n.");
95
+ injectString("id", "Filter by group", "Filter berdasarkan grup");
96
+ injectString("it", "Filter by group", "Filtrare per gruppo");
97
+ injectString("ja", "Filter by group", "\u30B0\u30EB\u30FC\u30D7\u306B\u3088\u308B\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0");
98
+ injectString("ko-KR", "Filter by group", "\uADF8\uB8F9\uBCC4 \uD544\uD130\uB9C1");
99
+ injectString("ms", "Filter by group", "Saring mengikut kumpulan");
100
+ injectString("nb-NO", "Filter by group", "Filtrer etter gruppe");
101
+ injectString("nl", "Filter by group", "Filteren op groep");
102
+ injectString("pl", "Filter by group", "Filtruj wed\u0142ug grupy");
103
+ injectString("pt-BR", "Filter by group", "Filtrar por grupo");
104
+ injectString("sk-SK", "Filter by group", "Filtrova\u0165 pod\u013Ea skupiny");
105
+ injectString("sv", "Filter by group", "Filtrera efter grupp");
106
+ injectString("th", "Filter by group", "\u0E01\u0E23\u0E2D\u0E07\u0E15\u0E32\u0E21\u0E01\u0E25\u0E38\u0E48\u0E21");
107
+ injectString("tr", "Filter by group", "Gruba g\xF6re filtrele");
108
+ injectString("zh-Hans", "Filter by group", "\u6309\u7EC4\u8FC7\u6EE4");
109
+ injectString("zh-TW", "Filter by group", "\u4F9D\u7FA4\u7D44\u7BE9\u9078");
110
+ injectString("cs", "Apply", "Pou\u017E\xEDt");
111
+ injectString("da-DK", "Apply", "Anvend");
112
+ injectString("de", "Apply", "Anwenden");
113
+ injectString("en", "Apply", "Apply");
114
+ injectString("es", "Apply", "Aplicar");
115
+ injectString("fi-FI", "Apply", "K\xE4yt\xE4");
116
+ injectString("fr", "Apply", "Appliquer");
117
+ injectString("fr-FR", "Apply", "Appliquer");
118
+ injectString("hu-HU", "Apply", "Alkalmazd.");
119
+ injectString("id", "Apply", "Terapkan");
120
+ injectString("it", "Apply", "Applicare");
121
+ injectString("ja", "Apply", "\u9069\u7528");
122
+ injectString("ko-KR", "Apply", "\uC801\uC6A9");
123
+ injectString("ms", "Apply", "Gunakan");
124
+ injectString("nb-NO", "Apply", "Bruk");
125
+ injectString("nl", "Apply", "Toepassen");
126
+ injectString("pl", "Apply", "Zastosuj");
127
+ injectString("pt-BR", "Apply", "Aplicar");
128
+ injectString("sk-SK", "Apply", "Pou\u017Ei");
129
+ injectString("sv", "Apply", "Ans\xF6k");
130
+ injectString("th", "Apply", "\u0E43\u0E0A\u0E49");
131
+ injectString("tr", "Apply", "Uygula");
132
+ injectString("zh-Hans", "Apply", "\u5E94\u7528");
133
+ injectString("zh-TW", "Apply", "\u5957\u7528");
134
+ injectString("cs", "Cancel", "Zru\u0161it");
135
+ injectString("da-DK", "Cancel", "Annuller");
136
+ injectString("de", "Cancel", "Abbrechen");
137
+ injectString("en", "Cancel", "Cancel");
138
+ injectString("es", "Cancel", "Cancelar");
139
+ injectString("fi-FI", "Cancel", "Peruuta");
140
+ injectString("fr", "Cancel", "Annuler");
141
+ injectString("fr-FR", "Cancel", "Annuler");
142
+ injectString("hu-HU", "Cancel", "M\xE9gse");
143
+ injectString("id", "Cancel", "Batalkan");
144
+ injectString("it", "Cancel", "Annullare");
145
+ injectString("ja", "Cancel", "\u30AD\u30E3\u30F3\u30BB\u30EB");
146
+ injectString("ko-KR", "Cancel", "\uCDE8\uC18C");
147
+ injectString("ms", "Cancel", "Batal");
148
+ injectString("nb-NO", "Cancel", "Avbryt");
149
+ injectString("nl", "Cancel", "Annuleren");
150
+ injectString("pl", "Cancel", "Anuluj");
151
+ injectString("pt-BR", "Cancel", "Cancelar");
152
+ injectString("sk-SK", "Cancel", "Zru\u0161.");
153
+ injectString("sv", "Cancel", "Avbryt");
154
+ injectString("th", "Cancel", "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01");
155
+ injectString("tr", "Cancel", "\u0130ptal");
156
+ injectString("zh-Hans", "Cancel", "\u53D6\u6D88");
157
+ injectString("zh-TW", "Cancel", "\u53D6\u6D88");
158
+ injectString("cs", "Clear", "Vymazat");
159
+ injectString("da-DK", "Clear", "Ryd");
160
+ injectString("de", "Clear", "L\xF6schen");
161
+ injectString("en", "Clear", "Clear");
162
+ injectString("es", "Clear", "Borrar");
163
+ injectString("fi-FI", "Clear", "Tyhjenn\xE4");
164
+ injectString("fr", "Clear", "Effacer");
165
+ injectString("fr-FR", "Clear", "Effacer");
166
+ injectString("hu-HU", "Clear", "T\xF6r\xF6ld.");
167
+ injectString("id", "Clear", "Hapus");
168
+ injectString("it", "Clear", "Cancella");
169
+ injectString("ja", "Clear", "\u30AF\u30EA\u30A2");
170
+ injectString("ko-KR", "Clear", "\uC9C0\uC6B0\uAE30");
171
+ injectString("ms", "Clear", "Kosongkan");
172
+ injectString("nb-NO", "Clear", "T\xF8m");
173
+ injectString("nl", "Clear", "Wissen");
174
+ injectString("pl", "Clear", "Wyczy\u015B\u0107");
175
+ injectString("pt-BR", "Clear", "Limpar");
176
+ injectString("sk-SK", "Clear", "Vyma\u017E");
177
+ injectString("sv", "Clear", "Rensa");
178
+ injectString("th", "Clear", "\u0E25\u0E49\u0E32\u0E07");
179
+ injectString("tr", "Clear", "Temizle");
180
+ injectString("zh-Hans", "Clear", "\u6E05\u9664");
181
+ injectString("zh-TW", "Clear", "\u6E05\u9664");
182
+ injectString("cs", "Organization groups filter", "Filtr skupin organizace");
183
+ injectString("da-DK", "Organization groups filter", "Filter for organisationsgrupper");
184
+ injectString("de", "Organization groups filter", "Filter f\xFCr Firmengruppen");
185
+ injectString("en", "Organization groups filter", "Organization groups filter");
186
+ injectString("es", "Organization groups filter", "Filtro de grupos de la organizaci\xF3n");
187
+ injectString("fi-FI", "Organization groups filter", "Organisaatioryhmien suodatin");
188
+ injectString("fr", "Organization groups filter", "Filtre de groupes organisationnels");
189
+ injectString("fr-FR", "Organization groups filter", "Filtre des groupes de l\u2019entreprise");
190
+ injectString("hu-HU", "Organization groups filter", "Szervezeti csoportok sz\u0171r\xE9se");
191
+ injectString("id", "Organization groups filter", "Filter grup organisasi");
192
+ injectString("it", "Organization groups filter", "Filtro di gruppi dell'organizzazione");
193
+ injectString("ja", "Organization groups filter", "\u56E3\u4F53\u30B0\u30EB\u30FC\u30D7\u30D5\u30A3\u30EB\u30BF\u30FC");
194
+ injectString("ko-KR", "Organization groups filter", "\uC870\uC9C1 \uADF8\uB8F9 \uD544\uD130");
195
+ injectString("ms", "Organization groups filter", "Penyaring kumpulan organisasi");
196
+ injectString("nb-NO", "Organization groups filter", "Filter for organisasjonsgrupper.");
197
+ injectString("nl", "Organization groups filter", "Filter voor organisatiegroepen");
198
+ injectString("pl", "Organization groups filter", "Filtr grup organizacji");
199
+ injectString("pt-BR", "Organization groups filter", "Filtro de grupos da organiza\xE7\xE3o");
200
+ injectString("sk-SK", "Organization groups filter", "Filter organiza\u010Dn\xFDch skup\xEDn");
201
+ injectString("sv", "Organization groups filter", "Filter f\xF6r organisationsgrupper");
202
+ injectString("th", "Organization groups filter", "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E01\u0E25\u0E38\u0E48\u0E21\u0E2D\u0E07\u0E04\u0E4C\u0E01\u0E23");
203
+ injectString("tr", "Organization groups filter", "Organizasyon gruplar\u0131 filtresi");
204
+ injectString("zh-Hans", "Organization groups filter", "\u7EC4\u7EC7\u7EC4\u7B5B\u9009\u5668");
205
+ injectString("zh-TW", "Organization groups filter", "\u7D44\u7E54\u7FA4\u7D44\u7BE9\u9078");
8
206
  const groupsFilterInitialState_1 = require("./groupsFilterInitialState");
9
207
  const groupsFilterAdjustmentState_1 = require("./groupsFilterAdjustmentState");
10
208
  const groupsFilterCurrentlySelectedState_1 = require("./groupsFilterCurrentlySelectedState");
@@ -38,319 +236,629 @@ const isFormItem_1 = require("../commonHelpers/isFormItem");
38
236
  const useFormField_1 = require("../commonHelpers/hooks/useFormField");
39
237
  const reviewTextControl_1 = require("../formGroup/components/reviewTextControl");
40
238
  // eslint-disable-next-line max-len, complexity
41
- const GroupsFilterRaw = (props) => {
239
+ const GroupsFilterRaw = props => {
240
+ var _a;
241
+ const {
242
+ fullSize,
243
+ className,
244
+ classNamePopup,
245
+ dataLoader,
246
+ errorHandler,
247
+ initialFilterState,
248
+ isWithColor,
249
+ onChange,
250
+ options,
251
+ listLimit = 500,
252
+ isError,
253
+ isReadOnly,
254
+ chip,
255
+ chipIcon,
256
+ chipId,
257
+ chipName
258
+ } = props;
259
+ const chipStatus = (0, chipStatusProvider_1.useChipStatus)();
260
+ const {
261
+ field
262
+ } = (0, useFormField_1.useFormField)(props.controller);
263
+ const isFormItemValue = (0, isFormItem_1.isFormItem)(props);
264
+ let initialFilterStateInner, onChangeInner;
265
+ if (isFormItemValue) {
266
+ initialFilterStateInner = (_a = props.controller) === null || _a === void 0 ? void 0 : _a.defaultValue;
267
+ onChangeInner = state => {
268
+ field === null || field === void 0 ? void 0 : field.onChange(state);
269
+ };
270
+ } else {
271
+ initialFilterStateInner = initialFilterState;
272
+ onChangeInner = onChange;
273
+ }
274
+ const {
275
+ translate
276
+ } = (0, useLanguage_1.useLanguage)();
277
+ const [groupPlaceHolder, setGroupPlaceHolder] = (0, react_1.useState)((options === null || options === void 0 ? void 0 : options.placeholder) || translate("Groups"));
278
+ const [state, dispatchState] = (0, react_1.useReducer)(stateReducer_1.stateReducer, (0, stateReducer_1.getInitialState)(translate, initialFilterState));
279
+ const [uiState, dispatchUiState] = (0, react_1.useReducer)(uiStateReducer_1.uiStateReducer, uiStateReducer_1.uiInitialGroupsFilterState);
280
+ const [dataItems, setDataItems] = (0, react_1.useState)([]);
281
+ const isMobile = (0, useMobile_1.useMobile)();
282
+ const inputRef = (0, react_1.useRef)(null);
283
+ const emptyInputRef = (0, react_1.useRef)(null);
284
+ const triggerRef = (0, react_1.useRef)(null);
285
+ const menuRef = (0, react_1.useRef)(null);
286
+ const prevInitialState = (0, react_1.useRef)(initialFilterStateInner);
287
+ const prevSearchField = (0, react_1.useRef)("");
288
+ const groupsFilterId = (0, react_1.useId)();
289
+ const blocksMap = (0, react_1.useMemo)(() => [["builtInGroups", "userGroups"], ["advancedGroups", "builtInGroups", "userGroups"], ["builtInGroups", "userGroups"]], []);
290
+ const onOptionsToggle = (0, react_1.useCallback)(() => {
291
+ dispatchUiState({
292
+ type: uiStateActionType_1.UiStateActionType.ToggleOpen,
293
+ payload: undefined
294
+ });
295
+ }, []);
296
+ const handleSetStep = (0, react_1.useCallback)(newStep => {
42
297
  var _a;
43
- const { fullSize, className, dataLoader, errorHandler, initialFilterState, isWithColor, onChange, options, listLimit = 500, isError, isReadOnly, chip, chipIcon, chipId, chipName } = props;
44
- const chipStatus = (0, chipStatusProvider_1.useChipStatus)();
45
- const { field } = (0, useFormField_1.useFormField)(props.controller);
46
- const isFormItemValue = (0, isFormItem_1.isFormItem)(props);
47
- let initialFilterStateInner, onChangeInner;
48
- if (isFormItemValue) {
49
- initialFilterStateInner = (_a = props.controller) === null || _a === void 0 ? void 0 : _a.defaultValue;
50
- onChangeInner = (state) => {
51
- field === null || field === void 0 ? void 0 : field.onChange(state);
52
- };
298
+ uiState.step !== groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected && dispatchUiState({
299
+ type: uiStateActionType_1.UiStateActionType.ClearUncheckedState,
300
+ payload: undefined
301
+ });
302
+ dispatchUiState({
303
+ type: uiStateActionType_1.UiStateActionType.SetStep,
304
+ payload: newStep
305
+ });
306
+ if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) && newStep !== groupsFilterInterfaces_1.FilterMenuStep.Initial) {
307
+ inputRef.current.value = "";
308
+ dispatchUiState({
309
+ type: uiStateActionType_1.UiStateActionType.SetSearchValue,
310
+ payload: ""
311
+ });
53
312
  }
54
- else {
55
- initialFilterStateInner = initialFilterState;
56
- onChangeInner = onChange;
313
+ }, [uiState.step]);
314
+ const onSearchChange = (0, react_1.useCallback)(event => {
315
+ const newValue = event.currentTarget.value;
316
+ dispatchUiState({
317
+ type: uiStateActionType_1.UiStateActionType.SetSearchValue,
318
+ payload: newValue
319
+ });
320
+ dispatchUiState({
321
+ type: uiStateActionType_1.UiStateActionType.SetIsOpen,
322
+ payload: true
323
+ });
324
+ uiState.step !== groupsFilterInterfaces_1.FilterMenuStep.Initial && handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
325
+ }, [handleSetStep, uiState.step]);
326
+ const onSearchChipChange = (0, react_1.useCallback)(newValue => {
327
+ dispatchUiState({
328
+ type: uiStateActionType_1.UiStateActionType.SetSearchValue,
329
+ payload: newValue || ""
330
+ });
331
+ dispatchUiState({
332
+ type: uiStateActionType_1.UiStateActionType.SetIsOpen,
333
+ payload: true
334
+ });
335
+ uiState.step !== groupsFilterInterfaces_1.FilterMenuStep.Initial && handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
336
+ }, [handleSetStep, uiState.step]);
337
+ const handleFocusOnClose = (0, react_1.useCallback)(() => {
338
+ var _a, _b, _c;
339
+ if (chip) {
340
+ (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
341
+ } else {
342
+ !isMobile && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
343
+ isMobile && ((_c = emptyInputRef.current) === null || _c === void 0 ? void 0 : _c.focus());
57
344
  }
58
- const { translate } = (0, useLanguage_1.useLanguage)();
59
- const [groupPlaceHolder, setGroupPlaceHolder] = (0, react_1.useState)((options === null || options === void 0 ? void 0 : options.placeholder) || translate("Groups"));
60
- const [state, dispatchState] = (0, react_1.useReducer)(stateReducer_1.stateReducer, (0, stateReducer_1.getInitialState)(translate, initialFilterState));
61
- const [uiState, dispatchUiState] = (0, react_1.useReducer)(uiStateReducer_1.uiStateReducer, uiStateReducer_1.uiInitialGroupsFilterState);
62
- const [dataItems, setDataItems] = (0, react_1.useState)([]);
63
- const isMobile = (0, useMobile_1.useMobile)();
64
- const inputRef = (0, react_1.useRef)(null);
65
- const emptyInputRef = (0, react_1.useRef)(null);
66
- const triggerRef = (0, react_1.useRef)(null);
67
- const menuRef = (0, react_1.useRef)(null);
68
- const prevInitialState = (0, react_1.useRef)(initialFilterStateInner);
69
- const prevSearchField = (0, react_1.useRef)("");
70
- const groupsFilterId = (0, react_1.useId)();
71
- const blocksMap = (0, react_1.useMemo)(() => [["builtInGroups", "userGroups"], ["advancedGroups", "builtInGroups", "userGroups"], ["builtInGroups", "userGroups"]], []);
72
- const onOptionsToggle = (0, react_1.useCallback)(() => { dispatchUiState({ type: uiStateActionType_1.UiStateActionType.ToggleOpen, payload: undefined }); }, []);
73
- const handleSetStep = (0, react_1.useCallback)((newStep) => {
74
- var _a;
75
- uiState.step !== groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected && dispatchUiState({ type: uiStateActionType_1.UiStateActionType.ClearUncheckedState, payload: undefined });
76
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetStep, payload: newStep });
77
- if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) && newStep !== groupsFilterInterfaces_1.FilterMenuStep.Initial) {
78
- inputRef.current.value = "";
79
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetSearchValue, payload: "" });
80
- }
81
- }, [uiState.step]);
82
- const onSearchChange = (0, react_1.useCallback)((event) => {
83
- const newValue = event.currentTarget.value;
84
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetSearchValue, payload: newValue });
85
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetIsOpen, payload: true });
86
- uiState.step !== groupsFilterInterfaces_1.FilterMenuStep.Initial && handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
87
- }, [handleSetStep, uiState.step]);
88
- const onSearchChipChange = (0, react_1.useCallback)((newValue) => {
89
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetSearchValue, payload: newValue || "" });
90
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetIsOpen, payload: true });
91
- uiState.step !== groupsFilterInterfaces_1.FilterMenuStep.Initial && handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
92
- }, [handleSetStep, uiState.step]);
93
- const handleFocusOnClose = (0, react_1.useCallback)(() => {
94
- var _a, _b, _c;
95
- if (chip) {
96
- (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
97
- }
98
- else {
99
- !isMobile && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
100
- isMobile && ((_c = emptyInputRef.current) === null || _c === void 0 ? void 0 : _c.focus());
101
- }
102
- }, [chip, isMobile]);
103
- const handleCancel = (0, react_1.useCallback)(() => {
104
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetIsOpen, payload: false });
105
- dispatchState({ type: stateActionType_1.StateActionType.SetState, payload: state.frozenState });
106
- dispatchState({ type: stateActionType_1.StateActionType.SideWide, payload: state.frozenSideWideState });
107
- handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
108
- handleFocusOnClose();
109
- }, [state.frozenState, state.frozenSideWideState, handleSetStep, handleFocusOnClose]);
110
- const handleApply = (0, react_1.useCallback)(() => {
111
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetIsOpen, payload: false });
112
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetSearchValue, payload: "" });
113
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.ClearUncheckedState, payload: undefined });
114
- if (inputRef.current) {
115
- inputRef.current.value = "";
116
- }
117
- handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
118
- dispatchState({ type: stateActionType_1.StateActionType.FreezeState, payload: (0, stateReducerHelper_1.getCurrentState)(state) });
119
- dispatchState({ type: stateActionType_1.StateActionType.FreezeSideWide, payload: state.sideWideState });
120
- handleFocusOnClose();
121
- }, [handleSetStep, state, handleFocusOnClose]);
122
- const handleReset = (0, react_1.useCallback)(() => {
123
- dispatchState({ type: stateActionType_1.StateActionType.ResetSelection, payload: undefined });
124
- }, []);
125
- const handleChipClose = (0, react_1.useCallback)(() => {
126
- dispatchState({ type: stateActionType_1.StateActionType.ResetSelection, payload: undefined });
127
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetIsOpen, payload: false });
128
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetSearchValue, payload: "" });
129
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.ClearUncheckedState, payload: undefined });
130
- if (inputRef.current) {
131
- inputRef.current.value = "";
132
- }
133
- handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
134
- dispatchState({ type: stateActionType_1.StateActionType.FreezeState, payload: stateReducer_1.defaultPreparedFilterState });
135
- dispatchState({ type: stateActionType_1.StateActionType.FreezeSideWide, payload: false });
136
- }, [handleSetStep]);
137
- const handleCheckboxChange = (0, react_1.useCallback)((value) => {
138
- if (value.partial) {
139
- dispatchState({ type: stateActionType_1.StateActionType.DeselectAllChildren, payload: value.id });
140
- }
141
- else {
142
- dispatchState({ type: stateActionType_1.StateActionType.ChangeSelection, payload: { value: value.state, itemId: value.id } });
143
- }
144
- }, [dispatchState]);
145
- const handleCheckboxItemClick = (0, react_1.useCallback)((id) => {
146
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetCurrentAdjustmentId, payload: id });
147
- handleSetStep(id ? groupsFilterInterfaces_1.FilterMenuStep.Adjustment : groupsFilterInterfaces_1.FilterMenuStep.Initial);
148
- }, [dispatchUiState, handleSetStep]);
149
- const handleCheckboxItemAdjustmentClick = (0, react_1.useCallback)((value) => {
150
- if (value.id === groupsFilterBox_1.ADVANCED_FILTER_ID) {
151
- const currentVal = value.state ? uiState.uncheckedAdvancedState : state.advancedFilterState;
152
- !value.state && dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetUncheckedAdvancedState, payload: currentVal });
153
- !value.state && dispatchState({ type: stateActionType_1.StateActionType.SetAdvancedFilterState, payload: (0, groupsHelper_1.getDefaultFilterState)() });
154
- value.state && dispatchState({ type: stateActionType_1.StateActionType.SetAdvancedFilterState, payload: currentVal || state.frozenState.advancedFilterState || (0, groupsHelper_1.getDefaultFilterState)() });
155
- return;
156
- }
157
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetUncheckedAdjustmentIds, payload: !value.state ?
158
- [...uiState.uncheckedAdjustmentIds, value.id] : uiState.uncheckedAdjustmentIds.filter(id => id !== value.id) });
159
- dispatchState({ type: stateActionType_1.StateActionType.ChangeSelection, payload: { value: value.state, itemId: value.id } });
160
- }, [dispatchState, dispatchUiState, state.advancedFilterState, state.frozenState.advancedFilterState, uiState.uncheckedAdvancedState, uiState.uncheckedAdjustmentIds]);
161
- const basicHandleBackButtonClick = (0, react_1.useCallback)(() => {
162
- handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
163
- }, [handleSetStep]);
164
- const handleBackButtonClick = (0, react_1.useCallback)(() => {
165
- const currentEl = uiState.currentAdjustmentId ? (0, stateReducerHelper_1.getGroupsTreeItem)(state, uiState.currentAdjustmentId) : undefined;
166
- if (!uiState.currentAdjustmentId || !(currentEl === null || currentEl === void 0 ? void 0 : currentEl.parent)) {
167
- basicHandleBackButtonClick();
168
- return;
169
- }
170
- const isNotRoot = currentEl.parent.id && currentEl.parent.id !== groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID;
171
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetCurrentAdjustmentId, payload: isNotRoot ? currentEl.parent.id : undefined });
172
- handleSetStep(isNotRoot ? groupsFilterInterfaces_1.FilterMenuStep.Adjustment : groupsFilterInterfaces_1.FilterMenuStep.Initial);
173
- }, [basicHandleBackButtonClick, handleSetStep, state, uiState.currentAdjustmentId]);
174
- const handleHomeButtonClick = (0, react_1.useCallback)(() => {
175
- handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
176
- uiState.currentAdjustmentId && dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetCurrentAdjustmentId, payload: undefined });
177
- }, [handleSetStep, uiState.currentAdjustmentId, dispatchUiState]);
178
- const handleCurrentlySelectedClick = (0, react_1.useCallback)(() => {
179
- handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected);
180
- }, [handleSetStep]);
181
- const selectAllHandler = (0, react_1.useCallback)((isAllSelected) => {
182
- if (!uiState.currentAdjustmentId) {
183
- return;
345
+ }, [chip, isMobile]);
346
+ const handleCancel = (0, react_1.useCallback)(() => {
347
+ dispatchUiState({
348
+ type: uiStateActionType_1.UiStateActionType.SetIsOpen,
349
+ payload: false
350
+ });
351
+ dispatchState({
352
+ type: stateActionType_1.StateActionType.SetState,
353
+ payload: state.frozenState
354
+ });
355
+ dispatchState({
356
+ type: stateActionType_1.StateActionType.SideWide,
357
+ payload: state.frozenSideWideState
358
+ });
359
+ handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
360
+ handleFocusOnClose();
361
+ }, [state.frozenState, state.frozenSideWideState, handleSetStep, handleFocusOnClose]);
362
+ const handleApply = (0, react_1.useCallback)(() => {
363
+ dispatchUiState({
364
+ type: uiStateActionType_1.UiStateActionType.SetIsOpen,
365
+ payload: false
366
+ });
367
+ dispatchUiState({
368
+ type: uiStateActionType_1.UiStateActionType.SetSearchValue,
369
+ payload: ""
370
+ });
371
+ dispatchUiState({
372
+ type: uiStateActionType_1.UiStateActionType.ClearUncheckedState,
373
+ payload: undefined
374
+ });
375
+ if (inputRef.current) {
376
+ inputRef.current.value = "";
377
+ }
378
+ handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
379
+ dispatchState({
380
+ type: stateActionType_1.StateActionType.FreezeState,
381
+ payload: (0, stateReducerHelper_1.getCurrentState)(state)
382
+ });
383
+ dispatchState({
384
+ type: stateActionType_1.StateActionType.FreezeSideWide,
385
+ payload: state.sideWideState
386
+ });
387
+ handleFocusOnClose();
388
+ }, [handleSetStep, state, handleFocusOnClose]);
389
+ const handleReset = (0, react_1.useCallback)(() => {
390
+ dispatchState({
391
+ type: stateActionType_1.StateActionType.ResetSelection,
392
+ payload: undefined
393
+ });
394
+ }, []);
395
+ const handleChipClose = (0, react_1.useCallback)(() => {
396
+ dispatchState({
397
+ type: stateActionType_1.StateActionType.ResetSelection,
398
+ payload: undefined
399
+ });
400
+ dispatchUiState({
401
+ type: uiStateActionType_1.UiStateActionType.SetIsOpen,
402
+ payload: false
403
+ });
404
+ dispatchUiState({
405
+ type: uiStateActionType_1.UiStateActionType.SetSearchValue,
406
+ payload: ""
407
+ });
408
+ dispatchUiState({
409
+ type: uiStateActionType_1.UiStateActionType.ClearUncheckedState,
410
+ payload: undefined
411
+ });
412
+ if (inputRef.current) {
413
+ inputRef.current.value = "";
414
+ }
415
+ handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
416
+ dispatchState({
417
+ type: stateActionType_1.StateActionType.FreezeState,
418
+ payload: stateReducer_1.defaultPreparedFilterState
419
+ });
420
+ dispatchState({
421
+ type: stateActionType_1.StateActionType.FreezeSideWide,
422
+ payload: false
423
+ });
424
+ }, [handleSetStep]);
425
+ const handleCheckboxChange = (0, react_1.useCallback)(value => {
426
+ if (value.partial) {
427
+ dispatchState({
428
+ type: stateActionType_1.StateActionType.DeselectAllChildren,
429
+ payload: value.id
430
+ });
431
+ } else {
432
+ dispatchState({
433
+ type: stateActionType_1.StateActionType.ChangeSelection,
434
+ payload: {
435
+ value: value.state,
436
+ itemId: value.id
184
437
  }
185
- dispatchState({ type: isAllSelected ? stateActionType_1.StateActionType.DeselectAllChildren : stateActionType_1.StateActionType.SelectAllChildren, payload: uiState.currentAdjustmentId });
186
- }, [uiState.currentAdjustmentId, dispatchState]);
187
- const handleTriggerClick = () => {
188
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.ToggleOpen, payload: undefined });
438
+ });
439
+ }
440
+ }, [dispatchState]);
441
+ const handleCheckboxItemClick = (0, react_1.useCallback)(id => {
442
+ dispatchUiState({
443
+ type: uiStateActionType_1.UiStateActionType.SetCurrentAdjustmentId,
444
+ payload: id
445
+ });
446
+ handleSetStep(id ? groupsFilterInterfaces_1.FilterMenuStep.Adjustment : groupsFilterInterfaces_1.FilterMenuStep.Initial);
447
+ }, [dispatchUiState, handleSetStep]);
448
+ const handleCheckboxItemAdjustmentClick = (0, react_1.useCallback)(value => {
449
+ if (value.id === groupsFilterBox_1.ADVANCED_FILTER_ID) {
450
+ const currentVal = value.state ? uiState.uncheckedAdvancedState : state.advancedFilterState;
451
+ !value.state && dispatchUiState({
452
+ type: uiStateActionType_1.UiStateActionType.SetUncheckedAdvancedState,
453
+ payload: currentVal
454
+ });
455
+ !value.state && dispatchState({
456
+ type: stateActionType_1.StateActionType.SetAdvancedFilterState,
457
+ payload: (0, groupsHelper_1.getDefaultFilterState)()
458
+ });
459
+ value.state && dispatchState({
460
+ type: stateActionType_1.StateActionType.SetAdvancedFilterState,
461
+ payload: currentVal || state.frozenState.advancedFilterState || (0, groupsHelper_1.getDefaultFilterState)()
462
+ });
463
+ return;
464
+ }
465
+ dispatchUiState({
466
+ type: uiStateActionType_1.UiStateActionType.SetUncheckedAdjustmentIds,
467
+ payload: !value.state ? [...uiState.uncheckedAdjustmentIds, value.id] : uiState.uncheckedAdjustmentIds.filter(id => id !== value.id)
468
+ });
469
+ dispatchState({
470
+ type: stateActionType_1.StateActionType.ChangeSelection,
471
+ payload: {
472
+ value: value.state,
473
+ itemId: value.id
474
+ }
475
+ });
476
+ }, [dispatchState, dispatchUiState, state.advancedFilterState, state.frozenState.advancedFilterState, uiState.uncheckedAdvancedState, uiState.uncheckedAdjustmentIds]);
477
+ const basicHandleBackButtonClick = (0, react_1.useCallback)(() => {
478
+ handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
479
+ }, [handleSetStep]);
480
+ const handleBackButtonClick = (0, react_1.useCallback)(() => {
481
+ const currentEl = uiState.currentAdjustmentId ? (0, stateReducerHelper_1.getGroupsTreeItem)(state, uiState.currentAdjustmentId) : undefined;
482
+ if (!uiState.currentAdjustmentId || !(currentEl === null || currentEl === void 0 ? void 0 : currentEl.parent)) {
483
+ basicHandleBackButtonClick();
484
+ return;
485
+ }
486
+ const isNotRoot = currentEl.parent.id && currentEl.parent.id !== groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID;
487
+ dispatchUiState({
488
+ type: uiStateActionType_1.UiStateActionType.SetCurrentAdjustmentId,
489
+ payload: isNotRoot ? currentEl.parent.id : undefined
490
+ });
491
+ handleSetStep(isNotRoot ? groupsFilterInterfaces_1.FilterMenuStep.Adjustment : groupsFilterInterfaces_1.FilterMenuStep.Initial);
492
+ }, [basicHandleBackButtonClick, handleSetStep, state, uiState.currentAdjustmentId]);
493
+ const handleHomeButtonClick = (0, react_1.useCallback)(() => {
494
+ handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.Initial);
495
+ uiState.currentAdjustmentId && dispatchUiState({
496
+ type: uiStateActionType_1.UiStateActionType.SetCurrentAdjustmentId,
497
+ payload: undefined
498
+ });
499
+ }, [handleSetStep, uiState.currentAdjustmentId, dispatchUiState]);
500
+ const handleCurrentlySelectedClick = (0, react_1.useCallback)(() => {
501
+ handleSetStep(groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected);
502
+ }, [handleSetStep]);
503
+ const selectAllHandler = (0, react_1.useCallback)(isAllSelected => {
504
+ if (!uiState.currentAdjustmentId) {
505
+ return;
506
+ }
507
+ dispatchState({
508
+ type: isAllSelected ? stateActionType_1.StateActionType.DeselectAllChildren : stateActionType_1.StateActionType.SelectAllChildren,
509
+ payload: uiState.currentAdjustmentId
510
+ });
511
+ }, [uiState.currentAdjustmentId, dispatchState]);
512
+ const handleTriggerClick = () => {
513
+ dispatchUiState({
514
+ type: uiStateActionType_1.UiStateActionType.ToggleOpen,
515
+ payload: undefined
516
+ });
517
+ };
518
+ const handleAdvancedDialogOpen = (0, react_1.useCallback)(() => {
519
+ dispatchUiState({
520
+ type: uiStateActionType_1.UiStateActionType.SetAdvancedFilterIsOpen,
521
+ payload: true
522
+ });
523
+ }, []);
524
+ const handleAdvancedDialogClose = (0, react_1.useCallback)(() => {
525
+ dispatchUiState({
526
+ type: uiStateActionType_1.UiStateActionType.SetAdvancedFilterIsOpen,
527
+ payload: false
528
+ });
529
+ }, []);
530
+ const handleAdvancedDialogApply = (0, react_1.useCallback)(val => {
531
+ dispatchUiState({
532
+ type: uiStateActionType_1.UiStateActionType.SetAdvancedFilterIsOpen,
533
+ payload: false
534
+ });
535
+ dispatchState({
536
+ type: stateActionType_1.StateActionType.SetAdvancedFilterState,
537
+ payload: val.items.length ? val : (0, groupsHelper_1.getDefaultFilterState)()
538
+ });
539
+ }, []);
540
+ const getAdvancedData = (0, react_1.useCallback)((_, searchValue) => dataLoader().then(data => searchValue ? data.filter(el => (el.name || el.id).toLocaleLowerCase().indexOf(searchValue.toLocaleLowerCase()) > -1) : data).catch(e => {
541
+ errorHandler(e);
542
+ return [];
543
+ }), [dataLoader, errorHandler]);
544
+ (0, react_1.useEffect)(() => {
545
+ dispatchUiState({
546
+ type: uiStateActionType_1.UiStateActionType.SetLoadWithError,
547
+ payload: false
548
+ });
549
+ dataLoader().then(groups => {
550
+ dispatchState({
551
+ type: stateActionType_1.StateActionType.CreateGroupsMap,
552
+ payload: groups
553
+ });
554
+ setDataItems(groups);
555
+ }).catch(e => {
556
+ dispatchUiState({
557
+ type: uiStateActionType_1.UiStateActionType.SetLoadWithError,
558
+ payload: true
559
+ });
560
+ errorHandler(e);
561
+ });
562
+ }, [dataLoader, errorHandler]);
563
+ (0, react_1.useEffect)(() => {
564
+ const step = uiState.step;
565
+ if (step !== groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected) {
566
+ return;
567
+ }
568
+ const groupsBlocks = (0, groupsFilterAdvancedValue_1.getAdvancedFilterValue)({
569
+ blocks: blocksMap[uiState.step],
570
+ state,
571
+ isWithColor: isWithColor || false,
572
+ uncheckedItems: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [],
573
+ uncheckedAdvancedState: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined,
574
+ listLimit
575
+ });
576
+ const label = (0, groupsFilterAdvancedValue_1.getAdvancedLabel)({
577
+ groupsBlocks
578
+ });
579
+ const selectedValues = dataItems.filter(item => {
580
+ var _a;
581
+ return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find(id => id === item.id);
582
+ }).map(item => item.name);
583
+ const selectedValuesLabel = selectedValues.join(` ${state.frozenState.relation === groupsFilterInterfaces_1.RelationOperator.OR ? translate("Or") : translate("And")} `);
584
+ if (!label && !selectedValuesLabel) {
585
+ setGroupPlaceHolder((options === null || options === void 0 ? void 0 : options.placeholder) || translate("Groups"));
586
+ return;
587
+ }
588
+ const separator = `${label && selectedValuesLabel ? ` ${state.frozenState.relation === groupsFilterInterfaces_1.RelationOperator.OR ? translate("Or") : translate("And")} ` : ""}`;
589
+ setGroupPlaceHolder(`${label}${separator}${selectedValuesLabel}`);
590
+ }, [uiState.searchValue, uiState.step, blocksMap, state, isWithColor, listLimit, uiState.currentAdjustmentId, uiState.uncheckedAdjustmentIds, uiState.uncheckedAdvancedState, dataItems, options === null || options === void 0 ? void 0 : options.placeholder, translate]);
591
+ const getGroupsBox = (0, react_1.useCallback)(() => (0, jsx_runtime_1.jsx)(groupsFilterBox_1.GroupsFilterBox, {
592
+ step: uiState.step,
593
+ currentId: uiState.currentAdjustmentId,
594
+ isWithColor: isWithColor || false,
595
+ state: state,
596
+ search: uiState.searchValue,
597
+ blocks: uiState.searchValue && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial ? [] : blocksMap[uiState.step],
598
+ onChange: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? handleCheckboxItemAdjustmentClick : handleCheckboxChange,
599
+ onClick: handleCheckboxItemClick,
600
+ uncheckedItems: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [],
601
+ uncheckedAdvancedState: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined,
602
+ listLimit: listLimit
603
+ }), [blocksMap, handleCheckboxChange, handleCheckboxItemAdjustmentClick, handleCheckboxItemClick, isWithColor, listLimit, state, uiState.currentAdjustmentId, uiState.searchValue, uiState.step, uiState.uncheckedAdjustmentIds, uiState.uncheckedAdvancedState]);
604
+ const onSideWideChange = newState => {
605
+ dispatchState({
606
+ type: stateActionType_1.StateActionType.SideWide,
607
+ payload: newState
608
+ });
609
+ };
610
+ const onRelationChange = newRelation => {
611
+ dispatchState({
612
+ type: stateActionType_1.StateActionType.Relation,
613
+ payload: newRelation
614
+ });
615
+ };
616
+ const getSearchResult = (0, react_1.useCallback)(() => {
617
+ const result = (0, stateReducerHelper_1.getSearchResultFromObject)(state, uiState.searchValue);
618
+ return result ? (result.builtInGroups.length + result.userGroups.length).toString() : "0";
619
+ }, [state, uiState.searchValue]);
620
+ const getAdvancedDialog = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(advancedGroupsFilter_1.AdvancedGroupsFilter, {
621
+ isOpen: uiState.isOpenAdvancedFilter,
622
+ onClose: handleAdvancedDialogClose,
623
+ onApply: handleAdvancedDialogApply,
624
+ state: state.advancedFilterState,
625
+ getData: getAdvancedData,
626
+ errorHandler: errorHandler,
627
+ dataItems: dataItems,
628
+ isMobile: isMobile
629
+ }), [uiState.isOpenAdvancedFilter, handleAdvancedDialogClose, handleAdvancedDialogApply, dataItems, state.advancedFilterState, getAdvancedData, errorHandler, isMobile]);
630
+ (0, react_1.useEffect)(() => {
631
+ if (!state.globalChanges) {
632
+ return;
633
+ }
634
+ const newState = {
635
+ groups: (0, groupsFilterHelper_1.convertPreparedFilters)(state.frozenState),
636
+ sideWide: state.frozenSideWideState
189
637
  };
190
- const handleAdvancedDialogOpen = (0, react_1.useCallback)(() => {
191
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetAdvancedFilterIsOpen, payload: true });
192
- }, []);
193
- const handleAdvancedDialogClose = (0, react_1.useCallback)(() => {
194
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetAdvancedFilterIsOpen, payload: false });
195
- }, []);
196
- const handleAdvancedDialogApply = (0, react_1.useCallback)((val) => {
197
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetAdvancedFilterIsOpen, payload: false });
198
- dispatchState({ type: stateActionType_1.StateActionType.SetAdvancedFilterState, payload: val.items.length ? val : (0, groupsHelper_1.getDefaultFilterState)() });
199
- }, []);
200
- const getAdvancedData = (0, react_1.useCallback)((_, searchValue) => dataLoader().then(data => (searchValue ? data.filter(el => (el.name || el.id).toLocaleLowerCase().indexOf(searchValue.toLocaleLowerCase()) > -1) : data)).catch((e) => {
201
- errorHandler(e);
202
- return [];
203
- }), [dataLoader, errorHandler]);
204
- (0, react_1.useEffect)(() => {
205
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetLoadWithError, payload: false });
206
- dataLoader().then(groups => {
207
- dispatchState({ type: stateActionType_1.StateActionType.CreateGroupsMap, payload: groups });
208
- setDataItems(groups);
209
- }).catch((e) => {
210
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetLoadWithError, payload: true });
211
- errorHandler(e);
212
- });
213
- }, [dataLoader, errorHandler]);
214
- (0, react_1.useEffect)(() => {
215
- const step = uiState.step;
216
- if (step !== groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected) {
217
- return;
218
- }
219
- const groupsBlocks = (0, groupsFilterAdvancedValue_1.getAdvancedFilterValue)({
220
- blocks: blocksMap[uiState.step],
221
- state,
222
- isWithColor: isWithColor || false,
223
- uncheckedItems: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [],
224
- uncheckedAdvancedState: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined,
225
- listLimit
226
- });
227
- const label = (0, groupsFilterAdvancedValue_1.getAdvancedLabel)({ groupsBlocks });
228
- const selectedValues = dataItems.filter((item) => { var _a; return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find((id) => id === item.id); }).map((item) => item.name);
229
- const selectedValuesLabel = selectedValues.join(` ${translate(state.frozenState.relation)} `);
230
- if (!label && !selectedValuesLabel) {
231
- setGroupPlaceHolder((options === null || options === void 0 ? void 0 : options.placeholder) || translate("Groups"));
232
- return;
233
- }
234
- const separator = `${label && selectedValuesLabel ? ` ${translate(state.frozenState.relation)} ` : ""}`;
235
- setGroupPlaceHolder(`${label}${separator}${selectedValuesLabel}`);
236
- }, [uiState.searchValue, uiState.step, blocksMap, state, isWithColor, listLimit, uiState.currentAdjustmentId,
237
- uiState.uncheckedAdjustmentIds, uiState.uncheckedAdvancedState, dataItems, options === null || options === void 0 ? void 0 : options.placeholder, translate]);
238
- const getGroupsBox = (0, react_1.useCallback)(() => (0, jsx_runtime_1.jsx)(groupsFilterBox_1.GroupsFilterBox, { step: uiState.step, currentId: uiState.currentAdjustmentId, isWithColor: isWithColor || false, state: state, search: uiState.searchValue, blocks: uiState.searchValue && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial ? [] : blocksMap[uiState.step], onChange: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? handleCheckboxItemAdjustmentClick : handleCheckboxChange, onClick: handleCheckboxItemClick, uncheckedItems: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [], uncheckedAdvancedState: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined, listLimit: listLimit }), [blocksMap, handleCheckboxChange, handleCheckboxItemAdjustmentClick, handleCheckboxItemClick, isWithColor, listLimit, state, uiState.currentAdjustmentId, uiState.searchValue, uiState.step,
239
- uiState.uncheckedAdjustmentIds, uiState.uncheckedAdvancedState]);
240
- const onSideWideChange = (newState) => { dispatchState({ type: stateActionType_1.StateActionType.SideWide, payload: newState }); };
241
- const onRelationChange = (newRelation) => { dispatchState({ type: stateActionType_1.StateActionType.Relation, payload: newRelation }); };
242
- const getSearchResult = (0, react_1.useCallback)(() => {
243
- const result = (0, stateReducerHelper_1.getSearchResultFromObject)(state, uiState.searchValue);
244
- return result ? (result.builtInGroups.length + result.userGroups.length).toString() : "0";
245
- }, [state, uiState.searchValue]);
246
- const getAdvancedDialog = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(advancedGroupsFilter_1.AdvancedGroupsFilter, { isOpen: uiState.isOpenAdvancedFilter, onClose: handleAdvancedDialogClose, onApply: handleAdvancedDialogApply, state: state.advancedFilterState, getData: getAdvancedData, errorHandler: errorHandler, dataItems: dataItems, isMobile: isMobile }), [uiState.isOpenAdvancedFilter, handleAdvancedDialogClose, handleAdvancedDialogApply, dataItems, state.advancedFilterState, getAdvancedData, errorHandler, isMobile]);
247
- (0, react_1.useEffect)(() => {
248
- if (!state.globalChanges) {
249
- return;
250
- }
251
- const newState = {
252
- groups: (0, groupsFilterHelper_1.convertPreparedFilters)(state.frozenState),
253
- sideWide: state.frozenSideWideState
254
- };
255
- if ((initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide) === state.frozenSideWideState && (0, groupsFilterHelper_1.comparePreparedFilters)((0, groupsFilterHelper_1.prepareFilters)(initialFilterStateInner.groups), state.frozenState)) {
256
- return;
257
- }
258
- const selectedValues = dataItems.filter(item => { var _a; return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find(id => id === item.id); }).map(item => item.name);
259
- setGroupPlaceHolder(selectedValues.length > 0 ? selectedValues.join(", ") : translate("Groups"));
260
- onChangeInner(Object.assign({}, newState));
261
- dispatchState({ type: stateActionType_1.StateActionType.TurnOfGlobalChanges, payload: undefined });
262
- }, [state.globalChanges, dataItems, translate, state.frozenState, state.frozenSideWideState, onChangeInner, initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide, initialFilterStateInner]);
263
- (0, react_1.useEffect)(() => {
264
- var _a;
265
- if (((_a = prevInitialState.current) === null || _a === void 0 ? void 0 : _a.sideWide) === (initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide)
266
- && (0, groupsFilterHelper_1.comparePreparedFilters)((0, groupsFilterHelper_1.prepareFilters)(initialFilterStateInner ? initialFilterStateInner.groups : (0, groupsHelper_1.getDefaultFilterState)()), (0, groupsFilterHelper_1.prepareFilters)(prevInitialState.current ? prevInitialState.current.groups : (0, groupsHelper_1.getDefaultFilterState)()))) {
267
- return;
268
- }
269
- const stateForDispatch = (initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.groups) ?
270
- { value: (0, groupsFilterHelper_1.prepareFilters)(initialFilterStateInner.groups), global: initialFilterStateInner.sideWide } : { value: (0, groupsFilterHelper_1.prepareFilters)((0, groupsHelper_1.getDefaultFilterState)()), global: false };
271
- if (Object.keys(state.groupsMap).length > 0) {
272
- prevInitialState.current = initialFilterStateInner ? Object.assign({}, initialFilterStateInner) : undefined;
273
- dispatchState({ type: stateActionType_1.StateActionType.CreateInitialState, payload: stateForDispatch });
274
- !(initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.groups) && dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetStep, payload: groupsFilterInterfaces_1.FilterMenuStep.Initial });
275
- }
276
- }, [initialFilterStateInner, state.groupsMap]);
277
- const handleReadyForFocus = (0, react_1.useCallback)((isCurrentOpen) => {
278
- var _a, _b, _c;
279
- if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
280
- return;
281
- }
282
- if (!isCurrentOpen) {
283
- (_b = emptyInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
284
- return;
285
- }
286
- (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focus();
287
- }, [inputRef]);
288
- (0, react_1.useEffect)(() => {
289
- var _a, _b, _c, _d;
290
- if (!uiState.isOpen) {
291
- return;
292
- }
293
- if (uiState.searchValue && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial || uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && uiState.searchValue === ""
294
- && prevSearchField.current !== uiState.searchValue) {
295
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
296
- prevSearchField.current = uiState.searchValue;
297
- }
298
- else {
299
- const firstFocusable = chip ? (_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(focusableSelector_1.FOCUSABLE_SELECTOR)[1] : (_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.querySelector(focusableSelector_1.FOCUSABLE_SELECTOR);
300
- prevSearchField.current = "";
301
- if (firstFocusable && !((_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.value)) {
302
- firstFocusable.focus();
303
- }
304
- }
305
- }, [uiState.searchValue, uiState.isOpen, uiState.step, handleSetStep, chip]);
306
- (0, react_1.useEffect)(() => {
307
- var _a;
308
- uiState.isOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
309
- }, [inputRef, uiState.isOpen]);
310
- (0, react_1.useEffect)(() => {
311
- if (!uiState.isOpen && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && (0, groupsFilterHelper_1.isFilterHasSelection)(state.frozenState)) {
312
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetStep, payload: groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected });
313
- }
314
- }, [uiState.isOpen, state.frozenState, uiState.step]);
315
- function handleEscape(e) {
316
- var _a;
317
- if (e && uiState.isOpen) {
318
- (_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
319
- }
320
- if (uiState.isOpenAdvancedFilter) {
321
- handleAdvancedDialogClose();
322
- return;
323
- }
324
- dispatchUiState({ type: uiStateActionType_1.UiStateActionType.SetIsOpen, payload: false });
325
- if (triggerRef.current) {
326
- triggerRef.current.focus();
327
- }
638
+ if ((initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide) === state.frozenSideWideState && (0, groupsFilterHelper_1.comparePreparedFilters)((0, groupsFilterHelper_1.prepareFilters)(initialFilterStateInner.groups), state.frozenState)) {
639
+ return;
640
+ }
641
+ const selectedValues = dataItems.filter(item => {
642
+ var _a;
643
+ return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find(id => id === item.id);
644
+ }).map(item => item.name);
645
+ setGroupPlaceHolder(selectedValues.length > 0 ? selectedValues.join(", ") : translate("Groups"));
646
+ onChangeInner(Object.assign({}, newState));
647
+ dispatchState({
648
+ type: stateActionType_1.StateActionType.TurnOfGlobalChanges,
649
+ payload: undefined
650
+ });
651
+ }, [state.globalChanges, dataItems, translate, state.frozenState, state.frozenSideWideState, onChangeInner, initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide, initialFilterStateInner]);
652
+ (0, react_1.useEffect)(() => {
653
+ var _a;
654
+ if (((_a = prevInitialState.current) === null || _a === void 0 ? void 0 : _a.sideWide) === (initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide) && (0, groupsFilterHelper_1.comparePreparedFilters)((0, groupsFilterHelper_1.prepareFilters)(initialFilterStateInner ? initialFilterStateInner.groups : (0, groupsHelper_1.getDefaultFilterState)()), (0, groupsFilterHelper_1.prepareFilters)(prevInitialState.current ? prevInitialState.current.groups : (0, groupsHelper_1.getDefaultFilterState)()))) {
655
+ return;
656
+ }
657
+ const stateForDispatch = (initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.groups) ? {
658
+ value: (0, groupsFilterHelper_1.prepareFilters)(initialFilterStateInner.groups),
659
+ global: initialFilterStateInner.sideWide
660
+ } : {
661
+ value: (0, groupsFilterHelper_1.prepareFilters)((0, groupsHelper_1.getDefaultFilterState)()),
662
+ global: false
663
+ };
664
+ if (Object.keys(state.groupsMap).length > 0) {
665
+ prevInitialState.current = initialFilterStateInner ? Object.assign({}, initialFilterStateInner) : undefined;
666
+ dispatchState({
667
+ type: stateActionType_1.StateActionType.CreateInitialState,
668
+ payload: stateForDispatch
669
+ });
670
+ !(initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.groups) && dispatchUiState({
671
+ type: uiStateActionType_1.UiStateActionType.SetStep,
672
+ payload: groupsFilterInterfaces_1.FilterMenuStep.Initial
673
+ });
674
+ }
675
+ }, [initialFilterStateInner, state.groupsMap]);
676
+ const handleReadyForFocus = (0, react_1.useCallback)(isCurrentOpen => {
677
+ var _a, _b, _c;
678
+ if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
679
+ return;
680
+ }
681
+ if (!isCurrentOpen) {
682
+ (_b = emptyInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
683
+ return;
684
+ }
685
+ (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focus();
686
+ }, [inputRef]);
687
+ (0, react_1.useEffect)(() => {
688
+ var _a, _b, _c, _d;
689
+ if (!uiState.isOpen) {
690
+ return;
691
+ }
692
+ if (uiState.searchValue && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial || uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && uiState.searchValue === "" && prevSearchField.current !== uiState.searchValue) {
693
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
694
+ prevSearchField.current = uiState.searchValue;
695
+ } else {
696
+ const firstFocusable = chip ? (_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(focusableSelector_1.FOCUSABLE_SELECTOR)[1] : (_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.querySelector(focusableSelector_1.FOCUSABLE_SELECTOR);
697
+ prevSearchField.current = "";
698
+ if (firstFocusable && !((_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.value)) {
699
+ firstFocusable.focus();
700
+ }
701
+ }
702
+ }, [uiState.searchValue, uiState.isOpen, uiState.step, handleSetStep, chip]);
703
+ (0, react_1.useEffect)(() => {
704
+ var _a;
705
+ uiState.isOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
706
+ }, [inputRef, uiState.isOpen]);
707
+ (0, react_1.useEffect)(() => {
708
+ if (!uiState.isOpen && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && (0, groupsFilterHelper_1.isFilterHasSelection)(state.frozenState)) {
709
+ dispatchUiState({
710
+ type: uiStateActionType_1.UiStateActionType.SetStep,
711
+ payload: groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected
712
+ });
713
+ }
714
+ }, [uiState.isOpen, state.frozenState, uiState.step]);
715
+ function handleEscape(e) {
716
+ var _a;
717
+ if (e && uiState.isOpen) {
718
+ (_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
719
+ }
720
+ if (uiState.isOpenAdvancedFilter) {
721
+ handleAdvancedDialogClose();
722
+ return;
328
723
  }
329
- (0, useEscape_1.useEscape)(triggerRef, handleEscape, uiState.isOpen);
330
- const selectedCount = (0, stateReducerHelper_1.getFrozenCount)(state);
331
- const isStateHasData = Object.keys(state.groupsMap).length > 0;
332
- const isApplyDisabled = !(0, stateReducerHelper_1.isStateChanged)(state);
333
- const memoizedContent = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-groups-filter-menu", isMobile ? "zen-groups-filter-menu--mobile" : ""]), ref: menuRef, children: [(chip || isMobile) ? (0, jsx_runtime_1.jsx)("div", { className: "zen-groups-filter__input-container", children: (0, jsx_runtime_1.jsx)(searchInput_1.SearchInput, { className: "zen-groups-filter__chip-input", onChange: onSearchChipChange, value: uiState.searchValue, ref: inputRef, id: groupsFilterId, placeholder: translate("Filter by group") }) }) : null, isStateHasData && !uiState.isLoadWithError && (0, jsx_runtime_1.jsxs)(groupsFilterMenu_1.GroupsFilterMenu, { onCancelClick: handleCancel, onApplyClick: handleApply, onResetClick: handleReset, isApplyDisabled: isApplyDisabled, hasFooter: !isMobile, children: [uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && (0, jsx_runtime_1.jsx)(groupsFilterInitialState_1.GroupsFilterInitialState, { siteWideState: state.sideWideState, onDialogButtonClick: handleAdvancedDialogOpen, count: (0, stateReducerHelper_1.getCurrentlySelectedCount)(state), onSiteWideChange: onSideWideChange, onCurrentlySelectedClick: handleCurrentlySelectedClick, searchResult: uiState.searchValue ? getSearchResult() : "", children: getGroupsBox() }), uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Adjustment && (0, jsx_runtime_1.jsx)(groupsFilterAdjustmentState_1.GroupsFilterAdjustmentState, { onBackButtonClick: handleBackButtonClick, onHomeButtonClick: handleHomeButtonClick, onSelectAllClick: selectAllHandler, backButtonName: (0, groupsFilterStatesHelper_1.getBackButtonName)(state, uiState.currentAdjustmentId), isAllSelected: (0, groupsFilterStatesHelper_1.isAllChildrenSelected)(state, uiState.currentAdjustmentId), children: getGroupsBox() }), uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected && (0, jsx_runtime_1.jsx)(groupsFilterCurrentlySelectedState_1.GroupsFilterCurrentlySelectedState, { siteWideState: state.sideWideState, relation: state.relation, count: (0, stateReducerHelper_1.getCurrentlySelectedCount)(state), onBackButtonClick: basicHandleBackButtonClick, onSiteWideChange: onSideWideChange, onRelationChange: onRelationChange, children: getGroupsBox() })] }), !uiState.isLoadWithError && !isStateHasData && !Object.keys(state.groupsMap).length && (0, jsx_runtime_1.jsx)(skeletonList_1.SkeletonList, { className: "zen-groups-filter__waiting" })] }), [isMobile, chip, onSearchChipChange, uiState.searchValue, uiState.isLoadWithError, uiState.step, uiState.currentAdjustmentId, groupsFilterId, translate,
334
- isStateHasData, handleCancel, handleApply, handleReset, isApplyDisabled, state, handleAdvancedDialogOpen, handleCurrentlySelectedClick, getSearchResult,
335
- getGroupsBox, handleBackButtonClick, handleHomeButtonClick, selectAllHandler, basicHandleBackButtonClick]);
336
- const memoizedFooterButtons = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)(footerButtons_1.FooterButtons, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleApply, type: buttonType_1.ButtonType.Primary, disabled: isApplyDisabled, className: "zen-groups-filter-menu__apply-button zen-ellipsis", title: translate("Apply"), children: translate("Apply") }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleCancel, className: "zen-groups-filter-menu__cancel-button zen-ellipsis", title: translate("Cancel"), children: translate("Cancel") }), (0, jsx_runtime_1.jsx)(button_1.Button, { type: buttonType_1.ButtonType.Tertiary, className: "zen-groups-filter-menu__reset-button zen-ellipsis", onClick: handleReset, children: translate("Clear") })] }), [handleApply, handleCancel, handleReset, isApplyDisabled, translate]);
337
- const memoizedMobileView = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)(mobileSheet_1.MobileSheet, { label: translate("Organization groups filter"), triggerRef: triggerRef, isOpen: uiState.isOpen, onHidePanel: onOptionsToggle, onCloseClick: onOptionsToggle, preventFirstFocus: true, onReadyForFocus: handleReadyForFocus, children: [(0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Title, { children: translate("Filter by group") }), (0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Content, { children: memoizedContent }), (0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Footer, { children: memoizedFooterButtons })] }), [translate, uiState.isOpen, onOptionsToggle, handleReadyForFocus, memoizedContent, memoizedFooterButtons]);
338
- const memoizedDesktopView = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, { isOpen: uiState.isOpen, className: (0, classNames_1.classNames)(["zen-groups-filter__popup",
339
- uiState.isOpenAdvancedFilter ? "zen-groups-filter__popup--inactive" : "", className ? className : ""]), onOpenChange: onOptionsToggle, useTrapFocusWithTrigger: uiState.isOpenAdvancedFilter ? "off" : "withTrigger", shouldHoldScroll: true, triggerRef: triggerRef, ariaLabel: translate("Organization groups filter"), recalculateOnScroll: true, children: memoizedContent }), [className, memoizedContent, onOptionsToggle, translate, uiState.isOpen, uiState.isOpenAdvancedFilter]);
340
- const triggerClassName = (0, classNames_1.classNames)(["zen-groups-filter-trigger", isError ? "zen-groups-filter-trigger--error" : ""]);
341
- if (isReadOnly) {
342
- // TODO: how many items should we show?
343
- return (0, jsx_runtime_1.jsx)(reviewTextControl_1.ReviewTextControl, { value: groupPlaceHolder });
724
+ dispatchUiState({
725
+ type: uiStateActionType_1.UiStateActionType.SetIsOpen,
726
+ payload: false
727
+ });
728
+ if (triggerRef.current) {
729
+ triggerRef.current.focus();
344
730
  }
345
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [chip ? (0, jsx_runtime_1.jsx)(chip_1.Chip, { status: selectedCount ? chipStatus || "active" : undefined, isOpen: uiState.isOpen, disabled: false, onClick: handleTriggerClick, onClose: selectedCount ? handleChipClose : undefined, triggerRef: triggerRef, icon: chipIcon, id: chipId, children: groupPlaceHolder !== translate("Groups") ? groupPlaceHolder : chipName })
346
- : (0, jsx_runtime_1.jsx)(groupsFilterTrigger_1.GroupsFilterTrigger, { value: uiState.searchValue, className: triggerClassName, onChange: onSearchChange, isOpenPopup: uiState.isOpen, count: selectedCount, withGlobeIcon: state.frozenSideWideState && selectedCount > 0, inputRef: isMobile ? emptyInputRef : inputRef, handleClick: handleTriggerClick, ref: triggerRef, fullSize: fullSize, placeholder: groupPlaceHolder }), isMobile ? memoizedMobileView : memoizedDesktopView, uiState.isOpenAdvancedFilter && getAdvancedDialog] });
731
+ }
732
+ (0, useEscape_1.useEscape)(triggerRef, handleEscape, uiState.isOpen);
733
+ const selectedCount = (0, stateReducerHelper_1.getFrozenCount)(state);
734
+ const isStateHasData = Object.keys(state.groupsMap).length > 0;
735
+ const isApplyDisabled = !(0, stateReducerHelper_1.isStateChanged)(state);
736
+ const memoizedContent = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)("div", {
737
+ className: (0, classNames_1.classNames)(["zen-groups-filter-menu", isMobile ? "zen-groups-filter-menu--mobile" : ""]),
738
+ ref: menuRef,
739
+ children: [chip || isMobile ? (0, jsx_runtime_1.jsx)("div", {
740
+ className: "zen-groups-filter__input-container",
741
+ children: (0, jsx_runtime_1.jsx)(searchInput_1.SearchInput, {
742
+ className: "zen-groups-filter__chip-input",
743
+ onChange: onSearchChipChange,
744
+ value: uiState.searchValue,
745
+ ref: inputRef,
746
+ id: groupsFilterId,
747
+ placeholder: translate("Filter by group")
748
+ })
749
+ }) : null, isStateHasData && !uiState.isLoadWithError && (0, jsx_runtime_1.jsxs)(groupsFilterMenu_1.GroupsFilterMenu, {
750
+ onCancelClick: handleCancel,
751
+ onApplyClick: handleApply,
752
+ onResetClick: handleReset,
753
+ isApplyDisabled: isApplyDisabled,
754
+ hasFooter: !isMobile,
755
+ children: [uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && (0, jsx_runtime_1.jsx)(groupsFilterInitialState_1.GroupsFilterInitialState, {
756
+ siteWideState: state.sideWideState,
757
+ onDialogButtonClick: handleAdvancedDialogOpen,
758
+ count: (0, stateReducerHelper_1.getCurrentlySelectedCount)(state),
759
+ onSiteWideChange: onSideWideChange,
760
+ onCurrentlySelectedClick: handleCurrentlySelectedClick,
761
+ searchResult: uiState.searchValue ? getSearchResult() : "",
762
+ children: getGroupsBox()
763
+ }), uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Adjustment && (0, jsx_runtime_1.jsx)(groupsFilterAdjustmentState_1.GroupsFilterAdjustmentState, {
764
+ onBackButtonClick: handleBackButtonClick,
765
+ onHomeButtonClick: handleHomeButtonClick,
766
+ onSelectAllClick: selectAllHandler,
767
+ backButtonName: (0, groupsFilterStatesHelper_1.getBackButtonName)(state, uiState.currentAdjustmentId),
768
+ isAllSelected: (0, groupsFilterStatesHelper_1.isAllChildrenSelected)(state, uiState.currentAdjustmentId),
769
+ children: getGroupsBox()
770
+ }), uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected && (0, jsx_runtime_1.jsx)(groupsFilterCurrentlySelectedState_1.GroupsFilterCurrentlySelectedState, {
771
+ siteWideState: state.sideWideState,
772
+ relation: state.relation,
773
+ count: (0, stateReducerHelper_1.getCurrentlySelectedCount)(state),
774
+ onBackButtonClick: basicHandleBackButtonClick,
775
+ onSiteWideChange: onSideWideChange,
776
+ onRelationChange: onRelationChange,
777
+ children: getGroupsBox()
778
+ })]
779
+ }), !uiState.isLoadWithError && !isStateHasData && !Object.keys(state.groupsMap).length && (0, jsx_runtime_1.jsx)(skeletonList_1.SkeletonList, {
780
+ className: "zen-groups-filter__waiting"
781
+ })]
782
+ }), [isMobile, chip, onSearchChipChange, uiState.searchValue, uiState.isLoadWithError, uiState.step, uiState.currentAdjustmentId, groupsFilterId, translate, isStateHasData, handleCancel, handleApply, handleReset, isApplyDisabled, state, handleAdvancedDialogOpen, handleCurrentlySelectedClick, getSearchResult, getGroupsBox, handleBackButtonClick, handleHomeButtonClick, selectAllHandler, basicHandleBackButtonClick]);
783
+ const memoizedFooterButtons = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)(footerButtons_1.FooterButtons, {
784
+ children: [(0, jsx_runtime_1.jsx)(button_1.Button, {
785
+ onClick: handleApply,
786
+ type: buttonType_1.ButtonType.Primary,
787
+ disabled: isApplyDisabled,
788
+ className: "zen-groups-filter-menu__apply-button zen-ellipsis",
789
+ title: translate("Apply"),
790
+ children: translate("Apply")
791
+ }), (0, jsx_runtime_1.jsx)(button_1.Button, {
792
+ onClick: handleCancel,
793
+ className: "zen-groups-filter-menu__cancel-button zen-ellipsis",
794
+ title: translate("Cancel"),
795
+ children: translate("Cancel")
796
+ }), (0, jsx_runtime_1.jsx)(button_1.Button, {
797
+ type: buttonType_1.ButtonType.Tertiary,
798
+ className: "zen-groups-filter-menu__reset-button zen-ellipsis",
799
+ onClick: handleReset,
800
+ children: translate("Clear")
801
+ })]
802
+ }), [handleApply, handleCancel, handleReset, isApplyDisabled, translate]);
803
+ const memoizedMobileView = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)(mobileSheet_1.MobileSheet, {
804
+ label: translate("Organization groups filter"),
805
+ triggerRef: triggerRef,
806
+ isOpen: uiState.isOpen,
807
+ onHidePanel: onOptionsToggle,
808
+ onCloseClick: onOptionsToggle,
809
+ preventFirstFocus: true,
810
+ onReadyForFocus: handleReadyForFocus,
811
+ children: [(0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Title, {
812
+ children: translate("Filter by group")
813
+ }), (0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Content, {
814
+ children: memoizedContent
815
+ }), (0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Footer, {
816
+ children: memoizedFooterButtons
817
+ })]
818
+ }), [translate, uiState.isOpen, onOptionsToggle, handleReadyForFocus, memoizedContent, memoizedFooterButtons]);
819
+ const memoizedDesktopView = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, {
820
+ isOpen: uiState.isOpen,
821
+ className: (0, classNames_1.classNames)(["zen-groups-filter__popup", uiState.isOpenAdvancedFilter ? "zen-groups-filter__popup--inactive" : "", classNamePopup || ""]),
822
+ onOpenChange: onOptionsToggle,
823
+ useTrapFocusWithTrigger: uiState.isOpenAdvancedFilter ? "off" : "withTrigger",
824
+ shouldHoldScroll: true,
825
+ triggerRef: triggerRef,
826
+ ariaLabel: translate("Organization groups filter"),
827
+ recalculateOnScroll: true,
828
+ children: memoizedContent
829
+ }), [classNamePopup, memoizedContent, onOptionsToggle, translate, uiState.isOpen, uiState.isOpenAdvancedFilter]);
830
+ const triggerClassName = (0, classNames_1.classNames)(["zen-groups-filter-trigger", isError ? "zen-groups-filter-trigger--error" : "", className || ""]);
831
+ if (isReadOnly) {
832
+ // TODO: how many items should we show?
833
+ return (0, jsx_runtime_1.jsx)(reviewTextControl_1.ReviewTextControl, {
834
+ value: groupPlaceHolder
835
+ });
836
+ }
837
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
838
+ children: [chip ? (0, jsx_runtime_1.jsx)(chip_1.Chip, {
839
+ status: selectedCount ? chipStatus || "active" : undefined,
840
+ isOpen: uiState.isOpen,
841
+ disabled: false,
842
+ onClick: handleTriggerClick,
843
+ onClose: selectedCount ? handleChipClose : undefined,
844
+ triggerRef: triggerRef,
845
+ icon: chipIcon,
846
+ id: chipId,
847
+ children: groupPlaceHolder !== translate("Groups") ? groupPlaceHolder : chipName
848
+ }) : (0, jsx_runtime_1.jsx)(groupsFilterTrigger_1.GroupsFilterTrigger, {
849
+ value: uiState.searchValue,
850
+ className: triggerClassName,
851
+ onChange: onSearchChange,
852
+ isOpenPopup: uiState.isOpen,
853
+ count: selectedCount,
854
+ withGlobeIcon: state.frozenSideWideState && selectedCount > 0,
855
+ inputRef: isMobile ? emptyInputRef : inputRef,
856
+ handleClick: handleTriggerClick,
857
+ ref: triggerRef,
858
+ fullSize: fullSize,
859
+ placeholder: groupPlaceHolder
860
+ }), isMobile ? memoizedMobileView : memoizedDesktopView, uiState.isOpenAdvancedFilter && getAdvancedDialog]
861
+ });
347
862
  };
348
863
  exports.GroupsFilterRaw = GroupsFilterRaw;
349
- exports.TRANSLATIONS = [
350
- "Organization groups filter",
351
- ...groupsFilterMenu_1.TRANSLATIONS,
352
- ...groupsFilterTrigger_1.TRANSLATIONS,
353
- ...groupsFilterAdjustmentState_1.TRANSLATIONS,
354
- ...groupsFilterInitialState_1.TRANSLATIONS,
355
- ...groupsFilterCurrentlySelectedState_1.TRANSLATIONS
356
- ];
864
+ exports.TRANSLATIONS = ["Organization groups filter", ...groupsFilterMenu_1.TRANSLATIONS, ...groupsFilterTrigger_1.TRANSLATIONS, ...groupsFilterAdjustmentState_1.TRANSLATIONS, ...groupsFilterInitialState_1.TRANSLATIONS, ...groupsFilterCurrentlySelectedState_1.TRANSLATIONS];