@vkontakte/vkui 6.7.2 → 6.7.3
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/BaseGallery/CarouselBase/CarouselBase.d.ts.map +1 -1
- package/dist/cjs/components/BaseGallery/CarouselBase/CarouselBase.js +5 -1
- package/dist/cjs/components/BaseGallery/CarouselBase/CarouselBase.js.map +1 -1
- package/dist/cjs/components/Button/Button.d.ts +1 -0
- package/dist/cjs/components/Button/Button.d.ts.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +3 -18
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/FormItem/FormItem.d.ts +0 -2
- package/dist/cjs/components/FormItem/FormItem.d.ts.map +1 -1
- package/dist/cjs/components/FormItem/FormItem.js.map +1 -1
- package/dist/components/BaseGallery/CarouselBase/CarouselBase.d.ts.map +1 -1
- package/dist/components/BaseGallery/CarouselBase/CarouselBase.js +5 -1
- package/dist/components/BaseGallery/CarouselBase/CarouselBase.js.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.js +3 -18
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/FormItem/FormItem.d.ts +0 -2
- package/dist/components/FormItem/FormItem.d.ts.map +1 -1
- package/dist/components/FormItem/FormItem.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/components.js.tmp +8 -18
- package/dist/cssm/components/BaseGallery/CarouselBase/CarouselBase.d.ts.map +1 -1
- package/dist/cssm/components/BaseGallery/CarouselBase/CarouselBase.js +5 -1
- package/dist/cssm/components/BaseGallery/CarouselBase/CarouselBase.js.map +1 -1
- package/dist/cssm/components/Button/Button.d.ts +1 -0
- package/dist/cssm/components/Button/Button.d.ts.map +1 -1
- package/dist/cssm/components/Button/Button.js +1 -0
- package/dist/cssm/components/Button/Button.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +3 -18
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/FormItem/FormItem.d.ts +0 -2
- package/dist/cssm/components/FormItem/FormItem.d.ts.map +1 -1
- package/dist/cssm/components/FormItem/FormItem.js.map +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.module.css +1 -0
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/dist/vkui.js.tmp +8 -18
- package/package.json +1 -1
- package/src/components/BaseGallery/CarouselBase/CarouselBase.tsx +6 -1
- package/src/components/Button/Button.tsx +1 -0
- package/src/components/CustomSelect/CustomSelect.tsx +4 -17
- package/src/components/FormItem/FormItem.tsx +0 -2
- package/src/components/FormLayoutGroup/FormLayoutGroup.module.css +1 -0
package/dist/vkui.js.tmp
CHANGED
|
@@ -11305,6 +11305,7 @@ function Button_object_without_properties_loose(source, excluded) {
|
|
|
11305
11305
|
|
|
11306
11306
|
|
|
11307
11307
|
|
|
11308
|
+
|
|
11308
11309
|
var stylesSize = {
|
|
11309
11310
|
s: "vkuiButton--size-s",
|
|
11310
11311
|
m: "vkuiButton--size-m",
|
|
@@ -30016,6 +30017,10 @@ var CarouselBase_CarouselBase = function(_param) {
|
|
|
30016
30017
|
width: elem.offsetWidth
|
|
30017
30018
|
};
|
|
30018
30019
|
}) || [];
|
|
30020
|
+
if (localSlides.length === 0) {
|
|
30021
|
+
initialized.current = false;
|
|
30022
|
+
return;
|
|
30023
|
+
}
|
|
30019
30024
|
var containerWidth = rootRef.current.offsetWidth;
|
|
30020
30025
|
var viewportOffsetWidth = viewportRef.current.offsetWidth;
|
|
30021
30026
|
var layerWidth = localSlides.reduce(function(val, slide) {
|
|
@@ -42473,20 +42478,6 @@ var filter = function(options, inputValue, filterFn) {
|
|
|
42473
42478
|
renderOption
|
|
42474
42479
|
]);
|
|
42475
42480
|
var selectInputRef = useExternRef(getSelectInputRef);
|
|
42476
|
-
var focusOnInputTimerRef = React.useRef();
|
|
42477
|
-
var focusOnInput = React.useCallback(function() {
|
|
42478
|
-
clearTimeout(focusOnInputTimerRef.current);
|
|
42479
|
-
focusOnInputTimerRef.current = setTimeout(function() {
|
|
42480
|
-
selectInputRef.current && selectInputRef.current.focus();
|
|
42481
|
-
}, 0);
|
|
42482
|
-
}, [
|
|
42483
|
-
selectInputRef
|
|
42484
|
-
]);
|
|
42485
|
-
useIsomorphicLayoutEffect(function clearFocusOnInputTimer() {
|
|
42486
|
-
return function() {
|
|
42487
|
-
clearTimeout(focusOnInputTimerRef.current);
|
|
42488
|
-
};
|
|
42489
|
-
}, []);
|
|
42490
42481
|
var controlledValueSet = isControlledOutside && props.value !== '';
|
|
42491
42482
|
var uncontrolledValueSet = !isControlledOutside && nativeSelectValue !== '';
|
|
42492
42483
|
var clearButtonShown = allowClearButton && !opened && (controlledValueSet || uncontrolledValueSet);
|
|
@@ -42499,7 +42490,7 @@ var filter = function(options, inputValue, filterFn) {
|
|
|
42499
42490
|
onClick: function clearSelectState() {
|
|
42500
42491
|
setNativeSelectValue('');
|
|
42501
42492
|
setInputValue('');
|
|
42502
|
-
|
|
42493
|
+
selectInputRef.current && selectInputRef.current.focus();
|
|
42503
42494
|
},
|
|
42504
42495
|
disabled: restProps.disabled,
|
|
42505
42496
|
"data-testid": clearButtonTestId
|
|
@@ -42510,7 +42501,7 @@ var filter = function(options, inputValue, filterFn) {
|
|
|
42510
42501
|
iconProp,
|
|
42511
42502
|
restProps.disabled,
|
|
42512
42503
|
clearButtonTestId,
|
|
42513
|
-
|
|
42504
|
+
selectInputRef
|
|
42514
42505
|
]);
|
|
42515
42506
|
var icon = React.useMemo(function() {
|
|
42516
42507
|
if (iconProp !== undefined) {
|
|
@@ -42544,12 +42535,11 @@ var filter = function(options, inputValue, filterFn) {
|
|
|
42544
42535
|
selectInputRef.current.click();
|
|
42545
42536
|
var inputIsNotFocused = document.activeElement !== selectInputRef.current;
|
|
42546
42537
|
if (inputIsNotFocused) {
|
|
42547
|
-
|
|
42538
|
+
selectInputRef.current.focus();
|
|
42548
42539
|
}
|
|
42549
42540
|
}
|
|
42550
42541
|
}, [
|
|
42551
42542
|
document,
|
|
42552
|
-
focusOnInput,
|
|
42553
42543
|
selectInputRef
|
|
42554
42544
|
]);
|
|
42555
42545
|
var preventInputBlurWhenClickInsideFocusedSelectArea = function(e) {
|
package/package.json
CHANGED
|
@@ -114,6 +114,11 @@ export const CarouselBase = ({
|
|
|
114
114
|
return { coordX: elem.offsetLeft, width: elem.offsetWidth };
|
|
115
115
|
}) || [];
|
|
116
116
|
|
|
117
|
+
if (localSlides.length === 0) {
|
|
118
|
+
initialized.current = false;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
const containerWidth = rootRef.current.offsetWidth;
|
|
118
123
|
const viewportOffsetWidth = viewportRef.current.offsetWidth;
|
|
119
124
|
const layerWidth = localSlides.reduce((val, slide) => slide.width + val, 0);
|
|
@@ -128,7 +133,7 @@ export const CarouselBase = ({
|
|
|
128
133
|
}
|
|
129
134
|
if (remainingWidth <= 0 && slideIndex === localSlides.length) {
|
|
130
135
|
warn(
|
|
131
|
-
'Ширины слайдов недостаточно для корректной работы свойства "looped". Пожалуйста, сделайте её больше.
|
|
136
|
+
'Ширины слайдов недостаточно для корректной работы свойства "looped". Пожалуйста, сделайте её больше.',
|
|
132
137
|
);
|
|
133
138
|
}
|
|
134
139
|
}
|
|
@@ -5,6 +5,7 @@ import { usePlatform } from '../../hooks/usePlatform';
|
|
|
5
5
|
import type { HasAlign } from '../../types';
|
|
6
6
|
import { Spinner } from '../Spinner/Spinner';
|
|
7
7
|
import { Tappable, type TappableProps } from '../Tappable/Tappable';
|
|
8
|
+
import '../Tappable/Tappable.module.css';
|
|
8
9
|
import '../Spinner/Spinner.module.css';
|
|
9
10
|
import styles from './Button.module.css';
|
|
10
11
|
|
|
@@ -714,19 +714,6 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
714
714
|
}, [emptyText, options, renderDropdown, renderOption]);
|
|
715
715
|
|
|
716
716
|
const selectInputRef = useExternRef(getSelectInputRef);
|
|
717
|
-
const focusOnInputTimerRef = React.useRef<ReturnType<typeof setTimeout>>();
|
|
718
|
-
const focusOnInput = React.useCallback(() => {
|
|
719
|
-
clearTimeout(focusOnInputTimerRef.current);
|
|
720
|
-
|
|
721
|
-
focusOnInputTimerRef.current = setTimeout(() => {
|
|
722
|
-
selectInputRef.current && selectInputRef.current.focus();
|
|
723
|
-
}, 0);
|
|
724
|
-
}, [selectInputRef]);
|
|
725
|
-
useIsomorphicLayoutEffect(function clearFocusOnInputTimer() {
|
|
726
|
-
return () => {
|
|
727
|
-
clearTimeout(focusOnInputTimerRef.current);
|
|
728
|
-
};
|
|
729
|
-
}, []);
|
|
730
717
|
|
|
731
718
|
const controlledValueSet = isControlledOutside && props.value !== '';
|
|
732
719
|
const uncontrolledValueSet = !isControlledOutside && nativeSelectValue !== '';
|
|
@@ -744,7 +731,7 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
744
731
|
onClick={function clearSelectState() {
|
|
745
732
|
setNativeSelectValue('');
|
|
746
733
|
setInputValue('');
|
|
747
|
-
|
|
734
|
+
selectInputRef.current && selectInputRef.current.focus();
|
|
748
735
|
}}
|
|
749
736
|
disabled={restProps.disabled}
|
|
750
737
|
data-testid={clearButtonTestId}
|
|
@@ -756,7 +743,7 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
756
743
|
iconProp,
|
|
757
744
|
restProps.disabled,
|
|
758
745
|
clearButtonTestId,
|
|
759
|
-
|
|
746
|
+
selectInputRef,
|
|
760
747
|
]);
|
|
761
748
|
|
|
762
749
|
const icon = React.useMemo(() => {
|
|
@@ -801,11 +788,11 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
|
|
|
801
788
|
|
|
802
789
|
const inputIsNotFocused = document.activeElement !== selectInputRef.current;
|
|
803
790
|
if (inputIsNotFocused) {
|
|
804
|
-
|
|
791
|
+
selectInputRef.current.focus();
|
|
805
792
|
}
|
|
806
793
|
}
|
|
807
794
|
},
|
|
808
|
-
[document,
|
|
795
|
+
[document, selectInputRef],
|
|
809
796
|
);
|
|
810
797
|
|
|
811
798
|
const preventInputBlurWhenClickInsideFocusedSelectArea = (
|
|
@@ -44,8 +44,6 @@ export interface FormItemProps
|
|
|
44
44
|
* Позволяет полностью заменить шапку поля пользовательским компонентом.
|
|
45
45
|
*
|
|
46
46
|
* @since 6.1.0
|
|
47
|
-
*
|
|
48
|
-
* TODO [>=7]: удалить и использовать top - оно будет принимать либо строку, либо подкомпонент
|
|
49
47
|
*/
|
|
50
48
|
topNode?: React.ReactNode;
|
|
51
49
|
bottom?: React.ReactNode;
|