@itwin/presentation-common 5.2.0-dev.2 → 5.2.0-dev.20
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 +31 -1
- package/Ruleset.schema.json +18 -0
- package/lib/cjs/presentation-common/KeySet.d.ts +22 -7
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +28 -37
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts +3 -3
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +9 -7
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +10 -0
- 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.d.ts +8 -0
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +1 -2
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +2 -16
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +16 -0
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +1 -0
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +2 -0
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +6 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +2 -0
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts +23 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +8 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -0
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +4 -0
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js +1 -0
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +1 -0
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +18 -0
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +5 -0
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +8 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +12 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +4 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +22 -7
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +29 -38
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts +3 -3
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +9 -7
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +10 -0
- 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.d.ts +8 -0
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +1 -2
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +2 -16
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +16 -0
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +1 -0
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +2 -0
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +6 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +2 -0
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -0
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts +23 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +8 -1
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -0
- package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js +1 -0
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +4 -0
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -0
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js +1 -0
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +1 -0
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +18 -0
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +5 -0
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +8 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +12 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +4 -0
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
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,cAAc,CAAC;AAIvC,OAAO,EAAsD,KAAK,EAA0B,MAAM,YAAY,CAAC;AAE/G,gBAAgB;AAChB,MAAM,OAAO,gBAAgB;IAEjB;IACA;IAFV,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,kBAAk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AAE,CAAC;QACZ,CAAC;QAED,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CACH,CAAC;IACJ,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.js\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\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, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, 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 (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.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 (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\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,cAAc,CAAC;AAIvC,OAAO,EAAsD,KAAK,EAA0B,MAAM,YAAY,CAAC;AAE/G,gBAAgB;AAChB,MAAM,OAAO,gBAAgB;IAEjB;IACA;IAFV,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,C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AC;QACtD,CAAC,CAAC,CACH,CAAC;IACJ,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.js\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\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 const memberValue = memberValues[memberField.name];\n // do not add undefined value to display values\n if (memberValue === undefined) {\n return;\n }\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, 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, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, 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 (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.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 (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\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"]}
|
|
@@ -5,6 +5,8 @@ import { Node } from "./Node.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Defines a hierarchy level that consists of an array of nodes and possibly other information.
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
9
|
+
* package for creating hierarchies.
|
|
8
10
|
*/
|
|
9
11
|
export interface HierarchyLevel {
|
|
10
12
|
/** A list of nodes in a hierarchy level. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyLevel.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/HierarchyLevel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HierarchyLevel.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/HierarchyLevel.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,KAAK,EAAE,IAAI,EAAE,CAAC;IACd;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module Hierarchies
|
|
7
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyLevel.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/HierarchyLevel.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 Hierarchies\n */\n\nimport { Node } from \"./Node.js\";\n\n/**\n * Defines a hierarchy level that consists of an array of nodes and possibly other information.\n * @public\n */\nexport interface HierarchyLevel {\n /** A list of nodes in a hierarchy level. */\n nodes: Node[];\n /**\n * Identifies whether the hierarchy level supports filtering. If not, requesting either a hierarchy level descriptor or\n * a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.\n */\n supportsFiltering?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HierarchyLevel.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/HierarchyLevel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;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/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module Hierarchies\n */\n\nimport { Node } from \"./Node.js\";\n\n/**\n * Defines a hierarchy level that consists of an array of nodes and possibly other information.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyLevel {\n /** A list of nodes in a hierarchy level. */\n nodes: Node[];\n /**\n * Identifies whether the hierarchy level supports filtering. If not, requesting either a hierarchy level descriptor or\n * a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.\n */\n supportsFiltering?: boolean;\n}\n"]}
|
|
@@ -6,6 +6,8 @@ import { InstanceKey } from "../EC.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Standard node types
|
|
8
8
|
* @public
|
|
9
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
10
|
+
* package for creating hierarchies.
|
|
9
11
|
*/
|
|
10
12
|
export declare enum StandardNodeTypes {
|
|
11
13
|
ECInstancesNode = "ECInstancesNode",
|
|
@@ -16,9 +18,15 @@ export declare enum StandardNodeTypes {
|
|
|
16
18
|
/**
|
|
17
19
|
* One of the node key types
|
|
18
20
|
* @public
|
|
21
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
22
|
+
* package for creating hierarchies.
|
|
19
23
|
*/
|
|
20
24
|
export type NodeKey = BaseNodeKey | ECInstancesNodeKey | ECClassGroupingNodeKey | ECPropertyGroupingNodeKey | LabelGroupingNodeKey;
|
|
21
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
28
|
+
* package for creating hierarchies.
|
|
29
|
+
*/
|
|
22
30
|
export declare namespace NodeKey {
|
|
23
31
|
/** Checks if the supplied key is an [[ECInstancesNodeKey]] */
|
|
24
32
|
function isInstancesNodeKey(key: NodeKey): key is ECInstancesNodeKey;
|
|
@@ -44,11 +52,15 @@ export declare namespace NodeKey {
|
|
|
44
52
|
/**
|
|
45
53
|
* Node key path. Can be used to define path from one node to another.
|
|
46
54
|
* @public
|
|
55
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
56
|
+
* package for creating hierarchies.
|
|
47
57
|
*/
|
|
48
58
|
export type NodeKeyPath = NodeKey[];
|
|
49
59
|
/**
|
|
50
60
|
* Data structure that describes a basic node key
|
|
51
61
|
* @public
|
|
62
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
63
|
+
* package for creating hierarchies.
|
|
52
64
|
*/
|
|
53
65
|
export interface BaseNodeKey {
|
|
54
66
|
/** Node type */
|
|
@@ -66,6 +78,8 @@ export interface BaseNodeKey {
|
|
|
66
78
|
/**
|
|
67
79
|
* Data structure that describes a node ECInstance node key
|
|
68
80
|
* @public
|
|
81
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
82
|
+
* package for creating hierarchies.
|
|
69
83
|
*/
|
|
70
84
|
export interface ECInstancesNodeKey extends BaseNodeKey {
|
|
71
85
|
type: StandardNodeTypes.ECInstancesNode;
|
|
@@ -75,6 +89,8 @@ export interface ECInstancesNodeKey extends BaseNodeKey {
|
|
|
75
89
|
/**
|
|
76
90
|
* Data structure that describes a grouping node key
|
|
77
91
|
* @public
|
|
92
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
93
|
+
* package for creating hierarchies.
|
|
78
94
|
*/
|
|
79
95
|
export interface GroupingNodeKey extends BaseNodeKey {
|
|
80
96
|
/**
|
|
@@ -89,6 +105,8 @@ export interface GroupingNodeKey extends BaseNodeKey {
|
|
|
89
105
|
/**
|
|
90
106
|
* Data structure that describes an ECClass grouping node key
|
|
91
107
|
* @public
|
|
108
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
109
|
+
* package for creating hierarchies.
|
|
92
110
|
*/
|
|
93
111
|
export interface ECClassGroupingNodeKey extends GroupingNodeKey {
|
|
94
112
|
type: StandardNodeTypes.ECClassGroupingNode;
|
|
@@ -98,6 +116,8 @@ export interface ECClassGroupingNodeKey extends GroupingNodeKey {
|
|
|
98
116
|
/**
|
|
99
117
|
* Data structure that describes an ECProperty grouping node key
|
|
100
118
|
* @public
|
|
119
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
120
|
+
* package for creating hierarchies.
|
|
101
121
|
*/
|
|
102
122
|
export interface ECPropertyGroupingNodeKey extends GroupingNodeKey {
|
|
103
123
|
type: StandardNodeTypes.ECPropertyGroupingNode;
|
|
@@ -111,6 +131,8 @@ export interface ECPropertyGroupingNodeKey extends GroupingNodeKey {
|
|
|
111
131
|
/**
|
|
112
132
|
* Data structure that describes a display label grouping node key
|
|
113
133
|
* @public
|
|
134
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
135
|
+
* package for creating hierarchies.
|
|
114
136
|
*/
|
|
115
137
|
export interface LabelGroupingNodeKey extends GroupingNodeKey {
|
|
116
138
|
type: StandardNodeTypes.DisplayLabelGroupingNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Key.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Key.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Key.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;GAKG;AACH,oBAAY,iBAAiB;IAC3B,eAAe,oBAAoB;IACnC,mBAAmB,wB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;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,GAAG,EAAE,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,iBAAiB,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module Hierarchies
|
|
7
8
|
*/
|
|
@@ -10,6 +11,8 @@ import { InstanceKey } from "../EC.js";
|
|
|
10
11
|
/**
|
|
11
12
|
* Standard node types
|
|
12
13
|
* @public
|
|
14
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
15
|
+
* package for creating hierarchies.
|
|
13
16
|
*/
|
|
14
17
|
export var StandardNodeTypes;
|
|
15
18
|
(function (StandardNodeTypes) {
|
|
@@ -18,7 +21,11 @@ export var StandardNodeTypes;
|
|
|
18
21
|
StandardNodeTypes["ECPropertyGroupingNode"] = "ECPropertyGroupingNode";
|
|
19
22
|
StandardNodeTypes["DisplayLabelGroupingNode"] = "DisplayLabelGroupingNode";
|
|
20
23
|
})(StandardNodeTypes || (StandardNodeTypes = {}));
|
|
21
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
27
|
+
* package for creating hierarchies.
|
|
28
|
+
*/
|
|
22
29
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
23
30
|
export var NodeKey;
|
|
24
31
|
(function (NodeKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Key.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Key.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,wDAAmC,CAAA;IACnC,gEAA2C,CAAA;IAC3C,sEAAiD,CAAA;IACjD,0EAAqD,CAAA;AACvD,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAOD,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,OAAO,CAoFvB;AApFD,WAAiB,OAAO;IACtB,8DAA8D;IAC9D,SAAgB,kBAAkB,CAAC,GAAY;QAC7C,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,eAAe,CAAC;IACxD,CAAC;IAFe,0BAAkB,qBAEjC,CAAA;IAED,kEAAkE;IAClE,SAAgB,sBAAsB,CAAC,GAAY;QACjD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,mBAAmB,CAAC;IAC5D,CAAC;IAFe,8BAAsB,yBAErC,CAAA;IAED,qEAAqE;IACrE,SAAgB,yBAAyB,CAAC,GAAY;QACpD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,sBAAsB,CAAC;IAC/D,CAAC;IAFe,iCAAyB,4BAExC,CAAA;IAED,+DAA+D;IAC/D,SAAgB,sBAAsB,CAAC,GAAY;QACjD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,wBAAwB,CAAC;IACjE,CAAC;IAFe,8BAAsB,yBAErC,CAAA;IAED,wDAAwD;IACxD,SAAgB,iBAAiB,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E,CAAC;gBACjD,IAAI,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACxE,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;YACpC,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC;QACzC,CAAC;QACD,IAAI,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;YACvC,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,YAAY,CAAC;QAClF,CAAC;QACD,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;YACpC,OAAO,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAhDe,cAAM,SAgDrB,CAAA;AACH,CAAC,EApFgB,OAAO,KAAP,OAAO,QAoFvB","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 Hierarchies\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"../EC.js\";\n\n/**\n * Standard node types\n * @public\n */\nexport enum StandardNodeTypes {\n ECInstancesNode = \"ECInstancesNode\",\n ECClassGroupingNode = \"ECClassGroupingNode\",\n ECPropertyGroupingNode = \"ECPropertyGroupingNode\",\n DisplayLabelGroupingNode = \"DisplayLabelGroupingNode\",\n}\n\n/**\n * One of the node key types\n * @public\n */\nexport type NodeKey = BaseNodeKey | ECInstancesNodeKey | ECClassGroupingNodeKey | ECPropertyGroupingNodeKey | LabelGroupingNodeKey;\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace NodeKey {\n /** Checks if the supplied key is an [[ECInstancesNodeKey]] */\n export function isInstancesNodeKey(key: NodeKey): key is ECInstancesNodeKey {\n return key.type === StandardNodeTypes.ECInstancesNode;\n }\n\n /** Checks if the supplied key is an [[ECClassGroupingNodeKey]] */\n export function isClassGroupingNodeKey(key: NodeKey): key is ECClassGroupingNodeKey {\n return key.type === StandardNodeTypes.ECClassGroupingNode;\n }\n\n /** Checks if the supplied key is an [[ECPropertyGroupingNodeKey]] */\n export function isPropertyGroupingNodeKey(key: NodeKey): key is ECPropertyGroupingNodeKey {\n return key.type === StandardNodeTypes.ECPropertyGroupingNode;\n }\n\n /** Checks if the supplied key is a [[LabelGroupingNodeKey]] */\n export function isLabelGroupingNodeKey(key: NodeKey): key is LabelGroupingNodeKey {\n return key.type === StandardNodeTypes.DisplayLabelGroupingNode;\n }\n\n /** Checks if the supplied key is a grouping node key */\n export function isGroupingNodeKey(key: NodeKey): key is GroupingNodeKey {\n return isClassGroupingNodeKey(key) || isPropertyGroupingNodeKey(key) || isLabelGroupingNodeKey(key);\n }\n\n /**\n * Checks if two given node keys are equal, taking their versions into account.\n *\n * When comparing two keys of the same version, the algorithm uses [[NodeKey.pathFromRoot]] array\n * which is the most accurate way of checking equality. However, when version are different,\n * [[NodeKey.pathFromRoot]] array may contain different strings even though keys represent the same node.\n * In that case equality is checked using other key attributes, depending on the type of the node (type,\n * label, grouping class, property name, etc.).\n */\n export function equals(lhs: NodeKey, rhs: NodeKey): boolean {\n // types must always be equal\n if (lhs.type !== rhs.type) {\n return false;\n }\n\n // `pathFromRoot` lengths must always be equal\n if (lhs.pathFromRoot.length !== rhs.pathFromRoot.length) {\n return false;\n }\n\n // when versions are equal, compare using contents of `pathFromRoot` array\n if (lhs.version === rhs.version) {\n for (let i = 0; i < lhs.pathFromRoot.length; ++i) {\n if (lhs.pathFromRoot[i] !== rhs.pathFromRoot[i]) {\n return false;\n }\n }\n return true;\n }\n\n // when versions aren't equal, compare using other key information, because key hashes\n // of different key versions can't be compared\n if (isInstancesNodeKey(lhs)) {\n assert(isInstancesNodeKey(rhs));\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return false;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n if (0 !== InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i])) {\n return false;\n }\n }\n return true;\n }\n if (isClassGroupingNodeKey(lhs)) {\n assert(isClassGroupingNodeKey(rhs));\n return lhs.className === rhs.className;\n }\n if (isPropertyGroupingNodeKey(lhs)) {\n assert(isPropertyGroupingNodeKey(rhs));\n return lhs.className === rhs.className && lhs.propertyName === rhs.propertyName;\n }\n if (isLabelGroupingNodeKey(lhs)) {\n assert(isLabelGroupingNodeKey(rhs));\n return lhs.label === rhs.label;\n }\n return true;\n }\n}\n\n/**\n * Node key path. Can be used to define path from one node to another.\n * @public\n */\nexport type NodeKeyPath = NodeKey[];\n\n/**\n * Data structure that describes a basic node key\n * @public\n */\nexport interface BaseNodeKey {\n /** Node type */\n type: string;\n\n /**\n * Version of the key. Different versions suggest that node keys were created by two different\n * versions of the library. In that case, keys representing the same node may be different.\n */\n version: number;\n\n /** Node hash path from root to the node whose key this is */\n pathFromRoot: string[];\n\n /** Query that returns all selected instance keys */\n instanceKeysSelectQuery?: PresentationQuery;\n}\n\n/**\n * Data structure that describes a node ECInstance node key\n * @public\n */\nexport interface ECInstancesNodeKey extends BaseNodeKey {\n type: StandardNodeTypes.ECInstancesNode;\n /** List of [[InstanceKey]] objects of ECInstances represented by the node */\n instanceKeys: InstanceKey[];\n}\n\n/**\n * Data structure that describes a grouping node key\n * @public\n */\nexport interface GroupingNodeKey extends BaseNodeKey {\n /**\n * Get the number of instances grouped by the node represented\n * by this key.\n *\n * **Note:** this property is just a helper and is not involved\n * in identifying a node.\n */\n groupedInstancesCount: number;\n}\n\n/**\n * Data structure that describes an ECClass grouping node key\n * @public\n */\nexport interface ECClassGroupingNodeKey extends GroupingNodeKey {\n type: StandardNodeTypes.ECClassGroupingNode;\n /** Full name of the grouping ECClass */\n className: string;\n}\n\n/**\n * Data structure that describes an ECProperty grouping node key\n * @public\n */\nexport interface ECPropertyGroupingNodeKey extends GroupingNodeKey {\n type: StandardNodeTypes.ECPropertyGroupingNode;\n /** Full name of the grouping ECProperty class */\n className: string;\n /** Name of the ECProperty */\n propertyName: string;\n /** Raw grouping values */\n groupingValues: any[];\n}\n\n/**\n * Data structure that describes a display label grouping node key\n * @public\n */\nexport interface LabelGroupingNodeKey extends GroupingNodeKey {\n type: StandardNodeTypes.DisplayLabelGroupingNode;\n /** Grouping display label */\n label: string;\n}\n\n/**\n * Data structure that describes a presentation query\n * @public\n */\nexport interface PresentationQuery {\n /** ECSQL query */\n query: string;\n /** The query bindings */\n bindings?: PresentationQueryBinding[];\n}\n\n/**\n * Defines an [[Id64String]] value binding.\n * @public\n */\nexport interface IdBinding {\n type: \"Id\";\n value: Id64String;\n}\n\n/**\n * Defines an [[IdSet]] value binding for use with `InVirtualSet` ECSQL function.\n * @public\n */\nexport interface IdSetBinding {\n type: \"IdSet\";\n value: Id64String[];\n}\n\n/**\n * Defines an EC value binding.\n * @public\n */\nexport interface ECValueBinding {\n type: \"ECValue\";\n valueType: string;\n valueTypeExtended?: string;\n value: any;\n}\n\n/**\n * Defines a binding for a list of EC values for use with `InVirtualSet` ECSQL function.\n * @public\n */\nexport interface ECValueSetBinding {\n type: \"ValueSet\";\n valueType: string;\n valueTypeExtended?: string;\n value: any[];\n}\n\n/**\n * One of the [[PresentationQuery]] binding types.\n * @public\n */\nexport type PresentationQueryBinding = IdBinding | IdSetBinding | ECValueBinding | ECValueSetBinding;\n"]}
|
|
1
|
+
{"version":3,"file":"Key.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Key.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,wDAAmC,CAAA;IACnC,gEAA2C,CAAA;IAC3C,sEAAiD,CAAA;IACjD,0EAAqD,CAAA;AACvD,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AASD;;;;GAIG;AACH,2DAA2D;AAC3D,MAAM,KAAW,OAAO,CAoFvB;AApFD,WAAiB,OAAO;IACtB,8DAA8D;IAC9D,SAAgB,kBAAkB,CAAC,GAAY;QAC7C,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,eAAe,CAAC;IACxD,CAAC;IAFe,0BAAkB,qBAEjC,CAAA;IAED,kEAAkE;IAClE,SAAgB,sBAAsB,CAAC,GAAY;QACjD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,mBAAmB,CAAC;IAC5D,CAAC;IAFe,8BAAsB,yBAErC,CAAA;IAED,qEAAqE;IACrE,SAAgB,yBAAyB,CAAC,GAAY;QACpD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,sBAAsB,CAAC;IAC/D,CAAC;IAFe,iCAAyB,4BAExC,CAAA;IAED,+DAA+D;IAC/D,SAAgB,sBAAsB,CAAC,GAAY;QACjD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,wBAAwB,CAAC;IACjE,CAAC;IAFe,8BAAsB,yBAErC,CAAA;IAED,wDAAwD;IACxD,SAAgB,iBAAiB,CAAC,GAAY;QAC5C,OAAO,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C,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACxE,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;YACpC,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC;QACzC,CAAC;QACD,IAAI,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;YACvC,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,YAAY,CAAC;QAClF,CAAC;QACD,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;YACpC,OAAO,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAhDe,cAAM,SAgDrB,CAAA;AACH,CAAC,EApFgB,OAAO,KAAP,OAAO,QAoFvB","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/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module Hierarchies\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"../EC.js\";\n\n/**\n * Standard node types\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport enum StandardNodeTypes {\n ECInstancesNode = \"ECInstancesNode\",\n ECClassGroupingNode = \"ECClassGroupingNode\",\n ECPropertyGroupingNode = \"ECPropertyGroupingNode\",\n DisplayLabelGroupingNode = \"DisplayLabelGroupingNode\",\n}\n\n/**\n * One of the node key types\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type NodeKey = BaseNodeKey | ECInstancesNodeKey | ECClassGroupingNodeKey | ECPropertyGroupingNodeKey | LabelGroupingNodeKey;\n/**\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace NodeKey {\n /** Checks if the supplied key is an [[ECInstancesNodeKey]] */\n export function isInstancesNodeKey(key: NodeKey): key is ECInstancesNodeKey {\n return key.type === StandardNodeTypes.ECInstancesNode;\n }\n\n /** Checks if the supplied key is an [[ECClassGroupingNodeKey]] */\n export function isClassGroupingNodeKey(key: NodeKey): key is ECClassGroupingNodeKey {\n return key.type === StandardNodeTypes.ECClassGroupingNode;\n }\n\n /** Checks if the supplied key is an [[ECPropertyGroupingNodeKey]] */\n export function isPropertyGroupingNodeKey(key: NodeKey): key is ECPropertyGroupingNodeKey {\n return key.type === StandardNodeTypes.ECPropertyGroupingNode;\n }\n\n /** Checks if the supplied key is a [[LabelGroupingNodeKey]] */\n export function isLabelGroupingNodeKey(key: NodeKey): key is LabelGroupingNodeKey {\n return key.type === StandardNodeTypes.DisplayLabelGroupingNode;\n }\n\n /** Checks if the supplied key is a grouping node key */\n export function isGroupingNodeKey(key: NodeKey): key is GroupingNodeKey {\n return isClassGroupingNodeKey(key) || isPropertyGroupingNodeKey(key) || isLabelGroupingNodeKey(key);\n }\n\n /**\n * Checks if two given node keys are equal, taking their versions into account.\n *\n * When comparing two keys of the same version, the algorithm uses [[NodeKey.pathFromRoot]] array\n * which is the most accurate way of checking equality. However, when version are different,\n * [[NodeKey.pathFromRoot]] array may contain different strings even though keys represent the same node.\n * In that case equality is checked using other key attributes, depending on the type of the node (type,\n * label, grouping class, property name, etc.).\n */\n export function equals(lhs: NodeKey, rhs: NodeKey): boolean {\n // types must always be equal\n if (lhs.type !== rhs.type) {\n return false;\n }\n\n // `pathFromRoot` lengths must always be equal\n if (lhs.pathFromRoot.length !== rhs.pathFromRoot.length) {\n return false;\n }\n\n // when versions are equal, compare using contents of `pathFromRoot` array\n if (lhs.version === rhs.version) {\n for (let i = 0; i < lhs.pathFromRoot.length; ++i) {\n if (lhs.pathFromRoot[i] !== rhs.pathFromRoot[i]) {\n return false;\n }\n }\n return true;\n }\n\n // when versions aren't equal, compare using other key information, because key hashes\n // of different key versions can't be compared\n if (isInstancesNodeKey(lhs)) {\n assert(isInstancesNodeKey(rhs));\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return false;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n if (0 !== InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i])) {\n return false;\n }\n }\n return true;\n }\n if (isClassGroupingNodeKey(lhs)) {\n assert(isClassGroupingNodeKey(rhs));\n return lhs.className === rhs.className;\n }\n if (isPropertyGroupingNodeKey(lhs)) {\n assert(isPropertyGroupingNodeKey(rhs));\n return lhs.className === rhs.className && lhs.propertyName === rhs.propertyName;\n }\n if (isLabelGroupingNodeKey(lhs)) {\n assert(isLabelGroupingNodeKey(rhs));\n return lhs.label === rhs.label;\n }\n return true;\n }\n}\n\n/**\n * Node key path. Can be used to define path from one node to another.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type NodeKeyPath = NodeKey[];\n\n/**\n * Data structure that describes a basic node key\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface BaseNodeKey {\n /** Node type */\n type: string;\n\n /**\n * Version of the key. Different versions suggest that node keys were created by two different\n * versions of the library. In that case, keys representing the same node may be different.\n */\n version: number;\n\n /** Node hash path from root to the node whose key this is */\n pathFromRoot: string[];\n\n /** Query that returns all selected instance keys */\n instanceKeysSelectQuery?: PresentationQuery;\n}\n\n/**\n * Data structure that describes a node ECInstance node key\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface ECInstancesNodeKey extends BaseNodeKey {\n type: StandardNodeTypes.ECInstancesNode;\n /** List of [[InstanceKey]] objects of ECInstances represented by the node */\n instanceKeys: InstanceKey[];\n}\n\n/**\n * Data structure that describes a grouping node key\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface GroupingNodeKey extends BaseNodeKey {\n /**\n * Get the number of instances grouped by the node represented\n * by this key.\n *\n * **Note:** this property is just a helper and is not involved\n * in identifying a node.\n */\n groupedInstancesCount: number;\n}\n\n/**\n * Data structure that describes an ECClass grouping node key\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface ECClassGroupingNodeKey extends GroupingNodeKey {\n type: StandardNodeTypes.ECClassGroupingNode;\n /** Full name of the grouping ECClass */\n className: string;\n}\n\n/**\n * Data structure that describes an ECProperty grouping node key\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface ECPropertyGroupingNodeKey extends GroupingNodeKey {\n type: StandardNodeTypes.ECPropertyGroupingNode;\n /** Full name of the grouping ECProperty class */\n className: string;\n /** Name of the ECProperty */\n propertyName: string;\n /** Raw grouping values */\n groupingValues: any[];\n}\n\n/**\n * Data structure that describes a display label grouping node key\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface LabelGroupingNodeKey extends GroupingNodeKey {\n type: StandardNodeTypes.DisplayLabelGroupingNode;\n /** Grouping display label */\n label: string;\n}\n\n/**\n * Data structure that describes a presentation query\n * @public\n */\nexport interface PresentationQuery {\n /** ECSQL query */\n query: string;\n /** The query bindings */\n bindings?: PresentationQueryBinding[];\n}\n\n/**\n * Defines an [[Id64String]] value binding.\n * @public\n */\nexport interface IdBinding {\n type: \"Id\";\n value: Id64String;\n}\n\n/**\n * Defines an [[IdSet]] value binding for use with `InVirtualSet` ECSQL function.\n * @public\n */\nexport interface IdSetBinding {\n type: \"IdSet\";\n value: Id64String[];\n}\n\n/**\n * Defines an EC value binding.\n * @public\n */\nexport interface ECValueBinding {\n type: \"ECValue\";\n valueType: string;\n valueTypeExtended?: string;\n value: any;\n}\n\n/**\n * Defines a binding for a list of EC values for use with `InVirtualSet` ECSQL function.\n * @public\n */\nexport interface ECValueSetBinding {\n type: \"ValueSet\";\n valueType: string;\n valueTypeExtended?: string;\n value: any[];\n}\n\n/**\n * One of the [[PresentationQuery]] binding types.\n * @public\n */\nexport type PresentationQueryBinding = IdBinding | IdSetBinding | ECValueBinding | ECValueSetBinding;\n"]}
|
|
@@ -6,6 +6,8 @@ import { NodeKey } from "./Key.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Data structure that describes a tree node.
|
|
8
8
|
* @public
|
|
9
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
10
|
+
* package for creating hierarchies.
|
|
9
11
|
*/
|
|
10
12
|
export interface Node {
|
|
11
13
|
/** A key that uniquely identifies a node. */
|
|
@@ -41,6 +43,8 @@ export interface Node {
|
|
|
41
43
|
/**
|
|
42
44
|
* Partial node definition.
|
|
43
45
|
* @public
|
|
46
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
47
|
+
* package for creating hierarchies.
|
|
44
48
|
*/
|
|
45
49
|
export type PartialNode = AllOrNone<Partial<Node>, "key" | "label">;
|
|
46
50
|
type AllOrNone<T, P extends keyof T> = Omit<T, P> & ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Node.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,WAAW,IAAI;IACnB,6CAA6C;IAC7C,GAAG,EAAE,OAAO,CAAC;IACb,uCAAuC;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4CAA4C;IAC5C,YAAY,CAAC,EAAE;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;AAEpE,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK;CAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module Hierarchies
|
|
7
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Node.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 Hierarchies\n */\n\nimport { LabelDefinition } from \"../LabelDefinition.js\";\nimport { NodeKey } from \"./Key.js\";\n\n/**\n * Data structure that describes a tree node.\n * @public\n */\nexport interface Node {\n /** A key that uniquely identifies a node. */\n key: NodeKey;\n /** Definition of node display label */\n label: LabelDefinition;\n /** Extensive description */\n description?: string;\n /**\n * Image ID\n * @deprecated in 3.3.0 - might be removed in next major version. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. Will\n * be removed with [[PropertyGroup.imageId]] and [[PropertyRangeGroupSpecification.imageId]].\n */\n imageId?: string;\n /** Does this node have child nodes */\n hasChildren?: boolean;\n /** Is this node selectable */\n isSelectionDisabled?: boolean;\n /** Is this node editable */\n isEditable?: boolean;\n /** Is this node expanded */\n isExpanded?: boolean;\n /**\n * Identifies whether the hierarchy level below this node supports filtering. If not, requesting either a hierarchy level descriptor or\n * a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.\n */\n supportsFiltering?: boolean;\n /** Extended data injected into this node */\n extendedData?: {\n [key: string]: any;\n };\n}\n\n/**\n * Partial node definition.\n * @public\n */\nexport type PartialNode = AllOrNone<Partial<Node>, \"key\" | \"label\">;\n\ntype AllOrNone<T, P extends keyof T> = Omit<T, P> & ({ [K in P]?: never } | Required<Pick<T, P>>);\n"]}
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/Node.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;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/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module Hierarchies\n */\n\nimport { LabelDefinition } from \"../LabelDefinition.js\";\nimport { NodeKey } from \"./Key.js\";\n\n/**\n * Data structure that describes a tree node.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface Node {\n /** A key that uniquely identifies a node. */\n key: NodeKey;\n /** Definition of node display label */\n label: LabelDefinition;\n /** Extensive description */\n description?: string;\n /**\n * Image ID\n * @deprecated in 3.3.0 - might be removed in next major version. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. Will\n * be removed with [[PropertyGroup.imageId]] and [[PropertyRangeGroupSpecification.imageId]].\n */\n imageId?: string;\n /** Does this node have child nodes */\n hasChildren?: boolean;\n /** Is this node selectable */\n isSelectionDisabled?: boolean;\n /** Is this node editable */\n isEditable?: boolean;\n /** Is this node expanded */\n isExpanded?: boolean;\n /**\n * Identifies whether the hierarchy level below this node supports filtering. If not, requesting either a hierarchy level descriptor or\n * a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.\n */\n supportsFiltering?: boolean;\n /** Extended data injected into this node */\n extendedData?: {\n [key: string]: any;\n };\n}\n\n/**\n * Partial node definition.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type PartialNode = AllOrNone<Partial<Node>, \"key\" | \"label\">;\n\ntype AllOrNone<T, P extends keyof T> = Omit<T, P> & ({ [K in P]?: never } | Required<Pick<T, P>>);\n"]}
|
|
@@ -5,6 +5,8 @@ import { Node } from "./Node.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Describes a single step in the nodes path.
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
9
|
+
* package for creating hierarchies.
|
|
8
10
|
*/
|
|
9
11
|
export interface NodePathElement {
|
|
10
12
|
/** Node instance */
|
|
@@ -21,6 +23,8 @@ export interface NodePathElement {
|
|
|
21
23
|
/**
|
|
22
24
|
* Data related to node hierarchy filtering
|
|
23
25
|
* @public
|
|
26
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
27
|
+
* package for creating hierarchies.
|
|
24
28
|
*/
|
|
25
29
|
export interface NodePathFilteringData {
|
|
26
30
|
/** Number of filter matches in the current element */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodePathElement.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/NodePathElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodePathElement.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/NodePathElement.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,+CAA+C;IAC/C,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module Hierarchies
|
|
7
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodePathElement.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/NodePathElement.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 Hierarchies\n */\n\nimport { Node } from \"./Node.js\";\n\n/**\n * Describes a single step in the nodes path.\n * @public\n */\nexport interface NodePathElement {\n /** Node instance */\n node: Node;\n /** Node index */\n index: number;\n /** Is this element part of the marked path */\n isMarked?: boolean;\n /** Child path elements */\n children: NodePathElement[];\n /** Additional filtering-related information */\n filteringData?: NodePathFilteringData;\n}\n\n/**\n * Data related to node hierarchy filtering\n * @public\n */\nexport interface NodePathFilteringData {\n /** Number of filter matches in the current element */\n matchesCount: number;\n /** Number of filter matches in the current element's children (recursively) */\n childMatchesCount: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NodePathElement.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/NodePathElement.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;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/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module Hierarchies\n */\n\nimport { Node } from \"./Node.js\";\n\n/**\n * Describes a single step in the nodes path.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NodePathElement {\n /** Node instance */\n node: Node;\n /** Node index */\n index: number;\n /** Is this element part of the marked path */\n isMarked?: boolean;\n /** Child path elements */\n children: NodePathElement[];\n /** Additional filtering-related information */\n filteringData?: NodePathFilteringData;\n}\n\n/**\n * Data related to node hierarchy filtering\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NodePathFilteringData {\n /** Number of filter matches in the current element */\n matchesCount: number;\n /** Number of filter matches in the current element's children (recursively) */\n childMatchesCount: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/rules/Rule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/rules/Rule.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC;IAEzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,2BAA2B,EAAE,CAAC;CACjD;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,MAAM,IAAI,GAAG,iBAAiB,GAAG,cAAc,GAAG,WAAW,GAAG,eAAe,GAAG,+BAA+B,CAAC;AAEhI;;;GAGG;AACH,oBAAY,SAAS;IAEnB,SAAS,cAAc;IACvB,UAAU,eAAe;IAGzB,OAAO,YAAY;IACnB,eAAe,oBAAoB,CAAE,mDAAmD;IACxF,+BAA+B,oCAAoC,CAAE,mDAAmD;IAGxH,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,qBAAqB,0BAA0B;IAC/C,aAAa,kBAAkB;IAC/B,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;CAC9B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module PresentationRules
|
|
7
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../src/presentation-common/rules/Rule.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AA8CH;;;GAGG;AACH,MAAM,CAAN,IAAY,SAqBX;AArBD,WAAY,SAAS;IACnB,kBAAkB;IAClB,oCAAuB,CAAA;IACvB,sCAAyB,CAAA;IAEzB,gBAAgB;IAChB,gCAAmB,CAAA;IACnB,gDAAmC,CAAA;IACnC,gFAAmE,CAAA;IAEnE,sBAAsB;IACtB,kCAAqB,CAAA;IACrB,gDAAmC,CAAA;IACnC,gDAAmC,CAAA;IACnC,4CAA+B,CAAA;IAC/B,4DAA+C,CAAA;IAC/C,4CAA+B,CAAA;IAC/B,kCAAqB,CAAA;IACrB,gDAAmC,CAAA;IACnC,4CAA+B,CAAA;IAC/B,0CAA6B,CAAA;AAC/B,CAAC,EArBW,SAAS,KAAT,SAAS,QAqBpB","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 PresentationRules\n */\n\nimport { ContentRule } from \"./content/ContentRule.js\";\nimport { DefaultPropertyCategoryOverride } from \"./content/DefaultPropertyCategoryOverride.js\";\nimport { ContentModifier } from \"./content/modifiers/ContentModifier.js\";\nimport { CustomizationRule } from \"./customization/CustomizationRule.js\";\nimport { NavigationRule } from \"./hierarchy/NavigationRule.js\";\nimport { RequiredSchemaSpecification } from \"./SchemasSpecification.js\";\n\n/**\n * Base interface for all [[Rule]] implementations.\n * @public\n */\nexport interface RuleBase {\n /**\n * Used for serializing to JSON.\n * @see RuleTypes\n */\n ruleType: `${RuleTypes}`;\n\n /**\n * Defines the order in which rules are handled, higher number means the rule is handled first. If priorities are\n * equal, the rules are handled in the order they're defined.\n *\n * @type integer\n */\n priority?: number;\n\n /**\n * Tells the library that the rule should only be handled if no other rule of the same type was handled previously (based on rule\n * priorities and definition order). This allows adding fallback rules which can be overriden by higher-priority rules.\n */\n onlyIfNotHandled?: boolean;\n\n /**\n * A list of [ECSchema requirements]($docs/presentation/RequiredSchemaSpecification.md) that need to be met for the rule to be used.\n */\n requiredSchemas?: RequiredSchemaSpecification[];\n}\n\n/**\n * A union of all presentation rule types.\n * @public\n */\nexport declare type Rule = CustomizationRule | NavigationRule | ContentRule | ContentModifier | DefaultPropertyCategoryOverride;\n\n/**\n * Used for serializing [[Rule]] objects to JSON.\n * @public\n */\nexport enum RuleTypes {\n // hierarchy rules\n RootNodes = \"RootNodes\",\n ChildNodes = \"ChildNodes\",\n\n // content rules\n Content = \"Content\",\n ContentModifier = \"ContentModifier\", // eslint-disable-line @typescript-eslint/no-shadow\n DefaultPropertyCategoryOverride = \"DefaultPropertyCategoryOverride\", // eslint-disable-line @typescript-eslint/no-shadow\n\n // customization rules\n Grouping = \"Grouping\",\n PropertySorting = \"PropertySorting\",\n DisabledSorting = \"DisabledSorting\",\n NodeArtifacts = \"NodeArtifacts\",\n InstanceLabelOverride = \"InstanceLabelOverride\",\n LabelOverride = \"LabelOverride\",\n CheckBox = \"CheckBox\",\n ImageIdOverride = \"ImageIdOverride\",\n StyleOverride = \"StyleOverride\",\n ExtendedData = \"ExtendedData\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../src/presentation-common/rules/Rule.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG;AA8CH;;;GAGG;AACH,MAAM,CAAN,IAAY,SAqBX;AArBD,WAAY,SAAS;IACnB,kBAAkB;IAClB,oCAAuB,CAAA;IACvB,sCAAyB,CAAA;IAEzB,gBAAgB;IAChB,gCAAmB,CAAA;IACnB,gDAAmC,CAAA;IACnC,gFAAmE,CAAA;IAEnE,sBAAsB;IACtB,kCAAqB,CAAA;IACrB,gDAAmC,CAAA;IACnC,gDAAmC,CAAA;IACnC,4CAA+B,CAAA;IAC/B,4DAA+C,CAAA;IAC/C,4CAA+B,CAAA;IAC/B,kCAAqB,CAAA;IACrB,gDAAmC,CAAA;IACnC,4CAA+B,CAAA;IAC/B,0CAA6B,CAAA;AAC/B,CAAC,EArBW,SAAS,KAAT,SAAS,QAqBpB","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/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { ContentRule } from \"./content/ContentRule.js\";\nimport { DefaultPropertyCategoryOverride } from \"./content/DefaultPropertyCategoryOverride.js\";\nimport { ContentModifier } from \"./content/modifiers/ContentModifier.js\";\nimport { CustomizationRule } from \"./customization/CustomizationRule.js\";\nimport { NavigationRule } from \"./hierarchy/NavigationRule.js\";\nimport { RequiredSchemaSpecification } from \"./SchemasSpecification.js\";\n\n/**\n * Base interface for all [[Rule]] implementations.\n * @public\n */\nexport interface RuleBase {\n /**\n * Used for serializing to JSON.\n * @see RuleTypes\n */\n ruleType: `${RuleTypes}`;\n\n /**\n * Defines the order in which rules are handled, higher number means the rule is handled first. If priorities are\n * equal, the rules are handled in the order they're defined.\n *\n * @type integer\n */\n priority?: number;\n\n /**\n * Tells the library that the rule should only be handled if no other rule of the same type was handled previously (based on rule\n * priorities and definition order). This allows adding fallback rules which can be overriden by higher-priority rules.\n */\n onlyIfNotHandled?: boolean;\n\n /**\n * A list of [ECSchema requirements]($docs/presentation/RequiredSchemaSpecification.md) that need to be met for the rule to be used.\n */\n requiredSchemas?: RequiredSchemaSpecification[];\n}\n\n/**\n * A union of all presentation rule types.\n * @public\n */\nexport declare type Rule = CustomizationRule | NavigationRule | ContentRule | ContentModifier | DefaultPropertyCategoryOverride;\n\n/**\n * Used for serializing [[Rule]] objects to JSON.\n * @public\n */\nexport enum RuleTypes {\n // hierarchy rules\n RootNodes = \"RootNodes\",\n ChildNodes = \"ChildNodes\",\n\n // content rules\n Content = \"Content\",\n ContentModifier = \"ContentModifier\", // eslint-disable-line @typescript-eslint/no-shadow\n DefaultPropertyCategoryOverride = \"DefaultPropertyCategoryOverride\", // eslint-disable-line @typescript-eslint/no-shadow\n\n // customization rules\n Grouping = \"Grouping\",\n PropertySorting = \"PropertySorting\",\n DisabledSorting = \"DisabledSorting\",\n NodeArtifacts = \"NodeArtifacts\",\n InstanceLabelOverride = \"InstanceLabelOverride\",\n LabelOverride = \"LabelOverride\",\n CheckBox = \"CheckBox\",\n ImageIdOverride = \"ImageIdOverride\",\n StyleOverride = \"StyleOverride\",\n ExtendedData = \"ExtendedData\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomizationRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/CustomizationRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomizationRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/CustomizationRule.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,MAAM,iBAAiB,GAAG,qBAAqB,GAAG,YAAY,GAAG,WAAW,GAAG,gBAAgB,GAAG,iBAAiB,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module PresentationRules
|
|
7
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomizationRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/CustomizationRule.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 PresentationRules\n */\n\nimport { NodeArtifactsRule } from \"../hierarchy/NodeArtifactsRule.js\";\nimport { ExtendedDataRule } from \"./ExtendedDataRule.js\";\nimport { GroupingRule } from \"./GroupingRule.js\";\nimport { InstanceLabelOverride } from \"./InstanceLabelOverride.js\";\nimport { SortingRule } from \"./SortingRule.js\";\n\n/**\n * Customization rules allow customizing each node or content item separately.\n * Most of the rules have a `condition` property which uses [ECExpressions]($docs/presentation/customization/ECExpressions.md)\n * for conditional rule filtering.\n *\n * **Nested customization rules:**\n *\n * Customization rules may be specified at ruleset level, in which case they're\n * applied to all content produced by the ruleset, or nested under navigation rules,\n * in which case they're applied only for nodes created by those rules.\n *\n * **Customization rule priorities:**\n *\n * Customization rules have a `priority` attribute which defines the order in which they're applied. If priorities match,\n * rules engine looks at the nesting level - the deeper the rule is nested, the higher is its `priority`.\n * If the nesting levels also match, the rule defined first wins.\n *\n * @public\n */\nexport declare type CustomizationRule = InstanceLabelOverride | GroupingRule | SortingRule | ExtendedDataRule | NodeArtifactsRule;\n"]}
|
|
1
|
+
{"version":3,"file":"CustomizationRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/CustomizationRule.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;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/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { NodeArtifactsRule } from \"../hierarchy/NodeArtifactsRule.js\";\nimport { ExtendedDataRule } from \"./ExtendedDataRule.js\";\nimport { GroupingRule } from \"./GroupingRule.js\";\nimport { InstanceLabelOverride } from \"./InstanceLabelOverride.js\";\nimport { SortingRule } from \"./SortingRule.js\";\n\n/**\n * Customization rules allow customizing each node or content item separately.\n * Most of the rules have a `condition` property which uses [ECExpressions]($docs/presentation/customization/ECExpressions.md)\n * for conditional rule filtering.\n *\n * **Nested customization rules:**\n *\n * Customization rules may be specified at ruleset level, in which case they're\n * applied to all content produced by the ruleset, or nested under navigation rules,\n * in which case they're applied only for nodes created by those rules.\n *\n * **Customization rule priorities:**\n *\n * Customization rules have a `priority` attribute which defines the order in which they're applied. If priorities match,\n * rules engine looks at the nesting level - the deeper the rule is nested, the higher is its `priority`.\n * If the nesting levels also match, the rule defined first wins.\n *\n * @public\n */\nexport declare type CustomizationRule = InstanceLabelOverride | GroupingRule | SortingRule | ExtendedDataRule | NodeArtifactsRule;\n"]}
|
|
@@ -8,6 +8,8 @@ import { RuleBase } from "../Rule.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @see [Grouping rule reference documentation page]($docs/presentation/hierarchies/GroupingRule.md)
|
|
10
10
|
* @public
|
|
11
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
12
|
+
* package for creating hierarchies.
|
|
11
13
|
*/
|
|
12
14
|
export interface GroupingRule extends RuleBase {
|
|
13
15
|
/** Used for serializing to JSON. */
|
|
@@ -29,11 +31,15 @@ export interface GroupingRule extends RuleBase {
|
|
|
29
31
|
/**
|
|
30
32
|
* Grouping rule specifications.
|
|
31
33
|
* @public
|
|
34
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
35
|
+
* package for creating hierarchies.
|
|
32
36
|
*/
|
|
33
37
|
export declare type GroupingSpecification = ClassGroup | PropertyGroup | SameLabelInstanceGroup;
|
|
34
38
|
/**
|
|
35
39
|
* Available types of [[GroupingSpecification]].
|
|
36
40
|
* @public
|
|
41
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
42
|
+
* package for creating hierarchies.
|
|
37
43
|
*/
|
|
38
44
|
export declare enum GroupingSpecificationTypes {
|
|
39
45
|
Class = "Class",
|
|
@@ -45,6 +51,8 @@ export declare enum GroupingSpecificationTypes {
|
|
|
45
51
|
* meant to be used directly, see `GroupingSpecification`.
|
|
46
52
|
*
|
|
47
53
|
* @public
|
|
54
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
55
|
+
* package for creating hierarchies.
|
|
48
56
|
*/
|
|
49
57
|
export interface GroupingSpecificationBase {
|
|
50
58
|
/**
|
|
@@ -59,6 +67,8 @@ export interface GroupingSpecificationBase {
|
|
|
59
67
|
*
|
|
60
68
|
* @see [Base class grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#base-class-grouping)
|
|
61
69
|
* @public
|
|
70
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
71
|
+
* package for creating hierarchies.
|
|
62
72
|
*/
|
|
63
73
|
export interface ClassGroup extends GroupingSpecificationBase {
|
|
64
74
|
/** Used for serializing to JSON. */
|
|
@@ -78,6 +88,8 @@ export interface ClassGroup extends GroupingSpecificationBase {
|
|
|
78
88
|
*
|
|
79
89
|
* @see [Same label instance grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#same-label-instance-grouping)
|
|
80
90
|
* @public
|
|
91
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
92
|
+
* package for creating hierarchies.
|
|
81
93
|
*/
|
|
82
94
|
export interface SameLabelInstanceGroup extends GroupingSpecificationBase {
|
|
83
95
|
/** Used for serializing to JSON. */
|
|
@@ -99,6 +111,8 @@ export interface SameLabelInstanceGroup extends GroupingSpecificationBase {
|
|
|
99
111
|
/**
|
|
100
112
|
* Specifies hierarchy creation stages used to apply [[SameLabelInstanceGroup]] grouping.
|
|
101
113
|
* @public
|
|
114
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
115
|
+
* package for creating hierarchies.
|
|
102
116
|
*/
|
|
103
117
|
export declare enum SameLabelInstanceGroupApplicationStage {
|
|
104
118
|
/** Apply grouping at query stage. */
|
|
@@ -117,6 +131,8 @@ export declare enum SameLabelInstanceGroupApplicationStage {
|
|
|
117
131
|
*
|
|
118
132
|
* @see [Property grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#property-grouping)
|
|
119
133
|
* @public
|
|
134
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
135
|
+
* package for creating hierarchies.
|
|
120
136
|
*/
|
|
121
137
|
export interface PropertyGroup extends GroupingSpecificationBase {
|
|
122
138
|
/** Used for serializing to JSON. */
|
|
@@ -150,6 +166,8 @@ export interface PropertyGroup extends GroupingSpecificationBase {
|
|
|
150
166
|
*
|
|
151
167
|
* @see [Property range group specification documentation section]($docs/presentation/hierarchies/GroupingRule.md#attribute-ranges)
|
|
152
168
|
* @public
|
|
169
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
170
|
+
* package for creating hierarchies.
|
|
153
171
|
*/
|
|
154
172
|
export interface PropertyRangeGroupSpecification {
|
|
155
173
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroupingRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,oCAAoC;IACpC,QAAQ,EAAE,UAAU,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,wEAAwE;IACxE,KAAK,EAAE,8BAA8B,CAAC;IAEtC;;;OAGG;IACH,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED;;;;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W,+BAA+B;IAC9C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
5
6
|
/** @packageDocumentation
|
|
6
7
|
* @module PresentationRules
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
10
|
* Available types of [[GroupingSpecification]].
|
|
10
11
|
* @public
|
|
12
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
13
|
+
* package for creating hierarchies.
|
|
11
14
|
*/
|
|
12
15
|
export var GroupingSpecificationTypes;
|
|
13
16
|
(function (GroupingSpecificationTypes) {
|
|
@@ -18,6 +21,8 @@ export var GroupingSpecificationTypes;
|
|
|
18
21
|
/**
|
|
19
22
|
* Specifies hierarchy creation stages used to apply [[SameLabelInstanceGroup]] grouping.
|
|
20
23
|
* @public
|
|
24
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
25
|
+
* package for creating hierarchies.
|
|
21
26
|
*/
|
|
22
27
|
export var SameLabelInstanceGroupApplicationStage;
|
|
23
28
|
(function (SameLabelInstanceGroupApplicationStage) {
|