@itwin/presentation-common 5.4.0-dev.7 → 5.5.0-dev.2

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/lib/cjs/presentation-common/ElementProperties.d.ts +1 -1
  3. package/lib/cjs/presentation-common/ElementProperties.d.ts.map +1 -1
  4. package/lib/cjs/presentation-common/ElementProperties.js +11 -5
  5. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  6. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +22 -0
  7. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  8. package/lib/cjs/presentation-common/content/ContentTraverser.js +29 -15
  9. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  10. package/lib/cjs/presentation-common-internal.d.ts +1 -1
  11. package/lib/cjs/presentation-common-internal.d.ts.map +1 -1
  12. package/lib/cjs/presentation-common-internal.js +2 -2
  13. package/lib/cjs/presentation-common-internal.js.map +1 -1
  14. package/lib/cjs/presentation-common.d.ts +1 -1
  15. package/lib/cjs/presentation-common.d.ts.map +1 -1
  16. package/lib/cjs/presentation-common.js +3 -1
  17. package/lib/cjs/presentation-common.js.map +1 -1
  18. package/lib/esm/presentation-common/ElementProperties.d.ts +1 -1
  19. package/lib/esm/presentation-common/ElementProperties.d.ts.map +1 -1
  20. package/lib/esm/presentation-common/ElementProperties.js +10 -4
  21. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  22. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +22 -0
  23. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  24. package/lib/esm/presentation-common/content/ContentTraverser.js +28 -15
  25. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  26. package/lib/esm/presentation-common-internal.d.ts +1 -1
  27. package/lib/esm/presentation-common-internal.d.ts.map +1 -1
  28. package/lib/esm/presentation-common-internal.js +1 -1
  29. package/lib/esm/presentation-common-internal.js.map +1 -1
  30. package/lib/esm/presentation-common.d.ts +1 -1
  31. package/lib/esm/presentation-common.d.ts.map +1 -1
  32. package/lib/esm/presentation-common.js +1 -1
  33. package/lib/esm/presentation-common.js.map +1 -1
  34. package/package.json +11 -11
@@ -49,7 +49,7 @@ export { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from "
49
49
  export { RendererDescription } from "./presentation-common/content/Renderer.js";
50
50
  export { PropertyValueFormat, PrimitiveTypeDescription, ArrayTypeDescription, StructFieldMemberDescription, StructTypeDescription, TypeDescription, } from "./presentation-common/content/TypeDescription.js";
51
51
  export { Value, ValuesMap, ValuesArray, DisplayValue, DisplayValuesMap, DisplayValuesArray, NestedContentValue, NavigationPropertyValue, DisplayValueGroup, } from "./presentation-common/content/Value.js";
52
- export { FieldHierarchy, StartContentProps, ProcessFieldHierarchiesProps, StartItemProps, StartCategoryProps, StartFieldProps, StartStructProps, StartArrayProps, ProcessMergedValueProps, ProcessPrimitiveValueProps, IContentVisitor, traverseFieldHierarchy, traverseContent, traverseContentItem, createFieldHierarchies, addFieldHierarchy, combineFieldNames, parseCombinedFieldNames, } from "./presentation-common/content/ContentTraverser.js";
52
+ export { FieldHierarchy, StartContentProps, ProcessFieldHierarchiesProps, StartItemProps, StartCategoryProps, StartFieldProps, StartStructProps, StartArrayProps, ProcessMergedValueProps, ProcessPrimitiveValueProps, IContentVisitor, traverseFieldHierarchy, traverseContent, traverseContentItem, createContentTraverser, createFieldHierarchies, addFieldHierarchy, combineFieldNames, parseCombinedFieldNames, } from "./presentation-common/content/ContentTraverser.js";
53
53
  export { createContentFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
54
54
  export { ElementProperties, ElementPropertiesCategoryItem, ElementPropertiesPrimitivePropertyItem, ElementPropertiesPrimitiveArrayPropertyItem, ElementPropertiesStructArrayPropertyItem, ElementPropertiesArrayPropertyItem, ElementPropertiesStructPropertyItem, ElementPropertiesPropertyValueType, ElementPropertiesPropertyItem, ElementPropertiesItem, } from "./presentation-common/ElementProperties.js";
55
55
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,wCAAwC,EACxC,4CAA4C,EAC5C,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC/G,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,sCAAsC,EACtC,4CAA4C,EAC5C,mCAAmC,EACnC,4BAA4B,EAC5B,+BAA+B,EAC/B,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,qCAAqC,EACrC,2CAA2C,EAC3C,yCAAyC,EACzC,oCAAoC,EACpC,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B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uD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,oEAAoE,CAAC;AACnF,cAAc,0DAA0D,CAAC;AACzE,cAAc,uFAAuF,CAAC;AACtG,cAAc,6EAA6E,CAAC;AAC5F,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,wEAAwE,CAAC;AACvF,cAAc,oFAAoF,CAAC;AACnG,cAAc,kEAAkE,CAAC;AACjF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,+EAA+E,CAAC;AAC9F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iFAAiF,CAAC;AAChG,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC"}
1
+ {"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,g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CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC"}
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.NodeKey = exports.StandardNodeTypes = exports.createContentFormatter = exports.parseCombinedFieldNames = exports.combineFieldNames = exports.addFieldHierarchy = exports.createFieldHierarchies = exports.traverseContentItem = exports.traverseContent = exports.traverseFieldHierarchy = exports.DisplayValue = exports.Value = exports.PropertyValueFormat = exports.Property = exports.Item = exports.FieldDescriptor = exports.FieldDescriptorType = exports.NestedContentField = exports.StructPropertiesField = exports.ArrayPropertiesField = exports.PropertiesField = exports.Field = exports.DefaultContentDisplayTypes = exports.Descriptor = exports.SortDirection = exports.ContentFlags = exports.SelectClassInfo = exports.Content = exports.CategoryDescription = exports.PresentationRpcInterface = exports.KoqPropertyValueFormatter = exports.getInstancesCount = exports.DEFAULT_KEYS_BATCH_SIZE = exports.UPDATE_FULL = exports.RulesetsFactory = exports.RulesetVariable = exports.VariableValueTypes = exports.RegisteredRuleset = exports.LabelDefinition = exports.KeySet = exports.Key = exports.PresentationError = exports.PresentationStatus = exports.RelationshipPath = exports.RelatedClassInfoWithOptionalRelationship = exports.RelatedClassInfo = exports.PropertyInfo = exports.NavigationPropertyInfo = exports.InstanceKey = exports.DiagnosticsLogEntry = void 0;
17
+ exports.StandardNodeTypes = exports.createContentFormatter = exports.parseCombinedFieldNames = exports.combineFieldNames = exports.addFieldHierarchy = exports.createFieldHierarchies = exports.createContentTraverser = exports.traverseContentItem = exports.traverseContent = exports.traverseFieldHierarchy = exports.DisplayValue = exports.Value = exports.PropertyValueFormat = exports.Property = exports.Item = exports.FieldDescriptor = exports.FieldDescriptorType = exports.NestedContentField = exports.StructPropertiesField = exports.ArrayPropertiesField = exports.PropertiesField = exports.Field = exports.DefaultContentDisplayTypes = exports.Descriptor = exports.SortDirection = exports.ContentFlags = exports.SelectClassInfo = exports.Content = exports.CategoryDescription = exports.PresentationRpcInterface = exports.KoqPropertyValueFormatter = exports.getInstancesCount = exports.DEFAULT_KEYS_BATCH_SIZE = exports.UPDATE_FULL = exports.RulesetsFactory = exports.RulesetVariable = exports.VariableValueTypes = exports.RegisteredRuleset = exports.LabelDefinition = exports.KeySet = exports.Key = exports.PresentationError = exports.PresentationStatus = exports.RelationshipPath = exports.RelatedClassInfoWithOptionalRelationship = exports.RelatedClassInfo = exports.PropertyInfo = exports.NavigationPropertyInfo = exports.InstanceKey = exports.DiagnosticsLogEntry = void 0;
18
+ exports.NodeKey = void 0;
18
19
  /*---------------------------------------------------------------------------------------------
19
20
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
20
21
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -103,6 +104,7 @@ var ContentTraverser_js_1 = require("./presentation-common/content/ContentTraver
103
104
  Object.defineProperty(exports, "traverseFieldHierarchy", { enumerable: true, get: function () { return ContentTraverser_js_1.traverseFieldHierarchy; } });
104
105
  Object.defineProperty(exports, "traverseContent", { enumerable: true, get: function () { return ContentTraverser_js_1.traverseContent; } });
105
106
  Object.defineProperty(exports, "traverseContentItem", { enumerable: true, get: function () { return ContentTraverser_js_1.traverseContentItem; } });
107
+ Object.defineProperty(exports, "createContentTraverser", { enumerable: true, get: function () { return ContentTraverser_js_1.createContentTraverser; } });
106
108
  Object.defineProperty(exports, "createFieldHierarchies", { enumerable: true, get: function () { return ContentTraverser_js_1.createFieldHierarchies; } });
107
109
  Object.defineProperty(exports, "addFieldHierarchy", { enumerable: true, get: function () { return ContentTraverser_js_1.addFieldHierarchy; } });
108
110
  Object.defineProperty(exports, "combineFieldNames", { enumerable: true, get: function () { return ContentTraverser_js_1.combineFieldNames; } });
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,uEAW8C;AAD5C,qHAAA,mBAAmB,OAAA;AAErB,qDAyBqC;AAtBnC,oGAAA,WAAW,OAAA;AAMX,+GAAA,sBAAsB,OAAA;AAEtB,qGAAA,YAAY,OAAA;AAMZ,yGAAA,gBAAgB,OAAA;AAEhB,iIAAA,wCAAwC,OAAA;AAExC,yGAAA,gBAAgB,OAAA;AAKlB,2DAAuF;AAA9E,8GAAA,kBAAkB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAC9C,6DAAgF;AAAvE,gGAAA,GAAG,OAAA;AAAoB,mGAAA,MAAM,OAAA;AACtC,+EAA+G;AAAlE,qHAAA,eAAe,OAAA;AA4B5D,mFAA+E;AAAtE,yHAAA,iBAAiB,OAAA;AAC1B,iFAamD;AAZjD,yHAAA,kBAAkB,OAAA;AASlB,sHAAA,eAAe,OAAA;AAIjB,+EAAgI;AAAvH,qHAAA,eAAe,OAAA;AACxB,6DAUyC;AATvC,wGAAA,WAAW,OAAA;AAUb,2DAAwJ;AAA/I,mHAAA,uBAAuB,OAAA;AAA8D,6GAAA,iBAAiB,OAAA;AAQ/G,mGAA4I;AAAtF,yIAAA,yBAAyB,OAAA;AAE/E;;;;;;GAMG;AACH,iGAqB2D;AADzD,uIAAA,wBAAwB,OAAA;AAW1B;;;;;GAKG;AACH,yEAAyG;AAAhG,kHAAA,mBAAmB,OAAA;AAC5B,uEAAgF;AAA1D,qGAAA,OAAO,OAAA;AAC7B,6EAUqD;AATnD,gHAAA,eAAe,OAAA;AAEf,6GAAA,YAAY,OAAA;AACZ,8GAAA,aAAa,OAAA;AAKb,2GAAA,UAAU,OAAA;AAEZ,iFAA2F;AAAlF,6HAAA,0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,+FAA6E;AAC7E,sEAAoD;AACpD,yEAAuD;AACvD,sFAAoE;AACpE,2EAAyD","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/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport { createContentFormatter } from \"./presentation-common/content/PropertyValueFormatter.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
1
+ {"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,uEAW8C;AAD5C,qHAAA,mBAAmB,OAAA;AAErB,qDAyBqC;AAtBnC,oGAAA,WAAW,OAAA;AAMX,+GAAA,sBAAsB,OAAA;AAEtB,qGAAA,YAAY,OAAA;AAMZ,yGAAA,gBAAgB,OAAA;AAEhB,iIAAA,wCAAwC,OAAA;AAExC,yGAAA,gBAAgB,OAAA;AAKlB,2DAAuF;AAA9E,8GAAA,kBAAkB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAC9C,6DAAgF;AAAvE,gGAAA,GAAG,OAAA;AAAoB,mGAAA,MAAM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;AACtB,wHAAA,iBAAiB,OAAA;AACjB,wHAAA,iBAAiB,OAAA;AACjB,8HAAA,uBAAuB,OAAA;AAEzB,qGAAiG;AAAxF,mIAAA,sBAAsB,OAAA;AAqB/B,iEAgBgD;AAf9C,2GAAA,iBAAiB,OAAA;AACjB,iGAAA,OAAO,OAAA;AAkBT;;;;;GAKG;AACH,kFAAkF;AAClF,yFAAuE;AACvE,kGAAgF;AAChF,mGAAiF;AACjF,iHAA+F;AAC/F,uHAAqG;AACrG,0FAAwE;AACxE,6FAA2E;AAC3E,6GAA2F;AAC3F,wFAAsE;AACtE,wFAAsE;AACtE,iGAA+E;AAC/E,gGAA8E;AAC9E,4FAA0E;AAC1E,qGAAmF;AACnF,2FAAyE;AACzE,wHAAsG;AACtG,8GAA4F;AAC5F,qFAAmE;AACnE,8FAA4E;AAC5E,+FAA6E;AAC7E,4GAA0F;AAC1F,yGAAuF;AACvF,qHAAmG;AACnG,mGAAiF;AACjF,iHAA+F;AAC/F,gHAA8F;AAC9F,+GAA6F;AAC7F,kHAAgG;AAChG,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,+FAA6E;AAC7E,sEAAoD;AACpD,yEAAuD;AACvD,sFAAoE;AACpE,2EAAyD","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/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createContentTraverser,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport { createContentFormatter } from \"./presentation-common/content/PropertyValueFormatter.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
@@ -124,5 +124,5 @@ export type ElementPropertiesPropertyItem = ElementPropertiesPrimitivePropertyIt
124
124
  */
125
125
  export type ElementPropertiesItem = ElementPropertiesCategoryItem | ElementPropertiesPropertyItem;
126
126
  /** @internal */
127
- export declare const buildElementProperties: (descriptor: Descriptor, item: Item) => ElementProperties;
127
+ export declare const createElementPropertiesBuilder: () => ((descriptor: Descriptor, item: Item) => ElementProperties);
128
128
  //# sourceMappingURL=ElementProperties.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElementProperties.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/ElementProperties.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAe/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,EAAE,EAAE,UAAU,CAAC;IACf,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,KAAK,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAE,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,IAAI,EAAE,UAAU,GAAG,kCAAkC,CAAC;CACvD;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;IAC9E,mCAAmC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AAM,kCAAkC,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,sCAAsC,GAAG,kCAAkC,GAAG,mCAAmC,CAAC;AAE9J;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,6BAA6B,GAAG,6BAA6B,CAAC;AAElG,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,eAAgB,UAAU,QAAQ,IAAI,KAAG,iBAI3E,CAAC"}
1
+ {"version":3,"file":"ElementProperties.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/ElementProperties.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAe/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,EAAE,EAAE,UAAU,CAAC;IACf,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,KAAK,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAE,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,IAAI,EAAE,UAAU,GAAG,kCAAkC,CAAC;CACvD;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;IAC9E,mCAAmC;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAE,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,yBAAyB;IAClF,mCAAmC;IACnC,IAAI,EAAE,kC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AAElG,gBAAgB;AAChB,eAAO,MAAM,8BAA8B,QAAO,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,KAAK,iBAAiB,CAO3G,CAAC"}
@@ -6,13 +6,16 @@
6
6
  * @module RPC
7
7
  */
8
8
  import { assert, Id64 } from "@itwin/core-bentley";
9
- import { traverseContentItem, } from "./content/ContentTraverser.js";
9
+ import { createContentTraverser, } from "./content/ContentTraverser.js";
10
10
  import { PropertyValueFormat } from "./content/TypeDescription.js";
11
11
  /** @internal */
12
- export const buildElementProperties = (descriptor, item) => {
12
+ export const createElementPropertiesBuilder = () => {
13
13
  const builder = new ElementPropertiesBuilder();
14
- traverseContentItem(builder, descriptor, item);
15
- return builder.items[0];
14
+ const traverseContent = createContentTraverser(builder);
15
+ return (descriptor, item) => {
16
+ traverseContent(descriptor, [item]);
17
+ return builder.items[0];
18
+ };
16
19
  };
17
20
  class ElementPropertiesAppender {
18
21
  _item;
@@ -144,6 +147,9 @@ class ElementPropertiesBuilder {
144
147
  return appender;
145
148
  }
146
149
  startContent(_props) {
150
+ this._appendersStack = [];
151
+ this._items = [];
152
+ this._elementPropertiesAppender = undefined;
147
153
  return true;
148
154
  }
149
155
  finishContent() { }
@@ -1 +1 @@
1
- {"version":3,"file":"ElementProperties.js","sourceRoot":"","sources":["../../../src/presentation-common/ElementProperties.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAWL,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AA8HnE,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAsB,EAAE,IAAU,EAAqB,EAAE;IAC9F,MAAM,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAC/C,mBAAmB,CAAC,OAA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AK,EAAE,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IACM,qBAAqB,CAAC,KAAiC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,IAAI,EAAE,WAAW;YACjB,gEAAgE;YAChE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { CategoryDescription } from \"./content/Category.js\";\nimport {\n IContentVisitor,\n ProcessFieldHierarchiesProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n StartArrayProps,\n StartCategoryProps,\n StartContentProps,\n StartFieldProps,\n StartItemProps,\n StartStructProps,\n traverseContentItem,\n} from \"./content/ContentTraverser.js\";\nimport { Descriptor } from \"./content/Descriptor.js\";\nimport { Item } from \"./content/Item.js\";\nimport { PropertyValueFormat } from \"./content/TypeDescription.js\";\n\n/**\n * Data structure for storing element properties information in a simplified format.\n * @see [[Content]] for a format that stores all available element property data.\n * @public\n */\nexport interface ElementProperties {\n /** Label of element's ECClass. */\n class: string;\n /** Element's ID. */\n id: Id64String;\n /** Element's label. */\n label: string;\n /** Container of property values */\n items: { [label: string]: ElementPropertiesItem };\n}\n\n/**\n * Base type for all [[ElementPropertiesItem]] types.\n * @public\n */\nexport interface ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: \"category\" | ElementPropertiesPropertyValueType;\n}\n\n/**\n * Definition for a category. A category can nest other property items, including categories.\n * @public\n */\nexport interface ElementPropertiesCategoryItem extends ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: \"category\";\n /** Container of property values */\n items: { [label: string]: ElementPropertiesItem };\n}\n\n/**\n * Base type for all [[ElementPropertiesPropertyItem]] types.\n * @public\n */\nexport interface ElementPropertiesPropertyItemBase extends ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: ElementPropertiesPropertyValueType;\n}\n\n/**\n * Definition for a primitive property value.\n * @public\n */\nexport interface ElementPropertiesPrimitivePropertyItem extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"primitive\";\n /** Display value of the property. */\n value: string;\n}\n\n/**\n * Base type for all [[ElementPropertiesArrayPropertyItem]] types.\n * @public\n */\nexport interface ElementPropertiesArrayPropertyItemBase extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"array\";\n /** Type of values contained in this array. */\n valueType: \"primitive\" | \"struct\";\n}\n\n/**\n * Definition for a primitives' array property value.\n * @public\n */\nexport interface ElementPropertiesPrimitiveArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\n /** Type of values contained in this array. */\n valueType: \"primitive\";\n /** Array of display values. */\n values: string[];\n}\n\n/**\n * Definition for a structs' array property value.\n * @public\n */\nexport interface ElementPropertiesStructArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\n /** Type of values contained in this array. */\n valueType: \"struct\";\n /** Array of structs. */\n values: Array<{ [memberLabel: string]: ElementPropertiesPropertyItem }>;\n}\n\n/**\n * Definition for an array property value.\n * @public\n */\nexport type ElementPropertiesArrayPropertyItem = ElementPropertiesPrimitiveArrayPropertyItem | ElementPropertiesStructArrayPropertyItem;\n\n/**\n * Definition for an struct property value.\n * @public\n */\nexport interface ElementPropertiesStructPropertyItem extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"struct\";\n /** Container of struct members. */\n members: { [memberLabel: string]: ElementPropertiesPropertyItem };\n}\n\n/**\n * Available element property types.\n * @public\n */\nexport type ElementPropertiesPropertyValueType = \"primitive\" | \"array\" | \"struct\";\n\n/**\n * Definition of a property value.\n * @public\n */\nexport type ElementPropertiesPropertyItem = ElementPropertiesPrimitivePropertyItem | ElementPropertiesArrayPropertyItem | ElementPropertiesStructPropertyItem;\n\n/**\n * Definition of a property item, including a property category.\n * @public\n */\nexport type ElementPropertiesItem = ElementPropertiesCategoryItem | ElementPropertiesPropertyItem;\n\n/** @internal */\nexport const buildElementProperties = (descriptor: Descriptor, item: Item): ElementProperties => {\n const builder = new ElementPropertiesBuilder();\n traverseContentItem(builder, descriptor, item);\n return builder.items[0];\n};\n\ninterface IPropertiesAppender {\n append(label: string, item: ElementPropertiesItem): void;\n finish(): void;\n}\n\nclass ElementPropertiesAppender implements IPropertiesAppender {\n private _propertyItems: { [label: string]: ElementPropertiesItem } = {};\n private _categoryItemAppenders: { [categoryName: string]: IPropertiesAppender } = {};\n constructor(\n private _item: Item,\n private _onItemFinished: (item: ElementProperties) => void,\n ) {}\n\n public append(label: string, item: ElementPropertiesItem): void {\n this._propertyItems[label] = item;\n }\n\n public finish(): void {\n // eslint-disable-next-line guard-for-in\n for (const categoryName in this._categoryItemAppenders) {\n const appender = this._categoryItemAppenders[categoryName];\n appender.finish();\n }\n\n this._onItemFinished({\n class: this._item.classInfo?.label ?? \"\",\n id: this._item.primaryKeys[0]?.id ?? Id64.invalid,\n label: this._item.label.displayValue,\n items: this._propertyItems,\n });\n }\n\n public getCategoryAppender(parentAppender: IPropertiesAppender, category: CategoryDescription): IPropertiesAppender {\n let appender = this._categoryItemAppenders[category.name];\n if (!appender) {\n appender = new CategoryItemAppender(parentAppender, category);\n this._categoryItemAppenders[category.name] = appender;\n }\n return appender;\n }\n}\n\nclass CategoryItemAppender implements IPropertiesAppender {\n private _items: { [label: string]: ElementPropertiesItem } = {};\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _category: CategoryDescription,\n ) {}\n public append(label: string, item: ElementPropertiesItem): void {\n this._items[label] = item;\n }\n public finish(): void {\n if (Object.keys(this._items).length === 0) {\n return;\n }\n\n this._parentAppender.append(this._category.label, {\n type: \"category\",\n items: this._items,\n });\n }\n}\n\nclass ArrayItemAppender implements IPropertiesAppender {\n private _items: ElementPropertiesPropertyItem[] = [];\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _props: StartArrayProps,\n ) {}\n public append(_label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._items.push(item);\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Array);\n if (this._props.valueType.memberType.valueFormat === PropertyValueFormat.Primitive) {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());\n } else {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());\n }\n }\n private createPrimitivesArray(): ElementPropertiesPrimitiveArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"primitive\",\n values: this._items.map((item) => {\n assert(item.type === \"primitive\");\n return item.value;\n }),\n };\n }\n private createStructsArray(): ElementPropertiesStructArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"struct\",\n values: this._items.map((item) => {\n assert(item.type === \"struct\");\n return item.members;\n }),\n };\n }\n}\n\nclass StructItemAppender implements IPropertiesAppender {\n private _members: { [label: string]: ElementPropertiesPropertyItem } = {};\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _props: StartStructProps,\n ) {}\n public append(label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._members[label] = item;\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Struct);\n this._parentAppender.append(this._props.hierarchy.field.label, {\n type: \"struct\",\n members: this._members,\n });\n }\n}\n\nclass ElementPropertiesBuilder implements IContentVisitor {\n private _appendersStack: IPropertiesAppender[] = [];\n private _items: ElementProperties[] = [];\n private _elementPropertiesAppender: ElementPropertiesAppender | undefined;\n\n public get items(): ElementProperties[] {\n return this._items;\n }\n\n private get _currentAppender(): IPropertiesAppender {\n const appender = this._appendersStack[this._appendersStack.length - 1];\n assert(appender !== undefined);\n return appender;\n }\n\n public startContent(_props: StartContentProps): boolean {\n return true;\n }\n public finishContent(): void {}\n\n public processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void {}\n\n public startItem(props: StartItemProps): boolean {\n this._elementPropertiesAppender = new ElementPropertiesAppender(props.item, (item) => this._items.push(item));\n this._appendersStack.push(this._elementPropertiesAppender);\n return true;\n }\n public finishItem(): void {\n this._appendersStack.pop();\n assert(this._elementPropertiesAppender !== undefined);\n this._elementPropertiesAppender.finish();\n this._elementPropertiesAppender = undefined;\n }\n\n public startCategory(props: StartCategoryProps): boolean {\n assert(this._elementPropertiesAppender !== undefined);\n this._appendersStack.push(this._elementPropertiesAppender.getCategoryAppender(this._currentAppender, props.category));\n return true;\n }\n public finishCategory(): void {\n this._appendersStack.pop();\n }\n\n public startField(_props: StartFieldProps): boolean {\n return true;\n }\n public finishField(): void {}\n\n public startStruct(props: StartStructProps): boolean {\n this._appendersStack.push(new StructItemAppender(this._currentAppender, props));\n return true;\n }\n public finishStruct(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public startArray(props: StartArrayProps): boolean {\n this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));\n return true;\n }\n public finishArray(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public processMergedValue(props: ProcessMergedValueProps): void {\n this._currentAppender.append(props.mergedField.label, {\n type: \"primitive\",\n value: \"\",\n });\n }\n public processPrimitiveValue(props: ProcessPrimitiveValueProps): void {\n this._currentAppender.append(props.field.label, {\n type: \"primitive\",\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n value: props.displayValue?.toString() ?? \"\",\n });\n }\n}\n"]}
1
+ {"version":3,"file":"ElementProperties.js","sourceRoot":"","sources":["../../../src/presentation-common/ElementProperties.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EACL,sBAAsB,GAWvB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;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UAAU,CAAC,KAAsB;QACtC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW;QAChB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAG,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;IAEM,kBAAkB,CAAC,KAA8B;QACtD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;YACpD,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IACM,qBAAqB,CAAC,KAAiC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,IAAI,EAAE,WAAW;YACjB,gEAAgE;YAChE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { CategoryDescription } from \"./content/Category.js\";\nimport {\n createContentTraverser,\n IContentVisitor,\n ProcessFieldHierarchiesProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n StartArrayProps,\n StartCategoryProps,\n StartContentProps,\n StartFieldProps,\n StartItemProps,\n StartStructProps,\n} from \"./content/ContentTraverser.js\";\nimport { Descriptor } from \"./content/Descriptor.js\";\nimport { Item } from \"./content/Item.js\";\nimport { PropertyValueFormat } from \"./content/TypeDescription.js\";\n\n/**\n * Data structure for storing element properties information in a simplified format.\n * @see [[Content]] for a format that stores all available element property data.\n * @public\n */\nexport interface ElementProperties {\n /** Label of element's ECClass. */\n class: string;\n /** Element's ID. */\n id: Id64String;\n /** Element's label. */\n label: string;\n /** Container of property values */\n items: { [label: string]: ElementPropertiesItem };\n}\n\n/**\n * Base type for all [[ElementPropertiesItem]] types.\n * @public\n */\nexport interface ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: \"category\" | ElementPropertiesPropertyValueType;\n}\n\n/**\n * Definition for a category. A category can nest other property items, including categories.\n * @public\n */\nexport interface ElementPropertiesCategoryItem extends ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: \"category\";\n /** Container of property values */\n items: { [label: string]: ElementPropertiesItem };\n}\n\n/**\n * Base type for all [[ElementPropertiesPropertyItem]] types.\n * @public\n */\nexport interface ElementPropertiesPropertyItemBase extends ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: ElementPropertiesPropertyValueType;\n}\n\n/**\n * Definition for a primitive property value.\n * @public\n */\nexport interface ElementPropertiesPrimitivePropertyItem extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"primitive\";\n /** Display value of the property. */\n value: string;\n}\n\n/**\n * Base type for all [[ElementPropertiesArrayPropertyItem]] types.\n * @public\n */\nexport interface ElementPropertiesArrayPropertyItemBase extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"array\";\n /** Type of values contained in this array. */\n valueType: \"primitive\" | \"struct\";\n}\n\n/**\n * Definition for a primitives' array property value.\n * @public\n */\nexport interface ElementPropertiesPrimitiveArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\n /** Type of values contained in this array. */\n valueType: \"primitive\";\n /** Array of display values. */\n values: string[];\n}\n\n/**\n * Definition for a structs' array property value.\n * @public\n */\nexport interface ElementPropertiesStructArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\n /** Type of values contained in this array. */\n valueType: \"struct\";\n /** Array of structs. */\n values: Array<{ [memberLabel: string]: ElementPropertiesPropertyItem }>;\n}\n\n/**\n * Definition for an array property value.\n * @public\n */\nexport type ElementPropertiesArrayPropertyItem = ElementPropertiesPrimitiveArrayPropertyItem | ElementPropertiesStructArrayPropertyItem;\n\n/**\n * Definition for an struct property value.\n * @public\n */\nexport interface ElementPropertiesStructPropertyItem extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"struct\";\n /** Container of struct members. */\n members: { [memberLabel: string]: ElementPropertiesPropertyItem };\n}\n\n/**\n * Available element property types.\n * @public\n */\nexport type ElementPropertiesPropertyValueType = \"primitive\" | \"array\" | \"struct\";\n\n/**\n * Definition of a property value.\n * @public\n */\nexport type ElementPropertiesPropertyItem = ElementPropertiesPrimitivePropertyItem | ElementPropertiesArrayPropertyItem | ElementPropertiesStructPropertyItem;\n\n/**\n * Definition of a property item, including a property category.\n * @public\n */\nexport type ElementPropertiesItem = ElementPropertiesCategoryItem | ElementPropertiesPropertyItem;\n\n/** @internal */\nexport const createElementPropertiesBuilder = (): ((descriptor: Descriptor, item: Item) => ElementProperties) => {\n const builder = new ElementPropertiesBuilder();\n const traverseContent = createContentTraverser(builder);\n return (descriptor: Descriptor, item: Item) => {\n traverseContent(descriptor, [item]);\n return builder.items[0];\n };\n};\n\ninterface IPropertiesAppender {\n append(label: string, item: ElementPropertiesItem): void;\n finish(): void;\n}\n\nclass ElementPropertiesAppender implements IPropertiesAppender {\n private _propertyItems: { [label: string]: ElementPropertiesItem } = {};\n private _categoryItemAppenders: { [categoryName: string]: IPropertiesAppender } = {};\n constructor(\n private _item: Item,\n private _onItemFinished: (item: ElementProperties) => void,\n ) {}\n\n public append(label: string, item: ElementPropertiesItem): void {\n this._propertyItems[label] = item;\n }\n\n public finish(): void {\n // eslint-disable-next-line guard-for-in\n for (const categoryName in this._categoryItemAppenders) {\n const appender = this._categoryItemAppenders[categoryName];\n appender.finish();\n }\n\n this._onItemFinished({\n class: this._item.classInfo?.label ?? \"\",\n id: this._item.primaryKeys[0]?.id ?? Id64.invalid,\n label: this._item.label.displayValue,\n items: this._propertyItems,\n });\n }\n\n public getCategoryAppender(parentAppender: IPropertiesAppender, category: CategoryDescription): IPropertiesAppender {\n let appender = this._categoryItemAppenders[category.name];\n if (!appender) {\n appender = new CategoryItemAppender(parentAppender, category);\n this._categoryItemAppenders[category.name] = appender;\n }\n return appender;\n }\n}\n\nclass CategoryItemAppender implements IPropertiesAppender {\n private _items: { [label: string]: ElementPropertiesItem } = {};\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _category: CategoryDescription,\n ) {}\n public append(label: string, item: ElementPropertiesItem): void {\n this._items[label] = item;\n }\n public finish(): void {\n if (Object.keys(this._items).length === 0) {\n return;\n }\n\n this._parentAppender.append(this._category.label, {\n type: \"category\",\n items: this._items,\n });\n }\n}\n\nclass ArrayItemAppender implements IPropertiesAppender {\n private _items: ElementPropertiesPropertyItem[] = [];\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _props: StartArrayProps,\n ) {}\n public append(_label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._items.push(item);\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Array);\n if (this._props.valueType.memberType.valueFormat === PropertyValueFormat.Primitive) {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());\n } else {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());\n }\n }\n private createPrimitivesArray(): ElementPropertiesPrimitiveArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"primitive\",\n values: this._items.map((item) => {\n assert(item.type === \"primitive\");\n return item.value;\n }),\n };\n }\n private createStructsArray(): ElementPropertiesStructArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"struct\",\n values: this._items.map((item) => {\n assert(item.type === \"struct\");\n return item.members;\n }),\n };\n }\n}\n\nclass StructItemAppender implements IPropertiesAppender {\n private _members: { [label: string]: ElementPropertiesPropertyItem } = {};\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _props: StartStructProps,\n ) {}\n public append(label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._members[label] = item;\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Struct);\n this._parentAppender.append(this._props.hierarchy.field.label, {\n type: \"struct\",\n members: this._members,\n });\n }\n}\n\nclass ElementPropertiesBuilder implements IContentVisitor {\n private _appendersStack: IPropertiesAppender[] = [];\n private _items: ElementProperties[] = [];\n private _elementPropertiesAppender: ElementPropertiesAppender | undefined;\n\n public get items(): ElementProperties[] {\n return this._items;\n }\n\n private get _currentAppender(): IPropertiesAppender {\n const appender = this._appendersStack[this._appendersStack.length - 1];\n assert(appender !== undefined);\n return appender;\n }\n\n public startContent(_props: StartContentProps): boolean {\n this._appendersStack = [];\n this._items = [];\n this._elementPropertiesAppender = undefined;\n return true;\n }\n public finishContent(): void {}\n\n public processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void {}\n\n public startItem(props: StartItemProps): boolean {\n this._elementPropertiesAppender = new ElementPropertiesAppender(props.item, (item) => this._items.push(item));\n this._appendersStack.push(this._elementPropertiesAppender);\n return true;\n }\n public finishItem(): void {\n this._appendersStack.pop();\n assert(this._elementPropertiesAppender !== undefined);\n this._elementPropertiesAppender.finish();\n this._elementPropertiesAppender = undefined;\n }\n\n public startCategory(props: StartCategoryProps): boolean {\n assert(this._elementPropertiesAppender !== undefined);\n this._appendersStack.push(this._elementPropertiesAppender.getCategoryAppender(this._currentAppender, props.category));\n return true;\n }\n public finishCategory(): void {\n this._appendersStack.pop();\n }\n\n public startField(_props: StartFieldProps): boolean {\n return true;\n }\n public finishField(): void {}\n\n public startStruct(props: StartStructProps): boolean {\n this._appendersStack.push(new StructItemAppender(this._currentAppender, props));\n return true;\n }\n public finishStruct(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public startArray(props: StartArrayProps): boolean {\n this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));\n return true;\n }\n public finishArray(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public processMergedValue(props: ProcessMergedValueProps): void {\n this._currentAppender.append(props.mergedField.label, {\n type: \"primitive\",\n value: \"\",\n });\n }\n public processPrimitiveValue(props: ProcessPrimitiveValueProps): void {\n this._currentAppender.append(props.field.label, {\n type: \"primitive\",\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n value: props.displayValue?.toString() ?? \"\",\n });\n }\n}\n"]}
@@ -239,13 +239,35 @@ export declare function traverseFieldHierarchy(hierarchy: FieldHierarchy, cb: (h
239
239
  * An utility to traverse content using provided visitor. Provides means to parse content into different formats,
240
240
  * for different components.
241
241
  * @public
242
+ * @deprecated in 5.4. Use [[createContentTraverser]] instead.
242
243
  */
243
244
  export declare function traverseContent(visitor: IContentVisitor, content: Content): void;
244
245
  /**
245
246
  * An utility for calling [[traverseContent]] when there's only one content item.
246
247
  * @public
248
+ * @deprecated in 5.4. Use [[createContentTraverser]] instead.
247
249
  */
248
250
  export declare function traverseContentItem(visitor: IContentVisitor, descriptor: Descriptor, item: Item): void;
251
+ /**
252
+ * An utility to traverse content using provided visitor. Provides means to parse content into different formats,
253
+ * for different components.
254
+ *
255
+ * This overload takes only the visitor and returns a function that takes descriptor and items to traverse, which is
256
+ * more convenient when item sets need to be traversed with different descriptors.
257
+ *
258
+ * @public
259
+ */
260
+ export declare function createContentTraverser(visitor: IContentVisitor): (descriptor: Descriptor, items: Item[]) => void;
261
+ /**
262
+ * An utility to traverse content using provided visitor. Provides means to parse content into different formats,
263
+ * for different components.
264
+ *
265
+ * This overload takes the visitor and descriptor and returns a function that takes items to traverse, which is more convenient
266
+ * when multiple sets of items need to be traversed with the same descriptor.
267
+ *
268
+ * @public
269
+ */
270
+ export declare function createContentTraverser(visitor: IContentVisitor, descriptor: Descriptor): (items: Item[]) => void;
249
271
  /**
250
272
  * Parses a list of [[Field]] objects into a list of [[FieldHierarchy]].
251
273
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":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AAC,eAAe,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,cAAc,GAAG,IAAI,CAapG;AAaD,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,UAE5E;AACD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,YAE3D"}
1
+ {"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAsB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAuB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEhB,KAAK,IAAI,iBAAiB,EAC1B,WAAW,IAAI,uBAAuB,EACtC,SAAS,IAAI,qBAAqB,EACnC,MAAM,YAAY,CAAC;AAYpB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB;IACrB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;A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,KAAK,OAAO,QAInG;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,QAEzE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,QAE/F;AAID;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAClH;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AA8QlH;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,gBAAgB,CAAC,EAAE,OAAO,oBAgCjF;AAoED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,cAAc,GAAG,IAAI,CAapG;AAaD,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,UAE5E;AACD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,YAE3D"}
@@ -58,7 +58,6 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
58
58
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
59
59
  });
60
60
  import { assert } from "@itwin/core-bentley";
61
- import { Content } from "./Content.js";
62
61
  import { Field } from "./Fields.js";
63
62
  import { Item } from "./Item.js";
64
63
  import { PropertyValueFormat } from "./TypeDescription.js";
@@ -73,32 +72,46 @@ export function traverseFieldHierarchy(hierarchy, cb) {
73
72
  hierarchy.childFields.forEach((childHierarchy) => traverseFieldHierarchy(childHierarchy, cb));
74
73
  }
75
74
  }
75
+ /* c8 ignore start */
76
76
  /**
77
77
  * An utility to traverse content using provided visitor. Provides means to parse content into different formats,
78
78
  * for different components.
79
79
  * @public
80
+ * @deprecated in 5.4. Use [[createContentTraverser]] instead.
80
81
  */
81
82
  export function traverseContent(visitor, content) {
82
- if (!visitor.startContent({ descriptor: content.descriptor })) {
83
- return;
84
- }
85
- try {
86
- const fieldHierarchies = createFieldHierarchies(content.descriptor.fields);
87
- visitor.processFieldHierarchies({ hierarchies: fieldHierarchies });
88
- content.contentSet.forEach((item) => {
89
- traverseContentItemFields(visitor, fieldHierarchies, item);
90
- });
91
- }
92
- finally {
93
- visitor.finishContent();
94
- }
83
+ return createContentTraverser(visitor, content.descriptor)(content.contentSet);
95
84
  }
96
85
  /**
97
86
  * An utility for calling [[traverseContent]] when there's only one content item.
98
87
  * @public
88
+ * @deprecated in 5.4. Use [[createContentTraverser]] instead.
99
89
  */
100
90
  export function traverseContentItem(visitor, descriptor, item) {
101
- traverseContent(visitor, new Content(descriptor, [item]));
91
+ return createContentTraverser(visitor, descriptor)([item]);
92
+ }
93
+ /** @public */
94
+ export function createContentTraverser(visitor, descriptorArg) {
95
+ let memo;
96
+ const traverseContentItems = (descriptor, items) => {
97
+ if (!visitor.startContent({ descriptor })) {
98
+ return;
99
+ }
100
+ try {
101
+ if (memo?.descriptor !== descriptor) {
102
+ const fieldHierarchies = createFieldHierarchies(descriptor.fields);
103
+ visitor.processFieldHierarchies({ hierarchies: fieldHierarchies });
104
+ memo = { descriptor, fieldHierarchies };
105
+ }
106
+ items.forEach((item) => {
107
+ traverseContentItemFields(visitor, memo.fieldHierarchies, item);
108
+ });
109
+ }
110
+ finally {
111
+ visitor.finishContent();
112
+ }
113
+ };
114
+ return descriptorArg ? (items) => traverseContentItems(descriptorArg, items) : traverseContentItems;
102
115
  }
103
116
  class VisitedCategories {
104
117
  _visitor;