@itwin/itwinui-react 3.0.0-dev.6 → 3.0.0-dev.8
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 +101 -0
- package/cjs/core/Alert/Alert.d.ts +20 -9
- package/cjs/core/Alert/Alert.js +48 -10
- 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/ButtonGroup/ButtonGroup.js +41 -36
- 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.js +1 -1
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +5 -1
- package/cjs/core/Buttons/IconButton/IconButton.js +27 -38
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
- package/cjs/core/Buttons/SplitButton/SplitButton.js +25 -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/ColorPicker/ColorInputPanel.js +172 -231
- package/cjs/core/ComboBox/ComboBox.js +3 -3
- package/cjs/core/ComboBox/ComboBoxDropdown.js +4 -9
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +3 -22
- package/cjs/core/ComboBox/ComboBoxInput.js +1 -1
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxMenu.js +5 -5
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +8 -6
- package/cjs/core/ComboBox/helpers.d.ts +1 -2
- package/cjs/core/DatePicker/DatePicker.d.ts +30 -8
- package/cjs/core/DatePicker/DatePicker.js +47 -6
- package/cjs/core/Dialog/Dialog.js +10 -17
- package/cjs/core/Dialog/DialogContext.d.ts +3 -4
- package/cjs/core/Dialog/DialogMain.js +5 -5
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +39 -18
- 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/HeaderDropdownButton.js +1 -1
- package/cjs/core/Header/HeaderSplitButton.js +3 -4
- package/cjs/core/Input/Input.d.ts +4 -0
- package/cjs/core/Input/Input.js +2 -1
- package/cjs/core/InputGrid/InputGrid.d.ts +25 -0
- package/cjs/core/InputGrid/InputGrid.js +39 -0
- package/cjs/core/InputGrid/index.d.ts +3 -0
- package/cjs/core/InputGrid/index.js +15 -0
- package/cjs/core/InputGroup/InputGroup.d.ts +13 -0
- package/cjs/core/InputGroup/InputGroup.js +35 -9
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/cjs/core/InputWithDecorations/InputWithDecorations.js +81 -0
- package/cjs/core/InputWithDecorations/index.d.ts +3 -0
- package/cjs/core/InputWithDecorations/index.js +15 -0
- package/cjs/core/Label/Label.d.ts +5 -0
- package/cjs/core/Label/Label.js +2 -0
- package/cjs/core/LabeledInput/LabeledInput.d.ts +22 -16
- package/cjs/core/LabeledInput/LabeledInput.js +52 -29
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +17 -7
- package/cjs/core/LabeledSelect/LabeledSelect.js +36 -17
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +12 -45
- package/cjs/core/Menu/Menu.d.ts +1 -1
- package/cjs/core/Menu/Menu.js +1 -1
- package/cjs/core/Menu/MenuDivider.d.ts +2 -1
- package/cjs/core/Menu/MenuDivider.js +1 -1
- package/cjs/core/Menu/MenuItem.d.ts +1 -1
- package/cjs/core/Menu/MenuItem.js +1 -0
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
- package/cjs/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
- package/cjs/core/ProgressIndicators/ProgressLinear.js +9 -1
- package/cjs/core/SearchBox/SearchBox.js +1 -1
- package/cjs/core/Select/Select.d.ts +4 -0
- package/cjs/core/Select/Select.js +12 -11
- package/cjs/core/SideNavigation/SideNavigation.d.ts +16 -0
- package/cjs/core/SideNavigation/SideNavigation.js +42 -9
- package/cjs/core/Slider/Slider.d.ts +24 -0
- package/cjs/core/Slider/Slider.js +58 -10
- package/cjs/core/Slider/Thumb.js +3 -2
- package/cjs/core/Slider/Track.d.ts +1 -1
- package/cjs/core/Slider/Track.js +17 -6
- package/cjs/core/StatusMessage/StatusMessage.d.ts +12 -2
- package/cjs/core/StatusMessage/StatusMessage.js +23 -9
- 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 +3 -1
- package/cjs/core/Table/Table.js +0 -1
- package/cjs/core/Table/TableCell.js +1 -1
- package/cjs/core/Table/TablePaginator.js +1 -3
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +46 -18
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
- package/cjs/core/Tabs/Tab.js +1 -2
- package/cjs/core/Textarea/Textarea.d.ts +7 -1
- package/cjs/core/Textarea/Textarea.js +6 -11
- 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 +142 -17
- package/cjs/core/Tile/Tile.js +107 -16
- package/cjs/core/Toast/Toast.d.ts +12 -4
- package/cjs/core/Toast/Toast.js +24 -13
- package/cjs/core/Tooltip/Tooltip.d.ts +35 -28
- package/cjs/core/Tooltip/Tooltip.js +116 -118
- package/cjs/core/TransferList/TransferList.js +4 -12
- package/cjs/core/Tree/TreeNode.js +1 -1
- package/cjs/core/index.d.ts +2 -0
- package/cjs/core/index.js +20 -4
- package/cjs/core/utils/components/ButtonBase.d.ts +14 -0
- package/cjs/core/utils/components/ButtonBase.js +46 -0
- package/cjs/core/utils/components/Icon.d.ts +5 -0
- package/cjs/core/utils/components/Icon.js +8 -1
- package/cjs/core/utils/components/InputContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputContainer.js +14 -34
- package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -0
- package/cjs/core/utils/components/InputFlexContainer.js +3 -1
- package/cjs/core/utils/components/Popover.js +5 -3
- package/cjs/core/utils/components/Portal.d.ts +27 -0
- package/cjs/core/utils/components/Portal.js +43 -0
- package/cjs/core/utils/components/VirtualScroll.js +4 -4
- package/cjs/core/utils/components/index.d.ts +2 -0
- package/cjs/core/utils/components/index.js +2 -0
- package/cjs/core/utils/functions/colors.d.ts +1 -1
- package/cjs/core/utils/functions/colors.js +1 -13
- package/cjs/core/utils/functions/index.d.ts +1 -0
- package/cjs/core/utils/functions/index.js +1 -0
- package/cjs/core/utils/functions/react.d.ts +8 -0
- package/cjs/core/utils/functions/react.js +40 -0
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useControlledState.d.ts +13 -0
- package/cjs/core/utils/hooks/useControlledState.js +39 -0
- package/cjs/core/utils/hooks/useGlobals.d.ts +1 -1
- package/cjs/styles.js +11 -35
- package/esm/core/Alert/Alert.d.ts +20 -9
- package/esm/core/Alert/Alert.js +49 -10
- 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/ButtonGroup/ButtonGroup.js +41 -36
- 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.js +1 -1
- package/esm/core/Buttons/IconButton/IconButton.d.ts +5 -1
- package/esm/core/Buttons/IconButton/IconButton.js +25 -37
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
- package/esm/core/Buttons/SplitButton/SplitButton.js +31 -14
- 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/ColorPicker/ColorInputPanel.js +173 -232
- package/esm/core/ComboBox/ComboBox.js +3 -3
- package/esm/core/ComboBox/ComboBoxDropdown.js +4 -9
- package/esm/core/ComboBox/ComboBoxEndIcon.js +4 -25
- package/esm/core/ComboBox/ComboBoxInput.js +1 -1
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxMenu.js +5 -5
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenuItem.js +9 -7
- package/esm/core/ComboBox/helpers.d.ts +1 -2
- package/esm/core/DatePicker/DatePicker.d.ts +30 -8
- package/esm/core/DatePicker/DatePicker.js +33 -6
- package/esm/core/Dialog/Dialog.js +11 -23
- package/esm/core/Dialog/DialogContext.d.ts +3 -4
- package/esm/core/Dialog/DialogMain.js +5 -5
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
- package/esm/core/ExpandableBlock/ExpandableBlock.js +41 -20
- 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/HeaderDropdownButton.js +1 -1
- package/esm/core/Header/HeaderSplitButton.js +9 -5
- package/esm/core/Input/Input.d.ts +4 -0
- package/esm/core/Input/Input.js +2 -1
- package/esm/core/InputGrid/InputGrid.d.ts +25 -0
- package/esm/core/InputGrid/InputGrid.js +35 -0
- package/esm/core/InputGrid/index.d.ts +3 -0
- package/esm/core/InputGrid/index.js +6 -0
- package/esm/core/InputGroup/InputGroup.d.ts +13 -0
- package/esm/core/InputGroup/InputGroup.js +34 -10
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/esm/core/InputWithDecorations/InputWithDecorations.js +80 -0
- package/esm/core/InputWithDecorations/index.d.ts +3 -0
- package/esm/core/InputWithDecorations/index.js +6 -0
- package/esm/core/Label/Label.d.ts +5 -0
- package/esm/core/Label/Label.js +2 -0
- package/esm/core/LabeledInput/LabeledInput.d.ts +22 -16
- package/esm/core/LabeledInput/LabeledInput.js +53 -29
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +17 -7
- package/esm/core/LabeledSelect/LabeledSelect.js +37 -18
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
- package/esm/core/LabeledTextarea/LabeledTextarea.js +14 -45
- package/esm/core/Menu/Menu.d.ts +1 -1
- package/esm/core/Menu/Menu.js +1 -1
- package/esm/core/Menu/MenuDivider.d.ts +2 -1
- package/esm/core/Menu/MenuDivider.js +1 -1
- package/esm/core/Menu/MenuItem.d.ts +1 -1
- package/esm/core/Menu/MenuItem.js +1 -0
- package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/esm/core/Menu/MenuItemSkeleton.js +0 -1
- package/esm/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
- package/esm/core/ProgressIndicators/ProgressLinear.js +9 -1
- package/esm/core/SearchBox/SearchBox.js +1 -1
- package/esm/core/Select/Select.d.ts +4 -0
- package/esm/core/Select/Select.js +12 -11
- package/esm/core/SideNavigation/SideNavigation.d.ts +16 -0
- package/esm/core/SideNavigation/SideNavigation.js +33 -9
- package/esm/core/Slider/Slider.d.ts +24 -0
- package/esm/core/Slider/Slider.js +43 -10
- package/esm/core/Slider/Thumb.js +3 -2
- package/esm/core/Slider/Track.d.ts +1 -1
- package/esm/core/Slider/Track.js +14 -6
- package/esm/core/StatusMessage/StatusMessage.d.ts +12 -2
- package/esm/core/StatusMessage/StatusMessage.js +23 -16
- 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 +3 -1
- package/esm/core/Table/Table.js +0 -1
- package/esm/core/Table/TableCell.js +1 -1
- package/esm/core/Table/TablePaginator.js +2 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +45 -17
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
- package/esm/core/Tabs/Tab.js +2 -3
- package/esm/core/Textarea/Textarea.d.ts +7 -1
- package/esm/core/Textarea/Textarea.js +6 -11
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +23 -3
- package/esm/core/ThemeProvider/ThemeProvider.js +65 -24
- package/esm/core/Tile/Tile.d.ts +142 -17
- package/esm/core/Tile/Tile.js +107 -16
- package/esm/core/Toast/Toast.d.ts +12 -4
- package/esm/core/Toast/Toast.js +26 -13
- package/esm/core/Tooltip/Tooltip.d.ts +35 -28
- package/esm/core/Tooltip/Tooltip.js +119 -116
- package/esm/core/TransferList/TransferList.js +4 -9
- package/esm/core/Tree/TreeNode.js +1 -1
- package/esm/core/index.d.ts +2 -0
- package/esm/core/index.js +2 -0
- package/esm/core/utils/components/ButtonBase.d.ts +14 -0
- package/esm/core/utils/components/ButtonBase.js +42 -0
- package/esm/core/utils/components/Icon.d.ts +5 -0
- package/esm/core/utils/components/Icon.js +8 -1
- package/esm/core/utils/components/InputContainer.d.ts +0 -1
- package/esm/core/utils/components/InputContainer.js +14 -30
- package/esm/core/utils/components/InputFlexContainer.d.ts +1 -0
- package/esm/core/utils/components/InputFlexContainer.js +3 -1
- package/esm/core/utils/components/Popover.js +5 -3
- package/esm/core/utils/components/Portal.d.ts +27 -0
- package/esm/core/utils/components/Portal.js +36 -0
- package/esm/core/utils/components/VirtualScroll.js +4 -4
- package/esm/core/utils/components/index.d.ts +2 -0
- package/esm/core/utils/components/index.js +2 -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/index.d.ts +1 -0
- package/esm/core/utils/functions/index.js +1 -0
- package/esm/core/utils/functions/react.d.ts +8 -0
- package/esm/core/utils/functions/react.js +35 -0
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useControlledState.d.ts +13 -0
- package/esm/core/utils/hooks/useControlledState.js +34 -0
- package/esm/core/utils/hooks/useGlobals.d.ts +1 -1
- package/esm/styles.js +11 -35
- package/package.json +3 -3
- package/styles.css +49 -46
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
|
+
type InputGridOwnProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Set display style of label.
|
|
5
|
+
* Supported values:
|
|
6
|
+
* - 'default' - label appears above input.
|
|
7
|
+
* - 'inline' - appears in the same line as input.
|
|
8
|
+
* @default 'default'
|
|
9
|
+
*/
|
|
10
|
+
labelPlacement?: 'default' | 'inline';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* InputGrid component is used to display inputs (input, textarea, select)
|
|
14
|
+
* with label and/or status message
|
|
15
|
+
*
|
|
16
|
+
* @usage
|
|
17
|
+
*
|
|
18
|
+
* <InputGrid>
|
|
19
|
+
* <Label htmlFor='input-1'>This is label</Label>
|
|
20
|
+
* <Input id='input-1'/>
|
|
21
|
+
* <StatusMessage>This is message</StatusMessage>
|
|
22
|
+
* </InputGrid>
|
|
23
|
+
*/
|
|
24
|
+
export declare const InputGrid: PolymorphicForwardRefComponent<"div", InputGridOwnProps>;
|
|
25
|
+
export default InputGrid;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { Box } from '../utils/index.js';
|
|
7
|
+
import cx from 'classnames';
|
|
8
|
+
//-------------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* InputGrid component is used to display inputs (input, textarea, select)
|
|
11
|
+
* with label and/or status message
|
|
12
|
+
*
|
|
13
|
+
* @usage
|
|
14
|
+
*
|
|
15
|
+
* <InputGrid>
|
|
16
|
+
* <Label htmlFor='input-1'>This is label</Label>
|
|
17
|
+
* <Input id='input-1'/>
|
|
18
|
+
* <StatusMessage>This is message</StatusMessage>
|
|
19
|
+
* </InputGrid>
|
|
20
|
+
*/
|
|
21
|
+
export const InputGrid = React.forwardRef((props, ref) => {
|
|
22
|
+
const { children, className, labelPlacement = undefined, ...rest } = props;
|
|
23
|
+
return React.createElement(
|
|
24
|
+
Box,
|
|
25
|
+
{
|
|
26
|
+
className: cx('iui-input-grid', className),
|
|
27
|
+
'data-iui-label-placement': labelPlacement,
|
|
28
|
+
ref: ref,
|
|
29
|
+
...rest,
|
|
30
|
+
},
|
|
31
|
+
children,
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
//-------------------------------------------------------------------------------
|
|
35
|
+
export default InputGrid;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { InputGrid } from './InputGrid.js';
|
|
6
|
+
export default './InputGrid';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
3
|
+
import { StatusMessage } from '../StatusMessage/index.js';
|
|
3
4
|
type InputGroupProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Label of the group.
|
|
@@ -36,6 +37,18 @@ type InputGroupProps = {
|
|
|
36
37
|
* Child inputs inside group.
|
|
37
38
|
*/
|
|
38
39
|
children: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Passes properties for label.
|
|
42
|
+
*/
|
|
43
|
+
labelProps?: React.ComponentProps<'label'>;
|
|
44
|
+
/**
|
|
45
|
+
* Passes properties for message.
|
|
46
|
+
*/
|
|
47
|
+
messageProps?: Pick<React.ComponentProps<typeof StatusMessage>, 'iconProps' | 'contentProps'>;
|
|
48
|
+
/**
|
|
49
|
+
* Passes properties for inner input group element.
|
|
50
|
+
*/
|
|
51
|
+
innerProps?: React.ComponentProps<'div'>;
|
|
39
52
|
};
|
|
40
53
|
/**
|
|
41
54
|
* Group Checkbox/Radio components together
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import cx from 'classnames';
|
|
7
|
+
import { StatusIconMap, Box } from '../utils/index.js';
|
|
8
|
+
import { InputGrid } from '../InputGrid/index.js';
|
|
9
|
+
import { Label } from '../Label/index.js';
|
|
10
|
+
import { StatusMessage } from '../StatusMessage/index.js';
|
|
7
11
|
/**
|
|
8
12
|
* Group Checkbox/Radio components together
|
|
9
13
|
* @example
|
|
@@ -21,6 +25,7 @@ import { StatusIconMap, InputContainer, Box } from '../utils/index.js';
|
|
|
21
25
|
*/
|
|
22
26
|
export const InputGroup = React.forwardRef((props, forwardedRef) => {
|
|
23
27
|
const {
|
|
28
|
+
className,
|
|
24
29
|
children,
|
|
25
30
|
disabled = false,
|
|
26
31
|
displayStyle = 'default',
|
|
@@ -29,6 +34,9 @@ export const InputGroup = React.forwardRef((props, forwardedRef) => {
|
|
|
29
34
|
status,
|
|
30
35
|
svgIcon,
|
|
31
36
|
required = false,
|
|
37
|
+
labelProps,
|
|
38
|
+
messageProps,
|
|
39
|
+
innerProps,
|
|
32
40
|
...rest
|
|
33
41
|
} = props;
|
|
34
42
|
const icon = () => {
|
|
@@ -43,19 +51,35 @@ export const InputGroup = React.forwardRef((props, forwardedRef) => {
|
|
|
43
51
|
return undefined;
|
|
44
52
|
};
|
|
45
53
|
return React.createElement(
|
|
46
|
-
|
|
54
|
+
InputGrid,
|
|
47
55
|
{
|
|
48
|
-
label: label,
|
|
49
|
-
disabled: disabled,
|
|
50
|
-
required: required,
|
|
51
|
-
status: status,
|
|
52
|
-
message: message,
|
|
53
|
-
icon: icon(),
|
|
54
|
-
isLabelInline: displayStyle === 'inline',
|
|
55
56
|
ref: forwardedRef,
|
|
57
|
+
as: 'div',
|
|
58
|
+
labelPlacement: displayStyle,
|
|
59
|
+
className: cx('iui-input-group-wrapper', className),
|
|
56
60
|
...rest,
|
|
57
61
|
},
|
|
58
|
-
|
|
62
|
+
label &&
|
|
63
|
+
React.createElement(
|
|
64
|
+
Label,
|
|
65
|
+
{ as: 'label', required: required, disabled: disabled, ...labelProps },
|
|
66
|
+
label,
|
|
67
|
+
),
|
|
68
|
+
React.createElement(
|
|
69
|
+
Box,
|
|
70
|
+
{
|
|
71
|
+
as: 'div',
|
|
72
|
+
...innerProps,
|
|
73
|
+
className: cx('iui-input-group', innerProps?.className),
|
|
74
|
+
},
|
|
75
|
+
children,
|
|
76
|
+
),
|
|
77
|
+
(message || status || svgIcon) &&
|
|
78
|
+
React.createElement(
|
|
79
|
+
StatusMessage,
|
|
80
|
+
{ startIcon: icon(), status: status, ...messageProps },
|
|
81
|
+
displayStyle !== 'inline' && message,
|
|
82
|
+
),
|
|
59
83
|
);
|
|
60
84
|
});
|
|
61
85
|
export default InputGroup;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
3
|
+
import type { InputProps } from '../Input/Input.js';
|
|
4
|
+
/**
|
|
5
|
+
* Input component with various additional decorations.
|
|
6
|
+
* You can add icons, buttons and other various subcomponents to it.
|
|
7
|
+
*
|
|
8
|
+
* If you are not using default InputWithDecorations.Icon and InputWithDecorations.Button, use borderless versions of other components.
|
|
9
|
+
*
|
|
10
|
+
* @usage
|
|
11
|
+
* <InputWithDecorations>
|
|
12
|
+
* <InputWithDecorations.Input />
|
|
13
|
+
* <InputWithDecorations.Icon>
|
|
14
|
+
* <SvgAdd />
|
|
15
|
+
* </InputWithDecorations.Icon>
|
|
16
|
+
* </InputWithDecorations>
|
|
17
|
+
*/
|
|
18
|
+
export declare const InputWithDecorations: PolymorphicForwardRefComponent<"div", Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
20
|
+
}, "as" | keyof import("../utils/index.js").InputFlexContainerProps> & import("../utils/index.js").InputFlexContainerProps & {
|
|
21
|
+
as?: "div" | undefined;
|
|
22
|
+
}> & {
|
|
23
|
+
/**
|
|
24
|
+
* Subcomponent to include input in your InputWithDecorations
|
|
25
|
+
*/
|
|
26
|
+
Input: PolymorphicForwardRefComponent<"input", InputProps>;
|
|
27
|
+
/**
|
|
28
|
+
* Subcomponent to include button in your InputWithDecorations
|
|
29
|
+
*/
|
|
30
|
+
Button: PolymorphicForwardRefComponent<"span", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
31
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
32
|
+
}, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "isActive" | "iconProps"> & {
|
|
33
|
+
isActive?: boolean | undefined;
|
|
34
|
+
label?: React.ReactNode;
|
|
35
|
+
iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
|
|
36
|
+
} & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
37
|
+
as?: "button" | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { Box, InputFlexContainer, useSafeContext } from '../utils/index.js';
|
|
7
|
+
import { IconButton } from '../Buttons/index.js';
|
|
8
|
+
const InputWithDecorationsContext = React.createContext(undefined);
|
|
9
|
+
const InputWithDecorationsComponent = React.forwardRef((props, ref) => {
|
|
10
|
+
const { children, size, isDisabled, ...rest } = props;
|
|
11
|
+
return React.createElement(
|
|
12
|
+
InputWithDecorationsContext.Provider,
|
|
13
|
+
{ value: { size, isDisabled } },
|
|
14
|
+
React.createElement(
|
|
15
|
+
InputFlexContainer,
|
|
16
|
+
{ isDisabled: isDisabled, size: size, ref: ref, ...rest },
|
|
17
|
+
children,
|
|
18
|
+
),
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
//-------------------------------------------------------------------------------
|
|
22
|
+
const InputWithDecorationsInput = React.forwardRef((props, ref) => {
|
|
23
|
+
const { id: idProp, size, disabled: localDisabled, ...rest } = props;
|
|
24
|
+
const { size: contextSize, isDisabled } = useSafeContext(
|
|
25
|
+
InputWithDecorationsContext,
|
|
26
|
+
);
|
|
27
|
+
return React.createElement(Box, {
|
|
28
|
+
as: 'input',
|
|
29
|
+
ref: ref,
|
|
30
|
+
'data-iui-size': size ?? contextSize,
|
|
31
|
+
disabled: localDisabled ?? isDisabled,
|
|
32
|
+
id: idProp,
|
|
33
|
+
...rest,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
//-------------------------------------------------------------------------------
|
|
37
|
+
const InputWithDecorationsButton = React.forwardRef((props, ref) => {
|
|
38
|
+
const { children, size, disabled: localDisabled, ...rest } = props;
|
|
39
|
+
const { size: contextSize, isDisabled } = useSafeContext(
|
|
40
|
+
InputWithDecorationsContext,
|
|
41
|
+
);
|
|
42
|
+
return React.createElement(
|
|
43
|
+
IconButton,
|
|
44
|
+
{
|
|
45
|
+
ref: ref,
|
|
46
|
+
size: size ?? contextSize,
|
|
47
|
+
styleType: 'borderless',
|
|
48
|
+
disabled: localDisabled ?? isDisabled,
|
|
49
|
+
...rest,
|
|
50
|
+
},
|
|
51
|
+
children,
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Input component with various additional decorations.
|
|
56
|
+
* You can add icons, buttons and other various subcomponents to it.
|
|
57
|
+
*
|
|
58
|
+
* If you are not using default InputWithDecorations.Icon and InputWithDecorations.Button, use borderless versions of other components.
|
|
59
|
+
*
|
|
60
|
+
* @usage
|
|
61
|
+
* <InputWithDecorations>
|
|
62
|
+
* <InputWithDecorations.Input />
|
|
63
|
+
* <InputWithDecorations.Icon>
|
|
64
|
+
* <SvgAdd />
|
|
65
|
+
* </InputWithDecorations.Icon>
|
|
66
|
+
* </InputWithDecorations>
|
|
67
|
+
*/
|
|
68
|
+
export const InputWithDecorations = Object.assign(
|
|
69
|
+
InputWithDecorationsComponent,
|
|
70
|
+
{
|
|
71
|
+
/**
|
|
72
|
+
* Subcomponent to include input in your InputWithDecorations
|
|
73
|
+
*/
|
|
74
|
+
Input: InputWithDecorationsInput,
|
|
75
|
+
/**
|
|
76
|
+
* Subcomponent to include button in your InputWithDecorations
|
|
77
|
+
*/
|
|
78
|
+
Button: InputWithDecorationsButton,
|
|
79
|
+
},
|
|
80
|
+
);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { InputWithDecorations } from './InputWithDecorations.js';
|
|
6
|
+
export default './Input';
|
|
@@ -12,6 +12,11 @@ type LabelOwnProps = {
|
|
|
12
12
|
* This adds an asterisk next to the label text.
|
|
13
13
|
*/
|
|
14
14
|
required?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Adds disabled styling to a label.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
15
20
|
};
|
|
16
21
|
/**
|
|
17
22
|
* A standalone label to be used with input components (using `htmlFor`).
|
package/esm/core/Label/Label.js
CHANGED
|
@@ -16,6 +16,7 @@ export const Label = React.forwardRef((props, forwardedRef) => {
|
|
|
16
16
|
const {
|
|
17
17
|
displayStyle = 'block',
|
|
18
18
|
required,
|
|
19
|
+
disabled,
|
|
19
20
|
className,
|
|
20
21
|
children,
|
|
21
22
|
...rest
|
|
@@ -32,6 +33,7 @@ export const Label = React.forwardRef((props, forwardedRef) => {
|
|
|
32
33
|
},
|
|
33
34
|
className,
|
|
34
35
|
),
|
|
36
|
+
'data-iui-disabled': disabled ? true : undefined,
|
|
35
37
|
ref: forwardedRef,
|
|
36
38
|
...rest,
|
|
37
39
|
},
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { Input } from '../Input/Input.js';
|
|
3
|
+
import { Icon } from '../utils/index.js';
|
|
3
4
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
5
|
+
import { InputGrid } from '../InputGrid/index.js';
|
|
6
|
+
import { InputWithDecorations } from '../InputWithDecorations/index.js';
|
|
4
7
|
export type LabeledInputProps = {
|
|
5
8
|
/**
|
|
6
9
|
* Label of the input.
|
|
@@ -17,15 +20,11 @@ export type LabeledInputProps = {
|
|
|
17
20
|
/**
|
|
18
21
|
* Custom svg icon. Will override status icon if specified.
|
|
19
22
|
*/
|
|
20
|
-
svgIcon?: JSX.Element;
|
|
23
|
+
svgIcon?: JSX.Element | null;
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Pass props to wrapper element.
|
|
23
26
|
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Custom CSS Style for the input element.
|
|
27
|
-
*/
|
|
28
|
-
inputStyle?: React.CSSProperties;
|
|
27
|
+
wrapperProps?: React.ComponentProps<typeof InputGrid>;
|
|
29
28
|
/**
|
|
30
29
|
* Set display style of label.
|
|
31
30
|
* Supported values:
|
|
@@ -35,15 +34,22 @@ export type LabeledInputProps = {
|
|
|
35
34
|
*/
|
|
36
35
|
displayStyle?: 'default' | 'inline';
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
|
|
37
|
+
* Passes properties for message content.
|
|
38
|
+
*/
|
|
39
|
+
messageContentProps?: React.ComponentPropsWithRef<'div'>;
|
|
40
|
+
/**
|
|
41
|
+
* Passes properties for icon.
|
|
42
|
+
*/
|
|
43
|
+
iconProps?: React.ComponentProps<typeof Icon>;
|
|
44
|
+
/**
|
|
45
|
+
* Passes properties for label.
|
|
46
|
+
*/
|
|
47
|
+
labelProps?: React.ComponentProps<'label'>;
|
|
48
|
+
/**
|
|
49
|
+
* Passes properties for input wrapper.
|
|
44
50
|
*/
|
|
45
|
-
|
|
46
|
-
} &
|
|
51
|
+
inputWrapperProps?: React.ComponentProps<typeof InputWithDecorations>;
|
|
52
|
+
} & React.ComponentProps<typeof Input>;
|
|
47
53
|
/**
|
|
48
54
|
* Basic labeled input component
|
|
49
55
|
* @example
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { Input } from '../Input/Input.js';
|
|
7
|
-
import { StatusIconMap,
|
|
7
|
+
import { StatusIconMap, useId, Icon } from '../utils/index.js';
|
|
8
|
+
import { InputGrid } from '../InputGrid/index.js';
|
|
9
|
+
import { InputWithDecorations } from '../InputWithDecorations/index.js';
|
|
10
|
+
import { StatusMessage } from '../StatusMessage/StatusMessage.js';
|
|
11
|
+
import { Label } from '../Label/Label.js';
|
|
8
12
|
/**
|
|
9
13
|
* Basic labeled input component
|
|
10
14
|
* @example
|
|
@@ -16,46 +20,66 @@ import { StatusIconMap, InputContainer, useId } from '../utils/index.js';
|
|
|
16
20
|
export const LabeledInput = React.forwardRef((props, ref) => {
|
|
17
21
|
const uid = useId();
|
|
18
22
|
const {
|
|
19
|
-
className,
|
|
20
23
|
disabled = false,
|
|
21
24
|
label,
|
|
22
25
|
message,
|
|
23
26
|
status,
|
|
24
27
|
svgIcon,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
wrapperProps,
|
|
29
|
+
labelProps,
|
|
30
|
+
messageContentProps,
|
|
31
|
+
iconProps,
|
|
32
|
+
inputWrapperProps,
|
|
28
33
|
displayStyle = 'default',
|
|
29
|
-
iconDisplayStyle = displayStyle === 'default' ? 'block' : 'inline',
|
|
30
34
|
required = false,
|
|
31
35
|
id = uid,
|
|
32
36
|
...rest
|
|
33
37
|
} = props;
|
|
34
38
|
const icon = svgIcon ?? (status && StatusIconMap[status]());
|
|
39
|
+
const shouldShowIcon = svgIcon !== null && (svgIcon || (status && !message));
|
|
35
40
|
return React.createElement(
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
InputGrid,
|
|
42
|
+
{ labelPlacement: displayStyle, ...wrapperProps },
|
|
43
|
+
label &&
|
|
44
|
+
React.createElement(
|
|
45
|
+
Label,
|
|
46
|
+
{
|
|
47
|
+
as: 'label',
|
|
48
|
+
required: required,
|
|
49
|
+
disabled: disabled,
|
|
50
|
+
htmlFor: id,
|
|
51
|
+
...labelProps,
|
|
52
|
+
},
|
|
53
|
+
label,
|
|
54
|
+
),
|
|
55
|
+
React.createElement(
|
|
56
|
+
InputWithDecorations,
|
|
57
|
+
{ status: status, isDisabled: disabled, ...inputWrapperProps },
|
|
58
|
+
React.createElement(InputWithDecorations.Input, {
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
required: required,
|
|
61
|
+
id: id,
|
|
62
|
+
ref: ref,
|
|
63
|
+
...rest,
|
|
64
|
+
}),
|
|
65
|
+
shouldShowIcon &&
|
|
66
|
+
React.createElement(
|
|
67
|
+
Icon,
|
|
68
|
+
{ fill: !svgIcon ? status : undefined, padded: true, ...iconProps },
|
|
69
|
+
icon,
|
|
70
|
+
),
|
|
71
|
+
),
|
|
72
|
+
typeof message === 'string'
|
|
73
|
+
? React.createElement(
|
|
74
|
+
StatusMessage,
|
|
75
|
+
{
|
|
76
|
+
status: status,
|
|
77
|
+
iconProps: iconProps,
|
|
78
|
+
contentProps: messageContentProps,
|
|
79
|
+
},
|
|
80
|
+
message,
|
|
81
|
+
)
|
|
82
|
+
: message,
|
|
59
83
|
);
|
|
60
84
|
});
|
|
61
85
|
export default LabeledInput;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SelectProps } from '../Select/Select.js';
|
|
3
|
+
import { Icon } from '../utils/index.js';
|
|
3
4
|
import type { LabeledInputProps } from '../LabeledInput/LabeledInput.js';
|
|
5
|
+
import { InputGrid } from '../InputGrid/InputGrid.js';
|
|
4
6
|
export type LabeledSelectProps<T> = {
|
|
5
7
|
/**
|
|
6
8
|
* Label of the select.
|
|
@@ -20,18 +22,26 @@ export type LabeledSelectProps<T> = {
|
|
|
20
22
|
*/
|
|
21
23
|
svgIcon?: JSX.Element;
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* If true, shows a red asterisk but does not prevent form submission.
|
|
26
|
+
* @default false
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
required?: boolean;
|
|
26
29
|
/**
|
|
27
|
-
*
|
|
30
|
+
* Pass props to wrapper element.
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
wrapperProps?: React.ComponentProps<typeof InputGrid>;
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @default false
|
|
34
|
+
* Passes properties for label.
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
labelProps?: React.ComponentProps<'div'>;
|
|
37
|
+
/**
|
|
38
|
+
* Passes properties for message content.
|
|
39
|
+
*/
|
|
40
|
+
messageContentProps?: React.ComponentPropsWithRef<'div'>;
|
|
41
|
+
/**
|
|
42
|
+
* Passes properties for message icon.
|
|
43
|
+
*/
|
|
44
|
+
messageIconProps?: React.ComponentProps<typeof Icon>;
|
|
35
45
|
} & Pick<LabeledInputProps, 'displayStyle'> & SelectProps<T>;
|
|
36
46
|
/**
|
|
37
47
|
* Labeled select component to select value from options.
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { Select } from '../Select/index.js';
|
|
7
|
-
import { StatusIconMap,
|
|
7
|
+
import { StatusIconMap, useId, Icon } from '../utils/index.js';
|
|
8
|
+
import { StatusMessage } from '../StatusMessage/StatusMessage.js';
|
|
9
|
+
import { InputGrid } from '../InputGrid/InputGrid.js';
|
|
10
|
+
import { Label } from '../Label/Label.js';
|
|
8
11
|
/**
|
|
9
12
|
* Labeled select component to select value from options.
|
|
10
13
|
* @example
|
|
@@ -48,16 +51,18 @@ export const LabeledSelect = (props) => {
|
|
|
48
51
|
svgIcon,
|
|
49
52
|
displayStyle = 'default',
|
|
50
53
|
style,
|
|
51
|
-
selectClassName,
|
|
52
|
-
selectStyle,
|
|
53
54
|
required = false,
|
|
54
55
|
triggerProps,
|
|
56
|
+
wrapperProps,
|
|
57
|
+
labelProps,
|
|
58
|
+
messageContentProps,
|
|
59
|
+
messageIconProps,
|
|
55
60
|
...rest
|
|
56
61
|
} = props;
|
|
57
62
|
const labelId = `${useId()}-label`;
|
|
58
63
|
const icon = () => {
|
|
59
64
|
if (svgIcon) {
|
|
60
|
-
return React.
|
|
65
|
+
return React.createElement(Icon, null, svgIcon);
|
|
61
66
|
}
|
|
62
67
|
if (status && message) {
|
|
63
68
|
return StatusIconMap[status]();
|
|
@@ -65,29 +70,43 @@ export const LabeledSelect = (props) => {
|
|
|
65
70
|
return undefined;
|
|
66
71
|
};
|
|
67
72
|
return React.createElement(
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
73
|
+
InputGrid,
|
|
74
|
+
{ labelPlacement: displayStyle, ...wrapperProps },
|
|
75
|
+
label &&
|
|
76
|
+
React.createElement(
|
|
77
|
+
Label,
|
|
78
|
+
{
|
|
79
|
+
as: 'div',
|
|
80
|
+
required: required,
|
|
81
|
+
disabled: disabled,
|
|
82
|
+
id: labelId,
|
|
83
|
+
...labelProps,
|
|
84
|
+
},
|
|
85
|
+
label,
|
|
86
|
+
),
|
|
87
|
+
React.createElement(Select, {
|
|
71
88
|
disabled: disabled,
|
|
72
|
-
required: required,
|
|
73
|
-
status: status,
|
|
74
|
-
message: message,
|
|
75
|
-
icon: displayStyle === 'default' ? icon() : undefined,
|
|
76
|
-
isLabelInline: displayStyle === 'inline',
|
|
77
89
|
className: className,
|
|
78
90
|
style: style,
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
React.createElement(Select, {
|
|
82
|
-
disabled: disabled,
|
|
83
|
-
className: selectClassName,
|
|
84
|
-
style: selectStyle,
|
|
91
|
+
status: status,
|
|
85
92
|
...rest,
|
|
86
93
|
triggerProps: {
|
|
87
94
|
'aria-labelledby': labelId,
|
|
88
95
|
...triggerProps,
|
|
89
96
|
},
|
|
90
97
|
}),
|
|
98
|
+
typeof message === 'string'
|
|
99
|
+
? React.createElement(
|
|
100
|
+
StatusMessage,
|
|
101
|
+
{
|
|
102
|
+
status: status,
|
|
103
|
+
startIcon: displayStyle === 'default' ? icon() : undefined,
|
|
104
|
+
iconProps: messageIconProps,
|
|
105
|
+
contentProps: messageContentProps,
|
|
106
|
+
},
|
|
107
|
+
message,
|
|
108
|
+
)
|
|
109
|
+
: message,
|
|
91
110
|
);
|
|
92
111
|
};
|
|
93
112
|
export default LabeledSelect;
|