intergalactic 15.43.0-prerelease-7718b840 → 15.43.0-prerelease-f399822f

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 (415) hide show
  1. package/accordion/lib/cjs/Accordion.js +6 -6
  2. package/accordion/lib/cjs/style/accordion.shadow.css +9 -2
  3. package/accordion/lib/es6/Accordion.js +6 -6
  4. package/accordion/lib/es6/style/accordion.shadow.css +9 -2
  5. package/animation/lib/cjs/Animation.js +11 -11
  6. package/animation/lib/cjs/Collapse.js +28 -28
  7. package/animation/lib/cjs/FadeInOut.js +28 -28
  8. package/animation/lib/cjs/Scale.js +28 -28
  9. package/animation/lib/cjs/Slide.js +28 -28
  10. package/animation/lib/cjs/Transform.js +28 -28
  11. package/animation/lib/es6/Animation.js +11 -11
  12. package/animation/lib/es6/Collapse.js +28 -28
  13. package/animation/lib/es6/FadeInOut.js +28 -28
  14. package/animation/lib/es6/Scale.js +28 -28
  15. package/animation/lib/es6/Slide.js +28 -28
  16. package/animation/lib/es6/Transform.js +28 -28
  17. package/badge/lib/cjs/Badge.js +6 -6
  18. package/badge/lib/es6/Badge.js +6 -6
  19. package/base-trigger/lib/cjs/BaseTrigger.js +26 -19
  20. package/base-trigger/lib/cjs/BaseTrigger.js.map +1 -1
  21. package/base-trigger/lib/cjs/ButtonTrigger.js +3 -3
  22. package/base-trigger/lib/cjs/FilterTrigger.js +7 -7
  23. package/base-trigger/lib/cjs/LinkTrigger.js +12 -12
  24. package/base-trigger/lib/cjs/style/base-trigger.shadow.css +8 -0
  25. package/base-trigger/lib/es6/BaseTrigger.js +26 -19
  26. package/base-trigger/lib/es6/BaseTrigger.js.map +1 -1
  27. package/base-trigger/lib/es6/ButtonTrigger.js +3 -3
  28. package/base-trigger/lib/es6/FilterTrigger.js +7 -7
  29. package/base-trigger/lib/es6/LinkTrigger.js +12 -12
  30. package/base-trigger/lib/es6/style/base-trigger.shadow.css +8 -0
  31. package/breadcrumbs/lib/cjs/Breadcrumbs.js +6 -6
  32. package/breadcrumbs/lib/es6/Breadcrumbs.js +6 -6
  33. package/button/lib/cjs/Button.js +26 -26
  34. package/button/lib/es6/Button.js +26 -26
  35. package/card/lib/cjs/Card.js +8 -8
  36. package/card/lib/es6/Card.js +8 -8
  37. package/carousel/lib/cjs/Carousel.js +16 -16
  38. package/carousel/lib/es6/Carousel.js +16 -16
  39. package/checkbox/lib/cjs/Checkbox.js +25 -21
  40. package/checkbox/lib/cjs/Checkbox.js.map +1 -1
  41. package/checkbox/lib/es6/Checkbox.js +25 -21
  42. package/checkbox/lib/es6/Checkbox.js.map +1 -1
  43. package/color-picker/index.d.ts +174 -0
  44. package/color-picker/lib/cjs/ColorPicker.js +23 -23
  45. package/color-picker/lib/cjs/PaletteManager.js +23 -23
  46. package/color-picker/lib/cjs/components/InputColor.js +23 -23
  47. package/color-picker/lib/cjs/index.d.js.map +1 -1
  48. package/color-picker/lib/es6/ColorPicker.js +23 -23
  49. package/color-picker/lib/es6/PaletteManager.js +23 -23
  50. package/color-picker/lib/es6/components/InputColor.js +23 -23
  51. package/color-picker/lib/es6/index.d.js.map +1 -1
  52. package/color-picker/lib/types/index.d.ts +174 -0
  53. package/core/lib/cjs/enhancement/Root.js +2 -2
  54. package/core/lib/cjs/enhancement/Root.js.map +1 -1
  55. package/core/lib/cjs/enhancement/hoistProps.js +3 -9
  56. package/core/lib/cjs/enhancement/hoistProps.js.map +1 -1
  57. package/core/lib/cjs/enhancement/i18n.js +1 -1
  58. package/core/lib/cjs/enhancement/i18n.js.map +1 -1
  59. package/core/lib/cjs/enhancement/staticChildren.js +3 -9
  60. package/core/lib/cjs/enhancement/staticChildren.js.map +1 -1
  61. package/core/lib/cjs/enhancement/uncontrolledProps.js +2 -6
  62. package/core/lib/cjs/enhancement/uncontrolledProps.js.map +1 -1
  63. package/core/lib/cjs/index.js +3 -3
  64. package/core/lib/cjs/index.js.map +1 -1
  65. package/core/lib/cjs/utils/assignProps.js +93 -0
  66. package/core/lib/cjs/utils/assignProps.js.map +1 -0
  67. package/core/lib/cjs/utils/canUseDOM.js +10 -0
  68. package/core/lib/cjs/utils/canUseDOM.js.map +1 -0
  69. package/core/lib/cjs/utils/capitalizeFirstLetter.js +10 -0
  70. package/core/lib/cjs/utils/capitalizeFirstLetter.js.map +1 -0
  71. package/core/lib/cjs/utils/createHoc.js +55 -0
  72. package/core/lib/cjs/utils/createHoc.js.map +1 -0
  73. package/core/lib/cjs/utils/enhances/WithI18n.js +85 -0
  74. package/core/lib/cjs/utils/enhances/WithI18n.js.map +1 -0
  75. package/core/lib/cjs/utils/enhances/i18nEnhance.js +133 -0
  76. package/core/lib/cjs/utils/enhances/i18nEnhance.js.map +1 -0
  77. package/core/lib/cjs/utils/getDisplayName.js +10 -0
  78. package/core/lib/cjs/utils/getDisplayName.js.map +1 -0
  79. package/core/lib/cjs/utils/logger.js +40 -0
  80. package/core/lib/cjs/utils/logger.js.map +1 -0
  81. package/core/lib/cjs/utils/pick.js +19 -0
  82. package/core/lib/cjs/utils/pick.js.map +1 -0
  83. package/core/lib/cjs/utils/ref.js +94 -0
  84. package/core/lib/cjs/utils/ref.js.map +1 -0
  85. package/core/lib/cjs/utils/use/useEnhancedEffect.js +13 -0
  86. package/core/lib/cjs/utils/use/useEnhancedEffect.js.map +1 -0
  87. package/core/lib/es6/enhancement/Root.js +2 -4
  88. package/core/lib/es6/enhancement/Root.js.map +1 -1
  89. package/core/lib/es6/enhancement/hoistProps.js +3 -6
  90. package/core/lib/es6/enhancement/hoistProps.js.map +1 -1
  91. package/core/lib/es6/enhancement/i18n.js +1 -2
  92. package/core/lib/es6/enhancement/i18n.js.map +1 -1
  93. package/core/lib/es6/enhancement/staticChildren.js +3 -6
  94. package/core/lib/es6/enhancement/staticChildren.js.map +1 -1
  95. package/core/lib/es6/enhancement/uncontrolledProps.js +2 -4
  96. package/core/lib/es6/enhancement/uncontrolledProps.js.map +1 -1
  97. package/core/lib/es6/index.js +3 -6
  98. package/core/lib/es6/index.js.map +1 -1
  99. package/core/lib/es6/utils/assignProps.js +84 -0
  100. package/core/lib/es6/utils/assignProps.js.map +1 -0
  101. package/core/lib/es6/utils/canUseDOM.js +4 -0
  102. package/core/lib/es6/utils/canUseDOM.js.map +1 -0
  103. package/core/lib/es6/utils/capitalizeFirstLetter.js +4 -0
  104. package/core/lib/es6/utils/capitalizeFirstLetter.js.map +1 -0
  105. package/core/lib/es6/utils/createHoc.js +46 -0
  106. package/core/lib/es6/utils/createHoc.js.map +1 -0
  107. package/core/lib/es6/utils/enhances/WithI18n.js +73 -0
  108. package/core/lib/es6/utils/enhances/WithI18n.js.map +1 -0
  109. package/core/lib/es6/utils/enhances/i18nEnhance.js +122 -0
  110. package/core/lib/es6/utils/enhances/i18nEnhance.js.map +1 -0
  111. package/core/lib/es6/utils/getDisplayName.js +4 -0
  112. package/core/lib/es6/utils/getDisplayName.js.map +1 -0
  113. package/core/lib/es6/utils/logger.js +32 -0
  114. package/core/lib/es6/utils/logger.js.map +1 -0
  115. package/core/lib/es6/utils/pick.js +13 -0
  116. package/core/lib/es6/utils/pick.js.map +1 -0
  117. package/core/lib/es6/utils/ref.js +82 -0
  118. package/core/lib/es6/utils/ref.js.map +1 -0
  119. package/core/lib/es6/utils/use/useEnhancedEffect.js +5 -0
  120. package/core/lib/es6/utils/use/useEnhancedEffect.js.map +1 -0
  121. package/core/lib/types/utils/assignProps.d.ts +13 -0
  122. package/core/lib/types/utils/canUseDOM.d.ts +1 -0
  123. package/core/lib/types/utils/capitalizeFirstLetter.d.ts +1 -0
  124. package/core/lib/types/utils/createHoc.d.ts +3 -0
  125. package/core/lib/types/utils/enhances/WithI18n.d.ts +43 -0
  126. package/core/lib/types/utils/enhances/i18nEnhance.d.ts +26 -0
  127. package/core/lib/types/utils/getDisplayName.d.ts +2 -0
  128. package/core/lib/types/utils/logger.d.ts +9 -0
  129. package/core/lib/types/utils/pick.d.ts +1 -0
  130. package/core/lib/types/utils/ref.d.ts +8 -0
  131. package/core/lib/types/utils/use/useEnhancedEffect.d.ts +3 -0
  132. package/core/utils/assignProps.d.ts +13 -0
  133. package/core/utils/canUseDOM.d.ts +1 -0
  134. package/core/utils/capitalizeFirstLetter.d.ts +1 -0
  135. package/core/utils/createHoc.d.ts +3 -0
  136. package/core/utils/enhances/WithI18n.d.ts +43 -0
  137. package/core/utils/enhances/i18nEnhance.d.ts +26 -0
  138. package/core/utils/getDisplayName.d.ts +2 -0
  139. package/core/utils/logger.d.ts +9 -0
  140. package/core/utils/pick.d.ts +1 -0
  141. package/core/utils/ref.d.ts +8 -0
  142. package/core/utils/use/useEnhancedEffect.d.ts +3 -0
  143. package/counter/lib/cjs/Counter.js +10 -10
  144. package/counter/lib/es6/Counter.js +10 -10
  145. package/d3-chart/lib/cjs/Area.js +9 -9
  146. package/d3-chart/lib/cjs/Axis.js +14 -14
  147. package/d3-chart/lib/cjs/Bar.js +8 -8
  148. package/d3-chart/lib/cjs/Bubble.js +10 -10
  149. package/d3-chart/lib/cjs/Donut.js +7 -7
  150. package/d3-chart/lib/cjs/Dots.js +19 -22
  151. package/d3-chart/lib/cjs/Dots.js.map +1 -1
  152. package/d3-chart/lib/cjs/HorizontalBar.js +8 -8
  153. package/d3-chart/lib/cjs/Hover.js +3 -3
  154. package/d3-chart/lib/cjs/Line.js +9 -9
  155. package/d3-chart/lib/cjs/Plot.js +3 -3
  156. package/d3-chart/lib/cjs/Radar.js +17 -17
  157. package/d3-chart/lib/cjs/RadialTree.js +10 -10
  158. package/d3-chart/lib/cjs/ReferenceLine.js +9 -9
  159. package/d3-chart/lib/cjs/ScatterPlot.js +7 -7
  160. package/d3-chart/lib/cjs/Tooltip.js +8 -8
  161. package/d3-chart/lib/cjs/Venn.js +7 -7
  162. package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
  163. package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
  164. package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  165. package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +15 -15
  166. package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  167. package/d3-chart/lib/es6/Area.js +9 -9
  168. package/d3-chart/lib/es6/Axis.js +14 -14
  169. package/d3-chart/lib/es6/Bar.js +8 -8
  170. package/d3-chart/lib/es6/Bubble.js +10 -10
  171. package/d3-chart/lib/es6/Donut.js +7 -7
  172. package/d3-chart/lib/es6/Dots.js +19 -22
  173. package/d3-chart/lib/es6/Dots.js.map +1 -1
  174. package/d3-chart/lib/es6/HorizontalBar.js +8 -8
  175. package/d3-chart/lib/es6/Hover.js +3 -3
  176. package/d3-chart/lib/es6/Line.js +9 -9
  177. package/d3-chart/lib/es6/Plot.js +3 -3
  178. package/d3-chart/lib/es6/Radar.js +17 -17
  179. package/d3-chart/lib/es6/RadialTree.js +10 -10
  180. package/d3-chart/lib/es6/ReferenceLine.js +9 -9
  181. package/d3-chart/lib/es6/ScatterPlot.js +7 -7
  182. package/d3-chart/lib/es6/Tooltip.js +8 -8
  183. package/d3-chart/lib/es6/Venn.js +7 -7
  184. package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
  185. package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
  186. package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  187. package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +15 -15
  188. package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  189. package/data-table/lib/cjs/Body.js +4 -4
  190. package/data-table/lib/cjs/DataTable.js +40 -40
  191. package/data-table/lib/cjs/Head.js +4 -4
  192. package/data-table/lib/es6/Body.js +4 -4
  193. package/data-table/lib/es6/DataTable.js +40 -40
  194. package/data-table/lib/es6/Head.js +4 -4
  195. package/date-picker/lib/cjs/DateRangeComparator.js +1 -0
  196. package/date-picker/lib/cjs/DateRangeComparator.js.map +1 -1
  197. package/date-picker/lib/cjs/MonthDateRangeComparator.js +1 -0
  198. package/date-picker/lib/cjs/MonthDateRangeComparator.js.map +1 -1
  199. package/date-picker/lib/cjs/components/Calendar.js +21 -21
  200. package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js +26 -25
  201. package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
  202. package/date-picker/lib/cjs/components/InputTrigger.js +40 -31
  203. package/date-picker/lib/cjs/components/InputTrigger.js.map +1 -1
  204. package/date-picker/lib/cjs/components/PickerAbstract.js +27 -27
  205. package/date-picker/lib/cjs/components/PickerAbstract.js.map +1 -1
  206. package/date-picker/lib/cjs/components/RangePickerAbstract.js +26 -25
  207. package/date-picker/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  208. package/date-picker/lib/cjs/style/date-picker.shadow.css +4 -0
  209. package/date-picker/lib/es6/DateRangeComparator.js +1 -0
  210. package/date-picker/lib/es6/DateRangeComparator.js.map +1 -1
  211. package/date-picker/lib/es6/MonthDateRangeComparator.js +1 -0
  212. package/date-picker/lib/es6/MonthDateRangeComparator.js.map +1 -1
  213. package/date-picker/lib/es6/components/Calendar.js +21 -21
  214. package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js +26 -25
  215. package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
  216. package/date-picker/lib/es6/components/InputTrigger.js +40 -31
  217. package/date-picker/lib/es6/components/InputTrigger.js.map +1 -1
  218. package/date-picker/lib/es6/components/PickerAbstract.js +27 -27
  219. package/date-picker/lib/es6/components/PickerAbstract.js.map +1 -1
  220. package/date-picker/lib/es6/components/RangePickerAbstract.js +26 -25
  221. package/date-picker/lib/es6/components/RangePickerAbstract.js.map +1 -1
  222. package/date-picker/lib/es6/style/date-picker.shadow.css +4 -0
  223. package/divider/lib/cjs/Divider.js +9 -9
  224. package/divider/lib/es6/Divider.js +9 -9
  225. package/dot/lib/cjs/Dot.js +10 -10
  226. package/dot/lib/es6/Dot.js +10 -10
  227. package/drag-and-drop/lib/cjs/DragAndDrop.js +12 -12
  228. package/drag-and-drop/lib/es6/DragAndDrop.js +12 -12
  229. package/dropdown/lib/cjs/Dropdown.js +2 -2
  230. package/dropdown/lib/es6/Dropdown.js +2 -2
  231. package/dropdown-menu/lib/cjs/DropdownMenu.js +12 -12
  232. package/dropdown-menu/lib/cjs/styleScrollArea.js +6 -6
  233. package/dropdown-menu/lib/es6/DropdownMenu.js +12 -12
  234. package/dropdown-menu/lib/es6/styleScrollArea.js +6 -6
  235. package/ellipsis/lib/cjs/Ellipsis.js +10 -10
  236. package/ellipsis/lib/es6/Ellipsis.js +10 -10
  237. package/errors/lib/cjs/Error.js +9 -9
  238. package/errors/lib/es6/Error.js +9 -9
  239. package/feature-popover/lib/cjs/FeaturePopover.js +10 -10
  240. package/feature-popover/lib/es6/FeaturePopover.js +10 -10
  241. package/feedback-form/lib/cjs/FeedbackForm.js +7 -7
  242. package/feedback-form/lib/es6/FeedbackForm.js +7 -7
  243. package/flags/lib/cjs/Flags.js +3 -3
  244. package/flags/lib/es6/Flags.js +3 -3
  245. package/flags/lib/sprites/sprite@1x.css +256 -256
  246. package/flags/lib/sprites/sprite@2x.css +257 -257
  247. package/flex-box/lib/cjs/Box/useBox.js +3 -3
  248. package/flex-box/lib/cjs/Flex/useFlex.js +3 -3
  249. package/flex-box/lib/es6/Box/useBox.js +3 -3
  250. package/flex-box/lib/es6/Flex/useFlex.js +3 -3
  251. package/format-text/lib/cjs/FormatText.js +5 -5
  252. package/format-text/lib/es6/FormatText.js +5 -5
  253. package/fullscreen-modal/lib/cjs/FullscreenModal.js +13 -13
  254. package/fullscreen-modal/lib/es6/FullscreenModal.js +13 -13
  255. package/grid/lib/cjs/Grid.js +114 -114
  256. package/grid/lib/es6/Grid.js +114 -114
  257. package/icon/color/Confluence/l/index.js +4 -4
  258. package/icon/color/Confluence/l/index.mjs +4 -4
  259. package/icon/color/Confluence/m/index.js +4 -4
  260. package/icon/color/Confluence/m/index.mjs +4 -4
  261. package/icon/color/MicrosoftOffice/l/index.js +10 -10
  262. package/icon/color/MicrosoftOffice/l/index.mjs +10 -10
  263. package/icon/color/MicrosoftOffice/m/index.js +10 -10
  264. package/icon/color/MicrosoftOffice/m/index.mjs +10 -10
  265. package/icon/lib/cjs/Icon.js +5 -5
  266. package/icon/lib/es6/Icon.js +5 -5
  267. package/icon/pay/Discover/l/index.js +1 -1
  268. package/icon/pay/Discover/l/index.mjs +1 -1
  269. package/icon/pay/Discover/m/index.js +1 -1
  270. package/icon/pay/Discover/m/index.mjs +1 -1
  271. package/icon/pay/JCB/l/index.js +10 -10
  272. package/icon/pay/JCB/l/index.mjs +10 -10
  273. package/icon/pay/JCB/m/index.js +10 -10
  274. package/icon/pay/JCB/m/index.mjs +10 -10
  275. package/icon/pay/Visa/l/index.js +2 -2
  276. package/icon/pay/Visa/l/index.mjs +2 -2
  277. package/icon/pay/Visa/m/index.js +2 -2
  278. package/icon/pay/Visa/m/index.mjs +2 -2
  279. package/illustration/lib/cjs/index.js +1 -1
  280. package/illustration/lib/es6/index.js +1 -1
  281. package/inline-edit/lib/cjs/InlineEdit.js +4 -4
  282. package/inline-edit/lib/es6/InlineEdit.js +4 -4
  283. package/inline-input/lib/cjs/InlineInput.js +26 -20
  284. package/inline-input/lib/cjs/InlineInput.js.map +1 -1
  285. package/inline-input/lib/cjs/style/inline-input.shadow.css +7 -0
  286. package/inline-input/lib/es6/InlineInput.js +26 -20
  287. package/inline-input/lib/es6/InlineInput.js.map +1 -1
  288. package/inline-input/lib/es6/style/inline-input.shadow.css +7 -0
  289. package/input/lib/cjs/Input.js +21 -19
  290. package/input/lib/cjs/Input.js.map +1 -1
  291. package/input/lib/cjs/style/input.shadow.css +7 -6
  292. package/input/lib/es6/Input.js +21 -19
  293. package/input/lib/es6/Input.js.map +1 -1
  294. package/input/lib/es6/style/input.shadow.css +7 -6
  295. package/input-mask/lib/cjs/InputMask.js +6 -6
  296. package/input-mask/lib/es6/InputMask.js +6 -6
  297. package/input-number/lib/cjs/InputNumber.js +9 -9
  298. package/input-number/lib/es6/InputNumber.js +9 -9
  299. package/input-tags/lib/cjs/InputTags.js +57 -42
  300. package/input-tags/lib/cjs/InputTags.js.map +1 -1
  301. package/input-tags/lib/cjs/style/input-tag.shadow.css +2 -6
  302. package/input-tags/lib/es6/InputTags.js +57 -42
  303. package/input-tags/lib/es6/InputTags.js.map +1 -1
  304. package/input-tags/lib/es6/style/input-tag.shadow.css +2 -6
  305. package/link/lib/cjs/Link.js +12 -12
  306. package/link/lib/es6/Link.js +12 -12
  307. package/modal/lib/cjs/Modal.js +11 -9
  308. package/modal/lib/cjs/Modal.js.map +1 -1
  309. package/modal/lib/es6/Modal.js +11 -9
  310. package/modal/lib/es6/Modal.js.map +1 -1
  311. package/notice/lib/cjs/Notice.js +13 -13
  312. package/notice/lib/es6/Notice.js +13 -13
  313. package/notice-bubble/lib/cjs/NoticeBubble.js +12 -12
  314. package/notice-bubble/lib/es6/NoticeBubble.js +12 -12
  315. package/notice-global/lib/cjs/NoticeGlobal.js +11 -11
  316. package/notice-global/lib/es6/NoticeGlobal.js +11 -11
  317. package/package.json +2 -2
  318. package/pagination/lib/cjs/Pagination.js +10 -10
  319. package/pagination/lib/es6/Pagination.js +10 -10
  320. package/pills/lib/cjs/Pills.js +17 -17
  321. package/pills/lib/es6/Pills.js +17 -17
  322. package/popper/lib/cjs/Popper.js +6 -6
  323. package/popper/lib/es6/Popper.js +6 -6
  324. package/product-head/lib/cjs/Info.js +4 -4
  325. package/product-head/lib/cjs/ProductHead.js +5 -5
  326. package/product-head/lib/cjs/Title.js +4 -4
  327. package/product-head/lib/es6/Info.js +4 -4
  328. package/product-head/lib/es6/ProductHead.js +5 -5
  329. package/product-head/lib/es6/Title.js +4 -4
  330. package/progress-bar/lib/cjs/ProgressBar.js +15 -15
  331. package/progress-bar/lib/es6/ProgressBar.js +15 -15
  332. package/radio/lib/cjs/Radio.js +23 -16
  333. package/radio/lib/cjs/Radio.js.map +1 -1
  334. package/radio/lib/cjs/style/radio.shadow.css +7 -0
  335. package/radio/lib/es6/Radio.js +23 -16
  336. package/radio/lib/es6/Radio.js.map +1 -1
  337. package/radio/lib/es6/style/radio.shadow.css +7 -0
  338. package/scroll-area/lib/cjs/ScrollArea.js +9 -9
  339. package/scroll-area/lib/cjs/ScrollBar.js +5 -5
  340. package/scroll-area/lib/es6/ScrollArea.js +9 -9
  341. package/scroll-area/lib/es6/ScrollBar.js +5 -5
  342. package/select/lib/cjs/InputSearch.js +6 -6
  343. package/select/lib/cjs/Select.js +7 -7
  344. package/select/lib/es6/InputSearch.js +6 -6
  345. package/select/lib/es6/Select.js +7 -7
  346. package/side-panel/lib/cjs/SidePanel.js +15 -15
  347. package/side-panel/lib/es6/SidePanel.js +15 -15
  348. package/skeleton/lib/cjs/Charts/Area.js +9 -9
  349. package/skeleton/lib/cjs/Charts/Bar.js +9 -9
  350. package/skeleton/lib/cjs/Charts/Bubble.js +9 -9
  351. package/skeleton/lib/cjs/Charts/Donut.js +9 -9
  352. package/skeleton/lib/cjs/Charts/Histogram.js +9 -9
  353. package/skeleton/lib/cjs/Charts/Line.js +9 -9
  354. package/skeleton/lib/cjs/Charts/RadialTree.js +9 -9
  355. package/skeleton/lib/cjs/Charts/ScatterPlot.js +9 -9
  356. package/skeleton/lib/cjs/Charts/Venn.js +9 -9
  357. package/skeleton/lib/cjs/Skeleton.js +8 -8
  358. package/skeleton/lib/es6/Charts/Area.js +9 -9
  359. package/skeleton/lib/es6/Charts/Bar.js +9 -9
  360. package/skeleton/lib/es6/Charts/Bubble.js +9 -9
  361. package/skeleton/lib/es6/Charts/Donut.js +9 -9
  362. package/skeleton/lib/es6/Charts/Histogram.js +9 -9
  363. package/skeleton/lib/es6/Charts/Line.js +9 -9
  364. package/skeleton/lib/es6/Charts/RadialTree.js +9 -9
  365. package/skeleton/lib/es6/Charts/ScatterPlot.js +9 -9
  366. package/skeleton/lib/es6/Charts/Venn.js +9 -9
  367. package/skeleton/lib/es6/Skeleton.js +8 -8
  368. package/slider/lib/cjs/Slider.js +7 -7
  369. package/slider/lib/es6/Slider.js +7 -7
  370. package/spin/lib/cjs/Spin.js +13 -13
  371. package/spin/lib/es6/Spin.js +13 -13
  372. package/spin-container/lib/cjs/SpinContainer.js +8 -8
  373. package/spin-container/lib/es6/SpinContainer.js +8 -8
  374. package/sticky/lib/cjs/Sticky.js +2 -2
  375. package/sticky/lib/es6/Sticky.js +2 -2
  376. package/switch/lib/cjs/Switch.js +21 -21
  377. package/switch/lib/es6/Switch.js +21 -21
  378. package/tab-line/lib/cjs/TabLine.js +13 -13
  379. package/tab-line/lib/es6/TabLine.js +13 -13
  380. package/tab-panel/lib/cjs/TabPanel.js +8 -8
  381. package/tab-panel/lib/es6/TabPanel.js +8 -8
  382. package/tag/lib/cjs/Tag.js +19 -19
  383. package/tag/lib/es6/Tag.js +19 -19
  384. package/textarea/lib/cjs/Textarea.js +8 -8
  385. package/textarea/lib/cjs/style/textarea.shadow.css +8 -1
  386. package/textarea/lib/es6/Textarea.js +8 -8
  387. package/textarea/lib/es6/style/textarea.shadow.css +8 -1
  388. package/time-picker/lib/cjs/TimePicker.js +12 -12
  389. package/time-picker/lib/es6/TimePicker.js +12 -12
  390. package/tooltip/index.d.ts +2 -1
  391. package/tooltip/lib/cjs/Tooltip.js +6 -6
  392. package/tooltip/lib/cjs/index.d.js.map +1 -1
  393. package/tooltip/lib/es6/Tooltip.js +6 -6
  394. package/tooltip/lib/es6/index.d.js.map +1 -1
  395. package/tooltip/lib/types/index.d.ts +2 -1
  396. package/typography/lib/cjs/Blockquote.js +4 -4
  397. package/typography/lib/cjs/Hint.js +7 -7
  398. package/typography/lib/cjs/List.js +5 -5
  399. package/typography/lib/cjs/Text.js +34 -34
  400. package/typography/lib/es6/Blockquote.js +4 -4
  401. package/typography/lib/es6/Hint.js +7 -7
  402. package/typography/lib/es6/List.js +5 -5
  403. package/typography/lib/es6/Text.js +34 -34
  404. package/utils/lib/propsForElement.js +1 -2
  405. package/utils/lib/propsForElement.js.map +1 -1
  406. package/utils/lib/propsForElement.mjs +1 -2
  407. package/utils/lib/propsForElement.mjs.map +1 -1
  408. package/utils/lib/use/useFocusLock.js +2 -2
  409. package/utils/lib/use/useFocusLock.js.map +1 -1
  410. package/utils/lib/use/useFocusLock.mjs +2 -2
  411. package/utils/lib/use/useFocusLock.mjs.map +1 -1
  412. package/widget-empty/lib/cjs/WidgetEmpty.js +5 -5
  413. package/widget-empty/lib/es6/WidgetEmpty.js +5 -5
  414. package/wizard/lib/cjs/Wizard.js +11 -11
  415. package/wizard/lib/es6/Wizard.js +11 -11
@@ -11,29 +11,29 @@ import Divider from 'intergalactic/divider';
11
11
  import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
12
12
  import i18nEnhance from 'intergalactic/utils/lib/enhances/i18nEnhance';
13
13
  /*__reshadow-styles__:"./style/color-picker.shadow.css"*/
14
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SColorPickerPopper_1wce9_gg_{max-width:calc(var(--intergalactic-spacing-4x, 16px)*2 + 28px*6 + 4px*6);padding:var(--intergalactic-spacing-4x, 16px)}.___SItemContainer_1wce9_gg_{position:relative;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid transparent;outline:0;cursor:pointer}@media (hover:hover){.___SItemContainer_1wce9_gg_:hover{border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}}.___SItemContainer_1wce9_gg_::after{content:\"\";position:absolute;width:22px;height:22px;border-radius:50%;box-shadow:inset 0 0 1px var(--intergalactic-border-secondary, #e0e1e9);background:var(--value_1wce9)}@media (hover:hover){.___SItemContainer_1wce9_gg_:hover>.___SCloseIcon_1wce9_gg_{opacity:1}}.___SItemContainer_1wce9_gg_.__keyboardFocused_1wce9_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SItemContainer_1wce9_gg_.__selected_1wce9_gg_{border:1px solid var(--intergalactic-border-info-active, #006dca)}.___SItemContainer_1wce9_gg_.__displayLabel_1wce9_gg_::after{background:var(--value_1wce9);opacity:.15}.___SItemContainer_1wce9_gg_:not(.__value_1wce9_gg_)::after{border:.9px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SColors_1wce9_gg_{display:flex;flex-wrap:wrap;align-items:center;gap:var(--intergalactic-spacing-1x, 4px)}.___SPaletteManager_1wce9_gg_{justify-content:space-between;margin-top:var(--intergalactic-spacing-3x, 12px);margin-left:calc(var(--intergalactic-spacing-1x, 4px) - 1px)}.___SInputContainer_1wce9_gg_,.___SPaletteManager_1wce9_gg_,.___SPlusButton_1wce9_gg_{display:flex;align-items:center}.___SPlusButton_1wce9_gg_{justify-content:center;width:28px;height:28px;border-radius:50%;cursor:pointer}@media (hover:hover){.___SPlusButton_1wce9_gg_:hover{background-color:var(--intergalactic-bg-secondary-neutral-hover, #e0e1e9)}}.___SDefaultTrigger_1wce9_gg_{display:inline-flex;align-items:center;outline:0;cursor:pointer}.___SDefaultTrigger_1wce9_gg_.__keyboardFocused_1wce9_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___STriggerCircle_1wce9_gg_{position:relative;width:12px;height:12px;margin-right:calc(var(--intergalactic-spacing-1x, 4px) + 1px);border-radius:50%;background-color:var(--data-value_1wce9);border:1px solid transparent}.___STriggerCircle_1wce9_gg_:not([data-value]){border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___STriggerCircleLine_1wce9_gg_{position:absolute;top:1px;left:1px}.___SCloseIcon_1wce9_gg_{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:12px;height:12px;border-radius:50%;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);opacity:0;z-index:1}.___SLine_1wce9_gg_{position:absolute}.___SLabel_1wce9_gg_{z-index:1;color:var(--data-value_1wce9);font-size:calc(var(--intergalactic-fs-100, 12px) + 1px);font-weight:var(--intergalactic-bold, 700)}.___SItemColor_1wce9_gg_{width:20px;height:20px;border-radius:50%;border:1px solid var(--intergalactic-border-secondary, #e0e1e9);background:var(--data-value_1wce9)}.___SClearConfirm_1wce9_gg_.__hidden_1wce9_gg_,.___SConfirmColor_1wce9_gg_.__hidden_1wce9_gg_{display:none}" /*__inner_css_end__*/, "1wce9_gg_") /*__reshadow_css_end__*/, {
15
- "__SColorPickerPopper": "___SColorPickerPopper_1wce9_gg_",
16
- "__SItemContainer": "___SItemContainer_1wce9_gg_",
17
- "__SCloseIcon": "___SCloseIcon_1wce9_gg_",
18
- "_keyboardFocused": "__keyboardFocused_1wce9_gg_",
19
- "_selected": "__selected_1wce9_gg_",
20
- "__SColors": "___SColors_1wce9_gg_",
21
- "__SPaletteManager": "___SPaletteManager_1wce9_gg_",
22
- "__SInputContainer": "___SInputContainer_1wce9_gg_",
23
- "__SDefaultTrigger": "___SDefaultTrigger_1wce9_gg_",
24
- "__STriggerCircle": "___STriggerCircle_1wce9_gg_",
25
- "--data-value": "--data-value_1wce9",
26
- "__STriggerCircleLine": "___STriggerCircleLine_1wce9_gg_",
27
- "__SLine": "___SLine_1wce9_gg_",
28
- "__SLabel": "___SLabel_1wce9_gg_",
29
- "__SItemColor": "___SItemColor_1wce9_gg_",
30
- "__SConfirmColor": "___SConfirmColor_1wce9_gg_",
31
- "_hidden": "__hidden_1wce9_gg_",
32
- "__SClearConfirm": "___SClearConfirm_1wce9_gg_",
33
- "--value": "--value_1wce9",
34
- "_displayLabel": "__displayLabel_1wce9_gg_",
35
- "_value": "__value_1wce9_gg_",
36
- "__SPlusButton": "___SPlusButton_1wce9_gg_"
14
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SColorPickerPopper_15luc_gg_{max-width:calc(var(--intergalactic-spacing-4x, 16px)*2 + 28px*6 + 4px*6);padding:var(--intergalactic-spacing-4x, 16px)}.___SItemContainer_15luc_gg_{position:relative;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid transparent;outline:0;cursor:pointer}@media (hover:hover){.___SItemContainer_15luc_gg_:hover{border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}}.___SItemContainer_15luc_gg_::after{content:\"\";position:absolute;width:22px;height:22px;border-radius:50%;box-shadow:inset 0 0 1px var(--intergalactic-border-secondary, #e0e1e9);background:var(--value_15luc)}@media (hover:hover){.___SItemContainer_15luc_gg_:hover>.___SCloseIcon_15luc_gg_{opacity:1}}.___SItemContainer_15luc_gg_.__keyboardFocused_15luc_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SItemContainer_15luc_gg_.__selected_15luc_gg_{border:1px solid var(--intergalactic-border-info-active, #006dca)}.___SItemContainer_15luc_gg_.__displayLabel_15luc_gg_::after{background:var(--value_15luc);opacity:.15}.___SItemContainer_15luc_gg_:not(.__value_15luc_gg_)::after{border:.9px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SColors_15luc_gg_{display:flex;flex-wrap:wrap;align-items:center;gap:var(--intergalactic-spacing-1x, 4px)}.___SPaletteManager_15luc_gg_{justify-content:space-between;margin-top:var(--intergalactic-spacing-3x, 12px);margin-left:calc(var(--intergalactic-spacing-1x, 4px) - 1px)}.___SInputContainer_15luc_gg_,.___SPaletteManager_15luc_gg_,.___SPlusButton_15luc_gg_{display:flex;align-items:center}.___SPlusButton_15luc_gg_{justify-content:center;width:28px;height:28px;border-radius:50%;cursor:pointer}@media (hover:hover){.___SPlusButton_15luc_gg_:hover{background-color:var(--intergalactic-bg-secondary-neutral-hover, #e0e1e9)}}.___SDefaultTrigger_15luc_gg_{display:inline-flex;align-items:center;outline:0;cursor:pointer}.___SDefaultTrigger_15luc_gg_.__keyboardFocused_15luc_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___STriggerCircle_15luc_gg_{position:relative;width:12px;height:12px;margin-right:calc(var(--intergalactic-spacing-1x, 4px) + 1px);border-radius:50%;background-color:var(--data-value_15luc);border:1px solid transparent}.___STriggerCircle_15luc_gg_:not([data-value]){border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___STriggerCircleLine_15luc_gg_{position:absolute;top:1px;left:1px}.___SCloseIcon_15luc_gg_{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:12px;height:12px;border-radius:50%;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);opacity:0;z-index:1}.___SLine_15luc_gg_{position:absolute}.___SLabel_15luc_gg_{z-index:1;color:var(--data-value_15luc);font-size:calc(var(--intergalactic-fs-100, 12px) + 1px);font-weight:var(--intergalactic-bold, 700)}.___SItemColor_15luc_gg_{width:20px;height:20px;border-radius:50%;border:1px solid var(--intergalactic-border-secondary, #e0e1e9);background:var(--data-value_15luc)}.___SClearConfirm_15luc_gg_.__hidden_15luc_gg_,.___SConfirmColor_15luc_gg_.__hidden_15luc_gg_{display:none}" /*__inner_css_end__*/, "15luc_gg_") /*__reshadow_css_end__*/, {
15
+ "__SColorPickerPopper": "___SColorPickerPopper_15luc_gg_",
16
+ "__SItemContainer": "___SItemContainer_15luc_gg_",
17
+ "__SCloseIcon": "___SCloseIcon_15luc_gg_",
18
+ "_keyboardFocused": "__keyboardFocused_15luc_gg_",
19
+ "_selected": "__selected_15luc_gg_",
20
+ "__SColors": "___SColors_15luc_gg_",
21
+ "__SPaletteManager": "___SPaletteManager_15luc_gg_",
22
+ "__SInputContainer": "___SInputContainer_15luc_gg_",
23
+ "__SDefaultTrigger": "___SDefaultTrigger_15luc_gg_",
24
+ "__STriggerCircle": "___STriggerCircle_15luc_gg_",
25
+ "--data-value": "--data-value_15luc",
26
+ "__STriggerCircleLine": "___STriggerCircleLine_15luc_gg_",
27
+ "__SLine": "___SLine_15luc_gg_",
28
+ "__SLabel": "___SLabel_15luc_gg_",
29
+ "__SItemColor": "___SItemColor_15luc_gg_",
30
+ "__SConfirmColor": "___SConfirmColor_15luc_gg_",
31
+ "_hidden": "__hidden_15luc_gg_",
32
+ "__SClearConfirm": "___SClearConfirm_15luc_gg_",
33
+ "--value": "--value_15luc",
34
+ "_displayLabel": "__displayLabel_15luc_gg_",
35
+ "_value": "__value_15luc_gg_",
36
+ "__SPlusButton": "___SPlusButton_15luc_gg_"
37
37
  });
38
38
  var PaletteManagerRoot = /*#__PURE__*/function (_Component) {
39
39
  _inherits(PaletteManagerRoot, _Component);
@@ -14,29 +14,29 @@ import Input from 'intergalactic/input';
14
14
  import CheckM from 'intergalactic/icon/Check/m';
15
15
  import CloseM from 'intergalactic/icon/Close/m';
16
16
  /*__reshadow-styles__:"../style/color-picker.shadow.css"*/
17
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SColorPickerPopper_1wce9_gg_{max-width:calc(var(--intergalactic-spacing-4x, 16px)*2 + 28px*6 + 4px*6);padding:var(--intergalactic-spacing-4x, 16px)}.___SItemContainer_1wce9_gg_{position:relative;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid transparent;outline:0;cursor:pointer}@media (hover:hover){.___SItemContainer_1wce9_gg_:hover{border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}}.___SItemContainer_1wce9_gg_::after{content:\"\";position:absolute;width:22px;height:22px;border-radius:50%;box-shadow:inset 0 0 1px var(--intergalactic-border-secondary, #e0e1e9);background:var(--value_1wce9)}@media (hover:hover){.___SItemContainer_1wce9_gg_:hover>.___SCloseIcon_1wce9_gg_{opacity:1}}.___SItemContainer_1wce9_gg_.__keyboardFocused_1wce9_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SItemContainer_1wce9_gg_.__selected_1wce9_gg_{border:1px solid var(--intergalactic-border-info-active, #006dca)}.___SItemContainer_1wce9_gg_.__displayLabel_1wce9_gg_::after{background:var(--value_1wce9);opacity:.15}.___SItemContainer_1wce9_gg_:not(.__value_1wce9_gg_)::after{border:.9px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SColors_1wce9_gg_{display:flex;flex-wrap:wrap;align-items:center;gap:var(--intergalactic-spacing-1x, 4px)}.___SPaletteManager_1wce9_gg_{justify-content:space-between;margin-top:var(--intergalactic-spacing-3x, 12px);margin-left:calc(var(--intergalactic-spacing-1x, 4px) - 1px)}.___SInputContainer_1wce9_gg_,.___SPaletteManager_1wce9_gg_,.___SPlusButton_1wce9_gg_{display:flex;align-items:center}.___SPlusButton_1wce9_gg_{justify-content:center;width:28px;height:28px;border-radius:50%;cursor:pointer}@media (hover:hover){.___SPlusButton_1wce9_gg_:hover{background-color:var(--intergalactic-bg-secondary-neutral-hover, #e0e1e9)}}.___SDefaultTrigger_1wce9_gg_{display:inline-flex;align-items:center;outline:0;cursor:pointer}.___SDefaultTrigger_1wce9_gg_.__keyboardFocused_1wce9_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___STriggerCircle_1wce9_gg_{position:relative;width:12px;height:12px;margin-right:calc(var(--intergalactic-spacing-1x, 4px) + 1px);border-radius:50%;background-color:var(--data-value_1wce9);border:1px solid transparent}.___STriggerCircle_1wce9_gg_:not([data-value]){border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___STriggerCircleLine_1wce9_gg_{position:absolute;top:1px;left:1px}.___SCloseIcon_1wce9_gg_{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:12px;height:12px;border-radius:50%;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);opacity:0;z-index:1}.___SLine_1wce9_gg_{position:absolute}.___SLabel_1wce9_gg_{z-index:1;color:var(--data-value_1wce9);font-size:calc(var(--intergalactic-fs-100, 12px) + 1px);font-weight:var(--intergalactic-bold, 700)}.___SItemColor_1wce9_gg_{width:20px;height:20px;border-radius:50%;border:1px solid var(--intergalactic-border-secondary, #e0e1e9);background:var(--data-value_1wce9)}.___SClearConfirm_1wce9_gg_.__hidden_1wce9_gg_,.___SConfirmColor_1wce9_gg_.__hidden_1wce9_gg_{display:none}" /*__inner_css_end__*/, "1wce9_gg_") /*__reshadow_css_end__*/, {
18
- "__SColorPickerPopper": "___SColorPickerPopper_1wce9_gg_",
19
- "__SItemContainer": "___SItemContainer_1wce9_gg_",
20
- "__SCloseIcon": "___SCloseIcon_1wce9_gg_",
21
- "_keyboardFocused": "__keyboardFocused_1wce9_gg_",
22
- "_selected": "__selected_1wce9_gg_",
23
- "__SColors": "___SColors_1wce9_gg_",
24
- "__SPaletteManager": "___SPaletteManager_1wce9_gg_",
25
- "__SInputContainer": "___SInputContainer_1wce9_gg_",
26
- "__SDefaultTrigger": "___SDefaultTrigger_1wce9_gg_",
27
- "__STriggerCircle": "___STriggerCircle_1wce9_gg_",
28
- "--data-value": "--data-value_1wce9",
29
- "__STriggerCircleLine": "___STriggerCircleLine_1wce9_gg_",
30
- "__SLine": "___SLine_1wce9_gg_",
31
- "__SLabel": "___SLabel_1wce9_gg_",
32
- "__SItemColor": "___SItemColor_1wce9_gg_",
33
- "__SConfirmColor": "___SConfirmColor_1wce9_gg_",
34
- "_hidden": "__hidden_1wce9_gg_",
35
- "__SClearConfirm": "___SClearConfirm_1wce9_gg_",
36
- "--value": "--value_1wce9",
37
- "_displayLabel": "__displayLabel_1wce9_gg_",
38
- "_value": "__value_1wce9_gg_",
39
- "__SPlusButton": "___SPlusButton_1wce9_gg_"
17
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SColorPickerPopper_15luc_gg_{max-width:calc(var(--intergalactic-spacing-4x, 16px)*2 + 28px*6 + 4px*6);padding:var(--intergalactic-spacing-4x, 16px)}.___SItemContainer_15luc_gg_{position:relative;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid transparent;outline:0;cursor:pointer}@media (hover:hover){.___SItemContainer_15luc_gg_:hover{border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}}.___SItemContainer_15luc_gg_::after{content:\"\";position:absolute;width:22px;height:22px;border-radius:50%;box-shadow:inset 0 0 1px var(--intergalactic-border-secondary, #e0e1e9);background:var(--value_15luc)}@media (hover:hover){.___SItemContainer_15luc_gg_:hover>.___SCloseIcon_15luc_gg_{opacity:1}}.___SItemContainer_15luc_gg_.__keyboardFocused_15luc_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SItemContainer_15luc_gg_.__selected_15luc_gg_{border:1px solid var(--intergalactic-border-info-active, #006dca)}.___SItemContainer_15luc_gg_.__displayLabel_15luc_gg_::after{background:var(--value_15luc);opacity:.15}.___SItemContainer_15luc_gg_:not(.__value_15luc_gg_)::after{border:.9px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SColors_15luc_gg_{display:flex;flex-wrap:wrap;align-items:center;gap:var(--intergalactic-spacing-1x, 4px)}.___SPaletteManager_15luc_gg_{justify-content:space-between;margin-top:var(--intergalactic-spacing-3x, 12px);margin-left:calc(var(--intergalactic-spacing-1x, 4px) - 1px)}.___SInputContainer_15luc_gg_,.___SPaletteManager_15luc_gg_,.___SPlusButton_15luc_gg_{display:flex;align-items:center}.___SPlusButton_15luc_gg_{justify-content:center;width:28px;height:28px;border-radius:50%;cursor:pointer}@media (hover:hover){.___SPlusButton_15luc_gg_:hover{background-color:var(--intergalactic-bg-secondary-neutral-hover, #e0e1e9)}}.___SDefaultTrigger_15luc_gg_{display:inline-flex;align-items:center;outline:0;cursor:pointer}.___SDefaultTrigger_15luc_gg_.__keyboardFocused_15luc_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___STriggerCircle_15luc_gg_{position:relative;width:12px;height:12px;margin-right:calc(var(--intergalactic-spacing-1x, 4px) + 1px);border-radius:50%;background-color:var(--data-value_15luc);border:1px solid transparent}.___STriggerCircle_15luc_gg_:not([data-value]){border:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___STriggerCircleLine_15luc_gg_{position:absolute;top:1px;left:1px}.___SCloseIcon_15luc_gg_{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:12px;height:12px;border-radius:50%;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);opacity:0;z-index:1}.___SLine_15luc_gg_{position:absolute}.___SLabel_15luc_gg_{z-index:1;color:var(--data-value_15luc);font-size:calc(var(--intergalactic-fs-100, 12px) + 1px);font-weight:var(--intergalactic-bold, 700)}.___SItemColor_15luc_gg_{width:20px;height:20px;border-radius:50%;border:1px solid var(--intergalactic-border-secondary, #e0e1e9);background:var(--data-value_15luc)}.___SClearConfirm_15luc_gg_.__hidden_15luc_gg_,.___SConfirmColor_15luc_gg_.__hidden_15luc_gg_{display:none}" /*__inner_css_end__*/, "15luc_gg_") /*__reshadow_css_end__*/, {
18
+ "__SColorPickerPopper": "___SColorPickerPopper_15luc_gg_",
19
+ "__SItemContainer": "___SItemContainer_15luc_gg_",
20
+ "__SCloseIcon": "___SCloseIcon_15luc_gg_",
21
+ "_keyboardFocused": "__keyboardFocused_15luc_gg_",
22
+ "_selected": "__selected_15luc_gg_",
23
+ "__SColors": "___SColors_15luc_gg_",
24
+ "__SPaletteManager": "___SPaletteManager_15luc_gg_",
25
+ "__SInputContainer": "___SInputContainer_15luc_gg_",
26
+ "__SDefaultTrigger": "___SDefaultTrigger_15luc_gg_",
27
+ "__STriggerCircle": "___STriggerCircle_15luc_gg_",
28
+ "--data-value": "--data-value_15luc",
29
+ "__STriggerCircleLine": "___STriggerCircleLine_15luc_gg_",
30
+ "__SLine": "___SLine_15luc_gg_",
31
+ "__SLabel": "___SLabel_15luc_gg_",
32
+ "__SItemColor": "___SItemColor_15luc_gg_",
33
+ "__SConfirmColor": "___SConfirmColor_15luc_gg_",
34
+ "_hidden": "__hidden_15luc_gg_",
35
+ "__SClearConfirm": "___SClearConfirm_15luc_gg_",
36
+ "--value": "--value_15luc",
37
+ "_displayLabel": "__displayLabel_15luc_gg_",
38
+ "_value": "__value_15luc_gg_",
39
+ "__SPlusButton": "___SPlusButton_15luc_gg_"
40
40
  });
41
41
  function isValidHex(hex) {
42
42
  if (hex[0] !== '#' && hex.length === 7) return false;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\nimport Dropdown, { DropdownProps, DropdownHandlers } from '@semcore/dropdown';\nimport { InputProps } from '@semcore/input';\n\n/** @deprecated */\nexport interface IItemProps extends ItemProps, UnknownProperties {}\nexport type ItemProps = BoxProps & {\n /**\n * Color item in hexadecimal format.\n */\n value?: string;\n /**\n * Shows label `A` as text color icon inside all color items\n */\n displayLabel?: boolean;\n /**\n * Property enabling the ability to remove a color item on click\n */\n editable?: boolean;\n /**\n * Shows if color item is selected\n */\n selected?: boolean;\n /**\n * Fired with color item when user clicks on the close icon\n */\n onRemove?: React.MouseEventHandler;\n};\n\n/** @deprecated */\nexport interface IColorsProps extends ColorsProps, UnknownProperties {}\nexport type ColorsProps = BoxProps & {\n /**\n * Array of color items\n */\n colors?: string[];\n};\n\n/** @deprecated */\nexport interface IColorsCustomProps extends ColorsCustomProps, UnknownProperties {}\nexport type ColorsCustomProps = ColorsProps &\n BoxProps & {\n /**\n * Fired when user clicks on the plus icon in Palette Manager - focuses the input component\n */\n onPlusButtonClick?: React.MouseEventHandler;\n };\n\n/** @deprecated */\nexport interface IInputColorProps extends InputColorProps, UnknownProperties {}\nexport type InputColorProps = InputProps & {\n /**\n * Text value of input\n */\n value?: string;\n /**\n * Default value if `value` property is not provided\n * @default null\n */\n defaultValue?: string | null;\n /**\n * Uncontrolled visual state of input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Array of color items\n */\n colors?: string[];\n /**\n * Fired with entered value when user clicks on the check icon or hits `Enter` or `Space`\n */\n onAdd?: (value: string, event: React.MouseEvent | React.KeyboardEvent) => void;\n};\n\n/** @deprecated */\nexport interface IColorPickerProps extends ColorPickerProps, UnknownProperties {}\nexport type ColorPickerProps = DropdownProps & {\n /**\n * Selected color item. Should be used with `onChange` property together\n */\n value?: string | null;\n /**\n * Fired when user selects color item. Should be used with `value` property together\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * Default value if `value` property is not provided\n * @default null\n */\n defaultValue?: string | null;\n /**\n * Array of color items. Should be used with `onColorsChange` property together\n * @default defaultColors\n */\n colors?: string[];\n /**\n * Fired when user changes color items. Should be used with `colors` property together\n */\n onColorsChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * Shows label `A` as text color icon inside all color items\n * @default false\n */\n displayLabel?: boolean;\n};\n\n/** @deprecated */\nexport interface IPaletteManagerProps extends PaletteManagerProps, UnknownProperties {}\nexport type PaletteManagerProps = BoxProps & {\n /**\n * Array of color items. Should be used with `onColorsChange` property together\n * @default []\n */\n colors?: string[];\n /**\n * Default value if `colors` property is not provided\n * @default []\n */\n defaultColors?: string[];\n /**\n * Fired when user adds or removes color items. Should be used with `colors` property together\n */\n onColorsChange?: (value: string, event: React.ChangeEvent) => void;\n};\n\n/** @deprecated */\nexport interface IColorPickerHandlers extends ColorPickerHandlers, UnknownProperties {}\nexport type ColorPickerHandlers = DropdownHandlers & {};\n\n/** @deprecated */\nexport interface IPaletteManagerHandlers extends PaletteManagerHandlers, UnknownProperties {}\nexport type PaletteManagerHandlers = DropdownHandlers & {};\n\ntype ColorPickerContext = {\n getTriggerProps: PropGetterFn;\n getColorsProps: PropGetterFn;\n getItemProps: PropGetterFn;\n};\n\ntype PaletteManagerContext = {\n getInputColorProps: PropGetterFn;\n getColorsProps: PropGetterFn;\n getItemProps: PropGetterFn;\n};\n\ndeclare const defaultColors: string[];\n\ndeclare const PaletteManager: Intergalactic.Component<\n 'div',\n PaletteManagerProps,\n PaletteManagerContext,\n [handlers: PaletteManagerHandlers]\n> & {\n Item: Intergalactic.Component<'div', ItemProps>;\n Colors: Intergalactic.Component<'div', ColorsCustomProps>;\n InputColor: Intergalactic.Component<'div', InputColorProps>;\n};\n\ndeclare const ColorPicker: Intergalactic.Component<\n 'div',\n ColorPickerProps,\n ColorPickerContext,\n [handlers: ColorPickerHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: typeof Dropdown.Popper;\n Item: Intergalactic.Component<'div', ItemProps>;\n Colors: Intergalactic.Component<'div', ColorsProps>;\n};\n\nexport { PaletteManager, defaultColors };\nexport default ColorPicker;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\nimport Dropdown, { DropdownProps, DropdownHandlers } from '@semcore/dropdown';\nimport { InputProps } from '@semcore/input';\n\n/** @deprecated */\nexport interface IItemProps extends ItemProps, UnknownProperties {}\nexport type ItemProps = BoxProps & {\n /**\n * Color item in hexadecimal format.\n */\n value?: string;\n /**\n * Shows label `A` as text color icon inside all color items\n */\n displayLabel?: boolean;\n /**\n * Property enabling the ability to remove a color item on click\n */\n editable?: boolean;\n /**\n * Shows if color item is selected\n */\n selected?: boolean;\n /**\n * Fired with color item when user clicks on the close icon\n */\n onRemove?: React.MouseEventHandler;\n};\n\n/** @deprecated */\nexport interface IColorsProps extends ColorsProps, UnknownProperties {}\nexport type ColorsProps = BoxProps & {\n /**\n * Array of color items\n */\n colors?: string[];\n};\n\n/** @deprecated */\nexport interface IColorsCustomProps extends ColorsCustomProps, UnknownProperties {}\nexport type ColorsCustomProps = ColorsProps &\n BoxProps & {\n /**\n * Fired when user clicks on the plus icon in Palette Manager - focuses the input component\n */\n onPlusButtonClick?: React.MouseEventHandler;\n };\n\n/** @deprecated */\nexport interface IInputColorProps extends InputColorProps, UnknownProperties {}\nexport type InputColorProps = InputProps & {\n /**\n * Text value of input\n */\n value?: string;\n /**\n * Default value if `value` property is not provided\n * @default null\n */\n defaultValue?: string | null;\n /**\n * Uncontrolled visual state of input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Array of color items\n */\n colors?: string[];\n /**\n * Fired with entered value when user clicks on the check icon or hits `Enter` or `Space`\n */\n onAdd?: (value: string, event: React.MouseEvent | React.KeyboardEvent) => void;\n};\n\n/** @deprecated */\nexport interface IColorPickerProps extends ColorPickerProps, UnknownProperties {}\nexport type ColorPickerProps = DropdownProps & {\n /**\n * Selected color item. Should be used with `onChange` property together\n */\n value?: string | null;\n /**\n * Fired when user selects color item. Should be used with `value` property together\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * Default value if `value` property is not provided\n * @default null\n */\n defaultValue?: string | null;\n /**\n * Array of color items. Should be used with `onColorsChange` property together\n * @default defaultColors\n */\n colors?: string[];\n /**\n * Fired when user changes color items. Should be used with `colors` property together\n */\n onColorsChange?: (value: string[], event: React.ChangeEvent) => void;\n /**\n * Shows label `A` as text color icon inside all color items\n * @default false\n */\n displayLabel?: boolean;\n};\n\n/** @deprecated */\nexport interface IPaletteManagerProps extends PaletteManagerProps, UnknownProperties {}\nexport type PaletteManagerProps = BoxProps & {\n /**\n * Array of color items. Should be used with `onColorsChange` property together\n * @default []\n */\n colors?: string[];\n /**\n * Default value if `colors` property is not provided\n * @default []\n */\n defaultColors?: string[];\n /**\n * Fired when user adds or removes color items. Should be used with `colors` property together\n */\n onColorsChange?: (value: string[], event: React.ChangeEvent) => void;\n};\n\n/** @deprecated */\nexport interface IColorPickerHandlers extends ColorPickerHandlers, UnknownProperties {}\nexport type ColorPickerHandlers = DropdownHandlers & {};\n\n/** @deprecated */\nexport interface IPaletteManagerHandlers extends PaletteManagerHandlers, UnknownProperties {}\nexport type PaletteManagerHandlers = DropdownHandlers & {};\n\ntype ColorPickerContext = {\n getTriggerProps: PropGetterFn;\n getColorsProps: PropGetterFn;\n getItemProps: PropGetterFn;\n};\n\ntype PaletteManagerContext = {\n getInputColorProps: PropGetterFn;\n getColorsProps: PropGetterFn;\n getItemProps: PropGetterFn;\n};\n\ndeclare const defaultColors: string[];\n\ndeclare const PaletteManager: Intergalactic.Component<\n 'div',\n PaletteManagerProps,\n PaletteManagerContext,\n [handlers: PaletteManagerHandlers]\n> & {\n Item: Intergalactic.Component<'div', ItemProps>;\n Colors: Intergalactic.Component<'div', ColorsCustomProps>;\n InputColor: Intergalactic.Component<'div', InputColorProps>;\n};\n\ndeclare const ColorPicker: Intergalactic.Component<\n 'div',\n ColorPickerProps,\n ColorPickerContext,\n [handlers: ColorPickerHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: typeof Dropdown.Popper;\n Item: Intergalactic.Component<'div', ItemProps>;\n Colors: Intergalactic.Component<'div', ColorsProps>;\n};\n\nexport { PaletteManager, defaultColors };\nexport default ColorPicker;\n"],"mappings":""}
@@ -0,0 +1,174 @@
1
+ import { PropGetterFn, UnknownProperties, Intergalactic } from 'intergalactic/core';
2
+ import { BoxProps } from 'intergalactic/flex-box';
3
+ import Dropdown, { DropdownProps, DropdownHandlers } from 'intergalactic/dropdown';
4
+ import { InputProps } from 'intergalactic/input';
5
+
6
+ /** @deprecated */
7
+ export interface IItemProps extends ItemProps, UnknownProperties {}
8
+ export type ItemProps = BoxProps & {
9
+ /**
10
+ * Color item in hexadecimal format.
11
+ */
12
+ value?: string;
13
+ /**
14
+ * Shows label `A` as text color icon inside all color items
15
+ */
16
+ displayLabel?: boolean;
17
+ /**
18
+ * Property enabling the ability to remove a color item on click
19
+ */
20
+ editable?: boolean;
21
+ /**
22
+ * Shows if color item is selected
23
+ */
24
+ selected?: boolean;
25
+ /**
26
+ * Fired with color item when user clicks on the close icon
27
+ */
28
+ onRemove?: React.MouseEventHandler;
29
+ };
30
+
31
+ /** @deprecated */
32
+ export interface IColorsProps extends ColorsProps, UnknownProperties {}
33
+ export type ColorsProps = BoxProps & {
34
+ /**
35
+ * Array of color items
36
+ */
37
+ colors?: string[];
38
+ };
39
+
40
+ /** @deprecated */
41
+ export interface IColorsCustomProps extends ColorsCustomProps, UnknownProperties {}
42
+ export type ColorsCustomProps = ColorsProps &
43
+ BoxProps & {
44
+ /**
45
+ * Fired when user clicks on the plus icon in Palette Manager - focuses the input component
46
+ */
47
+ onPlusButtonClick?: React.MouseEventHandler;
48
+ };
49
+
50
+ /** @deprecated */
51
+ export interface IInputColorProps extends InputColorProps, UnknownProperties {}
52
+ export type InputColorProps = InputProps & {
53
+ /**
54
+ * Text value of input
55
+ */
56
+ value?: string;
57
+ /**
58
+ * Default value if `value` property is not provided
59
+ * @default null
60
+ */
61
+ defaultValue?: string | null;
62
+ /**
63
+ * Uncontrolled visual state of input
64
+ * @default normal
65
+ */
66
+ state?: 'normal' | 'valid' | 'invalid';
67
+ /**
68
+ * Array of color items
69
+ */
70
+ colors?: string[];
71
+ /**
72
+ * Fired with entered value when user clicks on the check icon or hits `Enter` or `Space`
73
+ */
74
+ onAdd?: (value: string, event: React.MouseEvent | React.KeyboardEvent) => void;
75
+ };
76
+
77
+ /** @deprecated */
78
+ export interface IColorPickerProps extends ColorPickerProps, UnknownProperties {}
79
+ export type ColorPickerProps = DropdownProps & {
80
+ /**
81
+ * Selected color item. Should be used with `onChange` property together
82
+ */
83
+ value?: string | null;
84
+ /**
85
+ * Fired when user selects color item. Should be used with `value` property together
86
+ */
87
+ onChange?: (value: string, event: React.ChangeEvent) => void;
88
+ /**
89
+ * Default value if `value` property is not provided
90
+ * @default null
91
+ */
92
+ defaultValue?: string | null;
93
+ /**
94
+ * Array of color items. Should be used with `onColorsChange` property together
95
+ * @default defaultColors
96
+ */
97
+ colors?: string[];
98
+ /**
99
+ * Fired when user changes color items. Should be used with `colors` property together
100
+ */
101
+ onColorsChange?: (value: string[], event: React.ChangeEvent) => void;
102
+ /**
103
+ * Shows label `A` as text color icon inside all color items
104
+ * @default false
105
+ */
106
+ displayLabel?: boolean;
107
+ };
108
+
109
+ /** @deprecated */
110
+ export interface IPaletteManagerProps extends PaletteManagerProps, UnknownProperties {}
111
+ export type PaletteManagerProps = BoxProps & {
112
+ /**
113
+ * Array of color items. Should be used with `onColorsChange` property together
114
+ * @default []
115
+ */
116
+ colors?: string[];
117
+ /**
118
+ * Default value if `colors` property is not provided
119
+ * @default []
120
+ */
121
+ defaultColors?: string[];
122
+ /**
123
+ * Fired when user adds or removes color items. Should be used with `colors` property together
124
+ */
125
+ onColorsChange?: (value: string[], event: React.ChangeEvent) => void;
126
+ };
127
+
128
+ /** @deprecated */
129
+ export interface IColorPickerHandlers extends ColorPickerHandlers, UnknownProperties {}
130
+ export type ColorPickerHandlers = DropdownHandlers & {};
131
+
132
+ /** @deprecated */
133
+ export interface IPaletteManagerHandlers extends PaletteManagerHandlers, UnknownProperties {}
134
+ export type PaletteManagerHandlers = DropdownHandlers & {};
135
+
136
+ type ColorPickerContext = {
137
+ getTriggerProps: PropGetterFn;
138
+ getColorsProps: PropGetterFn;
139
+ getItemProps: PropGetterFn;
140
+ };
141
+
142
+ type PaletteManagerContext = {
143
+ getInputColorProps: PropGetterFn;
144
+ getColorsProps: PropGetterFn;
145
+ getItemProps: PropGetterFn;
146
+ };
147
+
148
+ declare const defaultColors: string[];
149
+
150
+ declare const PaletteManager: Intergalactic.Component<
151
+ 'div',
152
+ PaletteManagerProps,
153
+ PaletteManagerContext,
154
+ [handlers: PaletteManagerHandlers]
155
+ > & {
156
+ Item: Intergalactic.Component<'div', ItemProps>;
157
+ Colors: Intergalactic.Component<'div', ColorsCustomProps>;
158
+ InputColor: Intergalactic.Component<'div', InputColorProps>;
159
+ };
160
+
161
+ declare const ColorPicker: Intergalactic.Component<
162
+ 'div',
163
+ ColorPickerProps,
164
+ ColorPickerContext,
165
+ [handlers: ColorPickerHandlers]
166
+ > & {
167
+ Trigger: typeof Dropdown.Trigger;
168
+ Popper: typeof Dropdown.Popper;
169
+ Item: Intergalactic.Component<'div', ItemProps>;
170
+ Colors: Intergalactic.Component<'div', ColorsProps>;
171
+ };
172
+
173
+ export { PaletteManager, defaultColors };
174
+ export default ColorPicker;
@@ -9,8 +9,8 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireDefault(require("react"));
12
- var _assignProps = _interopRequireDefault(require("intergalactic/utils/lib/assignProps"));
13
- var _ref4 = require("intergalactic/utils/lib/ref");
12
+ var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
13
+ var _ref4 = require("../utils/ref");
14
14
  var _excluded = ["render"],
15
15
  _excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
16
16
  function createRootRender() {
@@ -1 +1 @@
1
- {"version":3,"file":"Root.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref4","_excluded","_excluded2","createRootRender","Root","React","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties2","_Root$props","props","_Root","styles","children","Children","_Root$props$forwardRe","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray2","name","value","undefined","child","origin","createElement","other","assignProps","_objectSpread2","useForkRef","Error","Fragment","Enhancement","init","asProps","WrapperComponent","isFunction","_default","exports"],"sources":["../../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport { useForkRef } from '@semcore/utils/lib/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles,\n\n children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAAoD,IAAAG,SAAA;EAAAC,UAAA;AAEpD,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGC,iBAAK,CAACC,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM;MAAUC,MAAM,OAAAC,yBAAA,aAAAL,IAAA,EAAAN,SAAA;IAC9D,IAAAY,WAAA,GAUIT,IAAI,CAACU,KAAK;MATNC,KAAK,GAAAF,WAAA,CAAXT,IAAI;MAEJY,MAAM,GAAAH,WAAA,CAANG,MAAM;MAENC,QAAQ,GAAAJ,WAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,WAAA,CAARK,QAAQ;MAAAC,qBAAA,GAAAN,WAAA,CACRP,UAAU;MAAVA,UAAU,GAAAa,qBAAA,cAAG,IAAI,GAAAA,qBAAA;MACdL,KAAK,OAAAF,yBAAA,aAAAC,WAAA,EAAAX,UAAA;IAIV,IAAMkB,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACR,KAAK,CAAC,CAACS,MAAM,CAAC,UAACT,KAAU,EAAAU,KA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B,KAAU,EAAE4B,gBAAqB,EAAEC,UAAmB,EAAE;MACpF,IAAIA,UAAU,EAAE;QACd,WAAAR,cAAA,iBAAAA,cAAA,iBACKrB,KAAK;UACRV,IAAI,EAAE,IAAI,CAACA;QAAI;MAEnB;MACA,OAAOU,KAAK;IACd,CAAC;IACDJ,MAAM,EAAE,SAAAA,OAAqBA,OAAW,EAAEI,KAAU,EAAE;MACpD,IAAI,CAACV,IAAI,CAACU,KAAK,GAAGA,KAAK;MACvB,OAAOJ,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAkC,QAAA,GAEcL,WAAW;AAAAM,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"Root.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref4","_excluded","_excluded2","createRootRender","Root","React","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties2","_Root$props","props","_Root","styles","children","Children","_Root$props$forwardRe","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray2","name","value","undefined","child","origin","createElement","other","assignProps","_objectSpread2","useForkRef","Error","Fragment","Enhancement","init","asProps","WrapperComponent","isFunction","_default","exports"],"sources":["../../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport { useForkRef } from '../utils/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles,\n\n children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA0C,IAAAG,SAAA;EAAAC,UAAA;AAE1C,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGC,iBAAK,CAACC,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM;MAAUC,MAAM,OAAAC,yBAAA,aAAAL,IAAA,EAAAN,SAAA;IAC9D,IAAAY,WAAA,GAUIT,IAAI,CAACU,KAAK;MATNC,KAAK,GAAAF,WAAA,CAAXT,IAAI;MAEJY,MAAM,GAAAH,WAAA,CAANG,MAAM;MAENC,QAAQ,GAAAJ,WAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,WAAA,CAARK,QAAQ;MAAAC,qBAAA,GAAAN,WAAA,CACRP,UAAU;MAAVA,UAAU,GAAAa,qBAAA,cAAG,IAAI,GAAAA,qBAAA;MACdL,KAAK,OAAAF,yBAAA,aAAAC,WAAA,EAAAX,UAAA;IAIV,IAAMkB,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACR,KAAK,CAAC,CAACS,MAAM,CAAC,UAACT,KAAU,EAAAU,KAAA,EAAoB;MAAA,IAAAC,KAAA,OAAAC,eAAA,a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;MACpF,IAAIA,UAAU,EAAE;QACd,WAAAR,cAAA,iBAAAA,cAAA,iBACKrB,KAAK;UACRV,IAAI,EAAE,IAAI,CAACA;QAAI;MAEnB;MACA,OAAOU,KAAK;IACd,CAAC;IACDJ,MAAM,EAAE,SAAAA,OAAqBA,OAAW,EAAEI,KAAU,EAAE;MACpD,IAAI,CAACV,IAAI,CAACU,KAAK,GAAGA,KAAK;MACvB,OAAOJ,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAkC,QAAA,GAEcL,WAAW;AAAAM,OAAA,cAAAD,QAAA"}
@@ -10,15 +10,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
12
  var _react = _interopRequireDefault(require("react"));
13
- var _assignProps = _interopRequireDefault(require("intergalactic/utils/lib/assignProps"));
14
- var _useEnhancedEffect = _interopRequireDefault(require("intergalactic/utils/lib/use/useEnhancedEffect"));
15
- var _pick = _interopRequireDefault(require("intergalactic/utils/lib/pick"));
16
- // @ts-ignore
17
-
18
- // @ts-ignore
19
-
20
- // @ts-ignore
21
-
13
+ var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
14
+ var _useEnhancedEffect = _interopRequireDefault(require("../utils/use/useEnhancedEffect"));
15
+ var _pick = _interopRequireDefault(require("../utils/pick"));
22
16
  var HOIST_CONTEXT = Symbol('HOIST_CONTEXT');
23
17
  exports.HOIST_CONTEXT = HOIST_CONTEXT;
24
18
  var HOIST_SELF = Symbol('HOIST_SELF');
@@ -1 +1 @@
1
- {"version":3,"file":"hoistProps.js","names":["_react","_interopRequireDefault","require","_assignProps","_useEnhancedEffect","_pick","HOIST_CONTEXT","Symbol","exports","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","concat","_toConsumableArray2","push","Enhancement","Context","condition","some","_Component$hoistProps","Boolean","hoistProps","length","init","props","WrapperComponent","isFunction","_this","React","useState","obj","forceUpdate","context","_objectSpread3","_defineProperty2","asProps","assignProps","wrapperProps","_WrapperComponent$hoi","useContext","renameProps","propName","_propName$split","split","_propName$split2","_slicedToArray2","name","rename","entries","pick","keys","_ref","_ref2","value","useEnhancedEffect","_default"],"sources":["../../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport useEnhancedEffect from '@semcore/utils/lib/use/useEnhancedEffect';\n// @ts-ignore\nimport pick from '@semcore/utils/lib/pick';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents: any) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc = [...acc, Component[0], ...flatChildComponent(Component[1])];\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\n/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps?.length),\n );\n },\n init: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = React.useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj: any) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj: any) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (this: any, context: any) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n if (WrapperComponent.hoistProps?.length) {\n const context: any = React.useContext(Context);\n const renameProps: any = WrapperComponent.hoistProps.reduce((acc: any, propName: any) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc: any, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AALA;;AAEA;;AAEA;;AAGO,IAAMI,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAAF,aAAA,GAAAA,aAAA;AACrD,IAAMG,UAAU,GAAGF,MAAM,CAAC,YAAY,CAAC;AACvC,IAAMG,SAAS,GAAGH,MAAM,CAAC,WAAW,CAAC;AAErC,SAASI,kBAAkBA,CAACC,eAAoB,EAAE;EAChD,OAAOC,MAAM,CAACC,MAAM,CAACF,eAAe,CAAC,CAACG,MAAM,CAAY,UAACC,GAAG,EAAEC,SAAS,EAAK;IAC1E,IAAIC,KAAK,CAACC,OAAO,CAACF,SAAS,CAAC,EAAE;MAC5BD,GAAG,MAAAI,MAAA,KAAAC,mBAAA,aAAOL,GAAG,IAAEC,SAAS,CAAC,CAAC,CAAC,OAAAI,mBAAA,aAAKV,kBAAkB,CAACM,SAA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AAG;QACZ,CAAC,EACD,CAAC,CAAC,CACH;QAED,IAAA8C,6BAAiB,EAAC,YAAM;UACtB,IAAItB,OAAO,CAAClC,aAAa,CAAC,EAAE;YAC1BkC,OAAO,CAAClC,aAAa,CAAC,CAACuB,UAAU,CAAC;UACpC;QACF,CAAC,EAAEhB,MAAM,CAACC,MAAM,CAACe,UAAU,CAAC,CAAC;MAC/B;MACA,OAAOG,KAAK;IACd;EACF,CAAC;AACH;AAAC,IAAA+B,QAAA,GAEcxC,WAAW;AAAAf,OAAA,cAAAuD,QAAA"}
1
+ {"version":3,"file":"hoistProps.js","names":["_react","_interopRequireDefault","require","_assignProps","_useEnhancedEffect","_pick","HOIST_CONTEXT","Symbol","exports","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","concat","_toConsumableArray2","push","Enhancement","Context","condition","some","_Component$hoistProps","Boolean","hoistProps","length","init","props","WrapperComponent","isFunction","_this","React","useState","obj","forceUpdate","context","_objectSpread3","_defineProperty2","asProps","assignProps","wrapperProps","_WrapperComponent$hoi","useContext","renameProps","propName","_propName$split","split","_propName$split2","_slicedToArray2","name","rename","entries","pick","keys","_ref","_ref2","value","useEnhancedEffect","_default"],"sources":["../../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport useEnhancedEffect from '../utils/use/useEnhancedEffect';\nimport pick from '../utils/pick';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents: any) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc = [...acc, Component[0], ...flatChildComponent(Component[1])];\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\n/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps?.length),\n );\n },\n init: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = React.useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj: any) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj: any) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (this: any, context: any) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n if (WrapperComponent.hoistProps?.length) {\n const context: any = React.useContext(Context);\n const renameProps: any = WrapperComponent.hoistProps.reduce((acc: any, propName: any) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc: any, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEO,IAAMI,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAA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AAID,IAAI;UAC1B,OAAOtC,GAAG;QACZ,CAAC,EAAE,CAAC,CAAC,CAAC;QACN,IAAMa,UAAU,GAAGhB,MAAM,CAAC2C,OAAO,CAAC,IAAAC,gBAAI,EAACzB,KAAK,EAAEnB,MAAM,CAAC6C,IAAI,CAACV,WAAW,CAAC,CAAC,CAAC,CAACjC,MAAM,CAC7E,UAACC,GAAQ,EAAA2C,IAAA,EAAoB;UAAA,IAAAC,KAAA,OAAAP,eAAA,aAAAM,IAAA;YAAjBL,IAAI,GAAAM,KAAA;YAAEC,KAAK,GAAAD,KAAA;UACrB5C,GAAG,CAACgC,WAAW,CAACM,IAAI,CAAC,CAAC,GAAGO,KAAK;UAC9B,OAAO7C,GAAG;QACZ,CAAC,EACD,CAAC,CAAC,CACH;QAED,IAAA8C,6BAAiB,EAAC,YAAM;UACtB,IAAItB,OAAO,CAAClC,aAAa,CAAC,EAAE;YAC1BkC,OAAO,CAAClC,aAAa,CAAC,CAACuB,UAAU,CAAC;UACpC;QACF,CAAC,EAAEhB,MAAM,CAACC,MAAM,CAACe,UAAU,CAAC,CAAC;MAC/B;MACA,OAAOG,KAAK;IACd;EACF,CAAC;AACH;AAAC,IAAA+B,QAAA,GAEcxC,WAAW;AAAAf,OAAA,cAAAuD,QAAA"}
@@ -8,7 +8,7 @@ exports["default"] = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
- var _WithI18n = require("intergalactic/utils/lib/enhances/WithI18n");
11
+ var _WithI18n = require("../utils/enhances/WithI18n");
12
12
  var _excluded = ["locale"];
13
13
  function i18nAppLocaleEnhance() {
14
14
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","_excluded","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties2","contextLocale","React","useContext","Context","_objectSpread2","_default","exports"],"sources":["../../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport { Context } from '@semcore/utils/lib/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAA+D,IAAAE,SAAA;AAE/D,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAAA,aAACC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,OAAAC,yBAAA,aAAKH,KAAK,EAAAH,SAAA;MAClC,IAAMO,aAAa,GAAGC,iBAAK,CAACC,UAAU,CAACC,iBAAO,CAAC;MAC/C,IAAI,CAACN,MAAM,IAAI,CAACG,aAAa,EAAE,OAAOJ,KAAK;MAC3C,WAAAQ,cAAA,iBAAAA,cAAA,iBACKN,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIG;MAAa;IAEnC;EACF,CAAC;AACH;AAAC,IAAAK,QAAA,GAEcX,oBAAoB;AAAAY,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","_excluded","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties2","contextLocale","React","useContext","Context","_objectSpread2","_default","exports"],"sources":["../../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAAqD,IAAAE,SAAA;AAErD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAAA,aAACC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,OAAAC,yBAAA,aAAKH,KAAK,EAAAH,SAAA;MAClC,IAAMO,aAAa,GAAGC,iBAAK,CAACC,UAAU,CAACC,iBAAO,CAAC;MAC/C,IAAI,CAACN,MAAM,IAAI,CAACG,aAAa,EAAE,OAAOJ,KAAK;MAC3C,WAAAQ,cAAA,iBAAAA,cAAA,iBACKN,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIG;MAAa;IAEnC;EACF,CAAC;AACH;AAAC,IAAAK,QAAA,GAEcX,oBAAoB;AAAAY,OAAA,cAAAD,QAAA"}
@@ -11,15 +11,9 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
11
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _react = _interopRequireDefault(require("react"));
14
- var _assignProps = _interopRequireDefault(require("intergalactic/utils/lib/assignProps"));
15
- var _pick = _interopRequireDefault(require("intergalactic/utils/lib/pick"));
16
- var _logger = _interopRequireDefault(require("intergalactic/utils/lib/logger"));
17
- // @ts-ignore
18
-
19
- // @ts-ignore
20
-
21
- // @ts-ignore
22
-
14
+ var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
15
+ var _pick = _interopRequireDefault(require("../utils/pick"));
16
+ var _logger = _interopRequireDefault(require("../utils/logger"));
23
17
  function assign(target, source) {
24
18
  return Object.defineProperties(target, Object.keys(source).reduce(function (descriptors, key) {
25
19
  descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
@@ -1 +1 @@
1
- {"version":3,"file":"staticChildren.js","names":["_react","_interopRequireDefault","require","_assignProps","_pick","_logger","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","getterMethodName","name","concat","getterMethodNameByDisplayName","displayName","arguments","length","undefined","displayNames","split","slice","join","flatGetterMethodNames","childComponents","parentName","entries","acc","_ref","_ref2","_slicedToArray2","value","Array","isArray","_toConsumableArray2","push","STATIC_COMPONENT","Symbol","exports","ROOT_COMPONENT","SELF_GETTER_METHOD","Enhancement","createComponent","options","getterMethodNames","condition","Component","Boolean","init","props","WrapperComponent","_this","getterMethods","pick","selfGetterMethod","logger","warn","getterMethod","childrenProps","getterProps","call","index","assignProps","cache","Set","_static","Error","_ref3","_ref4","prevStaticComponent","prevDisplayName","context","_objectSpread2","wrapperProps","React","useContext","has","add","render","_this2","forEach","clear","_default"],"sources":["../../../src/enhancement/staticChildren.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport pick from '@semcore/utils/lib/pick';\n// @ts-ignore\nimport logger from '@semcore/utils/lib/logger';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nexport function getterMethodName(name: string) {\n return `get${name}Props`;\n}\n\nexport function getterMethodNameByDisplayName(displayName = '') {\n const displayNames = displayName.split('.');\n const name = displayNames.slice(-(displayNames.length - 1)).join('');\n return getterMethodName(name);\n}\n\nfunction flatGetterMethodNames(childComponents: any, parentName?: string) {\n return Object.entries(childComponents).reduce<string[]>((acc, [name, value]) => {\n if (Array.isArray(value)) {\n acc = [...acc, ...flatGetterMethodNames(value[1], name)];\n }\n name = parentName ? `${parentName}${name}` : name;\n acc.push(getterMethodName(name));\n return acc;\n }, []);\n}\n\nexport const STATIC_COMPONENT = Symbol('STATIC_COMPONENT');\nexport const ROOT_COMPONENT = Symbol('ROOT_COMPONENT');\nconst SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');\n\nfunction Enhancement(childComponents: any, createComponent: any, options: any) {\n const getterMethodNames = flatGetterMethodNames(childComponents);\n return {\n condition: function (Component: any) {\n return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n const getterMethods: any = pick(this, getterMethodNames);\n this[SELF_GETTER_METHOD] = () => {\n const selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n logger.warn(\n true,\n `Getter \\`${selfGetterMethod}\\` can't be fired as it is a getter of static component`,\n props['data-ui-name'] || WrapperComponent.displayName,\n );\n };\n assign(\n this,\n getterMethodNames.reduce((acc: any, name) => {\n const getterMethod = getterMethods[name];\n if (!getterMethod) return acc;\n acc[name] = (childrenProps = {}) => {\n const getterProps = getterMethod.call(this, childrenProps, acc[name].index);\n return assignProps(childrenProps, getterProps);\n };\n acc[name].index = -1;\n acc[name].cache = new Set();\n return acc;\n }, {}),\n );\n },\n static: function (WrapperComponent: any, Component: any) {\n if (Object.keys(childComponents).length && !WrapperComponent.displayName) {\n throw new Error('\"displayName\" is not defined');\n }\n return Object.entries(childComponents).reduce((acc: any, [name, value]: any) => {\n let childComponents = {};\n\n if (Array.isArray(value)) {\n childComponents = value[1];\n value = value[0];\n }\n\n const prevStaticComponent = value[STATIC_COMPONENT];\n // @ts-ignore\n const prevDisplayName = value.displayName;\n // @ts-ignore\n value.displayName = `${WrapperComponent.displayName}.${name}`;\n value[STATIC_COMPONENT] = true;\n value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;\n acc[name] = createComponent(value, childComponents, options);\n // @ts-ignore\n value.displayName = prevDisplayName;\n value[STATIC_COMPONENT] = prevStaticComponent;\n return acc;\n }, {});\n },\n context: function (context: any /*, WrapperComponent*/) {\n // const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n return {\n ...context,\n // [getterMethod]: this[SELF_GETTER_METHOD],\n ...pick(this, getterMethodNames as any),\n };\n },\n wrapperProps: function (this: any, props: any, WrapperComponent: any) {\n if (!WrapperComponent[STATIC_COMPONENT]) return props;\n const context: any = React.useContext(options.context);\n const getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];\n if (getterMethod) {\n if (!getterMethod.cache.has(this)) {\n getterMethod.cache.add(this);\n getterMethod.index++;\n if (this) this.index = getterMethod.index;\n }\n if (this) getterMethod.index = this.index;\n return getterMethod(props);\n }\n return props;\n },\n render: function (this: any, render: any) {\n getterMethodNames.forEach((name) => {\n if (this[name] === undefined) return;\n this[name].index = -1;\n this[name].cache.clear();\n });\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AALA;;AAEA;;AAEA;;AAGA,SAASI,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAAM,EACNE,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,UAACC,WAAgB,EAAEC,GAAG,EAAK;IACpDD,WAAW,CAACC,GAAG,CAAC,GAAGL,MAAM,CAACM,wBAAwB,CAACP,MAAM,EAAEM,GAAG,CAAC;IAC/D,OAAOD,WAAW;EACpB,CAAC,EAAE,CAAC,CAAC,CAAC,CACP;AACH;AA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MAC5B;MACA,OAAOA,KAAK;IACd,CAAC;IACD6B,MAAM,EAAE,SAAAA,OAAqBA,OAAW,EAAE;MAAA,IAAAC,MAAA;MACxCnC,iBAAiB,CAACoC,OAAO,CAAC,UAACpE,IAAI,EAAK;QAClC,IAAImE,MAAI,CAACnE,IAAI,CAAC,KAAKM,SAAS,EAAE;QAC9B6D,MAAI,CAACnE,IAAI,CAAC,CAACiD,KAAK,GAAG,CAAC,CAAC;QACrBkB,MAAI,CAACnE,IAAI,CAAC,CAACmD,KAAK,CAACkB,KAAK,EAAE;MAC1B,CAAC,CAAC;MACF,OAAOH,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEczC,WAAW;AAAAH,OAAA,cAAA4C,QAAA"}
1
+ {"version":3,"file":"staticChildren.js","names":["_react","_interopRequireDefault","require","_assignProps","_pick","_logger","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","getterMethodName","name","concat","getterMethodNameByDisplayName","displayName","arguments","length","undefined","displayNames","split","slice","join","flatGetterMethodNames","childComponents","parentName","entries","acc","_ref","_ref2","_slicedToArray2","value","Array","isArray","_toConsumableArray2","push","STATIC_COMPONENT","Symbol","exports","ROOT_COMPONENT","SELF_GETTER_METHOD","Enhancement","createComponent","options","getterMethodNames","condition","Component","Boolean","init","props","WrapperComponent","_this","getterMethods","pick","selfGetterMethod","logger","warn","getterMethod","childrenProps","getterProps","call","index","assignProps","cache","Set","_static","Error","_ref3","_ref4","prevStaticComponent","prevDisplayName","context","_objectSpread2","wrapperProps","React","useContext","has","add","render","_this2","forEach","clear","_default"],"sources":["../../../src/enhancement/staticChildren.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport pick from '../utils/pick';\nimport logger from '../utils/logger';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nexport function getterMethodName(name: string) {\n return `get${name}Props`;\n}\n\nexport function getterMethodNameByDisplayName(displayName = '') {\n const displayNames = displayName.split('.');\n const name = displayNames.slice(-(displayNames.length - 1)).join('');\n return getterMethodName(name);\n}\n\nfunction flatGetterMethodNames(childComponents: any, parentName?: string) {\n return Object.entries(childComponents).reduce<string[]>((acc, [name, value]) => {\n if (Array.isArray(value)) {\n acc = [...acc, ...flatGetterMethodNames(value[1], name)];\n }\n name = parentName ? `${parentName}${name}` : name;\n acc.push(getterMethodName(name));\n return acc;\n }, []);\n}\n\nexport const STATIC_COMPONENT = Symbol('STATIC_COMPONENT');\nexport const ROOT_COMPONENT = Symbol('ROOT_COMPONENT');\nconst SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');\n\nfunction Enhancement(childComponents: any, createComponent: any, options: any) {\n const getterMethodNames = flatGetterMethodNames(childComponents);\n return {\n condition: function (Component: any) {\n return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n const getterMethods: any = pick(this, getterMethodNames);\n this[SELF_GETTER_METHOD] = () => {\n const selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n logger.warn(\n true,\n `Getter \\`${selfGetterMethod}\\` can't be fired as it is a getter of static component`,\n props['data-ui-name'] || WrapperComponent.displayName,\n );\n };\n assign(\n this,\n getterMethodNames.reduce((acc: any, name) => {\n const getterMethod = getterMethods[name];\n if (!getterMethod) return acc;\n acc[name] = (childrenProps = {}) => {\n const getterProps = getterMethod.call(this, childrenProps, acc[name].index);\n return assignProps(childrenProps, getterProps);\n };\n acc[name].index = -1;\n acc[name].cache = new Set();\n return acc;\n }, {}),\n );\n },\n static: function (WrapperComponent: any, Component: any) {\n if (Object.keys(childComponents).length && !WrapperComponent.displayName) {\n throw new Error('\"displayName\" is not defined');\n }\n return Object.entries(childComponents).reduce((acc: any, [name, value]: any) => {\n let childComponents = {};\n\n if (Array.isArray(value)) {\n childComponents = value[1];\n value = value[0];\n }\n\n const prevStaticComponent = value[STATIC_COMPONENT];\n // @ts-ignore\n const prevDisplayName = value.displayName;\n // @ts-ignore\n value.displayName = `${WrapperComponent.displayName}.${name}`;\n value[STATIC_COMPONENT] = true;\n value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;\n acc[name] = createComponent(value, childComponents, options);\n // @ts-ignore\n value.displayName = prevDisplayName;\n value[STATIC_COMPONENT] = prevStaticComponent;\n return acc;\n }, {});\n },\n context: function (context: any /*, WrapperComponent*/) {\n // const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n return {\n ...context,\n // [getterMethod]: this[SELF_GETTER_METHOD],\n ...pick(this, getterMethodNames as any),\n };\n },\n wrapperProps: function (this: any, props: any, WrapperComponent: any) {\n if (!WrapperComponent[STATIC_COMPONENT]) return props;\n const context: any = React.useContext(options.context);\n const getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];\n if (getterMethod) {\n if (!getterMethod.cache.has(this)) {\n getterMethod.cache.add(this);\n getterMethod.index++;\n if (this) this.index = getterMethod.index;\n }\n if (this) getterMethod.index = this.index;\n return getterMethod(props);\n }\n return props;\n },\n render: function (this: any, render: any) {\n getterMethodNames.forEach((name) => {\n if (this[name] === undefined) return;\n this[name].index = -1;\n this[name].cache.clear();\n });\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,SAASI,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAAM,EACNE,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAA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KAAK,EAAE;UACpB,IAAI,IAAI,EAAE,IAAI,CAACA,KAAK,GAAGJ,YAAY,CAACI,KAAK;QAC3C;QACA,IAAI,IAAI,EAAEJ,YAAY,CAACI,KAAK,GAAG,IAAI,CAACA,KAAK;QACzC,OAAOJ,YAAY,CAACR,KAAK,CAAC;MAC5B;MACA,OAAOA,KAAK;IACd,CAAC;IACD6B,MAAM,EAAE,SAAAA,OAAqBA,OAAW,EAAE;MAAA,IAAAC,MAAA;MACxCnC,iBAAiB,CAACoC,OAAO,CAAC,UAACpE,IAAI,EAAK;QAClC,IAAImE,MAAI,CAACnE,IAAI,CAAC,KAAKM,SAAS,EAAE;QAC9B6D,MAAI,CAACnE,IAAI,CAAC,CAACiD,KAAK,GAAG,CAAC,CAAC;QACrBkB,MAAI,CAACnE,IAAI,CAAC,CAACmD,KAAK,CAACkB,KAAK,EAAE;MAC1B,CAAC,CAAC;MACF,OAAOH,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEczC,WAAW;AAAAH,OAAA,cAAA4C,QAAA"}
@@ -12,12 +12,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
12
12
  var _toPropertyKey2 = _interopRequireDefault(require("@babel/runtime/helpers/toPropertyKey"));
13
13
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _assignProps = require("intergalactic/utils/lib/assignProps");
16
- var _capitalizeFirstLetter = _interopRequireDefault(require("intergalactic/utils/lib/capitalizeFirstLetter"));
17
- // @ts-ignore
18
-
19
- // @ts-ignore
20
-
15
+ var _assignProps = require("../utils/assignProps");
16
+ var _capitalizeFirstLetter = _interopRequireDefault(require("../utils/capitalizeFirstLetter"));
21
17
  function assign(target, source) {
22
18
  return Object.defineProperties(target, Object.keys(source).reduce(function (descriptors, key) {
23
19
  descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
@@ -1 +1 @@
1
- {"version":3,"file":"uncontrolledProps.js","names":["_assignProps","require","_capitalizeFirstLetter","_interopRequireDefault","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","defaultProp","prop","concat","capitalizeFirstLetter","handlerProp","isControlled","propValue","undefined","uncontrolledProp","self","propName","propDefaultValue","propHandler","chainHandler","getValue","state","value","oldValue","setState","_defineProperty2","_len","arguments","length","args","Array","_key","callAllEventHandlers","apply","_toConsumableArray2","uncontrolledUniversal","props","config","handlerProps","uncontrolledProps","result","_objectSpread2","handlerName","defaultPropName","other","_objectWithoutProperties2","map","_toPropertyKey2","console","warn","setter","isArray","_setter","_setter2","_toArray2","slice","v","_uncontrolledProp","_uncontrolledProp2","_slicedToArray2","handler","_objectSpread3","eventOrValue","_len2","_key2","push","uncontrolled","bind","Enhancement","condition","Component","Boolean","prototype","init","handlers","_uncontrolled","_uncontrolled2","uncontrolledHandlers","context","asProps","_uncontrolled3","_uncontrolled4","_default","exports"],"sources":["../../../src/enhancement/uncontrolledProps.tsx"],"sourcesContent":["// @ts-ignore\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport capitalizeFirstLetter from '@semcore/utils/lib/capitalizeFirstLetter';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nfunction defaultProp(prop: any) {\n return `default${capitalizeFirstLetter(prop)}`;\n}\n\nfunction handlerProp(prop: any) {\n if (prop === 'value') prop = '';\n if (prop === 'checked') prop = '';\n return `on${capitalizeFirstLetter(prop)}Change`;\n}\n\nfunction isControlled(propValue: any) {\n return propValue !== undefined;\n}\n\nfunction uncontrolledProp(\n self: any,\n propName: any,\n propValue: any,\n propDefaultValue: any,\n propHandler: any,\n chainHandler: any,\n) {\n function getValue() {\n return isControlled(propValue)\n ? propValue\n : propName in self.state\n ? self.state[propName]\n : propDefaultValue;\n }\n\n return [\n getValue(),\n (value: any, ...args: any[]) => {\n const oldValue = getValue();\n if (oldValue === value) return false;\n if (!isControlled(propValue)) self.setState({ [propName]: value });\n return callAllEventHandlers(propHandler, ...chainHandler)(value, ...args);\n },\n ];\n}\n\nfunction uncontrolledUniversal(props: any, config: any, uncontrolledProp: any) {\n const handlerProps = {};\n const uncontrolledProps = Object.keys(config).reduce((result, propName) => {\n const handlerName = handlerProp(propName);\n const defaultPropName = defaultProp(propName);\n const {\n [defaultPropName]: propDefaultValue,\n [propName]: propValue,\n [handlerName]: propHandler,\n ...other\n } = result;\n\n if (propDefaultValue === undefined) {\n console.warn(defaultPropName, 'must be installed in \"defaultProps\"');\n }\n\n // if (typeof propDefaultValue === 'function' && propDefaultValue.defaultInit) {\n // propDefaultValue = propDefaultValue(result);\n // }\n\n let setter = config[propName];\n let chainHandler = [];\n\n if (Array.isArray(setter)) [setter, ...chainHandler] = setter;\n setter = setter || ((v: any) => v);\n\n const [value, handler] = uncontrolledProp(\n propName,\n propValue,\n propDefaultValue,\n propHandler,\n chainHandler,\n );\n // TODO: need to warn about recursion (by lsroman)\n (handlerProps as any)[propName] = handler;\n\n return {\n ...other,\n [propName]: value,\n [handlerName]: (eventOrValue: any, ...args: any[]) => {\n const result = [setter(eventOrValue, ...args), ...args];\n if (eventOrValue?.target) {\n result.push(eventOrValue);\n }\n return handler(...result);\n },\n };\n }, props);\n return [uncontrolledProps, handlerProps];\n}\n\nfunction uncontrolled(self: any, props: any, config: any) {\n return uncontrolledUniversal(props, config, uncontrolledProp.bind(undefined, self));\n}\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.prototype.uncontrolledProps);\n },\n init: function (this: any) {\n this.state = this.state || {};\n assign(this, {\n get handlers() {\n const [, uncontrolledHandlers] = uncontrolled(this, this.props, this.uncontrolledProps());\n return uncontrolledHandlers;\n },\n });\n },\n context: function (this: any, context: any) {\n return {\n ...context,\n handlers: this.handlers,\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to omit unneccessary props (by lsroman)\n const [uncontrolledProps] = uncontrolled(this, props, this.uncontrolledProps());\n return uncontrolledProps;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAHA;;AAEA;;AAGA,SAASG,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAAM,EACNE,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,UAACC,WAAgB,EAAEC,GAAG,EAAK;IACpDD,WAAW,CAACC,GAAG,CAAC,GAAGL,MAAM,CAACM,wBAAwB,CAACP,MAAM,EAAEM,GAAG,CAAC;IAC/D,OAAOD,WAAW;EACpB,CAAC,EAAE,CAAC,CAAC,CAAC,CACP;AACH;AAEA,SAASG,WAAWA,CAACC,IAAS,EAAE;EAC9B,iBAAAC,MAAA,CAAiB,IAAAC,iCAAqB,EAACF,IAAI,CAAC;AAC9C;AAEA,SAASG,WAAWA,CAACH,IAAS,EAAE;EAC9B,IAAIA,IAAI,KAAK,OAAO,EAAEA,IAAI,GAAG,EAAE;EAC/B,IAAIA,IAAI,KAAK,SAAS,EAAEA,IAAI,GAAG,EAAE;EACjC,YAAAC,MAAA,CAAY,IAAAC,iCAAqB,EAACF,IAAI,CAAC;AACzC;AAEA,SAASI,YAAYA,CAACC,SAAc,EAAE;EACpC,OAAOA,SAAS,KAAKC,SAAS;AAChC;AAEA,SAASC,gBAAgBA,CACvBC,IAAS,EACTC,QAAa,EACbJ,SAAc,EACdK,gBAAqB,EACrBC,WAAgB,EAChBC,YAAiB,EACjB;EACA,SAASC,QAAQA,CAAA,EAAG;IAClB,OAAOT,YAAY,CAACC,SAAS,CAAC,GAC1BA,SAAS,GACTI,QAAQ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AAC;IACJ,CAAC;IACDC,OAAO,EAAE,SAAAA,QAAqBA,QAAY,EAAE;MAC1C,WAAAjB,cAAA,iBAAAA,cAAA,iBACKiB,QAAO;QACVJ,QAAQ,EAAE,IAAI,CAACA;MAAQ;IAE3B,CAAC;IACDK,OAAO,EAAE,SAAAA,QAAqB3C,KAAU,EAAE;MACxC;MACA,IAAA4C,cAAA,GAA4Bd,YAAY,CAAC,IAAI,EAAE9B,KAAK,EAAE,IAAI,CAACG,iBAAiB,EAAE,CAAC;QAAA0C,cAAA,OAAAtB,eAAA,aAAAqB,cAAA;QAAxEzC,iBAAiB,GAAA0C,cAAA;MACxB,OAAO1C,iBAAiB;IAC1B;EACF,CAAC;AACH;AAAC,IAAA2C,QAAA,GAEcd,WAAW;AAAAe,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"uncontrolledProps.js","names":["_assignProps","require","_capitalizeFirstLetter","_interopRequireDefault","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","defaultProp","prop","concat","capitalizeFirstLetter","handlerProp","isControlled","propValue","undefined","uncontrolledProp","self","propName","propDefaultValue","propHandler","chainHandler","getValue","state","value","oldValue","setState","_defineProperty2","_len","arguments","length","args","Array","_key","callAllEventHandlers","apply","_toConsumableArray2","uncontrolledUniversal","props","config","handlerProps","uncontrolledProps","result","_objectSpread2","handlerName","defaultPropName","other","_objectWithoutProperties2","map","_toPropertyKey2","console","warn","setter","isArray","_setter","_setter2","_toArray2","slice","v","_uncontrolledProp","_uncontrolledProp2","_slicedToArray2","handler","_objectSpread3","eventOrValue","_len2","_key2","push","uncontrolled","bind","Enhancement","condition","Component","Boolean","prototype","init","handlers","_uncontrolled","_uncontrolled2","uncontrolledHandlers","context","asProps","_uncontrolled3","_uncontrolled4","_default","exports"],"sources":["../../../src/enhancement/uncontrolledProps.tsx"],"sourcesContent":["import { callAllEventHandlers } from '../utils/assignProps';\nimport capitalizeFirstLetter from '../utils/capitalizeFirstLetter';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nfunction defaultProp(prop: any) {\n return `default${capitalizeFirstLetter(prop)}`;\n}\n\nfunction handlerProp(prop: any) {\n if (prop === 'value') prop = '';\n if (prop === 'checked') prop = '';\n return `on${capitalizeFirstLetter(prop)}Change`;\n}\n\nfunction isControlled(propValue: any) {\n return propValue !== undefined;\n}\n\nfunction uncontrolledProp(\n self: any,\n propName: any,\n propValue: any,\n propDefaultValue: any,\n propHandler: any,\n chainHandler: any,\n) {\n function getValue() {\n return isControlled(propValue)\n ? propValue\n : propName in self.state\n ? self.state[propName]\n : propDefaultValue;\n }\n\n return [\n getValue(),\n (value: any, ...args: any[]) => {\n const oldValue = getValue();\n if (oldValue === value) return false;\n if (!isControlled(propValue)) self.setState({ [propName]: value });\n return callAllEventHandlers(propHandler, ...chainHandler)(value, ...args);\n },\n ];\n}\n\nfunction uncontrolledUniversal(props: any, config: any, uncontrolledProp: any) {\n const handlerProps = {};\n const uncontrolledProps = Object.keys(config).reduce((result, propName) => {\n const handlerName = handlerProp(propName);\n const defaultPropName = defaultProp(propName);\n const {\n [defaultPropName]: propDefaultValue,\n [propName]: propValue,\n [handlerName]: propHandler,\n ...other\n } = result;\n\n if (propDefaultValue === undefined) {\n console.warn(defaultPropName, 'must be installed in \"defaultProps\"');\n }\n\n // if (typeof propDefaultValue === 'function' && propDefaultValue.defaultInit) {\n // propDefaultValue = propDefaultValue(result);\n // }\n\n let setter = config[propName];\n let chainHandler = [];\n\n if (Array.isArray(setter)) [setter, ...chainHandler] = setter;\n setter = setter || ((v: any) => v);\n\n const [value, handler] = uncontrolledProp(\n propName,\n propValue,\n propDefaultValue,\n propHandler,\n chainHandler,\n );\n // TODO: need to warn about recursion (by lsroman)\n (handlerProps as any)[propName] = handler;\n\n return {\n ...other,\n [propName]: value,\n [handlerName]: (eventOrValue: any, ...args: any[]) => {\n const result = [setter(eventOrValue, ...args), ...args];\n if (eventOrValue?.target) {\n result.push(eventOrValue);\n }\n return handler(...result);\n },\n };\n }, props);\n return [uncontrolledProps, handlerProps];\n}\n\nfunction uncontrolled(self: any, props: any, config: any) {\n return uncontrolledUniversal(props, config, uncontrolledProp.bind(undefined, self));\n}\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.prototype.uncontrolledProps);\n },\n init: function (this: any) {\n this.state = this.state || {};\n assign(this, {\n get handlers() {\n const [, uncontrolledHandlers] = uncontrolled(this, this.props, this.uncontrolledProps());\n return uncontrolledHandlers;\n },\n });\n },\n context: function (this: any, context: any) {\n return {\n ...context,\n handlers: this.handlers,\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to omit unneccessary props (by lsroman)\n const [uncontrolledProps] = uncontrolled(this, props, this.uncontrolledProps());\n return uncontrolledProps;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,SAASG,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAAM,EACNE,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,UAACC,WAAgB,EAAEC,GAAG,EAAK;IACpDD,WAAW,CAACC,GAAG,CAAC,GAAGL,MAAM,CAACM,wBAAwB,CAACP,MAAM,EAAEM,GAAG,CAAC;IAC/D,OAAOD,WAAW;EACpB,CAAC,EAAE,CAAC,CAAC,CAAC,CACP;AACH;AAEA,SAASG,WAAWA,CAACC,IAAS,EAAE;EAC9B,iBAAAC,MAAA,CAAiB,IAAAC,iCAAqB,EAACF,IAAI,CAAC;AAC9C;AAEA,SAASG,WAAWA,CAACH,IAAS,EAAE;EAC9B,IAAIA,IAAI,KAAK,OAAO,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