@itwin/itwinui-react 3.0.0-dev.5 → 3.0.0-dev.7
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 +98 -1
- package/cjs/core/Avatar/Avatar.d.ts +3 -2
- package/cjs/core/Avatar/Avatar.js +21 -19
- package/cjs/core/AvatarGroup/AvatarGroup.js +3 -8
- package/cjs/core/Buttons/Button/Button.d.ts +15 -2
- package/cjs/core/Buttons/Button/Button.js +23 -9
- package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -1
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +5 -1
- package/cjs/core/Buttons/IconButton/IconButton.js +11 -5
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
- package/cjs/core/Buttons/SplitButton/SplitButton.js +22 -13
- package/cjs/core/Carousel/Carousel.d.ts +6 -4
- package/cjs/core/Carousel/Carousel.js +2 -2
- package/cjs/core/Carousel/CarouselDot.js +1 -3
- package/cjs/core/Carousel/CarouselNavigation.d.ts +6 -4
- package/cjs/core/ColorPicker/ColorBuilder.js +2 -1
- package/cjs/core/ComboBox/ComboBoxInput.js +1 -1
- package/cjs/core/ComboBox/ComboBoxMenu.js +5 -5
- package/cjs/core/DatePicker/DatePicker.js +7 -1
- package/cjs/core/Dialog/Dialog.js +1 -2
- package/cjs/core/Dialog/DialogContent.d.ts +2 -1
- package/cjs/core/Dialog/DialogContent.js +25 -1
- package/cjs/core/Dialog/DialogMain.js +5 -6
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -3
- package/cjs/core/FileUpload/FileUpload.d.ts +4 -0
- package/cjs/core/FileUpload/FileUpload.js +24 -3
- package/cjs/core/Header/HeaderBasicButton.js +3 -16
- package/cjs/core/Header/HeaderButton.d.ts +4 -0
- package/cjs/core/Header/HeaderButton.js +2 -0
- package/cjs/core/Header/HeaderDropdownButton.js +1 -1
- package/cjs/core/Header/HeaderSplitButton.js +2 -4
- package/cjs/core/Input/Input.d.ts +5 -0
- package/cjs/core/Input/Input.js +2 -1
- package/cjs/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
- package/cjs/core/ProgressIndicators/ProgressLinear.js +9 -1
- package/cjs/core/Radio/Radio.d.ts +8 -0
- package/cjs/core/Radio/Radio.js +22 -9
- package/cjs/core/RadioTiles/RadioTile.d.ts +16 -0
- package/cjs/core/RadioTiles/RadioTile.js +61 -27
- package/cjs/core/Select/Select.js +2 -2
- package/cjs/core/SideNavigation/SideNavigation.d.ts +16 -0
- package/cjs/core/SideNavigation/SideNavigation.js +40 -9
- package/cjs/core/Slider/Slider.d.ts +24 -0
- package/cjs/core/Slider/Slider.js +58 -10
- package/cjs/core/Slider/Thumb.js +2 -2
- package/cjs/core/Slider/Track.d.ts +1 -1
- package/cjs/core/Slider/Track.js +17 -6
- package/cjs/core/Stepper/Stepper.d.ts +26 -1
- package/cjs/core/Stepper/Stepper.js +35 -6
- package/cjs/core/Stepper/StepperStep.d.ts +17 -0
- package/cjs/core/Stepper/StepperStep.js +33 -8
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +11 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +23 -10
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
- package/cjs/core/Stepper/WorkflowDiagramStep.js +9 -2
- package/cjs/core/Table/SubRowExpander.js +1 -1
- package/cjs/core/Table/Table.d.ts +16 -0
- package/cjs/core/Table/Table.js +50 -9
- package/cjs/core/Table/TableCell.js +1 -1
- package/cjs/core/Table/TablePaginator.js +1 -3
- package/cjs/core/Tabs/Tab.js +1 -2
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +23 -3
- package/cjs/core/ThemeProvider/ThemeProvider.js +56 -23
- package/cjs/core/Tile/Tile.d.ts +3 -2
- package/cjs/core/Toast/Toast.js +4 -9
- package/cjs/core/Tooltip/Tooltip.d.ts +1 -1
- package/cjs/core/Tooltip/Tooltip.js +1 -2
- package/cjs/core/Tree/TreeNode.js +1 -1
- package/cjs/core/utils/components/ButtonBase.d.ts +14 -0
- package/cjs/core/utils/components/ButtonBase.js +46 -0
- package/cjs/core/utils/components/Popover.js +5 -3
- package/cjs/core/utils/components/Resizer.js +21 -13
- package/cjs/core/utils/components/VirtualScroll.js +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/functions/colors.d.ts +1 -1
- package/cjs/core/utils/functions/colors.js +1 -13
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useGlobals.d.ts +1 -1
- package/cjs/core/utils/hooks/useUncontrolledState.d.ts +6 -0
- package/cjs/core/utils/hooks/useUncontrolledState.js +18 -0
- package/cjs/styles.js +4 -11
- package/esm/core/Avatar/Avatar.d.ts +3 -2
- package/esm/core/Avatar/Avatar.js +21 -17
- package/esm/core/AvatarGroup/AvatarGroup.js +3 -8
- package/esm/core/Buttons/Button/Button.d.ts +15 -2
- package/esm/core/Buttons/Button/Button.js +18 -10
- package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +1 -1
- package/esm/core/Buttons/IconButton/IconButton.d.ts +5 -1
- package/esm/core/Buttons/IconButton/IconButton.js +9 -6
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
- package/esm/core/Buttons/SplitButton/SplitButton.js +22 -13
- package/esm/core/Carousel/Carousel.d.ts +6 -4
- package/esm/core/Carousel/Carousel.js +8 -3
- package/esm/core/Carousel/CarouselDot.js +2 -4
- package/esm/core/Carousel/CarouselNavigation.d.ts +6 -4
- package/esm/core/ColorPicker/ColorBuilder.js +2 -1
- package/esm/core/ComboBox/ComboBoxInput.js +1 -1
- package/esm/core/ComboBox/ComboBoxMenu.js +5 -5
- package/esm/core/DatePicker/DatePicker.js +8 -1
- package/esm/core/Dialog/Dialog.js +1 -1
- package/esm/core/Dialog/DialogContent.d.ts +2 -1
- package/esm/core/Dialog/DialogContent.js +25 -2
- package/esm/core/Dialog/DialogMain.js +5 -6
- package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -3
- package/esm/core/FileUpload/FileUpload.d.ts +4 -0
- package/esm/core/FileUpload/FileUpload.js +26 -3
- package/esm/core/Header/HeaderBasicButton.js +4 -17
- package/esm/core/Header/HeaderButton.d.ts +4 -0
- package/esm/core/Header/HeaderButton.js +2 -0
- package/esm/core/Header/HeaderDropdownButton.js +1 -1
- package/esm/core/Header/HeaderSplitButton.js +8 -5
- package/esm/core/Input/Input.d.ts +5 -0
- package/esm/core/Input/Input.js +2 -1
- package/esm/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
- package/esm/core/ProgressIndicators/ProgressLinear.js +9 -1
- package/esm/core/Radio/Radio.d.ts +8 -0
- package/esm/core/Radio/Radio.js +19 -6
- package/esm/core/RadioTiles/RadioTile.d.ts +16 -0
- package/esm/core/RadioTiles/RadioTile.js +52 -22
- package/esm/core/Select/Select.js +2 -2
- package/esm/core/SideNavigation/SideNavigation.d.ts +16 -0
- package/esm/core/SideNavigation/SideNavigation.js +31 -9
- package/esm/core/Slider/Slider.d.ts +24 -0
- package/esm/core/Slider/Slider.js +43 -10
- package/esm/core/Slider/Thumb.js +2 -2
- package/esm/core/Slider/Track.d.ts +1 -1
- package/esm/core/Slider/Track.js +14 -6
- package/esm/core/Stepper/Stepper.d.ts +26 -1
- package/esm/core/Stepper/Stepper.js +32 -6
- package/esm/core/Stepper/StepperStep.d.ts +17 -0
- package/esm/core/Stepper/StepperStep.js +27 -8
- package/esm/core/Stepper/WorkflowDiagram.d.ts +11 -1
- package/esm/core/Stepper/WorkflowDiagram.js +10 -7
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
- package/esm/core/Stepper/WorkflowDiagramStep.js +6 -2
- package/esm/core/Table/SubRowExpander.js +1 -1
- package/esm/core/Table/Table.d.ts +16 -0
- package/esm/core/Table/Table.js +47 -9
- package/esm/core/Table/TableCell.js +1 -1
- package/esm/core/Table/TablePaginator.js +2 -3
- package/esm/core/Tabs/Tab.js +2 -3
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +23 -3
- package/esm/core/ThemeProvider/ThemeProvider.js +64 -24
- package/esm/core/Tile/Tile.d.ts +3 -2
- package/esm/core/Toast/Toast.js +5 -9
- package/esm/core/Tooltip/Tooltip.d.ts +1 -1
- package/esm/core/Tooltip/Tooltip.js +1 -1
- package/esm/core/Tree/TreeNode.js +1 -1
- package/esm/core/utils/components/ButtonBase.d.ts +14 -0
- package/esm/core/utils/components/ButtonBase.js +42 -0
- package/esm/core/utils/components/Popover.js +5 -3
- package/esm/core/utils/components/Resizer.js +21 -13
- package/esm/core/utils/components/VirtualScroll.js +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/functions/colors.d.ts +1 -1
- package/esm/core/utils/functions/colors.js +1 -13
- package/esm/core/utils/functions/import.js +2 -1
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useGlobals.d.ts +1 -1
- package/esm/core/utils/hooks/useUncontrolledState.d.ts +6 -0
- package/esm/core/utils/hooks/useUncontrolledState.js +13 -0
- package/esm/styles.js +4 -11
- package/package.json +2 -2
- package/styles.css +723 -1566
|
@@ -91,6 +91,12 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
91
91
|
thumbProps,
|
|
92
92
|
className,
|
|
93
93
|
railContainerProps,
|
|
94
|
+
minProps,
|
|
95
|
+
maxProps,
|
|
96
|
+
railProps,
|
|
97
|
+
trackProps,
|
|
98
|
+
tickProps,
|
|
99
|
+
ticksProps,
|
|
94
100
|
orientation = 'horizontal',
|
|
95
101
|
...rest
|
|
96
102
|
} = props;
|
|
@@ -283,18 +289,33 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
283
289
|
if (Array.isArray(tickLabels)) {
|
|
284
290
|
return React.createElement(
|
|
285
291
|
index_js_1.Box,
|
|
286
|
-
{
|
|
292
|
+
{
|
|
293
|
+
as: 'div',
|
|
294
|
+
...ticksProps,
|
|
295
|
+
className: (0, classnames_1.default)(
|
|
296
|
+
'iui-slider-ticks',
|
|
297
|
+
ticksProps?.className,
|
|
298
|
+
),
|
|
299
|
+
},
|
|
287
300
|
tickLabels.map((label, index) =>
|
|
288
301
|
React.createElement(
|
|
289
302
|
index_js_1.Box,
|
|
290
|
-
{
|
|
303
|
+
{
|
|
304
|
+
as: 'span',
|
|
305
|
+
...tickProps,
|
|
306
|
+
key: index,
|
|
307
|
+
className: (0, classnames_1.default)(
|
|
308
|
+
'iui-slider-tick',
|
|
309
|
+
tickProps?.className,
|
|
310
|
+
),
|
|
311
|
+
},
|
|
291
312
|
label,
|
|
292
313
|
),
|
|
293
314
|
),
|
|
294
315
|
);
|
|
295
316
|
}
|
|
296
317
|
return tickLabels;
|
|
297
|
-
}, [tickLabels]);
|
|
318
|
+
}, [tickLabels, tickProps, ticksProps]);
|
|
298
319
|
const generateTooltipProps = React.useCallback(
|
|
299
320
|
(index, val) => {
|
|
300
321
|
const outProps = tooltipProps ? tooltipProps(index, val, step) : {};
|
|
@@ -322,20 +343,39 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
322
343
|
minValueLabel &&
|
|
323
344
|
React.createElement(
|
|
324
345
|
index_js_1.Box,
|
|
325
|
-
{
|
|
346
|
+
{
|
|
347
|
+
as: 'span',
|
|
348
|
+
...minProps,
|
|
349
|
+
className: (0, classnames_1.default)(
|
|
350
|
+
'iui-slider-min',
|
|
351
|
+
minProps?.className,
|
|
352
|
+
),
|
|
353
|
+
},
|
|
326
354
|
minValueLabel,
|
|
327
355
|
),
|
|
328
356
|
React.createElement(
|
|
329
357
|
index_js_1.Box,
|
|
330
358
|
{
|
|
359
|
+
as: 'div',
|
|
331
360
|
ref: containerRef,
|
|
332
|
-
className: (0, classnames_1.default)('iui-slider-container', {
|
|
333
|
-
'iui-grabbing': undefined !== activeThumbIndex,
|
|
334
|
-
}),
|
|
335
|
-
onPointerDown: handlePointerDownOnSlider,
|
|
336
361
|
...railContainerProps,
|
|
362
|
+
className: (0, classnames_1.default)(
|
|
363
|
+
'iui-slider-container',
|
|
364
|
+
{
|
|
365
|
+
'iui-grabbing': undefined !== activeThumbIndex,
|
|
366
|
+
},
|
|
367
|
+
railContainerProps?.className,
|
|
368
|
+
),
|
|
369
|
+
onPointerDown: handlePointerDownOnSlider,
|
|
337
370
|
},
|
|
338
|
-
React.createElement(index_js_1.Box, {
|
|
371
|
+
React.createElement(index_js_1.Box, {
|
|
372
|
+
as: 'div',
|
|
373
|
+
...railProps,
|
|
374
|
+
className: (0, classnames_1.default)(
|
|
375
|
+
'iui-slider-rail',
|
|
376
|
+
railProps?.className,
|
|
377
|
+
),
|
|
378
|
+
}),
|
|
339
379
|
currentValues.map((thumbValue, index) => {
|
|
340
380
|
const [minVal, maxVal] = getAllowableThumbRange(index);
|
|
341
381
|
const thisThumbProps = thumbProps?.(index);
|
|
@@ -363,13 +403,21 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
363
403
|
sliderMax: max,
|
|
364
404
|
values: currentValues,
|
|
365
405
|
orientation: orientation,
|
|
406
|
+
...trackProps,
|
|
366
407
|
}),
|
|
367
408
|
tickMarkArea,
|
|
368
409
|
),
|
|
369
410
|
maxValueLabel &&
|
|
370
411
|
React.createElement(
|
|
371
412
|
index_js_1.Box,
|
|
372
|
-
{
|
|
413
|
+
{
|
|
414
|
+
as: 'span',
|
|
415
|
+
...maxProps,
|
|
416
|
+
className: (0, classnames_1.default)(
|
|
417
|
+
'iui-slider-max',
|
|
418
|
+
maxProps?.className,
|
|
419
|
+
),
|
|
420
|
+
},
|
|
373
421
|
maxValueLabel,
|
|
374
422
|
),
|
|
375
423
|
);
|
package/cjs/core/Slider/Thumb.js
CHANGED
|
@@ -101,8 +101,8 @@ const Thumb = (props) => {
|
|
|
101
101
|
style: {
|
|
102
102
|
...style,
|
|
103
103
|
...(orientation === 'horizontal'
|
|
104
|
-
? {
|
|
105
|
-
: {
|
|
104
|
+
? { insetInlineStart: `${lowPercent}%` }
|
|
105
|
+
: { insetBlockEnd: `${lowPercent}%` }),
|
|
106
106
|
},
|
|
107
107
|
className: (0, classnames_1.default)(
|
|
108
108
|
'iui-slider-thumb',
|
|
@@ -6,7 +6,7 @@ export type TrackProps = {
|
|
|
6
6
|
sliderMax: number;
|
|
7
7
|
values: number[];
|
|
8
8
|
orientation: SliderProps['orientation'];
|
|
9
|
-
}
|
|
9
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
10
10
|
/**
|
|
11
11
|
* Track displays color segments above Rail. Which, if any, segments that are
|
|
12
12
|
* colorized is based on `trackDisplayMode`.
|
package/cjs/core/Slider/Track.js
CHANGED
|
@@ -7,6 +7,7 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
9
|
const React = tslib_1.__importStar(require('react'));
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
10
11
|
const index_js_1 = require('../utils/index.js');
|
|
11
12
|
function shouldDisplaySegment(segmentIndex, mode) {
|
|
12
13
|
if ('odd-segments' === mode && 0 === (segmentIndex + 1) % 2) {
|
|
@@ -41,7 +42,14 @@ function generateSegments(values, min, max) {
|
|
|
41
42
|
* colorized is based on `trackDisplayMode`.
|
|
42
43
|
*/
|
|
43
44
|
const Track = (props) => {
|
|
44
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
className,
|
|
47
|
+
trackDisplayMode,
|
|
48
|
+
sliderMin,
|
|
49
|
+
sliderMax,
|
|
50
|
+
values,
|
|
51
|
+
orientation,
|
|
52
|
+
} = props;
|
|
45
53
|
const [segments, setSegments] = React.useState(() =>
|
|
46
54
|
generateSegments(values, sliderMin, sliderMax),
|
|
47
55
|
);
|
|
@@ -67,16 +75,19 @@ const Track = (props) => {
|
|
|
67
75
|
{ key: index },
|
|
68
76
|
shouldDisplaySegment(index, trackDisplayMode)
|
|
69
77
|
? React.createElement(index_js_1.Box, {
|
|
70
|
-
className:
|
|
78
|
+
className: (0, classnames_1.default)(
|
|
79
|
+
'iui-slider-track',
|
|
80
|
+
className,
|
|
81
|
+
),
|
|
71
82
|
style: {
|
|
72
83
|
...(orientation === 'horizontal'
|
|
73
84
|
? {
|
|
74
|
-
|
|
75
|
-
|
|
85
|
+
insetInlineStart: `${lowPercent}%`,
|
|
86
|
+
insetInlineEnd: `${highPercent}%`,
|
|
76
87
|
}
|
|
77
88
|
: {
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
insetBlockStart: `${highPercent}%`,
|
|
90
|
+
insetBlockEnd: `${lowPercent}%`,
|
|
80
91
|
}),
|
|
81
92
|
},
|
|
82
93
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
3
|
export type StepperLocalization = {
|
|
3
4
|
stepsCountLabel: (currentStep: number, totalSteps: number) => string;
|
|
@@ -11,7 +12,7 @@ export type StepProperties = {
|
|
|
11
12
|
* A tooltip giving detailed description to this step.
|
|
12
13
|
*/
|
|
13
14
|
description?: string;
|
|
14
|
-
}
|
|
15
|
+
} & React.ComponentProps<'li'>;
|
|
15
16
|
export type StepperProps = {
|
|
16
17
|
/**
|
|
17
18
|
* Current step index, 0 - based.
|
|
@@ -34,6 +35,30 @@ export type StepperProps = {
|
|
|
34
35
|
* Click handler on completed step.
|
|
35
36
|
*/
|
|
36
37
|
onStepClick?: (clickedIndex: number) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback that can provide additional props for `<li>` representing a step.
|
|
40
|
+
*/
|
|
41
|
+
stepProps?: (index: number) => React.ComponentProps<'li'>;
|
|
42
|
+
/**
|
|
43
|
+
* Allows props to be passed for track content.
|
|
44
|
+
*/
|
|
45
|
+
trackContentProps?: (index: number) => React.ComponentProps<'div'>;
|
|
46
|
+
/**
|
|
47
|
+
* Allows props to be passed for circle.
|
|
48
|
+
*/
|
|
49
|
+
circleProps?: (index: number) => React.ComponentProps<'span'>;
|
|
50
|
+
/**
|
|
51
|
+
* Allows props to be passed for name.
|
|
52
|
+
*/
|
|
53
|
+
nameProps?: (index: number) => React.ComponentProps<'span'>;
|
|
54
|
+
/**
|
|
55
|
+
* Allows props to be passed for label.
|
|
56
|
+
*/
|
|
57
|
+
labelProps?: React.ComponentProps<'div'>;
|
|
58
|
+
/**
|
|
59
|
+
* Allows props to be passed for label count.
|
|
60
|
+
*/
|
|
61
|
+
labelCountProps?: React.ComponentProps<'span'>;
|
|
37
62
|
};
|
|
38
63
|
export declare const Stepper: PolymorphicForwardRefComponent<"div", StepperProps>;
|
|
39
64
|
export default Stepper;
|
|
@@ -6,6 +6,7 @@ const tslib_1 = require('tslib');
|
|
|
6
6
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
9
10
|
const React = tslib_1.__importStar(require('react'));
|
|
10
11
|
const index_js_1 = require('../utils/index.js');
|
|
11
12
|
const StepperStep_js_1 = require('./StepperStep.js');
|
|
@@ -20,6 +21,12 @@ exports.Stepper = React.forwardRef((props, ref) => {
|
|
|
20
21
|
type = 'default',
|
|
21
22
|
localization = defaultStepperLocalization,
|
|
22
23
|
onStepClick,
|
|
24
|
+
stepProps,
|
|
25
|
+
trackContentProps,
|
|
26
|
+
circleProps,
|
|
27
|
+
nameProps,
|
|
28
|
+
labelProps,
|
|
29
|
+
labelCountProps,
|
|
23
30
|
...rest
|
|
24
31
|
} = props;
|
|
25
32
|
const boundedCurrentStep = Math.min(
|
|
@@ -32,8 +39,16 @@ exports.Stepper = React.forwardRef((props, ref) => {
|
|
|
32
39
|
React.createElement(
|
|
33
40
|
'ol',
|
|
34
41
|
null,
|
|
35
|
-
steps.map((s, index) =>
|
|
36
|
-
|
|
42
|
+
steps.map((s, index) => {
|
|
43
|
+
const thisStepProps = stepProps?.(index);
|
|
44
|
+
const thisTrackContentProps = trackContentProps?.(index);
|
|
45
|
+
const thisCircleProps = circleProps?.(index);
|
|
46
|
+
const thisNameProps = nameProps?.(index);
|
|
47
|
+
return React.createElement(StepperStep_js_1.StepperStep, {
|
|
48
|
+
stepProps: thisStepProps,
|
|
49
|
+
trackContentProps: thisTrackContentProps,
|
|
50
|
+
circleProps: thisCircleProps,
|
|
51
|
+
nameProps: thisNameProps,
|
|
37
52
|
key: index,
|
|
38
53
|
index: index,
|
|
39
54
|
title: type === 'long' ? '' : s.name,
|
|
@@ -42,16 +57,30 @@ exports.Stepper = React.forwardRef((props, ref) => {
|
|
|
42
57
|
type: type,
|
|
43
58
|
onClick: onStepClick,
|
|
44
59
|
description: s.description,
|
|
45
|
-
})
|
|
46
|
-
),
|
|
60
|
+
});
|
|
61
|
+
}),
|
|
47
62
|
),
|
|
48
63
|
type === 'long' &&
|
|
49
64
|
React.createElement(
|
|
50
65
|
index_js_1.Box,
|
|
51
|
-
{
|
|
66
|
+
{
|
|
67
|
+
as: 'div',
|
|
68
|
+
...labelProps,
|
|
69
|
+
className: (0, classnames_1.default)(
|
|
70
|
+
'iui-stepper-steps-label',
|
|
71
|
+
labelProps?.className,
|
|
72
|
+
),
|
|
73
|
+
},
|
|
52
74
|
React.createElement(
|
|
53
75
|
index_js_1.Box,
|
|
54
|
-
{
|
|
76
|
+
{
|
|
77
|
+
as: 'span',
|
|
78
|
+
...labelCountProps,
|
|
79
|
+
className: (0, classnames_1.default)(
|
|
80
|
+
'iui-stepper-steps-label-count',
|
|
81
|
+
labelCountProps?.className,
|
|
82
|
+
),
|
|
83
|
+
},
|
|
55
84
|
localization.stepsCountLabel(boundedCurrentStep + 1, steps.length),
|
|
56
85
|
),
|
|
57
86
|
steps[boundedCurrentStep].name,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
3
|
export type StepperStepProps = {
|
|
3
4
|
/**
|
|
@@ -28,5 +29,21 @@ export type StepperStepProps = {
|
|
|
28
29
|
* A tooltip giving detailed description to this step.
|
|
29
30
|
*/
|
|
30
31
|
description?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Allows props to be passed for stepper step.
|
|
34
|
+
*/
|
|
35
|
+
stepProps?: React.ComponentProps<'li'>;
|
|
36
|
+
/**
|
|
37
|
+
* Allows props to be passed for track content.
|
|
38
|
+
*/
|
|
39
|
+
trackContentProps?: React.ComponentProps<'div'>;
|
|
40
|
+
/**
|
|
41
|
+
* Allows props to be passed for stepper-step circle.
|
|
42
|
+
*/
|
|
43
|
+
circleProps?: React.ComponentProps<'span'>;
|
|
44
|
+
/**
|
|
45
|
+
* Allows props to be passed for stepper name.
|
|
46
|
+
*/
|
|
47
|
+
nameProps?: React.ComponentProps<'span'>;
|
|
31
48
|
};
|
|
32
49
|
export declare const StepperStep: PolymorphicForwardRefComponent<"li", StepperStepProps>;
|
|
@@ -21,6 +21,10 @@ exports.StepperStep = React.forwardRef((props, forwardedRef) => {
|
|
|
21
21
|
description,
|
|
22
22
|
className,
|
|
23
23
|
style,
|
|
24
|
+
stepProps,
|
|
25
|
+
trackContentProps,
|
|
26
|
+
circleProps,
|
|
27
|
+
nameProps,
|
|
24
28
|
...rest
|
|
25
29
|
} = props;
|
|
26
30
|
const isPast = currentStepNumber > index;
|
|
@@ -46,17 +50,17 @@ exports.StepperStep = React.forwardRef((props, forwardedRef) => {
|
|
|
46
50
|
index_js_2.Box,
|
|
47
51
|
{
|
|
48
52
|
as: 'li',
|
|
53
|
+
...stepProps,
|
|
49
54
|
className: (0, classnames_1.default)(
|
|
50
55
|
'iui-stepper-step',
|
|
51
|
-
{
|
|
52
|
-
'iui-current': isActive,
|
|
53
|
-
'iui-clickable': isClickable,
|
|
54
|
-
},
|
|
56
|
+
{ 'iui-current': isActive, 'iui-clickable': isClickable },
|
|
55
57
|
className,
|
|
58
|
+
stepProps?.className,
|
|
56
59
|
),
|
|
57
60
|
style: {
|
|
58
|
-
|
|
61
|
+
inlineSize: type === 'default' ? `${100 / totalSteps}%` : undefined,
|
|
59
62
|
...style,
|
|
63
|
+
...stepProps?.style,
|
|
60
64
|
},
|
|
61
65
|
onClick: onCompletedClick,
|
|
62
66
|
onKeyDown: onKeyDown,
|
|
@@ -67,17 +71,38 @@ exports.StepperStep = React.forwardRef((props, forwardedRef) => {
|
|
|
67
71
|
},
|
|
68
72
|
React.createElement(
|
|
69
73
|
index_js_2.Box,
|
|
70
|
-
{
|
|
74
|
+
{
|
|
75
|
+
as: 'div',
|
|
76
|
+
...trackContentProps,
|
|
77
|
+
className: (0, classnames_1.default)(
|
|
78
|
+
'iui-stepper-track-content',
|
|
79
|
+
trackContentProps?.className,
|
|
80
|
+
),
|
|
81
|
+
},
|
|
71
82
|
React.createElement(
|
|
72
83
|
index_js_2.Box,
|
|
73
|
-
{
|
|
84
|
+
{
|
|
85
|
+
as: 'span',
|
|
86
|
+
...circleProps,
|
|
87
|
+
className: (0, classnames_1.default)(
|
|
88
|
+
'iui-stepper-circle',
|
|
89
|
+
circleProps?.className,
|
|
90
|
+
),
|
|
91
|
+
},
|
|
74
92
|
index + 1,
|
|
75
93
|
),
|
|
76
94
|
),
|
|
77
95
|
type === 'default' &&
|
|
78
96
|
React.createElement(
|
|
79
97
|
index_js_2.Box,
|
|
80
|
-
{
|
|
98
|
+
{
|
|
99
|
+
as: 'span',
|
|
100
|
+
...nameProps,
|
|
101
|
+
className: (0, classnames_1.default)(
|
|
102
|
+
'iui-stepper-step-name',
|
|
103
|
+
nameProps?.className,
|
|
104
|
+
),
|
|
105
|
+
},
|
|
81
106
|
title,
|
|
82
107
|
),
|
|
83
108
|
);
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
3
|
import type { StepperProps } from './Stepper.js';
|
|
3
|
-
type WorkflowDiagramProps = Pick<StepperProps, 'steps'
|
|
4
|
+
type WorkflowDiagramProps = Pick<StepperProps, 'steps'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Allows props to be passed for diagram.
|
|
7
|
+
*/
|
|
8
|
+
contentProps?: (index: number) => React.ComponentProps<'span'>;
|
|
9
|
+
/**
|
|
10
|
+
* Allows props to be passed for diagram wrapper.
|
|
11
|
+
*/
|
|
12
|
+
wrapperProps?: React.ComponentProps<'div'>;
|
|
13
|
+
};
|
|
4
14
|
export declare const WorkflowDiagram: PolymorphicForwardRefComponent<"ol", WorkflowDiagramProps>;
|
|
5
15
|
export default WorkflowDiagram;
|
|
@@ -7,25 +7,38 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
9
|
const React = tslib_1.__importStar(require('react'));
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
10
11
|
const index_js_1 = require('../utils/index.js');
|
|
11
12
|
const WorkflowDiagramStep_js_1 = require('./WorkflowDiagramStep.js');
|
|
12
13
|
exports.WorkflowDiagram = React.forwardRef(
|
|
13
14
|
// TODO: Remove this ref cast. ref and rest props should be applied on the same element
|
|
14
15
|
(props, ref) => {
|
|
15
|
-
const { steps, ...rest } = props;
|
|
16
|
+
const { steps, className, contentProps, wrapperProps, ...rest } = props;
|
|
16
17
|
return React.createElement(
|
|
17
18
|
index_js_1.Box,
|
|
18
|
-
{ ref: ref },
|
|
19
|
+
{ as: 'div', ...wrapperProps, ref: ref },
|
|
19
20
|
React.createElement(
|
|
20
21
|
index_js_1.Box,
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
{
|
|
23
|
+
as: 'ol',
|
|
24
|
+
className: (0, classnames_1.default)(
|
|
25
|
+
'iui-workflow-diagram',
|
|
26
|
+
className,
|
|
27
|
+
),
|
|
28
|
+
...rest,
|
|
29
|
+
},
|
|
30
|
+
steps.map((s, index) => {
|
|
31
|
+
const thisContentProps = contentProps?.(index);
|
|
32
|
+
return React.createElement(
|
|
33
|
+
WorkflowDiagramStep_js_1.WorkflowDiagramStep,
|
|
34
|
+
{
|
|
35
|
+
contentProps: thisContentProps,
|
|
36
|
+
key: index,
|
|
37
|
+
title: s.name,
|
|
38
|
+
description: s.description,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
}),
|
|
29
42
|
),
|
|
30
43
|
);
|
|
31
44
|
},
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type CommonProps } from '../utils/index.js';
|
|
3
3
|
import type { StepperStepProps } from './StepperStep.js';
|
|
4
|
-
export type WorkflowDiagramStepProps =
|
|
4
|
+
export type WorkflowDiagramStepProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Allows props to be passed for diagram content.
|
|
7
|
+
*/
|
|
8
|
+
contentProps?: React.ComponentProps<'span'>;
|
|
9
|
+
} & Pick<StepperStepProps, 'title' | 'description'> & Omit<CommonProps, 'title'>;
|
|
5
10
|
export declare const WorkflowDiagramStep: (props: WorkflowDiagramStepProps) => React.JSX.Element;
|
|
@@ -11,7 +11,7 @@ const React = tslib_1.__importStar(require('react'));
|
|
|
11
11
|
const index_js_1 = require('../Tooltip/index.js');
|
|
12
12
|
const index_js_2 = require('../utils/index.js');
|
|
13
13
|
const WorkflowDiagramStep = (props) => {
|
|
14
|
-
const { title, description, className, style, ...rest } = props;
|
|
14
|
+
const { title, description, className, style, contentProps, ...rest } = props;
|
|
15
15
|
const stepShape = React.createElement(
|
|
16
16
|
index_js_2.Box,
|
|
17
17
|
{
|
|
@@ -25,7 +25,14 @@ const WorkflowDiagramStep = (props) => {
|
|
|
25
25
|
},
|
|
26
26
|
React.createElement(
|
|
27
27
|
index_js_2.Box,
|
|
28
|
-
{
|
|
28
|
+
{
|
|
29
|
+
as: 'span',
|
|
30
|
+
...contentProps,
|
|
31
|
+
className: (0, classnames_1.default)(
|
|
32
|
+
'iui-workflow-diagram-content',
|
|
33
|
+
contentProps?.className,
|
|
34
|
+
),
|
|
35
|
+
},
|
|
29
36
|
title,
|
|
30
37
|
),
|
|
31
38
|
);
|
|
@@ -190,6 +190,22 @@ export type TableProps<T extends Record<string, unknown> = Record<string, unknow
|
|
|
190
190
|
* @default false
|
|
191
191
|
*/
|
|
192
192
|
enableColumnReordering?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Passes props to Table header wrapper.
|
|
195
|
+
*/
|
|
196
|
+
headerWrapperProps?: React.ComponentProps<'div'>;
|
|
197
|
+
/**
|
|
198
|
+
* Passes props to Table header.
|
|
199
|
+
*/
|
|
200
|
+
headerProps?: React.ComponentProps<'div'>;
|
|
201
|
+
/**
|
|
202
|
+
* Passes custom props to Table body.
|
|
203
|
+
*/
|
|
204
|
+
bodyProps?: React.ComponentProps<'div'>;
|
|
205
|
+
/**
|
|
206
|
+
* Passes custom props to empty table.
|
|
207
|
+
*/
|
|
208
|
+
emptyTableContentProps?: React.ComponentProps<'div'>;
|
|
193
209
|
/**
|
|
194
210
|
* Function that returns index of the row that you want to scroll to.
|
|
195
211
|
*
|
package/cjs/core/Table/Table.js
CHANGED
|
@@ -117,6 +117,10 @@ const Table = (props) => {
|
|
|
117
117
|
styleType = 'default',
|
|
118
118
|
enableVirtualization = false,
|
|
119
119
|
enableColumnReordering = false,
|
|
120
|
+
headerWrapperProps,
|
|
121
|
+
headerProps,
|
|
122
|
+
bodyProps,
|
|
123
|
+
emptyTableContentProps,
|
|
120
124
|
...rest
|
|
121
125
|
} = props;
|
|
122
126
|
(0, index_js_2.useGlobals)();
|
|
@@ -580,7 +584,7 @@ const Table = (props) => {
|
|
|
580
584
|
return React.createElement(
|
|
581
585
|
index_js_2.Box,
|
|
582
586
|
{
|
|
583
|
-
|
|
587
|
+
as: 'div',
|
|
584
588
|
ref: headerRef,
|
|
585
589
|
onScroll: () => {
|
|
586
590
|
if (headerRef.current && bodyRef.current) {
|
|
@@ -589,10 +593,22 @@ const Table = (props) => {
|
|
|
589
593
|
}
|
|
590
594
|
},
|
|
591
595
|
key: headerGroupProps.key,
|
|
596
|
+
...headerWrapperProps,
|
|
597
|
+
className: (0, classnames_1.default)(
|
|
598
|
+
'iui-table-header-wrapper',
|
|
599
|
+
headerWrapperProps?.className,
|
|
600
|
+
),
|
|
592
601
|
},
|
|
593
602
|
React.createElement(
|
|
594
603
|
index_js_2.Box,
|
|
595
|
-
{
|
|
604
|
+
{
|
|
605
|
+
as: 'div',
|
|
606
|
+
...headerProps,
|
|
607
|
+
className: (0, classnames_1.default)(
|
|
608
|
+
'iui-table-header',
|
|
609
|
+
headerProps?.className,
|
|
610
|
+
),
|
|
611
|
+
},
|
|
596
612
|
React.createElement(
|
|
597
613
|
index_js_2.Box,
|
|
598
614
|
{ ...headerGroupProps },
|
|
@@ -712,10 +728,15 @@ const Table = (props) => {
|
|
|
712
728
|
React.createElement(
|
|
713
729
|
index_js_2.Box,
|
|
714
730
|
{
|
|
731
|
+
...bodyProps,
|
|
715
732
|
...getTableBodyProps({
|
|
716
|
-
className: (0, classnames_1.default)(
|
|
717
|
-
'iui-
|
|
718
|
-
|
|
733
|
+
className: (0, classnames_1.default)(
|
|
734
|
+
'iui-table-body',
|
|
735
|
+
{
|
|
736
|
+
'iui-zebra-striping': styleType === 'zebra-rows',
|
|
737
|
+
},
|
|
738
|
+
bodyProps?.className,
|
|
739
|
+
),
|
|
719
740
|
style: { outline: 0 },
|
|
720
741
|
}),
|
|
721
742
|
ref: bodyRef,
|
|
@@ -745,7 +766,14 @@ const Table = (props) => {
|
|
|
745
766
|
data.length === 0 &&
|
|
746
767
|
React.createElement(
|
|
747
768
|
index_js_2.Box,
|
|
748
|
-
{
|
|
769
|
+
{
|
|
770
|
+
as: 'div',
|
|
771
|
+
...emptyTableContentProps,
|
|
772
|
+
className: (0, classnames_1.default)(
|
|
773
|
+
'iui-table-empty',
|
|
774
|
+
emptyTableContentProps?.className,
|
|
775
|
+
),
|
|
776
|
+
},
|
|
749
777
|
React.createElement(index_js_1.ProgressRadial, {
|
|
750
778
|
indeterminate: true,
|
|
751
779
|
}),
|
|
@@ -764,7 +792,6 @@ const Table = (props) => {
|
|
|
764
792
|
React.createElement(index_js_1.ProgressRadial, {
|
|
765
793
|
indeterminate: true,
|
|
766
794
|
size: 'small',
|
|
767
|
-
style: { float: 'none', marginLeft: 0 },
|
|
768
795
|
}),
|
|
769
796
|
),
|
|
770
797
|
),
|
|
@@ -773,7 +800,14 @@ const Table = (props) => {
|
|
|
773
800
|
!areFiltersSet &&
|
|
774
801
|
React.createElement(
|
|
775
802
|
index_js_2.Box,
|
|
776
|
-
{
|
|
803
|
+
{
|
|
804
|
+
as: 'div',
|
|
805
|
+
...emptyTableContentProps,
|
|
806
|
+
className: (0, classnames_1.default)(
|
|
807
|
+
'iui-table-empty',
|
|
808
|
+
emptyTableContentProps?.className,
|
|
809
|
+
),
|
|
810
|
+
},
|
|
777
811
|
React.createElement('div', null, emptyTableContent),
|
|
778
812
|
),
|
|
779
813
|
!isLoading &&
|
|
@@ -781,7 +815,14 @@ const Table = (props) => {
|
|
|
781
815
|
areFiltersSet &&
|
|
782
816
|
React.createElement(
|
|
783
817
|
index_js_2.Box,
|
|
784
|
-
{
|
|
818
|
+
{
|
|
819
|
+
as: 'div',
|
|
820
|
+
...emptyTableContentProps,
|
|
821
|
+
className: (0, classnames_1.default)(
|
|
822
|
+
'iui-table-empty',
|
|
823
|
+
emptyTableContentProps?.className,
|
|
824
|
+
),
|
|
825
|
+
},
|
|
785
826
|
React.createElement('div', null, emptyFilteredTableContent),
|
|
786
827
|
),
|
|
787
828
|
),
|
|
@@ -45,7 +45,7 @@ const TableCell = (props) => {
|
|
|
45
45
|
}
|
|
46
46
|
const multiplier = 26 + expanderMargin; // 26 = expander width
|
|
47
47
|
return {
|
|
48
|
-
|
|
48
|
+
paddingInlineStart: cellPadding + dynamicMargin * multiplier,
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
const cellElementProps = cell.getCellProps({
|