@itwin/presentation-common 4.0.0-dev.22 → 4.0.0-dev.24
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/cjs/presentation-common/PropertyFormatter.d.ts +26 -0
- package/lib/cjs/presentation-common/PropertyFormatter.d.ts.map +1 -0
- package/lib/cjs/presentation-common/PropertyFormatter.js +74 -0
- package/lib/cjs/presentation-common/PropertyFormatter.js.map +1 -0
- package/lib/cjs/presentation-common.d.ts +1 -0
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +1 -0
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/PropertyFormatter.d.ts +26 -0
- package/lib/esm/presentation-common/PropertyFormatter.d.ts.map +1 -0
- package/lib/esm/presentation-common/PropertyFormatter.js +69 -0
- package/lib/esm/presentation-common/PropertyFormatter.js.map +1 -0
- package/lib/esm/presentation-common.d.ts +1 -0
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +1 -0
- package/lib/esm/presentation-common.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Core
|
|
3
|
+
*/
|
|
4
|
+
import { FormatProps, FormatterSpec, ParserSpec, UnitsProvider } from "@itwin/core-quantity";
|
|
5
|
+
import { Content } from "./content/Content";
|
|
6
|
+
/** @alpha */
|
|
7
|
+
export interface FormatOptions {
|
|
8
|
+
formatProps: FormatProps;
|
|
9
|
+
persistenceUnitName: string;
|
|
10
|
+
}
|
|
11
|
+
/** @alpha */
|
|
12
|
+
export declare class PropertyValueFormatter {
|
|
13
|
+
private _unitsProvider;
|
|
14
|
+
constructor(_unitsProvider: UnitsProvider);
|
|
15
|
+
format(value: number, options: FormatOptions): Promise<string>;
|
|
16
|
+
getFormatterSpec(options: FormatOptions): Promise<FormatterSpec>;
|
|
17
|
+
getParserSpec(options: FormatOptions): Promise<ParserSpec>;
|
|
18
|
+
}
|
|
19
|
+
/** @alpha */
|
|
20
|
+
export declare class ContentPropertyValueFormatter extends PropertyValueFormatter {
|
|
21
|
+
formatContent(content: Content): Promise<Content>;
|
|
22
|
+
private formatValues;
|
|
23
|
+
private formatNestedContentDisplayValues;
|
|
24
|
+
private isFormattable;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=PropertyFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyFormatter.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PropertyFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAU,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAM5C,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,aAAa;AACb,qBAAa,sBAAsB;IACrB,OAAO,CAAC,cAAc;gBAAd,cAAc,EAAE,aAAa;IAEpC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAK5C,gBAAgB,CAAC,OAAO,EAAE,aAAa;IAOvC,aAAa,CAAC,OAAO,EAAE,aAAa;CAMlD;AAED,aAAa;AACb,qBAAa,6BAA8B,SAAQ,sBAAsB;IAC1D,aAAa,CAAC,OAAO,EAAE,OAAO;YAQ7B,YAAY;YAgBZ,gCAAgC;IAM9C,OAAO,CAAC,aAAa;CAMtB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Core
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ContentPropertyValueFormatter = exports.PropertyValueFormatter = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const core_quantity_1 = require("@itwin/core-quantity");
|
|
13
|
+
const Value_1 = require("./content/Value");
|
|
14
|
+
/** @alpha */
|
|
15
|
+
class PropertyValueFormatter {
|
|
16
|
+
constructor(_unitsProvider) {
|
|
17
|
+
this._unitsProvider = _unitsProvider;
|
|
18
|
+
}
|
|
19
|
+
async format(value, options) {
|
|
20
|
+
const formatterSpec = await this.getFormatterSpec(options);
|
|
21
|
+
return formatterSpec.applyFormatting(value);
|
|
22
|
+
}
|
|
23
|
+
async getFormatterSpec(options) {
|
|
24
|
+
const { formatProps, persistenceUnitName } = options;
|
|
25
|
+
const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
26
|
+
const format = await core_quantity_1.Format.createFromJSON("", this._unitsProvider, formatProps);
|
|
27
|
+
return core_quantity_1.FormatterSpec.create("", format, this._unitsProvider, persistenceUnit);
|
|
28
|
+
}
|
|
29
|
+
async getParserSpec(options) {
|
|
30
|
+
const { formatProps, persistenceUnitName } = options;
|
|
31
|
+
const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
32
|
+
const format = await core_quantity_1.Format.createFromJSON("", this._unitsProvider, formatProps);
|
|
33
|
+
return core_quantity_1.ParserSpec.create(format, this._unitsProvider, persistenceUnit);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.PropertyValueFormatter = PropertyValueFormatter;
|
|
37
|
+
/** @alpha */
|
|
38
|
+
class ContentPropertyValueFormatter extends PropertyValueFormatter {
|
|
39
|
+
async formatContent(content) {
|
|
40
|
+
const descriptor = content.descriptor;
|
|
41
|
+
for (const item of content.contentSet) {
|
|
42
|
+
await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);
|
|
43
|
+
}
|
|
44
|
+
return content;
|
|
45
|
+
}
|
|
46
|
+
async formatValues(values, displayValues, fields, mergedFields) {
|
|
47
|
+
for (const field of fields) {
|
|
48
|
+
const value = values[field.name];
|
|
49
|
+
if (field.isNestedContentField() && !mergedFields.includes(field.name)) {
|
|
50
|
+
(0, core_bentley_1.assert)(Value_1.Value.isNestedContent(value));
|
|
51
|
+
await this.formatNestedContentDisplayValues(value, field.nestedFields);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (this.isFormattable(field) && typeof value === "number") {
|
|
55
|
+
const koq = field.properties[0].property.kindOfQuantity;
|
|
56
|
+
displayValues[field.name] = await this.format(value, { persistenceUnitName: koq.persistenceUnit, formatProps: koq.activeFormat });
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async formatNestedContentDisplayValues(nestedValues, fields) {
|
|
62
|
+
for (const nestedValue of nestedValues) {
|
|
63
|
+
await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
isFormattable(field) {
|
|
67
|
+
return field.isPropertiesField()
|
|
68
|
+
&& field.properties.length > 0
|
|
69
|
+
&& field.properties[0].property.kindOfQuantity !== undefined
|
|
70
|
+
&& field.properties[0].property.kindOfQuantity.activeFormat !== undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ContentPropertyValueFormatter = ContentPropertyValueFormatter;
|
|
74
|
+
//# sourceMappingURL=PropertyFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/PropertyFormatter.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,wDAAqG;AAGrG,2CAA0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AAI,CAAC,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;SAC9G;IACH,CAAC;IAEO,aAAa,CAAC,KAAY;QAChC,OAAO,KAAK,CAAC,iBAAiB,EAAE;eAC3B,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;eAC3B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS;eACzD,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,KAAK,SAAS,CAAC;IAC9E,CAAC;CACF;AArCD,sEAqCC","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 Core\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Format, FormatProps, FormatterSpec, ParserSpec, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport { Content } from \"./content/Content\";\r\nimport { Field, PropertiesField } from \"./content/Fields\";\r\nimport { DisplayValue, NestedContentValue, Value } from \"./content/Value\";\r\nimport { KindOfQuantityInfo, PropertyInfo } from \"./EC\";\r\nimport { ValuesDictionary } from \"./Utils\";\r\n\r\n/** @alpha */\r\nexport interface FormatOptions {\r\n formatProps: FormatProps;\r\n persistenceUnitName: string;\r\n}\r\n\r\n/** @alpha */\r\nexport class PropertyValueFormatter {\r\n constructor(private _unitsProvider: UnitsProvider) { }\r\n\r\n public async format(value: number, options: FormatOptions) {\r\n const formatterSpec = await this.getFormatterSpec(options);\r\n return formatterSpec.applyFormatting(value);\r\n }\r\n\r\n public async getFormatterSpec(options: FormatOptions) {\r\n const { formatProps, persistenceUnitName } = options;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\r\n }\r\n\r\n public async getParserSpec(options: FormatOptions) {\r\n const { formatProps, persistenceUnitName } = options;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport class ContentPropertyValueFormatter extends PropertyValueFormatter {\r\n public async formatContent(content: Content) {\r\n const descriptor = content.descriptor;\r\n for (const item of content.contentSet) {\r\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\r\n }\r\n return content;\r\n }\r\n\r\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\r\n for (const field of fields) {\r\n const value = values[field.name];\r\n if (field.isNestedContentField() && !mergedFields.includes(field.name)) {\r\n assert(Value.isNestedContent(value));\r\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\r\n continue;\r\n }\r\n if (this.isFormattable(field) && typeof value === \"number\") {\r\n const koq = field.properties[0].property.kindOfQuantity;\r\n displayValues[field.name] = await this.format(value, { persistenceUnitName: koq.persistenceUnit, formatProps: koq.activeFormat });\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\r\n for (const nestedValue of nestedValues) {\r\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\r\n }\r\n }\r\n\r\n private isFormattable(field: Field): field is FormattableField {\r\n return field.isPropertiesField()\r\n && field.properties.length > 0\r\n && field.properties[0].property.kindOfQuantity !== undefined\r\n && field.properties[0].property.kindOfQuantity.activeFormat !== undefined;\r\n }\r\n}\r\n\r\ntype FormattableField = PropertiesField & {\r\n properties: [{\r\n property: PropertyInfo & {\r\n kindOfQuantity: KindOfQuantityInfo & {\r\n activeFormat: FormatProps;\r\n };\r\n };\r\n }];\r\n};\r\n"]}
|
|
@@ -19,6 +19,7 @@ export * from "./presentation-common/Utils";
|
|
|
19
19
|
export * from "./presentation-common/PresentationIpcInterface";
|
|
20
20
|
export * from "./presentation-common/LocalizationHelper";
|
|
21
21
|
export * from "./presentation-common/InstanceFilterDefinition";
|
|
22
|
+
export * from "./presentation-common/PropertyFormatter";
|
|
22
23
|
/**
|
|
23
24
|
* @module RPC
|
|
24
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,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AAChF,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,yDAAyD,CAAC;AACxE,cAAc,oFAAoF,CAAC;AACnG,cAAc,0EAA0E,CAAC;AACzF,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wEAAwE,CAAC;AACvF,cAAc,qEAAqE,CAAC;AACpF,cAAc,iFAAiF,CAAC;AAChG,cAAc,+DAA+D,CAAC;AAC9E,cAAc,6EAA6E,CAAC;AAC5F,cAAc,4EAA4E,CAAC;AAC3F,cAAc,2EAA2E,CAAC;AAC1F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC"}
|
|
@@ -35,6 +35,7 @@ __exportStar(require("./presentation-common/Utils"), exports);
|
|
|
35
35
|
__exportStar(require("./presentation-common/PresentationIpcInterface"), exports);
|
|
36
36
|
__exportStar(require("./presentation-common/LocalizationHelper"), exports);
|
|
37
37
|
__exportStar(require("./presentation-common/InstanceFilterDefinition"), exports);
|
|
38
|
+
__exportStar(require("./presentation-common/PropertyFormatter"), exports);
|
|
38
39
|
/**
|
|
39
40
|
* @module RPC
|
|
40
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,mEAAiD;AACjD,oEAAkD;AAClD,2DAAyC;AACzC,8DAA4C;AAC5C,+DAA6C;AAC7C,wEAAsD;AACtD,mFAAiE;AACjE,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,+DAA6C;AAC7C,8DAA4C;AAC5C,iFAA+D;AAC/D,2EAAyD;AACzD,iFAA+D;
|
|
1
|
+
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,mEAAiD;AACjD,oEAAkD;AAClD,2DAAyC;AACzC,8DAA4C;AAC5C,+DAA6C;AAC7C,wEAAsD;AACtD,mFAAiE;AACjE,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,+DAA6C;AAC7C,8DAA4C;AAC5C,iFAA+D;AAC/D,2EAAyD;AACzD,iFAA+D;AAC/D,0EAAwD;AAExD;;;;;;GAMG;AACH,iFAA+D;AAC/D,2EAAyD;AACzD,0EAAwD;AAExD;;;;;GAKG;AACH,iFAA+D;AAE/D;;;;;GAKG;AACH,yEAAuD;AACvD,wEAAsD;AACtD,2EAAyD;AACzD,6EAA2D;AAC3D,uEAAqD;AACrD,uEAAqD;AACrD,qEAAmD;AACnD,yEAAuD;AACvD,yEAAuD;AACvD,gFAA8D;AAC9D,sEAAoD;AACpD,iFAA+D;AAE/D;;;;;GAKG;AACH,iFAA+D;AAC/D,sEAAoD;AACpD,uEAAqD;AACrD,kFAAgE;AAEhE;;;;;GAKG;AACH,sFAAoE;AACpE,+FAA6E;AAC7E,gGAA8E;AAC9E,8GAA4F;AAC5F,oHAAkG;AAClG,uFAAqE;AACrE,0FAAwE;AACxE,0GAAwF;AACxF,qFAAmE;AACnE,qFAAmE;AACnE,yFAAuE;AACvE,8FAA4E;AAC5E,6FAA2E;AAC3E,yFAAuE;AACvE,4FAA0E;AAC1E,kGAAgF;AAChF,0FAAwE;AACxE,wFAAsE;AACtE,0FAAwE;AACxE,qHAAmG;AACnG,2GAAyF;AACzF,kFAAgE;AAChE,2FAAyE;AACzE,4FAA0E;AAC1E,yGAAuF;AACvF,sGAAoF;AACpF,kHAAgG;AAChG,gGAA8E;AAC9E,8GAA4F;AAC5F,6GAA2F;AAC3F,4GAA0F;AAC1F,+GAA6F;AAC7F,kFAAgE;AAChE,2FAAyE;AACzE,oFAAkE;AAClE,4FAA0E;AAC1E,mEAAiD;AACjD,sEAAoD;AACpD,mFAAiE;AACjE,wEAAsD","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/**\r\n * @module Core\r\n *\r\n * @docs-group-description Core\r\n * Common types used all across Presentation packages.\r\n */\r\nexport * from \"./presentation-common/AsyncTasks\";\r\nexport * from \"./presentation-common/Diagnostics\";\r\nexport * from \"./presentation-common/EC\";\r\nexport * from \"./presentation-common/Error\";\r\nexport * from \"./presentation-common/KeySet\";\r\nexport * from \"./presentation-common/LabelDefinition\";\r\nexport * from \"./presentation-common/PresentationManagerOptions\";\r\nexport * from \"./presentation-common/RegisteredRuleset\";\r\nexport * from \"./presentation-common/RulesetVariables\";\r\nexport * from \"./presentation-common/RulesetsFactory\";\r\nexport * from \"./presentation-common/Update\";\r\nexport * from \"./presentation-common/Utils\";\r\nexport * from \"./presentation-common/PresentationIpcInterface\";\r\nexport * from \"./presentation-common/LocalizationHelper\";\r\nexport * from \"./presentation-common/InstanceFilterDefinition\";\r\nexport * from \"./presentation-common/PropertyFormatter\";\r\n\r\n/**\r\n * @module RPC\r\n *\r\n * @docs-group-description RPC\r\n * Types used for RPC communication between frontend and backend. Generally should\r\n * only be used internally by presentation packages.\r\n */\r\nexport * from \"./presentation-common/PresentationRpcInterface\";\r\nexport * from \"./presentation-common/RpcRequestsHandler\";\r\nexport * from \"./presentation-common/ElementProperties\";\r\n\r\n/**\r\n * @module UnifiedSelection\r\n *\r\n * @docs-group-description UnifiedSelection\r\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\r\n */\r\nexport * from \"./presentation-common/selection/SelectionScope\";\r\n\r\n/**\r\n * @module Content\r\n *\r\n * @docs-group-description Content\r\n * Types related to presentation [content]($docs/presentation/content/index.md).\r\n */\r\nexport * from \"./presentation-common/content/Category\";\r\nexport * from \"./presentation-common/content/Content\";\r\nexport * from \"./presentation-common/content/Descriptor\";\r\nexport * from \"./presentation-common/content/DisplayTypes\";\r\nexport * from \"./presentation-common/content/Editor\";\r\nexport * from \"./presentation-common/content/Fields\";\r\nexport * from \"./presentation-common/content/Item\";\r\nexport * from \"./presentation-common/content/Property\";\r\nexport * from \"./presentation-common/content/Renderer\";\r\nexport * from \"./presentation-common/content/TypeDescription\";\r\nexport * from \"./presentation-common/content/Value\";\r\nexport * from \"./presentation-common/content/ContentTraverser\";\r\n\r\n/**\r\n * @module Hierarchies\r\n *\r\n * @docs-group-description Hierarchies\r\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\r\n */\r\nexport * from \"./presentation-common/hierarchy/HierarchyLevel\";\r\nexport * from \"./presentation-common/hierarchy/Key\";\r\nexport * from \"./presentation-common/hierarchy/Node\";\r\nexport * from \"./presentation-common/hierarchy/NodePathElement\";\r\n\r\n/**\r\n * @module PresentationRules\r\n *\r\n * @docs-group-description PresentationRules\r\n * Types for defining the presentation ruleset.\r\n */\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/SubCondition\";\r\nexport * from \"./presentation-common/rules/customization/CheckBoxRule\";\r\nexport * from \"./presentation-common/rules/customization/CustomizationRule\";\r\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule\";\r\nexport * from \"./presentation-common/rules/customization/GroupingRule\";\r\nexport * from \"./presentation-common/rules/customization/ImageIdOverride\";\r\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride\";\r\nexport * from \"./presentation-common/rules/customization/LabelOverride\";\r\nexport * from \"./presentation-common/rules/customization/SortingRule\";\r\nexport * from \"./presentation-common/rules/customization/StyleOverride\";\r\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification\";\r\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification\";\r\nexport * from \"./presentation-common/rules/content/ContentRule\";\r\nexport * from \"./presentation-common/rules/content/ContentSpecification\";\r\nexport * from \"./presentation-common/rules/content/PropertySpecification\";\r\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification\";\r\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification\";\r\nexport * from \"./presentation-common/rules/ClassSpecifications\";\r\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification\";\r\nexport * from \"./presentation-common/rules/RelationshipDirection\";\r\nexport * from \"./presentation-common/rules/RelationshipPathSpecification\";\r\nexport * from \"./presentation-common/rules/Rule\";\r\nexport * from \"./presentation-common/rules/Ruleset\";\r\nexport * from \"./presentation-common/rules/SchemasSpecification\";\r\nexport * from \"./presentation-common/rules/Variables\";\r\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Core
|
|
3
|
+
*/
|
|
4
|
+
import { FormatProps, FormatterSpec, ParserSpec, UnitsProvider } from "@itwin/core-quantity";
|
|
5
|
+
import { Content } from "./content/Content";
|
|
6
|
+
/** @alpha */
|
|
7
|
+
export interface FormatOptions {
|
|
8
|
+
formatProps: FormatProps;
|
|
9
|
+
persistenceUnitName: string;
|
|
10
|
+
}
|
|
11
|
+
/** @alpha */
|
|
12
|
+
export declare class PropertyValueFormatter {
|
|
13
|
+
private _unitsProvider;
|
|
14
|
+
constructor(_unitsProvider: UnitsProvider);
|
|
15
|
+
format(value: number, options: FormatOptions): Promise<string>;
|
|
16
|
+
getFormatterSpec(options: FormatOptions): Promise<FormatterSpec>;
|
|
17
|
+
getParserSpec(options: FormatOptions): Promise<ParserSpec>;
|
|
18
|
+
}
|
|
19
|
+
/** @alpha */
|
|
20
|
+
export declare class ContentPropertyValueFormatter extends PropertyValueFormatter {
|
|
21
|
+
formatContent(content: Content): Promise<Content>;
|
|
22
|
+
private formatValues;
|
|
23
|
+
private formatNestedContentDisplayValues;
|
|
24
|
+
private isFormattable;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=PropertyFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyFormatter.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PropertyFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAU,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAM5C,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,aAAa;AACb,qBAAa,sBAAsB;IACrB,OAAO,CAAC,cAAc;gBAAd,cAAc,EAAE,aAAa;IAEpC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAK5C,gBAAgB,CAAC,OAAO,EAAE,aAAa;IAOvC,aAAa,CAAC,OAAO,EAAE,aAAa;CAMlD;AAED,aAAa;AACb,qBAAa,6BAA8B,SAAQ,sBAAsB;IAC1D,aAAa,CAAC,OAAO,EAAE,OAAO;YAQ7B,YAAY;YAgBZ,gCAAgC;IAM9C,OAAO,CAAC,aAAa;CAMtB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Core
|
|
7
|
+
*/
|
|
8
|
+
import { assert } from "@itwin/core-bentley";
|
|
9
|
+
import { Format, FormatterSpec, ParserSpec } from "@itwin/core-quantity";
|
|
10
|
+
import { Value } from "./content/Value";
|
|
11
|
+
/** @alpha */
|
|
12
|
+
export class PropertyValueFormatter {
|
|
13
|
+
constructor(_unitsProvider) {
|
|
14
|
+
this._unitsProvider = _unitsProvider;
|
|
15
|
+
}
|
|
16
|
+
async format(value, options) {
|
|
17
|
+
const formatterSpec = await this.getFormatterSpec(options);
|
|
18
|
+
return formatterSpec.applyFormatting(value);
|
|
19
|
+
}
|
|
20
|
+
async getFormatterSpec(options) {
|
|
21
|
+
const { formatProps, persistenceUnitName } = options;
|
|
22
|
+
const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
23
|
+
const format = await Format.createFromJSON("", this._unitsProvider, formatProps);
|
|
24
|
+
return FormatterSpec.create("", format, this._unitsProvider, persistenceUnit);
|
|
25
|
+
}
|
|
26
|
+
async getParserSpec(options) {
|
|
27
|
+
const { formatProps, persistenceUnitName } = options;
|
|
28
|
+
const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
29
|
+
const format = await Format.createFromJSON("", this._unitsProvider, formatProps);
|
|
30
|
+
return ParserSpec.create(format, this._unitsProvider, persistenceUnit);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** @alpha */
|
|
34
|
+
export class ContentPropertyValueFormatter extends PropertyValueFormatter {
|
|
35
|
+
async formatContent(content) {
|
|
36
|
+
const descriptor = content.descriptor;
|
|
37
|
+
for (const item of content.contentSet) {
|
|
38
|
+
await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);
|
|
39
|
+
}
|
|
40
|
+
return content;
|
|
41
|
+
}
|
|
42
|
+
async formatValues(values, displayValues, fields, mergedFields) {
|
|
43
|
+
for (const field of fields) {
|
|
44
|
+
const value = values[field.name];
|
|
45
|
+
if (field.isNestedContentField() && !mergedFields.includes(field.name)) {
|
|
46
|
+
assert(Value.isNestedContent(value));
|
|
47
|
+
await this.formatNestedContentDisplayValues(value, field.nestedFields);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (this.isFormattable(field) && typeof value === "number") {
|
|
51
|
+
const koq = field.properties[0].property.kindOfQuantity;
|
|
52
|
+
displayValues[field.name] = await this.format(value, { persistenceUnitName: koq.persistenceUnit, formatProps: koq.activeFormat });
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async formatNestedContentDisplayValues(nestedValues, fields) {
|
|
58
|
+
for (const nestedValue of nestedValues) {
|
|
59
|
+
await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
isFormattable(field) {
|
|
63
|
+
return field.isPropertiesField()
|
|
64
|
+
&& field.properties.length > 0
|
|
65
|
+
&& field.properties[0].property.kindOfQuantity !== undefined
|
|
66
|
+
&& field.properties[0].property.kindOfQuantity.activeFormat !== undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=PropertyFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/PropertyFormatter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAe,aAAa,EAAE,UAAU,EAAiB,MAAM,sBAAsB,CAAC;AAGrG,OAAO,EAAoC,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAU1E,aAAa;AACb,MAAM,OAAO,sBAAsB;IACjC,YAAoB,cAA6B;QAA7B,mBAAc,GAAd,cAAc,CAAe;IAAI,CAAC;IAE/C,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,OAAsB;QACvD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC3D,OAAO,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,OAAsB;QAClD,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QACrD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QACtF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACjF,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;IAChF,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAsB;QAC/C,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QACrD,MAAM,eAAe,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,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;gBACxD,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,mBAAmB,EAAE,GAAG,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;gBAClI,SAAS;aACV;SACF;IACH,CAAC;IAEO,KAAK,CAAC,gCAAgC,CAAC,YAAkC,EAAE,MAAe;QAChG,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;YACtC,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;SAC9G;IACH,CAAC;IAEO,aAAa,CAAC,KAAY;QAChC,OAAO,KAAK,CAAC,iBAAiB,EAAE;eAC3B,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;eAC3B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS;eACzD,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,KAAK,SAAS,CAAC;IAC9E,CAAC;CACF","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 Core\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Format, FormatProps, FormatterSpec, ParserSpec, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport { Content } from \"./content/Content\";\r\nimport { Field, PropertiesField } from \"./content/Fields\";\r\nimport { DisplayValue, NestedContentValue, Value } from \"./content/Value\";\r\nimport { KindOfQuantityInfo, PropertyInfo } from \"./EC\";\r\nimport { ValuesDictionary } from \"./Utils\";\r\n\r\n/** @alpha */\r\nexport interface FormatOptions {\r\n formatProps: FormatProps;\r\n persistenceUnitName: string;\r\n}\r\n\r\n/** @alpha */\r\nexport class PropertyValueFormatter {\r\n constructor(private _unitsProvider: UnitsProvider) { }\r\n\r\n public async format(value: number, options: FormatOptions) {\r\n const formatterSpec = await this.getFormatterSpec(options);\r\n return formatterSpec.applyFormatting(value);\r\n }\r\n\r\n public async getFormatterSpec(options: FormatOptions) {\r\n const { formatProps, persistenceUnitName } = options;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\r\n }\r\n\r\n public async getParserSpec(options: FormatOptions) {\r\n const { formatProps, persistenceUnitName } = options;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport class ContentPropertyValueFormatter extends PropertyValueFormatter {\r\n public async formatContent(content: Content) {\r\n const descriptor = content.descriptor;\r\n for (const item of content.contentSet) {\r\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\r\n }\r\n return content;\r\n }\r\n\r\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\r\n for (const field of fields) {\r\n const value = values[field.name];\r\n if (field.isNestedContentField() && !mergedFields.includes(field.name)) {\r\n assert(Value.isNestedContent(value));\r\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\r\n continue;\r\n }\r\n if (this.isFormattable(field) && typeof value === \"number\") {\r\n const koq = field.properties[0].property.kindOfQuantity;\r\n displayValues[field.name] = await this.format(value, { persistenceUnitName: koq.persistenceUnit, formatProps: koq.activeFormat });\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\r\n for (const nestedValue of nestedValues) {\r\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\r\n }\r\n }\r\n\r\n private isFormattable(field: Field): field is FormattableField {\r\n return field.isPropertiesField()\r\n && field.properties.length > 0\r\n && field.properties[0].property.kindOfQuantity !== undefined\r\n && field.properties[0].property.kindOfQuantity.activeFormat !== undefined;\r\n }\r\n}\r\n\r\ntype FormattableField = PropertiesField & {\r\n properties: [{\r\n property: PropertyInfo & {\r\n kindOfQuantity: KindOfQuantityInfo & {\r\n activeFormat: FormatProps;\r\n };\r\n };\r\n }];\r\n};\r\n"]}
|
|
@@ -19,6 +19,7 @@ export * from "./presentation-common/Utils";
|
|
|
19
19
|
export * from "./presentation-common/PresentationIpcInterface";
|
|
20
20
|
export * from "./presentation-common/LocalizationHelper";
|
|
21
21
|
export * from "./presentation-common/InstanceFilterDefinition";
|
|
22
|
+
export * from "./presentation-common/PropertyFormatter";
|
|
22
23
|
/**
|
|
23
24
|
* @module RPC
|
|
24
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,yCAAyC,CAAC;AAExD;;;;;;GAMG;AACH,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AAExD;;;;;GAKG;AACH,cAAc,gDAAgD,CAAC;AAE/D;;;;;GAKG;AACH,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAE/D;;;;;GAKG;AACH,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAEhE;;;;;GAKG;AACH,cAAc,qDAAqD,CAAC;AACpE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,6EAA6E,CAAC;AAC5F,cAAc,mFAAmF,CAAC;AAClG,cAAc,sDAAsD,CAAC;AACrE,cAAc,yDAAyD,CAAC;AACxE,cAAc,yEAAyE,CAAC;AACxF,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wDAAwD,CAAC;AACvE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,wDAAwD,CAAC;AACvE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,iEAAiE,CAAC;AAChF,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,yDAAyD,CAAC;AACxE,cAAc,oFAAoF,CAAC;AACnG,cAAc,0EAA0E,CAAC;AACzF,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wEAAwE,CAAC;AACvF,cAAc,qEAAqE,CAAC;AACpF,cAAc,iFAAiF,CAAC;AAChG,cAAc,+DAA+D,CAAC;AAC9E,cAAc,6EAA6E,CAAC;AAC5F,cAAc,4EAA4E,CAAC;AAC3F,cAAc,2EAA2E,CAAC;AAC1F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC"}
|
|
@@ -23,6 +23,7 @@ export * from "./presentation-common/Utils";
|
|
|
23
23
|
export * from "./presentation-common/PresentationIpcInterface";
|
|
24
24
|
export * from "./presentation-common/LocalizationHelper";
|
|
25
25
|
export * from "./presentation-common/InstanceFilterDefinition";
|
|
26
|
+
export * from "./presentation-common/PropertyFormatter";
|
|
26
27
|
/**
|
|
27
28
|
* @module RPC
|
|
28
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,yCAAyC,CAAC;AAExD;;;;;;GAMG;AACH,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AAExD;;;;;GA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ChG,cAAc,+DAA+D,CAAC;AAC9E,cAAc,6EAA6E,CAAC;AAC5F,cAAc,4EAA4E,CAAC;AAC3F,cAAc,2EAA2E,CAAC;AAC1F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC","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/**\r\n * @module Core\r\n *\r\n * @docs-group-description Core\r\n * Common types used all across Presentation packages.\r\n */\r\nexport * from \"./presentation-common/AsyncTasks\";\r\nexport * from \"./presentation-common/Diagnostics\";\r\nexport * from \"./presentation-common/EC\";\r\nexport * from \"./presentation-common/Error\";\r\nexport * from \"./presentation-common/KeySet\";\r\nexport * from \"./presentation-common/LabelDefinition\";\r\nexport * from \"./presentation-common/PresentationManagerOptions\";\r\nexport * from \"./presentation-common/RegisteredRuleset\";\r\nexport * from \"./presentation-common/RulesetVariables\";\r\nexport * from \"./presentation-common/RulesetsFactory\";\r\nexport * from \"./presentation-common/Update\";\r\nexport * from \"./presentation-common/Utils\";\r\nexport * from \"./presentation-common/PresentationIpcInterface\";\r\nexport * from \"./presentation-common/LocalizationHelper\";\r\nexport * from \"./presentation-common/InstanceFilterDefinition\";\r\nexport * from \"./presentation-common/PropertyFormatter\";\r\n\r\n/**\r\n * @module RPC\r\n *\r\n * @docs-group-description RPC\r\n * Types used for RPC communication between frontend and backend. Generally should\r\n * only be used internally by presentation packages.\r\n */\r\nexport * from \"./presentation-common/PresentationRpcInterface\";\r\nexport * from \"./presentation-common/RpcRequestsHandler\";\r\nexport * from \"./presentation-common/ElementProperties\";\r\n\r\n/**\r\n * @module UnifiedSelection\r\n *\r\n * @docs-group-description UnifiedSelection\r\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\r\n */\r\nexport * from \"./presentation-common/selection/SelectionScope\";\r\n\r\n/**\r\n * @module Content\r\n *\r\n * @docs-group-description Content\r\n * Types related to presentation [content]($docs/presentation/content/index.md).\r\n */\r\nexport * from \"./presentation-common/content/Category\";\r\nexport * from \"./presentation-common/content/Content\";\r\nexport * from \"./presentation-common/content/Descriptor\";\r\nexport * from \"./presentation-common/content/DisplayTypes\";\r\nexport * from \"./presentation-common/content/Editor\";\r\nexport * from \"./presentation-common/content/Fields\";\r\nexport * from \"./presentation-common/content/Item\";\r\nexport * from \"./presentation-common/content/Property\";\r\nexport * from \"./presentation-common/content/Renderer\";\r\nexport * from \"./presentation-common/content/TypeDescription\";\r\nexport * from \"./presentation-common/content/Value\";\r\nexport * from \"./presentation-common/content/ContentTraverser\";\r\n\r\n/**\r\n * @module Hierarchies\r\n *\r\n * @docs-group-description Hierarchies\r\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\r\n */\r\nexport * from \"./presentation-common/hierarchy/HierarchyLevel\";\r\nexport * from \"./presentation-common/hierarchy/Key\";\r\nexport * from \"./presentation-common/hierarchy/Node\";\r\nexport * from \"./presentation-common/hierarchy/NodePathElement\";\r\n\r\n/**\r\n * @module PresentationRules\r\n *\r\n * @docs-group-description PresentationRules\r\n * Types for defining the presentation ruleset.\r\n */\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/SubCondition\";\r\nexport * from \"./presentation-common/rules/customization/CheckBoxRule\";\r\nexport * from \"./presentation-common/rules/customization/CustomizationRule\";\r\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule\";\r\nexport * from \"./presentation-common/rules/customization/GroupingRule\";\r\nexport * from \"./presentation-common/rules/customization/ImageIdOverride\";\r\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride\";\r\nexport * from \"./presentation-common/rules/customization/LabelOverride\";\r\nexport * from \"./presentation-common/rules/customization/SortingRule\";\r\nexport * from \"./presentation-common/rules/customization/StyleOverride\";\r\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification\";\r\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification\";\r\nexport * from \"./presentation-common/rules/content/ContentRule\";\r\nexport * from \"./presentation-common/rules/content/ContentSpecification\";\r\nexport * from \"./presentation-common/rules/content/PropertySpecification\";\r\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification\";\r\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification\";\r\nexport * from \"./presentation-common/rules/ClassSpecifications\";\r\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification\";\r\nexport * from \"./presentation-common/rules/RelationshipDirection\";\r\nexport * from \"./presentation-common/rules/RelationshipPathSpecification\";\r\nexport * from \"./presentation-common/rules/Rule\";\r\nexport * from \"./presentation-common/rules/Ruleset\";\r\nexport * from \"./presentation-common/rules/SchemasSpecification\";\r\nexport * from \"./presentation-common/rules/Variables\";\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/presentation-common",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.24",
|
|
4
4
|
"description": "Common pieces for iModel.js presentation packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"module": "lib/esm/presentation-common.js",
|
|
22
22
|
"typings": "lib/cjs/presentation-common",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@itwin/core-bentley": "^4.0.0-dev.
|
|
25
|
-
"@itwin/core-common": "^4.0.0-dev.
|
|
26
|
-
"@itwin/core-quantity": "^4.0.0-dev.
|
|
24
|
+
"@itwin/core-bentley": "^4.0.0-dev.24",
|
|
25
|
+
"@itwin/core-common": "^4.0.0-dev.24",
|
|
26
|
+
"@itwin/core-quantity": "^4.0.0-dev.24"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@itwin/build-tools": "4.0.0-dev.
|
|
30
|
-
"@itwin/core-bentley": "4.0.0-dev.
|
|
31
|
-
"@itwin/core-common": "4.0.0-dev.
|
|
32
|
-
"@itwin/core-quantity": "4.0.0-dev.
|
|
33
|
-
"@itwin/eslint-plugin": "4.0.0-dev.
|
|
29
|
+
"@itwin/build-tools": "4.0.0-dev.24",
|
|
30
|
+
"@itwin/core-bentley": "4.0.0-dev.24",
|
|
31
|
+
"@itwin/core-common": "4.0.0-dev.24",
|
|
32
|
+
"@itwin/core-quantity": "4.0.0-dev.24",
|
|
33
|
+
"@itwin/eslint-plugin": "4.0.0-dev.24",
|
|
34
34
|
"@types/chai": "4.3.1",
|
|
35
35
|
"@types/chai-as-promised": "^7",
|
|
36
36
|
"@types/chai-jest-snapshot": "^1.3.0",
|