@chayns-components/core 5.0.0-beta.36 → 5.0.0-beta.360

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 (412) hide show
  1. package/README.md +3 -9
  2. package/lib/api/image/post.d.ts +16 -0
  3. package/lib/api/image/post.js +34 -0
  4. package/lib/api/image/post.js.map +1 -0
  5. package/lib/api/video/post.d.ts +16 -0
  6. package/lib/api/video/post.js +31 -0
  7. package/lib/api/video/post.js.map +1 -0
  8. package/lib/components/accordion/Accordion.d.ts +24 -3
  9. package/lib/components/accordion/Accordion.js +38 -33
  10. package/lib/components/accordion/Accordion.js.map +1 -1
  11. package/lib/components/accordion/Accordion.styles.d.ts +6 -4
  12. package/lib/components/accordion/Accordion.styles.js +70 -35
  13. package/lib/components/accordion/Accordion.styles.js.map +1 -1
  14. package/lib/components/accordion/accordion-body/AccordionBody.d.ts +21 -2
  15. package/lib/components/accordion/accordion-body/AccordionBody.js +17 -17
  16. package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  17. package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +268 -1
  18. package/lib/components/accordion/accordion-body/AccordionBody.styles.js +15 -11
  19. package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  20. package/lib/components/accordion/accordion-content/AccordionContent.d.ts +10 -2
  21. package/lib/components/accordion/accordion-content/AccordionContent.js +7 -10
  22. package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  23. package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +7 -4
  24. package/lib/components/accordion/accordion-content/AccordionContent.styles.js +18 -13
  25. package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  26. package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +4 -3
  27. package/lib/components/accordion/accordion-group/AccordionGroup.js +6 -14
  28. package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  29. package/lib/components/accordion/accordion-head/AccordionHead.d.ts +1 -1
  30. package/lib/components/accordion/accordion-head/AccordionHead.js +6 -19
  31. package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  32. package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +2687 -12
  33. package/lib/components/accordion/accordion-head/AccordionHead.styles.js +104 -45
  34. package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  35. package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +8 -2
  36. package/lib/components/accordion/accordion-intro/AccordionIntro.js +1 -7
  37. package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -1
  38. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +273 -1
  39. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +3 -10
  40. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -1
  41. package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -0
  42. package/lib/components/accordion/accordion-item/AccordionItem.js +27 -0
  43. package/lib/components/accordion/accordion-item/AccordionItem.js.map +1 -0
  44. package/lib/components/accordion/accordion-item/AccordionItem.styles.d.ts +7 -0
  45. package/lib/components/accordion/accordion-item/AccordionItem.styles.js +33 -0
  46. package/lib/components/accordion/accordion-item/AccordionItem.styles.js.map +1 -0
  47. package/lib/components/accordion/utils.js +1 -5
  48. package/lib/components/accordion/utils.js.map +1 -1
  49. package/lib/components/amount-control/AmountControl.d.ts +22 -0
  50. package/lib/components/amount-control/AmountControl.js +185 -0
  51. package/lib/components/amount-control/AmountControl.js.map +1 -0
  52. package/lib/components/amount-control/AmountControl.styles.d.ts +288 -0
  53. package/lib/components/amount-control/AmountControl.styles.js +58 -0
  54. package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
  55. package/lib/components/amount-control/utils.d.ts +7 -0
  56. package/lib/components/amount-control/utils.js +22 -0
  57. package/lib/components/amount-control/utils.js.map +1 -0
  58. package/lib/components/badge/Badge.d.ts +1 -1
  59. package/lib/components/badge/Badge.js +1 -8
  60. package/lib/components/badge/Badge.js.map +1 -1
  61. package/lib/components/badge/Badge.styles.d.ts +5 -3
  62. package/lib/components/badge/Badge.styles.js +14 -14
  63. package/lib/components/badge/Badge.styles.js.map +1 -1
  64. package/lib/components/button/Button.d.ts +6 -2
  65. package/lib/components/button/Button.js +55 -14
  66. package/lib/components/button/Button.js.map +1 -1
  67. package/lib/components/button/Button.styles.d.ts +808 -4
  68. package/lib/components/button/Button.styles.js +59 -23
  69. package/lib/components/button/Button.styles.js.map +1 -1
  70. package/lib/components/checkbox/Checkbox.d.ts +33 -0
  71. package/lib/components/checkbox/Checkbox.js +51 -0
  72. package/lib/components/checkbox/Checkbox.js.map +1 -0
  73. package/lib/components/checkbox/Checkbox.styles.d.ts +585 -0
  74. package/lib/components/checkbox/Checkbox.styles.js +140 -0
  75. package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
  76. package/lib/components/code-highlighter/CodeHighlighter.d.ts +36 -0
  77. package/lib/components/code-highlighter/CodeHighlighter.js +82 -0
  78. package/lib/components/code-highlighter/CodeHighlighter.js.map +1 -0
  79. package/lib/components/code-highlighter/CodeHighlighter.styles.d.ts +16 -0
  80. package/lib/components/code-highlighter/CodeHighlighter.styles.js +88 -0
  81. package/lib/components/code-highlighter/CodeHighlighter.styles.js.map +1 -0
  82. package/lib/components/code-highlighter/copy-to-clipboard/CopyToClipboard.d.ts +9 -0
  83. package/lib/components/code-highlighter/copy-to-clipboard/CopyToClipboard.js +41 -0
  84. package/lib/components/code-highlighter/copy-to-clipboard/CopyToClipboard.js.map +1 -0
  85. package/lib/components/code-highlighter/copy-to-clipboard/CopyToClipboard.styles.d.ts +280 -0
  86. package/lib/components/code-highlighter/copy-to-clipboard/CopyToClipboard.styles.js +24 -0
  87. package/lib/components/code-highlighter/copy-to-clipboard/CopyToClipboard.styles.js.map +1 -0
  88. package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +3 -2
  89. package/lib/components/color-scheme-provider/ColorSchemeProvider.js +20 -27
  90. package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  91. package/lib/components/color-scheme-provider/font.d.ts +6 -0
  92. package/lib/components/color-scheme-provider/font.js +59 -0
  93. package/lib/components/color-scheme-provider/font.js.map +1 -0
  94. package/lib/components/combobox/ComboBox.d.ts +25 -0
  95. package/lib/components/combobox/ComboBox.js +143 -0
  96. package/lib/components/combobox/ComboBox.js.map +1 -0
  97. package/lib/components/combobox/ComboBox.styles.d.ts +821 -0
  98. package/lib/components/combobox/ComboBox.styles.js +123 -0
  99. package/lib/components/combobox/ComboBox.styles.js.map +1 -0
  100. package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +18 -0
  101. package/lib/components/combobox/combobox-item/ComboBoxItem.js +29 -0
  102. package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
  103. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +4 -0
  104. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +27 -0
  105. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
  106. package/lib/components/content-card/ContentCard.d.ts +13 -0
  107. package/lib/components/content-card/ContentCard.js +21 -0
  108. package/lib/components/content-card/ContentCard.js.map +1 -0
  109. package/lib/components/content-card/ContentCard.styles.d.ts +273 -0
  110. package/lib/components/content-card/ContentCard.styles.js +22 -0
  111. package/lib/components/content-card/ContentCard.styles.js.map +1 -0
  112. package/lib/components/context-menu/ContextMenu.d.ts +5 -5
  113. package/lib/components/context-menu/ContextMenu.js +20 -42
  114. package/lib/components/context-menu/ContextMenu.js.map +1 -1
  115. package/lib/components/context-menu/ContextMenu.styles.d.ts +273 -1
  116. package/lib/components/context-menu/ContextMenu.styles.js +3 -10
  117. package/lib/components/context-menu/ContextMenu.styles.js.map +1 -1
  118. package/lib/components/context-menu/constants/alignment.js +3 -5
  119. package/lib/components/context-menu/constants/alignment.js.map +1 -1
  120. package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +1 -1
  121. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +11 -11
  122. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  123. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +813 -8
  124. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +80 -39
  125. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
  126. package/lib/components/date-info/DateInfo.d.ts +40 -0
  127. package/lib/components/date-info/DateInfo.js +108 -0
  128. package/lib/components/date-info/DateInfo.js.map +1 -0
  129. package/lib/components/date-info/utils/format.d.ts +43 -0
  130. package/lib/components/date-info/utils/format.js +287 -0
  131. package/lib/components/date-info/utils/format.js.map +1 -0
  132. package/lib/components/date-info/utils/language.d.ts +1 -0
  133. package/lib/components/date-info/utils/language.js +35 -0
  134. package/lib/components/date-info/utils/language.js.map +1 -0
  135. package/lib/components/file-input/FileInput.d.ts +21 -0
  136. package/lib/components/file-input/FileInput.js +104 -0
  137. package/lib/components/file-input/FileInput.js.map +1 -0
  138. package/lib/components/file-input/FileInput.styles.d.ts +544 -0
  139. package/lib/components/file-input/FileInput.styles.js +35 -0
  140. package/lib/components/file-input/FileInput.styles.js.map +1 -0
  141. package/lib/components/file-input/file-list/FileListItem.d.ts +9 -0
  142. package/lib/components/file-input/file-list/FileListItem.js +36 -0
  143. package/lib/components/file-input/file-list/FileListItem.js.map +1 -0
  144. package/lib/components/file-input/file-list/FileListItem.styles.d.ts +273 -0
  145. package/lib/components/file-input/file-list/FileListItem.styles.js +10 -0
  146. package/lib/components/file-input/file-list/FileListItem.styles.js.map +1 -0
  147. package/lib/components/filter-buttons/FilterButtons.d.ts +22 -0
  148. package/lib/components/filter-buttons/FilterButtons.js +88 -0
  149. package/lib/components/filter-buttons/FilterButtons.js.map +1 -0
  150. package/lib/components/filter-buttons/FilterButtons.styles.d.ts +273 -0
  151. package/lib/components/filter-buttons/FilterButtons.styles.js +14 -0
  152. package/lib/components/filter-buttons/FilterButtons.styles.js.map +1 -0
  153. package/lib/components/filter-buttons/filter-button/FilterButton.d.ts +14 -0
  154. package/lib/components/filter-buttons/filter-button/FilterButton.js +47 -0
  155. package/lib/components/filter-buttons/filter-button/FilterButton.js.map +1 -0
  156. package/lib/components/filter-buttons/filter-button/FilterButton.styles.d.ts +557 -0
  157. package/lib/components/filter-buttons/filter-button/FilterButton.styles.js +104 -0
  158. package/lib/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -0
  159. package/lib/components/filter-buttons/types.d.ts +15 -0
  160. package/lib/components/filter-buttons/types.js +17 -0
  161. package/lib/components/filter-buttons/types.js.map +1 -0
  162. package/lib/components/grid-image/GridImage.d.ts +1 -1
  163. package/lib/components/grid-image/GridImage.js +3 -10
  164. package/lib/components/grid-image/GridImage.js.map +1 -1
  165. package/lib/components/grid-image/GridImage.styles.d.ts +12 -11
  166. package/lib/components/grid-image/GridImage.styles.js +52 -32
  167. package/lib/components/grid-image/GridImage.styles.js.map +1 -1
  168. package/lib/components/icon/Icon.d.ts +1 -1
  169. package/lib/components/icon/Icon.js +2 -16
  170. package/lib/components/icon/Icon.js.map +1 -1
  171. package/lib/components/icon/Icon.styles.d.ts +7 -7
  172. package/lib/components/icon/Icon.styles.js +35 -29
  173. package/lib/components/icon/Icon.styles.js.map +1 -1
  174. package/lib/components/icon/utils.js +1 -5
  175. package/lib/components/icon/utils.js.map +1 -1
  176. package/lib/components/input/Input.d.ts +35 -3
  177. package/lib/components/input/Input.js +62 -24
  178. package/lib/components/input/Input.js.map +1 -1
  179. package/lib/components/input/Input.styles.d.ts +1081 -6
  180. package/lib/components/input/Input.styles.js +80 -28
  181. package/lib/components/input/Input.styles.js.map +1 -1
  182. package/lib/components/list/List.d.ts +1 -1
  183. package/lib/components/list/List.js +4 -14
  184. package/lib/components/list/List.js.map +1 -1
  185. package/lib/components/list/list-item/ListItem.d.ts +1 -1
  186. package/lib/components/list/list-item/ListItem.js +7 -20
  187. package/lib/components/list/list-item/ListItem.js.map +1 -1
  188. package/lib/components/list/list-item/ListItem.styles.d.ts +6 -4
  189. package/lib/components/list/list-item/ListItem.styles.js +30 -32
  190. package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
  191. package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +6 -2
  192. package/lib/components/list/list-item/list-item-body/ListItemBody.js +28 -12
  193. package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
  194. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +267 -1
  195. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +3 -10
  196. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
  197. package/lib/components/list/list-item/list-item-content/ListItemContent.d.ts +8 -2
  198. package/lib/components/list/list-item/list-item-content/ListItemContent.js +1 -7
  199. package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
  200. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.d.ts +273 -1
  201. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +5 -11
  202. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
  203. package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +1 -1
  204. package/lib/components/list/list-item/list-item-head/ListItemHead.js +4 -17
  205. package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  206. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +2434 -14
  207. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +75 -55
  208. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  209. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +1 -1
  210. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +1 -8
  211. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -1
  212. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +273 -1
  213. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +14 -12
  214. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -1
  215. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +1 -1
  216. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +3 -15
  217. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -1
  218. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +8 -7
  219. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +25 -18
  220. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -1
  221. package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
  222. package/lib/components/mention-finder/MentionFinder.js +139 -0
  223. package/lib/components/mention-finder/MentionFinder.js.map +1 -0
  224. package/lib/components/mention-finder/MentionFinder.styles.d.ts +540 -0
  225. package/lib/components/mention-finder/MentionFinder.styles.js +92 -0
  226. package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
  227. package/lib/components/mention-finder/constants/alignment.d.ts +4 -0
  228. package/lib/components/mention-finder/constants/alignment.js +12 -0
  229. package/lib/components/mention-finder/constants/alignment.js.map +1 -0
  230. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
  231. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +31 -0
  232. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
  233. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +1102 -0
  234. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +91 -0
  235. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
  236. package/lib/components/number-input/NumberInput.d.ts +46 -0
  237. package/lib/components/number-input/NumberInput.js +123 -0
  238. package/lib/components/number-input/NumberInput.js.map +1 -0
  239. package/lib/components/number-input/constants/number.d.ts +4 -0
  240. package/lib/components/number-input/constants/number.js +11 -0
  241. package/lib/components/number-input/constants/number.js.map +1 -0
  242. package/lib/components/number-input/utils/number.d.ts +21 -0
  243. package/lib/components/number-input/utils/number.js +64 -0
  244. package/lib/components/number-input/utils/number.js.map +1 -0
  245. package/lib/components/popup/Popup.d.ts +26 -0
  246. package/lib/components/popup/Popup.js +153 -0
  247. package/lib/components/popup/Popup.js.map +1 -0
  248. package/lib/components/popup/Popup.styles.d.ts +276 -0
  249. package/lib/components/popup/Popup.styles.js +25 -0
  250. package/lib/components/popup/Popup.styles.js.map +1 -0
  251. package/lib/components/popup/popup-content/PopupContent.d.ts +9 -0
  252. package/lib/components/popup/popup-content/PopupContent.js +68 -0
  253. package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
  254. package/lib/components/popup/popup-content/PopupContent.styles.d.ts +544 -0
  255. package/lib/components/popup/popup-content/PopupContent.styles.js +94 -0
  256. package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
  257. package/lib/components/popup/types.d.ts +16 -0
  258. package/lib/components/popup/types.js +16 -0
  259. package/lib/components/popup/types.js.map +1 -0
  260. package/lib/components/progress-bar/ProgressBar.d.ts +9 -0
  261. package/lib/components/progress-bar/ProgressBar.js +38 -0
  262. package/lib/components/progress-bar/ProgressBar.js.map +1 -0
  263. package/lib/components/progress-bar/ProgressBar.styles.d.ts +541 -0
  264. package/lib/components/progress-bar/ProgressBar.styles.js +36 -0
  265. package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
  266. package/lib/components/radio-button/RadioButton.d.ts +26 -0
  267. package/lib/components/radio-button/RadioButton.js +85 -0
  268. package/lib/components/radio-button/RadioButton.js.map +1 -0
  269. package/lib/components/radio-button/RadioButton.styles.d.ts +22 -0
  270. package/lib/components/radio-button/RadioButton.styles.js +95 -0
  271. package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
  272. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +17 -0
  273. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +46 -0
  274. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
  275. package/lib/components/radio-button/types.d.ts +4 -0
  276. package/lib/components/radio-button/types.js +2 -0
  277. package/lib/components/radio-button/types.js.map +1 -0
  278. package/lib/components/scroll-view/ScrollView.d.ts +13 -0
  279. package/lib/components/scroll-view/ScrollView.js +22 -0
  280. package/lib/components/scroll-view/ScrollView.js.map +1 -0
  281. package/lib/components/scroll-view/ScrollView.styles.d.ts +7 -0
  282. package/lib/components/scroll-view/ScrollView.styles.js +26 -0
  283. package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
  284. package/lib/components/search-box/SearchBox.d.ts +30 -0
  285. package/lib/components/search-box/SearchBox.js +179 -0
  286. package/lib/components/search-box/SearchBox.js.map +1 -0
  287. package/lib/components/search-box/SearchBox.styles.d.ts +542 -0
  288. package/lib/components/search-box/SearchBox.styles.js +56 -0
  289. package/lib/components/search-box/SearchBox.styles.js.map +1 -0
  290. package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +9 -0
  291. package/lib/components/search-box/search-box-item/SearchBoxItem.js +29 -0
  292. package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
  293. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +7 -0
  294. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +28 -0
  295. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
  296. package/lib/components/search-box/types.d.ts +4 -0
  297. package/lib/components/search-box/types.js +2 -0
  298. package/lib/components/search-box/types.js.map +1 -0
  299. package/lib/components/search-box/utils.d.ts +7 -0
  300. package/lib/components/search-box/utils.js +23 -0
  301. package/lib/components/search-box/utils.js.map +1 -0
  302. package/lib/components/search-input/SearchInput.d.ts +33 -0
  303. package/lib/components/search-input/SearchInput.js +102 -0
  304. package/lib/components/search-input/SearchInput.js.map +1 -0
  305. package/lib/components/search-input/SearchInput.styles.d.ts +1074 -0
  306. package/lib/components/search-input/SearchInput.styles.js +26 -0
  307. package/lib/components/search-input/SearchInput.styles.js.map +1 -0
  308. package/lib/components/setup-wizard/SetupWizard.d.ts +23 -0
  309. package/lib/components/setup-wizard/SetupWizard.js +79 -0
  310. package/lib/components/setup-wizard/SetupWizard.js.map +1 -0
  311. package/lib/components/setup-wizard/SetupWizard.styles.d.ts +273 -0
  312. package/lib/components/setup-wizard/SetupWizard.styles.js +10 -0
  313. package/lib/components/setup-wizard/SetupWizard.styles.js.map +1 -0
  314. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.d.ts +25 -0
  315. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +60 -0
  316. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -0
  317. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.d.ts +544 -0
  318. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.js +14 -0
  319. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.js.map +1 -0
  320. package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
  321. package/lib/components/sharing-bar/SharingBar.js +110 -0
  322. package/lib/components/sharing-bar/SharingBar.js.map +1 -0
  323. package/lib/components/sharing-bar/SharingBar.styles.d.ts +547 -0
  324. package/lib/components/sharing-bar/SharingBar.styles.js +24 -0
  325. package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
  326. package/lib/components/slider/Slider.d.ts +21 -0
  327. package/lib/components/slider/Slider.js +51 -0
  328. package/lib/components/slider/Slider.js.map +1 -0
  329. package/lib/components/slider/Slider.styles.d.ts +281 -0
  330. package/lib/components/slider/Slider.styles.js +74 -0
  331. package/lib/components/slider/Slider.styles.js.map +1 -0
  332. package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
  333. package/lib/components/small-wait-cursor/SmallWaitCursor.js +42 -0
  334. package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
  335. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +19 -0
  336. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +101 -0
  337. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
  338. package/lib/components/text-area/TextArea.d.ts +29 -0
  339. package/lib/components/text-area/TextArea.js +72 -0
  340. package/lib/components/text-area/TextArea.js.map +1 -0
  341. package/lib/components/text-area/TextArea.styles.d.ts +283 -0
  342. package/lib/components/text-area/TextArea.styles.js +79 -0
  343. package/lib/components/text-area/TextArea.styles.js.map +1 -0
  344. package/lib/components/tooltip/Tooltip.d.ts +18 -0
  345. package/lib/components/tooltip/Tooltip.js +32 -0
  346. package/lib/components/tooltip/Tooltip.js.map +1 -0
  347. package/lib/components/tooltip/Tooltip.styles.d.ts +273 -0
  348. package/lib/components/tooltip/Tooltip.styles.js +10 -0
  349. package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
  350. package/lib/components/tooltip/interface.d.ts +4 -0
  351. package/lib/components/tooltip/interface.js +2 -0
  352. package/lib/components/tooltip/interface.js.map +1 -0
  353. package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +7 -0
  354. package/lib/components/tooltip/tooltip-item/TooltipItem.js +20 -0
  355. package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
  356. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +279 -0
  357. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +29 -0
  358. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
  359. package/lib/components/truncation/Truncation.d.ts +25 -0
  360. package/lib/components/truncation/Truncation.js +92 -0
  361. package/lib/components/truncation/Truncation.js.map +1 -0
  362. package/lib/components/truncation/Truncation.styles.d.ts +1088 -0
  363. package/lib/components/truncation/Truncation.styles.js +27 -0
  364. package/lib/components/truncation/Truncation.styles.js.map +1 -0
  365. package/lib/constants/codeHighlighter.d.ts +7 -0
  366. package/lib/constants/codeHighlighter.js +13 -0
  367. package/lib/constants/codeHighlighter.js.map +1 -0
  368. package/lib/hooks/uuid.js +0 -4
  369. package/lib/hooks/uuid.js.map +1 -1
  370. package/lib/index.d.ts +41 -0
  371. package/lib/index.js +244 -14
  372. package/lib/index.js.map +1 -1
  373. package/lib/types/chayns.d.ts +56 -0
  374. package/lib/types/chayns.js +3 -5
  375. package/lib/types/chayns.js.map +1 -1
  376. package/lib/types/codeHighlighter.d.ts +10 -0
  377. package/lib/types/codeHighlighter.js +12 -0
  378. package/lib/types/codeHighlighter.js.map +1 -0
  379. package/lib/types/file.d.ts +42 -0
  380. package/lib/types/file.js +2 -0
  381. package/lib/types/file.js.map +1 -0
  382. package/lib/types/parser/prettier-parser-babel.d.js +2 -0
  383. package/lib/types/parser/prettier-parser-babel.d.js.map +1 -0
  384. package/lib/types/parser/prettier-parser-graphql.d.js +2 -0
  385. package/lib/types/parser/prettier-parser-graphql.d.js.map +1 -0
  386. package/lib/types/parser/prettier-parser-html.d.js +2 -0
  387. package/lib/types/parser/prettier-parser-html.d.js.map +1 -0
  388. package/lib/types/parser/prettier-parser-markdown.d.js +2 -0
  389. package/lib/types/parser/prettier-parser-markdown.d.js.map +1 -0
  390. package/lib/types/parser/prettier-parser-postcss.d.js +2 -0
  391. package/lib/types/parser/prettier-parser-postcss.d.js.map +1 -0
  392. package/lib/types/parser/prettier-parser-yaml.d.js +2 -0
  393. package/lib/types/parser/prettier-parser-yaml.d.js.map +1 -0
  394. package/lib/utils/calculate.d.ts +3 -0
  395. package/lib/utils/calculate.js +49 -0
  396. package/lib/utils/calculate.js.map +1 -0
  397. package/lib/utils/codeHighlighter.d.ts +3 -0
  398. package/lib/utils/codeHighlighter.js +67 -0
  399. package/lib/utils/codeHighlighter.js.map +1 -0
  400. package/lib/utils/file.d.ts +363 -0
  401. package/lib/utils/file.js +402 -0
  402. package/lib/utils/file.js.map +1 -0
  403. package/lib/utils/fileDialog.d.ts +7 -0
  404. package/lib/utils/fileDialog.js +73 -0
  405. package/lib/utils/fileDialog.js.map +1 -0
  406. package/lib/utils/isTobitEmployee.d.ts +1 -0
  407. package/lib/utils/isTobitEmployee.js +28 -0
  408. package/lib/utils/isTobitEmployee.js.map +1 -0
  409. package/lib/utils/uploadFile.d.ts +9 -0
  410. package/lib/utils/uploadFile.js +47 -0
  411. package/lib/utils/uploadFile.js.map +1 -0
  412. package/package.json +29 -21
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMentionFinderItemImage = exports.StyledMentionFinderItemContentName = exports.StyledMentionFinderItemContentInfo = exports.StyledMentionFinderItemContent = exports.StyledMentionFinderItem = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const StyledMentionFinderItem = exports.StyledMentionFinderItem = _styledComponents.default.div`
11
+ align-items: center;
12
+ cursor: pointer;
13
+ display: flex;
14
+ height: 64px;
15
+ padding: 12px 9px;
16
+
17
+ &:not(:last-child) {
18
+ border-bottom: 1px solid
19
+ rgba(${_ref => {
20
+ let {
21
+ theme
22
+ } = _ref;
23
+ return theme['text-rgb'];
24
+ }}, 0.15);
25
+ }
26
+
27
+ &:nth-child(even) {
28
+ background-color: ${_ref2 => {
29
+ let {
30
+ theme
31
+ } = _ref2;
32
+ return theme['002'];
33
+ }};
34
+ }
35
+
36
+ ${_ref3 => {
37
+ let {
38
+ isActive,
39
+ theme
40
+ } = _ref3;
41
+ return isActive && (0, _styledComponents.css)`
42
+ background-color: ${theme['102']} !important;
43
+ `;
44
+ }}
45
+ `;
46
+ const StyledMentionFinderItemImage = exports.StyledMentionFinderItemImage = _styledComponents.default.img`
47
+ background-color: rgba(
48
+ ${_ref4 => {
49
+ let {
50
+ theme
51
+ } = _ref4;
52
+ return theme['text-rgb'];
53
+ }},
54
+ 0.1
55
+ );
56
+ border-radius: 50%;
57
+ box-shadow: 0 0 0 1px
58
+ rgba(${_ref5 => {
59
+ let {
60
+ theme
61
+ } = _ref5;
62
+ return theme['009-rgb'];
63
+ }}, 0.08) inset;
64
+ flex: 0 0 auto;
65
+ height: 40px;
66
+ overflow: hidden;
67
+ transition: border-radius 0.3s ease;
68
+ width: 40px;
69
+ `;
70
+ const StyledMentionFinderItemContent = exports.StyledMentionFinderItemContent = _styledComponents.default.div`
71
+ color: ${_ref6 => {
72
+ let {
73
+ theme
74
+ } = _ref6;
75
+ return theme.text;
76
+ }};
77
+ display: flex;
78
+ flex: 1 1 auto;
79
+ flex-direction: column;
80
+ justify-content: center;
81
+ line-height: normal;
82
+ margin-left: 10px;
83
+ min-width: 0;
84
+ `;
85
+ const StyledMentionFinderItemContentName = exports.StyledMentionFinderItemContentName = _styledComponents.default.div``;
86
+ const StyledMentionFinderItemContentInfo = exports.StyledMentionFinderItemContentInfo = _styledComponents.default.div`
87
+ font-size: 85%;
88
+ margin-top: 2px;
89
+ opacity: 0.75;
90
+ `;
91
+ //# sourceMappingURL=MentionFinderItem.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MentionFinderItem.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledMentionFinderItem","exports","styled","div","_ref","theme","_ref2","_ref3","isActive","css","StyledMentionFinderItemImage","img","_ref4","_ref5","StyledMentionFinderItemContent","_ref6","text","StyledMentionFinderItemContentName","StyledMentionFinderItemContentInfo"],"sources":["../../../../src/components/mention-finder/mention-finder-item/MentionFinderItem.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\nimport type { MentionFinderItemProps } from './MentionFinderItem';\n\ntype StyledMentionFinderItemProps = WithTheme<Pick<MentionFinderItemProps, 'isActive'>>;\n\nexport const StyledMentionFinderItem = styled.div<StyledMentionFinderItemProps>`\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 64px;\n padding: 12px 9px;\n\n &:not(:last-child) {\n border-bottom: 1px solid\n rgba(${({ theme }: StyledMentionFinderItemProps) => theme['text-rgb']}, 0.15);\n }\n\n &:nth-child(even) {\n background-color: ${({ theme }: StyledMentionFinderItemProps) => theme['002']};\n }\n\n ${({ isActive, theme }) =>\n isActive &&\n css`\n background-color: ${theme['102']} !important;\n `}\n`;\n\ntype StyledMentionFinderItemImageProps = WithTheme<unknown>;\n\nexport const StyledMentionFinderItemImage = styled.img`\n background-color: rgba(\n ${({ theme }: StyledMentionFinderItemImageProps) => theme['text-rgb']},\n 0.1\n );\n border-radius: 50%;\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMentionFinderItemImageProps) => theme['009-rgb']}, 0.08) inset;\n flex: 0 0 auto;\n height: 40px;\n overflow: hidden;\n transition: border-radius 0.3s ease;\n width: 40px;\n`;\n\ntype StyledMentionFinderItemContentProps = WithTheme<unknown>;\n\nexport const StyledMentionFinderItemContent = styled.div`\n color: ${({ theme }: StyledMentionFinderItemContentProps) => theme.text};\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: center;\n line-height: normal;\n margin-left: 10px;\n min-width: 0;\n`;\n\nexport const StyledMentionFinderItemContentName = styled.div``;\n\nexport const StyledMentionFinderItemContentInfo = styled.div`\n font-size: 85%;\n margin-top: 2px;\n opac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AAjB,OAAA,CAAAiB,kCAAA,GAAGhB,yBAAM,CAACC,GAAI;AAC7D;AACA;AACA;AACA,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { FC } from 'react';
2
+ export type NumberInputProps = {
3
+ /**
4
+ * Applies rules for decimal input.
5
+ * Enables the user to input one zero as number before the comma
6
+ */
7
+ isDecimalInput?: boolean;
8
+ /**
9
+ * Whether the input is disabled
10
+ */
11
+ isDisabled?: boolean;
12
+ /**
13
+ * Applies rules for money input.
14
+ * Rules: only two decimal places, one zero before the comma
15
+ */
16
+ isMoneyInput?: boolean;
17
+ /**
18
+ * Limits the number to this value
19
+ */
20
+ maxNumber?: number;
21
+ /**
22
+ * Limits the number to this value
23
+ */
24
+ minNumber?: number;
25
+ /**
26
+ * Callback function that is called when the input gets out of focus
27
+ */
28
+ onBlur?: (newNumber: number | null, isInvalid: boolean) => void;
29
+ /**
30
+ * Callback function that is called when the input changes
31
+ * It will pass the text from the input
32
+ */
33
+ onChange?: (newValue: string) => void;
34
+ /**
35
+ * Placeholder for the input field
36
+ */
37
+ placeholder?: string;
38
+ /**
39
+ * The value, that should be displayed in the input, when it is in focus.
40
+ * You can also pass a stringified number as default value.
41
+ * NOTE: If you pass a stringified number, it will be formatted to the selected format
42
+ */
43
+ value?: string;
44
+ };
45
+ declare const NumberInput: FC<NumberInputProps>;
46
+ export default NumberInput;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _Input = _interopRequireDefault(require("../input/Input"));
9
+ var _number = require("./constants/number");
10
+ var _number2 = require("./utils/number");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ const NumberInput = _ref => {
15
+ let {
16
+ isDecimalInput,
17
+ isMoneyInput,
18
+ maxNumber = Infinity,
19
+ value,
20
+ placeholder,
21
+ onBlur,
22
+ isDisabled,
23
+ onChange,
24
+ minNumber = -Infinity
25
+ } = _ref;
26
+ // the plainText will be shown in the input, when it is in focus
27
+ const [plainText, setPlainText] = (0, _react.useState)('');
28
+ // the formattedValue will be shown in the input, when it is not in focus
29
+ const [formattedValue, setFormattedValue] = (0, _react.useState)('');
30
+ const [hasFocus, setHasFocus] = (0, _react.useState)(false);
31
+ const [isValueInvalid, setIsValueInvalid] = (0, _react.useState)(false);
32
+ const localPlaceholder = placeholder ?? (isMoneyInput ? '€' : undefined);
33
+ const onLocalChange = event => {
34
+ const newValue = event.target.value;
35
+ const sanitizedValueString = newValue
36
+ // Removes everything except numbers, commas and points
37
+ .replace(_number.NUMBER_CLEAR_REGEX, '');
38
+ const valueToCheck = sanitizedValueString.replaceAll(',', '.');
39
+ if (!(0, _number2.isValidString)({
40
+ string: valueToCheck,
41
+ isMoneyInput,
42
+ isDecimalInput
43
+ })) {
44
+ return;
45
+ }
46
+ setPlainText(sanitizedValueString.replaceAll('.', ','));
47
+ if (typeof onChange === 'function') {
48
+ onChange(sanitizedValueString.replaceAll('.', ','));
49
+ }
50
+ };
51
+ const onLocalBlur = () => {
52
+ const sanitizedValue = plainText.length === 0 ? '0' : plainText;
53
+ let isInvalid = false;
54
+ const parsedNumber = (0, _number2.parseFloatWithDecimals)({
55
+ stringValue: sanitizedValue.replace(',', '.'),
56
+ decimals: isMoneyInput ? 2 : undefined
57
+ });
58
+ if (parsedNumber !== 0 && (parsedNumber > maxNumber || parsedNumber < minNumber)) {
59
+ isInvalid = true;
60
+ }
61
+ setIsValueInvalid(isInvalid);
62
+ const newStringValue = plainText.length === 0 ? '' : (0, _number2.formateNumber)({
63
+ number: parsedNumber,
64
+ isMoneyInput
65
+ });
66
+ setFormattedValue(newStringValue);
67
+ setPlainText(newStringValue.replaceAll('.', ''));
68
+ setHasFocus(false);
69
+ if (typeof onChange === 'function') {
70
+ onChange(newStringValue.replaceAll('.', ''));
71
+ }
72
+ if (typeof onBlur === 'function') {
73
+ onBlur(parsedNumber === 0 ? null : parsedNumber, isInvalid);
74
+ }
75
+ };
76
+ const onLocalFocus = () => {
77
+ // formattedValue will be a number string with german number format (e.g. 1.000,00)
78
+ // It will remove all dots, so that the user can type in the number
79
+ setPlainText(formattedValue.replaceAll('.', ''));
80
+
81
+ // This will update the external state
82
+ if (typeof onChange === 'function') {
83
+ onChange(formattedValue.replaceAll('.', ''));
84
+ }
85
+ setIsValueInvalid(false);
86
+ setHasFocus(true);
87
+ };
88
+
89
+ // updates the formattedValue, when the value changes
90
+ (0, _react.useEffect)(() => {
91
+ const parsedNumber = (0, _number2.parseFloatWithDecimals)({
92
+ stringValue: plainText.replace(',', '.'),
93
+ decimals: isMoneyInput ? 2 : undefined
94
+ });
95
+
96
+ // checks, if a given number is invalid, if the input is not in focus
97
+ if (!hasFocus) {
98
+ setIsValueInvalid(parsedNumber > maxNumber || parsedNumber < minNumber);
99
+ }
100
+ setFormattedValue(plainText.length === 0 ? '' : (0, _number2.formateNumber)({
101
+ number: parsedNumber,
102
+ isMoneyInput
103
+ }));
104
+ }, [hasFocus, isMoneyInput, maxNumber, minNumber, plainText]);
105
+ (0, _react.useEffect)(() => {
106
+ if (typeof value === 'string') {
107
+ setPlainText(value);
108
+ }
109
+ }, [value]);
110
+ return /*#__PURE__*/_react.default.createElement(_Input.default, {
111
+ inputMode: "decimal",
112
+ onChange: onLocalChange,
113
+ value: hasFocus ? plainText : formattedValue,
114
+ placeholder: localPlaceholder,
115
+ onBlur: onLocalBlur,
116
+ onFocus: onLocalFocus,
117
+ isDisabled: isDisabled,
118
+ isInvalid: isValueInvalid
119
+ });
120
+ };
121
+ NumberInput.displayName = 'NumberInput';
122
+ var _default = exports.default = NumberInput;
123
+ //# sourceMappingURL=NumberInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberInput.js","names":["_react","_interopRequireWildcard","require","_Input","_interopRequireDefault","_number","_number2","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","NumberInput","_ref","isDecimalInput","isMoneyInput","maxNumber","Infinity","value","placeholder","onBlur","isDisabled","onChange","minNumber","plainText","setPlainText","useState","formattedValue","setFormattedValue","hasFocus","setHasFocus","isValueInvalid","setIsValueInvalid","localPlaceholder","undefined","onLocalChange","event","newValue","target","sanitizedValueString","replace","NUMBER_CLEAR_REGEX","valueToCheck","replaceAll","isValidString","string","onLocalBlur","sanitizedValue","length","isInvalid","parsedNumber","parseFloatWithDecimals","stringValue","decimals","newStringValue","formateNumber","number","onLocalFocus","useEffect","createElement","inputMode","onFocus","displayName","_default","exports"],"sources":["../../../src/components/number-input/NumberInput.tsx"],"sourcesContent":["import React, { ChangeEventHandler, FC, useEffect, useState } from 'react';\nimport Input from '../input/Input';\nimport { NUMBER_CLEAR_REGEX } from './constants/number';\nimport { formateNumber, isValidString, parseFloatWithDecimals } from './utils/number';\n\nexport type NumberInputProps = {\n /**\n * Applies rules for decimal input.\n * Enables the user to input one zero as number before the comma\n */\n isDecimalInput?: boolean;\n /**\n * Whether the input is disabled\n */\n isDisabled?: boolean;\n /**\n * Applies rules for money input.\n * Rules: only two decimal places, one zero before the comma\n */\n isMoneyInput?: boolean;\n /**\n * Limits the number to this value\n */\n maxNumber?: number;\n /**\n * Limits the number to this value\n */\n minNumber?: number;\n /**\n * Callback function that is called when the input gets out of focus\n */\n onBlur?: (newNumber: number | null, isInvalid: boolean) => void;\n /**\n * Callback function that is called when the input changes\n * It will pass the text from the input\n */\n onChange?: (newValue: string) => void;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * The value, that should be displayed in the input, when it is in focus.\n * You can also pass a stringified number as default value.\n * NOTE: If you pass a stringified number, it will be formatted to the selected format\n */\n value?: string;\n};\n\nconst NumberInput: FC<NumberInputProps> = (\n {\n isDecimalInput,\n isMoneyInput,\n maxNumber = Infinity,\n value,\n placeholder,\n onBlur,\n isDisabled,\n onChange,\n minNumber = -Infinity\n }) => {\n // the plainText will be shown in the input, when it is in focus\n const [plainText, setPlainText] = useState<string>('');\n // the formattedValue will be shown in the input, when it is not in focus\n const [formattedValue, setFormattedValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const [isValueInvalid, setIsValueInvalid] = useState(false);\n const localPlaceholder = placeholder ?? (isMoneyInput ? '€' : undefined);\n\n\n const onLocalChange: ChangeEventHandler<HTMLInputElement> =\n (event) => {\n const newValue = event.target.value;\n\n const sanitizedValueString = newValue\n // Removes everything except numbers, commas and points\n .replace(NUMBER_CLEAR_REGEX, '');\n\n const valueToCheck = sanitizedValueString.replaceAll(',', '.');\n\n if (!isValidString({ string: valueToCheck, isMoneyInput, isDecimalInput })) {\n return;\n }\n\n setPlainText(sanitizedValueString.replaceAll('.', ','));\n\n if (typeof onChange === 'function') {\n onChange(sanitizedValueString.replaceAll('.', ','));\n }\n };\n\n const onLocalBlur = () => {\n const sanitizedValue = plainText.length === 0 ? '0' : plainText;\n let isInvalid = false;\n\n const parsedNumber = parseFloatWithDecimals({\n stringValue: sanitizedValue.replace(',', '.'),\n decimals: isMoneyInput ? 2 : undefined\n });\n\n if (parsedNumber !== 0 && (parsedNumber > maxNumber || parsedNumber < minNumber)) {\n isInvalid = true;\n }\n\n setIsValueInvalid(isInvalid);\n\n const newStringValue = plainText.length === 0\n ? ''\n : formateNumber({\n number: parsedNumber,\n isMoneyInput,\n });\n\n setFormattedValue(newStringValue);\n setPlainText(newStringValue.replaceAll('.', ''));\n setHasFocus(false);\n\n if (typeof onChange === 'function') {\n onChange(newStringValue.replaceAll('.', ''));\n }\n\n if (typeof onBlur === 'function') {\n onBlur(parsedNumber === 0 ? null : parsedNumber, isInvalid);\n }\n };\n\n const onLocalFocus = () => {\n // formattedValue will be a number string with german number format (e.g. 1.000,00)\n // It will remove all dots, so that the user can type in the number\n setPlainText(formattedValue.replaceAll('.', ''));\n\n // This will update the external state\n if (typeof onChange === 'function') {\n onChange(formattedValue.replaceAll('.', ''));\n }\n\n setIsValueInvalid(false);\n setHasFocus(true);\n };\n\n // updates the formattedValue, when the value changes\n useEffect(() => {\n const parsedNumber = parseFloatWithDecimals({\n stringValue: plainText.replace(',', '.'),\n decimals: isMoneyInput ? 2 : undefined\n });\n\n // checks, if a given number is invalid, if the input is not in focus\n if (!hasFocus) {\n setIsValueInvalid(parsedNumber > maxNumber || parsedNumber < minNumber);\n }\n\n setFormattedValue(plainText.length === 0\n ? ''\n : formateNumber({\n number: parsedNumber,\n isMoneyInput,\n }));\n }, [hasFocus, isMoneyInput, maxNumber, minNumber, plainText]);\n\n useEffect(() => {\n if (typeof value === 'string') {\n setPlainText(value);\n }\n }, [value]);\n\n return (\n <Input\n inputMode=\"decimal\"\n onChange={onLocalChange}\n value={hasFocus ? plainText : formattedValue}\n placeholder={localPlaceholder}\n onBlur={onLocalBlur}\n onFocus={onLocalFocus}\n isDisabled={isDisabled}\n isInvalid={isValueInvalid}\n />\n );\n};\n\nNumberInput.displayName = 'NumberInput';\n\nexport default NumberInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA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tBpC,UAAU,EAAEA,UAAW;IACvB4B,SAAS,EAAElB;EAAe,CAC7B,CAAC;AAEV,CAAC;AAEDnB,WAAW,CAACkD,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxE,OAAA,GAEzBoB,WAAW"}
@@ -0,0 +1,4 @@
1
+ export declare const NUMBER_CLEAR_REGEX: RegExp;
2
+ export declare const INTEGER_TEST: RegExp;
3
+ export declare const DECIMAL_TEST: RegExp;
4
+ export declare const MONEY_TEST: RegExp;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NUMBER_CLEAR_REGEX = exports.MONEY_TEST = exports.INTEGER_TEST = exports.DECIMAL_TEST = void 0;
7
+ const NUMBER_CLEAR_REGEX = exports.NUMBER_CLEAR_REGEX = /[^\d,.]/gi;
8
+ const INTEGER_TEST = exports.INTEGER_TEST = /^[1-9][0-9]*$/;
9
+ const DECIMAL_TEST = exports.DECIMAL_TEST = /^(0|[1-9][0-9]*)?(\.[0-9]*)?$/;
10
+ const MONEY_TEST = exports.MONEY_TEST = /^(0|[1-9][0-9]*)?(\.[0-9]{0,2})?$/;
11
+ //# sourceMappingURL=number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.js","names":["NUMBER_CLEAR_REGEX","exports","INTEGER_TEST","DECIMAL_TEST","MONEY_TEST"],"sources":["../../../../src/components/number-input/constants/number.ts"],"sourcesContent":["export const NUMBER_CLEAR_REGEX = /[^\\d,.]/gi;\nexport const INTEGER_TEST = /^[1-9][0-9]*$/;\nexport const DECIMAL_TEST = /^(0|[1-9][0-9]*)?(\\.[0-9]*)?$/;\nexport const MONEY_TEST = /^(0|[1-9][0-9]*)?(\\.[0-9]{0,2})?$/;\n"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,WAAW;AACtC,MAAME,YAAY,GAAAD,OAAA,CAAAC,YAAA,GAAG,eAAe;AACpC,MAAMC,YAAY,GAAAF,OAAA,CAAAE,YAAA,GAAG,+BAA+B;AACpD,MAAMC,UAAU,GAAAH,OAAA,CAAAG,UAAA,GAAG,mCAAmC"}
@@ -0,0 +1,21 @@
1
+ interface ParseFloatWithDecimals {
2
+ ({ stringValue, decimals }: {
3
+ stringValue: string;
4
+ decimals?: number;
5
+ }): number;
6
+ }
7
+ export declare const parseFloatWithDecimals: ParseFloatWithDecimals;
8
+ interface FormateNumberOptions {
9
+ number: number | null;
10
+ isMoneyInput?: boolean;
11
+ }
12
+ export declare const formateNumber: ({ number, isMoneyInput }: FormateNumberOptions) => string;
13
+ interface IsValidString {
14
+ (config: {
15
+ string: string;
16
+ isDecimalInput?: boolean;
17
+ isMoneyInput?: boolean;
18
+ }): boolean;
19
+ }
20
+ export declare const isValidString: IsValidString;
21
+ export {};
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.parseFloatWithDecimals = exports.isValidString = exports.formateNumber = void 0;
7
+ var _number = require("../constants/number");
8
+ const parseFloatWithDecimals = _ref => {
9
+ let {
10
+ stringValue,
11
+ decimals
12
+ } = _ref;
13
+ const parsed = parseFloat(stringValue);
14
+ if (decimals) {
15
+ return parseFloat(parsed.toFixed(decimals));
16
+ }
17
+ return parsed;
18
+ };
19
+ exports.parseFloatWithDecimals = parseFloatWithDecimals;
20
+ const formateNumber = _ref2 => {
21
+ let {
22
+ number,
23
+ isMoneyInput
24
+ } = _ref2;
25
+ if (typeof number !== 'number') {
26
+ return '';
27
+ }
28
+ return number.toLocaleString('de-DE', {
29
+ useGrouping: true,
30
+ minimumFractionDigits: isMoneyInput ? 2 : undefined,
31
+ maximumFractionDigits: isMoneyInput ? 2 : undefined,
32
+ maximumSignificantDigits: !isMoneyInput ? 20 : undefined
33
+ });
34
+ };
35
+ exports.formateNumber = formateNumber;
36
+ const isValidString = _ref3 => {
37
+ let {
38
+ isDecimalInput,
39
+ isMoneyInput,
40
+ string
41
+ } = _ref3;
42
+ let isValid = false;
43
+
44
+ // Allows numbers, one (comma/point) and any number of decimal places
45
+ if (isDecimalInput && _number.DECIMAL_TEST.test(string)) {
46
+ isValid = true;
47
+ }
48
+
49
+ // Allows numbers but excludes numbers with leading 0
50
+ if (isMoneyInput && _number.MONEY_TEST.test(string)) {
51
+ isValid = true;
52
+ }
53
+
54
+ // Allows numbers but excludes numbers with leading 0
55
+ if (!isDecimalInput && !isMoneyInput && _number.INTEGER_TEST.test(string)) {
56
+ isValid = true;
57
+ }
58
+ if (string.length === 0) {
59
+ isValid = true;
60
+ }
61
+ return isValid;
62
+ };
63
+ exports.isValidString = isValidString;
64
+ //# sourceMappingURL=number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.js","names":["_number","require","parseFloatWithDecimals","_ref","stringValue","decimals","parsed","parseFloat","toFixed","exports","formateNumber","_ref2","number","isMoneyInput","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","_ref3","isDecimalInput","string","isValid","DECIMAL_TEST","test","MONEY_TEST","INTEGER_TEST","length"],"sources":["../../../../src/components/number-input/utils/number.ts"],"sourcesContent":["import { DECIMAL_TEST, INTEGER_TEST, MONEY_TEST } from '../constants/number';\n\ninterface ParseFloatWithDecimals {\n ({ stringValue, decimals }: { stringValue: string; decimals?: number }): number;\n}\n\nexport const parseFloatWithDecimals: ParseFloatWithDecimals = ({ stringValue, decimals }) => {\n const parsed = parseFloat(stringValue);\n\n if (decimals) {\n return parseFloat(parsed.toFixed(decimals));\n }\n\n return parsed;\n};\n\ninterface FormateNumberOptions {\n number: number | null;\n isMoneyInput?: boolean;\n}\n\nexport const formateNumber = ({ number, isMoneyInput }: FormateNumberOptions) => {\n if (typeof number !== 'number') {\n return '';\n }\n\n return number.toLocaleString('de-DE', {\n useGrouping: true,\n minimumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumSignificantDigits: !isMoneyInput ? 20 : undefined,\n });\n};\n\ninterface IsValidString {\n (config: {\n string: string;\n isDecimalInput?: boolean;\n isMoneyInput?: boolean;\n }): boolean;\n}\n\nexport const isValidString: IsValidString = (\n {\n isDecimalInput, isMoneyInput, string\n }) => {\n let isValid = false;\n\n // Allows numbers, one (comma/point) and any number of decimal places\n if (isDecimalInput && DECIMAL_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (isMoneyInput && MONEY_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (!isDecimalInput && !isMoneyInput && INTEGER_TEST.test(string)) {\n isValid = true;\n }\n\n if (string.length === 0) {\n isValid = true;\n\n }\n\n return isValid;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAMO,MAAMC,sBAA8C,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAAF,IAAA;EACpF,MAAMG,MAAM,GAAGC,UAAU,CAACH,WAAW,CAAC;EAEtC,IAAIC,QAAQ,EAAE;IACV,OAAOE,UAAU,CAACD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAAC;EAC/C;EAEA,OAAOC,MAAM;AACjB,CAAC;AAACG,OAAA,CAAAP,sBAAA,GAAAA,sBAAA;AAOK,MAAMQ,aAAa,GAAGC,KAAA,IAAoD;EAAA,IAAnD;IAAEC,MAAM;IAAEC;EAAmC,CAAC,GAAAF,KAAA;EACxE,IAAI,OAAOC,MAAM,KAAK,QAAQ,EAAE;IAC5B,OAAO,EAAE;EACb;EAEA,OAAOA,MAAM,CAACE,cAAc,CAAC,OAAO,EAAE;IAClCC,WAAW,EAAE,IAAI;IACjBC,qBAAqB,EAAEH,YAAY,GAAG,CAAC,GAAGI,SAAS;IACnDC,qBAAqB,EAAEL,YAAY,GAAG,CAAC,GAAGI,SAAS;IACnDE,wBAAwB,EAAE,CAACN,YAAY,GAAG,EAAE,GAAGI;EACnD,CAAC,CAAC;AACN,CAAC;AAACR,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAUK,MAAMU,aAA4B,GAAGC,KAAA,IAGlC;EAAA,IAFN;IACIC,cAAc;IAAET,YAAY;IAAEU;EAClC,CAAC,GAAAF,KAAA;EACD,IAAIG,OAAO,GAAG,KAAK;;EAEnB;EACA,IAAIF,cAAc,IAAIG,oBAAY,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IAC7CC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAIX,YAAY,IAAIc,kBAAU,CAACD,IAAI,CAACH,MAAM,CAAC,EAAE;IACzCC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAI,CAACF,cAAc,IAAI,CAACT,YAAY,IAAIe,oBAAY,CAACF,IAAI,CAACH,MAAM,CAAC,EAAE;IAC/DC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACM,MAAM,KAAK,CAAC,EAAE;IACrBL,OAAO,GAAG,IAAI;EAElB;EAEA,OAAOA,OAAO;AAClB,CAAC;AAACf,OAAA,CAAAW,aAAA,GAAAA,aAAA"}
@@ -0,0 +1,26 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { PopupRef } from './types';
3
+ export type PopupProps = {
4
+ /**
5
+ * The element over which the content of the `ContextMenu` should be displayed.
6
+ */
7
+ children?: ReactNode;
8
+ /**
9
+ * The content that should be displayed inside the popup.
10
+ */
11
+ content: ReactNode;
12
+ /**
13
+ * Function to be executed when the content of the Context menu has been hidden.
14
+ */
15
+ onHide?: VoidFunction;
16
+ /**
17
+ * Function to be executed when the content of the Context menu has been shown.
18
+ */
19
+ onShow?: VoidFunction;
20
+ /**
21
+ * Whether the popup should be opened on hover. If not, the popup will be opened on click.
22
+ */
23
+ shouldShowOnHover?: boolean;
24
+ };
25
+ declare const Popup: React.ForwardRefExoticComponent<PopupProps & React.RefAttributes<PopupRef>>;
26
+ export default Popup;
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _chaynsApi = require("chayns-api");
8
+ var _framerMotion = require("framer-motion");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactDom = require("react-dom");
11
+ var _uuid = require("../../hooks/uuid");
12
+ var _PopupContent = _interopRequireDefault(require("./popup-content/PopupContent"));
13
+ var _Popup = require("./Popup.styles");
14
+ var _types = require("./types");
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ const Popup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
19
+ let {
20
+ content,
21
+ onShow,
22
+ onHide,
23
+ children,
24
+ shouldShowOnHover = false
25
+ } = _ref;
26
+ const [coordinates, setCoordinates] = (0, _react.useState)({
27
+ x: 0,
28
+ y: 0
29
+ });
30
+ const container = document.querySelector('.tapp') || document.body;
31
+ const [alignment, setAlignment] = (0, _react.useState)(_types.PopupAlignment.TopLeft);
32
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
33
+ const [portal, setPortal] = (0, _react.useState)();
34
+ const [menuHeight, setMenuHeight] = (0, _react.useState)(0);
35
+ const uuid = (0, _uuid.useUuid)();
36
+
37
+ // ToDo: Replace with hook if new chayns api is ready
38
+ const popupContentRef = (0, _react.useRef)(null);
39
+ const popupPseudoContentRef = (0, _react.useRef)(null);
40
+ const popupRef = (0, _react.useRef)(null);
41
+ const handleShow = (0, _react.useCallback)(() => {
42
+ if (popupRef.current && popupPseudoContentRef.current) {
43
+ const {
44
+ height: pseudoHeight,
45
+ width: pseudoWidth
46
+ } = popupPseudoContentRef.current.getBoundingClientRect();
47
+ const {
48
+ height: childrenHeight,
49
+ left: childrenLeft,
50
+ top: childrenTop,
51
+ width: childrenWidth
52
+ } = popupRef.current.getBoundingClientRect();
53
+ if (pseudoHeight > childrenTop - 25) {
54
+ if (pseudoWidth > childrenLeft + childrenWidth / 2 - 25) {
55
+ setAlignment(_types.PopupAlignment.BottomRight);
56
+ } else {
57
+ setAlignment(_types.PopupAlignment.BottomLeft);
58
+ }
59
+ setCoordinates({
60
+ x: childrenLeft + childrenWidth / 2,
61
+ y: childrenTop + childrenHeight + 4
62
+ });
63
+ } else {
64
+ if (pseudoWidth > childrenLeft + childrenWidth / 2 - 25) {
65
+ setAlignment(_types.PopupAlignment.TopRight);
66
+ } else {
67
+ setAlignment(_types.PopupAlignment.TopLeft);
68
+ }
69
+ setCoordinates({
70
+ x: childrenLeft + childrenWidth / 2,
71
+ y: childrenTop - 4
72
+ });
73
+ }
74
+ setIsOpen(true);
75
+ }
76
+ }, []);
77
+ const handleChildrenClick = () => {
78
+ if (!shouldShowOnHover) {
79
+ handleShow();
80
+ }
81
+ };
82
+ const handleHide = (0, _react.useCallback)(() => {
83
+ setIsOpen(false);
84
+ }, []);
85
+ const handleMouseEnter = () => {
86
+ if (shouldShowOnHover) {
87
+ handleShow();
88
+ }
89
+ };
90
+ const handleMouseLeave = () => {
91
+ if (shouldShowOnHover) {
92
+ handleHide();
93
+ }
94
+ };
95
+ const handleDocumentClick = (0, _react.useCallback)(event => {
96
+ if (!popupContentRef.current?.contains(event.target)) {
97
+ event.preventDefault();
98
+ event.stopPropagation();
99
+ if (!shouldShowOnHover) {
100
+ handleHide();
101
+ }
102
+ }
103
+ }, [handleHide, shouldShowOnHover]);
104
+ (0, _react.useImperativeHandle)(ref, () => ({
105
+ hide: handleHide,
106
+ show: handleShow
107
+ }), [handleHide, handleShow]);
108
+ (0, _react.useEffect)(() => {
109
+ void (0, _chaynsApi.getWindowMetrics)().then(result => {
110
+ if (result.topBarHeight) {
111
+ setMenuHeight(result.topBarHeight);
112
+ }
113
+ });
114
+ }, []);
115
+ (0, _react.useEffect)(() => {
116
+ if (isOpen) {
117
+ document.addEventListener('click', handleDocumentClick, true);
118
+ window.addEventListener('blur', handleHide);
119
+ if (typeof onShow === 'function') {
120
+ onShow();
121
+ }
122
+ } else if (typeof onHide === 'function') {
123
+ onHide();
124
+ }
125
+ return () => {
126
+ document.removeEventListener('click', handleDocumentClick, true);
127
+ window.removeEventListener('blur', handleHide);
128
+ };
129
+ }, [handleDocumentClick, handleHide, isOpen, onHide, onShow]);
130
+ (0, _react.useEffect)(() => {
131
+ setPortal(() => /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
132
+ initial: false
133
+ }, isOpen && /*#__PURE__*/_react.default.createElement(_PopupContent.default, {
134
+ coordinates: coordinates,
135
+ content: content,
136
+ key: `tooltip_${uuid}`,
137
+ alignment: alignment,
138
+ ref: popupContentRef
139
+ })), container));
140
+ }, [alignment, container, content, coordinates, isOpen, uuid]);
141
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Popup.StyledPopupPseudo, {
142
+ ref: popupPseudoContentRef,
143
+ menuHeight: menuHeight
144
+ }, content), /*#__PURE__*/_react.default.createElement(_Popup.StyledPopup, {
145
+ ref: popupRef,
146
+ onClick: handleChildrenClick,
147
+ onMouseLeave: handleMouseLeave,
148
+ onMouseEnter: handleMouseEnter
149
+ }, children), portal);
150
+ });
151
+ Popup.displayName = 'Popup';
152
+ var _default = exports.default = Popup;
153
+ //# sourceMappingURL=Popup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popup.js","names":["_chaynsApi","require","_framerMotion","_react","_interopRequireWildcard","_reactDom","_uuid","_PopupContent","_interopRequireDefault","_Popup","_types","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Popup","forwardRef","_ref","ref","content","onShow","onHide","children","shouldShowOnHover","coordinates","setCoordinates","useState","x","y","container","document","querySelector","body","alignment","setAlignment","PopupAlignment","TopLeft","isOpen","setIsOpen","portal","setPortal","menuHeight","setMenuHeight","uuid","useUuid","popupContentRef","useRef","popupPseudoContentRef","popupRef","handleShow","useCallback","current","height","pseudoHeight","width","pseudoWidth","getBoundingClientRect","childrenHeight","left","childrenLeft","top","childrenTop","childrenWidth","BottomRight","BottomLeft","TopRight","handleChildrenClick","handleHide","handleMouseEnter","handleMouseLeave","handleDocumentClick","event","contains","target","preventDefault","stopPropagation","useImperativeHandle","hide","show","useEffect","getWindowMetrics","then","result","topBarHeight","addEventListener","window","removeEventListener","createPortal","createElement","AnimatePresence","initial","key","Fragment","StyledPopupPseudo","StyledPopup","onClick","onMouseLeave","onMouseEnter","displayName","_default","exports"],"sources":["../../../src/components/popup/Popup.tsx"],"sourcesContent":["import { getWindowMetrics } from 'chayns-api';\nimport { AnimatePresence } from 'framer-motion';\nimport React, {\n forwardRef,\n ReactNode,\n ReactPortal,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useUuid } from '../../hooks/uuid';\nimport PopupContent from './popup-content/PopupContent';\nimport { StyledPopup, StyledPopupPseudo } from './Popup.styles';\nimport { PopupAlignment, PopupCoordinates, PopupRef } from './types';\n\nexport type PopupProps = {\n /**\n * The element over which the content of the `ContextMenu` should be displayed.\n */\n children?: ReactNode;\n /**\n * The content that should be displayed inside the popup.\n */\n content: ReactNode;\n /**\n * Function to be executed when the content of the Context menu has been hidden.\n */\n onHide?: VoidFunction;\n /**\n * Function to be executed when the content of the Context menu has been shown.\n */\n onShow?: VoidFunction;\n /**\n * Whether the popup should be opened on hover. If not, the popup will be opened on click.\n */\n shouldShowOnHover?: boolean;\n};\n\nconst Popup = forwardRef<PopupRef, PopupProps>(\n ({ content, onShow, onHide, children, shouldShowOnHover = false }, ref) => {\n const [coordinates, setCoordinates] = useState<PopupCoordinates>({\n x: 0,\n y: 0,\n });\n const container = document.querySelector('.tapp') || document.body;\n\n const [alignment, setAlignment] = useState<PopupAlignment>(PopupAlignment.TopLeft);\n const [isOpen, setIsOpen] = useState(false);\n const [portal, setPortal] = useState<ReactPortal>();\n const [menuHeight, setMenuHeight] = useState(0);\n\n const uuid = useUuid();\n\n // ToDo: Replace with hook if new chayns api is ready\n const popupContentRef = useRef<HTMLDivElement>(null);\n const popupPseudoContentRef = useRef<HTMLDivElement>(null);\n const popupRef = useRef<HTMLDivElement>(null);\n\n const handleShow = useCallback(() => {\n if (popupRef.current && popupPseudoContentRef.current) {\n const { height: pseudoHeight, width: pseudoWidth } =\n popupPseudoContentRef.current.getBoundingClientRect();\n\n const {\n height: childrenHeight,\n left: childrenLeft,\n top: childrenTop,\n width: childrenWidth,\n } = popupRef.current.getBoundingClientRect();\n\n if (pseudoHeight > childrenTop - 25) {\n if (pseudoWidth > childrenLeft + childrenWidth / 2 - 25) {\n setAlignment(PopupAlignment.BottomRight);\n } else {\n setAlignment(PopupAlignment.BottomLeft);\n }\n\n setCoordinates({\n x: childrenLeft + childrenWidth / 2,\n y: childrenTop + childrenHeight + 4,\n });\n } else {\n if (pseudoWidth > childrenLeft + childrenWidth / 2 - 25) {\n setAlignment(PopupAlignment.TopRight);\n } else {\n setAlignment(PopupAlignment.TopLeft);\n }\n\n setCoordinates({\n x: childrenLeft + childrenWidth / 2,\n y: childrenTop - 4,\n });\n }\n\n setIsOpen(true);\n }\n }, []);\n\n const handleChildrenClick = () => {\n if (!shouldShowOnHover) {\n handleShow();\n }\n };\n\n const handleHide = useCallback(() => {\n setIsOpen(false);\n }, []);\n\n const handleMouseEnter = () => {\n if (shouldShowOnHover) {\n handleShow();\n }\n };\n\n const handleMouseLeave = () => {\n if (shouldShowOnHover) {\n handleHide();\n }\n };\n\n const handleDocumentClick = useCallback<EventListener>(\n (event) => {\n if (!popupContentRef.current?.contains(event.target as Node)) {\n event.preventDefault();\n event.stopPropagation();\n\n if (!shouldShowOnHover) {\n handleHide();\n }\n }\n },\n [handleHide, shouldShowOnHover]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleHide,\n show: handleShow,\n }),\n [handleHide, handleShow]\n );\n\n useEffect(() => {\n void getWindowMetrics().then((result) => {\n if (result.topBarHeight) {\n setMenuHeight(result.topBarHeight);\n }\n });\n }, []);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n\n if (typeof onShow === 'function') {\n onShow();\n }\n } else if (typeof onHide === 'function') {\n onHide();\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleDocumentClick, handleHide, isOpen, onHide, onShow]);\n\n useEffect(() => {\n setPortal(() =>\n createPortal(\n <AnimatePresence initial={false}>\n {isOpen && (\n <PopupContent\n coordinates={coordinates}\n content={content}\n key={`tooltip_${uuid}`}\n alignment={alignment}\n ref={popupContentRef}\n />\n )}\n </AnimatePresence>,\n container\n )\n );\n }, [alignment, container, content, coordinates, isOpen, uuid]);\n\n return (\n <>\n <StyledPopupPseudo ref={popupPseudoContentRef} menuHeight={menuHeight}>\n {content}\n </StyledPopupPseudo>\n <StyledPopup\n ref={popupRef}\n onClick={handleChildrenClick}\n onMouseLeave={handleMouseLeave}\n onMouseEnter={handleMouseEnter}\n >\n {children}\n </StyledPopup>\n {portal}\n </>\n );\n }\n);\n\nP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