@hh.ru/magritte-ui-chips-input 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mock.js +1 -30
- package/index.mock.js.map +1 -1
- package/package.json +8 -7
package/index.mock.js
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
|
|
4
|
-
function enhance(mockComponent, staticProps) {
|
|
5
|
-
// удаляем внутренний свойства реакта, чтобы не перезаписать ими mockComponent
|
|
6
|
-
delete staticProps.type;
|
|
7
|
-
delete staticProps.$$typeof;
|
|
8
|
-
delete staticProps.render;
|
|
9
|
-
for (const prop in staticProps) {
|
|
10
|
-
mockComponent[prop] = staticProps[prop];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
const MockComponent = ({ style, ...props }) => (
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
// eslint-disable-next-line react/jsx-no-undef
|
|
17
|
-
jsx("Magritte-component-mock", { "style-data": style, ...props }));
|
|
18
|
-
/**
|
|
19
|
-
* Возвращает mock React компонента
|
|
20
|
-
*/
|
|
21
|
-
const mockComponent = (componentName, staticProps = {}, { withChildren, innerDependence } = {}) => {
|
|
22
|
-
const mockWrapper = forwardRef(({ children, ...props }, ref) => {
|
|
23
|
-
return (
|
|
24
|
-
// eslint-disable-next-line react/jsx-no-undef
|
|
25
|
-
jsxs(MockComponent, { ...props, _component: componentName, children: [innerDependence ? innerDependence(props, ref) : null, withChildren ? children : null] }));
|
|
26
|
-
});
|
|
27
|
-
staticProps && enhance(mockWrapper, staticProps);
|
|
28
|
-
mockWrapper.displayName = 'magritte-ref';
|
|
29
|
-
return mockWrapper;
|
|
30
|
-
};
|
|
1
|
+
import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
|
|
31
2
|
|
|
32
3
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
33
4
|
const { ThemeProvider } = jest.requireActual('@hh.ru/magritte-ui-theme-provider/index');
|
package/index.mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mock.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport type * from '@hh.ru/magritte-ui-chips-input/types';\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst { ThemeProvider } = jest.requireActual('@hh.ru/magritte-ui-theme-provider/index');\n\nexport { ThemeProvider };\n\nexport const Input: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('ChipsInput', undefined, {\n withChildren: false,\n});\n"],"names":[],"mappings":";;AAMA;AACM,MAAA,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,yCAAyC,EAAE;MAI3E,KAAK,GAAuD,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE;AAC5G,IAAA,YAAY,EAAE,KAAK;AACtB,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-chips-input",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.4",
|
|
30
30
|
"@hh.ru/magritte-ui-breakpoint": "4.1.0",
|
|
31
|
-
"@hh.ru/magritte-ui-chips-trigger": "3.2.
|
|
32
|
-
"@hh.ru/magritte-ui-input": "7.0.
|
|
33
|
-
"@hh.ru/magritte-ui-
|
|
34
|
-
"@hh.ru/magritte-ui-
|
|
35
|
-
"@hh.ru/magritte-ui-
|
|
31
|
+
"@hh.ru/magritte-ui-chips-trigger": "3.2.6",
|
|
32
|
+
"@hh.ru/magritte-ui-input": "7.0.6",
|
|
33
|
+
"@hh.ru/magritte-ui-mock-component": "1.0.11",
|
|
34
|
+
"@hh.ru/magritte-ui-select": "8.6.5",
|
|
35
|
+
"@hh.ru/magritte-ui-suggest": "6.4.5",
|
|
36
|
+
"@hh.ru/magritte-ui-theme-provider": "1.1.32"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c433893f26e96398f781c1b7698d13bdcb442d48"
|
|
38
39
|
}
|