@salutejs/plasma-new-hope 0.188.0-canary.1552.11776095169.0 → 0.188.0-canary.1553.11776288397.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +0 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +6 -31
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +0 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +0 -2
- package/cjs/index.css +0 -2
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +7 -32
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +2 -5
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +7 -33
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +2 -5
- package/es/components/Combobox/ComboboxNew/Combobox.css +0 -2
- package/es/components/Combobox/ComboboxNew/Combobox.js +8 -33
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +0 -2
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +0 -2
- package/es/index.css +0 -2
- package/package.json +4 -4
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +7 -32
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +2 -5
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +7 -33
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +2 -5
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts +2 -2
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +2 -40
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +120 -1080
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +120 -1080
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Form/Form.css +0 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Form/Form.js +0 -37
- package/cjs/components/Combobox/ComboboxNew/ui/Form/Form.js.map +0 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Form/Form.styles.js +0 -15
- package/cjs/components/Combobox/ComboboxNew/ui/Form/Form.styles.js.map +0 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Form/Form.styles_22v2s5.css +0 -1
- package/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -55
- package/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js.map +0 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Form/Form.js +0 -38
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Form/Form.styles.js +0 -13
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -53
- package/emotion/es/components/Combobox/ComboboxNew/ui/Form/Form.js +0 -29
- package/emotion/es/components/Combobox/ComboboxNew/ui/Form/Form.styles.js +0 -6
- package/emotion/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -47
- package/es/components/Combobox/ComboboxNew/ui/Form/Form.css +0 -1
- package/es/components/Combobox/ComboboxNew/ui/Form/Form.js +0 -33
- package/es/components/Combobox/ComboboxNew/ui/Form/Form.js.map +0 -1
- package/es/components/Combobox/ComboboxNew/ui/Form/Form.styles.js +0 -11
- package/es/components/Combobox/ComboboxNew/ui/Form/Form.styles.js.map +0 -1
- package/es/components/Combobox/ComboboxNew/ui/Form/Form.styles_22v2s5.css +0 -1
- package/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -50
- package/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js.map +0 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Form/Form.js +0 -38
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Form/Form.styles.js +0 -12
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -53
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Form/Form.js +0 -29
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Form/Form.styles.js +0 -5
- package/styled-components/es/components/Combobox/ComboboxNew/utils/syntheticEvent.js +0 -47
- package/types/components/Combobox/ComboboxNew/ui/Form/Form.d.ts +0 -6
- package/types/components/Combobox/ComboboxNew/ui/Form/Form.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/ui/Form/Form.styles.d.ts +0 -3
- package/types/components/Combobox/ComboboxNew/ui/Form/Form.styles.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/utils/syntheticEvent.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/utils/syntheticEvent.d.ts.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Combobox/Combobox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIxE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,QAAA,MAAM,iBAAiB
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Combobox/Combobox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIxE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2IAA0B,CAAC;AAElD,aAAK,eAAe,GAAG,MAAM,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC;AAEzD,aAAK,QAAQ,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,GACzE,IAAI,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,EAAE,eAAe,CAAC,CAAC;AAEpE,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAET,YAAY,GAAG,IAAI,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.Form_styles_22v2s5_sngk5la__4621e773{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var React = require('react');
|
6
|
-
var plasmaCore = require('@salutejs/plasma-core');
|
7
|
-
var syntheticEvent = require('../../utils/syntheticEvent.js');
|
8
|
-
var Form_styles = require('./Form.styles.js');
|
9
|
-
|
10
|
-
var Form = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
11
|
-
var name = _ref.name,
|
12
|
-
multiple = _ref.multiple,
|
13
|
-
value = _ref.value,
|
14
|
-
onChange = _ref.onChange;
|
15
|
-
var values = multiple ? value : [value];
|
16
|
-
var selectRef = React.useRef(null);
|
17
|
-
var forkRef = plasmaCore.useForkRef(selectRef, ref);
|
18
|
-
React.useEffect(function () {
|
19
|
-
var event = syntheticEvent.createEvent(selectRef);
|
20
|
-
onChange && onChange(event);
|
21
|
-
}, [values]);
|
22
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form_styles.SelectHidden, {
|
23
|
-
ref: forkRef,
|
24
|
-
multiple: multiple,
|
25
|
-
name: name,
|
26
|
-
hidden: true,
|
27
|
-
value: multiple ? values : values[0]
|
28
|
-
}, values.map(function (v) {
|
29
|
-
return /*#__PURE__*/React.createElement("option", {
|
30
|
-
key: v,
|
31
|
-
value: v
|
32
|
-
}, v);
|
33
|
-
})));
|
34
|
-
});
|
35
|
-
|
36
|
-
exports.Form = Form;
|
37
|
-
//# sourceMappingURL=Form.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../../src/components/Combobox/ComboboxNew/ui/Form/Form.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { createEvent } from '../../utils/syntheticEvent';\nimport { ComboboxProps } from '../../Combobox.types';\n\nimport { SelectHidden } from './Form.styles';\n\ntype Props = Pick<ComboboxProps, 'name' | 'value' | 'multiple'> & {\n onChange: (value: React.ChangeEvent<HTMLSelectElement> | null) => void;\n};\n\nexport const Form = forwardRef<HTMLSelectElement, Props>(({ name, multiple, value, onChange }, ref) => {\n const values = (multiple ? value : [value]) as string[];\n const selectRef = useRef<HTMLSelectElement | null>(null);\n const forkRef = useForkRef(selectRef, ref);\n\n useEffect(() => {\n const event = createEvent(selectRef);\n onChange && onChange(event);\n }, [values]);\n return (\n <>\n <SelectHidden ref={forkRef} multiple={multiple} name={name} hidden value={multiple ? values : values[0]}>\n {values.map((v) => (\n <option key={v} value={v}>\n {v}\n </option>\n ))}\n </SelectHidden>\n </>\n );\n});\n"],"names":["Form","forwardRef","_ref","ref","name","multiple","value","onChange","values","selectRef","useRef","forkRef","useForkRef","useEffect","event","createEvent","React","createElement","Fragment","SelectHidden","hidden","map","v","key"],"mappings":";;;;;;;;;AAYO,IAAMA,IAAI,gBAAGC,gBAAU,CAA2B,UAAAC,IAAA,EAAsCC,GAAG,EAAK;AAAA,EAAA,IAA3CC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ,CAAA;EACvF,IAAMC,MAAM,GAAIH,QAAQ,GAAGC,KAAK,GAAG,CAACA,KAAK,CAAc,CAAA;AACvD,EAAA,IAAMG,SAAS,GAAGC,YAAM,CAA2B,IAAI,CAAC,CAAA;AACxD,EAAA,IAAMC,OAAO,GAAGC,qBAAU,CAACH,SAAS,EAAEN,GAAG,CAAC,CAAA;AAE1CU,EAAAA,eAAS,CAAC,YAAM;AACZ,IAAA,IAAMC,KAAK,GAAGC,0BAAW,CAACN,SAAS,CAAC,CAAA;AACpCF,IAAAA,QAAQ,IAAIA,QAAQ,CAACO,KAAK,CAAC,CAAA;AAC/B,GAAC,EAAE,CAACN,MAAM,CAAC,CAAC,CAAA;AACZ,EAAA,oBACIQ,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EAAA,IAAA,eACIF,KAAA,CAAAC,aAAA,CAACE,wBAAY,EAAA;AAAChB,IAAAA,GAAG,EAAEQ,OAAQ;AAACN,IAAAA,QAAQ,EAAEA,QAAS;AAACD,IAAAA,IAAI,EAAEA,IAAK;IAACgB,MAAM,EAAA,IAAA;AAACd,IAAAA,KAAK,EAAED,QAAQ,GAAGG,MAAM,GAAGA,MAAM,CAAC,CAAC,CAAA;AAAE,GAAA,EACnGA,MAAM,CAACa,GAAG,CAAC,UAACC,CAAC,EAAA;IAAA,oBACVN,KAAA,CAAAC,aAAA,CAAA,QAAA,EAAA;AAAQM,MAAAA,GAAG,EAAED,CAAE;AAAChB,MAAAA,KAAK,EAAEgB,CAAAA;AAAE,KAAA,EACpBA,CACG,CAAC,CAAA;GACZ,CACS,CAChB,CAAC,CAAA;AAEX,CAAC;;;;"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import './Form.styles_22v2s5.css';
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
5
|
-
|
6
|
-
var react = require('@linaria/react');
|
7
|
-
|
8
|
-
var SelectHidden = /*#__PURE__*/react.styled('select')({
|
9
|
-
name: "SelectHidden",
|
10
|
-
"class": "sngk5la",
|
11
|
-
propsAsIs: false
|
12
|
-
});
|
13
|
-
|
14
|
-
exports.SelectHidden = SelectHidden;
|
15
|
-
//# sourceMappingURL=Form.styles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Form.styles.js","sources":["../../../../../../src/components/Combobox/ComboboxNew/ui/Form/Form.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { applyHidden } from '../../../../../mixins';\n\nexport const SelectHidden = styled.select`\n ${applyHidden()};\n`;\n"],"names":["SelectHidden","styled","name","class","propsAsIs"],"mappings":";;;;;;AAIO,IAAMA,YAAY,gBAAGC,YAAM,CAAA,QAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,cAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEjC;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.sngk5la{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var createEvent = function createEvent(ref) {
|
6
|
-
if (ref.current) {
|
7
|
-
var event = new Event('change', {
|
8
|
-
bubbles: true
|
9
|
-
});
|
10
|
-
Object.defineProperty(event, 'target', {
|
11
|
-
writable: false,
|
12
|
-
value: ref.current
|
13
|
-
});
|
14
|
-
var syntheticEvent = createSyntheticEvent(event);
|
15
|
-
return syntheticEvent;
|
16
|
-
}
|
17
|
-
return null;
|
18
|
-
};
|
19
|
-
var createSyntheticEvent = function createSyntheticEvent(event) {
|
20
|
-
var _isDefaultPrevented = false;
|
21
|
-
var _isPropagationStopped = false;
|
22
|
-
var preventDefault = function preventDefault() {
|
23
|
-
_isDefaultPrevented = true;
|
24
|
-
event.preventDefault();
|
25
|
-
};
|
26
|
-
var stopPropagation = function stopPropagation() {
|
27
|
-
_isPropagationStopped = true;
|
28
|
-
event.stopPropagation();
|
29
|
-
};
|
30
|
-
return {
|
31
|
-
nativeEvent: event,
|
32
|
-
currentTarget: event.currentTarget,
|
33
|
-
target: event.target,
|
34
|
-
bubbles: event.bubbles,
|
35
|
-
cancelable: event.cancelable,
|
36
|
-
defaultPrevented: event.defaultPrevented,
|
37
|
-
eventPhase: event.eventPhase,
|
38
|
-
isTrusted: event.isTrusted,
|
39
|
-
preventDefault: preventDefault,
|
40
|
-
isDefaultPrevented: function isDefaultPrevented() {
|
41
|
-
return _isDefaultPrevented;
|
42
|
-
},
|
43
|
-
stopPropagation: stopPropagation,
|
44
|
-
isPropagationStopped: function isPropagationStopped() {
|
45
|
-
return _isPropagationStopped;
|
46
|
-
},
|
47
|
-
persist: function persist() {},
|
48
|
-
timeStamp: event.timeStamp,
|
49
|
-
type: event.type
|
50
|
-
};
|
51
|
-
};
|
52
|
-
|
53
|
-
exports.createEvent = createEvent;
|
54
|
-
exports.createSyntheticEvent = createSyntheticEvent;
|
55
|
-
//# sourceMappingURL=syntheticEvent.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"syntheticEvent.js","sources":["../../../../../src/components/Combobox/ComboboxNew/utils/syntheticEvent.ts"],"sourcesContent":["import { RefObject } from 'react';\n\nexport const createEvent = (ref: RefObject<HTMLSelectElement>) => {\n if (ref.current) {\n const event = new Event('change', { bubbles: true });\n Object.defineProperty(event, 'target', { writable: false, value: ref.current });\n const syntheticEvent = createSyntheticEvent(event) as React.ChangeEvent<typeof ref.current>;\n return syntheticEvent;\n }\n\n return null;\n};\n\nexport const createSyntheticEvent = <T extends Element, E extends Event>(event: E): React.SyntheticEvent<T, E> => {\n let isDefaultPrevented = false;\n let isPropagationStopped = false;\n const preventDefault = () => {\n isDefaultPrevented = true;\n event.preventDefault();\n };\n const stopPropagation = () => {\n isPropagationStopped = true;\n event.stopPropagation();\n };\n return {\n nativeEvent: event,\n currentTarget: event.currentTarget as EventTarget & T,\n target: event.target as EventTarget & T,\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n defaultPrevented: event.defaultPrevented,\n eventPhase: event.eventPhase,\n isTrusted: event.isTrusted,\n preventDefault,\n isDefaultPrevented: () => isDefaultPrevented,\n stopPropagation,\n isPropagationStopped: () => isPropagationStopped,\n persist: () => {},\n timeStamp: event.timeStamp,\n type: event.type,\n };\n};\n"],"names":["createEvent","ref","current","event","Event","bubbles","Object","defineProperty","writable","value","syntheticEvent","createSyntheticEvent","isDefaultPrevented","isPropagationStopped","preventDefault","stopPropagation","nativeEvent","currentTarget","target","cancelable","defaultPrevented","eventPhase","isTrusted","persist","timeStamp","type"],"mappings":";;;;IAEaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,GAAiC,EAAK;EAC9D,IAAIA,GAAG,CAACC,OAAO,EAAE;AACb,IAAA,IAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC,QAAQ,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;AACpDC,IAAAA,MAAM,CAACC,cAAc,CAACJ,KAAK,EAAE,QAAQ,EAAE;AAAEK,MAAAA,QAAQ,EAAE,KAAK;MAAEC,KAAK,EAAER,GAAG,CAACC,OAAAA;AAAQ,KAAC,CAAC,CAAA;AAC/E,IAAA,IAAMQ,cAAc,GAAGC,oBAAoB,CAACR,KAAK,CAA0C,CAAA;AAC3F,IAAA,OAAOO,cAAc,CAAA;AACzB,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACf,EAAC;IAEYC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAwCR,KAAQ,EAAiC;EAC9G,IAAIS,mBAAkB,GAAG,KAAK,CAAA;EAC9B,IAAIC,qBAAoB,GAAG,KAAK,CAAA;AAChC,EAAA,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,GAAS;AACzBF,IAAAA,mBAAkB,GAAG,IAAI,CAAA;IACzBT,KAAK,CAACW,cAAc,EAAE,CAAA;GACzB,CAAA;AACD,EAAA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,GAAS;AAC1BF,IAAAA,qBAAoB,GAAG,IAAI,CAAA;IAC3BV,KAAK,CAACY,eAAe,EAAE,CAAA;GAC1B,CAAA;EACD,OAAO;AACHC,IAAAA,WAAW,EAAEb,KAAK;IAClBc,aAAa,EAAEd,KAAK,CAACc,aAAgC;IACrDC,MAAM,EAAEf,KAAK,CAACe,MAAyB;IACvCb,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBc,UAAU,EAAEhB,KAAK,CAACgB,UAAU;IAC5BC,gBAAgB,EAAEjB,KAAK,CAACiB,gBAAgB;IACxCC,UAAU,EAAElB,KAAK,CAACkB,UAAU;IAC5BC,SAAS,EAAEnB,KAAK,CAACmB,SAAS;AAC1BR,IAAAA,cAAc,EAAdA,cAAc;IACdF,kBAAkB,EAAE,SAAAA,kBAAA,GAAA;AAAA,MAAA,OAAMA,mBAAkB,CAAA;AAAA,KAAA;AAC5CG,IAAAA,eAAe,EAAfA,eAAe;IACfF,oBAAoB,EAAE,SAAAA,oBAAA,GAAA;AAAA,MAAA,OAAMA,qBAAoB,CAAA;AAAA,KAAA;AAChDU,IAAAA,OAAO,EAAE,SAAAA,OAAA,GAAM,EAAE;IACjBC,SAAS,EAAErB,KAAK,CAACqB,SAAS;IAC1BC,IAAI,EAAEtB,KAAK,CAACsB,IAAAA;GACf,CAAA;AACL;;;;;"}
|
@@ -1,38 +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.Form = void 0;
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
|
-
var _syntheticEvent = /*#__PURE__*/require("../../utils/syntheticEvent");
|
11
|
-
var _Form = /*#__PURE__*/require("./Form.styles");
|
12
|
-
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); }
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
14
|
-
var Form = exports.Form = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
15
|
-
var name = _ref.name,
|
16
|
-
multiple = _ref.multiple,
|
17
|
-
value = _ref.value,
|
18
|
-
onChange = _ref.onChange;
|
19
|
-
var values = multiple ? value : [value];
|
20
|
-
var selectRef = (0, _react.useRef)(null);
|
21
|
-
var forkRef = (0, _plasmaCore.useForkRef)(selectRef, ref);
|
22
|
-
(0, _react.useEffect)(function () {
|
23
|
-
var event = (0, _syntheticEvent.createEvent)(selectRef);
|
24
|
-
onChange && onChange(event);
|
25
|
-
}, [values]);
|
26
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Form.SelectHidden, {
|
27
|
-
ref: forkRef,
|
28
|
-
multiple: multiple,
|
29
|
-
name: name,
|
30
|
-
hidden: true,
|
31
|
-
value: multiple ? values : values[0]
|
32
|
-
}, values.map(function (v) {
|
33
|
-
return /*#__PURE__*/_react["default"].createElement("option", {
|
34
|
-
key: v,
|
35
|
-
value: v
|
36
|
-
}, v);
|
37
|
-
})));
|
38
|
-
});
|
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.SelectHidden = void 0;
|
7
|
-
var _base = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("@emotion/styled/base"));
|
8
|
-
var _mixins = /*#__PURE__*/require("../../../../../mixins");
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
var SelectHidden = exports.SelectHidden = /*#__PURE__*/(0, _base["default"])("select", {
|
11
|
-
target: "e10p9ksh0",
|
12
|
-
label: "plasma-new-hope__SelectHidden"
|
13
|
-
})( /*#__PURE__*/(0, _mixins.applyHidden)(), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQ29tYm9ib3gvQ29tYm9ib3hOZXcvdWkvRm9ybS9Gb3JtLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJeUMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9Db21ib2JveC9Db21ib2JveE5ldy91aS9Gb3JtL0Zvcm0uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBhcHBseUhpZGRlbiB9IGZyb20gJy4uLy4uLy4uLy4uLy4uL21peGlucyc7XG5cbmV4cG9ydCBjb25zdCBTZWxlY3RIaWRkZW4gPSBzdHlsZWQuc2VsZWN0YFxuICAgICR7YXBwbHlIaWRkZW4oKX07XG5gO1xuIl19 */"));
|
@@ -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,29 +0,0 @@
|
|
1
|
-
import React, { forwardRef, useEffect, useRef } from 'react';
|
2
|
-
import { useForkRef } from '@salutejs/plasma-core';
|
3
|
-
import { createEvent } from '../../utils/syntheticEvent';
|
4
|
-
import { SelectHidden } from './Form.styles';
|
5
|
-
export var Form = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
6
|
-
var name = _ref.name,
|
7
|
-
multiple = _ref.multiple,
|
8
|
-
value = _ref.value,
|
9
|
-
onChange = _ref.onChange;
|
10
|
-
var values = multiple ? value : [value];
|
11
|
-
var selectRef = useRef(null);
|
12
|
-
var forkRef = useForkRef(selectRef, ref);
|
13
|
-
useEffect(function () {
|
14
|
-
var event = createEvent(selectRef);
|
15
|
-
onChange && onChange(event);
|
16
|
-
}, [values]);
|
17
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SelectHidden, {
|
18
|
-
ref: forkRef,
|
19
|
-
multiple: multiple,
|
20
|
-
name: name,
|
21
|
-
hidden: true,
|
22
|
-
value: multiple ? values : values[0]
|
23
|
-
}, values.map(function (v) {
|
24
|
-
return /*#__PURE__*/React.createElement("option", {
|
25
|
-
key: v,
|
26
|
-
value: v
|
27
|
-
}, v);
|
28
|
-
})));
|
29
|
-
});
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
2
|
-
import { applyHidden } from '../../../../../mixins';
|
3
|
-
export var SelectHidden = /*#__PURE__*/_styled("select", {
|
4
|
-
target: "e10p9ksh0",
|
5
|
-
label: "plasma-new-hope__SelectHidden"
|
6
|
-
})( /*#__PURE__*/applyHidden(), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQ29tYm9ib3gvQ29tYm9ib3hOZXcvdWkvRm9ybS9Gb3JtLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJeUMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9Db21ib2JveC9Db21ib2JveE5ldy91aS9Gb3JtL0Zvcm0uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBhcHBseUhpZGRlbiB9IGZyb20gJy4uLy4uLy4uLy4uLy4uL21peGlucyc7XG5cbmV4cG9ydCBjb25zdCBTZWxlY3RIaWRkZW4gPSBzdHlsZWQuc2VsZWN0YFxuICAgICR7YXBwbHlIaWRkZW4oKX07XG5gO1xuIl19 */"));
|
@@ -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
|
-
.Form_styles_22v2s5_sngk5la__4621e773{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import React, { forwardRef, useRef, useEffect } from 'react';
|
2
|
-
import { useForkRef } from '@salutejs/plasma-core';
|
3
|
-
import { createEvent } from '../../utils/syntheticEvent.js';
|
4
|
-
import { SelectHidden } from './Form.styles.js';
|
5
|
-
|
6
|
-
var Form = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
7
|
-
var name = _ref.name,
|
8
|
-
multiple = _ref.multiple,
|
9
|
-
value = _ref.value,
|
10
|
-
onChange = _ref.onChange;
|
11
|
-
var values = multiple ? value : [value];
|
12
|
-
var selectRef = useRef(null);
|
13
|
-
var forkRef = useForkRef(selectRef, ref);
|
14
|
-
useEffect(function () {
|
15
|
-
var event = createEvent(selectRef);
|
16
|
-
onChange && onChange(event);
|
17
|
-
}, [values]);
|
18
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SelectHidden, {
|
19
|
-
ref: forkRef,
|
20
|
-
multiple: multiple,
|
21
|
-
name: name,
|
22
|
-
hidden: true,
|
23
|
-
value: multiple ? values : values[0]
|
24
|
-
}, values.map(function (v) {
|
25
|
-
return /*#__PURE__*/React.createElement("option", {
|
26
|
-
key: v,
|
27
|
-
value: v
|
28
|
-
}, v);
|
29
|
-
})));
|
30
|
-
});
|
31
|
-
|
32
|
-
export { Form };
|
33
|
-
//# sourceMappingURL=Form.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../../src/components/Combobox/ComboboxNew/ui/Form/Form.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { createEvent } from '../../utils/syntheticEvent';\nimport { ComboboxProps } from '../../Combobox.types';\n\nimport { SelectHidden } from './Form.styles';\n\ntype Props = Pick<ComboboxProps, 'name' | 'value' | 'multiple'> & {\n onChange: (value: React.ChangeEvent<HTMLSelectElement> | null) => void;\n};\n\nexport const Form = forwardRef<HTMLSelectElement, Props>(({ name, multiple, value, onChange }, ref) => {\n const values = (multiple ? value : [value]) as string[];\n const selectRef = useRef<HTMLSelectElement | null>(null);\n const forkRef = useForkRef(selectRef, ref);\n\n useEffect(() => {\n const event = createEvent(selectRef);\n onChange && onChange(event);\n }, [values]);\n return (\n <>\n <SelectHidden ref={forkRef} multiple={multiple} name={name} hidden value={multiple ? values : values[0]}>\n {values.map((v) => (\n <option key={v} value={v}>\n {v}\n </option>\n ))}\n </SelectHidden>\n </>\n );\n});\n"],"names":["Form","forwardRef","_ref","ref","name","multiple","value","onChange","values","selectRef","useRef","forkRef","useForkRef","useEffect","event","createEvent","React","createElement","Fragment","SelectHidden","hidden","map","v","key"],"mappings":";;;;;AAYO,IAAMA,IAAI,gBAAGC,UAAU,CAA2B,UAAAC,IAAA,EAAsCC,GAAG,EAAK;AAAA,EAAA,IAA3CC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ,CAAA;EACvF,IAAMC,MAAM,GAAIH,QAAQ,GAAGC,KAAK,GAAG,CAACA,KAAK,CAAc,CAAA;AACvD,EAAA,IAAMG,SAAS,GAAGC,MAAM,CAA2B,IAAI,CAAC,CAAA;AACxD,EAAA,IAAMC,OAAO,GAAGC,UAAU,CAACH,SAAS,EAAEN,GAAG,CAAC,CAAA;AAE1CU,EAAAA,SAAS,CAAC,YAAM;AACZ,IAAA,IAAMC,KAAK,GAAGC,WAAW,CAACN,SAAS,CAAC,CAAA;AACpCF,IAAAA,QAAQ,IAAIA,QAAQ,CAACO,KAAK,CAAC,CAAA;AAC/B,GAAC,EAAE,CAACN,MAAM,CAAC,CAAC,CAAA;AACZ,EAAA,oBACIQ,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EAAA,IAAA,eACIF,KAAA,CAAAC,aAAA,CAACE,YAAY,EAAA;AAAChB,IAAAA,GAAG,EAAEQ,OAAQ;AAACN,IAAAA,QAAQ,EAAEA,QAAS;AAACD,IAAAA,IAAI,EAAEA,IAAK;IAACgB,MAAM,EAAA,IAAA;AAACd,IAAAA,KAAK,EAAED,QAAQ,GAAGG,MAAM,GAAGA,MAAM,CAAC,CAAC,CAAA;AAAE,GAAA,EACnGA,MAAM,CAACa,GAAG,CAAC,UAACC,CAAC,EAAA;IAAA,oBACVN,KAAA,CAAAC,aAAA,CAAA,QAAA,EAAA;AAAQM,MAAAA,GAAG,EAAED,CAAE;AAAChB,MAAAA,KAAK,EAAEgB,CAAAA;AAAE,KAAA,EACpBA,CACG,CAAC,CAAA;GACZ,CACS,CAChB,CAAC,CAAA;AAEX,CAAC;;;;"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import './Form.styles_22v2s5.css';
|
2
|
-
import { styled } from '@linaria/react';
|
3
|
-
|
4
|
-
var SelectHidden = /*#__PURE__*/styled('select')({
|
5
|
-
name: "SelectHidden",
|
6
|
-
"class": "sngk5la",
|
7
|
-
propsAsIs: false
|
8
|
-
});
|
9
|
-
|
10
|
-
export { SelectHidden };
|
11
|
-
//# sourceMappingURL=Form.styles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Form.styles.js","sources":["../../../../../../src/components/Combobox/ComboboxNew/ui/Form/Form.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { applyHidden } from '../../../../../mixins';\n\nexport const SelectHidden = styled.select`\n ${applyHidden()};\n`;\n"],"names":["SelectHidden","styled","name","class","propsAsIs"],"mappings":";;AAIO,IAAMA,YAAY,gBAAGC,MAAM,CAAA,QAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,cAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEjC;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.sngk5la{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
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
|
-
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
|
-
};
|
48
|
-
|
49
|
-
export { createEvent, createSyntheticEvent };
|
50
|
-
//# sourceMappingURL=syntheticEvent.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"syntheticEvent.js","sources":["../../../../../src/components/Combobox/ComboboxNew/utils/syntheticEvent.ts"],"sourcesContent":["import { RefObject } from 'react';\n\nexport const createEvent = (ref: RefObject<HTMLSelectElement>) => {\n if (ref.current) {\n const event = new Event('change', { bubbles: true });\n Object.defineProperty(event, 'target', { writable: false, value: ref.current });\n const syntheticEvent = createSyntheticEvent(event) as React.ChangeEvent<typeof ref.current>;\n return syntheticEvent;\n }\n\n return null;\n};\n\nexport const createSyntheticEvent = <T extends Element, E extends Event>(event: E): React.SyntheticEvent<T, E> => {\n let isDefaultPrevented = false;\n let isPropagationStopped = false;\n const preventDefault = () => {\n isDefaultPrevented = true;\n event.preventDefault();\n };\n const stopPropagation = () => {\n isPropagationStopped = true;\n event.stopPropagation();\n };\n return {\n nativeEvent: event,\n currentTarget: event.currentTarget as EventTarget & T,\n target: event.target as EventTarget & T,\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n defaultPrevented: event.defaultPrevented,\n eventPhase: event.eventPhase,\n isTrusted: event.isTrusted,\n preventDefault,\n isDefaultPrevented: () => isDefaultPrevented,\n stopPropagation,\n isPropagationStopped: () => isPropagationStopped,\n persist: () => {},\n timeStamp: event.timeStamp,\n type: event.type,\n };\n};\n"],"names":["createEvent","ref","current","event","Event","bubbles","Object","defineProperty","writable","value","syntheticEvent","createSyntheticEvent","isDefaultPrevented","isPropagationStopped","preventDefault","stopPropagation","nativeEvent","currentTarget","target","cancelable","defaultPrevented","eventPhase","isTrusted","persist","timeStamp","type"],"mappings":"IAEaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,GAAiC,EAAK;EAC9D,IAAIA,GAAG,CAACC,OAAO,EAAE;AACb,IAAA,IAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC,QAAQ,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;AACpDC,IAAAA,MAAM,CAACC,cAAc,CAACJ,KAAK,EAAE,QAAQ,EAAE;AAAEK,MAAAA,QAAQ,EAAE,KAAK;MAAEC,KAAK,EAAER,GAAG,CAACC,OAAAA;AAAQ,KAAC,CAAC,CAAA;AAC/E,IAAA,IAAMQ,cAAc,GAAGC,oBAAoB,CAACR,KAAK,CAA0C,CAAA;AAC3F,IAAA,OAAOO,cAAc,CAAA;AACzB,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACf,EAAC;IAEYC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAwCR,KAAQ,EAAiC;EAC9G,IAAIS,mBAAkB,GAAG,KAAK,CAAA;EAC9B,IAAIC,qBAAoB,GAAG,KAAK,CAAA;AAChC,EAAA,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,GAAS;AACzBF,IAAAA,mBAAkB,GAAG,IAAI,CAAA;IACzBT,KAAK,CAACW,cAAc,EAAE,CAAA;GACzB,CAAA;AACD,EAAA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,GAAS;AAC1BF,IAAAA,qBAAoB,GAAG,IAAI,CAAA;IAC3BV,KAAK,CAACY,eAAe,EAAE,CAAA;GAC1B,CAAA;EACD,OAAO;AACHC,IAAAA,WAAW,EAAEb,KAAK;IAClBc,aAAa,EAAEd,KAAK,CAACc,aAAgC;IACrDC,MAAM,EAAEf,KAAK,CAACe,MAAyB;IACvCb,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBc,UAAU,EAAEhB,KAAK,CAACgB,UAAU;IAC5BC,gBAAgB,EAAEjB,KAAK,CAACiB,gBAAgB;IACxCC,UAAU,EAAElB,KAAK,CAACkB,UAAU;IAC5BC,SAAS,EAAEnB,KAAK,CAACmB,SAAS;AAC1BR,IAAAA,cAAc,EAAdA,cAAc;IACdF,kBAAkB,EAAE,SAAAA,kBAAA,GAAA;AAAA,MAAA,OAAMA,mBAAkB,CAAA;AAAA,KAAA;AAC5CG,IAAAA,eAAe,EAAfA,eAAe;IACfF,oBAAoB,EAAE,SAAAA,oBAAA,GAAA;AAAA,MAAA,OAAMA,qBAAoB,CAAA;AAAA,KAAA;AAChDU,IAAAA,OAAO,EAAE,SAAAA,OAAA,GAAM,EAAE;IACjBC,SAAS,EAAErB,KAAK,CAACqB,SAAS;IAC1BC,IAAI,EAAEtB,KAAK,CAACsB,IAAAA;GACf,CAAA;AACL;;;;"}
|
@@ -1,38 +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.Form = void 0;
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
|
-
var _syntheticEvent = /*#__PURE__*/require("../../utils/syntheticEvent");
|
11
|
-
var _Form = /*#__PURE__*/require("./Form.styles");
|
12
|
-
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); }
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
14
|
-
var Form = exports.Form = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
15
|
-
var name = _ref.name,
|
16
|
-
multiple = _ref.multiple,
|
17
|
-
value = _ref.value,
|
18
|
-
onChange = _ref.onChange;
|
19
|
-
var values = multiple ? value : [value];
|
20
|
-
var selectRef = (0, _react.useRef)(null);
|
21
|
-
var forkRef = (0, _plasmaCore.useForkRef)(selectRef, ref);
|
22
|
-
(0, _react.useEffect)(function () {
|
23
|
-
var event = (0, _syntheticEvent.createEvent)(selectRef);
|
24
|
-
onChange && onChange(event);
|
25
|
-
}, [values]);
|
26
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Form.SelectHidden, {
|
27
|
-
ref: forkRef,
|
28
|
-
multiple: multiple,
|
29
|
-
name: name,
|
30
|
-
hidden: true,
|
31
|
-
value: multiple ? values : values[0]
|
32
|
-
}, values.map(function (v) {
|
33
|
-
return /*#__PURE__*/_react["default"].createElement("option", {
|
34
|
-
key: v,
|
35
|
-
value: v
|
36
|
-
}, v);
|
37
|
-
})));
|
38
|
-
});
|
@@ -1,12 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.SelectHidden = void 0;
|
7
|
-
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
|
-
var _mixins = /*#__PURE__*/require("../../../../../mixins");
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
var SelectHidden = exports.SelectHidden = /*#__PURE__*/_styledComponents["default"].select.withConfig({
|
11
|
-
componentId: "plasma-new-hope__sc-13p7uhq-0"
|
12
|
-
})(["", ";"], /*#__PURE__*/(0, _mixins.applyHidden)());
|
@@ -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,29 +0,0 @@
|
|
1
|
-
import React, { forwardRef, useEffect, useRef } from 'react';
|
2
|
-
import { useForkRef } from '@salutejs/plasma-core';
|
3
|
-
import { createEvent } from '../../utils/syntheticEvent';
|
4
|
-
import { SelectHidden } from './Form.styles';
|
5
|
-
export var Form = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
6
|
-
var name = _ref.name,
|
7
|
-
multiple = _ref.multiple,
|
8
|
-
value = _ref.value,
|
9
|
-
onChange = _ref.onChange;
|
10
|
-
var values = multiple ? value : [value];
|
11
|
-
var selectRef = useRef(null);
|
12
|
-
var forkRef = useForkRef(selectRef, ref);
|
13
|
-
useEffect(function () {
|
14
|
-
var event = createEvent(selectRef);
|
15
|
-
onChange && onChange(event);
|
16
|
-
}, [values]);
|
17
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SelectHidden, {
|
18
|
-
ref: forkRef,
|
19
|
-
multiple: multiple,
|
20
|
-
name: name,
|
21
|
-
hidden: true,
|
22
|
-
value: multiple ? values : values[0]
|
23
|
-
}, values.map(function (v) {
|
24
|
-
return /*#__PURE__*/React.createElement("option", {
|
25
|
-
key: v,
|
26
|
-
value: v
|
27
|
-
}, v);
|
28
|
-
})));
|
29
|
-
});
|