@sima-land/ui-nucleons 45.0.0-alpha.3 → 45.0.0-alpha.5
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/_internal/custom-scrollbar/index.d.ts +2 -2
- package/_internal/custom-scrollbar/index.js +17 -14
- package/_internal/dropdown-loading/index.js +2 -3
- package/_internal/page-scroll-lock/context.js +3 -25
- package/alert/index.d.ts +2 -2
- package/alert/index.js +4 -30
- package/arrow-button/arrow-button.module.scss +5 -5
- package/arrow-button/index.js +18 -19
- package/autocomplete/autocomplete.js +49 -76
- package/autocomplete-deprecated/index.d.ts +1 -1
- package/autocomplete-deprecated/index.js +43 -67
- package/avatar/avatar.module.scss +3 -1
- package/avatar/index.d.ts +1 -1
- package/avatar/index.js +10 -36
- package/avatar/user.d.ts +1 -1
- package/avatar/user.js +8 -29
- package/avatar/utils.d.ts +1 -1
- package/avatar/utils.js +12 -10
- package/base-input/base-input.js +5 -31
- package/base-input-deprecated/index.d.ts +2 -2
- package/base-input-deprecated/index.js +8 -34
- package/bordered-layout/index.d.ts +1 -1
- package/bordered-layout/index.js +2 -3
- package/bottom-bar/bottom-bar.js +2 -3
- package/box/index.d.ts +1 -1
- package/box/index.js +2 -2
- package/button/index.d.ts +2 -2
- package/button/index.js +6 -32
- package/card/index.js +2 -8
- package/card/slots.d.ts +1 -1
- package/card/slots.js +9 -31
- package/carousel/draggable.d.ts +1 -1
- package/carousel/draggable.js +5 -28
- package/carousel/index.d.ts +1 -1
- package/carousel/index.js +17 -43
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +3 -29
- package/checkbox-field/index.d.ts +2 -2
- package/checkbox-field/index.js +3 -31
- package/chips/index.d.ts +1 -1
- package/chips/index.js +3 -25
- package/chips/item.d.ts +1 -1
- package/chips/item.js +3 -5
- package/clean-buttons/index.js +6 -28
- package/dot-nav/index.d.ts +1 -1
- package/dot-nav/index.js +12 -34
- package/dropdown/index.d.ts +2 -2
- package/dropdown/index.js +3 -26
- package/dropdown-item/index.d.ts +1 -1
- package/dropdown-item/index.js +4 -9
- package/expandable/index.d.ts +2 -2
- package/expandable/index.js +8 -36
- package/field-block/index.js +2 -9
- package/field-grid/index.d.ts +1 -1
- package/field-grid/index.js +43 -65
- package/file-icon/index.d.ts +1 -1
- package/file-icon/index.js +5 -10
- package/group-overflow/index.js +7 -29
- package/helpers/define-slots.d.ts +1 -1
- package/helpers/events.d.ts +1 -1
- package/helpers/on.d.ts +1 -1
- package/hint/hint-view.js +3 -3
- package/hint/hint.js +3 -8
- package/hint/utils.d.ts +4 -1
- package/hint/utils.js +4 -3
- package/hint-deprecated/index.d.ts +2 -2
- package/hint-deprecated/index.js +3 -26
- package/hooks/breakpoint/index.js +3 -25
- package/info-text/index.js +15 -42
- package/input/index.js +8 -30
- package/layout/layout.js +2 -2
- package/layout/legacy.d.ts +5 -5
- package/layout/legacy.js +3 -25
- package/link/index.d.ts +6 -3
- package/link/index.js +3 -25
- package/loading-overlay/index.d.ts +1 -1
- package/loading-overlay/index.js +2 -3
- package/masked-field/index.d.ts +2 -2
- package/masked-field/index.js +3 -25
- package/masked-input/masked-input.js +3 -25
- package/modal/index.d.ts +1 -1
- package/modal/index.js +3 -10
- package/modal/slots.js +6 -29
- package/modal-overlay/index.js +3 -26
- package/no-index/index.d.ts +3 -3
- package/no-index/index.js +4 -8
- package/no-index-mark/index.d.ts +2 -2
- package/no-index-mark/index.js +7 -6
- package/package.json +6 -11
- package/pagination/index.d.ts +4 -20
- package/pagination/index.js +8 -15
- package/pagination/pagination-item.d.ts +8 -0
- package/pagination/pagination-item.js +31 -0
- package/pagination/pagination-item.module.scss +49 -0
- package/pagination/pagination.d.ts +8 -0
- package/pagination/pagination.js +78 -0
- package/pagination/pagination.module.scss +14 -70
- package/pagination/types.d.ts +28 -0
- package/pagination/types.js +2 -0
- package/pagination/utils.d.ts +15 -43
- package/pagination/utils.js +38 -87
- package/{pagination → pagination-deprecated}/base-pagination.d.ts +6 -1
- package/{pagination → pagination-deprecated}/base-pagination.js +33 -33
- package/pagination-deprecated/index.d.ts +22 -0
- package/pagination-deprecated/index.js +15 -0
- package/{pagination → pagination-deprecated}/page-button.d.ts +2 -1
- package/{pagination → pagination-deprecated}/page-button.js +3 -5
- package/pagination-deprecated/pagination.module.scss +76 -0
- package/pagination-deprecated/utils.d.ts +58 -0
- package/pagination-deprecated/utils.js +124 -0
- package/panel/index.js +3 -6
- package/phone-input/images/armenia.png +0 -0
- package/phone-input/images/azerbaijan.png +0 -0
- package/phone-input/images/belarus.png +0 -0
- package/phone-input/images/georgia.png +0 -0
- package/phone-input/images/kazakhstan.png +0 -0
- package/phone-input/images/kyrgyzstan.png +0 -0
- package/phone-input/images/moldova.png +0 -0
- package/phone-input/images/other.png +0 -0
- package/phone-input/images/russia.png +0 -0
- package/phone-input/images/tajikistan.png +0 -0
- package/phone-input/images/turkmenistan.png +0 -0
- package/phone-input/images/ukraine.png +0 -0
- package/phone-input/images/uzbekistan.png +0 -0
- package/phone-input/phone-input.js +13 -37
- package/phone-input/presets.js +2 -0
- package/phone-input-deprecated/index.d.ts +1 -1
- package/phone-input-deprecated/index.js +31 -57
- package/plate/index.d.ts +2 -2
- package/plate/index.js +3 -25
- package/popup/popup-view.js +3 -6
- package/popup/popup.js +4 -26
- package/portal/index.d.ts +1 -1
- package/price/index.js +2 -2
- package/radio-button/index.js +2 -4
- package/range/index.d.ts +1 -1
- package/range/index.js +6 -33
- package/rating/index.d.ts +1 -1
- package/rating/index.js +4 -9
- package/readme.md +4 -67
- package/screen/index.d.ts +5 -5
- package/screen/index.js +11 -37
- package/screen/slots.d.ts +3 -3
- package/screen/slots.js +9 -31
- package/select/parts/block.js +6 -28
- package/select/parts/button.js +7 -29
- package/select/parts/menu.js +12 -33
- package/select/select.js +4 -28
- package/select-deprecated/index.d.ts +1 -1
- package/select-deprecated/index.js +32 -56
- package/side-page/index.js +4 -30
- package/side-page/slots.js +4 -4
- package/spinner/index.d.ts +1 -1
- package/spinner/index.js +3 -5
- package/spinner/spinner.module.scss +3 -1
- package/stepper/index.d.ts +2 -2
- package/stepper/index.js +11 -38
- package/stroked-svg/index.d.ts +2 -2
- package/stroked-svg/index.js +3 -27
- package/styling/sizes.module.scss +3 -1
- package/super-ellipse-clip-path/index.js +2 -8
- package/switcher-row/index.js +5 -10
- package/tabs/index.d.ts +1 -1
- package/tabs/index.js +4 -26
- package/text/index.d.ts +2 -2
- package/text/index.js +3 -25
- package/text-button/index.d.ts +2 -2
- package/text-button/index.js +4 -7
- package/text-button/text-button.module.scss +1 -1
- package/text-field/index.d.ts +2 -2
- package/text-field/index.js +25 -55
- package/textarea/index.js +4 -26
- package/timer/index.d.ts +1 -1
- package/timer/index.js +3 -25
- package/toggle/index.d.ts +2 -2
- package/toggle/index.js +3 -27
- package/tooltip/index.d.ts +2 -2
- package/tooltip/index.js +4 -28
- package/top-bar/index.d.ts +1 -1
- package/top-bar/index.js +3 -1
- package/top-bar/top-bar.js +5 -45
- package/top-bar/utils.d.ts +2 -2
- package/top-bar/utils.js +6 -28
- package/touch-slider/index.d.ts +1 -1
- package/touch-slider/index.js +2 -4
- package/unknown-content/index.d.ts +1 -1
- package/unknown-content/index.js +3 -25
- package/upload-area/upload-area.js +8 -38
- package/with-hint/index.d.ts +1 -1
- package/with-hint/index.js +3 -28
- package/with-hint/positioning-hint.d.ts +1 -1
- package/with-hint/positioning-hint.js +3 -25
- package/with-tooltip/index.d.ts +1 -1
- package/with-tooltip/index.js +6 -31
- package/with-tooltip/positioning-tooltip.d.ts +1 -1
- package/with-tooltip/positioning-tooltip.js +4 -26
- package/file-icon/unknown.svg +0 -9
- package/rating/star.svg +0 -3
- package/upload-area/upload.svg +0 -6
package/readme.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
### Установка
|
|
8
8
|
|
|
9
|
-
```
|
|
9
|
+
```sh
|
|
10
10
|
# npm
|
|
11
11
|
npm i -S @sima-land/ui-nucleons
|
|
12
12
|
|
|
@@ -18,42 +18,21 @@ yarn add @sima-land/ui-nucleons
|
|
|
18
18
|
|
|
19
19
|
Компоненты библиотеки используют:
|
|
20
20
|
|
|
21
|
-
- импорты изображений (jpg, png
|
|
21
|
+
- импорты изображений (jpg, png...) как url/base64
|
|
22
22
|
- импорты стилей
|
|
23
23
|
- импорты стилей как css-модулей (каждый такой файл промаркирован в виде `%filename%.module.scss`)
|
|
24
|
-
- импорты svg-файлов как react-компоненты
|
|
25
24
|
|
|
26
25
|
#### Для работы с Webpack необходимо (как вариант):
|
|
27
26
|
|
|
28
|
-
-
|
|
29
|
-
- сконфигурировать обработку svg, css, scss файлов
|
|
30
|
-
|
|
31
|
-
##### Зависимости
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm install --save-dev @svgr/core @svgr/plugin-jsx @svgr/plugin-svgo @svgr/webpack
|
|
35
|
-
```
|
|
27
|
+
- сконфигурировать обработку импортов css, scss файлов
|
|
36
28
|
|
|
37
29
|
##### Конфигурация
|
|
38
30
|
|
|
39
31
|
```js
|
|
40
32
|
// webpack.config.js
|
|
41
|
-
const svgrOptions = require('../../svgr.config'); // опции SVGR (скопировать из данного проекта)
|
|
42
|
-
|
|
43
33
|
module.exports = {
|
|
44
34
|
module: {
|
|
45
35
|
rules: [
|
|
46
|
-
// svg
|
|
47
|
-
{
|
|
48
|
-
test: /\.svg$/,
|
|
49
|
-
use: [
|
|
50
|
-
{
|
|
51
|
-
loader: '@svgr/webpack',
|
|
52
|
-
options: svgrOptions,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
|
|
57
36
|
// стилей
|
|
58
37
|
{
|
|
59
38
|
test: /\.(css|scss)$/,
|
|
@@ -78,29 +57,7 @@ module.exports = {
|
|
|
78
57
|
|
|
79
58
|
#### Для работы с Jest необходимо (как вариант):
|
|
80
59
|
|
|
81
|
-
-
|
|
82
|
-
- сконфигурировать обработку svg, css, scss файлов
|
|
83
|
-
|
|
84
|
-
##### Добавить обработку SVG
|
|
85
|
-
|
|
86
|
-
- добавить файл "трансформера" вида:
|
|
87
|
-
|
|
88
|
-
```js
|
|
89
|
-
const babel = require('@babel/core');
|
|
90
|
-
const babelConfig = require('../../babel.config');
|
|
91
|
-
const svgr = require('@svgr/core');
|
|
92
|
-
const svgrConfig = require('../../svgr.config');
|
|
93
|
-
|
|
94
|
-
module.exports = {
|
|
95
|
-
process(sourceText, sourcePath) {
|
|
96
|
-
const code = svgr.transform.sync(sourceText, svgrConfig, { filePath: sourcePath });
|
|
97
|
-
|
|
98
|
-
return babel.transformSync(code, { filename: sourcePath, ...babelConfig });
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
- задействовать его в конфигурации Jest
|
|
60
|
+
- сконфигурировать обработку css, scss файлов
|
|
104
61
|
|
|
105
62
|
##### Добавить поддержку стилей
|
|
106
63
|
|
|
@@ -109,9 +66,6 @@ module.exports = {
|
|
|
109
66
|
```js
|
|
110
67
|
module.exports = {
|
|
111
68
|
transform: {
|
|
112
|
-
// svg как react-компоненты
|
|
113
|
-
'\\.svg$': '<rootDir>/.jest/transforms/svg.js',
|
|
114
|
-
|
|
115
69
|
// обычный css
|
|
116
70
|
'(?<!(\\.module))\\.(css|scss)$': './transformer/empty.js',
|
|
117
71
|
|
|
@@ -142,12 +96,6 @@ declare module '*.module.scss' {
|
|
|
142
96
|
const classes: { [key: string]: string };
|
|
143
97
|
export default classes;
|
|
144
98
|
}
|
|
145
|
-
|
|
146
|
-
// svg как React-компоненты
|
|
147
|
-
declare module '*.svg' {
|
|
148
|
-
const content: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
149
|
-
export default content;
|
|
150
|
-
}
|
|
151
99
|
```
|
|
152
100
|
|
|
153
101
|
## Разработка и поддержка
|
|
@@ -170,14 +118,3 @@ declare module '*.svg' {
|
|
|
170
118
|
- `helpers/` - общие вспомогательные функции (для использования вне библиотеки)
|
|
171
119
|
- `hooks/` - общие react-хуки (для использования вне библиотеки)
|
|
172
120
|
- `_internal/` - внутренние скрипты для использования только в рамках данной библиотеки
|
|
173
|
-
|
|
174
|
-
### Тестирование
|
|
175
|
-
|
|
176
|
-
Локально E2E-тесты должны запускаться через docker, пример:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.29.2-focal /bin/bash
|
|
180
|
-
npx playwright test
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
В противном случае скриншотные тесты не будут совпадать из-за разницы окружения запуска.
|
package/screen/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ScreenInnerProps } from './utils';
|
|
3
3
|
import { WithPageScrollLock } from '../_internal/page-scroll-lock';
|
|
4
4
|
export interface ScreenProps extends ScreenInnerProps, WithPageScrollLock {
|
|
@@ -18,8 +18,8 @@ export interface ScreenProps extends ScreenInnerProps, WithPageScrollLock {
|
|
|
18
18
|
export declare const Screen: {
|
|
19
19
|
({ children, loading, loadingArea, loadingOverlayProps, onFullScroll, fullScrollThreshold, withScrollDisable, scrollDisableOptions, "data-testid": testId, }: ScreenProps): JSX.Element;
|
|
20
20
|
Header: ({ divided, title, subtitle, buttons, onBack, onClose, ...restProps }: import("./slots").HeaderSlotProps) => JSX.Element;
|
|
21
|
-
Body:
|
|
22
|
-
children?:
|
|
23
|
-
} &
|
|
24
|
-
Footer:
|
|
21
|
+
Body: import("react").ForwardRefExoticComponent<{
|
|
22
|
+
children?: import("react").ReactNode;
|
|
23
|
+
} & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
24
|
+
Footer: import("react").FC<{}>;
|
|
25
25
|
};
|
package/screen/index.js
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.Screen = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const slots_1 = require("./slots");
|
|
32
10
|
const layer_1 = require("../helpers/layer");
|
|
33
11
|
const define_slots_1 = require("../helpers/define-slots");
|
|
@@ -53,20 +31,16 @@ const Screen = ({ children, loading, loadingArea = 'full', loadingOverlayProps,
|
|
|
53
31
|
if (!body) {
|
|
54
32
|
throw Error('Looks like you are trying to render <Screen /> without <Screen.Body /> slot, but it is required');
|
|
55
33
|
}
|
|
56
|
-
return (
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: rootRef, className: screen_module_scss_1.default.root, style: {
|
|
57
35
|
zIndex: layer, // z-index именно здесь из-за position: fixed
|
|
58
|
-
}, "data-testid": testId },
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
withScrollDisable,
|
|
67
|
-
scrollDisableOptions,
|
|
68
|
-
} }, body),
|
|
69
|
-
!fullLoading && footer && (react_1.default.createElement("div", { className: screen_module_scss_1.default.footer, "data-testid": 'screen:footer' }, footer)))));
|
|
36
|
+
}, "data-testid": testId }, { children: (0, jsx_runtime_1.jsxs)(layer_1.LayerProvider, Object.assign({ value: layer }, { children: [!fullLoading && header, (0, jsx_runtime_1.jsx)(utils_1.ScreenContext.Provider, Object.assign({ value: {
|
|
37
|
+
loading,
|
|
38
|
+
loadingOverlayProps,
|
|
39
|
+
onFullScroll,
|
|
40
|
+
fullScrollThreshold,
|
|
41
|
+
withScrollDisable,
|
|
42
|
+
scrollDisableOptions,
|
|
43
|
+
} }, { children: body })), !fullLoading && footer && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: screen_module_scss_1.default.footer, "data-testid": 'screen:footer' }, { children: footer })))] })) })));
|
|
70
44
|
};
|
|
71
45
|
exports.Screen = Screen;
|
|
72
46
|
exports.Screen.Header = slots_1.HeaderSlot;
|
package/screen/slots.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { TopBarProps } from '../top-bar';
|
|
3
3
|
export interface HeaderSlotProps extends TopBarProps {
|
|
4
4
|
/** Будет вызвана при нажатии на кнопку-стрелку. */
|
|
@@ -15,9 +15,9 @@ export declare const HeaderSlot: ({ divided, title, subtitle, buttons, onBack, o
|
|
|
15
15
|
/**
|
|
16
16
|
* Слот основного контента экрана.
|
|
17
17
|
*/
|
|
18
|
-
export declare const BodySlot:
|
|
18
|
+
export declare const BodySlot: import("react").ForwardRefExoticComponent<{
|
|
19
19
|
children?: React.ReactNode;
|
|
20
|
-
} &
|
|
20
|
+
} & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
21
21
|
/**
|
|
22
22
|
* Слот футера экрана.
|
|
23
23
|
* @param props Свойства.
|
package/screen/slots.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,10 +15,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.FooterSlot = exports.BodySlot = exports.HeaderSlot = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const lodash_1 = require("lodash");
|
|
43
|
-
const
|
|
44
|
-
const
|
|
21
|
+
const ArrowLeft_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/ArrowLeft"));
|
|
22
|
+
const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Cross"));
|
|
45
23
|
const page_scroll_lock_1 = require("../_internal/page-scroll-lock");
|
|
46
24
|
const hooks_1 = require("../hooks");
|
|
47
25
|
const loading_overlay_1 = require("../loading-overlay");
|
|
@@ -55,11 +33,11 @@ const top_bar_1 = require("../top-bar");
|
|
|
55
33
|
*/
|
|
56
34
|
const HeaderSlot = (_a) => {
|
|
57
35
|
var { divided, title, subtitle, buttons, onBack, onClose } = _a, restProps = __rest(_a, ["divided", "title", "subtitle", "buttons", "onBack", "onClose"]);
|
|
58
|
-
return (
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(top_bar_1.TopBar, Object.assign({}, restProps, { size: 's', title: title, subtitle: subtitle, divided: divided, buttons: Object.assign(Object.assign({}, buttons), { start: onBack
|
|
59
37
|
? {
|
|
60
38
|
// ВАЖНО: не подмешиваем свойства из buttons.start
|
|
61
39
|
// чтобы не распылять конфигурацию одной и той же кнопки по нескольким местам
|
|
62
|
-
icon:
|
|
40
|
+
icon: (0, jsx_runtime_1.jsx)(ArrowLeft_1.default, {}),
|
|
63
41
|
onClick: onBack,
|
|
64
42
|
'aria-label': 'Вернуться назад',
|
|
65
43
|
'data-testid': 'screen:back',
|
|
@@ -68,7 +46,7 @@ const HeaderSlot = (_a) => {
|
|
|
68
46
|
? {
|
|
69
47
|
// ВАЖНО: не подмешиваем свойства из buttons.end
|
|
70
48
|
// чтобы не распылять конфигурацию одной и той же кнопки по нескольким местам
|
|
71
|
-
icon:
|
|
49
|
+
icon: (0, jsx_runtime_1.jsx)(Cross_1.default, {}),
|
|
72
50
|
onClick: onClose,
|
|
73
51
|
'aria-label': `Закрыть ${title || ''}`.trim(),
|
|
74
52
|
'data-testid': 'screen:close',
|
|
@@ -90,12 +68,12 @@ exports.BodySlot = (0, react_1.forwardRef)(function BodySlot({ children }, outer
|
|
|
90
68
|
(0, hooks_1.useInfiniteScroll)(ref, { onFullScroll, threshold: fullScrollThreshold });
|
|
91
69
|
return (
|
|
92
70
|
// ВАЖНО: элемент с ref должен выводиться всегда (без условий), т.к. он нужен для блокировки прокрутки
|
|
93
|
-
|
|
71
|
+
(0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: screen_module_scss_1.default.body, "data-testid": 'screen:body' }, { children: loading ? ((0, jsx_runtime_1.jsx)(loading_overlay_1.LoadingOverlay, Object.assign({}, loadingOverlayProps, { fill: false, style: { height: '100%' } }))) : (children) })));
|
|
94
72
|
});
|
|
95
73
|
/**
|
|
96
74
|
* Слот футера экрана.
|
|
97
75
|
* @param props Свойства.
|
|
98
76
|
* @return Элемент.
|
|
99
77
|
*/
|
|
100
|
-
const FooterSlot = ({ children }) =>
|
|
78
|
+
const FooterSlot = ({ children }) => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
101
79
|
exports.FooterSlot = FooterSlot;
|
package/select/parts/block.js
CHANGED
|
@@ -1,38 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.SelectFieldBlock = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const utils_1 = require("../utils");
|
|
32
10
|
const field_block_1 = require("../../field-block");
|
|
33
11
|
const colors_1 = require("../../colors");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
12
|
+
const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
|
|
13
|
+
const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
|
|
36
14
|
const block_module_scss_1 = __importDefault(require("./block.module.scss"));
|
|
37
15
|
const classnames_1 = __importDefault(require("classnames"));
|
|
38
16
|
/**
|
|
@@ -44,12 +22,12 @@ function SelectFieldBlock(props) {
|
|
|
44
22
|
var _a;
|
|
45
23
|
const binding = (0, react_1.useContext)(utils_1.SelectContext);
|
|
46
24
|
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
47
|
-
const ArrowSVG = binding.opened ?
|
|
25
|
+
const ArrowSVG = binding.opened ? Up_1.default : Down_1.default;
|
|
48
26
|
// @todo прокидывать ref в props.blockRef при необходимости
|
|
49
27
|
const ref = (0, react_1.useRef)(null);
|
|
50
28
|
(0, react_1.useImperativeHandle)(binding.anchorRef, () => ref.current);
|
|
51
29
|
(0, react_1.useImperativeHandle)(binding.openerRef, () => ref.current);
|
|
52
|
-
return (
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(field_block_1.FieldBlock, Object.assign({ label: binding.label, adornmentEnd: (0, jsx_runtime_1.jsx)(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray24') }) }, props, { failed: binding.failed, disabled: binding.disabled, fixedHeight: true, blockRef: ref, blockProps: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.blockProps), { onFocus: event => {
|
|
53
31
|
var _a, _b;
|
|
54
32
|
setFocused(true);
|
|
55
33
|
(_b = (_a = props.blockProps) === null || _a === void 0 ? void 0 : _a.onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
package/select/parts/button.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,11 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.SelectTextButton = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const text_button_1 = require("../../text-button");
|
|
43
21
|
const utils_1 = require("../utils");
|
|
44
|
-
const
|
|
45
|
-
const
|
|
22
|
+
const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
|
|
23
|
+
const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
|
|
46
24
|
/**
|
|
47
25
|
* Компонент открывашки в виде текстовой кнопки.
|
|
48
26
|
* @param props Свойства.
|
|
@@ -52,11 +30,11 @@ function SelectTextButton(_a) {
|
|
|
52
30
|
var { buttonRef: buttonRefProp, children, onKeyDown, onMouseDown } = _a, props = __rest(_a, ["buttonRef", "children", "onKeyDown", "onMouseDown"]);
|
|
53
31
|
const buttonRef = (0, react_1.useRef)(null);
|
|
54
32
|
const binding = (0, react_1.useContext)(utils_1.SelectContext);
|
|
55
|
-
const ArrowSVG = binding.opened ?
|
|
33
|
+
const ArrowSVG = binding.opened ? Up_1.default : Down_1.default;
|
|
56
34
|
(0, react_1.useImperativeHandle)(buttonRefProp, () => buttonRef.current);
|
|
57
35
|
(0, react_1.useImperativeHandle)(binding.anchorRef, () => buttonRef.current);
|
|
58
36
|
(0, react_1.useImperativeHandle)(binding.openerRef, () => buttonRef.current);
|
|
59
|
-
return (
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(text_button_1.TextButton, Object.assign({ iconGutter: 4, endIcon: ArrowSVG }, props, { as: 'button', onMouseDown: event => {
|
|
60
38
|
var _a;
|
|
61
39
|
(_a = binding.onMouseDown) === null || _a === void 0 ? void 0 : _a.call(binding, event);
|
|
62
40
|
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
|
|
@@ -64,6 +42,6 @@ function SelectTextButton(_a) {
|
|
|
64
42
|
var _a;
|
|
65
43
|
(_a = binding.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(binding, event);
|
|
66
44
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
67
|
-
}, disabled: binding.disabled, buttonRef: buttonRef, role: 'combobox' }
|
|
45
|
+
}, disabled: binding.disabled, buttonRef: buttonRef, role: 'combobox' }, { children: children !== null && children !== void 0 ? children : (binding.value || binding.label) })));
|
|
68
46
|
}
|
|
69
47
|
exports.SelectTextButton = SelectTextButton;
|
package/select/parts/menu.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,7 +15,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.SelectMenu = void 0;
|
|
41
|
-
const react_1 =
|
|
18
|
+
const react_1 = require("react");
|
|
19
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
|
+
const react_2 = require("react");
|
|
42
21
|
const dropdown_1 = require("../../dropdown");
|
|
43
22
|
const dropdown_item_1 = require("../../dropdown-item");
|
|
44
23
|
const utils_1 = require("../../dropdown-item/utils");
|
|
@@ -56,13 +35,13 @@ const MenuItemAttr = {
|
|
|
56
35
|
*/
|
|
57
36
|
function SelectMenu(_a) {
|
|
58
37
|
var { loading, children, menuRef, value, onKeyDown, onItemSelect } = _a, restProps = __rest(_a, ["loading", "children", "menuRef", "value", "onKeyDown", "onItemSelect"]);
|
|
59
|
-
const ref = (0,
|
|
60
|
-
const osComponentRef = (0,
|
|
61
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
62
|
-
const items =
|
|
63
|
-
(0,
|
|
38
|
+
const ref = (0, react_2.useRef)(null);
|
|
39
|
+
const osComponentRef = (0, react_2.useRef)(null);
|
|
40
|
+
const [activeIndex, setActiveIndex] = (0, react_2.useState)(-1);
|
|
41
|
+
const items = react_2.Children.toArray(children).filter(utils_1.DropdownItemUtils.is);
|
|
42
|
+
(0, react_2.useImperativeHandle)(menuRef, () => ref.current);
|
|
64
43
|
// прокрутка до элемента списка
|
|
65
|
-
(0,
|
|
44
|
+
(0, react_2.useEffect)(() => {
|
|
66
45
|
var _a, _b;
|
|
67
46
|
const menu = ref.current;
|
|
68
47
|
const itemSelector = `[${MenuItemAttr.name}="${MenuItemAttr.value}"]`;
|
|
@@ -74,7 +53,7 @@ function SelectMenu(_a) {
|
|
|
74
53
|
});
|
|
75
54
|
}
|
|
76
55
|
}, [activeIndex]);
|
|
77
|
-
const handleMenuKeyDown = (0,
|
|
56
|
+
const handleMenuKeyDown = (0, react_2.useCallback)(event => {
|
|
78
57
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
79
58
|
switch (event.code) {
|
|
80
59
|
case 'Enter': {
|
|
@@ -93,13 +72,13 @@ function SelectMenu(_a) {
|
|
|
93
72
|
break;
|
|
94
73
|
}
|
|
95
74
|
}, [items, activeIndex, onKeyDown]);
|
|
96
|
-
const handleItemClick = (0,
|
|
75
|
+
const handleItemClick = (0, react_2.useCallback)((item) => item.props.disabled
|
|
97
76
|
? undefined
|
|
98
77
|
: event => {
|
|
99
78
|
var _a, _b;
|
|
100
79
|
(_b = (_a = item.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
101
80
|
onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(item);
|
|
102
81
|
}, [onItemSelect]);
|
|
103
|
-
return (
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({}, restProps, { ref: ref, tabIndex: 0, role: 'listbox', onKeyDown: handleMenuKeyDown, className: (0, classnames_1.default)(menu_module_scss_1.default.menu, restProps.className), customScrollbarProps: { osComponentRef } }, { children: loading ? ((0, jsx_runtime_1.jsx)(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (items.map((item, index) => ((0, react_1.createElement)(dropdown_item_1.DropdownItem, Object.assign({ checked: activeIndex === index, selected: value === utils_1.DropdownItemUtils.getValue(item) }, item.props, { key: index, role: 'option', onClick: handleItemClick(item) }, { [MenuItemAttr.name]: MenuItemAttr.value }))))) })));
|
|
104
83
|
}
|
|
105
84
|
exports.SelectMenu = SelectMenu;
|
package/select/select.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -35,7 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
12
|
};
|
|
36
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
14
|
exports.Select = void 0;
|
|
38
|
-
const
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
39
17
|
const utils_1 = require("./utils");
|
|
40
18
|
const identity_1 = require("../hooks/identity");
|
|
41
19
|
const utils_2 = require("../dropdown-item/utils");
|
|
@@ -49,7 +27,7 @@ const utils_3 = require("../dropdown/utils");
|
|
|
49
27
|
* @param props Свойства.
|
|
50
28
|
* @return Элемент.
|
|
51
29
|
*/
|
|
52
|
-
function Select({ children, disabled, failed, loading, onValueChange, onMenuToggle, value, defaultValue, label, opener =
|
|
30
|
+
function Select({ children, disabled, failed, loading, onValueChange, onMenuToggle, value, defaultValue, label, opener = (0, jsx_runtime_1.jsx)(block_1.SelectFieldBlock, {}), renderValue = v => v, dropdownProps, }) {
|
|
53
31
|
// @todo по аналогии с <select /> надо проверять, есть ли значение в списке переданных
|
|
54
32
|
const [initialValue] = (0, react_1.useState)(() => { var _a; return (_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : ''; });
|
|
55
33
|
const [currentValue, setCurrentValue] = (0, react_1.useState)(initialValue);
|
|
@@ -136,9 +114,7 @@ function Select({ children, disabled, failed, loading, onValueChange, onMenuTogg
|
|
|
136
114
|
setNeedMenu(false);
|
|
137
115
|
(_a = openerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
138
116
|
} });
|
|
139
|
-
return (
|
|
140
|
-
react_1.default.createElement(utils_1.SelectContext.Provider, { value: openerBinding }, (0, react_1.isValidElement)(opener) && opener),
|
|
141
|
-
react_1.default.createElement(react_2.FloatingPortal, { id: '' }, needMenu && react_1.default.createElement(menu_1.SelectMenu, Object.assign({}, menuProps), children))));
|
|
117
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(utils_1.SelectContext.Provider, Object.assign({ value: openerBinding }, { children: (0, react_1.isValidElement)(opener) && opener })), (0, jsx_runtime_1.jsx)(react_2.FloatingPortal, Object.assign({ id: '' }, { children: needMenu && (0, jsx_runtime_1.jsx)(menu_1.SelectMenu, Object.assign({}, menuProps, { children: children })) }))] }));
|
|
142
118
|
}
|
|
143
119
|
exports.Select = Select;
|
|
144
120
|
Select.FieldBlock = block_1.SelectFieldBlock;
|