@itwin/presentation-common 3.1.0-dev.24 → 3.1.0-dev.28

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 CHANGED
@@ -1,6 +1,33 @@
1
1
  # Change Log - @itwin/presentation-common
2
2
 
3
- This log was last generated on Wed, 12 Jan 2022 14:52:38 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 24 Jan 2022 14:00:52 GMT and should not be manually modified.
4
+
5
+ ## 3.0.0
6
+ Mon, 24 Jan 2022 14:00:52 GMT
7
+
8
+ ### Updates
9
+
10
+ - Removed deprecated rules for iModel.js 3.0.
11
+ - Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
12
+ - rename contextId -> iTwinId
13
+ - Added 'BaseNodeKey.version' property and 'NodeKey.equals' function to compare keys taking their versions into account.
14
+ - rename to @itwin/presentation-common
15
+ - Added `excludedClasses` attribute to `ContentInstancesOfSpecificClassesSpecification` and `InstanceNodesOfSpecificClassesSpecification` specifications.
16
+ - Added 'onlyIfNotHandled' property support to all content rule specifications
17
+ - Update `SelectClassInfo.pathFromInputToSelectClass` type definition to match reality - the relationship may not always be set.
18
+ - Clean up deprecated APIs
19
+ - Added API to get properties of all elements.
20
+ - Added `getContentSources` RPC to retrieve information about where content for specific types of elements comes from.
21
+ - Fixed processing of merged content values under nested content field.
22
+ - Remove ability to get multiple element properties over RPC.
23
+ - Add `getContentInstanceKeys` RPC to efficiently get content instance keys.
24
+ - Remove `priority` attribute from presentation request options type.
25
+ - Optimize `KeySetJSON` size by compressing instance IDs.
26
+ - Remove `PresentationRpcInterface.loadHierarchy`.
27
+ - The `condition` attribute should be defined on both `ChildNodeRule` and `RootNodeRule`.
28
+ - Added `ignoreCategories` parameter in `createFieldHierarchies` function for adding all of the nested properties to parent field's child fields without considering categories.
29
+ - Removed `PresentationUnitSystem` in favor of `UnitSystemKey` from `@itwin/core-quantity`.
30
+ - remove ClientRequestContext.current
4
31
 
5
32
  ## 2.19.28
6
33
  Wed, 12 Jan 2022 14:52:38 GMT
@@ -68,7 +68,7 @@ export interface RelatedPropertiesSpecification {
68
68
  skipIfDuplicate?: boolean;
69
69
  /**
70
70
  * Meaning of the relationship which tells how to categorize the related properties. Defaults to [[RelationshipMeaning.RelatedInstance]].
71
- * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#relationship-meaning-attribute)
71
+ * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#attribute-relationshipmeaning)
72
72
  */
73
73
  relationshipMeaning?: RelationshipMeaning;
74
74
  /** Specifications for nested related properties */
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedPropertiesSpecification.js","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH;;;GAGG;AACH,IAAY,mBAcX;AAdD,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,oDAA6B,CAAA;IAE7B;;;;OAIG;IACH,0DAAmC,CAAA;AACrC,CAAC,EAdW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAc9B;AAED;;;GAGG;AACH,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC;;;OAGG;IACH,iDAAe,CAAA;IAEf;;OAEG;IACH,2CAAS,CAAA;AACX,CAAC,EAXW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAWzC","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 PresentationRules\r\n */\r\n\r\nimport { RelationshipPathSpecification } from \"../../RelationshipPathSpecification\";\r\nimport { PropertySpecification } from \"../PropertySpecification\";\r\n\r\n/**\r\n * Meaning of the relationship\r\n * @public\r\n */\r\nexport enum RelationshipMeaning {\r\n /**\r\n * Related instance is part of the primary instance. Related properties\r\n * with this meaning are displayed in UI as if they belonged to the\r\n * primary instance.\r\n */\r\n SameInstance = \"SameInstance\",\r\n\r\n /**\r\n * Related instance if not part of the primary instance - it should\r\n * appear as related. UI components may display related instance properties\r\n * differently, e.g. put them under a different category, etc.\r\n */\r\n RelatedInstance = \"RelatedInstance\",\r\n}\r\n\r\n/**\r\n * Special values that can be used in [[RelatedPropertiesSpecification.propertyNames]]\r\n * @public\r\n */\r\nexport enum RelatedPropertiesSpecialValues {\r\n /**\r\n * Used to specify that no properties should be included. Usually\r\n * used together with [[RelatedPropertiesSpecification.nestedRelatedProperties]]\r\n */\r\n None = \"_none_\",\r\n\r\n /**\r\n * Used to specify that all properties should be included.\r\n */\r\n All = \"*\",\r\n}\r\n\r\n/**\r\n * Sub-specification to include additional related instance properties.\r\n *\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md)\r\n * @public\r\n */\r\nexport interface RelatedPropertiesSpecification {\r\n /**\r\n * Relationship path from content class to properties' class.\r\n */\r\n propertiesSource: RelationshipPathSpecification;\r\n\r\n /**\r\n * Should the target class specified in [[propertiesSource]] be handled\r\n * polymorphically. This means properties of not only the target class, but also all its subclasses\r\n * are loaded.\r\n *\r\n * @note There's a difference between loading properties and instances polymorphically. This attribute\r\n * only controls polymorphism of properties, while instances are always looked up in a polymorphic fashion.\r\n */\r\n handleTargetClassPolymorphically?: boolean;\r\n\r\n /**\r\n * Should field containing related properties be automatically expanded. This only takes effect when\r\n * content class is related to properties source class through a one-to-many or many-to-many relationship.\r\n */\r\n autoExpand?: boolean;\r\n\r\n /**\r\n * Should this related properties specification be ignored if it duplicates another higher priority specification for the same relationship.\r\n * @beta\r\n */\r\n skipIfDuplicate?: boolean;\r\n\r\n /**\r\n * Meaning of the relationship which tells how to categorize the related properties. Defaults to [[RelationshipMeaning.RelatedInstance]].\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#relationship-meaning-attribute)\r\n */\r\n relationshipMeaning?: RelationshipMeaning;\r\n\r\n /** Specifications for nested related properties */\r\n nestedRelatedProperties?: RelatedPropertiesSpecification[];\r\n\r\n /**\r\n * A list of property names or specifications that should be included in the content. All\r\n * properties are included if this attribute is not specified.\r\n */\r\n properties?: Array<string | PropertySpecification> | RelatedPropertiesSpecialValues;\r\n}\r\n"]}
1
+ {"version":3,"file":"RelatedPropertiesSpecification.js","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH;;;GAGG;AACH,IAAY,mBAcX;AAdD,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,oDAA6B,CAAA;IAE7B;;;;OAIG;IACH,0DAAmC,CAAA;AACrC,CAAC,EAdW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAc9B;AAED;;;GAGG;AACH,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC;;;OAGG;IACH,iDAAe,CAAA;IAEf;;OAEG;IACH,2CAAS,CAAA;AACX,CAAC,EAXW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAWzC","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 PresentationRules\r\n */\r\n\r\nimport { RelationshipPathSpecification } from \"../../RelationshipPathSpecification\";\r\nimport { PropertySpecification } from \"../PropertySpecification\";\r\n\r\n/**\r\n * Meaning of the relationship\r\n * @public\r\n */\r\nexport enum RelationshipMeaning {\r\n /**\r\n * Related instance is part of the primary instance. Related properties\r\n * with this meaning are displayed in UI as if they belonged to the\r\n * primary instance.\r\n */\r\n SameInstance = \"SameInstance\",\r\n\r\n /**\r\n * Related instance if not part of the primary instance - it should\r\n * appear as related. UI components may display related instance properties\r\n * differently, e.g. put them under a different category, etc.\r\n */\r\n RelatedInstance = \"RelatedInstance\",\r\n}\r\n\r\n/**\r\n * Special values that can be used in [[RelatedPropertiesSpecification.propertyNames]]\r\n * @public\r\n */\r\nexport enum RelatedPropertiesSpecialValues {\r\n /**\r\n * Used to specify that no properties should be included. Usually\r\n * used together with [[RelatedPropertiesSpecification.nestedRelatedProperties]]\r\n */\r\n None = \"_none_\",\r\n\r\n /**\r\n * Used to specify that all properties should be included.\r\n */\r\n All = \"*\",\r\n}\r\n\r\n/**\r\n * Sub-specification to include additional related instance properties.\r\n *\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md)\r\n * @public\r\n */\r\nexport interface RelatedPropertiesSpecification {\r\n /**\r\n * Relationship path from content class to properties' class.\r\n */\r\n propertiesSource: RelationshipPathSpecification;\r\n\r\n /**\r\n * Should the target class specified in [[propertiesSource]] be handled\r\n * polymorphically. This means properties of not only the target class, but also all its subclasses\r\n * are loaded.\r\n *\r\n * @note There's a difference between loading properties and instances polymorphically. This attribute\r\n * only controls polymorphism of properties, while instances are always looked up in a polymorphic fashion.\r\n */\r\n handleTargetClassPolymorphically?: boolean;\r\n\r\n /**\r\n * Should field containing related properties be automatically expanded. This only takes effect when\r\n * content class is related to properties source class through a one-to-many or many-to-many relationship.\r\n */\r\n autoExpand?: boolean;\r\n\r\n /**\r\n * Should this related properties specification be ignored if it duplicates another higher priority specification for the same relationship.\r\n * @beta\r\n */\r\n skipIfDuplicate?: boolean;\r\n\r\n /**\r\n * Meaning of the relationship which tells how to categorize the related properties. Defaults to [[RelationshipMeaning.RelatedInstance]].\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#attribute-relationshipmeaning)\r\n */\r\n relationshipMeaning?: RelationshipMeaning;\r\n\r\n /** Specifications for nested related properties */\r\n nestedRelatedProperties?: RelatedPropertiesSpecification[];\r\n\r\n /**\r\n * A list of property names or specifications that should be included in the content. All\r\n * properties are included if this attribute is not specified.\r\n */\r\n properties?: Array<string | PropertySpecification> | RelatedPropertiesSpecialValues;\r\n}\r\n"]}
@@ -68,7 +68,7 @@ export interface RelatedPropertiesSpecification {
68
68
  skipIfDuplicate?: boolean;
69
69
  /**
70
70
  * Meaning of the relationship which tells how to categorize the related properties. Defaults to [[RelationshipMeaning.RelatedInstance]].
71
- * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#relationship-meaning-attribute)
71
+ * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#attribute-relationshipmeaning)
72
72
  */
73
73
  relationshipMeaning?: RelationshipMeaning;
74
74
  /** Specifications for nested related properties */
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedPropertiesSpecification.js","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAcX;AAdD,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,oDAA6B,CAAA;IAE7B;;;;OAIG;IACH,0DAAmC,CAAA;AACrC,CAAC,EAdW,mBAAmB,KAAnB,mBAAmB,QAc9B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC;;;OAGG;IACH,iDAAe,CAAA;IAEf;;OAEG;IACH,2CAAS,CAAA;AACX,CAAC,EAXW,8BAA8B,KAA9B,8BAA8B,QAWzC","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 PresentationRules\r\n */\r\n\r\nimport { RelationshipPathSpecification } from \"../../RelationshipPathSpecification\";\r\nimport { PropertySpecification } from \"../PropertySpecification\";\r\n\r\n/**\r\n * Meaning of the relationship\r\n * @public\r\n */\r\nexport enum RelationshipMeaning {\r\n /**\r\n * Related instance is part of the primary instance. Related properties\r\n * with this meaning are displayed in UI as if they belonged to the\r\n * primary instance.\r\n */\r\n SameInstance = \"SameInstance\",\r\n\r\n /**\r\n * Related instance if not part of the primary instance - it should\r\n * appear as related. UI components may display related instance properties\r\n * differently, e.g. put them under a different category, etc.\r\n */\r\n RelatedInstance = \"RelatedInstance\",\r\n}\r\n\r\n/**\r\n * Special values that can be used in [[RelatedPropertiesSpecification.propertyNames]]\r\n * @public\r\n */\r\nexport enum RelatedPropertiesSpecialValues {\r\n /**\r\n * Used to specify that no properties should be included. Usually\r\n * used together with [[RelatedPropertiesSpecification.nestedRelatedProperties]]\r\n */\r\n None = \"_none_\",\r\n\r\n /**\r\n * Used to specify that all properties should be included.\r\n */\r\n All = \"*\",\r\n}\r\n\r\n/**\r\n * Sub-specification to include additional related instance properties.\r\n *\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md)\r\n * @public\r\n */\r\nexport interface RelatedPropertiesSpecification {\r\n /**\r\n * Relationship path from content class to properties' class.\r\n */\r\n propertiesSource: RelationshipPathSpecification;\r\n\r\n /**\r\n * Should the target class specified in [[propertiesSource]] be handled\r\n * polymorphically. This means properties of not only the target class, but also all its subclasses\r\n * are loaded.\r\n *\r\n * @note There's a difference between loading properties and instances polymorphically. This attribute\r\n * only controls polymorphism of properties, while instances are always looked up in a polymorphic fashion.\r\n */\r\n handleTargetClassPolymorphically?: boolean;\r\n\r\n /**\r\n * Should field containing related properties be automatically expanded. This only takes effect when\r\n * content class is related to properties source class through a one-to-many or many-to-many relationship.\r\n */\r\n autoExpand?: boolean;\r\n\r\n /**\r\n * Should this related properties specification be ignored if it duplicates another higher priority specification for the same relationship.\r\n * @beta\r\n */\r\n skipIfDuplicate?: boolean;\r\n\r\n /**\r\n * Meaning of the relationship which tells how to categorize the related properties. Defaults to [[RelationshipMeaning.RelatedInstance]].\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#relationship-meaning-attribute)\r\n */\r\n relationshipMeaning?: RelationshipMeaning;\r\n\r\n /** Specifications for nested related properties */\r\n nestedRelatedProperties?: RelatedPropertiesSpecification[];\r\n\r\n /**\r\n * A list of property names or specifications that should be included in the content. All\r\n * properties are included if this attribute is not specified.\r\n */\r\n properties?: Array<string | PropertySpecification> | RelatedPropertiesSpecialValues;\r\n}\r\n"]}
1
+ {"version":3,"file":"RelatedPropertiesSpecification.js","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAcX;AAdD,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,oDAA6B,CAAA;IAE7B;;;;OAIG;IACH,0DAAmC,CAAA;AACrC,CAAC,EAdW,mBAAmB,KAAnB,mBAAmB,QAc9B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC;;;OAGG;IACH,iDAAe,CAAA;IAEf;;OAEG;IACH,2CAAS,CAAA;AACX,CAAC,EAXW,8BAA8B,KAA9B,8BAA8B,QAWzC","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 PresentationRules\r\n */\r\n\r\nimport { RelationshipPathSpecification } from \"../../RelationshipPathSpecification\";\r\nimport { PropertySpecification } from \"../PropertySpecification\";\r\n\r\n/**\r\n * Meaning of the relationship\r\n * @public\r\n */\r\nexport enum RelationshipMeaning {\r\n /**\r\n * Related instance is part of the primary instance. Related properties\r\n * with this meaning are displayed in UI as if they belonged to the\r\n * primary instance.\r\n */\r\n SameInstance = \"SameInstance\",\r\n\r\n /**\r\n * Related instance if not part of the primary instance - it should\r\n * appear as related. UI components may display related instance properties\r\n * differently, e.g. put them under a different category, etc.\r\n */\r\n RelatedInstance = \"RelatedInstance\",\r\n}\r\n\r\n/**\r\n * Special values that can be used in [[RelatedPropertiesSpecification.propertyNames]]\r\n * @public\r\n */\r\nexport enum RelatedPropertiesSpecialValues {\r\n /**\r\n * Used to specify that no properties should be included. Usually\r\n * used together with [[RelatedPropertiesSpecification.nestedRelatedProperties]]\r\n */\r\n None = \"_none_\",\r\n\r\n /**\r\n * Used to specify that all properties should be included.\r\n */\r\n All = \"*\",\r\n}\r\n\r\n/**\r\n * Sub-specification to include additional related instance properties.\r\n *\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md)\r\n * @public\r\n */\r\nexport interface RelatedPropertiesSpecification {\r\n /**\r\n * Relationship path from content class to properties' class.\r\n */\r\n propertiesSource: RelationshipPathSpecification;\r\n\r\n /**\r\n * Should the target class specified in [[propertiesSource]] be handled\r\n * polymorphically. This means properties of not only the target class, but also all its subclasses\r\n * are loaded.\r\n *\r\n * @note There's a difference between loading properties and instances polymorphically. This attribute\r\n * only controls polymorphism of properties, while instances are always looked up in a polymorphic fashion.\r\n */\r\n handleTargetClassPolymorphically?: boolean;\r\n\r\n /**\r\n * Should field containing related properties be automatically expanded. This only takes effect when\r\n * content class is related to properties source class through a one-to-many or many-to-many relationship.\r\n */\r\n autoExpand?: boolean;\r\n\r\n /**\r\n * Should this related properties specification be ignored if it duplicates another higher priority specification for the same relationship.\r\n * @beta\r\n */\r\n skipIfDuplicate?: boolean;\r\n\r\n /**\r\n * Meaning of the relationship which tells how to categorize the related properties. Defaults to [[RelationshipMeaning.RelatedInstance]].\r\n * @see [More details]($docs/presentation/Content/RelatedPropertiesSpecification.md#attribute-relationshipmeaning)\r\n */\r\n relationshipMeaning?: RelationshipMeaning;\r\n\r\n /** Specifications for nested related properties */\r\n nestedRelatedProperties?: RelatedPropertiesSpecification[];\r\n\r\n /**\r\n * A list of property names or specifications that should be included in the content. All\r\n * properties are included if this attribute is not specified.\r\n */\r\n properties?: Array<string | PropertySpecification> | RelatedPropertiesSpecialValues;\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/presentation-common",
3
- "version": "3.1.0-dev.24",
3
+ "version": "3.1.0-dev.28",
4
4
  "description": "Common pieces for iModel.js presentation packages",
5
5
  "imodeljsSharedLibrary": true,
6
6
  "license": "MIT",
@@ -22,16 +22,16 @@
22
22
  "module": "lib/esm/presentation-common.js",
23
23
  "typings": "lib/cjs/presentation-common",
24
24
  "peerDependencies": {
25
- "@itwin/core-bentley": "^3.1.0-dev.24",
26
- "@itwin/core-common": "^3.1.0-dev.24",
27
- "@itwin/core-quantity": "^3.1.0-dev.24"
25
+ "@itwin/core-bentley": "^3.1.0-dev.28",
26
+ "@itwin/core-common": "^3.1.0-dev.28",
27
+ "@itwin/core-quantity": "^3.1.0-dev.28"
28
28
  },
29
29
  "devDependencies": {
30
- "@itwin/build-tools": "3.1.0-dev.24",
31
- "@itwin/core-bentley": "3.1.0-dev.24",
32
- "@itwin/core-common": "3.1.0-dev.24",
33
- "@itwin/core-quantity": "3.1.0-dev.24",
34
- "@itwin/eslint-plugin": "3.1.0-dev.24",
30
+ "@itwin/build-tools": "3.1.0-dev.28",
31
+ "@itwin/core-bentley": "3.1.0-dev.28",
32
+ "@itwin/core-common": "3.1.0-dev.28",
33
+ "@itwin/core-quantity": "3.1.0-dev.28",
34
+ "@itwin/eslint-plugin": "3.1.0-dev.28",
35
35
  "@types/chai": "^4.1.4",
36
36
  "@types/chai-as-promised": "^7",
37
37
  "@types/chai-jest-snapshot": "^1.3.0",