@itwin/core-react 3.1.0-dev.7 → 3.2.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +59 -6
  2. package/lib/cjs/core-react/_z-index.scss +2 -0
  3. package/lib/cjs/core-react/button/Button.d.ts.map +1 -1
  4. package/lib/cjs/core-react/button/Button.js +2 -4
  5. package/lib/cjs/core-react/button/Button.js.map +1 -1
  6. package/lib/cjs/core-react/dialog/Dialog.d.ts +2 -0
  7. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  8. package/lib/cjs/core-react/dialog/Dialog.js +33 -0
  9. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  10. package/lib/cjs/core-react/inputs/Input.js +1 -1
  11. package/lib/cjs/core-react/inputs/Input.js.map +1 -1
  12. package/lib/cjs/core-react/slider/Slider.js.map +1 -1
  13. package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
  14. package/lib/cjs/core-react/tree/Node.js +2 -2
  15. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  16. package/lib/esm/core-react/_z-index.scss +2 -0
  17. package/lib/esm/core-react/button/Button.d.ts.map +1 -1
  18. package/lib/esm/core-react/button/Button.js +2 -4
  19. package/lib/esm/core-react/button/Button.js.map +1 -1
  20. package/lib/esm/core-react/dialog/Dialog.d.ts +2 -0
  21. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  22. package/lib/esm/core-react/dialog/Dialog.js +33 -0
  23. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  24. package/lib/esm/core-react/inputs/Input.js +1 -1
  25. package/lib/esm/core-react/inputs/Input.js.map +1 -1
  26. package/lib/esm/core-react/slider/Slider.js.map +1 -1
  27. package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
  28. package/lib/esm/core-react/tree/Node.js +2 -2
  29. package/lib/esm/core-react/tree/Node.js.map +1 -1
  30. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,6 +1,59 @@
1
1
  # Change Log - @itwin/core-react
2
2
 
3
- This log was last generated on Wed, 12 Jan 2022 14:52:38 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 24 Feb 2022 15:26:55 GMT and should not be manually modified.
4
+
5
+ ## 3.0.1
6
+ Thu, 24 Feb 2022 15:26:55 GMT
7
+
8
+ ### Updates
9
+
10
+ - `TreeNode`: Fix checkbox propagating click events to the parent element, resulting in unexpected TreeNodeProps.onClick invocations.
11
+
12
+ ## 3.0.0
13
+ Mon, 24 Jan 2022 14:00:52 GMT
14
+
15
+ ### Updates
16
+
17
+ - Update NumberInput to select on focus and to capture Enter key
18
+ - Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
19
+ - rename to @itwin/core-react
20
+ - remove ClientRequestContext and its subclasses
21
+ - Replace usage of I18N with generic Localization interface.
22
+ - Update snapshots
23
+ - Fix Select menu position when redered in a Popup.
24
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
25
+ - Deprecate obsolete code.
26
+ - Create empty frontstage and UiItemsProviders to populate it and update how ContentGroups are defined.
27
+ - Add missing public/beta types to the barrel file.
28
+ - Fix infinite loop crash in ContextMenu when the menu is too large to fit in the parent window.
29
+ - Fix issue with PopupContextMenu not closing when click occurs in a parent popup.
30
+ - Deprecate and promote apis
31
+ - Deprecate obsolete APIs. Publish beta APIs from last release.
32
+ - Upgraded itwinui-react to 1.16.2. Fixed editor sizes.
33
+ - Fixed small ExpandableBlock padding
34
+ - Remove files generated by bad merge
35
+ - Update disabled styling for NumberInput.
36
+ - Update styling on some status field items for better popup alignment.
37
+ - Update IconComponent SCSS to ensure color for inline svg is set.
38
+ - Allow size of NumberInput container to be sized via a style prop.
39
+ - Deprecated HorizontalTabs in ui-core. Removed older deprecated items. Updated NextVersion.md.
40
+ - Update to latest itwinui-react
41
+ - Incorporating iTwinUI-CSS and iTwinUI-React into iModel.js
42
+ - Moved iTwinUI style overrides to ui-core from ui-framework
43
+ - Rename ui directories to match new package names.
44
+ - Fix bug that sets the icon on MessageBox.NoSymbol the Success icon.
45
+ - Add prop that prevents popup children from unmounting when popup is closed.
46
+ - Update to React 17.
47
+ - Created imodel-components folder & package and moved color, lineweight, navigationaids, quantity, timeline & viewport. Deprecated MessageSeverity in ui-core & added it ui-abstract. Added MessagePresenter interface to ui-abstract.
48
+ - Remove react 16 peer dependency.
49
+ - Remove itwinUi css overrides.
50
+ - UiFramework and UiIModelComponent initialize method no longer take localization argument, uses IModelApp.localization internally.
51
+ - Fix vertical alignment of text in message box.
52
+ - Avoid error seen sometimes in Electron where resizeObserver.current is null.
53
+ - Fixed z-index of status messages to be on top of a dialog
54
+ - Deprecated ui-core Slider. Wrapped with one from iTwinUi-react to remove dependency on react-compound-slider.
55
+ - Update to latest types/react package
56
+ - Lock down and update version numbers so docs will build.
4
57
 
5
58
  ## 2.19.28
6
59
  Wed, 12 Jan 2022 14:52:38 GMT
@@ -264,9 +317,9 @@ Mon, 24 May 2021 15:58:39 GMT
264
317
  ### Updates
265
318
 
266
319
  - Wrap resizeObserver in a windows animation frame to prevent loop limit exceeded error.
267
- - Add support for child popup windows.
320
+ - Add support for child popup windows.
268
321
  - Improved Multi-Value column filtering in the Table component
269
- - Update to latest classnames package
322
+ - Update to latest classnames package
270
323
  - Fix GlobalContextMenu layout issue in presentation-test-app by setting display:none on anchoring div.
271
324
 
272
325
  ## 2.15.6
@@ -394,7 +447,7 @@ Thu, 28 Jan 2021 13:39:27 GMT
394
447
 
395
448
  ### Updates
396
449
 
397
- - Update components that support providing refs via React.forwardRef to work better with document generation.
450
+ - Update components that support providing refs via React.forwardRef to work better with document generation.
398
451
  - Add option to use a 'x-small' webfont icon.
399
452
  - Add nested popup support to components that use HOC withOnOutsideClick.
400
453
  - Fix bug processing zero value in Select options.
@@ -665,7 +718,7 @@ Tue, 28 Jul 2020 16:26:24 GMT
665
718
  - Add support for a basic single selection aria compliant listbox.
666
719
  - Checkboxes in lists & trees are out of place
667
720
  - Disabled component styling. Fixed Dialog focus problems.
668
- - Map Layer UX
721
+ - Map Layer UX
669
722
  - Allowing Input component user to override the type
670
723
  - Fix ThemeSelect formatOptionLabel prop to return React.ReactNode.
671
724
  - Added Arrow key navigation in Tabs components. Added ItemKeyboardNavigator.
@@ -988,7 +1041,7 @@ Mon, 13 May 2019 15:52:05 GMT
988
1041
  - Put sourcemap in npm package.
989
1042
  - Added SignIn presentational component to ui-components. Removed --ignoreMissingTags extract-api option.
990
1043
  - Require React & React-dom 16.8
991
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1044
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
992
1045
  - Added ViewportDialog in ui-test-app, ui-core/ContributeGuidelines.md. TSLint rules in ui-core for no-default-export & completed-docs. @beta release tags.
993
1046
  - Update icons-generic-webfont version to latest available.
994
1047
  - Added TableProp to hide header and supporting style changes
@@ -7,6 +7,8 @@
7
7
  // Order matters, last is top-most on screen.
8
8
  $uicore-internal-z-index-layers:
9
9
  view-overlay,
10
+ view-content-dialog,
11
+ content-card-popup,
10
12
  widget-grip,
11
13
  dragged-widget,
12
14
  zone-target,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/core-react/button/Button.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;GAGG;AACH,oBAAY,UAAU;IACpB,OAAO,KAAK;IACZ,KAAK,UAAU;CAChB;AAED;;;GAGG;AACH,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW;IAC7F,sCAAsC;IACt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AAK,IAAI,CAAC,CAAC;CAC9E;AAED;;;GAGG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC;IAC1D,OAAO,CAAC,gBAAgB,CAetB;IAEc,MAAM;CAQvB;AAED,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,CAkBtE"}
@@ -57,10 +57,8 @@ class Button extends React.PureComponent {
57
57
  render() {
58
58
  const { buttonType, size, className, style, onClick, ...props } = this.props;
59
59
  const iuiButtonType = this.getIuiButtonType(buttonType);
60
- let iuiButtonSize = "small";
61
- if (size === ButtonSize.Large) // eslint-disable-line deprecation/deprecation
62
- iuiButtonSize = undefined;
63
- return React.createElement(itwinui_react_1.Button, { ...props, className: className, style: style, onClick: onClick, styleType: iuiButtonType, size: iuiButtonSize });
60
+ // eslint-disable-next-line deprecation/deprecation
61
+ return React.createElement(itwinui_react_1.Button, { ...props, className: className, style: style, onClick: onClick, styleType: iuiButtonType, size: size === ButtonSize.Large ? undefined : "small" });
64
62
  }
65
63
  }
66
64
  exports.Button = Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/core-react/button/Button.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAgE;AAGhE;;;GAGG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,0BAAY,CAAA;IACZ,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED;;;GAGG;AACH,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAiBD;;;GAGG;AACH,MAAa,MAAO,SAAQ,KAAK,CAAC,aA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E,aAAa,GAAG,yBAAyB,CAAC;YAC1C,MAAM;QACR,KAAK,UAAU,CAAC,MAAM,EAAE,8CAA8C;YACpE,aAAa,GAAG,uBAAuB,CAAC;YACxC,MAAM;QACR,KAAK,UAAU,CAAC,OAAO,CAAC,CAAE,8CAA8C;QACxE;YACE,aAAa,GAAG,wBAAwB,CAAC;YACzC,MAAM;KACT;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAlBD,wDAkBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Button\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Button as ITwinUI_Button } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Sizes for [[Button]] component\r\n * @public\r\n * @deprecated Use `size` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonSize {\r\n Default = \"\",\r\n Large = \"large\",\r\n}\r\n\r\n/** Types for [[Button]] component\r\n * @public\r\n * @deprecated Use `styleType` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonType {\r\n Primary = \"primary\",\r\n Blue = \"blue\",\r\n Disabled = \"disabled\",\r\n Hollow = \"hollow\",\r\n}\r\n\r\n/** Properties for [[Button]] component\r\n * @public\r\n * @deprecated Use ButtonProps from itwinui-react instead\r\n */\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Allow ID to be passed to Button */\r\n id?: string;\r\n /** Default and large sizes */\r\n size?: ButtonSize; // eslint-disable-line deprecation/deprecation\r\n /** 4 styles to tweak the content of the button */\r\n buttonType?: ButtonType; // eslint-disable-line deprecation/deprecation\r\n /** A function to be run when the element is clicked */\r\n onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void);\r\n}\r\n\r\n/** Generic button component\r\n * @public\r\n * @deprecated Use Button from itwinui-react instead\r\n */\r\nexport class Button extends React.PureComponent<ButtonProps> { // eslint-disable-line deprecation/deprecation\r\n private getIuiButtonType = (buttonType?: ButtonType): string => { // eslint-disable-line deprecation/deprecation\r\n let iuiButtonType: string;\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"high-visibility\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"default\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n iuiButtonType = \"cta\";\r\n break;\r\n }\r\n return iuiButtonType;\r\n };\r\n\r\n public override render() {\r\n const { buttonType, size, className, style, onClick, ...props } = this.props;\r\n\r\n const iuiButtonType = this.getIuiButtonType(buttonType);\r\n\r\n let iuiButtonSize: string | undefined = \"small\";\r\n if (size === ButtonSize.Large) // eslint-disable-line deprecation/deprecation\r\n iuiButtonSize = undefined;\r\n\r\n return <ITwinUI_Button {...props} className={className} style={style} onClick={onClick} styleType={iuiButtonType} size={iuiButtonSize} />;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function getButtonTypeClassName(buttonType?: ButtonType): string { // eslint-disable-line deprecation/deprecation\r\n let typeClassName: string;\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-blue\";\r\n break;\r\n case ButtonType.Disabled: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-disabled\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-hollow\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n typeClassName = \"uicore-buttons-primary\";\r\n break;\r\n }\r\n return typeClassName;\r\n}\r\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/core-react/button/Button.tsx"],"names":[],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,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,KAAK,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,GAAI,CAAC;IAC9K,CAAC;CACF;AA1BD,wBA0BC;AAED,gBAAgB;AAChB,SAAgB,sBAAsB,CAAC,UAAuB;IAC5D,IAAI,aAAqB,CAAC;IAC1B,QAAQ,UAAU,EAAE;QAClB,KAAK,UAAU,CAAC,IAAI,EAAE,8CAA8C;YAClE,aAAa,GAAG,qBAAqB,CAAC;YACtC,MAAM;QACR,KAAK,UAAU,CAAC,QAAQ,EAAE,8CAA8C;YACtE,aAAa,GAAG,yBAAyB,CAAC;YAC1C,MAAM;QACR,KAAK,UAAU,CAAC,MAAM,EAAE,8CAA8C;YACpE,aAAa,GAAG,uBAAuB,CAAC;YACxC,MAAM;QACR,KAAK,UAAU,CAAC,OAAO,CAAC,CAAE,8CAA8C;QACxE;YACE,aAAa,GAAG,wBAAwB,CAAC;YACzC,MAAM;KACT;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAlBD,wDAkBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Button\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Button as ITwinUI_Button, ButtonProps as ITwinUI_ButtonProps } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Sizes for [[Button]] component\r\n * @public\r\n * @deprecated Use `size` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonSize {\r\n Default = \"\",\r\n Large = \"large\",\r\n}\r\n\r\n/** Types for [[Button]] component\r\n * @public\r\n * @deprecated Use `styleType` prop for itwinui-react Button instead\r\n */\r\nexport enum ButtonType {\r\n Primary = \"primary\",\r\n Blue = \"blue\",\r\n Disabled = \"disabled\",\r\n Hollow = \"hollow\",\r\n}\r\n\r\n/** Properties for [[Button]] component\r\n * @public\r\n * @deprecated Use ButtonProps from itwinui-react instead\r\n */\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Allow ID to be passed to Button */\r\n id?: string;\r\n /** Default and large sizes */\r\n size?: ButtonSize; // eslint-disable-line deprecation/deprecation\r\n /** 4 styles to tweak the content of the button */\r\n buttonType?: ButtonType; // eslint-disable-line deprecation/deprecation\r\n /** A function to be run when the element is clicked */\r\n onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void);\r\n}\r\n\r\n/** Generic button component\r\n * @public\r\n * @deprecated Use Button from itwinui-react instead\r\n */\r\nexport class Button extends React.PureComponent<ButtonProps> { // eslint-disable-line deprecation/deprecation\r\n private getIuiButtonType = (buttonType?: ButtonType) => { // eslint-disable-line deprecation/deprecation\r\n let iuiButtonType: ITwinUI_ButtonProps[\"styleType\"];\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"high-visibility\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n iuiButtonType = \"default\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n iuiButtonType = \"cta\";\r\n break;\r\n }\r\n return iuiButtonType;\r\n };\r\n\r\n public override render() {\r\n const { buttonType, size, className, style, onClick, ...props } = this.props;\r\n\r\n const iuiButtonType = this.getIuiButtonType(buttonType);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n return <ITwinUI_Button {...props} className={className} style={style} onClick={onClick} styleType={iuiButtonType} size={size === ButtonSize.Large ? undefined : \"small\"} />;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function getButtonTypeClassName(buttonType?: ButtonType): string { // eslint-disable-line deprecation/deprecation\r\n let typeClassName: string;\r\n switch (buttonType) {\r\n case ButtonType.Blue: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-blue\";\r\n break;\r\n case ButtonType.Disabled: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-disabled\";\r\n break;\r\n case ButtonType.Hollow: // eslint-disable-line deprecation/deprecation\r\n typeClassName = \"uicore-buttons-hollow\";\r\n break;\r\n case ButtonType.Primary: // eslint-disable-line deprecation/deprecation\r\n default:\r\n typeClassName = \"uicore-buttons-primary\";\r\n break;\r\n }\r\n return typeClassName;\r\n}\r\n"]}
@@ -113,6 +113,8 @@ export declare class Dialog extends React.Component<DialogProps, DialogState> {
113
113
  constructor(props: DialogProps);
114
114
  private getParentWindow;
115
115
  componentWillUnmount(): void;
116
+ /** Keep title bar of movable Dialog at least partially visible */
117
+ private _handleAppWindowResize;
116
118
  componentDidMount(): void;
117
119
  handleRefSet: (containerDiv: HTMLDivElement | null) => void;
118
120
  render(): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/core-react/dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAgC,MAAM,uBAAuB,CAAC;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C;;GAEG;AACH,oBAAY,eAAe;IACzB,OAAO,aAAa;IAAE,GAAG,QAAQ;IAAE,QAAQ,cAAc;IACzD,IAAI,SAAS;IAAE,MAAM,WAAW;IAAE,KAAK,UAAU;IACjD,UAAU,gBAAgB;IAAE,MAAM,WAAW;IAAE,WAAW,iBAAiB;CAC5E;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAA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,CAAC;gBAE1C,KAAK,EAAE,WAAW;IAY9B,OAAO,CAAC,eAAe;IAKP,oBAAoB,IAAI,IAAI;IAQ5C,kEAAkE;IAElE,OAAO,CAAC,sBAAsB,CAkB5B;IAEc,iBAAiB,IAAI,IAAI;IAOlC,YAAY,iBAAkB,cAAc,GAAG,IAAI,UAGxD;IAEc,MAAM,IAAI,GAAG,CAAC,OAAO;IAuIrC,OAAO,CAAC,4BAA4B;IA4CpC,OAAO,CAAC,gBAAgB;IAmDxB,OAAO,CAAC,YAAY,CAIlB;IAEF,OAAO,CAAC,2BAA2B,CAKjC;IAEF,OAAO,CAAC,uBAAuB,CAK7B;IAEF,OAAO,CAAC,sBAAsB,CAK5B;IAEF,OAAO,CAAC,2BAA2B,CAKjC;IAEF,OAAO,CAAC,gBAAgB,CAmBtB;IAEF,OAAO,CAAC,kBAAkB,CAwDxB;IAEF,OAAO,CAAC,gBAAgB,CAiBtB;CACH"}
@@ -41,6 +41,24 @@ class Dialog extends React.Component {
41
41
  super(props);
42
42
  this._parentDocument = document;
43
43
  this._containerRef = React.createRef();
44
+ /** Keep title bar of movable Dialog at least partially visible */
45
+ // istanbul ignore next
46
+ this._handleAppWindowResize = () => {
47
+ if (!this._containerRef.current || !this.props.movable)
48
+ return;
49
+ const parentWindow = this.getParentWindow();
50
+ const { x, y } = this.state;
51
+ let newX;
52
+ let newY;
53
+ if (undefined !== y && undefined !== x) {
54
+ if (y > parentWindow.innerHeight - 32)
55
+ newY = parentWindow.innerHeight - 32;
56
+ if (x > parentWindow.innerWidth - 32)
57
+ newX = parentWindow.innerWidth - 32;
58
+ }
59
+ if (newX !== undefined || newY !== undefined)
60
+ this.setState({ x: newX !== undefined ? newX : x, y: newY !== undefined ? newY : y, positionSet: true });
61
+ };
44
62
  this.handleRefSet = (containerDiv) => {
45
63
  if (containerDiv)
46
64
  this._parentDocument = containerDiv.ownerDocument;
@@ -123,9 +141,22 @@ class Dialog extends React.Component {
123
141
  }
124
142
  this.setState({ width, height });
125
143
  }
144
+ // istanbul ignore next
126
145
  if (movable && this.state.moving) {
127
146
  x = event.clientX - this.state.grabOffsetX;
128
147
  y = event.clientY - this.state.grabOffsetY;
148
+ if (y < 0)
149
+ y = 0;
150
+ if (event.view) {
151
+ if (y > event.view.innerHeight - 32)
152
+ y = event.view.innerHeight - 32;
153
+ if (x > event.view.innerWidth - 32)
154
+ x = event.view.innerWidth - 32;
155
+ if (width) {
156
+ if (x < (0 - width + 32))
157
+ x = 0 - width + 32;
158
+ }
159
+ }
129
160
  this.setState({ x, y, positionSet: true });
130
161
  }
131
162
  };
@@ -164,11 +195,13 @@ class Dialog extends React.Component {
164
195
  parentWindow.removeEventListener("pointerup", this._handlePointerUp, true);
165
196
  parentWindow.removeEventListener("pointermove", this._handlePointerMove, true);
166
197
  this._parentDocument.removeEventListener("keyup", this._handleKeyUp, true);
198
+ parentWindow.addEventListener("resize", this._handleAppWindowResize);
167
199
  }
168
200
  componentDidMount() {
169
201
  const parentWindow = this.getParentWindow();
170
202
  parentWindow.addEventListener("pointerup", this._handlePointerUp, true);
171
203
  this._parentDocument.addEventListener("keyup", this._handleKeyUp, true);
204
+ parentWindow.addEventListener("resize", this._handleAppWindowResize);
172
205
  }
173
206
  render() {
174
207
  const { opened, title, footer, buttonCluster, onClose, onEscape, onOutsideClick, // eslint-disable-line @typescript-eslint/no-unused-vars
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/Dialog.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAC/B,0DAAsF;AACtF,qEAAkE;AAClE,sCAAmC;AAGnC,sDAAmD;AACnD,wDAA8C;AAE9C,0BAA0B;AAE1B;;GAEG;AACH,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,uCAAoB,CAAA;IAAE,8BAAW,CAAA;IAAE,yCAAsB,CAAA;IACzD,gCAAa,C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E,MAAM,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;wBACvE,MAAM;oBACR,KAAK,iCAAgB,CAAC,QAAQ;wBAC5B,UAAU,GAAG,eAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;wBACjD,WAAW,GAAG,IAAA,oBAAU,EAAC,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;wBACvE,MAAM;iBACT;gBAED,IAAI,MAAM,CAAC,KAAK;oBACd,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;gBAE5B,OAAO,CAAC,IAAI,CAAC,oBAAC,sBAAM,IAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAG,UAAU,CAAU,CAAC,CAAC;YACjJ,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;;AA1RH,wBAiZC;AA9Ye,mBAAY,GAAyB;IACjD,SAAS,EAAE,eAAe,CAAC,MAAM;IACjC,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,KAAK;CACjB,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 Dialog\r\n */\r\n\r\nimport \"./Dialog.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { DialogButtonDef, DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { DivWithOutsideClick } from \"../base/DivWithOutsideClick\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Omit } from \"../utils/typeUtils\";\r\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cspell:ignore focustrap\r\n\r\n/** Enum for dialog alignment\r\n * @public\r\n */\r\nexport enum DialogAlignment {\r\n TopLeft = \"top-left\", Top = \"top\", TopRight = \"top-right\",\r\n Left = \"left\", Center = \"center\", Right = \"right\",\r\n BottomLeft = \"bottom-left\", Bottom = \"bottom\", BottomRight = \"bottom-right\",\r\n}\r\n\r\n/** Properties for the [[Dialog]] component\r\n * @public\r\n */\r\nexport interface DialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"title\">, CommonProps {\r\n /** Indicates whether to show dialog or not */\r\n opened: boolean;\r\n\r\n /** Indicates whether the user can resize dialog with cursor. Default: false */\r\n resizable?: boolean;\r\n /** Indicates whether the user can move dialog with cursor. Default: false */\r\n movable?: boolean;\r\n /** Indicates whether the content should be inset. Default: true */\r\n inset?: boolean;\r\n /** Indicates whether the focus should be trapped within the dialog. Default: false */\r\n trapFocus?: boolean;\r\n\r\n /** Whether the hide the header. Default: false */\r\n hideHeader?: boolean;\r\n /** Override for the header */\r\n header?: React.ReactNode;\r\n /** Title to show in title bar of dialog */\r\n title?: string | JSX.Element;\r\n /** Footer to show at bottom of dialog. Note: will override buttonCluster */\r\n footer?: string | JSX.Element;\r\n /** List of DialogButtonDef objects specifying buttons and associated onClick events */\r\n buttonCluster?: DialogButtonDef[];\r\n\r\n /** Default alignment of dialog. Default: DialogAlignment.Center */\r\n alignment?: DialogAlignment;\r\n /** Initial x/left position of dialog in px. */\r\n x?: number;\r\n /** Initial y/top position of dialog in px. */\r\n y?: number;\r\n\r\n /** onClick event for X button for dialog */\r\n onClose?: () => void;\r\n /** 'keyup' event for Esc key */\r\n onEscape?: () => void;\r\n /** Triggered when a click is triggered outside of this dialog. */\r\n onOutsideClick?: (event: MouseEvent) => any;\r\n\r\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: \"50%\" */\r\n width?: string | number;\r\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n height?: string | number;\r\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 300px */\r\n minWidth?: string | number;\r\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100px */\r\n minHeight?: string | number;\r\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxWidth?: string | number;\r\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxHeight?: string | number;\r\n\r\n /** Whether to show background overlay. Default: true.\r\n * @note Modeless dialogs require an id and an implementation of onModelessPointerDown.\r\n */\r\n modal?: boolean;\r\n /** An id for a modeless dialog */\r\n modelessId?: string;\r\n /** Pointer Down event handler when modeless (modal = false) */\r\n onModelessPointerDown?: (event: React.PointerEvent, id: string) => void;\r\n\r\n /** Custom CSS Style for overlay */\r\n backgroundStyle?: React.CSSProperties;\r\n /** Custom CSS Style for title */\r\n titleStyle?: React.CSSProperties;\r\n /** Custom CSS Style for footer */\r\n footerStyle?: React.CSSProperties;\r\n /** Custom CSS class name for the content */\r\n contentClassName?: string;\r\n /** Custom CSS Style for the content */\r\n contentStyle?: React.CSSProperties;\r\n}\r\n\r\n/** @internal */\r\ninterface DialogState {\r\n rightResizing: boolean;\r\n downResizing: boolean;\r\n moving: boolean;\r\n grabOffsetX: number;\r\n grabOffsetY: number;\r\n x?: number;\r\n y?: number;\r\n width?: number;\r\n height?: number;\r\n positionSet: boolean;\r\n}\r\n\r\n/**\r\n * Dialog React component with optional resizing and dragging functionality\r\n * @public\r\n */\r\nexport class Dialog extends React.Component<DialogProps, DialogState> {\r\n private _parentDocument = document;\r\n private _containerRef = React.createRef<HTMLDivElement>();\r\n public static defaultProps: Partial<DialogProps> = {\r\n alignment: DialogAlignment.Center,\r\n minWidth: 300,\r\n minHeight: 100,\r\n width: \"50%\",\r\n hideHeader: false,\r\n resizable: false,\r\n movable: false,\r\n modal: true,\r\n inset: true,\r\n trapFocus: false,\r\n };\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<DialogState>;\r\n\r\n constructor(props: DialogProps) {\r\n super(props);\r\n this.state = {\r\n rightResizing: false,\r\n downResizing: false,\r\n moving: false,\r\n grabOffsetX: 0,\r\n grabOffsetY: 0,\r\n positionSet: props.x !== undefined || props.y !== undefined,\r\n };\r\n }\r\n\r\n private getParentWindow() {\r\n // istanbul ignore next\r\n return this._parentDocument.defaultView ?? window;\r\n }\r\n\r\n public override componentWillUnmount(): void {\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.removeEventListener(\"pointerup\", this._handlePointerUp, true);\r\n parentWindow.removeEventListener(\"pointermove\", this._handlePointerMove, true);\r\n this._parentDocument.removeEventListener(\"keyup\", this._handleKeyUp, true);\r\n }\r\n\r\n public override componentDidMount(): void {\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointerup\", this._handlePointerUp, true);\r\n this._parentDocument.addEventListener(\"keyup\", this._handleKeyUp, true);\r\n }\r\n\r\n public handleRefSet = (containerDiv: HTMLDivElement | null) => {\r\n if (containerDiv)\r\n this._parentDocument = containerDiv.ownerDocument;\r\n };\r\n\r\n public override render(): JSX.Element {\r\n const {\r\n opened, title, footer, buttonCluster, onClose, onEscape, onOutsideClick, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n minWidth, minHeight, x, y, width, height, maxHeight, maxWidth,\r\n backgroundStyle, titleStyle, footerStyle, style, contentStyle, contentClassName,\r\n modal, resizable, movable, className, alignment, inset, trapFocus, modelessId, onModelessPointerDown, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n hideHeader, header, ...props } = this.props;\r\n\r\n const containerStyle: React.CSSProperties = {\r\n margin: \"\",\r\n left: x, top: y,\r\n width, height,\r\n };\r\n\r\n if (this.state.x !== undefined || this.state.y !== undefined) {\r\n // istanbul ignore else\r\n if (this.state.x !== undefined) {\r\n containerStyle.marginLeft = \"0\";\r\n containerStyle.marginRight = \"0\";\r\n containerStyle.left = this.state.x;\r\n }\r\n // istanbul ignore else\r\n if (this.state.y !== undefined) {\r\n containerStyle.marginTop = \"0\";\r\n containerStyle.marginBottom = \"0\";\r\n containerStyle.top = this.state.y;\r\n }\r\n }\r\n\r\n if (this.state.width !== undefined || this.state.height !== undefined) {\r\n // istanbul ignore else\r\n if (this.state.width !== undefined)\r\n containerStyle.width = this.state.width;\r\n // istanbul ignore else\r\n if (this.state.height !== undefined)\r\n containerStyle.height = this.state.height;\r\n }\r\n\r\n const minMaxStyle: React.CSSProperties = {};\r\n minMaxStyle.minWidth = (typeof minWidth === \"number\") ? `${minWidth}px` : minWidth;\r\n minMaxStyle.minHeight = (typeof minHeight === \"number\") ? `${minHeight}px` : minHeight;\r\n if (maxWidth !== undefined)\r\n minMaxStyle.maxWidth = (typeof maxWidth === \"number\") ? `${maxWidth}px` : maxWidth;\r\n if (maxHeight !== undefined)\r\n minMaxStyle.maxHeight = (typeof maxHeight === \"number\") ? `${maxHeight}px` : maxHeight;\r\n\r\n const buttons = this.getFooterButtons(this.props);\r\n\r\n const footerElement: React.ReactNode = footer || (buttons.length > 0 && <div className={\"core-dialog-buttons\"}>{buttons}</div>);\r\n\r\n const divStyle: React.CSSProperties = {\r\n ...backgroundStyle,\r\n ...style,\r\n };\r\n\r\n const headerElement = header || (\r\n <div\r\n className={classnames(\r\n \"core-dialog-head\",\r\n { \"core-dialog-movable\": movable },\r\n { \"core-dialog-modal\": modal }\r\n )}\r\n data-testid=\"core-dialog-head\"\r\n onPointerDown={this._handleStartMove}>\r\n <div className={\"core-dialog-title\"} data-testid=\"core-dialog-title\" style={titleStyle}>{title}</div>\r\n <button\r\n className={\"core-focus-trap-ignore-initial core-dialog-close icon icon-close\"}\r\n data-testid=\"core-dialog-close\"\r\n onClick={onClose}\r\n />\r\n </div>\r\n );\r\n\r\n return (\r\n <div ref={this.handleRefSet}\r\n className={classnames(\r\n \"core-dialog\",\r\n !modal && \"core-dialog-hidden\",\r\n opened && \"core-dialog-opened\",\r\n className,\r\n )}\r\n style={divStyle}\r\n data-testid=\"core-dialog-root\"\r\n {...props}\r\n >\r\n { opened &&\r\n <DivWithOutsideClick onOutsideClick={onOutsideClick}>\r\n <FocusTrap active={trapFocus && modal} returnFocusOnDeactivate={true}>\r\n <div\r\n className={classnames(\"core-dialog-container\", this.getCSSClassNameFromAlignment(alignment))}\r\n style={{ ...containerStyle, ...minMaxStyle }}\r\n data-testid=\"core-dialog-container\"\r\n onPointerDown={this._handleContainerPointerDown}\r\n >\r\n <div className={\"core-dialog-area\"} ref={this._containerRef} style={minMaxStyle}>\r\n {!hideHeader &&\r\n headerElement\r\n }\r\n <div\r\n className={classnames(\r\n \"core-dialog-content\",\r\n { \"core-dialog-content-no-inset\": !inset },\r\n contentClassName)}\r\n style={contentStyle}>\r\n {this.props.children}\r\n </div>\r\n {footerElement &&\r\n <div className={\"core-dialog-footer\"} style={footerStyle}>\r\n {footerElement}\r\n </div>\r\n }\r\n <div\r\n className={classnames(\"core-dialog-drag\", \"core-dialog-drag-right\", { \"core-dialog-drag-enabled\": resizable })}\r\n data-testid=\"core-dialog-drag-right\"\r\n onPointerDown={this._handleStartResizeRight}\r\n />\r\n <div\r\n className={classnames(\"core-dialog-drag\", \"core-dialog-drag-bottom-mid\", { \"core-dialog-drag-enabled\": resizable })}\r\n data-testid=\"core-dialog-drag-bottom\"\r\n onPointerDown={this._handleStartResizeDown}\r\n />\r\n <div\r\n className={classnames(\"core-dialog-drag\", \"core-dialog-drag-bottom-right\", { \"core-dialog-drag-enabled\": resizable })}\r\n data-testid=\"core-dialog-drag-bottom-right\"\r\n onPointerDown={this._handleStartResizeDownRight}\r\n />\r\n </div>\r\n </div>\r\n </FocusTrap>\r\n </DivWithOutsideClick>\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n private getCSSClassNameFromAlignment(alignment?: DialogAlignment): string {\r\n let className = \"\";\r\n\r\n // Drop the alignment CSS class if the Dialog has been sized or moved.\r\n if (this.state.positionSet)\r\n return \"\";\r\n\r\n // istanbul ignore next\r\n if (!alignment)\r\n alignment = DialogAlignment.Center;\r\n\r\n switch (alignment) {\r\n case DialogAlignment.TopLeft:\r\n className = \"core-dialog-top-left\";\r\n break;\r\n case DialogAlignment.Top:\r\n className = \"core-dialog-top\";\r\n break;\r\n case DialogAlignment.TopRight:\r\n className = \"core-dialog-top-right\";\r\n break;\r\n case DialogAlignment.Left:\r\n className = \"core-dialog-left\";\r\n break;\r\n case DialogAlignment.Center:\r\n className = \"core-dialog-center\";\r\n break;\r\n case DialogAlignment.Right:\r\n className = \"core-dialog-right\";\r\n break;\r\n case DialogAlignment.BottomLeft:\r\n className = \"core-dialog-bottom-left\";\r\n break;\r\n case DialogAlignment.Bottom:\r\n className = \"core-dialog-bottom\";\r\n break;\r\n case DialogAlignment.BottomRight:\r\n className = \"core-dialog-bottom-right\";\r\n break;\r\n }\r\n\r\n return className;\r\n }\r\n\r\n private getFooterButtons(props: DialogProps) {\r\n const buttons: React.ReactNode[] = [];\r\n if (props.buttonCluster) {\r\n props.buttonCluster.forEach((button: DialogButtonDef, index: number) => {\r\n let buttonText = \"\";\r\n let buttonClass = classnames(\"core-dialog-button\", `dialog-button-${button.type}`, button.className);\r\n\r\n switch (button.type) {\r\n case DialogButtonType.OK:\r\n buttonText = UiCore.translate(\"dialog.ok\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.Retry:\r\n buttonText = UiCore.translate(\"dialog.retry\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.Yes:\r\n buttonText = UiCore.translate(\"dialog.yes\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.No:\r\n buttonText = UiCore.translate(\"dialog.no\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle);\r\n break;\r\n case DialogButtonType.Cancel:\r\n buttonText = UiCore.translate(\"dialog.cancel\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle);\r\n break;\r\n case DialogButtonType.Close:\r\n buttonText = UiCore.translate(\"dialog.close\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle);\r\n break;\r\n case DialogButtonType.Next:\r\n buttonText = UiCore.translate(\"dialog.next\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.Previous:\r\n buttonText = UiCore.translate(\"dialog.previous\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n }\r\n\r\n if (button.label)\r\n buttonText = button.label;\r\n\r\n buttons.push(<Button className={buttonClass} disabled={button.disabled} key={index.toString()} onClick={button.onClick}>{buttonText}</Button>);\r\n });\r\n }\r\n return buttons;\r\n }\r\n\r\n private _handleKeyUp = (event: KeyboardEvent) => {\r\n if (event.key === SpecialKey.Escape && this.props.opened && this.props.onEscape) {\r\n this.props.onEscape();\r\n }\r\n };\r\n\r\n private _handleContainerPointerDown = (event: React.PointerEvent): void => {\r\n if (!this.props.modal) {\r\n if (this.props.onModelessPointerDown && this.props.modelessId)\r\n this.props.onModelessPointerDown(event, this.props.modelessId);\r\n }\r\n };\r\n\r\n private _handleStartResizeRight = (event: React.PointerEvent): void => {\r\n event.preventDefault();\r\n this.setState({ rightResizing: true });\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n\r\n private _handleStartResizeDown = (event: React.PointerEvent): void => {\r\n event.preventDefault();\r\n this.setState({ downResizing: true });\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n\r\n private _handleStartResizeDownRight = (event: React.PointerEvent): void => {\r\n event.preventDefault();\r\n this.setState({ downResizing: true, rightResizing: true });\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n\r\n private _handleStartMove = (event: React.PointerEvent): void => {\r\n if (!this.props.movable)\r\n return;\r\n\r\n event.preventDefault();\r\n // istanbul ignore else\r\n if (this._containerRef.current) {\r\n const rect = this._containerRef.current.getBoundingClientRect();\r\n const grabOffsetX = event.clientX - rect.left;\r\n const grabOffsetY = event.clientY - rect.top;\r\n this.setState({\r\n grabOffsetX,\r\n grabOffsetY,\r\n moving: true,\r\n });\r\n\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n }\r\n };\r\n\r\n private _handlePointerMove = (event: PointerEvent): void => {\r\n if ((!this.props.resizable && !this.props.movable) || !this._containerRef.current)\r\n return;\r\n\r\n const { minWidth, maxWidth, minHeight, maxHeight, movable } = this.props;\r\n let { x, y, width, height } = this.state;\r\n\r\n // istanbul ignore else\r\n if (x === undefined) { // if x is undefined, so is y, width, and height\r\n const rect = this._containerRef.current.getBoundingClientRect();\r\n width = rect.width, height = rect.height, x = rect.left, y = rect.top;\r\n }\r\n\r\n if (this.props.resizable) {\r\n if (this.state.rightResizing) {\r\n const pointerX = event.clientX;\r\n width = pointerX - x;\r\n // istanbul ignore else\r\n if (typeof minWidth === \"number\")\r\n width = Math.max(width, minWidth);\r\n if (maxWidth !== undefined && typeof maxWidth === \"number\")\r\n width = Math.min(width, maxWidth);\r\n }\r\n\r\n if (this.state.downResizing) {\r\n const pointerY = event.clientY;\r\n height = pointerY - y!;\r\n // istanbul ignore else\r\n if (typeof minHeight === \"number\")\r\n height = Math.max(height, minHeight);\r\n if (maxHeight !== undefined && typeof maxHeight === \"number\")\r\n height = Math.min(height, maxHeight);\r\n }\r\n\r\n this.setState({ width, height });\r\n }\r\n\r\n if (movable && this.state.moving) {\r\n x = event.clientX - this.state.grabOffsetX;\r\n y = event.clientY - this.state.grabOffsetY;\r\n this.setState({ x, y, positionSet: true });\r\n }\r\n };\r\n\r\n private _handlePointerUp = (_event: PointerEvent): void => {\r\n if (!this.props.movable && !this.props.resizable)\r\n return;\r\n\r\n // istanbul ignore else\r\n if (this._containerRef.current) {\r\n this.setState({\r\n rightResizing: false,\r\n downResizing: false,\r\n moving: false,\r\n grabOffsetX: 0,\r\n grabOffsetY: 0,\r\n });\r\n }\r\n\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.removeEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/Dialog.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAC/B,0DAAsF;AACtF,qEAAkE;AAClE,sCAAmC;AAGnC,sDAAmD;AACnD,wDAA8C;AAE9C,0BAA0B;AAE1B;;GAEG;AACH,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,uCAAoB,CAAA;IAAE,8BAAW,CAAA;IAAE,yCAAsB,CAAA;IACzD,gCAAa,CAAA;IAAE,oCAAiB,CAAA;IAAE,kCAAe,CAAA;IACjD,6CAA0B,CAAA;IAAE,oCAAiB,CAAA;IAAE,+CAA4B,CAAA;AAC7E,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AA2FD;;;GAGG;AACH,MAAa,MAAO,SAAQ,KAAK,CAAC,SAAmC;IAmBnE,YAAY,KAAkB;QAC5B,KAAK,CAAC,KAAK,CAAC,CAAC;QAnBP,oBAAe,GAAG,QAAQ,CAAC;QAC3B,kBAAa,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QA0C1D,kEAAkE;QAClE,uBAAuB;QACf,2BAAsB,GAAG,GAAS,EAAE;YAC1C,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AAS,CAAC,CAAC;wBACvE,MAAM;oBACR,KAAK,iCAAgB,CAAC,QAAQ;wBAC5B,UAAU,GAAG,eAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;wBACjD,WAAW,GAAG,IAAA,oBAAU,EAAC,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;wBACvE,MAAM;iBACT;gBAED,IAAI,MAAM,CAAC,KAAK;oBACd,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;gBAE5B,OAAO,CAAC,IAAI,CAAC,oBAAC,sBAAM,IAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAG,UAAU,CAAU,CAAC,CAAC;YACjJ,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;;AAlTH,wBAubC;AApbe,mBAAY,GAAyB;IACjD,SAAS,EAAE,eAAe,CAAC,MAAM;IACjC,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,KAAK;CACjB,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 Dialog\r\n */\r\n\r\nimport \"./Dialog.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { DialogButtonDef, DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { DivWithOutsideClick } from \"../base/DivWithOutsideClick\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Omit } from \"../utils/typeUtils\";\r\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cspell:ignore focustrap\r\n\r\n/** Enum for dialog alignment\r\n * @public\r\n */\r\nexport enum DialogAlignment {\r\n TopLeft = \"top-left\", Top = \"top\", TopRight = \"top-right\",\r\n Left = \"left\", Center = \"center\", Right = \"right\",\r\n BottomLeft = \"bottom-left\", Bottom = \"bottom\", BottomRight = \"bottom-right\",\r\n}\r\n\r\n/** Properties for the [[Dialog]] component\r\n * @public\r\n */\r\nexport interface DialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"title\">, CommonProps {\r\n /** Indicates whether to show dialog or not */\r\n opened: boolean;\r\n\r\n /** Indicates whether the user can resize dialog with cursor. Default: false */\r\n resizable?: boolean;\r\n /** Indicates whether the user can move dialog with cursor. Default: false */\r\n movable?: boolean;\r\n /** Indicates whether the content should be inset. Default: true */\r\n inset?: boolean;\r\n /** Indicates whether the focus should be trapped within the dialog. Default: false */\r\n trapFocus?: boolean;\r\n\r\n /** Whether the hide the header. Default: false */\r\n hideHeader?: boolean;\r\n /** Override for the header */\r\n header?: React.ReactNode;\r\n /** Title to show in title bar of dialog */\r\n title?: string | JSX.Element;\r\n /** Footer to show at bottom of dialog. Note: will override buttonCluster */\r\n footer?: string | JSX.Element;\r\n /** List of DialogButtonDef objects specifying buttons and associated onClick events */\r\n buttonCluster?: DialogButtonDef[];\r\n\r\n /** Default alignment of dialog. Default: DialogAlignment.Center */\r\n alignment?: DialogAlignment;\r\n /** Initial x/left position of dialog in px. */\r\n x?: number;\r\n /** Initial y/top position of dialog in px. */\r\n y?: number;\r\n\r\n /** onClick event for X button for dialog */\r\n onClose?: () => void;\r\n /** 'keyup' event for Esc key */\r\n onEscape?: () => void;\r\n /** Triggered when a click is triggered outside of this dialog. */\r\n onOutsideClick?: (event: MouseEvent) => any;\r\n\r\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: \"50%\" */\r\n width?: string | number;\r\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n height?: string | number;\r\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 300px */\r\n minWidth?: string | number;\r\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100px */\r\n minHeight?: string | number;\r\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxWidth?: string | number;\r\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxHeight?: string | number;\r\n\r\n /** Whether to show background overlay. Default: true.\r\n * @note Modeless dialogs require an id and an implementation of onModelessPointerDown.\r\n */\r\n modal?: boolean;\r\n /** An id for a modeless dialog */\r\n modelessId?: string;\r\n /** Pointer Down event handler when modeless (modal = false) */\r\n onModelessPointerDown?: (event: React.PointerEvent, id: string) => void;\r\n\r\n /** Custom CSS Style for overlay */\r\n backgroundStyle?: React.CSSProperties;\r\n /** Custom CSS Style for title */\r\n titleStyle?: React.CSSProperties;\r\n /** Custom CSS Style for footer */\r\n footerStyle?: React.CSSProperties;\r\n /** Custom CSS class name for the content */\r\n contentClassName?: string;\r\n /** Custom CSS Style for the content */\r\n contentStyle?: React.CSSProperties;\r\n}\r\n\r\n/** @internal */\r\ninterface DialogState {\r\n rightResizing: boolean;\r\n downResizing: boolean;\r\n moving: boolean;\r\n grabOffsetX: number;\r\n grabOffsetY: number;\r\n x?: number;\r\n y?: number;\r\n width?: number;\r\n height?: number;\r\n positionSet: boolean;\r\n}\r\n\r\n/**\r\n * Dialog React component with optional resizing and dragging functionality\r\n * @public\r\n */\r\nexport class Dialog extends React.Component<DialogProps, DialogState> {\r\n private _parentDocument = document;\r\n private _containerRef = React.createRef<HTMLDivElement>();\r\n public static defaultProps: Partial<DialogProps> = {\r\n alignment: DialogAlignment.Center,\r\n minWidth: 300,\r\n minHeight: 100,\r\n width: \"50%\",\r\n hideHeader: false,\r\n resizable: false,\r\n movable: false,\r\n modal: true,\r\n inset: true,\r\n trapFocus: false,\r\n };\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<DialogState>;\r\n\r\n constructor(props: DialogProps) {\r\n super(props);\r\n this.state = {\r\n rightResizing: false,\r\n downResizing: false,\r\n moving: false,\r\n grabOffsetX: 0,\r\n grabOffsetY: 0,\r\n positionSet: props.x !== undefined || props.y !== undefined,\r\n };\r\n }\r\n\r\n private getParentWindow() {\r\n // istanbul ignore next\r\n return this._parentDocument.defaultView ?? window;\r\n }\r\n\r\n public override componentWillUnmount(): void {\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.removeEventListener(\"pointerup\", this._handlePointerUp, true);\r\n parentWindow.removeEventListener(\"pointermove\", this._handlePointerMove, true);\r\n this._parentDocument.removeEventListener(\"keyup\", this._handleKeyUp, true);\r\n parentWindow.addEventListener(\"resize\", this._handleAppWindowResize);\r\n }\r\n\r\n /** Keep title bar of movable Dialog at least partially visible */\r\n // istanbul ignore next\r\n private _handleAppWindowResize = (): void => {\r\n if (!this._containerRef.current || !this.props.movable)\r\n return;\r\n\r\n const parentWindow = this.getParentWindow();\r\n const { x, y } = this.state;\r\n let newX: number | undefined;\r\n let newY: number | undefined;\r\n\r\n if (undefined !== y && undefined !== x) {\r\n if (y > parentWindow.innerHeight - 32)\r\n newY = parentWindow.innerHeight - 32;\r\n if (x > parentWindow.innerWidth - 32)\r\n newX = parentWindow.innerWidth - 32;\r\n }\r\n\r\n if (newX !== undefined || newY !== undefined)\r\n this.setState({ x: newX !== undefined ? newX : x, y: newY !== undefined ? newY : y, positionSet: true });\r\n };\r\n\r\n public override componentDidMount(): void {\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointerup\", this._handlePointerUp, true);\r\n this._parentDocument.addEventListener(\"keyup\", this._handleKeyUp, true);\r\n parentWindow.addEventListener(\"resize\", this._handleAppWindowResize);\r\n }\r\n\r\n public handleRefSet = (containerDiv: HTMLDivElement | null) => {\r\n if (containerDiv)\r\n this._parentDocument = containerDiv.ownerDocument;\r\n };\r\n\r\n public override render(): JSX.Element {\r\n const {\r\n opened, title, footer, buttonCluster, onClose, onEscape, onOutsideClick, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n minWidth, minHeight, x, y, width, height, maxHeight, maxWidth,\r\n backgroundStyle, titleStyle, footerStyle, style, contentStyle, contentClassName,\r\n modal, resizable, movable, className, alignment, inset, trapFocus, modelessId, onModelessPointerDown, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n hideHeader, header, ...props } = this.props;\r\n\r\n const containerStyle: React.CSSProperties = {\r\n margin: \"\",\r\n left: x, top: y,\r\n width, height,\r\n };\r\n\r\n if (this.state.x !== undefined || this.state.y !== undefined) {\r\n // istanbul ignore else\r\n if (this.state.x !== undefined) {\r\n containerStyle.marginLeft = \"0\";\r\n containerStyle.marginRight = \"0\";\r\n containerStyle.left = this.state.x;\r\n }\r\n // istanbul ignore else\r\n if (this.state.y !== undefined) {\r\n containerStyle.marginTop = \"0\";\r\n containerStyle.marginBottom = \"0\";\r\n containerStyle.top = this.state.y;\r\n }\r\n }\r\n\r\n if (this.state.width !== undefined || this.state.height !== undefined) {\r\n // istanbul ignore else\r\n if (this.state.width !== undefined)\r\n containerStyle.width = this.state.width;\r\n // istanbul ignore else\r\n if (this.state.height !== undefined)\r\n containerStyle.height = this.state.height;\r\n }\r\n\r\n const minMaxStyle: React.CSSProperties = {};\r\n minMaxStyle.minWidth = (typeof minWidth === \"number\") ? `${minWidth}px` : minWidth;\r\n minMaxStyle.minHeight = (typeof minHeight === \"number\") ? `${minHeight}px` : minHeight;\r\n if (maxWidth !== undefined)\r\n minMaxStyle.maxWidth = (typeof maxWidth === \"number\") ? `${maxWidth}px` : maxWidth;\r\n if (maxHeight !== undefined)\r\n minMaxStyle.maxHeight = (typeof maxHeight === \"number\") ? `${maxHeight}px` : maxHeight;\r\n\r\n const buttons = this.getFooterButtons(this.props);\r\n\r\n const footerElement: React.ReactNode = footer || (buttons.length > 0 && <div className={\"core-dialog-buttons\"}>{buttons}</div>);\r\n\r\n const divStyle: React.CSSProperties = {\r\n ...backgroundStyle,\r\n ...style,\r\n };\r\n\r\n const headerElement = header || (\r\n <div\r\n className={classnames(\r\n \"core-dialog-head\",\r\n { \"core-dialog-movable\": movable },\r\n { \"core-dialog-modal\": modal }\r\n )}\r\n data-testid=\"core-dialog-head\"\r\n onPointerDown={this._handleStartMove}>\r\n <div className={\"core-dialog-title\"} data-testid=\"core-dialog-title\" style={titleStyle}>{title}</div>\r\n <button\r\n className={\"core-focus-trap-ignore-initial core-dialog-close icon icon-close\"}\r\n data-testid=\"core-dialog-close\"\r\n onClick={onClose}\r\n />\r\n </div>\r\n );\r\n\r\n return (\r\n <div ref={this.handleRefSet}\r\n className={classnames(\r\n \"core-dialog\",\r\n !modal && \"core-dialog-hidden\",\r\n opened && \"core-dialog-opened\",\r\n className,\r\n )}\r\n style={divStyle}\r\n data-testid=\"core-dialog-root\"\r\n {...props}\r\n >\r\n {opened &&\r\n <DivWithOutsideClick onOutsideClick={onOutsideClick}>\r\n <FocusTrap active={trapFocus && modal} returnFocusOnDeactivate={true}>\r\n <div\r\n className={classnames(\"core-dialog-container\", this.getCSSClassNameFromAlignment(alignment))}\r\n style={{ ...containerStyle, ...minMaxStyle }}\r\n data-testid=\"core-dialog-container\"\r\n onPointerDown={this._handleContainerPointerDown}\r\n >\r\n <div className={\"core-dialog-area\"} ref={this._containerRef} style={minMaxStyle}>\r\n {!hideHeader &&\r\n headerElement\r\n }\r\n <div\r\n className={classnames(\r\n \"core-dialog-content\",\r\n { \"core-dialog-content-no-inset\": !inset },\r\n contentClassName)}\r\n style={contentStyle}>\r\n {this.props.children}\r\n </div>\r\n {footerElement &&\r\n <div className={\"core-dialog-footer\"} style={footerStyle}>\r\n {footerElement}\r\n </div>\r\n }\r\n <div\r\n className={classnames(\"core-dialog-drag\", \"core-dialog-drag-right\", { \"core-dialog-drag-enabled\": resizable })}\r\n data-testid=\"core-dialog-drag-right\"\r\n onPointerDown={this._handleStartResizeRight}\r\n />\r\n <div\r\n className={classnames(\"core-dialog-drag\", \"core-dialog-drag-bottom-mid\", { \"core-dialog-drag-enabled\": resizable })}\r\n data-testid=\"core-dialog-drag-bottom\"\r\n onPointerDown={this._handleStartResizeDown}\r\n />\r\n <div\r\n className={classnames(\"core-dialog-drag\", \"core-dialog-drag-bottom-right\", { \"core-dialog-drag-enabled\": resizable })}\r\n data-testid=\"core-dialog-drag-bottom-right\"\r\n onPointerDown={this._handleStartResizeDownRight}\r\n />\r\n </div>\r\n </div>\r\n </FocusTrap>\r\n </DivWithOutsideClick>\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n private getCSSClassNameFromAlignment(alignment?: DialogAlignment): string {\r\n let className = \"\";\r\n\r\n // Drop the alignment CSS class if the Dialog has been sized or moved.\r\n if (this.state.positionSet)\r\n return \"\";\r\n\r\n // istanbul ignore next\r\n if (!alignment)\r\n alignment = DialogAlignment.Center;\r\n\r\n switch (alignment) {\r\n case DialogAlignment.TopLeft:\r\n className = \"core-dialog-top-left\";\r\n break;\r\n case DialogAlignment.Top:\r\n className = \"core-dialog-top\";\r\n break;\r\n case DialogAlignment.TopRight:\r\n className = \"core-dialog-top-right\";\r\n break;\r\n case DialogAlignment.Left:\r\n className = \"core-dialog-left\";\r\n break;\r\n case DialogAlignment.Center:\r\n className = \"core-dialog-center\";\r\n break;\r\n case DialogAlignment.Right:\r\n className = \"core-dialog-right\";\r\n break;\r\n case DialogAlignment.BottomLeft:\r\n className = \"core-dialog-bottom-left\";\r\n break;\r\n case DialogAlignment.Bottom:\r\n className = \"core-dialog-bottom\";\r\n break;\r\n case DialogAlignment.BottomRight:\r\n className = \"core-dialog-bottom-right\";\r\n break;\r\n }\r\n\r\n return className;\r\n }\r\n\r\n private getFooterButtons(props: DialogProps) {\r\n const buttons: React.ReactNode[] = [];\r\n if (props.buttonCluster) {\r\n props.buttonCluster.forEach((button: DialogButtonDef, index: number) => {\r\n let buttonText = \"\";\r\n let buttonClass = classnames(\"core-dialog-button\", `dialog-button-${button.type}`, button.className);\r\n\r\n switch (button.type) {\r\n case DialogButtonType.OK:\r\n buttonText = UiCore.translate(\"dialog.ok\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.Retry:\r\n buttonText = UiCore.translate(\"dialog.retry\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.Yes:\r\n buttonText = UiCore.translate(\"dialog.yes\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.No:\r\n buttonText = UiCore.translate(\"dialog.no\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle);\r\n break;\r\n case DialogButtonType.Cancel:\r\n buttonText = UiCore.translate(\"dialog.cancel\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle);\r\n break;\r\n case DialogButtonType.Close:\r\n buttonText = UiCore.translate(\"dialog.close\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle);\r\n break;\r\n case DialogButtonType.Next:\r\n buttonText = UiCore.translate(\"dialog.next\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n case DialogButtonType.Previous:\r\n buttonText = UiCore.translate(\"dialog.previous\");\r\n buttonClass = classnames(buttonClass, button.buttonStyle || \"iui-cta\");\r\n break;\r\n }\r\n\r\n if (button.label)\r\n buttonText = button.label;\r\n\r\n buttons.push(<Button className={buttonClass} disabled={button.disabled} key={index.toString()} onClick={button.onClick}>{buttonText}</Button>);\r\n });\r\n }\r\n return buttons;\r\n }\r\n\r\n private _handleKeyUp = (event: KeyboardEvent) => {\r\n if (event.key === SpecialKey.Escape && this.props.opened && this.props.onEscape) {\r\n this.props.onEscape();\r\n }\r\n };\r\n\r\n private _handleContainerPointerDown = (event: React.PointerEvent): void => {\r\n if (!this.props.modal) {\r\n if (this.props.onModelessPointerDown && this.props.modelessId)\r\n this.props.onModelessPointerDown(event, this.props.modelessId);\r\n }\r\n };\r\n\r\n private _handleStartResizeRight = (event: React.PointerEvent): void => {\r\n event.preventDefault();\r\n this.setState({ rightResizing: true });\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n\r\n private _handleStartResizeDown = (event: React.PointerEvent): void => {\r\n event.preventDefault();\r\n this.setState({ downResizing: true });\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n\r\n private _handleStartResizeDownRight = (event: React.PointerEvent): void => {\r\n event.preventDefault();\r\n this.setState({ downResizing: true, rightResizing: true });\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n\r\n private _handleStartMove = (event: React.PointerEvent): void => {\r\n if (!this.props.movable)\r\n return;\r\n\r\n event.preventDefault();\r\n // istanbul ignore else\r\n if (this._containerRef.current) {\r\n const rect = this._containerRef.current.getBoundingClientRect();\r\n const grabOffsetX = event.clientX - rect.left;\r\n const grabOffsetY = event.clientY - rect.top;\r\n this.setState({\r\n grabOffsetX,\r\n grabOffsetY,\r\n moving: true,\r\n });\r\n\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\r\n }\r\n };\r\n\r\n private _handlePointerMove = (event: PointerEvent): void => {\r\n if ((!this.props.resizable && !this.props.movable) || !this._containerRef.current)\r\n return;\r\n\r\n const { minWidth, maxWidth, minHeight, maxHeight, movable } = this.props;\r\n let { x, y, width, height } = this.state;\r\n\r\n // istanbul ignore else\r\n if (x === undefined) { // if x is undefined, so is y, width, and height\r\n const rect = this._containerRef.current.getBoundingClientRect();\r\n width = rect.width, height = rect.height, x = rect.left, y = rect.top;\r\n }\r\n\r\n if (this.props.resizable) {\r\n if (this.state.rightResizing) {\r\n const pointerX = event.clientX;\r\n width = pointerX - x;\r\n // istanbul ignore else\r\n if (typeof minWidth === \"number\")\r\n width = Math.max(width, minWidth);\r\n if (maxWidth !== undefined && typeof maxWidth === \"number\")\r\n width = Math.min(width, maxWidth);\r\n }\r\n\r\n if (this.state.downResizing) {\r\n const pointerY = event.clientY;\r\n height = pointerY - y!;\r\n // istanbul ignore else\r\n if (typeof minHeight === \"number\")\r\n height = Math.max(height, minHeight);\r\n if (maxHeight !== undefined && typeof maxHeight === \"number\")\r\n height = Math.min(height, maxHeight);\r\n }\r\n\r\n this.setState({ width, height });\r\n }\r\n\r\n // istanbul ignore next\r\n if (movable && this.state.moving) {\r\n x = event.clientX - this.state.grabOffsetX;\r\n y = event.clientY - this.state.grabOffsetY;\r\n if (y < 0)\r\n y = 0;\r\n if (event.view) {\r\n if (y > event.view.innerHeight - 32)\r\n y = event.view.innerHeight - 32;\r\n if (x > event.view.innerWidth - 32)\r\n x = event.view.innerWidth - 32;\r\n if (width) {\r\n if (x < (0 - width + 32))\r\n x = 0 - width + 32;\r\n }\r\n }\r\n\r\n this.setState({ x, y, positionSet: true });\r\n }\r\n };\r\n\r\n private _handlePointerUp = (_event: PointerEvent): void => {\r\n if (!this.props.movable && !this.props.resizable)\r\n return;\r\n\r\n // istanbul ignore else\r\n if (this._containerRef.current) {\r\n this.setState({\r\n rightResizing: false,\r\n downResizing: false,\r\n moving: false,\r\n grabOffsetX: 0,\r\n grabOffsetY: 0,\r\n });\r\n }\r\n\r\n const parentWindow = this.getParentWindow();\r\n parentWindow.removeEventListener(\"pointermove\", this._handlePointerMove, true);\r\n };\r\n}\r\n"]}
@@ -15,7 +15,7 @@ const useRefs_1 = require("../utils/hooks/useRefs");
15
15
  // Defined using following pattern (const Input at bottom) to ensure useful API documentation is extracted
16
16
  const ForwardRefInput = React.forwardRef(// eslint-disable-line deprecation/deprecation
17
17
  function ForwardRefInput(props, ref) {
18
- const { className, style, setFocus, nativeKeyHandler, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars
18
+ const { className, style, setFocus, nativeKeyHandler, size, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars
19
19
  const inputElementRef = React.useRef();
20
20
  const refs = (0, useRefs_1.useRefs)(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.
21
21
  React.useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/Input.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;AAC/B,wDAA8D;AAC9D,oDAAiD;AAgBjD,0GAA0G;AAC1G,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAkC,8CAA8C;AACtH,SAAS,eAAe,CAAC,KAAK,EAAE,GAAG;IACjC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,wDAAwD;IACvI,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,EAAoB,CAAC;IACzD,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,eAAe,EAAE,GAAG,CAAC,CAAC,CAAE,uGAAuG;IAEpJ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC;QAC/C,MAAM,cAAc,GAAG,gBAAgB,CAAC;QAExC,IAAI,cAAc,IAAI,cAAc,EAAE;YACpC,cAAc,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;SAC5D;QACD,OAAO,GAAG,EAAE;YACV,IAAI,cAAc,IAAI,cAAc,EAAE;gBACpC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;aAC/D;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,eAAe,CAAC,OAAO,IAAI,QAAQ;YACrC,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAyC,EAAE,EAAE;QAClF,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,qBAAa,IAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,KAAK,UAAU,EAAE,OAAO,EAAE,WAAW,EACxE,SAAS,EAAE,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,KAAK,GAA8C,eAAe,CAAC,CAAE,8CAA8C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Inputs\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Input as ITwinUI_Input } from \"@itwin/itwinui-react\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for the [[Input]] component\r\n * @public\r\n * @deprecated Use InputProps in itwinui-react instead\r\n */\r\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n /** Native keydown event handler */\r\n nativeKeyHandler?: (e: KeyboardEvent) => void;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\n// Defined using following pattern (const Input at bottom) to ensure useful API documentation is extracted\r\nconst ForwardRefInput = React.forwardRef<HTMLInputElement, InputProps>( // eslint-disable-line deprecation/deprecation\r\n function ForwardRefInput(props, ref) {\r\n const { className, style, setFocus, nativeKeyHandler, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const inputElementRef = React.useRef<HTMLInputElement>();\r\n const refs = useRefs(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n\r\n React.useEffect(() => {\r\n const currentElement = inputElementRef.current;\r\n const currentHandler = nativeKeyHandler;\r\n\r\n if (currentElement && currentHandler) {\r\n currentElement.addEventListener(\"keydown\", currentHandler);\r\n }\r\n return () => {\r\n if (currentHandler && currentElement) {\r\n currentElement.removeEventListener(\"keydown\", currentHandler);\r\n }\r\n };\r\n }, [nativeKeyHandler]);\r\n\r\n React.useEffect(() => {\r\n if (inputElementRef.current && setFocus)\r\n inputElementRef.current.focus();\r\n }, [setFocus]);\r\n\r\n const handleFocus = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n event.currentTarget.select();\r\n }, []);\r\n\r\n return (\r\n <ITwinUI_Input ref={refs} type=\"text\" {...otherProps} onFocus={handleFocus}\r\n className={classnames(\"uicore-inputs-input\", className)} style={style} />\r\n );\r\n }\r\n);\r\n\r\n/** Basic text input, is a wrapper for the `<input type=\"text\">` HTML element.\r\n * @public\r\n * @deprecated Use Input in itwinui-react instead\r\n */\r\nexport const Input: (props: InputProps) => JSX.Element | null = ForwardRefInput; // eslint-disable-line deprecation/deprecation\r\n"]}
1
+ {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/Input.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;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C,CAAC;IAEP,OAAO,CACL,oBAAC,qBAAa,IAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,KAAK,UAAU,EAAE,OAAO,EAAE,WAAW,EACxE,SAAS,EAAE,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,KAAK,GAA8C,eAAe,CAAC,CAAE,8CAA8C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Inputs\r\n */\r\n\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Input as ITwinUI_Input } from \"@itwin/itwinui-react\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/** Properties for the [[Input]] component\r\n * @public\r\n * @deprecated Use InputProps in itwinui-react instead\r\n */\r\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n /** Native keydown event handler */\r\n nativeKeyHandler?: (e: KeyboardEvent) => void;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\n// Defined using following pattern (const Input at bottom) to ensure useful API documentation is extracted\r\nconst ForwardRefInput = React.forwardRef<HTMLInputElement, InputProps>( // eslint-disable-line deprecation/deprecation\r\n function ForwardRefInput(props, ref) {\r\n const { className, style, setFocus, nativeKeyHandler, size, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const inputElementRef = React.useRef<HTMLInputElement>();\r\n const refs = useRefs(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n\r\n React.useEffect(() => {\r\n const currentElement = inputElementRef.current;\r\n const currentHandler = nativeKeyHandler;\r\n\r\n if (currentElement && currentHandler) {\r\n currentElement.addEventListener(\"keydown\", currentHandler);\r\n }\r\n return () => {\r\n if (currentHandler && currentElement) {\r\n currentElement.removeEventListener(\"keydown\", currentHandler);\r\n }\r\n };\r\n }, [nativeKeyHandler]);\r\n\r\n React.useEffect(() => {\r\n if (inputElementRef.current && setFocus)\r\n inputElementRef.current.focus();\r\n }, [setFocus]);\r\n\r\n const handleFocus = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n event.currentTarget.select();\r\n }, []);\r\n\r\n return (\r\n <ITwinUI_Input ref={refs} type=\"text\" {...otherProps} onFocus={handleFocus}\r\n className={classnames(\"uicore-inputs-input\", className)} style={style} />\r\n );\r\n }\r\n);\r\n\r\n/** Basic text input, is a wrapper for the `<input type=\"text\">` HTML element.\r\n * @public\r\n * @deprecated Use Input in itwinui-react instead\r\n */\r\nexport const Input: (props: InputProps) => JSX.Element | null = ForwardRefInput; // eslint-disable-line deprecation/deprecation\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../../src/core-react/slider/Slider.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAC/B,wDAA6D;AAE7D,+CAA4C;AA6E5C;;;;IAII;AACJ,SAAgB,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,EAC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,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,mBAAQ,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 };\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,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAC/B,wDAA6D;AAE7D,+CAA4C;AA6E5C;;;;IAII;AACJ,SAAgB,MAAM,CAAC,KAAkB;IACv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AAU,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;AAvGD,wBAuGC;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,mBAAQ,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 +1 @@
1
- {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C;;GAEG;AACH,oBAAY,uBAAuB,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IAClF,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF;;GAEG;AACH,oBAAY,oBAAoB,GAAG,CAAC,KAAK,EAAE,uBAAuB,KAAK,KAAK,CAAC,SAAS,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAI/B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,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Toggle();
39
39
  };
40
40
  this._onClick = (e) => {
41
+ var _a, _b;
41
42
  e.stopPropagation();
42
- if (this.props.onClick)
43
- this.props.onClick(e);
43
+ (_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
44
44
  };
45
45
  }
46
46
  render() {