@salutejs/plasma-new-hope 0.186.0-canary.1542.11716355955.0 → 0.186.0-canary.1546.11723696357.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/cjs/components/Badge/Badge.css +4 -4
  2. package/cjs/components/Badge/Badge.js +16 -4
  3. package/cjs/components/Badge/Badge.js.map +1 -1
  4. package/cjs/components/Badge/Badge.tokens.js +10 -5
  5. package/cjs/components/Badge/Badge.tokens.js.map +1 -1
  6. package/cjs/components/Badge/variations/_clear/base.js +1 -1
  7. package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
  8. package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  9. package/cjs/components/Badge/variations/_size/base.js +1 -1
  10. package/cjs/components/Badge/variations/_size/base.js.map +1 -1
  11. package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_rn38n6.css} +1 -1
  12. package/cjs/components/Badge/variations/_transparent/base.js +1 -1
  13. package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
  14. package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  15. package/cjs/components/Badge/variations/_view/base.js +1 -1
  16. package/cjs/components/Badge/variations/_view/base.js.map +1 -1
  17. package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  18. package/cjs/index.css +4 -4
  19. package/cjs/index.js +0 -2
  20. package/cjs/index.js.map +1 -1
  21. package/emotion/cjs/components/Badge/Badge.js +21 -4
  22. package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
  23. package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
  24. package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
  25. package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
  26. package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
  27. package/emotion/cjs/components/Combobox/ComboboxNew/index.js +1 -8
  28. package/emotion/cjs/components/Combobox/index.js +0 -6
  29. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +14 -14
  30. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
  31. package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
  32. package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
  33. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  34. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
  35. package/emotion/es/components/Badge/Badge.js +23 -5
  36. package/emotion/es/components/Badge/Badge.tokens.js +9 -5
  37. package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
  38. package/emotion/es/components/Badge/variations/_size/base.js +3 -2
  39. package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
  40. package/emotion/es/components/Badge/variations/_view/base.js +2 -2
  41. package/emotion/es/components/Combobox/ComboboxNew/index.js +1 -2
  42. package/emotion/es/components/Combobox/index.js +1 -1
  43. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +14 -14
  44. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
  45. package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
  46. package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
  47. package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  48. package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
  49. package/es/components/Badge/Badge.css +4 -4
  50. package/es/components/Badge/Badge.js +19 -7
  51. package/es/components/Badge/Badge.js.map +1 -1
  52. package/es/components/Badge/Badge.tokens.js +10 -6
  53. package/es/components/Badge/Badge.tokens.js.map +1 -1
  54. package/es/components/Badge/variations/_clear/base.js +1 -1
  55. package/es/components/Badge/variations/_clear/base.js.map +1 -1
  56. package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  57. package/es/components/Badge/variations/_size/base.js +1 -1
  58. package/es/components/Badge/variations/_size/base.js.map +1 -1
  59. package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_rn38n6.css} +1 -1
  60. package/es/components/Badge/variations/_transparent/base.js +1 -1
  61. package/es/components/Badge/variations/_transparent/base.js.map +1 -1
  62. package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  63. package/es/components/Badge/variations/_view/base.js +1 -1
  64. package/es/components/Badge/variations/_view/base.js.map +1 -1
  65. package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  66. package/es/index.css +4 -4
  67. package/es/index.js +0 -1
  68. package/es/index.js.map +1 -1
  69. package/package.json +2 -2
  70. package/styled-components/cjs/components/Badge/Badge.js +21 -4
  71. package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
  72. package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
  73. package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
  74. package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
  75. package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
  76. package/styled-components/cjs/components/Combobox/ComboboxNew/index.js +1 -8
  77. package/styled-components/cjs/components/Combobox/index.js +0 -6
  78. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  79. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
  80. package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
  81. package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
  82. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  83. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
  84. package/styled-components/es/components/Badge/Badge.js +23 -5
  85. package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
  86. package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
  87. package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
  88. package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
  89. package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
  90. package/styled-components/es/components/Combobox/ComboboxNew/index.js +1 -2
  91. package/styled-components/es/components/Combobox/index.js +1 -1
  92. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  93. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +8 -2
  94. package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.js +2 -7
  95. package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +4 -62
  96. package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  97. package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +8 -2
  98. package/types/components/Badge/Badge.d.ts.map +1 -1
  99. package/types/components/Badge/Badge.tokens.d.ts +8 -4
  100. package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
  101. package/types/components/Badge/Badge.types.d.ts +18 -5
  102. package/types/components/Badge/Badge.types.d.ts.map +1 -1
  103. package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
  104. package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
  105. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +0 -21
  106. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
  107. package/types/components/Combobox/ComboboxNew/index.d.ts +0 -1
  108. package/types/components/Combobox/ComboboxNew/index.d.ts.map +1 -1
  109. package/types/components/Combobox/index.d.ts +1 -1
  110. package/types/components/Combobox/index.d.ts.map +1 -1
  111. package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
  112. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +58 -4
  113. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
  114. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +2 -3
  115. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
  116. package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
  117. package/types/examples/plasma_web/components/Badge/Badge.d.ts +58 -4
  118. package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
  119. package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  120. package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  121. package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
  122. package/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -22
  123. package/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js.map +0 -1
  124. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -21
  125. package/emotion/cjs/components/Combobox/ComboboxNew/utils/getForm.js +0 -90
  126. package/emotion/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -53
  127. package/emotion/es/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -14
  128. package/emotion/es/components/Combobox/ComboboxNew/utils/getForm.js +0 -83
  129. package/emotion/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -47
  130. package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  131. package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  132. package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
  133. package/es/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -18
  134. package/es/components/Combobox/ComboboxNew/Combobox.boundler.js.map +0 -1
  135. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -21
  136. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getForm.js +0 -90
  137. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -53
  138. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.boundler.js +0 -14
  139. package/styled-components/es/components/Combobox/ComboboxNew/utils/getForm.js +0 -83
  140. package/styled-components/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -47
  141. package/types/components/Combobox/ComboboxNew/Combobox.boundler.d.ts +0 -4
  142. package/types/components/Combobox/ComboboxNew/Combobox.boundler.d.ts.map +0 -1
  143. package/types/components/Combobox/ComboboxNew/utils/getForm.d.ts +0 -4
  144. package/types/components/Combobox/ComboboxNew/utils/getForm.d.ts.map +0 -1
  145. package/types/components/Combobox/ComboboxNew/utils/syntheticEvent.d.ts +0 -4
  146. package/types/components/Combobox/ComboboxNew/utils/syntheticEvent.d.ts.map +0 -1
@@ -1,83 +0,0 @@
1
- var _excluded = ["onChange", "component"],
2
- _excluded2 = ["onChange", "component"];
3
- 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); }
4
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- 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); }
7
- 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; }
8
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
- // @ts-nocheck
14
-
15
- import React, { useEffect, useRef, useState } from 'react';
16
- import { createEvent } from './syntheticEvent';
17
- var SingleForm = function SingleForm(args) {
18
- var onChange = args.onChange,
19
- Component = args.component,
20
- rest = _objectWithoutProperties(args, _excluded);
21
- var _useState = useState(),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- value = _useState2[0],
24
- setValue = _useState2[1];
25
- var selectRef = useRef(null);
26
- var handleChange = function handleChange(value) {
27
- setValue(value);
28
- };
29
- useEffect(function () {
30
- var event = createEvent(selectRef);
31
- onChange && onChange(event);
32
- }, [value]);
33
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("select", {
34
- ref: selectRef,
35
- value: value,
36
- hidden: true
37
- }, /*#__PURE__*/React.createElement("option", {
38
- value: value
39
- }, value)), /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
40
- value: value,
41
- onChange: handleChange
42
- })));
43
- };
44
- var MultipleForm = function MultipleForm(args) {
45
- var onChange = args.onChange,
46
- Component = args.component,
47
- rest = _objectWithoutProperties(args, _excluded2);
48
- var _useState3 = useState([]),
49
- _useState4 = _slicedToArray(_useState3, 2),
50
- values = _useState4[0],
51
- setValues = _useState4[1];
52
- var selectRef = useRef(null);
53
- var handleChange = function handleChange(value) {
54
- setValues(value);
55
- };
56
- useEffect(function () {
57
- var event = createEvent(selectRef);
58
- onChange && onChange(event);
59
- }, [values]);
60
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("select", {
61
- ref: selectRef,
62
- value: values,
63
- multiple: true,
64
- hidden: true
65
- }, values.map(function (value) {
66
- return /*#__PURE__*/React.createElement("option", {
67
- key: value,
68
- value: value
69
- }, value);
70
- })), /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
71
- value: values,
72
- onChange: handleChange
73
- })));
74
- };
75
- export var getFormComponentGenerator = function getFormComponentGenerator(Component) {
76
- return function (args) {
77
- return args.multiple ? /*#__PURE__*/React.createElement(MultipleForm, _extends({}, args, {
78
- component: Component
79
- })) : /*#__PURE__*/React.createElement(SingleForm, _extends({}, args, {
80
- component: Component
81
- }));
82
- };
83
- };
@@ -1,47 +0,0 @@
1
- export var createEvent = function createEvent(ref) {
2
- if (ref.current) {
3
- var event = new Event('change', {
4
- bubbles: true
5
- });
6
- Object.defineProperty(event, 'target', {
7
- writable: false,
8
- value: ref.current
9
- });
10
- var syntheticEvent = createSyntheticEvent(event);
11
- return syntheticEvent;
12
- }
13
- return null;
14
- };
15
- export var createSyntheticEvent = function createSyntheticEvent(event) {
16
- var _isDefaultPrevented = false;
17
- var _isPropagationStopped = false;
18
- var preventDefault = function preventDefault() {
19
- _isDefaultPrevented = true;
20
- event.preventDefault();
21
- };
22
- var stopPropagation = function stopPropagation() {
23
- _isPropagationStopped = true;
24
- event.stopPropagation();
25
- };
26
- return {
27
- nativeEvent: event,
28
- currentTarget: event.currentTarget,
29
- target: event.target,
30
- bubbles: event.bubbles,
31
- cancelable: event.cancelable,
32
- defaultPrevented: event.defaultPrevented,
33
- eventPhase: event.eventPhase,
34
- isTrusted: event.isTrusted,
35
- preventDefault: preventDefault,
36
- isDefaultPrevented: function isDefaultPrevented() {
37
- return _isDefaultPrevented;
38
- },
39
- stopPropagation: stopPropagation,
40
- isPropagationStopped: function isPropagationStopped() {
41
- return _isPropagationStopped;
42
- },
43
- persist: function persist() {},
44
- timeStamp: event.timeStamp,
45
- type: event.type
46
- };
47
- };
@@ -1 +0,0 @@
1
- .b1e1wuvi.badge-clear{color:var(--plasma-badge-color-clear);background-color:transparent;padding:0;}
@@ -1 +0,0 @@
1
- .binquhc.badge-transparent{color:var(--plasma-badge-color-transparent);background-color:var(--plasma-badge-background-transparent);}
@@ -1 +0,0 @@
1
- .b5zny0e{color:var(--plasma-badge-color);background-color:var(--plasma-badge-background);}
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
-
3
- var boundCombobox = function boundCombobox(_ref) {
4
- var ComboboxBase = _ref.base,
5
- ComboboxBaseForm = _ref.baseForm;
6
- return function (rest) {
7
- if (rest.formType) {
8
- return /*#__PURE__*/React.createElement(ComboboxBaseForm, rest);
9
- }
10
- if (!rest.formType) {
11
- return /*#__PURE__*/React.createElement(ComboboxBase, rest);
12
- }
13
- return null;
14
- };
15
- };
16
-
17
- export { boundCombobox };
18
- //# sourceMappingURL=Combobox.boundler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Combobox.boundler.js","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.boundler.tsx"],"sourcesContent":["import React from 'react';\n\nimport { ComboboxBoundlerProps, ComboboxBoundlerPropsComponent } from './Combobox.types';\n\nexport const boundCombobox: (args: ComboboxBoundlerProps) => React.FC<ComboboxBoundlerPropsComponent> = ({\n base: ComboboxBase,\n baseForm: ComboboxBaseForm,\n}) => (rest) => {\n if (rest.formType) {\n return <ComboboxBaseForm {...rest} />;\n }\n\n if (!rest.formType) {\n return <ComboboxBase {...rest} />;\n }\n\n return null;\n};\n"],"names":["boundCombobox","_ref","ComboboxBase","base","ComboboxBaseForm","baseForm","rest","formType","React","createElement"],"mappings":";;IAIaA,aAAwF,GAAG,SAA3FA,aAAwFA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3FC,YAAY,GAAAD,IAAA,CAAlBE,IAAI;IACMC,gBAAgB,GAAAH,IAAA,CAA1BI,QAAQ,CAAA;EAAA,OACN,UAACC,IAAI,EAAK;IACZ,IAAIA,IAAI,CAACC,QAAQ,EAAE;AACf,MAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACL,gBAAgB,EAAKE,IAAO,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,IAAI,CAACA,IAAI,CAACC,QAAQ,EAAE;AAChB,MAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACP,YAAY,EAAKI,IAAO,CAAC,CAAA;AACrC,KAAA;AAEA,IAAA,OAAO,IAAI,CAAA;GACd,CAAA;AAAA;;;;"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.boundCombobox = void 0;
7
- var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- var boundCombobox = exports.boundCombobox = function boundCombobox(_ref) {
10
- var ComboboxBase = _ref.base,
11
- ComboboxBaseForm = _ref.baseForm;
12
- return function (rest) {
13
- if (rest.formType) {
14
- return /*#__PURE__*/_react["default"].createElement(ComboboxBaseForm, rest);
15
- }
16
- if (!rest.formType) {
17
- return /*#__PURE__*/_react["default"].createElement(ComboboxBase, rest);
18
- }
19
- return null;
20
- };
21
- };
@@ -1,90 +0,0 @@
1
- "use strict";
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
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getFormComponentGenerator = void 0;
8
- var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
- var _syntheticEvent = /*#__PURE__*/require("./syntheticEvent");
10
- var _excluded = ["onChange", "component"],
11
- _excluded2 = ["onChange", "component"]; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
- // @ts-nocheck
13
- 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); }
14
- 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; }
15
- 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); }
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
- 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); }
19
- 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; }
20
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
- var SingleForm = function SingleForm(args) {
25
- var onChange = args.onChange,
26
- Component = args.component,
27
- rest = _objectWithoutProperties(args, _excluded);
28
- var _useState = (0, _react.useState)(),
29
- _useState2 = _slicedToArray(_useState, 2),
30
- value = _useState2[0],
31
- setValue = _useState2[1];
32
- var selectRef = (0, _react.useRef)(null);
33
- var handleChange = function handleChange(value) {
34
- setValue(value);
35
- };
36
- (0, _react.useEffect)(function () {
37
- var event = (0, _syntheticEvent.createEvent)(selectRef);
38
- onChange && onChange(event);
39
- }, [value]);
40
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("select", {
41
- ref: selectRef,
42
- value: value,
43
- hidden: true
44
- }, /*#__PURE__*/_react["default"].createElement("option", {
45
- value: value
46
- }, value)), /*#__PURE__*/_react["default"].createElement(Component, _extends({}, rest, {
47
- value: value,
48
- onChange: handleChange
49
- })));
50
- };
51
- var MultipleForm = function MultipleForm(args) {
52
- var onChange = args.onChange,
53
- Component = args.component,
54
- rest = _objectWithoutProperties(args, _excluded2);
55
- var _useState3 = (0, _react.useState)([]),
56
- _useState4 = _slicedToArray(_useState3, 2),
57
- values = _useState4[0],
58
- setValues = _useState4[1];
59
- var selectRef = (0, _react.useRef)(null);
60
- var handleChange = function handleChange(value) {
61
- setValues(value);
62
- };
63
- (0, _react.useEffect)(function () {
64
- var event = (0, _syntheticEvent.createEvent)(selectRef);
65
- onChange && onChange(event);
66
- }, [values]);
67
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("select", {
68
- ref: selectRef,
69
- value: values,
70
- multiple: true,
71
- hidden: true
72
- }, values.map(function (value) {
73
- return /*#__PURE__*/_react["default"].createElement("option", {
74
- key: value,
75
- value: value
76
- }, value);
77
- })), /*#__PURE__*/_react["default"].createElement(Component, _extends({}, rest, {
78
- value: values,
79
- onChange: handleChange
80
- })));
81
- };
82
- var getFormComponentGenerator = exports.getFormComponentGenerator = function getFormComponentGenerator(Component) {
83
- return function (args) {
84
- return args.multiple ? /*#__PURE__*/_react["default"].createElement(MultipleForm, _extends({}, args, {
85
- component: Component
86
- })) : /*#__PURE__*/_react["default"].createElement(SingleForm, _extends({}, args, {
87
- component: Component
88
- }));
89
- };
90
- };
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createSyntheticEvent = exports.createEvent = void 0;
7
- var createEvent = exports.createEvent = function createEvent(ref) {
8
- if (ref.current) {
9
- var event = new Event('change', {
10
- bubbles: true
11
- });
12
- Object.defineProperty(event, 'target', {
13
- writable: false,
14
- value: ref.current
15
- });
16
- var syntheticEvent = createSyntheticEvent(event);
17
- return syntheticEvent;
18
- }
19
- return null;
20
- };
21
- var createSyntheticEvent = exports.createSyntheticEvent = function createSyntheticEvent(event) {
22
- var _isDefaultPrevented = false;
23
- var _isPropagationStopped = false;
24
- var preventDefault = function preventDefault() {
25
- _isDefaultPrevented = true;
26
- event.preventDefault();
27
- };
28
- var stopPropagation = function stopPropagation() {
29
- _isPropagationStopped = true;
30
- event.stopPropagation();
31
- };
32
- return {
33
- nativeEvent: event,
34
- currentTarget: event.currentTarget,
35
- target: event.target,
36
- bubbles: event.bubbles,
37
- cancelable: event.cancelable,
38
- defaultPrevented: event.defaultPrevented,
39
- eventPhase: event.eventPhase,
40
- isTrusted: event.isTrusted,
41
- preventDefault: preventDefault,
42
- isDefaultPrevented: function isDefaultPrevented() {
43
- return _isDefaultPrevented;
44
- },
45
- stopPropagation: stopPropagation,
46
- isPropagationStopped: function isPropagationStopped() {
47
- return _isPropagationStopped;
48
- },
49
- persist: function persist() {},
50
- timeStamp: event.timeStamp,
51
- type: event.type
52
- };
53
- };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- export var boundCombobox = function boundCombobox(_ref) {
3
- var ComboboxBase = _ref.base,
4
- ComboboxBaseForm = _ref.baseForm;
5
- return function (rest) {
6
- if (rest.formType) {
7
- return /*#__PURE__*/React.createElement(ComboboxBaseForm, rest);
8
- }
9
- if (!rest.formType) {
10
- return /*#__PURE__*/React.createElement(ComboboxBase, rest);
11
- }
12
- return null;
13
- };
14
- };
@@ -1,83 +0,0 @@
1
- var _excluded = ["onChange", "component"],
2
- _excluded2 = ["onChange", "component"];
3
- 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); }
4
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- 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); }
7
- 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; }
8
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
- // @ts-nocheck
14
-
15
- import React, { useEffect, useRef, useState } from 'react';
16
- import { createEvent } from './syntheticEvent';
17
- var SingleForm = function SingleForm(args) {
18
- var onChange = args.onChange,
19
- Component = args.component,
20
- rest = _objectWithoutProperties(args, _excluded);
21
- var _useState = useState(),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- value = _useState2[0],
24
- setValue = _useState2[1];
25
- var selectRef = useRef(null);
26
- var handleChange = function handleChange(value) {
27
- setValue(value);
28
- };
29
- useEffect(function () {
30
- var event = createEvent(selectRef);
31
- onChange && onChange(event);
32
- }, [value]);
33
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("select", {
34
- ref: selectRef,
35
- value: value,
36
- hidden: true
37
- }, /*#__PURE__*/React.createElement("option", {
38
- value: value
39
- }, value)), /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
40
- value: value,
41
- onChange: handleChange
42
- })));
43
- };
44
- var MultipleForm = function MultipleForm(args) {
45
- var onChange = args.onChange,
46
- Component = args.component,
47
- rest = _objectWithoutProperties(args, _excluded2);
48
- var _useState3 = useState([]),
49
- _useState4 = _slicedToArray(_useState3, 2),
50
- values = _useState4[0],
51
- setValues = _useState4[1];
52
- var selectRef = useRef(null);
53
- var handleChange = function handleChange(value) {
54
- setValues(value);
55
- };
56
- useEffect(function () {
57
- var event = createEvent(selectRef);
58
- onChange && onChange(event);
59
- }, [values]);
60
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("select", {
61
- ref: selectRef,
62
- value: values,
63
- multiple: true,
64
- hidden: true
65
- }, values.map(function (value) {
66
- return /*#__PURE__*/React.createElement("option", {
67
- key: value,
68
- value: value
69
- }, value);
70
- })), /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
71
- value: values,
72
- onChange: handleChange
73
- })));
74
- };
75
- export var getFormComponentGenerator = function getFormComponentGenerator(Component) {
76
- return function (args) {
77
- return args.multiple ? /*#__PURE__*/React.createElement(MultipleForm, _extends({}, args, {
78
- component: Component
79
- })) : /*#__PURE__*/React.createElement(SingleForm, _extends({}, args, {
80
- component: Component
81
- }));
82
- };
83
- };
@@ -1,47 +0,0 @@
1
- export var createEvent = function createEvent(ref) {
2
- if (ref.current) {
3
- var event = new Event('change', {
4
- bubbles: true
5
- });
6
- Object.defineProperty(event, 'target', {
7
- writable: false,
8
- value: ref.current
9
- });
10
- var syntheticEvent = createSyntheticEvent(event);
11
- return syntheticEvent;
12
- }
13
- return null;
14
- };
15
- export var createSyntheticEvent = function createSyntheticEvent(event) {
16
- var _isDefaultPrevented = false;
17
- var _isPropagationStopped = false;
18
- var preventDefault = function preventDefault() {
19
- _isDefaultPrevented = true;
20
- event.preventDefault();
21
- };
22
- var stopPropagation = function stopPropagation() {
23
- _isPropagationStopped = true;
24
- event.stopPropagation();
25
- };
26
- return {
27
- nativeEvent: event,
28
- currentTarget: event.currentTarget,
29
- target: event.target,
30
- bubbles: event.bubbles,
31
- cancelable: event.cancelable,
32
- defaultPrevented: event.defaultPrevented,
33
- eventPhase: event.eventPhase,
34
- isTrusted: event.isTrusted,
35
- preventDefault: preventDefault,
36
- isDefaultPrevented: function isDefaultPrevented() {
37
- return _isDefaultPrevented;
38
- },
39
- stopPropagation: stopPropagation,
40
- isPropagationStopped: function isPropagationStopped() {
41
- return _isPropagationStopped;
42
- },
43
- persist: function persist() {},
44
- timeStamp: event.timeStamp,
45
- type: event.type
46
- };
47
- };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { ComboboxBoundlerProps, ComboboxBoundlerPropsComponent } from './Combobox.types';
3
- export declare const boundCombobox: (args: ComboboxBoundlerProps) => React.FC<ComboboxBoundlerPropsComponent>;
4
- //# sourceMappingURL=Combobox.boundler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Combobox.boundler.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.boundler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAEzF,eAAO,MAAM,aAAa,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAanG,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ComponentType } from 'react';
2
- import { ComboboxFormProps } from '../Combobox.types';
3
- export declare const getFormComponentGenerator: (Component: ComponentType<ModifiedComboboxProps>) => (args: ComboboxFormProps) => JSX.Element;
4
- //# sourceMappingURL=getForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ComboboxNew/utils/getForm.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,aAAa,EAA+B,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA4DrE,eAAO,MAAM,yBAAyB,cAAe,cAAc,qBAAqB,CAAC,YACvE,iBAAiB,gBAOlC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { RefObject } from 'react';
2
- export declare const createEvent: (ref: RefObject<HTMLSelectElement>) => import("react").ChangeEvent<HTMLSelectElement> | null;
3
- export declare const createSyntheticEvent: <T extends Element, E extends Event>(event: E) => import("react").SyntheticEvent<T, E>;
4
- //# sourceMappingURL=syntheticEvent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syntheticEvent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ComboboxNew/utils/syntheticEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,WAAW,QAAS,UAAU,iBAAiB,CAAC,0DAS5D,CAAC;AAEF,eAAO,MAAM,oBAAoB,wFA4BhC,CAAC"}