@itwin/itwinui-react 1.38.1 → 1.40.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 +30 -0
- package/cjs/core/Carousel/Carousel.js +21 -12
- package/cjs/core/Carousel/CarouselContext.d.ts +4 -2
- package/cjs/core/Carousel/CarouselDotsList.js +1 -0
- package/cjs/core/Carousel/CarouselNavigation.js +8 -10
- package/cjs/core/Carousel/CarouselSlide.js +3 -7
- package/cjs/core/Carousel/CarouselSlider.js +23 -28
- package/cjs/core/ColorPicker/ColorPickerContext.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBox.d.ts +10 -1
- package/cjs/core/ComboBox/ComboBox.js +39 -20
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +5 -6
- package/cjs/core/ComboBox/ComboBoxInput.js +28 -9
- package/cjs/core/ComboBox/ComboBoxMenu.js +10 -2
- package/cjs/core/ComboBox/helpers.d.ts +1 -1
- package/cjs/core/ComboBox/helpers.js +1 -1
- package/cjs/core/DatePicker/DatePicker.d.ts +1 -1
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +32 -0
- package/cjs/core/Menu/MenuItemSkeleton.js +53 -0
- package/cjs/core/Menu/index.d.ts +2 -0
- package/cjs/core/Menu/index.js +3 -1
- package/cjs/core/Table/Table.js +68 -25
- package/cjs/core/Table/TableCell.js +10 -3
- package/cjs/core/Table/TablePaginator.js +1 -1
- package/cjs/core/Table/TableRowMemoized.js +5 -1
- package/cjs/core/Table/actionHandlers/resizeHandler.d.ts +8 -0
- package/cjs/core/Table/actionHandlers/selectHandler.d.ts +4 -0
- package/cjs/core/Table/columns/selectionColumn.js +4 -2
- package/cjs/core/Table/filters/tableFilters.d.ts +3 -3
- package/cjs/core/Table/hooks/index.d.ts +1 -0
- package/cjs/core/Table/hooks/index.js +3 -1
- package/cjs/core/Table/hooks/useExpanderCell.js +11 -1
- package/cjs/core/Table/hooks/useStickyColumns.d.ts +2 -0
- package/cjs/core/Table/hooks/useStickyColumns.js +84 -0
- package/cjs/core/Table/utils.d.ts +1 -0
- package/cjs/core/Table/utils.js +36 -1
- package/cjs/core/Toast/Toaster.js +97 -18
- package/cjs/core/index.d.ts +2 -2
- package/cjs/core/index.js +4 -3
- package/cjs/core/utils/components/Popover.d.ts +1 -18
- package/cjs/core/utils/components/VirtualScroll.js +2 -2
- package/cjs/core/utils/components/VisuallyHidden.d.ts +9 -0
- package/cjs/core/utils/components/VisuallyHidden.js +44 -0
- package/cjs/core/utils/components/WithCSSTransition.d.ts +1 -2
- package/cjs/core/utils/components/icons.d.ts +4 -4
- package/cjs/core/utils/components/index.d.ts +1 -0
- package/cjs/core/utils/components/index.js +1 -0
- package/cjs/core/utils/hooks/useOverflow.js +4 -2
- package/cjs/core/utils/hooks/useTheme.d.ts +1 -1
- package/cjs/types/react-table-config.d.ts +9 -0
- package/esm/core/Carousel/Carousel.js +21 -12
- package/esm/core/Carousel/CarouselContext.d.ts +4 -2
- package/esm/core/Carousel/CarouselDotsList.js +1 -0
- package/esm/core/Carousel/CarouselNavigation.js +8 -10
- package/esm/core/Carousel/CarouselSlide.js +3 -7
- package/esm/core/Carousel/CarouselSlider.js +24 -29
- package/esm/core/ColorPicker/ColorPickerContext.d.ts +2 -2
- package/esm/core/ComboBox/ComboBox.d.ts +10 -1
- package/esm/core/ComboBox/ComboBox.js +39 -20
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +5 -6
- package/esm/core/ComboBox/ComboBoxInput.js +28 -9
- package/esm/core/ComboBox/ComboBoxMenu.js +10 -2
- package/esm/core/ComboBox/helpers.d.ts +1 -1
- package/esm/core/ComboBox/helpers.js +1 -1
- package/esm/core/DatePicker/DatePicker.d.ts +1 -1
- package/esm/core/Menu/MenuItemSkeleton.d.ts +32 -0
- package/esm/core/Menu/MenuItemSkeleton.js +46 -0
- package/esm/core/Menu/index.d.ts +2 -0
- package/esm/core/Menu/index.js +1 -0
- package/esm/core/Table/Table.js +70 -27
- package/esm/core/Table/TableCell.js +11 -4
- package/esm/core/Table/TablePaginator.js +1 -1
- package/esm/core/Table/TableRowMemoized.js +5 -1
- package/esm/core/Table/actionHandlers/resizeHandler.d.ts +8 -0
- package/esm/core/Table/actionHandlers/selectHandler.d.ts +4 -0
- package/esm/core/Table/columns/selectionColumn.js +4 -2
- package/esm/core/Table/filters/tableFilters.d.ts +3 -3
- package/esm/core/Table/hooks/index.d.ts +1 -0
- package/esm/core/Table/hooks/index.js +1 -0
- package/esm/core/Table/hooks/useExpanderCell.js +8 -1
- package/esm/core/Table/hooks/useStickyColumns.d.ts +2 -0
- package/esm/core/Table/hooks/useStickyColumns.js +80 -0
- package/esm/core/Table/utils.d.ts +1 -0
- package/esm/core/Table/utils.js +34 -0
- package/esm/core/Toast/Toaster.js +75 -19
- package/esm/core/index.d.ts +2 -2
- package/esm/core/index.js +1 -1
- package/esm/core/utils/components/Popover.d.ts +1 -18
- package/esm/core/utils/components/VirtualScroll.js +2 -2
- package/esm/core/utils/components/VisuallyHidden.d.ts +9 -0
- package/esm/core/utils/components/VisuallyHidden.js +38 -0
- package/esm/core/utils/components/WithCSSTransition.d.ts +1 -2
- package/esm/core/utils/components/icons.d.ts +4 -4
- package/esm/core/utils/components/index.d.ts +1 -0
- package/esm/core/utils/components/index.js +1 -0
- package/esm/core/utils/hooks/useOverflow.js +4 -2
- package/esm/core/utils/hooks/useTheme.d.ts +1 -1
- package/esm/types/react-table-config.d.ts +9 -0
- package/package.json +24 -39
|
@@ -10,6 +10,65 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
+
function step(op) {
|
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
+
while (_) try {
|
|
52
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
+
switch (op[0]) {
|
|
55
|
+
case 0: case 1: t = op; break;
|
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
+
default:
|
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
+
if (t[2]) _.ops.pop();
|
|
65
|
+
_.trys.pop(); continue;
|
|
66
|
+
}
|
|
67
|
+
op = body.call(thisArg, _);
|
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
13
72
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
73
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
74
|
if (ar || !(i in from)) {
|
|
@@ -28,7 +87,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
87
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
29
88
|
*--------------------------------------------------------------------------------------------*/
|
|
30
89
|
var react_1 = __importDefault(require("react"));
|
|
31
|
-
var
|
|
90
|
+
var ReactDOM = __importStar(require("react-dom"));
|
|
32
91
|
var utils_1 = require("../utils");
|
|
33
92
|
var ToastWrapper_1 = require("./ToastWrapper");
|
|
34
93
|
var TOASTS_CONTAINER_ID = 'iui-toasts-container';
|
|
@@ -45,21 +104,41 @@ var Toaster = /** @class */ (function () {
|
|
|
45
104
|
this.isInitialized = false;
|
|
46
105
|
// Create container on demand.
|
|
47
106
|
// Cannot do it in constructor, because SSG/SSR apps would fail.
|
|
48
|
-
this.asyncInit =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
107
|
+
this.asyncInit = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
108
|
+
var container, toastWrapper, _ReactDOM, _ReactDOMInternals, root;
|
|
109
|
+
var _a, _b;
|
|
110
|
+
return __generator(this, function (_c) {
|
|
111
|
+
if (this.isInitialized) {
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
container = (_a = (0, utils_1.getContainer)(TOASTS_CONTAINER_ID)) !== null && _a !== void 0 ? _a : (_b = (0, utils_1.getDocument)()) === null || _b === void 0 ? void 0 : _b.body;
|
|
115
|
+
if (!container) {
|
|
116
|
+
return [2 /*return*/];
|
|
117
|
+
}
|
|
118
|
+
this.isInitialized = true;
|
|
119
|
+
toastWrapper = react_1.default.createElement(ToastWrapper_1.ToastWrapper, { ref: this.toastsRef });
|
|
120
|
+
_ReactDOM = ReactDOM;
|
|
121
|
+
// v18 mode
|
|
122
|
+
if (_ReactDOM.createRoot) {
|
|
123
|
+
_ReactDOMInternals = _ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
124
|
+
// suppress warning about importing createRoot from react-dom/client
|
|
125
|
+
if (_ReactDOMInternals) {
|
|
126
|
+
_ReactDOMInternals.usingClientEntryPoint = true;
|
|
127
|
+
}
|
|
128
|
+
root = _ReactDOM.createRoot(container);
|
|
129
|
+
root.render(toastWrapper);
|
|
130
|
+
// revert suppression, not to influence users app
|
|
131
|
+
if (_ReactDOMInternals) {
|
|
132
|
+
_ReactDOMInternals.usingClientEntryPoint = false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// v17 and before
|
|
137
|
+
ReactDOM.render(toastWrapper, container);
|
|
138
|
+
}
|
|
139
|
+
return [2 /*return*/];
|
|
140
|
+
});
|
|
141
|
+
}); };
|
|
63
142
|
}
|
|
64
143
|
/**
|
|
65
144
|
* Set global Toaster settings for toasts order and placement.
|
|
@@ -73,7 +152,7 @@ var Toaster = /** @class */ (function () {
|
|
|
73
152
|
? 'ascending'
|
|
74
153
|
: 'descending');
|
|
75
154
|
this.settings = newSettings;
|
|
76
|
-
this.asyncInit.then(function () {
|
|
155
|
+
this.asyncInit().then(function () {
|
|
77
156
|
var _a, _b;
|
|
78
157
|
(_a = _this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setPlacement((_b = _this.settings.placement) !== null && _b !== void 0 ? _b : 'top');
|
|
79
158
|
});
|
|
@@ -110,7 +189,7 @@ var Toaster = /** @class */ (function () {
|
|
|
110
189
|
};
|
|
111
190
|
Toaster.prototype.updateView = function () {
|
|
112
191
|
var _this = this;
|
|
113
|
-
this.asyncInit.then(function () {
|
|
192
|
+
this.asyncInit().then(function () {
|
|
114
193
|
var _a;
|
|
115
194
|
(_a = _this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setToasts(_this.toasts);
|
|
116
195
|
});
|
package/cjs/core/index.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ export { LabeledSelect } from './LabeledSelect';
|
|
|
48
48
|
export type { LabeledSelectProps } from './LabeledSelect';
|
|
49
49
|
export { LabeledTextarea } from './LabeledTextarea';
|
|
50
50
|
export type { LabeledTextareaProps } from './LabeledTextarea';
|
|
51
|
-
export { Menu, MenuItem, MenuDivider, MenuExtraContent } from './Menu';
|
|
52
|
-
export type { MenuProps, MenuItemProps, MenuDividerProps, MenuExtraContentProps, } from './Menu';
|
|
51
|
+
export { Menu, MenuItem, MenuDivider, MenuExtraContent, MenuItemSkeleton, } from './Menu';
|
|
52
|
+
export type { MenuProps, MenuItemProps, MenuDividerProps, MenuExtraContentProps, MenuItemSkeletonProps, } from './Menu';
|
|
53
53
|
export { Modal, ModalButtonBar, ModalContent } from './Modal';
|
|
54
54
|
export type { ModalProps, ModalButtonBarProps, ModalContentProps, } from './Modal';
|
|
55
55
|
export { ProgressLinear, ProgressRadial } from './ProgressIndicators';
|
package/cjs/core/index.js
CHANGED
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = void 0;
|
|
6
|
+
exports.MenuItemSkeleton = 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.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 = exports.Modal = void 0;
|
|
8
|
+
exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = exports.UserIcon = 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.
|
|
@@ -85,6 +85,7 @@ Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { re
|
|
|
85
85
|
Object.defineProperty(exports, "MenuItem", { enumerable: true, get: function () { return Menu_1.MenuItem; } });
|
|
86
86
|
Object.defineProperty(exports, "MenuDivider", { enumerable: true, get: function () { return Menu_1.MenuDivider; } });
|
|
87
87
|
Object.defineProperty(exports, "MenuExtraContent", { enumerable: true, get: function () { return Menu_1.MenuExtraContent; } });
|
|
88
|
+
Object.defineProperty(exports, "MenuItemSkeleton", { enumerable: true, get: function () { return Menu_1.MenuItemSkeleton; } });
|
|
88
89
|
var Modal_1 = require("./Modal");
|
|
89
90
|
Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return Modal_1.Modal; } });
|
|
90
91
|
Object.defineProperty(exports, "ModalButtonBar", { enumerable: true, get: function () { return Modal_1.ModalButtonBar; } });
|
|
@@ -26,24 +26,7 @@ export declare type PopoverProps = {
|
|
|
26
26
|
* with pre-configured props and plugins (e.g. lazy mounting, focus, etc).
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
|
-
export declare const Popover: React.ForwardRefExoticComponent<Pick<
|
|
30
|
-
/**
|
|
31
|
-
* Controlled flag for whether the popover is visible.
|
|
32
|
-
*/
|
|
33
|
-
visible?: boolean | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Determines the events that cause the popover to show.
|
|
36
|
-
* Should not be used when `visible` is set.
|
|
37
|
-
* @see [tippy.js trigger prop](https://atomiks.github.io/tippyjs/v6/all-props/#trigger)
|
|
38
|
-
*/
|
|
39
|
-
trigger?: string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Placement of the popover content.
|
|
42
|
-
* @default 'bottom-start'
|
|
43
|
-
* @see [tippy.js placement prop](https://atomiks.github.io/tippyjs/v6/all-props/#placement).
|
|
44
|
-
*/
|
|
45
|
-
placement?: import("@popperjs/core").Placement | undefined;
|
|
46
|
-
} & Omit<TippyProps, "placement" | "trigger" | "visible">, "disabled" | "children" | "placement" | "trigger" | "visible" | "content" | "render" | "animateFill" | "appendTo" | "aria" | "delay" | "duration" | "followCursor" | "getReferenceClientRect" | "hideOnClick" | "ignoreAttributes" | "inlinePositioning" | "interactive" | "interactiveBorder" | "interactiveDebounce" | "moveTransition" | "offset" | "plugins" | "popperOptions" | "showOnCreate" | "sticky" | "touch" | "triggerTarget" | "onAfterUpdate" | "onBeforeUpdate" | "onCreate" | "onDestroy" | "onHidden" | "onHide" | "onMount" | "onShow" | "onShown" | "onTrigger" | "onUntrigger" | "onClickOutside" | "allowHTML" | "animation" | "arrow" | "inertia" | "maxWidth" | "role" | "theme" | "zIndex" | "className" | "singleton" | "reference"> & React.RefAttributes<unknown>>;
|
|
29
|
+
export declare const Popover: React.ForwardRefExoticComponent<Pick<PopoverProps, "disabled" | "children" | "placement" | "trigger" | "visible" | "content" | "render" | "animateFill" | "appendTo" | "aria" | "delay" | "duration" | "followCursor" | "getReferenceClientRect" | "hideOnClick" | "ignoreAttributes" | "inlinePositioning" | "interactive" | "interactiveBorder" | "interactiveDebounce" | "moveTransition" | "offset" | "plugins" | "popperOptions" | "showOnCreate" | "sticky" | "touch" | "triggerTarget" | "onAfterUpdate" | "onBeforeUpdate" | "onCreate" | "onDestroy" | "onHidden" | "onHide" | "onMount" | "onShow" | "onShown" | "onTrigger" | "onUntrigger" | "onClickOutside" | "allowHTML" | "animation" | "arrow" | "inertia" | "maxWidth" | "role" | "theme" | "zIndex" | "className" | "singleton" | "reference"> & React.RefAttributes<unknown>>;
|
|
47
30
|
/**
|
|
48
31
|
* Plugin to hide Popover when either Esc key is pressed,
|
|
49
32
|
* or when the content inside is not tabbable and Tab key is pressed.
|
|
@@ -291,11 +291,11 @@ var useVirtualization = function (props) {
|
|
|
291
291
|
updateVirtualScroll();
|
|
292
292
|
}, [scrollContainerHeight, updateVirtualScroll]);
|
|
293
293
|
return {
|
|
294
|
-
outerProps: __assign({ style: __assign({
|
|
294
|
+
outerProps: __assign({ style: __assign({ minHeight: itemsLength > 1
|
|
295
295
|
? Math.max(itemsLength - 2, 0) * childHeight.current.middle +
|
|
296
296
|
childHeight.current.first +
|
|
297
297
|
childHeight.current.last
|
|
298
|
-
: childHeight.current.middle,
|
|
298
|
+
: childHeight.current.middle, minWidth: '100%' }, style) }, rest),
|
|
299
299
|
innerProps: {
|
|
300
300
|
style: { willChange: 'transform' },
|
|
301
301
|
ref: (0, hooks_1.mergeRefs)(parentRef), // convert object ref to callback ref for better types
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type VisuallyHiddenProps = React.ComponentPropsWithRef<'div'>;
|
|
3
|
+
/**
|
|
4
|
+
* Hides content visually but is still accessible to screen readers.
|
|
5
|
+
*/
|
|
6
|
+
export declare const VisuallyHidden: React.ForwardRefExoticComponent<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
7
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
8
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default VisuallyHidden;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.VisuallyHidden = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
35
|
+
var hooks_1 = require("../hooks");
|
|
36
|
+
/**
|
|
37
|
+
* Hides content visually but is still accessible to screen readers.
|
|
38
|
+
*/
|
|
39
|
+
exports.VisuallyHidden = react_1.default.forwardRef(function (props, ref) {
|
|
40
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
41
|
+
(0, hooks_1.useTheme)();
|
|
42
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-visually-hidden', className), ref: ref }, rest)));
|
|
43
|
+
});
|
|
44
|
+
exports.default = exports.VisuallyHidden;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CSSTransition } from 'react-transition-group';
|
|
3
2
|
import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
4
|
-
export declare const WithCSSTransition: (props: Partial<
|
|
3
|
+
export declare const WithCSSTransition: (props: Partial<CSSTransitionProps<undefined>> & {
|
|
5
4
|
children: JSX.Element;
|
|
6
5
|
dimension?: "width" | "height" | undefined;
|
|
7
6
|
}) => JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CommonProps } from '../props';
|
|
3
3
|
export declare const StatusIconMap: {
|
|
4
|
-
negative: (args?: CommonProps
|
|
5
|
-
positive: (args?: CommonProps
|
|
6
|
-
warning: (args?: CommonProps
|
|
7
|
-
informational: (args?: CommonProps
|
|
4
|
+
negative: (args?: CommonProps) => JSX.Element;
|
|
5
|
+
positive: (args?: CommonProps) => JSX.Element;
|
|
6
|
+
warning: (args?: CommonProps) => JSX.Element;
|
|
7
|
+
informational: (args?: CommonProps) => JSX.Element;
|
|
8
8
|
};
|
|
@@ -78,8 +78,10 @@ var useOverflow = function (items, disabled, orientation) {
|
|
|
78
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
|
-
|
|
82
|
-
|
|
81
|
+
if (!isNaN(visibleItems)) {
|
|
82
|
+
// Doubling the visible items to overflow the container. Just to be safe.
|
|
83
|
+
setVisibleCount(Math.min(items.length, visibleItems * 2));
|
|
84
|
+
}
|
|
83
85
|
}
|
|
84
86
|
needsFullRerender.current = false;
|
|
85
87
|
}, [containerSize, visibleCount, disabled, items.length, orientation]);
|
|
@@ -19,4 +19,4 @@ export declare type ThemeType = 'light' | 'dark' | 'os';
|
|
|
19
19
|
* @param theme Light, dark, or based on OS setting.
|
|
20
20
|
* @param themeOptions Options that override default theming behavior.
|
|
21
21
|
*/
|
|
22
|
-
export declare const useTheme: (theme?: ThemeType
|
|
22
|
+
export declare const useTheme: (theme?: ThemeType, themeOptions?: ThemeOptions) => void;
|
|
@@ -46,6 +46,10 @@ declare module 'react-table' {
|
|
|
46
46
|
};
|
|
47
47
|
isTableResizing?: boolean;
|
|
48
48
|
columnReorderStartIndex: number;
|
|
49
|
+
sticky: {
|
|
50
|
+
isScrolledToRight?: boolean;
|
|
51
|
+
isScrolledToLeft?: boolean;
|
|
52
|
+
};
|
|
49
53
|
}
|
|
50
54
|
interface ColumnInterface<D extends object = {}> extends UseSortByColumnOptions<D>, UseFiltersColumnOptions<D>, UseResizeColumnsColumnOptions<D> {
|
|
51
55
|
/**
|
|
@@ -91,12 +95,17 @@ declare module 'react-table' {
|
|
|
91
95
|
* @default false
|
|
92
96
|
*/
|
|
93
97
|
disableToggleVisibility?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Side on which column should be sticked to.
|
|
100
|
+
*/
|
|
101
|
+
sticky?: 'left' | 'right';
|
|
94
102
|
}
|
|
95
103
|
interface ColumnInstance<D extends object = {}> extends UseFiltersColumnProps<D>, UseGroupByColumnProps<D>, UseResizeColumnsColumnProps<D>, UseSortByColumnProps<D> {
|
|
96
104
|
originalWidth: number;
|
|
97
105
|
resizeWidth?: number;
|
|
98
106
|
isResizerVisible?: boolean;
|
|
99
107
|
getDragAndDropProps: () => TableKeyedProps;
|
|
108
|
+
originalSticky?: 'left' | 'right' | 'none';
|
|
100
109
|
}
|
|
101
110
|
interface Cell<D extends object = {}> extends UseGroupByCellProps<D>, UseRowStateCellProps<D> {
|
|
102
111
|
}
|
|
@@ -58,19 +58,24 @@ export var Carousel = Object.assign(React.forwardRef(function (props, ref) {
|
|
|
58
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
|
-
var scrollInstantly = React.useRef(false);
|
|
62
61
|
var carouselRef = React.useRef(null);
|
|
63
62
|
var refs = useMergedRefs(carouselRef, ref);
|
|
64
|
-
var _b = React.useState(userActiveIndex), currentIndex = _b[0],
|
|
63
|
+
var _b = React.useState(userActiveIndex), currentIndex = _b[0], setCurrentIndex = _b[1];
|
|
64
|
+
var scrollToSlide = React.useRef(function () { }); // stub function populated in CarouselSlider
|
|
65
|
+
var justMounted = React.useRef(true);
|
|
65
66
|
React.useEffect(function () {
|
|
66
|
-
_setCurrentIndex(userActiveIndex);
|
|
67
|
-
}, [userActiveIndex]);
|
|
68
|
-
var setCurrentIndex = React.useCallback(function (index) {
|
|
69
67
|
var _a;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
setCurrentIndex(userActiveIndex);
|
|
69
|
+
scrollToSlide.current(userActiveIndex, {
|
|
70
|
+
instant: justMounted.current,
|
|
71
|
+
});
|
|
72
|
+
// re-focus the carousel for keyboard nav, but not on first mount
|
|
73
|
+
// because it shows outline and might interfere with other components
|
|
74
|
+
if (!justMounted.current) {
|
|
75
|
+
(_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
76
|
+
}
|
|
77
|
+
justMounted.current = false;
|
|
78
|
+
}, [userActiveIndex]);
|
|
74
79
|
var _c = React.useState(0), slideCount = _c[0], setSlideCount = _c[1];
|
|
75
80
|
var _d = React.useState({}), keysPressed = _d[0], setKeysPressed = _d[1];
|
|
76
81
|
var handleKeyDown = function (event) {
|
|
@@ -88,12 +93,16 @@ export var Carousel = Object.assign(React.forwardRef(function (props, ref) {
|
|
|
88
93
|
switch (event.key) {
|
|
89
94
|
case 'ArrowLeft': {
|
|
90
95
|
setKeysPressed(function (old) { return (__assign(__assign({}, old), { ArrowLeft: false })); });
|
|
91
|
-
|
|
96
|
+
var prevIndex = (slideCount + currentIndex - 1) % slideCount;
|
|
97
|
+
scrollToSlide.current(prevIndex);
|
|
98
|
+
setCurrentIndex(prevIndex);
|
|
92
99
|
break;
|
|
93
100
|
}
|
|
94
101
|
case 'ArrowRight': {
|
|
95
102
|
setKeysPressed(function (old) { return (__assign(__assign({}, old), { ArrowRight: false })); });
|
|
96
|
-
|
|
103
|
+
var nextIndex = (slideCount + currentIndex + 1) % slideCount;
|
|
104
|
+
scrollToSlide.current(nextIndex);
|
|
105
|
+
setCurrentIndex(nextIndex);
|
|
97
106
|
break;
|
|
98
107
|
}
|
|
99
108
|
}
|
|
@@ -112,7 +121,7 @@ export var Carousel = Object.assign(React.forwardRef(function (props, ref) {
|
|
|
112
121
|
keysPressed: keysPressed,
|
|
113
122
|
idPrefix: id,
|
|
114
123
|
isManuallyUpdating: isManuallyUpdating,
|
|
115
|
-
|
|
124
|
+
scrollToSlide: scrollToSlide,
|
|
116
125
|
} }, children)));
|
|
117
126
|
}), {
|
|
118
127
|
Slider: CarouselSlider,
|
|
@@ -31,7 +31,9 @@ export declare const CarouselContext: React.Context<{
|
|
|
31
31
|
*/
|
|
32
32
|
isManuallyUpdating: React.MutableRefObject<boolean>;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Function that scrolls to the current slide. Should be called on all managed events (clicks and keydowns).
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
scrollToSlide: React.MutableRefObject<(slideIndex: number, options?: {
|
|
37
|
+
instant?: boolean;
|
|
38
|
+
}) => void>;
|
|
37
39
|
} | undefined>;
|
|
@@ -63,6 +63,7 @@ export var CarouselDotsList = React.forwardRef(function (props, ref) {
|
|
|
63
63
|
var handleSlideChange = React.useCallback(function (index) {
|
|
64
64
|
if (context) {
|
|
65
65
|
context.setCurrentIndex(index);
|
|
66
|
+
context.scrollToSlide.current(index);
|
|
66
67
|
}
|
|
67
68
|
onSlideChange === null || onSlideChange === void 0 ? void 0 : onSlideChange(index);
|
|
68
69
|
}, [context, onSlideChange]);
|
|
@@ -37,13 +37,12 @@ var PreviousButton = React.forwardRef(function (props, ref) {
|
|
|
37
37
|
if (!context) {
|
|
38
38
|
throw new Error('CarouselNavigation should be used inside Carousel');
|
|
39
39
|
}
|
|
40
|
-
var slideCount = context.slideCount, setCurrentIndex = context.setCurrentIndex, keysPressed = context.keysPressed,
|
|
40
|
+
var slideCount = context.slideCount, currentIndex = context.currentIndex, setCurrentIndex = context.setCurrentIndex, keysPressed = context.keysPressed, scrollToSlide = context.scrollToSlide;
|
|
41
41
|
return (React.createElement(IconButton, __assign({ styleType: 'borderless', size: 'small', tabIndex: -1, "data-pressed": keysPressed['ArrowLeft'] || undefined, ref: ref }, props, { onClick: function (e) {
|
|
42
42
|
var _a;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
setCurrentIndex(function (old) { return (slideCount + old - 1) % slideCount; });
|
|
43
|
+
var prevIndex = (slideCount + currentIndex - 1) % slideCount;
|
|
44
|
+
setCurrentIndex(prevIndex);
|
|
45
|
+
scrollToSlide.current(prevIndex, { instant: e.detail > 3 });
|
|
47
46
|
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
48
47
|
} }),
|
|
49
48
|
React.createElement(SvgChevronLeft, null)));
|
|
@@ -54,13 +53,12 @@ var NextButton = React.forwardRef(function (props, ref) {
|
|
|
54
53
|
if (!context) {
|
|
55
54
|
throw new Error('CarouselNavigation should be used inside Carousel');
|
|
56
55
|
}
|
|
57
|
-
var slideCount = context.slideCount, setCurrentIndex = context.setCurrentIndex, keysPressed = context.keysPressed,
|
|
56
|
+
var slideCount = context.slideCount, currentIndex = context.currentIndex, setCurrentIndex = context.setCurrentIndex, keysPressed = context.keysPressed, scrollToSlide = context.scrollToSlide;
|
|
58
57
|
return (React.createElement(IconButton, __assign({ styleType: 'borderless', size: 'small', tabIndex: -1, "data-pressed": keysPressed['ArrowRight'] || undefined, ref: ref }, props, { onClick: function (e) {
|
|
59
58
|
var _a;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
setCurrentIndex(function (old) { return (slideCount + old + 1) % slideCount; });
|
|
59
|
+
var nextIndex = (slideCount + currentIndex + 1) % slideCount;
|
|
60
|
+
setCurrentIndex(nextIndex);
|
|
61
|
+
scrollToSlide.current(nextIndex, { instant: e.detail > 3 });
|
|
64
62
|
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
65
63
|
} }),
|
|
66
64
|
React.createElement(SvgChevronRight, null)));
|
|
@@ -40,17 +40,13 @@ export var CarouselSlide = React.forwardRef(function (props, ref) {
|
|
|
40
40
|
if (!context || index == null) {
|
|
41
41
|
throw new Error('CarouselSlide must be used within Carousel');
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var isManuallyUpdating = context.isManuallyUpdating, setCurrentIndex = context.setCurrentIndex;
|
|
44
44
|
var updateActiveIndexOnScroll = React.useCallback(function () {
|
|
45
45
|
// only update index if scroll was triggered by browser
|
|
46
|
-
if (!isManuallyUpdating.current
|
|
46
|
+
if (!isManuallyUpdating.current) {
|
|
47
47
|
setCurrentIndex(index);
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
if (currentIndex === index) {
|
|
51
|
-
isManuallyUpdating.current = false;
|
|
52
|
-
}
|
|
53
|
-
}, [currentIndex, index, isManuallyUpdating, setCurrentIndex]);
|
|
49
|
+
}, [index, isManuallyUpdating, setCurrentIndex]);
|
|
54
50
|
var intersectionRef = useIntersection(updateActiveIndexOnScroll, { threshold: 0.5 }, false);
|
|
55
51
|
var refs = useMergedRefs(intersectionRef, ref);
|
|
56
52
|
return (React.createElement("li", __assign({ className: cx('iui-carousel-slider-item', className), role: 'tabpanel', "aria-roledescription": 'slide', ref: refs }, rest), children));
|
|
@@ -27,7 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import React from 'react';
|
|
28
28
|
import cx from 'classnames';
|
|
29
29
|
import { CarouselContext } from './CarouselContext';
|
|
30
|
-
import { getWindow, useMergedRefs
|
|
30
|
+
import { getWindow, useMergedRefs } from '../utils';
|
|
31
31
|
/**
|
|
32
32
|
* `CarouselSlider` is the scrollable list that should consist of `CarouselSlide` components.
|
|
33
33
|
*/
|
|
@@ -37,7 +37,7 @@ export var CarouselSlider = React.forwardRef(function (props, ref) {
|
|
|
37
37
|
if (!context) {
|
|
38
38
|
throw new Error('CarouselSlider must be used within Carousel');
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var setSlideCount = context.setSlideCount, idPrefix = context.idPrefix, scrollToSlide = context.scrollToSlide, isManuallyUpdating = context.isManuallyUpdating;
|
|
41
41
|
var items = React.useMemo(function () {
|
|
42
42
|
var _a;
|
|
43
43
|
return (_a = React.Children.map(children, function (child, index) {
|
|
@@ -52,37 +52,32 @@ export var CarouselSlider = React.forwardRef(function (props, ref) {
|
|
|
52
52
|
React.useLayoutEffect(function () {
|
|
53
53
|
setSlideCount(items.length);
|
|
54
54
|
}, [items.length, setSlideCount]);
|
|
55
|
-
var _a = React.useState(), width = _a[0], setWidth = _a[1];
|
|
56
|
-
var resizeRef = useResizeObserver(function (_a) {
|
|
57
|
-
var width = _a.width;
|
|
58
|
-
return setWidth(width);
|
|
59
|
-
})[0];
|
|
60
55
|
var sliderRef = React.useRef(null);
|
|
61
|
-
var refs = useMergedRefs(sliderRef,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var slideToShow = (
|
|
67
|
-
if (!sliderRef.current ||
|
|
68
|
-
!slideToShow ||
|
|
69
|
-
(!isManuallyUpdating.current && previousWidth.current === width)) {
|
|
56
|
+
var refs = useMergedRefs(sliderRef, ref);
|
|
57
|
+
scrollToSlide.current = function (slideIndex, _a) {
|
|
58
|
+
var _b, _c, _d;
|
|
59
|
+
var _e = _a === void 0 ? {} : _a, instant = _e.instant;
|
|
60
|
+
isManuallyUpdating.current = true; // start manual update
|
|
61
|
+
var slideToShow = (_b = sliderRef.current) === null || _b === void 0 ? void 0 : _b.children.item(slideIndex);
|
|
62
|
+
if (!sliderRef.current || !slideToShow) {
|
|
70
63
|
return;
|
|
71
64
|
}
|
|
72
|
-
|
|
73
|
-
if (justMounted.current) {
|
|
74
|
-
scrollInstantly.current = true;
|
|
75
|
-
justMounted.current = false;
|
|
76
|
-
}
|
|
77
|
-
var motionOk = (_c = (_b = getWindow()) === null || _b === void 0 ? void 0 : _b.matchMedia('(prefers-reduced-motion: no-preference)')) === null || _c === void 0 ? void 0 : _c.matches;
|
|
65
|
+
var motionOk = (_d = (_c = getWindow()) === null || _c === void 0 ? void 0 : _c.matchMedia('(prefers-reduced-motion: no-preference)')) === null || _d === void 0 ? void 0 : _d.matches;
|
|
78
66
|
sliderRef.current.scrollTo({
|
|
79
67
|
left: slideToShow.offsetLeft - sliderRef.current.offsetLeft,
|
|
80
|
-
behavior: (
|
|
81
|
-
? 'instant'
|
|
82
|
-
: 'smooth'), // scrollTo accepts 'instant' but ScrollBehavior type is wrong
|
|
68
|
+
behavior: (instant || !motionOk ? 'instant' : 'smooth'), // scrollTo accepts 'instant' but ScrollBehavior type is wrong
|
|
83
69
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
};
|
|
71
|
+
var scrollTimeout = React.useRef();
|
|
72
|
+
// reset isManuallyUpdating.current to false after the last scroll event
|
|
73
|
+
var handleOnScroll = React.useCallback(function () {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
if (scrollTimeout.current) {
|
|
76
|
+
(_a = getWindow()) === null || _a === void 0 ? void 0 : _a.clearTimeout(scrollTimeout.current);
|
|
77
|
+
}
|
|
78
|
+
scrollTimeout.current = (_b = getWindow()) === null || _b === void 0 ? void 0 : _b.setTimeout(function () {
|
|
79
|
+
isManuallyUpdating.current = false;
|
|
80
|
+
}, 100);
|
|
81
|
+
}, [isManuallyUpdating]);
|
|
82
|
+
return (React.createElement("ol", __assign({ "aria-live": 'polite', className: cx('iui-carousel-slider', className), ref: refs, onScroll: handleOnScroll }, rest), items));
|
|
88
83
|
});
|
|
@@ -5,7 +5,7 @@ export declare const ColorPickerContext: React.Context<{
|
|
|
5
5
|
setActiveColor: (color: ColorValue | ((prevColor: ColorValue) => ColorValue)) => void;
|
|
6
6
|
hsvColor: HsvColor;
|
|
7
7
|
onChangeComplete?: ((color: ColorValue) => void) | undefined;
|
|
8
|
-
applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean, newColorValue?: ColorValue
|
|
8
|
+
applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean, newColorValue?: ColorValue) => void;
|
|
9
9
|
showAlpha: boolean;
|
|
10
10
|
} | undefined>;
|
|
11
11
|
export declare const useColorPickerContext: () => {
|
|
@@ -13,6 +13,6 @@ export declare const useColorPickerContext: () => {
|
|
|
13
13
|
setActiveColor: (color: ColorValue | ((prevColor: ColorValue) => ColorValue)) => void;
|
|
14
14
|
hsvColor: HsvColor;
|
|
15
15
|
onChangeComplete?: ((color: ColorValue) => void) | undefined;
|
|
16
|
-
applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean, newColorValue?: ColorValue
|
|
16
|
+
applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean, newColorValue?: ColorValue) => void;
|
|
17
17
|
showAlpha: boolean;
|
|
18
18
|
};
|