@alfalab/core-components-select 9.7.1 → 10.1.2

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.
Files changed (105) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/Component.d.ts +1 -1
  3. package/dist/Component.js +2 -1
  4. package/dist/components/arrow/Component.js +3 -2
  5. package/dist/components/arrow/index.css +8 -7
  6. package/dist/components/arrow/index.js +1 -0
  7. package/dist/components/base-select/Component.js +4 -4
  8. package/dist/components/base-select/index.css +7 -7
  9. package/dist/components/base-select/index.js +1 -1
  10. package/dist/components/checkmark/Component.js +1 -1
  11. package/dist/components/checkmark/index.css +3 -3
  12. package/dist/components/field/Component.js +2 -2
  13. package/dist/components/field/index.css +9 -9
  14. package/dist/components/field/index.js +1 -1
  15. package/dist/components/index.js +2 -1
  16. package/dist/components/native-select/Component.js +1 -1
  17. package/dist/components/native-select/index.js +1 -1
  18. package/dist/components/optgroup/Component.js +1 -1
  19. package/dist/components/optgroup/index.css +6 -6
  20. package/dist/components/option/Component.js +2 -2
  21. package/dist/components/option/index.css +20 -20
  22. package/dist/components/option/index.js +1 -1
  23. package/dist/components/options-list/Component.js +1 -1
  24. package/dist/components/options-list/index.css +5 -5
  25. package/dist/components/virtual-options-list/Component.js +1 -1
  26. package/dist/components/virtual-options-list/index.css +11 -11
  27. package/dist/cssm/Component.d.ts +1 -1
  28. package/dist/cssm/Component.js +1 -0
  29. package/dist/cssm/components/arrow/Component.js +2 -1
  30. package/dist/cssm/components/arrow/index.js +1 -0
  31. package/dist/cssm/components/arrow/index.module.css +5 -4
  32. package/dist/cssm/components/base-select/Component.js +2 -2
  33. package/dist/cssm/components/index.js +1 -0
  34. package/dist/cssm/index.js +1 -0
  35. package/dist/cssm/typings.d.ts +4 -0
  36. package/dist/esm/Component.d.ts +1 -1
  37. package/dist/esm/Component.js +2 -1
  38. package/dist/esm/components/arrow/Component.js +3 -2
  39. package/dist/esm/components/arrow/index.css +8 -7
  40. package/dist/esm/components/arrow/index.js +1 -0
  41. package/dist/esm/components/base-select/Component.js +4 -4
  42. package/dist/esm/components/base-select/index.css +7 -7
  43. package/dist/esm/components/base-select/index.js +1 -1
  44. package/dist/esm/components/checkmark/Component.js +1 -1
  45. package/dist/esm/components/checkmark/index.css +3 -3
  46. package/dist/esm/components/field/Component.js +2 -2
  47. package/dist/esm/components/field/index.css +9 -9
  48. package/dist/esm/components/field/index.js +1 -1
  49. package/dist/esm/components/index.js +2 -1
  50. package/dist/esm/components/native-select/Component.js +1 -1
  51. package/dist/esm/components/native-select/index.js +1 -1
  52. package/dist/esm/components/optgroup/Component.js +1 -1
  53. package/dist/esm/components/optgroup/index.css +6 -6
  54. package/dist/esm/components/option/Component.js +2 -2
  55. package/dist/esm/components/option/index.css +20 -20
  56. package/dist/esm/components/option/index.js +1 -1
  57. package/dist/esm/components/options-list/Component.js +1 -1
  58. package/dist/esm/components/options-list/index.css +5 -5
  59. package/dist/esm/components/virtual-options-list/Component.js +1 -1
  60. package/dist/esm/components/virtual-options-list/index.css +11 -11
  61. package/dist/esm/index.js +2 -1
  62. package/dist/esm/presets/index.js +1 -1
  63. package/dist/esm/presets/useLazyLoading/hook.js +2 -2
  64. package/dist/esm/presets/useLazyLoading/index.css +2 -2
  65. package/dist/esm/presets/useSelectWithLoading/hook.js +2 -2
  66. package/dist/esm/presets/useSelectWithLoading/index.css +2 -2
  67. package/dist/esm/{tslib.es6-0285a9f7.d.ts → tslib.es6-010c27fc.d.ts} +0 -0
  68. package/dist/esm/{tslib.es6-0285a9f7.js → tslib.es6-010c27fc.js} +0 -0
  69. package/dist/esm/typings.d.ts +4 -0
  70. package/dist/index.js +2 -1
  71. package/dist/modern/Component.d.ts +1 -1
  72. package/dist/modern/Component.js +1 -0
  73. package/dist/modern/components/arrow/Component.js +3 -2
  74. package/dist/modern/components/arrow/index.css +8 -7
  75. package/dist/modern/components/arrow/index.js +1 -0
  76. package/dist/modern/components/base-select/Component.js +3 -3
  77. package/dist/modern/components/base-select/index.css +7 -7
  78. package/dist/modern/components/checkmark/Component.js +1 -1
  79. package/dist/modern/components/checkmark/index.css +3 -3
  80. package/dist/modern/components/field/Component.js +1 -1
  81. package/dist/modern/components/field/index.css +9 -9
  82. package/dist/modern/components/index.js +1 -0
  83. package/dist/modern/components/optgroup/Component.js +1 -1
  84. package/dist/modern/components/optgroup/index.css +6 -6
  85. package/dist/modern/components/option/Component.js +1 -1
  86. package/dist/modern/components/option/index.css +20 -20
  87. package/dist/modern/components/options-list/Component.js +1 -1
  88. package/dist/modern/components/options-list/index.css +5 -5
  89. package/dist/modern/components/virtual-options-list/Component.js +1 -1
  90. package/dist/modern/components/virtual-options-list/index.css +11 -11
  91. package/dist/modern/index.js +1 -0
  92. package/dist/modern/presets/useLazyLoading/hook.js +1 -1
  93. package/dist/modern/presets/useLazyLoading/index.css +2 -2
  94. package/dist/modern/presets/useSelectWithLoading/hook.js +1 -1
  95. package/dist/modern/presets/useSelectWithLoading/index.css +2 -2
  96. package/dist/modern/typings.d.ts +4 -0
  97. package/dist/presets/index.js +1 -1
  98. package/dist/presets/useLazyLoading/hook.js +2 -2
  99. package/dist/presets/useLazyLoading/index.css +2 -2
  100. package/dist/presets/useSelectWithLoading/hook.js +2 -2
  101. package/dist/presets/useSelectWithLoading/index.css +2 -2
  102. package/dist/{tslib.es6-8e873691.d.ts → tslib.es6-d4ec8979.d.ts} +0 -0
  103. package/dist/{tslib.es6-8e873691.js → tslib.es6-d4ec8979.js} +0 -0
  104. package/dist/typings.d.ts +4 -0
  105. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- /* hash: 9nrym */
1
+ /* hash: 1lbsx */
2
2
  :root {
3
3
  --color-light-border-primary: #dbdee1;
4
4
  --color-light-text-secondary: #546272;
@@ -32,24 +32,24 @@
32
32
 
33
33
  /* optgroup */
34
34
  }
35
- .select__virtualOptionsList_9nrym {
35
+ .select__virtualOptionsList_sz0k1 {
36
36
  overflow: auto;
37
37
  width: 100%;
38
38
  outline: none;
39
39
  box-sizing: border-box;
40
40
  position: relative;
41
41
  }
42
- .select__inner_9nrym {
42
+ .select__inner_sz0k1 {
43
43
  position: relative;
44
44
  width: 100%;
45
45
  }
46
- .select__virtualRow_9nrym {
46
+ .select__virtualRow_sz0k1 {
47
47
  position: absolute;
48
48
  top: 0;
49
49
  left: 0;
50
50
  width: 100%
51
51
  }
52
- .select__virtualRow_9nrym:before {
52
+ .select__virtualRow_sz0k1:before {
53
53
  content: '';
54
54
  position: absolute;
55
55
  z-index: 1;
@@ -60,18 +60,18 @@
60
60
  background: var(--select-option-divider-background);
61
61
  display: var(--select-option-divider-display);
62
62
  }
63
- .select__virtualRow_9nrym:first-child:before {
63
+ .select__virtualRow_sz0k1:first-child:before {
64
64
  display: none;
65
65
  }
66
- .select__highlighted_9nrym:before,
67
- .select__highlighted_9nrym + .select__virtualRow_9nrym:before {
66
+ .select__highlighted_sz0k1:before,
67
+ .select__highlighted_sz0k1 + .select__virtualRow_sz0k1:before {
68
68
  display: none;
69
69
  }
70
- .select__emptyPlaceholder_9nrym {
70
+ .select__emptyPlaceholder_sz0k1 {
71
71
  padding: var(--gap-m) var(--gap-s);
72
72
  color: var(--select-options-list-empty-placeholder-color);
73
73
  }
74
- .select__l_9nrym .select__emptyPlaceholder_9nrym,
75
- .select__xl_9nrym .select__emptyPlaceholder_9nrym {
74
+ .select__l_sz0k1 .select__emptyPlaceholder_sz0k1,
75
+ .select__xl_sz0k1 .select__emptyPlaceholder_sz0k1 {
76
76
  padding: var(--gap-xl) var(--gap-m);
77
77
  }
@@ -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" | "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"> & {
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" | "zIndexPopover" | "showEmptyOptionsList"> & {
86
86
  /**
87
87
  * Пропсы, которые будут прокинуты в компонент поля
88
88
  */
@@ -10,6 +10,7 @@ require('@alfalab/core-components-form-control/dist/cssm');
10
10
  require('./utils.js');
11
11
  require('./components/field/index.module.css');
12
12
  var components_field_Component = require('./components/field/Component.js');
13
+ require('@alfalab/icons-glyph/ChevronDownMIcon');
13
14
  require('./components/arrow/index.module.css');
14
15
  var components_arrow_Component = require('./components/arrow/Component.js');
15
16
  require('react-merge-refs');
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var cn = require('classnames');
7
+ var ChevronDownMIcon = require('@alfalab/icons-glyph/ChevronDownMIcon');
7
8
  var styles = require('./index.module.css');
8
9
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -15,7 +16,7 @@ var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
15
16
  var Arrow = function (_a) {
16
17
  var _b;
17
18
  var open = _a.open, className = _a.className;
18
- return (React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].arrow, className, (_b = {}, _b[styles__default['default'].open] = open, _b)) }));
19
+ return (React__default['default'].createElement(ChevronDownMIcon.ChevronDownMIcon, { className: cn__default['default'](styles__default['default'].arrow, className, (_b = {}, _b[styles__default['default'].open] = open, _b)) }));
19
20
  };
20
21
 
21
22
  exports.Arrow = Arrow;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('react');
6
6
  require('classnames');
7
+ require('@alfalab/icons-glyph/ChevronDownMIcon');
7
8
  require('./index.module.css');
8
9
  var components_arrow_Component = require('./Component.js');
9
10
 
@@ -1,3 +1,6 @@
1
+ :root {
2
+ --color-light-graphic-primary: #0b1f35;
3
+ }
1
4
  :root {
2
5
 
3
6
  /* Hard */
@@ -10,7 +13,7 @@
10
13
  --arrow-transform: rotate(180deg);
11
14
  }
12
15
  :root {
13
- --select-arrow-background: url('https://alfabank.st/icons/glyph_chevron-down_m.svg');
16
+ --select-arrow-color: var(--color-light-graphic-primary);
14
17
 
15
18
  /* options list */
16
19
 
@@ -24,10 +27,8 @@
24
27
  display: block;
25
28
  width: 24px;
26
29
  height: 24px;
30
+ color: var(--select-arrow-color);
27
31
 
28
- background: var(--select-arrow-background);
29
- background-size: cover;
30
- background-position: center;
31
32
  transition: transform 0.15s ease-in-out, opacity 0.2s ease;
32
33
  }
33
34
  .open {
@@ -27,7 +27,7 @@ var getDataTestId = function (dataTestId, element) {
27
27
 
28
28
  var BaseSelect = React.forwardRef(function (_a, ref) {
29
29
  var _b;
30
- 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;
30
+ 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, zIndexPopover = _a.zIndexPopover, _y = _a.showEmptyOptionsList, showEmptyOptionsList = _y === void 0 ? false : _y, visibleOptions = _a.visibleOptions;
31
31
  var rootRef = React.useRef(null);
32
32
  var fieldRef = React.useRef(null);
33
33
  var listRef = React.useRef(null);
@@ -237,7 +237,7 @@ var BaseSelect = React.forwardRef(function (_a, ref) {
237
237
  : undefined,
238
238
  }, dataTestId: getDataTestId(dataTestId, 'field') }, fieldProps)),
239
239
  name && !nativeSelect && renderValue(),
240
- !nativeSelect && (React__default['default'].createElement(coreComponentsPopover.Popover, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: styles__default['default'].popoverInner, update: updatePopover }, needRenderOptionsList && (React__default['default'].createElement("div", tslib_es6.__assign({}, menuProps, { className: cn__default['default'](optionsListClassName, styles__default['default'].optionsList) }),
240
+ !nativeSelect && (React__default['default'].createElement(coreComponentsPopover.Popover, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: styles__default['default'].popoverInner, update: updatePopover, zIndex: zIndexPopover }, needRenderOptionsList && (React__default['default'].createElement("div", tslib_es6.__assign({}, menuProps, { className: cn__default['default'](optionsListClassName, styles__default['default'].optionsList) }),
241
241
  React__default['default'].createElement(OptionsList, tslib_es6.__assign({}, optionsListProps, { flatOptions: flatOptions, highlightedIndex: highlightedIndex, open: open, size: size, options: options, Optgroup: Optgroup, Option: WrappedOption, visibleOptions: visibleOptions, onScroll: onScroll, dataTestId: getDataTestId(dataTestId, 'options-list') }))))))));
242
242
  });
243
243
 
@@ -10,6 +10,7 @@ require('@alfalab/core-components-form-control/dist/cssm');
10
10
  require('../utils.js');
11
11
  require('./field/index.module.css');
12
12
  var components_field_Component = require('./field/Component.js');
13
+ require('@alfalab/icons-glyph/ChevronDownMIcon');
13
14
  require('./arrow/index.module.css');
14
15
  var components_arrow_Component = require('./arrow/Component.js');
15
16
  require('react-merge-refs');
@@ -10,6 +10,7 @@ require('@alfalab/core-components-form-control/dist/cssm');
10
10
  var utils = require('./utils.js');
11
11
  require('./components/field/index.module.css');
12
12
  var components_field_Component = require('./components/field/Component.js');
13
+ require('@alfalab/icons-glyph/ChevronDownMIcon');
13
14
  require('./components/arrow/index.module.css');
14
15
  var components_arrow_Component = require('./components/arrow/Component.js');
15
16
  require('react-merge-refs');
@@ -219,6 +219,10 @@ type BaseSelectProps = {
219
219
  * Хранит функцию, с помощью которой можно обновить положение поповера
220
220
  */
221
221
  updatePopover?: PopoverProps['update'];
222
+ /**
223
+ * z-index поповера
224
+ */
225
+ zIndexPopover?: PopoverProps['zIndex'];
222
226
  /**
223
227
  * Показывать OptionsList, если он пустой
224
228
  */
@@ -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" | "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"> & {
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" | "zIndexPopover" | "showEmptyOptionsList"> & {
86
86
  /**
87
87
  * Пропсы, которые будут прокинуты в компонент поля
88
88
  */
@@ -1,10 +1,11 @@
1
- import { _ as __rest, a as __assign } from './tslib.es6-0285a9f7.js';
1
+ import { _ as __rest, a as __assign } from './tslib.es6-010c27fc.js';
2
2
  import React, { forwardRef } from 'react';
3
3
  import 'classnames';
4
4
  import '@alfalab/hooks';
5
5
  import '@alfalab/core-components-form-control/dist/esm';
6
6
  import './utils.js';
7
7
  import { Field } from './components/field/Component.js';
8
+ import '@alfalab/icons-glyph/ChevronDownMIcon';
8
9
  import { Arrow } from './components/arrow/Component.js';
9
10
  import 'react-merge-refs';
10
11
  import { Optgroup } from './components/optgroup/Component.js';
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
+ import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
3
4
 
4
- var styles = {"arrow":"select__arrow_14ac7","open":"select__open_14ac7"};
5
+ var styles = {"arrow":"select__arrow_1qq59","open":"select__open_1qq59"};
5
6
  require('./index.css')
6
7
 
7
8
  var Arrow = function (_a) {
8
9
  var _b;
9
10
  var open = _a.open, className = _a.className;
10
- return (React.createElement("span", { className: cn(styles.arrow, className, (_b = {}, _b[styles.open] = open, _b)) }));
11
+ return (React.createElement(ChevronDownMIcon, { className: cn(styles.arrow, className, (_b = {}, _b[styles.open] = open, _b)) }));
11
12
  };
12
13
 
13
14
  export { Arrow };
@@ -1,4 +1,7 @@
1
- /* hash: 14ac7 */
1
+ /* hash: 1axgb */
2
+ :root {
3
+ --color-light-graphic-primary: #0b1f35;
4
+ }
2
5
  :root {
3
6
 
4
7
  /* Hard */
@@ -11,7 +14,7 @@
11
14
  --arrow-transform: rotate(180deg);
12
15
  }
13
16
  :root {
14
- --select-arrow-background: url('https://alfabank.st/icons/glyph_chevron-down_m.svg');
17
+ --select-arrow-color: var(--color-light-graphic-primary);
15
18
 
16
19
  /* options list */
17
20
 
@@ -21,16 +24,14 @@
21
24
 
22
25
  /* optgroup */
23
26
  }
24
- .select__arrow_14ac7 {
27
+ .select__arrow_1qq59 {
25
28
  display: block;
26
29
  width: 24px;
27
30
  height: 24px;
31
+ color: var(--select-arrow-color);
28
32
 
29
- background: var(--select-arrow-background);
30
- background-size: cover;
31
- background-position: center;
32
33
  transition: transform 0.15s ease-in-out, opacity 0.2s ease;
33
34
  }
34
- .select__open_14ac7 {
35
+ .select__open_1qq59 {
35
36
  transform: var(--arrow-transform);
36
37
  }
@@ -1,3 +1,4 @@
1
1
  import 'react';
2
2
  import 'classnames';
3
+ import '@alfalab/icons-glyph/ChevronDownMIcon';
3
4
  export { Arrow } from './Component.js';
@@ -1,4 +1,4 @@
1
- import { a as __assign, b as __spreadArrays, _ as __rest } from '../../tslib.es6-0285a9f7.js';
1
+ import { a as __assign, b as __spreadArrays, _ as __rest } from '../../tslib.es6-010c27fc.js';
2
2
  import React, { forwardRef, useRef, useMemo, useCallback, useEffect, useLayoutEffect } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { processOptions } from '../../utils.js';
@@ -13,12 +13,12 @@ var getDataTestId = function (dataTestId, element) {
13
13
  return dataTestId ? "" + dataTestId + elementPart : undefined;
14
14
  };
15
15
 
16
- var styles = {"component":"select__component_6wx3t","popoverInner":"select__popoverInner_6wx3t","optionsList":"select__optionsList_6wx3t","nativeSelect":"select__nativeSelect_6wx3t","block":"select__block_6wx3t"};
16
+ var styles = {"component":"select__component_ea2un","popoverInner":"select__popoverInner_ea2un","optionsList":"select__optionsList_ea2un","nativeSelect":"select__nativeSelect_ea2un","block":"select__block_ea2un"};
17
17
  require('./index.css')
18
18
 
19
19
  var BaseSelect = forwardRef(function (_a, ref) {
20
20
  var _b;
21
- 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;
21
+ 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, zIndexPopover = _a.zIndexPopover, _y = _a.showEmptyOptionsList, showEmptyOptionsList = _y === void 0 ? false : _y, visibleOptions = _a.visibleOptions;
22
22
  var rootRef = useRef(null);
23
23
  var fieldRef = useRef(null);
24
24
  var listRef = useRef(null);
@@ -228,7 +228,7 @@ var BaseSelect = forwardRef(function (_a, ref) {
228
228
  : undefined,
229
229
  }, dataTestId: getDataTestId(dataTestId, 'field') }, fieldProps)),
230
230
  name && !nativeSelect && renderValue(),
231
- !nativeSelect && (React.createElement(Popover, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: styles.popoverInner, update: updatePopover }, needRenderOptionsList && (React.createElement("div", __assign({}, menuProps, { className: cn(optionsListClassName, styles.optionsList) }),
231
+ !nativeSelect && (React.createElement(Popover, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: styles.popoverInner, update: updatePopover, zIndex: zIndexPopover }, needRenderOptionsList && (React.createElement("div", __assign({}, menuProps, { className: cn(optionsListClassName, styles.optionsList) }),
232
232
  React.createElement(OptionsList, __assign({}, optionsListProps, { flatOptions: flatOptions, highlightedIndex: highlightedIndex, open: open, size: size, options: options, Optgroup: Optgroup, Option: WrappedOption, visibleOptions: visibleOptions, onScroll: onScroll, dataTestId: getDataTestId(dataTestId, 'options-list') }))))))));
233
233
  });
234
234
 
@@ -1,4 +1,4 @@
1
- /* hash: 6wx3t */
1
+ /* hash: dx375 */
2
2
  :root {
3
3
  --color-light-bg-primary: #fff;
4
4
  }
@@ -28,12 +28,12 @@
28
28
 
29
29
  /* optgroup */
30
30
  }
31
- .select__component_6wx3t {
31
+ .select__component_ea2un {
32
32
  width: max-content;
33
33
  position: relative;
34
34
  outline: 0;
35
35
  }
36
- .select__popoverInner_6wx3t {
36
+ .select__popoverInner_ea2un {
37
37
  padding-top: var(--select-options-list-offset);
38
38
  padding-bottom: var(--select-options-list-offset);
39
39
  box-shadow: none;
@@ -42,7 +42,7 @@
42
42
  border-radius: 0;
43
43
  position: relative;
44
44
  }
45
- .select__optionsList_6wx3t {
45
+ .select__optionsList_ea2un {
46
46
  padding-top: var(--select-options-list-top-padding);
47
47
  padding-bottom: var(--select-options-list-bottom-padding);
48
48
  box-shadow: var(--select-options-list-box-shadow);
@@ -51,7 +51,7 @@
51
51
  overflow: hidden;
52
52
  will-change: transform;
53
53
  }
54
- .select__nativeSelect_6wx3t {
54
+ .select__nativeSelect_ea2un {
55
55
  opacity: 0;
56
56
  overflow: hidden;
57
57
  position: absolute;
@@ -65,12 +65,12 @@
65
65
  cursor: pointer;
66
66
  z-index: 1;
67
67
  }
68
- .select__block_6wx3t {
68
+ .select__block_ea2un {
69
69
  width: 100%;
70
70
  }
71
71
  /* width: max-content; fix for IE */
72
72
  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
73
- .select__component_6wx3t {
73
+ .select__component_ea2un {
74
74
  float: left;
75
75
  clear: left;
76
76
  }
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-0285a9f7.js';
1
+ import '../../tslib.es6-010c27fc.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '../../utils.js';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- var styles = {"checkmark":"select__checkmark_6z46i","selected":"select__selected_6z46i"};
4
+ var styles = {"checkmark":"select__checkmark_bebuq","selected":"select__selected_bebuq"};
5
5
  require('./index.css')
6
6
 
7
7
  var Checkmark = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 6z46i */
1
+ /* hash: 13r48 */
2
2
  :root {
3
3
  --color-light-graphic-primary: #0b1f35;
4
4
  }
@@ -33,7 +33,7 @@
33
33
 
34
34
  /* optgroup */
35
35
  }
36
- .select__checkmark_6z46i {
36
+ .select__checkmark_bebuq {
37
37
  display: flex;
38
38
  align-items: center;
39
39
  justify-content: center;
@@ -47,6 +47,6 @@
47
47
  width: var(--select-checkmark-size);
48
48
  height: var(--select-checkmark-size);
49
49
  }
50
- .select__selected_6z46i {
50
+ .select__selected_bebuq {
51
51
  opacity: 1;
52
52
  }
@@ -1,11 +1,11 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-0285a9f7.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-010c27fc.js';
2
2
  import React, { useState, useRef, useCallback } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { useFocus } from '@alfalab/hooks';
5
5
  import { FormControl } from '@alfalab/core-components-form-control/dist/esm';
6
6
  import { joinOptions } from '../../utils.js';
7
7
 
8
- 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"};
8
+ var styles = {"component":"select__component_1dmwd","field":"select__field_1dmwd","disabled":"select__disabled_1dmwd","arrow":"select__arrow_1dmwd","placeholder":"select__placeholder_1dmwd","contentWrapper":"select__contentWrapper_1dmwd","value":"select__value_1dmwd","focusVisible":"select__focusVisible_1dmwd"};
9
9
  require('./index.css')
10
10
 
11
11
  var Field = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 13cpz */
1
+ /* hash: yr6je */
2
2
  :root {
3
3
  --color-light-border-link: #007aff;
4
4
  --color-light-text-secondary: #546272;
@@ -26,24 +26,24 @@
26
26
 
27
27
  /* optgroup */
28
28
  }
29
- .select__component_13cpz {
29
+ .select__component_1dmwd {
30
30
  width: 100%;
31
31
  outline: none;
32
32
  }
33
- .select__field_13cpz:not(.select__disabled_13cpz) {
33
+ .select__field_1dmwd:not(.select__disabled_1dmwd) {
34
34
  cursor: pointer
35
35
  }
36
- .select__field_13cpz:not(.select__disabled_13cpz):hover .select__arrow_13cpz {
36
+ .select__field_1dmwd:not(.select__disabled_1dmwd):hover .select__arrow_1dmwd {
37
37
  opacity: var(--select-arrow-hover-opacity);
38
38
  }
39
- .select__disabled_13cpz {
39
+ .select__disabled_1dmwd {
40
40
  cursor: var(--disabled-cursor);
41
41
  }
42
42
  /* TODO: Заюзать переменные из инпута */
43
- .select__placeholder_13cpz {
43
+ .select__placeholder_1dmwd {
44
44
  color: var(--color-light-text-secondary);
45
45
  }
46
- .select__contentWrapper_13cpz {
46
+ .select__contentWrapper_1dmwd {
47
47
  font-size: 16px;
48
48
  line-height: 20px;
49
49
  font-weight: 400;
@@ -53,12 +53,12 @@
53
53
  overflow: hidden;
54
54
  width: 100%;
55
55
  }
56
- .select__value_13cpz {
56
+ .select__value_1dmwd {
57
57
  overflow: hidden;
58
58
  text-overflow: ellipsis;
59
59
  text-align: left;
60
60
  }
61
- .select__focusVisible_13cpz {
61
+ .select__focusVisible_1dmwd {
62
62
  outline: 2px solid var(--focus-color);
63
63
  outline-offset: 2px;
64
64
  }
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-0285a9f7.js';
1
+ import '../../tslib.es6-010c27fc.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '@alfalab/hooks';
@@ -1,10 +1,11 @@
1
- import '../tslib.es6-0285a9f7.js';
1
+ import '../tslib.es6-010c27fc.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '@alfalab/hooks';
5
5
  import '@alfalab/core-components-form-control/dist/esm';
6
6
  import '../utils.js';
7
7
  export { Field } from './field/Component.js';
8
+ import '@alfalab/icons-glyph/ChevronDownMIcon';
8
9
  export { Arrow } from './arrow/Component.js';
9
10
  import 'react-merge-refs';
10
11
  export { Optgroup } from './optgroup/Component.js';
@@ -1,4 +1,4 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-0285a9f7.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-010c27fc.js';
2
2
  import React, { forwardRef, useCallback } from 'react';
3
3
  import { isGroup } from '../../utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-0285a9f7.js';
1
+ import '../../tslib.es6-010c27fc.js';
2
2
  import 'react';
3
3
  import '../../utils.js';
4
4
  export { NativeSelect } from './Component.js';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- var styles = {"optgroup":"select__optgroup_11cr7","label":"select__label_11cr7","l":"select__l_11cr7","xl":"select__xl_11cr7"};
4
+ var styles = {"optgroup":"select__optgroup_1w9pl","label":"select__label_1w9pl","l":"select__l_1w9pl","xl":"select__xl_1w9pl"};
5
5
  require('./index.css')
6
6
 
7
7
  var Optgroup = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 11cr7 */
1
+ /* hash: 1vwpx */
2
2
  :root {
3
3
  --color-light-bg-primary: #fff;
4
4
  --color-light-text-secondary: #546272;
@@ -33,7 +33,7 @@
33
33
  --select-optgroup-l-left-padding: var(--gap-m);
34
34
  --select-optgroup-l-right-padding: var(--gap-m);
35
35
  }
36
- .select__optgroup_11cr7 {
36
+ .select__optgroup_1w9pl {
37
37
  position: relative;
38
38
  display: flex;
39
39
  align-items: center;
@@ -43,10 +43,10 @@
43
43
  background: var(--select-optgroup-background);
44
44
  min-height: 40px
45
45
  }
46
- .select__optgroup_11cr7 + *[role='option']:before {
46
+ .select__optgroup_1w9pl + *[role='option']:before {
47
47
  display: none;
48
48
  }
49
- .select__label_11cr7 {
49
+ .select__label_1w9pl {
50
50
  font-size: 12px;
51
51
  line-height: 16px;
52
52
  font-weight: 500;
@@ -56,8 +56,8 @@
56
56
  display: block;
57
57
  color: var(--select-optgroup-color);
58
58
  }
59
- .select__l_11cr7,
60
- .select__xl_11cr7 {
59
+ .select__l_1w9pl,
60
+ .select__xl_1w9pl {
61
61
  padding-left: var(--select-optgroup-l-left-padding);
62
62
  padding-right: var(--select-optgroup-l-right-padding);
63
63
  }
@@ -1,9 +1,9 @@
1
- import { a as __assign } from '../../tslib.es6-0285a9f7.js';
1
+ import { a as __assign } from '../../tslib.es6-010c27fc.js';
2
2
  import React, { isValidElement } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { Checkmark } from '../checkmark/Component.js';
5
5
 
6
- 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"};
6
+ var styles = {"option":"select__option_sjeec","disabled":"select__disabled_sjeec","s":"select__s_sjeec","m":"select__m_sjeec","l":"select__l_sjeec","xl":"select__xl_sjeec","selected":"select__selected_sjeec","highlighted":"select__highlighted_sjeec","content":"select__content_sjeec","textContent":"select__textContent_sjeec"};
7
7
  require('./index.css')
8
8
 
9
9
  var Option = function (_a) {