@itwin/presentation-common 5.0.0-dev.4 → 5.0.0-dev.41
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 +37 -1
- package/lib/cjs/assets/locales/en/Presentation.json +19 -19
- package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-common/EC.js.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
- package/lib/cjs/presentation-common/Error.js.map +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +29 -8
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +4 -4
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Category.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
- package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +31 -23
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
- package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
- package/lib/cjs/presentation-common/content/Value.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-common/EC.js.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
- package/lib/esm/presentation-common/Error.js.map +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +29 -8
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +4 -4
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Category.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
- package/lib/esm/presentation-common/content/Editor.js.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +31 -23
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
- package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
- package/lib/esm/presentation-common/content/Value.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/esm/presentation-common.js.map +1 -1
- package/lib/public/locales/en/Presentation.json +19 -19
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAIL,sBAAsB,EAGtB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAGhG,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AAyEpD,SAAS,iBAAiB,CAAC,KAAwB;IACjD,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC;AAKD,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO,CAAC,CAAE,KAAkC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO,CAAC,CAAE,KAAmC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAKD,SAAS,oBAAoB,CAAC,KAAwB;IACpD,OAAO,CAAC,CAAE,KAAa,CAAC,YAAY,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,KAAK;IAsBhB;;;;;;;;;;;OAWG;IACH,YAC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EAAE,GAAG,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE;QACpG,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACpJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n ClassInfo,\n ClassInfoJSON,\n CompressedClassInfoJSON,\n NavigationPropertyInfo,\n PropertyInfo,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelationshipPath,\n} from \"../EC\";\nimport { PresentationError, PresentationStatus } from \"../Error\";\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification\";\nimport { CategoryDescription } from \"./Category\";\nimport { EditorDescription } from \"./Editor\";\nimport { Property, PropertyJSON } from \"./Property\";\nimport { RendererDescription } from \"./Renderer\";\nimport { TypeDescription } from \"./TypeDescription\";\n\n/**\n * Data structure for a [[Field]] serialized to JSON.\n * @public\n */\nexport interface BaseFieldJSON {\n category: string;\n name: string;\n label: string;\n type: TypeDescription;\n isReadonly: boolean;\n priority: number;\n renderer?: RendererDescription;\n editor?: EditorDescription;\n extendedData?: { [key: string]: unknown };\n}\n\n/**\n * Data structure for a [[PropertiesField]] serialized to JSON.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\n properties: PropertyJSON<TClassInfoJSON>[];\n}\n\n/**\n * Data structure for a [[ArrayPropertiesField]] serialized to JSON.\n * @public\n */\nexport interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\n itemsField: PropertiesFieldJSON<TClassInfoJSON>;\n}\n\n/**\n * Data structure for a [[StructPropertiesField]] serialized to JSON.\n * @public\n */\nexport interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\n memberFields: PropertiesFieldJSON<TClassInfoJSON>[];\n}\n\n/**\n * Data structure for a [[NestedContentField]] serialized to JSON.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\n contentClassInfo: TClassInfoJSON;\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\n relationshipMeaning?: RelationshipMeaning;\n actualPrimaryClassIds?: Id64String[];\n autoExpand?: boolean;\n nestedFields: FieldJSON<TClassInfoJSON>[];\n}\n\n/**\n * JSON representation of a [[Field]]\n * @public\n */\nexport type FieldJSON<TClassInfoJSON = ClassInfoJSON> =\n | BaseFieldJSON\n | PropertiesFieldJSON<TClassInfoJSON>\n | ArrayPropertiesFieldJSON<TClassInfoJSON>\n | StructPropertiesFieldJSON<TClassInfoJSON>\n | NestedContentFieldJSON<TClassInfoJSON>;\n\n/** Is supplied field a properties field. */\nfunction isPropertiesField(field: FieldJSON): field is PropertiesFieldJSON<any>;\nfunction isPropertiesField(field: Field): field is PropertiesField;\nfunction isPropertiesField(field: FieldJSON | Field) {\n return !!(field as any).properties;\n}\n\n/** Is supplied field an array properties field. */\nfunction isArrayPropertiesField(field: FieldJSON): field is ArrayPropertiesFieldJSON<any>;\nfunction isArrayPropertiesField(field: Field): field is ArrayPropertiesField;\nfunction isArrayPropertiesField(field: FieldJSON | Field) {\n return !!(field as ArrayPropertiesFieldJSON).itemsField;\n}\n\n/** Is supplied field an array properties field. */\nfunction isStructPropertiesField(field: FieldJSON): field is StructPropertiesFieldJSON<any>;\nfunction isStructPropertiesField(field: Field): field is StructPropertiesField;\nfunction isStructPropertiesField(field: FieldJSON | Field) {\n return !!(field as StructPropertiesFieldJSON).memberFields;\n}\n\n/** Is supplied field a nested content field. */\nfunction isNestedContentField(field: FieldJSON): field is NestedContentFieldJSON<any>;\nfunction isNestedContentField(field: Field): field is NestedContentField;\nfunction isNestedContentField(field: FieldJSON | Field) {\n return !!(field as any).nestedFields;\n}\n\n/**\n * Describes a single content field. A field is usually represented as a grid column\n * or a property pane row.\n *\n * @public\n */\nexport class Field {\n /** Category information */\n public category: CategoryDescription;\n /** Unique name */\n public name: string;\n /** Display label */\n public label: string;\n /** Description of this field's values data type */\n public type: TypeDescription;\n /** Are values in this field read-only */\n public isReadonly: boolean;\n /** Priority of the field. Higher priority fields should appear first in the UI */\n public priority: number;\n /** Property renderer used to render values of this field */\n public renderer?: RendererDescription;\n /** Property editor used to edit values of this field */\n public editor?: EditorDescription;\n /** Extended data associated with this field */\n public extendedData?: { [key: string]: unknown };\n /** Parent field */\n private _parent?: NestedContentField;\n\n /**\n * Creates an instance of Field.\n * @param category Category information\n * @param name Unique name\n * @param label Display label\n * @param type Description of this field's values data type\n * @param isReadonly Are values in this field read-only\n * @param priority Priority of the field\n * @param editor Property editor used to edit values of this field\n * @param renderer Property renderer used to render values of this field\n * @param extendedData Extended data associated with this field\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n type: TypeDescription,\n isReadonly: boolean,\n priority: number,\n editor?: EditorDescription,\n renderer?: RendererDescription,\n extendedData?: { [key: string] : unknown }\n ) {\n this.category = category;\n this.name = name;\n this.label = label;\n this.type = type;\n this.isReadonly = isReadonly;\n this.priority = priority;\n this.editor = editor;\n this.renderer = renderer;\n this.extendedData = extendedData;\n }\n\n /**\n * Is this a [[PropertiesField]]\n */\n public isPropertiesField(): this is PropertiesField {\n return isPropertiesField(this);\n }\n\n /**\n * Is this a [[NestedContentField]]\n */\n public isNestedContentField(): this is NestedContentField {\n return isNestedContentField(this);\n }\n\n /**\n * Get parent\n */\n public get parent(): NestedContentField | undefined {\n return this._parent;\n }\n\n public clone() {\n const clone = new Field(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.editor, this.renderer, this.extendedData);\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /** Serialize this object to JSON */\n public toJSON(): FieldJSON {\n return {\n category: this.category.name,\n name: this.name,\n label: this.label,\n type: this.type,\n isReadonly: this.isReadonly,\n priority: this.priority,\n renderer: this.renderer,\n editor: this.editor,\n extendedData: this.extendedData\n };\n }\n\n /** Serialize this object to compressed JSON */\n public toCompressedJSON(_classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\n return this.toJSON();\n }\n\n /** Deserialize [[Field]] from JSON */\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\n if (!json) {\n return undefined;\n }\n if (isPropertiesField(json)) {\n return PropertiesField.fromJSON(json, categories);\n }\n if (isNestedContentField(json)) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return NestedContentField.fromJSON(json, categories);\n }\n const field = Object.create(Field.prototype);\n return Object.assign(field, json, {\n category: Field.getCategoryFromFieldJson(json, categories),\n });\n }\n\n /** Deserialize a [[Field]] from compressed JSON. */\n public static fromCompressedJSON(\n json: FieldJSON<string> | undefined,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): Field | undefined {\n if (!json) {\n return undefined;\n }\n\n if (isPropertiesField(json)) {\n return PropertiesField.fromCompressedJSON(json, classesMap, categories);\n }\n\n if (isNestedContentField(json)) {\n return NestedContentField.fromCompressedJSON(json, classesMap, categories);\n }\n\n const field = Object.create(Field.prototype);\n return Object.assign(field, json, {\n category: Field.getCategoryFromFieldJson(json, categories),\n });\n }\n\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, categories: CategoryDescription[]): CategoryDescription {\n const category = categories.find((c) => c.name === fieldJson.category);\n if (!category) {\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);\n }\n return category;\n }\n\n /** Resets field's parent. */\n public resetParentship(): void {\n this._parent = undefined;\n }\n\n /** Sets provided [[NestedContentField]] as parent of this field. */\n public rebuildParentship(parentField?: NestedContentField): void {\n this._parent = parentField;\n }\n\n /**\n * Get descriptor for this field.\n * @public\n */\n public getFieldDescriptor(): FieldDescriptor {\n return {\n type: FieldDescriptorType.Name,\n fieldName: this.name,\n } as NamedFieldDescriptor;\n }\n\n /**\n * Checks if this field matches given field descriptor\n * @see [[getFieldDescriptor]]\n */\n public matchesDescriptor(descriptor: FieldDescriptor) {\n return FieldDescriptor.isNamed(descriptor) && descriptor.fieldName === this.name;\n }\n}\n\n/**\n * Describes a content field that's based on one or more similar\n * EC properties.\n *\n * @public\n */\nexport class PropertiesField extends Field {\n /** A list of properties this field is created from */\n public properties: Property[];\n\n /**\n * Creates an instance of PropertiesField.\n * @param category Category information\n * @param name Unique name\n * @param label Display label\n * @param type Description of this field's values data type\n * @param isReadonly Are values in this field read-only\n * @param priority Priority of the field\n * @param properties A list of properties this field is created from\n * @param editor Property editor used to edit values of this field\n * @param renderer Property renderer used to render values of this field\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n description: TypeDescription,\n isReadonly: boolean,\n priority: number,\n properties: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n ) {\n super(category, name, label, description, isReadonly, priority, editor, renderer);\n this.properties = properties;\n }\n\n /** Is this a an array property field */\n public isArrayPropertiesField(): this is ArrayPropertiesField {\n return false;\n }\n /** Is this a an struct property field */\n public isStructPropertiesField(): this is StructPropertiesField {\n return false;\n }\n\n public override clone() {\n const clone = new PropertiesField(\n this.category,\n this.name,\n this.label,\n this.type,\n this.isReadonly,\n this.priority,\n this.properties,\n this.editor,\n this.renderer,\n );\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /** Serialize this object to JSON */\n public override toJSON(): PropertiesFieldJSON {\n return {\n ...super.toJSON(),\n properties: this.properties,\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): PropertiesFieldJSON<string> {\n return {\n ...super.toCompressedJSON(classesMap),\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\n };\n }\n\n /** Deserialize [[PropertiesField]] from JSON */\n public static override fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined {\n if (!json) {\n return undefined;\n }\n\n if (isArrayPropertiesField(json)) {\n return ArrayPropertiesField.fromJSON(json, categories);\n }\n if (isStructPropertiesField(json)) {\n return StructPropertiesField.fromJSON(json, categories);\n }\n\n const field = Object.create(PropertiesField.prototype);\n return Object.assign(field, json, {\n category: this.getCategoryFromFieldJson(json, categories),\n });\n }\n\n /**\n * Deserialize a [[PropertiesField]] from compressed JSON.\n * @public\n */\n public static override fromCompressedJSON(\n json: PropertiesFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): PropertiesField | undefined {\n if (isArrayPropertiesField(json)) {\n return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);\n }\n if (isStructPropertiesField(json)) {\n return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);\n }\n const field = Object.create(PropertiesField.prototype);\n return Object.assign(field, json, {\n category: this.getCategoryFromFieldJson(json, categories),\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\n });\n }\n\n /**\n * Get descriptor for this field.\n * @public\n */\n public override getFieldDescriptor(): FieldDescriptor {\n const pathFromPropertyToSelectClass = new Array<RelatedClassInfo>();\n let currAncestor = this.parent;\n while (currAncestor) {\n pathFromPropertyToSelectClass.push(...currAncestor.pathToPrimaryClass);\n currAncestor = currAncestor.parent;\n }\n return {\n type: FieldDescriptorType.Properties,\n pathFromSelectToPropertyClass: RelationshipPath.strip(RelationshipPath.reverse(pathFromPropertyToSelectClass)),\n properties: this.properties.map((p) => ({\n class: p.property.classInfo.name,\n name: p.property.name,\n })),\n } as PropertiesFieldDescriptor;\n }\n\n /**\n * Checks if this field matches given field descriptor\n * @see [[getFieldDescriptor]]\n */\n public override matchesDescriptor(descriptor: FieldDescriptor) {\n if (!FieldDescriptor.isProperties(descriptor)) {\n return false;\n }\n\n // ensure at least one descriptor property matches at least one property of this field\n if (\n !this.properties.some(({ property: fieldProperty }) =>\n descriptor.properties.some(\n (descriptorProperty) => fieldProperty.name === descriptorProperty.name && fieldProperty.classInfo.name === descriptorProperty.class,\n ),\n )\n ) {\n return false;\n }\n\n // ensure path from select to property in field and in descriptor matches\n let stepsCount = 0;\n let currAncestor = this.parent;\n while (currAncestor) {\n const pathFromCurrentToItsParent = RelationshipPath.reverse(currAncestor.pathToPrimaryClass);\n for (const step of pathFromCurrentToItsParent) {\n if (descriptor.pathFromSelectToPropertyClass.length < stepsCount + 1) {\n return false;\n }\n if (!RelatedClassInfo.equals(step, descriptor.pathFromSelectToPropertyClass[descriptor.pathFromSelectToPropertyClass.length - stepsCount - 1])) {\n return false;\n }\n ++stepsCount;\n }\n currAncestor = currAncestor.parent;\n }\n return true;\n }\n}\n\n/**\n * Describes a content field that's based on one or more similar EC array properties.\n * @public\n */\nexport class ArrayPropertiesField extends PropertiesField {\n public itemsField: PropertiesField;\n\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n description: TypeDescription,\n itemsField: PropertiesField,\n isReadonly: boolean,\n priority: number,\n properties: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n ) {\n super(category, name, label, description, isReadonly, priority, properties, editor, renderer);\n this.itemsField = itemsField;\n }\n\n public override isArrayPropertiesField(): this is ArrayPropertiesField {\n return true;\n }\n\n public override clone() {\n const clone = new ArrayPropertiesField(\n this.category,\n this.name,\n this.label,\n this.type,\n this.itemsField.clone(),\n this.isReadonly,\n this.priority,\n this.properties,\n this.editor,\n this.renderer,\n );\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /** Serialize this object to JSON */\n public override toJSON(): ArrayPropertiesFieldJSON {\n return {\n ...super.toJSON(),\n itemsField: this.itemsField.toJSON(),\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): ArrayPropertiesFieldJSON<string> {\n return {\n ...super.toCompressedJSON(classesMap),\n itemsField: this.itemsField.toCompressedJSON(classesMap),\n };\n }\n\n /** Deserialize [[ArrayPropertiesField]] from JSON */\n public static override fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField {\n const field = Object.create(ArrayPropertiesField.prototype);\n return Object.assign(field, json, {\n category: this.getCategoryFromFieldJson(json, categories),\n itemsField: PropertiesField.fromJSON(json.itemsField, categories),\n });\n }\n\n /**\n * Deserialize an [[ArrayPropertiesField]] from compressed JSON.\n * @public\n */\n public static override fromCompressedJSON(\n json: ArrayPropertiesFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): ArrayPropertiesField {\n const field = Object.create(ArrayPropertiesField.prototype);\n return Object.assign(field, json, {\n category: this.getCategoryFromFieldJson(json, categories),\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\n itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),\n });\n }\n}\n\n/**\n * Describes a content field that's based on one or more similar EC struct properties.\n * @public\n */\nexport class StructPropertiesField extends PropertiesField {\n public memberFields: PropertiesField[];\n\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n description: TypeDescription,\n memberFields: PropertiesField[],\n isReadonly: boolean,\n priority: number,\n properties: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n ) {\n super(category, name, label, description, isReadonly, priority, properties, editor, renderer);\n this.memberFields = memberFields;\n }\n\n public override isStructPropertiesField(): this is StructPropertiesField {\n return true;\n }\n\n public override clone() {\n const clone = new StructPropertiesField(\n this.category,\n this.name,\n this.label,\n this.type,\n this.memberFields.map((m) => m.clone()),\n this.isReadonly,\n this.priority,\n this.properties,\n this.editor,\n this.renderer,\n );\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /** Serialize this object to JSON */\n public override toJSON(): StructPropertiesFieldJSON {\n return {\n ...super.toJSON(),\n memberFields: this.memberFields.map((m) => m.toJSON()),\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): StructPropertiesFieldJSON<string> {\n return {\n ...super.toCompressedJSON(classesMap),\n memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),\n };\n }\n\n /** Deserialize [[StructPropertiesField]] from JSON */\n public static override fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField {\n const field = Object.create(StructPropertiesField.prototype);\n return Object.assign(field, json, {\n category: this.getCategoryFromFieldJson(json, categories),\n memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),\n });\n }\n\n /**\n * Deserialize a [[StructPropertiesField]] from compressed JSON.\n * @public\n */\n public static override fromCompressedJSON(\n json: StructPropertiesFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): StructPropertiesField {\n const field = Object.create(StructPropertiesField.prototype);\n return Object.assign(field, json, {\n category: this.getCategoryFromFieldJson(json, categories),\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\n memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),\n });\n }\n}\n\n/**\n * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).\n *\n * @public\n */\nexport class NestedContentField extends Field {\n /** Information about an ECClass whose properties are nested inside this field */\n public contentClassInfo: ClassInfo;\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\n public pathToPrimaryClass: RelationshipPath;\n /**\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\n * and content class of this field.\n *\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\n * presentation rules for creating the content.\n */\n public relationshipMeaning: RelationshipMeaning;\n /**\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\n * here to help.\n *\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\n */\n public actualPrimaryClassIds: Id64String[];\n /** Contained nested fields */\n public nestedFields: Field[];\n /** Flag specifying whether field should be expanded */\n public autoExpand?: boolean;\n\n /**\n * Creates an instance of NestedContentField.\n * @param category Category information\n * @param name Unique name\n * @param label Display label\n * @param type Description of this field's values data type\n * @param isReadonly Are values in this field read-only\n * @param priority Priority of the field\n * @param contentClassInfo Information about an ECClass whose properties are nested inside this field\n * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)\n * @param nestedFields Contained nested fields\n * @param editor Property editor used to edit values of this field\n * @param autoExpand Flag specifying whether field should be expanded\n * @param relationshipMeaning RelationshipMeaning of the field\n * @param renderer Property renderer used to render values of this field\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n description: TypeDescription,\n isReadonly: boolean,\n priority: number,\n contentClassInfo: ClassInfo,\n pathToPrimaryClass: RelationshipPath,\n nestedFields: Field[],\n editor?: EditorDescription,\n autoExpand?: boolean,\n renderer?: RendererDescription,\n ) {\n super(category, name, label, description, isReadonly, priority, editor, renderer);\n this.contentClassInfo = contentClassInfo;\n this.pathToPrimaryClass = pathToPrimaryClass;\n this.relationshipMeaning = RelationshipMeaning.RelatedInstance;\n this.nestedFields = nestedFields;\n this.autoExpand = autoExpand;\n this.actualPrimaryClassIds = [];\n }\n\n public override clone() {\n const clone = new NestedContentField(\n this.category,\n this.name,\n this.label,\n this.type,\n this.isReadonly,\n this.priority,\n this.contentClassInfo,\n this.pathToPrimaryClass,\n this.nestedFields.map((n) => n.clone()),\n this.editor,\n this.autoExpand,\n this.renderer,\n );\n clone.actualPrimaryClassIds = this.actualPrimaryClassIds;\n clone.relationshipMeaning = this.relationshipMeaning;\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /**\n * Get field by its name\n * @param name Name of the field to find\n * @param recurse Recurse into nested fields\n */\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\n return getFieldByName(this.nestedFields, name, recurse);\n }\n\n /** Serialize this object to JSON */\n public override toJSON(): NestedContentFieldJSON {\n return {\n ...super.toJSON(),\n contentClassInfo: this.contentClassInfo,\n pathToPrimaryClass: this.pathToPrimaryClass,\n relationshipMeaning: this.relationshipMeaning,\n actualPrimaryClassIds: this.actualPrimaryClassIds,\n nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\n autoExpand: this.autoExpand,\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): NestedContentFieldJSON<string> {\n const { id, ...leftOverInfo } = this.contentClassInfo;\n classesMap[id] = leftOverInfo;\n return {\n ...super.toCompressedJSON(classesMap),\n contentClassInfo: id,\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\n };\n }\n\n /**\n * Deserialize [[NestedContentField]] from JSON\n * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]\n */\n public static override fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined {\n if (!json) {\n return undefined;\n }\n\n const field = Object.create(NestedContentField.prototype);\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\n nestedFields: json.nestedFields\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\n .filter((nestedField): nestedField is Field => !!nestedField),\n });\n }\n\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\n public static override fromCompressedJSON(\n json: NestedContentFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ) {\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\n const field = Object.create(NestedContentField.prototype);\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\n category: this.getCategoryFromFieldJson(json, categories),\n nestedFields: json.nestedFields\n .map((nestedFieldJson: FieldJSON) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))\n .filter((nestedField): nestedField is Field => !!nestedField),\n contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },\n pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private static fromCommonJSON(json: NestedContentFieldJSON<ClassInfoJSON | string>, categories: CategoryDescription[]): Partial<NestedContentField> {\n return {\n category: this.getCategoryFromFieldJson(json, categories),\n relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,\n actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],\n autoExpand: json.autoExpand,\n };\n }\n\n /** Resets parent of this field and all nested fields. */\n public override resetParentship(): void {\n super.resetParentship();\n for (const nestedField of this.nestedFields) {\n nestedField.resetParentship();\n }\n }\n\n /**\n * Sets provided [[NestedContentField]] as parent of this fields and recursively updates\n * all nested fields parents.\n */\n public override rebuildParentship(parentField?: NestedContentField): void {\n super.rebuildParentship(parentField);\n for (const nestedField of this.nestedFields) {\n nestedField.rebuildParentship(this);\n }\n }\n}\n\n/** @internal */\nexport const getFieldByName = (fields: Field[], name: string | undefined, recurse?: boolean): Field | undefined => {\n if (name) {\n for (const field of fields) {\n if (field.name === name) {\n return field;\n }\n\n if (recurse && field.isNestedContentField()) {\n const nested = getFieldByName(field.nestedFields, name, recurse);\n if (nested) {\n return nested;\n }\n }\n }\n }\n return undefined;\n};\n\n/** @internal */\nexport const getFieldByDescriptor = (fields: Field[], fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined => {\n for (const field of fields) {\n if (field.matchesDescriptor(fieldDescriptor)) {\n return field;\n }\n\n if (recurse && field.isNestedContentField()) {\n const nested = getFieldByDescriptor(field.nestedFields, fieldDescriptor, recurse);\n if (nested) {\n return nested;\n }\n }\n }\n return undefined;\n};\n\n/**\n * Types of different field descriptors.\n * @public\n */\nexport enum FieldDescriptorType {\n Name = \"name\",\n Properties = \"properties\",\n}\n\n/**\n * Base for a field descriptor\n * @public\n */\nexport interface FieldDescriptorBase {\n type: FieldDescriptorType;\n}\n\n/**\n * A union of all possible field descriptor types\n * @public\n */\nexport type FieldDescriptor = NamedFieldDescriptor | PropertiesFieldDescriptor;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace FieldDescriptor {\n /** Is this a named field descriptor */\n export function isNamed(d: FieldDescriptor): d is NamedFieldDescriptor {\n return d.type === FieldDescriptorType.Name;\n }\n /** Is this a properties field descriptor */\n export function isProperties(d: FieldDescriptor): d is PropertiesFieldDescriptor {\n return d.type === FieldDescriptorType.Properties;\n }\n}\n\n/**\n * Field descriptor that identifies a content field by its unique name.\n * @public\n */\nexport interface NamedFieldDescriptor extends FieldDescriptorBase {\n type: FieldDescriptorType.Name;\n fieldName: string;\n}\n\n/**\n * Field descriptor that identifies a properties field using a list of\n * properties that the field contains.\n * @public\n */\nexport interface PropertiesFieldDescriptor extends FieldDescriptorBase {\n type: FieldDescriptorType.Properties;\n pathFromSelectToPropertyClass: StrippedRelationshipPath;\n /**\n * A list of properties that describe the field. At least one property in the list must\n * match at least one property in the field for the descriptor to be considered matching.\n */\n properties: Array<{\n /** Full class name */\n class: string;\n /** Property name */\n name: string;\n }>;\n}\n\nfunction fromCompressedPropertyJSON(compressedPropertyJSON: PropertyJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): Property {\n return {\n property: fromCompressedPropertyInfoJSON(compressedPropertyJSON.property, classesMap),\n };\n}\n\nfunction fromCompressedPropertyInfoJSON(compressedPropertyJSON: PropertyInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfo {\n assert(classesMap.hasOwnProperty(compressedPropertyJSON.classInfo));\n\n const { navigationPropertyInfo, ...leftOverPropertyJSON } = compressedPropertyJSON;\n\n return {\n ...leftOverPropertyJSON,\n classInfo: { id: compressedPropertyJSON.classInfo, ...classesMap[compressedPropertyJSON.classInfo] },\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAIL,sBAAsB,EAGtB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAGhG,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AAyEpD,SAAS,iBAAiB,CAAC,KAAwB;IACjD,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC;AAKD,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO,CAAC,CAAE,KAAkC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO,CAAC,CAAE,KAAmC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAKD,SAAS,oBAAoB,CAAC,KAAwB;IACpD,OAAO,CAAC,CAAE,KAAa,CAAC,YAAY,CAAC;A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,OAAO;QACL,GAAG,oBAAoB;QACvB,SAAS,EAAE,EAAE,EAAE,EAAE,sBAAsB,CAAC,SAAS,EAAE,GAAG,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE;QACpG,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACpJ,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 Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n ClassInfoJSON,\r\n CompressedClassInfoJSON,\r\n NavigationPropertyInfo,\r\n PropertyInfo,\r\n PropertyInfoJSON,\r\n RelatedClassInfo,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n StrippedRelationshipPath,\r\n} from \"../EC\";\r\nimport { PresentationError, PresentationStatus } from \"../Error\";\r\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification\";\r\nimport { CategoryDescription } from \"./Category\";\r\nimport { EditorDescription } from \"./Editor\";\r\nimport { Property, PropertyJSON } from \"./Property\";\r\nimport { RendererDescription } from \"./Renderer\";\r\nimport { TypeDescription } from \"./TypeDescription\";\r\n\r\n/**\r\n * Data structure for a [[Field]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface BaseFieldJSON {\r\n category: string;\r\n name: string;\r\n label: string;\r\n type: TypeDescription;\r\n isReadonly: boolean;\r\n priority: number;\r\n renderer?: RendererDescription;\r\n editor?: EditorDescription;\r\n extendedData?: { [key: string]: unknown };\r\n}\r\n\r\n/**\r\n * Data structure for a [[PropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n properties: PropertyJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[ArrayPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n itemsField: PropertiesFieldJSON<TClassInfoJSON>;\r\n}\r\n\r\n/**\r\n * Data structure for a [[StructPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n memberFields: PropertiesFieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[NestedContentField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n contentClassInfo: TClassInfoJSON;\r\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\r\n relationshipMeaning?: RelationshipMeaning;\r\n actualPrimaryClassIds?: Id64String[];\r\n autoExpand?: boolean;\r\n nestedFields: FieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * JSON representation of a [[Field]]\r\n * @public\r\n */\r\nexport type FieldJSON<TClassInfoJSON = ClassInfoJSON> =\r\n | BaseFieldJSON\r\n | PropertiesFieldJSON<TClassInfoJSON>\r\n | ArrayPropertiesFieldJSON<TClassInfoJSON>\r\n | StructPropertiesFieldJSON<TClassInfoJSON>\r\n | NestedContentFieldJSON<TClassInfoJSON>;\r\n\r\n/** Is supplied field a properties field. */\r\nfunction isPropertiesField(field: FieldJSON): field is PropertiesFieldJSON<any>;\r\nfunction isPropertiesField(field: Field): field is PropertiesField;\r\nfunction isPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as any).properties;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isArrayPropertiesField(field: FieldJSON): field is ArrayPropertiesFieldJSON<any>;\r\nfunction isArrayPropertiesField(field: Field): field is ArrayPropertiesField;\r\nfunction isArrayPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as ArrayPropertiesFieldJSON).itemsField;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isStructPropertiesField(field: FieldJSON): field is StructPropertiesFieldJSON<any>;\r\nfunction isStructPropertiesField(field: Field): field is StructPropertiesField;\r\nfunction isStructPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as StructPropertiesFieldJSON).memberFields;\r\n}\r\n\r\n/** Is supplied field a nested content field. */\r\nfunction isNestedContentField(field: FieldJSON): field is NestedContentFieldJSON<any>;\r\nfunction isNestedContentField(field: Field): field is NestedContentField;\r\nfunction isNestedContentField(field: FieldJSON | Field) {\r\n return !!(field as any).nestedFields;\r\n}\r\n\r\n/**\r\n * Describes a single content field. A field is usually represented as a grid column\r\n * or a property pane row.\r\n *\r\n * @public\r\n */\r\nexport class Field {\r\n /** Category information */\r\n public category: CategoryDescription;\r\n /** Unique name */\r\n public name: string;\r\n /** Display label */\r\n public label: string;\r\n /** Description of this field's values data type */\r\n public type: TypeDescription;\r\n /** Are values in this field read-only */\r\n public isReadonly: boolean;\r\n /** Priority of the field. Higher priority fields should appear first in the UI */\r\n public priority: number;\r\n /** Property renderer used to render values of this field */\r\n public renderer?: RendererDescription;\r\n /** Property editor used to edit values of this field */\r\n public editor?: EditorDescription;\r\n /** Extended data associated with this field */\r\n public extendedData?: { [key: string]: unknown };\r\n /** Parent field */\r\n private _parent?: NestedContentField;\r\n\r\n /**\r\n * Creates an instance of Field.\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n * @param extendedData Extended data associated with this field\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n extendedData?: { [key: string] : unknown }\r\n ) {\r\n this.category = category;\r\n this.name = name;\r\n this.label = label;\r\n this.type = type;\r\n this.isReadonly = isReadonly;\r\n this.priority = priority;\r\n this.editor = editor;\r\n this.renderer = renderer;\r\n this.extendedData = extendedData;\r\n }\r\n\r\n /**\r\n * Is this a [[PropertiesField]]\r\n */\r\n public isPropertiesField(): this is PropertiesField {\r\n return isPropertiesField(this);\r\n }\r\n\r\n /**\r\n * Is this a [[NestedContentField]]\r\n */\r\n public isNestedContentField(): this is NestedContentField {\r\n return isNestedContentField(this);\r\n }\r\n\r\n /**\r\n * Get parent\r\n */\r\n public get parent(): NestedContentField | undefined {\r\n return this._parent;\r\n }\r\n\r\n public clone() {\r\n const clone = new Field(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.editor, this.renderer, this.extendedData);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): FieldJSON {\r\n return {\r\n category: this.category.name,\r\n name: this.name,\r\n label: this.label,\r\n type: this.type,\r\n isReadonly: this.isReadonly,\r\n priority: this.priority,\r\n renderer: this.renderer,\r\n editor: this.editor,\r\n extendedData: this.extendedData\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public toCompressedJSON(_classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\r\n return this.toJSON();\r\n }\r\n\r\n /** Deserialize [[Field]] from JSON */\r\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isPropertiesField(json)) {\r\n return PropertiesField.fromJSON(json, categories);\r\n }\r\n if (isNestedContentField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return NestedContentField.fromJSON(json, categories);\r\n }\r\n const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /** Deserialize a [[Field]] from compressed JSON. */\r\n public static fromCompressedJSON(\r\n json: FieldJSON<string> | undefined,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (isPropertiesField(json)) {\r\n return PropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n\r\n if (isNestedContentField(json)) {\r\n return NestedContentField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n\r\n const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, categories: CategoryDescription[]): CategoryDescription {\r\n const category = categories.find((c) => c.name === fieldJson.category);\r\n if (!category) {\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);\r\n }\r\n return category;\r\n }\r\n\r\n /** Resets field's parent. */\r\n public resetParentship(): void {\r\n this._parent = undefined;\r\n }\r\n\r\n /** Sets provided [[NestedContentField]] as parent of this field. */\r\n public rebuildParentship(parentField?: NestedContentField): void {\r\n this._parent = parentField;\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public getFieldDescriptor(): FieldDescriptor {\r\n return {\r\n type: FieldDescriptorType.Name,\r\n fieldName: this.name,\r\n } as NamedFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public matchesDescriptor(descriptor: FieldDescriptor) {\r\n return FieldDescriptor.isNamed(descriptor) && descriptor.fieldName === this.name;\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar\r\n * EC properties.\r\n *\r\n * @public\r\n */\r\nexport class PropertiesField extends Field {\r\n /** A list of properties this field is created from */\r\n public properties: Property[];\r\n\r\n /**\r\n * Creates an instance of PropertiesField.\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param properties A list of properties this field is created from\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.properties = properties;\r\n }\r\n\r\n /** Is this a an array property field */\r\n public isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return false;\r\n }\r\n /** Is this a an struct property field */\r\n public isStructPropertiesField(): this is StructPropertiesField {\r\n return false;\r\n }\r\n\r\n public override clone() {\r\n const clone = new PropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): PropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n properties: this.properties,\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): PropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\r\n };\r\n }\r\n\r\n /** Deserialize [[PropertiesField]] from JSON */\r\n public static override fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (isArrayPropertiesField(json)) {\r\n return ArrayPropertiesField.fromJSON(json, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n return StructPropertiesField.fromJSON(json, categories);\r\n }\r\n\r\n const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[PropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: PropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): PropertiesField | undefined {\r\n if (isArrayPropertiesField(json)) {\r\n return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n });\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public override getFieldDescriptor(): FieldDescriptor {\r\n const pathFromPropertyToSelectClass = new Array<RelatedClassInfo>();\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n pathFromPropertyToSelectClass.push(...currAncestor.pathToPrimaryClass);\r\n currAncestor = currAncestor.parent;\r\n }\r\n return {\r\n type: FieldDescriptorType.Properties,\r\n pathFromSelectToPropertyClass: RelationshipPath.strip(RelationshipPath.reverse(pathFromPropertyToSelectClass)),\r\n properties: this.properties.map((p) => ({\r\n class: p.property.classInfo.name,\r\n name: p.property.name,\r\n })),\r\n } as PropertiesFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public override matchesDescriptor(descriptor: FieldDescriptor) {\r\n if (!FieldDescriptor.isProperties(descriptor)) {\r\n return false;\r\n }\r\n\r\n // ensure at least one descriptor property matches at least one property of this field\r\n if (\r\n !this.properties.some(({ property: fieldProperty }) =>\r\n descriptor.properties.some(\r\n (descriptorProperty) => fieldProperty.name === descriptorProperty.name && fieldProperty.classInfo.name === descriptorProperty.class,\r\n ),\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n // ensure path from select to property in field and in descriptor matches\r\n let stepsCount = 0;\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n const pathFromCurrentToItsParent = RelationshipPath.reverse(currAncestor.pathToPrimaryClass);\r\n for (const step of pathFromCurrentToItsParent) {\r\n if (descriptor.pathFromSelectToPropertyClass.length < stepsCount + 1) {\r\n return false;\r\n }\r\n if (!RelatedClassInfo.equals(step, descriptor.pathFromSelectToPropertyClass[descriptor.pathFromSelectToPropertyClass.length - stepsCount - 1])) {\r\n return false;\r\n }\r\n ++stepsCount;\r\n }\r\n currAncestor = currAncestor.parent;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC array properties.\r\n * @public\r\n */\r\nexport class ArrayPropertiesField extends PropertiesField {\r\n public itemsField: PropertiesField;\r\n\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n itemsField: PropertiesField,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, properties, editor, renderer);\r\n this.itemsField = itemsField;\r\n }\r\n\r\n public override isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new ArrayPropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.itemsField.clone(),\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): ArrayPropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n itemsField: this.itemsField.toJSON(),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): ArrayPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n itemsField: this.itemsField.toCompressedJSON(classesMap),\r\n };\r\n }\r\n\r\n /** Deserialize [[ArrayPropertiesField]] from JSON */\r\n public static override fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField {\r\n const field = Object.create(ArrayPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n itemsField: PropertiesField.fromJSON(json.itemsField, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize an [[ArrayPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: ArrayPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): ArrayPropertiesField {\r\n const field = Object.create(ArrayPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC struct properties.\r\n * @public\r\n */\r\nexport class StructPropertiesField extends PropertiesField {\r\n public memberFields: PropertiesField[];\r\n\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n memberFields: PropertiesField[],\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, properties, editor, renderer);\r\n this.memberFields = memberFields;\r\n }\r\n\r\n public override isStructPropertiesField(): this is StructPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new StructPropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.memberFields.map((m) => m.clone()),\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): StructPropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n memberFields: this.memberFields.map((m) => m.toJSON()),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): StructPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n /** Deserialize [[StructPropertiesField]] from JSON */\r\n public static override fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField {\r\n const field = Object.create(StructPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[StructPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: StructPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): StructPropertiesField {\r\n const field = Object.create(StructPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).\r\n *\r\n * @public\r\n */\r\nexport class NestedContentField extends Field {\r\n /** Information about an ECClass whose properties are nested inside this field */\r\n public contentClassInfo: ClassInfo;\r\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\r\n public pathToPrimaryClass: RelationshipPath;\r\n /**\r\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\r\n * and content class of this field.\r\n *\r\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\r\n * presentation rules for creating the content.\r\n */\r\n public relationshipMeaning: RelationshipMeaning;\r\n /**\r\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\r\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\r\n * here to help.\r\n *\r\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\r\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\r\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\r\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\r\n */\r\n public actualPrimaryClassIds: Id64String[];\r\n /** Contained nested fields */\r\n public nestedFields: Field[];\r\n /** Flag specifying whether field should be expanded */\r\n public autoExpand?: boolean;\r\n\r\n /**\r\n * Creates an instance of NestedContentField.\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param contentClassInfo Information about an ECClass whose properties are nested inside this field\r\n * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)\r\n * @param nestedFields Contained nested fields\r\n * @param editor Property editor used to edit values of this field\r\n * @param autoExpand Flag specifying whether field should be expanded\r\n * @param relationshipMeaning RelationshipMeaning of the field\r\n * @param renderer Property renderer used to render values of this field\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n contentClassInfo: ClassInfo,\r\n pathToPrimaryClass: RelationshipPath,\r\n nestedFields: Field[],\r\n editor?: EditorDescription,\r\n autoExpand?: boolean,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.contentClassInfo = contentClassInfo;\r\n this.pathToPrimaryClass = pathToPrimaryClass;\r\n this.relationshipMeaning = RelationshipMeaning.RelatedInstance;\r\n this.nestedFields = nestedFields;\r\n this.autoExpand = autoExpand;\r\n this.actualPrimaryClassIds = [];\r\n }\r\n\r\n public override clone() {\r\n const clone = new NestedContentField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.contentClassInfo,\r\n this.pathToPrimaryClass,\r\n this.nestedFields.map((n) => n.clone()),\r\n this.editor,\r\n this.autoExpand,\r\n this.renderer,\r\n );\r\n clone.actualPrimaryClassIds = this.actualPrimaryClassIds;\r\n clone.relationshipMeaning = this.relationshipMeaning;\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.nestedFields, name, recurse);\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): NestedContentFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n contentClassInfo: this.contentClassInfo,\r\n pathToPrimaryClass: this.pathToPrimaryClass,\r\n relationshipMeaning: this.relationshipMeaning,\r\n actualPrimaryClassIds: this.actualPrimaryClassIds,\r\n nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\r\n autoExpand: this.autoExpand,\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): NestedContentFieldJSON<string> {\r\n const { id, ...leftOverInfo } = this.contentClassInfo;\r\n classesMap[id] = leftOverInfo;\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n contentClassInfo: id,\r\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\r\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[NestedContentField]] from JSON\r\n * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]\r\n */\r\n public static override fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n });\r\n }\r\n\r\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\r\n public static override fromCompressedJSON(\r\n json: NestedContentFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ) {\r\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },\r\n pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),\r\n });\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n private static fromCommonJSON(json: NestedContentFieldJSON<ClassInfoJSON | string>, categories: CategoryDescription[]): Partial<NestedContentField> {\r\n return {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,\r\n actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],\r\n autoExpand: json.autoExpand,\r\n };\r\n }\r\n\r\n /** Resets parent of this field and all nested fields. */\r\n public override resetParentship(): void {\r\n super.resetParentship();\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.resetParentship();\r\n }\r\n }\r\n\r\n /**\r\n * Sets provided [[NestedContentField]] as parent of this fields and recursively updates\r\n * all nested fields parents.\r\n */\r\n public override rebuildParentship(parentField?: NestedContentField): void {\r\n super.rebuildParentship(parentField);\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.rebuildParentship(this);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const getFieldByName = (fields: Field[], name: string | undefined, recurse?: boolean): Field | undefined => {\r\n if (name) {\r\n for (const field of fields) {\r\n if (field.name === name) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByName(field.nestedFields, name, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/** @internal */\r\nexport const getFieldByDescriptor = (fields: Field[], fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined => {\r\n for (const field of fields) {\r\n if (field.matchesDescriptor(fieldDescriptor)) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByDescriptor(field.nestedFields, fieldDescriptor, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Types of different field descriptors.\r\n * @public\r\n */\r\nexport enum FieldDescriptorType {\r\n Name = \"name\",\r\n Properties = \"properties\",\r\n}\r\n\r\n/**\r\n * Base for a field descriptor\r\n * @public\r\n */\r\nexport interface FieldDescriptorBase {\r\n type: FieldDescriptorType;\r\n}\r\n\r\n/**\r\n * A union of all possible field descriptor types\r\n * @public\r\n */\r\nexport type FieldDescriptor = NamedFieldDescriptor | PropertiesFieldDescriptor;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace FieldDescriptor {\r\n /** Is this a named field descriptor */\r\n export function isNamed(d: FieldDescriptor): d is NamedFieldDescriptor {\r\n return d.type === FieldDescriptorType.Name;\r\n }\r\n /** Is this a properties field descriptor */\r\n export function isProperties(d: FieldDescriptor): d is PropertiesFieldDescriptor {\r\n return d.type === FieldDescriptorType.Properties;\r\n }\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a content field by its unique name.\r\n * @public\r\n */\r\nexport interface NamedFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Name;\r\n fieldName: string;\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a properties field using a list of\r\n * properties that the field contains.\r\n * @public\r\n */\r\nexport interface PropertiesFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Properties;\r\n pathFromSelectToPropertyClass: StrippedRelationshipPath;\r\n /**\r\n * A list of properties that describe the field. At least one property in the list must\r\n * match at least one property in the field for the descriptor to be considered matching.\r\n */\r\n properties: Array<{\r\n /** Full class name */\r\n class: string;\r\n /** Property name */\r\n name: string;\r\n }>;\r\n}\r\n\r\nfunction fromCompressedPropertyJSON(compressedPropertyJSON: PropertyJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): Property {\r\n return {\r\n property: fromCompressedPropertyInfoJSON(compressedPropertyJSON.property, classesMap),\r\n };\r\n}\r\n\r\nfunction fromCompressedPropertyInfoJSON(compressedPropertyJSON: PropertyInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfo {\r\n assert(classesMap.hasOwnProperty(compressedPropertyJSON.classInfo));\r\n\r\n const { navigationPropertyInfo, ...leftOverPropertyJSON } = compressedPropertyJSON;\r\n\r\n return {\r\n ...leftOverPropertyJSON,\r\n classInfo: { id: compressedPropertyJSON.classInfo, ...classesMap[compressedPropertyJSON.classInfo] },\r\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\r\n };\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAA0C,KAAK,EAA4B,MAAM,SAAS,CAAC;AAuBhH;;;GAGG;AACH,MAAM,OAAO,IAAI;IA0Bf;;;;;;;;;;OAUG;IACH,YACE,WAA0B,EAC1B,KAA+B,EAC/B,OAAe,EACf,SAAgC,EAChC,MAA+B,EAC/B,aAA6C,EAC7C,gBAA0B,EAC1B,YAAqC;QAErC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,uDAAuD;QAC/E,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAA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,4DAA4D;YAC5D,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;YACxD,4DAA4D;YAC5D,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,eAAe,CAAC;SAChC,CAAC,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,GAAW,EAAE,KAAU;QAC3C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,YAAY,CAAC,IAAyB;QAClD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,6DAA6D;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;QACD,6DAA6D;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAU;QAC/C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { ClassInfo, InstanceKey } from \"../EC\";\nimport { LabelDefinition, LabelDefinitionJSON } from \"../LabelDefinition\";\nimport { ValuesDictionary } from \"../Utils\";\nimport { DisplayValue, DisplayValueJSON, DisplayValuesMapJSON, Value, ValueJSON, ValuesMapJSON } from \"./Value\";\n\n/**\n * Serialized [[Item]] JSON representation.\n * @public\n */\nexport interface ItemJSON {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n // TODO: rename to `label`\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n labelDefinition: LabelDefinitionJSON;\n /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */\n imageId: string;\n classInfo?: ClassInfo;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n values: ValuesDictionary<ValueJSON>;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n displayValues: ValuesDictionary<DisplayValueJSON>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * A data structure that represents a single content record.\n * @public\n */\nexport class Item {\n /**\n * Keys of input instances that caused this item to be included in content. Only set if the content is\n * created with [[ContentFlags.IncludeInputKeys]] flag.\n */\n public inputKeys?: InstanceKey[];\n /** Keys of instances whose data is contained in this item */\n public primaryKeys: InstanceKey[];\n /** Display label of the item */\n public label: LabelDefinition;\n /**\n * ID of the image associated with this item\n * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\n */\n public imageId: string;\n /** For cases when item consists only of same class instances, information about the ECClass */\n public classInfo?: ClassInfo;\n /** Raw values dictionary */\n public values: ValuesDictionary<Value>;\n /** Display values dictionary */\n public displayValues: ValuesDictionary<DisplayValue>;\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\n public mergedFieldNames: string[];\n /** Extended data injected into this content item */\n public extendedData?: { [key: string]: any };\n\n /**\n * Creates an instance of Item.\n * @param primaryKeys Keys of instances whose data is contained in this item\n * @param label Display label of the item\n * @param imageId ID of the image associated with this item\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\n * @param values Raw values dictionary\n * @param displayValues Display values dictionary\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\n * @param extendedData Extended data injected into this content item\n */\n public constructor(\n primaryKeys: InstanceKey[],\n label: string | LabelDefinition,\n imageId: string,\n classInfo: ClassInfo | undefined,\n values: ValuesDictionary<Value>,\n displayValues: ValuesDictionary<DisplayValue>,\n mergedFieldNames: string[],\n extendedData?: { [key: string]: any },\n ) {\n this.primaryKeys = primaryKeys;\n this.imageId = imageId; // eslint-disable-line @typescript-eslint/no-deprecated\n this.classInfo = classInfo;\n this.values = values;\n this.displayValues = displayValues;\n this.mergedFieldNames = mergedFieldNames;\n this.extendedData = extendedData;\n this.label = typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label;\n }\n\n /**\n * Is value of field with the specified name merged in this record.\n */\n public isFieldMerged(fieldName: string): boolean {\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\n }\n\n /** Serialize this object to JSON */\n public toJSON(): ItemJSON {\n const { label, ...baseItem } = this;\n return {\n ...baseItem,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n values: Value.toJSON(this.values) as ValuesMapJSON,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n displayValues: DisplayValue.toJSON(this.displayValues) as DisplayValuesMapJSON,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n labelDefinition: LabelDefinition.toJSON(label),\n };\n }\n\n /** Deserialize [[Item]] from JSON */\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\n if (!json) {\n return undefined;\n }\n if (typeof json === \"string\") {\n return JSON.parse(json, (key, value) => Item.reviver(key, value));\n }\n const item = Object.create(Item.prototype);\n const { labelDefinition, ...baseJson } = json;\n return Object.assign(item, baseJson, {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n values: Value.fromJSON(json.values),\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n displayValues: DisplayValue.fromJSON(json.displayValues),\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n label: LabelDefinition.fromJSON(labelDefinition),\n } as Partial<Item>);\n }\n\n /**\n * Reviver function that can be used as a second argument for\n * `JSON.parse` method when parsing Item objects.\n * @internal\n */\n public static reviver(key: string, value: any): any {\n return key === \"\" ? Item.fromJSON(value) : value;\n }\n\n /**\n * Deserialize items list from JSON\n * @param json JSON or JSON serialized to string to deserialize from\n * @returns Deserialized items list\n * @internal\n */\n public static listFromJSON(json: ItemJSON[] | string): Item[] {\n if (typeof json === \"string\") {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return JSON.parse(json, Item.listReviver);\n }\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return json.map(Item.fromJSON).filter((item): item is Item => !!item);\n }\n\n /**\n * Reviver function that can be used as a second argument for\n * `JSON.parse` method when parsing [[Item]][] objects.\n * @internal\n */\n public static listReviver(key: string, value: any): any {\n return key === \"\" ? Item.listFromJSON(value) : value;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAA0C,KAAK,EAA4B,MAAM,SAAS,CAAC;AAuBhH;;;GAGG;AACH,MAAM,OAAO,IAAI;IA0Bf;;;;;;;;;;OAUG;IACH,YACE,WAA0B,EAC1B,KAA+B,EAC/B,OAAe,EACf,SAAgC,EAChC,MAA+B,EAC/B,aAA6C,EAC7C,gBAA0B,EAC1B,YAAqC;QAErC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,uDAAuD;QAC/E,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACz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I,EAAE,QAAQ,EAAE;YACnC,4DAA4D;YAC5D,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;YACnC,4DAA4D;YAC5D,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;YACxD,4DAA4D;YAC5D,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,eAAe,CAAC;SAChC,CAAC,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,GAAW,EAAE,KAAU;QAC3C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,YAAY,CAAC,IAAyB;QAClD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,6DAA6D;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;QACD,6DAA6D;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAU;QAC/C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,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/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { ClassInfo, InstanceKey } from \"../EC\";\r\nimport { LabelDefinition, LabelDefinitionJSON } from \"../LabelDefinition\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\nimport { DisplayValue, DisplayValueJSON, DisplayValuesMapJSON, Value, ValueJSON, ValuesMapJSON } from \"./Value\";\r\n\r\n/**\r\n * Serialized [[Item]] JSON representation.\r\n * @public\r\n */\r\nexport interface ItemJSON {\r\n inputKeys?: InstanceKey[];\r\n primaryKeys: InstanceKey[];\r\n // TODO: rename to `label`\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n labelDefinition: LabelDefinitionJSON;\r\n /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */\r\n imageId: string;\r\n classInfo?: ClassInfo;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n values: ValuesDictionary<ValueJSON>;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\r\n mergedFieldNames: string[];\r\n extendedData?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * A data structure that represents a single content record.\r\n * @public\r\n */\r\nexport class Item {\r\n /**\r\n * Keys of input instances that caused this item to be included in content. Only set if the content is\r\n * created with [[ContentFlags.IncludeInputKeys]] flag.\r\n */\r\n public inputKeys?: InstanceKey[];\r\n /** Keys of instances whose data is contained in this item */\r\n public primaryKeys: InstanceKey[];\r\n /** Display label of the item */\r\n public label: LabelDefinition;\r\n /**\r\n * ID of the image associated with this item\r\n * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\r\n */\r\n public imageId: string;\r\n /** For cases when item consists only of same class instances, information about the ECClass */\r\n public classInfo?: ClassInfo;\r\n /** Raw values dictionary */\r\n public values: ValuesDictionary<Value>;\r\n /** Display values dictionary */\r\n public displayValues: ValuesDictionary<DisplayValue>;\r\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\r\n public mergedFieldNames: string[];\r\n /** Extended data injected into this content item */\r\n public extendedData?: { [key: string]: any };\r\n\r\n /**\r\n * Creates an instance of Item.\r\n * @param primaryKeys Keys of instances whose data is contained in this item\r\n * @param label Display label of the item\r\n * @param imageId ID of the image associated with this item\r\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\r\n * @param values Raw values dictionary\r\n * @param displayValues Display values dictionary\r\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\r\n * @param extendedData Extended data injected into this content item\r\n */\r\n public constructor(\r\n primaryKeys: InstanceKey[],\r\n label: string | LabelDefinition,\r\n imageId: string,\r\n classInfo: ClassInfo | undefined,\r\n values: ValuesDictionary<Value>,\r\n displayValues: ValuesDictionary<DisplayValue>,\r\n mergedFieldNames: string[],\r\n extendedData?: { [key: string]: any },\r\n ) {\r\n this.primaryKeys = primaryKeys;\r\n this.imageId = imageId; // eslint-disable-line @typescript-eslint/no-deprecated\r\n this.classInfo = classInfo;\r\n this.values = values;\r\n this.displayValues = displayValues;\r\n this.mergedFieldNames = mergedFieldNames;\r\n this.extendedData = extendedData;\r\n this.label = typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label;\r\n }\r\n\r\n /**\r\n * Is value of field with the specified name merged in this record.\r\n */\r\n public isFieldMerged(fieldName: string): boolean {\r\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): ItemJSON {\r\n const { label, ...baseItem } = this;\r\n return {\r\n ...baseItem,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n values: Value.toJSON(this.values) as ValuesMapJSON,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n displayValues: DisplayValue.toJSON(this.displayValues) as DisplayValuesMapJSON,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n labelDefinition: LabelDefinition.toJSON(label),\r\n };\r\n }\r\n\r\n /** Deserialize [[Item]] from JSON */\r\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (typeof json === \"string\") {\r\n return JSON.parse(json, (key, value) => Item.reviver(key, value));\r\n }\r\n const item = Object.create(Item.prototype);\r\n const { labelDefinition, ...baseJson } = json;\r\n return Object.assign(item, baseJson, {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n values: Value.fromJSON(json.values),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n displayValues: DisplayValue.fromJSON(json.displayValues),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n label: LabelDefinition.fromJSON(labelDefinition),\r\n } as Partial<Item>);\r\n }\r\n\r\n /**\r\n * Reviver function that can be used as a second argument for\r\n * `JSON.parse` method when parsing Item objects.\r\n * @internal\r\n */\r\n public static reviver(key: string, value: any): any {\r\n return key === \"\" ? Item.fromJSON(value) : value;\r\n }\r\n\r\n /**\r\n * Deserialize items list from JSON\r\n * @param json JSON or JSON serialized to string to deserialize from\r\n * @returns Deserialized items list\r\n * @internal\r\n */\r\n public static listFromJSON(json: ItemJSON[] | string): Item[] {\r\n if (typeof json === \"string\") {\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n return JSON.parse(json, Item.listReviver);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n return json.map(Item.fromJSON).filter((item): item is Item => !!item);\r\n }\r\n\r\n /**\r\n * Reviver function that can be used as a second argument for\r\n * `JSON.parse` method when parsing [[Item]][] objects.\r\n * @internal\r\n */\r\n public static listReviver(key: string, value: any): any {\r\n return key === \"\" ? Item.listFromJSON(value) : value;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAA0C,YAAY,EAAoB,MAAM,OAAO,CAAC;AAkC/F,cAAc;AACd,MAAM,KAAW,QAAQ,CAyBxB;AAzBD,WAAiB,QAAQ;IACvB;;;OAGG;IACH,uBAAuB;IACvB,SAAgB,MAAM,CAAC,IAAc;QACnC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IACrB,CAAC;IAFe,eAAM,SAErB,CAAA;IAED,gDAAgD;IAChD,SAAgB,gBAAgB,CAAC,IAAc,EAAE,UAAqD;QACpG,OAAO;YACL,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;SACnE,CAAC;IACJ,CAAC;IAJe,yBAAgB,mBAI/B,CAAA;IAED;;;OAGG;IACH,uBAAuB;IACvB,SAAgB,QAAQ,CAAC,IAAkB;QACzC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IACrB,CAAC;IAFe,iBAAQ,WAEvB,CAAA;AACH,CAAC,EAzBgB,QAAQ,KAAR,QAAQ,QAyBxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { ClassInfoJSON, CompressedClassInfoJSON, PropertyInfo, PropertyInfoJSON } from \"../EC\";\n\n/**\n * Data structure that describes one step of property\n * accessor path.\n *\n * @public\n */\nexport interface PropertyAccessor {\n /** Name of ECProperty */\n propertyName: string;\n /** If the property is an array, array index. Otherwise undefined. */\n arrayIndex?: number;\n}\n\n/**\n * Describes path to a property.\n * @public\n */\nexport type PropertyAccessorPath = PropertyAccessor[];\n\n/**\n * Data structure that describes a single ECProperty that's\n * included in a [[PropertiesField]].\n *\n * TODO: Remove?\n *\n * @public\n */\nexport interface Property {\n /** ECProperty information */\n property: PropertyInfo;\n}\n\n/** @public */\nexport namespace Property {\n /**\n * Serialize [[Property]] to JSON\n * @deprecated in 3.x. Use [[toCompressedJSON]]\n */\n // istanbul ignore next\n export function toJSON(prop: Property): PropertyJSON {\n return { ...prop };\n }\n\n /** Serialize [[Property]] to compressed JSON */\n export function toCompressedJSON(prop: Property, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyJSON<string> {\n return {\n property: PropertyInfo.toCompressedJSON(prop.property, classesMap),\n };\n }\n\n /**\n * Deserializes [[Property]] from JSON\n * @deprecated in 3.x. Use [[Property]]\n */\n // istanbul ignore next\n export function fromJSON(json: PropertyJSON): Property {\n return { ...json };\n }\n}\n\n/**\n * JSON representation of [[Property]]\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface PropertyJSON<TClassInfoJSON = ClassInfoJSON> {\n property: PropertyInfoJSON<TClassInfoJSON>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAA0C,YAAY,EAAoB,MAAM,OAAO,CAAC;AAkC/F,cAAc;AACd,MAAM,KAAW,QAAQ,CAyBxB;AAzBD,WAAiB,QAAQ;IACvB;;;OAGG;IACH,uBAAuB;IACvB,SAAgB,MAAM,CAAC,IAAc;QACnC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IACrB,CAAC;IAFe,eAAM,SAErB,CAAA;IAED,gDAAgD;IAChD,SAAgB,gBAAgB,CAAC,IAAc,EAAE,UAAqD;QACpG,OAAO;YACL,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;SACnE,CAAC;IACJ,CAAC;IAJe,yBAAgB,mBAI/B,CAAA;IAED;;;OAGG;IACH,uBAAuB;IACvB,SAAgB,QAAQ,CAAC,IAAkB;QACzC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IACrB,CAAC;IAFe,iBAAQ,WAEvB,CAAA;AACH,CAAC,EAzBgB,QAAQ,KAAR,QAAQ,QAyBxB","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 Content\r\n */\r\n\r\nimport { ClassInfoJSON, CompressedClassInfoJSON, PropertyInfo, PropertyInfoJSON } from \"../EC\";\r\n\r\n/**\r\n * Data structure that describes one step of property\r\n * accessor path.\r\n *\r\n * @public\r\n */\r\nexport interface PropertyAccessor {\r\n /** Name of ECProperty */\r\n propertyName: string;\r\n /** If the property is an array, array index. Otherwise undefined. */\r\n arrayIndex?: number;\r\n}\r\n\r\n/**\r\n * Describes path to a property.\r\n * @public\r\n */\r\nexport type PropertyAccessorPath = PropertyAccessor[];\r\n\r\n/**\r\n * Data structure that describes a single ECProperty that's\r\n * included in a [[PropertiesField]].\r\n *\r\n * TODO: Remove?\r\n *\r\n * @public\r\n */\r\nexport interface Property {\r\n /** ECProperty information */\r\n property: PropertyInfo;\r\n}\r\n\r\n/** @public */\r\nexport namespace Property {\r\n /**\r\n * Serialize [[Property]] to JSON\r\n * @deprecated in 3.x. Use [[toCompressedJSON]]\r\n */\r\n // istanbul ignore next\r\n export function toJSON(prop: Property): PropertyJSON {\r\n return { ...prop };\r\n }\r\n\r\n /** Serialize [[Property]] to compressed JSON */\r\n export function toCompressedJSON(prop: Property, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyJSON<string> {\r\n return {\r\n property: PropertyInfo.toCompressedJSON(prop.property, classesMap),\r\n };\r\n }\r\n\r\n /**\r\n * Deserializes [[Property]] from JSON\r\n * @deprecated in 3.x. Use [[Property]]\r\n */\r\n // istanbul ignore next\r\n export function fromJSON(json: PropertyJSON): Property {\r\n return { ...json };\r\n }\r\n}\r\n\r\n/**\r\n * JSON representation of [[Property]]\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface PropertyJSON<TClassInfoJSON = ClassInfoJSON> {\r\n property: PropertyInfoJSON<TClassInfoJSON>;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAwB,KAAK,EAA0C,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAwB,KAAK,EAA0C,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAwC,KAAK,EAA0B,MAAM,SAAS,CAAC;AAE5G,gBAAgB;AAChB,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,uBAAuB;IAC/B,OAAO,CAAC,WAAW,CAAC;gBADZ,uBAAuB,EAAE;QAAE,mBAAmB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;KAAE,EACnI,WAAW,CAAC,EAAE,aAAa,YAAA;IAGxB,aAAa,CAAC,OAAO,EAAE,OAAO;IAK9B,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU;YASvD,YAAY;YAgCZ,gCAAgC;YAMhC,mBAAmB;YAYnB,gBAAgB;YAIhB,mBAAmB;CASlC;AAED,gBAAgB;AAChB,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,yBAAyB;IAEpD,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;YAejG,WAAW;YAcX,oBAAoB;YA6CpB,iBAAiB;YAYjB,gBAAgB;CAW/B"}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { assert } from "@itwin/core-bentley";
|
|
9
9
|
import { Content } from "./Content";
|
|
10
|
-
import { PropertyValueFormat } from "./TypeDescription";
|
|
11
10
|
import { Value } from "./Value";
|
|
12
11
|
/** @internal */
|
|
13
12
|
export class ContentFormatter {
|
|
@@ -94,67 +93,76 @@ export class ContentPropertyValueFormatter {
|
|
|
94
93
|
return formatDouble(rawValue);
|
|
95
94
|
}
|
|
96
95
|
: async (rawValue) => formatDouble(rawValue);
|
|
97
|
-
return this.formatValue(field
|
|
96
|
+
return this.formatValue(field, value, { doubleFormatter });
|
|
98
97
|
}
|
|
99
|
-
async formatValue(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
async formatValue(field, value, ctx) {
|
|
99
|
+
if (field.isPropertiesField()) {
|
|
100
|
+
if (field.isArrayPropertiesField()) {
|
|
101
|
+
return this.formatArrayValue(field, value);
|
|
102
|
+
}
|
|
103
|
+
if (field.isStructPropertiesField()) {
|
|
104
|
+
return this.formatStructValue(field, value);
|
|
105
|
+
}
|
|
107
106
|
}
|
|
107
|
+
return this.formatPrimitiveValue(field, value, ctx);
|
|
108
108
|
}
|
|
109
|
-
async formatPrimitiveValue(
|
|
109
|
+
async formatPrimitiveValue(field, value, ctx) {
|
|
110
110
|
if (value === undefined) {
|
|
111
111
|
return "";
|
|
112
112
|
}
|
|
113
113
|
const formatDoubleValue = async (raw) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));
|
|
114
|
-
if (type.typeName === "point2d" && isPoint2d(value)) {
|
|
114
|
+
if (field.type.typeName === "point2d" && isPoint2d(value)) {
|
|
115
115
|
return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;
|
|
116
116
|
}
|
|
117
|
-
if (type.typeName === "point3d" && isPoint3d(value)) {
|
|
117
|
+
if (field.type.typeName === "point3d" && isPoint3d(value)) {
|
|
118
118
|
return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;
|
|
119
119
|
}
|
|
120
|
-
if (type.typeName === "dateTime") {
|
|
120
|
+
if (field.type.typeName === "dateTime") {
|
|
121
121
|
assert(typeof value === "string");
|
|
122
122
|
return value;
|
|
123
123
|
}
|
|
124
|
-
if (type.typeName === "bool" || type.typeName === "boolean") {
|
|
124
|
+
if (field.type.typeName === "bool" || field.type.typeName === "boolean") {
|
|
125
125
|
assert(typeof value === "boolean");
|
|
126
126
|
return value ? "@Presentation:value.true@" : "@Presentation:value.false@";
|
|
127
127
|
}
|
|
128
|
-
if (type.typeName === "int" || type.typeName === "long") {
|
|
128
|
+
if (field.type.typeName === "int" || field.type.typeName === "long") {
|
|
129
129
|
assert(isNumber(value));
|
|
130
130
|
return value.toFixed(0);
|
|
131
131
|
}
|
|
132
|
-
if (type.typeName === "double") {
|
|
132
|
+
if (field.type.typeName === "double") {
|
|
133
133
|
assert(isNumber(value));
|
|
134
134
|
return formatDoubleValue(value);
|
|
135
135
|
}
|
|
136
|
-
if (type.typeName === "navigation") {
|
|
136
|
+
if (field.type.typeName === "navigation") {
|
|
137
137
|
assert(Value.isNavigationValue(value));
|
|
138
138
|
return value.label.displayValue;
|
|
139
139
|
}
|
|
140
|
+
if (field.type.typeName === "enum" && field.isPropertiesField()) {
|
|
141
|
+
const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict
|
|
142
|
+
? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string
|
|
143
|
+
: undefined;
|
|
144
|
+
return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;
|
|
145
|
+
}
|
|
140
146
|
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
141
147
|
return value.toString();
|
|
142
148
|
}
|
|
143
|
-
async formatStructValue(
|
|
149
|
+
async formatStructValue(field, value) {
|
|
144
150
|
if (!Value.isMap(value)) {
|
|
145
151
|
return {};
|
|
146
152
|
}
|
|
147
153
|
const formattedMember = {};
|
|
148
|
-
for (const member of
|
|
149
|
-
formattedMember[member.name] = await this.formatValue(member
|
|
154
|
+
for (const member of field.memberFields) {
|
|
155
|
+
formattedMember[member.name] = await this.formatValue(member, value[member.name]);
|
|
150
156
|
}
|
|
151
157
|
return formattedMember;
|
|
152
158
|
}
|
|
153
|
-
async formatArrayValue(
|
|
159
|
+
async formatArrayValue(field, value) {
|
|
154
160
|
if (!Value.isArray(value)) {
|
|
155
161
|
return [];
|
|
156
162
|
}
|
|
157
|
-
return Promise.all(value.map(async (arrayVal) =>
|
|
163
|
+
return Promise.all(value.map(async (arrayVal) => {
|
|
164
|
+
return this.formatValue(field.itemsField, arrayVal);
|
|
165
|
+
}));
|
|
158
166
|
}
|
|
159
167
|
}
|
|
160
168
|
function formatDouble(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.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AC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAYD,SAAS,cAAc,CAAC,KAAY;IAClC,OAAO,KAAK,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/H,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter\";\nimport { ValuesDictionary } from \"../Utils\";\nimport { Content } from \"./Content\";\nimport { Descriptor } from \"./Descriptor\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields\";\nimport { Item } from \"./Item\";\nimport { ArrayTypeDescription, PrimitiveTypeDescription, PropertyValueFormat, StructTypeDescription, TypeDescription } from \"./TypeDescription\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value\";\n\n/** @internal */\nexport class ContentFormatter {\n constructor(\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\n private _unitSystem?: UnitSystemKey,\n ) {}\n\n public async formatContent(content: Content) {\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\n return new Content(content.descriptor, formattedItems);\n }\n\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\n return Promise.all(\n items.map(async (item) => {\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\n return item;\n }),\n );\n }\n\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\n for (const field of fields) {\n const value = values[field.name];\n\n // format display value of merged values\n if (mergedFields.includes(field.name)) {\n displayValues[field.name] = \"@Presentation:label.varies@\";\n continue;\n }\n\n // do not add undefined value to display values\n if (value === undefined) {\n continue;\n }\n\n // format display values of nested content field\n if (field.isNestedContentField()) {\n assert(Value.isNestedContent(value));\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\n continue;\n }\n\n // format property items\n if (field.isPropertiesField()) {\n displayValues[field.name] = await this.formatPropertyValue(value, field);\n continue;\n }\n\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n }\n\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\n for (const nestedValue of nestedValues) {\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\n }\n }\n\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\n if (field.isArrayPropertiesField()) {\n assert(Value.isArray(value));\n return this.formatArrayItems(value, field);\n }\n if (field.isStructPropertiesField()) {\n assert(Value.isMap(value));\n return this.formatStructMembers(value, field);\n }\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\n }\n\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\n const displayValues: DisplayValuesMap = {};\n await Promise.all(\n field.memberFields.map(async (memberField) => {\n displayValues[memberField.name] = await this.formatPropertyValue(memberValues[memberField.name], memberField);\n }),\n );\n return displayValues;\n }\n}\n\n/** @internal */\nexport class ContentPropertyValueFormatter {\n constructor(private _koqValueFormatter: KoqPropertyValueFormatter) {}\n\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\n const doubleFormatter = isFieldWithKoq(field)\n ? async (rawValue: number) => {\n const koq = field.properties[0].property.kindOfQuantity;\n const formattedValue = await this._koqValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\n if (formattedValue !== undefined) {\n return formattedValue;\n }\n return formatDouble(rawValue);\n }\n : async (rawValue: number) => formatDouble(rawValue);\n\n return this.formatValue(field.type, value, { doubleFormatter });\n }\n\n private async formatValue(type: TypeDescription, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n switch (type.valueFormat) {\n case PropertyValueFormat.Primitive:\n return this.formatPrimitiveValue(type, value, ctx);\n case PropertyValueFormat.Array:\n return this.formatArrayValue(type, value);\n case PropertyValueFormat.Struct:\n return this.formatStructValue(type, value);\n }\n }\n\n private async formatPrimitiveValue(type: PrimitiveTypeDescription, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\n if (value === undefined) {\n return \"\";\n }\n\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\n\n if (type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (type.typeName === \"point3d\" && isPoint3d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\n }\n if (type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (type.typeName === \"bool\" || type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (type.typeName === \"int\" || type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(type: StructTypeDescription, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of type.members) {\n formattedMember[member.name] = await this.formatValue(member.type, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(type: ArrayTypeDescription, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(value.map(async (arrayVal) => this.formatValue(type.memberType, arrayVal)));\n }\n}\n\nfunction formatDouble(value: number) {\n return value.toFixed(2);\n}\n\ntype FieldWithKoq = PropertiesField & {\n properties: [\n {\n property: PropertyInfo & {\n kindOfQuantity: KindOfQuantityInfo;\n };\n },\n ];\n};\n\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\n}\n\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\n}\n\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\n return isPoint2d(obj) && isNumber((obj as any).z);\n}\n\nfunction isNumber(obj: Value): obj is number {\n return !isNaN(Number(obj));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAK7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAsD,KAAK,EAA0B,MAAM,SAAS,CAAC;AAE5G,gBAAgB;AAChB,MAAM,OAAO,gBAAgB;IAC3B,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAAX,WAAW,CAAgB;IAClC,CAAC;IAEG,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7F,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,KAAa,EAAE,UAAsB;QACnE,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,MAA+B,EAAE,aAA6C,EAAE,MAAe,EAAE,YAAsB;QAChJ,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,KAAK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AAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,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 Content\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC\";\r\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\nimport { Content } from \"./Content\";\r\nimport { Descriptor } from \"./Descriptor\";\r\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields\";\r\nimport { Item } from \"./Item\";\r\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value\";\r\n\r\n/** @internal */\r\nexport class ContentFormatter {\r\n constructor(\r\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\r\n private _unitSystem?: UnitSystemKey,\r\n ) {}\r\n\r\n public async formatContent(content: Content) {\r\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\r\n return new Content(content.descriptor, formattedItems);\r\n }\r\n\r\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\r\n return Promise.all(\r\n items.map(async (item) => {\r\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\r\n return item;\r\n }),\r\n );\r\n }\r\n\r\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\r\n for (const field of fields) {\r\n const value = values[field.name];\r\n\r\n // format display value of merged values\r\n if (mergedFields.includes(field.name)) {\r\n displayValues[field.name] = \"@Presentation:label.varies@\";\r\n continue;\r\n }\r\n\r\n // do not add undefined value to display values\r\n if (value === undefined) {\r\n continue;\r\n }\r\n\r\n // format display values of nested content field\r\n if (field.isNestedContentField()) {\r\n assert(Value.isNestedContent(value));\r\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\r\n continue;\r\n }\r\n\r\n // format property items\r\n if (field.isPropertiesField()) {\r\n displayValues[field.name] = await this.formatPropertyValue(value, field);\r\n continue;\r\n }\r\n\r\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\r\n }\r\n }\r\n\r\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\r\n for (const nestedValue of nestedValues) {\r\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\r\n }\r\n }\r\n\r\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\r\n if (field.isArrayPropertiesField()) {\r\n assert(Value.isArray(value));\r\n return this.formatArrayItems(value, field);\r\n }\r\n if (field.isStructPropertiesField()) {\r\n assert(Value.isMap(value));\r\n return this.formatStructMembers(value, field);\r\n }\r\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\r\n }\r\n\r\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\r\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\r\n }\r\n\r\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\r\n const displayValues: DisplayValuesMap = {};\r\n await Promise.all(\r\n field.memberFields.map(async (memberField) => {\r\n displayValues[memberField.name] = await this.formatPropertyValue(memberValues[memberField.name], memberField);\r\n }),\r\n );\r\n return displayValues;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ContentPropertyValueFormatter {\r\n constructor(private _koqValueFormatter: KoqPropertyValueFormatter) {}\r\n\r\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\r\n const doubleFormatter = isFieldWithKoq(field)\r\n ? async (rawValue: number) => {\r\n const koq = field.properties[0].property.kindOfQuantity;\r\n const formattedValue = await this._koqValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\r\n if (formattedValue !== undefined) {\r\n return formattedValue;\r\n }\r\n return formatDouble(rawValue);\r\n }\r\n : async (rawValue: number) => formatDouble(rawValue);\r\n\r\n return this.formatValue(field, value, { doubleFormatter });\r\n }\r\n\r\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\r\n if (field.isPropertiesField()) {\r\n if (field.isArrayPropertiesField()) {\r\n return this.formatArrayValue(field, value);\r\n }\r\n\r\n if (field.isStructPropertiesField()) {\r\n return this.formatStructValue(field, value);\r\n }\r\n }\r\n\r\n return this.formatPrimitiveValue(field, value, ctx);\r\n }\r\n\r\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\r\n if (value === undefined) {\r\n return \"\";\r\n }\r\n\r\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\r\n\r\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\r\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\r\n }\r\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\r\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\r\n }\r\n if (field.type.typeName === \"dateTime\") {\r\n assert(typeof value === \"string\");\r\n return value;\r\n }\r\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\r\n assert(typeof value === \"boolean\");\r\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\r\n }\r\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\r\n assert(isNumber(value));\r\n return value.toFixed(0);\r\n }\r\n if (field.type.typeName === \"double\") {\r\n assert(isNumber(value));\r\n return formatDoubleValue(value);\r\n }\r\n if (field.type.typeName === \"navigation\") {\r\n assert(Value.isNavigationValue(value));\r\n return value.label.displayValue;\r\n }\r\n\r\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\r\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\r\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\r\n : undefined;\r\n\r\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n return value.toString();\r\n }\r\n\r\n private async formatStructValue(field: StructPropertiesField, value: Value) {\r\n if (!Value.isMap(value)) {\r\n return {};\r\n }\r\n\r\n const formattedMember: DisplayValuesMap = {};\r\n for (const member of field.memberFields) {\r\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\r\n }\r\n return formattedMember;\r\n }\r\n\r\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\r\n if (!Value.isArray(value)) {\r\n return [];\r\n }\r\n\r\n return Promise.all(\r\n value.map(async (arrayVal) => {\r\n return this.formatValue(field.itemsField, arrayVal);\r\n }),\r\n );\r\n }\r\n}\r\n\r\nfunction formatDouble(value: number) {\r\n return value.toFixed(2);\r\n}\r\n\r\ntype FieldWithKoq = PropertiesField & {\r\n properties: [\r\n {\r\n property: PropertyInfo & {\r\n kindOfQuantity: KindOfQuantityInfo;\r\n };\r\n },\r\n ];\r\n};\r\n\r\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\r\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\r\n}\r\n\r\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\r\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\r\n}\r\n\r\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\r\n return isPoint2d(obj) && isNumber((obj as any).z);\r\n}\r\n\r\nfunction isNumber(obj: Value): obj is number {\r\n return !isNaN(Number(obj));\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Renderer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\n/**\n * Describes property renderer used for a content [[Field]].\n * @public\n */\nexport interface RendererDescription {\n /** Renderer name. */\n name: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Renderer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 Content\r\n */\r\n\r\n/**\r\n * Describes property renderer used for a content [[Field]].\r\n * @public\r\n */\r\nexport interface RendererDescription {\r\n /** Renderer name. */\r\n name: string;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeDescription.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/TypeDescription.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,sBAAsB;IACtB,8CAAuB,CAAA;IACvB,kBAAkB;IAClB,sCAAe,CAAA;IACf,mBAAmB;IACnB,wCAAiB,CAAA;AACnB,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\n/**\n * Format of the property value.\n * @public\n */\nexport enum PropertyValueFormat {\n /** Primitive value */\n Primitive = \"Primitive\",\n /** Array value */\n Array = \"Array\",\n /** Struct value */\n Struct = \"Struct\",\n}\n\n/**\n * Data structure for base content field type description. Not\n * meant to be used directly, see `TypeDescription`.\n *\n * @public\n */\nexport interface BaseTypeDescription {\n /** Value format */\n valueFormat: PropertyValueFormat;\n /** Type name */\n typeName: string;\n}\n\n/**\n * Type description for primitive properties.\n * @public\n */\nexport interface PrimitiveTypeDescription extends BaseTypeDescription {\n /** Primitive format */\n valueFormat: PropertyValueFormat.Primitive;\n}\n\n/**\n * Type description for array properties.\n * @public\n */\nexport interface ArrayTypeDescription extends BaseTypeDescription {\n /** Array format */\n valueFormat: PropertyValueFormat.Array;\n /** Type of array items */\n memberType: TypeDescription;\n}\n\n/**\n * A data structure that describes a struct member.\n * @public\n */\nexport interface StructFieldMemberDescription {\n /** Unique name of a struct member */\n name: string;\n /** Label of the struct member */\n label: string;\n /** Type of the struct member */\n type: TypeDescription;\n}\n\n/**\n * Type description for struct properties.\n * @public\n */\nexport interface StructTypeDescription extends BaseTypeDescription {\n /** Struct format */\n valueFormat: PropertyValueFormat.Struct;\n /** Type descriptions of struct members */\n members: StructFieldMemberDescription[];\n}\n\n/**\n * One of content field type descriptions.\n * @public\n */\nexport type TypeDescription = PrimitiveTypeDescription | ArrayTypeDescription | StructTypeDescription;\n"]}
|
|
1
|
+
{"version":3,"file":"TypeDescription.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/TypeDescription.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,sBAAsB;IACtB,8CAAuB,CAAA;IACvB,kBAAkB;IAClB,sCAAe,CAAA;IACf,mBAAmB;IACnB,wCAAiB,CAAA;AACnB,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B","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 Content\r\n */\r\n\r\n/**\r\n * Format of the property value.\r\n * @public\r\n */\r\nexport enum PropertyValueFormat {\r\n /** Primitive value */\r\n Primitive = \"Primitive\",\r\n /** Array value */\r\n Array = \"Array\",\r\n /** Struct value */\r\n Struct = \"Struct\",\r\n}\r\n\r\n/**\r\n * Data structure for base content field type description. Not\r\n * meant to be used directly, see `TypeDescription`.\r\n *\r\n * @public\r\n */\r\nexport interface BaseTypeDescription {\r\n /** Value format */\r\n valueFormat: PropertyValueFormat;\r\n /** Type name */\r\n typeName: string;\r\n}\r\n\r\n/**\r\n * Type description for primitive properties.\r\n * @public\r\n */\r\nexport interface PrimitiveTypeDescription extends BaseTypeDescription {\r\n /** Primitive format */\r\n valueFormat: PropertyValueFormat.Primitive;\r\n}\r\n\r\n/**\r\n * Type description for array properties.\r\n * @public\r\n */\r\nexport interface ArrayTypeDescription extends BaseTypeDescription {\r\n /** Array format */\r\n valueFormat: PropertyValueFormat.Array;\r\n /** Type of array items */\r\n memberType: TypeDescription;\r\n}\r\n\r\n/**\r\n * A data structure that describes a struct member.\r\n * @public\r\n */\r\nexport interface StructFieldMemberDescription {\r\n /** Unique name of a struct member */\r\n name: string;\r\n /** Label of the struct member */\r\n label: string;\r\n /** Type of the struct member */\r\n type: TypeDescription;\r\n}\r\n\r\n/**\r\n * Type description for struct properties.\r\n * @public\r\n */\r\nexport interface StructTypeDescription extends BaseTypeDescription {\r\n /** Struct format */\r\n valueFormat: PropertyValueFormat.Struct;\r\n /** Type descriptions of struct members */\r\n members: StructFieldMemberDescription[];\r\n}\r\n\r\n/**\r\n * One of content field type descriptions.\r\n * @public\r\n */\r\nexport type TypeDescription = PrimitiveTypeDescription | ArrayTypeDescription | StructTypeDescription;\r\n"]}
|