@geotab/zenith 3.1.1-beta.6 → 3.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) 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 +173 -59
  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/components/filtersSidePanelDropdown.js +2 -2
  73. package/dist/filters/filters.js +445 -268
  74. package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +729 -272
  75. package/dist/filtersBar/components/resetComponentButton.js +45 -5
  76. package/dist/filtersBar/filtersBarActions/filtersBarActions.js +126 -15
  77. package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRadioGroup/filtersBarSidePanelRadioGroup.js +2 -2
  78. package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +155 -49
  79. package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +360 -104
  80. package/dist/filtersBar/filtersContainer/filtersContainer.js +204 -134
  81. package/dist/formField/components/formFieldWithLabel.d.ts +2 -1
  82. package/dist/formField/components/formFieldWithLabel.js +3 -2
  83. package/dist/formField/components/formFieldWithoutLabel.d.ts +2 -1
  84. package/dist/formField/components/formFieldWithoutLabel.js +3 -3
  85. package/dist/formField/components/trailingComponent.d.ts +8 -0
  86. package/dist/formField/components/trailingComponent.js +11 -0
  87. package/dist/formField/formField.js +26 -11
  88. package/dist/formField/hooks/useError.js +100 -36
  89. package/dist/formGroup/components/reviewListToggle/reviewListToggle.js +72 -7
  90. package/dist/formGroup/hooks/useToggle.js +37 -11
  91. package/dist/formGroup/utils/getControls.js +8 -7
  92. package/dist/formLayout/hooks/useError.js +55 -15
  93. package/dist/formLayout/hooks/useFormButtons.js +128 -27
  94. package/dist/formSection/components/formSectionModal.js +1 -1
  95. package/dist/formSection/formSection.js +1 -1
  96. package/dist/formSection/hooks/useError.js +70 -22
  97. package/dist/formStepper/components/formStep.js +65 -10
  98. package/dist/formStepper/formStepper.js +129 -33
  99. package/dist/formStepperButtons/formStepperButtons.js +184 -38
  100. package/dist/groupsFilter/groupsHelper.d.ts +1 -1
  101. package/dist/groupsFilterRaw/groupsFilterAdjustmentState.js +162 -17
  102. package/dist/groupsFilterRaw/groupsFilterBox.js +137 -32
  103. package/dist/groupsFilterRaw/groupsFilterCommon.js +75 -8
  104. package/dist/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +184 -25
  105. package/dist/groupsFilterRaw/groupsFilterHelper.d.ts +2 -1
  106. package/dist/groupsFilterRaw/groupsFilterHelper.js +284 -168
  107. package/dist/groupsFilterRaw/groupsFilterInitialState.js +266 -18
  108. package/dist/groupsFilterRaw/groupsFilterMenu.js +124 -9
  109. package/dist/groupsFilterRaw/groupsFilterRaw.d.ts +1 -0
  110. package/dist/groupsFilterRaw/groupsFilterRaw.js +816 -308
  111. package/dist/groupsFilterRaw/groupsFilterTestData.d.ts +155 -2
  112. package/dist/groupsFilterRaw/groupsFilterTestData.js +153 -58
  113. package/dist/groupsFilterRaw/groupsFilterTrigger.js +139 -35
  114. package/dist/groupsFilterRaw/groupsHelper.js +739 -208
  115. package/dist/groupsFilterRaw/stateReducer/stateReducerHelper.js +3 -1
  116. package/dist/groupsFilterRaw/types.d.ts +1 -0
  117. package/dist/header/components/collapsedItemsControl/collapsedItemsControl.js +107 -52
  118. package/dist/header/components/mobileFilterControl/mobileFilterControl.js +62 -9
  119. package/dist/header/components/mobileSearchControl/mobileSearchControl.js +119 -14
  120. package/dist/header/headerBack.js +64 -20
  121. package/dist/index.css +116 -74
  122. package/dist/index.d.ts +1 -0
  123. package/dist/index.js +4 -1
  124. package/dist/list/itemData/itemDataInternal.js +216 -51
  125. package/dist/list/listItem/listItem.js +168 -55
  126. package/dist/menu/components/menuErrorItem.js +33 -5
  127. package/dist/mobileSheet/mobileSheet.js +195 -69
  128. package/dist/modal/modal.js +300 -142
  129. package/dist/nav/nav.js +1 -1
  130. package/dist/nav/navFooter/navFooter.js +82 -39
  131. package/dist/nav/navFooter/navFooterAction/navFooterAction.js +52 -13
  132. package/dist/nav/navHeader/navHeader.js +86 -36
  133. package/dist/nav/navHeader/navHeaderSearch/navHeaderSearch.js +88 -29
  134. package/dist/nav/navItem/navItem.d.ts +3 -3
  135. package/dist/nav/navItem/navItem.js +35 -33
  136. package/dist/nav/navMobileBar/navMobileBar.js +67 -21
  137. package/dist/notification/notification.js +124 -21
  138. package/dist/pagination/paginationArrow.js +81 -11
  139. package/dist/pagination/paginationText/paginationText.js +45 -11
  140. package/dist/pill/components/pillNonActionable/pillNonActionable.js +93 -24
  141. package/dist/pillBox/components/pillBoxItem.js +52 -9
  142. package/dist/pillBox/pillBox.js +121 -20
  143. package/dist/pillExpandable/pillExpandable.js +333 -139
  144. package/dist/rangeRaw/rangeRaw.js +486 -141
  145. package/dist/rangeRaw/utils/rangeHelper.js +209 -39
  146. package/dist/searchInputRaw/searchInputRaw.js +180 -65
  147. package/dist/skeleton/skeleton.js +51 -6
  148. package/dist/sortControl/sortControl.js +152 -42
  149. package/dist/stepperRaw/stepperRaw.js +116 -42
  150. package/dist/summary/summary.js +94 -8
  151. package/dist/table/actions/actionsMenu.js +171 -78
  152. package/dist/table/flexible/columnSettings.js +80 -10
  153. package/dist/table/flexible/columnsList.js +110 -43
  154. package/dist/table/flexible/columnsPopup.js +77 -20
  155. package/dist/table/nested/useNestedRows.js +167 -77
  156. package/dist/table/selectable/selectableHeader.js +180 -41
  157. package/dist/table/selectable/useSelectableRows.js +270 -191
  158. package/dist/table/sortable/sortableHeader.js +153 -75
  159. package/dist/tabs/tabs.js +227 -118
  160. package/dist/timePickerRaw/timePickerRaw.js +278 -58
  161. package/dist/toastRaw/toastRaw.js +138 -32
  162. package/dist/toggleButton/toggleButton.d.ts +0 -1
  163. package/dist/toggleButtonRaw/toggleButtonRaw.d.ts +1 -0
  164. package/dist/toggleButtonRaw/toggleButtonRaw.js +146 -40
  165. package/dist/utils/formatDate.js +1001 -117
  166. package/{esm/utils/localization/translations/cs-json.js → dist/utils/localization/translations/cs.json} +11 -12
  167. package/{esm/utils/localization/translations/da-DK-json.js → dist/utils/localization/translations/da-DK.json} +31 -23
  168. package/{esm/utils/localization/translations/de-json.js → dist/utils/localization/translations/de.json} +12 -13
  169. package/dist/utils/localization/translations/en.json +308 -0
  170. package/{esm/utils/localization/translations/es-json.js → dist/utils/localization/translations/es.json} +11 -12
  171. package/{esm/utils/localization/translations/fi-FI-json.js → dist/utils/localization/translations/fi-FI.json} +31 -23
  172. package/{esm/utils/localization/translations/fr-FR-json.js → dist/utils/localization/translations/fr-FR.json} +12 -12
  173. package/{esm/utils/localization/translations/fr-json.js → dist/utils/localization/translations/fr.json} +11 -12
  174. package/{esm/utils/localization/translations/hu-HU-json.js → dist/utils/localization/translations/hu-HU.json} +31 -23
  175. package/{esm/utils/localization/translations/id-json.js → dist/utils/localization/translations/id.json} +11 -13
  176. package/{esm/utils/localization/translations/it-json.js → dist/utils/localization/translations/it.json} +11 -12
  177. package/{esm/utils/localization/translations/ja-json.js → dist/utils/localization/translations/ja.json} +11 -12
  178. package/{esm/utils/localization/translations/ko-KR-json.js → dist/utils/localization/translations/ko-KR.json} +24 -23
  179. package/{esm/utils/localization/translations/ms-json.js → dist/utils/localization/translations/ms.json} +11 -12
  180. package/{esm/utils/localization/translations/nb-NO-json.js → dist/utils/localization/translations/nb-NO.json} +31 -23
  181. package/{esm/utils/localization/translations/nl-json.js → dist/utils/localization/translations/nl.json} +11 -12
  182. package/{esm/utils/localization/translations/pl-json.js → dist/utils/localization/translations/pl.json} +11 -12
  183. package/{esm/utils/localization/translations/pt-BR-json.js → dist/utils/localization/translations/pt-BR.json} +11 -12
  184. package/{esm/utils/localization/translations/sk-SK-json.js → dist/utils/localization/translations/sk-SK.json} +31 -23
  185. package/{esm/utils/localization/translations/sv-json.js → dist/utils/localization/translations/sv.json} +11 -12
  186. package/{esm/utils/localization/translations/th-json.js → dist/utils/localization/translations/th.json} +11 -12
  187. package/{esm/utils/localization/translations/tr-json.js → dist/utils/localization/translations/tr.json} +11 -12
  188. package/{esm/utils/localization/translations/zh-Hans-json.js → dist/utils/localization/translations/zh-Hans.json} +11 -12
  189. package/{esm/utils/localization/translations/zh-TW-json.js → dist/utils/localization/translations/zh-TW.json} +11 -23
  190. package/dist/utils/localization/translationsDictionary.d.ts +2 -0
  191. package/dist/utils/localization/translationsDictionary.js +63 -0
  192. package/dist/utils/localization/useLanguage.js +2 -74
  193. package/esm/advancedGroupsFilter/advancedGroupsFilter.js +130 -29
  194. package/esm/advancedGroupsFilter/advancedGroupsFilterForm.js +133 -33
  195. package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +317 -65
  196. package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.d.ts +0 -1
  197. package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +77 -8
  198. package/esm/alertRaw/alertRaw.js +165 -51
  199. package/esm/banner/bannerMultipLine.js +121 -20
  200. package/esm/banner/bannerSingleLine.js +100 -13
  201. package/esm/betaPill/betaPill.js +105 -19
  202. package/esm/bookmark/bookmark.js +89 -27
  203. package/esm/bulkEditControl/bulkEditControl.js +161 -33
  204. package/esm/calendar/calendar.js +937 -272
  205. package/esm/calendar/calendarUtils.js +151 -84
  206. package/esm/card/card.js +233 -101
  207. package/esm/chart/accessibleChart/accessibleChartNarrative.js +642 -554
  208. package/esm/chart/accessibleChart/accessibleChartTable.js +239 -85
  209. package/esm/chart/chart.js +30 -20
  210. package/esm/chart/chartAxis/chartAxis.js +79 -6
  211. package/esm/checkboxListWithAction/checkboxListWithAction.js +218 -68
  212. package/esm/chip/chip.js +189 -90
  213. package/esm/columnsSelector/columnsSelector.js +91 -11
  214. package/esm/columnsSelector/columnsTab/columnsTab.js +53 -14
  215. package/esm/columnsSelector/columnsTabGroup/columnsTabGroup.js +75 -33
  216. package/esm/comboboxSelected/comboboxSelected.js +1 -3
  217. package/esm/dataFeed/feedExpandControl/feedExpandControl.js +21 -9
  218. package/esm/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +86 -10
  219. package/esm/dataGrid/dataGrid.js +221 -116
  220. package/esm/dataGrid/emptySearchList/emptySearchList.js +50 -8
  221. package/esm/dataGrid/entitiesListActions/actions/columnsListButton.js +45 -6
  222. package/esm/dataGrid/entitiesListActions/actions/fullscreenButton.js +58 -17
  223. package/esm/dataGrid/withFlexibleColumns/components/columnSettings.js +78 -9
  224. package/esm/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +44 -15
  225. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +217 -31
  226. package/esm/dataGrid/withSelectableRows/withSelectableRows.js +280 -212
  227. package/esm/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +172 -94
  228. package/esm/dateInputInner/dateInputInner.js +785 -475
  229. package/esm/dateInputInner/dateInputInnerControlBlock.js +119 -21
  230. package/esm/dateInputRaw/dateInputRaw.js +309 -103
  231. package/esm/dateInputRaw/utils/getLabel.js +32 -6
  232. package/esm/dateRangeInner/dateRangeInner.js +167 -58
  233. package/esm/dateRangeRaw/dateRangeRaw.js +595 -238
  234. package/esm/dateRangeRaw/utils/dateRangeUtils.js +622 -239
  235. package/esm/dateSelectionWrapper/dateSelectionWrapper.js +146 -13
  236. package/esm/dialog/dialogContent.js +117 -39
  237. package/esm/dropdownRaw/dropdownHelper.d.ts +2 -2
  238. package/esm/dropdownRaw/dropdownHelper.js +10 -10
  239. package/esm/dropdownRaw/dropdownList.js +412 -56
  240. package/esm/dropdownRaw/dropdownPopup.js +212 -19
  241. package/esm/dropdownRaw/dropdownRaw.js +862 -507
  242. package/esm/dropdownRaw/dropdownSearchableTrigger.js +217 -45
  243. package/esm/dropdownRaw/stateReducer/stateAction.d.ts +5 -1
  244. package/esm/dropdownRaw/stateReducer/stateActionType.d.ts +2 -1
  245. package/esm/dropdownRaw/stateReducer/stateActionType.js +1 -0
  246. package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +6 -1
  247. package/esm/dropdownRaw/stateReducer/stateReducer.js +24 -12
  248. package/esm/dropdownRaw/stateReducer/stateReducerHelper.d.ts +2 -0
  249. package/esm/dropdownRaw/stateReducer/stateReducerHelper.js +18 -0
  250. package/esm/dropdownRaw/stateReducer/stateReducerTestData.d.ts +39 -0
  251. package/esm/dropdownRaw/stateReducer/stateReducerTestData.js +71 -0
  252. package/esm/dropdownRaw/types.d.ts +1 -0
  253. package/esm/favoriteButton/favoriteButton.js +53 -9
  254. package/esm/filters/components/filtersContainer.js +141 -61
  255. package/esm/filters/components/filtersEmptySelectedList.js +24 -3
  256. package/esm/filters/components/filtersSaveModal.js +134 -41
  257. package/esm/filters/components/filtersSavedChipComponent.js +312 -107
  258. package/esm/filters/components/filtersSearchItemData.js +121 -46
  259. package/esm/filters/components/filtersSearchList.js +375 -178
  260. package/esm/filters/components/filtersSelect.js +122 -60
  261. package/esm/filters/components/filtersSelectListItem.js +119 -12
  262. package/esm/filters/components/filtersSidePanel.js +504 -177
  263. package/esm/filters/components/filtersSidePanelDropdown.js +2 -2
  264. package/esm/filters/filters.js +435 -265
  265. package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +722 -270
  266. package/esm/filtersBar/components/resetComponentButton.js +39 -4
  267. package/esm/filtersBar/filtersBarActions/filtersBarActions.js +120 -14
  268. package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRadioGroup/filtersBarSidePanelRadioGroup.js +2 -2
  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.js +27 -12
  279. package/esm/formField/hooks/useError.js +94 -35
  280. package/esm/formGroup/components/reviewListToggle/reviewListToggle.js +66 -6
  281. package/esm/formGroup/hooks/useToggle.js +31 -10
  282. package/esm/formGroup/utils/getControls.js +8 -7
  283. package/esm/formLayout/hooks/useError.js +49 -14
  284. package/esm/formLayout/hooks/useFormButtons.js +122 -26
  285. package/esm/formSection/components/formSectionModal.js +1 -1
  286. package/esm/formSection/formSection.js +1 -1
  287. package/esm/formSection/hooks/useError.js +64 -21
  288. package/esm/formStepper/components/formStep.js +59 -9
  289. package/esm/formStepper/formStepper.js +123 -32
  290. package/esm/formStepperButtons/formStepperButtons.js +178 -37
  291. package/esm/groupsFilter/groupsHelper.d.ts +1 -1
  292. package/esm/groupsFilterRaw/groupsFilterAdjustmentState.js +152 -14
  293. package/esm/groupsFilterRaw/groupsFilterBox.js +131 -31
  294. package/esm/groupsFilterRaw/groupsFilterCommon.js +69 -7
  295. package/esm/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +178 -24
  296. package/esm/groupsFilterRaw/groupsFilterHelper.d.ts +2 -1
  297. package/esm/groupsFilterRaw/groupsFilterHelper.js +279 -168
  298. package/esm/groupsFilterRaw/groupsFilterInitialState.js +260 -17
  299. package/esm/groupsFilterRaw/groupsFilterMenu.js +118 -8
  300. package/esm/groupsFilterRaw/groupsFilterRaw.d.ts +1 -0
  301. package/esm/groupsFilterRaw/groupsFilterRaw.js +811 -308
  302. package/esm/groupsFilterRaw/groupsFilterTestData.d.ts +155 -2
  303. package/esm/groupsFilterRaw/groupsFilterTestData.js +152 -57
  304. package/esm/groupsFilterRaw/groupsFilterTrigger.js +133 -34
  305. package/esm/groupsFilterRaw/groupsHelper.js +733 -207
  306. package/esm/groupsFilterRaw/stateReducer/stateReducerHelper.js +3 -1
  307. package/esm/groupsFilterRaw/types.d.ts +1 -0
  308. package/esm/header/components/collapsedItemsControl/collapsedItemsControl.js +101 -51
  309. package/esm/header/components/mobileFilterControl/mobileFilterControl.js +56 -8
  310. package/esm/header/components/mobileSearchControl/mobileSearchControl.js +113 -13
  311. package/esm/header/headerBack.js +58 -19
  312. package/esm/index.d.ts +1 -0
  313. package/esm/index.js +1 -0
  314. package/esm/list/itemData/itemDataInternal.js +210 -50
  315. package/esm/list/listItem/listItem.js +162 -54
  316. package/esm/menu/components/menuErrorItem.js +27 -4
  317. package/esm/mobileSheet/mobileSheet.js +189 -68
  318. package/esm/modal/modal.js +265 -120
  319. package/esm/nav/nav.js +1 -1
  320. package/esm/nav/navFooter/navFooter.js +76 -38
  321. package/esm/nav/navFooter/navFooterAction/navFooterAction.js +46 -12
  322. package/esm/nav/navHeader/navHeader.js +80 -35
  323. package/esm/nav/navHeader/navHeaderSearch/navHeaderSearch.js +82 -28
  324. package/esm/nav/navItem/navItem.d.ts +3 -3
  325. package/esm/nav/navItem/navItem.js +35 -33
  326. package/esm/nav/navMobileBar/navMobileBar.js +61 -20
  327. package/esm/notification/notification.js +114 -18
  328. package/esm/pagination/paginationArrow.js +75 -10
  329. package/esm/pagination/paginationText/paginationText.js +39 -10
  330. package/esm/pill/components/pillNonActionable/pillNonActionable.js +87 -23
  331. package/esm/pillBox/components/pillBoxItem.js +46 -8
  332. package/esm/pillBox/pillBox.js +115 -19
  333. package/esm/pillExpandable/pillExpandable.js +327 -138
  334. package/esm/rangeRaw/rangeRaw.js +480 -140
  335. package/esm/rangeRaw/utils/rangeHelper.js +203 -38
  336. package/esm/searchInputRaw/searchInputRaw.js +145 -43
  337. package/esm/skeleton/skeleton.js +45 -5
  338. package/esm/sortControl/sortControl.js +146 -41
  339. package/esm/stepperRaw/stepperRaw.js +112 -41
  340. package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/EntitiesListAction.js +178 -19
  341. package/esm/summary/summary.js +88 -7
  342. package/esm/table/actions/actionsMenu.js +165 -77
  343. package/esm/table/flexible/columnSettings.js +74 -9
  344. package/esm/table/flexible/columnsList.js +104 -42
  345. package/esm/table/flexible/columnsPopup.js +71 -19
  346. package/esm/table/nested/useNestedRows.js +161 -76
  347. package/esm/table/selectable/selectableHeader.js +174 -40
  348. package/esm/table/selectable/useSelectableRows.js +264 -190
  349. package/esm/table/sortable/sortableHeader.js +147 -74
  350. package/esm/tabs/tabs.js +221 -117
  351. package/esm/timePickerRaw/timePickerRaw.js +272 -57
  352. package/esm/toastRaw/toastRaw.js +132 -31
  353. package/esm/toggleButton/toggleButton.d.ts +0 -1
  354. package/esm/toggleButtonRaw/toggleButtonRaw.d.ts +1 -0
  355. package/esm/toggleButtonRaw/toggleButtonRaw.js +111 -18
  356. package/esm/utils/formatDate.js +995 -116
  357. package/{dist/utils/localization/translations/cs-json.js → esm/utils/localization/translations/cs.json} +11 -15
  358. package/{dist/utils/localization/translations/da-DK-json.js → esm/utils/localization/translations/da-DK.json} +31 -26
  359. package/{dist/utils/localization/translations/de-json.js → esm/utils/localization/translations/de.json} +12 -16
  360. package/esm/utils/localization/translations/en.json +308 -0
  361. package/{dist/utils/localization/translations/es-json.js → esm/utils/localization/translations/es.json} +11 -15
  362. package/{dist/utils/localization/translations/fi-FI-json.js → esm/utils/localization/translations/fi-FI.json} +31 -26
  363. package/{dist/utils/localization/translations/fr-FR-json.js → esm/utils/localization/translations/fr-FR.json} +12 -15
  364. package/{dist/utils/localization/translations/fr-json.js → esm/utils/localization/translations/fr.json} +11 -15
  365. package/{dist/utils/localization/translations/hu-HU-json.js → esm/utils/localization/translations/hu-HU.json} +31 -26
  366. package/{dist/utils/localization/translations/id-json.js → esm/utils/localization/translations/id.json} +11 -16
  367. package/{dist/utils/localization/translations/it-json.js → esm/utils/localization/translations/it.json} +11 -15
  368. package/{dist/utils/localization/translations/ja-json.js → esm/utils/localization/translations/ja.json} +11 -15
  369. package/{dist/utils/localization/translations/ko-KR-json.js → esm/utils/localization/translations/ko-KR.json} +24 -26
  370. package/{dist/utils/localization/translations/ms-json.js → esm/utils/localization/translations/ms.json} +11 -15
  371. package/{dist/utils/localization/translations/nb-NO-json.js → esm/utils/localization/translations/nb-NO.json} +31 -26
  372. package/{dist/utils/localization/translations/nl-json.js → esm/utils/localization/translations/nl.json} +11 -15
  373. package/{dist/utils/localization/translations/pl-json.js → esm/utils/localization/translations/pl.json} +11 -15
  374. package/{dist/utils/localization/translations/pt-BR-json.js → esm/utils/localization/translations/pt-BR.json} +11 -15
  375. package/{dist/utils/localization/translations/sk-SK-json.js → esm/utils/localization/translations/sk-SK.json} +31 -26
  376. package/{dist/utils/localization/translations/sv-json.js → esm/utils/localization/translations/sv.json} +11 -15
  377. package/{dist/utils/localization/translations/th-json.js → esm/utils/localization/translations/th.json} +11 -15
  378. package/{dist/utils/localization/translations/tr-json.js → esm/utils/localization/translations/tr.json} +11 -15
  379. package/{dist/utils/localization/translations/zh-Hans-json.js → esm/utils/localization/translations/zh-Hans.json} +11 -15
  380. package/{dist/utils/localization/translations/zh-TW-json.js → esm/utils/localization/translations/zh-TW.json} +11 -26
  381. package/esm/utils/localization/translationsDictionary.d.ts +2 -0
  382. package/esm/utils/localization/translationsDictionary.js +59 -0
  383. package/esm/utils/localization/useLanguage.js +1 -50
  384. package/package.json +19 -12
  385. package/dist/utils/localization/translations/cs-json.d.ts +0 -251
  386. package/dist/utils/localization/translations/da-DK-json.d.ts +0 -252
  387. package/dist/utils/localization/translations/de-json.d.ts +0 -251
  388. package/dist/utils/localization/translations/en-json.d.ts +0 -314
  389. package/dist/utils/localization/translations/en-json.js +0 -317
  390. package/dist/utils/localization/translations/es-json.d.ts +0 -251
  391. package/dist/utils/localization/translations/fi-FI-json.d.ts +0 -252
  392. package/dist/utils/localization/translations/fr-FR-json.d.ts +0 -250
  393. package/dist/utils/localization/translations/fr-json.d.ts +0 -251
  394. package/dist/utils/localization/translations/hu-HU-json.d.ts +0 -252
  395. package/dist/utils/localization/translations/id-json.d.ts +0 -252
  396. package/dist/utils/localization/translations/it-json.d.ts +0 -251
  397. package/dist/utils/localization/translations/ja-json.d.ts +0 -251
  398. package/dist/utils/localization/translations/ko-KR-json.d.ts +0 -258
  399. package/dist/utils/localization/translations/ms-json.d.ts +0 -251
  400. package/dist/utils/localization/translations/nb-NO-json.d.ts +0 -252
  401. package/dist/utils/localization/translations/nl-json.d.ts +0 -251
  402. package/dist/utils/localization/translations/pl-json.d.ts +0 -251
  403. package/dist/utils/localization/translations/pt-BR-json.d.ts +0 -251
  404. package/dist/utils/localization/translations/sk-SK-json.d.ts +0 -251
  405. package/dist/utils/localization/translations/sv-json.d.ts +0 -251
  406. package/dist/utils/localization/translations/th-json.d.ts +0 -251
  407. package/dist/utils/localization/translations/tr-json.d.ts +0 -251
  408. package/dist/utils/localization/translations/zh-Hans-json.d.ts +0 -251
  409. package/dist/utils/localization/translations/zh-TW-json.d.ts +0 -271
  410. package/esm/utils/localization/translations/cs-json.d.ts +0 -251
  411. package/esm/utils/localization/translations/da-DK-json.d.ts +0 -252
  412. package/esm/utils/localization/translations/de-json.d.ts +0 -251
  413. package/esm/utils/localization/translations/en-json.d.ts +0 -314
  414. package/esm/utils/localization/translations/en-json.js +0 -314
  415. package/esm/utils/localization/translations/es-json.d.ts +0 -251
  416. package/esm/utils/localization/translations/fi-FI-json.d.ts +0 -252
  417. package/esm/utils/localization/translations/fr-FR-json.d.ts +0 -250
  418. package/esm/utils/localization/translations/fr-json.d.ts +0 -251
  419. package/esm/utils/localization/translations/hu-HU-json.d.ts +0 -252
  420. package/esm/utils/localization/translations/id-json.d.ts +0 -252
  421. package/esm/utils/localization/translations/it-json.d.ts +0 -251
  422. package/esm/utils/localization/translations/ja-json.d.ts +0 -251
  423. package/esm/utils/localization/translations/ko-KR-json.d.ts +0 -258
  424. package/esm/utils/localization/translations/ms-json.d.ts +0 -251
  425. package/esm/utils/localization/translations/nb-NO-json.d.ts +0 -252
  426. package/esm/utils/localization/translations/nl-json.d.ts +0 -251
  427. package/esm/utils/localization/translations/pl-json.d.ts +0 -251
  428. package/esm/utils/localization/translations/pt-BR-json.d.ts +0 -251
  429. package/esm/utils/localization/translations/sk-SK-json.d.ts +0 -251
  430. package/esm/utils/localization/translations/sv-json.d.ts +0 -251
  431. package/esm/utils/localization/translations/th-json.d.ts +0 -251
  432. package/esm/utils/localization/translations/tr-json.d.ts +0 -251
  433. package/esm/utils/localization/translations/zh-Hans-json.d.ts +0 -251
  434. package/esm/utils/localization/translations/zh-TW-json.d.ts +0 -271
@@ -1,3 +1,4 @@
1
+ import { injectString } from "../../utils/localization/translationsDictionary";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { useCallback, useMemo, useRef, useState } from "react";
3
4
  import { Chip } from "../../chip/chip";
@@ -14,111 +15,315 @@ import { useDriveClassName } from "../../utils/theme/useDriveClassName";
14
15
  import { useMobile } from "../../commonHelpers/hooks/useMobile";
15
16
  import { MobileSheet } from "../../mobileSheet/mobileSheet";
16
17
  import { getFirstFocusableItem, getNewFocusableItem } from "../../utils/keyboardHelpers";
18
+ injectString("en", "Save new filters", "Save new filters");
19
+ injectString("cs", "Save", "Ulo\u017Eit");
20
+ injectString("da-DK", "Save", "Spare");
21
+ injectString("de", "Save", "Speichern");
22
+ injectString("en", "Save", "Save");
23
+ injectString("es", "Save", "Guardar");
24
+ injectString("fi-FI", "Save", "S\xE4\xE4st\xE4\xE4");
25
+ injectString("fr", "Save", "Enregistrer");
26
+ injectString("fr-FR", "Save", "Enregistrer");
27
+ injectString("hu-HU", "Save", "Ment\xE9s");
28
+ injectString("id", "Save", "Simpan");
29
+ injectString("it", "Save", "Salvare");
30
+ injectString("ja", "Save", "\u4FDD\u5B58");
31
+ injectString("ko-KR", "Save", "\uC800\uC7A5");
32
+ injectString("ms", "Save", "Simpan");
33
+ injectString("nb-NO", "Save", "Lagre");
34
+ injectString("nl", "Save", "Opslaan");
35
+ injectString("pl", "Save", "Zapisz");
36
+ injectString("pt-BR", "Save", "Salvar");
37
+ injectString("sk-SK", "Save", "Ulo\u017Ei\u0165");
38
+ injectString("sv", "Save", "Spara");
39
+ injectString("th", "Save", "\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01");
40
+ injectString("tr", "Save", "Kaydet");
41
+ injectString("zh-Hans", "Save", "\u4FDD\u5B58");
42
+ injectString("zh-TW", "Save", "\u5132\u5B58");
43
+ injectString("en", "Save new", "Save new");
44
+ injectString("cs", "Remove", "Odebrat");
45
+ injectString("da-DK", "Remove", "Fjerne");
46
+ injectString("de", "Remove", "Entfernen");
47
+ injectString("en", "Remove", "Remove");
48
+ injectString("es", "Remove", "Eliminar");
49
+ injectString("fi-FI", "Remove", "Poistaa");
50
+ injectString("fr", "Remove", "Supprimer");
51
+ injectString("fr-FR", "Remove", "Supprimer");
52
+ injectString("hu-HU", "Remove", "T\xE1vol\xEDtsa el");
53
+ injectString("id", "Remove", "Hapus");
54
+ injectString("it", "Remove", "Rimuovere");
55
+ injectString("ja", "Remove", "\u524A\u9664");
56
+ injectString("ko-KR", "Remove", "\uC81C\uAC70");
57
+ injectString("ms", "Remove", "Alih Keluar");
58
+ injectString("nb-NO", "Remove", "Fjern");
59
+ injectString("nl", "Remove", "Verwijderen");
60
+ injectString("pl", "Remove", "Usu\u0144");
61
+ injectString("pt-BR", "Remove", "Remover");
62
+ injectString("sk-SK", "Remove", "Odstr\xE1ni\u0165");
63
+ injectString("sv", "Remove", "Ta bort");
64
+ injectString("th", "Remove", "\u0E25\u0E1A");
65
+ injectString("tr", "Remove", "Kald\u0131r");
66
+ injectString("zh-Hans", "Remove", "\u5220\u9664");
67
+ injectString("zh-TW", "Remove", "\u79FB\u9664");
68
+ injectString("en", "Saved filters", "Saved filters");
69
+ injectString("en", "Remove saved {name} filter?", "Remove saved {name} filter?");
70
+ injectString("cs", "Cancel", "Zru\u0161it");
71
+ injectString("da-DK", "Cancel", "Annuller");
72
+ injectString("de", "Cancel", "Abbrechen");
73
+ injectString("en", "Cancel", "Cancel");
74
+ injectString("es", "Cancel", "Cancelar");
75
+ injectString("fi-FI", "Cancel", "Peruuta");
76
+ injectString("fr", "Cancel", "Annuler");
77
+ injectString("fr-FR", "Cancel", "Annuler");
78
+ injectString("hu-HU", "Cancel", "M\xE9gse");
79
+ injectString("id", "Cancel", "Batalkan");
80
+ injectString("it", "Cancel", "Annullare");
81
+ injectString("ja", "Cancel", "\u30AD\u30E3\u30F3\u30BB\u30EB");
82
+ injectString("ko-KR", "Cancel", "\uCDE8\uC18C");
83
+ injectString("ms", "Cancel", "Batal");
84
+ injectString("nb-NO", "Cancel", "Avbryt");
85
+ injectString("nl", "Cancel", "Annuleren");
86
+ injectString("pl", "Cancel", "Anuluj");
87
+ injectString("pt-BR", "Cancel", "Cancelar");
88
+ injectString("sk-SK", "Cancel", "Zru\u0161.");
89
+ injectString("sv", "Cancel", "Avbryt");
90
+ injectString("th", "Cancel", "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01");
91
+ injectString("tr", "Cancel", "\u0130ptal");
92
+ injectString("zh-Hans", "Cancel", "\u53D6\u6D88");
93
+ injectString("zh-TW", "Cancel", "\u53D6\u6D88");
94
+ injectString("cs", "Confirm", "Potvrdit");
95
+ injectString("da-DK", "Confirm", "Bekr\xE6fte");
96
+ injectString("de", "Confirm", "Best\xE4tigen");
97
+ injectString("en", "Confirm", "Confirm");
98
+ injectString("es", "Confirm", "Confirmar");
99
+ injectString("fi-FI", "Confirm", "Vahvistaa");
100
+ injectString("fr", "Confirm", "Confirmer");
101
+ injectString("fr-FR", "Confirm", "Confirmer");
102
+ injectString("hu-HU", "Confirm", "Meger\u0151s\xEDt\xE9s");
103
+ injectString("id", "Confirm", "Konfirmasi");
104
+ injectString("it", "Confirm", "Confermare");
105
+ injectString("ja", "Confirm", "\u78BA\u8A8D");
106
+ injectString("ko-KR", "Confirm", "\uD655\uC778");
107
+ injectString("ms", "Confirm", "Sahkan");
108
+ injectString("nb-NO", "Confirm", "Bekreft");
109
+ injectString("nl", "Confirm", "Bevestigen");
110
+ injectString("pl", "Confirm", "Potwierd\u017A");
111
+ injectString("pt-BR", "Confirm", "Confirmar");
112
+ injectString("sk-SK", "Confirm", "Potvrdi\u0165");
113
+ injectString("sv", "Confirm", "Bekr\xE4fta");
114
+ injectString("th", "Confirm", "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19");
115
+ injectString("tr", "Confirm", "Onayla");
116
+ injectString("zh-Hans", "Confirm", "\u786E\u8BA4");
117
+ injectString("zh-TW", "Confirm", "\u78BA\u8A8D");
17
118
  export const FiltersSavedChipComponent = () => {
18
- const { translate } = useLanguage();
19
- const isMobile = useMobile();
20
- const iconDriveClassName = useDriveClassName("icon");
21
- const contentDriveClassName = useDriveClassName("zen-filters-saved-popup__content");
22
- const { items, active, onRemove, onApply, onSave } = useFiltersSavedItems();
23
- const [savedChipOpen, setSavedChipOpen] = useState(false);
24
- const [removeModalOpen, setRemoveModalOpen] = useState(false);
25
- const [saveModalOpen, setSaveModalOpen] = useState(false);
26
- const savedChipRef = useRef(null);
27
- const removeChipRef = useRef("");
28
- const savedFiltersRef = useRef(null);
29
- const handleRemove = useCallback((itemKey) => () => {
30
- removeChipRef.current = itemKey;
31
- setRemoveModalOpen(true);
32
- }, []);
33
- const toggleSavedChipOpen = useCallback(() => {
34
- if (removeModalOpen || saveModalOpen) {
35
- return;
36
- }
37
- setSavedChipOpen((prev) => !prev);
38
- }, [removeModalOpen, saveModalOpen]);
39
- const toggleRemoveModal = useCallback(() => {
40
- setRemoveModalOpen((prev) => !prev);
41
- }, []);
42
- const toggleSaveModal = useCallback(() => {
43
- setSaveModalOpen((prev) => !prev);
44
- }, []);
45
- const handleCancelRemoveModal = useCallback(() => {
46
- setRemoveModalOpen(false);
47
- removeChipRef.current = "";
48
- }, []);
49
- const handleRemoveItem = useCallback((e) => {
50
- e.stopPropagation();
51
- setRemoveModalOpen(false);
52
- onRemove && onRemove(removeChipRef.current);
53
- removeChipRef.current = "";
54
- }, [onRemove]);
55
- const handleFilterSelect = useCallback((e) => {
56
- var _a;
57
- const filterName = e.target.dataset.filterName;
58
- if (!filterName) {
59
- return;
60
- }
61
- onApply && onApply(filterName);
62
- setSavedChipOpen((prev) => !prev);
63
- (_a = savedChipRef.current) === null || _a === void 0 ? void 0 : _a.focus();
64
- }, [onApply]);
65
- const handleSaveItemKeyDown = useCallback((e) => {
66
- if (e.key === "ArrowDown") {
67
- const nextItem = getFirstFocusableItem(savedFiltersRef.current);
68
- nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
69
- return;
70
- }
71
- }, [savedFiltersRef]);
72
- const handleItemKeyDown = useCallback((e) => {
73
- var _a;
74
- if (e.key === "Enter" || e.key === " ") {
75
- const filterName = e.currentTarget.dataset.filterName;
76
- const isRemoveButton = e.target.dataset.removeButton;
77
- if (isRemoveButton || !filterName) {
78
- return;
79
- }
80
- onApply && onApply(filterName);
81
- setSavedChipOpen((prev) => !prev);
82
- (_a = savedChipRef.current) === null || _a === void 0 ? void 0 : _a.focus();
83
- return;
84
- }
85
- const isListItem = e.target instanceof HTMLElement && e.target.dataset.listItem === "true";
86
- const isButtonItem = e.target instanceof HTMLElement && e.target.dataset.removeButton === "true";
87
- const getSelector = () => {
88
- if (isListItem) {
89
- return `[data-list-item="true"]`;
90
- }
91
- if (isButtonItem) {
92
- return `[data-remove-button="true"]`;
93
- }
94
- return undefined;
95
- };
96
- if (e.key === "ArrowDown") {
97
- const nextItem = getNewFocusableItem(1, savedFiltersRef.current, getSelector());
98
- nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
99
- return;
100
- }
101
- if (e.key === "ArrowUp") {
102
- const prevItem = getNewFocusableItem(-1, savedFiltersRef.current, getSelector());
103
- prevItem === null || prevItem === void 0 ? void 0 : prevItem.focus();
104
- return;
105
- }
106
- if (e.key === "ArrowRight" && isListItem) {
107
- const nextItem = getNewFocusableItem(1, savedFiltersRef.current, `[data-remove-button="true"]`);
108
- nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
109
- return;
110
- }
111
- if (e.key === "ArrowLeft" && isButtonItem) {
112
- const prevItem = getNewFocusableItem(-1, savedFiltersRef.current, `[data-list-item="true"]`);
113
- prevItem === null || prevItem === void 0 ? void 0 : prevItem.focus();
114
- return;
115
- }
116
- }, [onApply]);
117
- const saveButton = useMemo(() => _jsxs("button", { type: "button", onKeyDown: handleSaveItemKeyDown, onClick: toggleSaveModal, className: "zen-filters-saved-popup__action-button", title: translate("Save new filters"), children: [_jsx(IconDisk, { description: translate("Save"), className: "svgIcon", size: iconDriveClassName ? "huge" : "large" }), _jsx("div", { className: classNames(["", "zen-ellipsis"]), children: translate("Save new") })] }), [iconDriveClassName, toggleSaveModal, translate, handleSaveItemKeyDown]);
118
- const memoizedItems = useMemo(() => Array.from(items), [items]);
119
- const popupContent = useMemo(() => _jsxs("div", { className: classNames(["zen-filters-saved-popup__content", contentDriveClassName || ""]), children: [onSave ? saveButton : null, _jsx("div", { ref: savedFiltersRef, onClick: handleFilterSelect, children: memoizedItems.map((filterName) => (_jsxs("div", { tabIndex: 0, onKeyDown: handleItemKeyDown, "data-list-item": true, "data-filter-name": filterName, className: classNames(["zen-filters-saved-popup__item", active.has(filterName) ? "zen-filters-saved-popup__item--active" : ""]), children: [_jsx("div", { className: "zen-filters-saved-popup__name", "data-filter-name": filterName, children: filterName }), onRemove ? _jsx(Button, { "data-remove-button": true, type: "tertiary-black", className: "zen-filters-saved-popup__action", onClick: handleRemove(filterName), title: translate("Remove"), "aria-label": translate("Remove"), children: _jsx(IconClose, { size: iconDriveClassName ? "huge" : "large", className: "zen-filters-saved-popup__close-icon" }) }) : null] }, filterName))) })] }), [active, contentDriveClassName, handleFilterSelect, handleItemKeyDown, handleRemove, iconDriveClassName, memoizedItems, onRemove, onSave, saveButton, translate]);
120
- const memoizedStatus = useMemo(() => (active.size > 0 && Array.from(items).some(item => active.has(item)) ? "active" : undefined), [active, items]);
121
- const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, { isOpen: savedChipOpen, className: classNames(["zen-filters-saved-popup"]), onOpenChange: toggleSavedChipOpen, useTrapFocusWithTrigger: "on", shouldHoldScroll: true, triggerRef: savedChipRef, ariaLabel: translate("Saved filters"), recalculateOnScroll: true, children: popupContent }), [popupContent, savedChipOpen, toggleSavedChipOpen, savedChipRef, translate]);
122
- const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, { label: translate("Saved filters"), triggerRef: savedChipRef, isOpen: savedChipOpen, onHidePanel: toggleSavedChipOpen, onCloseClick: toggleSavedChipOpen, useTrapFocusWithTrigger: false, children: [_jsx(MobileSheet.Title, { children: translate("Saved filters") }), _jsx(MobileSheet.Content, { className: "zen-filters-saved-chip__mobile-sheet", children: popupContent })] }), [popupContent, savedChipOpen, toggleSavedChipOpen, translate]);
123
- return (_jsxs(_Fragment, { children: [_jsx(Chip, { className: "zen-filters-saved-chip", isOpen: savedChipOpen, status: memoizedStatus, onClick: toggleSavedChipOpen, title: translate("Saved filters"), icon: IconDisk, triggerRef: savedChipRef }), isMobile ? memoizedMobileView : memoizedDesktopView, _jsxs(Modal, { isOpen: removeModalOpen, onClose: toggleRemoveModal, modalContainerClassName: classNames([isMobile ? "zen-filters-prioritized-modal" : ""]), title: translate("Remove saved {name} filter?").replace("{name}", removeChipRef.current), children: [_jsx(Modal.SecondaryButton, { title: translate("Cancel"), onClick: handleCancelRemoveModal, children: translate("Cancel") }), _jsx(Modal.PrimaryButton, { title: translate("Confirm"), onClick: handleRemoveItem, type: "destructive", children: translate("Confirm") })] }), onSave ? _jsx(FiltersSaveModal, { prioritize: isMobile, isOpen: saveModalOpen, onClose: setSaveModalOpen, onSave: onSave }) : null] }));
124
- };
119
+ const {
120
+ translate
121
+ } = useLanguage();
122
+ const isMobile = useMobile();
123
+ const iconDriveClassName = useDriveClassName("icon");
124
+ const contentDriveClassName = useDriveClassName("zen-filters-saved-popup__content");
125
+ const {
126
+ items,
127
+ active,
128
+ onRemove,
129
+ onApply,
130
+ onSave
131
+ } = useFiltersSavedItems();
132
+ const [savedChipOpen, setSavedChipOpen] = useState(false);
133
+ const [removeModalOpen, setRemoveModalOpen] = useState(false);
134
+ const [saveModalOpen, setSaveModalOpen] = useState(false);
135
+ const savedChipRef = useRef(null);
136
+ const removeChipRef = useRef("");
137
+ const savedFiltersRef = useRef(null);
138
+ const handleRemove = useCallback(itemKey => () => {
139
+ removeChipRef.current = itemKey;
140
+ setRemoveModalOpen(true);
141
+ }, []);
142
+ const toggleSavedChipOpen = useCallback(() => {
143
+ if (removeModalOpen || saveModalOpen) {
144
+ return;
145
+ }
146
+ setSavedChipOpen(prev => !prev);
147
+ }, [removeModalOpen, saveModalOpen]);
148
+ const toggleRemoveModal = useCallback(() => {
149
+ setRemoveModalOpen(prev => !prev);
150
+ }, []);
151
+ const toggleSaveModal = useCallback(() => {
152
+ setSaveModalOpen(prev => !prev);
153
+ }, []);
154
+ const handleCancelRemoveModal = useCallback(() => {
155
+ setRemoveModalOpen(false);
156
+ removeChipRef.current = "";
157
+ }, []);
158
+ const handleRemoveItem = useCallback(e => {
159
+ e.stopPropagation();
160
+ setRemoveModalOpen(false);
161
+ onRemove && onRemove(removeChipRef.current);
162
+ removeChipRef.current = "";
163
+ }, [onRemove]);
164
+ const handleFilterSelect = useCallback(e => {
165
+ var _a;
166
+ const filterName = e.target.dataset.filterName;
167
+ if (!filterName) {
168
+ return;
169
+ }
170
+ onApply && onApply(filterName);
171
+ setSavedChipOpen(prev => !prev);
172
+ (_a = savedChipRef.current) === null || _a === void 0 ? void 0 : _a.focus();
173
+ }, [onApply]);
174
+ const handleSaveItemKeyDown = useCallback(e => {
175
+ if (e.key === "ArrowDown") {
176
+ const nextItem = getFirstFocusableItem(savedFiltersRef.current);
177
+ nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
178
+ return;
179
+ }
180
+ }, [savedFiltersRef]);
181
+ const handleItemKeyDown = useCallback(e => {
182
+ var _a;
183
+ if (e.key === "Enter" || e.key === " ") {
184
+ const filterName = e.currentTarget.dataset.filterName;
185
+ const isRemoveButton = e.target.dataset.removeButton;
186
+ if (isRemoveButton || !filterName) {
187
+ return;
188
+ }
189
+ onApply && onApply(filterName);
190
+ setSavedChipOpen(prev => !prev);
191
+ (_a = savedChipRef.current) === null || _a === void 0 ? void 0 : _a.focus();
192
+ return;
193
+ }
194
+ const isListItem = e.target instanceof HTMLElement && e.target.dataset.listItem === "true";
195
+ const isButtonItem = e.target instanceof HTMLElement && e.target.dataset.removeButton === "true";
196
+ const getSelector = () => {
197
+ if (isListItem) {
198
+ return `[data-list-item="true"]`;
199
+ }
200
+ if (isButtonItem) {
201
+ return `[data-remove-button="true"]`;
202
+ }
203
+ return undefined;
204
+ };
205
+ if (e.key === "ArrowDown") {
206
+ const nextItem = getNewFocusableItem(1, savedFiltersRef.current, getSelector());
207
+ nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
208
+ return;
209
+ }
210
+ if (e.key === "ArrowUp") {
211
+ const prevItem = getNewFocusableItem(-1, savedFiltersRef.current, getSelector());
212
+ prevItem === null || prevItem === void 0 ? void 0 : prevItem.focus();
213
+ return;
214
+ }
215
+ if (e.key === "ArrowRight" && isListItem) {
216
+ const nextItem = getNewFocusableItem(1, savedFiltersRef.current, `[data-remove-button="true"]`);
217
+ nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
218
+ return;
219
+ }
220
+ if (e.key === "ArrowLeft" && isButtonItem) {
221
+ const prevItem = getNewFocusableItem(-1, savedFiltersRef.current, `[data-list-item="true"]`);
222
+ prevItem === null || prevItem === void 0 ? void 0 : prevItem.focus();
223
+ return;
224
+ }
225
+ }, [onApply]);
226
+ const saveButton = useMemo(() => _jsxs("button", {
227
+ type: "button",
228
+ onKeyDown: handleSaveItemKeyDown,
229
+ onClick: toggleSaveModal,
230
+ className: "zen-filters-saved-popup__action-button",
231
+ title: translate("Save new filters"),
232
+ children: [_jsx(IconDisk, {
233
+ description: translate("Save"),
234
+ className: "svgIcon",
235
+ size: iconDriveClassName ? "huge" : "large"
236
+ }), _jsx("div", {
237
+ className: classNames(["", "zen-ellipsis"]),
238
+ children: translate("Save new")
239
+ })]
240
+ }), [iconDriveClassName, toggleSaveModal, translate, handleSaveItemKeyDown]);
241
+ const memoizedItems = useMemo(() => Array.from(items), [items]);
242
+ const popupContent = useMemo(() => _jsxs("div", {
243
+ className: classNames(["zen-filters-saved-popup__content", contentDriveClassName || ""]),
244
+ children: [onSave ? saveButton : null, _jsx("div", {
245
+ ref: savedFiltersRef,
246
+ onClick: handleFilterSelect,
247
+ children: memoizedItems.map(filterName => _jsxs("div", {
248
+ tabIndex: 0,
249
+ onKeyDown: handleItemKeyDown,
250
+ "data-list-item": true,
251
+ "data-filter-name": filterName,
252
+ className: classNames(["zen-filters-saved-popup__item", active.has(filterName) ? "zen-filters-saved-popup__item--active" : ""]),
253
+ children: [_jsx("div", {
254
+ className: "zen-filters-saved-popup__name",
255
+ "data-filter-name": filterName,
256
+ children: filterName
257
+ }), onRemove ? _jsx(Button, {
258
+ "data-remove-button": true,
259
+ type: "tertiary-black",
260
+ className: "zen-filters-saved-popup__action",
261
+ onClick: handleRemove(filterName),
262
+ title: translate("Remove"),
263
+ "aria-label": translate("Remove"),
264
+ children: _jsx(IconClose, {
265
+ size: iconDriveClassName ? "huge" : "large",
266
+ className: "zen-filters-saved-popup__close-icon"
267
+ })
268
+ }) : null]
269
+ }, filterName))
270
+ })]
271
+ }), [active, contentDriveClassName, handleFilterSelect, handleItemKeyDown, handleRemove, iconDriveClassName, memoizedItems, onRemove, onSave, saveButton, translate]);
272
+ const memoizedStatus = useMemo(() => active.size > 0 && Array.from(items).some(item => active.has(item)) ? "active" : undefined, [active, items]);
273
+ const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, {
274
+ isOpen: savedChipOpen,
275
+ className: classNames(["zen-filters-saved-popup"]),
276
+ onOpenChange: toggleSavedChipOpen,
277
+ useTrapFocusWithTrigger: "on",
278
+ shouldHoldScroll: true,
279
+ triggerRef: savedChipRef,
280
+ ariaLabel: translate("Saved filters"),
281
+ recalculateOnScroll: true,
282
+ children: popupContent
283
+ }), [popupContent, savedChipOpen, toggleSavedChipOpen, savedChipRef, translate]);
284
+ const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, {
285
+ label: translate("Saved filters"),
286
+ triggerRef: savedChipRef,
287
+ isOpen: savedChipOpen,
288
+ onHidePanel: toggleSavedChipOpen,
289
+ onCloseClick: toggleSavedChipOpen,
290
+ useTrapFocusWithTrigger: false,
291
+ children: [_jsx(MobileSheet.Title, {
292
+ children: translate("Saved filters")
293
+ }), _jsx(MobileSheet.Content, {
294
+ className: "zen-filters-saved-chip__mobile-sheet",
295
+ children: popupContent
296
+ })]
297
+ }), [popupContent, savedChipOpen, toggleSavedChipOpen, translate]);
298
+ return _jsxs(_Fragment, {
299
+ children: [_jsx(Chip, {
300
+ className: "zen-filters-saved-chip",
301
+ isOpen: savedChipOpen,
302
+ status: memoizedStatus,
303
+ onClick: toggleSavedChipOpen,
304
+ title: translate("Saved filters"),
305
+ icon: IconDisk,
306
+ triggerRef: savedChipRef
307
+ }), isMobile ? memoizedMobileView : memoizedDesktopView, _jsxs(Modal, {
308
+ isOpen: removeModalOpen,
309
+ onClose: toggleRemoveModal,
310
+ modalContainerClassName: classNames([isMobile ? "zen-filters-prioritized-modal" : ""]),
311
+ title: translate("Remove saved {name} filter?").replace("{name}", removeChipRef.current),
312
+ children: [_jsx(Modal.SecondaryButton, {
313
+ title: translate("Cancel"),
314
+ onClick: handleCancelRemoveModal,
315
+ children: translate("Cancel")
316
+ }), _jsx(Modal.PrimaryButton, {
317
+ title: translate("Confirm"),
318
+ onClick: handleRemoveItem,
319
+ type: "destructive",
320
+ children: translate("Confirm")
321
+ })]
322
+ }), onSave ? _jsx(FiltersSaveModal, {
323
+ prioritize: isMobile,
324
+ isOpen: saveModalOpen,
325
+ onClose: setSaveModalOpen,
326
+ onSave: onSave
327
+ }) : null]
328
+ });
329
+ };
@@ -1,3 +1,4 @@
1
+ import { injectString } from "../../utils/localization/translationsDictionary";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createElement, useCallback, useMemo } from "react";
3
4
  import { useLanguage } from "../../utils/localization/useLanguage";
@@ -5,51 +6,125 @@ import { Button } from "../../button/button";
5
6
  import { classNames } from "../../commonHelpers/classNames/classNames";
6
7
  import { isActiveElement } from "../../list/utils/isActiveElement";
7
8
  import { IconClose } from "../../icons/iconClose";
8
- export const FiltersSearchItemData = ({ id, icon, isActive, iconClassName, name, secondary, onClick, onClose, isDrive, isMobile }) => {
9
- const { translate } = useLanguage();
10
- const driveClassName = useMemo(() => isDrive
11
- ? isMobile ? "zen-search-item-data--drive" : "zen-search-item-data--drive-tablet"
12
- : "", [isDrive, isMobile]);
13
- const renderIcon = useCallback((iconComponent, iClassName, className) => {
14
- if (typeof iconComponent === "function") {
15
- return createElement(iconComponent, { size: "large", className: classNames([className || "", iClassName || ""]) });
16
- }
17
- return iconComponent;
18
- }, []);
19
- const handleClick = useCallback((e) => {
20
- if (!onClick) {
21
- return;
22
- }
23
- if (e.target instanceof HTMLElement && isActiveElement(e.target)) {
24
- return;
25
- }
26
- onClick();
27
- }, [onClick]);
28
- const handleKeyDown = useCallback((e) => {
29
- if (!onClick) {
30
- return;
31
- }
32
- if (e.key === "Enter" || e.key === " ") {
33
- const isCloseButton = e.target instanceof HTMLElement && (e.target.dataset.closeButton === "true");
34
- if (isCloseButton) {
35
- e.preventDefault();
36
- e.stopPropagation();
37
- onClose === null || onClose === void 0 ? void 0 : onClose();
38
- return;
39
- }
40
- e.preventDefault();
41
- onClick();
42
- }
43
- }, [onClick, onClose]);
44
- const handleClose = useCallback((e) => {
45
- if (!onClose) {
46
- return;
47
- }
48
- console.log("handleClose");
9
+ injectString("cs", "Close", "Zav\u0159\xEDt");
10
+ injectString("da-DK", "Close", "Luk");
11
+ injectString("de", "Close", "Schlie\xDFen");
12
+ injectString("en", "Close", "Close");
13
+ injectString("es", "Close", "Cerrar");
14
+ injectString("fi-FI", "Close", "Sulje");
15
+ injectString("fr", "Close", "Fermer");
16
+ injectString("fr-FR", "Close", "Fermer");
17
+ injectString("hu-HU", "Close", "Z\xE1rd be.");
18
+ injectString("id", "Close", "Tutup");
19
+ injectString("it", "Close", "Chiudere");
20
+ injectString("ja", "Close", "\u9589\u3058\u308B");
21
+ injectString("ko-KR", "Close", "\uB2EB\uAE30");
22
+ injectString("ms", "Close", "Tutup");
23
+ injectString("nb-NO", "Close", "Lukk");
24
+ injectString("nl", "Close", "Sluiten");
25
+ injectString("pl", "Close", "Zamknij");
26
+ injectString("pt-BR", "Close", "Fechar");
27
+ injectString("sk-SK", "Close", "Zatvor");
28
+ injectString("sv", "Close", "St\xE4ng");
29
+ injectString("th", "Close", "\u0E1B\u0E34\u0E14");
30
+ injectString("tr", "Close", "Kapat");
31
+ injectString("zh-Hans", "Close", "\u5173\u95ED");
32
+ injectString("zh-TW", "Close", "\u95DC\u9589");
33
+ export const FiltersSearchItemData = ({
34
+ id,
35
+ icon,
36
+ isActive,
37
+ iconClassName,
38
+ name,
39
+ secondary,
40
+ onClick,
41
+ onClose,
42
+ isDrive,
43
+ isMobile
44
+ }) => {
45
+ const {
46
+ translate
47
+ } = useLanguage();
48
+ const driveClassName = useMemo(() => isDrive ? isMobile ? "zen-search-item-data--drive" : "zen-search-item-data--drive-tablet" : "", [isDrive, isMobile]);
49
+ const renderIcon = useCallback((iconComponent, iClassName, className) => {
50
+ if (typeof iconComponent === "function") {
51
+ return createElement(iconComponent, {
52
+ size: "large",
53
+ className: classNames([className || "", iClassName || ""])
54
+ });
55
+ }
56
+ return iconComponent;
57
+ }, []);
58
+ const handleClick = useCallback(e => {
59
+ if (!onClick) {
60
+ return;
61
+ }
62
+ if (e.target instanceof HTMLElement && isActiveElement(e.target)) {
63
+ return;
64
+ }
65
+ onClick();
66
+ }, [onClick]);
67
+ const handleKeyDown = useCallback(e => {
68
+ if (!onClick) {
69
+ return;
70
+ }
71
+ if (e.key === "Enter" || e.key === " ") {
72
+ const isCloseButton = e.target instanceof HTMLElement && e.target.dataset.closeButton === "true";
73
+ if (isCloseButton) {
49
74
  e.preventDefault();
50
75
  e.stopPropagation();
51
- onClose();
52
- }, [onClose]);
53
- return _jsx("li", { tabIndex: 0, className: classNames(["zen-search-item-data", isActive ? "zen-search-item-data--active" : "",
54
- onClick ? "zen-search-item-data--clickable" : "", driveClassName || ""]), "data-list-item-id": id, onClick: handleClick, onKeyDown: handleKeyDown, "data-list-item": true, children: _jsxs("div", { className: "zen-search-item-data__main", children: [icon ? _jsx("div", { className: classNames(["zen-search-item-data__icon", iconClassName || ""]), children: renderIcon(icon) }) : null, _jsxs("div", { className: "zen-search-item-data__main-data", children: [_jsxs("div", { className: "zen-search-item-data__identifier", children: [_jsx("div", { className: "zen-search-item-data__name", children: name }), secondary ? _jsx("div", { className: "zen-search-item-data__secondary", children: secondary }) : null] }), onClose ? _jsx(Button, { type: "tertiary-black", className: "zen-search-item-data__close", "data-close-button": true, title: translate("Close"), "aria-label": translate("Close"), onClick: handleClose, children: _jsx(IconClose, { size: "large", className: "zen-search-item-data__close-icon" }) }) : null] })] }) }, id);
55
- };
76
+ onClose === null || onClose === void 0 ? void 0 : onClose();
77
+ return;
78
+ }
79
+ e.preventDefault();
80
+ onClick();
81
+ }
82
+ }, [onClick, onClose]);
83
+ const handleClose = useCallback(e => {
84
+ if (!onClose) {
85
+ return;
86
+ }
87
+ console.log("handleClose");
88
+ e.preventDefault();
89
+ e.stopPropagation();
90
+ onClose();
91
+ }, [onClose]);
92
+ return _jsx("li", {
93
+ tabIndex: 0,
94
+ className: classNames(["zen-search-item-data", isActive ? "zen-search-item-data--active" : "", onClick ? "zen-search-item-data--clickable" : "", driveClassName || ""]),
95
+ "data-list-item-id": id,
96
+ onClick: handleClick,
97
+ onKeyDown: handleKeyDown,
98
+ "data-list-item": true,
99
+ children: _jsxs("div", {
100
+ className: "zen-search-item-data__main",
101
+ children: [icon ? _jsx("div", {
102
+ className: classNames(["zen-search-item-data__icon", iconClassName || ""]),
103
+ children: renderIcon(icon)
104
+ }) : null, _jsxs("div", {
105
+ className: "zen-search-item-data__main-data",
106
+ children: [_jsxs("div", {
107
+ className: "zen-search-item-data__identifier",
108
+ children: [_jsx("div", {
109
+ className: "zen-search-item-data__name",
110
+ children: name
111
+ }), secondary ? _jsx("div", {
112
+ className: "zen-search-item-data__secondary",
113
+ children: secondary
114
+ }) : null]
115
+ }), onClose ? _jsx(Button, {
116
+ type: "tertiary-black",
117
+ className: "zen-search-item-data__close",
118
+ "data-close-button": true,
119
+ title: translate("Close"),
120
+ "aria-label": translate("Close"),
121
+ onClick: handleClose,
122
+ children: _jsx(IconClose, {
123
+ size: "large",
124
+ className: "zen-search-item-data__close-icon"
125
+ })
126
+ }) : null]
127
+ })]
128
+ })
129
+ }, id);
130
+ };