@itwin/presentation-common 5.0.0-dev.5 → 5.0.0-dev.52
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 +47 -1
- package/lib/cjs/assets/locales/en/Presentation.json +19 -19
- 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 +4 -3
- package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-common/EC.d.ts +31 -0
- package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
- package/lib/cjs/presentation-common/EC.js.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
- package/lib/cjs/presentation-common/Error.js.map +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +29 -8
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +4 -4
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +3 -2
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js +6 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.d.ts +9 -0
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +17 -0
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Category.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +95 -16
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.js +22 -11
- package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
- package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.d.ts +111 -8
- package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js +137 -98
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.d.ts +19 -0
- package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js +37 -30
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +31 -23
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
- package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
- package/lib/cjs/presentation-common/content/Value.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/cjs/presentation-common.d.ts +1 -1
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +4 -1
- 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 +4 -3
- package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-common/EC.d.ts +31 -0
- package/lib/esm/presentation-common/EC.d.ts.map +1 -1
- package/lib/esm/presentation-common/EC.js.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
- package/lib/esm/presentation-common/Error.js.map +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +29 -8
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +4 -4
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts +3 -2
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js +6 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.d.ts +9 -0
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +16 -0
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Category.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +96 -17
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.js +22 -11
- package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
- package/lib/esm/presentation-common/content/Editor.js.map +1 -1
- package/lib/esm/presentation-common/content/Fields.d.ts +111 -8
- package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js +137 -98
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.d.ts +19 -0
- package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Item.js +37 -30
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +31 -23
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
- package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
- package/lib/esm/presentation-common/content/Value.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/esm/presentation-common.d.ts +1 -1
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +1 -1
- package/lib/esm/presentation-common.js.map +1 -1
- package/lib/public/locales/en/Presentation.json +19 -19
- package/package.json +12 -12
|
@@ -12,6 +12,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
|
|
|
12
12
|
const EC_1 = require("../EC");
|
|
13
13
|
const Error_1 = require("../Error");
|
|
14
14
|
const RelatedPropertiesSpecification_1 = require("../rules/content/modifiers/RelatedPropertiesSpecification");
|
|
15
|
+
const Utils_1 = require("../Utils");
|
|
15
16
|
const Property_1 = require("./Property");
|
|
16
17
|
function isPropertiesField(field) {
|
|
17
18
|
return !!field.properties;
|
|
@@ -32,28 +33,30 @@ function isNestedContentField(field) {
|
|
|
32
33
|
* @public
|
|
33
34
|
*/
|
|
34
35
|
class Field {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
36
|
+
constructor(categoryOrProps, name, label, type, isReadonly, priority, editor, renderer, extendedData) {
|
|
37
|
+
/* istanbul ignore next */
|
|
38
|
+
const props = "category" in categoryOrProps
|
|
39
|
+
? categoryOrProps
|
|
40
|
+
: {
|
|
41
|
+
category: categoryOrProps,
|
|
42
|
+
name: name,
|
|
43
|
+
label: label,
|
|
44
|
+
type: type,
|
|
45
|
+
isReadonly: isReadonly,
|
|
46
|
+
priority: priority,
|
|
47
|
+
editor,
|
|
48
|
+
renderer,
|
|
49
|
+
extendedData,
|
|
50
|
+
};
|
|
51
|
+
this.category = props.category;
|
|
52
|
+
this.name = props.name;
|
|
53
|
+
this.label = props.label;
|
|
54
|
+
this.type = props.type;
|
|
55
|
+
this.isReadonly = props.isReadonly;
|
|
56
|
+
this.priority = props.priority;
|
|
57
|
+
this.editor = props.editor;
|
|
58
|
+
this.renderer = props.renderer;
|
|
59
|
+
this.extendedData = props.extendedData;
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
59
62
|
* Is this a [[PropertiesField]]
|
|
@@ -74,13 +77,13 @@ class Field {
|
|
|
74
77
|
return this._parent;
|
|
75
78
|
}
|
|
76
79
|
clone() {
|
|
77
|
-
const clone = new Field(this
|
|
80
|
+
const clone = new Field(this);
|
|
78
81
|
clone.rebuildParentship(this.parent);
|
|
79
82
|
return clone;
|
|
80
83
|
}
|
|
81
84
|
/** Serialize this object to JSON */
|
|
82
85
|
toJSON() {
|
|
83
|
-
return {
|
|
86
|
+
return (0, Utils_1.omitUndefined)({
|
|
84
87
|
category: this.category.name,
|
|
85
88
|
name: this.name,
|
|
86
89
|
label: this.label,
|
|
@@ -89,8 +92,8 @@ class Field {
|
|
|
89
92
|
priority: this.priority,
|
|
90
93
|
renderer: this.renderer,
|
|
91
94
|
editor: this.editor,
|
|
92
|
-
extendedData: this.extendedData
|
|
93
|
-
};
|
|
95
|
+
extendedData: this.extendedData,
|
|
96
|
+
});
|
|
94
97
|
}
|
|
95
98
|
/** Serialize this object to compressed JSON */
|
|
96
99
|
toCompressedJSON(_classesMap) {
|
|
@@ -108,8 +111,8 @@ class Field {
|
|
|
108
111
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
109
112
|
return NestedContentField.fromJSON(json, categories);
|
|
110
113
|
}
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
return new Field({
|
|
115
|
+
...json,
|
|
113
116
|
category: Field.getCategoryFromFieldJson(json, categories),
|
|
114
117
|
});
|
|
115
118
|
}
|
|
@@ -124,8 +127,8 @@ class Field {
|
|
|
124
127
|
if (isNestedContentField(json)) {
|
|
125
128
|
return NestedContentField.fromCompressedJSON(json, classesMap, categories);
|
|
126
129
|
}
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
return new Field({
|
|
131
|
+
...json,
|
|
129
132
|
category: Field.getCategoryFromFieldJson(json, categories),
|
|
130
133
|
});
|
|
131
134
|
}
|
|
@@ -170,21 +173,23 @@ exports.Field = Field;
|
|
|
170
173
|
* @public
|
|
171
174
|
*/
|
|
172
175
|
class PropertiesField extends Field {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
176
|
+
constructor(categoryOrProps, name, label, type, isReadonly, priority, properties, editor, renderer) {
|
|
177
|
+
/* istanbul ignore next */
|
|
178
|
+
const props = "category" in categoryOrProps
|
|
179
|
+
? categoryOrProps
|
|
180
|
+
: {
|
|
181
|
+
category: categoryOrProps,
|
|
182
|
+
name: name,
|
|
183
|
+
label: label,
|
|
184
|
+
type: type,
|
|
185
|
+
isReadonly: isReadonly,
|
|
186
|
+
priority: priority,
|
|
187
|
+
editor,
|
|
188
|
+
renderer,
|
|
189
|
+
properties: properties,
|
|
190
|
+
};
|
|
191
|
+
super(props);
|
|
192
|
+
this.properties = props.properties;
|
|
188
193
|
}
|
|
189
194
|
/** Is this a an array property field */
|
|
190
195
|
isArrayPropertiesField() {
|
|
@@ -195,7 +200,7 @@ class PropertiesField extends Field {
|
|
|
195
200
|
return false;
|
|
196
201
|
}
|
|
197
202
|
clone() {
|
|
198
|
-
const clone = new PropertiesField(this
|
|
203
|
+
const clone = new PropertiesField(this);
|
|
199
204
|
clone.rebuildParentship(this.parent);
|
|
200
205
|
return clone;
|
|
201
206
|
}
|
|
@@ -224,8 +229,8 @@ class PropertiesField extends Field {
|
|
|
224
229
|
if (isStructPropertiesField(json)) {
|
|
225
230
|
return StructPropertiesField.fromJSON(json, categories);
|
|
226
231
|
}
|
|
227
|
-
|
|
228
|
-
|
|
232
|
+
return new PropertiesField({
|
|
233
|
+
...json,
|
|
229
234
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
230
235
|
});
|
|
231
236
|
}
|
|
@@ -240,8 +245,8 @@ class PropertiesField extends Field {
|
|
|
240
245
|
if (isStructPropertiesField(json)) {
|
|
241
246
|
return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);
|
|
242
247
|
}
|
|
243
|
-
|
|
244
|
-
|
|
248
|
+
return new PropertiesField({
|
|
249
|
+
...json,
|
|
245
250
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
246
251
|
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
247
252
|
});
|
|
@@ -303,15 +308,30 @@ exports.PropertiesField = PropertiesField;
|
|
|
303
308
|
* @public
|
|
304
309
|
*/
|
|
305
310
|
class ArrayPropertiesField extends PropertiesField {
|
|
306
|
-
constructor(
|
|
307
|
-
|
|
308
|
-
|
|
311
|
+
constructor(categoryOrProps, name, label, type, itemsField, isReadonly, priority, properties, editor, renderer) {
|
|
312
|
+
/* istanbul ignore next */
|
|
313
|
+
const props = "category" in categoryOrProps
|
|
314
|
+
? categoryOrProps
|
|
315
|
+
: {
|
|
316
|
+
category: categoryOrProps,
|
|
317
|
+
name: name,
|
|
318
|
+
label: label,
|
|
319
|
+
type: type,
|
|
320
|
+
isReadonly: isReadonly,
|
|
321
|
+
priority: priority,
|
|
322
|
+
editor,
|
|
323
|
+
renderer,
|
|
324
|
+
properties: properties,
|
|
325
|
+
itemsField: itemsField,
|
|
326
|
+
};
|
|
327
|
+
super(props);
|
|
328
|
+
this.itemsField = props.itemsField;
|
|
309
329
|
}
|
|
310
330
|
isArrayPropertiesField() {
|
|
311
331
|
return true;
|
|
312
332
|
}
|
|
313
333
|
clone() {
|
|
314
|
-
const clone = new ArrayPropertiesField(this
|
|
334
|
+
const clone = new ArrayPropertiesField(this);
|
|
315
335
|
clone.rebuildParentship(this.parent);
|
|
316
336
|
return clone;
|
|
317
337
|
}
|
|
@@ -331,8 +351,8 @@ class ArrayPropertiesField extends PropertiesField {
|
|
|
331
351
|
}
|
|
332
352
|
/** Deserialize [[ArrayPropertiesField]] from JSON */
|
|
333
353
|
static fromJSON(json, categories) {
|
|
334
|
-
|
|
335
|
-
|
|
354
|
+
return new ArrayPropertiesField({
|
|
355
|
+
...json,
|
|
336
356
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
337
357
|
itemsField: PropertiesField.fromJSON(json.itemsField, categories),
|
|
338
358
|
});
|
|
@@ -342,8 +362,8 @@ class ArrayPropertiesField extends PropertiesField {
|
|
|
342
362
|
* @public
|
|
343
363
|
*/
|
|
344
364
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
345
|
-
|
|
346
|
-
|
|
365
|
+
return new ArrayPropertiesField({
|
|
366
|
+
...json,
|
|
347
367
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
348
368
|
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
349
369
|
itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),
|
|
@@ -356,15 +376,30 @@ exports.ArrayPropertiesField = ArrayPropertiesField;
|
|
|
356
376
|
* @public
|
|
357
377
|
*/
|
|
358
378
|
class StructPropertiesField extends PropertiesField {
|
|
359
|
-
constructor(
|
|
360
|
-
|
|
361
|
-
|
|
379
|
+
constructor(categoryOrProps, name, label, type, memberFields, isReadonly, priority, properties, editor, renderer) {
|
|
380
|
+
/* istanbul ignore next */
|
|
381
|
+
const props = "category" in categoryOrProps
|
|
382
|
+
? categoryOrProps
|
|
383
|
+
: {
|
|
384
|
+
category: categoryOrProps,
|
|
385
|
+
name: name,
|
|
386
|
+
label: label,
|
|
387
|
+
type: type,
|
|
388
|
+
isReadonly: isReadonly,
|
|
389
|
+
priority: priority,
|
|
390
|
+
editor,
|
|
391
|
+
renderer,
|
|
392
|
+
properties: properties,
|
|
393
|
+
memberFields: memberFields,
|
|
394
|
+
};
|
|
395
|
+
super(props);
|
|
396
|
+
this.memberFields = props.memberFields;
|
|
362
397
|
}
|
|
363
398
|
isStructPropertiesField() {
|
|
364
399
|
return true;
|
|
365
400
|
}
|
|
366
401
|
clone() {
|
|
367
|
-
const clone = new StructPropertiesField(this
|
|
402
|
+
const clone = new StructPropertiesField(this);
|
|
368
403
|
clone.rebuildParentship(this.parent);
|
|
369
404
|
return clone;
|
|
370
405
|
}
|
|
@@ -384,8 +419,8 @@ class StructPropertiesField extends PropertiesField {
|
|
|
384
419
|
}
|
|
385
420
|
/** Deserialize [[StructPropertiesField]] from JSON */
|
|
386
421
|
static fromJSON(json, categories) {
|
|
387
|
-
|
|
388
|
-
|
|
422
|
+
return new StructPropertiesField({
|
|
423
|
+
...json,
|
|
389
424
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
390
425
|
memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),
|
|
391
426
|
});
|
|
@@ -395,8 +430,8 @@ class StructPropertiesField extends PropertiesField {
|
|
|
395
430
|
* @public
|
|
396
431
|
*/
|
|
397
432
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
398
|
-
|
|
399
|
-
|
|
433
|
+
return new StructPropertiesField({
|
|
434
|
+
...json,
|
|
400
435
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
401
436
|
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
402
437
|
memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),
|
|
@@ -410,35 +445,37 @@ exports.StructPropertiesField = StructPropertiesField;
|
|
|
410
445
|
* @public
|
|
411
446
|
*/
|
|
412
447
|
class NestedContentField extends Field {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
this.
|
|
433
|
-
this.
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
436
|
-
this.
|
|
448
|
+
constructor(categoryOrProps, name, label, type, isReadonly, priority, contentClassInfo, pathToPrimaryClass, nestedFields, editor, autoExpand, renderer) {
|
|
449
|
+
/* istanbul ignore next */
|
|
450
|
+
const props = "category" in categoryOrProps
|
|
451
|
+
? categoryOrProps
|
|
452
|
+
: {
|
|
453
|
+
category: categoryOrProps,
|
|
454
|
+
name: name,
|
|
455
|
+
label: label,
|
|
456
|
+
type: type,
|
|
457
|
+
isReadonly: isReadonly,
|
|
458
|
+
priority: priority,
|
|
459
|
+
editor,
|
|
460
|
+
renderer,
|
|
461
|
+
contentClassInfo: contentClassInfo,
|
|
462
|
+
pathToPrimaryClass: pathToPrimaryClass,
|
|
463
|
+
nestedFields: nestedFields,
|
|
464
|
+
autoExpand,
|
|
465
|
+
};
|
|
466
|
+
super(props);
|
|
467
|
+
this.contentClassInfo = props.contentClassInfo;
|
|
468
|
+
this.pathToPrimaryClass = props.pathToPrimaryClass;
|
|
469
|
+
this.relationshipMeaning = props.relationshipMeaning ?? RelatedPropertiesSpecification_1.RelationshipMeaning.RelatedInstance;
|
|
470
|
+
this.nestedFields = props.nestedFields;
|
|
471
|
+
this.autoExpand = props.autoExpand;
|
|
472
|
+
this.actualPrimaryClassIds = props.actualPrimaryClassIds ?? [];
|
|
437
473
|
}
|
|
438
474
|
clone() {
|
|
439
|
-
const clone = new NestedContentField(
|
|
440
|
-
|
|
441
|
-
|
|
475
|
+
const clone = new NestedContentField({
|
|
476
|
+
...this,
|
|
477
|
+
nestedFields: this.nestedFields.map((n) => n.clone()),
|
|
478
|
+
});
|
|
442
479
|
clone.rebuildParentship(this.parent);
|
|
443
480
|
return clone;
|
|
444
481
|
}
|
|
@@ -459,7 +496,7 @@ class NestedContentField extends Field {
|
|
|
459
496
|
relationshipMeaning: this.relationshipMeaning,
|
|
460
497
|
actualPrimaryClassIds: this.actualPrimaryClassIds,
|
|
461
498
|
nestedFields: this.nestedFields.map((field) => field.toJSON()),
|
|
462
|
-
autoExpand:
|
|
499
|
+
...(this.autoExpand ? { autoExpand: true } : undefined),
|
|
463
500
|
};
|
|
464
501
|
}
|
|
465
502
|
/** Serialize this object to compressed JSON */
|
|
@@ -481,8 +518,9 @@ class NestedContentField extends Field {
|
|
|
481
518
|
if (!json) {
|
|
482
519
|
return undefined;
|
|
483
520
|
}
|
|
484
|
-
|
|
485
|
-
|
|
521
|
+
return new NestedContentField({
|
|
522
|
+
...json,
|
|
523
|
+
...this.fromCommonJSON(json, categories),
|
|
486
524
|
nestedFields: json.nestedFields
|
|
487
525
|
.map((nestedFieldJson) => Field.fromJSON(nestedFieldJson, categories))
|
|
488
526
|
.filter((nestedField) => !!nestedField),
|
|
@@ -491,8 +529,9 @@ class NestedContentField extends Field {
|
|
|
491
529
|
/** Deserialize a [[NestedContentField]] from compressed JSON. */
|
|
492
530
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
493
531
|
(0, core_bentley_1.assert)(classesMap.hasOwnProperty(json.contentClassInfo));
|
|
494
|
-
|
|
495
|
-
|
|
532
|
+
return new NestedContentField({
|
|
533
|
+
...json,
|
|
534
|
+
...this.fromCommonJSON(json, categories),
|
|
496
535
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
497
536
|
nestedFields: json.nestedFields
|
|
498
537
|
.map((nestedFieldJson) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))
|