@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
|
@@ -38,8 +38,8 @@ export var IconButton = React.forwardRef(function (props, ref) {
|
|
|
38
38
|
var _a;
|
|
39
39
|
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"]);
|
|
40
40
|
useTheme();
|
|
41
|
-
return (React.createElement(Element, __assign({ ref: ref, className: cx('iui-button', "iui-"
|
|
42
|
-
_a["iui-"
|
|
41
|
+
return (React.createElement(Element, __assign({ ref: ref, className: cx('iui-button', "iui-".concat(styleType), (_a = {},
|
|
42
|
+
_a["iui-".concat(size)] = !!size,
|
|
43
43
|
_a['iui-active'] = isActive,
|
|
44
44
|
_a), className), type: type }, rest), React.cloneElement(children, {
|
|
45
45
|
className: cx('iui-button-icon', children.props.className),
|
|
@@ -55,7 +55,7 @@ import { CarouselNavigation } from './CarouselNavigation';
|
|
|
55
55
|
export var Carousel = Object.assign(React.forwardRef(function (props, ref) {
|
|
56
56
|
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"]);
|
|
57
57
|
// Generate a stateful random id if not specified
|
|
58
|
-
var id = React.useState(function () { var _a; return (_a = props.id) !== null && _a !== void 0 ? _a : "iui-carousel-"
|
|
58
|
+
var id = React.useState(function () { var _a; return (_a = props.id) !== null && _a !== void 0 ? _a : "iui-carousel-".concat(getRandomValue(10)); })[0];
|
|
59
59
|
useTheme();
|
|
60
60
|
var isManuallyUpdating = React.useRef(false);
|
|
61
61
|
var scrollInstantly = React.useRef(false);
|
|
@@ -96,7 +96,7 @@ export var CarouselDotsList = React.forwardRef(function (props, ref) {
|
|
|
96
96
|
var isSecondSmallDot = (index === firstVisibleDotIndex + 1 && index !== 1) ||
|
|
97
97
|
(index === lastVisibleDotIndex - 1 && index !== slideCount - 2);
|
|
98
98
|
var isClipped = index < firstVisibleDotIndex || index > lastVisibleDotIndex;
|
|
99
|
-
return (React.createElement(CarouselDot, { key: index, "aria-label": "Slide "
|
|
99
|
+
return (React.createElement(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) }));
|
|
100
100
|
});
|
|
101
101
|
}, [
|
|
102
102
|
slideCount,
|
|
@@ -43,7 +43,7 @@ export var CarouselSlider = React.forwardRef(function (props, ref) {
|
|
|
43
43
|
return (_a = React.Children.map(children, function (child, index) {
|
|
44
44
|
return React.isValidElement(child)
|
|
45
45
|
? React.cloneElement(child, {
|
|
46
|
-
id: idPrefix
|
|
46
|
+
id: "".concat(idPrefix, "--slide-").concat(index),
|
|
47
47
|
index: index,
|
|
48
48
|
})
|
|
49
49
|
: child;
|
|
@@ -69,7 +69,7 @@ export var Checkbox = React.forwardRef(function (props, ref) {
|
|
|
69
69
|
return !label ? (checkbox) : (React.createElement("label", { className: cx('iui-checkbox-wrapper', (_b = {
|
|
70
70
|
'iui-disabled': disabled
|
|
71
71
|
},
|
|
72
|
-
_b["iui-"
|
|
72
|
+
_b["iui-".concat(status)] = !!status,
|
|
73
73
|
_b['iui-loading'] = isLoading,
|
|
74
74
|
_b), className), style: style },
|
|
75
75
|
checkbox,
|
|
@@ -63,20 +63,20 @@ export var ColorBuilder = React.forwardRef(function (props, ref) {
|
|
|
63
63
|
]);
|
|
64
64
|
var _p = React.useState(false), colorDotActive = _p[0], setColorDotActive = _p[1];
|
|
65
65
|
var hueColorString = hueSliderColor.toHexString();
|
|
66
|
-
var colorSquareStyle = ((_c = (_b = (_a = 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: "
|
|
66
|
+
var colorSquareStyle = ((_c = (_b = (_a = 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)))
|
|
67
67
|
? {
|
|
68
68
|
'--iui-color-field-hue': hueColorString,
|
|
69
69
|
'--iui-color-picker-selected-color': dotColorString,
|
|
70
70
|
}
|
|
71
71
|
: { backgroundColor: hueColorString };
|
|
72
|
-
var opacitySliderStyle = ((_f = (_e = (_d = 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: "
|
|
72
|
+
var opacitySliderStyle = ((_f = (_e = (_d = 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)))
|
|
73
73
|
? { '--iui-color-picker-selected-color': hueColorString }
|
|
74
74
|
: { backgroundColor: hueColorString };
|
|
75
75
|
var squareTop = 100 - hsvColor.v;
|
|
76
76
|
var squareLeft = hsvColor.s;
|
|
77
77
|
var colorDotStyle = ((_j = (_h = (_g = 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"))
|
|
78
78
|
? {
|
|
79
|
-
'--iui-color-dot-inset': squareTop.toString()
|
|
79
|
+
'--iui-color-dot-inset': "".concat(squareTop.toString(), "% auto auto ").concat(squareLeft.toString(), "%"),
|
|
80
80
|
}
|
|
81
81
|
: {
|
|
82
82
|
backgroundColor: dotColorString,
|
|
@@ -150,7 +150,7 @@ export var ColorInputPanel = React.forwardRef(function (props, ref) {
|
|
|
150
150
|
React.createElement(Input, { size: 'small', maxLength: showAlpha ? 9 : 7, minLength: 1, placeholder: 'HEX', value: input[0], onChange: function (event) {
|
|
151
151
|
var value = event.target.value.startsWith('#')
|
|
152
152
|
? event.target.value
|
|
153
|
-
: "#"
|
|
153
|
+
: "#".concat(event.target.value);
|
|
154
154
|
setInput([value]);
|
|
155
155
|
}, onKeyDown: function (event) {
|
|
156
156
|
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;
|
|
@@ -45,7 +45,7 @@ export var ColorSwatch = React.forwardRef(function (props, ref) {
|
|
|
45
45
|
}, [color]);
|
|
46
46
|
var _style = React.useMemo(function () {
|
|
47
47
|
var _a, _b, _c;
|
|
48
|
-
return ((_c = (_b = (_a = 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: "
|
|
48
|
+
return ((_c = (_b = (_a = 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)))
|
|
49
49
|
? __assign({ '--iui-color-swatch-background': colorString }, style) : __assign({ backgroundColor: colorString }, style);
|
|
50
50
|
}, [colorString, style]);
|
|
51
51
|
return (React.createElement("div", __assign({ className: cx('iui-color-swatch', { 'iui-active': isActive }, className), style: _style, onClick: onClick, tabIndex: isActive ? 0 : -1, "aria-selected": isActive, ref: ref }, rest)));
|
|
@@ -51,18 +51,21 @@ export var ComboBox = function (props) {
|
|
|
51
51
|
// Generate a stateful random id if not specified
|
|
52
52
|
var id = React.useState(function () {
|
|
53
53
|
var _a, _b;
|
|
54
|
-
return (_b = (_a = props.id) !== null && _a !== void 0 ? _a : ((inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) && inputProps.id
|
|
54
|
+
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(getRandomValue(10));
|
|
55
55
|
})[0];
|
|
56
56
|
useTheme();
|
|
57
57
|
/** Generates a memoized id for an option, given the index from original list */
|
|
58
58
|
var getOptionId = React.useCallback(function (index) {
|
|
59
59
|
var _a;
|
|
60
|
-
return (_a = options[index].id) !== null && _a !== void 0 ? _a : id
|
|
60
|
+
return (_a = options[index].id) !== null && _a !== void 0 ? _a : "".concat(id, "-option").concat(options.findIndex(function (_a) {
|
|
61
61
|
var value = _a.value;
|
|
62
62
|
return value === options[index].value;
|
|
63
|
-
});
|
|
63
|
+
}));
|
|
64
64
|
}, [options, id]);
|
|
65
65
|
var userOnChange = React.useRef(onChange);
|
|
66
|
+
React.useEffect(function () {
|
|
67
|
+
userOnChange.current = onChange;
|
|
68
|
+
}, [onChange]);
|
|
66
69
|
var memoizedItems = React.useMemo(function () {
|
|
67
70
|
return options.map(function (option, index) {
|
|
68
71
|
var label = option.label, value = option.value, rest = __rest(option, ["label", "value"]);
|
|
@@ -278,9 +281,9 @@ export var ComboBox = function (props) {
|
|
|
278
281
|
if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
|
|
279
282
|
setIsOpen(false);
|
|
280
283
|
}
|
|
281
|
-
}, animation: 'shift-away', duration: 200 }, dropdownMenuProps, { content: React.createElement(Menu, { id: id
|
|
284
|
+
}, animation: 'shift-away', duration: 200 }, dropdownMenuProps, { content: React.createElement(Menu, { id: "".concat(id, "-list"), className: 'iui-scroll', style: {
|
|
282
285
|
minWidth: minWidth,
|
|
283
|
-
maxWidth: "min("
|
|
286
|
+
maxWidth: "min(".concat(minWidth * 2, "px, 90vw)"),
|
|
284
287
|
maxHeight: 300,
|
|
285
288
|
}, setFocus: false, role: 'listbox', ref: menuRef }, menuItems), onHide: function (instance) {
|
|
286
289
|
var _a;
|
|
@@ -296,7 +299,7 @@ export var ComboBox = function (props) {
|
|
|
296
299
|
} }),
|
|
297
300
|
React.createElement(Input, __assign({ ref: inputRef, onKeyDown: onKeyDown, onFocus: function () { return setIsOpen(true); }, value: inputValue, "aria-activedescendant": isOpen && focusedIndex > -1
|
|
298
301
|
? getOptionId(focusedIndex)
|
|
299
|
-
: undefined, role: 'combobox', "aria-controls": isOpen ? id
|
|
302
|
+
: undefined, role: 'combobox', "aria-controls": isOpen ? "".concat(id, "-list") : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off' }, inputProps, { onChange: onInput }))),
|
|
300
303
|
React.createElement("span", { ref: toggleButtonRef, className: cx('iui-end-icon', {
|
|
301
304
|
'iui-actionable': !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled),
|
|
302
305
|
'iui-disabled': inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
|
|
@@ -288,9 +288,9 @@ export var DatePicker = function (props) {
|
|
|
288
288
|
React.createElement(SvgChevronRightDouble, null)))),
|
|
289
289
|
React.createElement("div", { className: 'iui-calendar-weekdays' }, shortDays.map(function (day, index) { return (React.createElement("div", { key: day, title: longDays[index] }, day)); })),
|
|
290
290
|
React.createElement("div", { onKeyDown: handleCalendarKeyDown, role: 'listbox' }, weeks.map(function (weekDays, weekIndex) {
|
|
291
|
-
return (React.createElement("div", { key: "week-"
|
|
291
|
+
return (React.createElement("div", { key: "week-".concat(displayedMonthIndex, "-").concat(weekIndex), className: 'iui-calendar-week' }, weekDays.map(function (weekDay, dayIndex) {
|
|
292
292
|
var dateValue = weekDay.getDate();
|
|
293
|
-
return (React.createElement("div", { key: "day-"
|
|
293
|
+
return (React.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) {
|
|
294
294
|
return isSameDay(weekDay, focusedDay) &&
|
|
295
295
|
needFocus.current &&
|
|
296
296
|
(element === null || element === void 0 ? void 0 : element.focus());
|
|
@@ -71,7 +71,7 @@ export var ExpandableBlock = function (props) {
|
|
|
71
71
|
caption && React.createElement("div", { className: 'iui-caption' }, caption)),
|
|
72
72
|
icon &&
|
|
73
73
|
React.cloneElement(icon, {
|
|
74
|
-
className: cx('iui-status-icon', (_a = {}, _a["iui-"
|
|
74
|
+
className: cx('iui-status-icon', (_a = {}, _a["iui-".concat(status)] = !!status, _a), icon.props.className),
|
|
75
75
|
})),
|
|
76
76
|
React.createElement(WithCSSTransition, { in: expanded },
|
|
77
77
|
React.createElement("div", { className: 'iui-expandable-content' },
|
|
@@ -64,7 +64,7 @@ export var Footer = function (props) {
|
|
|
64
64
|
var defaultElements = [
|
|
65
65
|
{
|
|
66
66
|
key: 'copyright',
|
|
67
|
-
title: "\u00A9 "
|
|
67
|
+
title: "\u00A9 ".concat(new Date().getFullYear(), " Bentley Systems, Incorporated"),
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
key: 'termsOfService',
|
|
@@ -101,7 +101,7 @@ export var Footer = function (props) {
|
|
|
101
101
|
}
|
|
102
102
|
return (React.createElement("footer", __assign({ className: cx('iui-legal-footer', className) }, rest),
|
|
103
103
|
React.createElement("ul", null, elements.map(function (element, index) {
|
|
104
|
-
return (React.createElement("li", { key: element.key || element.title
|
|
104
|
+
return (React.createElement("li", { key: element.key || "".concat(element.title, "-").concat(index) },
|
|
105
105
|
index > 0 && React.createElement("span", { className: 'iui-separator' }),
|
|
106
106
|
element.url ? (React.createElement("a", { href: element.url, target: '_blank', rel: 'noreferrer' }, element.title)) : (element.title)));
|
|
107
107
|
}))));
|
|
@@ -52,7 +52,7 @@ export var HeaderBreadcrumbs = function (props) {
|
|
|
52
52
|
useTheme();
|
|
53
53
|
return (React.createElement("nav", __assign({ "aria-label": 'breadcrumbs' }, rest), items.reduce(function (previous, current, index) { return __spreadArray(__spreadArray([], previous, true), [
|
|
54
54
|
current,
|
|
55
|
-
index !== items.length - 1 && (React.createElement(SvgChevronRight, { key: "chevron"
|
|
55
|
+
index !== items.length - 1 && (React.createElement(SvgChevronRight, { key: "chevron".concat(index), "aria-hidden": true, className: 'iui-chevron' })),
|
|
56
56
|
], false); }, [])));
|
|
57
57
|
};
|
|
58
58
|
export default HeaderBreadcrumbs;
|
|
@@ -55,6 +55,7 @@ export var HeaderButton = React.forwardRef(function (props, ref) {
|
|
|
55
55
|
: undefined, styleType: 'borderless', className: cx({
|
|
56
56
|
'iui-header-button': !isSplitButton(props),
|
|
57
57
|
'iui-header-split-button': isSplitButton(props),
|
|
58
|
+
'iui-header-dropdown-button': !isSplitButton(props) && isDropdownButton(props),
|
|
58
59
|
'iui-active': isActive,
|
|
59
60
|
}, className), 'aria-current': isActive ? 'location' : undefined, children: (React.createElement(React.Fragment, null,
|
|
60
61
|
React.createElement("div", null, name),
|
|
@@ -76,10 +76,10 @@ export var InformationPanel = React.forwardRef(function (props, ref) {
|
|
|
76
76
|
}
|
|
77
77
|
var _a = infoPanelRef.current.getBoundingClientRect(), right = _a.right, bottom = _a.bottom;
|
|
78
78
|
if (orientation === 'vertical') {
|
|
79
|
-
infoPanelRef.current.style.width = right - e.clientX
|
|
79
|
+
infoPanelRef.current.style.width = "".concat(right - e.clientX, "px");
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
infoPanelRef.current.style.height = bottom - e.clientY
|
|
82
|
+
infoPanelRef.current.style.height = "".concat(bottom - e.clientY, "px");
|
|
83
83
|
}
|
|
84
84
|
}, [orientation]);
|
|
85
85
|
return (React.createElement("div", __assign({ className: cx('iui-information-panel', {
|
package/esm/core/Input/Input.js
CHANGED
|
@@ -46,6 +46,6 @@ export var Input = React.forwardRef(function (props, ref) {
|
|
|
46
46
|
inputRef.current.focus();
|
|
47
47
|
}
|
|
48
48
|
}, [setFocus]);
|
|
49
|
-
return (React.createElement("input", __assign({ className: cx('iui-input', (_a = {}, _a["iui-"
|
|
49
|
+
return (React.createElement("input", __assign({ className: cx('iui-input', (_a = {}, _a["iui-".concat(size)] = !!size, _a), className), ref: refs }, rest)));
|
|
50
50
|
});
|
|
51
51
|
export default Input;
|
package/esm/core/Menu/Menu.js
CHANGED
|
@@ -40,9 +40,14 @@ export var Menu = React.forwardRef(function (props, ref) {
|
|
|
40
40
|
React.useEffect(function () {
|
|
41
41
|
setFocusedIndex(null);
|
|
42
42
|
}, [children]);
|
|
43
|
+
var getFocusableNodes = React.useCallback(function () {
|
|
44
|
+
var focusableItems = getFocusableElements(menuRef.current);
|
|
45
|
+
// Filter out focusable elements that are inside each menu item, e.g. checkbox, anchor
|
|
46
|
+
return focusableItems.filter(function (i) { return !focusableItems.some(function (p) { return p.contains(i.parentElement); }); });
|
|
47
|
+
}, []);
|
|
43
48
|
React.useEffect(function () {
|
|
44
49
|
var _a;
|
|
45
|
-
var items =
|
|
50
|
+
var items = getFocusableNodes();
|
|
46
51
|
if (focusedIndex != null) {
|
|
47
52
|
(_a = items === null || items === void 0 ? void 0 : items[focusedIndex]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
48
53
|
return;
|
|
@@ -51,9 +56,9 @@ export var Menu = React.forwardRef(function (props, ref) {
|
|
|
51
56
|
if (setFocus) {
|
|
52
57
|
setFocusedIndex(selectedIndex > -1 ? selectedIndex : 0);
|
|
53
58
|
}
|
|
54
|
-
}, [setFocus, focusedIndex]);
|
|
59
|
+
}, [setFocus, focusedIndex, getFocusableNodes]);
|
|
55
60
|
var onKeyDown = function (event) {
|
|
56
|
-
var items =
|
|
61
|
+
var items = getFocusableNodes();
|
|
57
62
|
if (!(items === null || items === void 0 ? void 0 : items.length)) {
|
|
58
63
|
return;
|
|
59
64
|
}
|
|
@@ -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
|
|
@@ -49,13 +49,13 @@ export var ProgressLinear = function (props) {
|
|
|
49
49
|
useTheme();
|
|
50
50
|
var boundedValue = Math.min(100, Math.max(0, value));
|
|
51
51
|
return (React.createElement("div", __assign({ className: cx('iui-progress-indicator-linear', (_a = {},
|
|
52
|
-
_a["iui-"
|
|
52
|
+
_a["iui-".concat(status)] = !!status,
|
|
53
53
|
_a), className), style: style }, rest),
|
|
54
54
|
React.createElement("div", { className: 'iui-track' },
|
|
55
55
|
React.createElement("div", { className: cx('iui-fill', {
|
|
56
56
|
'iui-determinate': !indeterminate && isAnimated,
|
|
57
57
|
'iui-indeterminate': indeterminate,
|
|
58
|
-
}), style: { width: indeterminate ? '100%' : boundedValue
|
|
58
|
+
}), style: { width: indeterminate ? '100%' : "".concat(boundedValue, "%") } })),
|
|
59
59
|
labels.length > 0 && (React.createElement("div", { className: 'iui-label' }, labels.map(function (label, index) { return (React.createElement("span", { key: index }, label)); })))));
|
|
60
60
|
};
|
|
61
61
|
export default ProgressLinear;
|
|
@@ -63,8 +63,8 @@ export var ProgressRadial = function (props) {
|
|
|
63
63
|
'iui-determinate': !indeterminate,
|
|
64
64
|
'iui-indeterminate': indeterminate
|
|
65
65
|
},
|
|
66
|
-
_a["iui-"
|
|
67
|
-
_a["iui-"
|
|
66
|
+
_a["iui-".concat(size)] = !!size,
|
|
67
|
+
_a["iui-".concat(status)] = !!status,
|
|
68
68
|
_a), className), style: style }, rest),
|
|
69
69
|
React.createElement("svg", { className: 'iui-radial', viewBox: '0 0 32 32', "aria-hidden": 'true' },
|
|
70
70
|
React.createElement("circle", { className: 'iui-track', cx: '16', cy: '16', r: '14' }),
|
package/esm/core/Radio/Radio.js
CHANGED
|
@@ -50,7 +50,7 @@ export var Radio = React.forwardRef(function (props, ref) {
|
|
|
50
50
|
}
|
|
51
51
|
}, [setFocus]);
|
|
52
52
|
var radio = (React.createElement("input", __assign({ className: cx('iui-radio', className && (_a = {}, _a[className] = !label, _a), checkmarkClassName), style: __assign(__assign({}, (!label && style)), checkmarkStyle), disabled: disabled, type: 'radio', ref: refs }, rest)));
|
|
53
|
-
return !label ? (radio) : (React.createElement("label", { className: cx('iui-radio-wrapper', (_b = { 'iui-disabled': disabled }, _b["iui-"
|
|
53
|
+
return !label ? (radio) : (React.createElement("label", { className: cx('iui-radio-wrapper', (_b = { 'iui-disabled': disabled }, _b["iui-".concat(status)] = !!status, _b), className), style: style },
|
|
54
54
|
radio,
|
|
55
55
|
label && React.createElement("span", { className: 'iui-radio-label' }, label)));
|
|
56
56
|
});
|
|
@@ -127,7 +127,7 @@ export var Select = function (props) {
|
|
|
127
127
|
return options.map(function (option, index) {
|
|
128
128
|
var isSelected = value === option.value;
|
|
129
129
|
var menuItem = itemRenderer ? (itemRenderer(option, { close: close, isSelected: isSelected })) : (React.createElement(MenuItem, null, option.label));
|
|
130
|
-
return React.cloneElement(menuItem, __assign(__assign({ key: option.label
|
|
130
|
+
return React.cloneElement(menuItem, __assign(__assign({ key: "".concat(option.label, "-").concat(index), isSelected: isSelected, onClick: function () {
|
|
131
131
|
!option.disabled && (onChange === null || onChange === void 0 ? void 0 : onChange(option.value));
|
|
132
132
|
close();
|
|
133
133
|
}, ref: function (el) { return isSelected && (el === null || el === void 0 ? void 0 : el.scrollIntoView()); }, role: 'option' }, option), menuItem.props));
|
|
@@ -140,7 +140,7 @@ export var Select = function (props) {
|
|
|
140
140
|
return options.find(function (option) { return option.value === value; });
|
|
141
141
|
}, [options, value]);
|
|
142
142
|
return (React.createElement("div", __assign({ className: cx('iui-input-with-icon', className), "aria-expanded": isOpen, "aria-haspopup": 'listbox', style: style }, rest),
|
|
143
|
-
React.createElement(DropdownMenu, __assign({ menuItems: menuItems, placement: 'bottom-start', className: cx('iui-scroll', menuClassName), style: __assign({ minWidth: minWidth, maxWidth: "min("
|
|
143
|
+
React.createElement(DropdownMenu, __assign({ menuItems: menuItems, placement: 'bottom-start', className: cx('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) {
|
|
144
144
|
var _b;
|
|
145
145
|
var target = _a.target;
|
|
146
146
|
if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
|
|
@@ -151,7 +151,7 @@ export var Select = function (props) {
|
|
|
151
151
|
'iui-placeholder': !selectedItem && !!placeholder,
|
|
152
152
|
'iui-disabled': disabled
|
|
153
153
|
},
|
|
154
|
-
_a["iui-"
|
|
154
|
+
_a["iui-".concat(size)] = !!size,
|
|
155
155
|
_a)), onClick: function () { return !disabled && toggle(); }, onKeyDown: function (e) { return !disabled && onKeyDown(e, toggle); }, tabIndex: !disabled ? 0 : undefined },
|
|
156
156
|
!selectedItem && React.createElement("span", { className: 'iui-content' }, placeholder),
|
|
157
157
|
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,44 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import cx from 'classnames';
|
|
29
|
+
import { useTheme } from '../utils';
|
|
30
|
+
import '@itwin/itwinui-css/css/skip-to-content.css';
|
|
31
|
+
/**
|
|
32
|
+
* `SkipToContentLink` is for screen reader and keyboard users and will not be visible unless tabbed to.
|
|
33
|
+
* Provides a shortcut to the main content of the page without navigating through the header, etc.
|
|
34
|
+
* Should be placed just inside the body. Set `href` to the id of your main content component. Don't forget the `#`!
|
|
35
|
+
* @example
|
|
36
|
+
* <body><SkipToContentLink href='#main-content-id' /> ... </body>
|
|
37
|
+
* <body><SkipToContentLink href='#main-content-id'>{localizedLabel}</SkipToContentLink> ... </body>
|
|
38
|
+
*/
|
|
39
|
+
export var SkipToContentLink = React.forwardRef(function (props, ref) {
|
|
40
|
+
var _a = props.children, children = _a === void 0 ? 'Skip to main content' : _a, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
41
|
+
useTheme();
|
|
42
|
+
return (React.createElement("a", __assign({ ref: ref, className: cx('iui-skip-to-content-link', className) }, rest), children));
|
|
43
|
+
});
|
|
44
|
+
export default SkipToContentLink;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { SkipToContentLink } from './SkipToContentLink';
|
|
6
|
+
export default './SkipToContentLink';
|
|
@@ -74,7 +74,7 @@ var focusThumb = function (sliderContainer, activeIndex) {
|
|
|
74
74
|
var doc = sliderContainer.ownerDocument;
|
|
75
75
|
if (!sliderContainer.contains(doc.activeElement) ||
|
|
76
76
|
Number((_a = doc.activeElement) === null || _a === void 0 ? void 0 : _a.getAttribute('data-index')) !== activeIndex) {
|
|
77
|
-
var thumbToFocus = sliderContainer.querySelector("[data-index=\""
|
|
77
|
+
var thumbToFocus = sliderContainer.querySelector("[data-index=\"".concat(activeIndex, "\"]"));
|
|
78
78
|
thumbToFocus && thumbToFocus.focus();
|
|
79
79
|
}
|
|
80
80
|
};
|
package/esm/core/Slider/Thumb.js
CHANGED
|
@@ -67,5 +67,5 @@ export var Thumb = function (props) {
|
|
|
67
67
|
var leftPercent = (100.0 * (value - sliderMin)) / (sliderMax - sliderMin);
|
|
68
68
|
var _c = thumbProps || {}, style = _c.style, className = _c.className, rest = __rest(_c, ["style", "className"]);
|
|
69
69
|
return (React.createElement(Tooltip, __assign({ visible: isActive || hasFocus || isHovered, placement: 'top' }, tooltipProps),
|
|
70
|
-
React.createElement("div", __assign({}, rest, { "data-index": index, ref: thumbRef, style: __assign(__assign({}, style), { left: leftPercent
|
|
70
|
+
React.createElement("div", __assign({}, rest, { "data-index": index, ref: thumbRef, style: __assign(__assign({}, style), { left: "".concat(leftPercent, "%") }), className: cx('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); } }))));
|
|
71
71
|
};
|
package/esm/core/Slider/Track.js
CHANGED
|
@@ -49,6 +49,6 @@ export var Track = function (props) {
|
|
|
49
49
|
var leftPercent = (100.0 * (segment.left - sliderMin)) / (sliderMax - sliderMin);
|
|
50
50
|
var rightPercent = (100.0 * (segment.right - sliderMin)) / (sliderMax - sliderMin);
|
|
51
51
|
rightPercent = 100.0 - rightPercent;
|
|
52
|
-
return (React.createElement(React.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (React.createElement("div", { className: 'iui-slider-track', style: { left: leftPercent
|
|
52
|
+
return (React.createElement(React.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (React.createElement("div", { className: 'iui-slider-track', style: { left: "".concat(leftPercent, "%"), right: "".concat(rightPercent, "%") } })) : null));
|
|
53
53
|
})));
|
|
54
54
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonProps } from '../utils';
|
|
3
|
+
import '@itwin/itwinui-css/css/surface.css';
|
|
4
|
+
export declare type SurfaceProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Sets the elevation of the surface
|
|
7
|
+
* @default 0
|
|
8
|
+
*/
|
|
9
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
10
|
+
/**
|
|
11
|
+
* Content in the surface.
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
} & Omit<CommonProps, 'title'>;
|
|
15
|
+
/**
|
|
16
|
+
* The Surface container allows content to appear elevated through the use of a drop shadow
|
|
17
|
+
* @example
|
|
18
|
+
* <Surface>Surface Content</Surface>
|
|
19
|
+
* <Surface elevation={2}>Surface Content</Surface>
|
|
20
|
+
*/
|
|
21
|
+
export declare const Surface: React.ForwardRefExoticComponent<{
|
|
22
|
+
/**
|
|
23
|
+
* Sets the elevation of the surface
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 5 | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Content in the surface.
|
|
29
|
+
*/
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
} & Omit<CommonProps, "title"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export default Surface;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import cx from 'classnames';
|
|
29
|
+
import { useTheme, getWindow } from '../utils';
|
|
30
|
+
import '@itwin/itwinui-css/css/surface.css';
|
|
31
|
+
/**
|
|
32
|
+
* Helper function that returns one of the preset surface elevation values.
|
|
33
|
+
*/
|
|
34
|
+
var getSurfaceElevationValue = function (elevation) {
|
|
35
|
+
switch (elevation) {
|
|
36
|
+
case 1:
|
|
37
|
+
return '0 1px 5px rgba(0, 0, 0, 0.25)';
|
|
38
|
+
case 2:
|
|
39
|
+
return '0 1px 10px rgba(0, 0, 0, 0.25)';
|
|
40
|
+
case 3:
|
|
41
|
+
return '0 3px 14px rgba(0, 0, 0, 0.25)';
|
|
42
|
+
case 4:
|
|
43
|
+
return '0 6px 30px rgba(0, 0, 0, 0.25)';
|
|
44
|
+
case 5:
|
|
45
|
+
return '0 9px 46px rgba(0, 0, 0, 0.25)';
|
|
46
|
+
default:
|
|
47
|
+
return 'none';
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* The Surface container allows content to appear elevated through the use of a drop shadow
|
|
52
|
+
* @example
|
|
53
|
+
* <Surface>Surface Content</Surface>
|
|
54
|
+
* <Surface elevation={2}>Surface Content</Surface>
|
|
55
|
+
*/
|
|
56
|
+
export var Surface = React.forwardRef(function (props, ref) {
|
|
57
|
+
var _a, _b, _c;
|
|
58
|
+
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"]);
|
|
59
|
+
useTheme();
|
|
60
|
+
var _style = ((_c = (_b = (_a = 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))))
|
|
61
|
+
? __assign({ '--iui-surface-elevation': getSurfaceElevationValue(elevation) }, style) : __assign({ boxShadow: getSurfaceElevationValue(elevation) }, style);
|
|
62
|
+
return (React.createElement("div", __assign({ className: cx('iui-surface', className), style: _style, ref: ref }, rest), children));
|
|
63
|
+
});
|
|
64
|
+
export default Surface;
|