@alfalab/core-components-select 9.4.4 → 9.7.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/CHANGELOG.md +41 -0
- package/dist/Component.d.ts +3 -3
- package/dist/Component.js +1 -1
- package/dist/components/arrow/Component.js +1 -1
- package/dist/components/arrow/index.css +3 -8
- package/dist/components/base-select/Component.js +22 -7
- package/dist/components/base-select/index.css +7 -10
- package/dist/components/base-select/index.js +1 -1
- package/dist/components/checkmark/Component.js +1 -1
- package/dist/components/checkmark/index.css +3 -6
- package/dist/components/field/Component.d.ts +1 -1
- package/dist/components/field/Component.js +2 -2
- package/dist/components/field/index.css +9 -12
- package/dist/components/field/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/native-select/Component.js +1 -1
- package/dist/components/native-select/index.js +1 -1
- package/dist/components/optgroup/Component.js +1 -1
- package/dist/components/optgroup/index.css +6 -9
- package/dist/components/option/Component.js +2 -2
- package/dist/components/option/index.css +20 -23
- package/dist/components/option/index.js +1 -1
- package/dist/components/options-list/Component.js +1 -1
- package/dist/components/options-list/index.css +5 -8
- package/dist/components/virtual-options-list/Component.js +1 -1
- package/dist/components/virtual-options-list/index.css +11 -14
- package/dist/cssm/Component.d.ts +3 -3
- package/dist/cssm/components/arrow/index.module.css +0 -5
- package/dist/cssm/components/base-select/Component.js +20 -5
- package/dist/cssm/components/base-select/index.module.css +0 -3
- package/dist/cssm/components/checkmark/index.module.css +0 -3
- package/dist/cssm/components/field/Component.d.ts +1 -1
- package/dist/cssm/components/field/index.module.css +0 -3
- package/dist/cssm/components/optgroup/index.module.css +0 -3
- package/dist/cssm/components/option/index.module.css +0 -3
- package/dist/cssm/components/options-list/index.module.css +0 -3
- package/dist/cssm/components/virtual-options-list/index.module.css +0 -3
- package/dist/cssm/typings.d.ts +6 -2
- package/dist/esm/Component.d.ts +3 -3
- package/dist/esm/Component.js +1 -1
- package/dist/esm/components/arrow/Component.js +1 -1
- package/dist/esm/components/arrow/index.css +3 -8
- package/dist/esm/components/base-select/Component.js +22 -7
- package/dist/esm/components/base-select/index.css +7 -10
- package/dist/esm/components/base-select/index.js +1 -1
- package/dist/esm/components/checkmark/Component.js +1 -1
- package/dist/esm/components/checkmark/index.css +3 -6
- package/dist/esm/components/field/Component.d.ts +1 -1
- package/dist/esm/components/field/Component.js +2 -2
- package/dist/esm/components/field/index.css +9 -12
- package/dist/esm/components/field/index.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/native-select/Component.js +1 -1
- package/dist/esm/components/native-select/index.js +1 -1
- package/dist/esm/components/optgroup/Component.js +1 -1
- package/dist/esm/components/optgroup/index.css +6 -9
- package/dist/esm/components/option/Component.js +2 -2
- package/dist/esm/components/option/index.css +20 -23
- package/dist/esm/components/option/index.js +1 -1
- package/dist/esm/components/options-list/Component.js +1 -1
- package/dist/esm/components/options-list/index.css +5 -8
- package/dist/esm/components/virtual-options-list/Component.js +1 -1
- package/dist/esm/components/virtual-options-list/index.css +11 -14
- package/dist/esm/index.js +1 -1
- package/dist/esm/presets/index.js +1 -1
- package/dist/esm/presets/useLazyLoading/hook.js +2 -2
- package/dist/esm/presets/useLazyLoading/index.css +2 -2
- package/dist/esm/presets/useSelectWithLoading/hook.js +2 -2
- package/dist/esm/presets/useSelectWithLoading/index.css +2 -2
- package/dist/esm/{tslib.es6-16156773.d.ts → tslib.es6-0285a9f7.d.ts} +0 -0
- package/dist/esm/{tslib.es6-16156773.js → tslib.es6-0285a9f7.js} +0 -0
- package/dist/esm/typings.d.ts +6 -2
- package/dist/index.js +1 -1
- package/dist/modern/Component.d.ts +3 -3
- package/dist/modern/components/arrow/Component.js +1 -1
- package/dist/modern/components/arrow/index.css +3 -8
- package/dist/modern/components/base-select/Component.js +21 -6
- package/dist/modern/components/base-select/index.css +7 -10
- package/dist/modern/components/checkmark/Component.js +1 -1
- package/dist/modern/components/checkmark/index.css +3 -6
- package/dist/modern/components/field/Component.d.ts +1 -1
- package/dist/modern/components/field/Component.js +1 -1
- package/dist/modern/components/field/index.css +9 -12
- package/dist/modern/components/optgroup/Component.js +1 -1
- package/dist/modern/components/optgroup/index.css +6 -9
- package/dist/modern/components/option/Component.js +1 -1
- package/dist/modern/components/option/index.css +20 -23
- package/dist/modern/components/options-list/Component.js +1 -1
- package/dist/modern/components/options-list/index.css +5 -8
- package/dist/modern/components/virtual-options-list/Component.js +1 -1
- package/dist/modern/components/virtual-options-list/index.css +11 -14
- package/dist/modern/presets/useLazyLoading/hook.js +1 -1
- package/dist/modern/presets/useLazyLoading/index.css +2 -2
- package/dist/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/dist/modern/presets/useSelectWithLoading/index.css +2 -2
- package/dist/modern/typings.d.ts +6 -2
- package/dist/presets/index.js +1 -1
- package/dist/presets/useLazyLoading/hook.js +2 -2
- package/dist/presets/useLazyLoading/index.css +2 -2
- package/dist/presets/useSelectWithLoading/hook.js +2 -2
- package/dist/presets/useSelectWithLoading/index.css +2 -2
- package/dist/{tslib.es6-e98a9028.d.ts → tslib.es6-8e873691.d.ts} +0 -0
- package/dist/{tslib.es6-e98a9028.js → tslib.es6-8e873691.js} +0 -0
- package/dist/typings.d.ts +6 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,47 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.7.1](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-select@9.7.0...@alfalab/core-components-select@9.7.1) (2021-10-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @alfalab/core-components-select
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [9.7.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-select@9.6.0...@alfalab/core-components-select@9.7.0) (2021-10-11)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* проставлен role=alert для ошибок ([#850](https://github.com/alfa-laboratory/core-components/issues/850)) ([dc634a3](https://github.com/alfa-laboratory/core-components/commit/dc634a3d008accfab10192ce234c12ef0ecc7fa9))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [9.6.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-select@9.5.0...@alfalab/core-components-select@9.6.0) (2021-09-27)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **select:** controlled open ([#839](https://github.com/alfa-laboratory/core-components/issues/839)) ([95d0470](https://github.com/alfa-laboratory/core-components/commit/95d0470a86e1a54f4cb4b789bb7e3281a1f0a401))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# [9.5.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-select@9.4.4...@alfalab/core-components-select@9.5.0) (2021-09-14)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* change error type to ReactNode ([#825](https://github.com/alfa-laboratory/core-components/issues/825)) ([c6d95c1](https://github.com/alfa-laboratory/core-components/commit/c6d95c1c6239f2b2a3bf2c1639554d8500e794f3))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
6
47
|
## [9.4.4](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-select@9.4.3...@alfalab/core-components-select@9.4.4) (2021-09-08)
|
|
7
48
|
|
|
8
49
|
|
package/dist/Component.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ type FormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
30
30
|
/**
|
|
31
31
|
* Отображение ошибки
|
|
32
32
|
*/
|
|
33
|
-
error?:
|
|
33
|
+
error?: ReactNode | boolean;
|
|
34
34
|
/**
|
|
35
35
|
* Текст подсказки
|
|
36
36
|
*/
|
|
@@ -82,7 +82,7 @@ type SelectProps = Omit<BaseSelectProps, 'fieldProps'> & {
|
|
|
82
82
|
*/
|
|
83
83
|
fieldProps?: FormControlProps & Record<string, unknown>;
|
|
84
84
|
};
|
|
85
|
-
declare const Select: React.ForwardRefExoticComponent<Pick<BaseSelectProps, "block" | "size" | "className" | "fieldClassName" | "disabled" | "error" | "hint" | "label" | "dataTestId" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "onScroll" | "preventFlip" | "name" | "options" | "multiple" | "selected" | "valueRenderer" | "Optgroup" | "visibleOptions" | "Arrow" | "Option" | "optionsListClassName" | "optionClassName" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "circularNavigation" | "nativeSelect" | "defaultOpen" | "popoverPosition" | "optionsListWidth" | "optionsSize" | "optionsListProps" | "optionProps" | "onOpen" | "Field" | "OptionsList" | "updatePopover" | "showEmptyOptionsList"> & {
|
|
85
|
+
declare const Select: React.ForwardRefExoticComponent<Pick<BaseSelectProps, "block" | "size" | "className" | "fieldClassName" | "disabled" | "error" | "hint" | "label" | "dataTestId" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "onScroll" | "preventFlip" | "open" | "name" | "options" | "multiple" | "selected" | "valueRenderer" | "Optgroup" | "visibleOptions" | "Arrow" | "Option" | "optionsListClassName" | "optionClassName" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "circularNavigation" | "nativeSelect" | "defaultOpen" | "popoverPosition" | "optionsListWidth" | "optionsSize" | "optionsListProps" | "optionProps" | "onOpen" | "Field" | "OptionsList" | "updatePopover" | "showEmptyOptionsList"> & {
|
|
86
86
|
/**
|
|
87
87
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
88
88
|
*/
|
|
@@ -93,7 +93,7 @@ declare const Select: React.ForwardRefExoticComponent<Pick<BaseSelectProps, "blo
|
|
|
93
93
|
disabled?: boolean | undefined;
|
|
94
94
|
filled?: boolean | undefined;
|
|
95
95
|
focused?: boolean | undefined;
|
|
96
|
-
error?:
|
|
96
|
+
error?: React.ReactNode;
|
|
97
97
|
hint?: React.ReactNode;
|
|
98
98
|
label?: React.ReactNode;
|
|
99
99
|
leftAddons?: React.ReactNode;
|
package/dist/Component.js
CHANGED
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
11
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
12
12
|
|
|
13
|
-
var styles = {"arrow":"
|
|
13
|
+
var styles = {"arrow":"select__arrow_14ac7","open":"select__open_14ac7"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var Arrow = function (_a) {
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
:root {
|
|
3
|
-
|
|
4
|
-
/* TODO: цвета добавлены руками. Обновить токены */
|
|
5
|
-
--color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
|
|
6
|
-
}
|
|
1
|
+
/* hash: 14ac7 */
|
|
7
2
|
:root {
|
|
8
3
|
|
|
9
4
|
/* Hard */
|
|
@@ -26,7 +21,7 @@
|
|
|
26
21
|
|
|
27
22
|
/* optgroup */
|
|
28
23
|
}
|
|
29
|
-
.
|
|
24
|
+
.select__arrow_14ac7 {
|
|
30
25
|
display: block;
|
|
31
26
|
width: 24px;
|
|
32
27
|
height: 24px;
|
|
@@ -36,6 +31,6 @@
|
|
|
36
31
|
background-position: center;
|
|
37
32
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
38
33
|
}
|
|
39
|
-
.
|
|
34
|
+
.select__open_14ac7 {
|
|
40
35
|
transform: var(--arrow-transform);
|
|
41
36
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-8e873691.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var utils = require('../../utils.js');
|
|
@@ -23,12 +23,12 @@ var getDataTestId = function (dataTestId, element) {
|
|
|
23
23
|
return dataTestId ? "" + dataTestId + elementPart : undefined;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
var styles = {"component":"
|
|
26
|
+
var styles = {"component":"select__component_6wx3t","popoverInner":"select__popoverInner_6wx3t","optionsList":"select__optionsList_6wx3t","nativeSelect":"select__nativeSelect_6wx3t","block":"select__block_6wx3t"};
|
|
27
27
|
require('./index.css')
|
|
28
28
|
|
|
29
29
|
var BaseSelect = React.forwardRef(function (_a, ref) {
|
|
30
30
|
var _b;
|
|
31
|
-
var dataTestId = _a.dataTestId, className = _a.className, fieldClassName = _a.fieldClassName, optionsListClassName = _a.optionsListClassName, optionClassName = _a.optionClassName, options = _a.options, _c = _a.autocomplete, autocomplete = _c === void 0 ? false : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.allowUnselect, allowUnselect = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.closeOnSelect, closeOnSelect = _g === void 0 ? !multiple : _g, _h = _a.circularNavigation, circularNavigation = _h === void 0 ? false : _h, _j = _a.nativeSelect, nativeSelect = _j === void 0 ? false : _j, _k = _a.defaultOpen, defaultOpen = _k === void 0 ? false : _k, _l = _a.popoverPosition, popoverPosition = _l === void 0 ? 'bottom-start' : _l, _m = _a.preventFlip, preventFlip = _m === void 0 ? true : _m, _o = _a.optionsListWidth, optionsListWidth = _o === void 0 ? 'content' : _o, name = _a.name, id = _a.id, selected = _a.selected, _p = _a.size, size = _p === void 0 ? 's' : _p, _q = _a.optionsSize, optionsSize = _q === void 0 ? size : _q, error = _a.error, hint = _a.hint, block = _a.block, label = _a.label, placeholder = _a.placeholder, _r = _a.fieldProps, fieldProps = _r === void 0 ? {} : _r, _s = _a.optionsListProps, optionsListProps = _s === void 0 ? {} : _s, _t = _a.optionProps, optionProps = _t === void 0 ? {} : _t, valueRenderer = _a.valueRenderer, onChange = _a.onChange, onOpen = _a.onOpen, onFocus = _a.onFocus, onBlur = _a.onBlur, onScroll = _a.onScroll, Arrow = _a.Arrow, _u = _a.Field, Field = _u === void 0 ? function () { return null; } : _u, _v = _a.OptionsList, OptionsList = _v === void 0 ? function () { return null; } : _v, _w = _a.Optgroup, Optgroup = _w === void 0 ? function () { return null; } : _w, _x = _a.Option, Option = _x === void 0 ? function () { return null; } : _x, updatePopover = _a.updatePopover, _y = _a.showEmptyOptionsList, showEmptyOptionsList = _y === void 0 ? false : _y, visibleOptions = _a.visibleOptions;
|
|
31
|
+
var dataTestId = _a.dataTestId, className = _a.className, fieldClassName = _a.fieldClassName, optionsListClassName = _a.optionsListClassName, optionClassName = _a.optionClassName, options = _a.options, _c = _a.autocomplete, autocomplete = _c === void 0 ? false : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.allowUnselect, allowUnselect = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.closeOnSelect, closeOnSelect = _g === void 0 ? !multiple : _g, _h = _a.circularNavigation, circularNavigation = _h === void 0 ? false : _h, _j = _a.nativeSelect, nativeSelect = _j === void 0 ? false : _j, _k = _a.defaultOpen, defaultOpen = _k === void 0 ? false : _k, openProp = _a.open, _l = _a.popoverPosition, popoverPosition = _l === void 0 ? 'bottom-start' : _l, _m = _a.preventFlip, preventFlip = _m === void 0 ? true : _m, _o = _a.optionsListWidth, optionsListWidth = _o === void 0 ? 'content' : _o, name = _a.name, id = _a.id, selected = _a.selected, _p = _a.size, size = _p === void 0 ? 's' : _p, _q = _a.optionsSize, optionsSize = _q === void 0 ? size : _q, error = _a.error, hint = _a.hint, block = _a.block, label = _a.label, placeholder = _a.placeholder, _r = _a.fieldProps, fieldProps = _r === void 0 ? {} : _r, _s = _a.optionsListProps, optionsListProps = _s === void 0 ? {} : _s, _t = _a.optionProps, optionProps = _t === void 0 ? {} : _t, valueRenderer = _a.valueRenderer, onChange = _a.onChange, onOpen = _a.onOpen, onFocus = _a.onFocus, onBlur = _a.onBlur, onScroll = _a.onScroll, Arrow = _a.Arrow, _u = _a.Field, Field = _u === void 0 ? function () { return null; } : _u, _v = _a.OptionsList, OptionsList = _v === void 0 ? function () { return null; } : _v, _w = _a.Optgroup, Optgroup = _w === void 0 ? function () { return null; } : _w, _x = _a.Option, Option = _x === void 0 ? function () { return null; } : _x, updatePopover = _a.updatePopover, _y = _a.showEmptyOptionsList, showEmptyOptionsList = _y === void 0 ? false : _y, visibleOptions = _a.visibleOptions;
|
|
32
32
|
var rootRef = React.useRef(null);
|
|
33
33
|
var fieldRef = React.useRef(null);
|
|
34
34
|
var listRef = React.useRef(null);
|
|
@@ -64,16 +64,25 @@ var BaseSelect = React.forwardRef(function (_a, ref) {
|
|
|
64
64
|
var _0 = downshift.useMultipleSelection(useMultipleSelectionProps), selectedItems = _0.selectedItems, addSelectedItem = _0.addSelectedItem, setSelectedItems = _0.setSelectedItems, removeSelectedItem = _0.removeSelectedItem, getDropdownProps = _0.getDropdownProps;
|
|
65
65
|
var _1 = downshift.useCombobox({
|
|
66
66
|
id: id,
|
|
67
|
+
isOpen: openProp,
|
|
67
68
|
circularNavigation: circularNavigation,
|
|
68
69
|
items: flatOptions,
|
|
69
70
|
itemToString: itemToString,
|
|
70
71
|
defaultHighlightedIndex: selectedItems.length === 0 ? -1 : undefined,
|
|
71
72
|
onIsOpenChange: function (changes) {
|
|
72
73
|
if (onOpen) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Вызываем обработчик асинхронно.
|
|
76
|
+
*
|
|
77
|
+
* Иначе при клике вне открытого селекта сначала сработает onOpen, который закроет селект,
|
|
78
|
+
* А затем сработает onClick кнопки открытия\закрытия с open=false и в итоге селект откроется снова.
|
|
79
|
+
*/
|
|
80
|
+
setTimeout(function () {
|
|
81
|
+
onOpen({
|
|
82
|
+
open: changes.isOpen,
|
|
83
|
+
name: name,
|
|
84
|
+
});
|
|
85
|
+
}, 0);
|
|
77
86
|
}
|
|
78
87
|
},
|
|
79
88
|
stateReducer: function (state, actionAndChanges) {
|
|
@@ -177,6 +186,12 @@ var BaseSelect = React.forwardRef(function (_a, ref) {
|
|
|
177
186
|
if (defaultOpen)
|
|
178
187
|
openMenu();
|
|
179
188
|
}, [defaultOpen, openMenu]);
|
|
189
|
+
React.useEffect(function () {
|
|
190
|
+
if (openProp) {
|
|
191
|
+
openMenu();
|
|
192
|
+
}
|
|
193
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
194
|
+
}, []);
|
|
180
195
|
var calcOptionsListWidth = React.useCallback(function () {
|
|
181
196
|
if (listRef.current) {
|
|
182
197
|
var widthAttr = optionsListWidth === 'field' ? 'width' : 'minWidth';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 6wx3t */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
|
-
|
|
5
|
-
/* TODO: цвета добавлены руками. Обновить токены */
|
|
6
|
-
--color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
|
|
7
4
|
}
|
|
8
5
|
:root {
|
|
9
6
|
--shadow-s: 0 0 8px rgba(11, 31, 53, 0.04), 0 4px 8px rgba(11, 31, 53, 0.08);
|
|
@@ -31,12 +28,12 @@
|
|
|
31
28
|
|
|
32
29
|
/* optgroup */
|
|
33
30
|
}
|
|
34
|
-
.
|
|
31
|
+
.select__component_6wx3t {
|
|
35
32
|
width: max-content;
|
|
36
33
|
position: relative;
|
|
37
34
|
outline: 0;
|
|
38
35
|
}
|
|
39
|
-
.
|
|
36
|
+
.select__popoverInner_6wx3t {
|
|
40
37
|
padding-top: var(--select-options-list-offset);
|
|
41
38
|
padding-bottom: var(--select-options-list-offset);
|
|
42
39
|
box-shadow: none;
|
|
@@ -45,7 +42,7 @@
|
|
|
45
42
|
border-radius: 0;
|
|
46
43
|
position: relative;
|
|
47
44
|
}
|
|
48
|
-
.
|
|
45
|
+
.select__optionsList_6wx3t {
|
|
49
46
|
padding-top: var(--select-options-list-top-padding);
|
|
50
47
|
padding-bottom: var(--select-options-list-bottom-padding);
|
|
51
48
|
box-shadow: var(--select-options-list-box-shadow);
|
|
@@ -54,7 +51,7 @@
|
|
|
54
51
|
overflow: hidden;
|
|
55
52
|
will-change: transform;
|
|
56
53
|
}
|
|
57
|
-
.
|
|
54
|
+
.select__nativeSelect_6wx3t {
|
|
58
55
|
opacity: 0;
|
|
59
56
|
overflow: hidden;
|
|
60
57
|
position: absolute;
|
|
@@ -68,12 +65,12 @@
|
|
|
68
65
|
cursor: pointer;
|
|
69
66
|
z-index: 1;
|
|
70
67
|
}
|
|
71
|
-
.
|
|
68
|
+
.select__block_6wx3t {
|
|
72
69
|
width: 100%;
|
|
73
70
|
}
|
|
74
71
|
/* width: max-content; fix for IE */
|
|
75
72
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
76
|
-
.
|
|
73
|
+
.select__component_6wx3t {
|
|
77
74
|
float: left;
|
|
78
75
|
clear: left;
|
|
79
76
|
}
|
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
11
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
12
12
|
|
|
13
|
-
var styles = {"checkmark":"
|
|
13
|
+
var styles = {"checkmark":"select__checkmark_6z46i","selected":"select__selected_6z46i"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var Checkmark = function (_a) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 6z46i */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-graphic-primary: #0b1f35;
|
|
4
|
-
|
|
5
|
-
/* TODO: цвета добавлены руками. Обновить токены */
|
|
6
|
-
--color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
|
|
7
4
|
}
|
|
8
5
|
:root {
|
|
9
6
|
|
|
@@ -36,7 +33,7 @@
|
|
|
36
33
|
|
|
37
34
|
/* optgroup */
|
|
38
35
|
}
|
|
39
|
-
.
|
|
36
|
+
.select__checkmark_6z46i {
|
|
40
37
|
display: flex;
|
|
41
38
|
align-items: center;
|
|
42
39
|
justify-content: center;
|
|
@@ -50,6 +47,6 @@
|
|
|
50
47
|
width: var(--select-checkmark-size);
|
|
51
48
|
height: var(--select-checkmark-size);
|
|
52
49
|
}
|
|
53
|
-
.
|
|
50
|
+
.select__selected_6z46i {
|
|
54
51
|
opacity: 1;
|
|
55
52
|
}
|
|
@@ -8,7 +8,7 @@ declare const Field: ({ size, open, multiple, error, hint, disabled, label, plac
|
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
filled?: boolean | undefined;
|
|
10
10
|
focused?: boolean | undefined;
|
|
11
|
-
error?:
|
|
11
|
+
error?: React.ReactNode;
|
|
12
12
|
hint?: React.ReactNode;
|
|
13
13
|
label?: React.ReactNode;
|
|
14
14
|
leftAddons?: React.ReactNode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-8e873691.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var hooks = require('@alfalab/hooks');
|
|
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
15
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
16
16
|
|
|
17
|
-
var styles = {"component":"
|
|
17
|
+
var styles = {"component":"select__component_13cpz","field":"select__field_13cpz","disabled":"select__disabled_13cpz","arrow":"select__arrow_13cpz","placeholder":"select__placeholder_13cpz","contentWrapper":"select__contentWrapper_13cpz","value":"select__value_13cpz","focusVisible":"select__focusVisible_13cpz"};
|
|
18
18
|
require('./index.css')
|
|
19
19
|
|
|
20
20
|
var Field = function (_a) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 13cpz */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-link: #007aff;
|
|
4
4
|
--color-light-text-secondary: #546272;
|
|
5
|
-
|
|
6
|
-
/* TODO: цвета добавлены руками. Обновить токены */
|
|
7
|
-
--color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
|
|
8
5
|
}
|
|
9
6
|
:root {
|
|
10
7
|
|
|
@@ -29,24 +26,24 @@
|
|
|
29
26
|
|
|
30
27
|
/* optgroup */
|
|
31
28
|
}
|
|
32
|
-
.
|
|
29
|
+
.select__component_13cpz {
|
|
33
30
|
width: 100%;
|
|
34
31
|
outline: none;
|
|
35
32
|
}
|
|
36
|
-
.
|
|
33
|
+
.select__field_13cpz:not(.select__disabled_13cpz) {
|
|
37
34
|
cursor: pointer
|
|
38
35
|
}
|
|
39
|
-
.
|
|
36
|
+
.select__field_13cpz:not(.select__disabled_13cpz):hover .select__arrow_13cpz {
|
|
40
37
|
opacity: var(--select-arrow-hover-opacity);
|
|
41
38
|
}
|
|
42
|
-
.
|
|
39
|
+
.select__disabled_13cpz {
|
|
43
40
|
cursor: var(--disabled-cursor);
|
|
44
41
|
}
|
|
45
42
|
/* TODO: Заюзать переменные из инпута */
|
|
46
|
-
.
|
|
43
|
+
.select__placeholder_13cpz {
|
|
47
44
|
color: var(--color-light-text-secondary);
|
|
48
45
|
}
|
|
49
|
-
.
|
|
46
|
+
.select__contentWrapper_13cpz {
|
|
50
47
|
font-size: 16px;
|
|
51
48
|
line-height: 20px;
|
|
52
49
|
font-weight: 400;
|
|
@@ -56,12 +53,12 @@
|
|
|
56
53
|
overflow: hidden;
|
|
57
54
|
width: 100%;
|
|
58
55
|
}
|
|
59
|
-
.
|
|
56
|
+
.select__value_13cpz {
|
|
60
57
|
overflow: hidden;
|
|
61
58
|
text-overflow: ellipsis;
|
|
62
59
|
text-align: left;
|
|
63
60
|
}
|
|
64
|
-
.
|
|
61
|
+
.select__focusVisible_13cpz {
|
|
65
62
|
outline: 2px solid var(--focus-color);
|
|
66
63
|
outline-offset: 2px;
|
|
67
64
|
}
|
package/dist/components/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('../../tslib.es6-
|
|
5
|
+
require('../../tslib.es6-8e873691.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('../../utils.js');
|
|
8
8
|
var components_nativeSelect_Component = require('./Component.js');
|
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
11
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
12
12
|
|
|
13
|
-
var styles = {"optgroup":"
|
|
13
|
+
var styles = {"optgroup":"select__optgroup_11cr7","label":"select__label_11cr7","l":"select__l_11cr7","xl":"select__xl_11cr7"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var Optgroup = function (_a) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 11cr7 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-text-secondary: #546272;
|
|
5
|
-
|
|
6
|
-
/* TODO: цвета добавлены руками. Обновить токены */
|
|
7
|
-
--color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
|
|
8
5
|
}
|
|
9
6
|
:root {
|
|
10
7
|
|
|
@@ -36,7 +33,7 @@
|
|
|
36
33
|
--select-optgroup-l-left-padding: var(--gap-m);
|
|
37
34
|
--select-optgroup-l-right-padding: var(--gap-m);
|
|
38
35
|
}
|
|
39
|
-
.
|
|
36
|
+
.select__optgroup_11cr7 {
|
|
40
37
|
position: relative;
|
|
41
38
|
display: flex;
|
|
42
39
|
align-items: center;
|
|
@@ -46,10 +43,10 @@
|
|
|
46
43
|
background: var(--select-optgroup-background);
|
|
47
44
|
min-height: 40px
|
|
48
45
|
}
|
|
49
|
-
.
|
|
46
|
+
.select__optgroup_11cr7 + *[role='option']:before {
|
|
50
47
|
display: none;
|
|
51
48
|
}
|
|
52
|
-
.
|
|
49
|
+
.select__label_11cr7 {
|
|
53
50
|
font-size: 12px;
|
|
54
51
|
line-height: 16px;
|
|
55
52
|
font-weight: 500;
|
|
@@ -59,8 +56,8 @@
|
|
|
59
56
|
display: block;
|
|
60
57
|
color: var(--select-optgroup-color);
|
|
61
58
|
}
|
|
62
|
-
.
|
|
63
|
-
.
|
|
59
|
+
.select__l_11cr7,
|
|
60
|
+
.select__xl_11cr7 {
|
|
64
61
|
padding-left: var(--select-optgroup-l-left-padding);
|
|
65
62
|
padding-right: var(--select-optgroup-l-right-padding);
|
|
66
63
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-8e873691.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var components_checkmark_Component = require('../checkmark/Component.js');
|
|
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
13
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
14
14
|
|
|
15
|
-
var styles = {"option":"
|
|
15
|
+
var styles = {"option":"select__option_14t21","disabled":"select__disabled_14t21","s":"select__s_14t21","m":"select__m_14t21","l":"select__l_14t21","xl":"select__xl_14t21","selected":"select__selected_14t21","highlighted":"select__highlighted_14t21","content":"select__content_14t21","textContent":"select__textContent_14t21"};
|
|
16
16
|
require('./index.css')
|
|
17
17
|
|
|
18
18
|
var Option = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 14t21 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-bg-secondary: #f3f4f5;
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
--color-light-border-primary: #dbdee1;
|
|
7
7
|
--color-light-text-primary: #0b1f35;
|
|
8
8
|
--color-light-text-secondary: #546272;
|
|
9
|
-
|
|
10
|
-
/* TODO: цвета добавлены руками. Обновить токены */
|
|
11
|
-
--color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
|
|
12
9
|
}
|
|
13
10
|
:root {
|
|
14
11
|
|
|
@@ -56,7 +53,7 @@
|
|
|
56
53
|
|
|
57
54
|
/* optgroup */
|
|
58
55
|
}
|
|
59
|
-
.
|
|
56
|
+
.select__option_14t21 {
|
|
60
57
|
font-size: 16px;
|
|
61
58
|
line-height: 20px;
|
|
62
59
|
font-weight: 400;
|
|
@@ -72,11 +69,11 @@
|
|
|
72
69
|
position: relative;
|
|
73
70
|
cursor: pointer
|
|
74
71
|
}
|
|
75
|
-
.
|
|
72
|
+
.select__option_14t21:not(.select__disabled_14t21):active {
|
|
76
73
|
background: var(--select-option-active-background);
|
|
77
74
|
color: var(--select-option-active-color);
|
|
78
75
|
}
|
|
79
|
-
.
|
|
76
|
+
.select__option_14t21:before {
|
|
80
77
|
content: '';
|
|
81
78
|
position: absolute;
|
|
82
79
|
left: var(--select-option-left-padding);
|
|
@@ -87,60 +84,60 @@
|
|
|
87
84
|
display: var(--select-option-divider-display);
|
|
88
85
|
transition: opacity 0.2s ease;
|
|
89
86
|
}
|
|
90
|
-
.
|
|
87
|
+
.select__option_14t21:first-child:before {
|
|
91
88
|
display: none;
|
|
92
89
|
}
|
|
93
|
-
.
|
|
90
|
+
.select__s_14t21 {
|
|
94
91
|
min-height: var(--size-s-height);
|
|
95
92
|
}
|
|
96
|
-
.
|
|
93
|
+
.select__m_14t21 {
|
|
97
94
|
min-height: var(--size-m-height);
|
|
98
95
|
}
|
|
99
|
-
.
|
|
96
|
+
.select__l_14t21 {
|
|
100
97
|
min-height: var(--size-l-height);
|
|
101
98
|
}
|
|
102
|
-
.
|
|
99
|
+
.select__xl_14t21 {
|
|
103
100
|
min-height: var(--size-xl-height);
|
|
104
101
|
}
|
|
105
|
-
.
|
|
106
|
-
.
|
|
102
|
+
.select__l_14t21,
|
|
103
|
+
.select__xl_14t21 {
|
|
107
104
|
padding-left: var(--select-option-l-left-padding);
|
|
108
105
|
padding-right: var(--select-option-l-right-padding)
|
|
109
106
|
}
|
|
110
|
-
.
|
|
107
|
+
.select__l_14t21:before, .select__xl_14t21:before {
|
|
111
108
|
left: var(--select-option-l-left-padding);
|
|
112
109
|
right: var(--select-option-l-right-padding);
|
|
113
110
|
}
|
|
114
|
-
.
|
|
111
|
+
.select__selected_14t21 {
|
|
115
112
|
background: var(--select-option-selected-background);
|
|
116
113
|
color: var(--select-option-selected-color);
|
|
117
114
|
cursor: default;
|
|
118
115
|
}
|
|
119
|
-
.
|
|
116
|
+
.select__highlighted_14t21 {
|
|
120
117
|
background: var(--select-option-hover-background);
|
|
121
118
|
color: var(--select-option-hover-color)
|
|
122
119
|
}
|
|
123
|
-
.
|
|
124
|
-
.
|
|
120
|
+
.select__highlighted_14t21:before,
|
|
121
|
+
.select__highlighted_14t21 + .select__option_14t21:before {
|
|
125
122
|
opacity: 0;
|
|
126
123
|
}
|
|
127
|
-
.
|
|
124
|
+
.select__disabled_14t21 {
|
|
128
125
|
cursor: var(--disabled-cursor);
|
|
129
126
|
background: var(--select-option-disabled-background);
|
|
130
127
|
color: var(--select-option-disabled-color);
|
|
131
128
|
}
|
|
132
|
-
.
|
|
129
|
+
.select__content_14t21 {
|
|
133
130
|
overflow: hidden;
|
|
134
131
|
text-overflow: ellipsis;
|
|
135
132
|
flex: 1;
|
|
136
133
|
}
|
|
137
|
-
.
|
|
134
|
+
.select__textContent_14t21 {
|
|
138
135
|
padding-top: var(--gap-s);
|
|
139
136
|
padding-bottom: var(--gap-s);
|
|
140
137
|
}
|
|
141
138
|
/* IE min-height fix */
|
|
142
139
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
143
|
-
.
|
|
140
|
+
.select__option_14t21:after {
|
|
144
141
|
min-height: inherit;
|
|
145
142
|
font-size: 0;
|
|
146
143
|
content: '';
|
|
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
14
14
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
15
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
|
|
16
16
|
|
|
17
|
-
var styles = {"optionsList":"
|
|
17
|
+
var styles = {"optionsList":"select__optionsList_1p8n4","emptyPlaceholder":"select__emptyPlaceholder_1p8n4","l":"select__l_1p8n4","xl":"select__xl_1p8n4"};
|
|
18
18
|
require('./index.css')
|
|
19
19
|
|
|
20
20
|
var createCounter = function () {
|