@itwin/core-react 3.6.0-dev.8 → 4.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/core-react/button/Button.d.ts +4 -4
- package/lib/cjs/core-react/button/Button.js +3 -3
- package/lib/cjs/core-react/button/Button.js.map +1 -1
- package/lib/cjs/core-react/checkbox/Checkbox.d.ts +2 -2
- package/lib/cjs/core-react/checkbox/Checkbox.js +1 -1
- package/lib/cjs/core-react/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/core-react/dialog/DialogButtonDef.d.ts +3 -3
- package/lib/cjs/core-react/dialog/DialogButtonDef.js +2 -2
- package/lib/cjs/core-react/dialog/DialogButtonDef.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableBlock.d.ts +2 -2
- package/lib/cjs/core-react/expandable/ExpandableBlock.js +1 -1
- package/lib/cjs/core-react/expandable/ExpandableBlock.js.map +1 -1
- package/lib/cjs/core-react/form/Field.d.ts +2 -2
- package/lib/cjs/core-react/form/Field.js +1 -1
- package/lib/cjs/core-react/form/Field.js.map +1 -1
- package/lib/cjs/core-react/form/Form.d.ts +5 -5
- package/lib/cjs/core-react/form/Form.js +1 -1
- package/lib/cjs/core-react/form/Form.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgSprite.d.ts +2 -2
- package/lib/cjs/core-react/icons/SvgSprite.js +1 -1
- package/lib/cjs/core-react/icons/SvgSprite.js.map +1 -1
- package/lib/cjs/core-react/inputs/Input.d.ts +2 -2
- package/lib/cjs/core-react/inputs/Input.js +1 -1
- package/lib/cjs/core-react/inputs/Input.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledInput.d.ts +2 -2
- package/lib/cjs/core-react/inputs/LabeledInput.js +1 -1
- package/lib/cjs/core-react/inputs/LabeledInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledTextarea.d.ts +2 -2
- package/lib/cjs/core-react/inputs/LabeledTextarea.js +1 -1
- package/lib/cjs/core-react/inputs/LabeledTextarea.js.map +1 -1
- package/lib/cjs/core-react/inputs/Textarea.d.ts +2 -2
- package/lib/cjs/core-react/inputs/Textarea.js +1 -1
- package/lib/cjs/core-react/inputs/Textarea.js.map +1 -1
- package/lib/cjs/core-react/loading/Spinner.d.ts +3 -3
- package/lib/cjs/core-react/loading/Spinner.js +2 -2
- package/lib/cjs/core-react/loading/Spinner.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageSeverity.d.ts +1 -1
- package/lib/cjs/core-react/messagebox/MessageSeverity.js +1 -1
- package/lib/cjs/core-react/messagebox/MessageSeverity.js.map +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressBar.d.ts +2 -2
- package/lib/cjs/core-react/progress-indicators/ProgressBar.js +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressBar.js.map +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.d.ts +2 -2
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.js +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.js.map +1 -1
- package/lib/cjs/core-react/radio/Radio.d.ts +2 -2
- package/lib/cjs/core-react/radio/Radio.js +1 -1
- package/lib/cjs/core-react/radio/Radio.js.map +1 -1
- package/lib/cjs/core-react/select/LabeledSelect.d.ts +2 -2
- package/lib/cjs/core-react/select/LabeledSelect.js +1 -1
- package/lib/cjs/core-react/select/LabeledSelect.js.map +1 -1
- package/lib/cjs/core-react/select/LabeledThemedSelect.d.ts +2 -2
- package/lib/cjs/core-react/select/LabeledThemedSelect.js +1 -1
- package/lib/cjs/core-react/select/LabeledThemedSelect.js.map +1 -1
- package/lib/cjs/core-react/select/Select.d.ts +3 -3
- package/lib/cjs/core-react/select/Select.js +1 -1
- package/lib/cjs/core-react/select/Select.js.map +1 -1
- package/lib/cjs/core-react/select/ThemedSelect.d.ts +4 -4
- package/lib/cjs/core-react/select/ThemedSelect.js +1 -1
- package/lib/cjs/core-react/select/ThemedSelect.js.map +1 -1
- package/lib/cjs/core-react/slider/Slider.d.ts +1 -1
- package/lib/cjs/core-react/slider/Slider.js +1 -1
- package/lib/cjs/core-react/slider/Slider.js.map +1 -1
- package/lib/cjs/core-react/splitbutton/SplitButton.d.ts +2 -2
- package/lib/cjs/core-react/splitbutton/SplitButton.js +1 -1
- package/lib/cjs/core-react/splitbutton/SplitButton.js.map +1 -1
- package/lib/cjs/core-react/tabs/HorizontalTabs.d.ts +1 -1
- package/lib/cjs/core-react/tabs/HorizontalTabs.js +1 -1
- package/lib/cjs/core-react/tabs/HorizontalTabs.js.map +1 -1
- package/lib/cjs/core-react/text/Headline.d.ts +1 -1
- package/lib/cjs/core-react/text/Headline.js +1 -1
- package/lib/cjs/core-react/text/Headline.js.map +1 -1
- package/lib/cjs/core-react/text/LeadingText.d.ts +1 -1
- package/lib/cjs/core-react/text/LeadingText.js +1 -1
- package/lib/cjs/core-react/text/LeadingText.js.map +1 -1
- package/lib/cjs/core-react/text/LeadingText2.d.ts +1 -1
- package/lib/cjs/core-react/text/LeadingText2.js +1 -1
- package/lib/cjs/core-react/text/LeadingText2.js.map +1 -1
- package/lib/cjs/core-react/text/SmallText.d.ts +1 -1
- package/lib/cjs/core-react/text/SmallText.js +1 -1
- package/lib/cjs/core-react/text/SmallText.js.map +1 -1
- package/lib/cjs/core-react/text/Subheading.d.ts +1 -1
- package/lib/cjs/core-react/text/Subheading.js +1 -1
- package/lib/cjs/core-react/text/Subheading.js.map +1 -1
- package/lib/cjs/core-react/text/Subheading2.d.ts +1 -1
- package/lib/cjs/core-react/text/Subheading2.js +1 -1
- package/lib/cjs/core-react/text/Subheading2.js.map +1 -1
- package/lib/cjs/core-react/text/Title.d.ts +1 -1
- package/lib/cjs/core-react/text/Title.js +1 -1
- package/lib/cjs/core-react/text/Title.js.map +1 -1
- package/lib/cjs/core-react/text/Title2.d.ts +1 -1
- package/lib/cjs/core-react/text/Title2.js +1 -1
- package/lib/cjs/core-react/text/Title2.js.map +1 -1
- package/lib/cjs/core-react/tiles/FeaturedTile.d.ts +1 -1
- package/lib/cjs/core-react/tiles/FeaturedTile.js +1 -1
- package/lib/cjs/core-react/tiles/FeaturedTile.js.map +1 -1
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.d.ts +1 -1
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.js +1 -1
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.js.map +1 -1
- package/lib/cjs/core-react/tiles/MinimalTile.d.ts +1 -1
- package/lib/cjs/core-react/tiles/MinimalTile.js +1 -1
- package/lib/cjs/core-react/tiles/MinimalTile.js.map +1 -1
- package/lib/cjs/core-react/tiles/Tile.d.ts +2 -2
- package/lib/cjs/core-react/tiles/Tile.js +1 -1
- package/lib/cjs/core-react/tiles/Tile.js.map +1 -1
- package/lib/cjs/core-react/toggle/LabeledToggle.d.ts +2 -2
- package/lib/cjs/core-react/toggle/LabeledToggle.js +1 -1
- package/lib/cjs/core-react/toggle/LabeledToggle.js.map +1 -1
- package/lib/cjs/core-react/toggle/Toggle.d.ts +4 -4
- package/lib/cjs/core-react/toggle/Toggle.d.ts.map +1 -1
- package/lib/cjs/core-react/toggle/Toggle.js +2 -2
- package/lib/cjs/core-react/toggle/Toggle.js.map +1 -1
- package/lib/cjs/core-react/tooltip/Tooltip.d.ts +3 -3
- package/lib/cjs/core-react/tooltip/Tooltip.js +1 -1
- package/lib/cjs/core-react/tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/core-react/utils/PointProps.d.ts +1 -1
- package/lib/cjs/core-react/utils/PointProps.js.map +1 -1
- package/lib/cjs/core-react/utils/UiEvent.d.ts +1 -1
- package/lib/cjs/core-react/utils/UiEvent.js +1 -1
- package/lib/cjs/core-react/utils/UiEvent.js.map +1 -1
- package/lib/esm/core-react/button/Button.d.ts +4 -4
- package/lib/esm/core-react/button/Button.js +3 -3
- package/lib/esm/core-react/button/Button.js.map +1 -1
- package/lib/esm/core-react/checkbox/Checkbox.d.ts +2 -2
- package/lib/esm/core-react/checkbox/Checkbox.js +1 -1
- package/lib/esm/core-react/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/core-react/dialog/DialogButtonDef.d.ts +3 -3
- package/lib/esm/core-react/dialog/DialogButtonDef.js +2 -2
- package/lib/esm/core-react/dialog/DialogButtonDef.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableBlock.d.ts +2 -2
- package/lib/esm/core-react/expandable/ExpandableBlock.js +1 -1
- package/lib/esm/core-react/expandable/ExpandableBlock.js.map +1 -1
- package/lib/esm/core-react/form/Field.d.ts +2 -2
- package/lib/esm/core-react/form/Field.js +1 -1
- package/lib/esm/core-react/form/Field.js.map +1 -1
- package/lib/esm/core-react/form/Form.d.ts +5 -5
- package/lib/esm/core-react/form/Form.js +1 -1
- package/lib/esm/core-react/form/Form.js.map +1 -1
- package/lib/esm/core-react/icons/SvgSprite.d.ts +2 -2
- package/lib/esm/core-react/icons/SvgSprite.js +1 -1
- package/lib/esm/core-react/icons/SvgSprite.js.map +1 -1
- package/lib/esm/core-react/inputs/Input.d.ts +2 -2
- package/lib/esm/core-react/inputs/Input.js +1 -1
- package/lib/esm/core-react/inputs/Input.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledInput.d.ts +2 -2
- package/lib/esm/core-react/inputs/LabeledInput.js +1 -1
- package/lib/esm/core-react/inputs/LabeledInput.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledTextarea.d.ts +2 -2
- package/lib/esm/core-react/inputs/LabeledTextarea.js +1 -1
- package/lib/esm/core-react/inputs/LabeledTextarea.js.map +1 -1
- package/lib/esm/core-react/inputs/Textarea.d.ts +2 -2
- package/lib/esm/core-react/inputs/Textarea.js +1 -1
- package/lib/esm/core-react/inputs/Textarea.js.map +1 -1
- package/lib/esm/core-react/loading/Spinner.d.ts +3 -3
- package/lib/esm/core-react/loading/Spinner.js +2 -2
- package/lib/esm/core-react/loading/Spinner.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageSeverity.d.ts +1 -1
- package/lib/esm/core-react/messagebox/MessageSeverity.js +1 -1
- package/lib/esm/core-react/messagebox/MessageSeverity.js.map +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressBar.d.ts +2 -2
- package/lib/esm/core-react/progress-indicators/ProgressBar.js +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressBar.js.map +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.d.ts +2 -2
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.js +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.js.map +1 -1
- package/lib/esm/core-react/radio/Radio.d.ts +2 -2
- package/lib/esm/core-react/radio/Radio.js +1 -1
- package/lib/esm/core-react/radio/Radio.js.map +1 -1
- package/lib/esm/core-react/select/LabeledSelect.d.ts +2 -2
- package/lib/esm/core-react/select/LabeledSelect.js +1 -1
- package/lib/esm/core-react/select/LabeledSelect.js.map +1 -1
- package/lib/esm/core-react/select/LabeledThemedSelect.d.ts +2 -2
- package/lib/esm/core-react/select/LabeledThemedSelect.js +1 -1
- package/lib/esm/core-react/select/LabeledThemedSelect.js.map +1 -1
- package/lib/esm/core-react/select/Select.d.ts +3 -3
- package/lib/esm/core-react/select/Select.js +1 -1
- package/lib/esm/core-react/select/Select.js.map +1 -1
- package/lib/esm/core-react/select/ThemedSelect.d.ts +4 -4
- package/lib/esm/core-react/select/ThemedSelect.js +1 -1
- package/lib/esm/core-react/select/ThemedSelect.js.map +1 -1
- package/lib/esm/core-react/slider/Slider.d.ts +1 -1
- package/lib/esm/core-react/slider/Slider.js +1 -1
- package/lib/esm/core-react/slider/Slider.js.map +1 -1
- package/lib/esm/core-react/splitbutton/SplitButton.d.ts +2 -2
- package/lib/esm/core-react/splitbutton/SplitButton.js +1 -1
- package/lib/esm/core-react/splitbutton/SplitButton.js.map +1 -1
- package/lib/esm/core-react/tabs/HorizontalTabs.d.ts +1 -1
- package/lib/esm/core-react/tabs/HorizontalTabs.js +1 -1
- package/lib/esm/core-react/tabs/HorizontalTabs.js.map +1 -1
- package/lib/esm/core-react/text/Headline.d.ts +1 -1
- package/lib/esm/core-react/text/Headline.js +1 -1
- package/lib/esm/core-react/text/Headline.js.map +1 -1
- package/lib/esm/core-react/text/LeadingText.d.ts +1 -1
- package/lib/esm/core-react/text/LeadingText.js +1 -1
- package/lib/esm/core-react/text/LeadingText.js.map +1 -1
- package/lib/esm/core-react/text/LeadingText2.d.ts +1 -1
- package/lib/esm/core-react/text/LeadingText2.js +1 -1
- package/lib/esm/core-react/text/LeadingText2.js.map +1 -1
- package/lib/esm/core-react/text/SmallText.d.ts +1 -1
- package/lib/esm/core-react/text/SmallText.js +1 -1
- package/lib/esm/core-react/text/SmallText.js.map +1 -1
- package/lib/esm/core-react/text/Subheading.d.ts +1 -1
- package/lib/esm/core-react/text/Subheading.js +1 -1
- package/lib/esm/core-react/text/Subheading.js.map +1 -1
- package/lib/esm/core-react/text/Subheading2.d.ts +1 -1
- package/lib/esm/core-react/text/Subheading2.js +1 -1
- package/lib/esm/core-react/text/Subheading2.js.map +1 -1
- package/lib/esm/core-react/text/Title.d.ts +1 -1
- package/lib/esm/core-react/text/Title.js +1 -1
- package/lib/esm/core-react/text/Title.js.map +1 -1
- package/lib/esm/core-react/text/Title2.d.ts +1 -1
- package/lib/esm/core-react/text/Title2.js +1 -1
- package/lib/esm/core-react/text/Title2.js.map +1 -1
- package/lib/esm/core-react/tiles/FeaturedTile.d.ts +1 -1
- package/lib/esm/core-react/tiles/FeaturedTile.js +1 -1
- package/lib/esm/core-react/tiles/FeaturedTile.js.map +1 -1
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.d.ts +1 -1
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.js +1 -1
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.js.map +1 -1
- package/lib/esm/core-react/tiles/MinimalTile.d.ts +1 -1
- package/lib/esm/core-react/tiles/MinimalTile.js +1 -1
- package/lib/esm/core-react/tiles/MinimalTile.js.map +1 -1
- package/lib/esm/core-react/tiles/Tile.d.ts +2 -2
- package/lib/esm/core-react/tiles/Tile.js +1 -1
- package/lib/esm/core-react/tiles/Tile.js.map +1 -1
- package/lib/esm/core-react/toggle/LabeledToggle.d.ts +2 -2
- package/lib/esm/core-react/toggle/LabeledToggle.js +1 -1
- package/lib/esm/core-react/toggle/LabeledToggle.js.map +1 -1
- package/lib/esm/core-react/toggle/Toggle.d.ts +4 -4
- package/lib/esm/core-react/toggle/Toggle.d.ts.map +1 -1
- package/lib/esm/core-react/toggle/Toggle.js +2 -2
- package/lib/esm/core-react/toggle/Toggle.js.map +1 -1
- package/lib/esm/core-react/tooltip/Tooltip.d.ts +3 -3
- package/lib/esm/core-react/tooltip/Tooltip.js +1 -1
- package/lib/esm/core-react/tooltip/Tooltip.js.map +1 -1
- package/lib/esm/core-react/utils/PointProps.d.ts +1 -1
- package/lib/esm/core-react/utils/PointProps.js.map +1 -1
- package/lib/esm/core-react/utils/UiEvent.d.ts +1 -1
- package/lib/esm/core-react/utils/UiEvent.js +1 -1
- package/lib/esm/core-react/utils/UiEvent.js.map +1 -1
- package/package.json +20 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
# Change Log - @itwin/core-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.5.5
|
|
6
|
+
Thu, 26 Jan 2023 22:53:27 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 3.5.4
|
|
11
|
+
Wed, 18 Jan 2023 15:27:15 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 3.5.3
|
|
16
|
+
Fri, 13 Jan 2023 17:23:07 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 3.5.2
|
|
21
|
+
Wed, 11 Jan 2023 16:46:30 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 3.5.1
|
|
26
|
+
Thu, 15 Dec 2022 16:38:29 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
4
29
|
|
|
5
30
|
## 3.5.0
|
|
6
31
|
Wed, 07 Dec 2022 19:12:37 GMT
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2017-
|
|
3
|
+
Copyright © 2017-2023 Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { CommonProps } from "../utils/Props";
|
|
6
6
|
/** Sizes for [[Button]] component
|
|
7
7
|
* @public
|
|
8
|
-
* @deprecated Use `size` prop for itwinui-react Button instead
|
|
8
|
+
* @deprecated in 3.0. Use `size` prop for itwinui-react Button instead
|
|
9
9
|
*/
|
|
10
10
|
export declare enum ButtonSize {
|
|
11
11
|
Default = "",
|
|
@@ -13,7 +13,7 @@ export declare enum ButtonSize {
|
|
|
13
13
|
}
|
|
14
14
|
/** Types for [[Button]] component
|
|
15
15
|
* @public
|
|
16
|
-
* @deprecated Use `styleType` prop for itwinui-react Button instead
|
|
16
|
+
* @deprecated in 3.0. Use `styleType` prop for itwinui-react Button instead
|
|
17
17
|
*/
|
|
18
18
|
export declare enum ButtonType {
|
|
19
19
|
Primary = "primary",
|
|
@@ -23,7 +23,7 @@ export declare enum ButtonType {
|
|
|
23
23
|
}
|
|
24
24
|
/** Properties for [[Button]] component
|
|
25
25
|
* @public
|
|
26
|
-
* @deprecated Use ButtonProps from itwinui-react instead
|
|
26
|
+
* @deprecated in 3.0. Use ButtonProps from itwinui-react instead
|
|
27
27
|
*/
|
|
28
28
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
29
29
|
/** Allow ID to be passed to Button */
|
|
@@ -37,7 +37,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
37
37
|
}
|
|
38
38
|
/** Generic button component
|
|
39
39
|
* @public
|
|
40
|
-
* @deprecated Use Button from itwinui-react instead
|
|
40
|
+
* @deprecated in 3.0. Use Button from itwinui-react instead
|
|
41
41
|
*/
|
|
42
42
|
export declare class Button extends React.PureComponent<ButtonProps> {
|
|
43
43
|
private getIuiButtonType;
|
|
@@ -12,7 +12,7 @@ const React = require("react");
|
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
/** Sizes for [[Button]] component
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated Use `size` prop for itwinui-react Button instead
|
|
15
|
+
* @deprecated in 3.0. Use `size` prop for itwinui-react Button instead
|
|
16
16
|
*/
|
|
17
17
|
var ButtonSize;
|
|
18
18
|
(function (ButtonSize) {
|
|
@@ -21,7 +21,7 @@ var ButtonSize;
|
|
|
21
21
|
})(ButtonSize = exports.ButtonSize || (exports.ButtonSize = {}));
|
|
22
22
|
/** Types for [[Button]] component
|
|
23
23
|
* @public
|
|
24
|
-
* @deprecated Use `styleType` prop for itwinui-react Button instead
|
|
24
|
+
* @deprecated in 3.0. Use `styleType` prop for itwinui-react Button instead
|
|
25
25
|
*/
|
|
26
26
|
var ButtonType;
|
|
27
27
|
(function (ButtonType) {
|
|
@@ -32,7 +32,7 @@ var ButtonType;
|
|
|
32
32
|
})(ButtonType = exports.ButtonType || (exports.ButtonType = {}));
|
|
33
33
|
/** Generic button component
|
|
34
34
|
* @public
|
|
35
|
-
* @deprecated Use Button from itwinui-react instead
|
|
35
|
+
* @deprecated in 3.0. Use Button from itwinui-react instead
|
|
36
36
|
*/
|
|
37
37
|
class Button extends React.PureComponent {
|
|
38
38
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/core-react/button/Button.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAoG;AAGpG;;;GAGG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,0BAAY,CAAA;IACZ,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED;;;GAGG;AACH,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAiBD;;;GAGG;AACH,MAAa,MAAO,SAAQ,KAAK,CAAC,aAA0B;IAA5D;;QACU,qBAAgB,GAAG,CAAC,UAAuB,EAAE,EAAE;YACrD,IAAI,aAA+C,CAAC;YACpD,QAAQ,UAAU,EAAE;gBAClB,KAAK,UAAU,CAAC,IAAI,EAAE,8CAA8C;oBAClE,aAAa,GAAG,iBAAiB,CAAC;oBAClC,MAAM;gBACR,KAAK,UAAU,CAAC,MAAM,EAAE,8CAA8C;oBACpE,aAAa,GAAG,SAAS,CAAC;oBAC1B,MAAM;gBACR,KAAK,UAAU,CAAC,OAAO,CAAC,CAAE,8CAA8C;gBACxE;oBACE,aAAa,GAAG,KAAK,CAAC;oBACtB,MAAM;aACT;YACD,OAAO,aAAa,CAAC;QACvB,CAAC,CAAC;IAUJ,CAAC;IARiB,MAAM;QACpB,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7E,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAExD,mDAAmD;QACnD,OAAO,oBAAC,sBAAc,OAAK,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,KAAK,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,GAAI,CAAC;IAC9K,CAAC;CACF;AA1BD,wBA0BC;AAED,gBAAgB;AAChB,SAAgB,sBAAsB,CAAC,UAAuB;IAC5D,IAAI,aAAqB,CAAC;IAC1B,QAAQ,UAAU,EAAE;QAClB,KAAK,UAAU,CAAC,IAAI,EAAE,8CAA8C;YAClE,aAAa,GAAG,qBAAqB,CAAC;YACtC,MAAM;QACR,KAAK,UAAU,CAAC,QAAQ,EAAE,8CAA8C;YACtE,aAAa,GAAG,yBAAyB,CAAC;YAC1C,MAAM;QACR,KAAK,UAAU,CAAC,MAAM,EAAE,8CAA8C;YACpE,aAAa,GAAG,uBAAuB,CAAC;YACxC,MAAM;QACR,KAAK,UAAU,CAAC,OAAO,CAAC,CAAE,8CAA8C;QACxE;YACE,aAAa,GAAG,wBAAwB,CAAC;YACzC,MAAM;KACT;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAlBD,wDAkBC","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 Button\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Button as ITwinUI_Button, ButtonProps as ITwinUI_ButtonProps } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Sizes for [[Button]] component\r\n * @public\r\n * @deprecated Use `size` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonSize {\r\n Default = \"\",\r\n Large = \"large\",\r\n}\r\n\r\n/** Types for [[Button]] component\r\n * @public\r\n * @deprecated Use `styleType` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonType {\r\n Primary = \"primary\",\r\n Blue = \"blue\",\r\n Disabled = \"disabled\",\r\n Hollow = \"hollow\",\r\n}\r\n\r\n/** Properties for [[Button]] component\r\n * @public\r\n * @deprecated Use ButtonProps from itwinui-react instead\r\n */\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Allow ID to be passed to Button */\r\n id?: string;\r\n /** Default and large sizes */\r\n size?: ButtonSize; // eslint-disable-line deprecation/deprecation\r\n /** 4 styles to tweak the content of the button */\r\n buttonType?: ButtonType; // eslint-disable-line deprecation/deprecation\r\n /** A function to be run when the element is clicked */\r\n onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void);\r\n}\r\n\r\n/** Generic button component\r\n * @public\r\n * @deprecated Use Button from itwinui-react instead\r\n */\r\nexport class Button extends React.PureComponent<ButtonProps> { // eslint-disable-line deprecation/deprecation\r\n private getIuiButtonType = (buttonType?: ButtonType) => { // eslint-disable-line deprecation/deprecation\r\n let iuiButtonType: ITwinUI_ButtonProps[\"styleType\"];\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"high-visibility\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"default\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n iuiButtonType = \"cta\";\r\n break;\r\n }\r\n return iuiButtonType;\r\n };\r\n\r\n public override render() {\r\n const { buttonType, size, className, style, onClick, ...props } = this.props;\r\n\r\n const iuiButtonType = this.getIuiButtonType(buttonType);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n return <ITwinUI_Button {...props} className={className} style={style} onClick={onClick} styleType={iuiButtonType} size={size === ButtonSize.Large ? undefined : \"small\"} />;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function getButtonTypeClassName(buttonType?: ButtonType): string { // eslint-disable-line deprecation/deprecation\r\n let typeClassName: string;\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-blue\";\r\n break;\r\n case ButtonType.Disabled: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-disabled\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-hollow\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n typeClassName = \"uicore-buttons-primary\";\r\n break;\r\n }\r\n return typeClassName;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/core-react/button/Button.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAoG;AAGpG;;;GAGG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,0BAAY,CAAA;IACZ,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED;;;GAGG;AACH,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAiBD;;;GAGG;AACH,MAAa,MAAO,SAAQ,KAAK,CAAC,aAA0B;IAA5D;;QACU,qBAAgB,GAAG,CAAC,UAAuB,EAAE,EAAE;YACrD,IAAI,aAA+C,CAAC;YACpD,QAAQ,UAAU,EAAE;gBAClB,KAAK,UAAU,CAAC,IAAI,EAAE,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,aAAa,GAAG,wBAAwB,CAAC;YACzC,MAAM;KACT;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAlBD,wDAkBC","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 Button\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Button as ITwinUI_Button, ButtonProps as ITwinUI_ButtonProps } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Sizes for [[Button]] component\r\n * @public\r\n * @deprecated in 3.0. Use `size` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonSize {\r\n Default = \"\",\r\n Large = \"large\",\r\n}\r\n\r\n/** Types for [[Button]] component\r\n * @public\r\n * @deprecated in 3.0. Use `styleType` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonType {\r\n Primary = \"primary\",\r\n Blue = \"blue\",\r\n Disabled = \"disabled\",\r\n Hollow = \"hollow\",\r\n}\r\n\r\n/** Properties for [[Button]] component\r\n * @public\r\n * @deprecated in 3.0. Use ButtonProps from itwinui-react instead\r\n */\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Allow ID to be passed to Button */\r\n id?: string;\r\n /** Default and large sizes */\r\n size?: ButtonSize; // eslint-disable-line deprecation/deprecation\r\n /** 4 styles to tweak the content of the button */\r\n buttonType?: ButtonType; // eslint-disable-line deprecation/deprecation\r\n /** A function to be run when the element is clicked */\r\n onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void);\r\n}\r\n\r\n/** Generic button component\r\n * @public\r\n * @deprecated in 3.0. Use Button from itwinui-react instead\r\n */\r\nexport class Button extends React.PureComponent<ButtonProps> { // eslint-disable-line deprecation/deprecation\r\n private getIuiButtonType = (buttonType?: ButtonType) => { // eslint-disable-line deprecation/deprecation\r\n let iuiButtonType: ITwinUI_ButtonProps[\"styleType\"];\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"high-visibility\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"default\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n iuiButtonType = \"cta\";\r\n break;\r\n }\r\n return iuiButtonType;\r\n };\r\n\r\n public override render() {\r\n const { buttonType, size, className, style, onClick, ...props } = this.props;\r\n\r\n const iuiButtonType = this.getIuiButtonType(buttonType);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n return <ITwinUI_Button {...props} className={className} style={style} onClick={onClick} styleType={iuiButtonType} size={size === ButtonSize.Large ? undefined : \"small\"} />;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function getButtonTypeClassName(buttonType?: ButtonType): string { // eslint-disable-line deprecation/deprecation\r\n let typeClassName: string;\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-blue\";\r\n break;\r\n case ButtonType.Disabled: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-disabled\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-hollow\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n typeClassName = \"uicore-buttons-primary\";\r\n break;\r\n }\r\n return typeClassName;\r\n}\r\n"]}
|
|
@@ -7,7 +7,7 @@ import { CommonProps } from "../utils/Props";
|
|
|
7
7
|
import { Omit } from "../utils/typeUtils";
|
|
8
8
|
/** Properties for [[Checkbox]] React component
|
|
9
9
|
* @public
|
|
10
|
-
* @deprecated Use CheckboxProps in itwinui-react instead
|
|
10
|
+
* @deprecated in 3.0. Use CheckboxProps in itwinui-react instead
|
|
11
11
|
*/
|
|
12
12
|
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "onClick" | "onBlur">, CommonProps {
|
|
13
13
|
/** Text that will be shown next to the checkbox. */
|
|
@@ -39,7 +39,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
39
39
|
/** A React component that renders a simple checkbox with label.
|
|
40
40
|
* It is a wrapper for the `<input type="checkbox">` HTML element.
|
|
41
41
|
* @public
|
|
42
|
-
* @deprecated Use Checkbox in itwinui-react instead
|
|
42
|
+
* @deprecated in 3.0. Use Checkbox in itwinui-react instead
|
|
43
43
|
*/
|
|
44
44
|
export declare class Checkbox extends React.PureComponent<CheckboxProps> {
|
|
45
45
|
private _checkboxInput;
|
|
@@ -14,7 +14,7 @@ const useRefs_1 = require("../utils/hooks/useRefs");
|
|
|
14
14
|
/** A React component that renders a simple checkbox with label.
|
|
15
15
|
* It is a wrapper for the `<input type="checkbox">` HTML element.
|
|
16
16
|
* @public
|
|
17
|
-
* @deprecated Use Checkbox in itwinui-react instead
|
|
17
|
+
* @deprecated in 3.0. Use Checkbox in itwinui-react instead
|
|
18
18
|
*/
|
|
19
19
|
class Checkbox extends React.PureComponent {
|
|
20
20
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/core-react/checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;AAI/B,oDAAmD;AAkCnD;;;;GAIG;AACH,MAAa,QAAS,SAAQ,KAAK,CAAC,aAA4B;IAI9D,gBAAgB;IAChB,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QALP,mBAAc,GAAG,KAAK,CAAC,SAAS,EAAoB,CAAC;QACrD,UAAK,GAAG,IAAA,mBAAS,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAUvC,qB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AC,CAAC,wDAAwD;QAC7H,MAAM,aAAa,GAAG,IAAA,oBAAU,EAAC,eAAe,EAC9C,QAAQ,IAAI,eAAe,EAC3B,CAAC,KAAK,IAAI,wBAAwB,EAClC,MAAM,EACN,SAAS,CAAC,CAAC;QAEb,OAAO;QACL,oEAAoE;QACpE,oEAAoE;QACpE,+BAAO,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;YAC9D,KAAK;gBACJ,8BAAM,SAAS,EAAC,qBAAqB,IAAE,KAAK,CAAQ;YAEtD,+BAAO,IAAI,EAAC,UAAU,EAAC,GAAG,EAAE,IAAI,CAAC,KAAK,KAAM,UAAU,EACpD,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAChE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,eAAe,GAAI;YAClE,8BAAM,SAAS,EAAC,yBAAyB,GAAQ,CAC1C,CACV,CAAC;IACJ,CAAC;CACF;AA/DD,4BA+DC","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 Checkbox\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { InputStatus } from \"../inputs/InputStatus\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Omit } from \"../utils/typeUtils\";\r\nimport { mergeRefs } from \"../utils/hooks/useRefs\";\r\n\r\n/** Properties for [[Checkbox]] React component\r\n * @public\r\n * @deprecated Use CheckboxProps in itwinui-react instead\r\n */\r\nexport interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"type\" | \"onClick\" | \"onBlur\">, CommonProps {\r\n /** Text that will be shown next to the checkbox. */\r\n label?: string;\r\n /** Indicates checkbox is in an Indeterminate or Partial state, regardless of the `checked` state */\r\n indeterminate?: boolean;\r\n /** Input status like: \"Success\", \"Warning\" or \"Error\" */\r\n status?: InputStatus;\r\n /** Custom CSS class name for the checkbox input element */\r\n inputClassName?: string;\r\n /** Custom CSS Style for the checkbox input element */\r\n inputStyle?: React.CSSProperties;\r\n /** Custom CSS class name for the label element */\r\n labelClassName?: string;\r\n /** Custom CSS Style for the label element */\r\n labelStyle?: React.CSSProperties;\r\n /**\r\n * Event called when checkbox is clicked on. This is a good event to\r\n * use for preventing the action from bubbling to component's parents.\r\n */\r\n onClick?: (e: React.MouseEvent) => void;\r\n /** Event called when checkbox loses focus. */\r\n onBlur?: (e: React.FocusEvent) => void;\r\n /** Indicates whether the checkbox should set focus */\r\n setFocus?: boolean;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n inputRef?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\n/** A React component that renders a simple checkbox with label.\r\n * It is a wrapper for the `<input type=\"checkbox\">` HTML element.\r\n * @public\r\n * @deprecated Use Checkbox in itwinui-react instead\r\n */\r\nexport class Checkbox extends React.PureComponent<CheckboxProps> { // eslint-disable-line deprecation/deprecation\r\n private _checkboxInput = React.createRef<HTMLInputElement>();\r\n private _refs = mergeRefs(this._checkboxInput);\r\n\r\n /** @internal */\r\n constructor(props: CheckboxProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n\r\n if (props.inputRef)\r\n this._refs = mergeRefs(this._checkboxInput, props.inputRef);\r\n }\r\n\r\n private _onCheckboxClick = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n };\r\n\r\n private _onCheckboxBlur = (e: React.FocusEvent) => {\r\n e.stopPropagation();\r\n };\r\n\r\n private _setIndeterminate(indeterminate: boolean) {\r\n // istanbul ignore else\r\n if (this._checkboxInput.current)\r\n this._checkboxInput.current.indeterminate = indeterminate;\r\n }\r\n\r\n public override componentDidMount() {\r\n if (this.props.indeterminate !== undefined)\r\n this._setIndeterminate(this.props.indeterminate);\r\n\r\n if (this.props.setFocus && this._checkboxInput.current)\r\n this._checkboxInput.current.focus();\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(_prevProps: CheckboxProps) { // eslint-disable-line deprecation/deprecation\r\n if (this.props.indeterminate !== undefined)\r\n this._setIndeterminate(this.props.indeterminate);\r\n }\r\n\r\n public override render() {\r\n const { status, disabled, label, indeterminate, className, inputClassName, inputStyle, labelClassName, labelStyle, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n onClick, onBlur, setFocus, inputRef, ...inputProps } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const checkBoxClass = classnames(\"core-checkbox\",\r\n disabled && \"core-disabled\",\r\n !label && \"core-checkbox-no-label\",\r\n status,\r\n className);\r\n\r\n return (\r\n /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\n /* eslint-disable-next-line jsx-a11y/click-events-have-key-events */\r\n <label className={checkBoxClass} onClick={onClick} onBlur={onBlur}>\r\n {label &&\r\n <span className=\"core-checkbox-label\">{label}</span>\r\n }\r\n <input type=\"checkbox\" ref={this._refs} {...inputProps}\r\n disabled={disabled} className={inputClassName} style={inputStyle}\r\n onClick={this._onCheckboxClick} onBlur={this._onCheckboxBlur} />\r\n <span className=\"core-checkbox-checkmark\"></span>\r\n </label >\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/core-react/checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;AAI/B,oDAAmD;AAkCnD;;;;GAIG;AACH,MAAa,QAAS,SAAQ,KAAK,CAAC,aAA4B;IAI9D,gBAAgB;IAChB,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QALP,mBAAc,GAAG,KAAK,CAAC,SAAS,EAAoB,CAAC;QACrD,UAAK,GAAG,IAAA,mBAAS,EAA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AG,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,wDAAwD;QAC7H,MAAM,aAAa,GAAG,IAAA,oBAAU,EAAC,eAAe,EAC9C,QAAQ,IAAI,eAAe,EAC3B,CAAC,KAAK,IAAI,wBAAwB,EAClC,MAAM,EACN,SAAS,CAAC,CAAC;QAEb,OAAO;QACL,oEAAoE;QACpE,oEAAoE;QACpE,+BAAO,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;YAC9D,KAAK;gBACJ,8BAAM,SAAS,EAAC,qBAAqB,IAAE,KAAK,CAAQ;YAEtD,+BAAO,IAAI,EAAC,UAAU,EAAC,GAAG,EAAE,IAAI,CAAC,KAAK,KAAM,UAAU,EACpD,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAChE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,eAAe,GAAI;YAClE,8BAAM,SAAS,EAAC,yBAAyB,GAAQ,CAC1C,CACV,CAAC;IACJ,CAAC;CACF;AA/DD,4BA+DC","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 Checkbox\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { InputStatus } from \"../inputs/InputStatus\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Omit } from \"../utils/typeUtils\";\r\nimport { mergeRefs } from \"../utils/hooks/useRefs\";\r\n\r\n/** Properties for [[Checkbox]] React component\r\n * @public\r\n * @deprecated in 3.0. Use CheckboxProps in itwinui-react instead\r\n */\r\nexport interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"type\" | \"onClick\" | \"onBlur\">, CommonProps {\r\n /** Text that will be shown next to the checkbox. */\r\n label?: string;\r\n /** Indicates checkbox is in an Indeterminate or Partial state, regardless of the `checked` state */\r\n indeterminate?: boolean;\r\n /** Input status like: \"Success\", \"Warning\" or \"Error\" */\r\n status?: InputStatus;\r\n /** Custom CSS class name for the checkbox input element */\r\n inputClassName?: string;\r\n /** Custom CSS Style for the checkbox input element */\r\n inputStyle?: React.CSSProperties;\r\n /** Custom CSS class name for the label element */\r\n labelClassName?: string;\r\n /** Custom CSS Style for the label element */\r\n labelStyle?: React.CSSProperties;\r\n /**\r\n * Event called when checkbox is clicked on. This is a good event to\r\n * use for preventing the action from bubbling to component's parents.\r\n */\r\n onClick?: (e: React.MouseEvent) => void;\r\n /** Event called when checkbox loses focus. */\r\n onBlur?: (e: React.FocusEvent) => void;\r\n /** Indicates whether the checkbox should set focus */\r\n setFocus?: boolean;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n inputRef?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\n/** A React component that renders a simple checkbox with label.\r\n * It is a wrapper for the `<input type=\"checkbox\">` HTML element.\r\n * @public\r\n * @deprecated in 3.0. Use Checkbox in itwinui-react instead\r\n */\r\nexport class Checkbox extends React.PureComponent<CheckboxProps> { // eslint-disable-line deprecation/deprecation\r\n private _checkboxInput = React.createRef<HTMLInputElement>();\r\n private _refs = mergeRefs(this._checkboxInput);\r\n\r\n /** @internal */\r\n constructor(props: CheckboxProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n\r\n if (props.inputRef)\r\n this._refs = mergeRefs(this._checkboxInput, props.inputRef);\r\n }\r\n\r\n private _onCheckboxClick = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n };\r\n\r\n private _onCheckboxBlur = (e: React.FocusEvent) => {\r\n e.stopPropagation();\r\n };\r\n\r\n private _setIndeterminate(indeterminate: boolean) {\r\n // istanbul ignore else\r\n if (this._checkboxInput.current)\r\n this._checkboxInput.current.indeterminate = indeterminate;\r\n }\r\n\r\n public override componentDidMount() {\r\n if (this.props.indeterminate !== undefined)\r\n this._setIndeterminate(this.props.indeterminate);\r\n\r\n if (this.props.setFocus && this._checkboxInput.current)\r\n this._checkboxInput.current.focus();\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(_prevProps: CheckboxProps) { // eslint-disable-line deprecation/deprecation\r\n if (this.props.indeterminate !== undefined)\r\n this._setIndeterminate(this.props.indeterminate);\r\n }\r\n\r\n public override render() {\r\n const { status, disabled, label, indeterminate, className, inputClassName, inputStyle, labelClassName, labelStyle, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n onClick, onBlur, setFocus, inputRef, ...inputProps } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const checkBoxClass = classnames(\"core-checkbox\",\r\n disabled && \"core-disabled\",\r\n !label && \"core-checkbox-no-label\",\r\n status,\r\n className);\r\n\r\n return (\r\n /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\n /* eslint-disable-next-line jsx-a11y/click-events-have-key-events */\r\n <label className={checkBoxClass} onClick={onClick} onBlur={onBlur}>\r\n {label &&\r\n <span className=\"core-checkbox-label\">{label}</span>\r\n }\r\n <input type=\"checkbox\" ref={this._refs} {...inputProps}\r\n disabled={disabled} className={inputClassName} style={inputStyle}\r\n onClick={this._onCheckboxClick} onBlur={this._onCheckboxBlur} />\r\n <span className=\"core-checkbox-checkmark\"></span>\r\n </label >\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/** Enum for button types. Determines button label, and default button style.
|
|
5
5
|
* @public
|
|
6
|
-
* @deprecated Use [DialogButtonType]($appui-abstract) instead
|
|
6
|
+
* @deprecated in 3.0. Use [DialogButtonType]($appui-abstract) instead
|
|
7
7
|
*/
|
|
8
8
|
export declare enum DialogButtonType {
|
|
9
9
|
None = "",
|
|
@@ -18,7 +18,7 @@ export declare enum DialogButtonType {
|
|
|
18
18
|
}
|
|
19
19
|
/** Enum for button style.
|
|
20
20
|
* @public
|
|
21
|
-
* @deprecated Use [DialogButtonStyle]($appui-abstract) instead
|
|
21
|
+
* @deprecated in 3.0. Use [DialogButtonStyle]($appui-abstract) instead
|
|
22
22
|
*/
|
|
23
23
|
export declare enum DialogButtonStyle {
|
|
24
24
|
None = "",
|
|
@@ -28,7 +28,7 @@ export declare enum DialogButtonStyle {
|
|
|
28
28
|
}
|
|
29
29
|
/** Interface for a dialog button in a button cluster
|
|
30
30
|
* @public
|
|
31
|
-
* @deprecated Use [DialogButtonDef]($appui-abstract) instead
|
|
31
|
+
* @deprecated in 3.0. Use [DialogButtonDef]($appui-abstract) instead
|
|
32
32
|
*/
|
|
33
33
|
export interface DialogButtonDef {
|
|
34
34
|
/** type of button */
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.DialogButtonStyle = exports.DialogButtonType = void 0;
|
|
11
11
|
/** Enum for button types. Determines button label, and default button style.
|
|
12
12
|
* @public
|
|
13
|
-
* @deprecated Use [DialogButtonType]($appui-abstract) instead
|
|
13
|
+
* @deprecated in 3.0. Use [DialogButtonType]($appui-abstract) instead
|
|
14
14
|
*/
|
|
15
15
|
var DialogButtonType;
|
|
16
16
|
(function (DialogButtonType) {
|
|
@@ -26,7 +26,7 @@ var DialogButtonType;
|
|
|
26
26
|
})(DialogButtonType = exports.DialogButtonType || (exports.DialogButtonType = {}));
|
|
27
27
|
/** Enum for button style.
|
|
28
28
|
* @public
|
|
29
|
-
* @deprecated Use [DialogButtonStyle]($appui-abstract) instead
|
|
29
|
+
* @deprecated in 3.0. Use [DialogButtonStyle]($appui-abstract) instead
|
|
30
30
|
*/
|
|
31
31
|
var DialogButtonStyle;
|
|
32
32
|
(function (DialogButtonStyle) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogButtonDef.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/DialogButtonDef.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;IAGI;AACJ,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED;;;IAGI;AACJ,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,iDAA4B,CAAA;AAC9B,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B","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 Dialog\r\n */\r\n\r\n/** Enum for button types. Determines button label, and default button style.\r\n * @public\r\n * @deprecated Use [DialogButtonType]($appui-abstract) instead\r\n */\r\nexport enum DialogButtonType {\r\n None = \"\",\r\n Close = \"close\",\r\n OK = \"ok\",\r\n Cancel = \"cancel\",\r\n Yes = \"yes\",\r\n No = \"no\",\r\n Retry = \"retry\",\r\n Next = \"next\",\r\n Previous = \"previous\"\r\n}\r\n\r\n/** Enum for button style.\r\n * @public\r\n * @deprecated Use [DialogButtonStyle]($appui-abstract) instead\r\n */\r\nexport enum DialogButtonStyle {\r\n None = \"\",\r\n Primary = \"iui-cta\",\r\n Hollow = \"iui-default\",\r\n Blue = \"iui-high-visibility\",\r\n}\r\n\r\n/** Interface for a dialog button in a button cluster\r\n * @public\r\n * @deprecated Use [DialogButtonDef]($appui-abstract) instead\r\n */\r\nexport interface DialogButtonDef {\r\n /** type of button */\r\n type: DialogButtonType; // eslint-disable-line deprecation/deprecation\r\n /** Triggered on button click */\r\n onClick: () => void;\r\n /** Which button style to decorate button width */\r\n buttonStyle?: DialogButtonStyle; // eslint-disable-line deprecation/deprecation\r\n /** Disable the button */\r\n disabled?: boolean;\r\n /** Custom label */\r\n label?: string;\r\n /** Custom CSS class */\r\n className?: string;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"DialogButtonDef.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/DialogButtonDef.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;IAGI;AACJ,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED;;;IAGI;AACJ,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,iDAA4B,CAAA;AAC9B,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B","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 Dialog\r\n */\r\n\r\n/** Enum for button types. Determines button label, and default button style.\r\n * @public\r\n * @deprecated in 3.0. Use [DialogButtonType]($appui-abstract) instead\r\n */\r\nexport enum DialogButtonType {\r\n None = \"\",\r\n Close = \"close\",\r\n OK = \"ok\",\r\n Cancel = \"cancel\",\r\n Yes = \"yes\",\r\n No = \"no\",\r\n Retry = \"retry\",\r\n Next = \"next\",\r\n Previous = \"previous\"\r\n}\r\n\r\n/** Enum for button style.\r\n * @public\r\n * @deprecated in 3.0. Use [DialogButtonStyle]($appui-abstract) instead\r\n */\r\nexport enum DialogButtonStyle {\r\n None = \"\",\r\n Primary = \"iui-cta\",\r\n Hollow = \"iui-default\",\r\n Blue = \"iui-high-visibility\",\r\n}\r\n\r\n/** Interface for a dialog button in a button cluster\r\n * @public\r\n * @deprecated in 3.0. Use [DialogButtonDef]($appui-abstract) instead\r\n */\r\nexport interface DialogButtonDef {\r\n /** type of button */\r\n type: DialogButtonType; // eslint-disable-line deprecation/deprecation\r\n /** Triggered on button click */\r\n onClick: () => void;\r\n /** Which button style to decorate button width */\r\n buttonStyle?: DialogButtonStyle; // eslint-disable-line deprecation/deprecation\r\n /** Disable the button */\r\n disabled?: boolean;\r\n /** Custom label */\r\n label?: string;\r\n /** Custom CSS class */\r\n className?: string;\r\n}\r\n"]}
|
|
@@ -6,7 +6,7 @@ import * as React from "react";
|
|
|
6
6
|
import { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Properties for the [[ExpandableBlock]] React component
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated Use ExpandableBlockProps from itwinui-react instead
|
|
9
|
+
* @deprecated in 3.0. Use ExpandableBlockProps from itwinui-react instead
|
|
10
10
|
*/
|
|
11
11
|
export interface ExpandableBlockProps extends CommonProps {
|
|
12
12
|
/** Label */
|
|
@@ -26,7 +26,7 @@ export interface ExpandableBlockProps extends CommonProps {
|
|
|
26
26
|
}
|
|
27
27
|
/** ExpandableBlock React component is a container that shows and hides child content.
|
|
28
28
|
* @public
|
|
29
|
-
* @deprecated Use ExpandableBlock from itwinui-react instead
|
|
29
|
+
* @deprecated in 3.0. Use ExpandableBlock from itwinui-react instead
|
|
30
30
|
*/
|
|
31
31
|
export declare class ExpandableBlock extends React.PureComponent<ExpandableBlockProps> {
|
|
32
32
|
render(): JSX.Element;
|
|
@@ -13,7 +13,7 @@ const classnames_1 = require("classnames");
|
|
|
13
13
|
const React = require("react");
|
|
14
14
|
/** ExpandableBlock React component is a container that shows and hides child content.
|
|
15
15
|
* @public
|
|
16
|
-
* @deprecated Use ExpandableBlock from itwinui-react instead
|
|
16
|
+
* @deprecated in 3.0. Use ExpandableBlock from itwinui-react instead
|
|
17
17
|
*/
|
|
18
18
|
class ExpandableBlock extends React.PureComponent {
|
|
19
19
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableBlock.js","sourceRoot":"","sources":["../../../../src/core-react/expandable/ExpandableBlock.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,kCAAgC;AAChC,2CAAoC;AACpC,+BAA+B;AAwB/B;;;GAGG;AACH,MAAa,eAAgB,SAAQ,KAAK,CAAC,aAAmC;IAE5D,MAAM;;QACpB,MAAM,KAAK,GAAG,IAAA,oBAAU,EACtB,gCAAgC,EAChC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,cAAc,EACpC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,EACtD,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,CAAC;QACF,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAC9D,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjF,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,mCAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAEzG,OAAO,CACL,6BAAK,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YAC5C,6BAAK,IAAI,EAAC,QAAQ,mBAAgB,YAAY,EAAE,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC5F,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ;gBACtF,6BAAK,SAAS,EAAC,gBAAgB;oBAC7B,2BAAG,SAAS,EAAC,yBAAyB,GAAG,CACrC;gBACL,IAAI,CAAC,KAAK,CAAC,OAAO;oBACjB,6BAAK,SAAS,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,IAC/C,IAAI,CAAC,KAAK,CAAC,OAAO,CACf;gBAER,6BAAK,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,IAChC,IAAI,CAAC,KAAK,CAAC,KAAK,CACb,CACF;YACN,6BAAK,SAAS,EAAC,SAAS,IACrB,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CACzC,CACF,CACP,CAAC;IACJ,CAAC;CACF;AApCD,0CAoCC","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 Expandable\r\n */\r\n\r\nimport \"./ExpandableBlock.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for the [[ExpandableBlock]] React component\r\n * @public\r\n * @deprecated Use ExpandableBlockProps from itwinui-react instead\r\n */\r\nexport interface ExpandableBlockProps extends CommonProps {\r\n /** Label */\r\n title: string | JSX.Element;\r\n /** Indicates whether the ExpandableBlock is expanded */\r\n isExpanded: boolean;\r\n /** Callback function for click event */\r\n onClick: React.MouseEventHandler<HTMLDivElement>;\r\n /** Callback function for key press event */\r\n onKeyPress?: React.KeyboardEventHandler<HTMLDivElement>;\r\n /** Callback function for key down event */\r\n onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\r\n /** Additional text displayed in the block below the label and in a smaller font size */\r\n caption?: string;\r\n /** Custom tooltip for the component. */\r\n tooltip?: string;\r\n}\r\n\r\n/** ExpandableBlock React component is a container that shows and hides child content.\r\n * @public\r\n * @deprecated Use ExpandableBlock from itwinui-react instead\r\n */\r\nexport class ExpandableBlock extends React.PureComponent<ExpandableBlockProps> { // eslint-disable-line deprecation/deprecation\r\n\r\n public override render() {\r\n const cName = classnames(\r\n \"uicore-expandable-blocks-block\",\r\n this.props.caption && \"with-caption\",\r\n this.props.isExpanded ? \"is-expanded\" : \"is-collapsed\",\r\n this.props.className,\r\n );\r\n const ariaExpanded = this.props.isExpanded ? \"true\" : \"false\";\r\n const tabIndex = (this.props.onKeyPress || this.props.onKeyDown) ? 0 : undefined;\r\n\r\n const title = this.props.tooltip ?? (typeof this.props.title == \"string\" ? this.props.title : undefined);\r\n\r\n return (\r\n <div className={cName} style={this.props.style}>\r\n <div role=\"button\" aria-expanded={ariaExpanded} className=\"header\" onClick={this.props.onClick}\r\n onKeyPress={this.props.onKeyPress} onKeyDown={this.props.onKeyDown} tabIndex={tabIndex}>\r\n <div className=\"icon-container\">\r\n <i className=\"icon icon-chevron-right\" />\r\n </div>\r\n {this.props.caption &&\r\n <div className=\"caption\" title={this.props.caption}>\r\n {this.props.caption}\r\n </div>\r\n }\r\n <div className=\"title\" title={title}>\r\n {this.props.title}\r\n </div>\r\n </div>\r\n <div className=\"content\">\r\n {this.props.isExpanded && this.props.children}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ExpandableBlock.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S,EAAE,QAAQ,EAAE,QAAQ;gBACtF,6BAAK,SAAS,EAAC,gBAAgB;oBAC7B,2BAAG,SAAS,EAAC,yBAAyB,GAAG,CACrC;gBACL,IAAI,CAAC,KAAK,CAAC,OAAO;oBACjB,6BAAK,SAAS,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,IAC/C,IAAI,CAAC,KAAK,CAAC,OAAO,CACf;gBAER,6BAAK,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,IAChC,IAAI,CAAC,KAAK,CAAC,KAAK,CACb,CACF;YACN,6BAAK,SAAS,EAAC,SAAS,IACrB,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CACzC,CACF,CACP,CAAC;IACJ,CAAC;CACF;AApCD,0CAoCC","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 Expandable\r\n */\r\n\r\nimport \"./ExpandableBlock.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for the [[ExpandableBlock]] React component\r\n * @public\r\n * @deprecated in 3.0. Use ExpandableBlockProps from itwinui-react instead\r\n */\r\nexport interface ExpandableBlockProps extends CommonProps {\r\n /** Label */\r\n title: string | JSX.Element;\r\n /** Indicates whether the ExpandableBlock is expanded */\r\n isExpanded: boolean;\r\n /** Callback function for click event */\r\n onClick: React.MouseEventHandler<HTMLDivElement>;\r\n /** Callback function for key press event */\r\n onKeyPress?: React.KeyboardEventHandler<HTMLDivElement>;\r\n /** Callback function for key down event */\r\n onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\r\n /** Additional text displayed in the block below the label and in a smaller font size */\r\n caption?: string;\r\n /** Custom tooltip for the component. */\r\n tooltip?: string;\r\n}\r\n\r\n/** ExpandableBlock React component is a container that shows and hides child content.\r\n * @public\r\n * @deprecated in 3.0. Use ExpandableBlock from itwinui-react instead\r\n */\r\nexport class ExpandableBlock extends React.PureComponent<ExpandableBlockProps> { // eslint-disable-line deprecation/deprecation\r\n\r\n public override render() {\r\n const cName = classnames(\r\n \"uicore-expandable-blocks-block\",\r\n this.props.caption && \"with-caption\",\r\n this.props.isExpanded ? \"is-expanded\" : \"is-collapsed\",\r\n this.props.className,\r\n );\r\n const ariaExpanded = this.props.isExpanded ? \"true\" : \"false\";\r\n const tabIndex = (this.props.onKeyPress || this.props.onKeyDown) ? 0 : undefined;\r\n\r\n const title = this.props.tooltip ?? (typeof this.props.title == \"string\" ? this.props.title : undefined);\r\n\r\n return (\r\n <div className={cName} style={this.props.style}>\r\n <div role=\"button\" aria-expanded={ariaExpanded} className=\"header\" onClick={this.props.onClick}\r\n onKeyPress={this.props.onKeyPress} onKeyDown={this.props.onKeyDown} tabIndex={tabIndex}>\r\n <div className=\"icon-container\">\r\n <i className=\"icon icon-chevron-right\" />\r\n </div>\r\n {this.props.caption &&\r\n <div className=\"caption\" title={this.props.caption}>\r\n {this.props.caption}\r\n </div>\r\n }\r\n <div className=\"title\" title={title}>\r\n {this.props.title}\r\n </div>\r\n </div>\r\n <div className=\"content\">\r\n {this.props.isExpanded && this.props.children}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { FieldDef } from "./Form";
|
|
6
6
|
/** Properties used to create a [[Field]] in a [[Form]]
|
|
7
|
-
* @public @deprecated
|
|
7
|
+
* @public @deprecated in 3.0.
|
|
8
8
|
*/
|
|
9
9
|
export interface FieldProps extends FieldDef {
|
|
10
10
|
id: string;
|
|
11
11
|
}
|
|
12
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
|
|
13
|
+
* @public @deprecated in 3.0.
|
|
14
14
|
*/
|
|
15
15
|
export declare class Field extends React.Component<FieldProps> {
|
|
16
16
|
constructor(props: FieldProps);
|
|
@@ -13,7 +13,7 @@ const React = require("react");
|
|
|
13
13
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
14
14
|
const Form_1 = require("./Form");
|
|
15
15
|
/** 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.
|
|
16
|
-
* @public @deprecated
|
|
16
|
+
* @public @deprecated in 3.0.
|
|
17
17
|
*/
|
|
18
18
|
class Field extends React.Component {
|
|
19
19
|
constructor(props) {
|
|
@@ -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,+BAA+B;AAC/B,wDAAuF;AACvF,iCAAiE;AAcjE;;GAEG;AACH,MAAa,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,EAAE,MAAM,EAAE,CACjC,CAAC,CAAC;aACJ;iBAAM,IAAI,WAAW,KAAK,SAAS,EAAE;gBACpC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACpD,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CACxC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["/*---------------------------------------------------------------------------------------------\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
|
|
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,+BAA+B;AAC/B,wDAAuF;AACvF,iCAAiE;AAcjE;;GAEG;AACH,MAAa,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,EAAE,MAAM,EAAE,CACjC,CAAC,CAAC;aACJ;iBAAM,IAAI,WAAW,KAAK,SAAS,EAAE;gBACpC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACpD,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CACxC,CAAC,CAAC;aACJ;YAED,OAAO,aAAa,CAAC;QACvB,CAAC,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OAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,GACxF,CACH;YACA,IAAI,CAAC,KAAK,CAAC,MAAO,CAAC,WAAW,EAAE,KAAK,kBAAkB,IAAI,CAC1D,oBAAC,wBAAQ,IACP,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,KAAK,EAAE,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EACrC,QAAQ,EAAE,CAAC,KAA6C,EAAE,EAAE,CAAC,OAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAC/H,SAAS,EAAC,oBAAoB,GAC9B,CACH;YACA,IAAI,CAAC,KAAK,CAAC,MAAO,CAAC,WAAW,EAAE,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CACxE,oBAAC,sBAAM,IACL,EAAE,EAAE,IAAI,CAAC,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;AAvED,sBAuEC","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 in 3.0.\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 in 3.0.\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"]}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import "./Form.scss";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
/** The available editors for the fields in a [[Form]].
|
|
7
|
-
* @public @deprecated
|
|
7
|
+
* @public @deprecated in 3.0.
|
|
8
8
|
*/
|
|
9
9
|
export declare type FieldEditor = "textbox" | "multilinetextbox" | "dropdown" | "checkbox";
|
|
10
10
|
/** Interface used to define each [[Field]] in a [[Form]]
|
|
11
|
-
* @public @deprecated
|
|
11
|
+
* @public @deprecated in 3.0.
|
|
12
12
|
*/
|
|
13
13
|
export interface FieldDef {
|
|
14
14
|
label?: string;
|
|
@@ -19,13 +19,13 @@ export interface FieldDef {
|
|
|
19
19
|
value?: any;
|
|
20
20
|
}
|
|
21
21
|
/** Key/value pairs for all the field values with key being the field HTML Id.
|
|
22
|
-
* @public @deprecated
|
|
22
|
+
* @public @deprecated in 3.0.
|
|
23
23
|
*/
|
|
24
24
|
export interface FieldValues {
|
|
25
25
|
[key: string]: any;
|
|
26
26
|
}
|
|
27
27
|
/** The state data used by [[Form]] to hold state of each [[Field]] and the result of submit button processing.
|
|
28
|
-
* @public @deprecated
|
|
28
|
+
* @public @deprecated in 3.0.
|
|
29
29
|
*/
|
|
30
30
|
interface FormState {
|
|
31
31
|
values: FieldValues;
|
|
@@ -40,7 +40,7 @@ export interface FormContextState extends FormState {
|
|
|
40
40
|
setValues: (values: FieldValues) => void;
|
|
41
41
|
}
|
|
42
42
|
/** React context used by Form as a Provider and by the Fields as Consumers and updaters.
|
|
43
|
-
* @public @deprecated
|
|
43
|
+
* @public @deprecated in 3.0.
|
|
44
44
|
*/
|
|
45
45
|
export declare const FormContext: React.Context<FormContextState | undefined>;
|
|
46
46
|
/** Key/value pairs for all the field definitions to be displayed in a [[Form]].
|
|
@@ -15,7 +15,7 @@ const UiCore_1 = require("../UiCore");
|
|
|
15
15
|
const Field_1 = require("./Field");
|
|
16
16
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
17
17
|
/** React context used by Form as a Provider and by the Fields as Consumers and updaters.
|
|
18
|
-
* @public @deprecated
|
|
18
|
+
* @public @deprecated in 3.0.
|
|
19
19
|
*/
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
21
|
exports.FormContext = React.createContext(undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../../src/core-react/form/Form.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,uBAAqB;AACrB,+BAA+B;AAC/B,sCAAmC;AACnC,mCAAgC;AAChC,wDAA8C;AAuD9C;;GAEG;AACH,gEAAgE;AACnD,QAAA,WAAW,GAAG,KAAK,CAAC,aAAa,CAA+B,SAAS,CAAC,CAAC;AACxF,mBAAW,CAAC,WAAW,GAAG,wBAAwB,CAAC;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4BAC/B,6BAAK,SAAS,EAAC,mBAAmB;gCAChC,oBAAC,sBAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,IAC9C,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CACzD,CACL;4BACL,aAAa,KAAK,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CACtD,6BAAK,SAAS,EAAC,iBAAiB,EAAC,IAAI,EAAC,OAAO,IAAE,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAO,CAC9G,CACG,CACF,CACD,CACH,CACe,CACxB,CAAC;IACJ,CAAC;CACF;AA3ED,oBA2EC","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 \"./Form.scss\";\r\nimport * as React from \"react\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { Field } from \"./Field\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** The available editors for the fields in a [[Form]].\r\n * @public @deprecated\r\n */\r\nexport type FieldEditor = \"textbox\" | \"multilinetextbox\" | \"dropdown\" | \"checkbox\";\r\n\r\n/** Interface used to define each [[Field]] in a [[Form]]\r\n * @public @deprecated\r\n */\r\nexport interface FieldDef {\r\n /* The label text for the field */\r\n label?: string;\r\n\r\n /* The editor for the field */\r\n editor?: FieldEditor;\r\n\r\n /* The drop down items for the field */\r\n options?: string[] | { [key: string]: string };\r\n\r\n /* The initial field value */\r\n value?: any;\r\n}\r\n\r\n/** Key/value pairs for all the field values with key being the field HTML Id.\r\n * @public @deprecated\r\n */\r\nexport interface FieldValues {\r\n [key: string]: any;\r\n}\r\n\r\n/** The state data used by [[Form]] to hold state of each [[Field]] and the result of submit button processing.\r\n * @public @deprecated\r\n */\r\ninterface FormState {\r\n /* The field values */\r\n values: FieldValues;\r\n\r\n /* The errorMsg message return in catch of async submit button processing */\r\n errorMsg: string;\r\n\r\n /* Whether the form has been successfully submitted */\r\n submitSuccess?: boolean;\r\n}\r\n\r\n/**\r\n * FormContextState combines the Form's state data with the callbacks used to update the value of the state data.\r\n * @public @deprecate\r\n */\r\nexport interface FormContextState extends FormState {\r\n setValues: (values: FieldValues) => void;\r\n}\r\n\r\n/** React context used by Form as a Provider and by the Fields as Consumers and updaters.\r\n * @public @deprecated\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const FormContext = React.createContext<FormContextState | undefined>(undefined);\r\nFormContext.displayName = \"core-react:FormContext\";\r\n\r\n/** Key/value pairs for all the field definitions to be displayed in a [[Form]].\r\n * @public\r\n */\r\nexport interface FieldDefinitions {\r\n [key: string]: FieldDef;\r\n}\r\n\r\n/** Properties that define [[Form]] including the callback to be called when the Submit button is pressed.\r\n * @public\r\n */\r\nexport interface FormProps {\r\n /** Required async callback the processes the Form data and throws and Error if the data cannot be processed. */\r\n handleFormSubmit: (values: FieldValues) => Promise<void>;\r\n /** Definition used to create each Field in the Form. */\r\n fields: FieldDefinitions;\r\n /** Optional label which will override default Submit button label. */\r\n submitButtonLabel?: string;\r\n}\r\n\r\n/** Component used to create a Form using supplied properties to specify the fields of the Form.\r\n * @example\r\n * // Example of using a form as contents of a modal dialog.\r\n * export class ExampleForm extends React.Component {\r\n * public static open() {\r\n * const form = new ExampleForm({});\r\n * ModalDialogManager.openDialog(form.render());\r\n * }\r\n *\r\n * protected async handleSubmit(values: FieldValues): Promise<void> {\r\n * await this.processFormSubmission(values);\r\n * ModalDialogManager.closeDialog();\r\n * const msg = JSON.stringify(values);\r\n * IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Form Submitted\", msg));\r\n * }\r\n *\r\n * protected async processFormSubmission(values: FieldValues): Promise<void> {\r\n * // if error occurs during async processing throw an Error and return error message back to form.\r\n * throw new Error(\"Error processing form\");\r\n * }\r\n *\r\n * protected handleCancel() {\r\n * ModalDialogManager.closeDialog();\r\n * }\r\n *\r\n * public render() {\r\n * const fields: FieldDefinitions = {\r\n * Name: {\r\n * label: this._nameLabel,\r\n * editor: \"textbox\",\r\n * value: \"John Smith\",\r\n * },\r\n * PickList: {\r\n * label: this._pickListLabel,\r\n * editor: \"dropdown\",\r\n * value: \"one\",\r\n * options: [\"one\", \"two\", \"three\", \"four\"],\r\n * },\r\n * };\r\n *\r\n * return (\r\n * <div>\r\n * <Dialog title=\"Example Form\"\r\n * opened={true}\r\n * onClose={() => this.handleCancel()}>\r\n * <Form handleFormSubmit={(values: FieldValues) => this.handleSubmit(values)}\r\n * fields={fields}\r\n * />\r\n * </Dialog>\r\n * </div >\r\n * );\r\n * }\r\n * @public @deprecate\r\n */\r\nexport class Form extends React.Component<FormProps, FormState> {\r\n private _submitButtonLabel = UiCore.translate(\"form.submitButtonLabel\");\r\n private _errorPrefix = UiCore.translate(\"form.errorPrefix\");\r\n private _errorSuffix = UiCore.translate(\"form.errorSuffix\");\r\n\r\n constructor(props: FormProps) {\r\n super(props);\r\n\r\n // set initial values for field values\r\n const values: FieldValues = {};\r\n Object.keys(props.fields).forEach((key) => values[key] = props.fields[key].value);\r\n\r\n this.state = {\r\n errorMsg: \"\",\r\n values,\r\n };\r\n }\r\n\r\n /**\r\n * Returns whether there is an errorMsg message in the state/context\r\n * @param errorMsg - The form errorMsg\r\n */\r\n private haveError(errorMsg: string) {\r\n return errorMsg && errorMsg.length;\r\n }\r\n\r\n private _setValues = (values: FieldValues) => {\r\n this.setState((prevState) => ({ values: { ...prevState.values, ...values } }));\r\n };\r\n\r\n private _handleSubmit = (event: React.FormEvent<HTMLFormElement>, values: FieldValues) => {\r\n event.preventDefault();\r\n\r\n // istanbul ignore next\r\n if (!this.props.handleFormSubmit || !values || 0 === values.length)\r\n throw new Error(\"A handleFormSubmit function and values must be defined\");\r\n\r\n this.props.handleFormSubmit(values)\r\n .then(() => {\r\n // Currently we don't need to do anything if successful. Typically the hosting dialog will close when the\r\n // submission is successful.\r\n // console.log(rtnMsg);\r\n })\r\n .catch((reason: Error) => {\r\n this.setState({ submitSuccess: false, errorMsg: reason.message });\r\n });\r\n };\r\n\r\n public override render() {\r\n const { submitSuccess, errorMsg } = this.state;\r\n const { fields, submitButtonLabel } = this.props;\r\n const context: FormContextState = { ...this.state, setValues: this._setValues };\r\n\r\n return (\r\n <FormContext.Provider value={context}>\r\n <div className=\"core-form-wrapper\">\r\n <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => this._handleSubmit(event, this.state.values)} noValidate={true}>\r\n <div className=\"core-form-container\">\r\n {Object.keys(fields).map((key) => <Field key={key} id={key} {...this.props.fields[key]} />)}\r\n <div className=\"core-form-footer\">\r\n <div className=\"core-form-buttons\">\r\n <Button type=\"submit\" styleType=\"high-visibility\">\r\n {submitButtonLabel ? submitButtonLabel : this._submitButtonLabel}\r\n </Button>\r\n </div>\r\n {submitSuccess === false && this.haveError(errorMsg) && (\r\n <div className=\"core-form-alert\" role=\"alert\">{`${this._errorPrefix}-${errorMsg} ${this._errorSuffix}`}</div>\r\n )}\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </FormContext.Provider>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../../src/core-react/form/Form.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,uBAAqB;AACrB,+BAA+B;AAC/B,sCAAmC;AACnC,mCAAgC;AAChC,wDAA8C;AAuD9C;;GAEG;AACH,gEAAgE;AACnD,QAAA,WAAW,GAAG,KAAK,CAAC,aAAa,CAA+B,SAAS,CAAC,CAAC;AACxF,mBAAW,CAAC,W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AAK,SAAS,EAAC,kBAAkB;4BAC/B,6BAAK,SAAS,EAAC,mBAAmB;gCAChC,oBAAC,sBAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,IAC9C,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CACzD,CACL;4BACL,aAAa,KAAK,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CACtD,6BAAK,SAAS,EAAC,iBAAiB,EAAC,IAAI,EAAC,OAAO,IAAE,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAO,CAC9G,CACG,CACF,CACD,CACH,CACe,CACxB,CAAC;IACJ,CAAC;CACF;AA3ED,oBA2EC","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 \"./Form.scss\";\r\nimport * as React from \"react\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { Field } from \"./Field\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** The available editors for the fields in a [[Form]].\r\n * @public @deprecated in 3.0.\r\n */\r\nexport type FieldEditor = \"textbox\" | \"multilinetextbox\" | \"dropdown\" | \"checkbox\";\r\n\r\n/** Interface used to define each [[Field]] in a [[Form]]\r\n * @public @deprecated in 3.0.\r\n */\r\nexport interface FieldDef {\r\n /* The label text for the field */\r\n label?: string;\r\n\r\n /* The editor for the field */\r\n editor?: FieldEditor;\r\n\r\n /* The drop down items for the field */\r\n options?: string[] | { [key: string]: string };\r\n\r\n /* The initial field value */\r\n value?: any;\r\n}\r\n\r\n/** Key/value pairs for all the field values with key being the field HTML Id.\r\n * @public @deprecated in 3.0.\r\n */\r\nexport interface FieldValues {\r\n [key: string]: any;\r\n}\r\n\r\n/** The state data used by [[Form]] to hold state of each [[Field]] and the result of submit button processing.\r\n * @public @deprecated in 3.0.\r\n */\r\ninterface FormState {\r\n /* The field values */\r\n values: FieldValues;\r\n\r\n /* The errorMsg message return in catch of async submit button processing */\r\n errorMsg: string;\r\n\r\n /* Whether the form has been successfully submitted */\r\n submitSuccess?: boolean;\r\n}\r\n\r\n/**\r\n * FormContextState combines the Form's state data with the callbacks used to update the value of the state data.\r\n * @public @deprecate\r\n */\r\nexport interface FormContextState extends FormState {\r\n setValues: (values: FieldValues) => void;\r\n}\r\n\r\n/** React context used by Form as a Provider and by the Fields as Consumers and updaters.\r\n * @public @deprecated in 3.0.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const FormContext = React.createContext<FormContextState | undefined>(undefined);\r\nFormContext.displayName = \"core-react:FormContext\";\r\n\r\n/** Key/value pairs for all the field definitions to be displayed in a [[Form]].\r\n * @public\r\n */\r\nexport interface FieldDefinitions {\r\n [key: string]: FieldDef;\r\n}\r\n\r\n/** Properties that define [[Form]] including the callback to be called when the Submit button is pressed.\r\n * @public\r\n */\r\nexport interface FormProps {\r\n /** Required async callback the processes the Form data and throws and Error if the data cannot be processed. */\r\n handleFormSubmit: (values: FieldValues) => Promise<void>;\r\n /** Definition used to create each Field in the Form. */\r\n fields: FieldDefinitions;\r\n /** Optional label which will override default Submit button label. */\r\n submitButtonLabel?: string;\r\n}\r\n\r\n/** Component used to create a Form using supplied properties to specify the fields of the Form.\r\n * @example\r\n * // Example of using a form as contents of a modal dialog.\r\n * export class ExampleForm extends React.Component {\r\n * public static open() {\r\n * const form = new ExampleForm({});\r\n * ModalDialogManager.openDialog(form.render());\r\n * }\r\n *\r\n * protected async handleSubmit(values: FieldValues): Promise<void> {\r\n * await this.processFormSubmission(values);\r\n * ModalDialogManager.closeDialog();\r\n * const msg = JSON.stringify(values);\r\n * IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Form Submitted\", msg));\r\n * }\r\n *\r\n * protected async processFormSubmission(values: FieldValues): Promise<void> {\r\n * // if error occurs during async processing throw an Error and return error message back to form.\r\n * throw new Error(\"Error processing form\");\r\n * }\r\n *\r\n * protected handleCancel() {\r\n * ModalDialogManager.closeDialog();\r\n * }\r\n *\r\n * public render() {\r\n * const fields: FieldDefinitions = {\r\n * Name: {\r\n * label: this._nameLabel,\r\n * editor: \"textbox\",\r\n * value: \"John Smith\",\r\n * },\r\n * PickList: {\r\n * label: this._pickListLabel,\r\n * editor: \"dropdown\",\r\n * value: \"one\",\r\n * options: [\"one\", \"two\", \"three\", \"four\"],\r\n * },\r\n * };\r\n *\r\n * return (\r\n * <div>\r\n * <Dialog title=\"Example Form\"\r\n * opened={true}\r\n * onClose={() => this.handleCancel()}>\r\n * <Form handleFormSubmit={(values: FieldValues) => this.handleSubmit(values)}\r\n * fields={fields}\r\n * />\r\n * </Dialog>\r\n * </div >\r\n * );\r\n * }\r\n * @public @deprecate\r\n */\r\nexport class Form extends React.Component<FormProps, FormState> {\r\n private _submitButtonLabel = UiCore.translate(\"form.submitButtonLabel\");\r\n private _errorPrefix = UiCore.translate(\"form.errorPrefix\");\r\n private _errorSuffix = UiCore.translate(\"form.errorSuffix\");\r\n\r\n constructor(props: FormProps) {\r\n super(props);\r\n\r\n // set initial values for field values\r\n const values: FieldValues = {};\r\n Object.keys(props.fields).forEach((key) => values[key] = props.fields[key].value);\r\n\r\n this.state = {\r\n errorMsg: \"\",\r\n values,\r\n };\r\n }\r\n\r\n /**\r\n * Returns whether there is an errorMsg message in the state/context\r\n * @param errorMsg - The form errorMsg\r\n */\r\n private haveError(errorMsg: string) {\r\n return errorMsg && errorMsg.length;\r\n }\r\n\r\n private _setValues = (values: FieldValues) => {\r\n this.setState((prevState) => ({ values: { ...prevState.values, ...values } }));\r\n };\r\n\r\n private _handleSubmit = (event: React.FormEvent<HTMLFormElement>, values: FieldValues) => {\r\n event.preventDefault();\r\n\r\n // istanbul ignore next\r\n if (!this.props.handleFormSubmit || !values || 0 === values.length)\r\n throw new Error(\"A handleFormSubmit function and values must be defined\");\r\n\r\n this.props.handleFormSubmit(values)\r\n .then(() => {\r\n // Currently we don't need to do anything if successful. Typically the hosting dialog will close when the\r\n // submission is successful.\r\n // console.log(rtnMsg);\r\n })\r\n .catch((reason: Error) => {\r\n this.setState({ submitSuccess: false, errorMsg: reason.message });\r\n });\r\n };\r\n\r\n public override render() {\r\n const { submitSuccess, errorMsg } = this.state;\r\n const { fields, submitButtonLabel } = this.props;\r\n const context: FormContextState = { ...this.state, setValues: this._setValues };\r\n\r\n return (\r\n <FormContext.Provider value={context}>\r\n <div className=\"core-form-wrapper\">\r\n <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => this._handleSubmit(event, this.state.values)} noValidate={true}>\r\n <div className=\"core-form-container\">\r\n {Object.keys(fields).map((key) => <Field key={key} id={key} {...this.props.fields[key]} />)}\r\n <div className=\"core-form-footer\">\r\n <div className=\"core-form-buttons\">\r\n <Button type=\"submit\" styleType=\"high-visibility\">\r\n {submitButtonLabel ? submitButtonLabel : this._submitButtonLabel}\r\n </Button>\r\n </div>\r\n {submitSuccess === false && this.haveError(errorMsg) && (\r\n <div className=\"core-form-alert\" role=\"alert\">{`${this._errorPrefix}-${errorMsg} ${this._errorSuffix}`}</div>\r\n )}\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </FormContext.Provider>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -5,7 +5,7 @@ import "./SvgSprite.scss";
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Properties of [[SvgSprite]] component.
|
|
8
|
-
* @public @deprecated
|
|
8
|
+
* @public @deprecated in 3.2.
|
|
9
9
|
*/
|
|
10
10
|
export interface SvgSpriteProps extends CommonProps {
|
|
11
11
|
/** Source for the Svg */
|
|
@@ -13,7 +13,7 @@ export interface SvgSpriteProps extends CommonProps {
|
|
|
13
13
|
}
|
|
14
14
|
/** Svg element wrapper.
|
|
15
15
|
* This component is deprecate -- use IconComponent
|
|
16
|
-
* @public @deprecated
|
|
16
|
+
* @public @deprecated in 3.2.
|
|
17
17
|
*/
|
|
18
18
|
export declare class SvgSprite extends React.PureComponent<SvgSpriteProps> {
|
|
19
19
|
render(): JSX.Element;
|
|
@@ -14,7 +14,7 @@ const classnames_1 = require("classnames");
|
|
|
14
14
|
const React = require("react");
|
|
15
15
|
/** Svg element wrapper.
|
|
16
16
|
* This component is deprecate -- use IconComponent
|
|
17
|
-
* @public @deprecated
|
|
17
|
+
* @public @deprecated in 3.2.
|
|
18
18
|
*/
|
|
19
19
|
class SvgSprite extends React.PureComponent {
|
|
20
20
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgSprite.js","sourceRoot":"","sources":["../../../../src/core-react/icons/SvgSprite.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,4BAA0B;AAC1B,2CAAoC;AACpC,+BAA+B;AAW/B;;;GAGG;AACH,MAAa,SAAU,SAAQ,KAAK,CAAC,aAA6B;IAChD,MAAM;QACpB,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,sBAAsB,EACtB,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,CACL,6BAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM;YAC5E,6BAAK,UAAU,EAAC,8BAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAI,CACxE,CACP,CAAC;IACJ,CAAC;CACF;AAbD,8BAaC","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 Icon\r\n */\r\n\r\nimport \"./SvgSprite.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties of [[SvgSprite]] component.\r\n * @public @deprecated
|
|
1
|
+
{"version":3,"file":"SvgSprite.js","sourceRoot":"","sources":["../../../../src/core-react/icons/SvgSprite.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,4BAA0B;AAC1B,2CAAoC;AACpC,+BAA+B;AAW/B;;;GAGG;AACH,MAAa,SAAU,SAAQ,KAAK,CAAC,aAA6B;IAChD,MAAM;QACpB,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,sBAAsB,EACtB,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,CACL,6BAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM;YAC5E,6BAAK,UAAU,EAAC,8BAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAI,CACxE,CACP,CAAC;IACJ,CAAC;CACF;AAbD,8BAaC","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 Icon\r\n */\r\n\r\nimport \"./SvgSprite.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties of [[SvgSprite]] component.\r\n * @public @deprecated in 3.2.\r\n */\r\nexport interface SvgSpriteProps extends CommonProps {\r\n /** Source for the Svg */\r\n src: string;\r\n}\r\n\r\n/** Svg element wrapper.\r\n * This component is deprecate -- use IconComponent\r\n * @public @deprecated in 3.2.\r\n */\r\nexport class SvgSprite extends React.PureComponent<SvgSpriteProps> {\r\n public override render() {\r\n const className = classnames(\r\n \"core-icons-svgSprite\",\r\n this.props.className,\r\n );\r\n\r\n return (\r\n <svg className={className} style={this.props.style} width=\"100%\" height=\"100%\">\r\n <use xmlnsXlink=\"http://www.w3.org/1999/xlink\" xlinkHref={this.props.src} />\r\n </svg>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { CommonProps } from "../utils/Props";
|
|
6
6
|
/** Properties for the [[Input]] component
|
|
7
7
|
* @public
|
|
8
|
-
* @deprecated Use InputProps in itwinui-react instead
|
|
8
|
+
* @deprecated in 3.0. Use InputProps in itwinui-react instead
|
|
9
9
|
*/
|
|
10
10
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {
|
|
11
11
|
/** Indicates whether to set focus to the input element */
|
|
@@ -17,7 +17,7 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
17
17
|
}
|
|
18
18
|
/** Basic text input, is a wrapper for the `<input type="text">` HTML element.
|
|
19
19
|
* @public
|
|
20
|
-
* @deprecated Use Input in itwinui-react instead
|
|
20
|
+
* @deprecated in 3.0. Use Input in itwinui-react instead
|
|
21
21
|
*/
|
|
22
22
|
export declare const Input: (props: InputProps) => JSX.Element | null;
|
|
23
23
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -41,7 +41,7 @@ function ForwardRefInput(props, ref) {
|
|
|
41
41
|
});
|
|
42
42
|
/** Basic text input, is a wrapper for the `<input type="text">` HTML element.
|
|
43
43
|
* @public
|
|
44
|
-
* @deprecated Use Input in itwinui-react instead
|
|
44
|
+
* @deprecated in 3.0. Use Input in itwinui-react instead
|
|
45
45
|
*/
|
|
46
46
|
exports.Input = ForwardRefInput; // eslint-disable-line deprecation/deprecation
|
|
47
47
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/Input.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;AAC/B,wDAA8D;AAC9D,oDAAiD;AAgBjD,0GAA0G;AAC1G,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAkC,8CAA8C;AACtH,SAAS,eAAe,CAAC,KAAK,EAAE,GAAG;IACjC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,wDAAwD;IAC7I,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC7D,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,eAAe,EAAE,GAAG,CAAC,CAAC,CAAE,uGAAuG;IAEpJ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC;QAC/C,MAAM,cAAc,GAAG,gBAAgB,CAAC;QAExC,IAAI,cAAc,IAAI,cAAc,EAAE;YACpC,cAAc,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;SAC5D;QACD,OAAO,GAAG,EAAE;YACV,IAAI,cAAc,IAAI,cAAc,EAAE;gBACpC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;aAC/D;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,eAAe,CAAC,OAAO,IAAI,QAAQ;YACrC,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAyC,EAAE,EAAE;QAClF,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,qBAAa,IAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,KAAK,UAAU,EAAE,OAAO,EAAE,WAAW,EACxE,SAAS,EAAE,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,KAAK,GAA8C,eAAe,CAAC,CAAE,8CAA8C","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 Inputs\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Input as ITwinUI_Input } from \"@itwin/itwinui-react\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for the [[Input]] component\r\n * @public\r\n * @deprecated Use InputProps in itwinui-react instead\r\n */\r\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n /** Native keydown event handler */\r\n nativeKeyHandler?: (e: KeyboardEvent) => void;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\n// Defined using following pattern (const Input at bottom) to ensure useful API documentation is extracted\r\nconst ForwardRefInput = React.forwardRef<HTMLInputElement, InputProps>( // eslint-disable-line deprecation/deprecation\r\n function ForwardRefInput(props, ref) {\r\n const { className, style, setFocus, nativeKeyHandler, size, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const inputElementRef = React.useRef<HTMLInputElement>(null);\r\n const refs = useRefs(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n\r\n React.useEffect(() => {\r\n const currentElement = inputElementRef.current;\r\n const currentHandler = nativeKeyHandler;\r\n\r\n if (currentElement && currentHandler) {\r\n currentElement.addEventListener(\"keydown\", currentHandler);\r\n }\r\n return () => {\r\n if (currentHandler && currentElement) {\r\n currentElement.removeEventListener(\"keydown\", currentHandler);\r\n }\r\n };\r\n }, [nativeKeyHandler]);\r\n\r\n React.useEffect(() => {\r\n if (inputElementRef.current && setFocus)\r\n inputElementRef.current.focus();\r\n }, [setFocus]);\r\n\r\n const handleFocus = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n event.currentTarget.select();\r\n }, []);\r\n\r\n return (\r\n <ITwinUI_Input ref={refs} type=\"text\" {...otherProps} onFocus={handleFocus}\r\n className={classnames(\"uicore-inputs-input\", className)} style={style} />\r\n );\r\n }\r\n);\r\n\r\n/** Basic text input, is a wrapper for the `<input type=\"text\">` HTML element.\r\n * @public\r\n * @deprecated Use Input in itwinui-react instead\r\n */\r\nexport const Input: (props: InputProps) => JSX.Element | null = ForwardRefInput; // eslint-disable-line deprecation/deprecation\r\n"]}
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/Input.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;AAC/B,wDAA8D;AAC9D,oDAAiD;AAgBjD,0GAA0G;AAC1G,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAkC,8CAA8C;AACtH,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AAE,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,KAAK,GAA8C,eAAe,CAAC,CAAE,8CAA8C","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 Inputs\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Input as ITwinUI_Input } from \"@itwin/itwinui-react\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for the [[Input]] component\r\n * @public\r\n * @deprecated in 3.0. Use InputProps in itwinui-react instead\r\n */\r\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n /** Native keydown event handler */\r\n nativeKeyHandler?: (e: KeyboardEvent) => void;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\n// Defined using following pattern (const Input at bottom) to ensure useful API documentation is extracted\r\nconst ForwardRefInput = React.forwardRef<HTMLInputElement, InputProps>( // eslint-disable-line deprecation/deprecation\r\n function ForwardRefInput(props, ref) {\r\n const { className, style, setFocus, nativeKeyHandler, size, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const inputElementRef = React.useRef<HTMLInputElement>(null);\r\n const refs = useRefs(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n\r\n React.useEffect(() => {\r\n const currentElement = inputElementRef.current;\r\n const currentHandler = nativeKeyHandler;\r\n\r\n if (currentElement && currentHandler) {\r\n currentElement.addEventListener(\"keydown\", currentHandler);\r\n }\r\n return () => {\r\n if (currentHandler && currentElement) {\r\n currentElement.removeEventListener(\"keydown\", currentHandler);\r\n }\r\n };\r\n }, [nativeKeyHandler]);\r\n\r\n React.useEffect(() => {\r\n if (inputElementRef.current && setFocus)\r\n inputElementRef.current.focus();\r\n }, [setFocus]);\r\n\r\n const handleFocus = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n event.currentTarget.select();\r\n }, []);\r\n\r\n return (\r\n <ITwinUI_Input ref={refs} type=\"text\" {...otherProps} onFocus={handleFocus}\r\n className={classnames(\"uicore-inputs-input\", className)} style={style} />\r\n );\r\n }\r\n);\r\n\r\n/** Basic text input, is a wrapper for the `<input type=\"text\">` HTML element.\r\n * @public\r\n * @deprecated in 3.0. Use Input in itwinui-react instead\r\n */\r\nexport const Input: (props: InputProps) => JSX.Element | null = ForwardRefInput; // eslint-disable-line deprecation/deprecation\r\n"]}
|
|
@@ -6,13 +6,13 @@ import { InputProps } from "./Input";
|
|
|
6
6
|
import { LabeledComponentProps, MessagedComponentProps } from "./LabeledComponentProps";
|
|
7
7
|
/** Properties for [[LabeledInput]] components
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated Use LabeledInputProps in itwinui-react instead
|
|
9
|
+
* @deprecated in 3.0. Use LabeledInputProps in itwinui-react instead
|
|
10
10
|
*/
|
|
11
11
|
export interface LabeledInputProps extends InputProps, LabeledComponentProps, MessagedComponentProps {
|
|
12
12
|
}
|
|
13
13
|
/** Text input wrapper that provides additional styling and labeling
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated Use LabeledInput in itwinui-react instead
|
|
15
|
+
* @deprecated in 3.0. Use LabeledInput in itwinui-react instead
|
|
16
16
|
*/
|
|
17
17
|
export declare function LabeledInput(props: LabeledInputProps): JSX.Element;
|
|
18
18
|
//# sourceMappingURL=LabeledInput.d.ts.map
|