@geotab/zenith 3.0.1-beta.4 → 3.1.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 (262) hide show
  1. package/README.md +17 -0
  2. package/dist/advancedGroupsFilter/advancedGroupsFilter.d.ts +1 -0
  3. package/dist/advancedGroupsFilter/advancedGroupsFilter.js +2 -2
  4. package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +3 -1
  5. package/dist/chip/chip.js +5 -5
  6. package/dist/commonStyles/zIndex.less +5 -0
  7. package/dist/dateInput/dateInput.d.ts +2 -1
  8. package/dist/dateInput/dateInput.js +11 -2
  9. package/dist/dateRange/dateRange.js +9 -8
  10. package/dist/dropdown/dropdown.d.ts +2 -0
  11. package/dist/dropdown/dropdown.js +6 -5
  12. package/dist/dropdown/dropdownHelper.d.ts +4 -4
  13. package/dist/dropdown/dropdownHelper.js +2 -1
  14. package/dist/dropdown/dropdownList.js +2 -2
  15. package/dist/dropdown/dropdownPopup.d.ts +1 -0
  16. package/dist/dropdown/dropdownPopup.js +2 -2
  17. package/dist/dropdown/dropdownSearchableTrigger.js +1 -1
  18. package/dist/dropdown/stateReducer/stateReducer.d.ts +6 -2
  19. package/dist/dropdown/stateReducer/stateReducer.js +28 -42
  20. package/dist/dropdown/stateReducer/stateReducerHelper.d.ts +2 -0
  21. package/dist/dropdown/stateReducer/stateReducerHelper.js +12 -1
  22. package/dist/dropdown/useDropdownState.d.ts +1 -1
  23. package/dist/dropdown/useDropdownState.js +5 -2
  24. package/dist/filters/components/filtersContainer.d.ts +1 -0
  25. package/dist/filters/components/filtersContainer.js +10 -11
  26. package/dist/filters/components/filtersDateInput.d.ts +10 -0
  27. package/dist/filters/components/filtersDateInput.js +27 -0
  28. package/dist/filters/components/filtersDropdown.d.ts +5 -4
  29. package/dist/filters/components/filtersDropdown.js +3 -3
  30. package/dist/filters/components/filtersEmptySelectedList.d.ts +2 -0
  31. package/dist/filters/components/filtersEmptySelectedList.js +11 -0
  32. package/dist/filters/components/filtersItem.d.ts +5 -4
  33. package/dist/filters/components/filtersItem.js +2 -1
  34. package/dist/filters/components/filtersSaveModal.d.ts +3 -1
  35. package/dist/filters/components/filtersSaveModal.js +2 -2
  36. package/dist/filters/components/filtersSavedChipComponent.js +68 -6
  37. package/dist/filters/components/filtersSearch.d.ts +4 -4
  38. package/dist/filters/components/filtersSearch.js +20 -9
  39. package/dist/filters/components/filtersSearchItemData.js +18 -1
  40. package/dist/filters/components/filtersSearchList.d.ts +5 -1
  41. package/dist/filters/components/filtersSearchList.js +155 -27
  42. package/dist/filters/components/filtersSelect.d.ts +1 -0
  43. package/dist/filters/components/filtersSelect.js +35 -7
  44. package/dist/filters/components/filtersSelectListItem.d.ts +21 -15
  45. package/dist/filters/components/filtersSelectListItem.js +13 -3
  46. package/dist/filters/components/filtersSidePanel.d.ts +15 -0
  47. package/dist/filters/components/filtersSidePanel.js +212 -0
  48. package/dist/filters/components/filtersSidePanelChip.d.ts +9 -0
  49. package/dist/filters/components/filtersSidePanelChip.js +13 -0
  50. package/dist/filters/components/filtersSidePanelDropdown.d.ts +6 -0
  51. package/dist/filters/components/filtersSidePanelDropdown.js +85 -0
  52. package/dist/filters/components/filtersSidePanelItem.d.ts +16 -0
  53. package/dist/filters/components/filtersSidePanelItem.js +67 -0
  54. package/dist/filters/components/filtersSidePanelRange.d.ts +6 -0
  55. package/dist/filters/components/filtersSidePanelRange.js +28 -0
  56. package/dist/filters/filters.d.ts +5 -0
  57. package/dist/filters/filters.js +101 -38
  58. package/dist/filters/filtersHelper.d.ts +4 -2
  59. package/dist/filters/filtersHelper.js +40 -1
  60. package/dist/filters/filtersHooks.d.ts +12 -2
  61. package/dist/filters/filtersHooks.js +21 -3
  62. package/dist/formStepper/formStepper.d.ts +1 -1
  63. package/dist/formStepper/formStepper.js +5 -2
  64. package/dist/groupsFilter/groupsFilter.js +72 -37
  65. package/dist/groupsFilter/groupsFilterMenu.d.ts +1 -0
  66. package/dist/groupsFilter/groupsFilterMenu.js +2 -2
  67. package/dist/groupsFilter/groupsFilterTrigger.js +1 -1
  68. package/dist/images/imageLooking.d.ts +4 -0
  69. package/dist/images/imageLooking.js +16 -0
  70. package/dist/index.css +407 -83
  71. package/dist/index.d.ts +7 -4
  72. package/dist/index.js +26 -15
  73. package/dist/list/list.d.ts +3 -1
  74. package/dist/list/list.js +2 -2
  75. package/dist/mobileSheet/mobileSheet.d.ts +2 -0
  76. package/dist/mobileSheet/mobileSheet.js +4 -4
  77. package/dist/modal/modal.d.ts +1 -0
  78. package/dist/modal/modal.js +2 -2
  79. package/dist/radioGroup/radioGroup.d.ts +1 -0
  80. package/dist/radioGroup/radioGroup.js +3 -2
  81. package/dist/range/range.js +29 -10
  82. package/dist/searchInputRaw/searchInputRaw.js +1 -1
  83. package/dist/sidePanel/sidePanel.d.ts +1 -0
  84. package/dist/sidePanel/sidePanel.js +3 -3
  85. package/dist/tabs/tabItem/tabItem.d.ts +1 -0
  86. package/dist/tabs/tabItem/tabItem.js +2 -2
  87. package/dist/tabs/tabs.d.ts +1 -0
  88. package/dist/tabs/tabs.js +1 -1
  89. package/dist/utils/keyboardHelpers.d.ts +2 -0
  90. package/dist/utils/keyboardHelpers.js +49 -0
  91. package/dist/utils/localization/translations/cs-json.d.ts +1 -0
  92. package/dist/utils/localization/translations/cs-json.js +2 -1
  93. package/dist/utils/localization/translations/de-json.d.ts +1 -0
  94. package/dist/utils/localization/translations/de-json.js +2 -1
  95. package/dist/utils/localization/translations/en-json.d.ts +7 -0
  96. package/dist/utils/localization/translations/en-json.js +8 -1
  97. package/dist/utils/localization/translations/es-json.d.ts +1 -0
  98. package/dist/utils/localization/translations/es-json.js +2 -1
  99. package/dist/utils/localization/translations/fr-FR-json.d.ts +1 -0
  100. package/dist/utils/localization/translations/fr-FR-json.js +2 -1
  101. package/dist/utils/localization/translations/fr-json.d.ts +1 -0
  102. package/dist/utils/localization/translations/fr-json.js +2 -1
  103. package/dist/utils/localization/translations/id-json.d.ts +1 -0
  104. package/dist/utils/localization/translations/id-json.js +2 -1
  105. package/dist/utils/localization/translations/it-json.d.ts +1 -0
  106. package/dist/utils/localization/translations/it-json.js +2 -1
  107. package/dist/utils/localization/translations/ja-json.d.ts +1 -0
  108. package/dist/utils/localization/translations/ja-json.js +2 -1
  109. package/dist/utils/localization/translations/ko-KR-json.d.ts +1 -0
  110. package/dist/utils/localization/translations/ko-KR-json.js +2 -1
  111. package/dist/utils/localization/translations/ms-json.d.ts +1 -0
  112. package/dist/utils/localization/translations/ms-json.js +2 -1
  113. package/dist/utils/localization/translations/nl-json.d.ts +1 -0
  114. package/dist/utils/localization/translations/nl-json.js +2 -1
  115. package/dist/utils/localization/translations/pl-json.d.ts +1 -0
  116. package/dist/utils/localization/translations/pl-json.js +2 -1
  117. package/dist/utils/localization/translations/pt-BR-json.d.ts +1 -0
  118. package/dist/utils/localization/translations/pt-BR-json.js +2 -1
  119. package/dist/utils/localization/translations/sv-json.d.ts +1 -0
  120. package/dist/utils/localization/translations/sv-json.js +2 -1
  121. package/dist/utils/localization/translations/th-json.d.ts +1 -0
  122. package/dist/utils/localization/translations/th-json.js +2 -1
  123. package/dist/utils/localization/translations/tr-json.d.ts +1 -0
  124. package/dist/utils/localization/translations/tr-json.js +2 -1
  125. package/dist/utils/localization/translations/zh-Hans-json.d.ts +1 -0
  126. package/dist/utils/localization/translations/zh-Hans-json.js +2 -1
  127. package/dist/utils/localization/translations/zh-TW-json.d.ts +1 -0
  128. package/dist/utils/localization/translations/zh-TW-json.js +2 -1
  129. package/esm/advancedGroupsFilter/advancedGroupsFilter.d.ts +1 -0
  130. package/esm/advancedGroupsFilter/advancedGroupsFilter.js +2 -2
  131. package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +3 -1
  132. package/esm/chip/chip.js +5 -5
  133. package/esm/dateInput/dateInput.d.ts +2 -1
  134. package/esm/dateInput/dateInput.js +11 -2
  135. package/esm/dateRange/dateRange.js +9 -8
  136. package/esm/dropdown/dropdown.d.ts +2 -0
  137. package/esm/dropdown/dropdown.js +5 -4
  138. package/esm/dropdown/dropdownHelper.d.ts +4 -4
  139. package/esm/dropdown/dropdownHelper.js +2 -1
  140. package/esm/dropdown/dropdownList.js +2 -2
  141. package/esm/dropdown/dropdownPopup.d.ts +1 -0
  142. package/esm/dropdown/dropdownPopup.js +2 -2
  143. package/esm/dropdown/dropdownSearchableTrigger.js +1 -1
  144. package/esm/dropdown/stateReducer/stateReducer.d.ts +6 -2
  145. package/esm/dropdown/stateReducer/stateReducer.js +29 -43
  146. package/esm/dropdown/stateReducer/stateReducerHelper.d.ts +2 -0
  147. package/esm/dropdown/stateReducer/stateReducerHelper.js +10 -0
  148. package/esm/dropdown/useDropdownState.d.ts +1 -1
  149. package/esm/dropdown/useDropdownState.js +5 -2
  150. package/esm/filters/components/filtersContainer.d.ts +1 -0
  151. package/esm/filters/components/filtersContainer.js +12 -13
  152. package/esm/filters/components/filtersDateInput.d.ts +10 -0
  153. package/esm/filters/components/filtersDateInput.js +23 -0
  154. package/esm/filters/components/filtersDropdown.d.ts +5 -4
  155. package/esm/filters/components/filtersDropdown.js +3 -3
  156. package/esm/filters/components/filtersEmptySelectedList.d.ts +2 -0
  157. package/esm/filters/components/filtersEmptySelectedList.js +7 -0
  158. package/esm/filters/components/filtersItem.d.ts +5 -4
  159. package/esm/filters/components/filtersItem.js +2 -1
  160. package/esm/filters/components/filtersSaveModal.d.ts +3 -1
  161. package/esm/filters/components/filtersSaveModal.js +2 -2
  162. package/esm/filters/components/filtersSavedChipComponent.js +68 -6
  163. package/esm/filters/components/filtersSearch.d.ts +4 -4
  164. package/esm/filters/components/filtersSearch.js +20 -9
  165. package/esm/filters/components/filtersSearchItemData.js +18 -1
  166. package/esm/filters/components/filtersSearchList.d.ts +5 -1
  167. package/esm/filters/components/filtersSearchList.js +156 -28
  168. package/esm/filters/components/filtersSelect.d.ts +1 -0
  169. package/esm/filters/components/filtersSelect.js +36 -8
  170. package/esm/filters/components/filtersSelectListItem.d.ts +21 -15
  171. package/esm/filters/components/filtersSelectListItem.js +13 -3
  172. package/esm/filters/components/filtersSidePanel.d.ts +15 -0
  173. package/esm/filters/components/filtersSidePanel.js +208 -0
  174. package/esm/filters/components/filtersSidePanelChip.d.ts +9 -0
  175. package/esm/filters/components/filtersSidePanelChip.js +9 -0
  176. package/esm/filters/components/filtersSidePanelDropdown.d.ts +6 -0
  177. package/esm/filters/components/filtersSidePanelDropdown.js +81 -0
  178. package/esm/filters/components/filtersSidePanelItem.d.ts +16 -0
  179. package/esm/filters/components/filtersSidePanelItem.js +63 -0
  180. package/esm/filters/components/filtersSidePanelRange.d.ts +6 -0
  181. package/esm/filters/components/filtersSidePanelRange.js +24 -0
  182. package/esm/filters/filters.d.ts +5 -0
  183. package/esm/filters/filters.js +101 -38
  184. package/esm/filters/filtersHelper.d.ts +4 -2
  185. package/esm/filters/filtersHelper.js +37 -0
  186. package/esm/filters/filtersHooks.d.ts +12 -2
  187. package/esm/filters/filtersHooks.js +19 -2
  188. package/esm/formStepper/formStepper.d.ts +1 -1
  189. package/esm/formStepper/formStepper.js +5 -2
  190. package/esm/groupsFilter/groupsFilter.js +72 -37
  191. package/esm/groupsFilter/groupsFilterMenu.d.ts +1 -0
  192. package/esm/groupsFilter/groupsFilterMenu.js +2 -2
  193. package/esm/groupsFilter/groupsFilterTrigger.js +1 -1
  194. package/esm/images/imageLooking.d.ts +4 -0
  195. package/esm/images/imageLooking.js +12 -0
  196. package/esm/index.d.ts +7 -4
  197. package/esm/index.js +6 -3
  198. package/esm/list/list.d.ts +3 -1
  199. package/esm/list/list.js +2 -2
  200. package/esm/mobileSheet/mobileSheet.d.ts +2 -0
  201. package/esm/mobileSheet/mobileSheet.js +4 -4
  202. package/esm/modal/modal.d.ts +1 -0
  203. package/esm/modal/modal.js +2 -2
  204. package/esm/radioGroup/radioGroup.d.ts +1 -0
  205. package/esm/radioGroup/radioGroup.js +3 -2
  206. package/esm/range/range.js +29 -10
  207. package/esm/searchInputRaw/searchInputRaw.js +1 -1
  208. package/esm/sidePanel/sidePanel.d.ts +1 -0
  209. package/esm/sidePanel/sidePanel.js +3 -3
  210. package/esm/tabs/tabItem/tabItem.d.ts +1 -0
  211. package/esm/tabs/tabItem/tabItem.js +2 -2
  212. package/esm/tabs/tabs.d.ts +1 -0
  213. package/esm/tabs/tabs.js +1 -1
  214. package/esm/utils/keyboardHelpers.d.ts +2 -0
  215. package/esm/utils/keyboardHelpers.js +44 -0
  216. package/esm/utils/localization/translations/cs-json.d.ts +1 -0
  217. package/esm/utils/localization/translations/cs-json.js +2 -1
  218. package/esm/utils/localization/translations/de-json.d.ts +1 -0
  219. package/esm/utils/localization/translations/de-json.js +2 -1
  220. package/esm/utils/localization/translations/en-json.d.ts +7 -0
  221. package/esm/utils/localization/translations/en-json.js +8 -1
  222. package/esm/utils/localization/translations/es-json.d.ts +1 -0
  223. package/esm/utils/localization/translations/es-json.js +2 -1
  224. package/esm/utils/localization/translations/fr-FR-json.d.ts +1 -0
  225. package/esm/utils/localization/translations/fr-FR-json.js +2 -1
  226. package/esm/utils/localization/translations/fr-json.d.ts +1 -0
  227. package/esm/utils/localization/translations/fr-json.js +2 -1
  228. package/esm/utils/localization/translations/id-json.d.ts +1 -0
  229. package/esm/utils/localization/translations/id-json.js +2 -1
  230. package/esm/utils/localization/translations/it-json.d.ts +1 -0
  231. package/esm/utils/localization/translations/it-json.js +2 -1
  232. package/esm/utils/localization/translations/ja-json.d.ts +1 -0
  233. package/esm/utils/localization/translations/ja-json.js +2 -1
  234. package/esm/utils/localization/translations/ko-KR-json.d.ts +1 -0
  235. package/esm/utils/localization/translations/ko-KR-json.js +2 -1
  236. package/esm/utils/localization/translations/ms-json.d.ts +1 -0
  237. package/esm/utils/localization/translations/ms-json.js +2 -1
  238. package/esm/utils/localization/translations/nl-json.d.ts +1 -0
  239. package/esm/utils/localization/translations/nl-json.js +2 -1
  240. package/esm/utils/localization/translations/pl-json.d.ts +1 -0
  241. package/esm/utils/localization/translations/pl-json.js +2 -1
  242. package/esm/utils/localization/translations/pt-BR-json.d.ts +1 -0
  243. package/esm/utils/localization/translations/pt-BR-json.js +2 -1
  244. package/esm/utils/localization/translations/sv-json.d.ts +1 -0
  245. package/esm/utils/localization/translations/sv-json.js +2 -1
  246. package/esm/utils/localization/translations/th-json.d.ts +1 -0
  247. package/esm/utils/localization/translations/th-json.js +2 -1
  248. package/esm/utils/localization/translations/tr-json.d.ts +1 -0
  249. package/esm/utils/localization/translations/tr-json.js +2 -1
  250. package/esm/utils/localization/translations/zh-Hans-json.d.ts +1 -0
  251. package/esm/utils/localization/translations/zh-Hans-json.js +2 -1
  252. package/esm/utils/localization/translations/zh-TW-json.d.ts +1 -0
  253. package/esm/utils/localization/translations/zh-TW-json.js +2 -1
  254. package/package.json +6 -6
  255. package/dist/filters/components/filtersModal.d.ts +0 -17
  256. package/dist/filters/components/filtersModal.js +0 -107
  257. package/dist/filters/components/filtersModalItem.d.ts +0 -9
  258. package/dist/filters/components/filtersModalItem.js +0 -74
  259. package/esm/filters/components/filtersModal.d.ts +0 -17
  260. package/esm/filters/components/filtersModal.js +0 -103
  261. package/esm/filters/components/filtersModalItem.d.ts +0 -9
  262. package/esm/filters/components/filtersModalItem.js +0 -70
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFirstFocusableItem = exports.getNewFocusableItem = void 0;
4
+ const focusableSelector_1 = require("./focusableSelector");
5
+ const getNewFocusableItem = (step, container, specificSelector) => {
6
+ if (!container) {
7
+ return undefined;
8
+ }
9
+ const allFocusables = Array.from(container.querySelectorAll(focusableSelector_1.FOCUSABLE_SELECTOR));
10
+ const currentElement = document.activeElement;
11
+ if (allFocusables.length === 0) {
12
+ return undefined;
13
+ }
14
+ if (specificSelector) {
15
+ const matchingItems = allFocusables.filter(el => el.matches(specificSelector));
16
+ const currentSpecificIndex = matchingItems.indexOf(currentElement);
17
+ if (currentSpecificIndex !== -1 && matchingItems.length > 1) {
18
+ let nextIndex = currentSpecificIndex + step;
19
+ if (nextIndex >= matchingItems.length) {
20
+ nextIndex = 0;
21
+ }
22
+ if (nextIndex < 0) {
23
+ nextIndex = matchingItems.length - 1;
24
+ }
25
+ return matchingItems[nextIndex];
26
+ }
27
+ }
28
+ const currentIndex = allFocusables.indexOf(currentElement);
29
+ if (currentIndex === -1) {
30
+ return undefined;
31
+ }
32
+ const nextIndex = currentIndex + step;
33
+ if (nextIndex >= allFocusables.length) {
34
+ return allFocusables[0];
35
+ }
36
+ if (nextIndex < 0) {
37
+ return allFocusables[allFocusables.length - 1];
38
+ }
39
+ return allFocusables[nextIndex];
40
+ };
41
+ exports.getNewFocusableItem = getNewFocusableItem;
42
+ const getFirstFocusableItem = (container) => {
43
+ if (!container) {
44
+ return undefined;
45
+ }
46
+ const allFocusables = Array.from(container.querySelectorAll(focusableSelector_1.FOCUSABLE_SELECTOR));
47
+ return allFocusables[0];
48
+ };
49
+ exports.getFirstFocusableItem = getFirstFocusableItem;
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Zavřít filtr",
247
247
  "Column Settings": "Nastavení sloupců",
248
248
  "Category": "Kategorie",
249
- "Select visible columns": "Vyberte viditelné sloupce"
249
+ "Select visible columns": "Vyberte viditelné sloupce",
250
+ "Selected": "Vybráno"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Filter schließen",
247
247
  "Column Settings": "Spalteneinstellungen",
248
248
  "Category": "Kategorie",
249
- "Select visible columns": "Sichtbare Spalten auswählen"
249
+ "Select visible columns": "Sichtbare Spalten auswählen",
250
+ "Selected": "Ausgewählt"
250
251
  };
@@ -292,4 +292,11 @@ export declare const translations: {
292
292
  "Date range filter:": string;
293
293
  "Date filter:": string;
294
294
  "Select visible columns": string;
295
+ Selected: string;
296
+ "No Filters Selected": string;
297
+ "Selected filters will appear here.": string;
298
+ "Currently selected": string;
299
+ "Top results": string;
300
+ "Open setting conditions popup": string;
301
+ "Close setting conditions popup": string;
295
302
  };
@@ -294,5 +294,12 @@ exports.translations = {
294
294
  "Category": "Category",
295
295
  "Date range filter:": "Date range filter:",
296
296
  "Date filter:": "Date filter:",
297
- "Select visible columns": "Select visible columns"
297
+ "Select visible columns": "Select visible columns",
298
+ "Selected": "Selected",
299
+ "No Filters Selected": "No Filters Selected",
300
+ "Selected filters will appear here.": "Selected filters will appear here.",
301
+ "Currently selected": "Currently selected",
302
+ "Top results": "Top results",
303
+ "Open setting conditions popup": "Open setting conditions popup",
304
+ "Close setting conditions popup": "Close setting conditions popup"
298
305
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Cerrar filtro",
247
247
  "Column Settings": "Configuración de columnas",
248
248
  "Category": "Categoría",
249
- "Select visible columns": "Seleccionar columnas visibles"
249
+ "Select visible columns": "Seleccionar columnas visibles",
250
+ "Selected": "Seleccionado"
250
251
  };
@@ -243,4 +243,5 @@ export declare const translations: {
243
243
  "Column Settings": string;
244
244
  Category: string;
245
245
  "Select visible columns": string;
246
+ Selected: string;
246
247
  };
@@ -245,5 +245,6 @@ exports.translations = {
245
245
  "Close filter": "Fermer le filtre",
246
246
  "Column Settings": "Paramètres des colonnes",
247
247
  "Category": "Catégorie",
248
- "Select visible columns": "Sélectionner les colonnes visibles"
248
+ "Select visible columns": "Sélectionner les colonnes visibles",
249
+ "Selected": "Sélectionné"
249
250
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Fermer le filtre",
247
247
  "Column Settings": "Paramètres des colonnes",
248
248
  "Category": "Catégorie",
249
- "Select visible columns": "Sélectionner les colonnes visibles"
249
+ "Select visible columns": "Sélectionner les colonnes visibles",
250
+ "Selected": "Sélectionné"
250
251
  };
@@ -245,4 +245,5 @@ export declare const translations: {
245
245
  "Column Settings": string;
246
246
  Category: string;
247
247
  "Select visible columns": string;
248
+ Selected: string;
248
249
  };
@@ -247,5 +247,6 @@ exports.translations = {
247
247
  "Close filter": "Tutup filter",
248
248
  "Column Settings": "Pengaturan Kolom",
249
249
  "Category": "Kategori",
250
- "Select visible columns": "Pilih kolom yang terlihat"
250
+ "Select visible columns": "Pilih kolom yang terlihat",
251
+ "Selected": "Dipilih"
251
252
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Chiudi filtro",
247
247
  "Column Settings": "Impostazioni colonna",
248
248
  "Category": "Categoria",
249
- "Select visible columns": "Selezionare colonne visibili"
249
+ "Select visible columns": "Selezionare colonne visibili",
250
+ "Selected": "Selezionato"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "フィルターを閉じる",
247
247
  "Column Settings": "列の設定",
248
248
  "Category": "カテゴリ",
249
- "Select visible columns": "表示列を選択"
249
+ "Select visible columns": "表示列を選択",
250
+ "Selected": "選択車両"
250
251
  };
@@ -251,4 +251,5 @@ export declare const translations: {
251
251
  "Column Settings": string;
252
252
  Category: string;
253
253
  "Select visible columns": string;
254
+ Selected: string;
254
255
  };
@@ -253,5 +253,6 @@ exports.translations = {
253
253
  "Close filter": "필터 닫기",
254
254
  "Column Settings": "열 설정",
255
255
  "Category": "범주",
256
- "Select visible columns": "표시되는 열 선택"
256
+ "Select visible columns": "표시되는 열 선택",
257
+ "Selected": "선택됨"
257
258
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Tutup penyaring",
247
247
  "Column Settings": "Tetapan Lajur",
248
248
  "Category": "Kategori",
249
- "Select visible columns": "Pilih lajur yang boleh dilihat"
249
+ "Select visible columns": "Pilih lajur yang boleh dilihat",
250
+ "Selected": "Dipilih"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Filter sluiten",
247
247
  "Column Settings": "Kolominstellingen",
248
248
  "Category": "Categorie",
249
- "Select visible columns": "Zichtbare kolommen selecteren"
249
+ "Select visible columns": "Zichtbare kolommen selecteren",
250
+ "Selected": "Geselecteerd"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Zamknij filtr",
247
247
  "Column Settings": "Ustawienia kolumn",
248
248
  "Category": "Kategoria",
249
- "Select visible columns": "Wybierz widoczne kolumny"
249
+ "Select visible columns": "Wybierz widoczne kolumny",
250
+ "Selected": "Wybrano"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Fechar filtro",
247
247
  "Column Settings": "Configurações da coluna",
248
248
  "Category": "Categoria",
249
- "Select visible columns": "Selecionar colunas visíveis"
249
+ "Select visible columns": "Selecionar colunas visíveis",
250
+ "Selected": "Selecionado"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Stäng filter",
247
247
  "Column Settings": "Kolumninställningar",
248
248
  "Category": "Kategori",
249
- "Select visible columns": "Välj synbara kolumner"
249
+ "Select visible columns": "Välj synbara kolumner",
250
+ "Selected": "Valda"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "ปิดตัวกรอง",
247
247
  "Column Settings": "การตั้งค่าคอลัมน์",
248
248
  "Category": "หมวดหมู่",
249
- "Select visible columns": "เลือกคอลัมน์ที่มองเห็นได้"
249
+ "Select visible columns": "เลือกคอลัมน์ที่มองเห็นได้",
250
+ "Selected": "เลือกแล้ว"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "Filtreyi kapat",
247
247
  "Column Settings": "Sütun Ayarları",
248
248
  "Category": "Kategori",
249
- "Select visible columns": "Görünür sütunları seç"
249
+ "Select visible columns": "Görünür sütunları seç",
250
+ "Selected": "Seçildi"
250
251
  };
@@ -244,4 +244,5 @@ export declare const translations: {
244
244
  "Column Settings": string;
245
245
  Category: string;
246
246
  "Select visible columns": string;
247
+ Selected: string;
247
248
  };
@@ -246,5 +246,6 @@ exports.translations = {
246
246
  "Close filter": "关闭筛选器",
247
247
  "Column Settings": "列设置",
248
248
  "Category": "类别",
249
- "Select visible columns": "选择可见列"
249
+ "Select visible columns": "选择可见列",
250
+ "Selected": "选中的"
250
251
  };
@@ -264,4 +264,5 @@ export declare const translations: {
264
264
  "Column Settings": string;
265
265
  Category: string;
266
266
  "Select visible columns": string;
267
+ Selected: string;
267
268
  };
@@ -266,5 +266,6 @@ exports.translations = {
266
266
  "Close filter": "關閉篩選器",
267
267
  "Column Settings": "欄設定",
268
268
  "Category": "種類",
269
- "Select visible columns": "選取可見欄"
269
+ "Select visible columns": "選取可見欄",
270
+ "Selected": "已選取"
270
271
  };
@@ -12,6 +12,7 @@ export interface IAdvancedGroupsFilter extends IZenComponentProps {
12
12
  errorHandler: (e: Error) => void;
13
13
  dataItems?: IDropdownItem[];
14
14
  tooltipText?: string;
15
+ isMobile?: boolean;
15
16
  }
16
17
  export declare const AdvancedGroupsFilter: React.FC<IAdvancedGroupsFilter>;
17
18
  export declare const TRANSLATIONS: string[];
@@ -5,7 +5,7 @@ import { AdvancedGroupsFilterForm, TRANSLATIONS as AdvancedGroupsFilterFormTrans
5
5
  import { classNames } from "../commonHelpers/classNames/classNames";
6
6
  import { useLanguage } from "../utils/localization/useLanguage";
7
7
  import { Modal } from "../modal/modal";
8
- export const AdvancedGroupsFilter = ({ isOpen, onClose, onApply, state, className, getData, errorHandler, dataItems, tooltipText }) => {
8
+ export const AdvancedGroupsFilter = ({ isOpen, onClose, onApply, state, className, getData, errorHandler, dataItems, tooltipText, isMobile }) => {
9
9
  //const dropdownFocusedListClasses = ["zen-dropdown-searchable-trigger__input", "zen-dropdown-searchable-trigger__popup-trigger"];
10
10
  const [currentState, setCurrentState] = useState(prepareCurrentFilterState(state));
11
11
  const [dataItemsValue, setDataItemsValue] = useState(dataItems || []);
@@ -28,7 +28,7 @@ export const AdvancedGroupsFilter = ({ isOpen, onClose, onApply, state, classNam
28
28
  const handleApply = () => {
29
29
  onApply(prepareToFilterState(currentState));
30
30
  };
31
- return _jsxs(Modal, { title: translate("Advanced groups filter"), className: classNames(["zen-advanced-groups-filter", className || ""]), isOpen: isOpen, onClose: handleClose, children: [_jsx(AdvancedGroupsFilterForm, { dataItems: dataItemsValue, getData: getData, errorHandler: errorHandler, state: currentState, onStateChange: setCurrentState, tooltipText: tooltipText }), _jsx(Modal.SecondaryButton, { onClick: onClose, children: translate("Cancel") }), _jsx(Modal.PrimaryButton, { onClick: handleApply, children: translate("Apply") })] });
31
+ return _jsxs(Modal, { title: translate("Advanced groups filter"), className: classNames(["zen-advanced-groups-filter", className || ""]), isOpen: isOpen, modalContainerClassName: isMobile ? "zen-advanced-groups-filter-prioritized-modal" : undefined, onClose: handleClose, children: [_jsx(AdvancedGroupsFilterForm, { dataItems: dataItemsValue, getData: getData, errorHandler: errorHandler, state: currentState, onStateChange: setCurrentState, tooltipText: tooltipText }), _jsx(Modal.SecondaryButton, { onClick: onClose, children: translate("Cancel") }), _jsx(Modal.PrimaryButton, { onClick: handleApply, children: translate("Apply") })] });
32
32
  };
33
33
  export const TRANSLATIONS = [
34
34
  ...AdvancedGroupsFilterFormTranslations,
@@ -9,9 +9,11 @@ import { getCurrentSelectionFromIds } from "./advancedGroupsFilterHelper";
9
9
  import { ENTIRE_ORGANIZATION_GROUP_ID } from "../groupsFilter/groupsHelper";
10
10
  import { useLanguage } from "../utils/localization/useLanguage";
11
11
  import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
12
+ import { useMobile } from "../commonHelpers/hooks/useMobile";
12
13
  export const AdvancedGroupsFilterFormSection = ({ state, interSectionRelation, itemId, onInterSectionChange, onRelationChange, onRemoveCondition, onStateChange, getData, errorHandler, dataItems, isHasRemoveConditionButton, isHasTooltip, tooltipText }) => {
13
14
  const { translate } = useLanguage();
14
15
  const inputItem = useId();
16
+ const isMobile = useMobile();
15
17
  const [currentSelection, setCurrentSelection] = React.useState(getCurrentSelectionFromIds(state.items, dataItems));
16
18
  const isPrevEmptyComboItems = useRef(dataItems.length === 0);
17
19
  const comboboxRef = useRef(null);
@@ -58,7 +60,7 @@ export const AdvancedGroupsFilterFormSection = ({ state, interSectionRelation, i
58
60
  ] }) }) }) : null, _jsxs("div", { className: "zen-advanced-groups-filter-form__main-section", children: [_jsxs("div", { className: "zen-advanced-groups-filter-form__section-column zen-advanced-groups-filter-form__section-column--left", children: [_jsxs("div", { className: "zen-advanced-groups-filter-form__section-label zen-advanced-groups-filter-form__operator-section", children: [_jsx("div", { className: "zen-advanced-groups-filter-form__operator-label", children: translate("Operator") }), isHasTooltip && _jsx(AdvancedGroupsFilterSectionTooltip, { ariaLabel: "Information", text: tooltipText })] }), _jsx(GroupButton, { onChange: handleRelationChange, groupData: [
59
61
  { name: translate("And"), value: RelationOperator.AND, selected: state.relation === RelationOperator.AND },
60
62
  { name: translate("Or"), value: RelationOperator.OR, selected: state.relation === RelationOperator.OR }
61
- ] })] }), _jsxs("div", { className: "zen-advanced-groups-filter-form__section-column zen-advanced-groups-filter-form__section-column--right", children: [_jsx("label", { className: "zen-advanced-groups-filter-form__section-label", children: translate("Groups") }), isHasRemoveConditionButton && _jsx("button", { type: "button", className: "zen-advanced-groups-filter-form__remove-button", "data-item": itemId, onClick: onRemoveCondition, children: translate("Remove condition") }), _jsxs("div", { className: "zen-advanced-groups-filter-form__combo-section", children: [_jsx("div", { className: "zen-advanced-groups-filter-form__combo-box", ref: comboboxRef, children: _jsx(Dropdown, { classNamePopup: "zen-advanced-groups-filter-form__popup", getData: getData, errorHandler: errorHandler, dataItems: dataItems, onChange: handleSelection, value: state.items.map((el) => el.id), placeholder: translate("Select groups…"), inputId: `${inputItem}-dropdown-${itemId}`, showCounterPill: true }) }), _jsx("div", { className: "zen-advanced-groups-filter-form__selected-box", ref: pillBoxRef, children: _jsx(ComboboxSelected, { selection: getCurrentSelectionFromIds(state.items, dataItems).map((el) => ({ id: el.id, name: el.name })), onRemove: handleRemove, pillEmptyText: ENTIRE_ORGANIZATION_GROUP_ID }) })] })] })] })] });
63
+ ] })] }), _jsxs("div", { className: "zen-advanced-groups-filter-form__section-column zen-advanced-groups-filter-form__section-column--right", children: [_jsx("label", { className: "zen-advanced-groups-filter-form__section-label", children: translate("Groups") }), isHasRemoveConditionButton && _jsx("button", { type: "button", className: "zen-advanced-groups-filter-form__remove-button", "data-item": itemId, onClick: onRemoveCondition, children: translate("Remove condition") }), _jsxs("div", { className: "zen-advanced-groups-filter-form__combo-section", children: [_jsx("div", { className: "zen-advanced-groups-filter-form__combo-box", ref: comboboxRef, children: _jsx(Dropdown, { classNamePopup: "zen-advanced-groups-filter-form__popup", getData: getData, mobileSheetStackingClassName: isMobile ? "zen-advanced-groups-filter-form__mobile-sheet-stacking" : undefined, errorHandler: errorHandler, dataItems: dataItems, onChange: handleSelection, value: state.items.map((el) => el.id), placeholder: translate("Select groups…"), inputId: `${inputItem}-dropdown-${itemId}`, showCounterPill: true }) }), _jsx("div", { className: "zen-advanced-groups-filter-form__selected-box", ref: pillBoxRef, children: _jsx(ComboboxSelected, { selection: getCurrentSelectionFromIds(state.items, dataItems).map((el) => ({ id: el.id, name: el.name })), onRemove: handleRemove, pillEmptyText: ENTIRE_ORGANIZATION_GROUP_ID }) })] })] })] })] });
62
64
  };
63
65
  export const TRANSLATIONS = [
64
66
  ...AdvancedGroupsFilterSectionTooltipTranslations,
package/esm/chip/chip.js CHANGED
@@ -90,12 +90,12 @@ export const Chip = (props) => {
90
90
  isTriggerMode ? getChipTriggerStateClassName(!!disabled, isOpen, status) : getChipStateClassName(!!disabled, !!readonly, active, status),
91
91
  className !== null && className !== void 0 ? className : ""
92
92
  ], [driveChipClass, isTriggerMode, disabled, isOpen, status, readonly, active, className]);
93
- const chipComponent = useMemo(() => _jsxs("label", { className: classNames(memoizedClasses), ref: ref, title: chipTitle, htmlFor: id || chipId, children: [_jsx("input", { checked: active, onBlur: onBlurHandler, onKeyUp: onKeyUpHandler, onKeyDown: onKeyDownHandler, onChange: onChangeHandler, id: id || chipId, className: "zen-chip__input", type: "checkbox", disabled: disabled, readOnly: readonly }), children ? _jsx("div", { className: classNames(["zen-chip-text-content", driveTextClass !== null && driveTextClass !== void 0 ? driveTextClass : ""]), children: children }) : null, svgIcon, isClosable && _jsx("button", { type: "button", className: "zen-chip__close-button", onClick: handleClose, title: closeAriaText || translate("Close"), "aria-label": closeAriaText || translate("Close"), children: _jsx(IconClose, { size: isDrive ? "huger" : "large", className: "zen-pill-non-actionable__close-icon" }) })] }), [memoizedClasses, ref, chipTitle, id, chipId, active, onBlurHandler, onKeyUpHandler, onKeyDownHandler, onChangeHandler, disabled, readonly, children, driveTextClass, svgIcon, isClosable,
94
- handleClose, closeAriaText, translate, isDrive]);
93
+ const chipComponent = useMemo(() => _jsxs("label", { className: classNames(memoizedClasses), ref: ref, title: title || chipTitle, htmlFor: id || chipId, children: [_jsx("input", { checked: active, onBlur: onBlurHandler, onKeyUp: onKeyUpHandler, onKeyDown: onKeyDownHandler, onChange: onChangeHandler, id: id || chipId, className: "zen-chip__input", type: "checkbox", disabled: disabled, readOnly: readonly }), children ? _jsx("div", { className: classNames(["zen-chip-text-content", driveTextClass !== null && driveTextClass !== void 0 ? driveTextClass : ""]), children: children }) : null, svgIcon, isClosable && _jsx("button", { type: "button", className: "zen-chip__close-button", onClick: handleClose, title: closeAriaText || translate("Close"), "aria-label": closeAriaText || translate("Close"), children: _jsx(IconClose, { size: isDrive ? "huger" : "large", className: "zen-pill-non-actionable__close-icon" }) })] }), [memoizedClasses, ref, title, chipTitle, id, chipId, active, onBlurHandler, onKeyUpHandler, onKeyDownHandler, onChangeHandler, disabled, readonly,
94
+ children, driveTextClass, svgIcon, isClosable, handleClose, closeAriaText, translate, isDrive]);
95
95
  const chipTriggerComponent = useMemo(() => {
96
- const extraAttributes = chipTitle ? { "aria-label": chipTitle } : {};
96
+ const extraAttributes = title ? { "aria-label": title } : chipTitle ? { "aria-label": chipTitle } : {};
97
97
  return _jsx("div", Object.assign({ role: "button", tabIndex: 0 }, extraAttributes, { onClick: handleClick, onKeyDown: chipTriggerKeyDownHandler, className: classNames(memoizedClasses), "data-id": id || chipId, ref: triggerRef, children: _jsxs("div", { className: "zen-chip__content-wrapper", children: [hasContent ? _jsx("div", { className: classNames(["zen-chip-text-content", driveTextClass !== null && driveTextClass !== void 0 ? driveTextClass : ""]), children: children }) : null, svgIcon, isClosable && _jsx("button", { type: "button", className: "zen-chip__close-button", onClick: handleClose, title: closeAriaText || translate("Close"), "aria-label": closeAriaText || translate("Close"), children: _jsx(IconClose, { size: isDrive ? "huger" : "large", className: "zen-pill-non-actionable__close-icon" }) }), hasQuantity && quantity ? _jsx("div", { className: "zen-chip__quantity", children: quantity }) : null] }) }));
98
- }, [handleClick, chipTriggerKeyDownHandler, memoizedClasses, id, chipId, triggerRef, hasContent, chipTitle, driveTextClass, children, svgIcon, isClosable, handleClose,
99
- closeAriaText, translate, isDrive, hasQuantity, quantity]);
98
+ }, [title, chipTitle, handleClick, chipTriggerKeyDownHandler, memoizedClasses, id, chipId, triggerRef, hasContent, driveTextClass,
99
+ children, svgIcon, isClosable, handleClose, closeAriaText, translate, isDrive, hasQuantity, quantity]);
100
100
  return isTriggerMode ? chipTriggerComponent : chipComponent;
101
101
  };
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import "./dateInput.less";
3
3
  import { IZenComponentProps } from "../commonHelpers/zenComponent";
4
- export interface IDateInput extends IZenComponentProps {
4
+ import { IChipsParent } from "../chip/chip";
5
+ export interface IDateInput extends IZenComponentProps, IChipsParent {
5
6
  defaultValue?: string;
6
7
  value: string | undefined;
7
8
  onChange: (value: string | undefined) => void;
@@ -18,9 +18,12 @@ import { FormFieldError } from "../formFieldError/formFieldError";
18
18
  import { FooterButtons } from "../footerButtons/footerButtons";
19
19
  import { MobileSheet } from "../mobileSheet/mobileSheet";
20
20
  import { useDriveClassName } from "../utils/theme/useDriveClassName";
21
- export const DateInput = ({ className, classNamePopup, defaultValue, value, onChange, id, disabled, dropDownTitle, timeSelect, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, error, requireSelection = false, buttonLabel }) => {
21
+ import { Chip } from "../chip/chip";
22
+ import { useChipStatus } from "../chip/chipStatusProvider";
23
+ export const DateInput = ({ className, classNamePopup, defaultValue, value, onChange, id, disabled, dropDownTitle, timeSelect, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, error, requireSelection = false, chip, chipIcon, chipId, chipName, buttonLabel }) => {
22
24
  const { translate } = useLanguage();
23
25
  const isMobile = useMobile();
26
+ const chipStatus = useChipStatus();
24
27
  const drivePopupClassName = useDriveClassName("zen-date-input-popup");
25
28
  const driveWrapperClassName = useDriveClassName("zen-date-input-popup-wrapper");
26
29
  const { dateFormat, timeFormat, weekStartsOnSunday, toLocalDateTime } = useContext(userFormatContext);
@@ -66,6 +69,11 @@ export const DateInput = ({ className, classNamePopup, defaultValue, value, onCh
66
69
  const handleClearClick = useCallback(() => {
67
70
  setCustomDate(defaultValue);
68
71
  }, [defaultValue]);
72
+ const handleClearAndApply = useCallback(() => {
73
+ setCustomDate(defaultValue);
74
+ setIsOpen(false);
75
+ onChange(defaultValue);
76
+ }, [defaultValue, onChange]);
69
77
  useEffect(() => {
70
78
  setCustomDate(value);
71
79
  }, [value]);
@@ -98,7 +106,8 @@ export const DateInput = ({ className, classNamePopup, defaultValue, value, onCh
98
106
  }, [isOpen, isMobile]);
99
107
  const buttonCurrentLabel = getButtonLabel();
100
108
  const buttonCurrentTitle = getButtonLabel(true);
101
- return _jsxs(_Fragment, { children: [_jsx(TextIconButton, { id: id || undefined, htmlType: "button", title: buttonCurrentTitle, icon: IconCalendar, iconPosition: ButtonIconPosition.Start, className: cssClass, disabled: disabled, onClick: toggleVisibility, ref: triggerRef, children: buttonCurrentLabel }), isMobile ? memoizedMobileView : memoizedDesktopView, _jsx(FormFieldError, { error: error })] });
109
+ const chipTriggerComponent = useMemo(() => _jsx(Chip, { status: isDefaultState ? undefined : chipStatus || "active", title: isDefaultState ? chipName : buttonCurrentTitle, isOpen: isOpen, disabled: disabled, onClick: toggleVisibility, onClose: isDefaultState ? undefined : handleClearAndApply, triggerRef: triggerRef, icon: chipIcon || IconCalendar, id: chipId, children: isDefaultState ? chipName : buttonCurrentLabel }), [isDefaultState, chipStatus, isOpen, disabled, toggleVisibility, handleClearAndApply, chipIcon, chipId, chipName, buttonCurrentLabel, buttonCurrentTitle]);
110
+ return _jsxs(_Fragment, { children: [chip ? chipTriggerComponent : _jsx(TextIconButton, { id: id || undefined, htmlType: "button", title: buttonCurrentTitle, icon: IconCalendar, iconPosition: ButtonIconPosition.Start, className: cssClass, disabled: disabled, onClick: toggleVisibility, ref: triggerRef, children: buttonCurrentLabel }), isMobile ? memoizedMobileView : memoizedDesktopView, _jsx(FormFieldError, { error: error })] });
102
111
  };
103
112
  export const TRANSLATIONS = [
104
113
  "Pick a date",
@@ -24,6 +24,7 @@ import { useDrive } from "../utils/theme/useDrive";
24
24
  import { IconChevronRightSmall } from "../icons/iconChevronRightSmall";
25
25
  import { Chip } from "../chip/chip";
26
26
  import { useChipStatus } from "../chip/chipStatusProvider";
27
+ import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
27
28
  export const parseLabel = (option, dateFormat, translate, toLacalFn) => {
28
29
  const localeFrom = toLacalFn(option.from);
29
30
  const localeTo = toLacalFn(option.to);
@@ -49,7 +50,7 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
49
50
  const optionsMap = useMemo(() => getOptionsPeriodMap(optionsArg, translate, toLocalDateTime, weekStartsOnSunday ? "Sunday" : "Monday", toReverseOffsetDateTime), [optionsArg, toLocalDateTime, toReverseOffsetDateTime, translate, weekStartsOnSunday]);
50
51
  const previousStepOption = useRef("");
51
52
  const [selectedRange, setSelectedRange] = useState(getSelectedRangeFromValue(optionsMap, value));
52
- const [renderContent, setRenderContent] = useState(false);
53
+ const mobileContentRef = useRef(null);
53
54
  const isCustomDateOption = (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.label) === CUSTOM_CALENDAR_ID;
54
55
  const [isOpen, setIsOpen] = useState(false);
55
56
  const prevIsOpenRef = useRef(false);
@@ -185,16 +186,17 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
185
186
  setIsOpen(false);
186
187
  }, [setIsOpen]);
187
188
  const onReadyForFocus = useCallback((isCurrentOpen) => {
189
+ var _a;
188
190
  if (!isMobile) {
189
191
  return;
190
192
  }
191
193
  if (isCurrentOpen) {
192
- setRenderContent(true);
194
+ const focusableElement = (_a = mobileContentRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(FOCUSABLE_SELECTOR);
195
+ focusableElement === null || focusableElement === void 0 ? void 0 : focusableElement.focus();
193
196
  return;
194
197
  }
195
- setRenderContent(false);
196
198
  prevIsOpenRef.current = isCurrentOpen;
197
- }, [isMobile]);
199
+ }, [isMobile, mobileContentRef]);
198
200
  const isValueNotChanged = useMemo(() => {
199
201
  if (!hasApplyButton) {
200
202
  return false;
@@ -206,7 +208,6 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
206
208
  }, [customDate.from, customDate.to, hasApplyButton, isCustomDateOption, selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.label, value === null || value === void 0 ? void 0 : value.from, value === null || value === void 0 ? void 0 : value.label, value === null || value === void 0 ? void 0 : value.to]);
207
209
  const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, { className: classNames(["zen-date-range-popup-wrapper", driveWrapperPopupClassName || ""]), ariaLabel: translate("Date range"), useTrapFocusWithTrigger: "on", role: "dialog", triggerRef: triggerRef, onOpenChange: setIsOpen, shouldHoldScroll: true, isOpen: isOpen, recalculateOnScroll: true, children: _jsxs("div", { className: classNames(["zen-date-range-popup", drivePopupClassName || "", classNamePopup !== null && classNamePopup !== void 0 ? classNamePopup : ""]), children: [_jsx("div", { className: "zen-date-range-popup__header", children: title }), component, _jsxs("div", { className: "zen-date-range-popup__footer", children: [_jsx(Button, { className: "zen-date-range-popup__button-clear", type: ButtonType.Tertiary, disabled: !!isDefaultState, onClick: handleClearClick, children: translate("Clear") }), (!isCustomDateOption && hasApplyButton) &&
208
210
  _jsx(Button, { className: "zen-date-range-popup__button-reset", type: ButtonType.Secondary, onClick: handleCancelClick, children: translate("Cancel") }), (isCustomDateOption || hasApplyButton) && _jsx(Button, { className: "zen-date-range-popup__button-apply", type: ButtonType.Primary, disabled: (isCustomDateOption && (!customDate.from || !customDate.to)) || isValueNotChanged || !selectedRange, onClick: handleApplyClick, children: translate("Apply") })] })] }) }), [classNamePopup, component, customDate.from, customDate.to, drivePopupClassName, driveWrapperPopupClassName, handleApplyClick, handleCancelClick, handleClearClick, hasApplyButton, isCustomDateOption, isDefaultState, isOpen, isValueNotChanged, selectedRange, title, translate]);
209
- const notFocusedComponent = useMemo(() => !range.from && !range.to, [range.from, range.to]);
210
211
  const memoizedMobileFooter = useMemo(() => {
211
212
  const clearButton = _jsx(Button, { type: ButtonType.Tertiary, disabled: !!isDefaultState, onClick: handleClearClick, children: translate("Clear") });
212
213
  const cancelButton = hasApplyButton && !showMobileCalendar ? _jsx(Button, { type: ButtonType.Secondary, onClick: handleCancelClick, children: translate("Cancel") }) : null;
@@ -215,8 +216,8 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
215
216
  return _jsxs(FooterButtons, { children: [applyButton, cancelButton, clearButton] });
216
217
  }, [customDate.from, customDate.to, handleApplyClick, handleCancelClick, handleClearClick, hasApplyButton, isCustomDateOption, isDefaultState, isValueNotChanged, selectedRange,
217
218
  showMobileCalendar, translate]);
218
- const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, { className: classNames(["zen-date-range-mobile-sheet", classNamePopup ? `${classNamePopup}--mobile-sheet` : ""]), label: translate("Date range"), triggerRef: triggerRef, isOpen: isOpen, onHidePanel: memoizedHandleClose, onCloseClick: memoizedHandleClose, useTrapFocusWithTrigger: notFocusedComponent ? false : true, isBackVisible: showMobileCalendar, onBackClick: handleMobileBackClick, onReadyForFocus: onReadyForFocus, children: [_jsx(MobileSheet.Title, { children: showMobileCalendar ? calendarLabel : title }), _jsx(MobileSheet.Content, { children: renderContent ? component : null }), _jsx(MobileSheet.Footer, { children: memoizedMobileFooter })] }), [calendarLabel, classNamePopup, component, handleMobileBackClick, isOpen, memoizedHandleClose, memoizedMobileFooter, notFocusedComponent,
219
- onReadyForFocus, renderContent, showMobileCalendar, title, translate]);
219
+ const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, { className: classNames(["zen-date-range-mobile-sheet", classNamePopup ? `${classNamePopup}--mobile-sheet` : ""]), label: translate("Date range"), triggerRef: triggerRef, isOpen: isOpen, onHidePanel: memoizedHandleClose, onCloseClick: memoizedHandleClose, useTrapFocusWithTrigger: false, preventFirstFocus: true, isBackVisible: showMobileCalendar, onBackClick: handleMobileBackClick, onReadyForFocus: onReadyForFocus, children: [_jsx(MobileSheet.Title, { children: showMobileCalendar ? calendarLabel : title }), _jsx(MobileSheet.Content, { children: _jsx("div", { ref: mobileContentRef, children: component }) }), _jsx(MobileSheet.Footer, { children: memoizedMobileFooter })] }), [calendarLabel, classNamePopup, component, handleMobileBackClick, isOpen, memoizedHandleClose, memoizedMobileFooter,
220
+ onReadyForFocus, showMobileCalendar, title, translate, mobileContentRef]);
220
221
  const checkIsRangeDisable = useCallback((isIncrease) => {
221
222
  if (!selectedRange) {
222
223
  return true;
@@ -254,7 +255,7 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
254
255
  !defaultValue && !value || (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.label) === currentLabel || type && type !== ButtonType.Secondary ? "" : "zen-date-range--active"
255
256
  ]);
256
257
  const popupTriggerComponent = useMemo(() => _jsx(TextIconButton, { htmlType: "button", title: buttonTitle, icon: IconCalendar, iconPosition: ButtonIconPosition.Start, className: cssClass, type: type, disabled: disabled, onClick: toggleVisibility, ref: triggerRef, children: buttonLabel }), [cssClass, type, disabled, toggleVisibility, buttonLabel, buttonTitle]);
257
- const chipTriggerComponent = useMemo(() => _jsx(Chip, { status: isDefaultState ? undefined : chipStatus || "active", isOpen: isOpen, disabled: disabled, onClick: toggleVisibility, onClose: isDefaultState ? undefined : handleClearClick, triggerRef: triggerRef, icon: chipIcon || IconCalendar, id: chipId, children: isDefaultState ? chipName : buttonLabel }), [isDefaultState, chipStatus, isOpen, disabled, toggleVisibility, handleClearClick, chipIcon, chipId, chipName, buttonLabel]);
258
+ const chipTriggerComponent = useMemo(() => _jsx(Chip, { status: isDefaultState ? undefined : chipStatus || "active", title: isDefaultState ? chipName : buttonTitle, isOpen: isOpen, disabled: disabled, onClick: toggleVisibility, onClose: isDefaultState ? undefined : handleClearClick, triggerRef: triggerRef, icon: chipIcon || IconCalendar, id: chipId, children: isDefaultState ? chipName : buttonLabel }), [isDefaultState, chipStatus, isOpen, disabled, toggleVisibility, handleClearClick, chipIcon, chipId, chipName, buttonLabel, buttonTitle]);
258
259
  return _jsxs(_Fragment, { children: [stepper ? _jsxs("div", { className: classNames(["zen-date-range-wrapper", driveWrapperTriggerClassName || "", classNameWrapper || ""]), children: [_jsx("button", { type: "button", disabled: checkIsRangeDisable(false), onClick: decreaseRange, className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--left"]), title: translate("Previous"), children: _jsx(IconChevronLeftSmall, { size: isDrive ? "huge" : "large" }) }), popupTriggerComponent, _jsx("button", { type: "button", disabled: checkIsRangeDisable(true), onClick: increaseRange, className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--right"]), title: translate("Next"), children: _jsx(IconChevronRightSmall, { size: isDrive ? "huge" : "large" }) })] }) : (chip ? chipTriggerComponent : popupTriggerComponent), isMobile ? memoizedMobileView : memoizedDesktopView, _jsx(FormFieldError, { error: error })] });
259
260
  };
260
261
  export const TRANSLATIONS = [
@@ -5,6 +5,7 @@ import { IColor } from "../groupsFilter/groupsFilterInterfaces";
5
5
  import { TFilterButton } from "../filterButton/filterButton";
6
6
  import { TAlignment } from "../absolute/absolute";
7
7
  import { IChipsParent } from "../chip/chip";
8
+ export declare const LIST_LIMIT = 500;
8
9
  export interface ISelectionItem {
9
10
  id: string;
10
11
  name?: string;
@@ -49,6 +50,7 @@ interface IDropdownBase extends IChipsParent {
49
50
  isLoading?: boolean;
50
51
  alignment?: TAlignment;
51
52
  classNamePopup?: string;
53
+ mobileSheetStackingClassName?: string;
52
54
  error?: string;
53
55
  sortFn?: (a: IDropdownItem, b: IDropdownItem) => number;
54
56
  checkboxLabel?: string;