@telus-uds/components-base 3.28.0 → 3.28.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 +11 -2
- package/lib/cjs/Carousel/Carousel.js +16 -15
- package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +3 -3
- package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +5 -1
- package/lib/esm/Carousel/Carousel.js +16 -15
- package/lib/esm/Carousel/CarouselItem/CarouselItem.js +3 -3
- package/lib/esm/MultiSelectFilter/MultiSelectFilter.js +5 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/Carousel/Carousel.jsx +16 -15
- package/src/Carousel/CarouselItem/CarouselItem.jsx +3 -3
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 20 Feb 2026 23:53:11 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 3.28.1
|
|
8
|
+
|
|
9
|
+
Fri, 20 Feb 2026 23:53:11 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- `MultiSelectFilter`: onOpen callback now triggers when filter opens instead of when it closes (josue.higueroscalderon@telus.com)
|
|
14
|
+
- `Carousel`: fix peeking when using a larger maxWidth (guillermo.peitzner@telus.com)
|
|
15
|
+
|
|
7
16
|
## 3.28.0
|
|
8
17
|
|
|
9
18
|
Wed, 18 Feb 2026 02:50:19 GMT
|
|
@@ -18,7 +27,7 @@ Wed, 18 Feb 2026 02:50:19 GMT
|
|
|
18
27
|
### Patches
|
|
19
28
|
|
|
20
29
|
- `Card`: background image hidden behind the default background color issue fixed (josue.higueroscalderon@telus.com)
|
|
21
|
-
- `IconButton`: Fix wrong specific padding calculation
|
|
30
|
+
- `IconButton`: Fix wrong specific padding calculation (david.melara1@telus.com)
|
|
22
31
|
|
|
23
32
|
## 3.27.0
|
|
24
33
|
|
|
@@ -91,7 +91,7 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
91
91
|
isAutoPlayEnabled,
|
|
92
92
|
viewport,
|
|
93
93
|
maxWidth,
|
|
94
|
-
|
|
94
|
+
containerWidth
|
|
95
95
|
} = _ref;
|
|
96
96
|
const styles = {};
|
|
97
97
|
let positionOffset = 0;
|
|
@@ -107,18 +107,19 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
if (enablePeeking) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
const {
|
|
111
|
+
peekingMiddleSpace,
|
|
112
|
+
peekingGap
|
|
113
|
+
} = getPeekingProps(viewport);
|
|
114
|
+
const clampedMaxWidth = Math.min(maxWidth || containerWidth, containerWidth);
|
|
115
|
+
const slideRightEdge = (containerWidth + clampedMaxWidth) / 2 - peekingMiddleSpace;
|
|
116
|
+
const buttonCenter = slideRightEdge + peekingGap / 2;
|
|
117
|
+
positionOffset = containerWidth - buttonCenter - buttonWidth / 2;
|
|
117
118
|
}
|
|
118
119
|
styles[positionProperty] = positionOffset;
|
|
119
120
|
return styles;
|
|
120
121
|
};
|
|
121
|
-
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
122
|
+
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerWidth) => {
|
|
122
123
|
const styles = {
|
|
123
124
|
zIndex: 1,
|
|
124
125
|
position: 'absolute'
|
|
@@ -142,7 +143,7 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
|
|
|
142
143
|
isAutoPlayEnabled,
|
|
143
144
|
viewport,
|
|
144
145
|
maxWidth,
|
|
145
|
-
|
|
146
|
+
containerWidth
|
|
146
147
|
})
|
|
147
148
|
};
|
|
148
149
|
};
|
|
@@ -279,7 +280,7 @@ const calculateFinalWidth = (containerWidth, enablePeeking, viewport, maxWidth)
|
|
|
279
280
|
peekingGap,
|
|
280
281
|
peekingMiddleSpace
|
|
281
282
|
} = getPeekingProps(viewport);
|
|
282
|
-
const baseWidth = maxWidth || containerWidth;
|
|
283
|
+
const baseWidth = Math.min(maxWidth || containerWidth, containerWidth);
|
|
283
284
|
finalWidth = baseWidth - peekingMiddleSpace * _Constants.PEEKING_MULTIPLIER + peekingGap;
|
|
284
285
|
}
|
|
285
286
|
return finalWidth;
|
|
@@ -499,7 +500,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
499
500
|
peekingMiddleSpace
|
|
500
501
|
} = getPeekingProps(viewport);
|
|
501
502
|
let finalWidth;
|
|
502
|
-
const baseWidth = maxWidth || containerLayoutRef.current.width;
|
|
503
|
+
const baseWidth = Math.min(maxWidth || containerLayoutRef.current.width, containerLayoutRef.current.width);
|
|
503
504
|
const slideWide = baseWidth - peekingMiddleSpace * _Constants.PEEKING_MULTIPLIER;
|
|
504
505
|
if (activeIndexRef.current === 0) {
|
|
505
506
|
finalWidth = 0;
|
|
@@ -1021,7 +1022,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
1021
1022
|
isAutoPlayEnabled,
|
|
1022
1023
|
viewport,
|
|
1023
1024
|
maxWidth,
|
|
1024
|
-
|
|
1025
|
+
containerWidth: containerLayout.width
|
|
1025
1026
|
})],
|
|
1026
1027
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
1027
1028
|
icon: isCarouselPlaying ? pauseIcon : playIcon,
|
|
@@ -1030,7 +1031,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
1030
1031
|
onPress: onAnimationControlButtonPress
|
|
1031
1032
|
})
|
|
1032
1033
|
}) : null, showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
1033
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
1034
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerLayout.width),
|
|
1034
1035
|
testID: "previous-button-container",
|
|
1035
1036
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
1036
1037
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -1090,7 +1091,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
1090
1091
|
})
|
|
1091
1092
|
})
|
|
1092
1093
|
}), showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
1093
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
1094
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerLayout.width),
|
|
1094
1095
|
testID: "next-button-container",
|
|
1095
1096
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
1096
1097
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -31,10 +31,10 @@ const selectContainerStyle = _ref => {
|
|
|
31
31
|
let marginLeft = 0;
|
|
32
32
|
if (enablePeeking) {
|
|
33
33
|
const isFirst = elementIndex === 0;
|
|
34
|
-
const
|
|
35
|
-
adjustedWidth =
|
|
34
|
+
const clampedMaxWidth = Math.min(maxWidth || width, width);
|
|
35
|
+
adjustedWidth = clampedMaxWidth - peekingMiddleSpace * 2;
|
|
36
36
|
if (isFirst) {
|
|
37
|
-
marginLeft = peekingMiddleSpace + (viewportWidth -
|
|
37
|
+
marginLeft = peekingMiddleSpace + (viewportWidth - clampedMaxWidth) / 2;
|
|
38
38
|
} else {
|
|
39
39
|
marginLeft = peekingGap;
|
|
40
40
|
}
|
|
@@ -185,6 +185,11 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
|
|
|
185
185
|
setMaxWidth(items.length >= rowLimit);
|
|
186
186
|
}, [items.length, rowLimit]);
|
|
187
187
|
_react.default.useEffect(() => setCheckedIds(currentValues ?? []), [currentValues]);
|
|
188
|
+
_react.default.useEffect(() => {
|
|
189
|
+
if (isOpen && onOpen) {
|
|
190
|
+
onOpen();
|
|
191
|
+
}
|
|
192
|
+
}, [isOpen, onOpen]);
|
|
188
193
|
const uniqueFields = ['id', 'label'];
|
|
189
194
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
190
195
|
throw new Error(`MultiSelectFilter items must have unique ${uniqueFields.join(', ')}`);
|
|
@@ -197,7 +202,6 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
|
|
|
197
202
|
}]);
|
|
198
203
|
const handleChange = event => {
|
|
199
204
|
if (pressHandlers.onPress) pressHandlers?.onPress(event);
|
|
200
|
-
if (isOpen) onOpen();
|
|
201
205
|
setIsOpen(!isOpen);
|
|
202
206
|
};
|
|
203
207
|
const onApply = e => {
|
|
@@ -84,7 +84,7 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
84
84
|
isAutoPlayEnabled,
|
|
85
85
|
viewport,
|
|
86
86
|
maxWidth,
|
|
87
|
-
|
|
87
|
+
containerWidth
|
|
88
88
|
} = _ref;
|
|
89
89
|
const styles = {};
|
|
90
90
|
let positionOffset = 0;
|
|
@@ -100,18 +100,19 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
if (enablePeeking) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
const {
|
|
104
|
+
peekingMiddleSpace,
|
|
105
|
+
peekingGap
|
|
106
|
+
} = getPeekingProps(viewport);
|
|
107
|
+
const clampedMaxWidth = Math.min(maxWidth || containerWidth, containerWidth);
|
|
108
|
+
const slideRightEdge = (containerWidth + clampedMaxWidth) / 2 - peekingMiddleSpace;
|
|
109
|
+
const buttonCenter = slideRightEdge + peekingGap / 2;
|
|
110
|
+
positionOffset = containerWidth - buttonCenter - buttonWidth / 2;
|
|
110
111
|
}
|
|
111
112
|
styles[positionProperty] = positionOffset;
|
|
112
113
|
return styles;
|
|
113
114
|
};
|
|
114
|
-
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
115
|
+
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerWidth) => {
|
|
115
116
|
const styles = {
|
|
116
117
|
zIndex: 1,
|
|
117
118
|
position: 'absolute'
|
|
@@ -135,7 +136,7 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
|
|
|
135
136
|
isAutoPlayEnabled,
|
|
136
137
|
viewport,
|
|
137
138
|
maxWidth,
|
|
138
|
-
|
|
139
|
+
containerWidth
|
|
139
140
|
})
|
|
140
141
|
};
|
|
141
142
|
};
|
|
@@ -272,7 +273,7 @@ const calculateFinalWidth = (containerWidth, enablePeeking, viewport, maxWidth)
|
|
|
272
273
|
peekingGap,
|
|
273
274
|
peekingMiddleSpace
|
|
274
275
|
} = getPeekingProps(viewport);
|
|
275
|
-
const baseWidth = maxWidth || containerWidth;
|
|
276
|
+
const baseWidth = Math.min(maxWidth || containerWidth, containerWidth);
|
|
276
277
|
finalWidth = baseWidth - peekingMiddleSpace * PEEKING_MULTIPLIER + peekingGap;
|
|
277
278
|
}
|
|
278
279
|
return finalWidth;
|
|
@@ -492,7 +493,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
492
493
|
peekingMiddleSpace
|
|
493
494
|
} = getPeekingProps(viewport);
|
|
494
495
|
let finalWidth;
|
|
495
|
-
const baseWidth = maxWidth || containerLayoutRef.current.width;
|
|
496
|
+
const baseWidth = Math.min(maxWidth || containerLayoutRef.current.width, containerLayoutRef.current.width);
|
|
496
497
|
const slideWide = baseWidth - peekingMiddleSpace * PEEKING_MULTIPLIER;
|
|
497
498
|
if (activeIndexRef.current === 0) {
|
|
498
499
|
finalWidth = 0;
|
|
@@ -1014,7 +1015,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
1014
1015
|
isAutoPlayEnabled,
|
|
1015
1016
|
viewport,
|
|
1016
1017
|
maxWidth,
|
|
1017
|
-
|
|
1018
|
+
containerWidth: containerLayout.width
|
|
1018
1019
|
})],
|
|
1019
1020
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
1020
1021
|
icon: isCarouselPlaying ? pauseIcon : playIcon,
|
|
@@ -1023,7 +1024,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
1023
1024
|
onPress: onAnimationControlButtonPress
|
|
1024
1025
|
})
|
|
1025
1026
|
}) : null, showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/_jsx(View, {
|
|
1026
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
1027
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerLayout.width),
|
|
1027
1028
|
testID: "previous-button-container",
|
|
1028
1029
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
1029
1030
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -1083,7 +1084,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
1083
1084
|
})
|
|
1084
1085
|
})
|
|
1085
1086
|
}), showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/_jsx(View, {
|
|
1086
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
1087
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerLayout.width),
|
|
1087
1088
|
testID: "next-button-container",
|
|
1088
1089
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
1089
1090
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -24,10 +24,10 @@ const selectContainerStyle = _ref => {
|
|
|
24
24
|
let marginLeft = 0;
|
|
25
25
|
if (enablePeeking) {
|
|
26
26
|
const isFirst = elementIndex === 0;
|
|
27
|
-
const
|
|
28
|
-
adjustedWidth =
|
|
27
|
+
const clampedMaxWidth = Math.min(maxWidth || width, width);
|
|
28
|
+
adjustedWidth = clampedMaxWidth - peekingMiddleSpace * 2;
|
|
29
29
|
if (isFirst) {
|
|
30
|
-
marginLeft = peekingMiddleSpace + (viewportWidth -
|
|
30
|
+
marginLeft = peekingMiddleSpace + (viewportWidth - clampedMaxWidth) / 2;
|
|
31
31
|
} else {
|
|
32
32
|
marginLeft = peekingGap;
|
|
33
33
|
}
|
|
@@ -178,6 +178,11 @@ const MultiSelectFilter = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
178
178
|
setMaxWidth(items.length >= rowLimit);
|
|
179
179
|
}, [items.length, rowLimit]);
|
|
180
180
|
React.useEffect(() => setCheckedIds(currentValues ?? []), [currentValues]);
|
|
181
|
+
React.useEffect(() => {
|
|
182
|
+
if (isOpen && onOpen) {
|
|
183
|
+
onOpen();
|
|
184
|
+
}
|
|
185
|
+
}, [isOpen, onOpen]);
|
|
181
186
|
const uniqueFields = ['id', 'label'];
|
|
182
187
|
if (!containUniqueFields(items, uniqueFields)) {
|
|
183
188
|
throw new Error(`MultiSelectFilter items must have unique ${uniqueFields.join(', ')}`);
|
|
@@ -190,7 +195,6 @@ const MultiSelectFilter = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
190
195
|
}]);
|
|
191
196
|
const handleChange = event => {
|
|
192
197
|
if (pressHandlers.onPress) pressHandlers?.onPress(event);
|
|
193
|
-
if (isOpen) onOpen();
|
|
194
198
|
setIsOpen(!isOpen);
|
|
195
199
|
};
|
|
196
200
|
const onApply = e => {
|
package/lib/package.json
CHANGED
package/package.json
CHANGED
|
@@ -125,7 +125,7 @@ const selectControlButtonPositionStyles = ({
|
|
|
125
125
|
isAutoPlayEnabled,
|
|
126
126
|
viewport,
|
|
127
127
|
maxWidth,
|
|
128
|
-
|
|
128
|
+
containerWidth
|
|
129
129
|
}) => {
|
|
130
130
|
const styles = {}
|
|
131
131
|
|
|
@@ -148,13 +148,11 @@ const selectControlButtonPositionStyles = ({
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
if (enablePeeking) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
positionOffset += leftMargin
|
|
157
|
-
}
|
|
151
|
+
const { peekingMiddleSpace, peekingGap } = getPeekingProps(viewport)
|
|
152
|
+
const clampedMaxWidth = Math.min(maxWidth || containerWidth, containerWidth)
|
|
153
|
+
const slideRightEdge = (containerWidth + clampedMaxWidth) / 2 - peekingMiddleSpace
|
|
154
|
+
const buttonCenter = slideRightEdge + peekingGap / 2
|
|
155
|
+
positionOffset = containerWidth - buttonCenter - buttonWidth / 2
|
|
158
156
|
}
|
|
159
157
|
|
|
160
158
|
styles[positionProperty] = positionOffset
|
|
@@ -173,7 +171,7 @@ const selectPreviousNextNavigationButtonStyles = (
|
|
|
173
171
|
isAutoPlayEnabled,
|
|
174
172
|
viewport,
|
|
175
173
|
maxWidth,
|
|
176
|
-
|
|
174
|
+
containerWidth
|
|
177
175
|
) => {
|
|
178
176
|
const styles = {
|
|
179
177
|
zIndex: 1,
|
|
@@ -199,7 +197,7 @@ const selectPreviousNextNavigationButtonStyles = (
|
|
|
199
197
|
isAutoPlayEnabled,
|
|
200
198
|
viewport,
|
|
201
199
|
maxWidth,
|
|
202
|
-
|
|
200
|
+
containerWidth
|
|
203
201
|
})
|
|
204
202
|
}
|
|
205
203
|
}
|
|
@@ -343,7 +341,7 @@ const calculateFinalWidth = (containerWidth, enablePeeking, viewport, maxWidth)
|
|
|
343
341
|
|
|
344
342
|
if (enablePeeking) {
|
|
345
343
|
const { peekingGap, peekingMiddleSpace } = getPeekingProps(viewport)
|
|
346
|
-
const baseWidth = maxWidth || containerWidth
|
|
344
|
+
const baseWidth = Math.min(maxWidth || containerWidth, containerWidth)
|
|
347
345
|
finalWidth = baseWidth - peekingMiddleSpace * PEEKING_MULTIPLIER + peekingGap
|
|
348
346
|
}
|
|
349
347
|
|
|
@@ -572,7 +570,10 @@ const Carousel = React.forwardRef(
|
|
|
572
570
|
const { peekingGap, peekingMiddleSpace } = getPeekingProps(viewport)
|
|
573
571
|
|
|
574
572
|
let finalWidth
|
|
575
|
-
const baseWidth =
|
|
573
|
+
const baseWidth = Math.min(
|
|
574
|
+
maxWidth || containerLayoutRef.current.width,
|
|
575
|
+
containerLayoutRef.current.width
|
|
576
|
+
)
|
|
576
577
|
const slideWide = baseWidth - peekingMiddleSpace * PEEKING_MULTIPLIER
|
|
577
578
|
|
|
578
579
|
if (activeIndexRef.current === 0) {
|
|
@@ -1177,7 +1178,7 @@ const Carousel = React.forwardRef(
|
|
|
1177
1178
|
isAutoPlayEnabled,
|
|
1178
1179
|
viewport,
|
|
1179
1180
|
maxWidth,
|
|
1180
|
-
|
|
1181
|
+
containerWidth: containerLayout.width
|
|
1181
1182
|
})
|
|
1182
1183
|
]}
|
|
1183
1184
|
>
|
|
@@ -1205,7 +1206,7 @@ const Carousel = React.forwardRef(
|
|
|
1205
1206
|
isAutoPlayEnabled,
|
|
1206
1207
|
viewport,
|
|
1207
1208
|
maxWidth,
|
|
1208
|
-
|
|
1209
|
+
containerLayout.width
|
|
1209
1210
|
)}
|
|
1210
1211
|
testID="previous-button-container"
|
|
1211
1212
|
>
|
|
@@ -1303,7 +1304,7 @@ const Carousel = React.forwardRef(
|
|
|
1303
1304
|
isAutoPlayEnabled,
|
|
1304
1305
|
viewport,
|
|
1305
1306
|
maxWidth,
|
|
1306
|
-
|
|
1307
|
+
containerLayout.width
|
|
1307
1308
|
)}
|
|
1308
1309
|
testID="next-button-container"
|
|
1309
1310
|
>
|
|
@@ -31,10 +31,10 @@ const selectContainerStyle = ({
|
|
|
31
31
|
|
|
32
32
|
if (enablePeeking) {
|
|
33
33
|
const isFirst = elementIndex === 0
|
|
34
|
-
const
|
|
35
|
-
adjustedWidth =
|
|
34
|
+
const clampedMaxWidth = Math.min(maxWidth || width, width)
|
|
35
|
+
adjustedWidth = clampedMaxWidth - peekingMiddleSpace * 2
|
|
36
36
|
if (isFirst) {
|
|
37
|
-
marginLeft = peekingMiddleSpace + (viewportWidth -
|
|
37
|
+
marginLeft = peekingMiddleSpace + (viewportWidth - clampedMaxWidth) / 2
|
|
38
38
|
} else {
|
|
39
39
|
marginLeft = peekingGap
|
|
40
40
|
}
|
|
@@ -185,6 +185,12 @@ const MultiSelectFilter = React.forwardRef(
|
|
|
185
185
|
|
|
186
186
|
React.useEffect(() => setCheckedIds(currentValues ?? []), [currentValues])
|
|
187
187
|
|
|
188
|
+
React.useEffect(() => {
|
|
189
|
+
if (isOpen && onOpen) {
|
|
190
|
+
onOpen()
|
|
191
|
+
}
|
|
192
|
+
}, [isOpen, onOpen])
|
|
193
|
+
|
|
188
194
|
const uniqueFields = ['id', 'label']
|
|
189
195
|
if (!containUniqueFields(items, uniqueFields)) {
|
|
190
196
|
throw new Error(`MultiSelectFilter items must have unique ${uniqueFields.join(', ')}`)
|
|
@@ -194,7 +200,6 @@ const MultiSelectFilter = React.forwardRef(
|
|
|
194
200
|
|
|
195
201
|
const handleChange = (event) => {
|
|
196
202
|
if (pressHandlers.onPress) pressHandlers?.onPress(event)
|
|
197
|
-
if (isOpen) onOpen()
|
|
198
203
|
setIsOpen(!isOpen)
|
|
199
204
|
}
|
|
200
205
|
|