@itwin/core-react 3.6.0-dev.55 → 3.6.0-dev.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/core-react/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 +9 -9
|
@@ -7,7 +7,7 @@ import { SpinnerSize } from "../loading/Spinner";
|
|
|
7
7
|
/**
|
|
8
8
|
* Properties for [[ProgressSpinner]] component
|
|
9
9
|
* @beta
|
|
10
|
-
* @deprecated Use ProgressRadialProps in itwinui-react instead.
|
|
10
|
+
* @deprecated in 3.0. Use ProgressRadialProps in itwinui-react instead.
|
|
11
11
|
*/
|
|
12
12
|
export interface ProgressSpinnerProps extends CommonProps {
|
|
13
13
|
/**
|
|
@@ -43,7 +43,7 @@ export interface ProgressSpinnerProps extends CommonProps {
|
|
|
43
43
|
/**
|
|
44
44
|
* Circular Progress Indicator that supports determinate and indeterminate modes.
|
|
45
45
|
* @beta
|
|
46
|
-
* @deprecated Use ProgressRadial in itwinui-react instead.
|
|
46
|
+
* @deprecated in 3.0. Use ProgressRadial in itwinui-react instead.
|
|
47
47
|
*/
|
|
48
48
|
export declare function ProgressSpinner(props: ProgressSpinnerProps): JSX.Element;
|
|
49
49
|
//# sourceMappingURL=ProgressSpinner.d.ts.map
|
|
@@ -12,7 +12,7 @@ import { SpinnerSize } from "../loading/Spinner";
|
|
|
12
12
|
/**
|
|
13
13
|
* Circular Progress Indicator that supports determinate and indeterminate modes.
|
|
14
14
|
* @beta
|
|
15
|
-
* @deprecated Use ProgressRadial in itwinui-react instead.
|
|
15
|
+
* @deprecated in 3.0. Use ProgressRadial in itwinui-react instead.
|
|
16
16
|
*/
|
|
17
17
|
export function ProgressSpinner(props) {
|
|
18
18
|
const { value = 0, indeterminate = false, success = false, error = false, style = {}, size, children, } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressSpinner.js","sourceRoot":"","sources":["../../../../src/core-react/progress-indicators/ProgressSpinner.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAuCjD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EACJ,KAAK,GAAG,CAAC,EACT,aAAa,GAAG,KAAK,EACrB,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,KAAK,EACb,KAAK,GAAG,EAAE,EACV,IAAI,EACJ,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,IAAI,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAChC,MAAM,SAAS,GAAwB,EAAE,CAAC;IAC1C,mCAAmC;IACnC,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK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AoB,EAAE,EAAE;IAChF,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,QAAQ,MAAM,EAAE;YACd,KAAK,WAAW,CAAC,KAAK,EAAI,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;YACR,KAAK,WAAW,CAAC,MAAM,EAAG,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;YACR,KAAK,WAAW,CAAC,KAAK,EAAI,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;YACR,KAAK,WAAW,CAAC,MAAM,EAAG,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;SACT;KACF;IACD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACpD,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Loading\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Icon } from \"../icons/IconComponent\";\r\nimport { SpinnerSize } from \"../loading/Spinner\";\r\n\r\n/**\r\n * Properties for [[ProgressSpinner]] component\r\n * @beta\r\n * @deprecated Use ProgressRadialProps in itwinui-react instead.\r\n */\r\nexport interface ProgressSpinnerProps extends CommonProps {\r\n /**\r\n * Spinner percentage. Should be a number between 0 and 100.\r\n * @default 0\r\n */\r\n value?: number;\r\n /**\r\n * Spinner variant. If true, value will be ignored.\r\n * @default false\r\n */\r\n indeterminate?: boolean;\r\n /**\r\n * If true, spinner will be full, green, and display a checkmark.\r\n * @default false\r\n */\r\n success?: boolean;\r\n /**\r\n * If true, spinner will be full, red, and display an X.\r\n * @default false\r\n */\r\n error?: boolean;\r\n /**\r\n * Size of spinner\r\n * @default width/height of 40px\r\n */\r\n size?: SpinnerSize; // eslint-disable-line deprecation/deprecation\r\n /**\r\n * Child components\r\n */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Circular Progress Indicator that supports determinate and indeterminate modes.\r\n * @beta\r\n * @deprecated Use ProgressRadial in itwinui-react instead.\r\n */\r\nexport function ProgressSpinner(props: ProgressSpinnerProps) { // eslint-disable-line deprecation/deprecation\r\n const {\r\n value = 0,\r\n indeterminate = false,\r\n success = false,\r\n error = false,\r\n style = {},\r\n size,\r\n children,\r\n } = props;\r\n\r\n let outerClassName = classnames(\"uicore-progress-spinner\");\r\n const outerStyle = { ...style };\r\n const fillStyle: React.CSSProperties = {};\r\n // Ensure value is bounded 0 - 100;\r\n const dashOffset = 100 - Math.min(Math.max(value, 0), 100);\r\n let content: React.ReactNode;\r\n\r\n if (error) {\r\n outerClassName = classnames(outerClassName, \"error\");\r\n content = <Icon iconSpec=\"icon-close-2\" />;\r\n } else if (success) {\r\n outerClassName = classnames(outerClassName, \"success\");\r\n content = (\r\n <Icon iconSpec=\"icon-checkmark\" />\r\n );\r\n } else if (indeterminate) {\r\n outerClassName = classnames(outerClassName, \"indeterminate\");\r\n content = children;\r\n } else {\r\n outerClassName = classnames(outerClassName, \"determinate\");\r\n fillStyle.strokeDashoffset = dashOffset;\r\n content = children;\r\n }\r\n\r\n setDefaultDimensions(outerStyle, size);\r\n\r\n return (\r\n <div className={outerClassName} style={outerStyle}>\r\n <svg className=\"spinner\" viewBox=\"0 0 40 40\">\r\n <circle className=\"shape\" cx=\"20\" cy=\"20\" r=\"15.91549\" />\r\n <circle\r\n className=\"fill\"\r\n cx=\"20\"\r\n cy=\"20\"\r\n r=\"15.91549\"\r\n style={fillStyle}\r\n />\r\n </svg>\r\n {content && <span className=\"uicore-progress-spinner-content\">{content}</span>}\r\n </div>\r\n );\r\n}\r\n\r\nconst setDefaultDimensions = (style: React.CSSProperties, inSize?: SpinnerSize) => { // eslint-disable-line deprecation/deprecation\r\n let size = 40;\r\n\r\n if (inSize !== undefined) {\r\n switch (inSize) {\r\n case SpinnerSize.Small: // eslint-disable-line deprecation/deprecation\r\n size = 16;\r\n break;\r\n case SpinnerSize.Medium: // eslint-disable-line deprecation/deprecation\r\n size = 32;\r\n break;\r\n case SpinnerSize.Large: // eslint-disable-line deprecation/deprecation\r\n size = 64;\r\n break;\r\n case SpinnerSize.XLarge: // eslint-disable-line deprecation/deprecation\r\n size = 96;\r\n break;\r\n }\r\n }\r\n style.width = style.width ? style.width : size;\r\n style.height = style.height ? style.height : size;\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"ProgressSpinner.js","sourceRoot":"","sources":["../../../../src/core-react/progress-indicators/ProgressSpinner.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAuCjD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EACJ,KAAK,GAAG,CAAC,EACT,aAAa,GAAG,KAAK,EACrB,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,KAAK,EACb,KAAK,GAAG,EAAE,EACV,IAAI,EACJ,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,IAAI,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAChC,MAA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O,IAAI,8BAAM,SAAS,EAAC,iCAAiC,IAAE,OAAO,CAAQ,CAC1E,CACP,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,CAAC,KAA0B,EAAE,MAAoB,EAAE,EAAE;IAChF,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,QAAQ,MAAM,EAAE;YACd,KAAK,WAAW,CAAC,KAAK,EAAI,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;YACR,KAAK,WAAW,CAAC,MAAM,EAAG,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;YACR,KAAK,WAAW,CAAC,KAAK,EAAI,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;YACR,KAAK,WAAW,CAAC,MAAM,EAAG,8CAA8C;gBACtE,IAAI,GAAG,EAAE,CAAC;gBACV,MAAM;SACT;KACF;IACD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACpD,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Loading\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Icon } from \"../icons/IconComponent\";\r\nimport { SpinnerSize } from \"../loading/Spinner\";\r\n\r\n/**\r\n * Properties for [[ProgressSpinner]] component\r\n * @beta\r\n * @deprecated in 3.0. Use ProgressRadialProps in itwinui-react instead.\r\n */\r\nexport interface ProgressSpinnerProps extends CommonProps {\r\n /**\r\n * Spinner percentage. Should be a number between 0 and 100.\r\n * @default 0\r\n */\r\n value?: number;\r\n /**\r\n * Spinner variant. If true, value will be ignored.\r\n * @default false\r\n */\r\n indeterminate?: boolean;\r\n /**\r\n * If true, spinner will be full, green, and display a checkmark.\r\n * @default false\r\n */\r\n success?: boolean;\r\n /**\r\n * If true, spinner will be full, red, and display an X.\r\n * @default false\r\n */\r\n error?: boolean;\r\n /**\r\n * Size of spinner\r\n * @default width/height of 40px\r\n */\r\n size?: SpinnerSize; // eslint-disable-line deprecation/deprecation\r\n /**\r\n * Child components\r\n */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Circular Progress Indicator that supports determinate and indeterminate modes.\r\n * @beta\r\n * @deprecated in 3.0. Use ProgressRadial in itwinui-react instead.\r\n */\r\nexport function ProgressSpinner(props: ProgressSpinnerProps) { // eslint-disable-line deprecation/deprecation\r\n const {\r\n value = 0,\r\n indeterminate = false,\r\n success = false,\r\n error = false,\r\n style = {},\r\n size,\r\n children,\r\n } = props;\r\n\r\n let outerClassName = classnames(\"uicore-progress-spinner\");\r\n const outerStyle = { ...style };\r\n const fillStyle: React.CSSProperties = {};\r\n // Ensure value is bounded 0 - 100;\r\n const dashOffset = 100 - Math.min(Math.max(value, 0), 100);\r\n let content: React.ReactNode;\r\n\r\n if (error) {\r\n outerClassName = classnames(outerClassName, \"error\");\r\n content = <Icon iconSpec=\"icon-close-2\" />;\r\n } else if (success) {\r\n outerClassName = classnames(outerClassName, \"success\");\r\n content = (\r\n <Icon iconSpec=\"icon-checkmark\" />\r\n );\r\n } else if (indeterminate) {\r\n outerClassName = classnames(outerClassName, \"indeterminate\");\r\n content = children;\r\n } else {\r\n outerClassName = classnames(outerClassName, \"determinate\");\r\n fillStyle.strokeDashoffset = dashOffset;\r\n content = children;\r\n }\r\n\r\n setDefaultDimensions(outerStyle, size);\r\n\r\n return (\r\n <div className={outerClassName} style={outerStyle}>\r\n <svg className=\"spinner\" viewBox=\"0 0 40 40\">\r\n <circle className=\"shape\" cx=\"20\" cy=\"20\" r=\"15.91549\" />\r\n <circle\r\n className=\"fill\"\r\n cx=\"20\"\r\n cy=\"20\"\r\n r=\"15.91549\"\r\n style={fillStyle}\r\n />\r\n </svg>\r\n {content && <span className=\"uicore-progress-spinner-content\">{content}</span>}\r\n </div>\r\n );\r\n}\r\n\r\nconst setDefaultDimensions = (style: React.CSSProperties, inSize?: SpinnerSize) => { // eslint-disable-line deprecation/deprecation\r\n let size = 40;\r\n\r\n if (inSize !== undefined) {\r\n switch (inSize) {\r\n case SpinnerSize.Small: // eslint-disable-line deprecation/deprecation\r\n size = 16;\r\n break;\r\n case SpinnerSize.Medium: // eslint-disable-line deprecation/deprecation\r\n size = 32;\r\n break;\r\n case SpinnerSize.Large: // eslint-disable-line deprecation/deprecation\r\n size = 64;\r\n break;\r\n case SpinnerSize.XLarge: // eslint-disable-line deprecation/deprecation\r\n size = 96;\r\n break;\r\n }\r\n }\r\n style.width = style.width ? style.width : size;\r\n style.height = style.height ? style.height : size;\r\n};\r\n"]}
|
|
@@ -6,13 +6,13 @@ import { LabeledComponentProps } from "../inputs/LabeledComponentProps";
|
|
|
6
6
|
import { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Properties for [[Radio]] component
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated Use RadioProps in itwinui-react instead
|
|
9
|
+
* @deprecated in 3.0. Use RadioProps in itwinui-react instead
|
|
10
10
|
*/
|
|
11
11
|
export interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps, LabeledComponentProps {
|
|
12
12
|
}
|
|
13
13
|
/** Basic radio input component is a wrapper for the `<input type="radio">` HTML element.
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated Use Radio in itwinui-react instead
|
|
15
|
+
* @deprecated in 3.0. Use Radio in itwinui-react instead
|
|
16
16
|
*/
|
|
17
17
|
export declare class Radio extends React.PureComponent<RadioProps> {
|
|
18
18
|
render(): JSX.Element;
|
|
@@ -9,7 +9,7 @@ import classnames from "classnames";
|
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
/** Basic radio input component is a wrapper for the `<input type="radio">` HTML element.
|
|
11
11
|
* @public
|
|
12
|
-
* @deprecated Use Radio in itwinui-react instead
|
|
12
|
+
* @deprecated in 3.0. Use Radio in itwinui-react instead
|
|
13
13
|
*/
|
|
14
14
|
export class Radio extends React.PureComponent {
|
|
15
15
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../../src/core-react/radio/Radio.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,aAAyB;IACxC,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,wDAAwD;QAEtK,OAAO,CACL,+BAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CACxC,qBAAqB,EACrB,QAAQ,IAAI,eAAe,EAC3B,MAAM,EACN,SAAS,CACV;YACE,KAAK;gBACJ,kCAAO,KAAK,CAAQ;YAEtB,+BAAO,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,KAAM,KAAK,GAAI;YACrG,8BAAM,SAAS,EAAC,sBAAsB,GAAQ,CACxC,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Radio\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { LabeledComponentProps } from \"../inputs/LabeledComponentProps\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for [[Radio]] component\r\n * @public\r\n * @deprecated Use RadioProps in itwinui-react instead\r\n */\r\nexport interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps, LabeledComponentProps { }\r\n\r\n/** Basic radio input component is a wrapper for the `<input type=\"radio\">` HTML element.\r\n * @public\r\n * @deprecated Use Radio in itwinui-react instead\r\n */\r\nexport class Radio extends React.PureComponent<RadioProps> { // eslint-disable-line deprecation/deprecation\r\n public override render(): JSX.Element {\r\n const { label, disabled, status, className, style, inputStyle, inputClassName, type, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n return (\r\n <label style={style} className={classnames(\r\n \"uicore-inputs-radio\",\r\n disabled && \"core-disabled\",\r\n status,\r\n className,\r\n )}>\r\n {label &&\r\n <span>{label}</span>\r\n }\r\n <input type={\"radio\"} className={inputClassName} style={inputStyle} disabled={disabled} {...props} />\r\n <span className=\"core-radio-checkmark\"></span>\r\n </label>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../../src/core-react/radio/Radio.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,aAAyB;IACxC,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,wDAAwD;QAEtK,OAAO,CACL,+BAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CACxC,qBAAqB,EACrB,QAAQ,IAAI,eAAe,EAC3B,MAAM,EACN,SAAS,CACV;YACE,KAAK;gBACJ,kCAAO,KAAK,CAAQ;YAEtB,+BAAO,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,KAAM,KAAK,GAAI;YACrG,8BAAM,SAAS,EAAC,sBAAsB,GAAQ,CACxC,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Radio\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { LabeledComponentProps } from \"../inputs/LabeledComponentProps\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for [[Radio]] component\r\n * @public\r\n * @deprecated in 3.0. Use RadioProps in itwinui-react instead\r\n */\r\nexport interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps, LabeledComponentProps { }\r\n\r\n/** Basic radio input component is a wrapper for the `<input type=\"radio\">` HTML element.\r\n * @public\r\n * @deprecated in 3.0. Use Radio in itwinui-react instead\r\n */\r\nexport class Radio extends React.PureComponent<RadioProps> { // eslint-disable-line deprecation/deprecation\r\n public override render(): JSX.Element {\r\n const { label, disabled, status, className, style, inputStyle, inputClassName, type, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n return (\r\n <label style={style} className={classnames(\r\n \"uicore-inputs-radio\",\r\n disabled && \"core-disabled\",\r\n status,\r\n className,\r\n )}>\r\n {label &&\r\n <span>{label}</span>\r\n }\r\n <input type={\"radio\"} className={inputClassName} style={inputStyle} disabled={disabled} {...props} />\r\n <span className=\"core-radio-checkmark\"></span>\r\n </label>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -6,13 +6,13 @@ import { LabeledComponentProps, MessagedComponentProps } from "../inputs/Labeled
|
|
|
6
6
|
import { SelectProps } from "./Select";
|
|
7
7
|
/** Properties for [[LabeledSelect]] components
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated Use LabeledSelectProps in itwinui-react instead
|
|
9
|
+
* @deprecated in 3.0. Use LabeledSelectProps in itwinui-react instead
|
|
10
10
|
*/
|
|
11
11
|
export interface LabeledSelectProps extends SelectProps, LabeledComponentProps, MessagedComponentProps {
|
|
12
12
|
}
|
|
13
13
|
/** Dropdown wrapper that allows for additional styling and labelling
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated Use LabeledSelect in itwinui-react instead
|
|
15
|
+
* @deprecated in 3.0. Use LabeledSelect in itwinui-react instead
|
|
16
16
|
*/
|
|
17
17
|
export declare class LabeledSelect extends React.PureComponent<LabeledSelectProps> {
|
|
18
18
|
render(): JSX.Element;
|
|
@@ -11,7 +11,7 @@ import * as React from "react";
|
|
|
11
11
|
import { Select } from "./Select";
|
|
12
12
|
/** Dropdown wrapper that allows for additional styling and labelling
|
|
13
13
|
* @public
|
|
14
|
-
* @deprecated Use LabeledSelect in itwinui-react instead
|
|
14
|
+
* @deprecated in 3.0. Use LabeledSelect in itwinui-react instead
|
|
15
15
|
*/
|
|
16
16
|
export class LabeledSelect extends React.PureComponent {
|
|
17
17
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/LabeledSelect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4CAA4C;AAE5C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAQ/C;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IACxD,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EACrC,cAAc,EAAE,UAAU,EAC1B,cAAc,EAAE,UAAU,EAC1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EACvC,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE1B,OAAO,CACL,+BAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CACxC,8BAA8B,EAC9B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,MAAM,EACN,SAAS,CACV;YACE,KAAK;gBACJ,6BAAK,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU;;oBAAI,KAAK;wBAAQ;YAEhG,oBAAC,MAAM,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,KAAM,KAAK,GAAI;YACjG,OAAO;gBACN,6BAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,IAAG,OAAO,CAAO,CAEhG,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { LabeledComponentProps, MessagedComponentProps } from \"../inputs/LabeledComponentProps\";\r\nimport { Select, SelectProps } from \"./Select\";\r\n\r\n/** Properties for [[LabeledSelect]] components\r\n * @public\r\n * @deprecated Use LabeledSelectProps in itwinui-react instead\r\n */\r\nexport interface LabeledSelectProps extends SelectProps, LabeledComponentProps, MessagedComponentProps { }\r\n\r\n/** Dropdown wrapper that allows for additional styling and labelling\r\n * @public\r\n * @deprecated Use LabeledSelect in itwinui-react instead\r\n */\r\nexport class LabeledSelect extends React.PureComponent<LabeledSelectProps> {\r\n public override render(): JSX.Element {\r\n const { label, status, className, style,\r\n inputClassName, inputStyle,\r\n labelClassName, labelStyle,\r\n message, messageClassName, messageStyle,\r\n ...props } = this.props;\r\n\r\n return (\r\n <label style={style} className={classnames(\r\n \"uicore-inputs-labeled-select\",\r\n this.props.disabled && \"uicore-disabled\",\r\n status,\r\n className,\r\n )}>\r\n {label &&\r\n <div className={classnames(\"uicore-label\", labelClassName)} style={labelStyle}> {label} </div>\r\n }\r\n <Select disabled={this.props.disabled} className={inputClassName} style={inputStyle} {...props} />\r\n {message &&\r\n <div className={classnames(\"uicore-message\", messageClassName)} style={messageStyle}>{message}</div>\r\n }\r\n </label>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LabeledSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/LabeledSelect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4CAA4C;AAE5C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAQ/C;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IACxD,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EACrC,cAAc,EAAE,UAAU,EAC1B,cAAc,EAAE,UAAU,EAC1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EACvC,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE1B,OAAO,CACL,+BAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CACxC,8BAA8B,EAC9B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,MAAM,EACN,SAAS,CACV;YACE,KAAK;gBACJ,6BAAK,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU;;oBAAI,KAAK;wBAAQ;YAEhG,oBAAC,MAAM,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,KAAM,KAAK,GAAI;YACjG,OAAO;gBACN,6BAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,IAAG,OAAO,CAAO,CAEhG,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { LabeledComponentProps, MessagedComponentProps } from \"../inputs/LabeledComponentProps\";\r\nimport { Select, SelectProps } from \"./Select\";\r\n\r\n/** Properties for [[LabeledSelect]] components\r\n * @public\r\n * @deprecated in 3.0. Use LabeledSelectProps in itwinui-react instead\r\n */\r\nexport interface LabeledSelectProps extends SelectProps, LabeledComponentProps, MessagedComponentProps { }\r\n\r\n/** Dropdown wrapper that allows for additional styling and labelling\r\n * @public\r\n * @deprecated in 3.0. Use LabeledSelect in itwinui-react instead\r\n */\r\nexport class LabeledSelect extends React.PureComponent<LabeledSelectProps> {\r\n public override render(): JSX.Element {\r\n const { label, status, className, style,\r\n inputClassName, inputStyle,\r\n labelClassName, labelStyle,\r\n message, messageClassName, messageStyle,\r\n ...props } = this.props;\r\n\r\n return (\r\n <label style={style} className={classnames(\r\n \"uicore-inputs-labeled-select\",\r\n this.props.disabled && \"uicore-disabled\",\r\n status,\r\n className,\r\n )}>\r\n {label &&\r\n <div className={classnames(\"uicore-label\", labelClassName)} style={labelStyle}> {label} </div>\r\n }\r\n <Select disabled={this.props.disabled} className={inputClassName} style={inputStyle} {...props} />\r\n {message &&\r\n <div className={classnames(\"uicore-message\", messageClassName)} style={messageStyle}>{message}</div>\r\n }\r\n </label>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import { LabeledComponentProps, MessagedComponentProps } from "../inputs/LabeledComponentProps";
|
|
6
6
|
import { ThemedSelectProps } from "./ThemedSelect";
|
|
7
7
|
/** Properties for [[LabeledThemedSelect]] components
|
|
8
|
-
* @beta @deprecated
|
|
8
|
+
* @beta @deprecated in 3.0.
|
|
9
9
|
*/
|
|
10
10
|
export interface LabeledThemedSelectProps extends ThemedSelectProps, LabeledComponentProps, MessagedComponentProps {
|
|
11
11
|
}
|
|
12
12
|
/** Dropdown wrapper that allows for additional styling and labelling
|
|
13
|
-
* @beta @deprecated
|
|
13
|
+
* @beta @deprecated in 3.0.
|
|
14
14
|
*/
|
|
15
15
|
export declare function LabeledThemedSelect(props: LabeledThemedSelectProps): JSX.Element;
|
|
16
16
|
//# sourceMappingURL=LabeledThemedSelect.d.ts.map
|
|
@@ -10,7 +10,7 @@ import classnames from "classnames";
|
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { ThemedSelect } from "./ThemedSelect";
|
|
12
12
|
/** Dropdown wrapper that allows for additional styling and labelling
|
|
13
|
-
* @beta @deprecated
|
|
13
|
+
* @beta @deprecated in 3.0.
|
|
14
14
|
*/
|
|
15
15
|
export function LabeledThemedSelect(props) {
|
|
16
16
|
const { label, status, className, style, inputClassName, inputStyle, labelClassName, labelStyle, message, messageClassName, messageStyle, ...otherProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledThemedSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/LabeledThemedSelect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAOjE;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EACrC,cAAc,EAAE,UAAU,EAC1B,cAAc,EAAE,UAAU,EAC1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EACvC,GAAG,UAAU,EAAE,GAAG,KAAY,CAAC;IAEjC,OAAO,CACL,+BAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CACxC,qCAAqC,EACrC,KAAK,CAAC,UAAU,IAAI,iBAAiB,EACrC,MAAM,EACN,SAAS,CACV;QACE,KAAK;YACJ,6BAAK,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU;;gBAAI,KAAK;oBAAQ;QAEhG,oBAAC,YAAY,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,KAAM,UAAU,GAAI;QAC5G,OAAO;YACN,6BAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,IAAG,OAAO,CAAO,CAEhG,CACT,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { LabeledComponentProps, MessagedComponentProps } from \"../inputs/LabeledComponentProps\";\r\nimport { ThemedSelect, ThemedSelectProps } from \"./ThemedSelect\";\r\n\r\n/** Properties for [[LabeledThemedSelect]] components\r\n * @beta @deprecated
|
|
1
|
+
{"version":3,"file":"LabeledThemedSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/LabeledThemedSelect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAOjE;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EACrC,cAAc,EAAE,UAAU,EAC1B,cAAc,EAAE,UAAU,EAC1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EACvC,GAAG,UAAU,EAAE,GAAG,KAAY,CAAC;IAEjC,OAAO,CACL,+BAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CACxC,qCAAqC,EACrC,KAAK,CAAC,UAAU,IAAI,iBAAiB,EACrC,MAAM,EACN,SAAS,CACV;QACE,KAAK;YACJ,6BAAK,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU;;gBAAI,KAAK;oBAAQ;QAEhG,oBAAC,YAAY,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,KAAM,UAAU,GAAI;QAC5G,OAAO;YACN,6BAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,IAAG,OAAO,CAAO,CAEhG,CACT,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { LabeledComponentProps, MessagedComponentProps } from \"../inputs/LabeledComponentProps\";\r\nimport { ThemedSelect, ThemedSelectProps } from \"./ThemedSelect\";\r\n\r\n/** Properties for [[LabeledThemedSelect]] components\r\n * @beta @deprecated in 3.0.\r\n */\r\nexport interface LabeledThemedSelectProps extends ThemedSelectProps, LabeledComponentProps, MessagedComponentProps { }\r\n\r\n/** Dropdown wrapper that allows for additional styling and labelling\r\n * @beta @deprecated in 3.0.\r\n */\r\nexport function LabeledThemedSelect(props: LabeledThemedSelectProps) {\r\n const { label, status, className, style,\r\n inputClassName, inputStyle,\r\n labelClassName, labelStyle,\r\n message, messageClassName, messageStyle,\r\n ...otherProps } = props as any;\r\n\r\n return (\r\n <label style={style} className={classnames(\r\n \"uicore-inputs-labeled-themed-select\",\r\n props.isDisabled && \"uicore-disabled\",\r\n status,\r\n className,\r\n )}>\r\n {label &&\r\n <div className={classnames(\"uicore-label\", labelClassName)} style={labelStyle}> {label} </div>\r\n }\r\n <ThemedSelect isDisabled={props.isDisabled} className={inputClassName} styles={inputStyle} {...otherProps} />\r\n {message &&\r\n <div className={classnames(\"uicore-message\", messageClassName)} style={messageStyle}>{message}</div>\r\n }\r\n </label>\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 a Select option
|
|
7
7
|
* @public
|
|
8
|
-
* @deprecated Use SelectOption in itwinui-react instead
|
|
8
|
+
* @deprecated in 3.0. Use SelectOption in itwinui-react instead
|
|
9
9
|
*/
|
|
10
10
|
export interface SelectOption {
|
|
11
11
|
/** Label of the option. If `value` is not set when using SelectOption[], also serves as the value. */
|
|
@@ -17,7 +17,7 @@ export interface SelectOption {
|
|
|
17
17
|
}
|
|
18
18
|
/** Properties for [[Select]] component
|
|
19
19
|
* @public
|
|
20
|
-
* @deprecated Use SelectProps in itwinui-react instead
|
|
20
|
+
* @deprecated in 3.0. Use SelectProps in itwinui-react instead
|
|
21
21
|
*/
|
|
22
22
|
export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement>, CommonProps {
|
|
23
23
|
/** Options for Select dropdown.
|
|
@@ -47,7 +47,7 @@ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElemen
|
|
|
47
47
|
}
|
|
48
48
|
/** Basic select component is a wrapper for the `<select>` HTML element.
|
|
49
49
|
* @public
|
|
50
|
-
* @deprecated Use Select in itwinui-react instead
|
|
50
|
+
* @deprecated in 3.0. Use Select in itwinui-react instead
|
|
51
51
|
*/
|
|
52
52
|
export declare const Select: (props: SelectProps) => JSX.Element | null;
|
|
53
53
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -51,7 +51,7 @@ const ForwardRefSelect = React.forwardRef(function ForwardRefSelect(props, ref)
|
|
|
51
51
|
});
|
|
52
52
|
/** Basic select component is a wrapper for the `<select>` HTML element.
|
|
53
53
|
* @public
|
|
54
|
-
* @deprecated Use Select in itwinui-react instead
|
|
54
|
+
* @deprecated in 3.0. Use Select in itwinui-react instead
|
|
55
55
|
*/
|
|
56
56
|
export const Select = ForwardRefSelect;
|
|
57
57
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/core-react/select/Select.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AA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CAAC;IACzG,OAAO,CACL,gCAAQ,GAAG,EAAE,IAAI,KAAM,UAAU,EAC/B,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,UAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,EACxD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS;QAClE,eAAe;YACd,gCAAQ,SAAS,EAAC,aAAa,EAAC,QAAQ,QAAC,GAAG,EAAC,EAAE,EAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,IAAG,KAAK,CAAC,WAAW,CAAU;QAE9G,OAAO,YAAY,KAAK,CAAC,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,gCAAQ,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,IACnF,cAAc,CAAC,MAAM,CAAC,CAChB,CACV,CAAC;YACF,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAChC,gCAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IACpE,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CACtB,CACV,CAAC,CAEG,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAA+C,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\n\r\n/** Properties for a Select option\r\n * @public\r\n * @deprecated Use SelectOption in itwinui-react instead\r\n */\r\nexport interface SelectOption {\r\n /** Label of the option. If `value` is not set when using SelectOption[], also serves as the value. */\r\n label: string;\r\n /** Value of the option when using SelectOption[]. */\r\n value?: string | number | readonly string[];\r\n /** Indicates whether the option is disabled. */\r\n disabled?: boolean;\r\n}\r\n\r\n/** Properties for [[Select]] component\r\n * @public\r\n * @deprecated Use SelectProps in itwinui-react instead\r\n */\r\nexport interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement>, CommonProps {\r\n /** Options for Select dropdown.\r\n * @example\r\n * // Example of {[key: string]: (string | SelectOption)} usage:\r\n * <Select options={{\r\n * option1: \"Option 1\",\r\n * option2: \"Option 2\",\r\n * option3: {label: \"Option 3\", disabled: true},\r\n * }} />\r\n *\r\n * // Example of (string | SelectOption)[] usage:\r\n * <Select options={[\r\n * \"Option 1\",\r\n * \"Option 2\",\r\n * {label: \"Option 3\", value: \"option3\", disabled: true},\r\n * ]} />\r\n * }\r\n */\r\n options: (string | SelectOption)[] | { [key: string]: (string | SelectOption) };\r\n /** Indicates whether to set focus to the select element */\r\n setFocus?: boolean;\r\n /** Provides ability to return reference to HTMLSelectElement */\r\n ref?: React.Ref<HTMLSelectElement>;\r\n}\r\n\r\nfunction getCurrentDefaultValue(defaultValue: string | number | readonly string[] | undefined, placeholderValue: string | undefined) {\r\n if (defaultValue)\r\n return defaultValue;\r\n\r\n return placeholderValue;\r\n}\r\n\r\nfunction getOptionLabel(option: string | SelectOption): string {\r\n return (typeof option === \"string\") ? option : option.label;\r\n}\r\n\r\nfunction getOptionValue(option: string | SelectOption): string | number | readonly string[] {\r\n return (typeof option === \"string\") ? option : (undefined !== option.value ? option.value : option.label);\r\n}\r\n\r\nfunction getOptionDisabled(option: string | SelectOption): boolean | undefined {\r\n return (typeof option === \"string\") ? undefined : option.disabled;\r\n}\r\n\r\nconst ForwardRefSelect = React.forwardRef<HTMLSelectElement, SelectProps>(\r\n function ForwardRefSelect(props, ref) {\r\n const selectElement = React.useRef<HTMLSelectElement>(null);\r\n const placeholderValue = React.useRef(\"placeholder\");\r\n const isInitialMount = React.useRef(true);\r\n const refs = useRefs(selectElement, 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 if (props.setFocus && selectElement.current)\r\n selectElement.current.focus();\r\n }, [props]);\r\n\r\n React.useEffect(() => {\r\n isInitialMount.current = false;\r\n }, []);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { value: selectValue, required, options, setFocus, className, defaultValue, ...otherProps } = props; // pluck off values that will be explicitly set below\r\n const showPlaceholder = React.useMemo(() => props.placeholder && (undefined === selectValue || selectValue === placeholderValue.current) && !defaultValue, [defaultValue, selectValue, props.placeholder]);\r\n const isRequired = React.useMemo(() => showPlaceholder || required, [required, showPlaceholder]);\r\n const currentDefaultValue = React.useMemo(() => getCurrentDefaultValue(defaultValue, showPlaceholder ? placeholderValue.current : undefined), [defaultValue, showPlaceholder]);\r\n const value = (!isInitialMount.current && undefined === selectValue) ? currentDefaultValue : selectValue;\r\n return (\r\n <select ref={refs} {...otherProps}\r\n required={isRequired}\r\n className={classnames(\"uicore-inputs-select\", className)}\r\n value={value}\r\n defaultValue={value === undefined ? currentDefaultValue : undefined}>\r\n {showPlaceholder &&\r\n <option className=\"placeholder\" disabled key=\"\" value={placeholderValue.current}>{props.placeholder}</option>\r\n }\r\n {options instanceof Array ?\r\n options.map((option, index) => (\r\n <option key={index} value={getOptionValue(option)} disabled={getOptionDisabled(option)} >\r\n {getOptionLabel(option)}\r\n </option>\r\n ))\r\n :\r\n Object.keys(options).map((key) => (\r\n <option key={key} value={key} disabled={getOptionDisabled(options[key])} >\r\n {getOptionLabel(options[key])}\r\n </option>\r\n ))\r\n }\r\n </select>\r\n );\r\n }\r\n);\r\n\r\n/** Basic select component is a wrapper for the `<select>` HTML element.\r\n * @public\r\n * @deprecated Use Select in itwinui-react instead\r\n */\r\nexport const Select: (props: SelectProps) => JSX.Element | null = ForwardRefSelect;\r\n"]}
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/core-react/select/Select.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4CAA4C;AAE5C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA4CjD,SAAS,sBAAsB,CAAC,YAA6D,EAAE,gBAAoC;IACjI,IAAI,YAAY;QACd,OAAO,YAAY,CAAC;IAEtB,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,MAA6B;IACnD,OAAO,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AAC9D,CAAC;AAED,SAAS,cAAc,CAAC,MAA6B;IACnD,OAAO,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5G,CAAC;AAED,SAAS,iBAAiB,CAAC,MAA6B;IACtD,OAAO,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;AACpE,CAAC;AAED,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACv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Ac,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CACtB,CACV,CAAC,CAEG,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAA+C,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\n\r\n/** Properties for a Select option\r\n * @public\r\n * @deprecated in 3.0. Use SelectOption in itwinui-react instead\r\n */\r\nexport interface SelectOption {\r\n /** Label of the option. If `value` is not set when using SelectOption[], also serves as the value. */\r\n label: string;\r\n /** Value of the option when using SelectOption[]. */\r\n value?: string | number | readonly string[];\r\n /** Indicates whether the option is disabled. */\r\n disabled?: boolean;\r\n}\r\n\r\n/** Properties for [[Select]] component\r\n * @public\r\n * @deprecated in 3.0. Use SelectProps in itwinui-react instead\r\n */\r\nexport interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement>, CommonProps {\r\n /** Options for Select dropdown.\r\n * @example\r\n * // Example of {[key: string]: (string | SelectOption)} usage:\r\n * <Select options={{\r\n * option1: \"Option 1\",\r\n * option2: \"Option 2\",\r\n * option3: {label: \"Option 3\", disabled: true},\r\n * }} />\r\n *\r\n * // Example of (string | SelectOption)[] usage:\r\n * <Select options={[\r\n * \"Option 1\",\r\n * \"Option 2\",\r\n * {label: \"Option 3\", value: \"option3\", disabled: true},\r\n * ]} />\r\n * }\r\n */\r\n options: (string | SelectOption)[] | { [key: string]: (string | SelectOption) };\r\n /** Indicates whether to set focus to the select element */\r\n setFocus?: boolean;\r\n /** Provides ability to return reference to HTMLSelectElement */\r\n ref?: React.Ref<HTMLSelectElement>;\r\n}\r\n\r\nfunction getCurrentDefaultValue(defaultValue: string | number | readonly string[] | undefined, placeholderValue: string | undefined) {\r\n if (defaultValue)\r\n return defaultValue;\r\n\r\n return placeholderValue;\r\n}\r\n\r\nfunction getOptionLabel(option: string | SelectOption): string {\r\n return (typeof option === \"string\") ? option : option.label;\r\n}\r\n\r\nfunction getOptionValue(option: string | SelectOption): string | number | readonly string[] {\r\n return (typeof option === \"string\") ? option : (undefined !== option.value ? option.value : option.label);\r\n}\r\n\r\nfunction getOptionDisabled(option: string | SelectOption): boolean | undefined {\r\n return (typeof option === \"string\") ? undefined : option.disabled;\r\n}\r\n\r\nconst ForwardRefSelect = React.forwardRef<HTMLSelectElement, SelectProps>(\r\n function ForwardRefSelect(props, ref) {\r\n const selectElement = React.useRef<HTMLSelectElement>(null);\r\n const placeholderValue = React.useRef(\"placeholder\");\r\n const isInitialMount = React.useRef(true);\r\n const refs = useRefs(selectElement, 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 if (props.setFocus && selectElement.current)\r\n selectElement.current.focus();\r\n }, [props]);\r\n\r\n React.useEffect(() => {\r\n isInitialMount.current = false;\r\n }, []);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { value: selectValue, required, options, setFocus, className, defaultValue, ...otherProps } = props; // pluck off values that will be explicitly set below\r\n const showPlaceholder = React.useMemo(() => props.placeholder && (undefined === selectValue || selectValue === placeholderValue.current) && !defaultValue, [defaultValue, selectValue, props.placeholder]);\r\n const isRequired = React.useMemo(() => showPlaceholder || required, [required, showPlaceholder]);\r\n const currentDefaultValue = React.useMemo(() => getCurrentDefaultValue(defaultValue, showPlaceholder ? placeholderValue.current : undefined), [defaultValue, showPlaceholder]);\r\n const value = (!isInitialMount.current && undefined === selectValue) ? currentDefaultValue : selectValue;\r\n return (\r\n <select ref={refs} {...otherProps}\r\n required={isRequired}\r\n className={classnames(\"uicore-inputs-select\", className)}\r\n value={value}\r\n defaultValue={value === undefined ? currentDefaultValue : undefined}>\r\n {showPlaceholder &&\r\n <option className=\"placeholder\" disabled key=\"\" value={placeholderValue.current}>{props.placeholder}</option>\r\n }\r\n {options instanceof Array ?\r\n options.map((option, index) => (\r\n <option key={index} value={getOptionValue(option)} disabled={getOptionDisabled(option)} >\r\n {getOptionLabel(option)}\r\n </option>\r\n ))\r\n :\r\n Object.keys(options).map((key) => (\r\n <option key={key} value={key} disabled={getOptionDisabled(options[key])} >\r\n {getOptionLabel(options[key])}\r\n </option>\r\n ))\r\n }\r\n </select>\r\n );\r\n }\r\n);\r\n\r\n/** Basic select component is a wrapper for the `<select>` HTML element.\r\n * @public\r\n * @deprecated in 3.0. Use Select in itwinui-react instead\r\n */\r\nexport const Select: (props: SelectProps) => JSX.Element | null = ForwardRefSelect;\r\n"]}
|
|
@@ -15,7 +15,7 @@ declare type FormatOptionLabelMeta = {
|
|
|
15
15
|
};
|
|
16
16
|
/** OptionType for react-select 2.0 and above. which only accepts pairs of value & label strings
|
|
17
17
|
* @beta
|
|
18
|
-
* @deprecated
|
|
18
|
+
* @deprecated in 3.0. Use Select from @itwin/itwinui-react
|
|
19
19
|
*/
|
|
20
20
|
export interface OptionType {
|
|
21
21
|
value: any;
|
|
@@ -23,12 +23,12 @@ export interface OptionType {
|
|
|
23
23
|
}
|
|
24
24
|
/** OptionsType to match label/value pair OptionType
|
|
25
25
|
* @beta
|
|
26
|
-
* @deprecated
|
|
26
|
+
* @deprecated in 3.0. Use Select from @itwin/itwinui-react
|
|
27
27
|
*/
|
|
28
28
|
export declare type OptionsType = Array<OptionType>;
|
|
29
29
|
/** ThemedSelectProps to control specific features of ThemedSelect
|
|
30
30
|
* @beta
|
|
31
|
-
* @deprecated
|
|
31
|
+
* @deprecated in 3.0. Use Select from @itwin/itwinui-react
|
|
32
32
|
*/
|
|
33
33
|
export declare type ThemedSelectProps = {
|
|
34
34
|
"aria-label"?: string;
|
|
@@ -97,7 +97,7 @@ export declare type ThemedSelectProps = {
|
|
|
97
97
|
};
|
|
98
98
|
/** ThemedSelect is a wrapper for react-select with iTwin.js UI theming applied
|
|
99
99
|
* @beta
|
|
100
|
-
* @deprecated
|
|
100
|
+
* @deprecated in 3.0. Use Select from @itwin/itwinui-react
|
|
101
101
|
*/
|
|
102
102
|
export declare function ThemedSelect(props: ThemedSelectProps): JSX.Element;
|
|
103
103
|
export {};
|
|
@@ -19,7 +19,7 @@ const ThemedMenu = (props) => {
|
|
|
19
19
|
};
|
|
20
20
|
/** ThemedSelect is a wrapper for react-select with iTwin.js UI theming applied
|
|
21
21
|
* @beta
|
|
22
|
-
* @deprecated
|
|
22
|
+
* @deprecated in 3.0. Use Select from @itwin/itwinui-react
|
|
23
23
|
*/
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
25
|
export function ThemedSelect(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemedSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/ThemedSelect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAKrD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAqLlD,MAAM,UAAU,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,oBAAC,UAAU,CAAC,IAAI,OAAK,KAAK,GAAI,CAC1B,CACP,CAAC;AACJ,CAAC,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cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,YAAY,EAC9B,MAAM,EAAE,YAAY;YACpB,gEAAgE;YAChE,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,KACjD,UAAU,GACd,CACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\nimport \"./themed-select.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport Component, { components } from \"react-select\";\r\nimport { formatGroupLabel, getOptionLabel, getOptionValue } from \"react-select/src/builtins\";\r\nimport { SelectComponentsConfig } from \"react-select/src/components/index\";\r\nimport { MenuProps } from \"react-select/src/components/Menu\";\r\nimport { ActionMeta, FocusEventHandler, InputActionMeta, KeyboardEventHandler, ValueType } from \"react-select/src/types\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { getCssVariableAsNumber } from \"../utils/getCssVariable\";\r\nimport { getParentSelector } from \"./modalHelper\";\r\n\r\n// cspell:ignore reactselect builtins\r\n\r\n/* eslint-disable @typescript-eslint/no-shadow, @typescript-eslint/consistent-type-definitions, @typescript-eslint/array-type */\r\ntype FormatOptionLabelContext = \"menu\" | \"value\";\r\ntype FormatOptionLabelMeta = {\r\n context: FormatOptionLabelContext;\r\n inputValue: string;\r\n selectValue: ValueType<OptionType>;\r\n};\r\n\r\n/** OptionType for react-select 2.0 and above. which only accepts pairs of value & label strings\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\nexport interface OptionType {\r\n value: any;\r\n label: string;\r\n}\r\n/** OptionsType to match label/value pair OptionType\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n*/\r\nexport type OptionsType = Array<OptionType>;\r\n\r\n/** ThemedSelectProps to control specific features of ThemedSelect\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\nexport type ThemedSelectProps = {\r\n /* Aria label (for assistive tech) */\r\n \"aria-label\"?: string;\r\n /* HTML ID of an element that should be used as the label (for assistive tech) */\r\n \"aria-labelledby\"?: string;\r\n /* Focus the control when it is mounted */\r\n autoFocus?: boolean;\r\n /* Remove the currently focused option when the user presses backspace */\r\n backspaceRemovesValue?: boolean;\r\n /* Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */\r\n blurInputOnSelect?: boolean;\r\n /* When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */\r\n captureMenuScroll?: boolean;\r\n /* Sets a className attribute on the outer component */\r\n className?: string;\r\n /* Close the select menu when the user selects an option */\r\n closeMenuOnSelect?: boolean;\r\n /*\r\n If `true`, close the select menu when the user scrolls the document/body.\r\n\r\n If a function, takes a standard javascript `ScrollEvent` you return a boolean:\r\n\r\n `true` => The menu closes\r\n\r\n `false` => The menu stays open\r\n\r\n This is useful when you have a scrollable modal and want to portal the menu out,\r\n but want to avoid graphical issues.\r\n */\r\n closeMenuOnScroll?: boolean | EventListener;\r\n /*\r\n This complex object includes all the compositional components that are used\r\n in `react-select`. If you wish to overwrite a component, pass in an object\r\n with the appropriate namespace.\r\n\r\n If you only wish to restyle a component, we recommend using the `styles` prop\r\n instead. For a list of the components that can be passed in, and the shape\r\n that will be passed to them, see [the components docs](/components)\r\n */\r\n components?: SelectComponentsConfig<OptionType>;\r\n /* Whether the value of the select, e.g. SingleValue, should be displayed in the control. */\r\n controlShouldRenderValue?: boolean;\r\n /* Ff true, the menu is open immediately */\r\n defaultMenuIsOpen?: boolean;\r\n /* Value set in the control by default */\r\n defaultValue?: ValueType<OptionType>;\r\n /** Provides ability to return reference to the outer HTMLDivElement */\r\n divRef?: React.Ref<HTMLDivElement>;\r\n /* Clear all values when the user presses escape AND the menu is closed */\r\n escapeClearsValue?: boolean;\r\n /* Custom method to filter whether an option should be displayed in the menu */\r\n filterOption?: ((\r\n option: OptionType,\r\n rawInput: string,\r\n ) => boolean) | null;\r\n /*\r\n Formats group labels in the menu as React components\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n*/\r\n formatGroupLabel?: typeof formatGroupLabel;\r\n /* Formats option labels in the menu and control as React components */\r\n formatOptionLabel?: (optionType: OptionType, formatLabelMeta: FormatOptionLabelMeta) => React.ReactNode;\r\n /* Resolves option data to a string to be displayed as the label by components */\r\n getOptionLabel?: typeof getOptionLabel;\r\n /* Resolves option data to a string to compare options and specify value attributes */\r\n getOptionValue?: typeof getOptionValue;\r\n /* Hide the selected option from the menu */\r\n hideSelectedOptions?: boolean;\r\n /* The id to set on the SelectContainer component. */\r\n id?: string;\r\n /* The value of the search input */\r\n inputValue?: string;\r\n /* The id of the search input */\r\n inputId?: string;\r\n /* Define an id prefix for the select components e.g. {your-id}-value */\r\n instanceId?: number | string;\r\n /* Is the select value clearable */\r\n isClearable?: boolean;\r\n /* Is the select disabled */\r\n isDisabled?: boolean;\r\n /* Is the select in a state of loading (async) */\r\n isLoading?: boolean;\r\n /*\r\n Override the built-in logic to detect whether an option is disabled\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n */\r\n isOptionDisabled?: (option: OptionType, options: OptionsType) => boolean | false;\r\n /* Support multiple selected options */\r\n isMulti?: boolean;\r\n /* If true, menu will not be opened in a portal */\r\n isMenuFixed?: boolean;\r\n /* Is the select direction right-to-left */\r\n isRtl?: boolean;\r\n /* Whether to enable search functionality */\r\n isSearchable?: boolean;\r\n /* Minimum height of the menu before flipping */\r\n minMenuHeight?: number;\r\n /* Maximum height of the menu before scrolling */\r\n maxMenuHeight?: number;\r\n /* Whether the menu is open */\r\n menuIsOpen?: boolean;\r\n /* Whether to block scroll events when the menu is open */\r\n menuShouldBlockScroll?: boolean;\r\n /* Whether the menu should be scrolled into view when it opens */\r\n menuShouldScrollIntoView?: boolean;\r\n /* Name of the HTML Input (optional - without this, no input will be rendered) */\r\n name?: string;\r\n /* Text to display when there are no options */\r\n noOptionsMessage?: (obj: { inputValue: string }) => string | null;\r\n /* Handle blur events on the control */\r\n onBlur?: FocusEventHandler;\r\n /* Handle change events on the select */\r\n onChange?: (value: ValueType<OptionType>, action: ActionMeta<OptionType>) => void;\r\n /* Handle focus events on the control */\r\n onFocus?: FocusEventHandler;\r\n /* Handle change events on the input */\r\n onInputChange?: (newValue: string, actionMeta?: InputActionMeta) => void;\r\n /* Handle key down events on the select */\r\n onKeyDown?: KeyboardEventHandler;\r\n /* Handle the menu opening */\r\n onMenuOpen?: () => void;\r\n /* Handle the menu closing */\r\n onMenuClose?: () => void;\r\n /* Fired when the user scrolls to the top of the menu */\r\n onMenuScrollToTop?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Fired when the user scrolls to the bottom of the menu */\r\n onMenuScrollToBottom?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Allows control of whether the menu is opened when the Select is focused */\r\n openMenuOnFocus?: boolean;\r\n /* Allows control of whether the menu is opened when the Select is clicked */\r\n openMenuOnClick?: boolean;\r\n /* Array of options that populate the select menu */\r\n options: OptionsType;\r\n /* Number of options to jump in menu when page{up|down} keys are used */\r\n pageSize?: number;\r\n /* Placeholder for the select value */\r\n placeholder?: string;\r\n /** Provides ability to return reference to the ThemedSelect */\r\n ref?: React.Ref<Component>;\r\n /* Sets additional styling */\r\n styles?: React.CSSProperties;\r\n /* Sets the tabIndex attribute on the input */\r\n tabIndex?: string;\r\n /* Select the currently focused option when the user presses tab */\r\n tabSelectsValue?: boolean;\r\n /* The value of the select; reflected by the selected option */\r\n value?: ValueType<OptionType>;\r\n};\r\n\r\nconst ThemedMenu = (props: MenuProps<any>) => { // eslint-disable-line @typescript-eslint/naming-convention\r\n return (\r\n <div className=\"uicore-reactSelectTop\">\r\n <components.Menu {...props} />\r\n </div>\r\n );\r\n};\r\n/** ThemedSelect is a wrapper for react-select with iTwin.js UI theming applied\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function ThemedSelect(props: ThemedSelectProps) {\r\n const noOptionLabel = React.useRef<string | undefined>();\r\n const defaultOptionMessage = React.useCallback(() => {\r\n if (!noOptionLabel.current) {\r\n noOptionLabel.current = UiCore.translate(\"reactselect.noSelectOption\");\r\n }\r\n return noOptionLabel.current;\r\n }, [noOptionLabel]);\r\n const noOptionFunction = props.noOptionsMessage ?? defaultOptionMessage;\r\n const selectClassName = classnames(\"uicore-reactSelectTop\", props.className);\r\n const portalTarget = !!props.isMenuFixed ? undefined : getParentSelector();\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n classNamePrefix, className, noOptionsMessage, menuPortalTarget, isMenuFixed, styles, components, divRef, ref,\r\n // eslint-disable-next-line comma-dangle\r\n ...otherProps // pass-through props\r\n } = props as any;\r\n const selectStyles = {\r\n ...props.styles,\r\n menuPortal: (base: React.CSSProperties) => ({ ...base, zIndex }),\r\n };\r\n\r\n const zIndex = getCssVariableAsNumber(\"--uicore-z-index-dialog-popup\");\r\n return (\r\n <div className={selectClassName} ref={divRef}>\r\n <Component\r\n ref={ref}\r\n classNamePrefix=\"react-select\"\r\n noOptionsMessage={noOptionFunction}\r\n menuPortalTarget={portalTarget}\r\n styles={selectStyles}\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n components={{ Menu: ThemedMenu, ...props.components }}\r\n {...otherProps}\r\n />\r\n </div>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ThemedSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/ThemedSelect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,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,GAAG;IAC5G,wCAAwC;IACxC,GAAG,UAAU,CAAC,qBAAqB;MACpC,GAAG,KAAY,CAAC;IACjB,MAAM,YAAY,GAAG;QACnB,GAAG,KAAK,CAAC,MAAM;QACf,UAAU,EAAE,CAAC,IAAyB,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;KACjE,CAAC;IAEF,MAAM,MAAM,GAAG,sBAAsB,CAAC,+BAA+B,CAAC,CAAC;IACvE,OAAO,CACL,6BAAK,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM;QAC1C,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,eAAe,EAAC,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,YAAY,EAC9B,MAAM,EAAE,YAAY;YACpB,gEAAgE;YAChE,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,KACjD,UAAU,GACd,CACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\nimport \"./themed-select.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport Component, { components } from \"react-select\";\r\nimport { formatGroupLabel, getOptionLabel, getOptionValue } from \"react-select/src/builtins\";\r\nimport { SelectComponentsConfig } from \"react-select/src/components/index\";\r\nimport { MenuProps } from \"react-select/src/components/Menu\";\r\nimport { ActionMeta, FocusEventHandler, InputActionMeta, KeyboardEventHandler, ValueType } from \"react-select/src/types\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { getCssVariableAsNumber } from \"../utils/getCssVariable\";\r\nimport { getParentSelector } from \"./modalHelper\";\r\n\r\n// cspell:ignore reactselect builtins\r\n\r\n/* eslint-disable @typescript-eslint/no-shadow, @typescript-eslint/consistent-type-definitions, @typescript-eslint/array-type */\r\ntype FormatOptionLabelContext = \"menu\" | \"value\";\r\ntype FormatOptionLabelMeta = {\r\n context: FormatOptionLabelContext;\r\n inputValue: string;\r\n selectValue: ValueType<OptionType>;\r\n};\r\n\r\n/** OptionType for react-select 2.0 and above. which only accepts pairs of value & label strings\r\n * @beta\r\n * @deprecated in 3.0. Use Select from @itwin/itwinui-react\r\n */\r\nexport interface OptionType {\r\n value: any;\r\n label: string;\r\n}\r\n/** OptionsType to match label/value pair OptionType\r\n * @beta\r\n * @deprecated in 3.0. Use Select from @itwin/itwinui-react\r\n*/\r\nexport type OptionsType = Array<OptionType>;\r\n\r\n/** ThemedSelectProps to control specific features of ThemedSelect\r\n * @beta\r\n * @deprecated in 3.0. Use Select from @itwin/itwinui-react\r\n */\r\nexport type ThemedSelectProps = {\r\n /* Aria label (for assistive tech) */\r\n \"aria-label\"?: string;\r\n /* HTML ID of an element that should be used as the label (for assistive tech) */\r\n \"aria-labelledby\"?: string;\r\n /* Focus the control when it is mounted */\r\n autoFocus?: boolean;\r\n /* Remove the currently focused option when the user presses backspace */\r\n backspaceRemovesValue?: boolean;\r\n /* Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */\r\n blurInputOnSelect?: boolean;\r\n /* When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */\r\n captureMenuScroll?: boolean;\r\n /* Sets a className attribute on the outer component */\r\n className?: string;\r\n /* Close the select menu when the user selects an option */\r\n closeMenuOnSelect?: boolean;\r\n /*\r\n If `true`, close the select menu when the user scrolls the document/body.\r\n\r\n If a function, takes a standard javascript `ScrollEvent` you return a boolean:\r\n\r\n `true` => The menu closes\r\n\r\n `false` => The menu stays open\r\n\r\n This is useful when you have a scrollable modal and want to portal the menu out,\r\n but want to avoid graphical issues.\r\n */\r\n closeMenuOnScroll?: boolean | EventListener;\r\n /*\r\n This complex object includes all the compositional components that are used\r\n in `react-select`. If you wish to overwrite a component, pass in an object\r\n with the appropriate namespace.\r\n\r\n If you only wish to restyle a component, we recommend using the `styles` prop\r\n instead. For a list of the components that can be passed in, and the shape\r\n that will be passed to them, see [the components docs](/components)\r\n */\r\n components?: SelectComponentsConfig<OptionType>;\r\n /* Whether the value of the select, e.g. SingleValue, should be displayed in the control. */\r\n controlShouldRenderValue?: boolean;\r\n /* Ff true, the menu is open immediately */\r\n defaultMenuIsOpen?: boolean;\r\n /* Value set in the control by default */\r\n defaultValue?: ValueType<OptionType>;\r\n /** Provides ability to return reference to the outer HTMLDivElement */\r\n divRef?: React.Ref<HTMLDivElement>;\r\n /* Clear all values when the user presses escape AND the menu is closed */\r\n escapeClearsValue?: boolean;\r\n /* Custom method to filter whether an option should be displayed in the menu */\r\n filterOption?: ((\r\n option: OptionType,\r\n rawInput: string,\r\n ) => boolean) | null;\r\n /*\r\n Formats group labels in the menu as React components\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n*/\r\n formatGroupLabel?: typeof formatGroupLabel;\r\n /* Formats option labels in the menu and control as React components */\r\n formatOptionLabel?: (optionType: OptionType, formatLabelMeta: FormatOptionLabelMeta) => React.ReactNode;\r\n /* Resolves option data to a string to be displayed as the label by components */\r\n getOptionLabel?: typeof getOptionLabel;\r\n /* Resolves option data to a string to compare options and specify value attributes */\r\n getOptionValue?: typeof getOptionValue;\r\n /* Hide the selected option from the menu */\r\n hideSelectedOptions?: boolean;\r\n /* The id to set on the SelectContainer component. */\r\n id?: string;\r\n /* The value of the search input */\r\n inputValue?: string;\r\n /* The id of the search input */\r\n inputId?: string;\r\n /* Define an id prefix for the select components e.g. {your-id}-value */\r\n instanceId?: number | string;\r\n /* Is the select value clearable */\r\n isClearable?: boolean;\r\n /* Is the select disabled */\r\n isDisabled?: boolean;\r\n /* Is the select in a state of loading (async) */\r\n isLoading?: boolean;\r\n /*\r\n Override the built-in logic to detect whether an option is disabled\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n */\r\n isOptionDisabled?: (option: OptionType, options: OptionsType) => boolean | false;\r\n /* Support multiple selected options */\r\n isMulti?: boolean;\r\n /* If true, menu will not be opened in a portal */\r\n isMenuFixed?: boolean;\r\n /* Is the select direction right-to-left */\r\n isRtl?: boolean;\r\n /* Whether to enable search functionality */\r\n isSearchable?: boolean;\r\n /* Minimum height of the menu before flipping */\r\n minMenuHeight?: number;\r\n /* Maximum height of the menu before scrolling */\r\n maxMenuHeight?: number;\r\n /* Whether the menu is open */\r\n menuIsOpen?: boolean;\r\n /* Whether to block scroll events when the menu is open */\r\n menuShouldBlockScroll?: boolean;\r\n /* Whether the menu should be scrolled into view when it opens */\r\n menuShouldScrollIntoView?: boolean;\r\n /* Name of the HTML Input (optional - without this, no input will be rendered) */\r\n name?: string;\r\n /* Text to display when there are no options */\r\n noOptionsMessage?: (obj: { inputValue: string }) => string | null;\r\n /* Handle blur events on the control */\r\n onBlur?: FocusEventHandler;\r\n /* Handle change events on the select */\r\n onChange?: (value: ValueType<OptionType>, action: ActionMeta<OptionType>) => void;\r\n /* Handle focus events on the control */\r\n onFocus?: FocusEventHandler;\r\n /* Handle change events on the input */\r\n onInputChange?: (newValue: string, actionMeta?: InputActionMeta) => void;\r\n /* Handle key down events on the select */\r\n onKeyDown?: KeyboardEventHandler;\r\n /* Handle the menu opening */\r\n onMenuOpen?: () => void;\r\n /* Handle the menu closing */\r\n onMenuClose?: () => void;\r\n /* Fired when the user scrolls to the top of the menu */\r\n onMenuScrollToTop?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Fired when the user scrolls to the bottom of the menu */\r\n onMenuScrollToBottom?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Allows control of whether the menu is opened when the Select is focused */\r\n openMenuOnFocus?: boolean;\r\n /* Allows control of whether the menu is opened when the Select is clicked */\r\n openMenuOnClick?: boolean;\r\n /* Array of options that populate the select menu */\r\n options: OptionsType;\r\n /* Number of options to jump in menu when page{up|down} keys are used */\r\n pageSize?: number;\r\n /* Placeholder for the select value */\r\n placeholder?: string;\r\n /** Provides ability to return reference to the ThemedSelect */\r\n ref?: React.Ref<Component>;\r\n /* Sets additional styling */\r\n styles?: React.CSSProperties;\r\n /* Sets the tabIndex attribute on the input */\r\n tabIndex?: string;\r\n /* Select the currently focused option when the user presses tab */\r\n tabSelectsValue?: boolean;\r\n /* The value of the select; reflected by the selected option */\r\n value?: ValueType<OptionType>;\r\n};\r\n\r\nconst ThemedMenu = (props: MenuProps<any>) => { // eslint-disable-line @typescript-eslint/naming-convention\r\n return (\r\n <div className=\"uicore-reactSelectTop\">\r\n <components.Menu {...props} />\r\n </div>\r\n );\r\n};\r\n/** ThemedSelect is a wrapper for react-select with iTwin.js UI theming applied\r\n * @beta\r\n * @deprecated in 3.0. Use Select from @itwin/itwinui-react\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function ThemedSelect(props: ThemedSelectProps) {\r\n const noOptionLabel = React.useRef<string | undefined>();\r\n const defaultOptionMessage = React.useCallback(() => {\r\n if (!noOptionLabel.current) {\r\n noOptionLabel.current = UiCore.translate(\"reactselect.noSelectOption\");\r\n }\r\n return noOptionLabel.current;\r\n }, [noOptionLabel]);\r\n const noOptionFunction = props.noOptionsMessage ?? defaultOptionMessage;\r\n const selectClassName = classnames(\"uicore-reactSelectTop\", props.className);\r\n const portalTarget = !!props.isMenuFixed ? undefined : getParentSelector();\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n classNamePrefix, className, noOptionsMessage, menuPortalTarget, isMenuFixed, styles, components, divRef, ref,\r\n // eslint-disable-next-line comma-dangle\r\n ...otherProps // pass-through props\r\n } = props as any;\r\n const selectStyles = {\r\n ...props.styles,\r\n menuPortal: (base: React.CSSProperties) => ({ ...base, zIndex }),\r\n };\r\n\r\n const zIndex = getCssVariableAsNumber(\"--uicore-z-index-dialog-popup\");\r\n return (\r\n <div className={selectClassName} ref={divRef}>\r\n <Component\r\n ref={ref}\r\n classNamePrefix=\"react-select\"\r\n noOptionsMessage={noOptionFunction}\r\n menuPortalTarget={portalTarget}\r\n styles={selectStyles}\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n components={{ Menu: ThemedMenu, ...props.components }}\r\n {...otherProps}\r\n />\r\n </div>\r\n );\r\n}\r\n"]}
|
|
@@ -74,7 +74,7 @@ export interface SliderProps extends CommonProps {
|
|
|
74
74
|
/**
|
|
75
75
|
* Slider React component displays a range slider.
|
|
76
76
|
* @public
|
|
77
|
-
* @deprecated Use Slider in itwinui-react instead
|
|
77
|
+
* @deprecated in 3.0. Use Slider in itwinui-react instead
|
|
78
78
|
*/
|
|
79
79
|
export declare function Slider(props: SliderProps): JSX.Element;
|
|
80
80
|
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -13,7 +13,7 @@ import { BodyText } from "../text/BodyText";
|
|
|
13
13
|
/**
|
|
14
14
|
* Slider React component displays a range slider.
|
|
15
15
|
* @public
|
|
16
|
-
* @deprecated Use Slider in itwinui-react instead
|
|
16
|
+
* @deprecated in 3.0. Use Slider in itwinui-react instead
|
|
17
17
|
*/
|
|
18
18
|
export function Slider(props) {
|
|
19
19
|
const { className, style, min, max, values, step, mode, formatMin, formatMax, onChange, onUpdate, showTicks, showTickLabels, formatTick, getTickCount, getTickValues, includeTicksInWidth, reversed, disabled, showMinMax, minImage, maxImage, showTooltip, tooltipBelow, formatTooltip, } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../../src/core-react/slider/Slider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC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,EAAE,QAAQ,EAClB,QAAQ,EAAC,EAAE,EACX,QAAQ,EAAC,EAAE,EACX,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB;QACD,UAAU;YACT,oBAAC,MAAM,IAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAC,iBAAiB,EAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAI,CAEjF,CACP,CAAC;AACJ,CAAC;AAUD,kCAAkC;AAClC,SAAS,MAAM,CAAC,KAAkB;IAChC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC/C,IAAI,OAAgC,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAElE,IAAI,KAAK;QACP,OAAO,GAAG,0CAAG,KAAK,CAAI,CAAC;;QAEvB,OAAO,GAAG,oBAAC,QAAQ,IAAC,SAAS,EAAC,oBAAoB,iBAAc,MAAM,IAAG,YAAY,CAAY,CAAC;IAEpG,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Slider\r\n */\r\n\r\nimport \"./Slider.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Slider as ItwinSlider } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { BodyText } from \"../text/BodyText\";\r\n\r\n// cspell:ignore pushable\r\n\r\n/** Properties for [[Slider]] component\r\n * @public\r\n */\r\nexport interface SliderProps extends CommonProps {\r\n /** Values to set Slider to initially */\r\n values: number[];\r\n /** Minimum value */\r\n min: number;\r\n /** Maximum value */\r\n max: number;\r\n /** Format the min display value */\r\n formatMin?: (value: number) => string;\r\n /** Format the max display value */\r\n formatMax?: (value: number) => string;\r\n\r\n /** Step value. Default is 0.1. */\r\n step?: number;\r\n /** The interaction mode. Default is 1. Possible values:\r\n * 1 - allows handles to cross each other.\r\n * 2 - keeps the sliders from crossing and separated by a step.\r\n */\r\n mode?: number | (() => number);\r\n /** Indicates whether the display of the Slider values is reversed. */\r\n reversed?: boolean;\r\n /** Indicates whether the Slider is disabled. */\r\n disabled?: boolean;\r\n /** Indicates whether to compensate for the tick marks when determining the width. */\r\n includeTicksInWidth?: boolean;\r\n\r\n /** Indicates whether to show tooltip with the value. The tooltip will be positioned above the Slider, by default. */\r\n showTooltip?: boolean;\r\n /** Indicates whether the tooltip should show below the Slider instead of above. */\r\n tooltipBelow?: boolean;\r\n /** Format a value for the tooltip */\r\n formatTooltip?: (value: number) => string;\r\n\r\n /** Indicates whether to show min & max values to the left & right of the Slider. */\r\n showMinMax?: boolean;\r\n /** Image to show for min. */\r\n minImage?: React.ReactNode;\r\n /** Image to show for max. */\r\n maxImage?: React.ReactNode;\r\n\r\n /** Indicates whether to show tick marks under the Slider. */\r\n showTicks?: boolean;\r\n /** Indicates whether to show tick labels under the tick marks. */\r\n showTickLabels?: boolean;\r\n /** Format a tick mark value */\r\n formatTick?: (tick: number) => string;\r\n /** Function to get the tick count. The default tick count is 10. */\r\n getTickCount?: () => number;\r\n /** Function to get the tick values. This overrides the tick count from getTickCount.\r\n * Use this prop if you want to specify your own tick values instead of ticks generated by the slider.\r\n * The numbers should be valid numbers in the domain and correspond to the step value.\r\n * Invalid values will be coerced to the closet matching value in the domain.\r\n */\r\n getTickValues?: () => number[];\r\n\r\n /** Listens for value changes.\r\n * Triggered when the value of the slider has changed. This will receive changes at\r\n * the end of a slide as well as changes from clicks on rails and tracks.\r\n */\r\n onChange?: (values: ReadonlyArray<number>) => void;\r\n /** Listens for value updates.\r\n * Called with the values at each update (caution: high-volume updates when dragging).\r\n */\r\n onUpdate?: (values: ReadonlyArray<number>) => void;\r\n /** No longer available use onUpdate. */\r\n onSlideStart?: (values: ReadonlyArray<number>) => void;\r\n /** No longer available use onChange. */\r\n onSlideEnd?: (values: ReadonlyArray<number>) => void;\r\n}\r\n\r\n/**\r\n * Slider React component displays a range slider.\r\n * @public\r\n * @deprecated Use Slider in itwinui-react instead\r\n */\r\nexport function Slider(props: SliderProps) {\r\n const { className, style, min, max, values, step, mode,\r\n formatMin, formatMax,\r\n onChange, onUpdate,\r\n showTicks, showTickLabels, formatTick, getTickCount, getTickValues, includeTicksInWidth,\r\n reversed, disabled,\r\n showMinMax, minImage, maxImage,\r\n showTooltip, tooltipBelow, formatTooltip,\r\n } = props;\r\n\r\n const containerClassNames = classnames(\r\n \"core-slider-container\",\r\n className,\r\n disabled && \"core-disabled\",\r\n showTickLabels && \"core-slider-tickLabels\",\r\n includeTicksInWidth && \"core-slider-includeTicksInWidth\",\r\n );\r\n const sliderClassNames = classnames(\r\n \"core-slider\",\r\n showMinMax && \"core-slider-minMax\",\r\n );\r\n\r\n const internalFormatTooltip = React.useCallback((value: number) => {\r\n if (formatTooltip)\r\n return formatTooltip(value);\r\n\r\n const actualStep = Math.abs(step ?? 1);\r\n\r\n if (Number.isInteger(actualStep))\r\n return value.toFixed(0);\r\n\r\n const stepString = actualStep.toString();\r\n const decimalIndex = stepString.indexOf(\".\");\r\n const numDecimals = actualStep.toString().length - (decimalIndex + 1);\r\n return value.toFixed(numDecimals);\r\n }, [formatTooltip, step]);\r\n\r\n const tooltipProps = React.useCallback((_index: number, val: number) => {\r\n const content = internalFormatTooltip(val);\r\n if (!showTooltip)\r\n return { visible: false };\r\n return { placement: tooltipBelow ? \"bottom\" : \"top\", content } as const;\r\n }, [internalFormatTooltip, showTooltip, tooltipBelow]);\r\n\r\n const tickLabels = React.useMemo(() => {\r\n let ticks: string[] | undefined;\r\n\r\n if (showTicks) {\r\n const count = getTickCount ? getTickCount() : 0;\r\n if (count) {\r\n ticks = [];\r\n const increment = (max - min) / count;\r\n for (let i = 0; i <= count; i++) {\r\n const value = (i * increment) + min;\r\n if (showTickLabels) {\r\n const label = formatTick ? formatTick(value) : internalFormatTooltip(value);\r\n ticks.push(label);\r\n } else {\r\n ticks.push(\"\");\r\n }\r\n }\r\n } else /* istanbul ignore else */ if (getTickValues) {\r\n return getTickValues().map((val: number) => formatTick ? formatTick(val) : internalFormatTooltip(val));\r\n }\r\n }\r\n return ticks;\r\n }, [formatTick, getTickCount, getTickValues, internalFormatTooltip, max, min, showTickLabels, showTicks]);\r\n\r\n const thumbMode = React.useMemo(() => {\r\n let inMode = 1;\r\n if (typeof mode === \"function\")\r\n inMode = mode();\r\n\r\n return 1 === inMode ? \"allow-crossing\" : \"inhibit-crossing\";\r\n }, [mode]);\r\n\r\n return (\r\n <div className={containerClassNames} style={style}>\r\n {showMinMax &&\r\n <MinMax value={min} testId=\"core-slider-min\" image={minImage} format={formatMin} />\r\n }\r\n <ItwinSlider\r\n className={sliderClassNames}\r\n values={values}\r\n min={min}\r\n max={max}\r\n step={step}\r\n thumbMode={thumbMode}\r\n trackDisplayMode={!reversed ? \"auto\" : \"odd-segments\"\r\n }\r\n disabled={disabled}\r\n minLabel=\"\"\r\n maxLabel=\"\"\r\n tooltipProps={tooltipProps}\r\n tickLabels={tickLabels}\r\n onChange={onChange}\r\n onUpdate={onUpdate}\r\n />\r\n {showMinMax &&\r\n <MinMax value={max} testId=\"core-slider-max\" image={maxImage} format={formatMax} />\r\n }\r\n </div>\r\n );\r\n}\r\n\r\n/** Properties for [[MinMax]] component */\r\ninterface MinMaxProps {\r\n value: number;\r\n testId: string;\r\n image?: React.ReactNode;\r\n format?: (value: number) => string;\r\n}\r\n\r\n/** MinMax component for Slider */\r\nfunction MinMax(props: MinMaxProps) {\r\n const { value, testId, image, format } = props;\r\n let element: React.ReactElement<any>;\r\n const displayValue = format !== undefined ? format(value) : value;\r\n\r\n if (image)\r\n element = <>{image}</>;\r\n else\r\n element = <BodyText className=\"core-slider-minmax\" data-testid={testId}>{displayValue}</BodyText>;\r\n\r\n return element;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../../src/core-react/slider/Slider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA6E5C;;;;IAII;AACJ,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EACpD,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EACvF,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAC9B,WAAW,EAAE,YAAY,EAAE,aAAa,GACzC,GAAG,KAAK,CAAC;IAEV,MAAM,mBAAmB,GAAG,UAAU,CACpC,uBAAuB,EACvB,SAAS,EACT,QAAQ,IAAI,eAAe,EAC3B,cAAc,IAAI,wBAAwB,EAC1C,mBAAmB,IAAI,iCAAiC,CACzD,CAAC;IACF,MAAM,gBAAgB,GAAG,UAAU,CACjC,aAAa,EACb,UAAU,IAAI,oBAAoB,CACnC,CAAC;IAEF,MAAM,qBAAqB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAa,EAAE,EAAE;QAChE,IAAI,aAAa;YACf,OAAO,aAAa,CAAC,KAAK,CAAC,CA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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/** @packageDocumentation\r\n * @module Slider\r\n */\r\n\r\nimport \"./Slider.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Slider as ItwinSlider } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { BodyText } from \"../text/BodyText\";\r\n\r\n// cspell:ignore pushable\r\n\r\n/** Properties for [[Slider]] component\r\n * @public\r\n */\r\nexport interface SliderProps extends CommonProps {\r\n /** Values to set Slider to initially */\r\n values: number[];\r\n /** Minimum value */\r\n min: number;\r\n /** Maximum value */\r\n max: number;\r\n /** Format the min display value */\r\n formatMin?: (value: number) => string;\r\n /** Format the max display value */\r\n formatMax?: (value: number) => string;\r\n\r\n /** Step value. Default is 0.1. */\r\n step?: number;\r\n /** The interaction mode. Default is 1. Possible values:\r\n * 1 - allows handles to cross each other.\r\n * 2 - keeps the sliders from crossing and separated by a step.\r\n */\r\n mode?: number | (() => number);\r\n /** Indicates whether the display of the Slider values is reversed. */\r\n reversed?: boolean;\r\n /** Indicates whether the Slider is disabled. */\r\n disabled?: boolean;\r\n /** Indicates whether to compensate for the tick marks when determining the width. */\r\n includeTicksInWidth?: boolean;\r\n\r\n /** Indicates whether to show tooltip with the value. The tooltip will be positioned above the Slider, by default. */\r\n showTooltip?: boolean;\r\n /** Indicates whether the tooltip should show below the Slider instead of above. */\r\n tooltipBelow?: boolean;\r\n /** Format a value for the tooltip */\r\n formatTooltip?: (value: number) => string;\r\n\r\n /** Indicates whether to show min & max values to the left & right of the Slider. */\r\n showMinMax?: boolean;\r\n /** Image to show for min. */\r\n minImage?: React.ReactNode;\r\n /** Image to show for max. */\r\n maxImage?: React.ReactNode;\r\n\r\n /** Indicates whether to show tick marks under the Slider. */\r\n showTicks?: boolean;\r\n /** Indicates whether to show tick labels under the tick marks. */\r\n showTickLabels?: boolean;\r\n /** Format a tick mark value */\r\n formatTick?: (tick: number) => string;\r\n /** Function to get the tick count. The default tick count is 10. */\r\n getTickCount?: () => number;\r\n /** Function to get the tick values. This overrides the tick count from getTickCount.\r\n * Use this prop if you want to specify your own tick values instead of ticks generated by the slider.\r\n * The numbers should be valid numbers in the domain and correspond to the step value.\r\n * Invalid values will be coerced to the closet matching value in the domain.\r\n */\r\n getTickValues?: () => number[];\r\n\r\n /** Listens for value changes.\r\n * Triggered when the value of the slider has changed. This will receive changes at\r\n * the end of a slide as well as changes from clicks on rails and tracks.\r\n */\r\n onChange?: (values: ReadonlyArray<number>) => void;\r\n /** Listens for value updates.\r\n * Called with the values at each update (caution: high-volume updates when dragging).\r\n */\r\n onUpdate?: (values: ReadonlyArray<number>) => void;\r\n /** No longer available use onUpdate. */\r\n onSlideStart?: (values: ReadonlyArray<number>) => void;\r\n /** No longer available use onChange. */\r\n onSlideEnd?: (values: ReadonlyArray<number>) => void;\r\n}\r\n\r\n/**\r\n * Slider React component displays a range slider.\r\n * @public\r\n * @deprecated in 3.0. Use Slider in itwinui-react instead\r\n */\r\nexport function Slider(props: SliderProps) {\r\n const { className, style, min, max, values, step, mode,\r\n formatMin, formatMax,\r\n onChange, onUpdate,\r\n showTicks, showTickLabels, formatTick, getTickCount, getTickValues, includeTicksInWidth,\r\n reversed, disabled,\r\n showMinMax, minImage, maxImage,\r\n showTooltip, tooltipBelow, formatTooltip,\r\n } = props;\r\n\r\n const containerClassNames = classnames(\r\n \"core-slider-container\",\r\n className,\r\n disabled && \"core-disabled\",\r\n showTickLabels && \"core-slider-tickLabels\",\r\n includeTicksInWidth && \"core-slider-includeTicksInWidth\",\r\n );\r\n const sliderClassNames = classnames(\r\n \"core-slider\",\r\n showMinMax && \"core-slider-minMax\",\r\n );\r\n\r\n const internalFormatTooltip = React.useCallback((value: number) => {\r\n if (formatTooltip)\r\n return formatTooltip(value);\r\n\r\n const actualStep = Math.abs(step ?? 1);\r\n\r\n if (Number.isInteger(actualStep))\r\n return value.toFixed(0);\r\n\r\n const stepString = actualStep.toString();\r\n const decimalIndex = stepString.indexOf(\".\");\r\n const numDecimals = actualStep.toString().length - (decimalIndex + 1);\r\n return value.toFixed(numDecimals);\r\n }, [formatTooltip, step]);\r\n\r\n const tooltipProps = React.useCallback((_index: number, val: number) => {\r\n const content = internalFormatTooltip(val);\r\n if (!showTooltip)\r\n return { visible: false };\r\n return { placement: tooltipBelow ? \"bottom\" : \"top\", content } as const;\r\n }, [internalFormatTooltip, showTooltip, tooltipBelow]);\r\n\r\n const tickLabels = React.useMemo(() => {\r\n let ticks: string[] | undefined;\r\n\r\n if (showTicks) {\r\n const count = getTickCount ? getTickCount() : 0;\r\n if (count) {\r\n ticks = [];\r\n const increment = (max - min) / count;\r\n for (let i = 0; i <= count; i++) {\r\n const value = (i * increment) + min;\r\n if (showTickLabels) {\r\n const label = formatTick ? formatTick(value) : internalFormatTooltip(value);\r\n ticks.push(label);\r\n } else {\r\n ticks.push(\"\");\r\n }\r\n }\r\n } else /* istanbul ignore else */ if (getTickValues) {\r\n return getTickValues().map((val: number) => formatTick ? formatTick(val) : internalFormatTooltip(val));\r\n }\r\n }\r\n return ticks;\r\n }, [formatTick, getTickCount, getTickValues, internalFormatTooltip, max, min, showTickLabels, showTicks]);\r\n\r\n const thumbMode = React.useMemo(() => {\r\n let inMode = 1;\r\n if (typeof mode === \"function\")\r\n inMode = mode();\r\n\r\n return 1 === inMode ? \"allow-crossing\" : \"inhibit-crossing\";\r\n }, [mode]);\r\n\r\n return (\r\n <div className={containerClassNames} style={style}>\r\n {showMinMax &&\r\n <MinMax value={min} testId=\"core-slider-min\" image={minImage} format={formatMin} />\r\n }\r\n <ItwinSlider\r\n className={sliderClassNames}\r\n values={values}\r\n min={min}\r\n max={max}\r\n step={step}\r\n thumbMode={thumbMode}\r\n trackDisplayMode={!reversed ? \"auto\" : \"odd-segments\"\r\n }\r\n disabled={disabled}\r\n minLabel=\"\"\r\n maxLabel=\"\"\r\n tooltipProps={tooltipProps}\r\n tickLabels={tickLabels}\r\n onChange={onChange}\r\n onUpdate={onUpdate}\r\n />\r\n {showMinMax &&\r\n <MinMax value={max} testId=\"core-slider-max\" image={maxImage} format={formatMax} />\r\n }\r\n </div>\r\n );\r\n}\r\n\r\n/** Properties for [[MinMax]] component */\r\ninterface MinMaxProps {\r\n value: number;\r\n testId: string;\r\n image?: React.ReactNode;\r\n format?: (value: number) => string;\r\n}\r\n\r\n/** MinMax component for Slider */\r\nfunction MinMax(props: MinMaxProps) {\r\n const { value, testId, image, format } = props;\r\n let element: React.ReactElement<any>;\r\n const displayValue = format !== undefined ? format(value) : value;\r\n\r\n if (image)\r\n element = <>{image}</>;\r\n else\r\n element = <BodyText className=\"core-slider-minmax\" data-testid={testId}>{displayValue}</BodyText>;\r\n\r\n return element;\r\n}\r\n"]}
|
|
@@ -14,7 +14,7 @@ export declare enum SplitButtonActionType {
|
|
|
14
14
|
}
|
|
15
15
|
/** Properties for [[SplitButton]] component
|
|
16
16
|
* @public
|
|
17
|
-
* @deprecated Use SplitButtonProps in itwinui-react instead
|
|
17
|
+
* @deprecated in 3.0. Use SplitButtonProps in itwinui-react instead
|
|
18
18
|
*/
|
|
19
19
|
export interface SplitButtonProps extends CommonProps {
|
|
20
20
|
/** Label to display in click area. */
|
|
@@ -43,7 +43,7 @@ interface SplitButtonState {
|
|
|
43
43
|
/**
|
|
44
44
|
* SplitButton with an action button on the left and an arrow button that displays a context menu on the right.
|
|
45
45
|
* @public
|
|
46
|
-
* @deprecated Use SplitButton in itwinui-react instead
|
|
46
|
+
* @deprecated in 3.0. Use SplitButton in itwinui-react instead
|
|
47
47
|
*/
|
|
48
48
|
export declare class SplitButton extends React.Component<SplitButtonProps, SplitButtonState> {
|
|
49
49
|
private _arrowElement;
|
|
@@ -22,7 +22,7 @@ export var SplitButtonActionType;
|
|
|
22
22
|
/**
|
|
23
23
|
* SplitButton with an action button on the left and an arrow button that displays a context menu on the right.
|
|
24
24
|
* @public
|
|
25
|
-
* @deprecated Use SplitButton in itwinui-react instead
|
|
25
|
+
* @deprecated in 3.0. Use SplitButton in itwinui-react instead
|
|
26
26
|
*/
|
|
27
27
|
export class SplitButton extends React.Component {
|
|
28
28
|
constructor(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../../../../src/core-react/splitbutton/SplitButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAY,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAc,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,kBAAkB;AAClB,gBAAgB;AAChB,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,+EAAW,CAAA;IACX,iEAAI,CAAA;AACN,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAiCD;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAQlF,YAAY,KAAuB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QARP,kBAAa,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAClD,eAAU,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC/C,aAAQ,GAAY,KAAK,CAAC;QAElC,gBAAgB;QACS,UAAK,GAA+B,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAmEzE,iBAAY,GAAG,CAAC,KAA0B,EAAE,EAAE;YACpD,IAAI,KAAK,CAAC,GAAG,KAAK,UAA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AAY,EAC3B,cAAc,EAAE,IAAI,CAAC,YAAY,EACjC,KAAK,EAAE,IAAI,CAAC,YAAY,EACxB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC3B,QAAQ,EAAE,KAAK,IACd,IAAI,CAAC,KAAK,CAAC,QAAQ,CACH,CACf,CACF,CACP,CAAC;IACJ,CAAC;CA0CF","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 SplitButton\r\n */\r\n\r\nimport \"./SplitButton.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { PopupContextMenu } from \"../contextmenu/PopupContextMenu\";\r\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { ButtonType, getButtonTypeClassName } from \"../button/Button\";\r\n\r\n// TODO: implement\r\n/** @internal */\r\nexport enum SplitButtonActionType {\r\n ContextMenu, // eslint-disable-line @typescript-eslint/no-shadow\r\n List,\r\n}\r\n\r\n/** Properties for [[SplitButton]] component\r\n * @public\r\n * @deprecated Use SplitButtonProps in itwinui-react instead\r\n */\r\nexport interface SplitButtonProps extends CommonProps {\r\n /** Label to display in click area. */\r\n label: string | React.ReactNode;\r\n /** Listens for click events on button area */\r\n onClick?: (event: any) => any;\r\n /** Listens for execute on button area */\r\n onExecute?: () => any;\r\n /** Specifies icon for Splitbutton component */\r\n icon?: IconSpec;\r\n /** Indicates whether to draw a border around the button */\r\n drawBorder?: boolean;\r\n /** ToolTip text */\r\n toolTip?: string;\r\n /** Direction relative to the button to which the popup is expanded (defaults to Bottom) */\r\n popupPosition?: RelativePosition;\r\n /** 4 styles to tweak the content of the button */\r\n buttonType?: ButtonType; // eslint-disable-line deprecation/deprecation\r\n\r\n /** @internal */\r\n initialExpanded?: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface SplitButtonState {\r\n expanded: boolean;\r\n}\r\n\r\n/**\r\n * SplitButton with an action button on the left and an arrow button that displays a context menu on the right.\r\n * @public\r\n * @deprecated Use SplitButton in itwinui-react instead\r\n */\r\nexport class SplitButton extends React.Component<SplitButtonProps, SplitButtonState> { // eslint-disable-line deprecation/deprecation\r\n private _arrowElement = React.createRef<HTMLDivElement>();\r\n private _buttonRef = React.createRef<HTMLDivElement>();\r\n private _closing: boolean = false;\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<SplitButtonState> = { expanded: false };\r\n\r\n constructor(props: SplitButtonProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n\r\n this.state = {\r\n expanded: props.initialExpanded !== undefined ? props.initialExpanded : false,\r\n };\r\n }\r\n\r\n public override render(): JSX.Element {\r\n let icon = (<></>);\r\n if (this.props.icon !== undefined) {\r\n icon = (\r\n <Icon iconSpec={this.props.icon} />\r\n );\r\n }\r\n\r\n const borderClassName = (this.props.drawBorder && this.props.buttonType === undefined) ? \"core-split-button-border\" : undefined;\r\n const typeClassName = this.props.buttonType !== undefined ? getButtonTypeClassName(this.props.buttonType) : \"core-split-button-default-colors\";\r\n const classNames = classnames(\r\n \"core-split-button\",\r\n typeClassName,\r\n borderClassName,\r\n this.state.expanded && \"core-expanded\",\r\n this.props.className);\r\n const position = this.props.popupPosition !== undefined ? this.props.popupPosition : RelativePosition.BottomLeft;\r\n\r\n return (\r\n <div data-testid=\"core-split-button-root\" title={this.props.toolTip}\r\n className={classNames}\r\n style={this.props.style}\r\n tabIndex={0}\r\n onKeyUp={this._handleKeyUp}\r\n ref={this._buttonRef}\r\n role=\"button\"\r\n >\r\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\r\n <div data-testid=\"core-split-button-label\" onClick={this.props.onClick}\r\n className={classnames(\"core-split-button-label\", this.props.drawBorder && \"core-split-button-border\")}\r\n role=\"button\" tabIndex={-1}\r\n >\r\n {icon} {this.props.label}\r\n </div>\r\n <div className={classnames(\"core-split-button-divider\", this.props.drawBorder && \"core-split-button-border\")} />\r\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\r\n <div className={\"core-split-button-arrow\"} ref={this._arrowElement} onClick={this._handleArrowClick}\r\n role=\"button\" tabIndex={-1}\r\n >\r\n <div className={classnames(\"core-split-button-arrow-icon\", \"icon\", \"icon-chevron-down\")} />\r\n <PopupContextMenu\r\n position={position}\r\n target={this._buttonRef.current}\r\n animate={false}\r\n selectedIndex={0}\r\n onSelect={this._handleClose}\r\n onOutsideClick={this._handleClose}\r\n onEsc={this._handleClose}\r\n isOpen={this.state.expanded}\r\n autoflip={false}>\r\n {this.props.children}\r\n </PopupContextMenu>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n private _handleKeyUp = (event: React.KeyboardEvent) => {\r\n if (event.key === SpecialKey.Enter) {\r\n this.props.onExecute && this.props.onExecute();\r\n } else if (event.key === SpecialKey.ArrowDown && !this.state.expanded) {\r\n this._closing = false;\r\n this._open();\r\n } else {\r\n this._closing = false;\r\n }\r\n };\r\n\r\n private _open = () => {\r\n // istanbul ignore else\r\n if (!this.state.expanded && !this._closing) {\r\n this.setState({ expanded: true });\r\n } else {\r\n this._closing = false;\r\n }\r\n };\r\n\r\n private _handleArrowClick = (event: React.MouseEvent) => {\r\n if (this.state.expanded) {\r\n event.stopPropagation();\r\n this.setState({ expanded: false });\r\n this._closing = false;\r\n } else {\r\n this._open();\r\n }\r\n };\r\n\r\n private _handleClose = (event: any) => {\r\n // istanbul ignore else\r\n if (this._arrowElement.current && this._buttonRef.current) {\r\n // istanbul ignore next\r\n if (this.state.expanded && \"target\" in event && this._arrowElement.current.contains(event.target))\r\n this._closing = true;\r\n this.setState((_prevState) => ({ expanded: false }));\r\n this._buttonRef.current.focus();\r\n }\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SplitButton.js","source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cesContent":["/*---------------------------------------------------------------------------------------------\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 SplitButton\r\n */\r\n\r\nimport \"./SplitButton.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { PopupContextMenu } from \"../contextmenu/PopupContextMenu\";\r\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { ButtonType, getButtonTypeClassName } from \"../button/Button\";\r\n\r\n// TODO: implement\r\n/** @internal */\r\nexport enum SplitButtonActionType {\r\n ContextMenu, // eslint-disable-line @typescript-eslint/no-shadow\r\n List,\r\n}\r\n\r\n/** Properties for [[SplitButton]] component\r\n * @public\r\n * @deprecated in 3.0. Use SplitButtonProps in itwinui-react instead\r\n */\r\nexport interface SplitButtonProps extends CommonProps {\r\n /** Label to display in click area. */\r\n label: string | React.ReactNode;\r\n /** Listens for click events on button area */\r\n onClick?: (event: any) => any;\r\n /** Listens for execute on button area */\r\n onExecute?: () => any;\r\n /** Specifies icon for Splitbutton component */\r\n icon?: IconSpec;\r\n /** Indicates whether to draw a border around the button */\r\n drawBorder?: boolean;\r\n /** ToolTip text */\r\n toolTip?: string;\r\n /** Direction relative to the button to which the popup is expanded (defaults to Bottom) */\r\n popupPosition?: RelativePosition;\r\n /** 4 styles to tweak the content of the button */\r\n buttonType?: ButtonType; // eslint-disable-line deprecation/deprecation\r\n\r\n /** @internal */\r\n initialExpanded?: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface SplitButtonState {\r\n expanded: boolean;\r\n}\r\n\r\n/**\r\n * SplitButton with an action button on the left and an arrow button that displays a context menu on the right.\r\n * @public\r\n * @deprecated in 3.0. Use SplitButton in itwinui-react instead\r\n */\r\nexport class SplitButton extends React.Component<SplitButtonProps, SplitButtonState> { // eslint-disable-line deprecation/deprecation\r\n private _arrowElement = React.createRef<HTMLDivElement>();\r\n private _buttonRef = React.createRef<HTMLDivElement>();\r\n private _closing: boolean = false;\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<SplitButtonState> = { expanded: false };\r\n\r\n constructor(props: SplitButtonProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n\r\n this.state = {\r\n expanded: props.initialExpanded !== undefined ? props.initialExpanded : false,\r\n };\r\n }\r\n\r\n public override render(): JSX.Element {\r\n let icon = (<></>);\r\n if (this.props.icon !== undefined) {\r\n icon = (\r\n <Icon iconSpec={this.props.icon} />\r\n );\r\n }\r\n\r\n const borderClassName = (this.props.drawBorder && this.props.buttonType === undefined) ? \"core-split-button-border\" : undefined;\r\n const typeClassName = this.props.buttonType !== undefined ? getButtonTypeClassName(this.props.buttonType) : \"core-split-button-default-colors\";\r\n const classNames = classnames(\r\n \"core-split-button\",\r\n typeClassName,\r\n borderClassName,\r\n this.state.expanded && \"core-expanded\",\r\n this.props.className);\r\n const position = this.props.popupPosition !== undefined ? this.props.popupPosition : RelativePosition.BottomLeft;\r\n\r\n return (\r\n <div data-testid=\"core-split-button-root\" title={this.props.toolTip}\r\n className={classNames}\r\n style={this.props.style}\r\n tabIndex={0}\r\n onKeyUp={this._handleKeyUp}\r\n ref={this._buttonRef}\r\n role=\"button\"\r\n >\r\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\r\n <div data-testid=\"core-split-button-label\" onClick={this.props.onClick}\r\n className={classnames(\"core-split-button-label\", this.props.drawBorder && \"core-split-button-border\")}\r\n role=\"button\" tabIndex={-1}\r\n >\r\n {icon} {this.props.label}\r\n </div>\r\n <div className={classnames(\"core-split-button-divider\", this.props.drawBorder && \"core-split-button-border\")} />\r\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\r\n <div className={\"core-split-button-arrow\"} ref={this._arrowElement} onClick={this._handleArrowClick}\r\n role=\"button\" tabIndex={-1}\r\n >\r\n <div className={classnames(\"core-split-button-arrow-icon\", \"icon\", \"icon-chevron-down\")} />\r\n <PopupContextMenu\r\n position={position}\r\n target={this._buttonRef.current}\r\n animate={false}\r\n selectedIndex={0}\r\n onSelect={this._handleClose}\r\n onOutsideClick={this._handleClose}\r\n onEsc={this._handleClose}\r\n isOpen={this.state.expanded}\r\n autoflip={false}>\r\n {this.props.children}\r\n </PopupContextMenu>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n private _handleKeyUp = (event: React.KeyboardEvent) => {\r\n if (event.key === SpecialKey.Enter) {\r\n this.props.onExecute && this.props.onExecute();\r\n } else if (event.key === SpecialKey.ArrowDown && !this.state.expanded) {\r\n this._closing = false;\r\n this._open();\r\n } else {\r\n this._closing = false;\r\n }\r\n };\r\n\r\n private _open = () => {\r\n // istanbul ignore else\r\n if (!this.state.expanded && !this._closing) {\r\n this.setState({ expanded: true });\r\n } else {\r\n this._closing = false;\r\n }\r\n };\r\n\r\n private _handleArrowClick = (event: React.MouseEvent) => {\r\n if (this.state.expanded) {\r\n event.stopPropagation();\r\n this.setState({ expanded: false });\r\n this._closing = false;\r\n } else {\r\n this._open();\r\n }\r\n };\r\n\r\n private _handleClose = (event: any) => {\r\n // istanbul ignore else\r\n if (this._arrowElement.current && this._buttonRef.current) {\r\n // istanbul ignore next\r\n if (this.state.expanded && \"target\" in event && this._arrowElement.current.contains(event.target))\r\n this._closing = true;\r\n this.setState((_prevState) => ({ expanded: false }));\r\n this._buttonRef.current.focus();\r\n }\r\n };\r\n}\r\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { TabsProps } from "./Tabs";
|
|
6
6
|
/** Horizontal tabs meant to represent the current position in a page/section
|
|
7
7
|
* @public
|
|
8
|
-
* @deprecated Use HorizontalTabs in itwinui-react instead
|
|
8
|
+
* @deprecated in 3.0. Use HorizontalTabs in itwinui-react instead
|
|
9
9
|
*/
|
|
10
10
|
export declare function HorizontalTabs(props: TabsProps): JSX.Element;
|
|
11
11
|
//# sourceMappingURL=HorizontalTabs.d.ts.map
|
|
@@ -10,7 +10,7 @@ import { Tabs } from "./Tabs";
|
|
|
10
10
|
import { Orientation } from "../enums/Orientation";
|
|
11
11
|
/** Horizontal tabs meant to represent the current position in a page/section
|
|
12
12
|
* @public
|
|
13
|
-
* @deprecated Use HorizontalTabs in itwinui-react instead
|
|
13
|
+
* @deprecated in 3.0. Use HorizontalTabs in itwinui-react instead
|
|
14
14
|
*/
|
|
15
15
|
export function HorizontalTabs(props) {
|
|
16
16
|
return (React.createElement(Tabs, { mainClassName: "uicore-tabs-horizontal", orientation: Orientation.Horizontal, ...props }));
|