@itwin/core-react 5.19.0 → 5.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/core-react/UiCore.js +2 -1
- package/lib/core-react/UiCore.js.map +1 -1
- package/lib/core-react/autosuggest/AutoSuggest.js +86 -86
- package/lib/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/core-react/contextmenu/ContextMenu.js +272 -269
- package/lib/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/core-react/contextmenu/ContextMenuItem.js +57 -55
- package/lib/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/core-react/contextmenu/ContextSubMenu.js +70 -67
- package/lib/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/core-react/contextmenu/GlobalContextMenu.js +23 -22
- package/lib/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/core-react/contextmenu/TildeFinder.js +52 -52
- package/lib/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/core-react/dialog/Dialog.js +29 -29
- package/lib/core-react/dialog/Dialog.js.map +1 -1
- package/lib/core-react/dialog/GlobalDialog.js +24 -23
- package/lib/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/core-react/expandable/ExpandableList.js +15 -15
- package/lib/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/core-react/focus/ItemKeyboardNavigator.js +7 -3
- package/lib/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/core-react/hocs/withIsPressed.js +14 -17
- package/lib/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/core-react/hocs/withOnOutsideClick.js +38 -41
- package/lib/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/core-react/hocs/withTimeout.js +2 -5
- package/lib/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/core-react/icons/ConditionalIconItem.js +3 -0
- package/lib/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/core-react/imagecheckbox/ImageCheckBox.js +15 -18
- package/lib/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/core-react/loading/LoadingBar.js +3 -3
- package/lib/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/core-react/loading/LoadingPrompt.js +9 -9
- package/lib/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/core-react/loading/LoadingSpinner.js +3 -3
- package/lib/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/core-react/loading/LoadingStatus.js +4 -4
- package/lib/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/core-react/messagebox/MessageBox.js +6 -6
- package/lib/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/core-react/popup/Popup.js +209 -209
- package/lib/core-react/popup/Popup.js.map +1 -1
- package/lib/core-react/radialmenu/Annulus.js +19 -2
- package/lib/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/core-react/radialmenu/RadialMenu.js +56 -56
- package/lib/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/core-react/searchbox/SearchBox.js +60 -60
- package/lib/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/core-react/settings/SettingsManager.js +20 -22
- package/lib/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/core-react/tabs/Tabs.js +14 -13
- package/lib/core-react/tabs/Tabs.js.map +1 -1
- package/lib/core-react/tree/Node.js +18 -18
- package/lib/core-react/tree/Node.js.map +1 -1
- package/lib/core-react/tree/Tree.js +1 -4
- package/lib/core-react/tree/Tree.js.map +1 -1
- package/lib/core-react/uistate/LocalStateStorage.js +1 -0
- package/lib/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/core-react/uistate/UiStateEntry.js +5 -0
- package/lib/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/core-react/utils/Point.js +2 -0
- package/lib/core-react/utils/Point.js.map +1 -1
- package/lib/core-react/utils/Rectangle.js +4 -0
- package/lib/core-react/utils/Rectangle.js.map +1 -1
- package/lib/core-react/utils/ScrollPositionMaintainer.js +1 -0
- package/lib/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/core-react/utils/Timer.js +5 -2
- package/lib/core-react/utils/Timer.js.map +1 -1
- package/package.json +3 -3
|
@@ -12,23 +12,20 @@ import * as React from "react";
|
|
|
12
12
|
*/
|
|
13
13
|
export const withIsPressed = (Component) => {
|
|
14
14
|
return class WithIsPressed extends React.PureComponent {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.props.onIsPressedChange && this.props.onIsPressedChange(isPressed);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
15
|
+
handleOnPointerDown = () => {
|
|
16
|
+
this.changeIsPressed(true);
|
|
17
|
+
};
|
|
18
|
+
handleOnPointerUp = () => {
|
|
19
|
+
this.changeIsPressed(false);
|
|
20
|
+
};
|
|
21
|
+
handleOnMouseLeave = () => {
|
|
22
|
+
this.changeIsPressed(false);
|
|
23
|
+
};
|
|
24
|
+
changeIsPressed = (isPressed) => {
|
|
25
|
+
if (this.props.isPressed === isPressed)
|
|
26
|
+
return;
|
|
27
|
+
this.props.onIsPressedChange && this.props.onIsPressedChange(isPressed);
|
|
28
|
+
};
|
|
32
29
|
render() {
|
|
33
30
|
const { isPressed, onIsPressedChange, ...props } = this.props; // todo: better solution to rest object of intersected type
|
|
34
31
|
return (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIsPressed.js","sourceRoot":"","sources":["../../../src/core-react/hocs/withIsPressed.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,SAA8C,EAC9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AE,IAAI,CAAC,kBAAkB;gBAErC,oBAAC,SAAS,OAAM,KAAwB,KAAM,IAAI,CAAC,KAAK,GAAI,CACxD,CACP,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\n\n/** Properties for [[withIsPressed]] React higher-order component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link withIsPressed} HOC.\n */\nexport interface WithIsPressedProps {\n /** initial value for pressed status */\n isPressed?: boolean;\n /** callback function for [isPressed] change */\n onIsPressedChange?: (isPressed: boolean) => void;\n}\n\n/** withIsPressed is a React higher-order component that adds pointer and mouse events.\n * @public\n * @deprecated in 4.15.0. Not used by AppUI.\n */\nexport const withIsPressed = <ComponentProps extends object>(\n Component: React.ComponentType<ComponentProps>\n) => {\n return class WithIsPressed extends React.PureComponent<\n ComponentProps & WithIsPressedProps // eslint-disable-line @typescript-eslint/no-deprecated\n > {\n public handleOnPointerDown = () => {\n this.changeIsPressed(true);\n };\n\n public handleOnPointerUp = () => {\n this.changeIsPressed(false);\n };\n\n public handleOnMouseLeave = () => {\n this.changeIsPressed(false);\n };\n\n public changeIsPressed = (isPressed: boolean) => {\n if (this.props.isPressed === isPressed) return;\n\n this.props.onIsPressedChange && this.props.onIsPressedChange(isPressed);\n };\n\n public override render() {\n const { isPressed, onIsPressedChange, ...props } = this.props; // todo: better solution to rest object of intersected type\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n className=\"withispressed-wrapper\"\n onMouseDown={this.handleOnPointerDown}\n onMouseUp={this.handleOnPointerUp}\n onTouchStart={this.handleOnPointerDown}\n onTouchEnd={this.handleOnPointerUp}\n onMouseLeave={this.handleOnMouseLeave}\n >\n <Component {...(props as ComponentProps)} {...this.state} />\n </div>\n );\n }\n };\n};\n"]}
|
|
@@ -12,47 +12,10 @@ import * as React from "react";
|
|
|
12
12
|
*/
|
|
13
13
|
export const withOnOutsideClick = (Component, defaultOnOutsideClick, useCapture = true, usePointerEvents = true) => {
|
|
14
14
|
return class WithOnOutsideClick extends React.PureComponent {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/** @internal */
|
|
20
|
-
this.isDownOutside = false;
|
|
21
|
-
/** @internal */
|
|
22
|
-
this.handleDocumentClick = (e) => {
|
|
23
|
-
if (!this.outsideClickContainerDiv ||
|
|
24
|
-
!(e.target instanceof Node) ||
|
|
25
|
-
this.outsideClickContainerDiv.contains(e.target))
|
|
26
|
-
return;
|
|
27
|
-
return this.onOutsideClick(e);
|
|
28
|
-
};
|
|
29
|
-
/** @internal */
|
|
30
|
-
this.handleDocumentPointerDown = (e) => {
|
|
31
|
-
this.isDownOutside = true;
|
|
32
|
-
if (this.outsideClickContainerDiv) {
|
|
33
|
-
// typically e.target test for instance of Node, but this is not working from pop out windows
|
|
34
|
-
this.isDownOutside =
|
|
35
|
-
!!e.target &&
|
|
36
|
-
!this.outsideClickContainerDiv.contains(e.target);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
/** @internal */
|
|
40
|
-
this.handleDocumentPointerUp = (e) => {
|
|
41
|
-
let isUpOutside = true;
|
|
42
|
-
if (this.outsideClickContainerDiv) {
|
|
43
|
-
// typically e.target test for instance of Node, but this is not working from pop out windows
|
|
44
|
-
isUpOutside =
|
|
45
|
-
!!e.target &&
|
|
46
|
-
!this.outsideClickContainerDiv.contains(e.target);
|
|
47
|
-
}
|
|
48
|
-
const isOutsideClick = isUpOutside && this.isDownOutside;
|
|
49
|
-
this.isDownOutside = false;
|
|
50
|
-
isOutsideClick && this.onOutsideClick(e);
|
|
51
|
-
};
|
|
52
|
-
this.handleOutsideClickContainerDivSet = (outsideClickContainerDiv) => {
|
|
53
|
-
this.outsideClickContainerDiv = outsideClickContainerDiv;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
outsideClickContainerDiv = null;
|
|
17
|
+
/** @internal */
|
|
18
|
+
isDownOutside = false;
|
|
56
19
|
/** @internal */
|
|
57
20
|
isInCorePopup(element) {
|
|
58
21
|
if (element.nodeName === "DIV") {
|
|
@@ -79,6 +42,40 @@ export const withOnOutsideClick = (Component, defaultOnOutsideClick, useCapture
|
|
|
79
42
|
else if (defaultOnOutsideClick)
|
|
80
43
|
return defaultOnOutsideClick(e);
|
|
81
44
|
}
|
|
45
|
+
/** @internal */
|
|
46
|
+
handleDocumentClick = (e) => {
|
|
47
|
+
if (!this.outsideClickContainerDiv ||
|
|
48
|
+
!(e.target instanceof Node) ||
|
|
49
|
+
this.outsideClickContainerDiv.contains(e.target))
|
|
50
|
+
return;
|
|
51
|
+
return this.onOutsideClick(e);
|
|
52
|
+
};
|
|
53
|
+
/** @internal */
|
|
54
|
+
handleDocumentPointerDown = (e) => {
|
|
55
|
+
this.isDownOutside = true;
|
|
56
|
+
if (this.outsideClickContainerDiv) {
|
|
57
|
+
// typically e.target test for instance of Node, but this is not working from pop out windows
|
|
58
|
+
this.isDownOutside =
|
|
59
|
+
!!e.target &&
|
|
60
|
+
!this.outsideClickContainerDiv.contains(e.target);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
/** @internal */
|
|
64
|
+
handleDocumentPointerUp = (e) => {
|
|
65
|
+
let isUpOutside = true;
|
|
66
|
+
if (this.outsideClickContainerDiv) {
|
|
67
|
+
// typically e.target test for instance of Node, but this is not working from pop out windows
|
|
68
|
+
isUpOutside =
|
|
69
|
+
!!e.target &&
|
|
70
|
+
!this.outsideClickContainerDiv.contains(e.target);
|
|
71
|
+
}
|
|
72
|
+
const isOutsideClick = isUpOutside && this.isDownOutside;
|
|
73
|
+
this.isDownOutside = false;
|
|
74
|
+
isOutsideClick && this.onOutsideClick(e);
|
|
75
|
+
};
|
|
76
|
+
handleOutsideClickContainerDivSet = (outsideClickContainerDiv) => {
|
|
77
|
+
this.outsideClickContainerDiv = outsideClickContainerDiv;
|
|
78
|
+
};
|
|
82
79
|
getParentDocument() {
|
|
83
80
|
return this.outsideClickContainerDiv?.ownerDocument ?? document;
|
|
84
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withOnOutsideClick.js","sourceRoot":"","sources":["../../../src/core-react/hocs/withOnOutsideClick.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAA8C,EAC9C,qBAAkD,EAClD,aAAsB,IAAI,EAC1B,mBAA4B,IAAI,EAChC,EAAE;IACF,OAAO,MAAM,kBAAmB,SAAQ,KAAK,CAAC,aAE7C;
|
|
1
|
+
{"version":3,"file":"withOnOutsideClick.js","sourceRoot":"","sources":["../../../src/core-react/hocs/withOnOutsideClick.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAA8C,EAC9C,qBAAkD,EAClD,aAAsB,IAAI,EAC1B,mBAA4B,IAAI,EAChC,EAAE;IACF,OAAO,MAAM,kBAAmB,SAAQ,KAAK,CAAC,aAE7C;QACC,gBAAgB;QACT,wBAAwB,GAA2B,IAAI,CAAC;QAC/D,gBAAgB;QACT,aAAa,GAAG,KAAK,CAAC;QAE7B,gBAAgB;QACT,aAAa,CAAC,OAAoB;YACvC,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;gBAC/B,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;oBAC/D,OAAO,IAAI,CAAC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,EACxB,UAAU,CACX,CAAC;QACN,CAAC;QAEe,oBAAoB;YAClC,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5D,IAAI,gBAAgB,EAAE,CAAC;gBACrB,0BAA0B,CAAC,mBAAmB,CAC5C,aAAa,EACb,IAAI,CAAC,yBAAyB,EAC9B,UAAU,CACX,CAAC;gBACF,0BAA0B,CAAC,mBAAmB,CAC5C,WAAW,EACX,IAAI,CAAC,uBAAuB,EAC5B,UAAU,CACX,CAAC;YACJ,CAAC;;gBACC,0BAA0B,CAAC,mBAAmB,CAC5C,OAAO,EACP,IAAI,CAAC,mBAAmB,EACxB,UAAU,CACX,CAAC;QACN,CAAC;QAEe,MAAM;YACpB,MAAM,EAAE,cAAc,EAAE,8BAA8B,EAAE,GAAG,KAAK,EAAE,GAChE,IAAI,CAAC,KAAK,CAAC;YACb,OAAO,CACL,6BAAK,GAAG,EAAE,IAAI,CAAC,iCAAiC;gBAC9C,oBAAC,SAAS,OAAM,KAAwB,GAAI,CACxC,CACP,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\n\n/** Properties for [[withOnOutsideClick]] React higher-order component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link withOnOutsideClick} HOC.\n */\nexport interface WithOnOutsideClickProps {\n /** Outside click callback function */\n onOutsideClick?: (event: MouseEvent) => any;\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\n closeOnNestedPopupOutsideClick?: boolean;\n}\n\n/** withOnOutsideClick is a React higher-order component that adds outside click support.\n * @public\n * @deprecated in 4.15.0. Used internally.\n */\nexport const withOnOutsideClick = <ComponentProps extends object>(\n Component: React.ComponentType<ComponentProps>,\n defaultOnOutsideClick?: (event: MouseEvent) => any,\n useCapture: boolean = true,\n usePointerEvents: boolean = true\n) => {\n return class WithOnOutsideClick extends React.PureComponent<\n ComponentProps & WithOnOutsideClickProps // eslint-disable-line @typescript-eslint/no-deprecated\n > {\n /** @internal */\n public outsideClickContainerDiv?: HTMLDivElement | null = null;\n /** @internal */\n public isDownOutside = false;\n\n /** @internal */\n public isInCorePopup(element: HTMLElement): boolean {\n if (element.nodeName === \"DIV\") {\n if (element.classList && element.classList.contains(\"core-popup\"))\n return true;\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n } else {\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n }\n return false;\n }\n\n /** @internal */\n public onOutsideClick(e: MouseEvent) {\n if (e.target instanceof Node && e.target.nodeType === Node.ELEMENT_NODE) {\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(e.target as HTMLElement)\n )\n return;\n }\n\n if (this.props.onOutsideClick) return this.props.onOutsideClick(e);\n else if (defaultOnOutsideClick) return defaultOnOutsideClick(e);\n }\n\n /** @internal */\n public handleDocumentClick = (e: MouseEvent) => {\n if (\n !this.outsideClickContainerDiv ||\n !(e.target instanceof Node) ||\n this.outsideClickContainerDiv.contains(e.target)\n )\n return;\n\n return this.onOutsideClick(e);\n };\n\n /** @internal */\n public handleDocumentPointerDown = (e: PointerEvent) => {\n this.isDownOutside = true;\n if (this.outsideClickContainerDiv) {\n // typically e.target test for instance of Node, but this is not working from pop out windows\n this.isDownOutside =\n !!e.target &&\n !this.outsideClickContainerDiv.contains(e.target as any);\n }\n };\n\n /** @internal */\n public handleDocumentPointerUp = (e: PointerEvent) => {\n let isUpOutside = true;\n if (this.outsideClickContainerDiv) {\n // typically e.target test for instance of Node, but this is not working from pop out windows\n isUpOutside =\n !!e.target &&\n !this.outsideClickContainerDiv.contains(e.target as any);\n }\n\n const isOutsideClick = isUpOutside && this.isDownOutside;\n this.isDownOutside = false;\n isOutsideClick && this.onOutsideClick(e);\n };\n\n public handleOutsideClickContainerDivSet = (\n outsideClickContainerDiv: HTMLDivElement | null\n ) => {\n this.outsideClickContainerDiv = outsideClickContainerDiv;\n };\n\n public getParentDocument() {\n return this.outsideClickContainerDiv?.ownerDocument ?? document;\n }\n\n public override componentDidMount() {\n const outsideClickParentDocument = this.getParentDocument();\n if (usePointerEvents) {\n outsideClickParentDocument.addEventListener(\n \"pointerdown\",\n this.handleDocumentPointerDown,\n useCapture\n );\n outsideClickParentDocument.addEventListener(\n \"pointerup\",\n this.handleDocumentPointerUp,\n useCapture\n );\n } else\n outsideClickParentDocument.addEventListener(\n \"click\",\n this.handleDocumentClick,\n useCapture\n );\n }\n\n public override componentWillUnmount() {\n const outsideClickParentDocument = this.getParentDocument();\n if (usePointerEvents) {\n outsideClickParentDocument.removeEventListener(\n \"pointerdown\",\n this.handleDocumentPointerDown,\n useCapture\n );\n outsideClickParentDocument.removeEventListener(\n \"pointerup\",\n this.handleDocumentPointerUp,\n useCapture\n );\n } else\n outsideClickParentDocument.removeEventListener(\n \"click\",\n this.handleDocumentClick,\n useCapture\n );\n }\n\n public override render() {\n const { onOutsideClick, closeOnNestedPopupOutsideClick, ...props } =\n this.props;\n return (\n <div ref={this.handleOutsideClickContainerDivSet}>\n <Component {...(props as ComponentProps)} />\n </div>\n );\n }\n };\n};\n"]}
|
|
@@ -13,11 +13,8 @@ import { Timer } from "../utils/Timer.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export const withTimeout = (Component) => {
|
|
15
15
|
return class WithTimeout extends React.PureComponent {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
19
|
-
this.timer = new Timer(0);
|
|
20
|
-
}
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
|
+
timer = new Timer(0);
|
|
21
18
|
componentDidMount() {
|
|
22
19
|
this.timer.setOnExecute(() => this.props.onTimeout && this.props.onTimeout());
|
|
23
20
|
this.startTimer(this.props.timeout);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTimeout.js","sourceRoot":"","sources":["../../../src/core-react/hocs/withTimeout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAa1C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAA8C,EAC9C,EAAE;IACF,OAAO,MAAM,WAAY,SAAQ,KAAK,CAAC,aAEtC;
|
|
1
|
+
{"version":3,"file":"withTimeout.js","sourceRoot":"","sources":["../../../src/core-react/hocs/withTimeout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAa1C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAA8C,EAC9C,EAAE;IACF,OAAO,MAAM,WAAY,SAAQ,KAAK,CAAC,aAEtC;QACC,4DAA4D;QACrD,KAAK,GAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAEnB,iBAAiB;YAC/B,IAAI,CAAC,KAAK,CAAC,YAAY,CACrB,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CACrD,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QAED,gBAAgB;QACA,kBAAkB,CAChC,UAAuD,CAAC,uDAAuD;;YAE/G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QAEe,oBAAoB;YAClC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAEe,MAAM;YACpB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YACpD,OAAO,oBAAC,SAAS,OAAM,KAAa,KAAM,IAAI,CAAC,KAAK,GAAI,CAAC;QAC3D,CAAC;QAEM,UAAU,CAAC,OAAe;YAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS;gBAAE,OAAO;YAEjC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\nimport { Timer } from \"../utils/Timer.js\";\n\n/** Properties for [[withTimeout]] React higher-order component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link withTimeout} HOC.\n */\nexport interface WithTimeoutProps {\n /** Timeout duration in milliseconds */\n timeout: number;\n /** Callback function for timeout */\n onTimeout?: () => void;\n}\n\n/** withTimeout is a React higher-order component that adds timeout support.\n * @public\n * @deprecated in 4.15.0. Not used by AppUI.\n */\nexport const withTimeout = <ComponentProps extends object>(\n Component: React.ComponentType<ComponentProps>\n) => {\n return class WithTimeout extends React.PureComponent<\n ComponentProps & WithTimeoutProps // eslint-disable-line @typescript-eslint/no-deprecated\n > {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public timer: Timer = new Timer(0);\n\n public override componentDidMount(): void {\n this.timer.setOnExecute(\n () => this.props.onTimeout && this.props.onTimeout()\n );\n this.startTimer(this.props.timeout);\n }\n\n /** @internal */\n public override componentDidUpdate(\n _prevProps: Readonly<ComponentProps & WithTimeoutProps> // eslint-disable-line @typescript-eslint/no-deprecated\n ): void {\n this.startTimer(this.props.timeout);\n }\n\n public override componentWillUnmount(): void {\n this.timer.stop();\n }\n\n public override render() {\n const { timeout, onTimeout, ...props } = this.props;\n return <Component {...(props as any)} {...this.state} />;\n }\n\n public startTimer(timeout: number) {\n if (this.timer.isRunning) return;\n\n this.timer.delay = timeout;\n this.timer.start();\n }\n };\n};\n"]}
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
* @deprecated in 4.16.0. Uses a deprecated {@link IconSpec} type. Use conditional rendering to render different icons.
|
|
12
12
|
*/
|
|
13
13
|
export class ConditionalIconItem {
|
|
14
|
+
iconGetter;
|
|
15
|
+
syncEventIds;
|
|
16
|
+
_value;
|
|
14
17
|
/** Constructor for ConditionalIconItem
|
|
15
18
|
* @param iconGetter Function to retrieve the icon that matches the condition. Returns an IconSpec.
|
|
16
19
|
* @param syncEventIds The array of event ids to be monitored. These events are triggered when the condition(s) that control the icon change.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalIconItem.js","sourceRoot":"","sources":["../../../src/core-react/icons/ConditionalIconItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,qDAAqD;AAErD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;
|
|
1
|
+
{"version":3,"file":"ConditionalIconItem.js","sourceRoot":"","sources":["../../../src/core-react/icons/ConditionalIconItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,qDAAqD;AAErD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IASZ;IACA;IATV,MAAM,CAAY;IAE1B;;;;OAIG;IACH,YACkB,UAA0B,EAC1B,YAAsB,EACtC,KAAgB;QAFA,eAAU,GAAV,UAAU,CAAgB;QAC1B,iBAAY,GAAZ,YAAY,CAAU;QAGtC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,mDAAmD;IACnD,IAAW,KAAK;QACd,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,2DAA2D;IACpD,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAEnC,IAAI,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gGAAgG;IACzF,MAAM,CAAC,YAAY,CACxB,gBAA0D,EAC1D,QAAqB;QAErB,IACE,SAAS,KAAK,gBAAgB;YAC9B,CAAC,CAAC,gBAAgB,YAAY,mBAAmB,CAAC;YAElD,OAAO,KAAK,CAAC;QAEf,MAAM,QAAQ,GAAG,gBAAgB,CAAC;QAElC,IACE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CACpD,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAClC;YAED,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC;QAE5B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,0FAA0F;IACnF,MAAM,CAAC,QAAQ,CACpB,gBAA0D;QAE1D,IAAI,SAAS,KAAK,gBAAgB;YAAE,OAAO,SAAS,CAAC;QAErD,IAAI,gBAAgB,YAAY,mBAAmB,EAAE,CAAC;YACpD,MAAM,QAAQ,GAAG,gBAAgB,CAAC;YAClC,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Icon\n */\n\nimport type { IconSpec } from \"./IconComponent.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Class used to return an icon. The icon is variable and can be changed in response to subscribed event ids.\n * @public\n * @deprecated in 4.16.0. Uses a deprecated {@link IconSpec} type. Use conditional rendering to render different icons.\n */\nexport class ConditionalIconItem {\n private _value?: IconSpec;\n\n /** Constructor for ConditionalIconItem\n * @param iconGetter Function to retrieve the icon that matches the condition. Returns an IconSpec.\n * @param syncEventIds The array of event ids to be monitored. These events are triggered when the condition(s) that control the icon change.\n * @param value The default IconSpec. If this is not specified, the function is run to get the initial value.\n */\n constructor(\n public readonly iconGetter: () => IconSpec,\n public readonly syncEventIds: string[],\n value?: IconSpec\n ) {\n this._value = value;\n }\n\n /** The current IconSpec according to conditions */\n public get value(): IconSpec {\n if (undefined !== this._value) return this._value;\n this._value = this.iconGetter();\n return this._value;\n }\n\n /** Called to update the value by running the iconGetter */\n public refresh(): boolean {\n const newValue = this.iconGetter();\n\n if (newValue !== this._value) {\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** A helper function that updates the IconSpec value when the specified events are triggered */\n public static refreshValue(\n conditionalValue: ConditionalIconItem | string | undefined,\n eventIds: Set<string>\n ): boolean {\n if (\n undefined === conditionalValue ||\n !(conditionalValue instanceof ConditionalIconItem)\n )\n return false;\n\n const iconItem = conditionalValue;\n\n if (\n iconItem.syncEventIds.some((value: string): boolean =>\n eventIds.has(value.toLowerCase())\n )\n )\n return iconItem.refresh();\n\n return false;\n }\n /** helper function to get the iconSpec from a ConditionIconItem as IconSpec | undefined*/\n public static getValue(\n conditionalValue: ConditionalIconItem | string | undefined\n ): IconSpec | undefined {\n if (undefined === conditionalValue) return undefined;\n\n if (conditionalValue instanceof ConditionalIconItem) {\n const iconItem = conditionalValue;\n return iconItem.value;\n }\n\n return conditionalValue;\n }\n}\n"]}
|
|
@@ -14,24 +14,21 @@ import { Icon } from "../icons/IconComponent.js";
|
|
|
14
14
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).
|
|
15
15
|
*/
|
|
16
16
|
export class ImageCheckBox extends React.PureComponent {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
};
|
|
34
|
-
}
|
|
17
|
+
_onChange = (e) => {
|
|
18
|
+
if (e && e.stopPropagation)
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
if (this.props.onClick) {
|
|
21
|
+
this.props.onClick(e.target.checked);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
_onInputClick = (e) => {
|
|
25
|
+
if (e && e.stopPropagation)
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
};
|
|
28
|
+
_onLabelClick = (e) => {
|
|
29
|
+
if (e && e.stopPropagation)
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
};
|
|
35
32
|
render() {
|
|
36
33
|
const checkBoxClass = classnames("core-image-checkbox", this.props.className);
|
|
37
34
|
const imageClass = classnames("image", this.props.border && "image-checkbox-border");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAgCjD;;;GAGG;AACH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,OAAO;YACjC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;YACpB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAExB,OAAO;QACL,yJAAyJ;QACzJ,+BACE,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAEzB,+BACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACpC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACxB;YACF,8BAAM,SAAS,EAAE,UAAU;gBACzB,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Checkbox\n */\n\nimport \"./ImageCheckBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon } from \"../icons/IconComponent.js\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Properties for the [[ImageCheckBox]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link ImageCheckBox}.\n */\nexport interface ImageCheckBoxProps extends CommonProps {\n /** Image for the \"checked\" state */\n imageOn: string | React.ReactNode;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string | React.ReactNode;\n /** Determine if the item is checked or not */\n checked?: boolean;\n /** Determine if the item is disabled or not */\n disabled?: boolean;\n /** Function called when item is clicked. */\n onClick?: (checked: boolean) => any;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Tooltip to be displayed when mouse is hovered over the checkbox */\n tooltip?: string;\n /** If true, draw a border around the image checkbox */\n border?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\n/** ImageCheckBox React component shows a checked or unchecked image\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).\n */\nexport class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e && e.stopPropagation) e.stopPropagation();\n\n if (this.props.onClick) {\n this.props.onClick(e.target.checked);\n }\n };\n\n private _onInputClick = (e: React.MouseEvent<HTMLInputElement>) => {\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n private _onLabelClick = (e: React.MouseEvent<HTMLLabelElement>) => {\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n public override render() {\n const checkBoxClass = classnames(\n \"core-image-checkbox\",\n this.props.className\n );\n const imageClass = classnames(\n \"image\",\n this.props.border && \"image-checkbox-border\"\n );\n const iconSpec = this.props.checked\n ? this.props.imageOn\n : this.props.imageOff;\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/label-has-associated-control, jsx-a11y/no-noninteractive-element-interactions\n <label\n className={checkBoxClass}\n style={this.props.style}\n onClick={this._onLabelClick}\n title={this.props.tooltip}\n >\n <input\n type=\"checkbox\"\n className={this.props.inputClassName}\n style={this.props.inputStyle}\n checked={this.props.checked}\n disabled={this.props.disabled}\n onChange={this._onChange}\n onClick={this._onInputClick}\n ref={this.props.inputRef}\n />\n <span className={imageClass}>\n <Icon iconSpec={iconSpec} />\n </span>\n </label>\n );\n }\n}\n"]}
|
|
@@ -13,6 +13,9 @@ import * as React from "react";
|
|
|
13
13
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.
|
|
14
14
|
*/
|
|
15
15
|
export class LoadingBar extends React.PureComponent {
|
|
16
|
+
static defaultProps = {
|
|
17
|
+
barHeight: 4,
|
|
18
|
+
};
|
|
16
19
|
render() {
|
|
17
20
|
const percent = `${percentInRange(this.props.percent)}%`;
|
|
18
21
|
const containerClass = classnames(this.props.className, "core-lb");
|
|
@@ -22,9 +25,6 @@ export class LoadingBar extends React.PureComponent {
|
|
|
22
25
|
this.props.showPercentage && (React.createElement("span", { className: "percent" }, percent))));
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
|
-
LoadingBar.defaultProps = {
|
|
26
|
-
barHeight: 4,
|
|
27
|
-
};
|
|
28
28
|
/** Sanity check to keep percentage between 0 & 100
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;
|
|
1
|
+
{"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAC3D,MAAM,CAAC,YAAY,GAA6B;QACrD,SAAS,EAAE,CAAC;KACb,CAAC;IAEc,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzD,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,6BAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACnE,6BAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAI,CAC/C;YACL,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAC5B,8BAAM,SAAS,EAAC,SAAS,IAAE,OAAO,CAAQ,CAC3C,CACG,CACP,CAAC;IACJ,CAAC;;AAGH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingBar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Properties for [[LoadingBar]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingBar}.\n */\nexport interface LoadingBarProps extends CommonProps {\n /** Percent */\n percent: number;\n /** Show percentage (optional) */\n showPercentage?: boolean;\n /** Height (in pixels) of the loading bar */\n barHeight: number;\n}\n\n/** A loading bar with optional percentage text.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.\n */\nexport class LoadingBar extends React.PureComponent<LoadingBarProps> {\n public static defaultProps: Partial<LoadingBarProps> = {\n barHeight: 4,\n };\n\n public override render() {\n const percent = `${percentInRange(this.props.percent)}%`;\n const containerClass = classnames(this.props.className, \"core-lb\");\n return (\n <div className={containerClass} style={this.props.style}>\n <div className=\"lb-container\" style={{ height: this.props.barHeight }}>\n <div className=\"fill\" style={{ width: percent }} />\n </div>\n {this.props.showPercentage && (\n <span className=\"percent\">{percent}</span>\n )}\n </div>\n );\n }\n}\n\n/** Sanity check to keep percentage between 0 & 100\n * @internal\n */\nexport function percentInRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n}\n"]}
|
|
@@ -17,6 +17,15 @@ import { LoadingStatus } from "./LoadingStatus.js";
|
|
|
17
17
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
|
|
18
18
|
*/
|
|
19
19
|
export class LoadingPrompt extends React.PureComponent {
|
|
20
|
+
static defaultProps = {
|
|
21
|
+
showPercentage: false,
|
|
22
|
+
showStatus: false,
|
|
23
|
+
showCancel: false,
|
|
24
|
+
isDeterminate: false,
|
|
25
|
+
showIndeterminateBar: false,
|
|
26
|
+
percent: 0,
|
|
27
|
+
status: "",
|
|
28
|
+
};
|
|
20
29
|
render() {
|
|
21
30
|
const isDeterminate = this.props.isDeterminate;
|
|
22
31
|
return (React.createElement("div", { className: classnames("core-loadingprompt", this.props.className), style: this.props.style },
|
|
@@ -29,13 +38,4 @@ export class LoadingPrompt extends React.PureComponent {
|
|
|
29
38
|
this.props.showCancel && (React.createElement(Button, { className: "loading-prompt-cancel", onClick: this.props.onCancel }, "Cancel"))));
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
|
-
LoadingPrompt.defaultProps = {
|
|
33
|
-
showPercentage: false,
|
|
34
|
-
showStatus: false,
|
|
35
|
-
showCancel: false,
|
|
36
|
-
isDeterminate: false,
|
|
37
|
-
showIndeterminateBar: false,
|
|
38
|
-
percent: 0,
|
|
39
|
-
status: "",
|
|
40
|
-
};
|
|
41
41
|
//# sourceMappingURL=LoadingPrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingPrompt.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAgCnD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;
|
|
1
|
+
{"version":3,"file":"LoadingPrompt.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAA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K,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC9D,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAC1B,CACH;YACA,CAAC,aAAa;gBACb,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CACjC,oBAAC,cAAc,IAAC,aAAa,SAAG,CACjC,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,OAAG,CACnB,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACxB,oBAAC,MAAM,IACL,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,aAGrB,CACV,CACG,CACP,CAAC;IACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingPrompt.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Button, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { LoadingBar } from \"./LoadingBar.js\";\nimport { LoadingSpinner } from \"./LoadingSpinner.js\";\nimport { LoadingStatus } from \"./LoadingStatus.js\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Properties for [[LoadingPrompt]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingPrompt}.\n */\nexport interface LoadingPromptProps extends CommonProps {\n /** Title */\n title: string;\n /** Message displayed below the title (optional) */\n message?: string;\n /** Determine if a percentage bar is displayed (isDeterminate=true), otherwise a loading spinner or indeterminate progress bar is shown. */\n isDeterminate: boolean;\n /** Show current status and percentage. Default is false (not shown) */\n showStatus: boolean;\n /** Show cancel button. Default is false (not shown) */\n showCancel: boolean;\n /** Current loading status text (optional). Only shown if showStatus=true and isDeterminate=true */\n status: string;\n /** Current percentage. Only used if isDeterminate=true */\n percent: number;\n /** Show percentage at the end of the loading bar (optional). Only shown if isDeterminate=true and showStatus=false */\n showPercentage: boolean;\n /** Show indeterminate progress bar instead of loading spinner */\n showIndeterminateBar: boolean;\n /** Function called when Cancel button is clicked. */\n onCancel?: () => void;\n}\n\n/** A component to display during loading that optionally shows percentage, status text and a cancel button.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.\n */\nexport class LoadingPrompt extends React.PureComponent<LoadingPromptProps> {\n public static defaultProps: Partial<LoadingPromptProps> = {\n showPercentage: false,\n showStatus: false,\n showCancel: false,\n isDeterminate: false,\n showIndeterminateBar: false,\n percent: 0,\n status: \"\",\n };\n\n public override render() {\n const isDeterminate = this.props.isDeterminate;\n\n return (\n <div\n className={classnames(\"core-loadingprompt\", this.props.className)}\n style={this.props.style}\n >\n <span className=\"title\">{this.props.title}</span>\n {this.props.message && (\n <span className=\"message\">{this.props.message}</span>\n )}\n {isDeterminate && (\n <LoadingBar\n style={{ width: \"100%\" }}\n percent={this.props.percent}\n showPercentage={this.props.showPercentage}\n />\n )}\n {isDeterminate && this.props.showStatus && (\n <LoadingStatus\n style={{ marginTop: \".5em\", width: \"100%\", fontSize: \".75em\" }}\n percent={this.props.percent}\n message={this.props.status}\n />\n )}\n {!isDeterminate &&\n (this.props.showIndeterminateBar ? (\n <ProgressLinear indeterminate />\n ) : (\n <LoadingSpinner />\n ))}\n {this.props.showCancel && (\n <Button\n className=\"loading-prompt-cancel\"\n onClick={this.props.onCancel}\n >\n Cancel\n </Button>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -13,6 +13,9 @@ import { ProgressRadial } from "@itwin/itwinui-react";
|
|
|
13
13
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.
|
|
14
14
|
*/
|
|
15
15
|
export class LoadingSpinner extends React.PureComponent {
|
|
16
|
+
static defaultProps = {
|
|
17
|
+
messageOnTop: false,
|
|
18
|
+
};
|
|
16
19
|
render() {
|
|
17
20
|
const { message, messageOnTop, size, ...rest } = this.props;
|
|
18
21
|
return (React.createElement("div", { className: "core-ls" },
|
|
@@ -21,7 +24,4 @@ export class LoadingSpinner extends React.PureComponent {
|
|
|
21
24
|
message && !messageOnTop && (React.createElement("span", { className: "ls-message-bottom" }, message))));
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
|
-
LoadingSpinner.defaultProps = {
|
|
25
|
-
messageOnTop: false,
|
|
26
|
-
};
|
|
27
27
|
//# sourceMappingURL=LoadingSpinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8BtD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAkC;
|
|
1
|
+
{"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8BtD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAkC;IACnE,MAAM,CAAC,YAAY,GAAiC;QACzD,YAAY,EAAE,KAAK;KACpB,CAAC;IAEc,MAAM;QACpB,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5D,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS;YACrB,OAAO,IAAI,YAAY,IAAI,CAC1B,8BAAM,SAAS,EAAC,gBAAgB,IAAE,OAAO,CAAQ,CAClD;YACD,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,EAAE,aAAa,SAAG;YACrD,OAAO,IAAI,CAAC,YAAY,IAAI,CAC3B,8BAAM,SAAS,EAAC,mBAAmB,IAAE,OAAO,CAAQ,CACrD,CACG,CACP,CAAC;IACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingSpinner.scss\";\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size\n * @public\n * @deprecated in 4.12.0. Type used in a deprecated component {@link LoadingSpinner}.\n */\nexport type RadialSizeType = ProgressRadialProps[\"size\"];\n\n/** Properties for [[LoadingSpinner]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingSpinner}.\n */\nexport interface LoadingSpinnerProps extends Omit<ProgressRadialProps, \"size\"> {\n /** Message (text) displayed */\n message?: string;\n /** Position the message above or below the spinner (defaults to bottom) */\n messageOnTop?: boolean;\n /**\n * Size of the progress indicator. Defaults to medium size.\n * @default ''\n */\n size?: RadialSizeType;\n}\n\n/** A loading spinner component that optionally shows a text message.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.\n */\nexport class LoadingSpinner extends React.PureComponent<LoadingSpinnerProps> {\n public static defaultProps: Partial<LoadingSpinnerProps> = {\n messageOnTop: false,\n };\n\n public override render() {\n const { message, messageOnTop, size, ...rest } = this.props;\n return (\n <div className=\"core-ls\">\n {message && messageOnTop && (\n <span className=\"ls-message-top\">{message}</span>\n )}\n <ProgressRadial size={size} {...rest} indeterminate />\n {message && !messageOnTop && (\n <span className=\"ls-message-bottom\">{message}</span>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -13,6 +13,10 @@ import * as React from "react";
|
|
|
13
13
|
* @deprecated in 4.12.0. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
|
|
14
14
|
*/
|
|
15
15
|
export class LoadingStatus extends React.PureComponent {
|
|
16
|
+
static defaultProps = {
|
|
17
|
+
message: "",
|
|
18
|
+
percent: 0,
|
|
19
|
+
};
|
|
16
20
|
// sanity check to keep percentage between 0 & 100
|
|
17
21
|
inRange(percent) {
|
|
18
22
|
let value = Math.min(percent, 100);
|
|
@@ -27,8 +31,4 @@ export class LoadingStatus extends React.PureComponent {
|
|
|
27
31
|
React.createElement("span", { className: "loading-status-percent" }, percent)));
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
LoadingStatus.defaultProps = {
|
|
31
|
-
message: "",
|
|
32
|
-
percent: 0,
|
|
33
|
-
};
|
|
34
34
|
//# sourceMappingURL=LoadingStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingStatus.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;
|
|
1
|
+
{"version":3,"file":"LoadingStatus.js","sourceRoot":"","sources":["../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IACjE,MAAM,CAAC,YAAY,GAAgC;QACxD,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,CAAC;KACX,CAAC;IAEF,kDAAkD;IAC1C,OAAO,CAAC,OAAe;QAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAI,CAAC,KAAK,CAAC,SAAS,EACpB,0BAA0B,CAC3B,CAAC;QACF,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,8BAAM,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ;YACpE,8BAAM,SAAS,EAAC,wBAAwB,IAAE,OAAO,CAAQ,CACrD,CACP,CAAC;IACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingStatus.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Properties for [[LoadingStatus]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingStatus}.\n */\nexport interface LoadingStatusProps extends CommonProps {\n /** Message (text) displayed */\n message: string;\n /** Percent displayed (as text) */\n percent: number;\n}\n\n/** A loading indicator that shows status text along with the percentage.\n * @public\n * @deprecated in 4.12.0. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.\n */\nexport class LoadingStatus extends React.PureComponent<LoadingStatusProps> {\n public static defaultProps: Partial<LoadingStatusProps> = {\n message: \"\",\n percent: 0,\n };\n\n // sanity check to keep percentage between 0 & 100\n private inRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n }\n\n public override render() {\n const percent = `${this.inRange(this.props.percent)}%`;\n const containerClass = classnames(\n this.props.className,\n \"loading-status-container\"\n );\n return (\n <div className={containerClass} style={this.props.style}>\n <span className=\"loading-status-message\">{this.props.message}</span>\n <span className=\"loading-status-percent\">{percent}</span>\n </div>\n );\n }\n}\n"]}
|
|
@@ -17,17 +17,17 @@ import { Dialog } from "../dialog/Dialog.js";
|
|
|
17
17
|
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
|
|
18
18
|
*/
|
|
19
19
|
export class MessageBox extends React.PureComponent {
|
|
20
|
+
static defaultProps = {
|
|
21
|
+
minWidth: 400,
|
|
22
|
+
minHeight: 400,
|
|
23
|
+
width: "512px",
|
|
24
|
+
modal: true,
|
|
25
|
+
};
|
|
20
26
|
render() {
|
|
21
27
|
return (React.createElement(Dialog, { title: this.props.title, buttonCluster: this.props.buttonCluster, opened: this.props.opened, onClose: this.props.onClose, onEscape: this.props.onEscape, modal: this.props.modal, className: this.props.className, style: this.props.style, width: this.props.width },
|
|
22
28
|
React.createElement(MessageContainer, { severity: this.props.severity, className: this.props.contentClassName, style: this.props.contentStyle }, this.props.children)));
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
|
-
MessageBox.defaultProps = {
|
|
26
|
-
minWidth: 400,
|
|
27
|
-
minHeight: 400,
|
|
28
|
-
width: "512px",
|
|
29
|
-
modal: true,
|
|
30
|
-
};
|
|
31
31
|
/** Message Container React component.
|
|
32
32
|
* @public
|
|
33
33
|
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
|