intergalactic 15.122.0 → 15.124.0-prerelease.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 (584) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/accordion/lib/cjs/Accordion.js +9 -9
  3. package/accordion/lib/es6/Accordion.js +9 -9
  4. package/accordion/package.json +1 -1
  5. package/add-filter/AddFilter.d.ts +3 -0
  6. package/add-filter/AddFilter.types.d.ts +62 -0
  7. package/add-filter/components/AddFilterDropdown.d.ts +4 -0
  8. package/add-filter/components/AddFilterInput.d.ts +4 -0
  9. package/add-filter/components/AddFilterSelect.d.ts +3 -0
  10. package/add-filter/index.d.ts +3 -0
  11. package/add-filter/index.js +8 -0
  12. package/add-filter/index.mjs +2 -0
  13. package/add-filter/lib/cjs/AddFilter.js +336 -0
  14. package/add-filter/lib/cjs/AddFilter.js.map +1 -0
  15. package/add-filter/lib/cjs/AddFilter.types.js +2 -0
  16. package/add-filter/lib/cjs/AddFilter.types.js.map +1 -0
  17. package/add-filter/lib/cjs/components/AddFilterDropdown.js +92 -0
  18. package/add-filter/lib/cjs/components/AddFilterDropdown.js.map +1 -0
  19. package/add-filter/lib/cjs/components/AddFilterInput.js +87 -0
  20. package/add-filter/lib/cjs/components/AddFilterInput.js.map +1 -0
  21. package/add-filter/lib/cjs/components/AddFilterSelect.js +103 -0
  22. package/add-filter/lib/cjs/components/AddFilterSelect.js.map +1 -0
  23. package/add-filter/lib/cjs/index.js +38 -0
  24. package/add-filter/lib/cjs/index.js.map +1 -0
  25. package/add-filter/lib/cjs/translations/__intergalactic-dynamic-locales.js +39 -0
  26. package/add-filter/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
  27. package/add-filter/lib/cjs/translations/de.json +4 -0
  28. package/add-filter/lib/cjs/translations/en.json +5 -0
  29. package/add-filter/lib/cjs/translations/es.json +4 -0
  30. package/add-filter/lib/cjs/translations/fr.json +4 -0
  31. package/add-filter/lib/cjs/translations/it.json +4 -0
  32. package/add-filter/lib/cjs/translations/ja.json +4 -0
  33. package/add-filter/lib/cjs/translations/ko.json +4 -0
  34. package/add-filter/lib/cjs/translations/nl.json +4 -0
  35. package/add-filter/lib/cjs/translations/pl.json +4 -0
  36. package/add-filter/lib/cjs/translations/pt.json +4 -0
  37. package/add-filter/lib/cjs/translations/sv.json +4 -0
  38. package/add-filter/lib/cjs/translations/tr.json +4 -0
  39. package/add-filter/lib/cjs/translations/vi.json +4 -0
  40. package/add-filter/lib/cjs/translations/zh.json +4 -0
  41. package/add-filter/lib/es6/AddFilter.js +328 -0
  42. package/add-filter/lib/es6/AddFilter.js.map +1 -0
  43. package/add-filter/lib/es6/AddFilter.types.js +2 -0
  44. package/add-filter/lib/es6/AddFilter.types.js.map +1 -0
  45. package/add-filter/lib/es6/components/AddFilterDropdown.js +84 -0
  46. package/add-filter/lib/es6/components/AddFilterDropdown.js.map +1 -0
  47. package/add-filter/lib/es6/components/AddFilterInput.js +80 -0
  48. package/add-filter/lib/es6/components/AddFilterInput.js.map +1 -0
  49. package/add-filter/lib/es6/components/AddFilterSelect.js +95 -0
  50. package/add-filter/lib/es6/components/AddFilterSelect.js.map +1 -0
  51. package/add-filter/lib/es6/index.js +4 -0
  52. package/add-filter/lib/es6/index.js.map +1 -0
  53. package/add-filter/lib/es6/translations/__intergalactic-dynamic-locales.js +31 -0
  54. package/add-filter/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
  55. package/add-filter/lib/es6/translations/de.json +4 -0
  56. package/add-filter/lib/es6/translations/en.json +5 -0
  57. package/add-filter/lib/es6/translations/es.json +4 -0
  58. package/add-filter/lib/es6/translations/fr.json +4 -0
  59. package/add-filter/lib/es6/translations/it.json +4 -0
  60. package/add-filter/lib/es6/translations/ja.json +4 -0
  61. package/add-filter/lib/es6/translations/ko.json +4 -0
  62. package/add-filter/lib/es6/translations/nl.json +4 -0
  63. package/add-filter/lib/es6/translations/pl.json +4 -0
  64. package/add-filter/lib/es6/translations/pt.json +4 -0
  65. package/add-filter/lib/es6/translations/sv.json +4 -0
  66. package/add-filter/lib/es6/translations/tr.json +4 -0
  67. package/add-filter/lib/es6/translations/vi.json +4 -0
  68. package/add-filter/lib/es6/translations/zh.json +4 -0
  69. package/add-filter/lib/types/AddFilter.d.ts +3 -0
  70. package/add-filter/lib/types/AddFilter.types.d.ts +62 -0
  71. package/add-filter/lib/types/components/AddFilterDropdown.d.ts +4 -0
  72. package/add-filter/lib/types/components/AddFilterInput.d.ts +4 -0
  73. package/add-filter/lib/types/components/AddFilterSelect.d.ts +3 -0
  74. package/add-filter/lib/types/index.d.ts +3 -0
  75. package/add-filter/lib/types/translations/__intergalactic-dynamic-locales.d.ts +59 -0
  76. package/add-filter/package.json +1 -0
  77. package/add-filter/translations/__intergalactic-dynamic-locales.d.ts +59 -0
  78. package/animation/lib/cjs/Animation.js +11 -11
  79. package/animation/lib/cjs/Collapse.js +28 -28
  80. package/animation/lib/cjs/FadeInOut.js +28 -28
  81. package/animation/lib/cjs/Scale.js +28 -28
  82. package/animation/lib/cjs/Slide.js +28 -28
  83. package/animation/lib/cjs/Transform.js +28 -28
  84. package/animation/lib/es6/Animation.js +11 -11
  85. package/animation/lib/es6/Collapse.js +28 -28
  86. package/animation/lib/es6/FadeInOut.js +28 -28
  87. package/animation/lib/es6/Scale.js +28 -28
  88. package/animation/lib/es6/Slide.js +28 -28
  89. package/animation/lib/es6/Transform.js +28 -28
  90. package/animation/package.json +1 -1
  91. package/badge/lib/cjs/Badge.js +6 -6
  92. package/badge/lib/es6/Badge.js +6 -6
  93. package/badge/package.json +1 -1
  94. package/base-trigger/lib/cjs/BaseTrigger.js +18 -18
  95. package/base-trigger/lib/cjs/ButtonTrigger.js +3 -3
  96. package/base-trigger/lib/cjs/FilterTrigger.js +7 -7
  97. package/base-trigger/lib/cjs/LinkTrigger.js +12 -12
  98. package/base-trigger/lib/es6/BaseTrigger.js +18 -18
  99. package/base-trigger/lib/es6/ButtonTrigger.js +3 -3
  100. package/base-trigger/lib/es6/FilterTrigger.js +7 -7
  101. package/base-trigger/lib/es6/LinkTrigger.js +12 -12
  102. package/base-trigger/package.json +1 -1
  103. package/breadcrumbs/lib/cjs/Breadcrumbs.js +8 -8
  104. package/breadcrumbs/lib/es6/Breadcrumbs.js +8 -8
  105. package/breadcrumbs/package.json +1 -1
  106. package/breakpoints/package.json +1 -1
  107. package/bulk-textarea/BulkTextarea.d.ts +3 -0
  108. package/bulk-textarea/BulkTextarea.types.d.ts +33 -0
  109. package/bulk-textarea/components/ClearAll.d.ts +7 -0
  110. package/bulk-textarea/components/Counter.d.ts +10 -0
  111. package/bulk-textarea/components/ErrorsNavigation.d.ts +15 -0
  112. package/bulk-textarea/components/InputField/InputField.d.ts +98 -0
  113. package/bulk-textarea/components/InputField/InputField.types.d.ts +157 -0
  114. package/bulk-textarea/index.d.ts +3 -0
  115. package/bulk-textarea/index.js +8 -0
  116. package/bulk-textarea/index.mjs +2 -0
  117. package/bulk-textarea/lib/cjs/BulkTextarea.js +318 -0
  118. package/bulk-textarea/lib/cjs/BulkTextarea.js.map +1 -0
  119. package/bulk-textarea/lib/cjs/BulkTextarea.types.js +2 -0
  120. package/bulk-textarea/lib/cjs/BulkTextarea.types.js.map +1 -0
  121. package/bulk-textarea/lib/cjs/components/ClearAll.js +23 -0
  122. package/bulk-textarea/lib/cjs/components/ClearAll.js.map +1 -0
  123. package/bulk-textarea/lib/cjs/components/Counter.js +27 -0
  124. package/bulk-textarea/lib/cjs/components/Counter.js.map +1 -0
  125. package/bulk-textarea/lib/cjs/components/ErrorsNavigation.js +57 -0
  126. package/bulk-textarea/lib/cjs/components/ErrorsNavigation.js.map +1 -0
  127. package/bulk-textarea/lib/cjs/components/InputField/InputField.js +1110 -0
  128. package/bulk-textarea/lib/cjs/components/InputField/InputField.js.map +1 -0
  129. package/bulk-textarea/lib/cjs/components/InputField/InputField.types.js +2 -0
  130. package/bulk-textarea/lib/cjs/components/InputField/InputField.types.js.map +1 -0
  131. package/bulk-textarea/lib/cjs/components/InputField/inputField.shadow.css +160 -0
  132. package/bulk-textarea/lib/cjs/index.js +14 -0
  133. package/bulk-textarea/lib/cjs/index.js.map +1 -0
  134. package/bulk-textarea/lib/cjs/translations/__intergalactic-dynamic-locales.js +39 -0
  135. package/bulk-textarea/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
  136. package/bulk-textarea/lib/cjs/translations/de.json +10 -0
  137. package/bulk-textarea/lib/cjs/translations/en.json +10 -0
  138. package/bulk-textarea/lib/cjs/translations/es.json +10 -0
  139. package/bulk-textarea/lib/cjs/translations/fr.json +10 -0
  140. package/bulk-textarea/lib/cjs/translations/it.json +10 -0
  141. package/bulk-textarea/lib/cjs/translations/ja.json +10 -0
  142. package/bulk-textarea/lib/cjs/translations/ko.json +10 -0
  143. package/bulk-textarea/lib/cjs/translations/nl.json +10 -0
  144. package/bulk-textarea/lib/cjs/translations/pl.json +10 -0
  145. package/bulk-textarea/lib/cjs/translations/pt.json +10 -0
  146. package/bulk-textarea/lib/cjs/translations/sv.json +10 -0
  147. package/bulk-textarea/lib/cjs/translations/tr.json +10 -0
  148. package/bulk-textarea/lib/cjs/translations/vi.json +10 -0
  149. package/bulk-textarea/lib/cjs/translations/zh.json +10 -0
  150. package/bulk-textarea/lib/es6/BulkTextarea.js +310 -0
  151. package/bulk-textarea/lib/es6/BulkTextarea.js.map +1 -0
  152. package/bulk-textarea/lib/es6/BulkTextarea.types.js +2 -0
  153. package/bulk-textarea/lib/es6/BulkTextarea.types.js.map +1 -0
  154. package/bulk-textarea/lib/es6/components/ClearAll.js +17 -0
  155. package/bulk-textarea/lib/es6/components/ClearAll.js.map +1 -0
  156. package/bulk-textarea/lib/es6/components/Counter.js +21 -0
  157. package/bulk-textarea/lib/es6/components/Counter.js.map +1 -0
  158. package/bulk-textarea/lib/es6/components/ErrorsNavigation.js +50 -0
  159. package/bulk-textarea/lib/es6/components/ErrorsNavigation.js.map +1 -0
  160. package/bulk-textarea/lib/es6/components/InputField/InputField.js +1104 -0
  161. package/bulk-textarea/lib/es6/components/InputField/InputField.js.map +1 -0
  162. package/bulk-textarea/lib/es6/components/InputField/InputField.types.js +2 -0
  163. package/bulk-textarea/lib/es6/components/InputField/InputField.types.js.map +1 -0
  164. package/bulk-textarea/lib/es6/components/InputField/inputField.shadow.css +160 -0
  165. package/bulk-textarea/lib/es6/index.js +2 -0
  166. package/bulk-textarea/lib/es6/index.js.map +1 -0
  167. package/bulk-textarea/lib/es6/translations/__intergalactic-dynamic-locales.js +31 -0
  168. package/bulk-textarea/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
  169. package/bulk-textarea/lib/es6/translations/de.json +10 -0
  170. package/bulk-textarea/lib/es6/translations/en.json +10 -0
  171. package/bulk-textarea/lib/es6/translations/es.json +10 -0
  172. package/bulk-textarea/lib/es6/translations/fr.json +10 -0
  173. package/bulk-textarea/lib/es6/translations/it.json +10 -0
  174. package/bulk-textarea/lib/es6/translations/ja.json +10 -0
  175. package/bulk-textarea/lib/es6/translations/ko.json +10 -0
  176. package/bulk-textarea/lib/es6/translations/nl.json +10 -0
  177. package/bulk-textarea/lib/es6/translations/pl.json +10 -0
  178. package/bulk-textarea/lib/es6/translations/pt.json +10 -0
  179. package/bulk-textarea/lib/es6/translations/sv.json +10 -0
  180. package/bulk-textarea/lib/es6/translations/tr.json +10 -0
  181. package/bulk-textarea/lib/es6/translations/vi.json +10 -0
  182. package/bulk-textarea/lib/es6/translations/zh.json +10 -0
  183. package/bulk-textarea/lib/types/BulkTextarea.d.ts +3 -0
  184. package/bulk-textarea/lib/types/BulkTextarea.types.d.ts +33 -0
  185. package/bulk-textarea/lib/types/components/ClearAll.d.ts +7 -0
  186. package/bulk-textarea/lib/types/components/Counter.d.ts +10 -0
  187. package/bulk-textarea/lib/types/components/ErrorsNavigation.d.ts +15 -0
  188. package/bulk-textarea/lib/types/components/InputField/InputField.d.ts +98 -0
  189. package/bulk-textarea/lib/types/components/InputField/InputField.types.d.ts +157 -0
  190. package/bulk-textarea/lib/types/index.d.ts +3 -0
  191. package/bulk-textarea/lib/types/translations/__intergalactic-dynamic-locales.d.ts +142 -0
  192. package/bulk-textarea/package.json +1 -0
  193. package/bulk-textarea/translations/__intergalactic-dynamic-locales.d.ts +142 -0
  194. package/button/lib/cjs/component/Button/Button.js +27 -27
  195. package/button/lib/cjs/component/Button/button.shadow.css +1 -1
  196. package/button/lib/cjs/component/ButtonLink/ButtonLink.js +20 -20
  197. package/button/lib/es6/component/Button/Button.js +27 -27
  198. package/button/lib/es6/component/Button/button.shadow.css +1 -1
  199. package/button/lib/es6/component/ButtonLink/ButtonLink.js +20 -20
  200. package/button/package.json +1 -1
  201. package/card/lib/cjs/Card.js +6 -6
  202. package/card/lib/es6/Card.js +6 -6
  203. package/card/package.json +1 -1
  204. package/carousel/lib/cjs/Carousel.js +21 -21
  205. package/carousel/lib/es6/Carousel.js +21 -21
  206. package/carousel/package.json +1 -1
  207. package/checkbox/lib/cjs/Checkbox.js +18 -18
  208. package/checkbox/lib/es6/Checkbox.js +18 -18
  209. package/checkbox/package.json +1 -1
  210. package/color-picker/lib/cjs/ColorPicker.js +24 -24
  211. package/color-picker/lib/cjs/PaletteManager.js +24 -24
  212. package/color-picker/lib/cjs/components/InputColor.js +24 -24
  213. package/color-picker/lib/es6/ColorPicker.js +24 -24
  214. package/color-picker/lib/es6/PaletteManager.js +24 -24
  215. package/color-picker/lib/es6/components/InputColor.js +24 -24
  216. package/color-picker/package.json +1 -1
  217. package/components.json +75 -73
  218. package/core/package.json +1 -1
  219. package/counter/lib/cjs/Counter.js +11 -11
  220. package/counter/lib/cjs/style/counter.shadow.css +1 -0
  221. package/counter/lib/es6/Counter.js +11 -11
  222. package/counter/lib/es6/style/counter.shadow.css +1 -0
  223. package/counter/package.json +1 -1
  224. package/d3-chart/lib/cjs/Area.js +11 -11
  225. package/d3-chart/lib/cjs/Axis.js +14 -14
  226. package/d3-chart/lib/cjs/Bar.js +16 -16
  227. package/d3-chart/lib/cjs/Bubble.js +12 -12
  228. package/d3-chart/lib/cjs/CompactHorizontalBar.js +16 -16
  229. package/d3-chart/lib/cjs/Donut.js +9 -9
  230. package/d3-chart/lib/cjs/Dots.js +8 -8
  231. package/d3-chart/lib/cjs/HorizontalBar.js +16 -16
  232. package/d3-chart/lib/cjs/Hover.js +3 -3
  233. package/d3-chart/lib/cjs/Line.js +9 -9
  234. package/d3-chart/lib/cjs/Plot.js +3 -3
  235. package/d3-chart/lib/cjs/Radar.js +19 -19
  236. package/d3-chart/lib/cjs/RadialTree.js +12 -12
  237. package/d3-chart/lib/cjs/Reference.js +12 -12
  238. package/d3-chart/lib/cjs/ScatterPlot.js +9 -9
  239. package/d3-chart/lib/cjs/Tooltip.js +9 -9
  240. package/d3-chart/lib/cjs/Venn.js +9 -9
  241. package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
  242. package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
  243. package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  244. package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  245. package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  246. package/d3-chart/lib/es6/Area.js +11 -11
  247. package/d3-chart/lib/es6/Axis.js +14 -14
  248. package/d3-chart/lib/es6/Bar.js +16 -16
  249. package/d3-chart/lib/es6/Bubble.js +12 -12
  250. package/d3-chart/lib/es6/CompactHorizontalBar.js +16 -16
  251. package/d3-chart/lib/es6/Donut.js +9 -9
  252. package/d3-chart/lib/es6/Dots.js +8 -8
  253. package/d3-chart/lib/es6/HorizontalBar.js +16 -16
  254. package/d3-chart/lib/es6/Hover.js +3 -3
  255. package/d3-chart/lib/es6/Line.js +9 -9
  256. package/d3-chart/lib/es6/Plot.js +3 -3
  257. package/d3-chart/lib/es6/Radar.js +19 -19
  258. package/d3-chart/lib/es6/RadialTree.js +12 -12
  259. package/d3-chart/lib/es6/Reference.js +12 -12
  260. package/d3-chart/lib/es6/ScatterPlot.js +9 -9
  261. package/d3-chart/lib/es6/Tooltip.js +9 -9
  262. package/d3-chart/lib/es6/Venn.js +9 -9
  263. package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
  264. package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
  265. package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  266. package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  267. package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  268. package/d3-chart/package.json +1 -1
  269. package/data-table/lib/cjs/Body.js +4 -4
  270. package/data-table/lib/cjs/Body.js.map +1 -1
  271. package/data-table/lib/cjs/DataTable.js +36 -36
  272. package/data-table/lib/es6/Body.js +4 -4
  273. package/data-table/lib/es6/Body.js.map +1 -1
  274. package/data-table/lib/es6/DataTable.js +36 -36
  275. package/data-table/package.json +1 -1
  276. package/date-picker/lib/cjs/components/Calendar.js +21 -21
  277. package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js +29 -29
  278. package/date-picker/lib/cjs/components/InputTrigger.js +31 -30
  279. package/date-picker/lib/cjs/components/InputTrigger.js.map +1 -1
  280. package/date-picker/lib/cjs/components/PickerAbstract.js +29 -29
  281. package/date-picker/lib/cjs/components/RangePickerAbstract.js +29 -29
  282. package/date-picker/lib/es6/components/Calendar.js +21 -21
  283. package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js +29 -29
  284. package/date-picker/lib/es6/components/InputTrigger.js +31 -30
  285. package/date-picker/lib/es6/components/InputTrigger.js.map +1 -1
  286. package/date-picker/lib/es6/components/PickerAbstract.js +29 -29
  287. package/date-picker/lib/es6/components/RangePickerAbstract.js +29 -29
  288. package/date-picker/package.json +1 -1
  289. package/divider/lib/cjs/Divider.js +10 -10
  290. package/divider/lib/es6/Divider.js +10 -10
  291. package/divider/package.json +1 -1
  292. package/dot/lib/cjs/Dot.js +10 -10
  293. package/dot/lib/es6/Dot.js +10 -10
  294. package/dot/package.json +1 -1
  295. package/drag-and-drop/lib/cjs/DragAndDrop.js +17 -17
  296. package/drag-and-drop/lib/es6/DragAndDrop.js +17 -17
  297. package/drag-and-drop/package.json +1 -1
  298. package/dropdown/lib/cjs/Dropdown.js +16 -16
  299. package/dropdown/lib/es6/Dropdown.js +16 -16
  300. package/dropdown/package.json +1 -1
  301. package/dropdown-menu/lib/cjs/DropdownMenu.js +18 -18
  302. package/dropdown-menu/lib/es6/DropdownMenu.js +18 -18
  303. package/dropdown-menu/package.json +1 -1
  304. package/ellipsis/lib/cjs/Ellipsis.js +10 -10
  305. package/ellipsis/lib/es6/Ellipsis.js +10 -10
  306. package/ellipsis/package.json +1 -1
  307. package/errors/lib/cjs/Error.js +9 -9
  308. package/errors/lib/es6/Error.js +9 -9
  309. package/errors/package.json +1 -1
  310. package/feature-popover/lib/cjs/FeaturePopover.js +11 -11
  311. package/feature-popover/lib/es6/FeaturePopover.js +11 -11
  312. package/feature-popover/package.json +1 -1
  313. package/feedback-form/component/feedback-rating/FeedbackRating.type.d.ts +3 -1
  314. package/feedback-form/lib/cjs/FeedbackForm.js +7 -7
  315. package/feedback-form/lib/cjs/component/checkbox-button/CheckboxButton.js +3 -3
  316. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.js +14 -9
  317. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
  318. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -1
  319. package/feedback-form/lib/cjs/component/slider-rating/SliderRating.js +7 -7
  320. package/feedback-form/lib/es6/FeedbackForm.js +7 -7
  321. package/feedback-form/lib/es6/component/checkbox-button/CheckboxButton.js +3 -3
  322. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.js +14 -9
  323. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
  324. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -1
  325. package/feedback-form/lib/es6/component/slider-rating/SliderRating.js +7 -7
  326. package/feedback-form/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +3 -1
  327. package/feedback-form/package.json +1 -1
  328. package/flags/lib/cjs/Flags.js +3 -3
  329. package/flags/lib/es6/Flags.js +3 -3
  330. package/flags/lib/sprites/sprite@1x.css +256 -256
  331. package/flags/lib/sprites/sprite@2x.css +257 -257
  332. package/flags/package.json +1 -1
  333. package/flex-box/lib/cjs/Box/useBox.js +3 -3
  334. package/flex-box/lib/cjs/Flex/useFlex.js +3 -3
  335. package/flex-box/lib/cjs/invalid-state-box/InvalidStateBox.js +2 -2
  336. package/flex-box/lib/cjs/screen-reader-only-box/ScreenReaderOnlyBox.js +2 -2
  337. package/flex-box/lib/es6/Box/useBox.js +3 -3
  338. package/flex-box/lib/es6/Flex/useFlex.js +3 -3
  339. package/flex-box/lib/es6/invalid-state-box/InvalidStateBox.js +2 -2
  340. package/flex-box/lib/es6/screen-reader-only-box/ScreenReaderOnlyBox.js +2 -2
  341. package/flex-box/package.json +1 -1
  342. package/format-text/lib/cjs/FormatText.js +5 -5
  343. package/format-text/lib/es6/FormatText.js +5 -5
  344. package/format-text/package.json +1 -1
  345. package/fullscreen-modal/lib/cjs/FullscreenModal.js +13 -13
  346. package/fullscreen-modal/lib/es6/FullscreenModal.js +13 -13
  347. package/fullscreen-modal/package.json +1 -1
  348. package/grid/lib/cjs/Grid.js +114 -114
  349. package/grid/lib/es6/Grid.js +114 -114
  350. package/grid/package.json +1 -1
  351. package/i18n-unplugin/package.json +1 -1
  352. package/icon/color/Confluence/l/index.js +4 -4
  353. package/icon/color/Confluence/l/index.mjs +4 -4
  354. package/icon/color/Confluence/m/index.js +4 -4
  355. package/icon/color/Confluence/m/index.mjs +4 -4
  356. package/icon/color/Copilot/l/index.d.ts +6 -0
  357. package/icon/color/Copilot/l/index.js +79 -0
  358. package/icon/color/Copilot/l/index.mjs +67 -0
  359. package/icon/color/Copilot/m/index.d.ts +6 -0
  360. package/icon/color/Copilot/m/index.js +79 -0
  361. package/icon/color/Copilot/m/index.mjs +67 -0
  362. package/icon/color/MetaColored/l/index.js +4 -4
  363. package/icon/color/MetaColored/l/index.mjs +4 -4
  364. package/icon/color/MetaColored/m/index.js +4 -4
  365. package/icon/color/MetaColored/m/index.mjs +4 -4
  366. package/icon/color/MicrosoftOffice/l/index.js +10 -10
  367. package/icon/color/MicrosoftOffice/l/index.mjs +10 -10
  368. package/icon/color/MicrosoftOffice/m/index.js +10 -10
  369. package/icon/color/MicrosoftOffice/m/index.mjs +10 -10
  370. package/icon/lib/cjs/Icon.js +5 -5
  371. package/icon/lib/es6/Icon.js +5 -5
  372. package/icon/package.json +1 -1
  373. package/icon/pay/Discover/l/index.js +1 -1
  374. package/icon/pay/Discover/l/index.mjs +1 -1
  375. package/icon/pay/Discover/m/index.js +1 -1
  376. package/icon/pay/Discover/m/index.mjs +1 -1
  377. package/icon/pay/JCB/l/index.js +10 -10
  378. package/icon/pay/JCB/l/index.mjs +10 -10
  379. package/icon/pay/JCB/m/index.js +10 -10
  380. package/icon/pay/JCB/m/index.mjs +10 -10
  381. package/icon/pay/Visa/l/index.js +2 -2
  382. package/icon/pay/Visa/l/index.mjs +2 -2
  383. package/icon/pay/Visa/m/index.js +2 -2
  384. package/icon/pay/Visa/m/index.mjs +2 -2
  385. package/illustration/lib/cjs/index.js +1 -1
  386. package/illustration/lib/es6/index.js +1 -1
  387. package/illustration/package.json +1 -1
  388. package/inline-edit/lib/cjs/InlineEdit.js +4 -4
  389. package/inline-edit/lib/es6/InlineEdit.js +4 -4
  390. package/inline-edit/package.json +1 -1
  391. package/inline-input/lib/cjs/InlineInput.js +14 -14
  392. package/inline-input/lib/es6/InlineInput.js +14 -14
  393. package/inline-input/package.json +1 -1
  394. package/input/lib/cjs/Input.js +17 -17
  395. package/input/lib/es6/Input.js +17 -17
  396. package/input/package.json +1 -1
  397. package/input-mask/InputMask.d.ts +1 -1
  398. package/input-mask/lib/cjs/InputMask.js +6 -6
  399. package/input-mask/lib/cjs/InputMask.js.map +1 -1
  400. package/input-mask/lib/es6/InputMask.js +6 -6
  401. package/input-mask/lib/es6/InputMask.js.map +1 -1
  402. package/input-mask/lib/types/InputMask.d.ts +1 -1
  403. package/input-mask/package.json +1 -1
  404. package/input-number/lib/cjs/InputNumber.js +10 -10
  405. package/input-number/lib/cjs/InputNumber.js.map +1 -1
  406. package/input-number/lib/es6/InputNumber.js +10 -10
  407. package/input-number/lib/es6/InputNumber.js.map +1 -1
  408. package/input-number/package.json +1 -1
  409. package/input-tags/lib/cjs/InputTags.js +12 -12
  410. package/input-tags/lib/es6/InputTags.js +12 -12
  411. package/input-tags/package.json +1 -1
  412. package/link/lib/cjs/Link.js +12 -12
  413. package/link/lib/es6/Link.js +12 -12
  414. package/link/package.json +1 -1
  415. package/mini-chart/lib/cjs/component/score/Donut.js +9 -9
  416. package/mini-chart/lib/cjs/component/score/Line.js +18 -18
  417. package/mini-chart/lib/cjs/component/trend/Bar.js +7 -7
  418. package/mini-chart/lib/cjs/component/trend/Line.js +7 -7
  419. package/mini-chart/lib/es6/component/score/Donut.js +9 -9
  420. package/mini-chart/lib/es6/component/score/Line.js +18 -18
  421. package/mini-chart/lib/es6/component/trend/Bar.js +7 -7
  422. package/mini-chart/lib/es6/component/trend/Line.js +7 -7
  423. package/mini-chart/package.json +1 -1
  424. package/modal/lib/cjs/Modal.js +8 -8
  425. package/modal/lib/es6/Modal.js +8 -8
  426. package/modal/package.json +1 -1
  427. package/neighbor-location/package.json +1 -1
  428. package/notice/lib/cjs/Notice.js +16 -16
  429. package/notice/lib/es6/Notice.js +16 -16
  430. package/notice/package.json +1 -1
  431. package/notice-bubble/lib/cjs/NoticeBubble.js +15 -15
  432. package/notice-bubble/lib/es6/NoticeBubble.js +15 -15
  433. package/notice-bubble/package.json +1 -1
  434. package/notice-global/lib/cjs/NoticeGlobal.js +11 -11
  435. package/notice-global/lib/es6/NoticeGlobal.js +11 -11
  436. package/notice-global/package.json +1 -1
  437. package/outside-click/package.json +1 -1
  438. package/package.json +3 -1
  439. package/pagination/lib/cjs/Pagination.js +10 -10
  440. package/pagination/lib/es6/Pagination.js +10 -10
  441. package/pagination/package.json +1 -1
  442. package/pills/lib/cjs/Pills.js +13 -13
  443. package/pills/lib/es6/Pills.js +13 -13
  444. package/pills/package.json +1 -1
  445. package/popper/index.d.ts +3 -1
  446. package/popper/lib/cjs/Popper.js +16 -6
  447. package/popper/lib/cjs/Popper.js.map +1 -1
  448. package/popper/lib/cjs/createPopper.js +3 -1
  449. package/popper/lib/cjs/createPopper.js.map +1 -1
  450. package/popper/lib/cjs/index.d.js.map +1 -1
  451. package/popper/lib/cjs/modifiers/applyMaxSize.js +34 -0
  452. package/popper/lib/cjs/modifiers/applyMaxSize.js.map +1 -0
  453. package/popper/lib/cjs/style/popper.shadow.css +1 -1
  454. package/popper/lib/es6/Popper.js +16 -6
  455. package/popper/lib/es6/Popper.js.map +1 -1
  456. package/popper/lib/es6/createPopper.js +3 -1
  457. package/popper/lib/es6/createPopper.js.map +1 -1
  458. package/popper/lib/es6/index.d.js.map +1 -1
  459. package/popper/lib/es6/modifiers/applyMaxSize.js +26 -0
  460. package/popper/lib/es6/modifiers/applyMaxSize.js.map +1 -0
  461. package/popper/lib/es6/style/popper.shadow.css +1 -1
  462. package/popper/lib/types/index.d.ts +3 -1
  463. package/popper/package.json +1 -1
  464. package/portal/package.json +1 -1
  465. package/product-head/lib/cjs/Info.js +4 -4
  466. package/product-head/lib/cjs/ProductHead.js +5 -5
  467. package/product-head/lib/cjs/Title.js +4 -4
  468. package/product-head/lib/es6/Info.js +4 -4
  469. package/product-head/lib/es6/ProductHead.js +5 -5
  470. package/product-head/lib/es6/Title.js +4 -4
  471. package/product-head/package.json +1 -1
  472. package/progress-bar/lib/cjs/ProgressBar.js +15 -15
  473. package/progress-bar/lib/es6/ProgressBar.js +15 -15
  474. package/progress-bar/package.json +1 -1
  475. package/radio/lib/cjs/Radio.js +16 -16
  476. package/radio/lib/es6/Radio.js +16 -16
  477. package/radio/package.json +1 -1
  478. package/scroll-area/lib/cjs/ScrollArea.js +21 -21
  479. package/scroll-area/lib/cjs/ScrollBar.js +6 -6
  480. package/scroll-area/lib/es6/ScrollArea.js +21 -21
  481. package/scroll-area/lib/es6/ScrollBar.js +6 -6
  482. package/scroll-area/package.json +1 -1
  483. package/select/lib/cjs/InputSearch.js +6 -6
  484. package/select/lib/cjs/Select.js +8 -8
  485. package/select/lib/es6/InputSearch.js +6 -6
  486. package/select/lib/es6/Select.js +8 -8
  487. package/select/package.json +1 -1
  488. package/side-panel/lib/cjs/SidePanel.js +16 -16
  489. package/side-panel/lib/es6/SidePanel.js +16 -16
  490. package/side-panel/package.json +1 -1
  491. package/skeleton/lib/cjs/Charts/Area.js +9 -9
  492. package/skeleton/lib/cjs/Charts/Bar.js +9 -9
  493. package/skeleton/lib/cjs/Charts/Bubble.js +9 -9
  494. package/skeleton/lib/cjs/Charts/CompactHorizontalBar.js +9 -9
  495. package/skeleton/lib/cjs/Charts/Donut.js +9 -9
  496. package/skeleton/lib/cjs/Charts/Histogram.js +9 -9
  497. package/skeleton/lib/cjs/Charts/Line.js +9 -9
  498. package/skeleton/lib/cjs/Charts/RadialTree.js +9 -9
  499. package/skeleton/lib/cjs/Charts/ScatterPlot.js +9 -9
  500. package/skeleton/lib/cjs/Charts/Venn.js +9 -9
  501. package/skeleton/lib/cjs/Skeleton.js +8 -8
  502. package/skeleton/lib/es6/Charts/Area.js +9 -9
  503. package/skeleton/lib/es6/Charts/Bar.js +9 -9
  504. package/skeleton/lib/es6/Charts/Bubble.js +9 -9
  505. package/skeleton/lib/es6/Charts/CompactHorizontalBar.js +9 -9
  506. package/skeleton/lib/es6/Charts/Donut.js +9 -9
  507. package/skeleton/lib/es6/Charts/Histogram.js +9 -9
  508. package/skeleton/lib/es6/Charts/Line.js +9 -9
  509. package/skeleton/lib/es6/Charts/RadialTree.js +9 -9
  510. package/skeleton/lib/es6/Charts/ScatterPlot.js +9 -9
  511. package/skeleton/lib/es6/Charts/Venn.js +9 -9
  512. package/skeleton/lib/es6/Skeleton.js +8 -8
  513. package/skeleton/package.json +1 -1
  514. package/slider/lib/cjs/Slider.js +8 -8
  515. package/slider/lib/es6/Slider.js +8 -8
  516. package/slider/package.json +1 -1
  517. package/spin/lib/cjs/Spin.js +13 -13
  518. package/spin/lib/es6/Spin.js +13 -13
  519. package/spin/package.json +1 -1
  520. package/spin-container/lib/cjs/SpinContainer.js +42 -12
  521. package/spin-container/lib/cjs/SpinContainer.js.map +1 -1
  522. package/spin-container/lib/es6/SpinContainer.js +42 -12
  523. package/spin-container/lib/es6/SpinContainer.js.map +1 -1
  524. package/spin-container/package.json +1 -1
  525. package/sticky/lib/cjs/Sticky.js +2 -2
  526. package/sticky/lib/es6/Sticky.js +2 -2
  527. package/sticky/package.json +1 -1
  528. package/switch/lib/cjs/Switch.js +21 -21
  529. package/switch/lib/es6/Switch.js +21 -21
  530. package/switch/package.json +1 -1
  531. package/tab-line/lib/cjs/TabLine.js +13 -13
  532. package/tab-line/lib/es6/TabLine.js +13 -13
  533. package/tab-line/package.json +1 -1
  534. package/tab-panel/lib/cjs/TabPanel.js +8 -8
  535. package/tab-panel/lib/es6/TabPanel.js +8 -8
  536. package/tab-panel/package.json +1 -1
  537. package/tag/lib/cjs/Tag.js +23 -23
  538. package/tag/lib/es6/Tag.js +23 -23
  539. package/tag/package.json +1 -1
  540. package/textarea/lib/cjs/Textarea.js +8 -8
  541. package/textarea/lib/es6/Textarea.js +8 -8
  542. package/textarea/package.json +1 -1
  543. package/time-picker/lib/cjs/PickerInput.js +1 -0
  544. package/time-picker/lib/cjs/PickerInput.js.map +1 -1
  545. package/time-picker/lib/cjs/TimePicker.js +12 -12
  546. package/time-picker/lib/es6/PickerInput.js +1 -0
  547. package/time-picker/lib/es6/PickerInput.js.map +1 -1
  548. package/time-picker/lib/es6/TimePicker.js +12 -12
  549. package/time-picker/package.json +1 -1
  550. package/tooltip/lib/cjs/Tooltip.js +9 -9
  551. package/tooltip/lib/es6/Tooltip.js +9 -9
  552. package/tooltip/package.json +1 -1
  553. package/typography/lib/cjs/Blockquote.js +4 -4
  554. package/typography/lib/cjs/Hint.js +7 -7
  555. package/typography/lib/cjs/List.js +5 -5
  556. package/typography/lib/cjs/Text.js +34 -34
  557. package/typography/lib/es6/Blockquote.js +4 -4
  558. package/typography/lib/es6/Hint.js +7 -7
  559. package/typography/lib/es6/List.js +5 -5
  560. package/typography/lib/es6/Text.js +34 -34
  561. package/typography/package.json +1 -1
  562. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +2 -2
  563. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +2 -2
  564. package/utils/lib/enhances/WithI18n.js +15 -5
  565. package/utils/lib/enhances/WithI18n.js.map +1 -1
  566. package/utils/lib/enhances/WithI18n.mjs +16 -6
  567. package/utils/lib/enhances/WithI18n.mjs.map +1 -1
  568. package/utils/lib/enhances/i18nEnhance.d.ts +0 -1
  569. package/utils/lib/enhances/i18nEnhance.js +1 -33
  570. package/utils/lib/enhances/i18nEnhance.js.map +1 -1
  571. package/utils/lib/enhances/i18nEnhance.mjs +0 -30
  572. package/utils/lib/enhances/i18nEnhance.mjs.map +1 -1
  573. package/utils/lib/injectStyle.js +1 -1
  574. package/utils/lib/injectStyle.mjs +1 -1
  575. package/utils/lib/inputProps.js +1 -1
  576. package/utils/lib/inputProps.js.map +1 -1
  577. package/utils/lib/inputProps.mjs +1 -1
  578. package/utils/lib/inputProps.mjs.map +1 -1
  579. package/widget-empty/lib/cjs/WidgetEmpty.js +5 -5
  580. package/widget-empty/lib/es6/WidgetEmpty.js +5 -5
  581. package/widget-empty/package.json +1 -1
  582. package/wizard/lib/cjs/Wizard.js +12 -12
  583. package/wizard/lib/es6/Wizard.js +12 -12
  584. package/wizard/package.json +1 -1
@@ -0,0 +1,328 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/createSuper";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import { assignProps as _assignProps } from 'intergalactic/core';
9
+ import React from 'react';
10
+ import { Flex, ScreenReaderOnly } from 'intergalactic/flex-box';
11
+ import Button from 'intergalactic/button';
12
+ import createComponent, { Component, Root } from 'intergalactic/core';
13
+ import DropdownMenu from 'intergalactic/dropdown-menu';
14
+ import MathPlusM from 'intergalactic/icon/MathPlus/m';
15
+ import CloseM from 'intergalactic/icon/Close/m';
16
+ import AddFilterSelect from './components/AddFilterSelect';
17
+ import AddFilterInput from './components/AddFilterInput';
18
+ import AddFilterDropdown from './components/AddFilterDropdown';
19
+ import { extractFrom } from 'intergalactic/utils/lib/findComponent';
20
+ import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
21
+ import i18nEnhance from 'intergalactic/utils/lib/enhances/i18nEnhance';
22
+ import focusSourceEnhance from 'intergalactic/utils/lib/enhances/focusSourceEnhance';
23
+ var RootAddFilter = /*#__PURE__*/function (_Component) {
24
+ _inherits(RootAddFilter, _Component);
25
+ var _super = _createSuper(RootAddFilter);
26
+ function RootAddFilter(props) {
27
+ var _this;
28
+ _classCallCheck(this, RootAddFilter);
29
+ _this = _super.call(this, props);
30
+ _defineProperty(_assertThisInitialized(_this), "addFilterTrigger", /*#__PURE__*/React.createRef());
31
+ _defineProperty(_assertThisInitialized(_this), "filtersFocusMap", new Map());
32
+ _defineProperty(_assertThisInitialized(_this), "clearMessageTimer", void 0);
33
+ _defineProperty(_assertThisInitialized(_this), "addDropdownItems", void 0);
34
+ _this.state = {
35
+ visibleFilters: new Set(),
36
+ clearFiltersMessage: ''
37
+ };
38
+ _this.addDropdownItems = RootAddFilter.getDefaultAddDropdownOptions(props.children);
39
+ return _this;
40
+ }
41
+ _createClass(RootAddFilter, [{
42
+ key: "componentWillUnmount",
43
+ value: function componentWillUnmount() {
44
+ clearTimeout(this.clearMessageTimer);
45
+ }
46
+ }, {
47
+ key: "focusFilterAfterItemCleared",
48
+ value: function focusFilterAfterItemCleared(name) {
49
+ var _this2 = this;
50
+ var focusSourceRef = this.asProps.focusSourceRef;
51
+ if (focusSourceRef.current !== 'keyboard') {
52
+ return;
53
+ }
54
+ var deletedIndex = Array.from(this.state.visibleFilters).findIndex(function (n) {
55
+ return n === name;
56
+ });
57
+ setTimeout(function () {
58
+ var _this2$filtersFocusMa;
59
+ var currentVisibleFiltersList = Array.from(_this2.state.visibleFilters);
60
+ var focusFilterName = currentVisibleFiltersList.at(deletedIndex);
61
+ var itemToFocus = (_this2$filtersFocusMa = _this2.filtersFocusMap.get(focusFilterName)) !== null && _this2$filtersFocusMa !== void 0 ? _this2$filtersFocusMa : _this2.addFilterTrigger.current;
62
+ itemToFocus === null || itemToFocus === void 0 ? void 0 : itemToFocus.focus();
63
+ }, 20);
64
+ }
65
+ }, {
66
+ key: "getVisibleFilters",
67
+ value: function getVisibleFilters(allFilters) {
68
+ return Array.from(this.state.visibleFilters).map(function (name) {
69
+ return allFilters.find(function (_ref2) {
70
+ var props = _ref2.props;
71
+ return props.name === name;
72
+ });
73
+ });
74
+ }
75
+ }, {
76
+ key: "getItemCommonProps",
77
+ value: function getItemCommonProps(props) {
78
+ var _this3 = this;
79
+ var name = props.name;
80
+ var filterData = this.asProps.filterData;
81
+ return {
82
+ name: name,
83
+ value: filterData[name],
84
+ setFocusRef: function setFocusRef(ref) {
85
+ _this3.filtersFocusMap.set(name, ref);
86
+ },
87
+ onClear: function onClear() {
88
+ _this3.hideFilter(name);
89
+ _this3.focusFilterAfterItemCleared(name);
90
+ }
91
+ };
92
+ }
93
+ }, {
94
+ key: "getInputProps",
95
+ value: function getInputProps(props) {
96
+ return this.getItemCommonProps(props);
97
+ }
98
+ }, {
99
+ key: "getDropdownAndSelectProps",
100
+ value: function getDropdownAndSelectProps(props, isEmpty) {
101
+ var _this4 = this;
102
+ var _this$getItemCommonPr = this.getItemCommonProps(props),
103
+ setFocusRef = _this$getItemCommonPr.setFocusRef,
104
+ value = _this$getItemCommonPr.value,
105
+ onClear = _this$getItemCommonPr.onClear;
106
+ return {
107
+ value: value,
108
+ onClear: onClear,
109
+ setFocusRef: setFocusRef,
110
+ onVisibleChange: function onVisibleChange(visible) {
111
+ // waiting for filterData update
112
+ setTimeout(function () {
113
+ var _this4$getItemCommonP = _this4.getItemCommonProps(props),
114
+ onClear = _this4$getItemCommonP.onClear;
115
+ if (!visible && isEmpty()) {
116
+ onClear();
117
+ }
118
+ }, 0);
119
+ }
120
+ };
121
+ }
122
+ }, {
123
+ key: "getSelectProps",
124
+ value: function getSelectProps(props) {
125
+ var _this5 = this;
126
+ var isEmpty = function isEmpty() {
127
+ var multiselect = props.multiselect;
128
+ var _this5$getItemCommonP = _this5.getItemCommonProps(props),
129
+ value = _this5$getItemCommonP.value;
130
+ return multiselect && Array.isArray(value) ? !(value !== null && value !== void 0 && value.length) : !value;
131
+ };
132
+ return this.getDropdownAndSelectProps(props, isEmpty);
133
+ }
134
+ }, {
135
+ key: "getDropdownProps",
136
+ value: function getDropdownProps(props) {
137
+ var _this6 = this;
138
+ var isEmpty = function isEmpty() {
139
+ var _this6$getItemCommonP = _this6.getItemCommonProps(props),
140
+ value = _this6$getItemCommonP.value;
141
+ return value == null;
142
+ };
143
+ return this.getDropdownAndSelectProps(props, isEmpty);
144
+ }
145
+ }, {
146
+ key: "clearAll",
147
+ value: function clearAll() {
148
+ var _this7 = this;
149
+ this.setState({
150
+ visibleFilters: new Set()
151
+ });
152
+ this.props.onClearAll();
153
+ this.announceClearMessageToSR();
154
+
155
+ // waiting for AddFilter button appear in the DOM
156
+ setTimeout(function () {
157
+ var _this7$addFilterTrigg;
158
+ (_this7$addFilterTrigg = _this7.addFilterTrigger.current) === null || _this7$addFilterTrigg === void 0 ? void 0 : _this7$addFilterTrigg.focus();
159
+ }, 20);
160
+ }
161
+ }, {
162
+ key: "announceClearMessageToSR",
163
+ value: function announceClearMessageToSR() {
164
+ var _this8 = this;
165
+ var getI18nText = this.asProps.getI18nText;
166
+ var clearFiltersMessage = getI18nText('AddFilter.ScreenReaderMessage.FiltersCleared');
167
+ this.setState({
168
+ clearFiltersMessage: clearFiltersMessage
169
+ });
170
+ this.clearMessageTimer = setTimeout(function () {
171
+ _this8.setState({
172
+ clearFiltersMessage: ''
173
+ });
174
+ }, 300);
175
+ }
176
+ }, {
177
+ key: "toggleFieldVisibility",
178
+ value: function toggleFieldVisibility(name, status) {
179
+ var visibleFilters = new Set(Array.from(this.state.visibleFilters));
180
+ if (status) {
181
+ visibleFilters.add(name);
182
+ } else {
183
+ visibleFilters["delete"](name);
184
+ }
185
+ this.setState({
186
+ visibleFilters: visibleFilters
187
+ });
188
+ }
189
+ }, {
190
+ key: "hideFilter",
191
+ value: function hideFilter(name) {
192
+ this.toggleFieldVisibility(name, false);
193
+ }
194
+ }, {
195
+ key: "getFilterSelectionMenuProps",
196
+ value: function getFilterSelectionMenuProps() {
197
+ var _this9 = this;
198
+ var getI18nText = this.asProps.getI18nText;
199
+ return {
200
+ ref: this.addFilterTrigger,
201
+ options: this.addDropdownItems,
202
+ toggleFieldVisibility: function toggleFieldVisibility(name, status) {
203
+ return _this9.toggleFieldVisibility(name, status);
204
+ },
205
+ visibleFilters: this.state.visibleFilters,
206
+ getI18nText: getI18nText
207
+ };
208
+ }
209
+ }, {
210
+ key: "getClearAllFiltersProps",
211
+ value: function getClearAllFiltersProps() {
212
+ var _this10 = this;
213
+ var _this$asProps = this.asProps,
214
+ getI18nText = _this$asProps.getI18nText,
215
+ filterData = _this$asProps.filterData;
216
+ return {
217
+ hasFilterData: Object.values(filterData).filter(function (value) {
218
+ return Array.isArray(value) ? value === null || value === void 0 ? void 0 : value.length : value;
219
+ }).length > 0,
220
+ clearAll: function clearAll() {
221
+ _this10.clearAll();
222
+ },
223
+ getI18nText: getI18nText
224
+ };
225
+ }
226
+ }, {
227
+ key: "render",
228
+ value: function render() {
229
+ var _ref = this.asProps;
230
+ var Children = this.asProps.Children;
231
+ var _RootAddFilter$getFil = RootAddFilter.getFilterPatternItems(Children),
232
+ _RootAddFilter$getFil2 = _slicedToArray(_RootAddFilter$getFil, 2),
233
+ filters = _RootAddFilter$getFil2[0],
234
+ persistentFilters = _RootAddFilter$getFil2[1];
235
+ var VisibleFilteredChildren = this.getVisibleFilters(filters);
236
+ var filtersSelectionDropdown = this.getFilterSelectionMenuProps();
237
+ var clearAllFiltersProps = this.getClearAllFiltersProps();
238
+ return /*#__PURE__*/React.createElement(Flex, _assignProps({
239
+ "gap": 2,
240
+ "flexWrap": true
241
+ }, _ref), persistentFilters, VisibleFilteredChildren, /*#__PURE__*/React.createElement(AddFilterDropdownMenu, filtersSelectionDropdown), /*#__PURE__*/React.createElement(ClearAllFilters, clearAllFiltersProps), /*#__PURE__*/React.createElement(ScreenReaderOnly, {
242
+ "aria-live": "polite",
243
+ role: "status"
244
+ }, this.state.clearFiltersMessage));
245
+ }
246
+ }]);
247
+ return RootAddFilter;
248
+ }(Component);
249
+ _defineProperty(RootAddFilter, "displayName", 'AddFilter');
250
+ _defineProperty(RootAddFilter, "enhance", [i18nEnhance(localizedMessages), focusSourceEnhance()]);
251
+ _defineProperty(RootAddFilter, "defaultProps", {
252
+ i18n: localizedMessages,
253
+ locale: 'en'
254
+ });
255
+ _defineProperty(RootAddFilter, "componentsNames", ['AddFilter.Input', 'AddFilter.Select', 'AddFilter.Dropdown']);
256
+ _defineProperty(RootAddFilter, "getFilterPatternItems", function (children) {
257
+ return extractFrom(children, RootAddFilter.componentsNames);
258
+ });
259
+ _defineProperty(RootAddFilter, "getDefaultAddDropdownOptions", function (children) {
260
+ var _RootAddFilter$getFil3 = RootAddFilter.getFilterPatternItems(children),
261
+ _RootAddFilter$getFil4 = _slicedToArray(_RootAddFilter$getFil3, 1),
262
+ filters = _RootAddFilter$getFil4[0];
263
+ return filters.map(function (_ref5) {
264
+ var props = _ref5.props;
265
+ var name = props.name,
266
+ displayName = props.displayName;
267
+ return {
268
+ label: displayName !== null && displayName !== void 0 ? displayName : name,
269
+ value: name
270
+ };
271
+ });
272
+ });
273
+ var AddFilterDropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
274
+ var options = props.options,
275
+ toggleFieldVisibility = props.toggleFieldVisibility,
276
+ visibleFilters = props.visibleFilters,
277
+ getI18nText = props.getI18nText;
278
+ var _React$useState = React.useState(false),
279
+ _React$useState2 = _slicedToArray(_React$useState, 2),
280
+ visible = _React$useState2[0],
281
+ setVisible = _React$useState2[1];
282
+ var optionsWithoutVisible = React.useMemo(function () {
283
+ return options.filter(function (filter) {
284
+ return !Array.from(visibleFilters).includes(filter.value);
285
+ });
286
+ }, [options, visibleFilters]);
287
+ if (!optionsWithoutVisible.length) {
288
+ return null;
289
+ }
290
+ return /*#__PURE__*/React.createElement(DropdownMenu, {
291
+ visible: visible,
292
+ onVisibleChange: setVisible
293
+ }, /*#__PURE__*/React.createElement(DropdownMenu.Trigger, {
294
+ ref: ref,
295
+ tag: Button,
296
+ use: "tertiary",
297
+ addonLeft: MathPlusM
298
+ }, getI18nText('AddFilter.DropdownTrigger.Text')), /*#__PURE__*/React.createElement(DropdownMenu.Menu, null, optionsWithoutVisible.map(function (_ref3) {
299
+ var label = _ref3.label,
300
+ value = _ref3.value;
301
+ return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
302
+ key: value,
303
+ onClick: function onClick() {
304
+ toggleFieldVisibility(value, true);
305
+ setVisible(false);
306
+ }
307
+ }, label);
308
+ })));
309
+ });
310
+ function ClearAllFilters(_ref4) {
311
+ var hasFilterData = _ref4.hasFilterData,
312
+ clearAll = _ref4.clearAll,
313
+ getI18nText = _ref4.getI18nText;
314
+ return hasFilterData ? /*#__PURE__*/React.createElement(Button, {
315
+ use: "tertiary",
316
+ theme: "muted",
317
+ addonLeft: CloseM,
318
+ ml: "auto",
319
+ onClick: clearAll
320
+ }, getI18nText('AddFilter.Button.Text')) : null;
321
+ }
322
+ var AddFilter = createComponent(RootAddFilter, {
323
+ Select: AddFilterSelect,
324
+ Input: AddFilterInput,
325
+ Dropdown: AddFilterDropdown
326
+ });
327
+ export default AddFilter;
328
+ //# sourceMappingURL=AddFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFilter.js","names":["React","Flex","ScreenReaderOnly","Button","createComponent","Component","Root","DropdownMenu","MathPlusM","CloseM","AddFilterSelect","AddFilterInput","AddFilterDropdown","extractFrom","localizedMessages","i18nEnhance","focusSourceEnhance","RootAddFilter","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","createRef","Map","state","visibleFilters","Set","clearFiltersMessage","addDropdownItems","getDefaultAddDropdownOptions","children","_createClass","key","value","componentWillUnmount","clearTimeout","clearMessageTimer","focusFilterAfterItemCleared","name","_this2","focusSourceRef","asProps","current","deletedIndex","Array","from","findIndex","n","setTimeout","_this2$filtersFocusMa","currentVisibleFiltersList","focusFilterName","at","itemToFocus","filtersFocusMap","get","addFilterTrigger","focus","getVisibleFilters","allFilters","map","find","_ref2","getItemCommonProps","_this3","filterData","setFocusRef","ref","set","onClear","hideFilter","getInputProps","getDropdownAndSelectProps","isEmpty","_this4","_this$getItemCommonPr","onVisibleChange","visible","_this4$getItemCommonP","getSelectProps","_this5","multiselect","_this5$getItemCommonP","isArray","length","getDropdownProps","_this6","_this6$getItemCommonP","clearAll","_this7","setState","onClearAll","announceClearMessageToSR","_this7$addFilterTrigg","_this8","getI18nText","toggleFieldVisibility","status","add","getFilterSelectionMenuProps","_this9","options","getClearAllFiltersProps","_this10","_this$asProps","hasFilterData","Object","values","filter","render","_ref","Children","_RootAddFilter$getFil","getFilterPatternItems","_RootAddFilter$getFil2","_slicedToArray","filters","persistentFilters","VisibleFilteredChildren","filtersSelectionDropdown","clearAllFiltersProps","createElement","_assignProps","AddFilterDropdownMenu","ClearAllFilters","role","i18n","locale","componentsNames","_RootAddFilter$getFil3","_RootAddFilter$getFil4","_ref5","displayName","label","forwardRef","_React$useState","useState","_React$useState2","setVisible","optionsWithoutVisible","useMemo","includes","Trigger","tag","use","addonLeft","Menu","_ref3","Item","onClick","_ref4","theme","ml","AddFilter","Select","Input","Dropdown"],"sources":["../../src/AddFilter.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex, ScreenReaderOnly } from '@semcore/flex-box';\nimport Button from '@semcore/button';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport DropdownMenu from '@semcore/dropdown-menu';\nimport MathPlusM from '@semcore/icon/MathPlus/m';\nimport CloseM from '@semcore/icon/Close/m';\nimport AddFilterType, { AddFilterProps, AddFilterItemProps } from './AddFilter.types';\nimport AddFilterSelect from './components/AddFilterSelect';\nimport AddFilterInput from './components/AddFilterInput';\nimport AddFilterDropdown from './components/AddFilterDropdown';\nimport { extractFrom } from '@semcore/utils/lib/findComponent';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { SelectProps } from '@semcore/select';\nimport focusSourceEnhance from '@semcore/utils/lib/enhances/focusSourceEnhance';\n\ntype SelectItemProps = SelectProps & AddFilterItemProps;\n\ntype AddFilterDropdownOption = { label: string; value: string };\ntype AddFilterDropdownMenuProps = {\n options: AddFilterDropdownOption[];\n toggleFieldVisibility: (name: string, status: boolean) => void;\n visibleFilters: Set<string>;\n getI18nText: (key: string) => string;\n};\n\ntype ClearAllFiltersButtonProps = {\n hasFilterData: boolean;\n clearAll: () => void;\n getI18nText: (key: string) => string;\n};\n\ntype AddFilterState = {\n visibleFilters: Set<string>;\n clearFiltersMessage: string;\n};\n\nclass RootAddFilter extends Component<\n AddFilterProps,\n {},\n AddFilterState,\n typeof RootAddFilter.enhance\n> {\n addFilterTrigger = React.createRef<HTMLButtonElement>();\n filtersFocusMap: Map<string | undefined, HTMLElement> = new Map();\n clearMessageTimer: ReturnType<typeof setTimeout> | undefined;\n addDropdownItems: AddFilterDropdownOption[];\n\n static displayName = 'AddFilter';\n static enhance = [i18nEnhance(localizedMessages), focusSourceEnhance()] as const;\n static defaultProps = {\n i18n: localizedMessages,\n locale: 'en',\n };\n\n static componentsNames = ['AddFilter.Input', 'AddFilter.Select', 'AddFilter.Dropdown'];\n static getFilterPatternItems = (children: React.ReactNode) => {\n return extractFrom(children, RootAddFilter.componentsNames);\n };\n\n static getDefaultAddDropdownOptions = (children: React.ReactNode) => {\n const [filters] = RootAddFilter.getFilterPatternItems(children);\n\n return filters.map(({ props }: { props: AddFilterItemProps }) => {\n const { name, displayName } = props;\n return { label: displayName ?? name, value: name };\n });\n };\n\n constructor(props: AddFilterProps) {\n super(props);\n\n this.state = {\n visibleFilters: new Set(),\n clearFiltersMessage: '',\n };\n\n this.addDropdownItems = RootAddFilter.getDefaultAddDropdownOptions(props.children);\n }\n\n componentWillUnmount() {\n clearTimeout(this.clearMessageTimer);\n }\n\n focusFilterAfterItemCleared(name?: string) {\n const { focusSourceRef } = this.asProps;\n\n if (focusSourceRef.current !== 'keyboard') {\n return;\n }\n\n const deletedIndex = Array.from(this.state.visibleFilters).findIndex((n) => n === name);\n setTimeout(() => {\n const currentVisibleFiltersList = Array.from(this.state.visibleFilters);\n const focusFilterName = currentVisibleFiltersList.at(deletedIndex);\n\n const itemToFocus =\n this.filtersFocusMap.get(focusFilterName) ?? this.addFilterTrigger.current;\n itemToFocus?.focus();\n }, 20);\n }\n\n getVisibleFilters(allFilters: React.ReactElement<AddFilterItemProps>[]) {\n return Array.from(this.state.visibleFilters).map((name) => {\n return allFilters.find(({ props }) => props.name === name);\n });\n }\n\n getItemCommonProps(props: AddFilterItemProps) {\n const { name } = props;\n const { filterData } = this.asProps;\n\n return {\n name,\n value: filterData[name],\n setFocusRef: (ref: HTMLElement) => {\n this.filtersFocusMap.set(name, ref);\n },\n onClear: () => {\n this.hideFilter(name);\n this.focusFilterAfterItemCleared(name);\n },\n };\n }\n\n getInputProps(props: AddFilterItemProps) {\n return this.getItemCommonProps(props);\n }\n\n getDropdownAndSelectProps(props: AddFilterItemProps, isEmpty: () => boolean) {\n const { setFocusRef, value, onClear } = this.getItemCommonProps(props);\n return {\n value,\n onClear,\n setFocusRef,\n onVisibleChange: (visible: boolean) => {\n // waiting for filterData update\n setTimeout(() => {\n const { onClear } = this.getItemCommonProps(props);\n\n if (!visible && isEmpty()) {\n onClear();\n }\n }, 0);\n },\n };\n }\n\n getSelectProps(props: SelectItemProps) {\n const isEmpty = () => {\n const { multiselect } = props;\n const { value } = this.getItemCommonProps(props);\n return multiselect && Array.isArray(value) ? !value?.length : !value;\n };\n\n return this.getDropdownAndSelectProps(props, isEmpty);\n }\n\n getDropdownProps(props: AddFilterItemProps) {\n const isEmpty = () => {\n const { value } = this.getItemCommonProps(props);\n return value == null;\n };\n return this.getDropdownAndSelectProps(props, isEmpty);\n }\n\n clearAll() {\n this.setState({\n visibleFilters: new Set(),\n });\n this.props.onClearAll();\n this.announceClearMessageToSR();\n\n // waiting for AddFilter button appear in the DOM\n setTimeout(() => {\n this.addFilterTrigger.current?.focus();\n }, 20);\n }\n\n announceClearMessageToSR() {\n const { getI18nText } = this.asProps;\n const clearFiltersMessage = getI18nText('AddFilter.ScreenReaderMessage.FiltersCleared');\n this.setState({ clearFiltersMessage });\n\n this.clearMessageTimer = setTimeout(() => {\n this.setState({ clearFiltersMessage: '' });\n }, 300);\n }\n\n toggleFieldVisibility(name: string, status: boolean) {\n const visibleFilters = new Set(Array.from(this.state.visibleFilters));\n if (status) {\n visibleFilters.add(name);\n } else {\n visibleFilters.delete(name);\n }\n\n this.setState({ visibleFilters });\n }\n\n hideFilter(name: string) {\n this.toggleFieldVisibility(name, false);\n }\n\n getFilterSelectionMenuProps() {\n const { getI18nText } = this.asProps;\n\n return {\n ref: this.addFilterTrigger,\n options: this.addDropdownItems,\n toggleFieldVisibility: (name: string, status: boolean) =>\n this.toggleFieldVisibility(name, status),\n visibleFilters: this.state.visibleFilters,\n getI18nText,\n };\n }\n\n getClearAllFiltersProps() {\n const { getI18nText, filterData } = this.asProps;\n\n return {\n hasFilterData:\n Object.values(filterData).filter((value) => (Array.isArray(value) ? value?.length : value))\n .length > 0,\n clearAll: () => {\n this.clearAll();\n },\n getI18nText,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n const [filters, persistentFilters] = RootAddFilter.getFilterPatternItems(Children);\n const VisibleFilteredChildren = this.getVisibleFilters(filters);\n\n const filtersSelectionDropdown = this.getFilterSelectionMenuProps();\n const clearAllFiltersProps = this.getClearAllFiltersProps();\n return (\n <Root render={Flex} gap={2} flexWrap>\n {persistentFilters}\n {VisibleFilteredChildren}\n <AddFilterDropdownMenu {...filtersSelectionDropdown} />\n <ClearAllFilters {...clearAllFiltersProps} />\n\n <ScreenReaderOnly aria-live='polite' role='status'>\n {this.state.clearFiltersMessage}\n </ScreenReaderOnly>\n </Root>\n );\n }\n}\n\nconst AddFilterDropdownMenu = React.forwardRef<HTMLButtonElement, AddFilterDropdownMenuProps>(\n function (props, ref) {\n const { options, toggleFieldVisibility, visibleFilters, getI18nText } = props;\n const [visible, setVisible] = React.useState(false);\n\n const optionsWithoutVisible = React.useMemo(() => {\n return options.filter((filter) => {\n return !Array.from(visibleFilters).includes(filter.value);\n });\n }, [options, visibleFilters]);\n\n if (!optionsWithoutVisible.length) {\n return null;\n }\n\n return (\n <DropdownMenu visible={visible} onVisibleChange={setVisible}>\n <DropdownMenu.Trigger ref={ref} tag={Button} use='tertiary' addonLeft={MathPlusM}>\n {getI18nText('AddFilter.DropdownTrigger.Text')}\n </DropdownMenu.Trigger>\n <DropdownMenu.Menu>\n {optionsWithoutVisible.map(({ label, value }) => (\n <DropdownMenu.Item\n key={value}\n onClick={() => {\n toggleFieldVisibility(value, true);\n setVisible(false);\n }}\n >\n {label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Menu>\n </DropdownMenu>\n );\n },\n);\n\nfunction ClearAllFilters({ hasFilterData, clearAll, getI18nText }: ClearAllFiltersButtonProps) {\n return hasFilterData ? (\n <Button use='tertiary' theme='muted' addonLeft={CloseM} ml='auto' onClick={clearAll}>\n {getI18nText('AddFilter.Button.Text')}\n </Button>\n ) : null;\n}\n\nconst AddFilter: typeof AddFilterType = createComponent(RootAddFilter, {\n Select: AddFilterSelect,\n Input: AddFilterInput,\n Dropdown: AddFilterDropdown,\n});\n\nexport default AddFilter;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,mBAAmB;AAC1D,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,YAAY,MAAM,wBAAwB;AACjD,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,MAAM,MAAM,uBAAuB;AAE1C,OAAOC,eAAe,MAAM,8BAA8B;AAC1D,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,SAASC,WAAW,QAAQ,kCAAkC;AAC9D,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,OAAOC,WAAW,MAAM,yCAAyC;AAEjE,OAAOC,kBAAkB,MAAM,gDAAgD;AAAC,IAuB1EC,aAAa,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAgCjB,SAAAA,cAAYK,KAAqB,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,aAAA;IACjCM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IAAEI,eAAA,CAAAC,sBAAA,CAAAJ,KAAA,oCA3BIvB,KAAK,CAAC4B,SAAS,EAAqB;IAAAF,eAAA,CAAAC,sBAAA,CAAAJ,KAAA,sBACC,IAAI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AAM;MACXoH,OAAO,EAAE,SAAAA,QAAA,EAAM;QACbrD,qBAAqB,CAAC/D,KAAK,EAAE,IAAI,CAAC;QAClCyG,UAAU,CAAC,KAAK,CAAC;MACnB;IAAE,GAEDL,KAAK,CACY;EAAA,CACrB,CAAC,CACgB,CACP;AAEnB,CAAC,CACF;AAED,SAAST,eAAeA,CAAA0B,KAAA,EAAuE;EAAA,IAApE7C,aAAa,GAAA6C,KAAA,CAAb7C,aAAa;IAAEjB,QAAQ,GAAA8D,KAAA,CAAR9D,QAAQ;IAAEO,WAAW,GAAAuD,KAAA,CAAXvD,WAAW;EAC7D,OAAOU,aAAa,gBAClB/G,KAAA,CAAA+H,aAAA,CAAC5H,MAAM;IAACmJ,GAAG,EAAC,UAAU;IAACO,KAAK,EAAC,OAAO;IAACN,SAAS,EAAE9I,MAAO;IAACqJ,EAAE,EAAC,MAAM;IAACH,OAAO,EAAE7D;EAAS,GACjFO,WAAW,CAAC,uBAAuB,CAAC,CAC9B,GACP,IAAI;AACV;AAEA,IAAM0D,SAA+B,GAAG3J,eAAe,CAACa,aAAa,EAAE;EACrE+I,MAAM,EAAEtJ,eAAe;EACvBuJ,KAAK,EAAEtJ,cAAc;EACrBuJ,QAAQ,EAAEtJ;AACZ,CAAC,CAAC;AAEF,eAAemJ,SAAS"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AddFilter.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFilter.types.js","names":[],"sources":["../../src/AddFilter.types.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/utils/lib/core';\nimport { FlexProps } from '@semcore/flex-box';\nimport Select from '@semcore/select';\nimport Input from '@semcore/input';\nimport Dropdown, { DropdownTriggerProps } from '@semcore/dropdown';\nimport { FilterTrigger } from '@semcore/base-trigger';\nimport { ButtonLink } from '@semcore/button';\n\nexport type AddFilterItemProps = {\n /**\n * Non-persistent filter item unique `name`. Should be the same as related `key` in `FilterData` item related to Filter Control.\n */\n name: string;\n /**\n * Optional `displayName` to be displayed inside `Add filter` dropdown menu. If not specified, `name` will be used instead.\n */\n displayName?: string;\n /**\n * Action to perform on filter item unmount.\n */\n onUnmount?: () => void;\n};\n\ndeclare const AddFilterSelectType: Intergalactic.Component<typeof Select, AddFilterItemProps> & {\n Trigger: typeof FilterTrigger;\n Popper: Intergalactic.Component<typeof Select.Popper, {}, { onApply: () => void }>;\n Option: typeof Select.Option;\n Menu: typeof Select.Menu;\n List: typeof Select.List;\n InputSearch: typeof Select.InputSearch;\n};\n\ndeclare const AddFilterInputType: Intergalactic.Component<typeof Input, AddFilterItemProps> & {\n Addon: typeof Input.Addon;\n Value: typeof Input.Value;\n Clear: typeof ButtonLink;\n};\n\ndeclare const AddFilterDropdownType: Intergalactic.Component<\n typeof Dropdown,\n AddFilterItemProps\n> & {\n Trigger: Intergalactic.Component<\n typeof Dropdown.Trigger,\n DropdownTriggerProps & { onClear: () => void }\n >;\n Popper: Intergalactic.Component<typeof Dropdown.Popper, {}, { onApply: () => void }>;\n};\n\nexport type FilterData = Record<string, any>;\nexport type AddFilterProps = FlexProps & {\n /**\n * Action to perform on `Clear filters` button click.\n */\n onClearAll: () => void;\n /**\n * `FilterData` object.\n */\n filterData: FilterData;\n};\n\ndeclare const AddFilterType: Intergalactic.Component<'div', AddFilterProps> & {\n Dropdown: typeof AddFilterDropdownType;\n Input: typeof AddFilterInputType;\n Select: typeof AddFilterSelectType;\n};\n\nexport { AddFilterInputType, AddFilterSelectType, AddFilterDropdownType };\nexport default AddFilterType;\n"],"mappings":""}
@@ -0,0 +1,84 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _createSuper from "@babel/runtime/helpers/createSuper";
5
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
+ import { assignProps as _assignProps } from 'intergalactic/core';
7
+ import React from 'react';
8
+ import createComponent, { Component, Root } from 'intergalactic/core';
9
+ import Dropdown from 'intergalactic/dropdown';
10
+ import { FilterTrigger } from 'intergalactic/base-trigger';
11
+ var AddFilterDropdownRoot = /*#__PURE__*/function (_Component) {
12
+ _inherits(AddFilterDropdownRoot, _Component);
13
+ var _super = _createSuper(AddFilterDropdownRoot);
14
+ function AddFilterDropdownRoot() {
15
+ _classCallCheck(this, AddFilterDropdownRoot);
16
+ return _super.apply(this, arguments);
17
+ }
18
+ _createClass(AddFilterDropdownRoot, [{
19
+ key: "uncontrolledProps",
20
+ value: function uncontrolledProps() {
21
+ return {
22
+ visible: [null]
23
+ };
24
+ }
25
+ }, {
26
+ key: "componentWillUnmount",
27
+ value: function componentWillUnmount() {
28
+ var _this$asProps$onUnmou, _this$asProps;
29
+ (_this$asProps$onUnmou = (_this$asProps = this.asProps).onUnmount) === null || _this$asProps$onUnmou === void 0 ? void 0 : _this$asProps$onUnmou.call(_this$asProps);
30
+ }
31
+ }, {
32
+ key: "getTriggerProps",
33
+ value: function getTriggerProps() {
34
+ var _ref2 = this.asProps,
35
+ value = _ref2.value,
36
+ onClear = _ref2.onClear,
37
+ setFocusRef = _ref2.setFocusRef;
38
+ return {
39
+ tag: FilterTrigger,
40
+ triggerRef: setFocusRef,
41
+ empty: value == null,
42
+ onClear: onClear,
43
+ autoFocus: true
44
+ };
45
+ }
46
+ }, {
47
+ key: "getPopperProps",
48
+ value: function getPopperProps() {
49
+ var _this = this;
50
+ var _ref3 = this.asProps,
51
+ value = _ref3.value,
52
+ onClear = _ref3.onClear;
53
+ return {
54
+ onKeyDown: function onKeyDown(e) {
55
+ if (!value && e.key === 'Escape') {
56
+ onClear();
57
+ }
58
+ },
59
+ onApply: function onApply() {
60
+ _this.handlers.visible(false);
61
+ }
62
+ };
63
+ }
64
+ }, {
65
+ key: "render",
66
+ value: function render() {
67
+ var _ref = this.asProps;
68
+ return /*#__PURE__*/React.createElement(Dropdown, _assignProps({}, _ref));
69
+ }
70
+ }]);
71
+ return AddFilterDropdownRoot;
72
+ }(Component);
73
+ _defineProperty(AddFilterDropdownRoot, "displayName", 'AddFilterDropdown');
74
+ _defineProperty(AddFilterDropdownRoot, "defaultProps", function () {
75
+ return {
76
+ defaultVisible: true
77
+ };
78
+ });
79
+ var AddFilterDropdown = createComponent(AddFilterDropdownRoot, {
80
+ Trigger: Dropdown.Trigger,
81
+ Popper: Dropdown.Popper
82
+ });
83
+ export default AddFilterDropdown;
84
+ //# sourceMappingURL=AddFilterDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFilterDropdown.js","names":["React","createComponent","Component","Root","Dropdown","FilterTrigger","AddFilterDropdownRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","visible","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getTriggerProps","_ref2","onClear","setFocusRef","tag","triggerRef","empty","autoFocus","getPopperProps","_this","_ref3","onKeyDown","e","onApply","handlers","render","_ref","createElement","_assignProps","_defineProperty","defaultVisible","AddFilterDropdown","Trigger","Popper"],"sources":["../../../src/components/AddFilterDropdown.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport Dropdown from '@semcore/dropdown';\nimport { AddFilterItemProps } from '../AddFilter.types';\nimport { FilterTrigger } from '@semcore/base-trigger';\n\ntype AsPropsTypeWithHandlers<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\n\nclass AddFilterDropdownRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterDropdown';\n\n static defaultProps = () => {\n return {\n defaultVisible: true,\n };\n };\n\n uncontrolledProps() {\n return {\n visible: [null],\n };\n }\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getTriggerProps() {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsTypeWithHandlers<\n typeof this.asProps\n >;\n\n return {\n tag: FilterTrigger,\n triggerRef: setFocusRef,\n empty: value == null,\n onClear,\n autoFocus: true,\n };\n }\n\n getPopperProps() {\n const { value, onClear } = this.asProps as AsPropsTypeWithHandlers<typeof this.asProps>;\n\n return {\n onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n onApply: () => {\n this.handlers.visible(false);\n },\n };\n }\n\n render() {\n return <Root render={Dropdown} />;\n }\n}\n\nconst AddFilterDropdown = createComponent(AddFilterDropdownRoot, {\n Trigger: Dropdown.Trigger,\n Popper: Dropdown.Popper,\n});\n\nexport default AddFilterDropdown;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,QAAQ,MAAM,mBAAmB;AAExC,SAASC,aAAa,QAAQ,uBAAuB;AAAC,IAQhDC,qBAAqB,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,qBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,qBAAA;EAAA,SAAAA,sBAAA;IAAAK,eAAA,OAAAL,qBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,qBAAA;IAAAS,GAAA;IAAAC,KAAA,EASzB,SAAAC,kBAAA,EAAoB;MAClB,OAAO;QACLC,OAAO,EAAE,CAAC,IAAI;MAChB,CAAC;IACH;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAG,qBAAA,EAAuB;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC,OAAO,EAACC,SAAS,cAAAH,qBAAA,uBAAtBA,qBAAA,CAAAI,IAAA,CAAAH,aAAA,CAA0B;IAC5B;EAAC;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAS,gBAAA,EAAkB;MAChB,IAAAC,KAAA,GAAwC,IA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OAAO,EAAE3C,QAAQ,CAAC2C,OAAO;EACzBC,MAAM,EAAE5C,QAAQ,CAAC4C;AACnB,CAAC,CAAC;AAEF,eAAeF,iBAAiB"}
@@ -0,0 +1,80 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
+ import { assignProps as _assignProps2 } from 'intergalactic/core';
8
+ import { assignProps as _assignProps } from 'intergalactic/core';
9
+ import React from 'react';
10
+ import createComponent, { Component, Root } from 'intergalactic/core';
11
+ import Input from 'intergalactic/input';
12
+ import { ButtonLink } from 'intergalactic/button';
13
+ var AddFilterInputRoot = /*#__PURE__*/function (_Component) {
14
+ _inherits(AddFilterInputRoot, _Component);
15
+ var _super = _createSuper(AddFilterInputRoot);
16
+ function AddFilterInputRoot() {
17
+ _classCallCheck(this, AddFilterInputRoot);
18
+ return _super.apply(this, arguments);
19
+ }
20
+ _createClass(AddFilterInputRoot, [{
21
+ key: "componentWillUnmount",
22
+ value: function componentWillUnmount() {
23
+ var _this$asProps$onUnmou, _this$asProps;
24
+ (_this$asProps$onUnmou = (_this$asProps = this.asProps).onUnmount) === null || _this$asProps$onUnmou === void 0 ? void 0 : _this$asProps$onUnmou.call(_this$asProps);
25
+ }
26
+ }, {
27
+ key: "getValueProps",
28
+ value: function getValueProps(props) {
29
+ var _ref3 = this.asProps,
30
+ value = _ref3.value,
31
+ onClear = _ref3.onClear,
32
+ setFocusRef = _ref3.setFocusRef;
33
+ return _objectSpread(_objectSpread({}, props), {}, {
34
+ ref: setFocusRef,
35
+ onBlur: function onBlur() {
36
+ if (!value) {
37
+ setTimeout(onClear, 200);
38
+ }
39
+ },
40
+ onKeyDown: function onKeyDown(e) {
41
+ if (!value && e.key === 'Escape') {
42
+ onClear();
43
+ }
44
+ },
45
+ autoFocus: true
46
+ });
47
+ }
48
+ }, {
49
+ key: "getClearProps",
50
+ value: function getClearProps() {
51
+ var _ref4 = this.asProps,
52
+ onClear = _ref4.onClear;
53
+ return {
54
+ onClick: onClear
55
+ };
56
+ }
57
+ }, {
58
+ key: "render",
59
+ value: function render() {
60
+ var _ref = this.asProps;
61
+ return /*#__PURE__*/React.createElement(Input, _assignProps({
62
+ "w": 'auto',
63
+ "inline": false
64
+ }, _ref));
65
+ }
66
+ }]);
67
+ return AddFilterInputRoot;
68
+ }(Component);
69
+ _defineProperty(AddFilterInputRoot, "displayName", 'AddFilterInput');
70
+ var Clear = function Clear() {
71
+ var _ref2 = arguments[0];
72
+ return /*#__PURE__*/React.createElement(ButtonLink, _assignProps2({}, _ref2));
73
+ };
74
+ var AddFilterInput = createComponent(AddFilterInputRoot, {
75
+ Value: Input.Value,
76
+ Addon: Input.Addon,
77
+ Clear: Clear
78
+ });
79
+ export default AddFilterInput;
80
+ //# sourceMappingURL=AddFilterInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFilterInput.js","names":["React","createComponent","Component","Root","Input","ButtonLink","AddFilterInputRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getValueProps","props","_ref3","onClear","setFocusRef","_objectSpread","ref","onBlur","setTimeout","onKeyDown","e","autoFocus","getClearProps","_ref4","onClick","render","_ref","createElement","_assignProps","_defineProperty","Clear","_ref2","arguments[0]","_assignProps2","AddFilterInput","Value","Addon"],"sources":["../../../src/components/AddFilterInput.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport Input from '@semcore/input';\nimport { AddFilterItemProps } from '../AddFilter.types';\nimport { InputValueProps } from '@semcore/input';\nimport { ButtonLink } from '@semcore/button';\n\ntype AsPropsWithOnClear<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\nclass AddFilterInputRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterInput';\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getValueProps(props: InputValueProps) {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n ...props,\n ref: setFocusRef,\n onBlur: () => {\n if (!value) {\n setTimeout(onClear, 200);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n autoFocus: true,\n };\n }\n\n getClearProps() {\n const { onClear } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n onClick: onClear,\n };\n }\n\n render() {\n return <Root render={Input} w={'auto'} inline={false} />;\n }\n}\n\nconst Clear = () => {\n return <Root render={ButtonLink} />;\n};\n\nconst AddFilterInput = createComponent(AddFilterInputRoot, {\n Value: Input.Value,\n Addon: Input.Addon,\n Clear,\n});\n\nexport default AddFilterInput;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,KAAK,MAAM,gBAAgB;AAGlC,SAASC,UAAU,QAAQ,iBAAiB;AAAC,IAOvCC,kBAAkB,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,kBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,kBAAA;EAAA,SAAAA,mBAAA;IAAAK,eAAA,OAAAL,kBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,kBAAA;IAAAS,GAAA;IAAAC,KAAA,EAGtB,SAAAC,qBAAA,EAAuB;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC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