@salutejs/plasma-new-hope 0.174.0-canary.1505.11518120718.0 → 0.174.0-dev.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. package/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -27
  2. package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  3. package/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -9
  4. package/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js.map +1 -1
  5. package/cjs/components/Drawer/Drawer.js +2 -1
  6. package/cjs/components/Drawer/Drawer.js.map +1 -1
  7. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  8. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  9. package/cjs/components/Select/Select.js +25 -13
  10. package/cjs/components/Select/Select.js.map +1 -1
  11. package/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
  12. package/cjs/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
  13. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  14. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  15. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  16. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  17. package/cjs/components/Select/utils/getButtonLabel.js +1 -1
  18. package/cjs/components/Select/utils/getButtonLabel.js.map +1 -1
  19. package/cjs/components/Select/utils/initialItemsTransform.js +6 -9
  20. package/cjs/components/Select/utils/initialItemsTransform.js.map +1 -1
  21. package/cjs/components/ViewContainer/ViewContainer.js +38 -0
  22. package/cjs/components/ViewContainer/ViewContainer.js.map +1 -0
  23. package/cjs/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
  24. package/cjs/components/ViewContainer/_view/base.js +9 -0
  25. package/cjs/components/ViewContainer/_view/base.js.map +1 -0
  26. package/cjs/components/ViewContainer/_view/base_x642ct.css +1 -0
  27. package/cjs/index.css +2 -0
  28. package/cjs/index.js +3 -0
  29. package/cjs/index.js.map +1 -1
  30. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -26
  31. package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +1 -8
  32. package/emotion/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  33. package/emotion/cjs/components/Drawer/Drawer.js +4 -3
  34. package/emotion/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  35. package/emotion/cjs/components/Select/Select.js +25 -12
  36. package/emotion/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
  37. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  38. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +13 -13
  39. package/emotion/cjs/components/Select/utils/getButtonLabel.js +1 -1
  40. package/emotion/cjs/components/Select/utils/index.js +1 -8
  41. package/emotion/cjs/components/Select/utils/initialItemsTransform.js +6 -19
  42. package/emotion/cjs/components/ViewContainer/ViewContainer.js +49 -0
  43. package/emotion/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  44. package/emotion/cjs/components/ViewContainer/_view/base.js +8 -0
  45. package/emotion/cjs/components/ViewContainer/_view/tokens.json +1 -0
  46. package/emotion/cjs/components/ViewContainer/index.js +18 -0
  47. package/emotion/cjs/examples/_helpers.js +3 -14
  48. package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  49. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
  50. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
  51. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  52. package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  53. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
  54. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
  55. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  56. package/emotion/cjs/index.js +11 -0
  57. package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +23 -27
  58. package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -2
  59. package/emotion/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  60. package/emotion/es/components/Drawer/Drawer.js +2 -1
  61. package/emotion/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  62. package/emotion/es/components/Select/Select.js +26 -13
  63. package/emotion/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
  64. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  65. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +13 -13
  66. package/emotion/es/components/Select/utils/getButtonLabel.js +1 -1
  67. package/emotion/es/components/Select/utils/index.js +1 -2
  68. package/emotion/es/components/Select/utils/initialItemsTransform.js +6 -19
  69. package/emotion/es/components/ViewContainer/ViewContainer.js +40 -0
  70. package/emotion/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  71. package/emotion/es/components/ViewContainer/_view/base.js +2 -0
  72. package/emotion/es/components/ViewContainer/_view/tokens.json +1 -0
  73. package/emotion/es/components/ViewContainer/index.js +1 -0
  74. package/emotion/es/examples/_helpers.js +3 -14
  75. package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  76. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
  77. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
  78. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  79. package/emotion/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  80. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
  81. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
  82. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  83. package/emotion/es/index.js +2 -1
  84. package/es/components/Combobox/ComboboxNew/Combobox.js +22 -27
  85. package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  86. package/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -9
  87. package/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js.map +1 -1
  88. package/es/components/Drawer/Drawer.js +2 -1
  89. package/es/components/Drawer/Drawer.js.map +1 -1
  90. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  91. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  92. package/es/components/Select/Select.js +26 -14
  93. package/es/components/Select/Select.js.map +1 -1
  94. package/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
  95. package/es/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
  96. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  97. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  98. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  99. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  100. package/es/components/Select/utils/getButtonLabel.js +1 -1
  101. package/es/components/Select/utils/getButtonLabel.js.map +1 -1
  102. package/es/components/Select/utils/initialItemsTransform.js +6 -9
  103. package/es/components/Select/utils/initialItemsTransform.js.map +1 -1
  104. package/es/components/ViewContainer/ViewContainer.js +33 -0
  105. package/es/components/ViewContainer/ViewContainer.js.map +1 -0
  106. package/es/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
  107. package/es/components/ViewContainer/_view/base.js +5 -0
  108. package/es/components/ViewContainer/_view/base.js.map +1 -0
  109. package/es/components/ViewContainer/_view/base_x642ct.css +1 -0
  110. package/es/index.css +2 -0
  111. package/es/index.js +1 -0
  112. package/es/index.js.map +1 -1
  113. package/package.json +3 -2
  114. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -26
  115. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +1 -8
  116. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  117. package/styled-components/cjs/components/Drawer/Drawer.js +4 -3
  118. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  119. package/styled-components/cjs/components/Select/Select.js +25 -12
  120. package/styled-components/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
  121. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  122. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  123. package/styled-components/cjs/components/Select/utils/getButtonLabel.js +1 -1
  124. package/styled-components/cjs/components/Select/utils/index.js +1 -8
  125. package/styled-components/cjs/components/Select/utils/initialItemsTransform.js +6 -19
  126. package/styled-components/cjs/components/ViewContainer/ViewContainer.js +40 -0
  127. package/styled-components/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  128. package/styled-components/cjs/components/ViewContainer/_view/base.js +8 -0
  129. package/styled-components/cjs/components/ViewContainer/_view/tokens.json +1 -0
  130. package/styled-components/cjs/components/ViewContainer/index.js +18 -0
  131. package/styled-components/cjs/examples/_helpers.js +3 -14
  132. package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  133. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
  134. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
  135. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  136. package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  137. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
  138. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
  139. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  140. package/styled-components/cjs/index.js +11 -0
  141. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +23 -27
  142. package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -2
  143. package/styled-components/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  144. package/styled-components/es/components/Drawer/Drawer.js +2 -1
  145. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  146. package/styled-components/es/components/Select/Select.js +26 -13
  147. package/styled-components/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
  148. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  149. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  150. package/styled-components/es/components/Select/utils/getButtonLabel.js +1 -1
  151. package/styled-components/es/components/Select/utils/index.js +1 -2
  152. package/styled-components/es/components/Select/utils/initialItemsTransform.js +6 -19
  153. package/styled-components/es/components/ViewContainer/ViewContainer.js +31 -0
  154. package/styled-components/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  155. package/styled-components/es/components/ViewContainer/_view/base.js +2 -0
  156. package/styled-components/es/components/ViewContainer/_view/tokens.json +1 -0
  157. package/styled-components/es/components/ViewContainer/index.js +1 -0
  158. package/styled-components/es/examples/_helpers.js +3 -14
  159. package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  160. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
  161. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
  162. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  163. package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  164. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
  165. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
  166. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  167. package/styled-components/es/index.js +2 -1
  168. package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
  169. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +3 -14
  170. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
  171. package/types/components/Combobox/ComboboxNew/utils/index.d.ts +0 -1
  172. package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
  173. package/types/components/Combobox/ComboboxNew/utils/initialItemsTransform.d.ts.map +1 -1
  174. package/types/components/Drawer/Drawer.d.ts.map +1 -1
  175. package/types/components/Select/Select.d.ts.map +1 -1
  176. package/types/components/Select/Select.types.d.ts +0 -1
  177. package/types/components/Select/Select.types.d.ts.map +1 -1
  178. package/types/components/Select/hooks/useKeyboardNavigation.d.ts +2 -2
  179. package/types/components/Select/hooks/useKeyboardNavigation.d.ts.map +1 -1
  180. package/types/components/Select/ui/Target/Target.types.d.ts +2 -2
  181. package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
  182. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts +4 -4
  183. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
  184. package/types/components/Select/utils/index.d.ts +0 -1
  185. package/types/components/Select/utils/index.d.ts.map +1 -1
  186. package/types/components/Select/utils/initialItemsTransform.d.ts.map +1 -1
  187. package/types/components/ViewContainer/ViewContainer.d.ts +26 -0
  188. package/types/components/ViewContainer/ViewContainer.d.ts.map +1 -0
  189. package/types/components/ViewContainer/_view/base.d.ts +2 -0
  190. package/types/components/ViewContainer/_view/base.d.ts.map +1 -0
  191. package/types/components/ViewContainer/index.d.ts +2 -0
  192. package/types/components/ViewContainer/index.d.ts.map +1 -0
  193. package/types/examples/_helpers.d.ts.map +1 -1
  194. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +6 -30
  195. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
  196. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts +9 -0
  197. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
  198. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts +8 -0
  199. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts.map +1 -0
  200. package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +6 -30
  201. package/types/examples/plasma_web/components/Combobox/Combobox.d.ts.map +1 -1
  202. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts +9 -0
  203. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
  204. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts +8 -0
  205. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts.map +1 -0
  206. package/types/index.d.ts +1 -0
  207. package/types/index.d.ts.map +1 -1
  208. package/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -21
  209. package/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js.map +0 -1
  210. package/cjs/components/Select/utils/getInitialValue.js +0 -21
  211. package/cjs/components/Select/utils/getInitialValue.js.map +0 -1
  212. package/emotion/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -20
  213. package/emotion/cjs/components/Select/utils/getInitialValue.js +0 -20
  214. package/emotion/cjs/examples/themes/declaration.d.ts +0 -4
  215. package/emotion/cjs/examples/themes/index.js +0 -15
  216. package/emotion/cjs/examples/themes/plasma_b2c.module.css +0 -984
  217. package/emotion/cjs/examples/themes/plasma_web.module.css +0 -984
  218. package/emotion/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -14
  219. package/emotion/es/components/Select/utils/getInitialValue.js +0 -14
  220. package/emotion/es/examples/themes/declaration.d.ts +0 -4
  221. package/emotion/es/examples/themes/index.js +0 -7
  222. package/emotion/es/examples/themes/plasma_b2c.module.css +0 -984
  223. package/emotion/es/examples/themes/plasma_web.module.css +0 -984
  224. package/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -17
  225. package/es/components/Combobox/ComboboxNew/utils/getInitialValue.js.map +0 -1
  226. package/es/components/Select/utils/getInitialValue.js +0 -17
  227. package/es/components/Select/utils/getInitialValue.js.map +0 -1
  228. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -20
  229. package/styled-components/cjs/components/Select/utils/getInitialValue.js +0 -20
  230. package/styled-components/cjs/examples/themes/declaration.d.ts +0 -4
  231. package/styled-components/cjs/examples/themes/index.js +0 -15
  232. package/styled-components/cjs/examples/themes/plasma_b2c.module.css +0 -984
  233. package/styled-components/cjs/examples/themes/plasma_web.module.css +0 -984
  234. package/styled-components/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -14
  235. package/styled-components/es/components/Select/utils/getInitialValue.js +0 -14
  236. package/styled-components/es/examples/themes/declaration.d.ts +0 -4
  237. package/styled-components/es/examples/themes/index.js +0 -7
  238. package/styled-components/es/examples/themes/plasma_b2c.module.css +0 -984
  239. package/styled-components/es/examples/themes/plasma_web.module.css +0 -984
  240. package/types/components/Combobox/ComboboxNew/utils/getInitialValue.d.ts +0 -4
  241. package/types/components/Combobox/ComboboxNew/utils/getInitialValue.d.ts.map +0 -1
  242. package/types/components/Select/utils/getInitialValue.d.ts +0 -4
  243. package/types/components/Select/utils/getInitialValue.d.ts.map +0 -1
  244. package/types/examples/themes/index.d.ts +0 -6
  245. package/types/examples/themes/index.d.ts.map +0 -1
@@ -20,7 +20,7 @@ var _getPathMaps = /*#__PURE__*/require("./hooks/getPathMaps");
20
20
  var _Combobox2 = /*#__PURE__*/require("./Combobox.styles");
21
21
  var _base = /*#__PURE__*/require("./variations/_view/base");
22
22
  var _base2 = /*#__PURE__*/require("./variations/_size/base");
23
- var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "targetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect", "renderValue"];
23
+ var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect"];
24
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
26
26
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -44,7 +44,6 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
44
44
  outerValue = props.value,
45
45
  outerOnChange = props.onChange,
46
46
  isTargetAmount = props.isTargetAmount,
47
- targetAmount = props.targetAmount,
48
47
  items = props.items,
49
48
  _props$placement = props.placement,
50
49
  placement = _props$placement === void 0 ? 'bottom-start' : _props$placement,
@@ -72,15 +71,10 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
72
71
  alwaysOpened = _props$alwaysOpened === void 0 ? false : _props$alwaysOpened,
73
72
  filter = props.filter,
74
73
  outerCloseAfterSelect = props.closeAfterSelect,
75
- renderValue = props.renderValue,
76
74
  rest = _objectWithoutProperties(props, _excluded);
77
- var transformedItems = (0, _react.useMemo)(function () {
78
- return (0, _utils3.initialItemsTransform)(items || []);
79
- }, [items]);
80
-
81
75
  // Создаем структуры для быстрой работы с деревом
82
76
  var _useMemo = (0, _react.useMemo)(function () {
83
- return (0, _getPathMaps.getTreeMaps)(transformedItems);
77
+ return (0, _getPathMaps.getTreeMaps)(items);
84
78
  }, [items]),
85
79
  _useMemo2 = _slicedToArray(_useMemo, 3),
86
80
  valueToCheckedMap = _useMemo2[0],
@@ -94,11 +88,14 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
94
88
  _useState4 = _slicedToArray(_useState3, 2),
95
89
  internalValue = _useState4[0],
96
90
  setInternalValue = _useState4[1];
97
- var value = outerValue !== null && outerValue !== undefined ? (0, _utils3.getInitialValue)(outerValue, valueToItemMap) : internalValue;
91
+ var value = outerValue || internalValue;
98
92
  var inputRef = (0, _react.useRef)(null);
99
93
  var floatingPopoverRef = (0, _react.useRef)(null);
100
94
  var inputForkRef = (0, _plasmaCore.useForkRef)(inputRef, ref);
101
95
  var treeId = (0, _plasmaCore.safeUseId)();
96
+ var transformedItems = (0, _react.useMemo)(function () {
97
+ return (0, _utils3.initialItemsTransform)(items || []);
98
+ }, [items]);
102
99
  var filteredItems = (0, _utils3.filterItems)(transformedItems, textValue, (_valueToItemMap$get2 = valueToItemMap.get(value)) === null || _valueToItemMap$get2 === void 0 ? void 0 : _valueToItemMap$get2.label, filter);
103
100
  var _useMemo3 = (0, _react.useMemo)(function () {
104
101
  return (0, _getPathMaps.getPathMap)(filteredItems);
@@ -265,7 +262,16 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
265
262
  if (e) {
266
263
  e.stopPropagation();
267
264
  }
268
- var isCurrentChecked = checked.get(item.value);
265
+ var checkedCopy = new Map(checked);
266
+ var isCurrentChecked = checkedCopy.get(item.value);
267
+ checkedCopy.forEach(function (_, key) {
268
+ checkedCopy.set(key, false);
269
+ });
270
+ if (!isCurrentChecked) {
271
+ checkedCopy.set(item.value, 'done');
272
+ (0, _utils3.updateSingleAncestors)(item, checkedCopy, 'dot');
273
+ }
274
+ setTextValue(isCurrentChecked ? '' : item.label);
269
275
  if (!alwaysOpened && closeAfterSelect) {
270
276
  dispatchPath({
271
277
  type: 'reset'
@@ -279,18 +285,14 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
279
285
  }
280
286
  };
281
287
  var getChips = function getChips() {
282
- if (multiple && Array.isArray(value)) {
288
+ if (multiple) {
283
289
  if (value.length === 0) return [];
284
290
  if (isTargetAmount) {
285
- return ["\u0412\u044B\u0431\u0440\u0430\u043D\u043E ".concat(targetAmount || value.length)];
291
+ return ["\u0412\u044B\u0431\u0440\u0430\u043D\u043E ".concat(value.length)];
286
292
  }
287
- var renderValueMapper = renderValue && function (stringValue) {
288
- return renderValue(valueToItemMap.get(stringValue));
289
- };
290
- var valueToItemMapper = function valueToItemMapper(stringValue) {
291
- return valueToItemMap.get(stringValue).label;
292
- };
293
- return value.map(renderValueMapper || valueToItemMapper);
293
+ return value.map(function (value) {
294
+ return valueToItemMap.get(value).label;
295
+ });
294
296
  }
295
297
  return [];
296
298
  };
@@ -318,7 +320,6 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
318
320
  // В данном эффекте мы следим за изменениями value снаружи и вносим коррективы в дерево чекбоксов.
319
321
  // Пример: когда юзер очистил value извне, тогда нужно пройтись по элементам и выключить все чекбоксы.
320
322
  (0, _react.useLayoutEffect)(function () {
321
- var _valueToItemMap$get4;
322
323
  var checkedCopy = new Map(checked);
323
324
  checkedCopy.forEach(function (_, key) {
324
325
  checkedCopy.set(key, false);
@@ -336,12 +337,7 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
336
337
  }
337
338
  }
338
339
  setChecked(checkedCopy);
339
- setTextValue(((_valueToItemMap$get4 = valueToItemMap.get(outerValue)) === null || _valueToItemMap$get4 === void 0 ? void 0 : _valueToItemMap$get4.label) || '');
340
-
341
- // В deps мы кладем именно outerValue и internalValue, а не просто value.
342
- // Т.к. вначале нужно отфильтровать и провалидировать outerValue и результат положить в переменную.
343
- // А переменную, содержащую сложные типы данных, нельзя помещать в deps.
344
- }, [outerValue, internalValue, items]);
340
+ }, [value]);
345
341
  return /*#__PURE__*/_react["default"].createElement(Root, {
346
342
  size: size,
347
343
  view: view,
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "filterItems", {
9
9
  return _filterItems.filterItems;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "getInitialValue", {
13
- enumerable: true,
14
- get: function get() {
15
- return _getInitialValue.getInitialValue;
16
- }
17
- });
18
12
  Object.defineProperty(exports, "getItemId", {
19
13
  enumerable: true,
20
14
  get: function get() {
@@ -57,5 +51,4 @@ var _updateAncestors = /*#__PURE__*/require("./updateAncestors");
57
51
  var _updateSingleAncestors = /*#__PURE__*/require("./updateSingleAncestors");
58
52
  var _sizeToIconSize = /*#__PURE__*/require("./sizeToIconSize");
59
53
  var _filterItems = /*#__PURE__*/require("./filterItems");
60
- var _getItemId = /*#__PURE__*/require("./getItemId");
61
- var _getInitialValue = /*#__PURE__*/require("./getInitialValue");
54
+ var _getItemId = /*#__PURE__*/require("./getItemId");
@@ -1,31 +1,17 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.initialItemsTransform = void 0;
8
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
7
  // Проходимся по массиву items и добавляем в каждый item ключ parent, который ссылается на item родителя.
20
8
  // Дает возможность прохода к корневому элементу (снизу вверх).
21
- // На выходе получаем глубокую копию исходного массива items.
22
9
  var initialItemsTransform = exports.initialItemsTransform = function initialItemsTransform(items, parent) {
23
- return _toConsumableArray(items).map(function (item) {
24
- var itemCopy = _objectSpread({}, item);
25
- itemCopy.parent = parent;
26
- if (itemCopy.items) {
27
- itemCopy.items = initialItemsTransform(itemCopy.items, itemCopy);
10
+ items.forEach(function (item) {
11
+ item.parent = parent;
12
+ if (item.items) {
13
+ item.items = initialItemsTransform(item.items, item);
28
14
  }
29
- return itemCopy;
30
15
  });
16
+ return items;
31
17
  };
@@ -13,13 +13,14 @@ var _Overlay = /*#__PURE__*/require("../Overlay");
13
13
  var _utils = /*#__PURE__*/require("../Popup/utils");
14
14
  var _Panel = /*#__PURE__*/require("../Panel");
15
15
  var _utils2 = /*#__PURE__*/require("../../utils");
16
+ var _hooks = /*#__PURE__*/require("../../hooks");
16
17
  var _Drawer = /*#__PURE__*/require("./Drawer.tokens");
17
18
  var _base = /*#__PURE__*/require("./variations/_view/base");
18
19
  var _base2 = /*#__PURE__*/require("./variations/_size/base");
19
20
  var _base3 = /*#__PURE__*/require("./variations/_borderRadius/base");
20
21
  var _Drawer2 = /*#__PURE__*/require("./Drawer.styles");
21
22
  var _DrawerContext = /*#__PURE__*/require("./DrawerContext");
22
- var _hooks = /*#__PURE__*/require("./hooks");
23
+ var _hooks2 = /*#__PURE__*/require("./hooks");
23
24
  var _excluded = ["id", "zIndex", "popupInfo", "withBlur", "children", "view", "size", "width", "height", "isOpen", "opened", "initialFocusRef", "focusAfterRef", "className", "onClose", "onOverlayClick", "onEscKeyDown", "offset", "frame", "borderRadius", "placement", "closeOnEsc", "closeOnOverlayClick", "asModal"];
24
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
26
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -62,7 +63,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
62
63
  asModal = _ref$asModal === void 0 ? true : _ref$asModal,
63
64
  rest = _objectWithoutProperties(_ref, _excluded);
64
65
  var innerIsOpen = Boolean(isOpen || opened);
65
- var trapRef = (0, _plasmaCore.useFocusTrap)(true, initialFocusRef, focusAfterRef);
66
+ var trapRef = (0, _hooks.useFocusTrap)(true, initialFocusRef, focusAfterRef);
66
67
  var popupController = (0, _Popup.usePopupContext)();
67
68
  var innerRef = (0, _plasmaCore.useForkRef)(trapRef, outerRef);
68
69
  var uniqId = (0, _plasmaCore.safeUseId)();
@@ -71,7 +72,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
71
72
  var innerWidth = width ? (0, _utils2.getSizeValueFromProp)(width) : '100%';
72
73
  var innerHeight = height ? (0, _utils2.getSizeValueFromProp)(height) : '100%';
73
74
  var placementClass = placement ? _Drawer.classes["".concat(placement, "Placement")] : undefined;
74
- var _useDrawer = (0, _hooks.useDrawer)({
75
+ var _useDrawer = (0, _hooks2.useDrawer)({
75
76
  id: innerId,
76
77
  isOpen: innerIsOpen,
77
78
  closeOnEsc: closeOnEsc,
@@ -24,8 +24,8 @@ var PaginationSelectPerPage = exports.PaginationSelectPerPage = function Paginat
24
24
  listWidth = _ref.listWidth,
25
25
  rest = _objectWithoutProperties(_ref, _excluded);
26
26
  var handleSelectChange = function handleSelectChange(newValue) {
27
- if (newValue && !Array.isArray(newValue) && onChangeValue) {
28
- onChangeValue(Number(newValue));
27
+ if (newValue) {
28
+ onChangeValue === null || onChangeValue === void 0 || onChangeValue(Number(newValue));
29
29
  }
30
30
  };
31
31
  var transformedList = perPageList.map(function (num) {
@@ -67,6 +67,17 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
67
67
  separator = props.separator,
68
68
  outerCloseAfterSelect = props.closeAfterSelect,
69
69
  rest = _objectWithoutProperties(props, _excluded);
70
+ var _useState = (0, _react.useState)(outerValue || props.multiselect ? [] : ''),
71
+ _useState2 = _slicedToArray(_useState, 2),
72
+ internalValue = _useState2[0],
73
+ setInternalValue = _useState2[1];
74
+ var value = outerValue || internalValue;
75
+ var onChange = function onChange(e) {
76
+ if (outerOnChange) {
77
+ outerOnChange(e);
78
+ }
79
+ setInternalValue(e);
80
+ };
70
81
  var transformedItems = (0, _react.useMemo)(function () {
71
82
  return (0, _utils2.initialItemsTransform)(items || []);
72
83
  }, [items]);
@@ -76,12 +87,6 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
76
87
  focusedToValueMap = _usePathMaps2[1],
77
88
  valueToCheckedMap = _usePathMaps2[2],
78
89
  valueToItemMap = _usePathMaps2[3];
79
- var value = (0, _utils2.getInitialValue)(outerValue, valueToItemMap);
80
- var onChange = function onChange(e) {
81
- if (outerOnChange) {
82
- outerOnChange(e);
83
- }
84
- };
85
90
  var _useReducer = (0, _react.useReducer)(_reducers.pathReducer, []),
86
91
  _useReducer2 = _slicedToArray(_useReducer, 2),
87
92
  path = _useReducer2[0],
@@ -94,10 +99,10 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
94
99
  _useReducer6 = _slicedToArray(_useReducer5, 2),
95
100
  focusedChipIndex = _useReducer6[0],
96
101
  dispatchFocusedChipIndex = _useReducer6[1];
97
- var _useState = (0, _react.useState)(valueToCheckedMap),
98
- _useState2 = _slicedToArray(_useState, 2),
99
- checked = _useState2[0],
100
- setChecked = _useState2[1];
102
+ var _useState3 = (0, _react.useState)(valueToCheckedMap),
103
+ _useState4 = _slicedToArray(_useState3, 2),
104
+ checked = _useState4[0],
105
+ setChecked = _useState4[1];
101
106
  var closeAfterSelect = outerCloseAfterSelect !== null && outerCloseAfterSelect !== void 0 ? outerCloseAfterSelect : !props.multiselect;
102
107
  var targetRef = (0, _hooks.useOutsideClick)(function () {
103
108
  if (focusedChipIndex != null) {
@@ -163,7 +168,15 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
163
168
  if (e) {
164
169
  e.stopPropagation();
165
170
  }
166
- var isCurrentChecked = checked.get(item.value);
171
+ var checkedCopy = new Map(checked);
172
+ var isCurrentChecked = checkedCopy.get(item.value);
173
+ checkedCopy.forEach(function (_, key) {
174
+ checkedCopy.set(key, false);
175
+ });
176
+ if (!isCurrentChecked) {
177
+ checkedCopy.set(item.value, 'done');
178
+ (0, _utils2.updateSingleAncestors)(item, checkedCopy, 'dot');
179
+ }
167
180
  if (closeAfterSelect) {
168
181
  dispatchPath({
169
182
  type: 'reset'
@@ -235,7 +248,7 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
235
248
  }
236
249
  }
237
250
  setChecked(checkedCopy);
238
- }, [outerValue, items]);
251
+ }, [value]);
239
252
  return /*#__PURE__*/_react["default"].createElement(Root, _extends({
240
253
  ref: ref,
241
254
  size: size,
@@ -159,7 +159,7 @@ var useKeyNavigation = exports.useKeyNavigation = function useKeyNavigation(_ref
159
159
  }
160
160
  case keys.Backspace:
161
161
  {
162
- if (!multiselect || !Array.isArray(value)) break;
162
+ if (!multiselect) break;
163
163
  if (focusedChipIndex !== null) {
164
164
  var _currentItem = valueToItemMap.get(value[focusedChipIndex]);
165
165
  handlePressDown(_currentItem);
@@ -41,7 +41,7 @@ var getLabel = function getLabel(_ref) {
41
41
  text: renderValue ? renderValue(valueToItemMap.get(currentValue)) : itemLabel,
42
42
  onClick: function onClick(e) {
43
43
  e.stopPropagation();
44
- onChipClick(currentValue.toString());
44
+ onChipClick(currentValue);
45
45
  },
46
46
  focused: focusedChipIndex === index
47
47
  });