@vkontakte/vkui 6.5.1 → 6.5.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.
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js +9 -9
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +2 -2
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/CustomSelectDropdown/CustomSelectDropdown.d.ts +1 -1
- package/dist/cjs/components/CustomSelectDropdown/CustomSelectDropdown.d.ts.map +1 -1
- package/dist/cjs/components/CustomSelectDropdown/CustomSelectDropdown.js +2 -14
- package/dist/cjs/components/CustomSelectDropdown/CustomSelectDropdown.js.map +1 -1
- package/dist/cjs/components/Footer/Footer.d.ts +1 -1
- package/dist/cjs/components/Footer/Footer.d.ts.map +1 -1
- package/dist/cjs/components/Footer/Footer.js +7 -3
- package/dist/cjs/components/Footer/Footer.js.map +1 -1
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.d.ts.map +1 -1
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.js +1 -1
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/cjs/components/RootComponent/RootComponent.d.ts +1 -1
- package/dist/cjs/components/RootComponent/RootComponent.d.ts.map +1 -1
- package/dist/cjs/components/RootComponent/RootComponent.js +1 -1
- package/dist/cjs/components/RootComponent/RootComponent.js.map +1 -1
- package/dist/cjs/components/Search/Search.d.ts.map +1 -1
- package/dist/cjs/components/Search/Search.js +1 -0
- package/dist/cjs/components/Search/Search.js.map +1 -1
- package/dist/cjs/hooks/useEnsuredControl.d.ts.map +1 -1
- package/dist/cjs/hooks/useEnsuredControl.js +27 -3
- package/dist/cjs/hooks/useEnsuredControl.js.map +1 -1
- package/dist/cjs/hooks/useIsClient.d.ts +1 -1
- package/dist/cjs/hooks/useIsClient.js.map +1 -1
- package/dist/cjs/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
- package/dist/components/ChipsSelect/ChipsSelect.js +9 -9
- package/dist/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.js +2 -2
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/CustomSelectDropdown/CustomSelectDropdown.d.ts +1 -1
- package/dist/components/CustomSelectDropdown/CustomSelectDropdown.d.ts.map +1 -1
- package/dist/components/CustomSelectDropdown/CustomSelectDropdown.js +2 -14
- package/dist/components/CustomSelectDropdown/CustomSelectDropdown.js.map +1 -1
- package/dist/components/Footer/Footer.d.ts +1 -1
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/components/Footer/Footer.js +7 -3
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/FormLayoutGroup/FormLayoutGroup.d.ts.map +1 -1
- package/dist/components/FormLayoutGroup/FormLayoutGroup.js +1 -1
- package/dist/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/components/RootComponent/RootComponent.d.ts +1 -1
- package/dist/components/RootComponent/RootComponent.d.ts.map +1 -1
- package/dist/components/RootComponent/RootComponent.js +1 -1
- package/dist/components/RootComponent/RootComponent.js.map +1 -1
- package/dist/components/Search/Search.d.ts.map +1 -1
- package/dist/components/Search/Search.js +1 -0
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components.css +2 -2
- package/dist/components.css.map +1 -1
- package/dist/components.js.tmp +52 -85
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js +9 -9
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +2 -2
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.d.ts +1 -1
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.d.ts.map +1 -1
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.js +2 -13
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.js.map +1 -1
- package/dist/cssm/components/Footer/Footer.d.ts +1 -1
- package/dist/cssm/components/Footer/Footer.d.ts.map +1 -1
- package/dist/cssm/components/Footer/Footer.js +4 -2
- package/dist/cssm/components/Footer/Footer.js.map +1 -1
- package/dist/cssm/components/FormField/FormField.module.css +36 -23
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.d.ts.map +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.js +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/cssm/components/RootComponent/RootComponent.d.ts +1 -1
- package/dist/cssm/components/RootComponent/RootComponent.d.ts.map +1 -1
- package/dist/cssm/components/RootComponent/RootComponent.js +2 -1
- package/dist/cssm/components/RootComponent/RootComponent.js.map +1 -1
- package/dist/cssm/components/RootComponent/RootComponent.module.css +10 -0
- package/dist/cssm/components/Search/Search.d.ts.map +1 -1
- package/dist/cssm/components/Search/Search.js +1 -0
- package/dist/cssm/components/Search/Search.js.map +1 -1
- package/dist/cssm/hooks/useEnsuredControl.d.ts.map +1 -1
- package/dist/cssm/hooks/useEnsuredControl.js +27 -3
- package/dist/cssm/hooks/useEnsuredControl.js.map +1 -1
- package/dist/cssm/hooks/useIsClient.d.ts +1 -1
- package/dist/cssm/hooks/useIsClient.js +1 -1
- package/dist/cssm/hooks/useIsClient.js.map +1 -1
- package/dist/cssm/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
- package/dist/cssm/styles/constants.css +2 -2
- package/dist/hooks/useEnsuredControl.d.ts.map +1 -1
- package/dist/hooks/useEnsuredControl.js +27 -3
- package/dist/hooks/useEnsuredControl.js.map +1 -1
- package/dist/hooks/useIsClient.d.ts +1 -1
- package/dist/hooks/useIsClient.js +1 -1
- package/dist/hooks/useIsClient.js.map +1 -1
- package/dist/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
- package/dist/vkui.css +2 -2
- package/dist/vkui.css.map +1 -1
- package/dist/vkui.js.tmp +52 -85
- package/package.json +1 -1
- package/src/components/ChipsSelect/ChipsSelect.tsx +12 -12
- package/src/components/CustomSelect/CustomSelect.tsx +4 -6
- package/src/components/CustomSelectDropdown/CustomSelectDropdown.tsx +3 -17
- package/src/components/Footer/Footer.tsx +14 -2
- package/src/components/FormField/FormField.module.css +32 -21
- package/src/components/FormLayoutGroup/FormLayoutGroup.tsx +1 -5
- package/src/components/RootComponent/RootComponent.module.css +10 -0
- package/src/components/RootComponent/RootComponent.tsx +12 -2
- package/src/components/Search/Search.tsx +1 -0
- package/src/hooks/useEnsuredControl.ts +38 -4
- package/src/hooks/useIsClient.ts +1 -1
- package/src/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.ts +1 -1
- package/src/styles/constants.css +2 -2
package/dist/vkui.js.tmp
CHANGED
|
@@ -5737,6 +5737,9 @@ function AppRoot_unsupported_iterable_to_array(o, minLen) {
|
|
|
5737
5737
|
}, props), content);
|
|
5738
5738
|
};
|
|
5739
5739
|
|
|
5740
|
+
;// CONCATENATED MODULE: ./src/components/RootComponent/RootComponent.module.css
|
|
5741
|
+
// extracted by mini-css-extract-plugin
|
|
5742
|
+
|
|
5740
5743
|
;// CONCATENATED MODULE: ./src/components/RootComponent/RootComponent.tsx
|
|
5741
5744
|
function RootComponent_define_property(obj, key, value) {
|
|
5742
5745
|
if (key in obj) {
|
|
@@ -5795,6 +5798,7 @@ function RootComponent_object_without_properties_loose(source, excluded) {
|
|
|
5795
5798
|
}
|
|
5796
5799
|
|
|
5797
5800
|
|
|
5801
|
+
|
|
5798
5802
|
/**
|
|
5799
5803
|
* Базовый корневой компонент.
|
|
5800
5804
|
*/ var RootComponent_RootComponent = function(_param) {
|
|
@@ -5806,7 +5810,7 @@ function RootComponent_object_without_properties_loose(source, excluded) {
|
|
|
5806
5810
|
]);
|
|
5807
5811
|
return /*#__PURE__*/ react.createElement(Component, RootComponent_object_spread({
|
|
5808
5812
|
ref: getRootRef,
|
|
5809
|
-
className: clsx(baseClassName,
|
|
5813
|
+
className: clsx(className, baseClassName, "vkuiRootComponent", restProps.hidden === true && "vkuiRootComponent--hidden")
|
|
5810
5814
|
}, restProps));
|
|
5811
5815
|
};
|
|
5812
5816
|
|
|
@@ -9395,7 +9399,7 @@ function useIsClient_unsupported_iterable_to_array(o, minLen) {
|
|
|
9395
9399
|
* ВНИМАНИЕ: Этот подход сделает ваши компоненты медленнее, потому что они
|
|
9396
9400
|
* должны рендериться дважды, поэтому используйте хук с осторожностью.
|
|
9397
9401
|
*
|
|
9398
|
-
* @see {@link https://
|
|
9402
|
+
* @see {@link https://react.dev/reference/react-dom/hydrate#handling-different-client-and-server-content React Docs}
|
|
9399
9403
|
*/ function useIsClient_useIsClient() {
|
|
9400
9404
|
var initial = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
9401
9405
|
var _React_useState = useIsClient_sliced_to_array(react.useState(initial), 2), isClient = _React_useState[0], setIsClient = _React_useState[1];
|
|
@@ -13085,6 +13089,7 @@ function useEnsuredControl_unsupported_iterable_to_array(o, minLen) {
|
|
|
13085
13089
|
|
|
13086
13090
|
|
|
13087
13091
|
|
|
13092
|
+
|
|
13088
13093
|
function useEnsuredControl_useEnsuredControl(_param) {
|
|
13089
13094
|
var onChangeProp = _param.onChange, disabled = _param.disabled, props = useEnsuredControl_object_without_properties(_param, [
|
|
13090
13095
|
"onChange",
|
|
@@ -13107,14 +13112,27 @@ function useEnsuredControl_useEnsuredControl(_param) {
|
|
|
13107
13112
|
onChange
|
|
13108
13113
|
];
|
|
13109
13114
|
}
|
|
13115
|
+
var useEnsuredControl_warn = warnOnce('useCustomEnsuredControl');
|
|
13110
13116
|
function useEnsuredControl_useCustomEnsuredControl(param) {
|
|
13111
13117
|
var value = param.value, defaultValue = param.defaultValue, disabled = param.disabled, onChangeProp = param.onChange;
|
|
13112
13118
|
var isControlled = value !== undefined;
|
|
13113
13119
|
var _React_useState = useEnsuredControl_sliced_to_array(react.useState(defaultValue), 2), localValue = _React_useState[0], setLocalValue = _React_useState[1];
|
|
13114
|
-
var preservedControlledValueRef = react.useRef(
|
|
13120
|
+
var preservedControlledValueRef = react.useRef();
|
|
13115
13121
|
useIsomorphicLayoutEffect_useIsomorphicLayoutEffect(function() {
|
|
13116
13122
|
preservedControlledValueRef.current = value;
|
|
13117
13123
|
});
|
|
13124
|
+
/*
|
|
13125
|
+
* Для ситуации, когда nextValue это пользовательская функция,
|
|
13126
|
+
* и в качестве аргумента мы должны передать prevValue.
|
|
13127
|
+
* Обычно в качестве prevValue используется preservedControlledValueRef, но оно может быть undefined, если
|
|
13128
|
+
* некотролируемое value вдруг стало контролируемым
|
|
13129
|
+
* (value = undefined ---> value = true)
|
|
13130
|
+
* Если в момент вызова onChange preservedControlledValueRef ещё не был
|
|
13131
|
+
* обновлён в useEffect, то мы не можем использовать preservedControlledValueRef как prevValue
|
|
13132
|
+
* В качестве запасного варианта мы храним текущее значение value в currentFallbackValueRef, чтобы
|
|
13133
|
+
* использовать его вместо preservedControlledValueRef.
|
|
13134
|
+
*/ var currentFallbackValueRef = react.useRef(value);
|
|
13135
|
+
currentFallbackValueRef.current = value;
|
|
13118
13136
|
var onChange = react.useCallback(function(nextValue) {
|
|
13119
13137
|
if (disabled) {
|
|
13120
13138
|
return;
|
|
@@ -13129,8 +13147,14 @@ function useEnsuredControl_useCustomEnsuredControl(param) {
|
|
|
13129
13147
|
return resolvedValue;
|
|
13130
13148
|
});
|
|
13131
13149
|
} else if (onChangeProp) {
|
|
13132
|
-
|
|
13133
|
-
|
|
13150
|
+
if (false) {}
|
|
13151
|
+
var prevValue = preservedControlledValueRef.current === undefined ? currentFallbackValueRef.current : preservedControlledValueRef.current;
|
|
13152
|
+
// В теории prevValue не может быть undefined,
|
|
13153
|
+
// но лучше не вызывать nextValue с таким значением
|
|
13154
|
+
if (prevValue !== undefined) {
|
|
13155
|
+
var resolvedValue = nextValue(prevValue);
|
|
13156
|
+
onChangeProp(resolvedValue);
|
|
13157
|
+
}
|
|
13134
13158
|
}
|
|
13135
13159
|
} else {
|
|
13136
13160
|
if (onChangeProp) {
|
|
@@ -28230,12 +28254,16 @@ function Footer_object_without_properties_loose(source, excluded) {
|
|
|
28230
28254
|
/**
|
|
28231
28255
|
* @see https://vkcom.github.io/VKUI/#/Footer
|
|
28232
28256
|
*/ var Footer = function(_param) {
|
|
28233
|
-
var children = _param.children, className = _param.className, restProps = Footer_object_without_properties(_param, [
|
|
28257
|
+
var children = _param.children, className = _param.className, _param_Component = _param.Component, Component = _param_Component === void 0 ? 'footer' : _param_Component, roleProp = _param.role, restProps = Footer_object_without_properties(_param, [
|
|
28234
28258
|
"children",
|
|
28235
|
-
"className"
|
|
28259
|
+
"className",
|
|
28260
|
+
"Component",
|
|
28261
|
+
"role"
|
|
28236
28262
|
]);
|
|
28263
|
+
var role = roleProp !== null && roleProp !== void 0 ? roleProp : Component === 'footer' ? 'contentinfo' : undefined;
|
|
28237
28264
|
return /*#__PURE__*/ React.createElement(Footnote, Footer_object_spread_props(Footer_object_spread({
|
|
28238
|
-
Component:
|
|
28265
|
+
Component: Component,
|
|
28266
|
+
role: role
|
|
28239
28267
|
}, restProps), {
|
|
28240
28268
|
className: classNames("vkuiFooter", className)
|
|
28241
28269
|
}), children);
|
|
@@ -30676,7 +30704,8 @@ function Search_unsupported_iterable_to_array(o, minLen) {
|
|
|
30676
30704
|
onPointerDown: onIconCancelClickStart,
|
|
30677
30705
|
onClick: onCancel,
|
|
30678
30706
|
className: "vkuiSearch__icon",
|
|
30679
|
-
tabIndex: hasValue ? undefined : -1
|
|
30707
|
+
tabIndex: hasValue ? undefined : -1,
|
|
30708
|
+
disabled: inputProps.disabled
|
|
30680
30709
|
}, /*#__PURE__*/ React.createElement(VisuallyHidden, null, clearLabel), platform === 'ios' ? /*#__PURE__*/ React.createElement(Icon16Clear, null) : /*#__PURE__*/ React.createElement(Icon24Cancel, null)), adaptiveSizeY.compact && onFindButtonClick && /*#__PURE__*/ React.createElement(Button, {
|
|
30681
30710
|
mode: "primary",
|
|
30682
30711
|
size: "m",
|
|
@@ -35013,7 +35042,7 @@ var FormLayoutGroup_sizeYClassNames = FormLayoutGroup_define_property({
|
|
|
35013
35042
|
return /*#__PURE__*/ React.createElement(RootComponent, FormLayoutGroup_object_spread({
|
|
35014
35043
|
getRootRef: rootEl,
|
|
35015
35044
|
Component: "fieldset",
|
|
35016
|
-
baseClassName: classNames("vkuiFormLayoutGroup", sizeY !== 'regular' && FormLayoutGroup_sizeYClassNames[sizeY], mode === 'horizontal' && classNames("vkuiFormLayoutGroup--mode-horizontal", 'vkuiInternalFormLayoutGroup--mode-horizontal'), mode === 'vertical' &&
|
|
35045
|
+
baseClassName: classNames("vkuiFormLayoutGroup", sizeY !== 'regular' && FormLayoutGroup_sizeYClassNames[sizeY], mode === 'horizontal' && classNames("vkuiFormLayoutGroup--mode-horizontal", 'vkuiInternalFormLayoutGroup--mode-horizontal'), mode === 'vertical' && 'vkuiInternalFormLayoutGroup--mode-vertical', isRemovable && classNames("vkuiFormLayoutGroup--removable", 'vkuiInternalFormLayoutGroup--removable'), segmented && classNames("vkuiFormLayoutGroup--segmented", 'vkuiInternalFormLayoutGroup--segmented'))
|
|
35017
35046
|
}, restProps), isRemovable ? /*#__PURE__*/ React.createElement(Removable, {
|
|
35018
35047
|
className: "vkuiFormLayoutGroup__removable",
|
|
35019
35048
|
align: "start",
|
|
@@ -37717,14 +37746,6 @@ var overscrollBehaviorClassNames = {
|
|
|
37717
37746
|
// extracted by mini-css-extract-plugin
|
|
37718
37747
|
|
|
37719
37748
|
;// CONCATENATED MODULE: ./src/components/CustomSelectDropdown/CustomSelectDropdown.tsx
|
|
37720
|
-
function CustomSelectDropdown_array_like_to_array(arr, len) {
|
|
37721
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
37722
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
37723
|
-
return arr2;
|
|
37724
|
-
}
|
|
37725
|
-
function CustomSelectDropdown_array_with_holes(arr) {
|
|
37726
|
-
if (Array.isArray(arr)) return arr;
|
|
37727
|
-
}
|
|
37728
37749
|
function CustomSelectDropdown_define_property(obj, key, value) {
|
|
37729
37750
|
if (key in obj) {
|
|
37730
37751
|
Object.defineProperty(obj, key, {
|
|
@@ -37738,33 +37759,6 @@ function CustomSelectDropdown_define_property(obj, key, value) {
|
|
|
37738
37759
|
}
|
|
37739
37760
|
return obj;
|
|
37740
37761
|
}
|
|
37741
|
-
function CustomSelectDropdown_iterable_to_array_limit(arr, i) {
|
|
37742
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
37743
|
-
if (_i == null) return;
|
|
37744
|
-
var _arr = [];
|
|
37745
|
-
var _n = true;
|
|
37746
|
-
var _d = false;
|
|
37747
|
-
var _s, _e;
|
|
37748
|
-
try {
|
|
37749
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
37750
|
-
_arr.push(_s.value);
|
|
37751
|
-
if (i && _arr.length === i) break;
|
|
37752
|
-
}
|
|
37753
|
-
} catch (err) {
|
|
37754
|
-
_d = true;
|
|
37755
|
-
_e = err;
|
|
37756
|
-
} finally{
|
|
37757
|
-
try {
|
|
37758
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
37759
|
-
} finally{
|
|
37760
|
-
if (_d) throw _e;
|
|
37761
|
-
}
|
|
37762
|
-
}
|
|
37763
|
-
return _arr;
|
|
37764
|
-
}
|
|
37765
|
-
function CustomSelectDropdown_non_iterable_rest() {
|
|
37766
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37767
|
-
}
|
|
37768
37762
|
function CustomSelectDropdown_object_spread(target) {
|
|
37769
37763
|
for(var i = 1; i < arguments.length; i++){
|
|
37770
37764
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -37807,35 +37801,20 @@ function CustomSelectDropdown_object_without_properties_loose(source, excluded)
|
|
|
37807
37801
|
}
|
|
37808
37802
|
return target;
|
|
37809
37803
|
}
|
|
37810
|
-
function CustomSelectDropdown_sliced_to_array(arr, i) {
|
|
37811
|
-
return CustomSelectDropdown_array_with_holes(arr) || CustomSelectDropdown_iterable_to_array_limit(arr, i) || CustomSelectDropdown_unsupported_iterable_to_array(arr, i) || CustomSelectDropdown_non_iterable_rest();
|
|
37812
|
-
}
|
|
37813
|
-
function CustomSelectDropdown_unsupported_iterable_to_array(o, minLen) {
|
|
37814
|
-
if (!o) return;
|
|
37815
|
-
if (typeof o === "string") return CustomSelectDropdown_array_like_to_array(o, minLen);
|
|
37816
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
37817
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
37818
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
37819
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return CustomSelectDropdown_array_like_to_array(o, minLen);
|
|
37820
|
-
}
|
|
37821
37804
|
|
|
37822
37805
|
|
|
37823
37806
|
|
|
37824
37807
|
|
|
37825
37808
|
|
|
37826
37809
|
|
|
37827
|
-
var calcIsTop = function(placement) {
|
|
37828
|
-
return placement.startsWith('top');
|
|
37829
|
-
};
|
|
37830
37810
|
var CustomSelectDropdown_CustomSelectDropdown = function(_param) {
|
|
37831
|
-
var children = _param.children, targetRef = _param.targetRef, scrollBoxRef = _param.scrollBoxRef, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'bottom' : _param_placement, fetching = _param.fetching,
|
|
37811
|
+
var children = _param.children, targetRef = _param.targetRef, scrollBoxRef = _param.scrollBoxRef, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'bottom' : _param_placement, fetching = _param.fetching, _param_offsetDistance = _param.offsetDistance, offsetDistance = _param_offsetDistance === void 0 ? 0 : _param_offsetDistance, _param_autoWidth = _param.autoWidth, autoWidth = _param_autoWidth === void 0 ? false : _param_autoWidth, _param_forcePortal = _param.forcePortal, forcePortal = _param_forcePortal === void 0 ? true : _param_forcePortal, autoHideScrollbar = _param.autoHideScrollbar, autoHideScrollbarDelay = _param.autoHideScrollbarDelay, className = _param.className, _param_noMaxHeight = _param.noMaxHeight, noMaxHeight = _param_noMaxHeight === void 0 ? false : _param_noMaxHeight, // CustomScrollView
|
|
37832
37812
|
overscrollBehavior = _param.overscrollBehavior, restProps = CustomSelectDropdown_object_without_properties(_param, [
|
|
37833
37813
|
"children",
|
|
37834
37814
|
"targetRef",
|
|
37835
37815
|
"scrollBoxRef",
|
|
37836
37816
|
"placement",
|
|
37837
37817
|
"fetching",
|
|
37838
|
-
"onPlacementChange",
|
|
37839
37818
|
"offsetDistance",
|
|
37840
37819
|
"autoWidth",
|
|
37841
37820
|
"forcePortal",
|
|
@@ -37845,24 +37824,12 @@ var CustomSelectDropdown_CustomSelectDropdown = function(_param) {
|
|
|
37845
37824
|
"noMaxHeight",
|
|
37846
37825
|
"overscrollBehavior"
|
|
37847
37826
|
]);
|
|
37848
|
-
var _React_useState = CustomSelectDropdown_sliced_to_array(React.useState(function() {
|
|
37849
|
-
return calcIsTop(placement);
|
|
37850
|
-
}), 2), isTop = _React_useState[0], setIsTop = _React_useState[1];
|
|
37851
|
-
var onPlacementChange = React.useCallback(function(placement) {
|
|
37852
|
-
setIsTop(calcIsTop(placement));
|
|
37853
|
-
if (parentOnPlacementChange) {
|
|
37854
|
-
parentOnPlacementChange(placement);
|
|
37855
|
-
}
|
|
37856
|
-
}, [
|
|
37857
|
-
parentOnPlacementChange
|
|
37858
|
-
]);
|
|
37859
37827
|
return /*#__PURE__*/ React.createElement(Popper, CustomSelectDropdown_object_spread({
|
|
37860
37828
|
targetRef: targetRef,
|
|
37861
37829
|
offsetByMainAxis: offsetDistance,
|
|
37862
37830
|
sameWidth: !autoWidth,
|
|
37863
|
-
onPlacementChange: onPlacementChange,
|
|
37864
37831
|
placement: placement,
|
|
37865
|
-
className: classNames("vkuiCustomSelectDropdown", 'vkuiInternalCustomSelectDropdown', offsetDistance === 0 && (
|
|
37832
|
+
className: classNames("vkuiCustomSelectDropdown", 'vkuiInternalCustomSelectDropdown', offsetDistance === 0 && (placement.includes('top') ? "vkuiCustomSelectDropdown--top" : "vkuiCustomSelectDropdown--bottom"), autoWidth && classNames("vkuiCustomSelectDropdown--wide", 'vkuiInternalCustomSelectDropdown--wide'), className),
|
|
37866
37833
|
usePortal: forcePortal,
|
|
37867
37834
|
autoUpdateOnTargetResize: true
|
|
37868
37835
|
}, restProps), /*#__PURE__*/ React.createElement(CustomScrollView, {
|
|
@@ -38641,6 +38608,13 @@ var ChipsSelect_findIndexBefore = function() {
|
|
|
38641
38608
|
var inputRef = useExternRef(getRef, inputRefHook);
|
|
38642
38609
|
// Связано с CustomSelectDropdownProps
|
|
38643
38610
|
var _React_useState = ChipsSelect_sliced_to_array(React.useState(placementProp), 2), dropdownVerticalPlacement = _React_useState[0], setDropdownVerticalPlacement = _React_useState[1];
|
|
38611
|
+
var onDropdownPlacementChange = React.useCallback(function(placement) {
|
|
38612
|
+
if (placement.startsWith('top')) {
|
|
38613
|
+
setDropdownVerticalPlacement('top');
|
|
38614
|
+
} else if (placement.startsWith('bottom')) {
|
|
38615
|
+
setDropdownVerticalPlacement('bottom');
|
|
38616
|
+
}
|
|
38617
|
+
}, []);
|
|
38644
38618
|
var dropdownId = React.useId();
|
|
38645
38619
|
var dropdownCurrentItemId = focusedOptionIndex !== null ? "".concat(dropdownId, "-").concat(focusedOptionIndex) : undefined;
|
|
38646
38620
|
var dropdownScrollBoxRef = React.useRef(null);
|
|
@@ -38769,13 +38743,6 @@ var ChipsSelect_findIndexBefore = function() {
|
|
|
38769
38743
|
focusedOptionIndex,
|
|
38770
38744
|
setFocusedOption
|
|
38771
38745
|
]);
|
|
38772
|
-
var onDropdownPlacementChange = React.useCallback(function(placement) {
|
|
38773
|
-
/* istanbul ignore next: */ if (placement.startsWith('top')) {
|
|
38774
|
-
setDropdownVerticalPlacement('top');
|
|
38775
|
-
} else if (placement.startsWith('bottom')) {
|
|
38776
|
-
setDropdownVerticalPlacement('bottom');
|
|
38777
|
-
}
|
|
38778
|
-
}, []);
|
|
38779
38746
|
var onDropdownMouseLeave = React.useCallback(function() {
|
|
38780
38747
|
setFocusedOptionIndex(null);
|
|
38781
38748
|
}, [
|
|
@@ -38788,7 +38755,7 @@ var ChipsSelect_findIndexBefore = function() {
|
|
|
38788
38755
|
]);
|
|
38789
38756
|
useGlobalOnClickOutside(handleClickOutside, opened ? rootRef : null, opened ? dropdownScrollBoxRef : null);
|
|
38790
38757
|
var openedClassNames = React.useMemo(function() {
|
|
38791
|
-
return opened && dropdownOffsetDistance === 0 && (
|
|
38758
|
+
return opened && dropdownOffsetDistance === 0 && (dropdownVerticalPlacement.includes('top') ? "vkuiChipsSelect--pop-up" : "vkuiChipsSelect--pop-down") || undefined;
|
|
38792
38759
|
}, [
|
|
38793
38760
|
dropdownOffsetDistance,
|
|
38794
38761
|
opened,
|
|
@@ -38832,7 +38799,7 @@ var ChipsSelect_findIndexBefore = function() {
|
|
|
38832
38799
|
})), opened && /*#__PURE__*/ React.createElement(CustomSelectDropdown, {
|
|
38833
38800
|
"data-testid": dropdownTestId,
|
|
38834
38801
|
targetRef: rootRef,
|
|
38835
|
-
placement:
|
|
38802
|
+
placement: dropdownVerticalPlacement,
|
|
38836
38803
|
scrollBoxRef: dropdownScrollBoxRef,
|
|
38837
38804
|
onPlacementChange: onDropdownPlacementChange,
|
|
38838
38805
|
onMouseLeave: onDropdownMouseLeave,
|
|
@@ -41351,7 +41318,7 @@ var filter = function(options, inputValue, filterFn) {
|
|
|
41351
41318
|
selectedOptionIndex
|
|
41352
41319
|
]);
|
|
41353
41320
|
var openedClassNames = React.useMemo(function() {
|
|
41354
|
-
return opened && dropdownOffsetDistance === 0 && (
|
|
41321
|
+
return opened && dropdownOffsetDistance === 0 && (popperPlacement.includes('top') ? "vkuiCustomSelect--pop-up" : "vkuiCustomSelect--pop-down") || undefined;
|
|
41355
41322
|
}, [
|
|
41356
41323
|
dropdownOffsetDistance,
|
|
41357
41324
|
opened,
|
|
@@ -41884,7 +41851,7 @@ var filter = function(options, inputValue, filterFn) {
|
|
|
41884
41851
|
});
|
|
41885
41852
|
})), opened && /*#__PURE__*/ React.createElement(CustomSelectDropdown, {
|
|
41886
41853
|
targetRef: containerRef,
|
|
41887
|
-
placement:
|
|
41854
|
+
placement: popperPlacement,
|
|
41888
41855
|
scrollBoxRef: setScrollBoxRef,
|
|
41889
41856
|
onPlacementChange: setPopperPlacement,
|
|
41890
41857
|
onMouseLeave: resetFocusedOption,
|
package/package.json
CHANGED
|
@@ -235,8 +235,17 @@ export const ChipsSelect = <Option extends ChipOption>({
|
|
|
235
235
|
|
|
236
236
|
// Связано с CustomSelectDropdownProps
|
|
237
237
|
const [dropdownVerticalPlacement, setDropdownVerticalPlacement] = React.useState<
|
|
238
|
-
|
|
238
|
+
'top' | 'bottom'
|
|
239
239
|
>(placementProp);
|
|
240
|
+
|
|
241
|
+
const onDropdownPlacementChange = React.useCallback((placement: Placement) => {
|
|
242
|
+
if (placement.startsWith('top')) {
|
|
243
|
+
setDropdownVerticalPlacement('top');
|
|
244
|
+
} else if (placement.startsWith('bottom')) {
|
|
245
|
+
setDropdownVerticalPlacement('bottom');
|
|
246
|
+
}
|
|
247
|
+
}, []);
|
|
248
|
+
|
|
240
249
|
const dropdownId = React.useId();
|
|
241
250
|
const dropdownCurrentItemId =
|
|
242
251
|
focusedOptionIndex !== null ? `${dropdownId}-${focusedOptionIndex}` : undefined;
|
|
@@ -393,15 +402,6 @@ export const ChipsSelect = <Option extends ChipOption>({
|
|
|
393
402
|
}
|
|
394
403
|
}, [options, focusedOptionIndex, setFocusedOption]);
|
|
395
404
|
|
|
396
|
-
const onDropdownPlacementChange = React.useCallback((placement: Placement) => {
|
|
397
|
-
/* istanbul ignore next: */
|
|
398
|
-
if (placement.startsWith('top')) {
|
|
399
|
-
setDropdownVerticalPlacement('top');
|
|
400
|
-
} else if (placement.startsWith('bottom')) {
|
|
401
|
-
setDropdownVerticalPlacement('bottom');
|
|
402
|
-
}
|
|
403
|
-
}, []);
|
|
404
|
-
|
|
405
405
|
const onDropdownMouseLeave = React.useCallback(() => {
|
|
406
406
|
setFocusedOptionIndex(null);
|
|
407
407
|
}, [setFocusedOptionIndex]);
|
|
@@ -420,7 +420,7 @@ export const ChipsSelect = <Option extends ChipOption>({
|
|
|
420
420
|
() =>
|
|
421
421
|
(opened &&
|
|
422
422
|
dropdownOffsetDistance === 0 &&
|
|
423
|
-
(dropdownVerticalPlacement
|
|
423
|
+
(dropdownVerticalPlacement.includes('top')
|
|
424
424
|
? styles['ChipsSelect--pop-up']
|
|
425
425
|
: styles['ChipsSelect--pop-down'])) ||
|
|
426
426
|
undefined,
|
|
@@ -475,7 +475,7 @@ export const ChipsSelect = <Option extends ChipOption>({
|
|
|
475
475
|
<CustomSelectDropdown
|
|
476
476
|
data-testid={dropdownTestId}
|
|
477
477
|
targetRef={rootRef}
|
|
478
|
-
placement={
|
|
478
|
+
placement={dropdownVerticalPlacement}
|
|
479
479
|
scrollBoxRef={dropdownScrollBoxRef}
|
|
480
480
|
onPlacementChange={onDropdownPlacementChange}
|
|
481
481
|
onMouseLeave={onDropdownMouseLeave}
|
|
@@ -3,7 +3,7 @@ import { classNames, debounce } from '@vkontakte/vkjs';
|
|
|
3
3
|
import { useAdaptivity } from '../../hooks/useAdaptivity';
|
|
4
4
|
import { useExternRef } from '../../hooks/useExternRef';
|
|
5
5
|
import { useDOM } from '../../lib/dom';
|
|
6
|
-
import type {
|
|
6
|
+
import type { Placement } from '../../lib/floating';
|
|
7
7
|
import { defaultFilterFn, type FilterFn } from '../../lib/select';
|
|
8
8
|
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
9
9
|
import { warnOnce } from '../../lib/warnOnce';
|
|
@@ -230,9 +230,7 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
230
230
|
calculateInputValueFromOptions(optionsProp, nativeSelectValue),
|
|
231
231
|
);
|
|
232
232
|
|
|
233
|
-
const [popperPlacement, setPopperPlacement] = React.useState<
|
|
234
|
-
popupDirection,
|
|
235
|
-
);
|
|
233
|
+
const [popperPlacement, setPopperPlacement] = React.useState<Placement>(popupDirection);
|
|
236
234
|
const [options, setOptions] = React.useState(optionsProp);
|
|
237
235
|
const [selectedOptionIndex, setSelectedOptionIndex] = React.useState<number | undefined>(
|
|
238
236
|
findSelectedIndex(optionsProp, props.value ?? defaultValue, allowClearButton),
|
|
@@ -266,7 +264,7 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
266
264
|
() =>
|
|
267
265
|
(opened &&
|
|
268
266
|
dropdownOffsetDistance === 0 &&
|
|
269
|
-
(popperPlacement
|
|
267
|
+
(popperPlacement.includes('top')
|
|
270
268
|
? styles['CustomSelect--pop-up']
|
|
271
269
|
: styles['CustomSelect--pop-down'])) ||
|
|
272
270
|
undefined,
|
|
@@ -851,7 +849,7 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
851
849
|
{opened && (
|
|
852
850
|
<CustomSelectDropdown
|
|
853
851
|
targetRef={containerRef}
|
|
854
|
-
placement={
|
|
852
|
+
placement={popperPlacement}
|
|
855
853
|
scrollBoxRef={setScrollBoxRef}
|
|
856
854
|
onPlacementChange={setPopperPlacement}
|
|
857
855
|
onMouseLeave={resetFocusedOption}
|
|
@@ -32,15 +32,12 @@ export interface CustomSelectDropdownProps
|
|
|
32
32
|
noMaxHeight?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const calcIsTop = (placement: Placement) => placement.startsWith('top');
|
|
36
|
-
|
|
37
35
|
export const CustomSelectDropdown = ({
|
|
38
36
|
children,
|
|
39
37
|
targetRef,
|
|
40
38
|
scrollBoxRef,
|
|
41
39
|
placement = 'bottom',
|
|
42
40
|
fetching,
|
|
43
|
-
onPlacementChange: parentOnPlacementChange,
|
|
44
41
|
offsetDistance = 0,
|
|
45
42
|
autoWidth = false,
|
|
46
43
|
forcePortal = true,
|
|
@@ -52,30 +49,19 @@ export const CustomSelectDropdown = ({
|
|
|
52
49
|
overscrollBehavior,
|
|
53
50
|
...restProps
|
|
54
51
|
}: CustomSelectDropdownProps): React.ReactNode => {
|
|
55
|
-
const [isTop, setIsTop] = React.useState(() => calcIsTop(placement));
|
|
56
|
-
|
|
57
|
-
const onPlacementChange = React.useCallback(
|
|
58
|
-
(placement: Placement) => {
|
|
59
|
-
setIsTop(calcIsTop(placement));
|
|
60
|
-
if (parentOnPlacementChange) {
|
|
61
|
-
parentOnPlacementChange(placement);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
[parentOnPlacementChange],
|
|
65
|
-
);
|
|
66
|
-
|
|
67
52
|
return (
|
|
68
53
|
<Popper
|
|
69
54
|
targetRef={targetRef}
|
|
70
55
|
offsetByMainAxis={offsetDistance}
|
|
71
56
|
sameWidth={!autoWidth}
|
|
72
|
-
onPlacementChange={onPlacementChange}
|
|
73
57
|
placement={placement}
|
|
74
58
|
className={classNames(
|
|
75
59
|
styles['CustomSelectDropdown'],
|
|
76
60
|
'vkuiInternalCustomSelectDropdown',
|
|
77
61
|
offsetDistance === 0 &&
|
|
78
|
-
(
|
|
62
|
+
(placement.includes('top')
|
|
63
|
+
? styles['CustomSelectDropdown--top']
|
|
64
|
+
: styles['CustomSelectDropdown--bottom']),
|
|
79
65
|
autoWidth &&
|
|
80
66
|
classNames(
|
|
81
67
|
styles['CustomSelectDropdown--wide'],
|
|
@@ -9,9 +9,21 @@ export type FooterProps = React.AllHTMLAttributes<HTMLElement> & HasComponent;
|
|
|
9
9
|
/**
|
|
10
10
|
* @see https://vkcom.github.io/VKUI/#/Footer
|
|
11
11
|
*/
|
|
12
|
-
export const Footer = ({
|
|
12
|
+
export const Footer = ({
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
Component = 'footer',
|
|
16
|
+
role: roleProp,
|
|
17
|
+
...restProps
|
|
18
|
+
}: FooterProps): React.ReactNode => {
|
|
19
|
+
const role = roleProp ?? (Component === 'footer' ? 'contentinfo' : undefined);
|
|
13
20
|
return (
|
|
14
|
-
<Footnote
|
|
21
|
+
<Footnote
|
|
22
|
+
Component={Component}
|
|
23
|
+
role={role}
|
|
24
|
+
{...restProps}
|
|
25
|
+
className={classNames(styles['Footer'], className)}
|
|
26
|
+
>
|
|
15
27
|
{children}
|
|
16
28
|
</Footnote>
|
|
17
29
|
);
|
|
@@ -111,14 +111,33 @@
|
|
|
111
111
|
background-color: var(--vkui--color_field_background);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
.FormField--hover {
|
|
115
|
+
background-color: var(--vkui--color_field_background);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.FormField--mode-default.FormField--hover .FormField__border {
|
|
119
|
+
border-color: var(--vkui--color_field_border_alpha--hover);
|
|
120
|
+
z-index: var(--vkui_internal--z_index_form_field_border_hover);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* useFocusVisibleClassName()
|
|
125
|
+
*/
|
|
126
|
+
/* increase specificity for selects */
|
|
127
|
+
.FormField--focus-visible.FormField--focus-visible .FormField__border {
|
|
128
|
+
border-color: var(--vkui--color_stroke_accent);
|
|
129
|
+
}
|
|
130
|
+
|
|
114
131
|
/**
|
|
115
132
|
* CMP:
|
|
116
133
|
* FormItem
|
|
117
134
|
* [start]
|
|
118
135
|
*/
|
|
119
136
|
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
|
|
120
|
-
:global(.vkuiInternalFormItem--status-error) .FormField__border,
|
|
121
|
-
.
|
|
137
|
+
:global(.vkuiInternalFormItem--status-error) .FormField--mode-default .FormField__border,
|
|
138
|
+
:global(.vkuiInternalFormItem--status-error) .FormField--focus-visible .FormField__border,
|
|
139
|
+
.FormField--status-error.FormField--mode-default .FormField__border,
|
|
140
|
+
.FormField--status-error.FormField--focus-visible .FormField__border {
|
|
122
141
|
border-color: var(--vkui--color_stroke_negative);
|
|
123
142
|
z-index: var(--vkui_internal--z_index_form_field_status);
|
|
124
143
|
}
|
|
@@ -129,12 +148,21 @@
|
|
|
129
148
|
background-color: var(--vkui--color_background_negative_tint);
|
|
130
149
|
}
|
|
131
150
|
|
|
151
|
+
/* increase specificity to cover --mode-default case */
|
|
132
152
|
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
|
|
133
|
-
:global(.vkuiInternalFormItem--status-valid) .FormField__border,
|
|
134
|
-
.
|
|
153
|
+
:global(.vkuiInternalFormItem--status-valid) .FormField--mode-default .FormField__border,
|
|
154
|
+
:global(.vkuiInternalFormItem--status-valid) .FormField--focus-visible .FormField__border,
|
|
155
|
+
.FormField--status-valid.FormField--mode-default .FormField__border,
|
|
156
|
+
.FormField--status-valid.FormField--focus-visible .FormField__border {
|
|
135
157
|
border-color: var(--vkui--color_stroke_positive);
|
|
136
158
|
z-index: var(--vkui_internal--z_index_form_field_status);
|
|
137
159
|
}
|
|
160
|
+
|
|
161
|
+
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
|
|
162
|
+
:global(.vkuiInternalFormItem--status-valid) .FormField:not(.FormField--mode-default),
|
|
163
|
+
.FormField--status-valid:not(.FormField--mode-default) {
|
|
164
|
+
background-color: var(--vkui--color_background_positive_tint);
|
|
165
|
+
}
|
|
138
166
|
/* [end] */
|
|
139
167
|
|
|
140
168
|
.FormField--disabled {
|
|
@@ -143,15 +171,6 @@
|
|
|
143
171
|
pointer-events: none;
|
|
144
172
|
}
|
|
145
173
|
|
|
146
|
-
.FormField--hover {
|
|
147
|
-
background-color: var(--vkui--color_field_background);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.FormField--mode-default.FormField--hover .FormField__border {
|
|
151
|
-
border-color: var(--vkui--color_field_border_alpha--hover);
|
|
152
|
-
z-index: var(--vkui_internal--z_index_form_field_border_hover);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
174
|
/**
|
|
156
175
|
* CMP:
|
|
157
176
|
* NativeSelect
|
|
@@ -221,11 +240,3 @@
|
|
|
221
240
|
border-end-start-radius: var(--vkui--size_border_radius--regular);
|
|
222
241
|
border-end-end-radius: var(--vkui--size_border_radius--regular);
|
|
223
242
|
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* useFocusVisibleClassName()
|
|
227
|
-
*/
|
|
228
|
-
/* increase specificity for selects */
|
|
229
|
-
.FormField--focus-visible.FormField--focus-visible .FormField__border {
|
|
230
|
-
border-color: var(--vkui--color_stroke_accent);
|
|
231
|
-
}
|
|
@@ -64,11 +64,7 @@ export const FormLayoutGroup = ({
|
|
|
64
64
|
styles['FormLayoutGroup--mode-horizontal'],
|
|
65
65
|
'vkuiInternalFormLayoutGroup--mode-horizontal',
|
|
66
66
|
),
|
|
67
|
-
mode === 'vertical' &&
|
|
68
|
-
classNames(
|
|
69
|
-
styles['FormLayoutGroup--mode-vertical'],
|
|
70
|
-
'vkuiInternalFormLayoutGroup--mode-vertical',
|
|
71
|
-
),
|
|
67
|
+
mode === 'vertical' && 'vkuiInternalFormLayoutGroup--mode-vertical',
|
|
72
68
|
isRemovable &&
|
|
73
69
|
classNames(
|
|
74
70
|
styles['FormLayoutGroup--removable'],
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
.RootComponent[hidden='hidden'],
|
|
2
|
+
.RootComponent--hidden {
|
|
3
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
4
|
+
display: none !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.RootComponent[hidden='until-found'] {
|
|
8
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
9
|
+
content-visibility: hidden !important;
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '@vkontakte/vkjs';
|
|
3
|
-
import { HasComponent, HasRootRef } from '../../types';
|
|
3
|
+
import type { HasComponent, HasRootRef } from '../../types';
|
|
4
|
+
import styles from './RootComponent.module.css';
|
|
4
5
|
|
|
5
6
|
export interface RootComponentProps<T>
|
|
6
7
|
extends React.AllHTMLAttributes<T>,
|
|
@@ -19,5 +20,14 @@ export const RootComponent = <T,>({
|
|
|
19
20
|
getRootRef,
|
|
20
21
|
...restProps
|
|
21
22
|
}: RootComponentProps<T>): React.ReactNode => (
|
|
22
|
-
<Component
|
|
23
|
+
<Component
|
|
24
|
+
ref={getRootRef}
|
|
25
|
+
className={classNames(
|
|
26
|
+
className,
|
|
27
|
+
baseClassName,
|
|
28
|
+
styles['RootComponent'],
|
|
29
|
+
restProps.hidden === true && styles['RootComponent--hidden'],
|
|
30
|
+
)}
|
|
31
|
+
{...restProps}
|
|
32
|
+
/>
|
|
23
33
|
);
|
|
@@ -206,6 +206,7 @@ export const Search = ({
|
|
|
206
206
|
onClick={onCancel}
|
|
207
207
|
className={styles['Search__icon']}
|
|
208
208
|
tabIndex={hasValue ? undefined : -1}
|
|
209
|
+
disabled={inputProps.disabled}
|
|
209
210
|
>
|
|
210
211
|
<VisuallyHidden>{clearLabel}</VisuallyHidden>
|
|
211
212
|
{platform === 'ios' ? <Icon16Clear /> : <Icon24Cancel />}
|