@itwin/presentation-shared 2.0.0-alpha.0 → 2.0.0-alpha.10

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 (135) hide show
  1. package/CHANGELOG.md +188 -1
  2. package/README.md +27 -9
  3. package/lib/cjs/presentation-shared.d.ts +16 -8
  4. package/lib/cjs/presentation-shared.d.ts.map +1 -1
  5. package/lib/cjs/presentation-shared.js +10 -4
  6. package/lib/cjs/presentation-shared.js.map +1 -1
  7. package/lib/cjs/shared/ConcatenatedValue.d.ts +1 -1
  8. package/lib/cjs/shared/ConcatenatedValue.d.ts.map +1 -1
  9. package/lib/cjs/shared/ECSqlCore.d.ts +1 -1
  10. package/lib/cjs/shared/ECSqlCore.d.ts.map +1 -1
  11. package/lib/cjs/shared/Event.d.ts +20 -2
  12. package/lib/cjs/shared/Event.d.ts.map +1 -1
  13. package/lib/cjs/shared/Formatting.d.ts +1 -1
  14. package/lib/cjs/shared/Formatting.d.ts.map +1 -1
  15. package/lib/cjs/shared/Formatting.js +10 -6
  16. package/lib/cjs/shared/Formatting.js.map +1 -1
  17. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts +5 -65
  18. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -1
  19. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js +0 -136
  20. package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js.map +1 -1
  21. package/lib/cjs/shared/Logging.js +2 -1
  22. package/lib/cjs/shared/Logging.js.map +1 -1
  23. package/lib/cjs/shared/MappedTypes.d.ts +3 -13
  24. package/lib/cjs/shared/MappedTypes.d.ts.map +1 -1
  25. package/lib/cjs/shared/Metadata.d.ts +13 -10
  26. package/lib/cjs/shared/Metadata.d.ts.map +1 -1
  27. package/lib/cjs/shared/Metadata.js +4 -1
  28. package/lib/cjs/shared/Metadata.js.map +1 -1
  29. package/lib/cjs/shared/Utils.d.ts +12 -1
  30. package/lib/cjs/shared/Utils.d.ts.map +1 -1
  31. package/lib/cjs/shared/Utils.js +25 -11
  32. package/lib/cjs/shared/Utils.js.map +1 -1
  33. package/lib/cjs/shared/Values.d.ts +3 -3
  34. package/lib/cjs/shared/Values.d.ts.map +1 -1
  35. package/lib/cjs/shared/Values.js +13 -47
  36. package/lib/cjs/shared/Values.js.map +1 -1
  37. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +1 -1
  38. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
  39. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js +10 -12
  40. package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
  41. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +4 -3
  42. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -1
  43. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +8 -6
  44. package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
  45. package/lib/cjs/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts +17 -0
  46. package/lib/cjs/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  47. package/lib/cjs/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js +51 -0
  48. package/lib/cjs/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js.map +1 -0
  49. package/lib/cjs/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts +39 -0
  50. package/lib/cjs/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  51. package/lib/cjs/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js +63 -0
  52. package/lib/cjs/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js.map +1 -0
  53. package/lib/cjs/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts +12 -0
  54. package/lib/cjs/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  55. package/lib/cjs/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js +39 -0
  56. package/lib/cjs/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js.map +1 -0
  57. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts +198 -0
  58. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts.map +1 -0
  59. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js +10 -0
  60. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js.map +1 -0
  61. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts +34 -0
  62. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  63. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js +335 -0
  64. package/lib/cjs/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js.map +1 -0
  65. package/lib/cjs/shared/instance-label-factory-impls/Utils.d.ts +6 -0
  66. package/lib/cjs/shared/instance-label-factory-impls/Utils.d.ts.map +1 -0
  67. package/lib/cjs/shared/instance-label-factory-impls/Utils.js +24 -0
  68. package/lib/cjs/shared/instance-label-factory-impls/Utils.js.map +1 -0
  69. package/lib/esm/presentation-shared.d.ts +16 -8
  70. package/lib/esm/presentation-shared.d.ts.map +1 -1
  71. package/lib/esm/presentation-shared.js +6 -2
  72. package/lib/esm/presentation-shared.js.map +1 -1
  73. package/lib/esm/shared/ConcatenatedValue.d.ts +1 -1
  74. package/lib/esm/shared/ConcatenatedValue.d.ts.map +1 -1
  75. package/lib/esm/shared/ECSqlCore.d.ts +1 -1
  76. package/lib/esm/shared/ECSqlCore.d.ts.map +1 -1
  77. package/lib/esm/shared/Event.d.ts +20 -2
  78. package/lib/esm/shared/Event.d.ts.map +1 -1
  79. package/lib/esm/shared/Formatting.d.ts +1 -1
  80. package/lib/esm/shared/Formatting.d.ts.map +1 -1
  81. package/lib/esm/shared/Formatting.js +10 -6
  82. package/lib/esm/shared/Formatting.js.map +1 -1
  83. package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts +5 -65
  84. package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -1
  85. package/lib/esm/shared/InstanceLabelSelectClauseFactory.js +0 -133
  86. package/lib/esm/shared/InstanceLabelSelectClauseFactory.js.map +1 -1
  87. package/lib/esm/shared/Logging.js +2 -1
  88. package/lib/esm/shared/Logging.js.map +1 -1
  89. package/lib/esm/shared/MappedTypes.d.ts +3 -13
  90. package/lib/esm/shared/MappedTypes.d.ts.map +1 -1
  91. package/lib/esm/shared/Metadata.d.ts +13 -10
  92. package/lib/esm/shared/Metadata.d.ts.map +1 -1
  93. package/lib/esm/shared/Metadata.js +4 -1
  94. package/lib/esm/shared/Metadata.js.map +1 -1
  95. package/lib/esm/shared/Utils.d.ts +12 -1
  96. package/lib/esm/shared/Utils.d.ts.map +1 -1
  97. package/lib/esm/shared/Utils.js +24 -11
  98. package/lib/esm/shared/Utils.js.map +1 -1
  99. package/lib/esm/shared/Values.d.ts +3 -3
  100. package/lib/esm/shared/Values.d.ts.map +1 -1
  101. package/lib/esm/shared/Values.js +13 -47
  102. package/lib/esm/shared/Values.js.map +1 -1
  103. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +1 -1
  104. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
  105. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js +10 -12
  106. package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
  107. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +4 -3
  108. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -1
  109. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +8 -6
  110. package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
  111. package/lib/esm/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts +17 -0
  112. package/lib/esm/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  113. package/lib/esm/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js +48 -0
  114. package/lib/esm/shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js.map +1 -0
  115. package/lib/esm/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts +39 -0
  116. package/lib/esm/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  117. package/lib/esm/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js +60 -0
  118. package/lib/esm/shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js.map +1 -0
  119. package/lib/esm/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts +12 -0
  120. package/lib/esm/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  121. package/lib/esm/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js +36 -0
  122. package/lib/esm/shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js.map +1 -0
  123. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts +198 -0
  124. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.d.ts.map +1 -0
  125. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js +9 -0
  126. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.Rules.js.map +1 -0
  127. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts +34 -0
  128. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.d.ts.map +1 -0
  129. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js +332 -0
  130. package/lib/esm/shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js.map +1 -0
  131. package/lib/esm/shared/instance-label-factory-impls/Utils.d.ts +6 -0
  132. package/lib/esm/shared/instance-label-factory-impls/Utils.d.ts.map +1 -0
  133. package/lib/esm/shared/instance-label-factory-impls/Utils.js +20 -0
  134. package/lib/esm/shared/instance-label-factory-impls/Utils.js.map +1 -0
  135. package/package.json +15 -23
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # @itwin/presentation-shared
2
2
 
3
+ ## 2.0.0-alpha.10
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1307](https://github.com/iTwin/presentation/pull/1307): Add `createIModelInstanceLabelSelectClauseFactory` — a new `IInstanceLabelSelectClauseFactory` implementation that applies `InstanceLabelOverride` rules stored in the iModel.
8
+
9
+ Rules are read from `PresentationRules.Ruleset` elements (top-level `rules[]` only) by querying the iModel via `ECSqlQueryExecutor`. All `InstanceLabelOverride` value specification types are supported: `String`, `Property`, `ClassName`, `ClassLabel`, `BriefcaseId`, `LocalId`, and `Composite`. Path-based specs (`RelatedInstanceLabel`, `Property` with `propertySource`) degrade silently to the next available value.
10
+
11
+ When the `PresentationRules` schema is not imported into the iModel, the factory falls back transparently to the provided `defaultClauseFactory` (defaults to `createBisInstanceLabelSelectClauseFactory`).
12
+
13
+ ## 2.0.0-alpha.9
14
+
15
+ ### Major Changes
16
+
17
+ - [#1250](https://github.com/iTwin/presentation/pull/1250): Use type-safe full class names.
18
+
19
+ The full class names used in this package were defined as `string`, although we always expect them to be in specific format - either `Schema:Class` or `Schema.Class`. In many cases we rely on this format when parsing the name for compare or other purposes, so type safety for the format is highly beneficial. This change makes full class names type-safe(ier) through [TypeScript's template literal types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), so that we can be sure that they are always in correct format.
20
+
21
+ ## Additions
22
+
23
+ - Added 3 new types to the `EC` namespace:
24
+ - `FullClassNameColonNotation` - matches the format `Schema:Class`,
25
+ - `FullClassNameDotNotation` - matches the format `Schema.Class`,
26
+ - `FullClassName` - union of the above two.
27
+
28
+ ## Non-breaking changes
29
+
30
+ - Updated `normalizeFullClassName` to return `EC.FullClassNameDotNotation` instead of `string`. The returned value is still assignable to `string`, but it adds type safety for the expected format of the full class name.
31
+
32
+ ## Breaking changes
33
+
34
+ - Changed `EC.CustomAttribute.className` to be of type `EC.FullClassName` instead of `string`.
35
+ - Changed `EC.CustomAttributeSet.get` argument to be of type `EC.FullClassName` instead of `string`.
36
+ - Changed `EC.SchemaItem.fullName` to be of type `EC.FullClassName` instead of `string`.
37
+ - Changed `compareFullClassNames` arguments to be of type `EC.FullClassName` instead of `string`.
38
+ - Changed `createClassBasedInstanceLabelSelectClauseFactory` prop `clauses` to take objects with `{ className: EC.FullClassName }` arguments instead of `{ className: string }`.
39
+ - Changed `IInstanceLabelSelectClauseFactory.createSelectClause` prop `className` to be of type `EC.FullClassName` instead of `string`.
40
+ - Changed `ECSql.createPrimitivePropertyValueSelectorProps` prop `propertyClassName` to be of type `EC.FullClassName` instead of `string`.
41
+ - Changed `ECSql.createRelationshipPathJoinClause` prop `path` to take class names (`relationshipName`, `sourceClassName` and `targetClassName`) of type `EC.FullClassName` instead of `string`.
42
+ - Changed `ECClassHierarchyInspector.classDerivesFrom` arguments to be of type `EC.FullClassName` instead of `string`.
43
+ - Changed the second argument of `getClass` to be of type `EC.FullClassName` instead of `string`.
44
+ - Changed `InstanceKey.className` to be of type `EC.FullClassName` instead of `string`.
45
+
46
+ In many cases migration will be seamless, as long as the input string matches the expected format. In some cases (e.g. when assigning a string variable to one of the affected properties), you may need to use `normalizeFullClassName` to ensure the value is of the correct type:
47
+
48
+ ```ts
49
+ const myClassName: string = "MySchema.MyClass";
50
+
51
+ // before
52
+ const myClass = getClass(schemaProvider, myClassName);
53
+
54
+ // after
55
+ const myClass = getClass(schemaProvider, normalizeFullClassName(myClassName));
56
+ ```
57
+
58
+ ## 2.0.0-alpha.8
59
+
60
+ ### Major Changes
61
+
62
+ - [#1222](https://github.com/iTwin/presentation/pull/1222): Enhance the `Props` type to only accept functions that have one object argument.
63
+
64
+ The term "props" refers to a props object, meaning there should only be one argument. For cases when a function has multiple arguments, use TypeScript's `Parameters` utility type instead.
65
+
66
+ ## 2.0.0-alpha.7
67
+
68
+ ### Major Changes
69
+
70
+ - [#1200](https://github.com/iTwin/presentation/pull/1200): Made `EC.RelationshipConstraint.multiplicity` required.
71
+
72
+ ### Minor Changes
73
+
74
+ - [#1204](https://github.com/iTwin/presentation/pull/1204): Add a `RaisableEvent` interface, which extends `Event` with additional `raiseEvent` method.
75
+
76
+ ### Patch Changes
77
+
78
+ - [#1198](https://github.com/iTwin/presentation/pull/1198): Fix `Event` type to prohibit being assigned an event with no-argument listener (unless the target event uses a no-argument listener).
79
+
80
+ Now TS will complain about the following assignment, which it previously allowed:
81
+
82
+ ```ts
83
+ const noArg: Event<() => void> = {} as any;
84
+ const withArg: Event<(arg: number) => void> = noArg; // TS didn't complain, but it does
85
+ ```
86
+
87
+ ## 2.0.0-alpha.6
88
+
89
+ ### Patch Changes
90
+
91
+ - [#1180](https://github.com/iTwin/presentation/pull/1180): Version bump
92
+
93
+ ## 2.0.0-alpha.5
94
+
95
+ ### Minor Changes
96
+
97
+ - [#1137](https://github.com/iTwin/presentation/pull/1137): Add and use a more robust way to check full class names for equality - `compareFullClassNames` function.
98
+
99
+ The function compares full class names in case-insensitive way, ignoring different supported schema-class name separators (`:` or `.`).
100
+
101
+ ## 2.0.0-alpha.4
102
+
103
+ ### Patch Changes
104
+
105
+ - e9ef80880c776522ce3b2632c8c3c461e62d6444: Fix `InstanceKey` methods `equals` and `compare` not handling different schema-class separators and casing.
106
+
107
+ ## 2.0.0-alpha.3
108
+
109
+ ### Patch Changes
110
+
111
+ - [#1112](https://github.com/iTwin/presentation/pull/1112): Version bump
112
+
113
+ ## 2.0.0-alpha.2
114
+
115
+ ### Patch Changes
116
+
117
+ - [#1042](https://github.com/iTwin/presentation/pull/1042): Version bump
118
+
119
+ ## 2.0.0-alpha.1
120
+
121
+ ### Patch Changes
122
+
123
+ - [#985](https://github.com/iTwin/presentation/pull/985): Add support for `itwinjs-core@5`
124
+
3
125
  ## 2.0.0-alpha.0
4
126
 
5
127
  ### Major Changes
@@ -15,6 +137,67 @@
15
137
 
16
138
  In reality, consumers will likely use `@itwin/presentation-core-interop` package for creating them, and the package has been updated to handle the change, so reacting to the breaking change is as simple as bumping the version of `@itwin/presentation-core-interop` package in the consumer's `package.json`.
17
139
 
140
+ ## 1.2.11
141
+
142
+ ### Patch Changes
143
+
144
+ - [#1286](https://github.com/iTwin/presentation/pull/1286): Bump dependencies.
145
+
146
+ ## 1.2.10
147
+
148
+ ### Patch Changes
149
+
150
+ - [#1242](https://github.com/iTwin/presentation/pull/1242): Bump dependencies.
151
+
152
+ ## 1.2.9
153
+
154
+ ### Patch Changes
155
+
156
+ - [#1215](https://github.com/iTwin/presentation/pull/1215): Update dependencies.
157
+
158
+ ## 1.2.8
159
+
160
+ ### Patch Changes
161
+
162
+ - [#1208](https://github.com/iTwin/presentation/pull/1208): Bump dependencies.
163
+
164
+ ## 1.2.7
165
+
166
+ ### Patch Changes
167
+
168
+ - [#1168](https://github.com/iTwin/presentation/pull/1168): Bump dependencies.
169
+ - [#1161](https://github.com/iTwin/presentation/pull/1161): Bump iTwin.js dependencies to `^5.5.0`.
170
+
171
+ ## 1.2.6
172
+
173
+ ### Patch Changes
174
+
175
+ - [#1152](https://github.com/iTwin/presentation/pull/1152): Bump dependencies.
176
+
177
+ ## 1.2.5
178
+
179
+ ### Patch Changes
180
+
181
+ - [#1139](https://github.com/iTwin/presentation/pull/1139): Bump dependencies.
182
+
183
+ ## 1.2.4
184
+
185
+ ### Patch Changes
186
+
187
+ - [#1124](https://github.com/iTwin/presentation/pull/1124): Bump dependencies.
188
+
189
+ ## 1.2.3
190
+
191
+ ### Patch Changes
192
+
193
+ - [#1039](https://github.com/iTwin/presentation/pull/1039): Bump iTwin.js core dependencies to `^5.1.1`.
194
+
195
+ ## 1.2.2
196
+
197
+ ### Patch Changes
198
+
199
+ - [#982](https://github.com/iTwin/presentation/pull/982): Update itwinjs-core dependencies to v5.0.0
200
+
18
201
  ## 1.2.1
19
202
 
20
203
  ### Patch Changes
@@ -168,7 +351,11 @@
168
351
  The change makes combining multiple concatenated values easier, e.g. now you can do this:
169
352
 
170
353
  ```ts
171
- const value: ConcatenatedValue = [createConcatenatedValueX(), { type: "String", value: " - " }, createConcatenatedValueY()];
354
+ const value: ConcatenatedValue = [
355
+ createConcatenatedValueX(),
356
+ { type: "String", value: " - " },
357
+ createConcatenatedValueY(),
358
+ ];
172
359
  ```
173
360
 
174
361
  ## 0.2.0
package/README.md CHANGED
@@ -55,7 +55,10 @@ const classHierarchyInspector: ECClassHierarchyInspector = createCachingECClassH
55
55
  // tell how many entries should be cached in LRU cache (0 or `undefined` stand for "no caching")
56
56
  cacheSize: 100,
57
57
  });
58
- const isGeometricElement = await classHierarchyInspector.classDerivesFrom("MySchema.MyClass", "BisCore.GeometricElement");
58
+ const isGeometricElement = await classHierarchyInspector.classDerivesFrom(
59
+ "MySchema.MyClass",
60
+ "BisCore.GeometricElement",
61
+ );
59
62
  ```
60
63
 
61
64
  ## ECSql
@@ -125,7 +128,6 @@ The ECSql utilities group contains a number of functions to help create complex
125
128
  ```
126
129
 
127
130
  - `createRawPrimitiveValueSelector` - creates an ECSQL selector for a raw primitive value.
128
-
129
131
  - `undefined` is selected as `NULL`.
130
132
  - `Date` values are selected in julian day format.
131
133
  - `Point2d` and `Point3d` values are selected as serialized JSON objects, e.g. `{ x: 1, y: 2, z: 3 }`.
@@ -273,21 +275,17 @@ The APIs in Values group contain various value types and utilities to work with
273
275
  - `InstanceKey` - a pair of full ECClass name and ECInstance ID, uniquely identifying an ECInstance in an iModel.
274
276
 
275
277
  - `PrimitiveValue` - a union of different supported primitive values. Also, a namespace, containing the following utilities:
276
-
277
278
  - `isPoint2d` - type guard to check if the given `PrimitiveValue` is a `Point2d`.
278
279
  - `isPoint3d` - type guard to check if the given `PrimitiveValue` is a `Point3d`.
279
280
 
280
281
  - `TypedPrimitiveValue` - a union of all supported combinations of `PrimitiveValue` and its type, possibly with some extra metadata like extended type name or units-related information. Also, a namespace, containing the following utilities:
281
-
282
282
  - `create` - given a `PrimitiveValue`, its type and, optionally, extra information, validates the input and creates a `TypedPrimitiveValue`.
283
283
 
284
284
  - `ConcatenatedValuePart` - a union of different types that may be used to create a single, combined value: nested `ConcatenatedValue`, `TypedPrimitiveValue` or just plain string. Also, a namespace, containing the following utilities:
285
-
286
285
  - `isString` - type guard to check if the given `ConcatenatedValuePart` is a `string`.
287
286
  - `isPrimitive` - type guard to check if the given `ConcatenatedValuePart` is a `TypedPrimitiveValue`.
288
287
 
289
288
  - `ConcatenatedValue` - an array of `ConcatenatedValuePart`. Also, a namespace containing the following utilities:
290
-
291
289
  - `serialize` - joins the given `ConcatenatedValue` parts using provided formatter and separator.
292
290
 
293
291
  - `IPrimitiveValueFormatter` - an interface for a function that knows how to format a `TypedPrimitiveValue` into a string.
@@ -317,7 +315,7 @@ The APIs in Values group contain various value types and utilities to work with
317
315
  }
318
316
  ```
319
317
 
320
- The package delivers 3 implementations of `IInstanceLabelSelectClauseFactory` that can be created using the following factory methods: `createDefaultInstanceLabelSelectClauseFactory`, `createClassBasedInstanceLabelSelectClauseFactory`, `createBisInstanceLabelSelectClauseFactory`.
318
+ The package delivers 4 implementations of `IInstanceLabelSelectClauseFactory` that can be created using the following factory methods: `createDefaultInstanceLabelSelectClauseFactory`, `createClassBasedInstanceLabelSelectClauseFactory`, `createBisInstanceLabelSelectClauseFactory`, `createIModelInstanceLabelSelectClauseFactory`.
321
319
 
322
320
  ### `createDefaultInstanceLabelSelectClauseFactory`
323
321
 
@@ -345,7 +343,10 @@ This label selectors factory doesn't create labels on its own, but allows assign
345
343
  Example usage:
346
344
 
347
345
  ```ts
348
- import { createClassBasedInstanceLabelSelectClauseFactory, ECClassHierarchyInspector } from "@itwin/presentation-shared";
346
+ import {
347
+ createClassBasedInstanceLabelSelectClauseFactory,
348
+ ECClassHierarchyInspector,
349
+ } from "@itwin/presentation-shared";
349
350
 
350
351
  const classHierarchyInspector: ECClassHierarchyInspector = getClassHierarchyInspector();
351
352
  const labelsFactory = createClassBasedInstanceLabelSelectClauseFactory({
@@ -384,6 +385,24 @@ const ecsql = `SELECT ${await labelsFactory.createSelectClause({ classAlias: "el
384
385
  // ...
385
386
  ```
386
387
 
388
+ ### `createIModelInstanceLabelSelectClauseFactory`
389
+
390
+ This label selectors factory reads `InstanceLabelOverride` rules from `PresentationRules` rulesets embedded in
391
+ the iModel and compiles them into ECSQL label selectors. Rules are loaded lazily on first use and cached per
392
+ factory instance. When the `PresentationRules` schema is absent from the iModel, the factory transparently
393
+ falls back to a configurable default (by default `createBisInstanceLabelSelectClauseFactory`).
394
+
395
+ Example usage:
396
+
397
+ ```ts
398
+ import { createIModelInstanceLabelSelectClauseFactory } from "@itwin/presentation-shared";
399
+
400
+ // `imodelAccess` must satisfy `ECSqlQueryExecutor & ECClassHierarchyInspector & ECSchemaProvider`
401
+ const labelsFactory = createIModelInstanceLabelSelectClauseFactory({ imodelAccess });
402
+ const ecsql = `SELECT ${await labelsFactory.createSelectClause({ classAlias: "element" })} AS [Label] FROM [BisCore].[Element] AS [element]`;
403
+ // ...
404
+ ```
405
+
387
406
  ## Logging
388
407
 
389
408
  The APIs in logging category define types and interfaces required for creating a logger. The package itself only delivers a `NOOP_LOGGER`, which does what it says - nothing. Besides that, we expect the `@itwin/presentation-core-interop` package to be used for creating a logger that forwards all logging to [iTwin.js `Logger`](https://www.itwinjs.org/reference/core-bentley/logging/logger/).
@@ -443,7 +462,6 @@ The package also delivers a number of utility types and functions:
443
462
  ```
444
463
 
445
464
  - `trimWhitespace` - trims all extra whitespace from the given string, including:
446
-
447
465
  - consecutive spaces,
448
466
  - spaces before closing parentheses and comma,
449
467
  - spaces after opening parentheses,
@@ -1,13 +1,21 @@
1
1
  import * as ECSql from "./shared/ecsql-snippets/index.js";
2
2
  export { ECSql };
3
3
  export { ConcatenatedValue, ConcatenatedValuePart } from "./shared/ConcatenatedValue.js";
4
- export { ECSqlBinding, ECSqlQueryDef, ECSqlQueryExecutor, ECSqlQueryReaderOptions, ECSqlQueryRow } from "./shared/ECSqlCore.js";
5
- export { createDefaultValueFormatter, formatConcatenatedValue, IPrimitiveValueFormatter } from "./shared/Formatting.js";
6
- export { IInstanceLabelSelectClauseFactory, createDefaultInstanceLabelSelectClauseFactory, createClassBasedInstanceLabelSelectClauseFactory, createBisInstanceLabelSelectClauseFactory, parseInstanceLabel, } from "./shared/InstanceLabelSelectClauseFactory.js";
7
- export { ILogger, NOOP_LOGGER, LogFunction, LogLevel } from "./shared/Logging.js";
8
- export { ArrayElement, EventArgs, EventListener, OmitOverUnion, Props } from "./shared/MappedTypes.js";
9
- export { createCachingECClassHierarchyInspector, EC, getClass, ECClassHierarchyInspector, ECSchemaProvider } from "./shared/Metadata.js";
10
- export { createMainThreadReleaseOnTimePassedHandler, julianToDateTime, normalizeFullClassName, parseFullClassName, releaseMainThread, trimWhitespace, } from "./shared/Utils.js";
4
+ export type { ECSqlBinding, ECSqlQueryDef, ECSqlQueryExecutor, ECSqlQueryReaderOptions, ECSqlQueryRow, } from "./shared/ECSqlCore.js";
5
+ export type { IPrimitiveValueFormatter } from "./shared/Formatting.js";
6
+ export { createDefaultValueFormatter, formatConcatenatedValue } from "./shared/Formatting.js";
7
+ export type { IInstanceLabelSelectClauseFactory } from "./shared/InstanceLabelSelectClauseFactory.js";
8
+ export { parseInstanceLabel } from "./shared/InstanceLabelSelectClauseFactory.js";
9
+ export { createDefaultInstanceLabelSelectClauseFactory } from "./shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js";
10
+ export { createClassBasedInstanceLabelSelectClauseFactory } from "./shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js";
11
+ export { createBisInstanceLabelSelectClauseFactory } from "./shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js";
12
+ export { createIModelInstanceLabelSelectClauseFactory } from "./shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js";
13
+ export type { ILogger, LogFunction, LogLevel } from "./shared/Logging.js";
14
+ export { NOOP_LOGGER } from "./shared/Logging.js";
15
+ export type { ArrayElement, OmitOverUnion, Props } from "./shared/MappedTypes.js";
16
+ export type { EC, ECClassHierarchyInspector, ECSchemaProvider } from "./shared/Metadata.js";
17
+ export { createCachingECClassHierarchyInspector, getClass } from "./shared/Metadata.js";
18
+ export { createMainThreadReleaseOnTimePassedHandler, julianToDateTime, compareFullClassNames, normalizeFullClassName, parseFullClassName, releaseMainThread, trimWhitespace, } from "./shared/Utils.js";
11
19
  export { InstanceKey, PrimitiveValue, TypedPrimitiveValue } from "./shared/Values.js";
12
- export { Event } from "./shared/Event.js";
20
+ export type { Event, RaisableEvent, EventArgs, EventListener } from "./shared/Event.js";
13
21
  //# sourceMappingURL=presentation-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-shared.d.ts","sourceRoot":"","sources":["../../src/presentation-shared.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,u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AE,MAAM,8CAA8C,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,6CAA6C,EAAE,MAAM,kFAAkF,CAAC;AACjJ,OAAO,EAAE,gDAAgD,EAAE,MAAM,qFAAqF,CAAC;AACvJ,OAAO,EAAE,yCAAyC,EAAE,MAAM,8EAA8E,CAAC;AACzI,OAAO,EAAE,4CAA4C,EAAE,MAAM,iFAAiF,CAAC;AAC/I,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClF,YAAY,EAAE,EAAE,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,sCAAsC,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EACL,0CAA0C,EAC1C,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
37
37
  };
38
38
  })();
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.TypedPrimitiveValue = exports.PrimitiveValue = exports.InstanceKey = exports.trimWhitespace = exports.releaseMainThread = exports.parseFullClassName = exports.normalizeFullClassName = exports.julianToDateTime = exports.createMainThreadReleaseOnTimePassedHandler = exports.getClass = exports.createCachingECClassHierarchyInspector = exports.NOOP_LOGGER = exports.parseInstanceLabel = exports.createBisInstanceLabelSelectClauseFactory = exports.createClassBasedInstanceLabelSelectClauseFactory = exports.createDefaultInstanceLabelSelectClauseFactory = exports.formatConcatenatedValue = exports.createDefaultValueFormatter = exports.ConcatenatedValuePart = exports.ConcatenatedValue = exports.ECSql = void 0;
40
+ exports.TypedPrimitiveValue = exports.PrimitiveValue = exports.InstanceKey = exports.trimWhitespace = exports.releaseMainThread = exports.parseFullClassName = exports.normalizeFullClassName = exports.compareFullClassNames = exports.julianToDateTime = exports.createMainThreadReleaseOnTimePassedHandler = exports.getClass = exports.createCachingECClassHierarchyInspector = exports.NOOP_LOGGER = exports.createIModelInstanceLabelSelectClauseFactory = exports.createBisInstanceLabelSelectClauseFactory = exports.createClassBasedInstanceLabelSelectClauseFactory = exports.createDefaultInstanceLabelSelectClauseFactory = exports.parseInstanceLabel = exports.formatConcatenatedValue = exports.createDefaultValueFormatter = exports.ConcatenatedValuePart = exports.ConcatenatedValue = exports.ECSql = void 0;
41
41
  const ECSql = __importStar(require("./shared/ecsql-snippets/index.js"));
42
42
  exports.ECSql = ECSql;
43
43
  var ConcatenatedValue_js_1 = require("./shared/ConcatenatedValue.js");
@@ -47,10 +47,15 @@ var Formatting_js_1 = require("./shared/Formatting.js");
47
47
  Object.defineProperty(exports, "createDefaultValueFormatter", { enumerable: true, get: function () { return Formatting_js_1.createDefaultValueFormatter; } });
48
48
  Object.defineProperty(exports, "formatConcatenatedValue", { enumerable: true, get: function () { return Formatting_js_1.formatConcatenatedValue; } });
49
49
  var InstanceLabelSelectClauseFactory_js_1 = require("./shared/InstanceLabelSelectClauseFactory.js");
50
- Object.defineProperty(exports, "createDefaultInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return InstanceLabelSelectClauseFactory_js_1.createDefaultInstanceLabelSelectClauseFactory; } });
51
- Object.defineProperty(exports, "createClassBasedInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return InstanceLabelSelectClauseFactory_js_1.createClassBasedInstanceLabelSelectClauseFactory; } });
52
- Object.defineProperty(exports, "createBisInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return InstanceLabelSelectClauseFactory_js_1.createBisInstanceLabelSelectClauseFactory; } });
53
50
  Object.defineProperty(exports, "parseInstanceLabel", { enumerable: true, get: function () { return InstanceLabelSelectClauseFactory_js_1.parseInstanceLabel; } });
51
+ var DefaultInstanceLabelSelectClauseFactory_js_1 = require("./shared/instance-label-factory-impls/DefaultInstanceLabelSelectClauseFactory.js");
52
+ Object.defineProperty(exports, "createDefaultInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return DefaultInstanceLabelSelectClauseFactory_js_1.createDefaultInstanceLabelSelectClauseFactory; } });
53
+ var ClassBasedInstanceLabelSelectClauseFactory_js_1 = require("./shared/instance-label-factory-impls/ClassBasedInstanceLabelSelectClauseFactory.js");
54
+ Object.defineProperty(exports, "createClassBasedInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return ClassBasedInstanceLabelSelectClauseFactory_js_1.createClassBasedInstanceLabelSelectClauseFactory; } });
55
+ var BisInstanceLabelSelectClauseFactory_js_1 = require("./shared/instance-label-factory-impls/BisInstanceLabelSelectClauseFactory.js");
56
+ Object.defineProperty(exports, "createBisInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return BisInstanceLabelSelectClauseFactory_js_1.createBisInstanceLabelSelectClauseFactory; } });
57
+ var IModelInstanceLabelSelectClauseFactory_js_1 = require("./shared/instance-label-factory-impls/IModelInstanceLabelSelectClauseFactory.js");
58
+ Object.defineProperty(exports, "createIModelInstanceLabelSelectClauseFactory", { enumerable: true, get: function () { return IModelInstanceLabelSelectClauseFactory_js_1.createIModelInstanceLabelSelectClauseFactory; } });
54
59
  var Logging_js_1 = require("./shared/Logging.js");
55
60
  Object.defineProperty(exports, "NOOP_LOGGER", { enumerable: true, get: function () { return Logging_js_1.NOOP_LOGGER; } });
56
61
  var Metadata_js_1 = require("./shared/Metadata.js");
@@ -59,6 +64,7 @@ Object.defineProperty(exports, "getClass", { enumerable: true, get: function ()
59
64
  var Utils_js_1 = require("./shared/Utils.js");
60
65
  Object.defineProperty(exports, "createMainThreadReleaseOnTimePassedHandler", { enumerable: true, get: function () { return Utils_js_1.createMainThreadReleaseOnTimePassedHandler; } });
61
66
  Object.defineProperty(exports, "julianToDateTime", { enumerable: true, get: function () { return Utils_js_1.julianToDateTime; } });
67
+ Object.defineProperty(exports, "compareFullClassNames", { enumerable: true, get: function () { return Utils_js_1.compareFullClassNames; } });
62
68
  Object.defineProperty(exports, "normalizeFullClassName", { enumerable: true, get: function () { return Utils_js_1.normalizeFullClassName; } });
63
69
  Object.defineProperty(exports, "parseFullClassName", { enumerable: true, get: function () { return Utils_js_1.parseFullClassName; } });
64
70
  Object.defineProperty(exports, "releaseMainThread", { enumerable: true, get: function () { return Utils_js_1.releaseMainThread; } });
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-shared.js","sourceRoot":"","sources":["../../src/presentation-shared.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG,wEAA0D;AAEjD,sBAAK;AAEd,sEAAyF;AAAhF,yHAAA,iBAAiB,OAAA;AAAE,6HAAA,qBAAqB,OAAA;AAEjD,wDAAwH;AAA/G,4HAAA,2BAA2B,OAAA;AAAE,wHAAA,uBAAuB,OAAA;AAC7D,oGAMsD;AAJpD,oKAAA,6CAA6C,OAAA;AAC7C,uKAAA,gDAAgD,OAAA;AAChD,gKAAA,yCAAyC,OAAA;AACzC,yIAAA,kBAAkB,OAAA;AAEpB,kDAAkF;AAAhE,yGAAA,WAAW,OAAA;AAE7B,oDAAyI;AAAhI,qIAAA,sCAAsC,OAAA;AAAM,uGAAA,QAAQ,OAAA;AAC7D,8CAO2B;AANzB,sIAAA,0CAA0C,OAAA;AAC1C,4GAAA,gBAAgB,OAAA;AAChB,kHAAA,sBAAsB,OAAA;AACtB,8GAAA,kBAAkB,OAAA;AAClB,6GAAA,iBAAiB,OAAA;AACjB,0GAAA,cAAc,OAAA;AAEhB,gDAAsF;AAA7E,wGAAA,WAAW,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,gHAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"presentation-shared.js","sourceRoot":"","sources":["../../src/presentation-shared.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG,wEAA0D;AAEjD,sBAAK;AAEd,sEAAyF;AAAhF,yHAAA,iBAAiB,OAAA;AAAE,6HAAA,qBAAqB,OAAA;AASjD,wDAA8F;AAArF,4HAAA,2BAA2B,OAAA;AAAE,wHAAA,uBAAuB,OAAA;AAE7D,oGAAkF;AAAzE,yIAAA,kBAAkB,OAAA;AAC3B,+IAAiJ;AAAxI,2KAAA,6CAA6C,OAAA;AACtD,qJAAuJ;AAA9I,iLAAA,gDAAgD,OAAA;AACzD,uIAAyI;AAAhI,mKAAA,yCAAyC,OAAA;AAClD,6IAA+I;AAAtI,yKAAA,4CAA4C,OAAA;AAErD,kDAAkD;AAAzC,yGAAA,WAAW,OAAA;AAGpB,oDAAwF;AAA/E,qIAAA,sCAAsC,OAAA;AAAE,uGAAA,QAAQ,OAAA;AACzD,8CAQ2B;AAPzB,sIAAA,0CAA0C,OAAA;AAC1C,4GAAA,gBAAgB,OAAA;AAChB,iHAAA,qBAAqB,OAAA;AACrB,kHAAA,sBAAsB,OAAA;AACtB,8GAAA,kBAAkB,OAAA;AAClB,6GAAA,iBAAiB,OAAA;AACjB,0GAAA,cAAc,OAAA;AAEhB,gDAAsF;AAA7E,wGAAA,WAAW,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,gHAAA,mBAAmB,OAAA"}
@@ -1,4 +1,4 @@
1
- import { TypedPrimitiveValue } from "./Values.js";
1
+ import type { TypedPrimitiveValue } from "./Values.js";
2
2
  /**
3
3
  * A part of a `ConcatenatedValue`, describing one piece of the value. Possible types:
4
4
  * - `ConcatenatedValue` describes a nested concatenated value.
@@ -1 +1 @@
1
- {"version":3,"file":"ConcatenatedValue.d.ts","sourceRoot":"","sources":["../../../src/shared/ConcatenatedValue.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,MAAM,CAAC;AAErF,cAAc;AAEd,yBAAiB,qBAAqB,CAAC;IACrC,cAAc;IACd,SAAgB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,MAAM,CAEpE;IAED,cAAc;IACd,SAAgB,WAAW,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,mBAAmB,CAEpF;IAED,cAAc;IACd,SAAgB,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,iBAAiB,CAE1F;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,EAAE,CAAC;AAExD,cAAc;AAEd,yBAAiB,iBAAiB,CAAC;IACjC;;;;;OAKG;IACH,SAAsB,SAAS,CAAC,KAAK,EAAE;QACrC,yBAAyB;QACzB,KAAK,EAAE,iBAAiB,CAAC;QACzB,qDAAqD;QACrD,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5F,6EAA6E;QAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYlB;CACF"}
1
+ {"version":3,"file":"ConcatenatedValue.d.ts","sourceRoot":"","sources":["../../../src/shared/ConcatenatedValue.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,MAAM,CAAC;AAErF,cAAc;AAEd,yBAAiB,qBAAqB,CAAC;IACrC,cAAc;IACd,SAAgB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,MAAM,CAEpE;IAED,cAAc;IACd,SAAgB,WAAW,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,mBAAmB,CAEpF;IAED,cAAc;IACd,SAAgB,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,iBAAiB,CAE1F;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,EAAE,CAAC;AAExD,cAAc;AAEd,yBAAiB,iBAAiB,CAAC;IACjC;;;;;OAKG;IACH,SAAsB,SAAS,CAAC,KAAK,EAAE;QACrC,yBAAyB;QACzB,KAAK,EAAE,iBAAiB,CAAC;QACzB,qDAAqD;QACrD,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5F,6EAA6E;QAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYlB;CACF"}
@@ -1,4 +1,4 @@
1
- import { Id64String } from "@itwin/core-bentley";
1
+ import type { Id64String } from "@itwin/core-bentley";
2
2
  /**
3
3
  * Defines an ECSql binding consisting of a value and its type. Necessary to differentiate between numeric
4
4
  * types and `Id64String` vs `string`.
@@ -1 +1 @@
1
- {"version":3,"file":"ECSqlCore.d.ts","sourceRoot":"","sources":["../../../src/shared/ECSqlCore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EA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,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,oBAAoB,GAAG,SAAS,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CAAC;IAC5B,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,CAAC;CAC9B;AAED;;;;GAIG;AACH,KAAK,gBAAgB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAAG,gBAAgB,CAAC;CAC7F"}
@@ -1,9 +1,27 @@
1
+ import type { Props } from "./MappedTypes.js";
1
2
  /**
2
3
  * An interface that allows subscribing and unsubscribing listeners that are called upon an event.
3
4
  * @public
4
5
  */
5
6
  export interface Event<TListener extends (...args: any[]) => void = () => void> {
6
- addListener(listener: TListener): () => void;
7
- removeListener(listener: TListener): void;
7
+ addListener: (listener: TListener) => () => void;
8
+ removeListener: (listener: TListener) => void;
8
9
  }
10
+ /**
11
+ * An `Event` that can be raised.
12
+ * @public
13
+ */
14
+ export interface RaisableEvent<TListener extends (...args: any[]) => void = () => void> extends Event<TListener> {
15
+ raiseEvent: (...args: Parameters<TListener>) => void;
16
+ }
17
+ /**
18
+ * Returns type of the given `Event` listener.
19
+ * @public
20
+ */
21
+ export type EventListener<TEvent extends {}> = TEvent extends Event<infer TListener> ? TListener : never;
22
+ /**
23
+ * Returns type of the given `Event` arguments.
24
+ * @public
25
+ */
26
+ export type EventArgs<TEvent extends {}> = Props<EventListener<TEvent>>;
9
27
  //# sourceMappingURL=Event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../src/shared/Event.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,WAAW,KAAK,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAC5E,WAAW,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,IAAI,CAAC;IAC7C,cAAc,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;CAC3C"}
1
+ {"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../src/shared/Event.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,KAAK,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAC5E,WAAW,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,MAAM,IAAI,CAAC;IACjD,cAAc,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC;IAC9G,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,EAAE,IAAI,MAAM,SAAS,KAAK,CAAC,MAAM,SAAS,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC;AAEzG;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,MAAM,SAAS,EAAE,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { ConcatenatedValue } from "./ConcatenatedValue.js";
2
- import { TypedPrimitiveValue } from "./Values.js";
2
+ import type { TypedPrimitiveValue } from "./Values.js";
3
3
  /**
4
4
  * A type definition for a function that knows how to create a display string for a typed primitive value.
5
5
  * @see `createDefaultValueFormatter`
@@ -1 +1 @@
1
- {"version":3,"file":"Formatting.d.ts","sourceRoot":"","sources":["../../../src/shared/Formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEvF;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAAC,cAAc,EAAE,wBAAwB,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBrJ;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,2BAA2B,IAAI,wBAAwB,CAatE"}
1
+ {"version":3,"file":"Formatting.d.ts","sourceRoot":"","sources":["../../../src/shared/Formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,wBAAwB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEvF;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAClC,cAAc,EAAE,wBAAwB,CAAC;CAC1C,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBlB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,2BAA2B,IAAI,wBAAwB,CAkBtE"}
@@ -25,10 +25,7 @@ async function formatConcatenatedValue(props) {
25
25
  partFormatter: async (part) => {
26
26
  // strings are converted to typed strings
27
27
  if (ConcatenatedValue_js_1.ConcatenatedValuePart.isString(part)) {
28
- part = {
29
- value: part,
30
- type: "String",
31
- };
28
+ part = { value: part, type: "String" };
32
29
  }
33
30
  // finally, use provided value formatter to create a string from `TypedPrimitiveValue`
34
31
  return valueFormatter(part);
@@ -68,7 +65,10 @@ function createDefaultValueFormatter() {
68
65
  return result;
69
66
  }
70
67
  }
71
- (0, core_bentley_1.assert)(typeof value.value === "undefined" || typeof value.value === "boolean" || typeof value.value === "number" || typeof value.value === "string");
68
+ (0, core_bentley_1.assert)(typeof value.value === "undefined" ||
69
+ typeof value.value === "boolean" ||
70
+ typeof value.value === "number" ||
71
+ typeof value.value === "string");
72
72
  return value.value.toString();
73
73
  };
74
74
  }
@@ -89,7 +89,11 @@ function applyNumericFormatting(value) {
89
89
  }
90
90
  function applyDatesFormatting(value) {
91
91
  function getDate(julianOrDate) {
92
- return typeof julianOrDate === "number" ? (0, Utils_js_1.julianToDateTime)(julianOrDate) : typeof julianOrDate === "string" ? new Date(julianOrDate) : julianOrDate;
92
+ return typeof julianOrDate === "number"
93
+ ? (0, Utils_js_1.julianToDateTime)(julianOrDate)
94
+ : typeof julianOrDate === "string"
95
+ ? new Date(julianOrDate)
96
+ : julianOrDate;
93
97
  }
94
98
  if (value.type !== "DateTime") {
95
99
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Formatting.js","sourceRoot":"","sources":["../../../src/shared/Formatting.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAoBhG,0DAmBC;AA0BD,kEAaC;AA5ED,sDAA6C;AAC7C,iEAAkF;AAClF,yCAA8C;AAU9C;;;;;GAKG;AACI,KAAK,UAAU,uBAAuB,CAAC,KAAsF;IAClI,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CAAC,CAAC,CAAC,KAAK,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;IACrH,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;IAClF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,11 +1,11 @@
1
- import { ConcatenatedValue } from "./ConcatenatedValue.js";
2
- import { TypedValueSelectClauseProps } from "./ecsql-snippets/ECSqlValueSelectorSnippets.js";
3
- import { ECClassHierarchyInspector } from "./Metadata.js";
1
+ import type { ConcatenatedValue } from "./ConcatenatedValue.js";
2
+ import type { TypedValueSelectClauseProps } from "./ecsql-snippets/ECSqlValueSelectorSnippets.js";
3
+ import type { EC } from "./Metadata.js";
4
4
  /**
5
5
  * Props for `IInstanceLabelSelectClauseFactory.createSelectClause`.
6
6
  * @public
7
7
  */
8
- interface CreateInstanceLabelSelectClauseProps {
8
+ export interface CreateInstanceLabelSelectClauseProps {
9
9
  /**
10
10
  * Alias of an ECSQL class referring to the target instance whose label should be selected.
11
11
  *
@@ -26,7 +26,7 @@ interface CreateInstanceLabelSelectClauseProps {
26
26
  * implementations may be able to create a more efficient select clause (e.g. drop some pieces of clause
27
27
  * that don't apply for given class).
28
28
  */
29
- className?: string;
29
+ className?: EC.FullClassName;
30
30
  /**
31
31
  * An optional function for concatenating multiple `TypedValueSelectClauseProps`. Selectors' concatenation
32
32
  * is used when a label consists of multiple pieces, e.g.:
@@ -70,64 +70,4 @@ export interface IInstanceLabelSelectClauseFactory {
70
70
  * @public
71
71
  */
72
72
  export declare function parseInstanceLabel(value: string | undefined): ConcatenatedValue | string;
73
- /**
74
- * Creates a label select clause in a format `Class label [base36(briefcase id)-base36(local id)]`, where
75
- * local and briefcase IDs are calculated based on ECInstance ID:
76
- * - `{briefcase id} = ECInstanceId >> 40`
77
- * - `{local id} = ECInstanceId & (1 << 40 - 1)`
78
- *
79
- * @see https://www.itwinjs.org/presentation/advanced/defaultbisrules/#label-overrides
80
- * @public
81
- */
82
- export declare function createDefaultInstanceLabelSelectClauseFactory(): IInstanceLabelSelectClauseFactory;
83
- /**
84
- * An association of a class and an instance label select clause factory method.
85
- * @public
86
- */
87
- interface ClassBasedLabelSelectClause {
88
- /** Full class name */
89
- className: string;
90
- /** A factory method to create an instance label select clause */
91
- clause: (props: CreateInstanceLabelSelectClauseProps) => Promise<string>;
92
- }
93
- /**
94
- * Props for `createClassBasedInstanceLabelSelectClauseFactory`.
95
- * @public
96
- */
97
- interface ClassBasedInstanceLabelSelectClauseFactoryProps {
98
- /** Access to ECClass hierarchy in the iModel. */
99
- classHierarchyInspector: ECClassHierarchyInspector;
100
- /**
101
- * A prioritized list of instance label selectors associated to classes they should be applied to.
102
- *
103
- * Because the list may contain clauses for classes in the same class hierarchy, and the factory
104
- * handles them in given order, the order of clauses should be from the most specific class to the
105
- * most general one.
106
- */
107
- clauses: ClassBasedLabelSelectClause[];
108
- /**
109
- * A fallback label clause factory for when class-based factory doesn't produce a label.
110
- * Defaults to the result of `createDefaultInstanceLabelSelectClauseFactory`.
111
- */
112
- defaultClauseFactory?: IInstanceLabelSelectClauseFactory;
113
- }
114
- /**
115
- * Creates an instance label select clause based on its class.
116
- * @public
117
- */
118
- export declare function createClassBasedInstanceLabelSelectClauseFactory(props: ClassBasedInstanceLabelSelectClauseFactoryProps): IInstanceLabelSelectClauseFactory;
119
- /**
120
- * Props for `createBisInstanceLabelSelectClauseFactory`.
121
- * @public
122
- */
123
- interface BisInstanceLabelSelectClauseFactoryProps {
124
- classHierarchyInspector: ECClassHierarchyInspector;
125
- }
126
- /**
127
- * Creates a label select clause according to BIS instance label rules.
128
- * @see https://www.itwinjs.org/presentation/advanced/defaultbisrules/#label-overrides
129
- * @public
130
- */
131
- export declare function createBisInstanceLabelSelectClauseFactory(props: BisInstanceLabelSelectClauseFactoryProps): IInstanceLabelSelectClauseFactory;
132
- export {};
133
73
  //# sourceMappingURL=InstanceLabelSelectClauseFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InstanceLabelSelectClauseFactory.d.ts","sourceRoot":"","sources":["../../../src/shared/InstanceLabelSelectClauseFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAGL,2BAA2B,EAC5B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE1D;;;GAGG;AACH,UAAU,oCAAoC;IAC5C;;;;;;;;;;OAUG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,2BAA2B,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CACtG;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iCAAiC;IAChD,qDAAqD;IACrD,kBAAkB,CAAC,KAAK,EAAE,oCAAoC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,MAAM,CAaxF;AAED;;;;;;;;GAQG;AACH,wBAAgB,6CAA6C,IAAI,iCAAiC,CAmBjG;AAED;;;GAGG;AACH,UAAU,2BAA2B;IACnC,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,EAAE,CAAC,KAAK,EAAE,oCAAoC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1E;AAED;;;GAGG;AACH,UAAU,+CAA+C;IACvD,iDAAiD;IACjD,uBAAuB,EAAE,yBAAyB,CAAC;IAEnD;;;;;;OAMG;IACH,OAAO,EAAE,2BAA2B,EAAE,CAAC;IAEvC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,iCAAiC,CAAC;CAC1D;AAED;;;GAGG;AACH,wBAAgB,gDAAgD,CAAC,KAAK,EAAE,+CAA+C,GAAG,iCAAiC,CA0D1J;AAED;;;GAGG;AACH,UAAU,wCAAwC;IAChD,uBAAuB,EAAE,yBAAyB,CAAC;CACpD;AAED;;;;GAIG;AACH,wBAAgB,yCAAyC,CAAC,KAAK,EAAE,wCAAwC,GAAG,iCAAiC,CAuC5I"}
1
+ {"version":3,"file":"InstanceLabelSelectClauseFactory.d.ts","sourceRoot":"","sources":["../../../src/shared/InstanceLabelSelectClauseFactory.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,oCAAoC;IACnD;;;;;;;;;;OAUG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC;IAE7B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,2BAA2B,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CACtG;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iCAAiC;IAChD,qDAAqD;IACrD,kBAAkB,CAAC,KAAK,EAAE,oCAAoC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,MAAM,CAaxF"}