@itwin/presentation-common 5.0.0-dev.7 → 5.0.0-dev.72
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 +3 -258
- package/lib/cjs/presentation-common/AsyncTasks.d.ts +4 -4
- package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
- package/lib/cjs/presentation-common/AsyncTasks.js +5 -6
- package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/cjs/presentation-common/EC.d.ts +36 -80
- package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
- package/lib/cjs/presentation-common/EC.js +1 -97
- package/lib/cjs/presentation-common/EC.js.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js +16 -9
- package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
- package/lib/cjs/presentation-common/Error.d.ts +2 -0
- package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Error.js +2 -0
- package/lib/cjs/presentation-common/Error.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.d.ts +2 -2
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +9 -11
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +4 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.d.ts +0 -48
- package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js +1 -44
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +1 -0
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +31 -10
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js +0 -5
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +9 -9
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +36 -21
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +3 -2
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js +9 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +9 -12
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +37 -30
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
- package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +2 -79
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +1 -104
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.d.ts +21 -0
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +57 -0
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.d.ts +0 -7
- package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js +5 -10
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +116 -28
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.d.ts +2 -31
- package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.js +68 -22
- package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.d.ts +151 -27
- package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js +264 -140
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.d.ts +26 -31
- package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js +52 -67
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.d.ts +2 -12
- package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js +0 -18
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +3 -0
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/content/Value.d.ts +5 -107
- package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Value.js +1 -215
- package/lib/cjs/presentation-common/content/Value.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts +0 -83
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +6 -24
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -107
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.d.ts +0 -14
- package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.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.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +3 -0
- package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.js +1 -0
- package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/cjs/presentation-common.d.ts +1 -5
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +6 -5
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.d.ts +4 -4
- package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.js +5 -6
- package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/esm/presentation-common/EC.d.ts +36 -80
- package/lib/esm/presentation-common/EC.d.ts.map +1 -1
- package/lib/esm/presentation-common/EC.js +0 -96
- package/lib/esm/presentation-common/EC.js.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js +16 -9
- package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
- package/lib/esm/presentation-common/Error.d.ts +2 -0
- package/lib/esm/presentation-common/Error.d.ts.map +1 -1
- package/lib/esm/presentation-common/Error.js +2 -0
- package/lib/esm/presentation-common/Error.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +2 -2
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +9 -11
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +5 -2
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.d.ts +0 -48
- package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js +0 -43
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +1 -0
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +31 -10
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js +0 -4
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +9 -9
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +38 -22
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts +3 -2
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js +9 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +9 -12
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +39 -32
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
- package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +2 -79
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +0 -103
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.d.ts +21 -0
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +54 -0
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.d.ts +0 -7
- package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Content.js +5 -10
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +117 -29
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.d.ts +2 -31
- package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.js +68 -22
- package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/esm/presentation-common/content/Fields.d.ts +151 -27
- package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js +264 -140
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.d.ts +26 -31
- package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Item.js +52 -67
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.d.ts +2 -12
- package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Property.js +0 -18
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +3 -0
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/content/Value.d.ts +5 -107
- package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Value.js +0 -214
- package/lib/esm/presentation-common/content/Value.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts +0 -83
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +6 -24
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -107
- package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.d.ts +0 -14
- package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
- package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
- package/lib/esm/presentation-common/rules/customization/GroupingRule.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.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.d.ts +3 -0
- package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.js +1 -0
- package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/esm/presentation-common.d.ts +1 -5
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +1 -5
- package/lib/esm/presentation-common.js.map +1 -1
- package/package.json +12 -12
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
- package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
- package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,M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all `undefined` properties from given `obj` object and returns
|
|
42
|
+
* the same (mutated) object.
|
|
43
|
+
*
|
|
44
|
+
* Example: `omitUndefined({ a: 1, b: undefined })` will return `{ a: 1 }`
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export function omitUndefined(obj) {
|
|
49
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
50
|
+
if (value === undefined) {
|
|
51
|
+
delete obj[key];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return obj;
|
|
55
|
+
}
|
|
56
|
+
/** @internal */
|
|
57
|
+
export function deepReplaceNullsToUndefined(obj) {
|
|
58
|
+
/* istanbul ignore next */
|
|
59
|
+
if (obj === null) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
/* istanbul ignore next */
|
|
63
|
+
if (Array.isArray(obj)) {
|
|
64
|
+
return obj.map(deepReplaceNullsToUndefined);
|
|
65
|
+
}
|
|
66
|
+
if (typeof obj === "object") {
|
|
67
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
68
|
+
const value = obj[key];
|
|
69
|
+
/* istanbul ignore else */
|
|
70
|
+
if (value !== null && value !== undefined) {
|
|
71
|
+
acc[key] = deepReplaceNullsToUndefined(value);
|
|
72
|
+
}
|
|
73
|
+
return acc;
|
|
74
|
+
}, {});
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
/** @internal */
|
|
79
|
+
export function createCancellableTimeoutPromise(timeoutMs) {
|
|
80
|
+
let timeout;
|
|
81
|
+
let rejectPromise;
|
|
82
|
+
const promise = new Promise((resolve, reject) => {
|
|
83
|
+
rejectPromise = reject;
|
|
84
|
+
timeout = setTimeout(resolve, timeoutMs);
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
promise,
|
|
88
|
+
cancel: () => {
|
|
89
|
+
clearTimeout(timeout);
|
|
90
|
+
rejectPromise();
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
40
94
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AA8C1C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAsB,EAAU,EAAE;IAClE,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACnC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAY,EAAE,EAAE;QACrC,IAAI,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,KAAK,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;QACnC,CAAC;aAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1C,KAAK,IAAI,GAAG,CAAC,qBAAqB,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { NodeKey } from \"./hierarchy/Key\";\r\nimport { KeySet } from \"./KeySet\";\r\n\r\n/**\r\n * Create a type with `T` properties excluding properties listed in `K`.\r\n *\r\n * Usage example: `Omit<SomeType, \"exclude_prop1\" | \"exclude_prop2\">`\r\n *\r\n * @public\r\n */\r\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;\r\n\r\n/**\r\n * Create a type with `T` properties excluding all properties in type `K`.\r\n *\r\n * Usage example: `Subtract<SomeType, ExcludePropertiesInThisType>`\r\n *\r\n * @public\r\n */\r\nexport type Subtract<T, K> = Omit<T, keyof K>;\r\n\r\n/**\r\n * Create a type from given type `T` and make specified properties optional.\r\n * @public\r\n */\r\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\r\n\r\n/**\r\n * A dictionary data structure.\r\n * @public\r\n */\r\nexport interface ValuesDictionary<T> {\r\n [key: string]: T;\r\n}\r\n\r\n/**\r\n * A structure for paged responses\r\n * @public\r\n */\r\nexport interface PagedResponse<T> {\r\n /** Total number of items */\r\n total: number;\r\n /** Items for the requested page */\r\n items: T[];\r\n}\r\n\r\n/**\r\n * Get total number of instances included in the supplied key set. The\r\n * count is calculated by adding all of the following:\r\n * - `keys.instanceKeysCount`\r\n * - number of `keys.nodeKeys` which are *ECInstance* keys\r\n * - for every grouping node key in `keys.nodeKeys`, number of grouped instances\r\n *\r\n * E.g. if `keys` contains one instance key, one *ECInstance* node key\r\n * and one grouping node key which groups 3 instances, the result is 5.\r\n *\r\n * @public\r\n */\r\nexport const getInstancesCount = (keys: Readonly<KeySet>): number => {\r\n let count = keys.instanceKeysCount;\r\n keys.nodeKeys.forEach((key: NodeKey) => {\r\n if (NodeKey.isInstancesNodeKey(key)) {\r\n count += key.instanceKeys.length;\r\n } else if (NodeKey.isGroupingNodeKey(key)) {\r\n count += key.groupedInstancesCount;\r\n }\r\n });\r\n return count;\r\n};\r\n\r\n/**\r\n * Default (recommended) keyset batch size for cases when it needs to be sent\r\n * over HTTP. Sending keys in batches helps avoid HTTP413 error.\r\n *\r\n * @public\r\n */\r\nexport const DEFAULT_KEYS_BATCH_SIZE = 5000;\r\n"]}
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,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AI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAc,CAAC,CAAC;YAClC,0BAA0B;YAC1B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC1C,GAAG,CAAC,GAA+B,CAAC,GAAG,2BAA2B,CAAC,KAAK,CAAQ,CAAC;YACnF,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAwB,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,GAAU,CAAC;AACpB,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,+BAA+B,CAAC,SAAiB;IAC/D,IAAI,OAAsC,CAAC;IAC3C,IAAI,aAAyB,CAAC;IAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpD,aAAa,GAAG,MAAM,CAAC;QACvB,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,OAAO;QACL,OAAO;QACP,MAAM,EAAE,GAAG,EAAE;YACX,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,aAAa,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { NodeKey } from \"./hierarchy/Key\";\r\nimport { KeySet } from \"./KeySet\";\r\n\r\n/**\r\n * Create a type with `T` properties excluding properties listed in `K`.\r\n *\r\n * Usage example: `Omit<SomeType, \"exclude_prop1\" | \"exclude_prop2\">`\r\n *\r\n * @public\r\n */\r\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;\r\n\r\n/**\r\n * Create a type with `T` properties excluding all properties in type `K`.\r\n *\r\n * Usage example: `Subtract<SomeType, ExcludePropertiesInThisType>`\r\n *\r\n * @public\r\n */\r\nexport type Subtract<T, K> = Omit<T, keyof K>;\r\n\r\n/**\r\n * Create a type from given type `T` and make specified properties optional.\r\n * @public\r\n */\r\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\r\n\r\n/**\r\n * A dictionary data structure.\r\n * @public\r\n */\r\nexport interface ValuesDictionary<T> {\r\n [key: string]: T;\r\n}\r\n\r\n/**\r\n * A structure for paged responses\r\n * @public\r\n */\r\nexport interface PagedResponse<T> {\r\n /** Total number of items */\r\n total: number;\r\n /** Items for the requested page */\r\n items: T[];\r\n}\r\n\r\n/**\r\n * Get total number of instances included in the supplied key set. The\r\n * count is calculated by adding all of the following:\r\n * - `keys.instanceKeysCount`\r\n * - number of `keys.nodeKeys` which are *ECInstance* keys\r\n * - for every grouping node key in `keys.nodeKeys`, number of grouped instances\r\n *\r\n * E.g. if `keys` contains one instance key, one *ECInstance* node key\r\n * and one grouping node key which groups 3 instances, the result is 5.\r\n *\r\n * @public\r\n */\r\nexport const getInstancesCount = (keys: Readonly<KeySet>): number => {\r\n let count = keys.instanceKeysCount;\r\n keys.nodeKeys.forEach((key: NodeKey) => {\r\n if (NodeKey.isInstancesNodeKey(key)) {\r\n count += key.instanceKeys.length;\r\n } else if (NodeKey.isGroupingNodeKey(key)) {\r\n count += key.groupedInstancesCount;\r\n }\r\n });\r\n return count;\r\n};\r\n\r\n/**\r\n * Default (recommended) keyset batch size for cases when it needs to be sent\r\n * over HTTP. Sending keys in batches helps avoid HTTP413 error.\r\n *\r\n * @public\r\n */\r\nexport const DEFAULT_KEYS_BATCH_SIZE = 5000;\r\n\r\n/**\r\n * Removes all `undefined` properties from given `obj` object and returns\r\n * the same (mutated) object.\r\n *\r\n * Example: `omitUndefined({ a: 1, b: undefined })` will return `{ a: 1 }`\r\n *\r\n * @internal\r\n */\r\nexport function omitUndefined<T extends object>(obj: T): T {\r\n Object.entries(obj).forEach(([key, value]) => {\r\n if (value === undefined) {\r\n delete obj[key as keyof T];\r\n }\r\n });\r\n return obj;\r\n}\r\n\r\n/** @internal */\r\ntype NullToUndefined<T> = T extends null\r\n ? undefined\r\n : T extends Array<infer U>\r\n ? Array<NullToUndefined<U>>\r\n : T extends object\r\n ? { [K in keyof T]: NullToUndefined<T[K]> }\r\n : T;\r\n\r\n/** @internal */\r\nexport function deepReplaceNullsToUndefined<T>(obj: T): NullToUndefined<T> {\r\n /* istanbul ignore next */\r\n if (obj === null) {\r\n return undefined as any;\r\n }\r\n /* istanbul ignore next */\r\n if (Array.isArray(obj)) {\r\n return obj.map(deepReplaceNullsToUndefined) as NullToUndefined<T>;\r\n }\r\n if (typeof obj === \"object\") {\r\n return Object.keys(obj).reduce((acc, key) => {\r\n const value = obj[key as keyof T];\r\n /* istanbul ignore else */\r\n if (value !== null && value !== undefined) {\r\n acc[key as keyof NullToUndefined<T>] = deepReplaceNullsToUndefined(value) as any;\r\n }\r\n return acc;\r\n }, {} as NullToUndefined<T>);\r\n }\r\n return obj as any;\r\n}\r\n\r\n/** @internal */\r\nexport function createCancellableTimeoutPromise(timeoutMs: number) {\r\n let timeout: ReturnType<typeof setTimeout>;\r\n let rejectPromise: () => void;\r\n const promise = new Promise<void>((resolve, reject) => {\r\n rejectPromise = reject;\r\n timeout = setTimeout(resolve, timeoutMs);\r\n });\r\n return {\r\n promise,\r\n cancel: () => {\r\n clearTimeout(timeout);\r\n rejectPromise();\r\n },\r\n };\r\n}\r\n"]}
|
|
@@ -28,12 +28,5 @@ export declare class Content {
|
|
|
28
28
|
toJSON(): ContentJSON;
|
|
29
29
|
/** Deserialize [[Content]] from JSON */
|
|
30
30
|
static fromJSON(json: ContentJSON | string | undefined): Content | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Reviver function that can be used as a second argument for
|
|
33
|
-
* `JSON.parse` method when parsing Content objects.
|
|
34
|
-
*
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
static reviver(key: string, value: any): any;
|
|
38
31
|
}
|
|
39
32
|
//# sourceMappingURL=Content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,OAAO;IAClB,4CAA4C;IAC5C,SAAgB,UAAU,EAAE,UAAU,CAAC;IACvC,oBAAoB;IACpB,SAAgB,UAAU,EAAE,IAAI,EAAE,CAAC;IAEnC,wCAAwC;gBACrB,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;IAKxD,oCAAoC;IAC7B,MAAM,IAAI,WAAW;IAO5B,wCAAwC;WAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,OAAO;IAClB,4CAA4C;IAC5C,SAAgB,UAAU,EAAE,UAAU,CAAC;IACvC,oBAAoB;IACpB,SAAgB,UAAU,EAAE,IAAI,EAAE,CAAC;IAEnC,wCAAwC;gBACrB,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;IAKxD,oCAAoC;IAC7B,MAAM,IAAI,WAAW;IAO5B,wCAAwC;WAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS;CAiBpF"}
|
|
@@ -14,6 +14,10 @@ import { Item } from "./Item";
|
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
16
|
export class Content {
|
|
17
|
+
/** Descriptor used to create the content */
|
|
18
|
+
descriptor;
|
|
19
|
+
/** Content items */
|
|
20
|
+
contentSet;
|
|
17
21
|
/** Create a new [[Content]] instance */
|
|
18
22
|
constructor(descriptor, items) {
|
|
19
23
|
this.descriptor = descriptor;
|
|
@@ -32,7 +36,7 @@ export class Content {
|
|
|
32
36
|
return undefined;
|
|
33
37
|
}
|
|
34
38
|
if (typeof json === "string") {
|
|
35
|
-
return JSON.parse(json
|
|
39
|
+
return Content.fromJSON(JSON.parse(json));
|
|
36
40
|
}
|
|
37
41
|
const descriptor = Descriptor.fromJSON(json.descriptor);
|
|
38
42
|
if (!descriptor) {
|
|
@@ -41,14 +45,5 @@ export class Content {
|
|
|
41
45
|
const contentSet = json.contentSet.map((itemJson) => Item.fromJSON(itemJson)).filter((item) => item !== undefined);
|
|
42
46
|
return new Content(descriptor, contentSet);
|
|
43
47
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Reviver function that can be used as a second argument for
|
|
46
|
-
* `JSON.parse` method when parsing Content objects.
|
|
47
|
-
*
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
static reviver(key, value) {
|
|
51
|
-
return key === "" ? Content.fromJSON(value) : value;
|
|
52
|
-
}
|
|
53
48
|
}
|
|
54
49
|
//# sourceMappingURL=Content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAY,MAAM,QAAQ,CAAC;AAWxC;;;;;GAKG;AACH,MAAM,OAAO,OAAO;
|
|
1
|
+
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAY,MAAM,QAAQ,CAAC;AAWxC;;;;;GAKG;AACH,MAAM,OAAO,OAAO;IAClB,4CAA4C;IAC5B,UAAU,CAAa;IACvC,oBAAoB;IACJ,UAAU,CAAS;IAEnC,wCAAwC;IACxC,YAAmB,UAAsB,EAAE,KAAa;QACtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,oCAAoC;IAC7B,MAAM;QACX,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YACpC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;SAC/D,CAAC;IACJ,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,QAAQ,CAAC,IAAsC;QAC3D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAO,CAAC,IAAI,EAAgB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACvI,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { Descriptor, DescriptorJSON } from \"./Descriptor\";\r\nimport { Item, ItemJSON } from \"./Item\";\r\n\r\n/**\r\n * Serialized [[Content]] JSON representation.\r\n * @public\r\n */\r\nexport interface ContentJSON {\r\n descriptor: DescriptorJSON;\r\n contentSet: ItemJSON[];\r\n}\r\n\r\n/**\r\n * A data structure that contains the [[Descriptor]] and a list of [[Item]]\r\n * objects which are based on that descriptor.\r\n *\r\n * @public\r\n */\r\nexport class Content {\r\n /** Descriptor used to create the content */\r\n public readonly descriptor: Descriptor;\r\n /** Content items */\r\n public readonly contentSet: Item[];\r\n\r\n /** Create a new [[Content]] instance */\r\n public constructor(descriptor: Descriptor, items: Item[]) {\r\n this.descriptor = descriptor;\r\n this.contentSet = items;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): ContentJSON {\r\n return {\r\n descriptor: this.descriptor.toJSON(),\r\n contentSet: this.contentSet.map((item: Item) => item.toJSON()),\r\n };\r\n }\r\n\r\n /** Deserialize [[Content]] from JSON */\r\n public static fromJSON(json: ContentJSON | string | undefined): Content | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (typeof json === \"string\") {\r\n return Content.fromJSON(JSON.parse(json));\r\n }\r\n\r\n const descriptor = Descriptor.fromJSON(json.descriptor);\r\n if (!descriptor) {\r\n return undefined;\r\n }\r\n\r\n const contentSet = json.contentSet.map((itemJson) => Item.fromJSON(itemJson)).filter<Item>((item): item is Item => item !== undefined);\r\n return new Content(descriptor, contentSet);\r\n }\r\n}\r\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Content
|
|
3
3
|
*/
|
|
4
|
+
import { LabelDefinition } from "../LabelDefinition";
|
|
4
5
|
import { CategoryDescription } from "./Category";
|
|
5
6
|
import { Content } from "./Content";
|
|
6
7
|
import { Descriptor } from "./Descriptor";
|
|
@@ -8,7 +9,6 @@ import { Field } from "./Fields";
|
|
|
8
9
|
import { Item } from "./Item";
|
|
9
10
|
import { TypeDescription } from "./TypeDescription";
|
|
10
11
|
import { DisplayValue, DisplayValuesArray, DisplayValuesMap, Value as PresentationValue, ValuesArray as PresentationValuesArray, ValuesMap as PresentationValuesMap } from "./Value";
|
|
11
|
-
import { LabelDefinition } from "../LabelDefinition";
|
|
12
12
|
/**
|
|
13
13
|
* A data structure to define a hierarchy of [[Field]] objects.
|
|
14
14
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAsB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEhB,KAAK,IAAI,iBAAiB,EAC1B,WAAW,IAAI,uBAAuB,EACtC,SAAS,IAAI,qBAAqB,EACnC,MAAM,SAAS,CAAC;
|
|
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,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAsB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEhB,KAAK,IAAI,iBAAiB,EAC1B,WAAW,IAAI,uBAAuB,EACtC,SAAS,IAAI,qBAAqB,EACnC,MAAM,SAAS,CAAC;AAYjB;;;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,4BAA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AC,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,OAAO,QAInG;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,QAczE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,QAE/F;AAiPD;;;;;;;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"}
|
|
@@ -5,7 +5,59 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Content
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
9
|
+
if (value !== null && value !== void 0) {
|
|
10
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
11
|
+
var dispose, inner;
|
|
12
|
+
if (async) {
|
|
13
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
14
|
+
dispose = value[Symbol.asyncDispose];
|
|
15
|
+
}
|
|
16
|
+
if (dispose === void 0) {
|
|
17
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
18
|
+
dispose = value[Symbol.dispose];
|
|
19
|
+
if (async) inner = dispose;
|
|
20
|
+
}
|
|
21
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
22
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
23
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
24
|
+
}
|
|
25
|
+
else if (async) {
|
|
26
|
+
env.stack.push({ async: true });
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
31
|
+
return function (env) {
|
|
32
|
+
function fail(e) {
|
|
33
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
34
|
+
env.hasError = true;
|
|
35
|
+
}
|
|
36
|
+
var r, s = 0;
|
|
37
|
+
function next() {
|
|
38
|
+
while (r = env.stack.pop()) {
|
|
39
|
+
try {
|
|
40
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
41
|
+
if (r.dispose) {
|
|
42
|
+
var result = r.dispose.call(r.value);
|
|
43
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
44
|
+
}
|
|
45
|
+
else s |= 1;
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
fail(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
52
|
+
if (env.hasError) throw env.error;
|
|
53
|
+
}
|
|
54
|
+
return next();
|
|
55
|
+
};
|
|
56
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
57
|
+
var e = new Error(message);
|
|
58
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
59
|
+
});
|
|
60
|
+
import { assert } from "@itwin/core-bentley";
|
|
9
61
|
import { Content } from "./Content";
|
|
10
62
|
import { Field } from "./Fields";
|
|
11
63
|
import { Item } from "./Item";
|
|
@@ -49,6 +101,9 @@ export function traverseContentItem(visitor, descriptor, item) {
|
|
|
49
101
|
traverseContent(visitor, new Content(descriptor, [item]));
|
|
50
102
|
}
|
|
51
103
|
class VisitedCategories {
|
|
104
|
+
_visitor;
|
|
105
|
+
_visitedCategories;
|
|
106
|
+
_didVisitAllHierarchy;
|
|
52
107
|
constructor(_visitor, category) {
|
|
53
108
|
this._visitor = _visitor;
|
|
54
109
|
const stack = [];
|
|
@@ -70,7 +125,7 @@ class VisitedCategories {
|
|
|
70
125
|
}
|
|
71
126
|
}
|
|
72
127
|
}
|
|
73
|
-
dispose() {
|
|
128
|
+
[Symbol.dispose]() {
|
|
74
129
|
while (this._visitedCategories.pop()) {
|
|
75
130
|
this._visitor.finishCategory();
|
|
76
131
|
}
|
|
@@ -85,11 +140,20 @@ function traverseContentItemFields(visitor, fieldHierarchies, item) {
|
|
|
85
140
|
}
|
|
86
141
|
try {
|
|
87
142
|
fieldHierarchies.forEach((fieldHierarchy) => {
|
|
88
|
-
|
|
143
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
144
|
+
try {
|
|
145
|
+
const res = __addDisposableResource(env_1, new VisitedCategories(visitor, fieldHierarchy.field.category), false);
|
|
89
146
|
if (res.shouldContinue) {
|
|
90
147
|
traverseContentItemField(visitor, fieldHierarchy, item);
|
|
91
148
|
}
|
|
92
|
-
}
|
|
149
|
+
}
|
|
150
|
+
catch (e_1) {
|
|
151
|
+
env_1.error = e_1;
|
|
152
|
+
env_1.hasError = true;
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
__disposeResources(env_1);
|
|
156
|
+
}
|
|
93
157
|
});
|
|
94
158
|
}
|
|
95
159
|
finally {
|
|
@@ -133,13 +197,15 @@ function traverseContentItemField(visitor, fieldHierarchy, item) {
|
|
|
133
197
|
else if (pathUpToField.length > 0) {
|
|
134
198
|
fieldHierarchy = {
|
|
135
199
|
...fieldHierarchy,
|
|
136
|
-
field:
|
|
137
|
-
|
|
200
|
+
field: (function () {
|
|
201
|
+
const clone = fieldHierarchy.field.clone();
|
|
202
|
+
clone.type = {
|
|
138
203
|
valueFormat: PropertyValueFormat.Array,
|
|
139
204
|
typeName: `${fieldHierarchy.field.type.typeName}[]`,
|
|
140
205
|
memberType: fieldHierarchy.field.type,
|
|
141
|
-
}
|
|
142
|
-
|
|
206
|
+
};
|
|
207
|
+
return clone;
|
|
208
|
+
})(),
|
|
143
209
|
};
|
|
144
210
|
}
|
|
145
211
|
traverseContentItemFieldValue(visitor, fieldHierarchy, item.mergedFieldNames, fieldHierarchy.field.type, parentFieldName, item.values[fieldHierarchy.field.name], item.displayValues[fieldHierarchy.field.name]);
|
|
@@ -195,7 +261,14 @@ function traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFiel
|
|
|
195
261
|
// Not finding a member field means we're traversing an ECStruct. We still need to carry member information, so we
|
|
196
262
|
// create a fake field to represent the member
|
|
197
263
|
memberField = {
|
|
198
|
-
field: new Field(
|
|
264
|
+
field: new Field({
|
|
265
|
+
category: fieldHierarchy.field.category,
|
|
266
|
+
name: memberDescription.name,
|
|
267
|
+
label: memberDescription.label,
|
|
268
|
+
type: memberDescription.type,
|
|
269
|
+
isReadonly: fieldHierarchy.field.isReadonly,
|
|
270
|
+
priority: 0,
|
|
271
|
+
}),
|
|
199
272
|
childFields: [],
|
|
200
273
|
};
|
|
201
274
|
}
|
|
@@ -364,23 +437,31 @@ function convertNestedContentItemToStructArrayItem(item, field, nextField) {
|
|
|
364
437
|
if (value.length === 0) {
|
|
365
438
|
return { emptyNestedItem: true, convertedItem: item };
|
|
366
439
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
440
|
+
let nextFieldValues = { raw: [], display: [] };
|
|
441
|
+
if (nextField.isNestedContentField()) {
|
|
442
|
+
const nextNestedContent = [];
|
|
443
|
+
value.forEach((ncv) => {
|
|
444
|
+
const nextRawValue = ncv.values[nextField.name];
|
|
372
445
|
if (nextRawValue) {
|
|
373
446
|
assert(PresentationValue.isNestedContent(nextRawValue));
|
|
374
|
-
|
|
447
|
+
nextNestedContent.push(...nextRawValue);
|
|
375
448
|
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
449
|
+
});
|
|
450
|
+
nextFieldValues.raw = nextNestedContent;
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
const nextValues = { raw: [], display: [] };
|
|
454
|
+
value.forEach((ncv) => {
|
|
455
|
+
nextValues.raw.push(ncv.values[nextField.name]);
|
|
456
|
+
nextValues.display.push(ncv.displayValues[nextField.name]);
|
|
457
|
+
});
|
|
458
|
+
nextFieldValues = nextValues;
|
|
459
|
+
}
|
|
460
|
+
const convertedItem = new Item({
|
|
461
|
+
...item,
|
|
462
|
+
values: { [nextField.name]: nextFieldValues.raw },
|
|
463
|
+
displayValues: { [nextField.name]: nextFieldValues.display },
|
|
381
464
|
});
|
|
382
|
-
const convertedItem = new Item(item.primaryKeys, item.label, item.imageId, // eslint-disable-line @typescript-eslint/no-deprecated
|
|
383
|
-
item.classInfo, { [nextField.name]: nextFieldValues.raw }, { [nextField.name]: nextFieldValues.display }, item.mergedFieldNames, item.extendedData);
|
|
384
465
|
return { emptyNestedItem: false, convertedItem };
|
|
385
466
|
}
|
|
386
467
|
function convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy, parentFieldName) {
|
|
@@ -392,8 +473,9 @@ function convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy
|
|
|
392
473
|
return child;
|
|
393
474
|
});
|
|
394
475
|
const convertedFieldHierarchy = {
|
|
395
|
-
field:
|
|
396
|
-
|
|
476
|
+
field: (function () {
|
|
477
|
+
const clone = fieldHierarchy.field.clone();
|
|
478
|
+
clone.type = {
|
|
397
479
|
valueFormat: PropertyValueFormat.Array,
|
|
398
480
|
typeName: `${fieldHierarchy.field.type.typeName}[]`,
|
|
399
481
|
memberType: {
|
|
@@ -405,8 +487,9 @@ function convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy
|
|
|
405
487
|
type: member.field.type,
|
|
406
488
|
})),
|
|
407
489
|
},
|
|
408
|
-
}
|
|
409
|
-
|
|
490
|
+
};
|
|
491
|
+
return clone;
|
|
492
|
+
})(),
|
|
410
493
|
childFields: convertedChildFieldHierarchies,
|
|
411
494
|
};
|
|
412
495
|
return convertedFieldHierarchy;
|
|
@@ -417,7 +500,8 @@ function convertNestedContentValuesToStructArrayValuesRecursive(fieldHierarchy,
|
|
|
417
500
|
const values = { ...ncv.values };
|
|
418
501
|
const displayValues = { ...ncv.displayValues };
|
|
419
502
|
const mergedFieldNames = [...ncv.mergedFieldNames];
|
|
420
|
-
|
|
503
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
504
|
+
values[NESTED_CONTENT_LABEL_SYMBOL] = ncv.label ?? ncv.labelDefinition;
|
|
421
505
|
fieldHierarchy.childFields.forEach((childFieldHierarchy) => {
|
|
422
506
|
const childFieldName = childFieldHierarchy.field.name;
|
|
423
507
|
if (-1 !== ncv.mergedFieldNames.indexOf(childFieldName)) {
|
|
@@ -446,8 +530,12 @@ function convertNestedContentFieldHierarchyItemToStructArrayItem(item, fieldHier
|
|
|
446
530
|
return { emptyNestedItem: true, convertedItem: item };
|
|
447
531
|
}
|
|
448
532
|
const converted = convertNestedContentValuesToStructArrayValuesRecursive(fieldHierarchy, rawValue);
|
|
449
|
-
const convertedItem = new Item(
|
|
450
|
-
|
|
533
|
+
const convertedItem = new Item({
|
|
534
|
+
...item,
|
|
535
|
+
values: { [fieldName]: converted.raw },
|
|
536
|
+
displayValues: { [fieldName]: converted.display },
|
|
537
|
+
mergedFieldNames: converted.mergedFieldNames,
|
|
538
|
+
});
|
|
451
539
|
return { emptyNestedItem: false, convertedItem };
|
|
452
540
|
}
|
|
453
541
|
//# sourceMappingURL=ContentTraverser.js.map
|