@itwin/itwinui-react 1.35.0 → 1.37.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 +34 -0
- package/cjs/core/Alert/Alert.js +1 -1
- package/cjs/core/Badge/Badge.js +1 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/cjs/core/Buttons/Button/Button.js +2 -2
- package/cjs/core/Buttons/IconButton/IconButton.js +2 -2
- package/cjs/core/Carousel/Carousel.js +1 -1
- package/cjs/core/Carousel/CarouselDotsList.js +1 -1
- package/cjs/core/Carousel/CarouselSlider.js +1 -1
- package/cjs/core/Checkbox/Checkbox.js +1 -1
- package/cjs/core/ColorPicker/ColorBuilder.js +3 -3
- package/cjs/core/ColorPicker/ColorInputPanel.js +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +1 -1
- package/cjs/core/ComboBox/ComboBox.js +9 -6
- package/cjs/core/DatePicker/DatePicker.js +2 -2
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
- package/cjs/core/Footer/Footer.js +2 -2
- package/cjs/core/Header/HeaderBreadcrumbs.js +1 -1
- package/cjs/core/Header/HeaderButton.js +1 -0
- package/cjs/core/InformationPanel/InformationPanel.js +2 -2
- package/cjs/core/Input/Input.js +1 -1
- package/cjs/core/Menu/Menu.js +8 -3
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
- package/cjs/core/Radio/Radio.js +1 -1
- package/cjs/core/Select/Select.js +3 -3
- package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +50 -0
- package/cjs/core/SkipToContentLink/index.d.ts +4 -0
- package/cjs/core/SkipToContentLink/index.js +10 -0
- package/cjs/core/Slider/Slider.js +1 -1
- package/cjs/core/Slider/Thumb.js +1 -1
- package/cjs/core/Slider/Track.js +1 -1
- package/cjs/core/Surface/Surface.d.ts +32 -0
- package/cjs/core/Surface/Surface.js +70 -0
- package/cjs/core/Surface/index.d.ts +4 -0
- package/cjs/core/Surface/index.js +10 -0
- package/cjs/core/Table/Table.d.ts +7 -0
- package/cjs/core/Table/Table.js +44 -21
- package/cjs/core/Table/TableCell.js +3 -3
- package/cjs/core/Table/TablePaginator.js +6 -6
- package/cjs/core/Table/TableRowMemoized.js +13 -8
- package/cjs/core/Table/actionHandlers/index.d.ts +2 -1
- package/cjs/core/Table/actionHandlers/index.js +5 -1
- package/cjs/core/Table/cells/DefaultCell.d.ts +1 -1
- package/cjs/core/Table/cells/DefaultCell.js +5 -2
- package/cjs/core/Table/columns/actionColumn.d.ts +35 -0
- package/cjs/core/Table/columns/actionColumn.js +91 -0
- package/cjs/core/Table/columns/expanderColumn.d.ts +47 -0
- package/cjs/core/Table/columns/expanderColumn.js +81 -0
- package/cjs/core/Table/columns/index.d.ts +3 -0
- package/cjs/core/Table/columns/index.js +15 -0
- package/cjs/core/Table/columns/selectionColumn.d.ts +35 -0
- package/cjs/core/Table/columns/selectionColumn.js +67 -0
- package/cjs/core/Table/hooks/index.d.ts +2 -2
- package/cjs/core/Table/hooks/index.js +1 -3
- package/cjs/core/Table/hooks/useExpanderCell.d.ts +0 -1
- package/cjs/core/Table/hooks/useExpanderCell.js +25 -39
- package/cjs/core/Table/hooks/useResizeColumns.js +8 -2
- package/cjs/core/Table/hooks/useSelectionCell.d.ts +1 -2
- package/cjs/core/Table/hooks/useSelectionCell.js +8 -53
- package/cjs/core/Table/index.d.ts +1 -0
- package/cjs/core/Table/index.js +5 -1
- package/cjs/core/Table/utils.js +5 -5
- package/cjs/core/Tabs/Tabs.d.ts +1 -1
- package/cjs/core/Tabs/Tabs.js +7 -8
- package/cjs/core/Tag/Tag.js +6 -3
- package/cjs/core/Tag/TagContainer.js +1 -1
- package/cjs/core/Tile/Tile.d.ts +6 -2
- package/cjs/core/Tile/Tile.js +8 -3
- package/cjs/core/Toast/Toast.js +3 -3
- package/cjs/core/Toast/ToastWrapper.js +1 -1
- package/cjs/core/Tree/TreeNode.js +2 -2
- package/cjs/core/Typography/Anchor/Anchor.d.ts +1 -0
- package/cjs/core/Typography/Anchor/Anchor.js +1 -0
- package/cjs/core/Typography/Text/Text.js +1 -1
- package/cjs/core/UserIcon/UserIcon.js +2 -2
- package/cjs/core/UserIconGroup/UserIconGroup.js +3 -3
- package/cjs/core/Wizard/Step.js +1 -1
- package/cjs/core/Wizard/Wizard.js +1 -1
- package/cjs/core/index.d.ts +5 -1
- package/cjs/core/index.js +9 -2
- package/cjs/core/utils/color/ColorValue.js +11 -11
- package/cjs/core/utils/color/index.js +5 -1
- package/cjs/core/utils/components/FocusTrap.js +6 -8
- package/cjs/core/utils/components/InputContainer.js +1 -1
- package/cjs/core/utils/components/MiddleTextTruncation.js +1 -1
- package/cjs/core/utils/components/Popover.js +13 -1
- package/cjs/core/utils/components/VirtualScroll.js +1 -1
- package/cjs/core/utils/components/WithCSSTransition.js +5 -5
- package/cjs/core/utils/components/index.js +5 -1
- package/cjs/core/utils/functions/focusable.js +1 -1
- package/cjs/core/utils/functions/index.js +5 -1
- package/cjs/core/utils/hooks/index.js +5 -1
- package/cjs/core/utils/hooks/useOverflow.js +3 -3
- package/cjs/core/utils/hooks/useTheme.js +1 -1
- package/cjs/core/utils/index.js +5 -1
- package/cjs/index.js +5 -1
- package/cjs/types/react-table-config.d.ts +18 -0
- package/esm/core/Alert/Alert.js +1 -1
- package/esm/core/Badge/Badge.js +1 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/esm/core/Buttons/Button/Button.js +2 -2
- package/esm/core/Buttons/IconButton/IconButton.js +2 -2
- package/esm/core/Carousel/Carousel.js +1 -1
- package/esm/core/Carousel/CarouselDotsList.js +1 -1
- package/esm/core/Carousel/CarouselSlider.js +1 -1
- package/esm/core/Checkbox/Checkbox.js +1 -1
- package/esm/core/ColorPicker/ColorBuilder.js +3 -3
- package/esm/core/ColorPicker/ColorInputPanel.js +1 -1
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +1 -1
- package/esm/core/ComboBox/ComboBox.js +9 -6
- package/esm/core/DatePicker/DatePicker.js +2 -2
- package/esm/core/ExpandableBlock/ExpandableBlock.js +1 -1
- package/esm/core/Footer/Footer.js +2 -2
- package/esm/core/Header/HeaderBreadcrumbs.js +1 -1
- package/esm/core/Header/HeaderButton.js +1 -0
- package/esm/core/InformationPanel/InformationPanel.js +2 -2
- package/esm/core/Input/Input.js +1 -1
- package/esm/core/Menu/Menu.js +8 -3
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
- package/esm/core/Radio/Radio.js +1 -1
- package/esm/core/Select/Select.js +3 -3
- package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
- package/esm/core/SkipToContentLink/SkipToContentLink.js +44 -0
- package/esm/core/SkipToContentLink/index.d.ts +4 -0
- package/esm/core/SkipToContentLink/index.js +6 -0
- package/esm/core/Slider/Slider.js +1 -1
- package/esm/core/Slider/Thumb.js +1 -1
- package/esm/core/Slider/Track.js +1 -1
- package/esm/core/Surface/Surface.d.ts +32 -0
- package/esm/core/Surface/Surface.js +64 -0
- package/esm/core/Surface/index.d.ts +4 -0
- package/esm/core/Surface/index.js +6 -0
- package/esm/core/Table/Table.d.ts +7 -0
- package/esm/core/Table/Table.js +40 -17
- package/esm/core/Table/TableCell.js +2 -2
- package/esm/core/Table/TablePaginator.js +6 -6
- package/esm/core/Table/TableRowMemoized.js +13 -8
- package/esm/core/Table/actionHandlers/index.d.ts +2 -1
- package/esm/core/Table/actionHandlers/index.js +2 -1
- package/esm/core/Table/cells/DefaultCell.d.ts +1 -1
- package/esm/core/Table/cells/DefaultCell.js +5 -2
- package/esm/core/Table/columns/actionColumn.d.ts +35 -0
- package/esm/core/Table/columns/actionColumn.js +84 -0
- package/esm/core/Table/columns/expanderColumn.d.ts +47 -0
- package/esm/core/Table/columns/expanderColumn.js +74 -0
- package/esm/core/Table/columns/index.d.ts +3 -0
- package/esm/core/Table/columns/index.js +7 -0
- package/esm/core/Table/columns/selectionColumn.d.ts +35 -0
- package/esm/core/Table/columns/selectionColumn.js +60 -0
- package/esm/core/Table/hooks/index.d.ts +2 -2
- package/esm/core/Table/hooks/index.js +2 -2
- package/esm/core/Table/hooks/useExpanderCell.d.ts +0 -1
- package/esm/core/Table/hooks/useExpanderCell.js +24 -35
- package/esm/core/Table/hooks/useResizeColumns.js +8 -2
- package/esm/core/Table/hooks/useSelectionCell.d.ts +1 -2
- package/esm/core/Table/hooks/useSelectionCell.js +7 -49
- package/esm/core/Table/index.d.ts +1 -0
- package/esm/core/Table/index.js +1 -0
- package/esm/core/Table/utils.js +5 -5
- package/esm/core/Tabs/Tabs.d.ts +1 -1
- package/esm/core/Tabs/Tabs.js +7 -8
- package/esm/core/Tag/Tag.js +6 -3
- package/esm/core/Tag/TagContainer.js +1 -1
- package/esm/core/Tile/Tile.d.ts +6 -2
- package/esm/core/Tile/Tile.js +8 -3
- package/esm/core/Toast/Toast.js +3 -3
- package/esm/core/Toast/ToastWrapper.js +1 -1
- package/esm/core/Tree/TreeNode.js +2 -2
- package/esm/core/Typography/Anchor/Anchor.d.ts +1 -0
- package/esm/core/Typography/Anchor/Anchor.js +1 -0
- package/esm/core/Typography/Text/Text.js +1 -1
- package/esm/core/UserIcon/UserIcon.js +2 -2
- package/esm/core/UserIconGroup/UserIconGroup.js +3 -3
- package/esm/core/Wizard/Step.js +1 -1
- package/esm/core/Wizard/Wizard.js +1 -1
- package/esm/core/index.d.ts +5 -1
- package/esm/core/index.js +3 -1
- package/esm/core/utils/color/ColorValue.js +11 -11
- package/esm/core/utils/components/FocusTrap.js +6 -8
- package/esm/core/utils/components/InputContainer.js +1 -1
- package/esm/core/utils/components/MiddleTextTruncation.js +1 -1
- package/esm/core/utils/components/Popover.js +13 -1
- package/esm/core/utils/components/VirtualScroll.js +1 -1
- package/esm/core/utils/components/WithCSSTransition.js +5 -5
- package/esm/core/utils/functions/focusable.js +1 -1
- package/esm/core/utils/hooks/useOverflow.js +3 -3
- package/esm/core/utils/hooks/useTheme.js +1 -1
- package/esm/types/react-table-config.d.ts +18 -0
- package/package.json +21 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### [1.37.1](https://www.github.com/iTwin/iTwinUI-react/compare/v1.37.0...v1.37.1) (2022-04-22)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
* **ComboBox:** Use latest value of `onChange` prop ([#636](https://www.github.com/iTwin/iTwinUI-react/issues/636)) ([a1f705e](https://www.github.com/iTwin/iTwinUI-react/commit/a1f705e05a7608f66e56d3555c679c180fadcae0))
|
|
8
|
+
|
|
9
|
+
## [1.37.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.36.0...v1.37.0) (2022-04-21)
|
|
10
|
+
|
|
11
|
+
### What's new
|
|
12
|
+
|
|
13
|
+
* **SkipToContent:** Add `SkipToContent` Component ([#618](https://www.github.com/iTwin/iTwinUI-react/issues/618)) ([5d56809](https://www.github.com/iTwin/iTwinUI-react/commit/5d56809c46ad312402669f9cb2dbf6c8d3c733ad))
|
|
14
|
+
* **Surface:** Add `Surface` component ([#624](https://www.github.com/iTwin/iTwinUI-react/issues/624)) ([aa8f992](https://www.github.com/iTwin/iTwinUI-react/commit/aa8f99228cd4069bcba237c4a599d4735beccd0e))
|
|
15
|
+
* **Table:** Single selection of rows ([#628](https://www.github.com/iTwin/iTwinUI-react/issues/628)) ([b8e0bf6](https://www.github.com/iTwin/iTwinUI-react/commit/b8e0bf63cbb07d8bd21fc165a505af1388e57a98))
|
|
16
|
+
* **Tile:** Add `isActionable` prop to use for interactive tile ([#631](https://www.github.com/iTwin/iTwinUI-react/issues/631)) ([abfb807](https://www.github.com/iTwin/iTwinUI-react/commit/abfb8073c129c06488be276e4d301b89bf4588d5))
|
|
17
|
+
|
|
18
|
+
### Fixes
|
|
19
|
+
|
|
20
|
+
* **Table:** Add support for `preventDefault` in row click events ([#629](https://www.github.com/iTwin/iTwinUI-react/issues/629)) ([997897d](https://www.github.com/iTwin/iTwinUI-react/commit/997897d438ff00ed9d63da1745c81f37957c14ba))
|
|
21
|
+
* **Header:** Fix `HeaderButton` spacing through css package update ([4094a3b](https://www.github.com/iTwin/iTwinUI-react/commit/4094a3bc94c8e589b4dbc6a2fd68f4f00389d941))
|
|
22
|
+
|
|
23
|
+
## [1.36.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.35.0...v1.36.0) (2022-04-15)
|
|
24
|
+
|
|
25
|
+
### What's new
|
|
26
|
+
|
|
27
|
+
* **Table:** Added `ColumnManager` for hiding columns ([#564](https://www.github.com/iTwin/iTwinUI-react/issues/564)) ([71cf927](https://www.github.com/iTwin/iTwinUI-react/commit/71cf9278d1e75dc426f24976a497d40b18da3c87))
|
|
28
|
+
- `ActionColumn` was added to use with `ColumnManager`. It can be used for fixed width columns (i.e. column with menu).
|
|
29
|
+
* **Table:** Default columns customization ([#599](https://www.github.com/iTwin/iTwinUI-react/issues/599)) ([e665821](https://www.github.com/iTwin/iTwinUI-react/commit/e665821b66972136873797058da6cd4036f4dd2d))
|
|
30
|
+
- `ExpanderColumn` and `SelectionColumn` were added for custom implementation of expansion and selection.
|
|
31
|
+
|
|
32
|
+
### Fixes
|
|
33
|
+
|
|
34
|
+
* **Menu:** Fixed keyboard navigation when `MenuItem` contains selectable children ([#625](https://www.github.com/iTwin/iTwinUI-react/issues/625)) ([082e384](https://www.github.com/iTwin/iTwinUI-react/commit/082e384ed5ccc1fb2ded9ccc69bca06be6e3f29b))
|
|
35
|
+
* **Popover:** Stop propagation of click in `Popover` ([#619](https://www.github.com/iTwin/iTwinUI-react/issues/619)) ([298cbf3](https://www.github.com/iTwin/iTwinUI-react/commit/298cbf3aba050763b481252ba76f5c945b5c2e17))
|
|
36
|
+
|
|
3
37
|
## [1.35.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.34.2...v1.35.0) (2022-04-05)
|
|
4
38
|
|
|
5
39
|
### What's new
|
package/cjs/core/Alert/Alert.js
CHANGED
|
@@ -49,7 +49,7 @@ var Alert = function (props) {
|
|
|
49
49
|
var children = props.children, className = props.className, _a = props.type, type = _a === void 0 ? 'informational' : _a, clickableText = props.clickableText, clickableTextProps = props.clickableTextProps, onClick = props.onClick, onClose = props.onClose, style = props.style, _b = props.isSticky, isSticky = _b === void 0 ? false : _b, rest = __rest(props, ["children", "className", "type", "clickableText", "clickableTextProps", "onClick", "onClose", "style", "isSticky"]);
|
|
50
50
|
(0, utils_1.useTheme)();
|
|
51
51
|
var StatusIcon = utils_1.StatusIconMap[type];
|
|
52
|
-
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-alert', "iui-"
|
|
52
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-alert', "iui-".concat(type), { 'iui-sticky': isSticky }, className), style: style }, rest),
|
|
53
53
|
react_1.default.createElement(StatusIcon, { className: 'iui-alert-icon' }),
|
|
54
54
|
react_1.default.createElement("span", { className: 'iui-alert-message' },
|
|
55
55
|
children,
|
package/cjs/core/Badge/Badge.js
CHANGED
|
@@ -66,7 +66,7 @@ var Badge = function (props) {
|
|
|
66
66
|
var backgroundColor = props.backgroundColor, style = props.style, className = props.className, children = props.children, rest = __rest(props, ["backgroundColor", "style", "className", "children"]);
|
|
67
67
|
(0, utils_1.useTheme)();
|
|
68
68
|
var _style = backgroundColor &&
|
|
69
|
-
((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-badge-background-color: "
|
|
69
|
+
((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-badge-background-color: ".concat(backgroundColor)))
|
|
70
70
|
? __assign({ '--iui-badge-background-color': getBadgeColorValue(backgroundColor) }, style) : __assign({ backgroundColor: getBadgeColorValue(backgroundColor) }, style);
|
|
71
71
|
return (react_1.default.createElement("span", __assign({ className: (0, classnames_1.default)('iui-badge', className), style: _style }, rest), children));
|
|
72
72
|
};
|
|
@@ -10,7 +10,7 @@ export declare type BreadcrumbsProps = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Breadcrumb items.
|
|
12
12
|
*/
|
|
13
|
-
children: React.
|
|
13
|
+
children: React.ReactNode[];
|
|
14
14
|
/**
|
|
15
15
|
* Specify a custom separator element to show between breadcrumb items.
|
|
16
16
|
* Defaults to the `SvgChevronRight` icon.
|
|
@@ -48,7 +48,7 @@ export declare const Breadcrumbs: React.ForwardRefExoticComponent<{
|
|
|
48
48
|
/**
|
|
49
49
|
* Breadcrumb items.
|
|
50
50
|
*/
|
|
51
|
-
children: React.
|
|
51
|
+
children: React.ReactNode[];
|
|
52
52
|
/**
|
|
53
53
|
* Specify a custom separator element to show between breadcrumb items.
|
|
54
54
|
* Defaults to the `SvgChevronRight` icon.
|
|
@@ -47,8 +47,8 @@ exports.Button = react_1.default.forwardRef(function (props, ref) {
|
|
|
47
47
|
var _a;
|
|
48
48
|
var children = props.children, className = props.className, size = props.size, style = props.style, _b = props.styleType, styleType = _b === void 0 ? 'default' : _b, _c = props.type, type = _c === void 0 ? 'button' : _c, startIcon = props.startIcon, endIcon = props.endIcon, _d = props.as, Element = _d === void 0 ? 'button' : _d, rest = __rest(props, ["children", "className", "size", "style", "styleType", "type", "startIcon", "endIcon", "as"]);
|
|
49
49
|
(0, utils_1.useTheme)();
|
|
50
|
-
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-"
|
|
51
|
-
_a["iui-"
|
|
50
|
+
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-".concat(styleType), (_a = {},
|
|
51
|
+
_a["iui-".concat(size)] = !!size,
|
|
52
52
|
_a), className), style: style, type: type }, rest),
|
|
53
53
|
startIcon &&
|
|
54
54
|
react_1.default.cloneElement(startIcon, {
|
|
@@ -44,8 +44,8 @@ exports.IconButton = react_1.default.forwardRef(function (props, ref) {
|
|
|
44
44
|
var _a;
|
|
45
45
|
var isActive = props.isActive, children = props.children, _b = props.styleType, styleType = _b === void 0 ? 'default' : _b, size = props.size, _c = props.type, type = _c === void 0 ? 'button' : _c, className = props.className, _d = props.as, Element = _d === void 0 ? 'button' : _d, rest = __rest(props, ["isActive", "children", "styleType", "size", "type", "className", "as"]);
|
|
46
46
|
(0, utils_1.useTheme)();
|
|
47
|
-
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-"
|
|
48
|
-
_a["iui-"
|
|
47
|
+
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-".concat(styleType), (_a = {},
|
|
48
|
+
_a["iui-".concat(size)] = !!size,
|
|
49
49
|
_a['iui-active'] = isActive,
|
|
50
50
|
_a), className), type: type }, rest), react_1.default.cloneElement(children, {
|
|
51
51
|
className: (0, classnames_1.default)('iui-button-icon', children.props.className),
|
|
@@ -61,7 +61,7 @@ var CarouselNavigation_1 = require("./CarouselNavigation");
|
|
|
61
61
|
exports.Carousel = Object.assign(react_1.default.forwardRef(function (props, ref) {
|
|
62
62
|
var _a = props.activeSlideIndex, userActiveIndex = _a === void 0 ? 0 : _a, onSlideChange = props.onSlideChange, className = props.className, children = props.children, rest = __rest(props, ["activeSlideIndex", "onSlideChange", "className", "children"]);
|
|
63
63
|
// Generate a stateful random id if not specified
|
|
64
|
-
var id = react_1.default.useState(function () { var _a; return (_a = props.id) !== null && _a !== void 0 ? _a : "iui-carousel-"
|
|
64
|
+
var id = react_1.default.useState(function () { var _a; return (_a = props.id) !== null && _a !== void 0 ? _a : "iui-carousel-".concat((0, utils_1.getRandomValue)(10)); })[0];
|
|
65
65
|
(0, utils_1.useTheme)();
|
|
66
66
|
var isManuallyUpdating = react_1.default.useRef(false);
|
|
67
67
|
var scrollInstantly = react_1.default.useRef(false);
|
|
@@ -102,7 +102,7 @@ exports.CarouselDotsList = react_1.default.forwardRef(function (props, ref) {
|
|
|
102
102
|
var isSecondSmallDot = (index === firstVisibleDotIndex + 1 && index !== 1) ||
|
|
103
103
|
(index === lastVisibleDotIndex - 1 && index !== slideCount - 2);
|
|
104
104
|
var isClipped = index < firstVisibleDotIndex || index > lastVisibleDotIndex;
|
|
105
|
-
return (react_1.default.createElement(CarouselDot_1.CarouselDot, { key: index, "aria-label": "Slide "
|
|
105
|
+
return (react_1.default.createElement(CarouselDot_1.CarouselDot, { key: index, "aria-label": "Slide ".concat(index), isActive: index === currentIndex, onClick: function () { return handleSlideChange(index); }, isSmall: isSecondSmallDot, isSmaller: isFirstSmallDot || isClipped, id: idPrefix && "".concat(idPrefix, "--dot-").concat(index), "aria-controls": idPrefix && "".concat(idPrefix, "--slide-").concat(index) }));
|
|
106
106
|
});
|
|
107
107
|
}, [
|
|
108
108
|
slideCount,
|
|
@@ -49,7 +49,7 @@ exports.CarouselSlider = react_1.default.forwardRef(function (props, ref) {
|
|
|
49
49
|
return (_a = react_1.default.Children.map(children, function (child, index) {
|
|
50
50
|
return react_1.default.isValidElement(child)
|
|
51
51
|
? react_1.default.cloneElement(child, {
|
|
52
|
-
id: idPrefix
|
|
52
|
+
id: "".concat(idPrefix, "--slide-").concat(index),
|
|
53
53
|
index: index,
|
|
54
54
|
})
|
|
55
55
|
: child;
|
|
@@ -75,7 +75,7 @@ exports.Checkbox = react_1.default.forwardRef(function (props, ref) {
|
|
|
75
75
|
return !label ? (checkbox) : (react_1.default.createElement("label", { className: (0, classnames_1.default)('iui-checkbox-wrapper', (_b = {
|
|
76
76
|
'iui-disabled': disabled
|
|
77
77
|
},
|
|
78
|
-
_b["iui-"
|
|
78
|
+
_b["iui-".concat(status)] = !!status,
|
|
79
79
|
_b['iui-loading'] = isLoading,
|
|
80
80
|
_b), className), style: style },
|
|
81
81
|
checkbox,
|
|
@@ -69,20 +69,20 @@ exports.ColorBuilder = react_1.default.forwardRef(function (props, ref) {
|
|
|
69
69
|
]);
|
|
70
70
|
var _p = react_1.default.useState(false), colorDotActive = _p[0], setColorDotActive = _p[1];
|
|
71
71
|
var hueColorString = hueSliderColor.toHexString();
|
|
72
|
-
var colorSquareStyle = ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-color-field-hue: "
|
|
72
|
+
var colorSquareStyle = ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-color-field-hue: ".concat(hueColorString)))
|
|
73
73
|
? {
|
|
74
74
|
'--iui-color-field-hue': hueColorString,
|
|
75
75
|
'--iui-color-picker-selected-color': dotColorString,
|
|
76
76
|
}
|
|
77
77
|
: { backgroundColor: hueColorString };
|
|
78
|
-
var opacitySliderStyle = ((_f = (_e = (_d = (0, utils_1.getWindow)()) === null || _d === void 0 ? void 0 : _d.CSS) === null || _e === void 0 ? void 0 : _e.supports) === null || _f === void 0 ? void 0 : _f.call(_e, "--iui-color-picker-selected-color: "
|
|
78
|
+
var opacitySliderStyle = ((_f = (_e = (_d = (0, utils_1.getWindow)()) === null || _d === void 0 ? void 0 : _d.CSS) === null || _e === void 0 ? void 0 : _e.supports) === null || _f === void 0 ? void 0 : _f.call(_e, "--iui-color-picker-selected-color: ".concat(hueColorString)))
|
|
79
79
|
? { '--iui-color-picker-selected-color': hueColorString }
|
|
80
80
|
: { backgroundColor: hueColorString };
|
|
81
81
|
var squareTop = 100 - hsvColor.v;
|
|
82
82
|
var squareLeft = hsvColor.s;
|
|
83
83
|
var colorDotStyle = ((_j = (_h = (_g = (0, utils_1.getWindow)()) === null || _g === void 0 ? void 0 : _g.CSS) === null || _h === void 0 ? void 0 : _h.supports) === null || _j === void 0 ? void 0 : _j.call(_h, "--iui-color-dot-inset: 0"))
|
|
84
84
|
? {
|
|
85
|
-
'--iui-color-dot-inset': squareTop.toString()
|
|
85
|
+
'--iui-color-dot-inset': "".concat(squareTop.toString(), "% auto auto ").concat(squareLeft.toString(), "%"),
|
|
86
86
|
}
|
|
87
87
|
: {
|
|
88
88
|
backgroundColor: dotColorString,
|
|
@@ -156,7 +156,7 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
|
|
|
156
156
|
react_1.default.createElement(Input_1.Input, { size: 'small', maxLength: showAlpha ? 9 : 7, minLength: 1, placeholder: 'HEX', value: input[0], onChange: function (event) {
|
|
157
157
|
var value = event.target.value.startsWith('#')
|
|
158
158
|
? event.target.value
|
|
159
|
-
: "#"
|
|
159
|
+
: "#".concat(event.target.value);
|
|
160
160
|
setInput([value]);
|
|
161
161
|
}, onKeyDown: function (event) {
|
|
162
162
|
if (event.key === 'Enter') {
|
|
@@ -17,5 +17,5 @@ export declare type ColorSwatchProps = {
|
|
|
17
17
|
* <ColorSwatch color='#23450b' onClick={onClick}/>
|
|
18
18
|
* <ColorSwatch color={{ r: 255, g: 255, b: 0 }} onClick={onClick}/>
|
|
19
19
|
*/
|
|
20
|
-
export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "aria-disabled" | "role" | "children" | "className" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "
|
|
20
|
+
export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "aria-disabled" | "role" | "children" | "className" | "onClick" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "isActive"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
export default ColorSwatch;
|
|
@@ -51,7 +51,7 @@ exports.ColorSwatch = react_1.default.forwardRef(function (props, ref) {
|
|
|
51
51
|
}, [color]);
|
|
52
52
|
var _style = react_1.default.useMemo(function () {
|
|
53
53
|
var _a, _b, _c;
|
|
54
|
-
return ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-color-swatch-background: "
|
|
54
|
+
return ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-color-swatch-background: ".concat(colorString)))
|
|
55
55
|
? __assign({ '--iui-color-swatch-background': colorString }, style) : __assign({ backgroundColor: colorString }, style);
|
|
56
56
|
}, [colorString, style]);
|
|
57
57
|
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-color-swatch', { 'iui-active': isActive }, className), style: _style, onClick: onClick, tabIndex: isActive ? 0 : -1, "aria-selected": isActive, ref: ref }, rest)));
|
|
@@ -57,18 +57,21 @@ var ComboBox = function (props) {
|
|
|
57
57
|
// Generate a stateful random id if not specified
|
|
58
58
|
var id = react_1.default.useState(function () {
|
|
59
59
|
var _a, _b;
|
|
60
|
-
return (_b = (_a = props.id) !== null && _a !== void 0 ? _a : ((inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) && inputProps.id
|
|
60
|
+
return (_b = (_a = props.id) !== null && _a !== void 0 ? _a : ((inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) && "".concat(inputProps.id, "-cb"))) !== null && _b !== void 0 ? _b : "iui-cb-".concat((0, utils_1.getRandomValue)(10));
|
|
61
61
|
})[0];
|
|
62
62
|
(0, utils_1.useTheme)();
|
|
63
63
|
/** Generates a memoized id for an option, given the index from original list */
|
|
64
64
|
var getOptionId = react_1.default.useCallback(function (index) {
|
|
65
65
|
var _a;
|
|
66
|
-
return (_a = options[index].id) !== null && _a !== void 0 ? _a : id
|
|
66
|
+
return (_a = options[index].id) !== null && _a !== void 0 ? _a : "".concat(id, "-option").concat(options.findIndex(function (_a) {
|
|
67
67
|
var value = _a.value;
|
|
68
68
|
return value === options[index].value;
|
|
69
|
-
});
|
|
69
|
+
}));
|
|
70
70
|
}, [options, id]);
|
|
71
71
|
var userOnChange = react_1.default.useRef(onChange);
|
|
72
|
+
react_1.default.useEffect(function () {
|
|
73
|
+
userOnChange.current = onChange;
|
|
74
|
+
}, [onChange]);
|
|
72
75
|
var memoizedItems = react_1.default.useMemo(function () {
|
|
73
76
|
return options.map(function (option, index) {
|
|
74
77
|
var label = option.label, value = option.value, rest = __rest(option, ["label", "value"]);
|
|
@@ -284,9 +287,9 @@ var ComboBox = function (props) {
|
|
|
284
287
|
if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
|
|
285
288
|
setIsOpen(false);
|
|
286
289
|
}
|
|
287
|
-
}, animation: 'shift-away', duration: 200 }, dropdownMenuProps, { content: react_1.default.createElement(Menu_1.Menu, { id: id
|
|
290
|
+
}, animation: 'shift-away', duration: 200 }, dropdownMenuProps, { content: react_1.default.createElement(Menu_1.Menu, { id: "".concat(id, "-list"), className: 'iui-scroll', style: {
|
|
288
291
|
minWidth: minWidth,
|
|
289
|
-
maxWidth: "min("
|
|
292
|
+
maxWidth: "min(".concat(minWidth * 2, "px, 90vw)"),
|
|
290
293
|
maxHeight: 300,
|
|
291
294
|
}, setFocus: false, role: 'listbox', ref: menuRef }, menuItems), onHide: function (instance) {
|
|
292
295
|
var _a;
|
|
@@ -302,7 +305,7 @@ var ComboBox = function (props) {
|
|
|
302
305
|
} }),
|
|
303
306
|
react_1.default.createElement(Input_1.Input, __assign({ ref: inputRef, onKeyDown: onKeyDown, onFocus: function () { return setIsOpen(true); }, value: inputValue, "aria-activedescendant": isOpen && focusedIndex > -1
|
|
304
307
|
? getOptionId(focusedIndex)
|
|
305
|
-
: undefined, role: 'combobox', "aria-controls": isOpen ? id
|
|
308
|
+
: undefined, role: 'combobox', "aria-controls": isOpen ? "".concat(id, "-list") : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off' }, inputProps, { onChange: onInput }))),
|
|
306
309
|
react_1.default.createElement("span", { ref: toggleButtonRef, className: (0, classnames_1.default)('iui-end-icon', {
|
|
307
310
|
'iui-actionable': !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled),
|
|
308
311
|
'iui-disabled': inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
|
|
@@ -295,9 +295,9 @@ var DatePicker = function (props) {
|
|
|
295
295
|
react_1.default.createElement(ChevronRightDouble_1.default, null)))),
|
|
296
296
|
react_1.default.createElement("div", { className: 'iui-calendar-weekdays' }, shortDays.map(function (day, index) { return (react_1.default.createElement("div", { key: day, title: longDays[index] }, day)); })),
|
|
297
297
|
react_1.default.createElement("div", { onKeyDown: handleCalendarKeyDown, role: 'listbox' }, weeks.map(function (weekDays, weekIndex) {
|
|
298
|
-
return (react_1.default.createElement("div", { key: "week-"
|
|
298
|
+
return (react_1.default.createElement("div", { key: "week-".concat(displayedMonthIndex, "-").concat(weekIndex), className: 'iui-calendar-week' }, weekDays.map(function (weekDay, dayIndex) {
|
|
299
299
|
var dateValue = weekDay.getDate();
|
|
300
|
-
return (react_1.default.createElement("div", { key: "day-"
|
|
300
|
+
return (react_1.default.createElement("div", { key: "day-".concat(displayedMonthIndex, "-").concat(dayIndex), className: getDayClass(weekDay), onClick: function () { return onDayClick(weekDay); }, role: 'option', tabIndex: isSameDay(weekDay, focusedDay) ? 0 : -1, ref: function (element) {
|
|
301
301
|
return isSameDay(weekDay, focusedDay) &&
|
|
302
302
|
needFocus.current &&
|
|
303
303
|
(element === null || element === void 0 ? void 0 : element.focus());
|
|
@@ -77,7 +77,7 @@ var ExpandableBlock = function (props) {
|
|
|
77
77
|
caption && react_1.default.createElement("div", { className: 'iui-caption' }, caption)),
|
|
78
78
|
icon &&
|
|
79
79
|
react_1.default.cloneElement(icon, {
|
|
80
|
-
className: (0, classnames_1.default)('iui-status-icon', (_a = {}, _a["iui-"
|
|
80
|
+
className: (0, classnames_1.default)('iui-status-icon', (_a = {}, _a["iui-".concat(status)] = !!status, _a), icon.props.className),
|
|
81
81
|
})),
|
|
82
82
|
react_1.default.createElement(utils_1.WithCSSTransition, { in: expanded },
|
|
83
83
|
react_1.default.createElement("div", { className: 'iui-expandable-content' },
|
|
@@ -70,7 +70,7 @@ var Footer = function (props) {
|
|
|
70
70
|
var defaultElements = [
|
|
71
71
|
{
|
|
72
72
|
key: 'copyright',
|
|
73
|
-
title: "\u00A9 "
|
|
73
|
+
title: "\u00A9 ".concat(new Date().getFullYear(), " Bentley Systems, Incorporated"),
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
key: 'termsOfService',
|
|
@@ -107,7 +107,7 @@ var Footer = function (props) {
|
|
|
107
107
|
}
|
|
108
108
|
return (react_1.default.createElement("footer", __assign({ className: (0, classnames_1.default)('iui-legal-footer', className) }, rest),
|
|
109
109
|
react_1.default.createElement("ul", null, elements.map(function (element, index) {
|
|
110
|
-
return (react_1.default.createElement("li", { key: element.key || element.title
|
|
110
|
+
return (react_1.default.createElement("li", { key: element.key || "".concat(element.title, "-").concat(index) },
|
|
111
111
|
index > 0 && react_1.default.createElement("span", { className: 'iui-separator' }),
|
|
112
112
|
element.url ? (react_1.default.createElement("a", { href: element.url, target: '_blank', rel: 'noreferrer' }, element.title)) : (element.title)));
|
|
113
113
|
}))));
|
|
@@ -58,7 +58,7 @@ var HeaderBreadcrumbs = function (props) {
|
|
|
58
58
|
(0, utils_1.useTheme)();
|
|
59
59
|
return (react_1.default.createElement("nav", __assign({ "aria-label": 'breadcrumbs' }, rest), items.reduce(function (previous, current, index) { return __spreadArray(__spreadArray([], previous, true), [
|
|
60
60
|
current,
|
|
61
|
-
index !== items.length - 1 && (react_1.default.createElement(ChevronRight_1.default, { key: "chevron"
|
|
61
|
+
index !== items.length - 1 && (react_1.default.createElement(ChevronRight_1.default, { key: "chevron".concat(index), "aria-hidden": true, className: 'iui-chevron' })),
|
|
62
62
|
], false); }, [])));
|
|
63
63
|
};
|
|
64
64
|
exports.HeaderBreadcrumbs = HeaderBreadcrumbs;
|
|
@@ -61,6 +61,7 @@ exports.HeaderButton = react_1.default.forwardRef(function (props, ref) {
|
|
|
61
61
|
: undefined, styleType: 'borderless', className: (0, classnames_1.default)({
|
|
62
62
|
'iui-header-button': !isSplitButton(props),
|
|
63
63
|
'iui-header-split-button': isSplitButton(props),
|
|
64
|
+
'iui-header-dropdown-button': !isSplitButton(props) && isDropdownButton(props),
|
|
64
65
|
'iui-active': isActive,
|
|
65
66
|
}, className), 'aria-current': isActive ? 'location' : undefined, children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
66
67
|
react_1.default.createElement("div", null, name),
|
|
@@ -82,10 +82,10 @@ exports.InformationPanel = react_1.default.forwardRef(function (props, ref) {
|
|
|
82
82
|
}
|
|
83
83
|
var _a = infoPanelRef.current.getBoundingClientRect(), right = _a.right, bottom = _a.bottom;
|
|
84
84
|
if (orientation === 'vertical') {
|
|
85
|
-
infoPanelRef.current.style.width = right - e.clientX
|
|
85
|
+
infoPanelRef.current.style.width = "".concat(right - e.clientX, "px");
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
infoPanelRef.current.style.height = bottom - e.clientY
|
|
88
|
+
infoPanelRef.current.style.height = "".concat(bottom - e.clientY, "px");
|
|
89
89
|
}
|
|
90
90
|
}, [orientation]);
|
|
91
91
|
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-information-panel', {
|
package/cjs/core/Input/Input.js
CHANGED
|
@@ -52,6 +52,6 @@ exports.Input = react_1.default.forwardRef(function (props, ref) {
|
|
|
52
52
|
inputRef.current.focus();
|
|
53
53
|
}
|
|
54
54
|
}, [setFocus]);
|
|
55
|
-
return (react_1.default.createElement("input", __assign({ className: (0, classnames_1.default)('iui-input', (_a = {}, _a["iui-"
|
|
55
|
+
return (react_1.default.createElement("input", __assign({ className: (0, classnames_1.default)('iui-input', (_a = {}, _a["iui-".concat(size)] = !!size, _a), className), ref: refs }, rest)));
|
|
56
56
|
});
|
|
57
57
|
exports.default = exports.Input;
|
package/cjs/core/Menu/Menu.js
CHANGED
|
@@ -46,9 +46,14 @@ exports.Menu = react_1.default.forwardRef(function (props, ref) {
|
|
|
46
46
|
react_1.default.useEffect(function () {
|
|
47
47
|
setFocusedIndex(null);
|
|
48
48
|
}, [children]);
|
|
49
|
+
var getFocusableNodes = react_1.default.useCallback(function () {
|
|
50
|
+
var focusableItems = (0, utils_1.getFocusableElements)(menuRef.current);
|
|
51
|
+
// Filter out focusable elements that are inside each menu item, e.g. checkbox, anchor
|
|
52
|
+
return focusableItems.filter(function (i) { return !focusableItems.some(function (p) { return p.contains(i.parentElement); }); });
|
|
53
|
+
}, []);
|
|
49
54
|
react_1.default.useEffect(function () {
|
|
50
55
|
var _a;
|
|
51
|
-
var items = (
|
|
56
|
+
var items = getFocusableNodes();
|
|
52
57
|
if (focusedIndex != null) {
|
|
53
58
|
(_a = items === null || items === void 0 ? void 0 : items[focusedIndex]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
54
59
|
return;
|
|
@@ -57,9 +62,9 @@ exports.Menu = react_1.default.forwardRef(function (props, ref) {
|
|
|
57
62
|
if (setFocus) {
|
|
58
63
|
setFocusedIndex(selectedIndex > -1 ? selectedIndex : 0);
|
|
59
64
|
}
|
|
60
|
-
}, [setFocus, focusedIndex]);
|
|
65
|
+
}, [setFocus, focusedIndex, getFocusableNodes]);
|
|
61
66
|
var onKeyDown = function (event) {
|
|
62
|
-
var items = (
|
|
67
|
+
var items = getFocusableNodes();
|
|
63
68
|
if (!(items === null || items === void 0 ? void 0 : items.length)) {
|
|
64
69
|
return;
|
|
65
70
|
}
|
|
@@ -15,7 +15,7 @@ export declare type ProgressLinearProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Labels array. One label will be centered, two will be put to the sides.
|
|
17
17
|
*/
|
|
18
|
-
labels?: React.
|
|
18
|
+
labels?: React.ReactNode[];
|
|
19
19
|
/**
|
|
20
20
|
* Apply animation to the value change, if determinate.
|
|
21
21
|
* @default false
|
|
@@ -55,13 +55,13 @@ var ProgressLinear = function (props) {
|
|
|
55
55
|
(0, utils_1.useTheme)();
|
|
56
56
|
var boundedValue = Math.min(100, Math.max(0, value));
|
|
57
57
|
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-progress-indicator-linear', (_a = {},
|
|
58
|
-
_a["iui-"
|
|
58
|
+
_a["iui-".concat(status)] = !!status,
|
|
59
59
|
_a), className), style: style }, rest),
|
|
60
60
|
react_1.default.createElement("div", { className: 'iui-track' },
|
|
61
61
|
react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-fill', {
|
|
62
62
|
'iui-determinate': !indeterminate && isAnimated,
|
|
63
63
|
'iui-indeterminate': indeterminate,
|
|
64
|
-
}), style: { width: indeterminate ? '100%' : boundedValue
|
|
64
|
+
}), style: { width: indeterminate ? '100%' : "".concat(boundedValue, "%") } })),
|
|
65
65
|
labels.length > 0 && (react_1.default.createElement("div", { className: 'iui-label' }, labels.map(function (label, index) { return (react_1.default.createElement("span", { key: index }, label)); })))));
|
|
66
66
|
};
|
|
67
67
|
exports.ProgressLinear = ProgressLinear;
|
|
@@ -69,8 +69,8 @@ var ProgressRadial = function (props) {
|
|
|
69
69
|
'iui-determinate': !indeterminate,
|
|
70
70
|
'iui-indeterminate': indeterminate
|
|
71
71
|
},
|
|
72
|
-
_a["iui-"
|
|
73
|
-
_a["iui-"
|
|
72
|
+
_a["iui-".concat(size)] = !!size,
|
|
73
|
+
_a["iui-".concat(status)] = !!status,
|
|
74
74
|
_a), className), style: style }, rest),
|
|
75
75
|
react_1.default.createElement("svg", { className: 'iui-radial', viewBox: '0 0 32 32', "aria-hidden": 'true' },
|
|
76
76
|
react_1.default.createElement("circle", { className: 'iui-track', cx: '16', cy: '16', r: '14' }),
|
package/cjs/core/Radio/Radio.js
CHANGED
|
@@ -56,7 +56,7 @@ exports.Radio = react_1.default.forwardRef(function (props, ref) {
|
|
|
56
56
|
}
|
|
57
57
|
}, [setFocus]);
|
|
58
58
|
var radio = (react_1.default.createElement("input", __assign({ className: (0, classnames_1.default)('iui-radio', className && (_a = {}, _a[className] = !label, _a), checkmarkClassName), style: __assign(__assign({}, (!label && style)), checkmarkStyle), disabled: disabled, type: 'radio', ref: refs }, rest)));
|
|
59
|
-
return !label ? (radio) : (react_1.default.createElement("label", { className: (0, classnames_1.default)('iui-radio-wrapper', (_b = { 'iui-disabled': disabled }, _b["iui-"
|
|
59
|
+
return !label ? (radio) : (react_1.default.createElement("label", { className: (0, classnames_1.default)('iui-radio-wrapper', (_b = { 'iui-disabled': disabled }, _b["iui-".concat(status)] = !!status, _b), className), style: style },
|
|
60
60
|
radio,
|
|
61
61
|
label && react_1.default.createElement("span", { className: 'iui-radio-label' }, label)));
|
|
62
62
|
});
|
|
@@ -133,7 +133,7 @@ var Select = function (props) {
|
|
|
133
133
|
return options.map(function (option, index) {
|
|
134
134
|
var isSelected = value === option.value;
|
|
135
135
|
var menuItem = itemRenderer ? (itemRenderer(option, { close: close, isSelected: isSelected })) : (react_1.default.createElement(MenuItem_1.MenuItem, null, option.label));
|
|
136
|
-
return react_1.default.cloneElement(menuItem, __assign(__assign({ key: option.label
|
|
136
|
+
return react_1.default.cloneElement(menuItem, __assign(__assign({ key: "".concat(option.label, "-").concat(index), isSelected: isSelected, onClick: function () {
|
|
137
137
|
!option.disabled && (onChange === null || onChange === void 0 ? void 0 : onChange(option.value));
|
|
138
138
|
close();
|
|
139
139
|
}, ref: function (el) { return isSelected && (el === null || el === void 0 ? void 0 : el.scrollIntoView()); }, role: 'option' }, option), menuItem.props));
|
|
@@ -146,7 +146,7 @@ var Select = function (props) {
|
|
|
146
146
|
return options.find(function (option) { return option.value === value; });
|
|
147
147
|
}, [options, value]);
|
|
148
148
|
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-input-with-icon', className), "aria-expanded": isOpen, "aria-haspopup": 'listbox', style: style }, rest),
|
|
149
|
-
react_1.default.createElement(DropdownMenu_1.DropdownMenu, __assign({ menuItems: menuItems, placement: 'bottom-start', className: (0, classnames_1.default)('iui-scroll', menuClassName), style: __assign({ minWidth: minWidth, maxWidth: "min("
|
|
149
|
+
react_1.default.createElement(DropdownMenu_1.DropdownMenu, __assign({ menuItems: menuItems, placement: 'bottom-start', className: (0, classnames_1.default)('iui-scroll', menuClassName), style: __assign({ minWidth: minWidth, maxWidth: "min(".concat(minWidth * 2, "px, 90vw)"), maxHeight: "300px" }, menuStyle), role: 'listbox', onShow: onShowHandler, onHide: onHideHandler, disabled: disabled }, popoverProps, { visible: isOpen, onClickOutside: function (_, _a) {
|
|
150
150
|
var _b;
|
|
151
151
|
var target = _a.target;
|
|
152
152
|
if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
|
|
@@ -157,7 +157,7 @@ var Select = function (props) {
|
|
|
157
157
|
'iui-placeholder': !selectedItem && !!placeholder,
|
|
158
158
|
'iui-disabled': disabled
|
|
159
159
|
},
|
|
160
|
-
_a["iui-"
|
|
160
|
+
_a["iui-".concat(size)] = !!size,
|
|
161
161
|
_a)), onClick: function () { return !disabled && toggle(); }, onKeyDown: function (e) { return !disabled && onKeyDown(e, toggle); }, tabIndex: !disabled ? 0 : undefined },
|
|
162
162
|
!selectedItem && react_1.default.createElement("span", { className: 'iui-content' }, placeholder),
|
|
163
163
|
selectedItem &&
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/skip-to-content.css';
|
|
3
|
+
export declare type SkipToContentLinkProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The id of the main content that the link directs to. Don't forget the #!
|
|
6
|
+
*/
|
|
7
|
+
href: string;
|
|
8
|
+
/**
|
|
9
|
+
* Localize 'Skip to main content' label.
|
|
10
|
+
* @default 'Skip to main content'
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
} & Omit<React.ComponentPropsWithoutRef<'a'>, 'href'>;
|
|
14
|
+
/**
|
|
15
|
+
* `SkipToContentLink` is for screen reader and keyboard users and will not be visible unless tabbed to.
|
|
16
|
+
* Provides a shortcut to the main content of the page without navigating through the header, etc.
|
|
17
|
+
* Should be placed just inside the body. Set `href` to the id of your main content component. Don't forget the `#`!
|
|
18
|
+
* @example
|
|
19
|
+
* <body><SkipToContentLink href='#main-content-id' /> ... </body>
|
|
20
|
+
* <body><SkipToContentLink href='#main-content-id'>{localizedLabel}</SkipToContentLink> ... </body>
|
|
21
|
+
*/
|
|
22
|
+
export declare const SkipToContentLink: React.ForwardRefExoticComponent<{
|
|
23
|
+
/**
|
|
24
|
+
* The id of the main content that the link directs to. Don't forget the #!
|
|
25
|
+
*/
|
|
26
|
+
href: string;
|
|
27
|
+
/**
|
|
28
|
+
* Localize 'Skip to main content' label.
|
|
29
|
+
* @default 'Skip to main content'
|
|
30
|
+
*/
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
} & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>>, "href"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
33
|
+
export default SkipToContentLink;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.SkipToContentLink = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
35
|
+
var utils_1 = require("../utils");
|
|
36
|
+
require("@itwin/itwinui-css/css/skip-to-content.css");
|
|
37
|
+
/**
|
|
38
|
+
* `SkipToContentLink` is for screen reader and keyboard users and will not be visible unless tabbed to.
|
|
39
|
+
* Provides a shortcut to the main content of the page without navigating through the header, etc.
|
|
40
|
+
* Should be placed just inside the body. Set `href` to the id of your main content component. Don't forget the `#`!
|
|
41
|
+
* @example
|
|
42
|
+
* <body><SkipToContentLink href='#main-content-id' /> ... </body>
|
|
43
|
+
* <body><SkipToContentLink href='#main-content-id'>{localizedLabel}</SkipToContentLink> ... </body>
|
|
44
|
+
*/
|
|
45
|
+
exports.SkipToContentLink = react_1.default.forwardRef(function (props, ref) {
|
|
46
|
+
var _a = props.children, children = _a === void 0 ? 'Skip to main content' : _a, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
47
|
+
(0, utils_1.useTheme)();
|
|
48
|
+
return (react_1.default.createElement("a", __assign({ ref: ref, className: (0, classnames_1.default)('iui-skip-to-content-link', className) }, rest), children));
|
|
49
|
+
});
|
|
50
|
+
exports.default = exports.SkipToContentLink;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkipToContentLink = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
var SkipToContentLink_1 = require("./SkipToContentLink");
|
|
9
|
+
Object.defineProperty(exports, "SkipToContentLink", { enumerable: true, get: function () { return SkipToContentLink_1.SkipToContentLink; } });
|
|
10
|
+
exports.default = './SkipToContentLink';
|
|
@@ -80,7 +80,7 @@ var focusThumb = function (sliderContainer, activeIndex) {
|
|
|
80
80
|
var doc = sliderContainer.ownerDocument;
|
|
81
81
|
if (!sliderContainer.contains(doc.activeElement) ||
|
|
82
82
|
Number((_a = doc.activeElement) === null || _a === void 0 ? void 0 : _a.getAttribute('data-index')) !== activeIndex) {
|
|
83
|
-
var thumbToFocus = sliderContainer.querySelector("[data-index=\""
|
|
83
|
+
var thumbToFocus = sliderContainer.querySelector("[data-index=\"".concat(activeIndex, "\"]"));
|
|
84
84
|
thumbToFocus && thumbToFocus.focus();
|
|
85
85
|
}
|
|
86
86
|
};
|