@itwin/appui-react 3.2.0-dev.50 → 3.2.0-dev.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/appui-react/content/ContentGroup.d.ts +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.d.ts +1 -1
- package/lib/esm/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.js.map +1 -1
- package/package.json +32 -32
|
@@ -22,7 +22,7 @@ export interface ContentProps {
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
export interface ContentGroupProps {
|
|
25
|
-
/** An
|
|
25
|
+
/** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */
|
|
26
26
|
id: string;
|
|
27
27
|
/** Content Layout Id or complete set of [[ContentLayoutProps]] */
|
|
28
28
|
layout: ContentLayoutProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAW,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAA0B,gCAAgC,EAA6B,MAAM,yCAAyC,CAAC;AAG9I,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,OAAO,EAAE,MAAM,GAAG,gCAAgC,CAAC;IACnD,gEAAgE;IAChE,eAAe,CAAC,EAAE,GAAG,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,
|
|
1
|
+
{"version":3,"file":"ContentGroup.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAW,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAA0B,gCAAgC,EAA6B,MAAM,yCAAyC,CAAC;AAG9I,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,OAAO,EAAE,MAAM,GAAG,gCAAgC,CAAC;IACnD,gEAAgE;IAChE,eAAe,CAAC,EAAE,GAAG,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mKAAmK;IACnK,EAAE,EAAE,MAAM,CAAC;IACX,mEAAmE;IACnE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,8BAAsB,oBAAoB;IACxC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAE3E;;OAEG;IACI,kBAAkB,CAAC,iBAAiB,EAAE,iBAAiB;IAI9D;;OAEG;IACI,wBAAwB,CAAC,iBAAiB,EAAE,iBAAiB;IAIpE,kFAAkF;IACrE,uBAAuB;CACrC;AAED;;GAEG;AACH,oBAAY,eAAe,GAAG,CAAC,OAAO,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;IAED;;OAEG;IACI,YAAY;QACjB,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;QAE1D,eAAe,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;YAClD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AArKH,oCAsKC;AArKgB,iBAAI,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContentLayoutProps, UiError } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\nimport { ConfigurableUiManager } from \"../configurableui/ConfigurableUiManager\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { FrontstageProps } from \"../frontstage/Frontstage\";\r\n\r\n/** Properties for content displayed in a content view\r\n * @public\r\n */\r\nexport interface ContentProps {\r\n /** A unique id for the Content View within the group */\r\n id: string;\r\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\r\n classId: string | ConfigurableUiControlConstructor;\r\n /** Optional application data passed down to the Content View */\r\n applicationData?: any;\r\n}\r\n\r\n/** Properties for a [[ContentGroup]]\r\n * @public\r\n */\r\nexport interface ContentGroupProps {\r\n /** An optional id for the [[ContentGroup]] */\r\n id: string;\r\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\r\n layout: ContentLayoutProps;\r\n /** A collection of [[ContentProps]], one for each content view */\r\n contents: ContentProps[];\r\n}\r\n\r\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\r\n * content group just prior to activating the frontstage.\r\n * @public\r\n */\r\nexport abstract class ContentGroupProvider {\r\n abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>;\r\n\r\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\r\n * be to remove applicationData entries.\r\n */\r\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\r\n * Typically this may be to add applicationData to content entries.\r\n */\r\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to save any content group data before the stage deactivated. */\r\n public async onFrontstageDeactivated() { }\r\n}\r\n\r\n/** Callback to process content properties during toJSON method\r\n * @public\r\n */\r\nexport type ContentCallback = (content: ContentProps) => void;\r\n\r\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\r\n * @public\r\n */\r\nexport class ContentGroup {\r\n private static _sId = 0;\r\n public groupId: string;\r\n public propsId: string;\r\n public layout: ContentLayoutProps;\r\n public contentPropsList: ContentProps[];\r\n private _contentControls = new Map<string, ContentControl>();\r\n private _contentSetMap = new Map<string, ContentControl>();\r\n\r\n public get id() {\r\n return this.groupId;\r\n }\r\n\r\n constructor(contentGroupProps: ContentGroupProps) {\r\n this.layout = { ...contentGroupProps.layout };\r\n this.propsId = contentGroupProps.id;\r\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\r\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\r\n this.contentPropsList = contentGroupProps.contents;\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\r\n public getContentControl(contentProps: ContentProps, _index: number): ContentControl | undefined {\r\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\r\n const id = `${contentProps.id}::${this.groupId}`;\r\n let contentControl: ContentControl | undefined;\r\n\r\n if (!this._contentControls.get(contentProps.id)) {\r\n let usedClassId: string = \"\";\r\n\r\n if (typeof contentProps.classId === \"string\") {\r\n if (!this._contentControls.get(contentProps.id) && ConfigurableUiManager.isControlRegistered(contentProps.classId)) {\r\n contentControl = ConfigurableUiManager.createControl(contentProps.classId, id, contentProps.applicationData, contentProps.id) as ContentControl;\r\n usedClassId = contentProps.classId;\r\n }\r\n } else {\r\n const info = new ConfigurableCreateInfo(contentProps.classId.name, id, contentProps.id);\r\n contentControl = new contentProps.classId(info, contentProps.applicationData) as ContentControl;\r\n usedClassId = contentProps.classId.name;\r\n }\r\n\r\n if (contentControl) {\r\n if (contentControl.getType() !== ConfigurableUiControlType.Content && contentControl.getType() !== ConfigurableUiControlType.Viewport) {\r\n throw new UiError(UiFramework.loggerCategory(this), `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`);\r\n }\r\n contentControl.initialize();\r\n this._contentControls.set(contentProps.id, contentControl);\r\n }\r\n }\r\n\r\n return this._contentControls.get(contentProps.id);\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\r\n public getContentControlById(id: string): ContentControl | undefined {\r\n return this._contentControls.get(id);\r\n }\r\n\r\n /** Gets the React nodes representing the Content Views in this Content Group. */\r\n public getContentNodes(): React.ReactNode[] {\r\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\r\n\r\n this._contentSetMap.clear();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentNodes.push(control.reactNode);\r\n this._contentSetMap.set(control.controlId, control);\r\n }\r\n });\r\n\r\n return contentNodes;\r\n }\r\n\r\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\r\n public getControlFromElement(node: React.ReactNode): ContentControl | undefined {\r\n if (this._contentSetMap.size === 0)\r\n this.getContentNodes();\r\n\r\n if (node && (node as React.ReactElement<any>).key) {\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n const controlId = key.split(\"::\", 1)[0];\r\n return this._contentSetMap.get(controlId);\r\n }\r\n\r\n Logger.logError(UiFramework.loggerCategory(this), `getControlFromElement: no control found for element`);\r\n return undefined;\r\n }\r\n\r\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\r\n public refreshContentNodes() {\r\n this._contentSetMap.clear();\r\n }\r\n\r\n /** Gets an array of the content controls representing the Content Views. */\r\n public getContentControls(): ContentControl[] {\r\n const contentControls: ContentControl[] = new Array<ContentControl>();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentControls.push(control);\r\n }\r\n });\r\n\r\n return contentControls;\r\n }\r\n\r\n /** Called when Frontstage is deactivated. */\r\n public onFrontstageDeactivated(): void {\r\n this.clearContentControls();\r\n }\r\n\r\n /** Called when Frontstage is ready. */\r\n public onFrontstageReady(): void { }\r\n\r\n /** Clears the map of content controls. */\r\n public clearContentControls(): void {\r\n this._contentControls.clear();\r\n }\r\n\r\n /** Creates [[ContentGroupProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\r\n const contentGroupProps: ContentGroupProps = {\r\n id: this.propsId,\r\n layout: this.layout,\r\n contents: this.contentPropsList,\r\n };\r\n\r\n contentGroupProps.contents.forEach((content: ContentProps, index: number) => {\r\n if (typeof content.classId !== \"string\") {\r\n const classId = ConfigurableUiManager.getConstructorClassId(content.classId);\r\n if (classId !== undefined)\r\n content.classId = classId;\r\n else\r\n throw new UiError(UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);\r\n\r\n if (contentCallback)\r\n contentCallback(content);\r\n }\r\n });\r\n\r\n return contentGroupProps;\r\n }\r\n\r\n /** Gets Viewports from Viewport Content Controls\r\n * @internal\r\n */\r\n public getViewports(): Array<ScreenViewport | undefined> {\r\n const contentControls = this.getContentControls();\r\n const viewports = new Array<ScreenViewport | undefined>();\r\n\r\n contentControls.forEach((control: ContentControl) => {\r\n if (control.isViewport && control.viewport) {\r\n viewports.push(control.viewport);\r\n } else {\r\n viewports.push(undefined);\r\n }\r\n });\r\n\r\n return viewports;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA6C;AAE7C,0DAAoE;AACpE,mFAA8I;AAC9I,mFAAgF;AAChF,gDAA6C;AA4B7C;;;GAGG;AACH,MAAsB,oBAAoB;IAGxC;;OAEG;IACI,kBAAkB,CAAC,iBAAoC;QAC5D,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,wBAAwB,CAAC,iBAAoC;QAClE,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,kFAAkF;IAC3E,KAAK,CAAC,uBAAuB,KAAK,CAAC;CAC3C;AAnBD,oDAmBC;AAOD;;GAEG;AACH,MAAa,YAAY;IAavB,YAAY,iBAAoC;QAPxC,qBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;QACrD,mBAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;QAOzD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,CAAC;QACpC,mIAAmI;QACnI,IAAI,CAAC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,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,gBAAgB;SAChC,CAAC;QAEF,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAqB,EAAE,KAAa,EAAE,EAAE;YAC1E,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE;gBACvC,MAAM,OAAO,GAAG,6CAAqB,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC7E,IAAI,OAAO,KAAK,SAAS;oBACvB,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;;oBAE1B,MAAM,IAAI,wBAAO,CAAC,yBAAW,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mCAAmC,KAAK,qCAAqC,CAAC,CAAC;gBAErI,IAAI,eAAe;oBACjB,eAAe,CAAC,OAAO,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;QAE1D,eAAe,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;YAClD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AArKH,oCAsKC;AArKgB,iBAAI,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContentLayoutProps, UiError } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\nimport { ConfigurableUiManager } from \"../configurableui/ConfigurableUiManager\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { FrontstageProps } from \"../frontstage/Frontstage\";\r\n\r\n/** Properties for content displayed in a content view\r\n * @public\r\n */\r\nexport interface ContentProps {\r\n /** A unique id for the Content View within the group */\r\n id: string;\r\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\r\n classId: string | ConfigurableUiControlConstructor;\r\n /** Optional application data passed down to the Content View */\r\n applicationData?: any;\r\n}\r\n\r\n/** Properties for a [[ContentGroup]]\r\n * @public\r\n */\r\nexport interface ContentGroupProps {\r\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\r\n id: string;\r\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\r\n layout: ContentLayoutProps;\r\n /** A collection of [[ContentProps]], one for each content view */\r\n contents: ContentProps[];\r\n}\r\n\r\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\r\n * content group just prior to activating the frontstage.\r\n * @public\r\n */\r\nexport abstract class ContentGroupProvider {\r\n abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>;\r\n\r\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\r\n * be to remove applicationData entries.\r\n */\r\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\r\n * Typically this may be to add applicationData to content entries.\r\n */\r\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to save any content group data before the stage deactivated. */\r\n public async onFrontstageDeactivated() { }\r\n}\r\n\r\n/** Callback to process content properties during toJSON method\r\n * @public\r\n */\r\nexport type ContentCallback = (content: ContentProps) => void;\r\n\r\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\r\n * @public\r\n */\r\nexport class ContentGroup {\r\n private static _sId = 0;\r\n public groupId: string;\r\n public propsId: string;\r\n public layout: ContentLayoutProps;\r\n public contentPropsList: ContentProps[];\r\n private _contentControls = new Map<string, ContentControl>();\r\n private _contentSetMap = new Map<string, ContentControl>();\r\n\r\n public get id() {\r\n return this.groupId;\r\n }\r\n\r\n constructor(contentGroupProps: ContentGroupProps) {\r\n this.layout = { ...contentGroupProps.layout };\r\n this.propsId = contentGroupProps.id;\r\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\r\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\r\n this.contentPropsList = contentGroupProps.contents;\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\r\n public getContentControl(contentProps: ContentProps, _index: number): ContentControl | undefined {\r\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\r\n const id = `${contentProps.id}::${this.groupId}`;\r\n let contentControl: ContentControl | undefined;\r\n\r\n if (!this._contentControls.get(contentProps.id)) {\r\n let usedClassId: string = \"\";\r\n\r\n if (typeof contentProps.classId === \"string\") {\r\n if (!this._contentControls.get(contentProps.id) && ConfigurableUiManager.isControlRegistered(contentProps.classId)) {\r\n contentControl = ConfigurableUiManager.createControl(contentProps.classId, id, contentProps.applicationData, contentProps.id) as ContentControl;\r\n usedClassId = contentProps.classId;\r\n }\r\n } else {\r\n const info = new ConfigurableCreateInfo(contentProps.classId.name, id, contentProps.id);\r\n contentControl = new contentProps.classId(info, contentProps.applicationData) as ContentControl;\r\n usedClassId = contentProps.classId.name;\r\n }\r\n\r\n if (contentControl) {\r\n if (contentControl.getType() !== ConfigurableUiControlType.Content && contentControl.getType() !== ConfigurableUiControlType.Viewport) {\r\n throw new UiError(UiFramework.loggerCategory(this), `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`);\r\n }\r\n contentControl.initialize();\r\n this._contentControls.set(contentProps.id, contentControl);\r\n }\r\n }\r\n\r\n return this._contentControls.get(contentProps.id);\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\r\n public getContentControlById(id: string): ContentControl | undefined {\r\n return this._contentControls.get(id);\r\n }\r\n\r\n /** Gets the React nodes representing the Content Views in this Content Group. */\r\n public getContentNodes(): React.ReactNode[] {\r\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\r\n\r\n this._contentSetMap.clear();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentNodes.push(control.reactNode);\r\n this._contentSetMap.set(control.controlId, control);\r\n }\r\n });\r\n\r\n return contentNodes;\r\n }\r\n\r\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\r\n public getControlFromElement(node: React.ReactNode): ContentControl | undefined {\r\n if (this._contentSetMap.size === 0)\r\n this.getContentNodes();\r\n\r\n if (node && (node as React.ReactElement<any>).key) {\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n const controlId = key.split(\"::\", 1)[0];\r\n return this._contentSetMap.get(controlId);\r\n }\r\n\r\n Logger.logError(UiFramework.loggerCategory(this), `getControlFromElement: no control found for element`);\r\n return undefined;\r\n }\r\n\r\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\r\n public refreshContentNodes() {\r\n this._contentSetMap.clear();\r\n }\r\n\r\n /** Gets an array of the content controls representing the Content Views. */\r\n public getContentControls(): ContentControl[] {\r\n const contentControls: ContentControl[] = new Array<ContentControl>();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentControls.push(control);\r\n }\r\n });\r\n\r\n return contentControls;\r\n }\r\n\r\n /** Called when Frontstage is deactivated. */\r\n public onFrontstageDeactivated(): void {\r\n this.clearContentControls();\r\n }\r\n\r\n /** Called when Frontstage is ready. */\r\n public onFrontstageReady(): void { }\r\n\r\n /** Clears the map of content controls. */\r\n public clearContentControls(): void {\r\n this._contentControls.clear();\r\n }\r\n\r\n /** Creates [[ContentGroupProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\r\n const contentGroupProps: ContentGroupProps = {\r\n id: this.propsId,\r\n layout: this.layout,\r\n contents: this.contentPropsList,\r\n };\r\n\r\n contentGroupProps.contents.forEach((content: ContentProps, index: number) => {\r\n if (typeof content.classId !== \"string\") {\r\n const classId = ConfigurableUiManager.getConstructorClassId(content.classId);\r\n if (classId !== undefined)\r\n content.classId = classId;\r\n else\r\n throw new UiError(UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);\r\n\r\n if (contentCallback)\r\n contentCallback(content);\r\n }\r\n });\r\n\r\n return contentGroupProps;\r\n }\r\n\r\n /** Gets Viewports from Viewport Content Controls\r\n * @internal\r\n */\r\n public getViewports(): Array<ScreenViewport | undefined> {\r\n const contentControls = this.getContentControls();\r\n const viewports = new Array<ScreenViewport | undefined>();\r\n\r\n contentControls.forEach((control: ContentControl) => {\r\n if (control.isViewport && control.viewport) {\r\n viewports.push(control.viewport);\r\n } else {\r\n viewports.push(undefined);\r\n }\r\n });\r\n\r\n return viewports;\r\n }\r\n}\r\n"]}
|
|
@@ -22,7 +22,7 @@ export interface ContentProps {
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
export interface ContentGroupProps {
|
|
25
|
-
/** An
|
|
25
|
+
/** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */
|
|
26
26
|
id: string;
|
|
27
27
|
/** Content Layout Id or complete set of [[ContentLayoutProps]] */
|
|
28
28
|
layout: ContentLayoutProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAW,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAA0B,gCAAgC,EAA6B,MAAM,yCAAyC,CAAC;AAG9I,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,OAAO,EAAE,MAAM,GAAG,gCAAgC,CAAC;IACnD,gEAAgE;IAChE,eAAe,CAAC,EAAE,GAAG,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,
|
|
1
|
+
{"version":3,"file":"ContentGroup.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAW,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAA0B,gCAAgC,EAA6B,MAAM,yCAAyC,CAAC;AAG9I,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAA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C;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AApKc,iBAAI,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContentLayoutProps, UiError } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\nimport { ConfigurableUiManager } from \"../configurableui/ConfigurableUiManager\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { FrontstageProps } from \"../frontstage/Frontstage\";\r\n\r\n/** Properties for content displayed in a content view\r\n * @public\r\n */\r\nexport interface ContentProps {\r\n /** A unique id for the Content View within the group */\r\n id: string;\r\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\r\n classId: string | ConfigurableUiControlConstructor;\r\n /** Optional application data passed down to the Content View */\r\n applicationData?: any;\r\n}\r\n\r\n/** Properties for a [[ContentGroup]]\r\n * @public\r\n */\r\nexport interface ContentGroupProps {\r\n /** An optional id for the [[ContentGroup]] */\r\n id: string;\r\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\r\n layout: ContentLayoutProps;\r\n /** A collection of [[ContentProps]], one for each content view */\r\n contents: ContentProps[];\r\n}\r\n\r\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\r\n * content group just prior to activating the frontstage.\r\n * @public\r\n */\r\nexport abstract class ContentGroupProvider {\r\n abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>;\r\n\r\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\r\n * be to remove applicationData entries.\r\n */\r\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\r\n * Typically this may be to add applicationData to content entries.\r\n */\r\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to save any content group data before the stage deactivated. */\r\n public async onFrontstageDeactivated() { }\r\n}\r\n\r\n/** Callback to process content properties during toJSON method\r\n * @public\r\n */\r\nexport type ContentCallback = (content: ContentProps) => void;\r\n\r\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\r\n * @public\r\n */\r\nexport class ContentGroup {\r\n private static _sId = 0;\r\n public groupId: string;\r\n public propsId: string;\r\n public layout: ContentLayoutProps;\r\n public contentPropsList: ContentProps[];\r\n private _contentControls = new Map<string, ContentControl>();\r\n private _contentSetMap = new Map<string, ContentControl>();\r\n\r\n public get id() {\r\n return this.groupId;\r\n }\r\n\r\n constructor(contentGroupProps: ContentGroupProps) {\r\n this.layout = { ...contentGroupProps.layout };\r\n this.propsId = contentGroupProps.id;\r\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\r\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\r\n this.contentPropsList = contentGroupProps.contents;\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\r\n public getContentControl(contentProps: ContentProps, _index: number): ContentControl | undefined {\r\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\r\n const id = `${contentProps.id}::${this.groupId}`;\r\n let contentControl: ContentControl | undefined;\r\n\r\n if (!this._contentControls.get(contentProps.id)) {\r\n let usedClassId: string = \"\";\r\n\r\n if (typeof contentProps.classId === \"string\") {\r\n if (!this._contentControls.get(contentProps.id) && ConfigurableUiManager.isControlRegistered(contentProps.classId)) {\r\n contentControl = ConfigurableUiManager.createControl(contentProps.classId, id, contentProps.applicationData, contentProps.id) as ContentControl;\r\n usedClassId = contentProps.classId;\r\n }\r\n } else {\r\n const info = new ConfigurableCreateInfo(contentProps.classId.name, id, contentProps.id);\r\n contentControl = new contentProps.classId(info, contentProps.applicationData) as ContentControl;\r\n usedClassId = contentProps.classId.name;\r\n }\r\n\r\n if (contentControl) {\r\n if (contentControl.getType() !== ConfigurableUiControlType.Content && contentControl.getType() !== ConfigurableUiControlType.Viewport) {\r\n throw new UiError(UiFramework.loggerCategory(this), `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`);\r\n }\r\n contentControl.initialize();\r\n this._contentControls.set(contentProps.id, contentControl);\r\n }\r\n }\r\n\r\n return this._contentControls.get(contentProps.id);\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\r\n public getContentControlById(id: string): ContentControl | undefined {\r\n return this._contentControls.get(id);\r\n }\r\n\r\n /** Gets the React nodes representing the Content Views in this Content Group. */\r\n public getContentNodes(): React.ReactNode[] {\r\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\r\n\r\n this._contentSetMap.clear();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentNodes.push(control.reactNode);\r\n this._contentSetMap.set(control.controlId, control);\r\n }\r\n });\r\n\r\n return contentNodes;\r\n }\r\n\r\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\r\n public getControlFromElement(node: React.ReactNode): ContentControl | undefined {\r\n if (this._contentSetMap.size === 0)\r\n this.getContentNodes();\r\n\r\n if (node && (node as React.ReactElement<any>).key) {\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n const controlId = key.split(\"::\", 1)[0];\r\n return this._contentSetMap.get(controlId);\r\n }\r\n\r\n Logger.logError(UiFramework.loggerCategory(this), `getControlFromElement: no control found for element`);\r\n return undefined;\r\n }\r\n\r\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\r\n public refreshContentNodes() {\r\n this._contentSetMap.clear();\r\n }\r\n\r\n /** Gets an array of the content controls representing the Content Views. */\r\n public getContentControls(): ContentControl[] {\r\n const contentControls: ContentControl[] = new Array<ContentControl>();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentControls.push(control);\r\n }\r\n });\r\n\r\n return contentControls;\r\n }\r\n\r\n /** Called when Frontstage is deactivated. */\r\n public onFrontstageDeactivated(): void {\r\n this.clearContentControls();\r\n }\r\n\r\n /** Called when Frontstage is ready. */\r\n public onFrontstageReady(): void { }\r\n\r\n /** Clears the map of content controls. */\r\n public clearContentControls(): void {\r\n this._contentControls.clear();\r\n }\r\n\r\n /** Creates [[ContentGroupProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\r\n const contentGroupProps: ContentGroupProps = {\r\n id: this.propsId,\r\n layout: this.layout,\r\n contents: this.contentPropsList,\r\n };\r\n\r\n contentGroupProps.contents.forEach((content: ContentProps, index: number) => {\r\n if (typeof content.classId !== \"string\") {\r\n const classId = ConfigurableUiManager.getConstructorClassId(content.classId);\r\n if (classId !== undefined)\r\n content.classId = classId;\r\n else\r\n throw new UiError(UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);\r\n\r\n if (contentCallback)\r\n contentCallback(content);\r\n }\r\n });\r\n\r\n return contentGroupProps;\r\n }\r\n\r\n /** Gets Viewports from Viewport Content Controls\r\n * @internal\r\n */\r\n public getViewports(): Array<ScreenViewport | undefined> {\r\n const contentControls = this.getContentControls();\r\n const viewports = new Array<ScreenViewport | undefined>();\r\n\r\n contentControls.forEach((control: ContentControl) => {\r\n if (control.isViewport && control.viewport) {\r\n viewports.push(control.viewport);\r\n } else {\r\n viewports.push(undefined);\r\n }\r\n });\r\n\r\n return viewports;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAsB,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAoC,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAC9I,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA4B7C;;;GAGG;AACH,MAAM,OAAgB,oBAAoB;IAGxC;;OAEG;IACI,kBAAkB,CAAC,iBAAoC;QAC5D,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,wBAAwB,CAAC,iBAAoC;QAClE,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,kFAAkF;IAC3E,KAAK,CAAC,uBAAuB,KAAK,CAAC;CAC3C;AAOD;;GAEG;AACH,MAAM,OAAO,YAAY;IAavB,YAAY,iBAAoC;QAPxC,qBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;QACrD,mBAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;QAOzD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,CAAC;QACpC,mIAAmI;QACnI,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAiB,CAAC,EAAE,IAAI,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC;QAClE,IAAI,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ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E,KAAa,EAAE,EAAE;YAC1E,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE;gBACvC,MAAM,OAAO,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC7E,IAAI,OAAO,KAAK,SAAS;oBACvB,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;;oBAE1B,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mCAAmC,KAAK,qCAAqC,CAAC,CAAC;gBAErI,IAAI,eAAe;oBACjB,eAAe,CAAC,OAAO,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;QAE1D,eAAe,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;YAClD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AApKc,iBAAI,GAAG,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContentLayoutProps, UiError } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\nimport { ConfigurableUiManager } from \"../configurableui/ConfigurableUiManager\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { FrontstageProps } from \"../frontstage/Frontstage\";\r\n\r\n/** Properties for content displayed in a content view\r\n * @public\r\n */\r\nexport interface ContentProps {\r\n /** A unique id for the Content View within the group */\r\n id: string;\r\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\r\n classId: string | ConfigurableUiControlConstructor;\r\n /** Optional application data passed down to the Content View */\r\n applicationData?: any;\r\n}\r\n\r\n/** Properties for a [[ContentGroup]]\r\n * @public\r\n */\r\nexport interface ContentGroupProps {\r\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\r\n id: string;\r\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\r\n layout: ContentLayoutProps;\r\n /** A collection of [[ContentProps]], one for each content view */\r\n contents: ContentProps[];\r\n}\r\n\r\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\r\n * content group just prior to activating the frontstage.\r\n * @public\r\n */\r\nexport abstract class ContentGroupProvider {\r\n abstract provideContentGroup(props: FrontstageProps): Promise<ContentGroup>;\r\n\r\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\r\n * be to remove applicationData entries.\r\n */\r\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\r\n * Typically this may be to add applicationData to content entries.\r\n */\r\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\r\n return contentGroupProps;\r\n }\r\n\r\n /** Allow provider to save any content group data before the stage deactivated. */\r\n public async onFrontstageDeactivated() { }\r\n}\r\n\r\n/** Callback to process content properties during toJSON method\r\n * @public\r\n */\r\nexport type ContentCallback = (content: ContentProps) => void;\r\n\r\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\r\n * @public\r\n */\r\nexport class ContentGroup {\r\n private static _sId = 0;\r\n public groupId: string;\r\n public propsId: string;\r\n public layout: ContentLayoutProps;\r\n public contentPropsList: ContentProps[];\r\n private _contentControls = new Map<string, ContentControl>();\r\n private _contentSetMap = new Map<string, ContentControl>();\r\n\r\n public get id() {\r\n return this.groupId;\r\n }\r\n\r\n constructor(contentGroupProps: ContentGroupProps) {\r\n this.layout = { ...contentGroupProps.layout };\r\n this.propsId = contentGroupProps.id;\r\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\r\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\r\n this.contentPropsList = contentGroupProps.contents;\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\r\n public getContentControl(contentProps: ContentProps, _index: number): ContentControl | undefined {\r\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\r\n const id = `${contentProps.id}::${this.groupId}`;\r\n let contentControl: ContentControl | undefined;\r\n\r\n if (!this._contentControls.get(contentProps.id)) {\r\n let usedClassId: string = \"\";\r\n\r\n if (typeof contentProps.classId === \"string\") {\r\n if (!this._contentControls.get(contentProps.id) && ConfigurableUiManager.isControlRegistered(contentProps.classId)) {\r\n contentControl = ConfigurableUiManager.createControl(contentProps.classId, id, contentProps.applicationData, contentProps.id) as ContentControl;\r\n usedClassId = contentProps.classId;\r\n }\r\n } else {\r\n const info = new ConfigurableCreateInfo(contentProps.classId.name, id, contentProps.id);\r\n contentControl = new contentProps.classId(info, contentProps.applicationData) as ContentControl;\r\n usedClassId = contentProps.classId.name;\r\n }\r\n\r\n if (contentControl) {\r\n if (contentControl.getType() !== ConfigurableUiControlType.Content && contentControl.getType() !== ConfigurableUiControlType.Viewport) {\r\n throw new UiError(UiFramework.loggerCategory(this), `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`);\r\n }\r\n contentControl.initialize();\r\n this._contentControls.set(contentProps.id, contentControl);\r\n }\r\n }\r\n\r\n return this._contentControls.get(contentProps.id);\r\n }\r\n\r\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\r\n public getContentControlById(id: string): ContentControl | undefined {\r\n return this._contentControls.get(id);\r\n }\r\n\r\n /** Gets the React nodes representing the Content Views in this Content Group. */\r\n public getContentNodes(): React.ReactNode[] {\r\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\r\n\r\n this._contentSetMap.clear();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentNodes.push(control.reactNode);\r\n this._contentSetMap.set(control.controlId, control);\r\n }\r\n });\r\n\r\n return contentNodes;\r\n }\r\n\r\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\r\n public getControlFromElement(node: React.ReactNode): ContentControl | undefined {\r\n if (this._contentSetMap.size === 0)\r\n this.getContentNodes();\r\n\r\n if (node && (node as React.ReactElement<any>).key) {\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n const controlId = key.split(\"::\", 1)[0];\r\n return this._contentSetMap.get(controlId);\r\n }\r\n\r\n Logger.logError(UiFramework.loggerCategory(this), `getControlFromElement: no control found for element`);\r\n return undefined;\r\n }\r\n\r\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\r\n public refreshContentNodes() {\r\n this._contentSetMap.clear();\r\n }\r\n\r\n /** Gets an array of the content controls representing the Content Views. */\r\n public getContentControls(): ContentControl[] {\r\n const contentControls: ContentControl[] = new Array<ContentControl>();\r\n\r\n this.contentPropsList.forEach((contentProps: ContentProps, index: number) => {\r\n const control = this.getContentControl(contentProps, index);\r\n if (control) {\r\n contentControls.push(control);\r\n }\r\n });\r\n\r\n return contentControls;\r\n }\r\n\r\n /** Called when Frontstage is deactivated. */\r\n public onFrontstageDeactivated(): void {\r\n this.clearContentControls();\r\n }\r\n\r\n /** Called when Frontstage is ready. */\r\n public onFrontstageReady(): void { }\r\n\r\n /** Clears the map of content controls. */\r\n public clearContentControls(): void {\r\n this._contentControls.clear();\r\n }\r\n\r\n /** Creates [[ContentGroupProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\r\n const contentGroupProps: ContentGroupProps = {\r\n id: this.propsId,\r\n layout: this.layout,\r\n contents: this.contentPropsList,\r\n };\r\n\r\n contentGroupProps.contents.forEach((content: ContentProps, index: number) => {\r\n if (typeof content.classId !== \"string\") {\r\n const classId = ConfigurableUiManager.getConstructorClassId(content.classId);\r\n if (classId !== undefined)\r\n content.classId = classId;\r\n else\r\n throw new UiError(UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);\r\n\r\n if (contentCallback)\r\n contentCallback(content);\r\n }\r\n });\r\n\r\n return contentGroupProps;\r\n }\r\n\r\n /** Gets Viewports from Viewport Content Controls\r\n * @internal\r\n */\r\n public getViewports(): Array<ScreenViewport | undefined> {\r\n const contentControls = this.getContentControls();\r\n const viewports = new Array<ScreenViewport | undefined>();\r\n\r\n contentControls.forEach((control: ContentControl) => {\r\n if (control.isViewport && control.viewport) {\r\n viewports.push(control.viewport);\r\n } else {\r\n viewports.push(undefined);\r\n }\r\n });\r\n\r\n return viewports;\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/appui-react",
|
|
3
|
-
"version": "3.2.0-dev.
|
|
3
|
+
"version": "3.2.0-dev.53",
|
|
4
4
|
"description": "UI framework",
|
|
5
5
|
"main": "lib/cjs/appui-react.js",
|
|
6
6
|
"module": "lib/esm/appui-react.js",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"url": "http://www.bentley.com"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@itwin/appui-abstract": "^3.2.0-dev.
|
|
24
|
-
"@itwin/appui-layout-react": "^3.2.0-dev.
|
|
25
|
-
"@itwin/components-react": "^3.2.0-dev.
|
|
26
|
-
"@itwin/core-bentley": "^3.2.0-dev.
|
|
27
|
-
"@itwin/core-common": "^3.2.0-dev.
|
|
28
|
-
"@itwin/core-frontend": "^3.2.0-dev.
|
|
29
|
-
"@itwin/core-geometry": "^3.2.0-dev.
|
|
30
|
-
"@itwin/core-markup": "^3.2.0-dev.
|
|
31
|
-
"@itwin/core-quantity": "^3.2.0-dev.
|
|
32
|
-
"@itwin/core-react": "^3.2.0-dev.
|
|
33
|
-
"@itwin/imodel-components-react": "^3.2.0-dev.
|
|
34
|
-
"@itwin/presentation-common": "^3.2.0-dev.
|
|
35
|
-
"@itwin/presentation-frontend": "^3.2.0-dev.
|
|
23
|
+
"@itwin/appui-abstract": "^3.2.0-dev.53",
|
|
24
|
+
"@itwin/appui-layout-react": "^3.2.0-dev.53",
|
|
25
|
+
"@itwin/components-react": "^3.2.0-dev.53",
|
|
26
|
+
"@itwin/core-bentley": "^3.2.0-dev.53",
|
|
27
|
+
"@itwin/core-common": "^3.2.0-dev.53",
|
|
28
|
+
"@itwin/core-frontend": "^3.2.0-dev.53",
|
|
29
|
+
"@itwin/core-geometry": "^3.2.0-dev.53",
|
|
30
|
+
"@itwin/core-markup": "^3.2.0-dev.53",
|
|
31
|
+
"@itwin/core-quantity": "^3.2.0-dev.53",
|
|
32
|
+
"@itwin/core-react": "^3.2.0-dev.53",
|
|
33
|
+
"@itwin/imodel-components-react": "^3.2.0-dev.53",
|
|
34
|
+
"@itwin/presentation-common": "^3.2.0-dev.53",
|
|
35
|
+
"@itwin/presentation-frontend": "^3.2.0-dev.53",
|
|
36
36
|
"react": "^17.0.0",
|
|
37
37
|
"react-dom": "^17.0.0",
|
|
38
38
|
"react-redux": "^7.2.2",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@itwin/appui-abstract": "3.2.0-dev.
|
|
47
|
-
"@itwin/appui-layout-react": "3.2.0-dev.
|
|
48
|
-
"@itwin/build-tools": "3.2.0-dev.
|
|
49
|
-
"@itwin/components-react": "3.2.0-dev.
|
|
50
|
-
"@itwin/core-bentley": "3.2.0-dev.
|
|
51
|
-
"@itwin/core-common": "3.2.0-dev.
|
|
52
|
-
"@itwin/core-frontend": "3.2.0-dev.
|
|
53
|
-
"@itwin/core-geometry": "3.2.0-dev.
|
|
54
|
-
"@itwin/core-markup": "3.2.0-dev.
|
|
55
|
-
"@itwin/core-quantity": "3.2.0-dev.
|
|
56
|
-
"@itwin/core-react": "3.2.0-dev.
|
|
57
|
-
"@itwin/eslint-plugin": "3.2.0-dev.
|
|
58
|
-
"@itwin/imodel-components-react": "3.2.0-dev.
|
|
59
|
-
"@itwin/presentation-common": "3.2.0-dev.
|
|
60
|
-
"@itwin/presentation-frontend": "3.2.0-dev.
|
|
61
|
-
"@itwin/presentation-testing": "3.2.0-dev.
|
|
46
|
+
"@itwin/appui-abstract": "3.2.0-dev.53",
|
|
47
|
+
"@itwin/appui-layout-react": "3.2.0-dev.53",
|
|
48
|
+
"@itwin/build-tools": "3.2.0-dev.53",
|
|
49
|
+
"@itwin/components-react": "3.2.0-dev.53",
|
|
50
|
+
"@itwin/core-bentley": "3.2.0-dev.53",
|
|
51
|
+
"@itwin/core-common": "3.2.0-dev.53",
|
|
52
|
+
"@itwin/core-frontend": "3.2.0-dev.53",
|
|
53
|
+
"@itwin/core-geometry": "3.2.0-dev.53",
|
|
54
|
+
"@itwin/core-markup": "3.2.0-dev.53",
|
|
55
|
+
"@itwin/core-quantity": "3.2.0-dev.53",
|
|
56
|
+
"@itwin/core-react": "3.2.0-dev.53",
|
|
57
|
+
"@itwin/eslint-plugin": "3.2.0-dev.53",
|
|
58
|
+
"@itwin/imodel-components-react": "3.2.0-dev.53",
|
|
59
|
+
"@itwin/presentation-common": "3.2.0-dev.53",
|
|
60
|
+
"@itwin/presentation-frontend": "3.2.0-dev.53",
|
|
61
|
+
"@itwin/presentation-testing": "3.2.0-dev.53",
|
|
62
62
|
"@testing-library/react": "^12.0.0",
|
|
63
63
|
"@testing-library/react-hooks": "^7.0.2",
|
|
64
64
|
"@types/chai": "^4.1.4",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@bentley/icons-generic": "^1.0.15",
|
|
115
115
|
"@bentley/icons-generic-webfont": "^1.0.15",
|
|
116
|
-
"@itwin/core-telemetry": "3.2.0-dev.
|
|
117
|
-
"@itwin/presentation-components": "3.2.0-dev.
|
|
116
|
+
"@itwin/core-telemetry": "3.2.0-dev.53",
|
|
117
|
+
"@itwin/presentation-components": "3.2.0-dev.53",
|
|
118
118
|
"@itwin/itwinui-css": "0.x",
|
|
119
119
|
"@itwin/itwinui-react": "^1.32.0",
|
|
120
120
|
"@itwin/itwinui-icons-react": "^1.8.0",
|