@itwin/core-react 3.2.0-dev.8 → 3.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
- package/lib/cjs/core-react/UiCore.js +3 -0
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/Badge.js +4 -2
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.js +2 -2
- package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.js +2 -2
- package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
- package/lib/cjs/core-react/colorvariables.scss +4 -0
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +16 -0
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.scss +5 -0
- package/lib/cjs/core-react/icons/SvgSprite.d.ts +3 -2
- package/lib/cjs/core-react/icons/SvgSprite.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/SvgSprite.js +3 -1
- package/lib/cjs/core-react/icons/SvgSprite.js.map +1 -1
- package/lib/cjs/core-react/inputs/Input.js +1 -1
- package/lib/cjs/core-react/inputs/Input.js.map +1 -1
- package/lib/cjs/core-react/inputs/Textarea.js +1 -1
- package/lib/cjs/core-react/inputs/Textarea.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.js +4 -4
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js +7 -4
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts +2 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts +11 -0
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -0
- package/lib/cjs/core-react/utils/IconWebComponent.js +49 -0
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +8 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +90 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -0
- package/lib/cjs/core-react/utils/hooks/useInterval.d.ts +6 -0
- package/lib/cjs/core-react/utils/hooks/useInterval.d.ts.map +1 -0
- package/lib/cjs/core-react/utils/hooks/useInterval.js +37 -0
- package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -0
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +2 -2
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react.d.ts +2 -0
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +2 -0
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts.map +1 -1
- package/lib/esm/core-react/UiCore.js +3 -0
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/Badge.js +4 -2
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.js +1 -1
- package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.js +1 -1
- package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
- package/lib/esm/core-react/colorvariables.scss +4 -0
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +16 -0
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.scss +5 -0
- package/lib/esm/core-react/icons/SvgSprite.d.ts +3 -2
- package/lib/esm/core-react/icons/SvgSprite.d.ts.map +1 -1
- package/lib/esm/core-react/icons/SvgSprite.js +3 -1
- package/lib/esm/core-react/icons/SvgSprite.js.map +1 -1
- package/lib/esm/core-react/inputs/Input.js +1 -1
- package/lib/esm/core-react/inputs/Input.js.map +1 -1
- package/lib/esm/core-react/inputs/Textarea.js +1 -1
- package/lib/esm/core-react/inputs/Textarea.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.js +4 -4
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js +7 -4
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts +2 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts +11 -0
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -0
- package/lib/esm/core-react/utils/IconWebComponent.js +45 -0
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +8 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +86 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -0
- package/lib/esm/core-react/utils/hooks/useInterval.d.ts +6 -0
- package/lib/esm/core-react/utils/hooks/useInterval.d.ts.map +1 -0
- package/lib/esm/core-react/utils/hooks/useInterval.js +33 -0
- package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -0
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +2 -2
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react.d.ts +2 -0
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +2 -0
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconHelper.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconHelper.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"IconHelper.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconHelper.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAY,MAAM,wBAAwB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,UAAU;IACd,MAAM,KAAK,YAAY;QAC5B,OAAO,yBAAyB,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAuD,EAAE,YAA+B;QACrH,uBAAuB;QACvB,IAAI,CAAC,IAAI;YACP,OAAO,IAAI,CAAC;QAEd,uBAAuB;QACvB,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;YAC5B,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,GAAI,CAAC;QAElC,qBAAqB;QACrB,IAAI,CAAC,CAAC,IAAI,YAAY,sBAAsB,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ;YACvE,OAAO,IAAI,CAAC;QAEd,MAAM,UAAU,GAAG,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU;YACb,OAAO,IAAI,CAAC;QAEd,uBAAuB;QACvB,IAAI,UAAU,KAAK,UAAU,CAAC,YAAY,EAAE;YAC1C,uBAAuB;YACvB,IAAI,YAAY;gBACd,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAoB,GAAI,CAAC;YAC1F,OAAO,IAAI,CAAC;SACb;QACD,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,UAAU,GAAI,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,QAAkB,EAAE,YAA+B;QAC3E,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEnF,IAAI,YAAY,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,YAAY,EAAE;YAChF,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;SACrD;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,YAAY,sBAAsB;YACpE,OAAO,IAAI,CAAC;QAEd,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\r\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\r\n\r\n/** Icon Helper Class used to store the data needed to generate an <Icon> for use in any control that shows an icon.\r\n * @public\r\n */\r\nexport class IconHelper {\r\n public static get reactIconKey(): string {\r\n return \"#-react-iconspec-node-#\";\r\n }\r\n /** Returns an <Icon> ReactNode from the many ways an icon can be specified.\r\n * @param icon abstract icon specification.\r\n * @param internalData a map that may hold a React.ReactNode stored in an abstract item definition.\r\n */\r\n public static getIconReactNode(icon: string | ConditionalStringValue | React.ReactNode, internalData?: Map<string, any>): React.ReactNode {\r\n // istanbul ignore else\r\n if (!icon)\r\n return null;\r\n\r\n // istanbul ignore else\r\n if (React.isValidElement(icon))\r\n return <Icon iconSpec={icon} />;\r\n\r\n // istanbul ignore if\r\n if (!(icon instanceof ConditionalStringValue) && typeof icon !== \"string\")\r\n return null;\r\n\r\n const iconString = ConditionalStringValue.getValue(icon);\r\n if (!iconString)\r\n return null;\r\n\r\n // istanbul ignore else\r\n if (iconString === IconHelper.reactIconKey) {\r\n // istanbul ignore else\r\n if (internalData)\r\n return <Icon iconSpec={internalData.get(IconHelper.reactIconKey) as React.ReactNode} />;\r\n return null;\r\n }\r\n return <Icon iconSpec={iconString} />;\r\n }\r\n\r\n /** Returns an icon definition that can be stored in an abstract item definition. If the iconSpec specifies a ReactNode\r\n * then the react data is stored in the internalData map and the key to the react data is returned.\r\n * @param iconSpec any supported variations of how an icon can be defined in an abstract item or IconProps.\r\n * @param internalData a map supplied by the caller to store away react element if React.ReactNode\r\n */\r\n public static getIconData(iconSpec: IconSpec, internalData?: Map<string, any>): string | ConditionalStringValue {\r\n const icon = (React.isValidElement(iconSpec)) ? IconHelper.reactIconKey : iconSpec;\r\n\r\n if (internalData && typeof icon === \"string\" && icon === IconHelper.reactIconKey) {\r\n internalData.set(IconHelper.reactIconKey, iconSpec);\r\n }\r\n\r\n if (typeof icon === \"string\" || icon instanceof ConditionalStringValue)\r\n return icon;\r\n\r\n return \"\";\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* IconWebComponent loads icon from an svg path
|
|
6
|
+
*/
|
|
7
|
+
export declare class IconWebComponent extends HTMLElement {
|
|
8
|
+
private connectedCallback;
|
|
9
|
+
private loadSvg;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=IconWebComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAMA;;GAEG;AAMH;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;YACjC,iBAAiB;YAKjB,OAAO;CAqBtB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
// istanbul ignore file
|
|
6
|
+
// IconWebComponent requires in-browser testing
|
|
7
|
+
/** @packageDocumentation
|
|
8
|
+
* @module Utilities
|
|
9
|
+
*/
|
|
10
|
+
import { UiError } from "@itwin/appui-abstract";
|
|
11
|
+
import { Logger } from "@itwin/core-bentley";
|
|
12
|
+
import { UiCore } from "../UiCore";
|
|
13
|
+
/**
|
|
14
|
+
* IconWebComponent loads icon from an svg path
|
|
15
|
+
*/
|
|
16
|
+
export class IconWebComponent extends HTMLElement {
|
|
17
|
+
async connectedCallback() {
|
|
18
|
+
await this.loadSvg();
|
|
19
|
+
this.dispatchEvent(new CustomEvent("load"));
|
|
20
|
+
}
|
|
21
|
+
async loadSvg() {
|
|
22
|
+
await fetch(this.getAttribute("src") || "")
|
|
23
|
+
.catch((_error) => {
|
|
24
|
+
Logger.logError(UiCore.loggerCategory(this), "Unable to load icon.");
|
|
25
|
+
})
|
|
26
|
+
.then(async (response) => {
|
|
27
|
+
if (response && response.ok) {
|
|
28
|
+
return response.text();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new UiError(UiCore.loggerCategory(this), "Unable to load icon.");
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
.then((str) => {
|
|
35
|
+
if (str !== undefined) {
|
|
36
|
+
return (new window.DOMParser()).parseFromString(str, "text/xml");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw new UiError(UiCore.loggerCategory(this), "Unable to load icon.");
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
.then((data) => this.append(data.documentElement));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=IconWebComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconWebComponent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,uBAAuB;AACvB,+CAA+C;AAC/C;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACvC,KAAK,CAAC,iBAAiB;QAC7B,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;aACxC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YAChB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;QACvE,CAAC,CAAC;aACD,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YACvB,IAAI,QAAQ,IAAI,QAAQ,CAAC,EAAE,EAAE;gBAC3B,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;aACxB;iBAAM;gBACL,MAAM,IAAI,OAAO,CAAE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;aACzE;QACH,CAAC,CAAC;aACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACZ,IAAI,GAAG,KAAK,SAAS,EAAE;gBACrB,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;aAClE;iBAAM;gBACL,MAAM,IAAI,OAAO,CAAE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;aACzE;QACH,CAAC,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IACvD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// istanbul ignore file\r\n// IconWebComponent requires in-browser testing\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport { UiError } from \"@itwin/appui-abstract\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { UiCore } from \"../UiCore\";\r\n\r\n/**\r\n * IconWebComponent loads icon from an svg path\r\n */\r\nexport class IconWebComponent extends HTMLElement {\r\n private async connectedCallback() {\r\n await this.loadSvg();\r\n this.dispatchEvent(new CustomEvent(\"load\"));\r\n }\r\n\r\n private async loadSvg() {\r\n await fetch(this.getAttribute(\"src\") || \"\")\r\n .catch((_error) => {\r\n Logger.logError(UiCore.loggerCategory(this), \"Unable to load icon.\");\r\n })\r\n .then(async (response) => {\r\n if (response && response.ok) {\r\n return response.text();\r\n } else {\r\n throw new UiError (UiCore.loggerCategory(this), \"Unable to load icon.\");\r\n }\r\n })\r\n .then((str) => {\r\n if (str !== undefined) {\r\n return (new window.DOMParser()).parseFromString(str, \"text/xml\");\r\n } else {\r\n throw new UiError (UiCore.loggerCategory(this), \"Unable to load icon.\");\r\n }\r\n })\r\n .then((data) => this.append(data.documentElement));\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
/** Hook that will show a popup window
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCrossOriginPopup(visible: boolean, url: string | undefined, title: string, width: number, height: number, onClose: () => void): void;
|
|
8
|
+
//# sourceMappingURL=useCrossOriginPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCrossOriginPopup.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useCrossOriginPopup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAKH;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,QAqF/I"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Utilities
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { useInterval } from "./useInterval";
|
|
10
|
+
/** Hook that will show a popup window
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export function useCrossOriginPopup(visible, url, title, width, height, onClose) {
|
|
14
|
+
const [checkPopupAliveDelay, setCheckPopupAliveDelay] = React.useState();
|
|
15
|
+
// ONLY re-render the popup when visibility changes, any other changes get deferred until next visibility change
|
|
16
|
+
// hence the massive use of 'useRef'
|
|
17
|
+
const popupWindow = React.useRef();
|
|
18
|
+
const savedUrl = React.useRef(url);
|
|
19
|
+
const savedTitle = React.useRef(title);
|
|
20
|
+
const savedWidth = React.useRef(width);
|
|
21
|
+
const savedHeight = React.useRef(height);
|
|
22
|
+
const savedOnClose = React.useRef(onClose);
|
|
23
|
+
React.useEffect(() => { savedUrl.current = url; }, [url]);
|
|
24
|
+
React.useEffect(() => { savedTitle.current = title; }, [title]);
|
|
25
|
+
React.useEffect(() => { savedWidth.current = width; }, [width]);
|
|
26
|
+
React.useEffect(() => { savedHeight.current = height; }, [height]);
|
|
27
|
+
React.useEffect(() => { savedOnClose.current = onClose; }, [onClose]);
|
|
28
|
+
// Cleanup method after a popup closure. Also calls the OnClose callback.
|
|
29
|
+
const handleClosedPopup = React.useCallback(() => {
|
|
30
|
+
savedOnClose.current();
|
|
31
|
+
setCheckPopupAliveDelay(undefined);
|
|
32
|
+
popupWindow.current = undefined;
|
|
33
|
+
}, []);
|
|
34
|
+
const closePopup = React.useCallback(() => {
|
|
35
|
+
if (popupWindow.current !== undefined) {
|
|
36
|
+
popupWindow.current.close(); // Manually close the popup
|
|
37
|
+
handleClosedPopup();
|
|
38
|
+
}
|
|
39
|
+
}, [handleClosedPopup]);
|
|
40
|
+
const checkPopupClosed = React.useCallback(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
if ((_a = popupWindow.current) === null || _a === void 0 ? void 0 : _a.closed) {
|
|
43
|
+
// Popup has been closed by end-user, inform our host and cleanup
|
|
44
|
+
handleClosedPopup();
|
|
45
|
+
}
|
|
46
|
+
}, [handleClosedPopup]);
|
|
47
|
+
// Close popup when parent window get closed
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
window.onbeforeunload = (_event) => { closePopup(); };
|
|
50
|
+
return () => {
|
|
51
|
+
window.onbeforeunload = null;
|
|
52
|
+
};
|
|
53
|
+
}, [closePopup]);
|
|
54
|
+
// Whenever the hook is unloaded, make sure the underlying popup get closed.
|
|
55
|
+
// Note: An interval is used to check if popup was closed by user: because we access
|
|
56
|
+
// a cross domain resource inside the popup, we don't have access to popup window events.
|
|
57
|
+
// As a workaround, we periodically check if popup is still alive.
|
|
58
|
+
// Reference: https://stackoverflow.com/questions/9388380/capture-the-close-event-of-popup-window-in-javascript/48240128#48240128
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
return () => {
|
|
61
|
+
closePopup();
|
|
62
|
+
};
|
|
63
|
+
}, [closePopup]);
|
|
64
|
+
// Timer that checks if popup was closed by end-user
|
|
65
|
+
useInterval(checkPopupClosed, checkPopupAliveDelay);
|
|
66
|
+
// ==> Main render effect
|
|
67
|
+
// Monitors visibility changes and open/close the popup accordingly.
|
|
68
|
+
React.useEffect(() => {
|
|
69
|
+
// If visible and a popup window is not already open, open a new popup window
|
|
70
|
+
if (visible && popupWindow.current === undefined) {
|
|
71
|
+
const popup = window.open(savedUrl.current, savedTitle.current, `width=${savedWidth.current},height=${savedHeight.current}`);
|
|
72
|
+
if (popup) {
|
|
73
|
+
popup.focus();
|
|
74
|
+
popupWindow.current = popup;
|
|
75
|
+
// Start and interval that will check if popup got closed by user
|
|
76
|
+
setCheckPopupAliveDelay(1000);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// If not visible but a previous popup window is still open, close it.
|
|
80
|
+
if (!visible && popupWindow.current !== undefined) {
|
|
81
|
+
popupWindow.current.close();
|
|
82
|
+
handleClosedPopup();
|
|
83
|
+
}
|
|
84
|
+
}, [handleClosedPopup, visible]);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=useCrossOriginPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCrossOriginPopup.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useCrossOriginPopup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,GAAuB,EAAE,KAAa,EAAE,KAAa,EAAE,MAAc,EAAE,OAAmB;IAE9I,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAsB,CAAC;IAE7F,gHAAgH;IAChH,oCAAoC;IACpC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE3C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,KAAK,CAAC,SA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AC;QACpD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC/B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,4EAA4E;IAC5E,oFAAoF;IACpF,yFAAyF;IACzF,kEAAkE;IAClE,iIAAiI;IACjI,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,GAAG,EAAE;YACV,UAAU,EAAE,CAAC;QACf,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,oDAAoD;IACpD,WAAW,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IAEpD,yBAAyB;IACzB,oEAAoE;IACpE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,6EAA6E;QAC7E,IAAI,OAAO,IAAI,WAAW,CAAC,OAAO,KAAK,SAAS,EAAE;YAChD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,CAAC,OAAO,WAAW,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7H,IAAI,KAAK,EAAE;gBACT,KAAK,CAAC,KAAK,EAAE,CAAC;gBACd,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;gBAE5B,iEAAiE;gBACjE,uBAAuB,CAAC,IAAI,CAAC,CAAC;aAC/B;SACF;QAED,sEAAsE;QACtE,IAAI,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,KAAK,SAAS,EAAE;YACjD,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAE5B,iBAAiB,EAAE,CAAC;SACrB;IAEH,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;AACnC,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 Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport {useInterval} from \"./useInterval\";\r\n\r\n/** Hook that will show a popup window\r\n * @beta\r\n */\r\nexport function useCrossOriginPopup(visible: boolean, url: string | undefined, title: string, width: number, height: number, onClose: () => void) {\r\n\r\n const [checkPopupAliveDelay, setCheckPopupAliveDelay] = React.useState<number | undefined>();\r\n\r\n // ONLY re-render the popup when visibility changes, any other changes get deferred until next visibility change\r\n // hence the massive use of 'useRef'\r\n const popupWindow = React.useRef<Window>();\r\n const savedUrl = React.useRef(url);\r\n const savedTitle = React.useRef(title);\r\n const savedWidth = React.useRef(width);\r\n const savedHeight = React.useRef(height);\r\n const savedOnClose = React.useRef(onClose);\r\n\r\n React.useEffect(() => { savedUrl.current = url; }, [url]);\r\n React.useEffect(() => { savedTitle.current = title; }, [title]);\r\n React.useEffect(() => { savedWidth.current = width; }, [width]);\r\n React.useEffect(() => { savedHeight.current = height; }, [height]);\r\n React.useEffect(() => { savedOnClose.current = onClose; }, [onClose]);\r\n\r\n // Cleanup method after a popup closure. Also calls the OnClose callback.\r\n const handleClosedPopup = React.useCallback(() => {\r\n savedOnClose.current();\r\n setCheckPopupAliveDelay(undefined);\r\n popupWindow.current = undefined;\r\n }, []);\r\n\r\n const closePopup = React.useCallback(() => {\r\n if (popupWindow.current !== undefined) {\r\n popupWindow.current.close(); // Manually close the popup\r\n handleClosedPopup();\r\n }\r\n }, [handleClosedPopup]);\r\n\r\n const checkPopupClosed = React.useCallback(() => {\r\n if (popupWindow.current?.closed) {\r\n // Popup has been closed by end-user, inform our host and cleanup\r\n handleClosedPopup();\r\n }\r\n }, [handleClosedPopup]);\r\n\r\n // Close popup when parent window get closed\r\n React.useEffect(() => {\r\n window.onbeforeunload = (_event) => {closePopup();};\r\n return () => {\r\n window.onbeforeunload = null;\r\n };\r\n }, [closePopup]);\r\n\r\n // Whenever the hook is unloaded, make sure the underlying popup get closed.\r\n // Note: An interval is used to check if popup was closed by user: because we access\r\n // a cross domain resource inside the popup, we don't have access to popup window events.\r\n // As a workaround, we periodically check if popup is still alive.\r\n // Reference: https://stackoverflow.com/questions/9388380/capture-the-close-event-of-popup-window-in-javascript/48240128#48240128\r\n React.useEffect(() => {\r\n return () => {\r\n closePopup();\r\n };\r\n }, [closePopup]);\r\n\r\n // Timer that checks if popup was closed by end-user\r\n useInterval(checkPopupClosed, checkPopupAliveDelay);\r\n\r\n // ==> Main render effect\r\n // Monitors visibility changes and open/close the popup accordingly.\r\n React.useEffect(() => {\r\n // If visible and a popup window is not already open, open a new popup window\r\n if (visible && popupWindow.current === undefined) {\r\n const popup = window.open(savedUrl.current, savedTitle.current, `width=${savedWidth.current},height=${savedHeight.current}`);\r\n if (popup) {\r\n popup.focus();\r\n popupWindow.current = popup;\r\n\r\n // Start and interval that will check if popup got closed by user\r\n setCheckPopupAliveDelay(1000);\r\n }\r\n }\r\n\r\n // If not visible but a previous popup window is still open, close it.\r\n if (!visible && popupWindow.current !== undefined) {\r\n popupWindow.current.close();\r\n\r\n handleClosedPopup();\r\n }\r\n\r\n }, [handleClosedPopup, visible]);\r\n}\r\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Hook that create an interval and clears it when unloaded
|
|
2
|
+
* Reference: https://github.com/gaearon/overreacted.io/blob/master/src/pages/making-setinterval-declarative-with-react-hooks/index.md
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
5
|
+
export declare function useInterval(callback: (...args: any[]) => void, delay: number | undefined): void;
|
|
6
|
+
//# sourceMappingURL=useInterval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInterval.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useInterval.tsx"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,QAoBxF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Utilities
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
/** Hook that create an interval and clears it when unloaded
|
|
10
|
+
* Reference: https://github.com/gaearon/overreacted.io/blob/master/src/pages/making-setinterval-declarative-with-react-hooks/index.md
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export function useInterval(callback, delay) {
|
|
14
|
+
const savedCallback = React.useRef(callback);
|
|
15
|
+
// Remember the latest function.
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
savedCallback.current = callback;
|
|
18
|
+
}, [callback]);
|
|
19
|
+
// Set up the interval.
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
function tick() {
|
|
22
|
+
savedCallback.current();
|
|
23
|
+
}
|
|
24
|
+
if (delay !== undefined) {
|
|
25
|
+
const id = setInterval(tick, delay);
|
|
26
|
+
return (() => { clearInterval(id); });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}, [delay]);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=useInterval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInterval.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useInterval.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,QAAkC,EAAE,KAAyB;IACvF,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAA2B,QAAQ,CAAC,CAAC;IAEvE,gCAAgC;IAChC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,aAAa,CAAC,OAAO,GAAG,QAAQ,CAAC;IACnC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,uBAAuB;IACvB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,IAAI;YACX,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvC;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,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 Utilities\r\n */\r\nimport * as React from \"react\";\r\n\r\n/** Hook that create an interval and clears it when unloaded\r\n * Reference: https://github.com/gaearon/overreacted.io/blob/master/src/pages/making-setinterval-declarative-with-react-hooks/index.md\r\n * @beta\r\n */\r\nexport function useInterval(callback: (...args: any[]) => void, delay: number | undefined) {\r\n const savedCallback = React.useRef<(...args: any[]) => void>(callback);\r\n\r\n // Remember the latest function.\r\n React.useEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n // Set up the interval.\r\n React.useEffect(() => {\r\n function tick() {\r\n savedCallback.current();\r\n }\r\n if (delay !== undefined) {\r\n const id = setInterval(tick, delay);\r\n return (() => { clearInterval(id); });\r\n } else {\r\n return undefined;\r\n }\r\n }, [delay]);\r\n}\r\n"]}
|
|
@@ -55,7 +55,7 @@ export function useResizeObserver(onResize) {
|
|
|
55
55
|
owningWindowRef.current = target.ownerDocument.defaultView;
|
|
56
56
|
// istanbul ignore else
|
|
57
57
|
if (owningWindowRef.current) {
|
|
58
|
-
owningWindowRef.current.addEventListener("
|
|
58
|
+
owningWindowRef.current.addEventListener("unload", resizeObserverCleanup);
|
|
59
59
|
// using requestAnimationFrame to stop the "ResizeObserver loop completed with undelivered notifications." and
|
|
60
60
|
// "ResizeObserver loop limit exceeded" messages reported to window.onError
|
|
61
61
|
rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));
|
|
@@ -142,7 +142,7 @@ export function useLayoutResizeObserver(inElement, onResize) {
|
|
|
142
142
|
owningWindowRef.current = target.ownerDocument.defaultView;
|
|
143
143
|
// istanbul ignore else
|
|
144
144
|
if (owningWindowRef.current) {
|
|
145
|
-
owningWindowRef.current.addEventListener("
|
|
145
|
+
owningWindowRef.current.addEventListener("unload", resizeObserverCleanup);
|
|
146
146
|
// using requestAnimationFrame to stop the "ResizeObserver loop completed with undelivered notifications." and
|
|
147
147
|
// "ResizeObserver loop limit exceeded" messages reported to window.onError
|
|
148
148
|
rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;IAEI;AACJ,MAAM,UAAU,iBAAiB,CAAoB,QAAkD;IACrG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;IACpC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,uBAAuB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,KAAK,GAAwB,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAEzG,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,IACxE,WAAW,IAAI,QAAQ,CACpB,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\nimport * as React from \"react\";\r\nimport { ResizeObserver } from \"./ResizeObserverPolyfill\";\r\nimport { useRefEffect } from \"./useRefEffect\";\r\nimport { useRefs } from \"./useRefs\";\r\n\r\n/** Uses ResizeObserver API to notify about element bound changes.\r\n * @internal\r\n */\r\nexport function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void) {\r\n const [bounds, setBounds] = React.useState({ width: 0, height: 0 });\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n return () => {\r\n isMountedRef.current = false;\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current?.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, []);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore else\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [onResize, bounds.height, bounds.width]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore if\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n const observerRef = useRefEffect((instance: T | null) => {\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n if (instance) {\r\n resizeObserver.current.observe(instance);\r\n const newBounds = instance.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n instance && ( /* istanbul ignore next */resizeObserver.current?.unobserve(instance));\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, onResize]);\r\n\r\n const handleRef = React.useCallback((instance: Element | null) => {\r\n const newBounds = instance && instance.getBoundingClientRect();\r\n // istanbul ignore if\r\n if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const ref = useRefs(handleRef, observerRef);\r\n return ref;\r\n}\r\n\r\n/** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector\r\n * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly\r\n * handles observing element in pop-out/child windows.\r\n * @internal\r\n */\r\nexport function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void) {\r\n const inBoundingRect = inElement?.getBoundingClientRect();\r\n const [bounds, setBounds] = React.useState<{ width?: number, height?: number }>({ width: inBoundingRect?.width, height: inBoundingRect?.height });\r\n const [watchedElement, setWatchedElement] = React.useState(inElement);\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n setWatchedElement(inElement);\r\n\r\n // istanbul ignore next\r\n if (inElement) {\r\n const newBounds = inElement.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n isMountedRef.current = false;\r\n (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, [onResize, inElement]);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore next\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n if (owningWindowRef.current)\r\n owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n React.useLayoutEffect(() => {\r\n if (!watchedElement) {\r\n return;\r\n }\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n resizeObserver.current.observe(watchedElement);\r\n return () => {\r\n // istanbul ignore next\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, watchedElement]);\r\n\r\n return [bounds.width, bounds.height];\r\n}\r\n\r\n/** Prop the ElementResizeObserver sends to the render function.\r\n * @public\r\n */\r\nexport interface RenderPropsArgs {\r\n width?: number;\r\n height?: number;\r\n}\r\n\r\n/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles\r\n * observing element in pop-out/child windows.\r\n * @public\r\n */\r\nexport function ElementResizeObserver({ watchedElement, render }: { watchedElement: HTMLElement | null, render: (props: RenderPropsArgs) => JSX.Element }) {\r\n const [width, height] = useLayoutResizeObserver(watchedElement);\r\n return render({ width, height });\r\n}\r\n\r\n/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when\r\n * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then\r\n * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report\r\n * size changes from its parent container.\r\n * @public\r\n */\r\nexport function ResizableContainerObserver({ onResize, children }: { onResize: (width: number, height: number) => void, children?: React.ReactNode }) {\r\n const containerRef = React.useRef<HTMLDivElement>(null); // set to non-zero when requestAnimationFrame processing is active\r\n const [containerElement, setContainerElement] = React.useState<HTMLElement | null>(null);\r\n const isMountedRef = React.useRef(false);\r\n const hasChildren = React.Children.count(children) !== 0;\r\n\r\n // if no children are specified then monitor size of parent element.\r\n React.useEffect(() => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current && containerRef.current) {\r\n isMountedRef.current = true;\r\n const hasParent = !!containerRef.current.parentElement;\r\n setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);\r\n }\r\n }, [hasChildren]);\r\n\r\n const processResize = React.useCallback((width?: number, height?: number) => {\r\n // istanbul ignore next\r\n onResize(width ?? 0, height ?? 0);\r\n }, [onResize]);\r\n\r\n useLayoutResizeObserver(containerElement, processResize);\r\n const style: React.CSSProperties = hasChildren ? { width: \"100%\", height: \"100%\" } : { display: \"none\" };\r\n\r\n return (\r\n <div ref={containerRef} className=\"uicore-resizable-container\" style={style}>\r\n {hasChildren && children}\r\n </div>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;IAEI;AACJ,MAAM,UAAU,iBAAi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,GAAI,CAAC,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,uBAAuB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,KAAK,GAAwB,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAEzG,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,IACxE,WAAW,IAAI,QAAQ,CACpB,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\nimport * as React from \"react\";\r\nimport { ResizeObserver } from \"./ResizeObserverPolyfill\";\r\nimport { useRefEffect } from \"./useRefEffect\";\r\nimport { useRefs } from \"./useRefs\";\r\n\r\n/** Uses ResizeObserver API to notify about element bound changes.\r\n * @internal\r\n */\r\nexport function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void) {\r\n const [bounds, setBounds] = React.useState({ width: 0, height: 0 });\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n return () => {\r\n isMountedRef.current = false;\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current?.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, []);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore else\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [onResize, bounds.height, bounds.width]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore if\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n const observerRef = useRefEffect((instance: T | null) => {\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n if (instance) {\r\n resizeObserver.current.observe(instance);\r\n const newBounds = instance.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n instance && ( /* istanbul ignore next */resizeObserver.current?.unobserve(instance));\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, onResize]);\r\n\r\n const handleRef = React.useCallback((instance: Element | null) => {\r\n const newBounds = instance && instance.getBoundingClientRect();\r\n // istanbul ignore if\r\n if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const ref = useRefs(handleRef, observerRef);\r\n return ref;\r\n}\r\n\r\n/** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector\r\n * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly\r\n * handles observing element in pop-out/child windows.\r\n * @internal\r\n */\r\nexport function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void) {\r\n const inBoundingRect = inElement?.getBoundingClientRect();\r\n const [bounds, setBounds] = React.useState<{ width?: number, height?: number }>({ width: inBoundingRect?.width, height: inBoundingRect?.height });\r\n const [watchedElement, setWatchedElement] = React.useState(inElement);\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n setWatchedElement(inElement);\r\n\r\n // istanbul ignore next\r\n if (inElement) {\r\n const newBounds = inElement.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n isMountedRef.current = false;\r\n (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, [onResize, inElement]);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore next\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n if (owningWindowRef.current)\r\n owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n React.useLayoutEffect(() => {\r\n if (!watchedElement) {\r\n return;\r\n }\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n resizeObserver.current.observe(watchedElement);\r\n return () => {\r\n // istanbul ignore next\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, watchedElement]);\r\n\r\n return [bounds.width, bounds.height];\r\n}\r\n\r\n/** Prop the ElementResizeObserver sends to the render function.\r\n * @public\r\n */\r\nexport interface RenderPropsArgs {\r\n width?: number;\r\n height?: number;\r\n}\r\n\r\n/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles\r\n * observing element in pop-out/child windows.\r\n * @public\r\n */\r\nexport function ElementResizeObserver({ watchedElement, render }: { watchedElement: HTMLElement | null, render: (props: RenderPropsArgs) => JSX.Element }) {\r\n const [width, height] = useLayoutResizeObserver(watchedElement);\r\n return render({ width, height });\r\n}\r\n\r\n/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when\r\n * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then\r\n * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report\r\n * size changes from its parent container.\r\n * @public\r\n */\r\nexport function ResizableContainerObserver({ onResize, children }: { onResize: (width: number, height: number) => void, children?: React.ReactNode }) {\r\n const containerRef = React.useRef<HTMLDivElement>(null); // set to non-zero when requestAnimationFrame processing is active\r\n const [containerElement, setContainerElement] = React.useState<HTMLElement | null>(null);\r\n const isMountedRef = React.useRef(false);\r\n const hasChildren = React.Children.count(children) !== 0;\r\n\r\n // if no children are specified then monitor size of parent element.\r\n React.useEffect(() => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current && containerRef.current) {\r\n isMountedRef.current = true;\r\n const hasParent = !!containerRef.current.parentElement;\r\n setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);\r\n }\r\n }, [hasChildren]);\r\n\r\n const processResize = React.useCallback((width?: number, height?: number) => {\r\n // istanbul ignore next\r\n onResize(width ?? 0, height ?? 0);\r\n }, [onResize]);\r\n\r\n useLayoutResizeObserver(containerElement, processResize);\r\n const style: React.CSSProperties = hasChildren ? { width: \"100%\", height: \"100%\" } : { display: \"none\" };\r\n\r\n return (\r\n <div ref={containerRef} className=\"uicore-resizable-container\" style={style}>\r\n {hasChildren && children}\r\n </div>\r\n );\r\n}\r\n"]}
|
package/lib/esm/core-react.d.ts
CHANGED
|
@@ -143,6 +143,8 @@ export * from "./core-react/utils/hooks/useRefState";
|
|
|
143
143
|
export * from "./core-react/utils/hooks/useResizeObserver";
|
|
144
144
|
export * from "./core-react/utils/hooks/useTargeted";
|
|
145
145
|
export * from "./core-react/utils/hooks/useWidgetOpacityContext";
|
|
146
|
+
export * from "./core-react/utils/hooks/useInterval";
|
|
147
|
+
export * from "./core-react/utils/hooks/useCrossOriginPopup";
|
|
146
148
|
/** @docs-package-description
|
|
147
149
|
* The core-react package contains general purpose React components, such as Dialog, MessageBox, SearchBox, RadialMenu and SplitButton.
|
|
148
150
|
* For more information, see [learning about core-react]($docs/learning/ui/core/index.md).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-react.d.ts","sourceRoot":"","sources":["../../src/core-react.ts"],"names":[],"mappings":"AAOA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AAErD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAE1D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AAExD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,iC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,cAAc,8CAA8C,CAAC;AAE7D;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
package/lib/esm/core-react.js
CHANGED
|
@@ -148,6 +148,8 @@ export * from "./core-react/utils/hooks/useRefState";
|
|
|
148
148
|
export * from "./core-react/utils/hooks/useResizeObserver";
|
|
149
149
|
export * from "./core-react/utils/hooks/useTargeted";
|
|
150
150
|
export * from "./core-react/utils/hooks/useWidgetOpacityContext";
|
|
151
|
+
export * from "./core-react/utils/hooks/useInterval";
|
|
152
|
+
export * from "./core-react/utils/hooks/useCrossOriginPopup";
|
|
151
153
|
/** @docs-package-description
|
|
152
154
|
* The core-react package contains general purpose React components, such as Dialog, MessageBox, SearchBox, RadialMenu and SplitButton.
|
|
153
155
|
* For more information, see [learning about core-react]($docs/learning/ui/core/index.md).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-react.js","sourceRoot":"","sources":["../../src/core-react.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,gFAAgF;AAEhF,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC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AuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AAEjE;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\r\n// cSpell:ignore focustrap imagecheckbox iconinput hocs numberinput numericinput\r\n\r\nexport * from \"./core-react/UiCore\";\r\n\r\nexport * from \"./core-react/badge/Badge\";\r\nexport * from \"./core-react/badge/BadgeUtilities\";\r\nexport * from \"./core-react/badge/BetaBadge\";\r\nexport * from \"./core-react/badge/NewBadge\";\r\n\r\nexport * from \"./core-react/base/Div\";\r\nexport * from \"./core-react/base/DivWithOutsideClick\";\r\nexport * from \"./core-react/base/Centered\";\r\nexport * from \"./core-react/base/FillCentered\";\r\nexport * from \"./core-react/base/FlexWrapContainer\";\r\nexport * from \"./core-react/base/Gap\";\r\nexport * from \"./core-react/base/PointerEvents\";\r\nexport * from \"./core-react/base/ScrollView\";\r\n\r\nexport * from \"./core-react/button/Button\";\r\nexport * from \"./core-react/button/UnderlinedButton\";\r\n\r\nexport * from \"./core-react/checklistbox/CheckListBox\";\r\n\r\nexport * from \"./core-react/contextmenu/ContextMenu\";\r\nexport * from \"./core-react/contextmenu/ContextMenuDirection\";\r\nexport * from \"./core-react/contextmenu/ContextMenuDivider\";\r\nexport * from \"./core-react/contextmenu/ContextMenuItem\";\r\nexport * from \"./core-react/contextmenu/ContextSubMenu\";\r\nexport * from \"./core-react/contextmenu/GlobalContextMenu\";\r\nexport * from \"./core-react/contextmenu/PopupContextMenu\";\r\n\r\nexport * from \"./core-react/dialog/Dialog\";\r\nexport * from \"./core-react/dialog/DialogButtonDef\";\r\nexport * from \"./core-react/dialog/GlobalDialog\";\r\n\r\nexport * from \"./core-react/elementseparator/ElementSeparator\";\r\n\r\nexport * from \"./core-react/enums/Alignment\";\r\nexport * from \"./core-react/enums/CheckBoxState\";\r\nexport * from \"./core-react/enums/Orientation\";\r\nexport * from \"./core-react/enums/SortDirection\";\r\nexport * from \"./core-react/enums/TimeFormat\";\r\n\r\nexport * from \"./core-react/expandable/ExpandableList\";\r\nexport * from \"./core-react/expandable/ExpandableBlock\";\r\n\r\nexport * from \"./core-react/focus/ItemKeyboardNavigator\";\r\nexport * from \"./core-react/focustrap/FocusTrap\";\r\n\r\nexport * from \"./core-react/form/Field\";\r\nexport * from \"./core-react/form/Form\";\r\n\r\nexport * from \"./core-react/hocs/withIsPressed\";\r\nexport * from \"./core-react/hocs/withOnOutsideClick\";\r\nexport * from \"./core-react/hocs/withTimeout\";\r\n\r\nexport * from \"./core-react/icons/IconComponent\";\r\nexport * from \"./core-react/icons/SvgPath\";\r\nexport * from \"./core-react/icons/SvgSprite\";\r\nexport * from \"./core-react/icons/WebFontIcon\";\r\n\r\nexport * from \"./core-react/autosuggest/AutoSuggest\";\r\n\r\nexport * from \"./core-react/checkbox/Checkbox\";\r\n\r\nexport * from \"./core-react/imagecheckbox/ImageCheckBox\";\r\n\r\nexport * from \"./core-react/inputs/Input\";\r\nexport * from \"./core-react/inputs/InputLabel\";\r\nexport * from \"./core-react/inputs/InputStatus\";\r\nexport * from \"./core-react/inputs/iconinput/IconInput\";\r\nexport * from \"./core-react/inputs/LabeledComponentProps\";\r\nexport * from \"./core-react/inputs/LabeledInput\";\r\nexport * from \"./core-react/inputs/LabeledTextarea\";\r\nexport * from \"./core-react/inputs/numberinput/NumberInput\";\r\nexport * from \"./core-react/inputs/Textarea\";\r\n\r\nexport * from \"./core-react/listbox/Listbox\";\r\n\r\nexport * from \"./core-react/loading/LoadingBar\";\r\nexport * from \"./core-react/loading/LoadingPrompt\";\r\nexport * from \"./core-react/loading/LoadingSpinner\";\r\nexport * from \"./core-react/loading/LoadingStatus\";\r\nexport * from \"./core-react/loading/Spinner\";\r\n\r\nexport * from \"./core-react/messagebox/MessageBox\";\r\nexport * from \"./core-react/messagebox/MessageSeverity\";\r\n\r\nexport * from \"./core-react/notification/MessageRenderer\";\r\nexport * from \"./core-react/notification/MessageType\";\r\n\r\nexport * from \"./core-react/popup/Popup\";\r\n\r\nexport * from \"./core-react/progress-indicators/ProgressBar\";\r\nexport * from \"./core-react/progress-indicators/ProgressSpinner\";\r\n\r\nexport * from \"./core-react/radialmenu/RadialMenu\";\r\nexport * from \"./core-react/radialmenu/Annulus\";\r\nexport * from \"./core-react/radio/Radio\";\r\n\r\nexport * from \"./core-react/select/LabeledSelect\";\r\nexport * from \"./core-react/select/Select\";\r\nexport * from \"./core-react/select/ThemedSelect\";\r\nexport * from \"./core-react/select/LabeledThemedSelect\";\r\nexport * from \"./core-react/searchbox/SearchBox\";\r\n\r\nexport * from \"./core-react/settings/SettingsManager\";\r\nexport * from \"./core-react/settings/SettingsContainer\";\r\n\r\nexport * from \"./core-react/slider/Slider\";\r\n\r\nexport * from \"./core-react/splitbutton/SplitButton\";\r\n\r\nexport * from \"./core-react/tabs/HorizontalTabs\";\r\nexport * from \"./core-react/tabs/VerticalTabs\";\r\nexport * from \"./core-react/tabs/Tabs\";\r\n\r\nexport * from \"./core-react/text/BodyText\";\r\nexport * from \"./core-react/text/BlockText\";\r\nexport * from \"./core-react/text/DisabledText\";\r\nexport * from \"./core-react/text/FilteredText\";\r\nexport * from \"./core-react/text/Headline\";\r\nexport * from \"./core-react/text/LeadingText\";\r\nexport * from \"./core-react/text/LeadingText2\";\r\nexport * from \"./core-react/text/MutedText\";\r\nexport * from \"./core-react/text/SmallText\";\r\nexport * from \"./core-react/text/Subheading\";\r\nexport * from \"./core-react/text/Subheading2\";\r\nexport * from \"./core-react/text/StyledText\";\r\nexport * from \"./core-react/text/TextProps\";\r\nexport * from \"./core-react/text/Title\";\r\nexport * from \"./core-react/text/Title2\";\r\n\r\nexport * from \"./core-react/tiles/FeaturedTile\";\r\nexport * from \"./core-react/tiles/MinimalFeaturedTile\";\r\nexport * from \"./core-react/tiles/MinimalTile\";\r\nexport * from \"./core-react/tiles/Tile\";\r\n\r\nexport * from \"./core-react/toggle/Toggle\";\r\nexport * from \"./core-react/toggle/LabeledToggle\";\r\n\r\nexport * from \"./core-react/tooltip/Tooltip\";\r\n\r\nexport { ExpansionToggle, ExpansionToggleProps } from \"./core-react/tree/ExpansionToggle\";\r\nexport { TreeBranch, TreeBranchProps } from \"./core-react/tree/Branch\";\r\nexport { TreeNode, TreeNodeProps, NodeCheckboxProps, NodeCheckboxRenderer, NodeCheckboxRenderProps } from \"./core-react/tree/Node\";\r\nexport { Tree, TreeProps } from \"./core-react/tree/Tree\";\r\nexport { TreeNodePlaceholder, TreeNodePlaceholderProps } from \"./core-react/tree/Placeholder\";\r\n\r\nexport * from \"./core-react/uistate/UiStateEntry\";\r\nexport * from \"./core-react/uistate/UiStateStorage\";\r\nexport * from \"./core-react/uistate/LocalStateStorage\";\r\n\r\nexport * from \"./core-react/utils/IconHelper\";\r\nexport * from \"./core-react/utils/Point\";\r\nexport * from \"./core-react/utils/PointProps\";\r\nexport * from \"./core-react/utils/Props\";\r\nexport * from \"./core-react/utils/Rectangle\";\r\nexport * from \"./core-react/utils/Size\";\r\nexport * from \"./core-react/utils/Timer\";\r\nexport * from \"./core-react/utils/UiEvent\";\r\nexport * from \"./core-react/utils/UiGeometry\";\r\nexport * from \"./core-react/utils/flattenChildren\";\r\nexport * from \"./core-react/utils/getBestBWContrastColor\";\r\nexport * from \"./core-react/utils/getCssVariable\";\r\nexport * from \"./core-react/utils/getDisplayName\";\r\nexport * from \"./core-react/utils/getUserColor\";\r\nexport * from \"./core-react/utils/shallowDiffers\";\r\nexport * from \"./core-react/utils/typeUtils\";\r\nexport * from \"./core-react/utils/isPromiseLike\";\r\nexport * from \"./core-react/utils/ScrollPositionMaintainer\";\r\n\r\nexport * from \"./core-react/utils/hooks/useDisposable\";\r\nexport * from \"./core-react/utils/hooks/useEffectSkipFirst\";\r\nexport * from \"./core-react/utils/hooks/useEventListener\";\r\nexport * from \"./core-react/utils/hooks/ResizeObserverPolyfill\";\r\nexport * from \"./core-react/utils/hooks/useOnOutsideClick\";\r\nexport * from \"./core-react/utils/hooks/useProximityToMouse\";\r\nexport * from \"./core-react/utils/hooks/useRefEffect\";\r\nexport * from \"./core-react/utils/hooks/useRefs\";\r\nexport * from \"./core-react/utils/hooks/useRefState\";\r\nexport * from \"./core-react/utils/hooks/useResizeObserver\";\r\nexport * from \"./core-react/utils/hooks/useTargeted\";\r\nexport * from \"./core-react/utils/hooks/useWidgetOpacityContext\";\r\n\r\n/** @docs-package-description\r\n * The core-react package contains general purpose React components, such as Dialog, MessageBox, SearchBox, RadialMenu and SplitButton.\r\n * For more information, see [learning about core-react]($docs/learning/ui/core/index.md).\r\n */\r\n/**\r\n * @docs-group-description AutoSuggest\r\n * Component for input with an auto-suggestion dropdown.\r\n */\r\n/**\r\n * @docs-group-description Base\r\n * Low-level classes and components for building application UI.\r\n */\r\n/**\r\n * @docs-group-description Button\r\n * Components for working with various Buttons.\r\n */\r\n/**\r\n * @docs-group-description Checkbox\r\n * Component is a wrapper for the `<input type=\"checkbox\">` HTML element.\r\n */\r\n/**\r\n * @docs-group-description CheckListBox\r\n * Components for working with a Check listbox.\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes and enums used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description ContextMenu\r\n * Components for working with a Context Menu.\r\n */\r\n/**\r\n * @docs-group-description Dialog\r\n * Components for working with a Dialog or MessageBox.\r\n */\r\n/**\r\n * @docs-group-description ElementSeparator\r\n * Components for working with a ElementSeparator.\r\n */\r\n/**\r\n * @docs-group-description Expandable\r\n * Components for working with a ExpandableBlock or ExpandableList.\r\n */\r\n/**\r\n * @docs-group-description Form\r\n * Components used to create a Form using supplied properties to specify fields.\r\n */\r\n/**\r\n * @docs-group-description Icon\r\n * Component that renders core-react icon when given an icon name or SVG source.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Components for working with input controls, such as Input, IconInput, NumberInput and Textarea.\r\n */\r\n/**\r\n * @docs-group-description Loading\r\n * Components for working with Loading spinners and progress indicators and bars.\r\n */\r\n/**\r\n * @docs-group-description Notification\r\n * Components for working with messages and tooltips.\r\n */\r\n/**\r\n * @docs-group-description Popup\r\n * Components for working with a Popup.\r\n */\r\n/**\r\n * @docs-group-description RadialMenu\r\n * Components for working with a RadialMenu.\r\n */\r\n/**\r\n * @docs-group-description Radio\r\n * Component is a wrapper for the `<input type=\"radio\">` HTML element.\r\n */\r\n/**\r\n * @docs-group-description SearchBox\r\n * Components for working with a SearchBox.\r\n */\r\n/**\r\n * @docs-group-description Select\r\n * Component is a wrapper for the `<select>` HTML element.\r\n */\r\n/**\r\n * @docs-group-description Settings\r\n * Manager and UI Components that allow users to modify settings for different packages and extensions.\r\n */\r\n/**\r\n * @docs-group-description Slider\r\n * Component displays a range slider with thumbs for changing the value.\r\n */\r\n/**\r\n * @docs-group-description SplitButton\r\n * Components for working with a SplitButton.\r\n */\r\n/**\r\n * @docs-group-description Tabs\r\n * Components for working with horizontal or vertical tabs.\r\n */\r\n/**\r\n * @docs-group-description Text\r\n * Components for working with styled text.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Components for a container rendering elements that can be grouped together.\r\n */\r\n/**\r\n * @docs-group-description Toggle\r\n * Components for working with a Toggle switch.\r\n */\r\n/**\r\n * @docs-group-description Tooltip\r\n * Components for working with a Tooltip.\r\n */\r\n/**\r\n * @docs-group-description Tree\r\n * Presentation React components for working with a Tree.\r\n */\r\n/**\r\n * @docs-group-description UiStateStorage\r\n * Interfaces and classes for working with persistent UI settings.\r\n */\r\n/**\r\n * @docs-group-description Utilities\r\n * Various utility classes, functions and React hooks for working with a UI.\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"core-react.js","sourceRoot":"","sources":["../../src/core-react.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,gFAAgF;AAEhF,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AAErD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAE1D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cA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GAGG;AACH;;;GAGG","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\r\n// cSpell:ignore focustrap imagecheckbox iconinput hocs numberinput numericinput\r\n\r\nexport * from \"./core-react/UiCore\";\r\n\r\nexport * from \"./core-react/badge/Badge\";\r\nexport * from \"./core-react/badge/BadgeUtilities\";\r\nexport * from \"./core-react/badge/BetaBadge\";\r\nexport * from \"./core-react/badge/NewBadge\";\r\n\r\nexport * from \"./core-react/base/Div\";\r\nexport * from \"./core-react/base/DivWithOutsideClick\";\r\nexport * from \"./core-react/base/Centered\";\r\nexport * from \"./core-react/base/FillCentered\";\r\nexport * from \"./core-react/base/FlexWrapContainer\";\r\nexport * from \"./core-react/base/Gap\";\r\nexport * from \"./core-react/base/PointerEvents\";\r\nexport * from \"./core-react/base/ScrollView\";\r\n\r\nexport * from \"./core-react/button/Button\";\r\nexport * from \"./core-react/button/UnderlinedButton\";\r\n\r\nexport * from \"./core-react/checklistbox/CheckListBox\";\r\n\r\nexport * from \"./core-react/contextmenu/ContextMenu\";\r\nexport * from \"./core-react/contextmenu/ContextMenuDirection\";\r\nexport * from \"./core-react/contextmenu/ContextMenuDivider\";\r\nexport * from \"./core-react/contextmenu/ContextMenuItem\";\r\nexport * from \"./core-react/contextmenu/ContextSubMenu\";\r\nexport * from \"./core-react/contextmenu/GlobalContextMenu\";\r\nexport * from \"./core-react/contextmenu/PopupContextMenu\";\r\n\r\nexport * from \"./core-react/dialog/Dialog\";\r\nexport * from \"./core-react/dialog/DialogButtonDef\";\r\nexport * from \"./core-react/dialog/GlobalDialog\";\r\n\r\nexport * from \"./core-react/elementseparator/ElementSeparator\";\r\n\r\nexport * from \"./core-react/enums/Alignment\";\r\nexport * from \"./core-react/enums/CheckBoxState\";\r\nexport * from \"./core-react/enums/Orientation\";\r\nexport * from \"./core-react/enums/SortDirection\";\r\nexport * from \"./core-react/enums/TimeFormat\";\r\n\r\nexport * from \"./core-react/expandable/ExpandableList\";\r\nexport * from \"./core-react/expandable/ExpandableBlock\";\r\n\r\nexport * from \"./core-react/focus/ItemKeyboardNavigator\";\r\nexport * from \"./core-react/focustrap/FocusTrap\";\r\n\r\nexport * from \"./core-react/form/Field\";\r\nexport * from \"./core-react/form/Form\";\r\n\r\nexport * from \"./core-react/hocs/withIsPressed\";\r\nexport * from \"./core-react/hocs/withOnOutsideClick\";\r\nexport * from \"./core-react/hocs/withTimeout\";\r\n\r\nexport * from \"./core-react/icons/IconComponent\";\r\nexport * from \"./core-react/icons/SvgPath\";\r\nexport * from \"./core-react/icons/SvgSprite\";\r\nexport * from \"./core-react/icons/WebFontIcon\";\r\n\r\nexport * from \"./core-react/autosuggest/AutoSuggest\";\r\n\r\nexport * from \"./core-react/checkbox/Checkbox\";\r\n\r\nexport * from \"./core-react/imagecheckbox/ImageCheckBox\";\r\n\r\nexport * from \"./core-react/inputs/Input\";\r\nexport * from \"./core-react/inputs/InputLabel\";\r\nexport * from \"./core-react/inputs/InputStatus\";\r\nexport * from \"./core-react/inputs/iconinput/IconInput\";\r\nexport * from \"./core-react/inputs/LabeledComponentProps\";\r\nexport * from \"./core-react/inputs/LabeledInput\";\r\nexport * from \"./core-react/inputs/LabeledTextarea\";\r\nexport * from \"./core-react/inputs/numberinput/NumberInput\";\r\nexport * from \"./core-react/inputs/Textarea\";\r\n\r\nexport * from \"./core-react/listbox/Listbox\";\r\n\r\nexport * from \"./core-react/loading/LoadingBar\";\r\nexport * from \"./core-react/loading/LoadingPrompt\";\r\nexport * from \"./core-react/loading/LoadingSpinner\";\r\nexport * from \"./core-react/loading/LoadingStatus\";\r\nexport * from \"./core-react/loading/Spinner\";\r\n\r\nexport * from \"./core-react/messagebox/MessageBox\";\r\nexport * from \"./core-react/messagebox/MessageSeverity\";\r\n\r\nexport * from \"./core-react/notification/MessageRenderer\";\r\nexport * from \"./core-react/notification/MessageType\";\r\n\r\nexport * from \"./core-react/popup/Popup\";\r\n\r\nexport * from \"./core-react/progress-indicators/ProgressBar\";\r\nexport * from \"./core-react/progress-indicators/ProgressSpinner\";\r\n\r\nexport * from \"./core-react/radialmenu/RadialMenu\";\r\nexport * from \"./core-react/radialmenu/Annulus\";\r\nexport * from \"./core-react/radio/Radio\";\r\n\r\nexport * from \"./core-react/select/LabeledSelect\";\r\nexport * from \"./core-react/select/Select\";\r\nexport * from \"./core-react/select/ThemedSelect\";\r\nexport * from \"./core-react/select/LabeledThemedSelect\";\r\nexport * from \"./core-react/searchbox/SearchBox\";\r\n\r\nexport * from \"./core-react/settings/SettingsManager\";\r\nexport * from \"./core-react/settings/SettingsContainer\";\r\n\r\nexport * from \"./core-react/slider/Slider\";\r\n\r\nexport * from \"./core-react/splitbutton/SplitButton\";\r\n\r\nexport * from \"./core-react/tabs/HorizontalTabs\";\r\nexport * from \"./core-react/tabs/VerticalTabs\";\r\nexport * from \"./core-react/tabs/Tabs\";\r\n\r\nexport * from \"./core-react/text/BodyText\";\r\nexport * from \"./core-react/text/BlockText\";\r\nexport * from \"./core-react/text/DisabledText\";\r\nexport * from \"./core-react/text/FilteredText\";\r\nexport * from \"./core-react/text/Headline\";\r\nexport * from \"./core-react/text/LeadingText\";\r\nexport * from \"./core-react/text/LeadingText2\";\r\nexport * from \"./core-react/text/MutedText\";\r\nexport * from \"./core-react/text/SmallText\";\r\nexport * from \"./core-react/text/Subheading\";\r\nexport * from \"./core-react/text/Subheading2\";\r\nexport * from \"./core-react/text/StyledText\";\r\nexport * from \"./core-react/text/TextProps\";\r\nexport * from \"./core-react/text/Title\";\r\nexport * from \"./core-react/text/Title2\";\r\n\r\nexport * from \"./core-react/tiles/FeaturedTile\";\r\nexport * from \"./core-react/tiles/MinimalFeaturedTile\";\r\nexport * from \"./core-react/tiles/MinimalTile\";\r\nexport * from \"./core-react/tiles/Tile\";\r\n\r\nexport * from \"./core-react/toggle/Toggle\";\r\nexport * from \"./core-react/toggle/LabeledToggle\";\r\n\r\nexport * from \"./core-react/tooltip/Tooltip\";\r\n\r\nexport { ExpansionToggle, ExpansionToggleProps } from \"./core-react/tree/ExpansionToggle\";\r\nexport { TreeBranch, TreeBranchProps } from \"./core-react/tree/Branch\";\r\nexport { TreeNode, TreeNodeProps, NodeCheckboxProps, NodeCheckboxRenderer, NodeCheckboxRenderProps } from \"./core-react/tree/Node\";\r\nexport { Tree, TreeProps } from \"./core-react/tree/Tree\";\r\nexport { TreeNodePlaceholder, TreeNodePlaceholderProps } from \"./core-react/tree/Placeholder\";\r\n\r\nexport * from \"./core-react/uistate/UiStateEntry\";\r\nexport * from \"./core-react/uistate/UiStateStorage\";\r\nexport * from \"./core-react/uistate/LocalStateStorage\";\r\n\r\nexport * from \"./core-react/utils/IconHelper\";\r\nexport * from \"./core-react/utils/Point\";\r\nexport * from \"./core-react/utils/PointProps\";\r\nexport * from \"./core-react/utils/Props\";\r\nexport * from \"./core-react/utils/Rectangle\";\r\nexport * from \"./core-react/utils/Size\";\r\nexport * from \"./core-react/utils/Timer\";\r\nexport * from \"./core-react/utils/UiEvent\";\r\nexport * from \"./core-react/utils/UiGeometry\";\r\nexport * from \"./core-react/utils/flattenChildren\";\r\nexport * from \"./core-react/utils/getBestBWContrastColor\";\r\nexport * from \"./core-react/utils/getCssVariable\";\r\nexport * from \"./core-react/utils/getDisplayName\";\r\nexport * from \"./core-react/utils/getUserColor\";\r\nexport * from \"./core-react/utils/shallowDiffers\";\r\nexport * from \"./core-react/utils/typeUtils\";\r\nexport * from \"./core-react/utils/isPromiseLike\";\r\nexport * from \"./core-react/utils/ScrollPositionMaintainer\";\r\n\r\nexport * from \"./core-react/utils/hooks/useDisposable\";\r\nexport * from \"./core-react/utils/hooks/useEffectSkipFirst\";\r\nexport * from \"./core-react/utils/hooks/useEventListener\";\r\nexport * from \"./core-react/utils/hooks/ResizeObserverPolyfill\";\r\nexport * from \"./core-react/utils/hooks/useOnOutsideClick\";\r\nexport * from \"./core-react/utils/hooks/useProximityToMouse\";\r\nexport * from \"./core-react/utils/hooks/useRefEffect\";\r\nexport * from \"./core-react/utils/hooks/useRefs\";\r\nexport * from \"./core-react/utils/hooks/useRefState\";\r\nexport * from \"./core-react/utils/hooks/useResizeObserver\";\r\nexport * from \"./core-react/utils/hooks/useTargeted\";\r\nexport * from \"./core-react/utils/hooks/useWidgetOpacityContext\";\r\nexport * from \"./core-react/utils/hooks/useInterval\";\r\nexport * from \"./core-react/utils/hooks/useCrossOriginPopup\";\r\n\r\n/** @docs-package-description\r\n * The core-react package contains general purpose React components, such as Dialog, MessageBox, SearchBox, RadialMenu and SplitButton.\r\n * For more information, see [learning about core-react]($docs/learning/ui/core/index.md).\r\n */\r\n/**\r\n * @docs-group-description AutoSuggest\r\n * Component for input with an auto-suggestion dropdown.\r\n */\r\n/**\r\n * @docs-group-description Base\r\n * Low-level classes and components for building application UI.\r\n */\r\n/**\r\n * @docs-group-description Button\r\n * Components for working with various Buttons.\r\n */\r\n/**\r\n * @docs-group-description Checkbox\r\n * Component is a wrapper for the `<input type=\"checkbox\">` HTML element.\r\n */\r\n/**\r\n * @docs-group-description CheckListBox\r\n * Components for working with a Check listbox.\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes and enums used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description ContextMenu\r\n * Components for working with a Context Menu.\r\n */\r\n/**\r\n * @docs-group-description Dialog\r\n * Components for working with a Dialog or MessageBox.\r\n */\r\n/**\r\n * @docs-group-description ElementSeparator\r\n * Components for working with a ElementSeparator.\r\n */\r\n/**\r\n * @docs-group-description Expandable\r\n * Components for working with a ExpandableBlock or ExpandableList.\r\n */\r\n/**\r\n * @docs-group-description Form\r\n * Components used to create a Form using supplied properties to specify fields.\r\n */\r\n/**\r\n * @docs-group-description Icon\r\n * Component that renders core-react icon when given an icon name or SVG source.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Components for working with input controls, such as Input, IconInput, NumberInput and Textarea.\r\n */\r\n/**\r\n * @docs-group-description Loading\r\n * Components for working with Loading spinners and progress indicators and bars.\r\n */\r\n/**\r\n * @docs-group-description Notification\r\n * Components for working with messages and tooltips.\r\n */\r\n/**\r\n * @docs-group-description Popup\r\n * Components for working with a Popup.\r\n */\r\n/**\r\n * @docs-group-description RadialMenu\r\n * Components for working with a RadialMenu.\r\n */\r\n/**\r\n * @docs-group-description Radio\r\n * Component is a wrapper for the `<input type=\"radio\">` HTML element.\r\n */\r\n/**\r\n * @docs-group-description SearchBox\r\n * Components for working with a SearchBox.\r\n */\r\n/**\r\n * @docs-group-description Select\r\n * Component is a wrapper for the `<select>` HTML element.\r\n */\r\n/**\r\n * @docs-group-description Settings\r\n * Manager and UI Components that allow users to modify settings for different packages and extensions.\r\n */\r\n/**\r\n * @docs-group-description Slider\r\n * Component displays a range slider with thumbs for changing the value.\r\n */\r\n/**\r\n * @docs-group-description SplitButton\r\n * Components for working with a SplitButton.\r\n */\r\n/**\r\n * @docs-group-description Tabs\r\n * Components for working with horizontal or vertical tabs.\r\n */\r\n/**\r\n * @docs-group-description Text\r\n * Components for working with styled text.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Components for a container rendering elements that can be grouped together.\r\n */\r\n/**\r\n * @docs-group-description Toggle\r\n * Components for working with a Toggle switch.\r\n */\r\n/**\r\n * @docs-group-description Tooltip\r\n * Components for working with a Tooltip.\r\n */\r\n/**\r\n * @docs-group-description Tree\r\n * Presentation React components for working with a Tree.\r\n */\r\n/**\r\n * @docs-group-description UiStateStorage\r\n * Interfaces and classes for working with persistent UI settings.\r\n */\r\n/**\r\n * @docs-group-description Utilities\r\n * Various utility classes, functions and React hooks for working with a UI.\r\n */\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0-dev.1",
|
|
4
4
|
"description": "iTwin.js UI core components",
|
|
5
5
|
"main": "lib/cjs/core-react.js",
|
|
6
6
|
"module": "lib/esm/core-react.js",
|
|
7
7
|
"typings": "lib/cjs/core-react",
|
|
8
|
-
"imodeljsSharedLibrary": true,
|
|
9
8
|
"license": "MIT",
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
@@ -23,8 +22,8 @@
|
|
|
23
22
|
"url": "http://www.bentley.com"
|
|
24
23
|
},
|
|
25
24
|
"peerDependencies": {
|
|
26
|
-
"@itwin/appui-abstract": "^3.
|
|
27
|
-
"@itwin/core-bentley": "^3.
|
|
25
|
+
"@itwin/appui-abstract": "^3.3.0-dev.1",
|
|
26
|
+
"@itwin/core-bentley": "^3.3.0-dev.1",
|
|
28
27
|
"react": "^17.0.0",
|
|
29
28
|
"react-dom": "^17.0.0"
|
|
30
29
|
},
|
|
@@ -33,12 +32,13 @@
|
|
|
33
32
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
34
33
|
],
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@itwin/appui-abstract": "3.
|
|
37
|
-
"@itwin/build-tools": "3.
|
|
38
|
-
"@itwin/core-bentley": "3.
|
|
39
|
-
"@itwin/core-common": "3.
|
|
40
|
-
"@itwin/core-i18n": "3.
|
|
41
|
-
"@itwin/eslint-plugin": "3.
|
|
35
|
+
"@itwin/appui-abstract": "3.3.0-dev.1",
|
|
36
|
+
"@itwin/build-tools": "3.3.0-dev.1",
|
|
37
|
+
"@itwin/core-bentley": "3.3.0-dev.1",
|
|
38
|
+
"@itwin/core-common": "3.3.0-dev.1",
|
|
39
|
+
"@itwin/core-i18n": "3.3.0-dev.1",
|
|
40
|
+
"@itwin/eslint-plugin": "3.3.0-dev.1",
|
|
41
|
+
"@testing-library/dom": "^8.11.2",
|
|
42
42
|
"@testing-library/react": "^12.0.0",
|
|
43
43
|
"@testing-library/react-hooks": "^7.0.2",
|
|
44
44
|
"@testing-library/user-event": "^13.2.1",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/enzyme": "3.9.3",
|
|
51
51
|
"@types/lodash": "^4.14.0",
|
|
52
52
|
"@types/mocha": "^8.2.2",
|
|
53
|
-
"@types/node": "
|
|
53
|
+
"@types/node": "16.11.7",
|
|
54
54
|
"@types/react": "^17.0.37",
|
|
55
55
|
"@types/react-autosuggest": "10.1.2",
|
|
56
56
|
"@types/react-dom": "^17.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"enzyme-to-json": "^3.3.4",
|
|
68
68
|
"eslint": "^7.11.0",
|
|
69
69
|
"ignore-styles": "^5.0.1",
|
|
70
|
-
"jsdom": "^
|
|
70
|
+
"jsdom": "^19.0.0",
|
|
71
71
|
"jsdom-global": "3.0.2",
|
|
72
72
|
"mocha": "^8.3.2",
|
|
73
73
|
"nyc": "^15.1.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"rimraf": "^3.0.2",
|
|
80
80
|
"sinon": "^9.0.2",
|
|
81
81
|
"sinon-chai": "^3.2.0",
|
|
82
|
-
"ts-node": "^
|
|
82
|
+
"ts-node": "^10.4.0",
|
|
83
83
|
"typemoq": "^2.1.0",
|
|
84
84
|
"typescript": "~4.4.0",
|
|
85
85
|
"xmlhttprequest": "^1.8.0"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
],
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@bentley/icons-generic-webfont": "^1.0.15",
|
|
93
|
-
"@itwin/itwinui-css": "0.
|
|
93
|
+
"@itwin/itwinui-css": "0.x",
|
|
94
94
|
"@itwin/itwinui-react": "^1.32.0",
|
|
95
95
|
"classnames": "^2.3.1",
|
|
96
96
|
"dompurify": "^2.0.12",
|