@itwin/itwinui-react 1.36.0 → 1.37.2
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 +27 -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/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 +6 -0
- package/cjs/core/Table/Table.js +34 -12
- 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/hooks/useSelectionCell.d.ts +1 -1
- package/cjs/core/Table/hooks/useSelectionCell.js +3 -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/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 +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/index.d.ts +4 -0
- package/cjs/core/index.js +6 -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/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/Header/HeaderButton.js +1 -0
- 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/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 +6 -0
- package/esm/core/Table/Table.js +34 -12
- 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/hooks/useSelectionCell.d.ts +1 -1
- package/esm/core/Table/hooks/useSelectionCell.js +3 -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/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 +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/index.d.ts +4 -0
- package/esm/core/index.js +2 -0
- 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 +22 -21
package/cjs/core/index.d.ts
CHANGED
|
@@ -62,10 +62,14 @@ export { Select } from './Select';
|
|
|
62
62
|
export type { SelectProps, SelectOption, ItemRendererProps } from './Select';
|
|
63
63
|
export { SideNavigation, SidenavButton, SidenavSubmenu, SidenavSubmenuHeader, } from './SideNavigation';
|
|
64
64
|
export type { SideNavigationProps, SidenavButtonProps, SidenavSubmenuProps, SidenavSubmenuHeaderProps, } from './SideNavigation';
|
|
65
|
+
export { SkipToContentLink } from './SkipToContentLink';
|
|
66
|
+
export type { SkipToContentLinkProps } from './SkipToContentLink';
|
|
65
67
|
export { Slider } from './Slider';
|
|
66
68
|
export type { SliderProps } from './Slider';
|
|
67
69
|
export { StatusMessage } from './StatusMessage';
|
|
68
70
|
export type { StatusMessageProps } from './StatusMessage';
|
|
71
|
+
export { Surface } from './Surface';
|
|
72
|
+
export type { SurfaceProps } from './Surface';
|
|
69
73
|
export { Table, tableFilters, FilterButtonBar, DefaultCell, EditableCell, TablePaginator, ActionColumn, ExpanderColumn, SelectionColumn, } from './Table';
|
|
70
74
|
export type { TableProps, TableFilterProps, TableFilterValue, DateRangeFilterOptions, FilterButtonBarProps, DefaultCellProps, EditableCellProps, TablePaginatorProps, TablePaginatorRendererProps, } from './Table';
|
|
71
75
|
export { Tag, TagContainer } from './Tag';
|
package/cjs/core/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Modal = exports.MenuExtraContent = exports.MenuDivider = exports.MenuItem = exports.Menu = exports.LabeledTextarea = exports.LabeledSelect = exports.InputGroup = exports.LabeledInput = exports.Label = exports.Input = exports.InformationPanelContent = exports.InformationPanelBody = exports.InformationPanelHeader = exports.InformationPanelWrapper = exports.InformationPanel = exports.HorizontalTab = exports.HorizontalTabs = exports.Tab = exports.VerticalTabs = exports.HeaderLogo = exports.HeaderButton = exports.HeaderBreadcrumbs = exports.Header = exports.Footer = exports.FileUploadTemplate = exports.FileUpload = exports.Fieldset = exports.ExpandableBlock = exports.ErrorPage = exports.DropdownMenu = exports.generateLocalizedStrings = exports.DatePicker = exports.ComboBox = exports.ColorPalette = exports.ColorInputPanel = exports.ColorBuilder = exports.ColorSwatch = exports.ColorPicker = exports.Checkbox = exports.Carousel = exports.ButtonGroup = exports.SplitButton = exports.IdeasButton = exports.IconButton = exports.DropdownButton = exports.Button = exports.Breadcrumbs = exports.Badge = exports.Alert = void 0;
|
|
7
|
-
exports.
|
|
8
|
-
exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = void 0;
|
|
7
|
+
exports.UserIcon = exports.Text = exports.KbdKeys = exports.Kbd = exports.Code = exports.Blockquote = exports.Title = exports.Subheading = exports.Small = exports.Leading = exports.Headline = exports.Body = exports.Anchor = exports.TreeNodeExpander = exports.TreeNode = exports.Tree = exports.Tooltip = exports.ToggleSwitch = exports.ThemeProvider = exports.toaster = exports.TimePicker = exports.Tile = exports.Textarea = exports.TagContainer = exports.Tag = exports.SelectionColumn = exports.ExpanderColumn = exports.ActionColumn = exports.TablePaginator = exports.EditableCell = exports.DefaultCell = exports.FilterButtonBar = exports.tableFilters = exports.Table = exports.Surface = exports.StatusMessage = exports.Slider = exports.SkipToContentLink = exports.SidenavSubmenuHeader = exports.SidenavSubmenu = exports.SidenavButton = exports.SideNavigation = exports.Select = exports.RadioTileGroup = exports.RadioTile = exports.Radio = exports.ProgressRadial = exports.ProgressLinear = exports.ModalContent = exports.ModalButtonBar = void 0;
|
|
8
|
+
exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = void 0;
|
|
9
9
|
/*---------------------------------------------------------------------------------------------
|
|
10
10
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
11
11
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -104,10 +104,14 @@ Object.defineProperty(exports, "SideNavigation", { enumerable: true, get: functi
|
|
|
104
104
|
Object.defineProperty(exports, "SidenavButton", { enumerable: true, get: function () { return SideNavigation_1.SidenavButton; } });
|
|
105
105
|
Object.defineProperty(exports, "SidenavSubmenu", { enumerable: true, get: function () { return SideNavigation_1.SidenavSubmenu; } });
|
|
106
106
|
Object.defineProperty(exports, "SidenavSubmenuHeader", { enumerable: true, get: function () { return SideNavigation_1.SidenavSubmenuHeader; } });
|
|
107
|
+
var SkipToContentLink_1 = require("./SkipToContentLink");
|
|
108
|
+
Object.defineProperty(exports, "SkipToContentLink", { enumerable: true, get: function () { return SkipToContentLink_1.SkipToContentLink; } });
|
|
107
109
|
var Slider_1 = require("./Slider");
|
|
108
110
|
Object.defineProperty(exports, "Slider", { enumerable: true, get: function () { return Slider_1.Slider; } });
|
|
109
111
|
var StatusMessage_1 = require("./StatusMessage");
|
|
110
112
|
Object.defineProperty(exports, "StatusMessage", { enumerable: true, get: function () { return StatusMessage_1.StatusMessage; } });
|
|
113
|
+
var Surface_1 = require("./Surface");
|
|
114
|
+
Object.defineProperty(exports, "Surface", { enumerable: true, get: function () { return Surface_1.Surface; } });
|
|
111
115
|
var Table_1 = require("./Table");
|
|
112
116
|
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return Table_1.Table; } });
|
|
113
117
|
Object.defineProperty(exports, "tableFilters", { enumerable: true, get: function () { return Table_1.tableFilters; } });
|
|
@@ -334,9 +334,9 @@ var ColorValue = /** @class */ (function () {
|
|
|
334
334
|
if (value < 0) {
|
|
335
335
|
value = 0xffffffff + value + 1;
|
|
336
336
|
}
|
|
337
|
-
return "#"
|
|
337
|
+
return "#".concat("00000000".concat(value.toString(16)).slice(-8));
|
|
338
338
|
}
|
|
339
|
-
return "#"
|
|
339
|
+
return "#".concat("000000".concat(this.getRgb().toString(16)).slice(-6));
|
|
340
340
|
};
|
|
341
341
|
/**
|
|
342
342
|
* Compute the 0xTTBBGGRR color corresponding to the specified hue, saturation, lightness values.
|
|
@@ -496,34 +496,34 @@ var ColorValue = /** @class */ (function () {
|
|
|
496
496
|
ColorValue.prototype.toRgbString = function (includeAlpha) {
|
|
497
497
|
var _a;
|
|
498
498
|
var rgb = this.toRgbColor();
|
|
499
|
-
var rgbString = rgb.r
|
|
499
|
+
var rgbString = "".concat(rgb.r, ", ").concat(rgb.g, ", ").concat(rgb.b);
|
|
500
500
|
if (includeAlpha) {
|
|
501
501
|
var alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
|
|
502
|
-
return "rgba("
|
|
502
|
+
return "rgba(".concat(rgbString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
|
|
503
503
|
}
|
|
504
|
-
return "rgb("
|
|
504
|
+
return "rgb(".concat(rgbString, ")");
|
|
505
505
|
};
|
|
506
506
|
/** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
|
|
507
507
|
ColorValue.prototype.toHslString = function (includeAlpha) {
|
|
508
508
|
var _a, _b;
|
|
509
509
|
var hsl = this.toHslColor();
|
|
510
|
-
var hslString = ColorValue.getFormattedColorNumber((_a = this._hue) !== null && _a !== void 0 ? _a : hsl.h)
|
|
510
|
+
var hslString = "".concat(ColorValue.getFormattedColorNumber((_a = this._hue) !== null && _a !== void 0 ? _a : hsl.h), ", ").concat(ColorValue.getFormattedColorNumber(hsl.s), "%, ").concat(ColorValue.getFormattedColorNumber(hsl.l), "%");
|
|
511
511
|
if (includeAlpha) {
|
|
512
512
|
var alpha = (_b = hsl.a) !== null && _b !== void 0 ? _b : 1;
|
|
513
|
-
return "hsla("
|
|
513
|
+
return "hsla(".concat(hslString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
|
|
514
514
|
}
|
|
515
|
-
return "hsl("
|
|
515
|
+
return "hsl(".concat(hslString, ")");
|
|
516
516
|
};
|
|
517
517
|
/** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
|
|
518
518
|
ColorValue.prototype.toHsvString = function (includeAlpha) {
|
|
519
519
|
var _a, _b;
|
|
520
520
|
var hsv = this.toHsvColor();
|
|
521
|
-
var hsvString = ((_a = this._hue) !== null && _a !== void 0 ? _a : hsv.h
|
|
521
|
+
var hsvString = "".concat((_a = this._hue) !== null && _a !== void 0 ? _a : hsv.h, ", ").concat(hsv.s, "%, ").concat(hsv.v, "%");
|
|
522
522
|
if (includeAlpha) {
|
|
523
523
|
var alpha = (_b = hsv.a) !== null && _b !== void 0 ? _b : 1;
|
|
524
|
-
return "hsva("
|
|
524
|
+
return "hsva(".concat(hsvString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
|
|
525
525
|
}
|
|
526
|
-
return "hsv("
|
|
526
|
+
return "hsv(".concat(hsvString, ")");
|
|
527
527
|
};
|
|
528
528
|
return ColorValue;
|
|
529
529
|
}());
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -25,23 +25,21 @@ var FocusTrap = function (props) {
|
|
|
25
25
|
return [firstElement, lastElement];
|
|
26
26
|
};
|
|
27
27
|
var onFirstFocus = function (event) {
|
|
28
|
-
var _a,
|
|
29
|
-
var _c = getFirstLastFocusables(), firstElement = _c[0], lastElement = _c[1];
|
|
28
|
+
var _a = getFirstLastFocusables(), firstElement = _a[0], lastElement = _a[1];
|
|
30
29
|
if (event.relatedTarget === firstElement) {
|
|
31
|
-
|
|
30
|
+
lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
|
|
32
31
|
}
|
|
33
32
|
else {
|
|
34
|
-
|
|
33
|
+
firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
36
|
var onLastFocus = function (event) {
|
|
38
|
-
var _a,
|
|
39
|
-
var _c = getFirstLastFocusables(), firstElement = _c[0], lastElement = _c[1];
|
|
37
|
+
var _a = getFirstLastFocusables(), firstElement = _a[0], lastElement = _a[1];
|
|
40
38
|
if (event.relatedTarget === lastElement) {
|
|
41
|
-
|
|
39
|
+
firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|
|
42
40
|
}
|
|
43
41
|
else {
|
|
44
|
-
|
|
42
|
+
lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
|
|
45
43
|
}
|
|
46
44
|
};
|
|
47
45
|
return (react_1.default.createElement("div", null,
|
|
@@ -43,7 +43,7 @@ var InputContainer = function (props) {
|
|
|
43
43
|
return (react_1.default.createElement(Element, __assign({ className: (0, classnames_1.default)('iui-input-container', (_a = {
|
|
44
44
|
'iui-disabled': disabled
|
|
45
45
|
},
|
|
46
|
-
_a["iui-"
|
|
46
|
+
_a["iui-".concat(status)] = !!status,
|
|
47
47
|
_a['iui-inline-label'] = isLabelInline,
|
|
48
48
|
_a['iui-inline-icon'] = isIconInline,
|
|
49
49
|
_a['iui-with-message'] = (!!message || !!icon || !!statusMessage) && !isLabelInline,
|
|
@@ -44,7 +44,7 @@ var MiddleTextTruncation = function (props) {
|
|
|
44
44
|
var _b = (0, useOverflow_1.useOverflow)(text), ref = _b[0], visibleCount = _b[1];
|
|
45
45
|
var truncatedText = react_1.default.useMemo(function () {
|
|
46
46
|
if (visibleCount < text.length) {
|
|
47
|
-
return ""
|
|
47
|
+
return "".concat(text.substr(0, visibleCount - endCharsCount - ELLIPSIS_CHAR.length)).concat(ELLIPSIS_CHAR).concat(text.substr(text.length - endCharsCount));
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
50
|
return text;
|
|
@@ -137,7 +137,7 @@ exports.VirtualScroll = react_1.default.forwardRef(function (_a, ref) {
|
|
|
137
137
|
if (!parentRef.current) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
|
-
parentRef.current.style.transform = "translateY("
|
|
140
|
+
parentRef.current.style.transform = "translateY(".concat(getTranslateValue(childHeight.current, startIndex), "px)");
|
|
141
141
|
}, [bufferSize, itemsLength]);
|
|
142
142
|
var removeScrollListener = react_1.default.useCallback(function () {
|
|
143
143
|
var _a, _b;
|
|
@@ -37,17 +37,17 @@ var WithCSSTransition = function (props) {
|
|
|
37
37
|
var expandedSize = react_1.default.useRef(0);
|
|
38
38
|
var dimensionCamelCase = dimension === 'height' ? 'Height' : 'Width';
|
|
39
39
|
return (react_1.default.createElement(react_transition_group_1.CSSTransition, __assign({ in: visible, timeout: 200, unmountOnExit: true, onEnter: function (node) {
|
|
40
|
-
node.style["min"
|
|
40
|
+
node.style["min".concat(dimensionCamelCase)] = 'initial';
|
|
41
41
|
node.style[dimension] = '0px';
|
|
42
42
|
}, onEntering: function (node) {
|
|
43
|
-
node.style[dimension] = expandedSize.current
|
|
43
|
+
node.style[dimension] = "".concat(expandedSize.current, "px");
|
|
44
44
|
}, onEntered: function (node) {
|
|
45
|
-
node.style["min"
|
|
45
|
+
node.style["min".concat(dimensionCamelCase)] = '';
|
|
46
46
|
node.style[dimension] = '';
|
|
47
47
|
}, onExit: function (node) {
|
|
48
|
-
node.style[dimension] = expandedSize.current
|
|
48
|
+
node.style[dimension] = "".concat(expandedSize.current, "px");
|
|
49
49
|
}, onExiting: function (node) {
|
|
50
|
-
node.style["min"
|
|
50
|
+
node.style["min".concat(dimensionCamelCase)] = 'initial';
|
|
51
51
|
node.style[dimension] = '0px';
|
|
52
52
|
}, classNames: 'iui' }, rest), react_1.default.cloneElement(children, {
|
|
53
53
|
ref: function (el) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,7 +28,7 @@ var getFocusableElements = function (container) {
|
|
|
28
28
|
if (!container) {
|
|
29
29
|
return [];
|
|
30
30
|
}
|
|
31
|
-
var elements = container.querySelectorAll(tabbableElementsSelector
|
|
31
|
+
var elements = container.querySelectorAll("".concat(tabbableElementsSelector, ", [tabindex=\"-1\"]"));
|
|
32
32
|
return Array.from(elements).filter(function (el) {
|
|
33
33
|
return !el.hasAttribute('disabled') &&
|
|
34
34
|
!el.classList.contains('iui-disabled') &&
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -67,15 +67,15 @@ var useOverflow = function (items, disabled, orientation) {
|
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
var dimension = orientation === 'horizontal' ? 'Width' : 'Height';
|
|
70
|
-
var availableSize = containerRef.current["offset"
|
|
71
|
-
var requiredSize = containerRef.current["scroll"
|
|
70
|
+
var availableSize = containerRef.current["offset".concat(dimension)];
|
|
71
|
+
var requiredSize = containerRef.current["scroll".concat(dimension)];
|
|
72
72
|
if (availableSize < requiredSize) {
|
|
73
73
|
var avgItemSize = requiredSize / visibleCount;
|
|
74
74
|
var visibleItems = Math.floor(availableSize / avgItemSize);
|
|
75
75
|
setVisibleCount(visibleItems);
|
|
76
76
|
}
|
|
77
77
|
else if (needsFullRerender.current) {
|
|
78
|
-
var childrenSize = Array.from(containerRef.current.children).reduce(function (sum, child) { return sum + child["offset"
|
|
78
|
+
var childrenSize = Array.from(containerRef.current.children).reduce(function (sum, child) { return sum + child["offset".concat(dimension)]; }, 0);
|
|
79
79
|
var avgItemSize = childrenSize / visibleCount;
|
|
80
80
|
var visibleItems = Math.floor(availableSize / avgItemSize);
|
|
81
81
|
// Doubling the visible items to overflow the container. Just to be safe.
|
package/cjs/core/utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/esm/core/Alert/Alert.js
CHANGED
|
@@ -43,7 +43,7 @@ export var Alert = function (props) {
|
|
|
43
43
|
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"]);
|
|
44
44
|
useTheme();
|
|
45
45
|
var StatusIcon = StatusIconMap[type];
|
|
46
|
-
return (React.createElement("div", __assign({ className: cx('iui-alert', "iui-"
|
|
46
|
+
return (React.createElement("div", __assign({ className: cx('iui-alert', "iui-".concat(type), { 'iui-sticky': isSticky }, className), style: style }, rest),
|
|
47
47
|
React.createElement(StatusIcon, { className: 'iui-alert-icon' }),
|
|
48
48
|
React.createElement("span", { className: 'iui-alert-message' },
|
|
49
49
|
children,
|
package/esm/core/Badge/Badge.js
CHANGED
|
@@ -60,7 +60,7 @@ export var Badge = function (props) {
|
|
|
60
60
|
var backgroundColor = props.backgroundColor, style = props.style, className = props.className, children = props.children, rest = __rest(props, ["backgroundColor", "style", "className", "children"]);
|
|
61
61
|
useTheme();
|
|
62
62
|
var _style = backgroundColor &&
|
|
63
|
-
((_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-badge-background-color: "
|
|
63
|
+
((_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-badge-background-color: ".concat(backgroundColor)))
|
|
64
64
|
? __assign({ '--iui-badge-background-color': getBadgeColorValue(backgroundColor) }, style) : __assign({ backgroundColor: getBadgeColorValue(backgroundColor) }, style);
|
|
65
65
|
return (React.createElement("span", __assign({ className: cx('iui-badge', className), style: _style }, rest), children));
|
|
66
66
|
};
|
|
@@ -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.
|
|
@@ -41,8 +41,8 @@ export var Button = React.forwardRef(function (props, ref) {
|
|
|
41
41
|
var _a;
|
|
42
42
|
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"]);
|
|
43
43
|
useTheme();
|
|
44
|
-
return (React.createElement(Element, __assign({ ref: ref, className: cx('iui-button', "iui-"
|
|
45
|
-
_a["iui-"
|
|
44
|
+
return (React.createElement(Element, __assign({ ref: ref, className: cx('iui-button', "iui-".concat(styleType), (_a = {},
|
|
45
|
+
_a["iui-".concat(size)] = !!size,
|
|
46
46
|
_a), className), style: style, type: type }, rest),
|
|
47
47
|
startIcon &&
|
|
48
48
|
React.cloneElement(startIcon, {
|
|
@@ -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" | "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;
|
|
@@ -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' },
|