@itwin/itwinui-react 2.12.0 → 2.12.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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1467](https://github.com/iTwin/iTwinUI/pull/1467): Fixed an issue in Carousel where latest `onSlideChange` callback was being ignored.
|
|
8
|
+
|
|
3
9
|
## 2.12.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -7,6 +13,7 @@
|
|
|
7
13
|
- [#1415](https://github.com/iTwin/iTwinUI/pull/1415): The styling strategy has changed so there will now be a single stylesheet included at runtime, instead of separate css imports inside every component. All the styles are also wrapped in a cascade layer named `itwinui`. This behavior can be customized using the `includeCss` prop in `ThemeProvider`.
|
|
8
14
|
|
|
9
15
|
**Important note**: The dependencies on `@itwin/itwinui-css` and `@itwin/itwinui-variables` have been removed, so these packages _don't_ need to be installed if you are only using components from `@itwin/itwinui-react`.
|
|
16
|
+
|
|
10
17
|
- [#1422](https://github.com/iTwin/iTwinUI/pull/1422): Changed `all: revert` to `all: revert-layer` so that only styles from the v1 layer are reverted, thus avoiding issues with inadvertently removing browser default styles.
|
|
11
18
|
- [#1443](https://github.com/iTwin/iTwinUI/pull/1443): `DropdownButton` now supports `styleType='high-visibility'` to make it blue. This should be used sparingly, as a default or borderless dropdown button is the better choice in most cases.
|
|
12
19
|
- [#1454](https://github.com/iTwin/iTwinUI/pull/1454): Added `disabled` prop to `ExpandableBlock` to disable intersction with it.
|
|
@@ -567,4 +574,4 @@ If you're interested in more details about every signle change, check out a full
|
|
|
567
574
|
|
|
568
575
|
## 1.X
|
|
569
576
|
|
|
570
|
-
For any changes prior to 2.0.0, check out the [1.X changelog](https://github.com/iTwin/iTwinUI
|
|
577
|
+
For any changes prior to 2.0.0, check out the [1.X changelog](https://github.com/iTwin/iTwinUI/blob/legacy/v1-react/packages/iTwinUI-react/CHANGELOG.md).
|
|
@@ -58,7 +58,9 @@ export declare const Carousel: React.ForwardRefExoticComponent<{
|
|
|
58
58
|
DotsList: React.ForwardRefExoticComponent<{
|
|
59
59
|
length?: number | undefined;
|
|
60
60
|
currentIndex?: number | undefined;
|
|
61
|
-
onSlideChange?: ((index: number) => void) | undefined;
|
|
61
|
+
onSlideChange?: ((index: number) => void) | undefined; /**
|
|
62
|
+
* Callback fired when the current slide changes.
|
|
63
|
+
*/
|
|
62
64
|
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
63
65
|
Dot: React.ForwardRefExoticComponent<{
|
|
64
66
|
isActive?: boolean | undefined;
|
|
@@ -111,11 +111,11 @@ exports.Carousel = Object.assign(React.forwardRef((props, ref) => {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
const userOnSlideChange =
|
|
114
|
+
const userOnSlideChange = (0, index_js_1.useLatestRef)(onSlideChange);
|
|
115
115
|
React.useEffect(() => {
|
|
116
116
|
var _a;
|
|
117
117
|
(_a = userOnSlideChange.current) === null || _a === void 0 ? void 0 : _a.call(userOnSlideChange, currentIndex);
|
|
118
|
-
}, [currentIndex]);
|
|
118
|
+
}, [userOnSlideChange, currentIndex]);
|
|
119
119
|
return (React.createElement("section", { "aria-roledescription": 'carousel', tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: refs, className: (0, classnames_1.default)('iui-carousel', className), ...rest, id: id },
|
|
120
120
|
React.createElement(CarouselContext_js_1.CarouselContext.Provider, { value: {
|
|
121
121
|
currentIndex,
|
|
@@ -58,7 +58,9 @@ export declare const Carousel: React.ForwardRefExoticComponent<{
|
|
|
58
58
|
DotsList: React.ForwardRefExoticComponent<{
|
|
59
59
|
length?: number | undefined;
|
|
60
60
|
currentIndex?: number | undefined;
|
|
61
|
-
onSlideChange?: ((index: number) => void) | undefined;
|
|
61
|
+
onSlideChange?: ((index: number) => void) | undefined; /**
|
|
62
|
+
* Callback fired when the current slide changes.
|
|
63
|
+
*/
|
|
62
64
|
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
63
65
|
Dot: React.ForwardRefExoticComponent<{
|
|
64
66
|
isActive?: boolean | undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import { getRandomValue, useMergedRefs, useTheme } from '../utils/index.js';
|
|
7
|
+
import { getRandomValue, useLatestRef, useMergedRefs, useTheme, } from '../utils/index.js';
|
|
8
8
|
import { CarouselContext } from './CarouselContext.js';
|
|
9
9
|
import { CarouselSlider } from './CarouselSlider.js';
|
|
10
10
|
import { CarouselSlide } from './CarouselSlide.js';
|
|
@@ -82,11 +82,11 @@ export const Carousel = Object.assign(React.forwardRef((props, ref) => {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
const userOnSlideChange =
|
|
85
|
+
const userOnSlideChange = useLatestRef(onSlideChange);
|
|
86
86
|
React.useEffect(() => {
|
|
87
87
|
var _a;
|
|
88
88
|
(_a = userOnSlideChange.current) === null || _a === void 0 ? void 0 : _a.call(userOnSlideChange, currentIndex);
|
|
89
|
-
}, [currentIndex]);
|
|
89
|
+
}, [userOnSlideChange, currentIndex]);
|
|
90
90
|
return (React.createElement("section", { "aria-roledescription": 'carousel', tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: refs, className: cx('iui-carousel', className), ...rest, id: id },
|
|
91
91
|
React.createElement(CarouselContext.Provider, { value: {
|
|
92
92
|
currentIndex,
|