@itwin/rpcinterface-full-stack-tests 5.15.0-dev.7 → 5.15.0-dev.9
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/lib/dist/bundled-tests.js +131 -97
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -337381,11 +337381,18 @@ class Parser {
|
|
|
337381
337381
|
}
|
|
337382
337382
|
return undefined;
|
|
337383
337383
|
}
|
|
337384
|
+
/** Get the Unit Conversion for a known unit. Matches by unit name first because labels can differ between units providers
|
|
337385
|
+
* (e.g. an unlabeled schema unit may have an empty label in one provider and a name-derived label in another). Falls back to label lookup.
|
|
337386
|
+
*/
|
|
337387
|
+
static tryFindUnitConversionForUnit(unit, unitsConversions) {
|
|
337388
|
+
const byName = unitsConversions.find((conversion) => conversion.name === unit.name);
|
|
337389
|
+
return byName ? byName.conversion : Parser.tryFindUnitConversion(unit.label, unitsConversions, unit);
|
|
337390
|
+
}
|
|
337384
337391
|
/**
|
|
337385
337392
|
* Get what the unit conversion is for a unitless value.
|
|
337386
337393
|
*/
|
|
337387
337394
|
static getDefaultUnitConversion(tokens, unitsConversions, defaultUnit) {
|
|
337388
|
-
let unitConversion = defaultUnit ? Parser.
|
|
337395
|
+
let unitConversion = defaultUnit ? Parser.tryFindUnitConversionForUnit(defaultUnit, unitsConversions) : undefined;
|
|
337389
337396
|
if (!unitConversion) {
|
|
337390
337397
|
// No default unit conversion, take the first valid unit.
|
|
337391
337398
|
const uniqueUnitLabels = [...new Set(tokens.filter((token) => token.isString).map((token) => token.value))];
|
|
@@ -337505,7 +337512,7 @@ class Parser {
|
|
|
337505
337512
|
if (compositeUnitIndex > 0 && format.units && format.units.length > compositeUnitIndex) {
|
|
337506
337513
|
// if this is not the first token, and we have a composite spec, look up the unit from the current index
|
|
337507
337514
|
const presUnitAtIndex = format.units[compositeUnitIndex][0];
|
|
337508
|
-
conversion = Parser.
|
|
337515
|
+
conversion = Parser.tryFindUnitConversionForUnit(presUnitAtIndex, unitsConversions);
|
|
337509
337516
|
}
|
|
337510
337517
|
else if (defaultUnitConversion) {
|
|
337511
337518
|
conversion = defaultUnitConversion;
|
|
@@ -337798,7 +337805,7 @@ class Parser {
|
|
|
337798
337805
|
}
|
|
337799
337806
|
// Original flow for 1-unit composite - use Quantity.convertTo for proper unit conversion
|
|
337800
337807
|
const defaultUnit = spec.format.units && spec.format.units.length > 0 ? spec.format.units[0][0] : undefined;
|
|
337801
|
-
const unitConversion = defaultUnit ? Parser.
|
|
337808
|
+
const unitConversion = defaultUnit ? Parser.tryFindUnitConversionForUnit(defaultUnit, spec.unitConversions) : undefined;
|
|
337802
337809
|
if (!unitConversion) {
|
|
337803
337810
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_2__.QuantityStatus.MissingRequiredProperty, `Missing input unit or unit conversion for interpreting ${spec.format.name}.`);
|
|
337804
337811
|
}
|
|
@@ -344174,7 +344181,7 @@ class TestContext {
|
|
|
344174
344181
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
344175
344182
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
344176
344183
|
await core_frontend_1.NoRenderApp.startup({
|
|
344177
|
-
applicationVersion: "5.15.0-dev.
|
|
344184
|
+
applicationVersion: "5.15.0-dev.9",
|
|
344178
344185
|
applicationId: this.settings.gprid,
|
|
344179
344186
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
344180
344187
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -348655,6 +348662,32 @@ class KoqPropertyValueFormatter {
|
|
|
348655
348662
|
}
|
|
348656
348663
|
return formatterSpec.applyFormatting(value);
|
|
348657
348664
|
}
|
|
348665
|
+
/**
|
|
348666
|
+
* Creates a formatter that reuses formatter specs for repeated formatting options.
|
|
348667
|
+
* Each call creates an independent cache that lasts as long as the returned formatter.
|
|
348668
|
+
* Cached specs and missing-format results are not invalidated by changes to formats,
|
|
348669
|
+
* default formats, or schemas. Create a new formatter to pick up those changes.
|
|
348670
|
+
* Failed spec lookups are not cached and may be retried by subsequent calls.
|
|
348671
|
+
* @returns A formatter with its own cache, suitable for a single content-formatting operation.
|
|
348672
|
+
*/
|
|
348673
|
+
createCachedFormatter() {
|
|
348674
|
+
const specs = new Map();
|
|
348675
|
+
return {
|
|
348676
|
+
format: async (value, options) => {
|
|
348677
|
+
const key = JSON.stringify([options.koqName, options.unitSystem, Object.entries(options.formatOverride ?? {})]);
|
|
348678
|
+
let specPromise = specs.get(key);
|
|
348679
|
+
if (!specPromise) {
|
|
348680
|
+
specPromise = this.getFormatterSpec(options).catch((error) => {
|
|
348681
|
+
specs.delete(key);
|
|
348682
|
+
throw error;
|
|
348683
|
+
});
|
|
348684
|
+
specs.set(key, specPromise);
|
|
348685
|
+
}
|
|
348686
|
+
const spec = await specPromise;
|
|
348687
|
+
return spec?.applyFormatting(value);
|
|
348688
|
+
},
|
|
348689
|
+
};
|
|
348690
|
+
}
|
|
348658
348691
|
async getFormatterSpec(options) {
|
|
348659
348692
|
const formattingProps = await this.#getFormattingProps(options);
|
|
348660
348693
|
if (!formattingProps) {
|
|
@@ -348828,12 +348861,14 @@ var LabelDefinition;
|
|
|
348828
348861
|
*/
|
|
348829
348862
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
348830
348863
|
exports.LocalizationHelper = void 0;
|
|
348831
|
-
const Content_js_1 = __webpack_require__(/*! ./content/Content.js */ "../../presentation/common/lib/cjs/presentation-common/content/Content.js");
|
|
348832
|
-
const Descriptor_js_1 = __webpack_require__(/*! ./content/Descriptor.js */ "../../presentation/common/lib/cjs/presentation-common/content/Descriptor.js");
|
|
348833
348864
|
const Value_js_1 = __webpack_require__(/*! ./content/Value.js */ "../../presentation/common/lib/cjs/presentation-common/content/Value.js");
|
|
348834
348865
|
const LabelDefinition_js_1 = __webpack_require__(/*! ./LabelDefinition.js */ "../../presentation/common/lib/cjs/presentation-common/LabelDefinition.js");
|
|
348835
348866
|
const KEY_PATTERN = /@[\w\d\-_]+:[\w\d\-\._]+?@/g;
|
|
348836
|
-
/**
|
|
348867
|
+
/**
|
|
348868
|
+
* Localizes presentation data structures **in place**. Callers must pass a mutable graph owned by the current
|
|
348869
|
+
* operation and must not reuse it as untranslated data for another locale.
|
|
348870
|
+
* @internal
|
|
348871
|
+
*/
|
|
348837
348872
|
class LocalizationHelper {
|
|
348838
348873
|
_getLocalizedString;
|
|
348839
348874
|
constructor(props) {
|
|
@@ -348843,126 +348878,122 @@ class LocalizationHelper {
|
|
|
348843
348878
|
return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, "")));
|
|
348844
348879
|
}
|
|
348845
348880
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
348846
|
-
|
|
348847
|
-
|
|
348881
|
+
localizeNodes(nodes) {
|
|
348882
|
+
nodes.forEach((n) => this.localizeNode(n));
|
|
348883
|
+
return nodes;
|
|
348848
348884
|
}
|
|
348849
|
-
|
|
348850
|
-
|
|
348851
|
-
|
|
348852
|
-
|
|
348853
|
-
|
|
348854
|
-
|
|
348885
|
+
localizeNode(node) {
|
|
348886
|
+
this.localizeLabelDefinition(node.label);
|
|
348887
|
+
if (node.description) {
|
|
348888
|
+
node.description = this.getLocalizedString(node.description);
|
|
348889
|
+
}
|
|
348890
|
+
return node;
|
|
348855
348891
|
}
|
|
348856
|
-
|
|
348857
|
-
|
|
348858
|
-
|
|
348859
|
-
|
|
348860
|
-
children: npe.children.map((c) => this.getLocalizedNodePathElement(c)),
|
|
348861
|
-
};
|
|
348892
|
+
localizeNodePathElement(npe) {
|
|
348893
|
+
this.localizeNode(npe.node);
|
|
348894
|
+
npe.children.forEach((c) => this.localizeNodePathElement(c));
|
|
348895
|
+
return npe;
|
|
348862
348896
|
}
|
|
348863
348897
|
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
348864
|
-
|
|
348865
|
-
|
|
348866
|
-
|
|
348867
|
-
displayValue: this.getLocalizedDisplayValue(group.displayValue),
|
|
348868
|
-
};
|
|
348898
|
+
localizeDisplayValueGroup(group) {
|
|
348899
|
+
group.displayValue = this.localizeDisplayValue(group.displayValue);
|
|
348900
|
+
return group;
|
|
348869
348901
|
}
|
|
348870
|
-
|
|
348871
|
-
const getLocalizedComposite = (compositeValue) => ({
|
|
348872
|
-
...compositeValue,
|
|
348873
|
-
values: compositeValue.values.map((value) => this.getLocalizedLabelDefinition(value)),
|
|
348874
|
-
});
|
|
348902
|
+
localizeLabelDefinition(labelDefinition) {
|
|
348875
348903
|
if (labelDefinition.typeName === LabelDefinition_js_1.COMPOSITE_LABEL_DEFINITION_TYPENAME) {
|
|
348876
|
-
|
|
348877
|
-
...labelDefinition,
|
|
348878
|
-
rawValue: getLocalizedComposite(labelDefinition.rawValue),
|
|
348879
|
-
};
|
|
348904
|
+
labelDefinition.rawValue.values.forEach((value) => this.localizeLabelDefinition(value));
|
|
348880
348905
|
}
|
|
348881
|
-
if (labelDefinition.typeName === "string") {
|
|
348882
|
-
|
|
348883
|
-
|
|
348884
|
-
rawValue: this.getLocalizedString(labelDefinition.rawValue),
|
|
348885
|
-
displayValue: this.getLocalizedString(labelDefinition.displayValue),
|
|
348886
|
-
};
|
|
348906
|
+
else if (labelDefinition.typeName === "string") {
|
|
348907
|
+
labelDefinition.rawValue = this.getLocalizedString(labelDefinition.rawValue);
|
|
348908
|
+
labelDefinition.displayValue = this.getLocalizedString(labelDefinition.displayValue);
|
|
348887
348909
|
}
|
|
348888
348910
|
return labelDefinition;
|
|
348889
348911
|
}
|
|
348890
|
-
|
|
348891
|
-
|
|
348912
|
+
localizeLabelDefinitions(labelDefinitions) {
|
|
348913
|
+
labelDefinitions.forEach((labelDefinition) => this.localizeLabelDefinition(labelDefinition));
|
|
348914
|
+
return labelDefinitions;
|
|
348892
348915
|
}
|
|
348893
|
-
|
|
348894
|
-
|
|
348895
|
-
|
|
348896
|
-
|
|
348897
|
-
return clone;
|
|
348916
|
+
localizeContentDescriptor(descriptor) {
|
|
348917
|
+
descriptor.fields.forEach((field) => this.localizeContentField(field));
|
|
348918
|
+
descriptor.categories.forEach((category) => this.localizeCategoryDescription(category));
|
|
348919
|
+
return descriptor;
|
|
348898
348920
|
}
|
|
348899
|
-
|
|
348900
|
-
|
|
348921
|
+
localizeContentItems(items) {
|
|
348922
|
+
items.forEach((item) => this.localizeContentItem(item));
|
|
348923
|
+
return items;
|
|
348901
348924
|
}
|
|
348902
|
-
|
|
348903
|
-
|
|
348925
|
+
localizeContent(content) {
|
|
348926
|
+
this.localizeContentDescriptor(content.descriptor);
|
|
348927
|
+
this.localizeContentItems(content.contentSet);
|
|
348928
|
+
return content;
|
|
348904
348929
|
}
|
|
348905
|
-
|
|
348906
|
-
|
|
348907
|
-
|
|
348908
|
-
label: this.getLocalizedString(elem.label),
|
|
348909
|
-
};
|
|
348930
|
+
localizeElementProperties(elem) {
|
|
348931
|
+
elem.label = this.getLocalizedString(elem.label);
|
|
348932
|
+
return elem;
|
|
348910
348933
|
}
|
|
348911
|
-
|
|
348912
|
-
|
|
348913
|
-
|
|
348914
|
-
|
|
348915
|
-
item.displayValues = Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});
|
|
348934
|
+
localizeContentItem(item) {
|
|
348935
|
+
this.localizeLabelDefinition(item.label);
|
|
348936
|
+
this.localizeRawValuesDictionary(item.values);
|
|
348937
|
+
this.localizeDisplayValuesDictionary(item.displayValues);
|
|
348916
348938
|
return item;
|
|
348917
348939
|
}
|
|
348918
|
-
|
|
348940
|
+
localizeRawValuesDictionary(values) {
|
|
348941
|
+
for (const key of Object.keys(values)) {
|
|
348942
|
+
values[key] = this.localizeRawValue(values[key]);
|
|
348943
|
+
}
|
|
348944
|
+
}
|
|
348945
|
+
localizeDisplayValuesDictionary(values) {
|
|
348946
|
+
for (const key of Object.keys(values)) {
|
|
348947
|
+
values[key] = this.localizeDisplayValue(values[key]);
|
|
348948
|
+
}
|
|
348949
|
+
}
|
|
348950
|
+
localizeRawValue(value) {
|
|
348919
348951
|
if (typeof value === "string") {
|
|
348920
348952
|
return this.getLocalizedString(value);
|
|
348921
348953
|
}
|
|
348922
348954
|
if (Value_js_1.Value.isNavigationValue(value)) {
|
|
348923
|
-
|
|
348924
|
-
|
|
348925
|
-
label: this.getLocalizedLabelDefinition(value.label),
|
|
348926
|
-
};
|
|
348955
|
+
this.localizeLabelDefinition(value.label);
|
|
348956
|
+
return value;
|
|
348927
348957
|
}
|
|
348928
348958
|
if (Value_js_1.Value.isNestedContent(value)) {
|
|
348929
|
-
|
|
348930
|
-
|
|
348931
|
-
|
|
348932
|
-
|
|
348933
|
-
|
|
348959
|
+
value.forEach((item) => {
|
|
348960
|
+
this.localizeRawValuesDictionary(item.values);
|
|
348961
|
+
this.localizeDisplayValuesDictionary(item.displayValues);
|
|
348962
|
+
});
|
|
348963
|
+
return value;
|
|
348934
348964
|
}
|
|
348935
348965
|
if (Value_js_1.Value.isArray(value)) {
|
|
348936
|
-
|
|
348966
|
+
for (let i = 0; i < value.length; ++i) {
|
|
348967
|
+
value[i] = this.localizeRawValue(value[i]);
|
|
348968
|
+
}
|
|
348969
|
+
return value;
|
|
348937
348970
|
}
|
|
348938
348971
|
if (Value_js_1.Value.isMap(value)) {
|
|
348939
|
-
|
|
348972
|
+
this.localizeRawValuesDictionary(value);
|
|
348940
348973
|
}
|
|
348941
348974
|
return value;
|
|
348942
348975
|
}
|
|
348943
|
-
|
|
348944
|
-
getLocalizedContentField(field) {
|
|
348976
|
+
localizeContentField(field) {
|
|
348945
348977
|
field.label = this.getLocalizedString(field.label);
|
|
348946
348978
|
if (field.isPropertiesField()) {
|
|
348947
348979
|
if (field.isStructPropertiesField()) {
|
|
348948
|
-
field.memberFields
|
|
348980
|
+
field.memberFields.forEach((m) => this.localizeContentField(m));
|
|
348949
348981
|
}
|
|
348950
348982
|
else if (field.isArrayPropertiesField()) {
|
|
348951
|
-
|
|
348983
|
+
this.localizeContentField(field.itemsField);
|
|
348952
348984
|
}
|
|
348953
348985
|
}
|
|
348954
348986
|
else if (field.isNestedContentField()) {
|
|
348955
|
-
field.nestedFields
|
|
348987
|
+
field.nestedFields.forEach((m) => this.localizeContentField(m));
|
|
348956
348988
|
}
|
|
348957
348989
|
return field;
|
|
348958
348990
|
}
|
|
348959
|
-
|
|
348960
|
-
getLocalizedCategoryDescription(category) {
|
|
348991
|
+
localizeCategoryDescription(category) {
|
|
348961
348992
|
category.label = this.getLocalizedString(category.label);
|
|
348962
348993
|
category.description = this.getLocalizedString(category.description);
|
|
348963
348994
|
return category;
|
|
348964
348995
|
}
|
|
348965
|
-
|
|
348996
|
+
localizeDisplayValue(value) {
|
|
348966
348997
|
if (typeof value === "undefined") {
|
|
348967
348998
|
return undefined;
|
|
348968
348999
|
}
|
|
@@ -348970,9 +349001,13 @@ class LocalizationHelper {
|
|
|
348970
349001
|
return this.getLocalizedString(value);
|
|
348971
349002
|
}
|
|
348972
349003
|
if (Value_js_1.DisplayValue.isArray(value)) {
|
|
348973
|
-
|
|
349004
|
+
for (let i = 0; i < value.length; ++i) {
|
|
349005
|
+
value[i] = this.localizeDisplayValue(value[i]);
|
|
349006
|
+
}
|
|
349007
|
+
return value;
|
|
348974
349008
|
}
|
|
348975
|
-
|
|
349009
|
+
this.localizeDisplayValuesDictionary(value);
|
|
349010
|
+
return value;
|
|
348976
349011
|
}
|
|
348977
349012
|
}
|
|
348978
349013
|
exports.LocalizationHelper = LocalizationHelper;
|
|
@@ -354225,7 +354260,7 @@ class PresentationManager {
|
|
|
354225
354260
|
const result = await this._requestsHandler.getPagedNodes({ ...rpcOptions, paging });
|
|
354226
354261
|
return {
|
|
354227
354262
|
total: result.total,
|
|
354228
|
-
items: this._localizationHelper.
|
|
354263
|
+
items: this._localizationHelper.localizeNodes(result.items),
|
|
354229
354264
|
};
|
|
354230
354265
|
},
|
|
354231
354266
|
});
|
|
@@ -354274,7 +354309,7 @@ class PresentationManager {
|
|
|
354274
354309
|
const rpcOptions = this.toRpcTokenOptions({ ...options });
|
|
354275
354310
|
const result = await this._requestsHandler.getNodesDescriptor(rpcOptions);
|
|
354276
354311
|
const descriptor = presentation_common_1.Descriptor.fromJSON(result);
|
|
354277
|
-
return descriptor ? this._localizationHelper.
|
|
354312
|
+
return descriptor ? this._localizationHelper.localizeContentDescriptor(descriptor) : undefined;
|
|
354278
354313
|
}
|
|
354279
354314
|
finally {
|
|
354280
354315
|
await (0, IModelConnectionInitialization_js_1.ensureIModelInitialized)(requestOptions.imodel);
|
|
@@ -354290,7 +354325,7 @@ class PresentationManager {
|
|
|
354290
354325
|
const options = await this.addRulesetAndVariablesToOptions(requestOptions);
|
|
354291
354326
|
const rpcOptions = this.toRpcTokenOptions({ ...options });
|
|
354292
354327
|
const result = await this._requestsHandler.getNodePaths(rpcOptions);
|
|
354293
|
-
return result.map((npe) => this._localizationHelper.
|
|
354328
|
+
return result.map((npe) => this._localizationHelper.localizeNodePathElement(npe));
|
|
354294
354329
|
}
|
|
354295
354330
|
/**
|
|
354296
354331
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
@@ -354301,7 +354336,7 @@ class PresentationManager {
|
|
|
354301
354336
|
(0, IModelConnectionInitialization_js_1.startIModelInitialization)(requestOptions.imodel);
|
|
354302
354337
|
const options = await this.addRulesetAndVariablesToOptions(requestOptions);
|
|
354303
354338
|
const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));
|
|
354304
|
-
return result.map((npe) => this._localizationHelper.
|
|
354339
|
+
return result.map((npe) => this._localizationHelper.localizeNodePathElement(npe));
|
|
354305
354340
|
}
|
|
354306
354341
|
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
354307
354342
|
/**
|
|
@@ -354326,7 +354361,7 @@ class PresentationManager {
|
|
|
354326
354361
|
});
|
|
354327
354362
|
const result = await this._requestsHandler.getContentDescriptor(rpcOptions);
|
|
354328
354363
|
const descriptor = presentation_common_1.Descriptor.fromJSON(result);
|
|
354329
|
-
return descriptor ? this._localizationHelper.
|
|
354364
|
+
return descriptor ? this._localizationHelper.localizeContentDescriptor(descriptor) : undefined;
|
|
354330
354365
|
}
|
|
354331
354366
|
finally {
|
|
354332
354367
|
await (0, IModelConnectionInitialization_js_1.ensureIModelInitialized)(requestOptions.imodel);
|
|
@@ -354362,7 +354397,7 @@ class PresentationManager {
|
|
|
354362
354397
|
formatsProvider: core_frontend_1.IModelApp.formatsProvider,
|
|
354363
354398
|
});
|
|
354364
354399
|
koqPropertyFormatter.defaultFormats = this._defaultFormats;
|
|
354365
|
-
contentFormatter = (0, presentation_common_1.createContentFormatter)({ propertyValueFormatter: koqPropertyFormatter, unitSystem });
|
|
354400
|
+
contentFormatter = (0, presentation_common_1.createContentFormatter)({ propertyValueFormatter: koqPropertyFormatter.createCachedFormatter(), unitSystem });
|
|
354366
354401
|
}
|
|
354367
354402
|
let descriptor = requestOptions.descriptor instanceof presentation_common_1.Descriptor ? requestOptions.descriptor : undefined;
|
|
354368
354403
|
let firstPage;
|
|
@@ -354371,14 +354406,13 @@ class PresentationManager {
|
|
|
354371
354406
|
if (!firstPageResponse?.descriptor || !firstPageResponse.contentSet) {
|
|
354372
354407
|
return undefined;
|
|
354373
354408
|
}
|
|
354374
|
-
descriptor = presentation_common_1.Descriptor.fromJSON(firstPageResponse
|
|
354409
|
+
descriptor = this._localizationHelper.localizeContentDescriptor(presentation_common_1.Descriptor.fromJSON(firstPageResponse.descriptor));
|
|
354375
354410
|
firstPage = firstPageResponse?.contentSet;
|
|
354376
354411
|
}
|
|
354377
354412
|
/* c8 ignore next 3 */
|
|
354378
354413
|
if (!descriptor) {
|
|
354379
354414
|
return undefined;
|
|
354380
354415
|
}
|
|
354381
|
-
descriptor = this._localizationHelper.getLocalizedContentDescriptor(descriptor);
|
|
354382
354416
|
const getPage = async (paging, requestIndex) => {
|
|
354383
354417
|
let contentSet = requestIndex === 0 ? firstPage : undefined;
|
|
354384
354418
|
contentSet ??= await this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging });
|
|
@@ -354386,7 +354420,7 @@ class PresentationManager {
|
|
|
354386
354420
|
if (contentFormatter) {
|
|
354387
354421
|
items = await contentFormatter.formatContentItems(items, descriptor);
|
|
354388
354422
|
}
|
|
354389
|
-
items = this._localizationHelper.
|
|
354423
|
+
items = this._localizationHelper.localizeContentItems(items);
|
|
354390
354424
|
return {
|
|
354391
354425
|
total: contentSet.total,
|
|
354392
354426
|
items,
|
|
@@ -354450,7 +354484,7 @@ class PresentationManager {
|
|
|
354450
354484
|
const response = await this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging });
|
|
354451
354485
|
return {
|
|
354452
354486
|
total: response.total,
|
|
354453
|
-
items: response.items.map((x) => this._localizationHelper.
|
|
354487
|
+
items: response.items.map((x) => this._localizationHelper.localizeDisplayValueGroup(x)),
|
|
354454
354488
|
};
|
|
354455
354489
|
},
|
|
354456
354490
|
});
|
|
@@ -354528,7 +354562,7 @@ class PresentationManager {
|
|
|
354528
354562
|
(0, IModelConnectionInitialization_js_1.startIModelInitialization)(requestOptions.imodel);
|
|
354529
354563
|
const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });
|
|
354530
354564
|
const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);
|
|
354531
|
-
return this._localizationHelper.
|
|
354565
|
+
return this._localizationHelper.localizeLabelDefinition(result);
|
|
354532
354566
|
}
|
|
354533
354567
|
/** Retrieves display label definition of specific items. */
|
|
354534
354568
|
async getDisplayLabelDefinitionsIterator(requestOptions) {
|
|
@@ -354539,7 +354573,7 @@ class PresentationManager {
|
|
|
354539
354573
|
getBatch: async (page) => {
|
|
354540
354574
|
const partialKeys = !page.start ? rpcOptions.keys : rpcOptions.keys.slice(page.start);
|
|
354541
354575
|
const result = await this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });
|
|
354542
|
-
result.items = this._localizationHelper.
|
|
354576
|
+
result.items = this._localizationHelper.localizeLabelDefinitions(result.items);
|
|
354543
354577
|
return result;
|
|
354544
354578
|
},
|
|
354545
354579
|
});
|
|
@@ -370916,7 +370950,7 @@ class WMS {
|
|
|
370916
370950
|
(module) {
|
|
370917
370951
|
|
|
370918
370952
|
"use strict";
|
|
370919
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.
|
|
370953
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.9","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.12","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
|
|
370920
370954
|
|
|
370921
370955
|
/***/ },
|
|
370922
370956
|
|