@itwin/core-react 3.5.0-dev.19 → 3.5.0-dev.20
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/lib/cjs/core-react/UiCore.d.ts +40 -40
- package/lib/cjs/core-react/UiCore.js +85 -85
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/_geometry.scss +70 -70
- package/lib/cjs/core-react/_helpers.scss +51 -51
- package/lib/cjs/core-react/_math.scss +13 -13
- package/lib/cjs/core-react/_scrollbar.scss +51 -51
- package/lib/cjs/core-react/_typography.scss +44 -44
- package/lib/cjs/core-react/_z-index.scss +65 -65
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +96 -96
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js +174 -174
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +82 -82
- package/lib/cjs/core-react/badge/Badge.d.ts +18 -18
- package/lib/cjs/core-react/badge/Badge.js +26 -26
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.scss +13 -13
- package/lib/cjs/core-react/badge/BadgeUtilities.d.ts +12 -12
- package/lib/cjs/core-react/badge/BadgeUtilities.js +38 -38
- package/lib/cjs/core-react/badge/BadgeUtilities.js.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.d.ts +10 -10
- package/lib/cjs/core-react/badge/BetaBadge.js +23 -23
- package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.scss +9 -9
- package/lib/cjs/core-react/badge/NewBadge.d.ts +10 -10
- package/lib/cjs/core-react/badge/NewBadge.js +23 -23
- package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.scss +9 -9
- package/lib/cjs/core-react/base/Centered.d.ts +10 -10
- package/lib/cjs/core-react/base/Centered.js +20 -20
- package/lib/cjs/core-react/base/Centered.js.map +1 -1
- package/lib/cjs/core-react/base/Div.d.ts +16 -16
- package/lib/cjs/core-react/base/Div.js +20 -20
- package/lib/cjs/core-react/base/Div.js.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts +79 -79
- package/lib/cjs/core-react/base/DivWithOutsideClick.js +16 -16
- package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.d.ts +10 -10
- package/lib/cjs/core-react/base/FillCentered.js +20 -20
- package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +11 -11
- package/lib/cjs/core-react/base/FlexWrapContainer.js +21 -21
- package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/cjs/core-react/base/Gap.d.ts +15 -15
- package/lib/cjs/core-react/base/Gap.js +20 -20
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/base/PointerEvents.d.ts +7 -7
- package/lib/cjs/core-react/base/PointerEvents.js +17 -17
- package/lib/cjs/core-react/base/PointerEvents.js.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.d.ts +11 -11
- package/lib/cjs/core-react/base/ScrollView.js +21 -21
- package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
- package/lib/cjs/core-react/base/base.scss +42 -42
- package/lib/cjs/core-react/base/classes.scss +13 -13
- package/lib/cjs/core-react/base/index.scss +5 -5
- package/lib/cjs/core-react/button/Button.d.ts +47 -47
- package/lib/cjs/core-react/button/Button.js +85 -85
- package/lib/cjs/core-react/button/Button.js.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts +24 -24
- package/lib/cjs/core-react/button/UnderlinedButton.js +35 -35
- package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.scss +32 -32
- package/lib/cjs/core-react/button/blue-large.scss +12 -12
- package/lib/cjs/core-react/button/blue.scss +25 -25
- package/lib/cjs/core-react/button/button.scss +81 -81
- package/lib/cjs/core-react/button/classes.scss +14 -14
- package/lib/cjs/core-react/button/disabled-large.scss +12 -12
- package/lib/cjs/core-react/button/disabled.scss +17 -17
- package/lib/cjs/core-react/button/hollow-large.scss +13 -13
- package/lib/cjs/core-react/button/hollow.scss +30 -30
- package/lib/cjs/core-react/button/index.scss +14 -14
- package/lib/cjs/core-react/button/primary-large.scss +12 -12
- package/lib/cjs/core-react/button/primary.scss +25 -25
- package/lib/cjs/core-react/button/variables.scss +19 -19
- package/lib/cjs/core-react/checkbox/Checkbox.d.ts +56 -56
- package/lib/cjs/core-react/checkbox/Checkbox.js +64 -64
- package/lib/cjs/core-react/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/core-react/checkbox/checkbox.scss +129 -129
- package/lib/cjs/core-react/checkbox/classes.scss +8 -8
- package/lib/cjs/core-react/checkbox/index.scss +8 -8
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +37 -37
- package/lib/cjs/core-react/checklistbox/CheckListBox.js +42 -42
- package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.scss +22 -22
- package/lib/cjs/core-react/classes.scss +18 -18
- package/lib/cjs/core-react/colorthemes.scss +58 -58
- package/lib/cjs/core-react/colorvariables.scss +116 -116
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +91 -91
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +364 -364
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +238 -238
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts +18 -18
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js +26 -26
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts +12 -12
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js +23 -23
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +61 -61
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +108 -108
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts +51 -51
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +159 -159
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts +34 -34
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +59 -59
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts +53 -53
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +55 -55
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/TildeFinder.d.ts +18 -18
- package/lib/cjs/core-react/contextmenu/TildeFinder.js +70 -70
- package/lib/cjs/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts +132 -132
- package/lib/cjs/core-react/dialog/Dialog.js +366 -366
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.scss +241 -241
- package/lib/cjs/core-react/dialog/DialogButtonDef.d.ts +46 -46
- package/lib/cjs/core-react/dialog/DialogButtonDef.js +37 -37
- package/lib/cjs/core-react/dialog/DialogButtonDef.js.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.d.ts +28 -28
- package/lib/cjs/core-react/dialog/GlobalDialog.js +53 -53
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +41 -41
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +163 -163
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +85 -85
- package/lib/cjs/core-react/enums/Alignment.d.ts +22 -22
- package/lib/cjs/core-react/enums/Alignment.js +31 -31
- package/lib/cjs/core-react/enums/Alignment.js.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts +20 -20
- package/lib/cjs/core-react/enums/CheckBoxState.js +19 -19
- package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.d.ts +11 -11
- package/lib/cjs/core-react/enums/Orientation.js +19 -19
- package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
- package/lib/cjs/core-react/enums/SortDirection.d.ts +12 -12
- package/lib/cjs/core-react/enums/SortDirection.js +20 -20
- package/lib/cjs/core-react/enums/SortDirection.js.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.d.ts +14 -14
- package/lib/cjs/core-react/enums/TimeFormat.js +22 -22
- package/lib/cjs/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableBlock.d.ts +33 -33
- package/lib/cjs/core-react/expandable/ExpandableBlock.js +35 -35
- package/lib/cjs/core-react/expandable/ExpandableBlock.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableBlock.scss +145 -145
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts +35 -35
- package/lib/cjs/core-react/expandable/ExpandableList.js +57 -57
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.scss +8 -8
- package/lib/cjs/core-react/expandable/classes.scss +7 -7
- package/lib/cjs/core-react/expandable/index.scss +5 -5
- package/lib/cjs/core-react/expandable/list.scss +45 -45
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts +53 -53
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js +150 -150
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.d.ts +28 -28
- package/lib/cjs/core-react/focustrap/FocusTrap.js +196 -196
- package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/cjs/core-react/form/Field.d.ts +19 -19
- package/lib/cjs/core-react/form/Field.js +44 -44
- package/lib/cjs/core-react/form/Field.js.map +1 -1
- package/lib/cjs/core-react/form/Form.d.ts +131 -131
- package/lib/cjs/core-react/form/Form.js +131 -131
- package/lib/cjs/core-react/form/Form.js.map +1 -1
- package/lib/cjs/core-react/form/Form.scss +78 -78
- package/lib/cjs/core-react/hocs/withIsPressed.d.ts +77 -77
- package/lib/cjs/core-react/hocs/withIsPressed.js +46 -46
- package/lib/cjs/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts +103 -103
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +115 -115
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/hocs/withTimeout.d.ts +74 -74
- package/lib/cjs/core-react/hocs/withTimeout.js +46 -46
- package/lib/cjs/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.d.ts +24 -24
- package/lib/cjs/core-react/icons/IconComponent.js +54 -54
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.scss +20 -20
- package/lib/cjs/core-react/icons/SvgPath.d.ts +23 -23
- package/lib/cjs/core-react/icons/SvgPath.js +27 -27
- package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgSprite.d.ts +20 -20
- package/lib/cjs/core-react/icons/SvgSprite.js +26 -26
- package/lib/cjs/core-react/icons/SvgSprite.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgSprite.scss +15 -15
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts +26 -26
- package/lib/cjs/core-react/icons/WebFontIcon.js +22 -22
- package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.scss +17 -17
- package/lib/cjs/core-react/icons/classes.scss +10 -10
- package/lib/cjs/core-react/icons/index.scss +6 -6
- package/lib/cjs/core-react/icons/mixins.scss +25 -25
- package/lib/cjs/core-react/icons/variables.scss +21 -21
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +42 -42
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +56 -56
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
- package/lib/cjs/core-react/index.scss +27 -27
- package/lib/cjs/core-react/inputs/Input.d.ts +22 -22
- package/lib/cjs/core-react/inputs/Input.js +46 -46
- package/lib/cjs/core-react/inputs/Input.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.d.ts +18 -18
- package/lib/cjs/core-react/inputs/InputLabel.js +33 -33
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.d.ts +11 -11
- package/lib/cjs/core-react/inputs/InputStatus.js +19 -19
- package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts +33 -33
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js +9 -9
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledInput.d.ts +17 -17
- package/lib/cjs/core-react/inputs/LabeledInput.js +33 -33
- package/lib/cjs/core-react/inputs/LabeledInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledTextarea.d.ts +17 -17
- package/lib/cjs/core-react/inputs/LabeledTextarea.js +31 -31
- package/lib/cjs/core-react/inputs/LabeledTextarea.js.map +1 -1
- package/lib/cjs/core-react/inputs/Textarea.d.ts +22 -22
- package/lib/cjs/core-react/inputs/Textarea.js +35 -35
- package/lib/cjs/core-react/inputs/Textarea.js.map +1 -1
- package/lib/cjs/core-react/inputs/classes.scss +10 -10
- package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +23 -23
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js +29 -29
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.scss +35 -35
- package/lib/cjs/core-react/inputs/index.scss +11 -11
- package/lib/cjs/core-react/inputs/input.scss +60 -60
- package/lib/cjs/core-react/inputs/labeled-input.scss +103 -103
- package/lib/cjs/core-react/inputs/labeled-textarea.scss +77 -77
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +45 -45
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +148 -148
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +89 -89
- package/lib/cjs/core-react/inputs/textarea.scss +55 -55
- package/lib/cjs/core-react/inputs/variables.scss +33 -33
- package/lib/cjs/core-react/layout-variables.scss +15 -15
- package/lib/cjs/core-react/listbox/Listbox.d.ts +55 -55
- package/lib/cjs/core-react/listbox/Listbox.js +222 -222
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.scss +53 -53
- package/lib/cjs/core-react/loading/LoadingBar.d.ts +29 -29
- package/lib/cjs/core-react/loading/LoadingBar.js +40 -40
- package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.scss +29 -29
- package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +39 -39
- package/lib/cjs/core-react/loading/LoadingPrompt.js +44 -44
- package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.scss +33 -33
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +33 -33
- package/lib/cjs/core-react/loading/LoadingSpinner.js +45 -45
- package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.scss +26 -26
- package/lib/cjs/core-react/loading/LoadingStatus.d.ts +24 -24
- package/lib/cjs/core-react/loading/LoadingStatus.js +37 -37
- package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.scss +20 -20
- package/lib/cjs/core-react/loading/Spinner.d.ts +37 -37
- package/lib/cjs/core-react/loading/Spinner.js +60 -60
- package/lib/cjs/core-react/loading/Spinner.js.map +1 -1
- package/lib/cjs/core-react/loading/Spinner.scss +26 -26
- package/lib/cjs/core-react/loading/index.scss +5 -5
- package/lib/cjs/core-react/loading/mixins.scss +57 -57
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts +64 -64
- package/lib/cjs/core-react/messagebox/MessageBox.js +70 -70
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.scss +46 -46
- package/lib/cjs/core-react/messagebox/MessageSeverity.d.ts +15 -15
- package/lib/cjs/core-react/messagebox/MessageSeverity.js +23 -23
- package/lib/cjs/core-react/messagebox/MessageSeverity.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts +19 -19
- package/lib/cjs/core-react/notification/MessageRenderer.js +81 -81
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.d.ts +22 -22
- package/lib/cjs/core-react/notification/MessageType.js +24 -24
- package/lib/cjs/core-react/notification/MessageType.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.d.ts +109 -109
- package/lib/cjs/core-react/popup/Popup.js +419 -419
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.scss +240 -240
- package/lib/cjs/core-react/progress-indicators/ProgressBar.d.ts +28 -28
- package/lib/cjs/core-react/progress-indicators/ProgressBar.js +47 -47
- package/lib/cjs/core-react/progress-indicators/ProgressBar.js.map +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.d.ts +48 -48
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.js +73 -73
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.js.map +1 -1
- package/lib/cjs/core-react/progress-indicators/classes.scss +33 -33
- package/lib/cjs/core-react/progress-indicators/index.scss +6 -6
- package/lib/cjs/core-react/progress-indicators/progress-bar.scss +91 -91
- package/lib/cjs/core-react/progress-indicators/progress-spinner.scss +132 -132
- package/lib/cjs/core-react/radialmenu/Annulus.d.ts +54 -54
- package/lib/cjs/core-react/radialmenu/Annulus.js +82 -82
- package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +93 -93
- package/lib/cjs/core-react/radialmenu/RadialMenu.js +179 -179
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +56 -56
- package/lib/cjs/core-react/radio/Radio.d.ts +19 -19
- package/lib/cjs/core-react/radio/Radio.js +27 -27
- package/lib/cjs/core-react/radio/Radio.js.map +1 -1
- package/lib/cjs/core-react/radio/classes.scss +7 -7
- package/lib/cjs/core-react/radio/index.scss +8 -8
- package/lib/cjs/core-react/radio/radio.scss +89 -89
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts +52 -52
- package/lib/cjs/core-react/searchbox/SearchBox.js +109 -109
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.scss +53 -53
- package/lib/cjs/core-react/select/LabeledSelect.d.ts +19 -19
- package/lib/cjs/core-react/select/LabeledSelect.js +33 -33
- package/lib/cjs/core-react/select/LabeledSelect.js.map +1 -1
- package/lib/cjs/core-react/select/LabeledThemedSelect.d.ts +15 -15
- package/lib/cjs/core-react/select/LabeledThemedSelect.js +30 -30
- package/lib/cjs/core-react/select/LabeledThemedSelect.js.map +1 -1
- package/lib/cjs/core-react/select/Select.d.ts +52 -52
- package/lib/cjs/core-react/select/Select.js +59 -59
- package/lib/cjs/core-react/select/Select.js.map +1 -1
- package/lib/cjs/core-react/select/ThemedSelect.d.ts +103 -103
- package/lib/cjs/core-react/select/ThemedSelect.js +56 -56
- package/lib/cjs/core-react/select/ThemedSelect.js.map +1 -1
- package/lib/cjs/core-react/select/classes.scss +9 -9
- package/lib/cjs/core-react/select/index.scss +10 -10
- package/lib/cjs/core-react/select/labeled-select.scss +72 -72
- package/lib/cjs/core-react/select/labeled-themed-select.scss +77 -77
- package/lib/cjs/core-react/select/modalHelper.d.ts +4 -4
- package/lib/cjs/core-react/select/modalHelper.js +20 -20
- package/lib/cjs/core-react/select/modalHelper.js.map +1 -1
- package/lib/cjs/core-react/select/select.scss +73 -73
- package/lib/cjs/core-react/select/themed-select.scss +159 -159
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts +30 -30
- package/lib/cjs/core-react/settings/SettingsContainer.js +121 -121
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.scss +64 -64
- package/lib/cjs/core-react/settings/SettingsManager.d.ts +132 -132
- package/lib/cjs/core-react/settings/SettingsManager.js +122 -122
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/slider/Slider.d.ts +79 -79
- package/lib/cjs/core-react/slider/Slider.js +90 -90
- package/lib/cjs/core-react/slider/Slider.js.map +1 -1
- package/lib/cjs/core-react/slider/Slider.scss +96 -96
- package/lib/cjs/core-react/splitbutton/SplitButton.d.ts +61 -61
- package/lib/cjs/core-react/splitbutton/SplitButton.js +103 -103
- package/lib/cjs/core-react/splitbutton/SplitButton.js.map +1 -1
- package/lib/cjs/core-react/splitbutton/SplitButton.scss +137 -137
- package/lib/cjs/core-react/style/baseline.scss +13 -13
- package/lib/cjs/core-react/style/breakpoints.scss +41 -41
- package/lib/cjs/core-react/style/colors.scss +77 -77
- package/lib/cjs/core-react/style/data-viz.scss +23 -23
- package/lib/cjs/core-react/style/index.scss +17 -17
- package/lib/cjs/core-react/style/itwinui-overrides.scss +24 -24
- package/lib/cjs/core-react/style/mixins.scss +28 -28
- package/lib/cjs/core-react/style/opacity.scss +17 -17
- package/lib/cjs/core-react/style/space.scss +17 -17
- package/lib/cjs/core-react/style/speed.scss +13 -13
- package/lib/cjs/core-react/style/themecolors.scss +126 -126
- package/lib/cjs/core-react/style/typography.scss +43 -43
- package/lib/cjs/core-react/style/variables.scss +13 -13
- package/lib/cjs/core-react/tabs/HorizontalTabs.d.ts +10 -10
- package/lib/cjs/core-react/tabs/HorizontalTabs.js +21 -21
- package/lib/cjs/core-react/tabs/HorizontalTabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts +71 -71
- package/lib/cjs/core-react/tabs/Tabs.js +125 -125
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +9 -9
- package/lib/cjs/core-react/tabs/VerticalTabs.js +20 -20
- package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/classes.scss +8 -8
- package/lib/cjs/core-react/tabs/horizontal.scss +77 -77
- package/lib/cjs/core-react/tabs/index.scss +6 -6
- package/lib/cjs/core-react/tabs/tabs.scss +117 -117
- package/lib/cjs/core-react/tabs/vertical.scss +64 -64
- package/lib/cjs/core-react/text/BlockText.d.ts +9 -9
- package/lib/cjs/core-react/text/BlockText.js +19 -19
- package/lib/cjs/core-react/text/BlockText.js.map +1 -1
- package/lib/cjs/core-react/text/BodyText.d.ts +9 -9
- package/lib/cjs/core-react/text/BodyText.js +19 -19
- package/lib/cjs/core-react/text/BodyText.js.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.d.ts +6 -6
- package/lib/cjs/core-react/text/DisabledText.js +19 -19
- package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.d.ts +24 -24
- package/lib/cjs/core-react/text/FilteredText.js +40 -40
- package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.scss +10 -10
- package/lib/cjs/core-react/text/Headline.d.ts +10 -10
- package/lib/cjs/core-react/text/Headline.js +20 -20
- package/lib/cjs/core-react/text/Headline.js.map +1 -1
- package/lib/cjs/core-react/text/LeadingText.d.ts +10 -10
- package/lib/cjs/core-react/text/LeadingText.js +20 -20
- package/lib/cjs/core-react/text/LeadingText.js.map +1 -1
- package/lib/cjs/core-react/text/LeadingText2.d.ts +10 -10
- package/lib/cjs/core-react/text/LeadingText2.js +20 -20
- package/lib/cjs/core-react/text/LeadingText2.js.map +1 -1
- package/lib/cjs/core-react/text/MutedText.d.ts +9 -9
- package/lib/cjs/core-react/text/MutedText.js +19 -19
- package/lib/cjs/core-react/text/MutedText.js.map +1 -1
- package/lib/cjs/core-react/text/SmallText.d.ts +10 -10
- package/lib/cjs/core-react/text/SmallText.js +20 -20
- package/lib/cjs/core-react/text/SmallText.js.map +1 -1
- package/lib/cjs/core-react/text/StyledText.d.ts +16 -16
- package/lib/cjs/core-react/text/StyledText.js +20 -20
- package/lib/cjs/core-react/text/StyledText.js.map +1 -1
- package/lib/cjs/core-react/text/Subheading.d.ts +10 -10
- package/lib/cjs/core-react/text/Subheading.js +20 -20
- package/lib/cjs/core-react/text/Subheading.js.map +1 -1
- package/lib/cjs/core-react/text/Subheading2.d.ts +10 -10
- package/lib/cjs/core-react/text/Subheading2.js +20 -20
- package/lib/cjs/core-react/text/Subheading2.js.map +1 -1
- package/lib/cjs/core-react/text/TextProps.d.ts +10 -10
- package/lib/cjs/core-react/text/TextProps.js +9 -9
- package/lib/cjs/core-react/text/TextProps.js.map +1 -1
- package/lib/cjs/core-react/text/Title.d.ts +10 -10
- package/lib/cjs/core-react/text/Title.js +20 -20
- package/lib/cjs/core-react/text/Title.js.map +1 -1
- package/lib/cjs/core-react/text/Title2.d.ts +10 -10
- package/lib/cjs/core-react/text/Title2.js +20 -20
- package/lib/cjs/core-react/text/Title2.js.map +1 -1
- package/lib/cjs/core-react/text/block.scss +10 -10
- package/lib/cjs/core-react/text/body.scss +10 -10
- package/lib/cjs/core-react/text/classes.scss +18 -18
- package/lib/cjs/core-react/text/disabled.scss +10 -10
- package/lib/cjs/core-react/text/headline.scss +10 -10
- package/lib/cjs/core-react/text/index.scss +18 -18
- package/lib/cjs/core-react/text/leading-2.scss +11 -11
- package/lib/cjs/core-react/text/leading.scss +10 -10
- package/lib/cjs/core-react/text/mixins.scss +62 -62
- package/lib/cjs/core-react/text/muted.scss +10 -10
- package/lib/cjs/core-react/text/small.scss +10 -10
- package/lib/cjs/core-react/text/subheading-2.scss +11 -11
- package/lib/cjs/core-react/text/subheading.scss +11 -11
- package/lib/cjs/core-react/text/title-2.scss +11 -11
- package/lib/cjs/core-react/text/title.scss +10 -10
- package/lib/cjs/core-react/tiles/FeaturedTile.d.ts +10 -10
- package/lib/cjs/core-react/tiles/FeaturedTile.js +20 -20
- package/lib/cjs/core-react/tiles/FeaturedTile.js.map +1 -1
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.d.ts +10 -10
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.js +20 -20
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.js.map +1 -1
- package/lib/cjs/core-react/tiles/MinimalTile.d.ts +10 -10
- package/lib/cjs/core-react/tiles/MinimalTile.js +20 -20
- package/lib/cjs/core-react/tiles/MinimalTile.js.map +1 -1
- package/lib/cjs/core-react/tiles/Tile.d.ts +31 -31
- package/lib/cjs/core-react/tiles/Tile.js +39 -39
- package/lib/cjs/core-react/tiles/Tile.js.map +1 -1
- package/lib/cjs/core-react/tiles/classes.scss +7 -7
- package/lib/cjs/core-react/tiles/index.scss +5 -5
- package/lib/cjs/core-react/tiles/tile.scss +134 -134
- package/lib/cjs/core-react/toggle/LabeledToggle.d.ts +25 -25
- package/lib/cjs/core-react/toggle/LabeledToggle.js +28 -28
- package/lib/cjs/core-react/toggle/LabeledToggle.js.map +1 -1
- package/lib/cjs/core-react/toggle/LabeledToggle.scss +21 -21
- package/lib/cjs/core-react/toggle/Toggle.d.ts +51 -51
- package/lib/cjs/core-react/toggle/Toggle.js +104 -104
- package/lib/cjs/core-react/toggle/Toggle.js.map +1 -1
- package/lib/cjs/core-react/toggle/Toggle.scss +135 -135
- package/lib/cjs/core-react/tooltip/Tooltip.d.ts +33 -33
- package/lib/cjs/core-react/tooltip/Tooltip.js +56 -56
- package/lib/cjs/core-react/tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/core-react/tooltip/Tooltip.scss +18 -18
- package/lib/cjs/core-react/tree/Branch.d.ts +19 -19
- package/lib/cjs/core-react/tree/Branch.js +23 -23
- package/lib/cjs/core-react/tree/Branch.js.map +1 -1
- package/lib/cjs/core-react/tree/Branch.scss +12 -12
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +20 -20
- package/lib/cjs/core-react/tree/ExpansionToggle.js +28 -28
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.scss +28 -28
- package/lib/cjs/core-react/tree/Node.d.ts +79 -79
- package/lib/cjs/core-react/tree/Node.js +88 -88
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.scss +84 -84
- package/lib/cjs/core-react/tree/Placeholder.d.ts +22 -22
- package/lib/cjs/core-react/tree/Placeholder.js +31 -31
- package/lib/cjs/core-react/tree/Placeholder.js.map +1 -1
- package/lib/cjs/core-react/tree/Placeholder.scss +20 -20
- package/lib/cjs/core-react/tree/Tree.d.ts +28 -28
- package/lib/cjs/core-react/tree/Tree.js +100 -100
- package/lib/cjs/core-react/tree/Tree.js.map +1 -1
- package/lib/cjs/core-react/tree/Tree.scss +21 -21
- package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts +16 -16
- package/lib/cjs/core-react/uistate/LocalStateStorage.js +49 -49
- package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.d.ts +30 -30
- package/lib/cjs/core-react/uistate/UiStateEntry.js +59 -59
- package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.d.ts +28 -28
- package/lib/cjs/core-react/uistate/UiStateStorage.js +21 -21
- package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts +23 -23
- package/lib/cjs/core-react/utils/IconHelper.js +62 -62
- package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts +10 -10
- package/lib/cjs/core-react/utils/IconWebComponent.js +72 -72
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/Point.d.ts +37 -37
- package/lib/cjs/core-react/utils/Point.js +73 -73
- package/lib/cjs/core-react/utils/Point.js.map +1 -1
- package/lib/cjs/core-react/utils/PointProps.d.ts +11 -11
- package/lib/cjs/core-react/utils/PointProps.js +9 -9
- package/lib/cjs/core-react/utils/PointProps.js.map +1 -1
- package/lib/cjs/core-react/utils/Props.d.ts +38 -38
- package/lib/cjs/core-react/utils/Props.js +9 -9
- package/lib/cjs/core-react/utils/Props.js.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.d.ts +144 -144
- package/lib/cjs/core-react/utils/Rectangle.js +270 -270
- package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts +23 -23
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js +36 -36
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/cjs/core-react/utils/Size.d.ts +23 -23
- package/lib/cjs/core-react/utils/Size.js +32 -32
- package/lib/cjs/core-react/utils/Size.js.map +1 -1
- package/lib/cjs/core-react/utils/Timer.d.ts +35 -35
- package/lib/cjs/core-react/utils/Timer.js +64 -64
- package/lib/cjs/core-react/utils/Timer.js.map +1 -1
- package/lib/cjs/core-react/utils/UiEvent.d.ts +9 -9
- package/lib/cjs/core-react/utils/UiEvent.js +17 -17
- package/lib/cjs/core-react/utils/UiEvent.js.map +1 -1
- package/lib/cjs/core-react/utils/UiGeometry.d.ts +20 -20
- package/lib/cjs/core-react/utils/UiGeometry.js +28 -28
- package/lib/cjs/core-react/utils/UiGeometry.js.map +1 -1
- package/lib/cjs/core-react/utils/flattenChildren.d.ts +8 -8
- package/lib/cjs/core-react/utils/flattenChildren.js +27 -27
- package/lib/cjs/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/cjs/core-react/utils/getBestBWContrastColor.d.ts +7 -7
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js +22 -22
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.d.ts +11 -11
- package/lib/cjs/core-react/utils/getCssVariable.js +31 -31
- package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/cjs/core-react/utils/getDisplayName.d.ts +8 -8
- package/lib/cjs/core-react/utils/getDisplayName.js +21 -21
- package/lib/cjs/core-react/utils/getDisplayName.js.map +1 -1
- package/lib/cjs/core-react/utils/getUserColor.d.ts +7 -7
- package/lib/cjs/core-react/utils/getUserColor.js +38 -38
- package/lib/cjs/core-react/utils/getUserColor.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -4
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +19 -19
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +7 -7
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +89 -89
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts +17 -17
- package/lib/cjs/core-react/utils/hooks/useDisposable.js +38 -38
- package/lib/cjs/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.d.ts +8 -8
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js +26 -26
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.d.ts +11 -11
- package/lib/cjs/core-react/utils/hooks/useEventListener.js +43 -43
- package/lib/cjs/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useInterval.d.ts +5 -5
- package/lib/cjs/core-react/utils/hooks/useInterval.js +36 -36
- package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.d.ts +5 -5
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js +64 -64
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts +12 -12
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js +92 -92
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.d.ts +55 -55
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js +114 -114
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefEffect.d.ts +7 -7
- package/lib/cjs/core-react/utils/hooks/useRefEffect.js +23 -23
- package/lib/cjs/core-react/utils/hooks/useRefEffect.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefState.d.ts +21 -21
- package/lib/cjs/core-react/utils/hooks/useRefState.js +35 -35
- package/lib/cjs/core-react/utils/hooks/useRefState.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.d.ts +12 -12
- package/lib/cjs/core-react/utils/hooks/useRefs.js +53 -53
- package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +39 -39
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +208 -208
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useTargeted.d.ts +8 -8
- package/lib/cjs/core-react/utils/hooks/useTargeted.js +28 -28
- package/lib/cjs/core-react/utils/hooks/useTargeted.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useThrottledFn.d.ts +15 -15
- package/lib/cjs/core-react/utils/hooks/useThrottledFn.js +25 -25
- package/lib/cjs/core-react/utils/hooks/useThrottledFn.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.d.ts +20 -20
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js +27 -27
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/cjs/core-react/utils/isPromiseLike.d.ts +7 -7
- package/lib/cjs/core-react/utils/isPromiseLike.js +17 -17
- package/lib/cjs/core-react/utils/isPromiseLike.js.map +1 -1
- package/lib/cjs/core-react/utils/shallowDiffers.d.ts +11 -11
- package/lib/cjs/core-react/utils/shallowDiffers.js +29 -29
- package/lib/cjs/core-react/utils/shallowDiffers.js.map +1 -1
- package/lib/cjs/core-react/utils/typeUtils.d.ts +7 -7
- package/lib/cjs/core-react/utils/typeUtils.js +9 -9
- package/lib/cjs/core-react/utils/typeUtils.js.map +1 -1
- package/lib/cjs/core-react.d.ts +275 -275
- package/lib/cjs/core-react.js +298 -298
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts +40 -40
- package/lib/esm/core-react/UiCore.js +81 -81
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/_geometry.scss +70 -70
- package/lib/esm/core-react/_helpers.scss +51 -51
- package/lib/esm/core-react/_math.scss +13 -13
- package/lib/esm/core-react/_scrollbar.scss +51 -51
- package/lib/esm/core-react/_typography.scss +44 -44
- package/lib/esm/core-react/_z-index.scss +65 -65
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +96 -96
- package/lib/esm/core-react/autosuggest/AutoSuggest.js +170 -170
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.scss +82 -82
- package/lib/esm/core-react/badge/Badge.d.ts +18 -18
- package/lib/esm/core-react/badge/Badge.js +22 -22
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.scss +13 -13
- package/lib/esm/core-react/badge/BadgeUtilities.d.ts +12 -12
- package/lib/esm/core-react/badge/BadgeUtilities.js +34 -34
- package/lib/esm/core-react/badge/BadgeUtilities.js.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.d.ts +10 -10
- package/lib/esm/core-react/badge/BetaBadge.js +19 -19
- package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.scss +9 -9
- package/lib/esm/core-react/badge/NewBadge.d.ts +10 -10
- package/lib/esm/core-react/badge/NewBadge.js +19 -19
- package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.scss +9 -9
- package/lib/esm/core-react/base/Centered.d.ts +10 -10
- package/lib/esm/core-react/base/Centered.js +16 -16
- package/lib/esm/core-react/base/Centered.js.map +1 -1
- package/lib/esm/core-react/base/Div.d.ts +16 -16
- package/lib/esm/core-react/base/Div.js +16 -16
- package/lib/esm/core-react/base/Div.js.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.d.ts +79 -79
- package/lib/esm/core-react/base/DivWithOutsideClick.js +13 -13
- package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/esm/core-react/base/FillCentered.d.ts +10 -10
- package/lib/esm/core-react/base/FillCentered.js +16 -16
- package/lib/esm/core-react/base/FillCentered.js.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts +11 -11
- package/lib/esm/core-react/base/FlexWrapContainer.js +17 -17
- package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/esm/core-react/base/Gap.d.ts +15 -15
- package/lib/esm/core-react/base/Gap.js +16 -16
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/base/PointerEvents.d.ts +7 -7
- package/lib/esm/core-react/base/PointerEvents.js +13 -13
- package/lib/esm/core-react/base/PointerEvents.js.map +1 -1
- package/lib/esm/core-react/base/ScrollView.d.ts +11 -11
- package/lib/esm/core-react/base/ScrollView.js +17 -17
- package/lib/esm/core-react/base/ScrollView.js.map +1 -1
- package/lib/esm/core-react/base/base.scss +42 -42
- package/lib/esm/core-react/base/classes.scss +13 -13
- package/lib/esm/core-react/base/index.scss +5 -5
- package/lib/esm/core-react/button/Button.d.ts +47 -47
- package/lib/esm/core-react/button/Button.js +80 -80
- package/lib/esm/core-react/button/Button.js.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.d.ts +24 -24
- package/lib/esm/core-react/button/UnderlinedButton.js +31 -31
- package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.scss +32 -32
- package/lib/esm/core-react/button/blue-large.scss +12 -12
- package/lib/esm/core-react/button/blue.scss +25 -25
- package/lib/esm/core-react/button/button.scss +81 -81
- package/lib/esm/core-react/button/classes.scss +14 -14
- package/lib/esm/core-react/button/disabled-large.scss +12 -12
- package/lib/esm/core-react/button/disabled.scss +17 -17
- package/lib/esm/core-react/button/hollow-large.scss +13 -13
- package/lib/esm/core-react/button/hollow.scss +30 -30
- package/lib/esm/core-react/button/index.scss +14 -14
- package/lib/esm/core-react/button/primary-large.scss +12 -12
- package/lib/esm/core-react/button/primary.scss +25 -25
- package/lib/esm/core-react/button/variables.scss +19 -19
- package/lib/esm/core-react/checkbox/Checkbox.d.ts +56 -56
- package/lib/esm/core-react/checkbox/Checkbox.js +60 -60
- package/lib/esm/core-react/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/core-react/checkbox/checkbox.scss +129 -129
- package/lib/esm/core-react/checkbox/classes.scss +8 -8
- package/lib/esm/core-react/checkbox/index.scss +8 -8
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +37 -37
- package/lib/esm/core-react/checklistbox/CheckListBox.js +36 -36
- package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.scss +22 -22
- package/lib/esm/core-react/classes.scss +18 -18
- package/lib/esm/core-react/colorthemes.scss +58 -58
- package/lib/esm/core-react/colorvariables.scss +116 -116
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +91 -91
- package/lib/esm/core-react/contextmenu/ContextMenu.js +360 -360
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +238 -238
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts +18 -18
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js +23 -23
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts +12 -12
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js +19 -19
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +61 -61
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +104 -104
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts +51 -51
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +155 -155
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts +34 -34
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +55 -55
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts +53 -53
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js +51 -51
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/TildeFinder.d.ts +18 -18
- package/lib/esm/core-react/contextmenu/TildeFinder.js +66 -66
- package/lib/esm/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts +132 -132
- package/lib/esm/core-react/dialog/Dialog.js +362 -362
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.scss +241 -241
- package/lib/esm/core-react/dialog/DialogButtonDef.d.ts +46 -46
- package/lib/esm/core-react/dialog/DialogButtonDef.js +34 -34
- package/lib/esm/core-react/dialog/DialogButtonDef.js.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.d.ts +28 -28
- package/lib/esm/core-react/dialog/GlobalDialog.js +49 -49
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +41 -41
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +159 -159
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.scss +85 -85
- package/lib/esm/core-react/enums/Alignment.d.ts +22 -22
- package/lib/esm/core-react/enums/Alignment.js +28 -28
- package/lib/esm/core-react/enums/Alignment.js.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.d.ts +20 -20
- package/lib/esm/core-react/enums/CheckBoxState.js +16 -16
- package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/esm/core-react/enums/Orientation.d.ts +11 -11
- package/lib/esm/core-react/enums/Orientation.js +16 -16
- package/lib/esm/core-react/enums/Orientation.js.map +1 -1
- package/lib/esm/core-react/enums/SortDirection.d.ts +12 -12
- package/lib/esm/core-react/enums/SortDirection.js +17 -17
- package/lib/esm/core-react/enums/SortDirection.js.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.d.ts +14 -14
- package/lib/esm/core-react/enums/TimeFormat.js +19 -19
- package/lib/esm/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableBlock.d.ts +33 -33
- package/lib/esm/core-react/expandable/ExpandableBlock.js +31 -31
- package/lib/esm/core-react/expandable/ExpandableBlock.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableBlock.scss +145 -145
- package/lib/esm/core-react/expandable/ExpandableList.d.ts +35 -35
- package/lib/esm/core-react/expandable/ExpandableList.js +53 -53
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.scss +8 -8
- package/lib/esm/core-react/expandable/classes.scss +7 -7
- package/lib/esm/core-react/expandable/index.scss +5 -5
- package/lib/esm/core-react/expandable/list.scss +45 -45
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts +53 -53
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js +145 -145
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.d.ts +28 -28
- package/lib/esm/core-react/focustrap/FocusTrap.js +191 -191
- package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/esm/core-react/form/Field.d.ts +19 -19
- package/lib/esm/core-react/form/Field.js +40 -40
- package/lib/esm/core-react/form/Field.js.map +1 -1
- package/lib/esm/core-react/form/Form.d.ts +131 -131
- package/lib/esm/core-react/form/Form.js +127 -127
- package/lib/esm/core-react/form/Form.js.map +1 -1
- package/lib/esm/core-react/form/Form.scss +78 -78
- package/lib/esm/core-react/hocs/withIsPressed.d.ts +77 -77
- package/lib/esm/core-react/hocs/withIsPressed.js +42 -42
- package/lib/esm/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts +103 -103
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +111 -111
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/hocs/withTimeout.d.ts +74 -74
- package/lib/esm/core-react/hocs/withTimeout.js +42 -42
- package/lib/esm/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.d.ts +24 -24
- package/lib/esm/core-react/icons/IconComponent.js +50 -50
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.scss +20 -20
- package/lib/esm/core-react/icons/SvgPath.d.ts +23 -23
- package/lib/esm/core-react/icons/SvgPath.js +23 -23
- package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
- package/lib/esm/core-react/icons/SvgSprite.d.ts +20 -20
- package/lib/esm/core-react/icons/SvgSprite.js +22 -22
- package/lib/esm/core-react/icons/SvgSprite.js.map +1 -1
- package/lib/esm/core-react/icons/SvgSprite.scss +15 -15
- package/lib/esm/core-react/icons/WebFontIcon.d.ts +26 -26
- package/lib/esm/core-react/icons/WebFontIcon.js +18 -18
- package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.scss +17 -17
- package/lib/esm/core-react/icons/classes.scss +10 -10
- package/lib/esm/core-react/icons/index.scss +6 -6
- package/lib/esm/core-react/icons/mixins.scss +25 -25
- package/lib/esm/core-react/icons/variables.scss +21 -21
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +42 -42
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +52 -52
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
- package/lib/esm/core-react/index.scss +27 -27
- package/lib/esm/core-react/inputs/Input.d.ts +22 -22
- package/lib/esm/core-react/inputs/Input.js +43 -43
- package/lib/esm/core-react/inputs/Input.js.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.d.ts +18 -18
- package/lib/esm/core-react/inputs/InputLabel.js +29 -29
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/InputStatus.d.ts +11 -11
- package/lib/esm/core-react/inputs/InputStatus.js +16 -16
- package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts +33 -33
- package/lib/esm/core-react/inputs/LabeledComponentProps.js +8 -8
- package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledInput.d.ts +17 -17
- package/lib/esm/core-react/inputs/LabeledInput.js +29 -29
- package/lib/esm/core-react/inputs/LabeledInput.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledTextarea.d.ts +17 -17
- package/lib/esm/core-react/inputs/LabeledTextarea.js +27 -27
- package/lib/esm/core-react/inputs/LabeledTextarea.js.map +1 -1
- package/lib/esm/core-react/inputs/Textarea.d.ts +22 -22
- package/lib/esm/core-react/inputs/Textarea.js +32 -32
- package/lib/esm/core-react/inputs/Textarea.js.map +1 -1
- package/lib/esm/core-react/inputs/classes.scss +10 -10
- package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +23 -23
- package/lib/esm/core-react/inputs/iconinput/IconInput.js +26 -26
- package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.scss +35 -35
- package/lib/esm/core-react/inputs/index.scss +11 -11
- package/lib/esm/core-react/inputs/input.scss +60 -60
- package/lib/esm/core-react/inputs/labeled-input.scss +103 -103
- package/lib/esm/core-react/inputs/labeled-textarea.scss +77 -77
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +45 -45
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js +145 -145
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +89 -89
- package/lib/esm/core-react/inputs/textarea.scss +55 -55
- package/lib/esm/core-react/inputs/variables.scss +33 -33
- package/lib/esm/core-react/layout-variables.scss +15 -15
- package/lib/esm/core-react/listbox/Listbox.d.ts +55 -55
- package/lib/esm/core-react/listbox/Listbox.js +217 -217
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.scss +53 -53
- package/lib/esm/core-react/loading/LoadingBar.d.ts +29 -29
- package/lib/esm/core-react/loading/LoadingBar.js +35 -35
- package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.scss +29 -29
- package/lib/esm/core-react/loading/LoadingPrompt.d.ts +39 -39
- package/lib/esm/core-react/loading/LoadingPrompt.js +40 -40
- package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.scss +33 -33
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts +33 -33
- package/lib/esm/core-react/loading/LoadingSpinner.js +41 -41
- package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.scss +26 -26
- package/lib/esm/core-react/loading/LoadingStatus.d.ts +24 -24
- package/lib/esm/core-react/loading/LoadingStatus.js +33 -33
- package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.scss +20 -20
- package/lib/esm/core-react/loading/Spinner.d.ts +37 -37
- package/lib/esm/core-react/loading/Spinner.js +56 -56
- package/lib/esm/core-react/loading/Spinner.js.map +1 -1
- package/lib/esm/core-react/loading/Spinner.scss +26 -26
- package/lib/esm/core-react/loading/index.scss +5 -5
- package/lib/esm/core-react/loading/mixins.scss +57 -57
- package/lib/esm/core-react/messagebox/MessageBox.d.ts +64 -64
- package/lib/esm/core-react/messagebox/MessageBox.js +65 -65
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.scss +46 -46
- package/lib/esm/core-react/messagebox/MessageSeverity.d.ts +15 -15
- package/lib/esm/core-react/messagebox/MessageSeverity.js +20 -20
- package/lib/esm/core-react/messagebox/MessageSeverity.js.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.d.ts +19 -19
- package/lib/esm/core-react/notification/MessageRenderer.js +77 -77
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/notification/MessageType.d.ts +22 -22
- package/lib/esm/core-react/notification/MessageType.js +19 -19
- package/lib/esm/core-react/notification/MessageType.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.d.ts +109 -109
- package/lib/esm/core-react/popup/Popup.js +415 -415
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.scss +240 -240
- package/lib/esm/core-react/progress-indicators/ProgressBar.d.ts +28 -28
- package/lib/esm/core-react/progress-indicators/ProgressBar.js +43 -43
- package/lib/esm/core-react/progress-indicators/ProgressBar.js.map +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.d.ts +48 -48
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.js +69 -69
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.js.map +1 -1
- package/lib/esm/core-react/progress-indicators/classes.scss +33 -33
- package/lib/esm/core-react/progress-indicators/index.scss +6 -6
- package/lib/esm/core-react/progress-indicators/progress-bar.scss +91 -91
- package/lib/esm/core-react/progress-indicators/progress-spinner.scss +132 -132
- package/lib/esm/core-react/radialmenu/Annulus.d.ts +54 -54
- package/lib/esm/core-react/radialmenu/Annulus.js +75 -75
- package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +93 -93
- package/lib/esm/core-react/radialmenu/RadialMenu.js +174 -174
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +56 -56
- package/lib/esm/core-react/radio/Radio.d.ts +19 -19
- package/lib/esm/core-react/radio/Radio.js +23 -23
- package/lib/esm/core-react/radio/Radio.js.map +1 -1
- package/lib/esm/core-react/radio/classes.scss +7 -7
- package/lib/esm/core-react/radio/index.scss +8 -8
- package/lib/esm/core-react/radio/radio.scss +89 -89
- package/lib/esm/core-react/searchbox/SearchBox.d.ts +52 -52
- package/lib/esm/core-react/searchbox/SearchBox.js +105 -105
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.scss +53 -53
- package/lib/esm/core-react/select/LabeledSelect.d.ts +19 -19
- package/lib/esm/core-react/select/LabeledSelect.js +29 -29
- package/lib/esm/core-react/select/LabeledSelect.js.map +1 -1
- package/lib/esm/core-react/select/LabeledThemedSelect.d.ts +15 -15
- package/lib/esm/core-react/select/LabeledThemedSelect.js +26 -26
- package/lib/esm/core-react/select/LabeledThemedSelect.js.map +1 -1
- package/lib/esm/core-react/select/Select.d.ts +52 -52
- package/lib/esm/core-react/select/Select.js +56 -56
- package/lib/esm/core-react/select/Select.js.map +1 -1
- package/lib/esm/core-react/select/ThemedSelect.d.ts +103 -103
- package/lib/esm/core-react/select/ThemedSelect.js +52 -52
- package/lib/esm/core-react/select/ThemedSelect.js.map +1 -1
- package/lib/esm/core-react/select/classes.scss +9 -9
- package/lib/esm/core-react/select/index.scss +10 -10
- package/lib/esm/core-react/select/labeled-select.scss +72 -72
- package/lib/esm/core-react/select/labeled-themed-select.scss +77 -77
- package/lib/esm/core-react/select/modalHelper.d.ts +4 -4
- package/lib/esm/core-react/select/modalHelper.js +16 -16
- package/lib/esm/core-react/select/modalHelper.js.map +1 -1
- package/lib/esm/core-react/select/select.scss +73 -73
- package/lib/esm/core-react/select/themed-select.scss +159 -159
- package/lib/esm/core-react/settings/SettingsContainer.d.ts +30 -30
- package/lib/esm/core-react/settings/SettingsContainer.js +115 -115
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.scss +64 -64
- package/lib/esm/core-react/settings/SettingsManager.d.ts +132 -132
- package/lib/esm/core-react/settings/SettingsManager.js +113 -113
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/slider/Slider.d.ts +79 -79
- package/lib/esm/core-react/slider/Slider.js +86 -86
- package/lib/esm/core-react/slider/Slider.js.map +1 -1
- package/lib/esm/core-react/slider/Slider.scss +96 -96
- package/lib/esm/core-react/splitbutton/SplitButton.d.ts +61 -61
- package/lib/esm/core-react/splitbutton/SplitButton.js +99 -99
- package/lib/esm/core-react/splitbutton/SplitButton.js.map +1 -1
- package/lib/esm/core-react/splitbutton/SplitButton.scss +137 -137
- package/lib/esm/core-react/style/baseline.scss +13 -13
- package/lib/esm/core-react/style/breakpoints.scss +41 -41
- package/lib/esm/core-react/style/colors.scss +77 -77
- package/lib/esm/core-react/style/data-viz.scss +23 -23
- package/lib/esm/core-react/style/index.scss +17 -17
- package/lib/esm/core-react/style/itwinui-overrides.scss +24 -24
- package/lib/esm/core-react/style/mixins.scss +28 -28
- package/lib/esm/core-react/style/opacity.scss +17 -17
- package/lib/esm/core-react/style/space.scss +17 -17
- package/lib/esm/core-react/style/speed.scss +13 -13
- package/lib/esm/core-react/style/themecolors.scss +126 -126
- package/lib/esm/core-react/style/typography.scss +43 -43
- package/lib/esm/core-react/style/variables.scss +13 -13
- package/lib/esm/core-react/tabs/HorizontalTabs.d.ts +10 -10
- package/lib/esm/core-react/tabs/HorizontalTabs.js +17 -17
- package/lib/esm/core-react/tabs/HorizontalTabs.js.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts +71 -71
- package/lib/esm/core-react/tabs/Tabs.js +121 -121
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts +9 -9
- package/lib/esm/core-react/tabs/VerticalTabs.js +16 -16
- package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/esm/core-react/tabs/classes.scss +8 -8
- package/lib/esm/core-react/tabs/horizontal.scss +77 -77
- package/lib/esm/core-react/tabs/index.scss +6 -6
- package/lib/esm/core-react/tabs/tabs.scss +117 -117
- package/lib/esm/core-react/tabs/vertical.scss +64 -64
- package/lib/esm/core-react/text/BlockText.d.ts +9 -9
- package/lib/esm/core-react/text/BlockText.js +15 -15
- package/lib/esm/core-react/text/BlockText.js.map +1 -1
- package/lib/esm/core-react/text/BodyText.d.ts +9 -9
- package/lib/esm/core-react/text/BodyText.js +15 -15
- package/lib/esm/core-react/text/BodyText.js.map +1 -1
- package/lib/esm/core-react/text/DisabledText.d.ts +6 -6
- package/lib/esm/core-react/text/DisabledText.js +15 -15
- package/lib/esm/core-react/text/DisabledText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.d.ts +24 -24
- package/lib/esm/core-react/text/FilteredText.js +36 -36
- package/lib/esm/core-react/text/FilteredText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.scss +10 -10
- package/lib/esm/core-react/text/Headline.d.ts +10 -10
- package/lib/esm/core-react/text/Headline.js +16 -16
- package/lib/esm/core-react/text/Headline.js.map +1 -1
- package/lib/esm/core-react/text/LeadingText.d.ts +10 -10
- package/lib/esm/core-react/text/LeadingText.js +16 -16
- package/lib/esm/core-react/text/LeadingText.js.map +1 -1
- package/lib/esm/core-react/text/LeadingText2.d.ts +10 -10
- package/lib/esm/core-react/text/LeadingText2.js +16 -16
- package/lib/esm/core-react/text/LeadingText2.js.map +1 -1
- package/lib/esm/core-react/text/MutedText.d.ts +9 -9
- package/lib/esm/core-react/text/MutedText.js +15 -15
- package/lib/esm/core-react/text/MutedText.js.map +1 -1
- package/lib/esm/core-react/text/SmallText.d.ts +10 -10
- package/lib/esm/core-react/text/SmallText.js +16 -16
- package/lib/esm/core-react/text/SmallText.js.map +1 -1
- package/lib/esm/core-react/text/StyledText.d.ts +16 -16
- package/lib/esm/core-react/text/StyledText.js +16 -16
- package/lib/esm/core-react/text/StyledText.js.map +1 -1
- package/lib/esm/core-react/text/Subheading.d.ts +10 -10
- package/lib/esm/core-react/text/Subheading.js +16 -16
- package/lib/esm/core-react/text/Subheading.js.map +1 -1
- package/lib/esm/core-react/text/Subheading2.d.ts +10 -10
- package/lib/esm/core-react/text/Subheading2.js +16 -16
- package/lib/esm/core-react/text/Subheading2.js.map +1 -1
- package/lib/esm/core-react/text/TextProps.d.ts +10 -10
- package/lib/esm/core-react/text/TextProps.js +8 -8
- package/lib/esm/core-react/text/TextProps.js.map +1 -1
- package/lib/esm/core-react/text/Title.d.ts +10 -10
- package/lib/esm/core-react/text/Title.js +16 -16
- package/lib/esm/core-react/text/Title.js.map +1 -1
- package/lib/esm/core-react/text/Title2.d.ts +10 -10
- package/lib/esm/core-react/text/Title2.js +16 -16
- package/lib/esm/core-react/text/Title2.js.map +1 -1
- package/lib/esm/core-react/text/block.scss +10 -10
- package/lib/esm/core-react/text/body.scss +10 -10
- package/lib/esm/core-react/text/classes.scss +18 -18
- package/lib/esm/core-react/text/disabled.scss +10 -10
- package/lib/esm/core-react/text/headline.scss +10 -10
- package/lib/esm/core-react/text/index.scss +18 -18
- package/lib/esm/core-react/text/leading-2.scss +11 -11
- package/lib/esm/core-react/text/leading.scss +10 -10
- package/lib/esm/core-react/text/mixins.scss +62 -62
- package/lib/esm/core-react/text/muted.scss +10 -10
- package/lib/esm/core-react/text/small.scss +10 -10
- package/lib/esm/core-react/text/subheading-2.scss +11 -11
- package/lib/esm/core-react/text/subheading.scss +11 -11
- package/lib/esm/core-react/text/title-2.scss +11 -11
- package/lib/esm/core-react/text/title.scss +10 -10
- package/lib/esm/core-react/tiles/FeaturedTile.d.ts +10 -10
- package/lib/esm/core-react/tiles/FeaturedTile.js +16 -16
- package/lib/esm/core-react/tiles/FeaturedTile.js.map +1 -1
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.d.ts +10 -10
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.js +16 -16
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.js.map +1 -1
- package/lib/esm/core-react/tiles/MinimalTile.d.ts +10 -10
- package/lib/esm/core-react/tiles/MinimalTile.js +16 -16
- package/lib/esm/core-react/tiles/MinimalTile.js.map +1 -1
- package/lib/esm/core-react/tiles/Tile.d.ts +31 -31
- package/lib/esm/core-react/tiles/Tile.js +35 -35
- package/lib/esm/core-react/tiles/Tile.js.map +1 -1
- package/lib/esm/core-react/tiles/classes.scss +7 -7
- package/lib/esm/core-react/tiles/index.scss +5 -5
- package/lib/esm/core-react/tiles/tile.scss +134 -134
- package/lib/esm/core-react/toggle/LabeledToggle.d.ts +25 -25
- package/lib/esm/core-react/toggle/LabeledToggle.js +24 -24
- package/lib/esm/core-react/toggle/LabeledToggle.js.map +1 -1
- package/lib/esm/core-react/toggle/LabeledToggle.scss +21 -21
- package/lib/esm/core-react/toggle/Toggle.d.ts +51 -51
- package/lib/esm/core-react/toggle/Toggle.js +101 -101
- package/lib/esm/core-react/toggle/Toggle.js.map +1 -1
- package/lib/esm/core-react/toggle/Toggle.scss +135 -135
- package/lib/esm/core-react/tooltip/Tooltip.d.ts +33 -33
- package/lib/esm/core-react/tooltip/Tooltip.js +51 -51
- package/lib/esm/core-react/tooltip/Tooltip.js.map +1 -1
- package/lib/esm/core-react/tooltip/Tooltip.scss +18 -18
- package/lib/esm/core-react/tree/Branch.d.ts +19 -19
- package/lib/esm/core-react/tree/Branch.js +19 -19
- package/lib/esm/core-react/tree/Branch.js.map +1 -1
- package/lib/esm/core-react/tree/Branch.scss +12 -12
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts +20 -20
- package/lib/esm/core-react/tree/ExpansionToggle.js +24 -24
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.scss +28 -28
- package/lib/esm/core-react/tree/Node.d.ts +79 -79
- package/lib/esm/core-react/tree/Node.js +84 -84
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/tree/Node.scss +84 -84
- package/lib/esm/core-react/tree/Placeholder.d.ts +22 -22
- package/lib/esm/core-react/tree/Placeholder.js +27 -27
- package/lib/esm/core-react/tree/Placeholder.js.map +1 -1
- package/lib/esm/core-react/tree/Placeholder.scss +20 -20
- package/lib/esm/core-react/tree/Tree.d.ts +28 -28
- package/lib/esm/core-react/tree/Tree.js +96 -96
- package/lib/esm/core-react/tree/Tree.js.map +1 -1
- package/lib/esm/core-react/tree/Tree.scss +21 -21
- package/lib/esm/core-react/uistate/LocalStateStorage.d.ts +16 -16
- package/lib/esm/core-react/uistate/LocalStateStorage.js +45 -45
- package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.d.ts +30 -30
- package/lib/esm/core-react/uistate/UiStateEntry.js +55 -55
- package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.d.ts +28 -28
- package/lib/esm/core-react/uistate/UiStateStorage.js +18 -18
- package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts +23 -23
- package/lib/esm/core-react/utils/IconHelper.js +58 -58
- package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts +10 -10
- package/lib/esm/core-react/utils/IconWebComponent.js +68 -68
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/Point.d.ts +37 -37
- package/lib/esm/core-react/utils/Point.js +69 -69
- package/lib/esm/core-react/utils/Point.js.map +1 -1
- package/lib/esm/core-react/utils/PointProps.d.ts +11 -11
- package/lib/esm/core-react/utils/PointProps.js +8 -8
- package/lib/esm/core-react/utils/PointProps.js.map +1 -1
- package/lib/esm/core-react/utils/Props.d.ts +38 -38
- package/lib/esm/core-react/utils/Props.js +8 -8
- package/lib/esm/core-react/utils/Props.js.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.d.ts +144 -144
- package/lib/esm/core-react/utils/Rectangle.js +266 -266
- package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts +23 -23
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js +32 -32
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/esm/core-react/utils/Size.d.ts +23 -23
- package/lib/esm/core-react/utils/Size.js +28 -28
- package/lib/esm/core-react/utils/Size.js.map +1 -1
- package/lib/esm/core-react/utils/Timer.d.ts +35 -35
- package/lib/esm/core-react/utils/Timer.js +60 -60
- package/lib/esm/core-react/utils/Timer.js.map +1 -1
- package/lib/esm/core-react/utils/UiEvent.d.ts +9 -9
- package/lib/esm/core-react/utils/UiEvent.js +13 -13
- package/lib/esm/core-react/utils/UiEvent.js.map +1 -1
- package/lib/esm/core-react/utils/UiGeometry.d.ts +20 -20
- package/lib/esm/core-react/utils/UiGeometry.js +24 -24
- package/lib/esm/core-react/utils/UiGeometry.js.map +1 -1
- package/lib/esm/core-react/utils/flattenChildren.d.ts +8 -8
- package/lib/esm/core-react/utils/flattenChildren.js +23 -23
- package/lib/esm/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/esm/core-react/utils/getBestBWContrastColor.d.ts +7 -7
- package/lib/esm/core-react/utils/getBestBWContrastColor.js +18 -18
- package/lib/esm/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.d.ts +11 -11
- package/lib/esm/core-react/utils/getCssVariable.js +26 -26
- package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/esm/core-react/utils/getDisplayName.d.ts +8 -8
- package/lib/esm/core-react/utils/getDisplayName.js +17 -17
- package/lib/esm/core-react/utils/getDisplayName.js.map +1 -1
- package/lib/esm/core-react/utils/getUserColor.d.ts +7 -7
- package/lib/esm/core-react/utils/getUserColor.js +34 -34
- package/lib/esm/core-react/utils/getUserColor.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -4
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +16 -16
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +7 -7
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +85 -85
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useDisposable.d.ts +17 -17
- package/lib/esm/core-react/utils/hooks/useDisposable.js +33 -33
- package/lib/esm/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.d.ts +8 -8
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js +22 -22
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.d.ts +11 -11
- package/lib/esm/core-react/utils/hooks/useEventListener.js +39 -39
- package/lib/esm/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useInterval.d.ts +5 -5
- package/lib/esm/core-react/utils/hooks/useInterval.js +32 -32
- package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.d.ts +5 -5
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js +60 -60
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts +12 -12
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js +88 -88
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.d.ts +55 -55
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js +102 -102
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefEffect.d.ts +7 -7
- package/lib/esm/core-react/utils/hooks/useRefEffect.js +19 -19
- package/lib/esm/core-react/utils/hooks/useRefEffect.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefState.d.ts +21 -21
- package/lib/esm/core-react/utils/hooks/useRefState.js +31 -31
- package/lib/esm/core-react/utils/hooks/useRefState.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.d.ts +12 -12
- package/lib/esm/core-react/utils/hooks/useRefs.js +48 -48
- package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +39 -39
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +201 -201
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useTargeted.d.ts +8 -8
- package/lib/esm/core-react/utils/hooks/useTargeted.js +24 -24
- package/lib/esm/core-react/utils/hooks/useTargeted.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useThrottledFn.d.ts +15 -15
- package/lib/esm/core-react/utils/hooks/useThrottledFn.js +21 -21
- package/lib/esm/core-react/utils/hooks/useThrottledFn.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.d.ts +20 -20
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js +23 -23
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/esm/core-react/utils/isPromiseLike.d.ts +7 -7
- package/lib/esm/core-react/utils/isPromiseLike.js +13 -13
- package/lib/esm/core-react/utils/isPromiseLike.js.map +1 -1
- package/lib/esm/core-react/utils/shallowDiffers.d.ts +11 -11
- package/lib/esm/core-react/utils/shallowDiffers.js +25 -25
- package/lib/esm/core-react/utils/shallowDiffers.js.map +1 -1
- package/lib/esm/core-react/utils/typeUtils.d.ts +7 -7
- package/lib/esm/core-react/utils/typeUtils.js +8 -8
- package/lib/esm/core-react/utils/typeUtils.js.map +1 -1
- package/lib/esm/core-react.d.ts +275 -275
- package/lib/esm/core-react.js +280 -280
- package/lib/esm/core-react.js.map +1 -1
- package/lib/public/locales/en/UiCore.json +30 -30
- package/package.json +9 -9
|
@@ -1,192 +1,192 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Popup
|
|
7
|
-
*/
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import { Logger } from "@itwin/core-bentley";
|
|
10
|
-
import { UiCore } from "../UiCore";
|
|
11
|
-
// cSpell:ignore focusable
|
|
12
|
-
function isFocusable(element) {
|
|
13
|
-
if (!element || element.tabIndex < 0)
|
|
14
|
-
return false;
|
|
15
|
-
if (element.classList && element.classList.contains("core-focus-trap-ignore-initial"))
|
|
16
|
-
return false;
|
|
17
|
-
if (element.getAttribute && (typeof element.getAttribute === "function") && element.getAttribute("disabled") !== null)
|
|
18
|
-
return false;
|
|
19
|
-
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null))
|
|
20
|
-
return true;
|
|
21
|
-
switch (element.nodeName) {
|
|
22
|
-
case "A":
|
|
23
|
-
const anchorElement = element;
|
|
24
|
-
return !!anchorElement.href && anchorElement.rel !== "ignore";
|
|
25
|
-
case "INPUT":
|
|
26
|
-
const inputElement = element;
|
|
27
|
-
return inputElement.type !== "hidden" && inputElement.type !== "file";
|
|
28
|
-
case "BUTTON":
|
|
29
|
-
case "SELECT":
|
|
30
|
-
case "TEXTAREA":
|
|
31
|
-
return true;
|
|
32
|
-
default:
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function processFindFocusableDescendant(element) {
|
|
37
|
-
// istanbul ignore next
|
|
38
|
-
if (!element)
|
|
39
|
-
return null;
|
|
40
|
-
for (const child of element.childNodes) {
|
|
41
|
-
// istanbul ignore else
|
|
42
|
-
if (isFocusable(child))
|
|
43
|
-
return child;
|
|
44
|
-
const focusable = processFindFocusableDescendant(child);
|
|
45
|
-
if (focusable)
|
|
46
|
-
return focusable;
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
function findFirstFocusableDescendant(focusContainer) {
|
|
51
|
-
return processFindFocusableDescendant(focusContainer);
|
|
52
|
-
}
|
|
53
|
-
function processFindLastFocusableDescendant(element) {
|
|
54
|
-
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
55
|
-
const child = element.childNodes[i];
|
|
56
|
-
const focusable = processFindLastFocusableDescendant(child);
|
|
57
|
-
// istanbul ignore else
|
|
58
|
-
if (focusable)
|
|
59
|
-
return focusable;
|
|
60
|
-
// istanbul ignore else
|
|
61
|
-
if (isFocusable(child))
|
|
62
|
-
return child;
|
|
63
|
-
}
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
function findLastFocusableDescendant(focusContainer) {
|
|
67
|
-
return processFindLastFocusableDescendant(focusContainer);
|
|
68
|
-
}
|
|
69
|
-
function getInitialFocusElement(focusContainer, initialFocusSpec) {
|
|
70
|
-
// istanbul ignore next
|
|
71
|
-
if (!focusContainer)
|
|
72
|
-
return null;
|
|
73
|
-
if (initialFocusSpec) {
|
|
74
|
-
if (typeof initialFocusSpec === "string") {
|
|
75
|
-
const node = focusContainer.querySelector(initialFocusSpec);
|
|
76
|
-
if (node) {
|
|
77
|
-
return node;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
Logger.logError(`${UiCore.packageName}.FocusTrap`, `Unable to locate element via selector ${initialFocusSpec}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
return initialFocusSpec.current;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return findFirstFocusableDescendant(focusContainer);
|
|
88
|
-
}
|
|
89
|
-
function attemptFocus(element, preventScroll) {
|
|
90
|
-
// istanbul ignore next
|
|
91
|
-
if (!isFocusable(element))
|
|
92
|
-
return false;
|
|
93
|
-
try {
|
|
94
|
-
// istanbul ignore else
|
|
95
|
-
if (document.activeElement !== element)
|
|
96
|
-
element.focus({ preventScroll: preventScroll ? true : /* istanbul ignore next */ false });
|
|
97
|
-
}
|
|
98
|
-
catch (e) {
|
|
99
|
-
// istanbul ignore next
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
return (document.activeElement === element);
|
|
103
|
-
} // end attemptFocus
|
|
104
|
-
/** Focus into first focusable element of a container.
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
107
|
-
export function focusIntoContainer(focusContainer, initialFocusElement) {
|
|
108
|
-
let result = false;
|
|
109
|
-
const focusElement = getInitialFocusElement(focusContainer, initialFocusElement);
|
|
110
|
-
if (focusElement) {
|
|
111
|
-
// delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.
|
|
112
|
-
setTimeout(() => {
|
|
113
|
-
attemptFocus(focusElement, true);
|
|
114
|
-
}, 60);
|
|
115
|
-
result = true;
|
|
116
|
-
}
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
|
-
/** Trap Focus in container while trap is active.
|
|
120
|
-
* @internal
|
|
121
|
-
*/
|
|
122
|
-
export function FocusTrap(props) {
|
|
123
|
-
const restoreFocusElement = React.useRef(null);
|
|
124
|
-
const initialFocusElement = React.useRef(null);
|
|
125
|
-
const focusContainer = React.useRef(null);
|
|
126
|
-
const isInitialMount = React.useRef(true);
|
|
127
|
-
const timeoutRef = React.useRef();
|
|
128
|
-
// Run on initial mount and when dependencies change. which could happen often.
|
|
129
|
-
React.useEffect(() => {
|
|
130
|
-
// istanbul ignore else
|
|
131
|
-
if (isInitialMount.current) {
|
|
132
|
-
isInitialMount.current = false;
|
|
133
|
-
if (props.active) {
|
|
134
|
-
if (props.returnFocusOnDeactivate) {
|
|
135
|
-
restoreFocusElement.current = document.activeElement;
|
|
136
|
-
}
|
|
137
|
-
initialFocusElement.current = getInitialFocusElement(focusContainer.current, props.initialFocusElement);
|
|
138
|
-
if (initialFocusElement.current) {
|
|
139
|
-
// delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.
|
|
140
|
-
timeoutRef.current = window.setTimeout(() => {
|
|
141
|
-
attemptFocus(initialFocusElement.current, true);
|
|
142
|
-
}, 60);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}, [props.children, props.initialFocusElement, props.active, props.returnFocusOnDeactivate]);
|
|
147
|
-
// Return function to run only when FocusTrap is unmounted to restore focus
|
|
148
|
-
React.useEffect(() => {
|
|
149
|
-
return () => {
|
|
150
|
-
window.clearTimeout(timeoutRef.current);
|
|
151
|
-
if (restoreFocusElement.current)
|
|
152
|
-
restoreFocusElement.current.focus({ preventScroll: true });
|
|
153
|
-
};
|
|
154
|
-
}, []);
|
|
155
|
-
// this is hit if Shift tab is used.
|
|
156
|
-
const cycleFocusToEnd = React.useCallback((event) => {
|
|
157
|
-
// istanbul ignore next
|
|
158
|
-
if (!props.active)
|
|
159
|
-
return;
|
|
160
|
-
if (focusContainer.current && event.target === focusContainer.current) {
|
|
161
|
-
event.stopPropagation();
|
|
162
|
-
event.preventDefault();
|
|
163
|
-
const focusable = findLastFocusableDescendant(focusContainer.current);
|
|
164
|
-
// istanbul ignore else
|
|
165
|
-
if (focusable) {
|
|
166
|
-
focusable.focus();
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)
|
|
170
|
-
attemptFocus(initialFocusElement.current, true);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}, [props.active]);
|
|
174
|
-
// this is hit if tab is used on last focusable item in child container.
|
|
175
|
-
const cycleFocusToStart = React.useCallback((event) => {
|
|
176
|
-
// istanbul ignore next
|
|
177
|
-
if (!props.active)
|
|
178
|
-
return;
|
|
179
|
-
event.stopPropagation();
|
|
180
|
-
// istanbul ignore else
|
|
181
|
-
if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)
|
|
182
|
-
initialFocusElement.current.focus();
|
|
183
|
-
}, [props.active]);
|
|
184
|
-
if (!props.children)
|
|
185
|
-
return null;
|
|
186
|
-
return (React.createElement(React.Fragment, null,
|
|
187
|
-
React.createElement("div", { "data-testid": "focus-trap-div", onFocus: cycleFocusToEnd, ref: focusContainer, tabIndex: 0,
|
|
188
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
189
|
-
style: { outline: "none", WebkitTapHighlightColor: "rgba(0,0,0,0)" } }, props.children),
|
|
190
|
-
React.createElement("div", { "data-testid": "focus-trap-limit-div", onFocus: cycleFocusToStart, tabIndex: 0 })));
|
|
191
|
-
}
|
|
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
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Popup
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Logger } from "@itwin/core-bentley";
|
|
10
|
+
import { UiCore } from "../UiCore";
|
|
11
|
+
// cSpell:ignore focusable
|
|
12
|
+
function isFocusable(element) {
|
|
13
|
+
if (!element || element.tabIndex < 0)
|
|
14
|
+
return false;
|
|
15
|
+
if (element.classList && element.classList.contains("core-focus-trap-ignore-initial"))
|
|
16
|
+
return false;
|
|
17
|
+
if (element.getAttribute && (typeof element.getAttribute === "function") && element.getAttribute("disabled") !== null)
|
|
18
|
+
return false;
|
|
19
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null))
|
|
20
|
+
return true;
|
|
21
|
+
switch (element.nodeName) {
|
|
22
|
+
case "A":
|
|
23
|
+
const anchorElement = element;
|
|
24
|
+
return !!anchorElement.href && anchorElement.rel !== "ignore";
|
|
25
|
+
case "INPUT":
|
|
26
|
+
const inputElement = element;
|
|
27
|
+
return inputElement.type !== "hidden" && inputElement.type !== "file";
|
|
28
|
+
case "BUTTON":
|
|
29
|
+
case "SELECT":
|
|
30
|
+
case "TEXTAREA":
|
|
31
|
+
return true;
|
|
32
|
+
default:
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function processFindFocusableDescendant(element) {
|
|
37
|
+
// istanbul ignore next
|
|
38
|
+
if (!element)
|
|
39
|
+
return null;
|
|
40
|
+
for (const child of element.childNodes) {
|
|
41
|
+
// istanbul ignore else
|
|
42
|
+
if (isFocusable(child))
|
|
43
|
+
return child;
|
|
44
|
+
const focusable = processFindFocusableDescendant(child);
|
|
45
|
+
if (focusable)
|
|
46
|
+
return focusable;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
function findFirstFocusableDescendant(focusContainer) {
|
|
51
|
+
return processFindFocusableDescendant(focusContainer);
|
|
52
|
+
}
|
|
53
|
+
function processFindLastFocusableDescendant(element) {
|
|
54
|
+
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
55
|
+
const child = element.childNodes[i];
|
|
56
|
+
const focusable = processFindLastFocusableDescendant(child);
|
|
57
|
+
// istanbul ignore else
|
|
58
|
+
if (focusable)
|
|
59
|
+
return focusable;
|
|
60
|
+
// istanbul ignore else
|
|
61
|
+
if (isFocusable(child))
|
|
62
|
+
return child;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
function findLastFocusableDescendant(focusContainer) {
|
|
67
|
+
return processFindLastFocusableDescendant(focusContainer);
|
|
68
|
+
}
|
|
69
|
+
function getInitialFocusElement(focusContainer, initialFocusSpec) {
|
|
70
|
+
// istanbul ignore next
|
|
71
|
+
if (!focusContainer)
|
|
72
|
+
return null;
|
|
73
|
+
if (initialFocusSpec) {
|
|
74
|
+
if (typeof initialFocusSpec === "string") {
|
|
75
|
+
const node = focusContainer.querySelector(initialFocusSpec);
|
|
76
|
+
if (node) {
|
|
77
|
+
return node;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
Logger.logError(`${UiCore.packageName}.FocusTrap`, `Unable to locate element via selector ${initialFocusSpec}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return initialFocusSpec.current;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return findFirstFocusableDescendant(focusContainer);
|
|
88
|
+
}
|
|
89
|
+
function attemptFocus(element, preventScroll) {
|
|
90
|
+
// istanbul ignore next
|
|
91
|
+
if (!isFocusable(element))
|
|
92
|
+
return false;
|
|
93
|
+
try {
|
|
94
|
+
// istanbul ignore else
|
|
95
|
+
if (document.activeElement !== element)
|
|
96
|
+
element.focus({ preventScroll: preventScroll ? true : /* istanbul ignore next */ false });
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
// istanbul ignore next
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return (document.activeElement === element);
|
|
103
|
+
} // end attemptFocus
|
|
104
|
+
/** Focus into first focusable element of a container.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export function focusIntoContainer(focusContainer, initialFocusElement) {
|
|
108
|
+
let result = false;
|
|
109
|
+
const focusElement = getInitialFocusElement(focusContainer, initialFocusElement);
|
|
110
|
+
if (focusElement) {
|
|
111
|
+
// delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
attemptFocus(focusElement, true);
|
|
114
|
+
}, 60);
|
|
115
|
+
result = true;
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
/** Trap Focus in container while trap is active.
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
export function FocusTrap(props) {
|
|
123
|
+
const restoreFocusElement = React.useRef(null);
|
|
124
|
+
const initialFocusElement = React.useRef(null);
|
|
125
|
+
const focusContainer = React.useRef(null);
|
|
126
|
+
const isInitialMount = React.useRef(true);
|
|
127
|
+
const timeoutRef = React.useRef();
|
|
128
|
+
// Run on initial mount and when dependencies change. which could happen often.
|
|
129
|
+
React.useEffect(() => {
|
|
130
|
+
// istanbul ignore else
|
|
131
|
+
if (isInitialMount.current) {
|
|
132
|
+
isInitialMount.current = false;
|
|
133
|
+
if (props.active) {
|
|
134
|
+
if (props.returnFocusOnDeactivate) {
|
|
135
|
+
restoreFocusElement.current = document.activeElement;
|
|
136
|
+
}
|
|
137
|
+
initialFocusElement.current = getInitialFocusElement(focusContainer.current, props.initialFocusElement);
|
|
138
|
+
if (initialFocusElement.current) {
|
|
139
|
+
// delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.
|
|
140
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
141
|
+
attemptFocus(initialFocusElement.current, true);
|
|
142
|
+
}, 60);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, [props.children, props.initialFocusElement, props.active, props.returnFocusOnDeactivate]);
|
|
147
|
+
// Return function to run only when FocusTrap is unmounted to restore focus
|
|
148
|
+
React.useEffect(() => {
|
|
149
|
+
return () => {
|
|
150
|
+
window.clearTimeout(timeoutRef.current);
|
|
151
|
+
if (restoreFocusElement.current)
|
|
152
|
+
restoreFocusElement.current.focus({ preventScroll: true });
|
|
153
|
+
};
|
|
154
|
+
}, []);
|
|
155
|
+
// this is hit if Shift tab is used.
|
|
156
|
+
const cycleFocusToEnd = React.useCallback((event) => {
|
|
157
|
+
// istanbul ignore next
|
|
158
|
+
if (!props.active)
|
|
159
|
+
return;
|
|
160
|
+
if (focusContainer.current && event.target === focusContainer.current) {
|
|
161
|
+
event.stopPropagation();
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
const focusable = findLastFocusableDescendant(focusContainer.current);
|
|
164
|
+
// istanbul ignore else
|
|
165
|
+
if (focusable) {
|
|
166
|
+
focusable.focus();
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)
|
|
170
|
+
attemptFocus(initialFocusElement.current, true);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}, [props.active]);
|
|
174
|
+
// this is hit if tab is used on last focusable item in child container.
|
|
175
|
+
const cycleFocusToStart = React.useCallback((event) => {
|
|
176
|
+
// istanbul ignore next
|
|
177
|
+
if (!props.active)
|
|
178
|
+
return;
|
|
179
|
+
event.stopPropagation();
|
|
180
|
+
// istanbul ignore else
|
|
181
|
+
if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)
|
|
182
|
+
initialFocusElement.current.focus();
|
|
183
|
+
}, [props.active]);
|
|
184
|
+
if (!props.children)
|
|
185
|
+
return null;
|
|
186
|
+
return (React.createElement(React.Fragment, null,
|
|
187
|
+
React.createElement("div", { "data-testid": "focus-trap-div", onFocus: cycleFocusToEnd, ref: focusContainer, tabIndex: 0,
|
|
188
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
189
|
+
style: { outline: "none", WebkitTapHighlightColor: "rgba(0,0,0,0)" } }, props.children),
|
|
190
|
+
React.createElement("div", { "data-testid": "focus-trap-limit-div", onFocus: cycleFocusToStart, tabIndex: 0 })));
|
|
191
|
+
}
|
|
192
192
|
//# sourceMappingURL=FocusTrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusTrap.js","sourceRoot":"","sources":["../../../../src/core-react/focustrap/FocusTrap.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,0BAA0B;AAE1B,SAAS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F,gEAAgE;YAChE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,eAAe,EAAE,IACnE,KAAK,CAAC,QAAQ,CACX;QAEN,4CAAiB,sBAAsB,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,GAAI,CAClF,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Popup\n */\n\nimport * as React from \"react\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiCore } from \"../UiCore\";\n\n// cSpell:ignore focusable\n\nfunction isFocusable(element: HTMLElement): boolean {\n if (!element || element.tabIndex < 0)\n return false;\n\n if (element.classList && element.classList.contains(\"core-focus-trap-ignore-initial\"))\n return false;\n\n if (element.getAttribute && (typeof element.getAttribute === \"function\") && element.getAttribute(\"disabled\") !== null)\n return false;\n\n if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute(\"tabIndex\") !== null))\n return true;\n\n switch (element.nodeName) {\n case \"A\":\n const anchorElement = element as HTMLAnchorElement;\n return !!anchorElement.href && anchorElement.rel !== \"ignore\";\n case \"INPUT\":\n const inputElement = element as HTMLInputElement;\n return inputElement.type !== \"hidden\" && inputElement.type !== \"file\";\n case \"BUTTON\":\n case \"SELECT\":\n case \"TEXTAREA\":\n return true;\n default:\n return false;\n }\n}\n\nfunction processFindFocusableDescendant(element: HTMLElement | null): HTMLElement | null {\n // istanbul ignore next\n if (!element)\n return null;\n\n for (const child of element.childNodes) {\n // istanbul ignore else\n if (isFocusable(child as HTMLElement))\n return child as HTMLElement;\n\n const focusable = processFindFocusableDescendant(child as HTMLElement);\n if (focusable)\n return focusable;\n }\n return null;\n}\n\nfunction findFirstFocusableDescendant(focusContainer: HTMLDivElement | null): HTMLElement | null {\n return processFindFocusableDescendant(focusContainer);\n}\n\nfunction processFindLastFocusableDescendant(element: HTMLElement): HTMLElement | null {\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\n const child = element.childNodes[i] as HTMLElement;\n\n const focusable = processFindLastFocusableDescendant(child);\n // istanbul ignore else\n if (focusable)\n return focusable;\n\n // istanbul ignore else\n if (isFocusable(child))\n return child;\n }\n return null;\n}\n\nfunction findLastFocusableDescendant(focusContainer: HTMLDivElement): HTMLElement | null {\n return processFindLastFocusableDescendant(focusContainer);\n}\n\nfunction getInitialFocusElement(focusContainer: HTMLDivElement | null, initialFocusSpec: React.RefObject<HTMLElement> | string | undefined): HTMLElement | null {\n // istanbul ignore next\n if (!focusContainer)\n return null;\n\n if (initialFocusSpec) {\n if (typeof initialFocusSpec === \"string\") {\n const node = focusContainer.querySelector(initialFocusSpec);\n if (node) {\n return node as HTMLElement;\n } else {\n Logger.logError(`${UiCore.packageName}.FocusTrap`, `Unable to locate element via selector ${initialFocusSpec}`);\n }\n } else {\n return initialFocusSpec.current;\n }\n }\n return findFirstFocusableDescendant(focusContainer);\n}\n\nfunction attemptFocus(element: HTMLElement, preventScroll: boolean): boolean {\n // istanbul ignore next\n if (!isFocusable(element))\n return false;\n\n try {\n // istanbul ignore else\n if (document.activeElement !== element)\n element.focus({ preventScroll: preventScroll ? true : /* istanbul ignore next */ false });\n } catch (e) {\n // istanbul ignore next\n return false;\n }\n return (document.activeElement === element);\n} // end attemptFocus\n\n/** Focus into first focusable element of a container.\n * @internal\n */\nexport function focusIntoContainer(focusContainer: HTMLDivElement, initialFocusElement?: React.RefObject<HTMLElement> | string): boolean {\n let result = false;\n const focusElement = getInitialFocusElement(focusContainer, initialFocusElement);\n if (focusElement) {\n // delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.\n setTimeout(() => {\n attemptFocus(focusElement, true);\n }, 60);\n result = true;\n }\n return result;\n}\n\n/** Properties supported by [[FocusTrap]] component.\n * @internal\n */\nexport interface FocusTrapProps extends React.AllHTMLAttributes<any> {\n /** child components */\n children: React.ReactNode;\n /** if active is not true then no trapping of focus is attempted. */\n active?: boolean;\n /** restore focus to element that had focus before trap was activated */\n returnFocusOnDeactivate: boolean;\n /** Optional reference to element to receive focus when trap is activated. Optionally a CSS Selector\n * string can be supplied to locate an element in the FocusTrap container. If no specification is defined\n * the first focusable element is used.\n */\n initialFocusElement?: React.RefObject<HTMLElement> | string;\n}\n\n/** Trap Focus in container while trap is active.\n * @internal\n */\nexport function FocusTrap(props: FocusTrapProps) {\n const restoreFocusElement = React.useRef<Element | null>(null);\n const initialFocusElement = React.useRef<Element | null>(null);\n const focusContainer = React.useRef<HTMLDivElement | null>(null);\n const isInitialMount = React.useRef(true);\n const timeoutRef = React.useRef<number | undefined>();\n\n // Run on initial mount and when dependencies change. which could happen often.\n React.useEffect(() => {\n // istanbul ignore else\n if (isInitialMount.current) {\n isInitialMount.current = false;\n if (props.active) {\n if (props.returnFocusOnDeactivate) {\n restoreFocusElement.current = document.activeElement;\n }\n\n initialFocusElement.current = getInitialFocusElement(focusContainer.current, props.initialFocusElement);\n if (initialFocusElement.current) {\n // delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.\n timeoutRef.current = window.setTimeout(() => {\n attemptFocus((initialFocusElement.current as HTMLElement), true);\n }, 60);\n }\n }\n }\n }, [props.children, props.initialFocusElement, props.active, props.returnFocusOnDeactivate]);\n\n // Return function to run only when FocusTrap is unmounted to restore focus\n React.useEffect(() => {\n return () => {\n window.clearTimeout(timeoutRef.current);\n if (restoreFocusElement.current)\n (restoreFocusElement.current as HTMLElement).focus({ preventScroll: true });\n };\n }, []);\n\n // this is hit if Shift tab is used.\n const cycleFocusToEnd = React.useCallback((event: React.FocusEvent<HTMLDivElement>) => {\n // istanbul ignore next\n if (!props.active)\n return;\n\n if (focusContainer.current && event.target === focusContainer.current) {\n event.stopPropagation();\n event.preventDefault();\n const focusable = findLastFocusableDescendant(focusContainer.current);\n\n // istanbul ignore else\n if (focusable) {\n focusable.focus();\n } else {\n if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)\n attemptFocus((initialFocusElement.current as HTMLElement), true);\n }\n }\n }, [props.active]);\n\n // this is hit if tab is used on last focusable item in child container.\n const cycleFocusToStart = React.useCallback((event: React.FocusEvent<HTMLDivElement>) => {\n // istanbul ignore next\n if (!props.active)\n return;\n\n event.stopPropagation();\n // istanbul ignore else\n if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)\n (initialFocusElement.current as HTMLElement).focus();\n }, [props.active]);\n\n if (!props.children)\n return null;\n return (\n <>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div data-testid=\"focus-trap-div\" onFocus={cycleFocusToEnd} ref={focusContainer} tabIndex={0}\n // eslint-disable-next-line @typescript-eslint/naming-convention\n style={{ outline: \"none\", WebkitTapHighlightColor: \"rgba(0,0,0,0)\" }}>\n {props.children}\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div data-testid=\"focus-trap-limit-div\" onFocus={cycleFocusToStart} tabIndex={0} />\n </>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FocusTrap.js","sourceRoot":"","sources":["../../../../src/core-react/focustrap/FocusTrap.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,0BAA0B;AAE1B,SAAS,WAAW,CAAC,OAAoB;IACvC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,GAAG,CAAC;QAClC,OAAO,KAAK,CAAC;IAEf,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QACnF,OAAO,KAAK,CAAC;IAEf,IAAI,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,O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AAE,CAAC;YACvB,MAAM,SAAS,GAAG,2BAA2B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAEtE,uBAAuB;YACvB,IAAI,SAAS,EAAE;gBACb,SAAS,CAAC,KAAK,EAAE,CAAC;aACnB;iBAAM;gBACL,IAAI,mBAAmB,CAAC,OAAO,IAAI,mBAAmB,CAAC,OAAO,KAAK,QAAQ,CAAC,aAAa;oBACvF,YAAY,CAAE,mBAAmB,CAAC,OAAuB,EAAE,IAAI,CAAC,CAAC;aACpE;SACF;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnB,wEAAwE;IACxE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAuC,EAAE,EAAE;QACtF,uBAAuB;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM;YACf,OAAO;QAET,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,uBAAuB;QACvB,IAAI,mBAAmB,CAAC,OAAO,IAAI,mBAAmB,CAAC,OAAO,KAAK,QAAQ,CAAC,aAAa;YACtF,mBAAmB,CAAC,OAAuB,CAAC,KAAK,EAAE,CAAC;IACzD,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnB,IAAI,CAAC,KAAK,CAAC,QAAQ;QACjB,OAAO,IAAI,CAAC;IACd,OAAO,CACL;QAEE,4CAAiB,gBAAgB,EAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;YAC1F,gEAAgE;YAChE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,eAAe,EAAE,IACnE,KAAK,CAAC,QAAQ,CACX;QAEN,4CAAiB,sBAAsB,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,GAAI,CAClF,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Popup\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { UiCore } from \"../UiCore\";\r\n\r\n// cSpell:ignore focusable\r\n\r\nfunction isFocusable(element: HTMLElement): boolean {\r\n if (!element || element.tabIndex < 0)\r\n return false;\r\n\r\n if (element.classList && element.classList.contains(\"core-focus-trap-ignore-initial\"))\r\n return false;\r\n\r\n if (element.getAttribute && (typeof element.getAttribute === \"function\") && element.getAttribute(\"disabled\") !== null)\r\n return false;\r\n\r\n if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute(\"tabIndex\") !== null))\r\n return true;\r\n\r\n switch (element.nodeName) {\r\n case \"A\":\r\n const anchorElement = element as HTMLAnchorElement;\r\n return !!anchorElement.href && anchorElement.rel !== \"ignore\";\r\n case \"INPUT\":\r\n const inputElement = element as HTMLInputElement;\r\n return inputElement.type !== \"hidden\" && inputElement.type !== \"file\";\r\n case \"BUTTON\":\r\n case \"SELECT\":\r\n case \"TEXTAREA\":\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\nfunction processFindFocusableDescendant(element: HTMLElement | null): HTMLElement | null {\r\n // istanbul ignore next\r\n if (!element)\r\n return null;\r\n\r\n for (const child of element.childNodes) {\r\n // istanbul ignore else\r\n if (isFocusable(child as HTMLElement))\r\n return child as HTMLElement;\r\n\r\n const focusable = processFindFocusableDescendant(child as HTMLElement);\r\n if (focusable)\r\n return focusable;\r\n }\r\n return null;\r\n}\r\n\r\nfunction findFirstFocusableDescendant(focusContainer: HTMLDivElement | null): HTMLElement | null {\r\n return processFindFocusableDescendant(focusContainer);\r\n}\r\n\r\nfunction processFindLastFocusableDescendant(element: HTMLElement): HTMLElement | null {\r\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\r\n const child = element.childNodes[i] as HTMLElement;\r\n\r\n const focusable = processFindLastFocusableDescendant(child);\r\n // istanbul ignore else\r\n if (focusable)\r\n return focusable;\r\n\r\n // istanbul ignore else\r\n if (isFocusable(child))\r\n return child;\r\n }\r\n return null;\r\n}\r\n\r\nfunction findLastFocusableDescendant(focusContainer: HTMLDivElement): HTMLElement | null {\r\n return processFindLastFocusableDescendant(focusContainer);\r\n}\r\n\r\nfunction getInitialFocusElement(focusContainer: HTMLDivElement | null, initialFocusSpec: React.RefObject<HTMLElement> | string | undefined): HTMLElement | null {\r\n // istanbul ignore next\r\n if (!focusContainer)\r\n return null;\r\n\r\n if (initialFocusSpec) {\r\n if (typeof initialFocusSpec === \"string\") {\r\n const node = focusContainer.querySelector(initialFocusSpec);\r\n if (node) {\r\n return node as HTMLElement;\r\n } else {\r\n Logger.logError(`${UiCore.packageName}.FocusTrap`, `Unable to locate element via selector ${initialFocusSpec}`);\r\n }\r\n } else {\r\n return initialFocusSpec.current;\r\n }\r\n }\r\n return findFirstFocusableDescendant(focusContainer);\r\n}\r\n\r\nfunction attemptFocus(element: HTMLElement, preventScroll: boolean): boolean {\r\n // istanbul ignore next\r\n if (!isFocusable(element))\r\n return false;\r\n\r\n try {\r\n // istanbul ignore else\r\n if (document.activeElement !== element)\r\n element.focus({ preventScroll: preventScroll ? true : /* istanbul ignore next */ false });\r\n } catch (e) {\r\n // istanbul ignore next\r\n return false;\r\n }\r\n return (document.activeElement === element);\r\n} // end attemptFocus\r\n\r\n/** Focus into first focusable element of a container.\r\n * @internal\r\n */\r\nexport function focusIntoContainer(focusContainer: HTMLDivElement, initialFocusElement?: React.RefObject<HTMLElement> | string): boolean {\r\n let result = false;\r\n const focusElement = getInitialFocusElement(focusContainer, initialFocusElement);\r\n if (focusElement) {\r\n // delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.\r\n setTimeout(() => {\r\n attemptFocus(focusElement, true);\r\n }, 60);\r\n result = true;\r\n }\r\n return result;\r\n}\r\n\r\n/** Properties supported by [[FocusTrap]] component.\r\n * @internal\r\n */\r\nexport interface FocusTrapProps extends React.AllHTMLAttributes<any> {\r\n /** child components */\r\n children: React.ReactNode;\r\n /** if active is not true then no trapping of focus is attempted. */\r\n active?: boolean;\r\n /** restore focus to element that had focus before trap was activated */\r\n returnFocusOnDeactivate: boolean;\r\n /** Optional reference to element to receive focus when trap is activated. Optionally a CSS Selector\r\n * string can be supplied to locate an element in the FocusTrap container. If no specification is defined\r\n * the first focusable element is used.\r\n */\r\n initialFocusElement?: React.RefObject<HTMLElement> | string;\r\n}\r\n\r\n/** Trap Focus in container while trap is active.\r\n * @internal\r\n */\r\nexport function FocusTrap(props: FocusTrapProps) {\r\n const restoreFocusElement = React.useRef<Element | null>(null);\r\n const initialFocusElement = React.useRef<Element | null>(null);\r\n const focusContainer = React.useRef<HTMLDivElement | null>(null);\r\n const isInitialMount = React.useRef(true);\r\n const timeoutRef = React.useRef<number | undefined>();\r\n\r\n // Run on initial mount and when dependencies change. which could happen often.\r\n React.useEffect(() => {\r\n // istanbul ignore else\r\n if (isInitialMount.current) {\r\n isInitialMount.current = false;\r\n if (props.active) {\r\n if (props.returnFocusOnDeactivate) {\r\n restoreFocusElement.current = document.activeElement;\r\n }\r\n\r\n initialFocusElement.current = getInitialFocusElement(focusContainer.current, props.initialFocusElement);\r\n if (initialFocusElement.current) {\r\n // delay setting focus immediately because in some browsers other focus events happen when popup is initially opened.\r\n timeoutRef.current = window.setTimeout(() => {\r\n attemptFocus((initialFocusElement.current as HTMLElement), true);\r\n }, 60);\r\n }\r\n }\r\n }\r\n }, [props.children, props.initialFocusElement, props.active, props.returnFocusOnDeactivate]);\r\n\r\n // Return function to run only when FocusTrap is unmounted to restore focus\r\n React.useEffect(() => {\r\n return () => {\r\n window.clearTimeout(timeoutRef.current);\r\n if (restoreFocusElement.current)\r\n (restoreFocusElement.current as HTMLElement).focus({ preventScroll: true });\r\n };\r\n }, []);\r\n\r\n // this is hit if Shift tab is used.\r\n const cycleFocusToEnd = React.useCallback((event: React.FocusEvent<HTMLDivElement>) => {\r\n // istanbul ignore next\r\n if (!props.active)\r\n return;\r\n\r\n if (focusContainer.current && event.target === focusContainer.current) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n const focusable = findLastFocusableDescendant(focusContainer.current);\r\n\r\n // istanbul ignore else\r\n if (focusable) {\r\n focusable.focus();\r\n } else {\r\n if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)\r\n attemptFocus((initialFocusElement.current as HTMLElement), true);\r\n }\r\n }\r\n }, [props.active]);\r\n\r\n // this is hit if tab is used on last focusable item in child container.\r\n const cycleFocusToStart = React.useCallback((event: React.FocusEvent<HTMLDivElement>) => {\r\n // istanbul ignore next\r\n if (!props.active)\r\n return;\r\n\r\n event.stopPropagation();\r\n // istanbul ignore else\r\n if (initialFocusElement.current && initialFocusElement.current !== document.activeElement)\r\n (initialFocusElement.current as HTMLElement).focus();\r\n }, [props.active]);\r\n\r\n if (!props.children)\r\n return null;\r\n return (\r\n <>\r\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\r\n <div data-testid=\"focus-trap-div\" onFocus={cycleFocusToEnd} ref={focusContainer} tabIndex={0}\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n style={{ outline: \"none\", WebkitTapHighlightColor: \"rgba(0,0,0,0)\" }}>\r\n {props.children}\r\n </div>\r\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\r\n <div data-testid=\"focus-trap-limit-div\" onFocus={cycleFocusToStart} tabIndex={0} />\r\n </>\r\n );\r\n}\r\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Form
|
|
3
|
-
*/
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { FieldDef } from "./Form";
|
|
6
|
-
/** Properties used to create a [[Field]] in a [[Form]]
|
|
7
|
-
* @public @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export interface FieldProps extends FieldDef {
|
|
10
|
-
id: string;
|
|
11
|
-
}
|
|
12
|
-
/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.
|
|
13
|
-
* @public @deprecated
|
|
14
|
-
*/
|
|
15
|
-
export declare class Field extends React.Component<FieldProps> {
|
|
16
|
-
constructor(props: FieldProps);
|
|
17
|
-
private _generateSelectOptions;
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Form
|
|
3
|
+
*/
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { FieldDef } from "./Form";
|
|
6
|
+
/** Properties used to create a [[Field]] in a [[Form]]
|
|
7
|
+
* @public @deprecated
|
|
8
|
+
*/
|
|
9
|
+
export interface FieldProps extends FieldDef {
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.
|
|
13
|
+
* @public @deprecated
|
|
14
|
+
*/
|
|
15
|
+
export declare class Field extends React.Component<FieldProps> {
|
|
16
|
+
constructor(props: FieldProps);
|
|
17
|
+
private _generateSelectOptions;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
20
|
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -1,41 +1,41 @@
|
|
|
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
|
-
/* eslint-disable deprecation/deprecation */
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Form
|
|
8
|
-
*/
|
|
9
|
-
import * as React from "react";
|
|
10
|
-
import { Checkbox, Input, Select, Textarea } from "@itwin/itwinui-react";
|
|
11
|
-
import { FormContext } from "./Form";
|
|
12
|
-
/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.
|
|
13
|
-
* @public @deprecated
|
|
14
|
-
*/
|
|
15
|
-
export class Field extends React.Component {
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this._generateSelectOptions = (propOptions) => {
|
|
19
|
-
let selectOptions = [];
|
|
20
|
-
if (propOptions instanceof Array) {
|
|
21
|
-
selectOptions = propOptions.map((option) => ({ value: option, label: option }));
|
|
22
|
-
}
|
|
23
|
-
else if (propOptions !== undefined) {
|
|
24
|
-
selectOptions = Object.keys(propOptions).map((key) => ({ value: key, label: propOptions[key] }));
|
|
25
|
-
}
|
|
26
|
-
return selectOptions;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
const selectOptions = this._generateSelectOptions(this.props.options);
|
|
31
|
-
return (React.createElement(FormContext.Consumer, null, (context) => (React.createElement("div", { className: "core-form-group" },
|
|
32
|
-
this.props.editor.toLowerCase() !== "checkbox" && this.props.label && React.createElement("label", { className: "core-form-label", htmlFor: this.props.id }, this.props.label),
|
|
33
|
-
this.props.editor.toLowerCase() === "textbox" && (React.createElement(Input, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-input", size: "small" })),
|
|
34
|
-
this.props.editor.toLowerCase() === "checkbox" && (React.createElement(Checkbox, { label: this.props.label, id: this.props.id, checked: context.values[this.props.id], onChange: () => context.setValues({ [this.props.id]: !context.values[this.props.id] }) })),
|
|
35
|
-
this.props.editor.toLowerCase() === "multilinetextbox" && (React.createElement(Textarea, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-textarea" })),
|
|
36
|
-
this.props.editor.toLowerCase() === "dropdown" && this.props.options && (React.createElement(Select, { id: this.props.id,
|
|
37
|
-
// name={this.props.id}
|
|
38
|
-
value: context.values[this.props.id], onChange: (newValue) => context.setValues({ [this.props.id]: newValue }), options: selectOptions, className: "core-form-select", size: "small" }))))));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
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
|
+
/* eslint-disable deprecation/deprecation */
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Form
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { Checkbox, Input, Select, Textarea } from "@itwin/itwinui-react";
|
|
11
|
+
import { FormContext } from "./Form";
|
|
12
|
+
/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.
|
|
13
|
+
* @public @deprecated
|
|
14
|
+
*/
|
|
15
|
+
export class Field extends React.Component {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this._generateSelectOptions = (propOptions) => {
|
|
19
|
+
let selectOptions = [];
|
|
20
|
+
if (propOptions instanceof Array) {
|
|
21
|
+
selectOptions = propOptions.map((option) => ({ value: option, label: option }));
|
|
22
|
+
}
|
|
23
|
+
else if (propOptions !== undefined) {
|
|
24
|
+
selectOptions = Object.keys(propOptions).map((key) => ({ value: key, label: propOptions[key] }));
|
|
25
|
+
}
|
|
26
|
+
return selectOptions;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const selectOptions = this._generateSelectOptions(this.props.options);
|
|
31
|
+
return (React.createElement(FormContext.Consumer, null, (context) => (React.createElement("div", { className: "core-form-group" },
|
|
32
|
+
this.props.editor.toLowerCase() !== "checkbox" && this.props.label && React.createElement("label", { className: "core-form-label", htmlFor: this.props.id }, this.props.label),
|
|
33
|
+
this.props.editor.toLowerCase() === "textbox" && (React.createElement(Input, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-input", size: "small" })),
|
|
34
|
+
this.props.editor.toLowerCase() === "checkbox" && (React.createElement(Checkbox, { label: this.props.label, id: this.props.id, checked: context.values[this.props.id], onChange: () => context.setValues({ [this.props.id]: !context.values[this.props.id] }) })),
|
|
35
|
+
this.props.editor.toLowerCase() === "multilinetextbox" && (React.createElement(Textarea, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-textarea" })),
|
|
36
|
+
this.props.editor.toLowerCase() === "dropdown" && this.props.options && (React.createElement(Select, { id: this.props.id,
|
|
37
|
+
// name={this.props.id}
|
|
38
|
+
value: context.values[this.props.id], onChange: (newValue) => context.setValues({ [this.props.id]: newValue }), options: selectOptions, className: "core-form-select", size: "small" }))))));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
41
|
//# sourceMappingURL=Field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/core-react/form/Field.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAgB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAY,WAAW,EAAoB,MAAM,QAAQ,CAAC;AAcjE;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAqB;IACpD,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,2BAAsB,GAAG,CAAC,WAA4B,EAA0B,EAAE;YACxF,IAAI,aAAa,GAA2B,EAAE,CAAC;YAE/C,IAAI,WAAW,YAAY,KAAK,EAAE;gBAChC,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,CAClD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK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,CAAC,OAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAC9E,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,kBAAkB,EAC5B,IAAI,EAAC,OAAO,GACZ,CACH,CACG,CACP,CACoB,CACxB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module Form\n */\n\nimport * as React from \"react\";\nimport { Checkbox, Input, Select, SelectOption, Textarea } from \"@itwin/itwinui-react\";\nimport { FieldDef, FormContext, FormContextState } from \"./Form\";\n\n// cSpell:ignore multilinetextbox\n\n/** Properties used to create a [[Field]] in a [[Form]]\n * @public @deprecated\n */\nexport interface FieldProps extends FieldDef {\n /* The unique field name */\n id: string;\n}\n\ntype FieldDefOptions = FieldDef[\"options\"];\n\n/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.\n * @public @deprecated\n */\nexport class Field extends React.Component<FieldProps> {\n constructor(props: FieldProps) {\n super(props);\n }\n\n private _generateSelectOptions = (propOptions: FieldDefOptions): SelectOption<string>[] => {\n let selectOptions: SelectOption<string>[] = [];\n\n if (propOptions instanceof Array) {\n selectOptions = propOptions.map((option: string) => (\n { value: option, label: option }\n ));\n } else if (propOptions !== undefined) {\n selectOptions = Object.keys(propOptions).map((key) => (\n { value: key, label: propOptions[key] }\n ));\n }\n\n return selectOptions;\n };\n\n public override render() {\n const selectOptions = this._generateSelectOptions(this.props.options);\n\n return (\n <FormContext.Consumer>\n {(context: FormContextState | undefined) => (\n <div className=\"core-form-group\">\n {this.props.editor!.toLowerCase() !== \"checkbox\" && this.props.label && <label className=\"core-form-label\" htmlFor={this.props.id}>{this.props.label}</label>}\n\n {this.props.editor!.toLowerCase() === \"textbox\" && (\n <Input\n id={this.props.id}\n value={context!.values[this.props.id]}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\n className=\"core-form-input\"\n size=\"small\"\n />\n )}\n {this.props.editor!.toLowerCase() === \"checkbox\" && (\n <Checkbox\n label={this.props.label}\n id={this.props.id}\n checked={context!.values[this.props.id]}\n onChange={() => context!.setValues({ [this.props.id]: !context!.values[this.props.id] })}\n />\n )}\n {this.props.editor!.toLowerCase() === \"multilinetextbox\" && (\n <Textarea\n id={this.props.id}\n value={context!.values[this.props.id]}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\n className=\"core-form-textarea\"\n />\n )}\n {this.props.editor!.toLowerCase() === \"dropdown\" && this.props.options && (\n <Select\n id={this.props.id}\n // name={this.props.id}\n value={context!.values[this.props.id]}\n onChange={(newValue: any) => context!.setValues({ [this.props.id]: newValue })}\n options={selectOptions}\n className=\"core-form-select\"\n size=\"small\"\n />\n )}\n </div>\n )}\n </FormContext.Consumer>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/core-react/form/Field.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAgB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAY,WAAW,EAAoB,MAAM,QAAQ,CAAC;AAcjE;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAqB;IACpD,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,2BAAsB,GAAG,CAAC,WAA4B,EAA0B,EAAE;YACxF,IAAI,aAAa,GAA2B,EAA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AC,KAAK,CAAC,EAAE;gBACjB,uBAAuB;gBACvB,KAAK,EAAE,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EACrC,QAAQ,EAAE,CAAC,QAAa,EAAE,EAAE,CAAC,OAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAC9E,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,kBAAkB,EAC5B,IAAI,EAAC,OAAO,GACZ,CACH,CACG,CACP,CACoB,CACxB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Form\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Checkbox, Input, Select, SelectOption, Textarea } from \"@itwin/itwinui-react\";\r\nimport { FieldDef, FormContext, FormContextState } from \"./Form\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** Properties used to create a [[Field]] in a [[Form]]\r\n * @public @deprecated\r\n */\r\nexport interface FieldProps extends FieldDef {\r\n /* The unique field name */\r\n id: string;\r\n}\r\n\r\ntype FieldDefOptions = FieldDef[\"options\"];\r\n\r\n/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.\r\n * @public @deprecated\r\n */\r\nexport class Field extends React.Component<FieldProps> {\r\n constructor(props: FieldProps) {\r\n super(props);\r\n }\r\n\r\n private _generateSelectOptions = (propOptions: FieldDefOptions): SelectOption<string>[] => {\r\n let selectOptions: SelectOption<string>[] = [];\r\n\r\n if (propOptions instanceof Array) {\r\n selectOptions = propOptions.map((option: string) => (\r\n { value: option, label: option }\r\n ));\r\n } else if (propOptions !== undefined) {\r\n selectOptions = Object.keys(propOptions).map((key) => (\r\n { value: key, label: propOptions[key] }\r\n ));\r\n }\r\n\r\n return selectOptions;\r\n };\r\n\r\n public override render() {\r\n const selectOptions = this._generateSelectOptions(this.props.options);\r\n\r\n return (\r\n <FormContext.Consumer>\r\n {(context: FormContextState | undefined) => (\r\n <div className=\"core-form-group\">\r\n {this.props.editor!.toLowerCase() !== \"checkbox\" && this.props.label && <label className=\"core-form-label\" htmlFor={this.props.id}>{this.props.label}</label>}\r\n\r\n {this.props.editor!.toLowerCase() === \"textbox\" && (\r\n <Input\r\n id={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\r\n className=\"core-form-input\"\r\n size=\"small\"\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"checkbox\" && (\r\n <Checkbox\r\n label={this.props.label}\r\n id={this.props.id}\r\n checked={context!.values[this.props.id]}\r\n onChange={() => context!.setValues({ [this.props.id]: !context!.values[this.props.id] })}\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"multilinetextbox\" && (\r\n <Textarea\r\n id={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\r\n className=\"core-form-textarea\"\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"dropdown\" && this.props.options && (\r\n <Select\r\n id={this.props.id}\r\n // name={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(newValue: any) => context!.setValues({ [this.props.id]: newValue })}\r\n options={selectOptions}\r\n className=\"core-form-select\"\r\n size=\"small\"\r\n />\r\n )}\r\n </div>\r\n )}\r\n </FormContext.Consumer>\r\n );\r\n }\r\n}\r\n"]}
|