@itwin/presentation-common 4.10.0-dev.32 → 4.10.0-dev.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  2. package/lib/cjs/presentation-common/EC.js +4 -4
  3. package/lib/cjs/presentation-common/EC.js.map +1 -1
  4. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  5. package/lib/cjs/presentation-common/Error.js +0 -1
  6. package/lib/cjs/presentation-common/Error.js.map +1 -1
  7. package/lib/cjs/presentation-common/KeySet.js +5 -5
  8. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  9. package/lib/cjs/presentation-common/LabelDefinition.js +4 -4
  10. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  11. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +3 -3
  12. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  13. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  14. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  15. package/lib/cjs/presentation-common/PresentationRpcInterface.js +4 -5
  16. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  17. package/lib/cjs/presentation-common/RpcRequestsHandler.js +5 -5
  18. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  19. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  20. package/lib/cjs/presentation-common/RulesetsFactory.js +0 -1
  21. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  22. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  23. package/lib/cjs/presentation-common/Update.js +14 -14
  24. package/lib/cjs/presentation-common/Update.js.map +1 -1
  25. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +1 -1
  26. package/lib/cjs/presentation-common/content/ContentTraverser.js +2 -2
  27. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  28. package/lib/cjs/presentation-common/content/Descriptor.js +6 -6
  29. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  30. package/lib/cjs/presentation-common/content/DisplayTypes.d.ts +1 -1
  31. package/lib/cjs/presentation-common/content/DisplayTypes.d.ts.map +1 -1
  32. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  33. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  34. package/lib/cjs/presentation-common/content/Fields.js +2 -2
  35. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  36. package/lib/cjs/presentation-common/content/Item.js +7 -7
  37. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  38. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  39. package/lib/cjs/presentation-common/content/Value.js +34 -34
  40. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  41. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +2 -2
  42. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  43. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  44. package/lib/cjs/presentation-common/hierarchy/Key.js +8 -8
  45. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  46. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  47. package/lib/cjs/presentation-common/hierarchy/Node.js +9 -9
  48. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  49. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +13 -13
  50. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  51. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  52. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  53. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  54. package/lib/esm/presentation-common/EC.js +4 -4
  55. package/lib/esm/presentation-common/EC.js.map +1 -1
  56. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  57. package/lib/esm/presentation-common/Error.js +0 -1
  58. package/lib/esm/presentation-common/Error.js.map +1 -1
  59. package/lib/esm/presentation-common/KeySet.js +5 -5
  60. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  61. package/lib/esm/presentation-common/LabelDefinition.js +4 -4
  62. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  63. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +3 -3
  64. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  65. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  66. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  67. package/lib/esm/presentation-common/PresentationRpcInterface.js +4 -5
  68. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  69. package/lib/esm/presentation-common/RpcRequestsHandler.js +5 -5
  70. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  71. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  72. package/lib/esm/presentation-common/RulesetsFactory.js +0 -1
  73. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  74. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  75. package/lib/esm/presentation-common/Update.js +14 -14
  76. package/lib/esm/presentation-common/Update.js.map +1 -1
  77. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +1 -1
  78. package/lib/esm/presentation-common/content/ContentTraverser.js +2 -2
  79. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  80. package/lib/esm/presentation-common/content/Descriptor.js +6 -6
  81. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  82. package/lib/esm/presentation-common/content/DisplayTypes.d.ts +1 -1
  83. package/lib/esm/presentation-common/content/DisplayTypes.d.ts.map +1 -1
  84. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  85. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  86. package/lib/esm/presentation-common/content/Fields.js +2 -2
  87. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  88. package/lib/esm/presentation-common/content/Item.js +7 -7
  89. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  90. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  91. package/lib/esm/presentation-common/content/Value.js +34 -34
  92. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  93. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +2 -2
  94. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  95. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  96. package/lib/esm/presentation-common/hierarchy/Key.js +8 -8
  97. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  98. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  99. package/lib/esm/presentation-common/hierarchy/Node.js +9 -9
  100. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  101. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +13 -13
  102. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  103. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  104. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  105. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"CustomizationRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/CustomizationRule.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 { NodeArtifactsRule } from \"../hierarchy/NodeArtifactsRule\";\r\nimport { CheckBoxRule } from \"./CheckBoxRule\";\r\nimport { ExtendedDataRule } from \"./ExtendedDataRule\";\r\nimport { GroupingRule } from \"./GroupingRule\";\r\nimport { ImageIdOverride } from \"./ImageIdOverride\";\r\nimport { InstanceLabelOverride } from \"./InstanceLabelOverride\";\r\nimport { LabelOverride } from \"./LabelOverride\";\r\nimport { SortingRule } from \"./SortingRule\";\r\nimport { StyleOverride } from \"./StyleOverride\";\r\n\r\n/**\r\n * Customization rules allow customizing each node or content item separately.\r\n * Most of the rules have a `condition` property which uses [ECExpressions]($docs/presentation/customization/ECExpressions.md)\r\n * for conditional rule filtering.\r\n *\r\n * **Nested customization rules:**\r\n *\r\n * Customization rules may be specified at ruleset level, in which case they're\r\n * applied to all content produced by the ruleset, or nested under navigation rules,\r\n * in which case they're applied only for nodes created by those rules.\r\n *\r\n * **Customization rule priorities:**\r\n *\r\n * Customization rules have a `priority` attribute which defines the order in which they're applied. If priorities match,\r\n * rules engine looks at the nesting level - the deeper the rule is nested, the higher is its `priority`.\r\n * If the nesting levels also match, the rule defined first wins.\r\n *\r\n * @public\r\n */\r\nexport declare type CustomizationRule =\r\n | InstanceLabelOverride\r\n | CheckBoxRule // eslint-disable-line deprecation/deprecation\r\n | GroupingRule\r\n | ImageIdOverride // eslint-disable-line deprecation/deprecation\r\n | LabelOverride // eslint-disable-line deprecation/deprecation\r\n | SortingRule\r\n | StyleOverride // eslint-disable-line deprecation/deprecation\r\n | ExtendedDataRule\r\n | NodeArtifactsRule;\r\n"]}
1
+ {"version":3,"file":"CustomizationRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/CustomizationRule.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 { NodeArtifactsRule } from \"../hierarchy/NodeArtifactsRule\";\r\nimport { CheckBoxRule } from \"./CheckBoxRule\";\r\nimport { ExtendedDataRule } from \"./ExtendedDataRule\";\r\nimport { GroupingRule } from \"./GroupingRule\";\r\nimport { ImageIdOverride } from \"./ImageIdOverride\";\r\nimport { InstanceLabelOverride } from \"./InstanceLabelOverride\";\r\nimport { LabelOverride } from \"./LabelOverride\";\r\nimport { SortingRule } from \"./SortingRule\";\r\nimport { StyleOverride } from \"./StyleOverride\";\r\n\r\n/**\r\n * Customization rules allow customizing each node or content item separately.\r\n * Most of the rules have a `condition` property which uses [ECExpressions]($docs/presentation/customization/ECExpressions.md)\r\n * for conditional rule filtering.\r\n *\r\n * **Nested customization rules:**\r\n *\r\n * Customization rules may be specified at ruleset level, in which case they're\r\n * applied to all content produced by the ruleset, or nested under navigation rules,\r\n * in which case they're applied only for nodes created by those rules.\r\n *\r\n * **Customization rule priorities:**\r\n *\r\n * Customization rules have a `priority` attribute which defines the order in which they're applied. If priorities match,\r\n * rules engine looks at the nesting level - the deeper the rule is nested, the higher is its `priority`.\r\n * If the nesting levels also match, the rule defined first wins.\r\n *\r\n * @public\r\n */\r\nexport declare type CustomizationRule =\r\n | InstanceLabelOverride\r\n | CheckBoxRule // eslint-disable-line @typescript-eslint/no-deprecated\r\n | GroupingRule\r\n | ImageIdOverride // eslint-disable-line @typescript-eslint/no-deprecated\r\n | LabelOverride // eslint-disable-line @typescript-eslint/no-deprecated\r\n | SortingRule\r\n | StyleOverride // eslint-disable-line @typescript-eslint/no-deprecated\r\n | ExtendedDataRule\r\n | NodeArtifactsRule;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/customization/GroupingRule.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAsCH;;;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;AAgED;;;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;AAyDD;;;;;;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 { RuleBase } from \"../Rule\";\r\n\r\n/**\r\n * Grouping rules provide advanced ways to group instances when creating hierarchies.\r\n *\r\n * @see [Grouping rule reference documentation page]($docs/presentation/hierarchies/GroupingRule.md)\r\n * @public\r\n */\r\nexport interface GroupingRule extends RuleBase {\r\n /** Used for serializing to JSON. */\r\n ruleType: \"Grouping\";\r\n\r\n /**\r\n * An [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#rule-condition) that results in\r\n * a boolean value. If specified, the grouping rule applies only to instance nodes that cause the condition\r\n * to evaluate to `true`.\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 /**\r\n * Specifies a list of [grouping specifications]($docs/presentation/hierarchies/GroupingRule.md#grouping-specifications)\r\n * which describe the kind of grouping that should be applied.\r\n */\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 /**\r\n * Type of the subclass\r\n * @see GroupingSpecificationTypes\r\n */\r\n specType: `${GroupingSpecificationTypes}`;\r\n}\r\n\r\n/**\r\n * Base class grouping allows grouping ECInstance nodes by their base class (as opposed to the hierarchy\r\n * specifications' `groupByClass` attribute, which always groups by direct class).\r\n *\r\n * @see [Base class grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#base-class-grouping)\r\n * @public\r\n */\r\nexport interface ClassGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: \"Class\";\r\n\r\n /** Specifies whether a grouping node should be created if there is only one item in that group. */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /**\r\n * Specification of the base ECClass to group by. If specified, allows grouping by a subclass of the class\r\n * specified by rule's `class` attribute.\r\n */\r\n baseClass?: SingleSchemaClassSpecification;\r\n}\r\n\r\n/**\r\n * Allows grouping multiple instances with the same label into one ECInstances type of node. Similar to display label grouping,\r\n * but instead of showing a grouping node with multiple grouped ECInstance nodes, it shows a single ECInstances node which represents\r\n * multiple ECInstances.\r\n *\r\n * @see [Same label instance grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#same-label-instance-grouping)\r\n * @public\r\n */\r\nexport interface SameLabelInstanceGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: \"SameLabelInstance\";\r\n\r\n /**\r\n * Grouping nodes by label is an expensive operation because it requires the whole hierarchy level to be created before even the first\r\n * grouped node can be produced. To alleviate the performance impact when this specification is used, two `applicationStage` settings have been introduced:\r\n *\r\n * - `\"Query\"` groups instances during ECSql query, which can often make use of database indices and is generally fairly quick. It is chosen\r\n * as the default option, however, it fails to produce grouping nodes when certain ruleset specifications are involved.\r\n *\r\n * - `\"PostProcess\"` groups instances after the whole hierarchy level is built. It incurs a large performance penalty, but it will\r\n * produce the expected result in all cases.\r\n *\r\n * @see SameLabelInstanceGroupApplicationStage\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 * Property grouping allows grouping by a property of the instance by value or by given ranges of values.\r\n *\r\n * @see [Property grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#property-grouping)\r\n * @public\r\n */\r\nexport interface PropertyGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: \"Property\";\r\n\r\n /**\r\n * Name of the ECProperty which is used for grouping. The property must exist on the ECClass specified by the\r\n * rule's `class` attribute and it must be of either a primitive or a navigation type.\r\n *\r\n * @minLength 1\r\n */\r\n propertyName: string;\r\n\r\n /**\r\n * Specifies grouping node's image ID. If set, the ID is assigned to [[Node.imageId]] and\r\n * it's up to the UI component to decide what to do with it.\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /** Specifies whether a grouping node should 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 set or is set to an empty string.\r\n */\r\n createGroupForUnspecifiedValues?: boolean;\r\n\r\n /**\r\n * Specifies whether instances should be grouped using property's display or raw value.\r\n *\r\n * @see PropertyGroupingValue\r\n * @deprecated in 3.x. Display value should always be used for grouping.\r\n */\r\n groupingValue?: `${PropertyGroupingValue}`; // eslint-disable-line deprecation/deprecation\r\n\r\n /**\r\n * Specifies whether nodes should be sorted by their display label or the grouping property's value. In most cases the result\r\n * is the same, unless a [label override rule]($docs/presentation/customization/LabelOverride.md) is used to change node's display label.\r\n *\r\n * @see PropertyGroupingValue\r\n * @deprecated in 3.x. 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. Instances are grouped by value if no ranges are specified. */\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 in 3.x. 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 *\r\n * @see [Property range group specification documentation section]($docs/presentation/hierarchies/GroupingRule.md#attribute-ranges)\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;;;gGAGgG;AAChG;;GAEG;AAsCH;;;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;AAgED;;;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;AAyDD;;;;;;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 { RuleBase } from \"../Rule\";\r\n\r\n/**\r\n * Grouping rules provide advanced ways to group instances when creating hierarchies.\r\n *\r\n * @see [Grouping rule reference documentation page]($docs/presentation/hierarchies/GroupingRule.md)\r\n * @public\r\n */\r\nexport interface GroupingRule extends RuleBase {\r\n /** Used for serializing to JSON. */\r\n ruleType: \"Grouping\";\r\n\r\n /**\r\n * An [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#rule-condition) that results in\r\n * a boolean value. If specified, the grouping rule applies only to instance nodes that cause the condition\r\n * to evaluate to `true`.\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 /**\r\n * Specifies a list of [grouping specifications]($docs/presentation/hierarchies/GroupingRule.md#grouping-specifications)\r\n * which describe the kind of grouping that should be applied.\r\n */\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 /**\r\n * Type of the subclass\r\n * @see GroupingSpecificationTypes\r\n */\r\n specType: `${GroupingSpecificationTypes}`;\r\n}\r\n\r\n/**\r\n * Base class grouping allows grouping ECInstance nodes by their base class (as opposed to the hierarchy\r\n * specifications' `groupByClass` attribute, which always groups by direct class).\r\n *\r\n * @see [Base class grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#base-class-grouping)\r\n * @public\r\n */\r\nexport interface ClassGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: \"Class\";\r\n\r\n /** Specifies whether a grouping node should be created if there is only one item in that group. */\r\n createGroupForSingleItem?: boolean;\r\n\r\n /**\r\n * Specification of the base ECClass to group by. If specified, allows grouping by a subclass of the class\r\n * specified by rule's `class` attribute.\r\n */\r\n baseClass?: SingleSchemaClassSpecification;\r\n}\r\n\r\n/**\r\n * Allows grouping multiple instances with the same label into one ECInstances type of node. Similar to display label grouping,\r\n * but instead of showing a grouping node with multiple grouped ECInstance nodes, it shows a single ECInstances node which represents\r\n * multiple ECInstances.\r\n *\r\n * @see [Same label instance grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#same-label-instance-grouping)\r\n * @public\r\n */\r\nexport interface SameLabelInstanceGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: \"SameLabelInstance\";\r\n\r\n /**\r\n * Grouping nodes by label is an expensive operation because it requires the whole hierarchy level to be created before even the first\r\n * grouped node can be produced. To alleviate the performance impact when this specification is used, two `applicationStage` settings have been introduced:\r\n *\r\n * - `\"Query\"` groups instances during ECSql query, which can often make use of database indices and is generally fairly quick. It is chosen\r\n * as the default option, however, it fails to produce grouping nodes when certain ruleset specifications are involved.\r\n *\r\n * - `\"PostProcess\"` groups instances after the whole hierarchy level is built. It incurs a large performance penalty, but it will\r\n * produce the expected result in all cases.\r\n *\r\n * @see SameLabelInstanceGroupApplicationStage\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 * Property grouping allows grouping by a property of the instance by value or by given ranges of values.\r\n *\r\n * @see [Property grouping documentation section]($docs/presentation/hierarchies/GroupingRule.md#property-grouping)\r\n * @public\r\n */\r\nexport interface PropertyGroup extends GroupingSpecificationBase {\r\n /** Used for serializing to JSON. */\r\n specType: \"Property\";\r\n\r\n /**\r\n * Name of the ECProperty which is used for grouping. The property must exist on the ECClass specified by the\r\n * rule's `class` attribute and it must be of either a primitive or a navigation type.\r\n *\r\n * @minLength 1\r\n */\r\n propertyName: string;\r\n\r\n /**\r\n * Specifies grouping node's image ID. If set, the ID is assigned to [[Node.imageId]] and\r\n * it's up to the UI component to decide what to do with it.\r\n *\r\n * @minLength 1\r\n */\r\n imageId?: string;\r\n\r\n /** Specifies whether a grouping node should 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 set or is set to an empty string.\r\n */\r\n createGroupForUnspecifiedValues?: boolean;\r\n\r\n /**\r\n * Specifies whether instances should be grouped using property's display or raw value.\r\n *\r\n * @see PropertyGroupingValue\r\n * @deprecated in 3.x. Display value should always be used for grouping.\r\n */\r\n groupingValue?: `${PropertyGroupingValue}`; // eslint-disable-line @typescript-eslint/no-deprecated\r\n\r\n /**\r\n * Specifies whether nodes should be sorted by their display label or the grouping property's value. In most cases the result\r\n * is the same, unless a [label override rule]($docs/presentation/customization/LabelOverride.md) is used to change node's display label.\r\n *\r\n * @see PropertyGroupingValue\r\n * @deprecated in 3.x. Property grouping nodes should always be sorted by display label.\r\n */\r\n sortingValue?: `${PropertyGroupingValue}`; // eslint-disable-line @typescript-eslint/no-deprecated\r\n\r\n /** Ranges into which the grouping values are divided. Instances are grouped by value if no ranges are specified. */\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 in 3.x. 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 *\r\n * @see [Property range group specification documentation section]($docs/presentation/hierarchies/GroupingRule.md#attribute-ranges)\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": "4.10.0-dev.32",
3
+ "version": "4.10.0-dev.34",
4
4
  "description": "Common pieces for iModel.js presentation packages",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,13 +22,13 @@
22
22
  "module": "lib/esm/presentation-common.js",
23
23
  "typings": "lib/cjs/presentation-common",
24
24
  "peerDependencies": {
25
- "@itwin/core-bentley": "^4.10.0-dev.32",
26
- "@itwin/core-common": "^4.10.0-dev.32",
27
- "@itwin/core-quantity": "^4.10.0-dev.32",
28
- "@itwin/ecschema-metadata": "^4.10.0-dev.32"
25
+ "@itwin/core-bentley": "^4.10.0-dev.34",
26
+ "@itwin/core-common": "^4.10.0-dev.34",
27
+ "@itwin/core-quantity": "^4.10.0-dev.34",
28
+ "@itwin/ecschema-metadata": "^4.10.0-dev.34"
29
29
  },
30
30
  "devDependencies": {
31
- "@itwin/eslint-plugin": "^4.0.2",
31
+ "@itwin/eslint-plugin": "5.0.0-dev.1",
32
32
  "@types/chai": "4.3.1",
33
33
  "@types/chai-as-promised": "^7",
34
34
  "@types/chai-jest-snapshot": "^1.3.8",
@@ -46,7 +46,7 @@
46
46
  "cpx2": "^3.0.0",
47
47
  "cross-env": "^5.1.4",
48
48
  "deep-equal": "^1",
49
- "eslint": "^8.56.0",
49
+ "eslint": "^9.13.0",
50
50
  "eslint-config-prettier": "^9.1.0",
51
51
  "faker": "^4.1.0",
52
52
  "json-schema-faker": "0.5.0-rc16",
@@ -61,11 +61,11 @@
61
61
  "typescript": "~5.6.2",
62
62
  "typescript-json-schema": "^0.55.0",
63
63
  "yargs": "^17.4.0",
64
- "@itwin/core-quantity": "4.10.0-dev.32",
65
- "@itwin/build-tools": "4.10.0-dev.32",
66
- "@itwin/core-bentley": "4.10.0-dev.32",
67
- "@itwin/ecschema-metadata": "4.10.0-dev.32",
68
- "@itwin/core-common": "4.10.0-dev.32"
64
+ "@itwin/build-tools": "4.10.0-dev.34",
65
+ "@itwin/core-bentley": "4.10.0-dev.34",
66
+ "@itwin/core-common": "4.10.0-dev.34",
67
+ "@itwin/core-quantity": "4.10.0-dev.34",
68
+ "@itwin/ecschema-metadata": "4.10.0-dev.34"
69
69
  },
70
70
  "nyc": {
71
71
  "extends": "./node_modules/@itwin/build-tools/.nycrc"
@@ -88,7 +88,7 @@
88
88
  "ruleset-json-schema": "npm run -s ruleset-json-schema:generate && npm run -s ruleset-json-schema:post-process",
89
89
  "ruleset-json-schema:generate": "typescript-json-schema ./tsconfig.json Ruleset --noExtraProps --required --strictNullChecks --validationKeywords deprecated --include ./src/presentation-common/rules/**/*.ts --include ./src/presentation-common/rules/*.ts > ./Ruleset.schema.json",
90
90
  "ruleset-json-schema:post-process": "node ./scripts/post-process-json-schema.js --path ./Ruleset.schema.json",
91
- "lint": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
91
+ "lint": "eslint \"./src/**/*.ts\" 1>&2",
92
92
  "pseudolocalize:assets": "betools pseudolocalize --englishDir ./assets/locales/en --out ./lib/cjs/assets/locales/en-PSEUDO",
93
93
  "pseudolocalize:public": "betools pseudolocalize --englishDir ./assets/locales/en --out ./lib/public/locales/en-PSEUDO",
94
94
  "test": "mocha --config ../.mocharc.json --file ./lib/cjs/test/index.test.js \"./lib/cjs/test/**/*.test.js\"",