@geotab/zenith 3.3.0 → 3.4.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 (279) hide show
  1. package/README.md +17 -0
  2. package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +1 -1
  3. package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +0 -39
  4. package/dist/alertRaw/components/alertAnimation.js +8 -4
  5. package/dist/card/card.d.ts +1 -1
  6. package/dist/card/card.js +1 -3
  7. package/dist/card/components/status.js +2 -2
  8. package/dist/chart/barChart/getBarTooltipItems.js +31 -2
  9. package/dist/chart/barChart.js +2 -1
  10. package/dist/chart/utils/getYAxisMeta.d.ts +1 -1
  11. package/dist/chart/utils/getYAxisMeta.js +44 -1
  12. package/dist/checkbox/checkbox.js +3 -3
  13. package/dist/dataGrid/emptySearchList/emptySearchList.d.ts +6 -7
  14. package/dist/dataGrid/emptySearchList/emptySearchList.js +15 -23
  15. package/dist/dateInputRaw/dateInputRaw.d.ts +1 -1
  16. package/dist/dateRangeRaw/dateRangeRaw.d.ts +1 -1
  17. package/dist/dateRangeRaw/utils/dateRangeUtils.d.ts +1 -0
  18. package/dist/dateRangeRaw/utils/dateRangeUtils.js +39 -1
  19. package/dist/dropdownRaw/dropdownRaw.d.ts +1 -1
  20. package/dist/emptyState/emptyState.d.ts +9 -0
  21. package/dist/emptyState/emptyState.js +14 -0
  22. package/dist/emptyState/hooks/useIcon.d.ts +2 -0
  23. package/dist/emptyState/hooks/useIcon.js +17 -0
  24. package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.d.ts +1 -0
  25. package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +28 -3
  26. package/dist/formField/components/formFieldAdditionalInfo.d.ts +12 -0
  27. package/dist/formField/components/formFieldAdditionalInfo.js +10 -0
  28. package/dist/formField/components/formFieldAssistiveError.d.ts +10 -0
  29. package/dist/formField/components/formFieldAssistiveError.js +12 -0
  30. package/dist/formField/components/formFieldCounter.d.ts +6 -0
  31. package/dist/formField/components/formFieldCounter.js +7 -0
  32. package/dist/formField/components/formFieldLoading.d.ts +12 -0
  33. package/dist/formField/components/formFieldLoading.js +16 -0
  34. package/dist/formField/components/formFieldWithLabel.d.ts +8 -11
  35. package/dist/formField/components/formFieldWithLabel.js +21 -3
  36. package/dist/formField/components/formFieldWithoutLabel.d.ts +8 -9
  37. package/dist/formField/components/formFieldWithoutLabel.js +6 -1
  38. package/dist/formField/components/isOldFormFieldComponent.d.ts +2 -0
  39. package/dist/formField/components/isOldFormFieldComponent.js +12 -0
  40. package/dist/formField/components/trailingComponent.d.ts +2 -1
  41. package/dist/formField/components/trailingComponent.js +7 -1
  42. package/dist/formField/formField.d.ts +17 -35
  43. package/dist/formField/formField.js +4 -71
  44. package/dist/formField/hooks/useContainer.d.ts +2 -0
  45. package/dist/formField/hooks/useContainer.js +47 -0
  46. package/dist/formField/hooks/useError.d.ts +1 -1
  47. package/dist/formField/hooks/useFormFieldClasses.d.ts +2 -0
  48. package/dist/formField/hooks/useFormFieldClasses.js +30 -0
  49. package/dist/formField/hooks/useFormFieldProps.d.ts +17 -0
  50. package/dist/formField/hooks/useFormFieldProps.js +37 -0
  51. package/dist/formField/hooks/useTrailing.d.ts +1 -1
  52. package/dist/formField/hooks/useTrailing.js +1 -1
  53. package/dist/formField/hooks/useWidth.d.ts +1 -1
  54. package/dist/formField/types.d.ts +35 -0
  55. package/dist/formField/types.js +2 -0
  56. package/dist/formGroup/components/formGroupList.d.ts +1 -1
  57. package/dist/formGroup/components/formGroupToggle.d.ts +1 -1
  58. package/dist/formGroup/formGroup.d.ts +1 -1
  59. package/dist/formGroup/hooks/useLabelAlign.d.ts +1 -1
  60. package/dist/formGroup/types.d.ts +1 -1
  61. package/dist/formGroup/utils/applyCustomControlClasses.d.ts +1 -1
  62. package/dist/formGroup/utils/applyCustomLabelClasses.d.ts +1 -1
  63. package/dist/formGroup/utils/getControlClasses/getControlClasses.d.ts +1 -1
  64. package/dist/formGroup/utils/getControlClasses/getOneLabelOneControlClasses.d.ts +1 -1
  65. package/dist/formGroup/utils/getControlClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
  66. package/dist/formGroup/utils/getControlClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
  67. package/dist/formGroup/utils/getControlClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
  68. package/dist/formGroup/utils/getLabelClasses/getLabelClasses.d.ts +1 -1
  69. package/dist/formGroup/utils/getLabelClasses/getOneLabelOneControlClasses.d.ts +1 -1
  70. package/dist/formGroup/utils/getLabelClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
  71. package/dist/formGroup/utils/getLabelClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
  72. package/dist/formGroup/utils/getLabelClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
  73. package/dist/formGroup/utils/getListClasses.d.ts +1 -1
  74. package/dist/formGroup/utils/getToggleClasses.d.ts +1 -1
  75. package/dist/formGroup/utils/initializeState.d.ts +1 -1
  76. package/dist/formGroup/utils/isTopAlign.d.ts +1 -1
  77. package/dist/formLayout/types.d.ts +1 -1
  78. package/dist/formSection/types.d.ts +1 -1
  79. package/dist/formSection/utils/formSectionProvider.d.ts +1 -1
  80. package/dist/groupButtonRaw/groupButtonRaw.d.ts +1 -1
  81. package/dist/groupsFilterRaw/groupsFilterRaw.d.ts +1 -1
  82. package/dist/groupsFilterRaw/groupsHelper.js +2 -2
  83. package/dist/headerTitle/headerTitle.js +1 -1
  84. package/dist/images/imageAdjustFilter.d.ts +4 -0
  85. package/dist/images/imageAdjustFilter.js +16 -0
  86. package/dist/images/imageNoMatchingAssets.d.ts +4 -0
  87. package/dist/images/imageNoMatchingAssets.js +16 -0
  88. package/dist/index.css +619 -524
  89. package/dist/index.d.ts +6 -2
  90. package/dist/index.js +23 -16
  91. package/dist/inputAdornments/inputAdornments.d.ts +2 -1
  92. package/dist/inputAdornments/inputAdornments.js +2 -2
  93. package/dist/layout/layout.js +11 -7
  94. package/dist/list/itemData/itemData.d.ts +1 -0
  95. package/dist/list/itemData/itemDataInternal.d.ts +2 -1
  96. package/dist/list/itemData/itemDataInternal.js +4 -2
  97. package/dist/list/itemData/itemDataWaiting.d.ts +2 -1
  98. package/dist/list/itemData/itemDataWaiting.js +4 -1
  99. package/dist/list/list.d.ts +13 -4
  100. package/dist/list/list.js +29 -12
  101. package/dist/list/utils/getLoadingItems.d.ts +1 -1
  102. package/dist/list/utils/getLoadingItems.js +4 -4
  103. package/dist/modal/modal.js +7 -0
  104. package/dist/pillExpandable/pillExpandable.d.ts +1 -0
  105. package/dist/pillExpandable/pillExpandable.js +74 -33
  106. package/dist/radioGroupRaw/radioGroupRaw.d.ts +1 -1
  107. package/dist/rangeRaw/rangeRaw.d.ts +1 -1
  108. package/dist/summary/summary.js +0 -1
  109. package/dist/summaryTile/summaryTile.js +2 -2
  110. package/dist/table/children/tableEmpty.d.ts +1 -1
  111. package/dist/table/children/useTableChildren.js +1 -1
  112. package/dist/timePickerRaw/timePickerRaw.d.ts +1 -1
  113. package/dist/tooltip/tooltip.d.ts +15 -4
  114. package/dist/tooltip/tooltip.js +421 -158
  115. package/dist/utils/localization/translations/cs.json +2 -1
  116. package/dist/utils/localization/translations/da-DK.json +2 -1
  117. package/dist/utils/localization/translations/de.json +2 -1
  118. package/dist/utils/localization/translations/en.json +2 -1
  119. package/dist/utils/localization/translations/es.json +3 -2
  120. package/dist/utils/localization/translations/fi-FI.json +2 -1
  121. package/dist/utils/localization/translations/fr-FR.json +2 -1
  122. package/dist/utils/localization/translations/fr.json +3 -2
  123. package/dist/utils/localization/translations/hu-HU.json +2 -1
  124. package/dist/utils/localization/translations/id.json +2 -1
  125. package/dist/utils/localization/translations/it.json +2 -1
  126. package/dist/utils/localization/translations/ja.json +2 -1
  127. package/dist/utils/localization/translations/ko-KR.json +2 -1
  128. package/dist/utils/localization/translations/ms.json +2 -1
  129. package/dist/utils/localization/translations/nb-NO.json +2 -1
  130. package/dist/utils/localization/translations/nl.json +2 -1
  131. package/dist/utils/localization/translations/pl.json +2 -1
  132. package/dist/utils/localization/translations/pt-BR.json +2 -1
  133. package/dist/utils/localization/translations/sk-SK.json +2 -1
  134. package/dist/utils/localization/translations/sv.json +2 -1
  135. package/dist/utils/localization/translations/th.json +2 -1
  136. package/dist/utils/localization/translations/tr.json +2 -1
  137. package/dist/utils/localization/translations/zh-Hans.json +2 -1
  138. package/dist/utils/localization/translations/zh-TW.json +2 -1
  139. package/dist/utils/positioningUtils/calculatePosition.d.ts +1 -1
  140. package/dist/utils/positioningUtils/calculatePosition.js +11 -1
  141. package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +1 -1
  142. package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +0 -39
  143. package/esm/alertRaw/components/alertAnimation.js +8 -4
  144. package/esm/card/card.d.ts +1 -1
  145. package/esm/card/card.js +1 -3
  146. package/esm/card/components/status.js +2 -2
  147. package/esm/chart/barChart/getBarTooltipItems.js +31 -2
  148. package/esm/chart/barChart.js +2 -1
  149. package/esm/chart/utils/getYAxisMeta.d.ts +1 -1
  150. package/esm/chart/utils/getYAxisMeta.js +44 -1
  151. package/esm/checkbox/checkbox.js +3 -3
  152. package/esm/dataGrid/emptySearchList/emptySearchList.d.ts +6 -7
  153. package/esm/dataGrid/emptySearchList/emptySearchList.js +16 -24
  154. package/esm/dateInputRaw/dateInputRaw.d.ts +1 -1
  155. package/esm/dateRangeRaw/dateRangeRaw.d.ts +1 -1
  156. package/esm/dateRangeRaw/utils/dateRangeUtils.d.ts +1 -0
  157. package/esm/dateRangeRaw/utils/dateRangeUtils.js +37 -0
  158. package/esm/dropdownRaw/dropdownRaw.d.ts +1 -1
  159. package/esm/emptyState/emptyState.d.ts +9 -0
  160. package/esm/emptyState/emptyState.js +10 -0
  161. package/esm/emptyState/hooks/useIcon.d.ts +2 -0
  162. package/esm/emptyState/hooks/useIcon.js +10 -0
  163. package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.d.ts +1 -0
  164. package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +29 -4
  165. package/esm/formField/components/formFieldAdditionalInfo.d.ts +12 -0
  166. package/esm/formField/components/formFieldAdditionalInfo.js +6 -0
  167. package/esm/formField/components/formFieldAssistiveError.d.ts +10 -0
  168. package/esm/formField/components/formFieldAssistiveError.js +8 -0
  169. package/esm/formField/components/formFieldCounter.d.ts +6 -0
  170. package/esm/formField/components/formFieldCounter.js +3 -0
  171. package/esm/formField/components/formFieldLoading.d.ts +12 -0
  172. package/esm/formField/components/formFieldLoading.js +12 -0
  173. package/esm/formField/components/formFieldWithLabel.d.ts +8 -11
  174. package/esm/formField/components/formFieldWithLabel.js +21 -3
  175. package/esm/formField/components/formFieldWithoutLabel.d.ts +8 -9
  176. package/esm/formField/components/formFieldWithoutLabel.js +6 -1
  177. package/esm/formField/components/isOldFormFieldComponent.d.ts +2 -0
  178. package/esm/formField/components/isOldFormFieldComponent.js +8 -0
  179. package/esm/formField/components/trailingComponent.d.ts +2 -1
  180. package/esm/formField/components/trailingComponent.js +7 -1
  181. package/esm/formField/formField.d.ts +17 -35
  182. package/esm/formField/formField.js +5 -72
  183. package/esm/formField/hooks/useContainer.d.ts +2 -0
  184. package/esm/formField/hooks/useContainer.js +43 -0
  185. package/esm/formField/hooks/useError.d.ts +1 -1
  186. package/esm/formField/hooks/useFormFieldClasses.d.ts +2 -0
  187. package/esm/formField/hooks/useFormFieldClasses.js +26 -0
  188. package/esm/formField/hooks/useFormFieldProps.d.ts +17 -0
  189. package/esm/formField/hooks/useFormFieldProps.js +33 -0
  190. package/esm/formField/hooks/useTrailing.d.ts +1 -1
  191. package/esm/formField/hooks/useTrailing.js +1 -1
  192. package/esm/formField/hooks/useWidth.d.ts +1 -1
  193. package/esm/formField/types.d.ts +35 -0
  194. package/esm/formField/types.js +1 -0
  195. package/esm/formGroup/components/formGroupList.d.ts +1 -1
  196. package/esm/formGroup/components/formGroupToggle.d.ts +1 -1
  197. package/esm/formGroup/formGroup.d.ts +1 -1
  198. package/esm/formGroup/hooks/useLabelAlign.d.ts +1 -1
  199. package/esm/formGroup/types.d.ts +1 -1
  200. package/esm/formGroup/utils/applyCustomControlClasses.d.ts +1 -1
  201. package/esm/formGroup/utils/applyCustomLabelClasses.d.ts +1 -1
  202. package/esm/formGroup/utils/getControlClasses/getControlClasses.d.ts +1 -1
  203. package/esm/formGroup/utils/getControlClasses/getOneLabelOneControlClasses.d.ts +1 -1
  204. package/esm/formGroup/utils/getControlClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
  205. package/esm/formGroup/utils/getControlClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
  206. package/esm/formGroup/utils/getControlClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
  207. package/esm/formGroup/utils/getLabelClasses/getLabelClasses.d.ts +1 -1
  208. package/esm/formGroup/utils/getLabelClasses/getOneLabelOneControlClasses.d.ts +1 -1
  209. package/esm/formGroup/utils/getLabelClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
  210. package/esm/formGroup/utils/getLabelClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
  211. package/esm/formGroup/utils/getLabelClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
  212. package/esm/formGroup/utils/getListClasses.d.ts +1 -1
  213. package/esm/formGroup/utils/getToggleClasses.d.ts +1 -1
  214. package/esm/formGroup/utils/initializeState.d.ts +1 -1
  215. package/esm/formGroup/utils/isTopAlign.d.ts +1 -1
  216. package/esm/formLayout/types.d.ts +1 -1
  217. package/esm/formSection/types.d.ts +1 -1
  218. package/esm/formSection/utils/formSectionProvider.d.ts +1 -1
  219. package/esm/groupButtonRaw/groupButtonRaw.d.ts +1 -1
  220. package/esm/groupsFilterRaw/groupsFilterRaw.d.ts +1 -1
  221. package/esm/groupsFilterRaw/groupsHelper.js +2 -2
  222. package/esm/headerTitle/headerTitle.js +1 -1
  223. package/esm/images/imageAdjustFilter.d.ts +4 -0
  224. package/esm/images/imageAdjustFilter.js +12 -0
  225. package/esm/images/imageNoMatchingAssets.d.ts +4 -0
  226. package/esm/images/imageNoMatchingAssets.js +12 -0
  227. package/esm/index.d.ts +6 -2
  228. package/esm/index.js +4 -1
  229. package/esm/inputAdornments/inputAdornments.d.ts +2 -1
  230. package/esm/inputAdornments/inputAdornments.js +2 -2
  231. package/esm/layout/layout.js +11 -7
  232. package/esm/list/itemData/itemData.d.ts +1 -0
  233. package/esm/list/itemData/itemDataInternal.d.ts +2 -1
  234. package/esm/list/itemData/itemDataInternal.js +4 -2
  235. package/esm/list/itemData/itemDataWaiting.d.ts +2 -1
  236. package/esm/list/itemData/itemDataWaiting.js +4 -1
  237. package/esm/list/list.d.ts +13 -4
  238. package/esm/list/list.js +29 -12
  239. package/esm/list/utils/getLoadingItems.d.ts +1 -1
  240. package/esm/list/utils/getLoadingItems.js +4 -4
  241. package/esm/modal/modal.js +7 -0
  242. package/esm/pillExpandable/pillExpandable.d.ts +1 -0
  243. package/esm/pillExpandable/pillExpandable.js +74 -33
  244. package/esm/radioGroupRaw/radioGroupRaw.d.ts +1 -1
  245. package/esm/rangeRaw/rangeRaw.d.ts +1 -1
  246. package/esm/summary/summary.js +0 -1
  247. package/esm/summaryTile/summaryTile.js +2 -2
  248. package/esm/table/children/tableEmpty.d.ts +1 -1
  249. package/esm/table/children/useTableChildren.js +1 -1
  250. package/esm/timePickerRaw/timePickerRaw.d.ts +1 -1
  251. package/esm/tooltip/tooltip.d.ts +15 -4
  252. package/esm/tooltip/tooltip.js +388 -138
  253. package/esm/utils/localization/translations/cs.json +2 -1
  254. package/esm/utils/localization/translations/da-DK.json +2 -1
  255. package/esm/utils/localization/translations/de.json +2 -1
  256. package/esm/utils/localization/translations/en.json +2 -1
  257. package/esm/utils/localization/translations/es.json +3 -2
  258. package/esm/utils/localization/translations/fi-FI.json +2 -1
  259. package/esm/utils/localization/translations/fr-FR.json +2 -1
  260. package/esm/utils/localization/translations/fr.json +3 -2
  261. package/esm/utils/localization/translations/hu-HU.json +2 -1
  262. package/esm/utils/localization/translations/id.json +2 -1
  263. package/esm/utils/localization/translations/it.json +2 -1
  264. package/esm/utils/localization/translations/ja.json +2 -1
  265. package/esm/utils/localization/translations/ko-KR.json +2 -1
  266. package/esm/utils/localization/translations/ms.json +2 -1
  267. package/esm/utils/localization/translations/nb-NO.json +2 -1
  268. package/esm/utils/localization/translations/nl.json +2 -1
  269. package/esm/utils/localization/translations/pl.json +2 -1
  270. package/esm/utils/localization/translations/pt-BR.json +2 -1
  271. package/esm/utils/localization/translations/sk-SK.json +2 -1
  272. package/esm/utils/localization/translations/sv.json +2 -1
  273. package/esm/utils/localization/translations/th.json +2 -1
  274. package/esm/utils/localization/translations/tr.json +2 -1
  275. package/esm/utils/localization/translations/zh-Hans.json +2 -1
  276. package/esm/utils/localization/translations/zh-TW.json +2 -1
  277. package/esm/utils/positioningUtils/calculatePosition.d.ts +1 -1
  278. package/esm/utils/positioningUtils/calculatePosition.js +11 -1
  279. package/package.json +1 -1
@@ -1,30 +1,92 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
2
+
3
+ const {
4
+ injectString
5
+ } = require("../utils/localization/translationsDictionary");
6
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = {
11
+ enumerable: true,
12
+ get: function () {
13
+ return m[k];
14
+ }
15
+ };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ } : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
17
21
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
22
+ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
23
+ Object.defineProperty(o, "default", {
24
+ enumerable: true,
25
+ value: v
26
+ });
27
+ } : function (o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = this && this.__importStar || function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
34
+ __setModuleDefault(result, mod);
35
+ return result;
24
36
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
37
+ Object.defineProperty(exports, "__esModule", {
38
+ value: true
39
+ });
26
40
  exports.Tooltip = void 0;
27
41
  const jsx_runtime_1 = require("react/jsx-runtime");
42
+ injectString("cs", "Information", "Informace");
43
+ injectString("da-DK", "Information", "Information");
44
+ injectString("de", "Information", "Information");
45
+ injectString("en", "Information", "Information");
46
+ injectString("es", "Information", "Informaci\xF3n");
47
+ injectString("fi-FI", "Information", "Tiedot");
48
+ injectString("fr", "Information", "Renseignements");
49
+ injectString("fr-FR", "Information", "Informations");
50
+ injectString("hu-HU", "Information", "Inform\xE1ci\xF3");
51
+ injectString("id", "Information", "Informasi");
52
+ injectString("it", "Information", "Informazioni");
53
+ injectString("ja", "Information", "\u60C5\u5831");
54
+ injectString("ko-KR", "Information", "\uC815\uBCF4");
55
+ injectString("ms", "Information", "Maklumat");
56
+ injectString("nb-NO", "Information", "Informasjon");
57
+ injectString("nl", "Information", "Informatie");
58
+ injectString("pl", "Information", "Informacje");
59
+ injectString("pt-BR", "Information", "Informa\xE7\xF5es");
60
+ injectString("sk-SK", "Information", "Inform\xE1cie");
61
+ injectString("sv", "Information", "Information");
62
+ injectString("th", "Information", "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25");
63
+ injectString("tr", "Information", "Bilgi");
64
+ injectString("zh-Hans", "Information", "\u4FE1\u606F");
65
+ injectString("zh-TW", "Information", "\u8CC7\u8A0A");
66
+ injectString("cs", "Close", "Zav\u0159\xEDt");
67
+ injectString("da-DK", "Close", "Luk");
68
+ injectString("de", "Close", "Schlie\xDFen");
69
+ injectString("en", "Close", "Close");
70
+ injectString("es", "Close", "Cerrar");
71
+ injectString("fi-FI", "Close", "Sulje");
72
+ injectString("fr", "Close", "Fermer");
73
+ injectString("fr-FR", "Close", "Fermer");
74
+ injectString("hu-HU", "Close", "Z\xE1rd be.");
75
+ injectString("id", "Close", "Tutup");
76
+ injectString("it", "Close", "Chiudere");
77
+ injectString("ja", "Close", "\u9589\u3058\u308B");
78
+ injectString("ko-KR", "Close", "\uB2EB\uAE30");
79
+ injectString("ms", "Close", "Tutup");
80
+ injectString("nb-NO", "Close", "Lukk");
81
+ injectString("nl", "Close", "Sluiten");
82
+ injectString("pl", "Close", "Zamknij");
83
+ injectString("pt-BR", "Close", "Fechar");
84
+ injectString("sk-SK", "Close", "Zatvor");
85
+ injectString("sv", "Close", "St\xE4ng");
86
+ injectString("th", "Close", "\u0E1B\u0E34\u0E14");
87
+ injectString("tr", "Close", "Kapat");
88
+ injectString("zh-Hans", "Close", "\u5173\u95ED");
89
+ injectString("zh-TW", "Close", "\u95DC\u9589");
28
90
  const react_1 = __importStar(require("react"));
29
91
  const useResize_1 = require("../commonHelpers/hooks/useResize");
30
92
  const calculatePosition_1 = require("../utils/positioningUtils/calculatePosition");
@@ -33,149 +95,350 @@ const classNames_1 = require("../commonHelpers/classNames/classNames");
33
95
  const calculateArrowPosition_1 = require("./helpers/calculateArrowPosition");
34
96
  const deviceType_1 = require("../commonHelpers/hooks/deviceType");
35
97
  const useDeviceType_1 = require("../commonHelpers/hooks/useDeviceType");
36
- const mobileSheet_1 = require("../mobileSheet/mobileSheet");
37
98
  const themeContext_1 = require("../utils/theme/themeContext");
38
99
  const tooltipAlignments_1 = require("../utils/positioningUtils/tooltipAlignments");
39
- const TOOLTIP_ARROW_HEIGHT = 6;
100
+ const iconClose_1 = require("../icons/iconClose");
101
+ const button_1 = require("../button/button");
102
+ const useLanguage_1 = require("../utils/localization/useLanguage");
103
+ const iconInfoCircle_1 = require("../icons/iconInfoCircle");
104
+ const useDrive_1 = require("../utils/theme/useDrive");
105
+ const shield_1 = require("../shield/shield");
40
106
  const TOOLTIP_VISIBILITY_DELAY = 100;
41
107
  const arrowClasses = {
42
- "top": "zen-tooltip__arrow--top",
43
- "top-left": "zen-tooltip__arrow--top",
44
- "top-right": "zen-tooltip__arrow--top",
45
- "bottom": "zen-tooltip__arrow--bottom",
46
- "bottom-left": "zen-tooltip__arrow--bottom",
47
- "bottom-right": "zen-tooltip__arrow--bottom",
48
- "right": "zen-tooltip__arrow--right",
49
- "right-top": "zen-tooltip__arrow--right",
50
- "right-bottom": "zen-tooltip__arrow--right",
51
- "left": "zen-tooltip__arrow--left",
52
- "left-top": "zen-tooltip__arrow--left",
53
- "left-bottom": "zen-tooltip__arrow--left"
108
+ "top": "zen-tooltip__arrow--top",
109
+ "top-left": "zen-tooltip__arrow--top",
110
+ "top-right": "zen-tooltip__arrow--top",
111
+ "bottom": "zen-tooltip__arrow--bottom",
112
+ "bottom-left": "zen-tooltip__arrow--bottom",
113
+ "bottom-right": "zen-tooltip__arrow--bottom",
114
+ "right": "zen-tooltip__arrow--right",
115
+ "right-top": "zen-tooltip__arrow--right",
116
+ "right-bottom": "zen-tooltip__arrow--right",
117
+ "left": "zen-tooltip__arrow--left",
118
+ "left-top": "zen-tooltip__arrow--left",
119
+ "left-bottom": "zen-tooltip__arrow--left"
54
120
  };
55
- const Tooltip = ({ trigger, className = "", size = "small", alignment = "bottom", padding = 0, children, mobileView = "default", mobileSheetTitle }) => {
56
- const triggerRefNative = trigger.props.ref;
57
- const triggerLocalRef = (0, react_1.useRef)(null);
58
- const triggerRef = triggerRefNative || triggerLocalRef;
59
- const timerRef = (0, react_1.useRef)(null);
60
- const timerMouseOutRef = (0, react_1.useRef)(null);
61
- const tooltipRef = (0, react_1.useRef)(null);
62
- const arrowRef = (0, react_1.useRef)(null);
63
- const [isTooltipVisible, setTooltipVisible] = (0, react_1.useState)(false);
64
- const [deviceType, setDeviceType] = (0, react_1.useState)(deviceType_1.DeviceType.Desktop);
65
- const tooltipId = (0, react_1.useId)();
66
- const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
67
- (0, useDeviceType_1.useDeviceType)(setDeviceType);
68
- const onKeyDownHandler = (0, react_1.useCallback)((e) => {
69
- if (e.code === "Escape") {
70
- setTooltipVisible(false);
71
- }
72
- }, []);
73
- const triggerEvents = (0, react_1.useMemo)(() => {
74
- if (deviceType === deviceType_1.DeviceType.Desktop) {
75
- return {
76
- onMouseOver: () => {
77
- setTooltipVisible(true);
78
- timerMouseOutRef.current && clearTimeout(timerMouseOutRef.current);
79
- },
80
- onMouseLeave: () => {
81
- timerRef.current = setTimeout(() => {
82
- setTooltipVisible(false);
83
- }, TOOLTIP_VISIBILITY_DELAY);
84
- },
85
- onFocus: () => setTooltipVisible(true),
86
- onBlur: () => setTooltipVisible(false),
87
- onKeyDown: onKeyDownHandler,
88
- onClick: (...args) => {
89
- const triggerProps = trigger.props;
90
- if (triggerProps.onClick) {
91
- triggerProps.onClick(...args);
92
- }
93
- if (isTooltipVisible) {
94
- setTooltipVisible(false);
95
- }
96
- }
97
- };
98
- }
99
- if (mobileView === "mobileSheet") {
100
- return {
101
- onClick: () => setTooltipVisible(true)
102
- };
103
- }
104
- return {
105
- onClick: (e) => {
106
- e.stopPropagation();
107
- const triggerProps = trigger.props;
108
- if (triggerProps.onClick) {
109
- triggerProps.onClick(e);
110
- }
111
- else {
112
- setTooltipVisible(isVisible => !isVisible);
113
- }
114
- },
115
- onTouchStart: () => setTooltipVisible(true),
116
- onTouchEnd: () => setTooltipVisible(false)
117
- };
118
- }, [deviceType, mobileView, onKeyDownHandler, trigger.props, isTooltipVisible]);
119
- const triggerCloneProps = isTooltipVisible ? {
120
- "aria-describedby": tooltipId
121
- } : {};
122
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
123
- const triggerClone = react_1.default.cloneElement(trigger, Object.assign(Object.assign({ ref: triggerRef }, triggerCloneProps), triggerEvents
124
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
125
- ));
126
- const arrowClass = (0, react_1.useMemo)(() => arrowClasses[alignment] || arrowClasses.bottom, [alignment]);
127
- const renderTooltip = () => {
128
- if (mobileView === "mobileSheet" && deviceType === deviceType_1.DeviceType.Mobile) {
129
- return (0, jsx_runtime_1.jsxs)(mobileSheet_1.MobileSheet, { onHidePanel: () => {
130
- var _a;
131
- setTooltipVisible(false);
132
- (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
133
- }, triggerRef: triggerRef, label: "", isOpen: isTooltipVisible, onCloseClick: () => {
134
- var _a;
135
- setTooltipVisible(false);
136
- (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
137
- }, children: [(0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Content, { className: "zen-tooltip__mobile-sheet-content", children: children }), (0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Title, { children: mobileSheetTitle })] });
121
+ const getInitialDeviceType = () => {
122
+ if (typeof window !== "undefined") {
123
+ return (0, useDeviceType_1.getDeviceType)(window.innerWidth);
124
+ }
125
+ return deviceType_1.DeviceType.Desktop;
126
+ };
127
+ const EventWrapper = ({
128
+ children,
129
+ deviceType,
130
+ onKeyDownHandler,
131
+ handleUniversalClick,
132
+ setTooltipVisible,
133
+ timerRef,
134
+ timerMouseOutRef
135
+ }) => {
136
+ const isCurrentDeviceDesktop = deviceType === deviceType_1.DeviceType.Desktop;
137
+ const originalOnClick = children.props.onClick;
138
+ const composedOnClick = (0, react_1.useCallback)(e => {
139
+ // Call original onClick first if it exists
140
+ if (originalOnClick) {
141
+ originalOnClick(e);
142
+ }
143
+ // Then call tooltip's click handler
144
+ handleUniversalClick(e);
145
+ }, [originalOnClick, handleUniversalClick]);
146
+ const desktopEvents = {
147
+ onMouseOver: () => {
148
+ setTooltipVisible(true);
149
+ timerMouseOutRef.current && clearTimeout(timerMouseOutRef.current);
150
+ },
151
+ onMouseLeave: () => {
152
+ timerRef.current = setTimeout(() => {
153
+ setTooltipVisible(false);
154
+ }, TOOLTIP_VISIBILITY_DELAY);
155
+ },
156
+ onFocus: () => setTooltipVisible(true),
157
+ onBlur: () => setTooltipVisible(false),
158
+ onKeyDown: onKeyDownHandler,
159
+ onClick: composedOnClick
160
+ };
161
+ const mobileOnKeyDown = (0, react_1.useCallback)(e => {
162
+ if (e.key === "Enter") {
163
+ handleUniversalClick(undefined);
164
+ }
165
+ }, [handleUniversalClick]);
166
+ const mobileEvents = {
167
+ onClick: composedOnClick,
168
+ onKeyDown: mobileOnKeyDown
169
+ };
170
+ const propsToApply = isCurrentDeviceDesktop ? desktopEvents : mobileEvents;
171
+ return react_1.default.cloneElement(children, propsToApply);
172
+ };
173
+ const Tooltip = ({
174
+ trigger,
175
+ triggerClassName,
176
+ className = "",
177
+ alignment,
178
+ children,
179
+ mobileSheetTitle,
180
+ mobileTitle
181
+ }) => {
182
+ const GAP = 12;
183
+ const isDrive = (0, useDrive_1.useDrive)();
184
+ const triggerRefNative = trigger === null || trigger === void 0 ? void 0 : trigger.ref;
185
+ const triggerLocalRef = (0, react_1.useRef)(null);
186
+ const triggerRef = triggerRefNative || triggerLocalRef;
187
+ const timerRef = (0, react_1.useRef)(null);
188
+ const timerMouseOutRef = (0, react_1.useRef)(null);
189
+ const tooltipRef = (0, react_1.useRef)(null);
190
+ const arrowRef = (0, react_1.useRef)(null);
191
+ const [isTooltipVisible, setTooltipVisible] = (0, react_1.useState)(false);
192
+ const [deviceType, setDeviceType] = (0, react_1.useState)(getInitialDeviceType);
193
+ const isMobile = deviceType === deviceType_1.DeviceType.Mobile;
194
+ const tooltipId = (0, react_1.useId)();
195
+ const {
196
+ translate
197
+ } = (0, useLanguage_1.useLanguage)();
198
+ const {
199
+ dark
200
+ } = (0, react_1.useContext)(themeContext_1.themeContext);
201
+ const tooltipAlignment = (0, react_1.useMemo)(() => isMobile ? "bottom" : alignment || "right", [isMobile, alignment]);
202
+ const TOOLTIP_ARROW_HEIGHT = (0, react_1.useMemo)(() => isMobile || isDrive ? 0 : 6, [isMobile, isDrive]);
203
+ const tooltipAlignmentRef = (0, react_1.useRef)(tooltipAlignment);
204
+ tooltipAlignmentRef.current = tooltipAlignment;
205
+ const setDeviceTypeStable = (0, react_1.useCallback)(newType => {
206
+ setDeviceType(currentDeviceType => newType !== currentDeviceType ? newType : currentDeviceType);
207
+ }, []);
208
+ const setDeviceTypeConditional = (0, react_1.useCallback)(newType => {
209
+ setTooltipVisible(currentVisible => {
210
+ if (!currentVisible) {
211
+ setDeviceTypeStable(newType);
212
+ }
213
+ return currentVisible;
214
+ });
215
+ }, [setDeviceTypeStable]);
216
+ (0, useDeviceType_1.useDeviceType)(setDeviceTypeConditional);
217
+ const onKeyDownHandler = e => {
218
+ if (e.code === "Escape") {
219
+ setTooltipVisible(false);
220
+ }
221
+ };
222
+ const handleUniversalClick = (0, react_1.useCallback)(e => {
223
+ const hasExternalClickHandler = !!(trigger === null || trigger === void 0 ? void 0 : trigger.props.onClick);
224
+ if (deviceType === deviceType_1.DeviceType.Desktop) {
225
+ setTooltipVisible(currentVisible => {
226
+ if (currentVisible) {
227
+ return false;
138
228
  }
139
- return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { id: tooltipId, role: "tooltip", ref: tooltipRef, className: (0, classNames_1.classNames)(["zen-tooltip", dark ? "zen-dark" : "", `zen-tooltip--${size}`, className]), onMouseOver: () => {
140
- timerRef.current && clearTimeout(timerRef.current);
141
- timerMouseOutRef.current && clearTimeout(timerMouseOutRef.current);
142
- }, onMouseOut: () => {
143
- timerMouseOutRef.current = setTimeout(() => setTooltipVisible(false), TOOLTIP_VISIBILITY_DELAY);
144
- }, children: [(0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-tooltip__arrow", arrowClass]), ref: arrowRef }), (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-tooltip__body", `zen-tooltip__body--${size}`]), children: children })] }), document.fullscreenElement || document.body);
229
+ return currentVisible;
230
+ });
231
+ } else {
232
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
233
+ if (!hasExternalClickHandler) {
234
+ setTooltipVisible(isVisible => !isVisible);
235
+ }
236
+ }
237
+ }, [trigger === null || trigger === void 0 ? void 0 : trigger.props, deviceType]);
238
+ const triggerCloneProps = (0, react_1.useMemo)(() => isTooltipVisible ? {
239
+ "aria-describedby": tooltipId
240
+ } : {}, [isTooltipVisible, tooltipId]);
241
+ const tooltipTrigger = (0, react_1.useMemo)(() => trigger ? trigger : (0, jsx_runtime_1.jsx)("button", {
242
+ tabIndex: 0,
243
+ type: "button",
244
+ className: "zen-tooltip__trigger-container",
245
+ "aria-label": translate("Information"),
246
+ children: (0, react_1.createElement)(iconInfoCircle_1.IconInfoCircle, {
247
+ size: isMobile ? "huge" : "large",
248
+ className: (0, classNames_1.classNames)([triggerClassName || "", "zen-tooltip__trigger"])
249
+ })
250
+ }), [trigger, isMobile, triggerClassName, translate]);
251
+ const triggerClone = (0, jsx_runtime_1.jsx)(EventWrapper, {
252
+ deviceType: deviceType,
253
+ isTooltipVisible: isTooltipVisible,
254
+ onKeyDownHandler: onKeyDownHandler,
255
+ handleUniversalClick: handleUniversalClick,
256
+ setTooltipVisible: setTooltipVisible,
257
+ timerRef: timerRef,
258
+ timerMouseOutRef: timerMouseOutRef,
259
+ children: react_1.default.cloneElement(tooltipTrigger, Object.assign({
260
+ ref: triggerRef
261
+ }, triggerCloneProps))
262
+ });
263
+ // Initial arrow class - will be updated by calculatePosition
264
+ const arrowClass = (0, react_1.useMemo)(() => arrowClasses[tooltipAlignment], [tooltipAlignment]);
265
+ const getOppositeAlignment = main => {
266
+ switch (main) {
267
+ case "right":
268
+ return "left";
269
+ case "left":
270
+ return "right";
271
+ case "top":
272
+ return "bottom";
273
+ case "bottom":
274
+ return "top";
275
+ default:
276
+ return main;
277
+ }
278
+ };
279
+ const checkNaturalFit = (0, react_1.useCallback)((rawPosition, popupRect) => {
280
+ const docWidth = window.innerWidth + window.scrollX;
281
+ const docHeight = window.innerHeight + window.scrollY;
282
+ // Check horizontal fit
283
+ if (rawPosition.left !== undefined) {
284
+ if (rawPosition.left < 0 || rawPosition.left + popupRect.width > docWidth) {
285
+ return false;
286
+ }
287
+ } else if (rawPosition.right !== undefined) {
288
+ if (docWidth - rawPosition.right < popupRect.width) {
289
+ return false;
290
+ }
291
+ }
292
+ // Check vertical fit
293
+ if (rawPosition.top !== undefined) {
294
+ if (rawPosition.top < 0 || rawPosition.top + popupRect.height > docHeight) {
295
+ return false;
296
+ }
297
+ } else if (rawPosition.bottom !== undefined) {
298
+ if (docHeight - rawPosition.bottom < popupRect.height) {
299
+ return false;
300
+ }
301
+ }
302
+ return true;
303
+ }, []);
304
+ const getEffectiveAlignment = (0, react_1.useCallback)(preferredAlignment => {
305
+ if (isMobile) {
306
+ return preferredAlignment;
307
+ }
308
+ const triggerEl = triggerRef.current;
309
+ const popupEl = tooltipRef.current;
310
+ if (!triggerEl || !popupEl) {
311
+ return preferredAlignment;
312
+ }
313
+ const triggerRect = triggerEl.getBoundingClientRect();
314
+ const popupRect = popupEl.getBoundingClientRect();
315
+ const parentRect = {
316
+ top: 0,
317
+ left: 0,
318
+ right: window.innerWidth,
319
+ bottom: window.innerHeight,
320
+ width: window.innerWidth,
321
+ height: window.innerHeight
145
322
  };
146
- const calculatePosition = (0, react_1.useCallback)(() => {
147
- (0, calculatePosition_1.calculatePosition)(triggerRef, tooltipRef, TOOLTIP_ARROW_HEIGHT + padding, TOOLTIP_ARROW_HEIGHT + padding, false, alignment, tooltipAlignments_1.tooltipAlignments);
148
- (0, calculateArrowPosition_1.calculateArrowPosition)(triggerRef, tooltipRef, arrowRef, alignment);
149
- }, [alignment, padding, triggerRef]);
150
- const handleClickOutside = (0, react_1.useCallback)((event) => {
151
- var _a, _b;
152
- if (!((_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) && !((_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
323
+ const [mainAlignment, subAlignment] = preferredAlignment.split("-");
324
+ const oppositeMain = getOppositeAlignment(mainAlignment);
325
+ const preferredFn = tooltipAlignments_1.tooltipAlignments[preferredAlignment];
326
+ const rawPreferredPos = preferredFn(triggerRect, popupRect, parentRect, TOOLTIP_ARROW_HEIGHT + GAP, TOOLTIP_ARROW_HEIGHT + GAP);
327
+ if (checkNaturalFit(rawPreferredPos, popupRect)) {
328
+ return preferredAlignment;
329
+ }
330
+ const fallbackAlignment = subAlignment ? `${oppositeMain}-${subAlignment}` : oppositeMain;
331
+ const fallbackFn = tooltipAlignments_1.tooltipAlignments[fallbackAlignment];
332
+ const rawFallbackPos = fallbackFn(triggerRect, popupRect, parentRect, TOOLTIP_ARROW_HEIGHT + GAP, TOOLTIP_ARROW_HEIGHT + GAP);
333
+ if (checkNaturalFit(rawFallbackPos, popupRect)) {
334
+ return fallbackAlignment;
335
+ }
336
+ return preferredAlignment;
337
+ }, [isMobile, TOOLTIP_ARROW_HEIGHT, triggerRef, checkNaturalFit]);
338
+ const renderTooltip = () => {
339
+ if (!isTooltipVisible) {
340
+ return "";
341
+ }
342
+ const content = (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
343
+ children: [isMobile && (0, jsx_runtime_1.jsx)(shield_1.Shield, {
344
+ className: "zen-tooltip__shield"
345
+ }), (0, jsx_runtime_1.jsxs)("div", {
346
+ id: tooltipId,
347
+ role: "tooltip",
348
+ ref: tooltipRef,
349
+ className: (0, classNames_1.classNames)(["zen-tooltip", dark ? "zen-dark" : "", `zen-tooltip--auto`, isMobile ? "zen-tooltip--mobile" : "", isDrive ? "zen-tooltip--drive" : "", className]),
350
+ onMouseOver: () => {
351
+ timerRef.current && clearTimeout(timerRef.current);
352
+ timerMouseOutRef.current && clearTimeout(timerMouseOutRef.current);
353
+ },
354
+ onMouseOut: () => {
355
+ timerMouseOutRef.current = setTimeout(() => {
356
+ if (!isMobile && !isDrive) {
357
+ setTooltipVisible(false);
358
+ }
359
+ }, TOOLTIP_VISIBILITY_DELAY);
360
+ },
361
+ children: [!isMobile && !isDrive && (0, jsx_runtime_1.jsx)("div", {
362
+ className: (0, classNames_1.classNames)(["zen-tooltip__arrow", arrowClass]),
363
+ ref: arrowRef
364
+ }), (0, jsx_runtime_1.jsxs)("div", {
365
+ className: (0, classNames_1.classNames)(["zen-tooltip__body", "zen-tooltip__body--auto", isDrive ? "zen-tooltip__body--drive" : "", isMobile ? "zen-tooltip__body--mobile" : "", deviceType === deviceType_1.DeviceType.Desktop && !isDrive ? "zen-tooltip__body--desktop" : ""]),
366
+ children: [(mobileSheetTitle || mobileTitle) && (deviceType === deviceType_1.DeviceType.Mobile || isDrive) && (0, jsx_runtime_1.jsx)("div", {
367
+ className: "zen-tooltip__title",
368
+ children: mobileSheetTitle || mobileTitle
369
+ }), children]
370
+ }), (deviceType === deviceType_1.DeviceType.Mobile || isDrive) && (0, jsx_runtime_1.jsx)(button_1.Button, {
371
+ className: "zen-tooltip__close-button",
372
+ title: translate("Close"),
373
+ "aria-label": translate("Close"),
374
+ onClick: () => {
375
+ var _a;
153
376
  setTooltipVisible(false);
377
+ (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
378
+ },
379
+ children: (0, jsx_runtime_1.jsx)(iconClose_1.IconClose, {
380
+ description: translate("Close"),
381
+ className: "svgIcon",
382
+ size: "huge"
383
+ })
384
+ })]
385
+ })]
386
+ });
387
+ return (0, react_dom_1.createPortal)(content, document.fullscreenElement || document.body, tooltipId);
388
+ };
389
+ const calculatePosition = (0, react_1.useCallback)(() => {
390
+ const eAlignment = getEffectiveAlignment(tooltipAlignmentRef.current);
391
+ (0, calculatePosition_1.calculatePosition)(triggerRef, tooltipRef, TOOLTIP_ARROW_HEIGHT + GAP, TOOLTIP_ARROW_HEIGHT + GAP, false, eAlignment, tooltipAlignments_1.tooltipAlignments, undefined, isMobile);
392
+ (0, calculateArrowPosition_1.calculateArrowPosition)(triggerRef, tooltipRef, arrowRef, eAlignment);
393
+ // Update arrow class directly in DOM to avoid triggering re-renders
394
+ if (arrowRef.current) {
395
+ const newArrowClass = arrowClasses[eAlignment];
396
+ arrowRef.current.className = arrowRef.current.className.replace(/zen-tooltip__arrow--\S+/g, "").trim();
397
+ if (newArrowClass) {
398
+ arrowRef.current.classList.add(newArrowClass.replace("zen-tooltip__arrow ", ""));
399
+ }
400
+ }
401
+ }, [TOOLTIP_ARROW_HEIGHT, triggerRef, tooltipRef, arrowRef, getEffectiveAlignment, isMobile]);
402
+ (0, useResize_1.useResize)(calculatePosition, isTooltipVisible);
403
+ (0, react_1.useLayoutEffect)(calculatePosition, [isTooltipVisible, calculatePosition]);
404
+ (0, react_1.useEffect)(() => {
405
+ const finalClickHandler = event => {
406
+ var _a, _b;
407
+ if (!isTooltipVisible) {
408
+ return;
409
+ }
410
+ if (deviceType === deviceType_1.DeviceType.Mobile) {
411
+ if (!((_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) && !((_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
412
+ setTooltipVisible(false);
154
413
  }
155
- }, [triggerRef]);
156
- (0, useResize_1.useResize)(calculatePosition, isTooltipVisible);
157
- (0, react_1.useLayoutEffect)(calculatePosition, [isTooltipVisible, calculatePosition]);
158
- (0, react_1.useEffect)(() => {
159
- if (deviceType === deviceType_1.DeviceType.Mobile && isTooltipVisible) {
160
- document.addEventListener("click", handleClickOutside);
161
- }
162
- return () => {
163
- document.removeEventListener("click", handleClickOutside);
164
- };
165
- }, [deviceType, isTooltipVisible, handleClickOutside]);
166
- (0, react_1.useEffect)(() => {
167
- if (deviceType === deviceType_1.DeviceType.Mobile && isTooltipVisible) {
168
- document.addEventListener("click", handleClickOutside);
169
- }
170
- return () => {
171
- document.removeEventListener("click", handleClickOutside);
172
- };
173
- }, [deviceType, isTooltipVisible, handleClickOutside]);
174
- (0, react_1.useEffect)(() => {
175
- const escapeHandler = onKeyDownHandler;
176
- document.addEventListener("keydown", escapeHandler);
177
- return () => document.removeEventListener("keydown", escapeHandler);
178
- }, [onKeyDownHandler]);
179
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isTooltipVisible && renderTooltip(), triggerClone] });
414
+ }
415
+ };
416
+ const escapeHandler = e => {
417
+ if (!isTooltipVisible) {
418
+ return;
419
+ }
420
+ if (e.code === "Escape") {
421
+ setTooltipVisible(false);
422
+ }
423
+ };
424
+ document.addEventListener("click", finalClickHandler);
425
+ document.addEventListener("keydown", escapeHandler);
426
+ return () => {
427
+ document.removeEventListener("click", finalClickHandler);
428
+ document.removeEventListener("keydown", escapeHandler);
429
+ };
430
+ }, [isTooltipVisible, deviceType, triggerRef, tooltipRef]);
431
+ // Cleanup timers and event listeners on unmount to prevent memory leaks and test issues
432
+ (0, react_1.useEffect)(() => () => {
433
+ if (timerRef.current) {
434
+ clearTimeout(timerRef.current);
435
+ }
436
+ if (timerMouseOutRef.current) {
437
+ clearTimeout(timerMouseOutRef.current);
438
+ }
439
+ }, []);
440
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
441
+ children: [isTooltipVisible && renderTooltip(), triggerClone]
442
+ });
180
443
  };
181
- exports.Tooltip = Tooltip;
444
+ exports.Tooltip = Tooltip;
@@ -248,5 +248,6 @@
248
248
  "Confirm": "Potvrdit",
249
249
  "Clear all": "Vymazat vše",
250
250
  "Reload": "Načíst znovu",
251
- "View details": "Zobrazit podrobnosti"
251
+ "View details": "Zobrazit podrobnosti",
252
+ "Year to date": "Od začátku roku"
252
253
  }
@@ -258,5 +258,6 @@
258
258
  "On": "På",
259
259
  "Off": "Slukket",
260
260
  "Reload": "Genindlæs",
261
- "View details": "Se detaljer"
261
+ "View details": "Se detaljer",
262
+ "Year to date": "År til dato"
262
263
  }
@@ -248,5 +248,6 @@
248
248
  "Confirm": "Bestätigen",
249
249
  "Clear all": "Alle löschen",
250
250
  "Reload": "Neu laden",
251
- "View details": "Details anzeigen"
251
+ "View details": "Details anzeigen",
252
+ "Year to date": "Seit Jahresbeginn"
252
253
  }
@@ -308,5 +308,6 @@
308
308
  "Details": "Details",
309
309
  "View details": "View details",
310
310
  "Selection panel": "Selection panel",
311
- "Bulk select": "Bulk select"
311
+ "Bulk select": "Bulk select",
312
+ "Year to date": "Year to date"
312
313
  }