@itwin/itwinui-react 1.37.0 → 1.37.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/CHANGELOG.md +19 -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/InformationPanel/InformationPanel.js +2 -2
- package/cjs/core/Input/Input.js +1 -1
- 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/Slider/Slider.js +1 -1
- package/cjs/core/Slider/Thumb.js +16 -2
- package/cjs/core/Slider/Track.js +24 -13
- package/cjs/core/Surface/Surface.js +1 -1
- package/cjs/core/Table/Table.js +18 -6
- package/cjs/core/Table/TablePaginator.js +6 -6
- package/cjs/core/Table/TableRowMemoized.js +1 -1
- package/cjs/core/Table/cells/EditableCell.js +2 -1
- package/cjs/core/Table/columns/actionColumn.js +2 -2
- 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/TagContainer.js +1 -1
- package/cjs/core/Tile/Tile.js +1 -1
- package/cjs/core/Toast/Toast.js +2 -2
- package/cjs/core/Toast/ToastWrapper.js +1 -1
- package/cjs/core/Tree/TreeNode.js +2 -2
- 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/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/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/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/InformationPanel/InformationPanel.js +2 -2
- package/esm/core/Input/Input.js +1 -1
- 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/Slider/Slider.js +1 -1
- package/esm/core/Slider/Thumb.js +16 -2
- package/esm/core/Slider/Track.js +24 -13
- package/esm/core/Surface/Surface.js +1 -1
- package/esm/core/Table/Table.js +18 -6
- package/esm/core/Table/TablePaginator.js +6 -6
- package/esm/core/Table/TableRowMemoized.js +1 -1
- package/esm/core/Table/cells/EditableCell.js +2 -1
- package/esm/core/Table/columns/actionColumn.js +2 -2
- 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/TagContainer.js +1 -1
- package/esm/core/Tile/Tile.js +1 -1
- package/esm/core/Toast/Toast.js +2 -2
- package/esm/core/Toast/ToastWrapper.js +1 -1
- package/esm/core/Tree/TreeNode.js +2 -2
- 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/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/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/package.json +21 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### [1.37.3](https://www.github.com/iTwin/iTwinUI-react/compare/v1.37.2...v1.37.3) (2022-05-06)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
* **Slider:** Skip drawing track if thumb values are out of range ([#652](https://www.github.com/iTwin/iTwinUI-react/issues/652)) ([38d6574](https://www.github.com/iTwin/iTwinUI-react/commit/38d657423d2def7d54b9e195f0c543a35e725d3f))
|
|
8
|
+
|
|
9
|
+
### [1.37.2](https://www.github.com/iTwin/iTwinUI-react/compare/v1.37.1...v1.37.2) (2022-05-04)
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
* **Table:** Fix direction of sort icons ([#645](https://www.github.com/iTwin/iTwinUI-react/issues/645)) ([1a0683b](https://www.github.com/iTwin/iTwinUI-react/commit/1a0683b2d8f18b8ec80412e2208fbfa12df88d51))
|
|
14
|
+
* **Table:** Fix error of headless table ([#648](https://www.github.com/iTwin/iTwinUI-react/issues/648)) ([87c6b9e](https://www.github.com/iTwin/iTwinUI-react/commit/87c6b9eb0b8338357aec107af3f7a7539dd0f5a3))
|
|
15
|
+
|
|
16
|
+
### [1.37.1](https://www.github.com/iTwin/iTwinUI-react/compare/v1.37.0...v1.37.1) (2022-04-22)
|
|
17
|
+
|
|
18
|
+
### Fixes
|
|
19
|
+
|
|
20
|
+
* **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))
|
|
21
|
+
|
|
3
22
|
## [1.37.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.36.0...v1.37.0) (2022-04-21)
|
|
4
23
|
|
|
5
24
|
### 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" | "onClick" | "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" | "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" | "
|
|
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;
|
|
@@ -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;
|
|
@@ -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 &&
|
|
@@ -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
|
};
|
package/cjs/core/Slider/Thumb.js
CHANGED
|
@@ -70,9 +70,23 @@ var Thumb = function (props) {
|
|
|
70
70
|
}, [disabled, index, onThumbActivated]);
|
|
71
71
|
var _a = react_1.default.useState(false), hasFocus = _a[0], setHasFocus = _a[1];
|
|
72
72
|
var _b = react_1.default.useState(false), isHovered = _b[0], setIsHovered = _b[1];
|
|
73
|
-
var
|
|
73
|
+
var adjustedValue = react_1.default.useMemo(function () {
|
|
74
|
+
if (value < sliderMin) {
|
|
75
|
+
return sliderMin;
|
|
76
|
+
}
|
|
77
|
+
if (value > sliderMax) {
|
|
78
|
+
return sliderMax;
|
|
79
|
+
}
|
|
80
|
+
return value;
|
|
81
|
+
}, [sliderMax, sliderMin, value]);
|
|
82
|
+
var leftPercent = react_1.default.useMemo(function () {
|
|
83
|
+
if (sliderMax === sliderMin) {
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
return (100.0 * (adjustedValue - sliderMin)) / (sliderMax - sliderMin);
|
|
87
|
+
}, [adjustedValue, sliderMax, sliderMin]);
|
|
74
88
|
var _c = thumbProps || {}, style = _c.style, className = _c.className, rest = __rest(_c, ["style", "className"]);
|
|
75
89
|
return (react_1.default.createElement(Tooltip_1.Tooltip, __assign({ visible: isActive || hasFocus || isHovered, placement: 'top' }, tooltipProps),
|
|
76
|
-
react_1.default.createElement("div", __assign({}, rest, { "data-index": index, ref: thumbRef, style: __assign(__assign({}, style), { left: leftPercent
|
|
90
|
+
react_1.default.createElement("div", __assign({}, rest, { "data-index": index, ref: thumbRef, style: __assign(__assign({}, style), { left: "".concat(leftPercent, "%") }), className: (0, classnames_1.default)('iui-slider-thumb', { 'iui-active': isActive }, className), role: 'slider', tabIndex: disabled ? undefined : 0, "aria-valuemin": minVal, "aria-valuenow": value, "aria-valuemax": maxVal, "aria-disabled": disabled, onPointerDown: handlePointerDownOnThumb, onKeyDown: handleOnKeyDown, onFocus: function () { return setHasFocus(true); }, onBlur: function () { return setHasFocus(false); }, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }))));
|
|
77
91
|
};
|
|
78
92
|
exports.Thumb = Thumb;
|
package/cjs/core/Slider/Track.js
CHANGED
|
@@ -29,10 +29,18 @@ function shouldDisplaySegment(segmentIndex, mode) {
|
|
|
29
29
|
}
|
|
30
30
|
function generateSegments(values, min, max) {
|
|
31
31
|
var segments = [];
|
|
32
|
+
var newValues = __spreadArray([], values, true);
|
|
33
|
+
newValues.sort(function (a, b) { return a - b; });
|
|
34
|
+
if (0 === newValues.length ||
|
|
35
|
+
newValues[0] < min ||
|
|
36
|
+
newValues[newValues.length - 1] > max ||
|
|
37
|
+
min === max) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
32
40
|
var lastValue = min;
|
|
33
|
-
for (var i = 0; i <
|
|
34
|
-
segments.push({ left: lastValue, right:
|
|
35
|
-
lastValue =
|
|
41
|
+
for (var i = 0; i < newValues.length; i++) {
|
|
42
|
+
segments.push({ left: lastValue, right: newValues[i] });
|
|
43
|
+
lastValue = newValues[i];
|
|
36
44
|
}
|
|
37
45
|
segments.push({ left: lastValue, right: max });
|
|
38
46
|
return segments;
|
|
@@ -43,19 +51,22 @@ function generateSegments(values, min, max) {
|
|
|
43
51
|
*/
|
|
44
52
|
var Track = function (props) {
|
|
45
53
|
var trackDisplayMode = props.trackDisplayMode, sliderMin = props.sliderMin, sliderMax = props.sliderMax, values = props.values;
|
|
46
|
-
var _a = react_1.default.useState(
|
|
54
|
+
var _a = react_1.default.useState(function () {
|
|
55
|
+
return generateSegments(values, sliderMin, sliderMax);
|
|
56
|
+
}), segments = _a[0], setSegments = _a[1];
|
|
47
57
|
react_1.default.useEffect(function () {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
setCurrentValues(newValues);
|
|
51
|
-
}, [values]);
|
|
52
|
-
var segments = react_1.default.useMemo(function () { return generateSegments(currentValues, sliderMin, sliderMax); }, [currentValues, sliderMin, sliderMax]);
|
|
58
|
+
setSegments(generateSegments(values, sliderMin, sliderMax));
|
|
59
|
+
}, [values, sliderMin, sliderMax]);
|
|
53
60
|
return (react_1.default.createElement(react_1.default.Fragment, null, 'none' !== trackDisplayMode &&
|
|
54
61
|
segments.map(function (segment, index) {
|
|
55
|
-
var leftPercent =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
var leftPercent = segment.left >= sliderMin && sliderMax !== sliderMin
|
|
63
|
+
? (100.0 * (segment.left - sliderMin)) / (sliderMax - sliderMin)
|
|
64
|
+
: 0;
|
|
65
|
+
var rightPercent = segment.right >= sliderMin && sliderMax !== sliderMin
|
|
66
|
+
? 100.0 -
|
|
67
|
+
(100.0 * (segment.right - sliderMin)) / (sliderMax - sliderMin)
|
|
68
|
+
: 100;
|
|
69
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (react_1.default.createElement("div", { className: 'iui-slider-track', style: { left: "".concat(leftPercent, "%"), right: "".concat(rightPercent, "%") } })) : null));
|
|
59
70
|
})));
|
|
60
71
|
};
|
|
61
72
|
exports.Track = Track;
|
|
@@ -63,7 +63,7 @@ exports.Surface = react_1.default.forwardRef(function (props, ref) {
|
|
|
63
63
|
var _a, _b, _c;
|
|
64
64
|
var _d = props.elevation, elevation = _d === void 0 ? 0 : _d, className = props.className, style = props.style, children = props.children, rest = __rest(props, ["elevation", "className", "style", "children"]);
|
|
65
65
|
(0, utils_1.useTheme)();
|
|
66
|
-
var _style = ((_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-surface-elevation: "
|
|
66
|
+
var _style = ((_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-surface-elevation: ".concat(getSurfaceElevationValue(elevation))))
|
|
67
67
|
? __assign({ '--iui-surface-elevation': getSurfaceElevationValue(elevation) }, style) : __assign({ boxShadow: getSurfaceElevationValue(elevation) }, style);
|
|
68
68
|
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-surface', className), style: _style, ref: ref }, rest), children));
|
|
69
69
|
});
|