@sima-land/ui-nucleons 41.2.0 → 41.2.1
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/carousel/draggable.js +3 -1
- package/carousel/index.d.ts +2 -2
- package/carousel/index.js +1 -1
- package/package.json +16 -18
- package/rating/index.js +2 -2
- package/text-field/index.js +1 -1
package/carousel/draggable.js
CHANGED
|
@@ -238,7 +238,9 @@ class Draggable extends react_1.Component {
|
|
|
238
238
|
render() {
|
|
239
239
|
const { children, containerProps = {}, transitionDuration: duration = 320 } = this.props;
|
|
240
240
|
const { x, y } = this.currentOffset;
|
|
241
|
-
return (react_1.default.createElement("div", Object.assign({}, containerProps, { className: cx('draggable-container', containerProps.className),
|
|
241
|
+
return (react_1.default.createElement("div", Object.assign({}, containerProps, { className: cx('draggable-container', containerProps.className),
|
|
242
|
+
// обрабатываем захват чтобы при обработке клика на дочернем элементе defaultPrevented уже был true
|
|
243
|
+
onClickCapture: this.handleClick, onMouseDown: this.startCapture, onTouchStart: this.startCapture }),
|
|
242
244
|
react_1.default.createElement("div", { ref: this.draggableRef, style: {
|
|
243
245
|
transform: (0, styles_1.getTranslateStyle)(x, y),
|
|
244
246
|
transition: this.hasTransition ? (0, styles_1.getTransitionStyle)(duration, 'transform') : '',
|
package/carousel/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare class Carousel extends Component<CarouselProps, State> {
|
|
|
77
77
|
* @param index Индекс.
|
|
78
78
|
* @return Элемент списка.
|
|
79
79
|
*/
|
|
80
|
-
static defaultRenderItem(item: any, index:
|
|
80
|
+
static defaultRenderItem(item: any, index: number): JSX.Element;
|
|
81
81
|
/**
|
|
82
82
|
* Возвращает кнопку управления.
|
|
83
83
|
* @param data Данные для вывода кнопки.
|
|
@@ -179,7 +179,7 @@ export declare class Carousel extends Component<CarouselProps, State> {
|
|
|
179
179
|
*/
|
|
180
180
|
moveBackwardFinite(step: number): void;
|
|
181
181
|
/**
|
|
182
|
-
* Выполняет
|
|
182
|
+
* Выполняет прокрутку в бесконечном режиме.
|
|
183
183
|
* @param step Количество элементов для прокрутки.
|
|
184
184
|
* @param forward Нужно выполнить прокрутку вперед?
|
|
185
185
|
*/
|
package/carousel/index.js
CHANGED
|
@@ -276,7 +276,7 @@ class Carousel extends react_1.Component {
|
|
|
276
276
|
this.setCurrentIndex(newIndex !== -1 && newIndex - step >= 0 ? newIndex - step : 0);
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
|
-
* Выполняет
|
|
279
|
+
* Выполняет прокрутку в бесконечном режиме.
|
|
280
280
|
* @param step Количество элементов для прокрутки.
|
|
281
281
|
* @param forward Нужно выполнить прокрутку вперед?
|
|
282
282
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sima-land/ui-nucleons",
|
|
3
|
-
"version": "41.2.
|
|
3
|
+
"version": "41.2.1",
|
|
4
4
|
"repository": "ssh://git@github.com:sima-land/ui-nucleons.git",
|
|
5
5
|
"author": "www.sima-land.ru team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,21 +22,20 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@babel/core": "^7.16.0",
|
|
25
|
-
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
26
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
27
25
|
"@babel/preset-env": "^7.16.4",
|
|
28
26
|
"@babel/preset-react": "^7.16.0",
|
|
27
|
+
"@babel/preset-typescript": "^7.16.5",
|
|
29
28
|
"@rushstack/eslint-patch": "^1.1.0",
|
|
30
29
|
"@sima-land/linters": "^2.1.1",
|
|
31
|
-
"@storybook/addon-actions": "^6.
|
|
32
|
-
"@storybook/addon-backgrounds": "^6.
|
|
33
|
-
"@storybook/addon-docs": "^6.
|
|
34
|
-
"@storybook/addon-storysource": "^6.
|
|
35
|
-
"@storybook/addons": "^6.
|
|
36
|
-
"@storybook/builder-webpack5": "^6.
|
|
37
|
-
"@storybook/manager-webpack5": "^6.
|
|
38
|
-
"@storybook/react": "^6.
|
|
39
|
-
"@storybook/theming": "^6.
|
|
30
|
+
"@storybook/addon-actions": "^6.4.13",
|
|
31
|
+
"@storybook/addon-backgrounds": "^6.4.13",
|
|
32
|
+
"@storybook/addon-docs": "^6.4.13",
|
|
33
|
+
"@storybook/addon-storysource": "^6.4.13",
|
|
34
|
+
"@storybook/addons": "^6.4.13",
|
|
35
|
+
"@storybook/builder-webpack5": "^6.4.13",
|
|
36
|
+
"@storybook/manager-webpack5": "^6.4.13",
|
|
37
|
+
"@storybook/react": "^6.4.13",
|
|
38
|
+
"@storybook/theming": "^6.4.13",
|
|
40
39
|
"@svgr/core": "^5.5.0",
|
|
41
40
|
"@svgr/plugin-svgo": "^5.5.0",
|
|
42
41
|
"@svgr/webpack": "^5.5.0",
|
|
@@ -51,6 +50,7 @@
|
|
|
51
50
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
52
51
|
"@typescript-eslint/parser": "^5.4.0",
|
|
53
52
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
|
|
53
|
+
"babel-jest": "^27.4.6",
|
|
54
54
|
"babel-loader": "^8.2.3",
|
|
55
55
|
"babel-preset-jest": "^27.2.0",
|
|
56
56
|
"copyfiles": "^2.4.1",
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"eslint": "^7.31.0",
|
|
61
61
|
"file-loader": "^6.2.0",
|
|
62
62
|
"husky": "^7.0.4",
|
|
63
|
-
"identity-obj-proxy": "^3.0.0",
|
|
64
63
|
"jest": "^27.3.1",
|
|
65
64
|
"jest-css-modules-transform": "^4.3.0",
|
|
66
65
|
"lint-staged": "^12.1.2",
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
"sass-loader": "^10.1.0",
|
|
75
74
|
"style-loader": "^2.0.0",
|
|
76
75
|
"stylelint": "^14.1.0",
|
|
77
|
-
"ts-jest": "^27.0.7",
|
|
78
76
|
"typescript": "^4.5.2",
|
|
79
77
|
"typescript-plugin-css-modules": "^3.4.0",
|
|
80
78
|
"webpack": "^5.64.2"
|
|
@@ -89,13 +87,13 @@
|
|
|
89
87
|
"build:main": "tsc --project tsconfig.build.json",
|
|
90
88
|
"build:after": "node dist.js",
|
|
91
89
|
"build": "npm run build:before && npm run build:main && npm run build:after",
|
|
92
|
-
"test": "jest",
|
|
90
|
+
"test": "BROWSERSLIST_ENV=\"test\" npx jest",
|
|
91
|
+
"coverage": "jest --clearCache && BROWSERSLIST_ENV=\"test\" npx jest --coverage",
|
|
93
92
|
"type-check": "tsc -p . --noEmit",
|
|
94
|
-
"coverage": "jest --clearCache && jest --coverage",
|
|
95
93
|
"lint:scripts": "eslint --cache src/ --ext .js,.jsx,.ts,.tsx",
|
|
96
94
|
"lint:styles": "stylelint 'src/**/*.{css,scss}'",
|
|
97
|
-
"storybook": "start-storybook -p 9009 -c .storybook",
|
|
98
|
-
"storybook:build": "build-storybook --quiet --loglevel error -o build-storybook",
|
|
95
|
+
"storybook": "BROWSERSLIST_ENV=\"storybook\" npx start-storybook -p 9009 -c .storybook",
|
|
96
|
+
"storybook:build": "BROWSERSLIST_ENV=\"storybook\" npx build-storybook --quiet --loglevel error -o build-storybook",
|
|
99
97
|
"prettier": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error",
|
|
100
98
|
"prettier:check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error"
|
|
101
99
|
}
|
package/rating/index.js
CHANGED
|
@@ -27,7 +27,7 @@ const cx = bind_1.default.bind(rating_module_scss_1.default);
|
|
|
27
27
|
* @return Элемент.
|
|
28
28
|
*/
|
|
29
29
|
const Rating = (_a) => {
|
|
30
|
-
var { size, value, className, 'data-testid': testId = 'rating' } = _a, restProps = __rest(_a, ["size", "value", "className", 'data-testid']);
|
|
30
|
+
var { size = 's', value, className, 'data-testid': testId = 'rating' } = _a, restProps = __rest(_a, ["size", "value", "className", 'data-testid']);
|
|
31
31
|
return (react_1.default.createElement("div", Object.assign({}, restProps, { className: cx('root', className), "data-testid": testId, "data-rating": value }), (0, utils_1.getStars)(Math.min(5, value), 5).map((type, index) => (react_1.default.createElement(Star, { key: index, type: type, size: size })))));
|
|
32
32
|
};
|
|
33
33
|
exports.Rating = Rating;
|
|
@@ -36,7 +36,7 @@ exports.Rating = Rating;
|
|
|
36
36
|
* @param props Свойства.
|
|
37
37
|
* @return Элемент.
|
|
38
38
|
*/
|
|
39
|
-
const Star = ({ type, size
|
|
39
|
+
const Star = ({ type, size }) => (react_1.default.createElement("div", { className: cx('star', `size-${size}`) },
|
|
40
40
|
type === 'empty' && react_1.default.createElement(star_svg_1.default, { className: cx('svg') }),
|
|
41
41
|
type === 'half' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
42
|
react_1.default.createElement(star_svg_1.default, { className: cx('svg') }),
|
package/text-field/index.js
CHANGED
|
@@ -77,7 +77,7 @@ exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, capt
|
|
|
77
77
|
} },
|
|
78
78
|
!multiline && Boolean(startAdornment) && (react_1.default.createElement(box_1.Box, { display: 'flex', alignItems: 'center', marginRight: 4 }, startAdornment)),
|
|
79
79
|
react_1.default.createElement("div", { className: cx('main-column') },
|
|
80
|
-
withLabel && (react_1.default.createElement("label", { className: cx('label', commonModifyClasses, hasValue && 'filled', labelAsPlaceholder && 'as-placeholder'), children: label })),
|
|
80
|
+
withLabel && (react_1.default.createElement("label", { className: cx('label', commonModifyClasses, hasValue && 'filled', labelAsPlaceholder && 'as-placeholder'), children: label, "data-testid": 'text-field:label' })),
|
|
81
81
|
react_1.default.createElement("div", { className: cx('input-wrapper') },
|
|
82
82
|
react_1.default.createElement(base_input_1.BaseInput, Object.assign({}, baseInputProps, { "data-testid": 'text-field:field', multiline: multiline, ref: baseInputRef, placeholder: withLabel && labelAsPlaceholder ? undefined : placeholder, restPlaceholder: withLabel && labelAsPlaceholder ? undefined : restPlaceholder, autoFocus: autoFocus, className: cx('base-input', commonModifyClasses, classes.baseInput, size && `size-${size}`), defaultValue: defaultValue, value: value, readOnly: readOnly, disabled: disabled, onFocus: (event) => {
|
|
83
83
|
(0, lodash_1.isFunction)(onFocus) && onFocus(event);
|