@itwin/presentation-common 3.1.0-dev.8 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,65 @@
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 Wed, 06 Apr 2022 22:27:56 GMT and should not be manually modified.
4
+
5
+ ## 3.1.2
6
+ Wed, 06 Apr 2022 22:27:56 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.1.1
11
+ Thu, 31 Mar 2022 15:55:48 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.1.0
16
+ Tue, 29 Mar 2022 20:53:47 GMT
17
+
18
+ ### Updates
19
+
20
+ - Deprecate `PropertyGroupingValue`, `PropertyGroup.groupingValue` and `PropertyGroup.sortingValue`.
21
+
22
+ ## 3.0.3
23
+ Fri, 25 Mar 2022 15:10:02 GMT
24
+
25
+ _Version update only_
26
+
27
+ ## 3.0.2
28
+ Thu, 10 Mar 2022 21:18:13 GMT
29
+
30
+ _Version update only_
31
+
32
+ ## 3.0.1
33
+ Thu, 24 Feb 2022 15:26:55 GMT
34
+
35
+ _Version update only_
36
+
37
+ ## 3.0.0
38
+ Mon, 24 Jan 2022 14:00:52 GMT
39
+
40
+ ### Updates
41
+
42
+ - Removed deprecated rules for iModel.js 3.0.
43
+ - Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
44
+ - rename contextId -> iTwinId
45
+ - Added 'BaseNodeKey.version' property and 'NodeKey.equals' function to compare keys taking their versions into account.
46
+ - rename to @itwin/presentation-common
47
+ - Added `excludedClasses` attribute to `ContentInstancesOfSpecificClassesSpecification` and `InstanceNodesOfSpecificClassesSpecification` specifications.
48
+ - Added 'onlyIfNotHandled' property support to all content rule specifications
49
+ - Update `SelectClassInfo.pathFromInputToSelectClass` type definition to match reality - the relationship may not always be set.
50
+ - Clean up deprecated APIs
51
+ - Added API to get properties of all elements.
52
+ - Added `getContentSources` RPC to retrieve information about where content for specific types of elements comes from.
53
+ - Fixed processing of merged content values under nested content field.
54
+ - Remove ability to get multiple element properties over RPC.
55
+ - Add `getContentInstanceKeys` RPC to efficiently get content instance keys.
56
+ - Remove `priority` attribute from presentation request options type.
57
+ - Optimize `KeySetJSON` size by compressing instance IDs.
58
+ - Remove `PresentationRpcInterface.loadHierarchy`.
59
+ - The `condition` attribute should be defined on both `ChildNodeRule` and `RootNodeRule`.
60
+ - Added `ignoreCategories` parameter in `createFieldHierarchies` function for adding all of the nested properties to parent field's child fields without considering categories.
61
+ - Removed `PresentationUnitSystem` in favor of `UnitSystemKey` from `@itwin/core-quantity`.
62
+ - remove ClientRequestContext.current
4
63
 
5
64
  ## 2.19.28
6
65
  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"]}
@@ -148,6 +148,11 @@ export interface PropertyGroup extends GroupingSpecificationBase {
148
148
  * overridden to display grouped instances count.
149
149
  *
150
150
  * **Warning:** Grouping by label and sorting by property value is not possible.
151
+ *
152
+ * @deprecated Display value should always be used for grouping. In cases when there's a
153
+ * need to show grouped instances count suffix, that can be achieved at the UI component
154
+ * layer by composing UI node's label from node's display label and
155
+ * [GroupingNodeKey.groupedInstancesCount]($presentation-common).
151
156
  */
152
157
  groupingValue?: PropertyGroupingValue;
153
158
  /**
@@ -159,6 +164,8 @@ export interface PropertyGroup extends GroupingSpecificationBase {
159
164
  * property value as well.
160
165
  *
161
166
  * **Warning:** Grouping by label and sorting by property value is not possible.
167
+ *
168
+ * @deprecated Property grouping nodes should always be sorted by display label.
162
169
  */
163
170
  sortingValue?: PropertyGroupingValue;
164
171
  /** Ranges into which the grouping values are divided */
@@ -169,6 +176,7 @@ export interface PropertyGroup extends GroupingSpecificationBase {
169
176
  * for grouping and sorting
170
177
  *
171
178
  * @public
179
+ * @deprecated The attributes using this enum are deprecated.
172
180
  */
173
181
  export declare enum PropertyGroupingValue {
174
182
  /** By property value */
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ,EAAE,kBAAkB;IAChE,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC;IAE7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uEAAuE;IACvE,KAAK,EAAE,8BAA8B,CAAC;IAEtC,iFAAiF;IACjF,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG,UAAU,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAEhG;;;GAGG;AACH,oBAAY,0BAA0B;IACpC,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,iBAAiB,sBAAsB;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,2BAA2B;IAC3B,QAAQ,EAAE,0BAA0B,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,yBAAyB;IAC3D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,KAAK,CAAC;IAE3C,mFAAmF;IACnF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,8BAA8B,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAuB,SAAQ,yBAAyB;IACvE,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;IACvD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,sCAAsC,CAAC;CAC3D;AAED;;;GAGG;AACH,oBAAY,sCAAsC;IAChD,qCAAqC;IACrC,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,WAAW,gBAAgB;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,yBAAyB;IAC9D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAE9C;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kFAAkF;IAClF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC,wDAAwD;IACxD,MAAM,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAC5C;AAED;;;;;GAKG;AACH,oBAAY,qBAAqB;IAC/B,wBAAwB;IACxB,aAAa,kBAAkB;IAE/B,uBAAuB;IACvB,YAAY,iBAAiB;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"GroupingRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ,EAAE,kBAAkB;IAChE,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC;IAE7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uEAAuE;IACvE,KAAK,EAAE,8BAA8B,CAAC;IAEtC,iFAAiF;IACjF,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG,UAAU,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAEhG;;;GAGG;AACH,oBAAY,0BAA0B;IACpC,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,iBAAiB,sBAAsB;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,2BAA2B;IAC3B,QAAQ,EAAE,0BAA0B,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,yBAAyB;IAC3D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,KAAK,CAAC;IAE3C,mFAAmF;IACnF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,8BAA8B,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAuB,SAAQ,yBAAyB;IACvE,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;IACvD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,sCAAsC,CAAC;CAC3D;AAED;;;GAGG;AACH,oBAAY,sCAAsC;IAChD,qCAAqC;IACrC,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,WAAW,gBAAgB;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,yBAAyB;IAC9D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAE9C;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kFAAkF;IAClF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC,wDAAwD;IACxD,MAAM,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,wBAAwB;IACxB,aAAa,kBAAkB;IAE/B,uBAAuB;IACvB,YAAY,iBAAiB;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -40,6 +40,7 @@ var SameLabelInstanceGroupApplicationStage;
40
40
  * for grouping and sorting
41
41
  *
42
42
  * @public
43
+ * @deprecated The attributes using this enum are deprecated.
43
44
  */
44
45
  var PropertyGroupingValue;
45
46
  (function (PropertyGroupingValue) {
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAmDH;;;GAGG;AACH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,6CAAe,CAAA;IACf,mDAAqB,CAAA;IACrB,qEAAuC,CAAA;AACzC,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAgDD;;;GAGG;AACH,IAAY,sCAYX;AAZD,WAAY,sCAAsC;IAChD,qCAAqC;IACrC,yDAAe,CAAA;IAEf;;;;;;OAMG;IACH,qEAA2B,CAAA;AAC7B,CAAC,EAZW,sCAAsC,GAAtC,8CAAsC,KAAtC,8CAAsC,QAYjD;AAgED;;;;;GAKG;AACH,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wBAAwB;IACxB,wDAA+B,CAAA;IAE/B,uBAAuB;IACvB,sDAA6B,CAAA;AAC/B,CAAC,EANW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAMhC","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 { SingleSchemaClassSpecification } from \"../ClassSpecifications\";\r\nimport { ConditionContainer, RuleBase, RuleTypes } from \"../Rule\";\r\n\r\n/**\r\n * Grouping rule is an advanced way to configure node grouping.\r\n *\r\n * It allows to define these types of groupings:\r\n * - Group by base class.\r\n * - Group by any property of the instance by a common value or a range of values.\r\n * - Group multiple instances with the same label in to one ECInstance node. This can be used in cases when these\r\n * instances represent the same object for the user.\r\n *\r\n * The rule works in conjunction with other grouping options available in navigation specifications [[ChildNodeSpecification]]:\r\n * `groupByClass` and `groupByLabel`. The grouping hierarchy looks like this:\r\n * - Base ECClass grouping node (specified by base class grouping specification [[ClassGroup]])\r\n * - ECClass grouping node (specified by `groupByClass` property)\r\n * - ECProperty grouping node 1 (specified by 1st [[PropertyGroup]])\r\n * - ECProperty grouping node 2 (specified by 2nd [[PropertyGroup]])\r\n * - ECProperty grouping node n (specified by n-th [[PropertyGroup]])\r\n * - Display label grouping node (specified by `groupByLabel` property)\r\n * - ECInstance nodes (may be grouped under a single node by [[SameLabelInstanceGroup]])\r\n *\r\n * @see [More details]($docs/presentation/Hierarchies/GroupingRule.md)\r\n * @public\r\n */\r\nexport interface GroupingRule extends RuleBase, ConditionContainer {\r\n /** Used for serializing to JSON. */\r\n ruleType: RuleTypes.Grouping;\r\n\r\n /**\r\n * Defines a condition for the rule, which needs to be met in order to execute it. Condition\r\n * is an [ECExpression]($docs/presentation/Advanced/ECExpressions.md), which can use\r\n * a [limited set of symbols]($docs/presentation/Hierarchies/ECExpressions.md#rule-condition).\r\n */\r\n condition?: string;\r\n\r\n /** Specification of ECClass which should be grouped using this rule */\r\n class: SingleSchemaClassSpecification;\r\n\r\n /** Specifications of grouping which should be applied to matching ECInstances */\r\n groups: GroupingSpecification[];\r\n}\r\n\r\n/**\r\n * Grouping rule specifications\r\n * @public\r\n */\r\nexport declare type GroupingSpecification = ClassGroup | PropertyGroup | SameLabelInstanceGroup;\r\n\r\n/**\r\n * Available types of [[GroupingSpecification]]\r\n * @public\r\n */\r\nexport enum GroupingSpecificationTypes {\r\n Class = \"Class\",\r\n Property = \"Property\",\r\n SameLabelInstance = \"SameLabelInstance\",\r\n}\r\n\r\n/**\r\n * Base interface for all [[GroupingSpecification]] implementations. Not\r\n * meant to be used directly, see `GroupingSpecification`.\r\n *\r\n * @public\r\n */\r\nexport interface GroupingSpecificationBase {\r\n /** Type of the subclass */\r\n specType: GroupingSpecificationTypes;\r\n}\r\n\r\n/**\r\n * Allows grouping ECInstance nodes by their base class.\r\n * @public\r\n */\r\nexport interface ClassGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Class;\r\n\r\n /** Should the grouping node be created if there is only one item in that group. */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /** Specification of the base ECClass to group by. Defaults to rule's class. */\r\n baseClass?: SingleSchemaClassSpecification;\r\n}\r\n\r\n/**\r\n * Allows grouping multiple instances with the same label into one ECInstance node.\r\n * It can be used in cases when these instances represent the same object for the user.\r\n *\r\n * When multiple instances are grouped, an ECInstance node is created instead of a\r\n * grouping node and the ECInstance key for the node is assigned to key of one of grouped\r\n * instances.\r\n *\r\n * @public\r\n */\r\nexport interface SameLabelInstanceGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.SameLabelInstance;\r\n /**\r\n * Stage of hierarchy creation at which the rule is applied.\r\n * Defaults to [[SameLabelInstanceGroupApplicationStage.Query]].\r\n */\r\n applicationStage?: SameLabelInstanceGroupApplicationStage;\r\n}\r\n\r\n/**\r\n * Specifies hierarchy creation stages used to apply [[SameLabelInstanceGroup]] grouping.\r\n * @public\r\n */\r\nexport enum SameLabelInstanceGroupApplicationStage {\r\n /** Apply grouping at query stage. */\r\n Query = \"Query\",\r\n\r\n /**\r\n * Apply grouping at post-processing stage.\r\n *\r\n * This allows grouping nodes created by different hierarchy specifications at\r\n * a higher performance cost as it requires loading the whole hierarchy level before\r\n * returning even the first node - avoid using with large numbers of nodes.\r\n */\r\n PostProcess = \"PostProcess\",\r\n}\r\n\r\n/**\r\n * Allows grouping by property of the instance\r\n * by a common value or by range of values.\r\n *\r\n * @public\r\n */\r\nexport interface PropertyGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Property;\r\n\r\n /**\r\n * Name of the ECProperty which is used for grouping.\r\n *\r\n * @minLength 1\r\n */\r\n propertyName: string;\r\n\r\n /**\r\n * ID of an image to use for the grouping node\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /** Should the grouping node be created if there is only one item in that group */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /**\r\n * Should a separate grouping node be created for nodes whose grouping value is not\r\n * set or is an empty string.\r\n *\r\n * Defaults to `true`.\r\n */\r\n createGroupForUnspecifiedValues?: boolean;\r\n\r\n /**\r\n * Should the instances be grouped on display label or the grouping property value.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Grouping by property value is required if the display label is\r\n * overridden to display grouped instances count.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n */\r\n groupingValue?: PropertyGroupingValue;\r\n\r\n /**\r\n * Should the nodes be sorted by display label or the grouping property value. In most\r\n * cases the result is the same, unless [[LabelOverride]] rule is used to change the display label.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Sorting by property value only makes sense when instances are grouped by\r\n * property value as well.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n */\r\n sortingValue?: PropertyGroupingValue;\r\n\r\n /** Ranges into which the grouping values are divided */\r\n ranges?: PropertyRangeGroupSpecification[];\r\n}\r\n\r\n/**\r\n * Used in [[PropertyGroup]] to specify the type of value to use\r\n * for grouping and sorting\r\n *\r\n * @public\r\n */\r\nexport enum PropertyGroupingValue {\r\n /** By property value */\r\n PropertyValue = \"PropertyValue\",\r\n\r\n /** By display label */\r\n DisplayLabel = \"DisplayLabel\",\r\n}\r\n\r\n/**\r\n * Describes a grouping range\r\n * @public\r\n */\r\nexport interface PropertyRangeGroupSpecification {\r\n /**\r\n * ID of an image to use for the grouping node. Defaults to [[PropertyGroup.imageId]] specified in [[PropertyGroup]].\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /**\r\n * Grouping node label. May be [localized]($docs/presentation/Advanced/Localization.md).\r\n * Defaults to `{from value} - {to value}`\r\n *\r\n * @minLength 1\r\n */\r\n label?: string;\r\n\r\n /**\r\n * Value that defines the range start (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n fromValue: string;\r\n\r\n /**\r\n * Value that defines the range end (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n toValue: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"GroupingRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAmDH;;;GAGG;AACH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,6CAAe,CAAA;IACf,mDAAqB,CAAA;IACrB,qEAAuC,CAAA;AACzC,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAgDD;;;GAGG;AACH,IAAY,sCAYX;AAZD,WAAY,sCAAsC;IAChD,qCAAqC;IACrC,yDAAe,CAAA;IAEf;;;;;;OAMG;IACH,qEAA2B,CAAA;AAC7B,CAAC,EAZW,sCAAsC,GAAtC,8CAAsC,KAAtC,8CAAsC,QAYjD;AAuED;;;;;;GAMG;AACH,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wBAAwB;IACxB,wDAA+B,CAAA;IAE/B,uBAAuB;IACvB,sDAA6B,CAAA;AAC/B,CAAC,EANW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAMhC","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 { SingleSchemaClassSpecification } from \"../ClassSpecifications\";\r\nimport { ConditionContainer, RuleBase, RuleTypes } from \"../Rule\";\r\n\r\n/**\r\n * Grouping rule is an advanced way to configure node grouping.\r\n *\r\n * It allows to define these types of groupings:\r\n * - Group by base class.\r\n * - Group by any property of the instance by a common value or a range of values.\r\n * - Group multiple instances with the same label in to one ECInstance node. This can be used in cases when these\r\n * instances represent the same object for the user.\r\n *\r\n * The rule works in conjunction with other grouping options available in navigation specifications [[ChildNodeSpecification]]:\r\n * `groupByClass` and `groupByLabel`. The grouping hierarchy looks like this:\r\n * - Base ECClass grouping node (specified by base class grouping specification [[ClassGroup]])\r\n * - ECClass grouping node (specified by `groupByClass` property)\r\n * - ECProperty grouping node 1 (specified by 1st [[PropertyGroup]])\r\n * - ECProperty grouping node 2 (specified by 2nd [[PropertyGroup]])\r\n * - ECProperty grouping node n (specified by n-th [[PropertyGroup]])\r\n * - Display label grouping node (specified by `groupByLabel` property)\r\n * - ECInstance nodes (may be grouped under a single node by [[SameLabelInstanceGroup]])\r\n *\r\n * @see [More details]($docs/presentation/Hierarchies/GroupingRule.md)\r\n * @public\r\n */\r\nexport interface GroupingRule extends RuleBase, ConditionContainer {\r\n /** Used for serializing to JSON. */\r\n ruleType: RuleTypes.Grouping;\r\n\r\n /**\r\n * Defines a condition for the rule, which needs to be met in order to execute it. Condition\r\n * is an [ECExpression]($docs/presentation/Advanced/ECExpressions.md), which can use\r\n * a [limited set of symbols]($docs/presentation/Hierarchies/ECExpressions.md#rule-condition).\r\n */\r\n condition?: string;\r\n\r\n /** Specification of ECClass which should be grouped using this rule */\r\n class: SingleSchemaClassSpecification;\r\n\r\n /** Specifications of grouping which should be applied to matching ECInstances */\r\n groups: GroupingSpecification[];\r\n}\r\n\r\n/**\r\n * Grouping rule specifications\r\n * @public\r\n */\r\nexport declare type GroupingSpecification = ClassGroup | PropertyGroup | SameLabelInstanceGroup;\r\n\r\n/**\r\n * Available types of [[GroupingSpecification]]\r\n * @public\r\n */\r\nexport enum GroupingSpecificationTypes {\r\n Class = \"Class\",\r\n Property = \"Property\",\r\n SameLabelInstance = \"SameLabelInstance\",\r\n}\r\n\r\n/**\r\n * Base interface for all [[GroupingSpecification]] implementations. Not\r\n * meant to be used directly, see `GroupingSpecification`.\r\n *\r\n * @public\r\n */\r\nexport interface GroupingSpecificationBase {\r\n /** Type of the subclass */\r\n specType: GroupingSpecificationTypes;\r\n}\r\n\r\n/**\r\n * Allows grouping ECInstance nodes by their base class.\r\n * @public\r\n */\r\nexport interface ClassGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Class;\r\n\r\n /** Should the grouping node be created if there is only one item in that group. */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /** Specification of the base ECClass to group by. Defaults to rule's class. */\r\n baseClass?: SingleSchemaClassSpecification;\r\n}\r\n\r\n/**\r\n * Allows grouping multiple instances with the same label into one ECInstance node.\r\n * It can be used in cases when these instances represent the same object for the user.\r\n *\r\n * When multiple instances are grouped, an ECInstance node is created instead of a\r\n * grouping node and the ECInstance key for the node is assigned to key of one of grouped\r\n * instances.\r\n *\r\n * @public\r\n */\r\nexport interface SameLabelInstanceGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.SameLabelInstance;\r\n /**\r\n * Stage of hierarchy creation at which the rule is applied.\r\n * Defaults to [[SameLabelInstanceGroupApplicationStage.Query]].\r\n */\r\n applicationStage?: SameLabelInstanceGroupApplicationStage;\r\n}\r\n\r\n/**\r\n * Specifies hierarchy creation stages used to apply [[SameLabelInstanceGroup]] grouping.\r\n * @public\r\n */\r\nexport enum SameLabelInstanceGroupApplicationStage {\r\n /** Apply grouping at query stage. */\r\n Query = \"Query\",\r\n\r\n /**\r\n * Apply grouping at post-processing stage.\r\n *\r\n * This allows grouping nodes created by different hierarchy specifications at\r\n * a higher performance cost as it requires loading the whole hierarchy level before\r\n * returning even the first node - avoid using with large numbers of nodes.\r\n */\r\n PostProcess = \"PostProcess\",\r\n}\r\n\r\n/**\r\n * Allows grouping by property of the instance\r\n * by a common value or by range of values.\r\n *\r\n * @public\r\n */\r\nexport interface PropertyGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Property;\r\n\r\n /**\r\n * Name of the ECProperty which is used for grouping.\r\n *\r\n * @minLength 1\r\n */\r\n propertyName: string;\r\n\r\n /**\r\n * ID of an image to use for the grouping node\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /** Should the grouping node be created if there is only one item in that group */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /**\r\n * Should a separate grouping node be created for nodes whose grouping value is not\r\n * set or is an empty string.\r\n *\r\n * Defaults to `true`.\r\n */\r\n createGroupForUnspecifiedValues?: boolean;\r\n\r\n /**\r\n * Should the instances be grouped on display label or the grouping property value.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Grouping by property value is required if the display label is\r\n * overridden to display grouped instances count.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n *\r\n * @deprecated Display value should always be used for grouping. In cases when there's a\r\n * need to show grouped instances count suffix, that can be achieved at the UI component\r\n * layer by composing UI node's label from node's display label and\r\n * [GroupingNodeKey.groupedInstancesCount]($presentation-common).\r\n */\r\n groupingValue?: PropertyGroupingValue; // eslint-disable-line deprecation/deprecation\r\n\r\n /**\r\n * Should the nodes be sorted by display label or the grouping property value. In most\r\n * cases the result is the same, unless [[LabelOverride]] rule is used to change the display label.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Sorting by property value only makes sense when instances are grouped by\r\n * property value as well.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n *\r\n * @deprecated Property grouping nodes should always be sorted by display label.\r\n */\r\n sortingValue?: PropertyGroupingValue; // eslint-disable-line deprecation/deprecation\r\n\r\n /** Ranges into which the grouping values are divided */\r\n ranges?: PropertyRangeGroupSpecification[];\r\n}\r\n\r\n/**\r\n * Used in [[PropertyGroup]] to specify the type of value to use\r\n * for grouping and sorting\r\n *\r\n * @public\r\n * @deprecated The attributes using this enum are deprecated.\r\n */\r\nexport enum PropertyGroupingValue {\r\n /** By property value */\r\n PropertyValue = \"PropertyValue\",\r\n\r\n /** By display label */\r\n DisplayLabel = \"DisplayLabel\",\r\n}\r\n\r\n/**\r\n * Describes a grouping range\r\n * @public\r\n */\r\nexport interface PropertyRangeGroupSpecification {\r\n /**\r\n * ID of an image to use for the grouping node. Defaults to [[PropertyGroup.imageId]] specified in [[PropertyGroup]].\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /**\r\n * Grouping node label. May be [localized]($docs/presentation/Advanced/Localization.md).\r\n * Defaults to `{from value} - {to value}`\r\n *\r\n * @minLength 1\r\n */\r\n label?: string;\r\n\r\n /**\r\n * Value that defines the range start (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n fromValue: string;\r\n\r\n /**\r\n * Value that defines the range end (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n toValue: string;\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"]}
@@ -148,6 +148,11 @@ export interface PropertyGroup extends GroupingSpecificationBase {
148
148
  * overridden to display grouped instances count.
149
149
  *
150
150
  * **Warning:** Grouping by label and sorting by property value is not possible.
151
+ *
152
+ * @deprecated Display value should always be used for grouping. In cases when there's a
153
+ * need to show grouped instances count suffix, that can be achieved at the UI component
154
+ * layer by composing UI node's label from node's display label and
155
+ * [GroupingNodeKey.groupedInstancesCount]($presentation-common).
151
156
  */
152
157
  groupingValue?: PropertyGroupingValue;
153
158
  /**
@@ -159,6 +164,8 @@ export interface PropertyGroup extends GroupingSpecificationBase {
159
164
  * property value as well.
160
165
  *
161
166
  * **Warning:** Grouping by label and sorting by property value is not possible.
167
+ *
168
+ * @deprecated Property grouping nodes should always be sorted by display label.
162
169
  */
163
170
  sortingValue?: PropertyGroupingValue;
164
171
  /** Ranges into which the grouping values are divided */
@@ -169,6 +176,7 @@ export interface PropertyGroup extends GroupingSpecificationBase {
169
176
  * for grouping and sorting
170
177
  *
171
178
  * @public
179
+ * @deprecated The attributes using this enum are deprecated.
172
180
  */
173
181
  export declare enum PropertyGroupingValue {
174
182
  /** By property value */
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ,EAAE,kBAAkB;IAChE,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC;IAE7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uEAAuE;IACvE,KAAK,EAAE,8BAA8B,CAAC;IAEtC,iFAAiF;IACjF,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG,UAAU,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAEhG;;;GAGG;AACH,oBAAY,0BAA0B;IACpC,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,iBAAiB,sBAAsB;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,2BAA2B;IAC3B,QAAQ,EAAE,0BAA0B,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,yBAAyB;IAC3D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,KAAK,CAAC;IAE3C,mFAAmF;IACnF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,8BAA8B,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAuB,SAAQ,yBAAyB;IACvE,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;IACvD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,sCAAsC,CAAC;CAC3D;AAED;;;GAGG;AACH,oBAAY,sCAAsC;IAChD,qCAAqC;IACrC,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,WAAW,gBAAgB;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,yBAAyB;IAC9D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAE9C;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kFAAkF;IAClF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC,wDAAwD;IACxD,MAAM,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAC5C;AAED;;;;;GAKG;AACH,oBAAY,qBAAqB;IAC/B,wBAAwB;IACxB,aAAa,kBAAkB;IAE/B,uBAAuB;IACvB,YAAY,iBAAiB;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"GroupingRule.d.ts","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ,EAAE,kBAAkB;IAChE,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC;IAE7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uEAAuE;IACvE,KAAK,EAAE,8BAA8B,CAAC;IAEtC,iFAAiF;IACjF,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG,UAAU,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAEhG;;;GAGG;AACH,oBAAY,0BAA0B;IACpC,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,iBAAiB,sBAAsB;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,2BAA2B;IAC3B,QAAQ,EAAE,0BAA0B,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,yBAAyB;IAC3D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,KAAK,CAAC;IAE3C,mFAAmF;IACnF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,8BAA8B,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAuB,SAAQ,yBAAyB;IACvE,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;IACvD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,sCAAsC,CAAC;CAC3D;AAED;;;GAGG;AACH,oBAAY,sCAAsC;IAChD,qCAAqC;IACrC,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,WAAW,gBAAgB;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,yBAAyB;IAC9D,oCAAoC;IACpC,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAE9C;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kFAAkF;IAClF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC,wDAAwD;IACxD,MAAM,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,wBAAwB;IACxB,aAAa,kBAAkB;IAE/B,uBAAuB;IACvB,YAAY,iBAAiB;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -37,6 +37,7 @@ export var SameLabelInstanceGroupApplicationStage;
37
37
  * for grouping and sorting
38
38
  *
39
39
  * @public
40
+ * @deprecated The attributes using this enum are deprecated.
40
41
  */
41
42
  export var PropertyGroupingValue;
42
43
  (function (PropertyGroupingValue) {
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAmDH;;;GAGG;AACH,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,6CAAe,CAAA;IACf,mDAAqB,CAAA;IACrB,qEAAuC,CAAA;AACzC,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAgDD;;;GAGG;AACH,MAAM,CAAN,IAAY,sCAYX;AAZD,WAAY,sCAAsC;IAChD,qCAAqC;IACrC,yDAAe,CAAA;IAEf;;;;;;OAMG;IACH,qEAA2B,CAAA;AAC7B,CAAC,EAZW,sCAAsC,KAAtC,sCAAsC,QAYjD;AAgED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wBAAwB;IACxB,wDAA+B,CAAA;IAE/B,uBAAuB;IACvB,sDAA6B,CAAA;AAC/B,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC","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 { SingleSchemaClassSpecification } from \"../ClassSpecifications\";\r\nimport { ConditionContainer, RuleBase, RuleTypes } from \"../Rule\";\r\n\r\n/**\r\n * Grouping rule is an advanced way to configure node grouping.\r\n *\r\n * It allows to define these types of groupings:\r\n * - Group by base class.\r\n * - Group by any property of the instance by a common value or a range of values.\r\n * - Group multiple instances with the same label in to one ECInstance node. This can be used in cases when these\r\n * instances represent the same object for the user.\r\n *\r\n * The rule works in conjunction with other grouping options available in navigation specifications [[ChildNodeSpecification]]:\r\n * `groupByClass` and `groupByLabel`. The grouping hierarchy looks like this:\r\n * - Base ECClass grouping node (specified by base class grouping specification [[ClassGroup]])\r\n * - ECClass grouping node (specified by `groupByClass` property)\r\n * - ECProperty grouping node 1 (specified by 1st [[PropertyGroup]])\r\n * - ECProperty grouping node 2 (specified by 2nd [[PropertyGroup]])\r\n * - ECProperty grouping node n (specified by n-th [[PropertyGroup]])\r\n * - Display label grouping node (specified by `groupByLabel` property)\r\n * - ECInstance nodes (may be grouped under a single node by [[SameLabelInstanceGroup]])\r\n *\r\n * @see [More details]($docs/presentation/Hierarchies/GroupingRule.md)\r\n * @public\r\n */\r\nexport interface GroupingRule extends RuleBase, ConditionContainer {\r\n /** Used for serializing to JSON. */\r\n ruleType: RuleTypes.Grouping;\r\n\r\n /**\r\n * Defines a condition for the rule, which needs to be met in order to execute it. Condition\r\n * is an [ECExpression]($docs/presentation/Advanced/ECExpressions.md), which can use\r\n * a [limited set of symbols]($docs/presentation/Hierarchies/ECExpressions.md#rule-condition).\r\n */\r\n condition?: string;\r\n\r\n /** Specification of ECClass which should be grouped using this rule */\r\n class: SingleSchemaClassSpecification;\r\n\r\n /** Specifications of grouping which should be applied to matching ECInstances */\r\n groups: GroupingSpecification[];\r\n}\r\n\r\n/**\r\n * Grouping rule specifications\r\n * @public\r\n */\r\nexport declare type GroupingSpecification = ClassGroup | PropertyGroup | SameLabelInstanceGroup;\r\n\r\n/**\r\n * Available types of [[GroupingSpecification]]\r\n * @public\r\n */\r\nexport enum GroupingSpecificationTypes {\r\n Class = \"Class\",\r\n Property = \"Property\",\r\n SameLabelInstance = \"SameLabelInstance\",\r\n}\r\n\r\n/**\r\n * Base interface for all [[GroupingSpecification]] implementations. Not\r\n * meant to be used directly, see `GroupingSpecification`.\r\n *\r\n * @public\r\n */\r\nexport interface GroupingSpecificationBase {\r\n /** Type of the subclass */\r\n specType: GroupingSpecificationTypes;\r\n}\r\n\r\n/**\r\n * Allows grouping ECInstance nodes by their base class.\r\n * @public\r\n */\r\nexport interface ClassGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Class;\r\n\r\n /** Should the grouping node be created if there is only one item in that group. */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /** Specification of the base ECClass to group by. Defaults to rule's class. */\r\n baseClass?: SingleSchemaClassSpecification;\r\n}\r\n\r\n/**\r\n * Allows grouping multiple instances with the same label into one ECInstance node.\r\n * It can be used in cases when these instances represent the same object for the user.\r\n *\r\n * When multiple instances are grouped, an ECInstance node is created instead of a\r\n * grouping node and the ECInstance key for the node is assigned to key of one of grouped\r\n * instances.\r\n *\r\n * @public\r\n */\r\nexport interface SameLabelInstanceGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.SameLabelInstance;\r\n /**\r\n * Stage of hierarchy creation at which the rule is applied.\r\n * Defaults to [[SameLabelInstanceGroupApplicationStage.Query]].\r\n */\r\n applicationStage?: SameLabelInstanceGroupApplicationStage;\r\n}\r\n\r\n/**\r\n * Specifies hierarchy creation stages used to apply [[SameLabelInstanceGroup]] grouping.\r\n * @public\r\n */\r\nexport enum SameLabelInstanceGroupApplicationStage {\r\n /** Apply grouping at query stage. */\r\n Query = \"Query\",\r\n\r\n /**\r\n * Apply grouping at post-processing stage.\r\n *\r\n * This allows grouping nodes created by different hierarchy specifications at\r\n * a higher performance cost as it requires loading the whole hierarchy level before\r\n * returning even the first node - avoid using with large numbers of nodes.\r\n */\r\n PostProcess = \"PostProcess\",\r\n}\r\n\r\n/**\r\n * Allows grouping by property of the instance\r\n * by a common value or by range of values.\r\n *\r\n * @public\r\n */\r\nexport interface PropertyGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Property;\r\n\r\n /**\r\n * Name of the ECProperty which is used for grouping.\r\n *\r\n * @minLength 1\r\n */\r\n propertyName: string;\r\n\r\n /**\r\n * ID of an image to use for the grouping node\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /** Should the grouping node be created if there is only one item in that group */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /**\r\n * Should a separate grouping node be created for nodes whose grouping value is not\r\n * set or is an empty string.\r\n *\r\n * Defaults to `true`.\r\n */\r\n createGroupForUnspecifiedValues?: boolean;\r\n\r\n /**\r\n * Should the instances be grouped on display label or the grouping property value.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Grouping by property value is required if the display label is\r\n * overridden to display grouped instances count.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n */\r\n groupingValue?: PropertyGroupingValue;\r\n\r\n /**\r\n * Should the nodes be sorted by display label or the grouping property value. In most\r\n * cases the result is the same, unless [[LabelOverride]] rule is used to change the display label.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Sorting by property value only makes sense when instances are grouped by\r\n * property value as well.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n */\r\n sortingValue?: PropertyGroupingValue;\r\n\r\n /** Ranges into which the grouping values are divided */\r\n ranges?: PropertyRangeGroupSpecification[];\r\n}\r\n\r\n/**\r\n * Used in [[PropertyGroup]] to specify the type of value to use\r\n * for grouping and sorting\r\n *\r\n * @public\r\n */\r\nexport enum PropertyGroupingValue {\r\n /** By property value */\r\n PropertyValue = \"PropertyValue\",\r\n\r\n /** By display label */\r\n DisplayLabel = \"DisplayLabel\",\r\n}\r\n\r\n/**\r\n * Describes a grouping range\r\n * @public\r\n */\r\nexport interface PropertyRangeGroupSpecification {\r\n /**\r\n * ID of an image to use for the grouping node. Defaults to [[PropertyGroup.imageId]] specified in [[PropertyGroup]].\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /**\r\n * Grouping node label. May be [localized]($docs/presentation/Advanced/Localization.md).\r\n * Defaults to `{from value} - {to value}`\r\n *\r\n * @minLength 1\r\n */\r\n label?: string;\r\n\r\n /**\r\n * Value that defines the range start (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n fromValue: string;\r\n\r\n /**\r\n * Value that defines the range end (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n toValue: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"GroupingRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAmDH;;;GAGG;AACH,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,6CAAe,CAAA;IACf,mDAAqB,CAAA;IACrB,qEAAuC,CAAA;AACzC,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAgDD;;;GAGG;AACH,MAAM,CAAN,IAAY,sCAYX;AAZD,WAAY,sCAAsC;IAChD,qCAAqC;IACrC,yDAAe,CAAA;IAEf;;;;;;OAMG;IACH,qEAA2B,CAAA;AAC7B,CAAC,EAZW,sCAAsC,KAAtC,sCAAsC,QAYjD;AAuED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wBAAwB;IACxB,wDAA+B,CAAA;IAE/B,uBAAuB;IACvB,sDAA6B,CAAA;AAC/B,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC","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 { SingleSchemaClassSpecification } from \"../ClassSpecifications\";\r\nimport { ConditionContainer, RuleBase, RuleTypes } from \"../Rule\";\r\n\r\n/**\r\n * Grouping rule is an advanced way to configure node grouping.\r\n *\r\n * It allows to define these types of groupings:\r\n * - Group by base class.\r\n * - Group by any property of the instance by a common value or a range of values.\r\n * - Group multiple instances with the same label in to one ECInstance node. This can be used in cases when these\r\n * instances represent the same object for the user.\r\n *\r\n * The rule works in conjunction with other grouping options available in navigation specifications [[ChildNodeSpecification]]:\r\n * `groupByClass` and `groupByLabel`. The grouping hierarchy looks like this:\r\n * - Base ECClass grouping node (specified by base class grouping specification [[ClassGroup]])\r\n * - ECClass grouping node (specified by `groupByClass` property)\r\n * - ECProperty grouping node 1 (specified by 1st [[PropertyGroup]])\r\n * - ECProperty grouping node 2 (specified by 2nd [[PropertyGroup]])\r\n * - ECProperty grouping node n (specified by n-th [[PropertyGroup]])\r\n * - Display label grouping node (specified by `groupByLabel` property)\r\n * - ECInstance nodes (may be grouped under a single node by [[SameLabelInstanceGroup]])\r\n *\r\n * @see [More details]($docs/presentation/Hierarchies/GroupingRule.md)\r\n * @public\r\n */\r\nexport interface GroupingRule extends RuleBase, ConditionContainer {\r\n /** Used for serializing to JSON. */\r\n ruleType: RuleTypes.Grouping;\r\n\r\n /**\r\n * Defines a condition for the rule, which needs to be met in order to execute it. Condition\r\n * is an [ECExpression]($docs/presentation/Advanced/ECExpressions.md), which can use\r\n * a [limited set of symbols]($docs/presentation/Hierarchies/ECExpressions.md#rule-condition).\r\n */\r\n condition?: string;\r\n\r\n /** Specification of ECClass which should be grouped using this rule */\r\n class: SingleSchemaClassSpecification;\r\n\r\n /** Specifications of grouping which should be applied to matching ECInstances */\r\n groups: GroupingSpecification[];\r\n}\r\n\r\n/**\r\n * Grouping rule specifications\r\n * @public\r\n */\r\nexport declare type GroupingSpecification = ClassGroup | PropertyGroup | SameLabelInstanceGroup;\r\n\r\n/**\r\n * Available types of [[GroupingSpecification]]\r\n * @public\r\n */\r\nexport enum GroupingSpecificationTypes {\r\n Class = \"Class\",\r\n Property = \"Property\",\r\n SameLabelInstance = \"SameLabelInstance\",\r\n}\r\n\r\n/**\r\n * Base interface for all [[GroupingSpecification]] implementations. Not\r\n * meant to be used directly, see `GroupingSpecification`.\r\n *\r\n * @public\r\n */\r\nexport interface GroupingSpecificationBase {\r\n /** Type of the subclass */\r\n specType: GroupingSpecificationTypes;\r\n}\r\n\r\n/**\r\n * Allows grouping ECInstance nodes by their base class.\r\n * @public\r\n */\r\nexport interface ClassGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Class;\r\n\r\n /** Should the grouping node be created if there is only one item in that group. */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /** Specification of the base ECClass to group by. Defaults to rule's class. */\r\n baseClass?: SingleSchemaClassSpecification;\r\n}\r\n\r\n/**\r\n * Allows grouping multiple instances with the same label into one ECInstance node.\r\n * It can be used in cases when these instances represent the same object for the user.\r\n *\r\n * When multiple instances are grouped, an ECInstance node is created instead of a\r\n * grouping node and the ECInstance key for the node is assigned to key of one of grouped\r\n * instances.\r\n *\r\n * @public\r\n */\r\nexport interface SameLabelInstanceGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.SameLabelInstance;\r\n /**\r\n * Stage of hierarchy creation at which the rule is applied.\r\n * Defaults to [[SameLabelInstanceGroupApplicationStage.Query]].\r\n */\r\n applicationStage?: SameLabelInstanceGroupApplicationStage;\r\n}\r\n\r\n/**\r\n * Specifies hierarchy creation stages used to apply [[SameLabelInstanceGroup]] grouping.\r\n * @public\r\n */\r\nexport enum SameLabelInstanceGroupApplicationStage {\r\n /** Apply grouping at query stage. */\r\n Query = \"Query\",\r\n\r\n /**\r\n * Apply grouping at post-processing stage.\r\n *\r\n * This allows grouping nodes created by different hierarchy specifications at\r\n * a higher performance cost as it requires loading the whole hierarchy level before\r\n * returning even the first node - avoid using with large numbers of nodes.\r\n */\r\n PostProcess = \"PostProcess\",\r\n}\r\n\r\n/**\r\n * Allows grouping by property of the instance\r\n * by a common value or by range of values.\r\n *\r\n * @public\r\n */\r\nexport interface PropertyGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: GroupingSpecificationTypes.Property;\r\n\r\n /**\r\n * Name of the ECProperty which is used for grouping.\r\n *\r\n * @minLength 1\r\n */\r\n propertyName: string;\r\n\r\n /**\r\n * ID of an image to use for the grouping node\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /** Should the grouping node be created if there is only one item in that group */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /**\r\n * Should a separate grouping node be created for nodes whose grouping value is not\r\n * set or is an empty string.\r\n *\r\n * Defaults to `true`.\r\n */\r\n createGroupForUnspecifiedValues?: boolean;\r\n\r\n /**\r\n * Should the instances be grouped on display label or the grouping property value.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Grouping by property value is required if the display label is\r\n * overridden to display grouped instances count.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n *\r\n * @deprecated Display value should always be used for grouping. In cases when there's a\r\n * need to show grouped instances count suffix, that can be achieved at the UI component\r\n * layer by composing UI node's label from node's display label and\r\n * [GroupingNodeKey.groupedInstancesCount]($presentation-common).\r\n */\r\n groupingValue?: PropertyGroupingValue; // eslint-disable-line deprecation/deprecation\r\n\r\n /**\r\n * Should the nodes be sorted by display label or the grouping property value. In most\r\n * cases the result is the same, unless [[LabelOverride]] rule is used to change the display label.\r\n * Defaults to [[PropertyGroupingValue.DisplayLabel]].\r\n *\r\n * **Note:** Sorting by property value only makes sense when instances are grouped by\r\n * property value as well.\r\n *\r\n * **Warning:** Grouping by label and sorting by property value is not possible.\r\n *\r\n * @deprecated Property grouping nodes should always be sorted by display label.\r\n */\r\n sortingValue?: PropertyGroupingValue; // eslint-disable-line deprecation/deprecation\r\n\r\n /** Ranges into which the grouping values are divided */\r\n ranges?: PropertyRangeGroupSpecification[];\r\n}\r\n\r\n/**\r\n * Used in [[PropertyGroup]] to specify the type of value to use\r\n * for grouping and sorting\r\n *\r\n * @public\r\n * @deprecated The attributes using this enum are deprecated.\r\n */\r\nexport enum PropertyGroupingValue {\r\n /** By property value */\r\n PropertyValue = \"PropertyValue\",\r\n\r\n /** By display label */\r\n DisplayLabel = \"DisplayLabel\",\r\n}\r\n\r\n/**\r\n * Describes a grouping range\r\n * @public\r\n */\r\nexport interface PropertyRangeGroupSpecification {\r\n /**\r\n * ID of an image to use for the grouping node. Defaults to [[PropertyGroup.imageId]] specified in [[PropertyGroup]].\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /**\r\n * Grouping node label. May be [localized]($docs/presentation/Advanced/Localization.md).\r\n * Defaults to `{from value} - {to value}`\r\n *\r\n * @minLength 1\r\n */\r\n label?: string;\r\n\r\n /**\r\n * Value that defines the range start (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n fromValue: string;\r\n\r\n /**\r\n * Value that defines the range end (inclusive)\r\n *\r\n * @minLength 1\r\n */\r\n toValue: string;\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.8",
3
+ "version": "3.1.2",
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.8",
26
- "@itwin/core-common": "^3.1.0-dev.8",
27
- "@itwin/core-quantity": "^3.1.0-dev.8"
25
+ "@itwin/core-bentley": "^3.1.2",
26
+ "@itwin/core-common": "^3.1.2",
27
+ "@itwin/core-quantity": "^3.1.2"
28
28
  },
29
29
  "devDependencies": {
30
- "@itwin/build-tools": "3.1.0-dev.8",
31
- "@itwin/core-bentley": "3.1.0-dev.8",
32
- "@itwin/core-common": "3.1.0-dev.8",
33
- "@itwin/core-quantity": "3.1.0-dev.8",
34
- "@itwin/eslint-plugin": "3.1.0-dev.8",
30
+ "@itwin/build-tools": "3.1.2",
31
+ "@itwin/core-bentley": "3.1.2",
32
+ "@itwin/core-common": "3.1.2",
33
+ "@itwin/core-quantity": "3.1.2",
34
+ "@itwin/eslint-plugin": "3.1.2",
35
35
  "@types/chai": "^4.1.4",
36
36
  "@types/chai-as-promised": "^7",
37
37
  "@types/chai-jest-snapshot": "^1.3.0",