@itwin/presentation-common 4.0.0-dev.80 → 4.0.0-dev.81

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 (73) hide show
  1. package/Ruleset.schema.json +4 -0
  2. package/lib/cjs/assets/locales/en/Presentation.json +4 -0
  3. package/lib/cjs/assets/locales/en-PSEUDO/Presentation.json +4 -0
  4. package/lib/cjs/presentation-common/{PropertyFormatter.d.ts → KoqPropertyValueFormatter.d.ts} +3 -14
  5. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
  6. package/lib/cjs/presentation-common/{PropertyFormatter.js → KoqPropertyValueFormatter.js} +5 -48
  7. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
  8. package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
  9. package/lib/cjs/presentation-common/LocalizationHelper.js +3 -0
  10. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  11. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +0 -13
  12. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  13. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  14. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +6 -0
  15. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  16. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  17. package/lib/cjs/presentation-common/Update.d.ts +1 -64
  18. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  19. package/lib/cjs/presentation-common/Update.js +1 -113
  20. package/lib/cjs/presentation-common/Update.js.map +1 -1
  21. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
  22. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
  23. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +139 -0
  24. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -0
  25. package/lib/cjs/presentation-common/content/Value.d.ts +18 -3
  26. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  27. package/lib/cjs/presentation-common/content/Value.js +8 -0
  28. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  29. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +7 -0
  30. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  31. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  32. package/lib/cjs/presentation-common.d.ts +2 -1
  33. package/lib/cjs/presentation-common.d.ts.map +1 -1
  34. package/lib/cjs/presentation-common.js +2 -1
  35. package/lib/cjs/presentation-common.js.map +1 -1
  36. package/lib/esm/presentation-common/{PropertyFormatter.d.ts → KoqPropertyValueFormatter.d.ts} +3 -14
  37. package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
  38. package/lib/esm/presentation-common/{PropertyFormatter.js → KoqPropertyValueFormatter.js} +3 -45
  39. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
  40. package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
  41. package/lib/esm/presentation-common/LocalizationHelper.js +3 -0
  42. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  43. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +0 -13
  44. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  45. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  46. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +6 -0
  47. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  48. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  49. package/lib/esm/presentation-common/Update.d.ts +1 -64
  50. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  51. package/lib/esm/presentation-common/Update.js +0 -112
  52. package/lib/esm/presentation-common/Update.js.map +1 -1
  53. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
  54. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
  55. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +134 -0
  56. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -0
  57. package/lib/esm/presentation-common/content/Value.d.ts +18 -3
  58. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  59. package/lib/esm/presentation-common/content/Value.js +8 -0
  60. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  61. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +7 -0
  62. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  63. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  64. package/lib/esm/presentation-common.d.ts +2 -1
  65. package/lib/esm/presentation-common.d.ts.map +1 -1
  66. package/lib/esm/presentation-common.js +2 -1
  67. package/lib/esm/presentation-common.js.map +1 -1
  68. package/lib/public/locales/en/Presentation.json +4 -0
  69. package/package.json +10 -10
  70. package/lib/cjs/presentation-common/PropertyFormatter.d.ts.map +0 -1
  71. package/lib/cjs/presentation-common/PropertyFormatter.js.map +0 -1
  72. package/lib/esm/presentation-common/PropertyFormatter.d.ts.map +0 -1
  73. package/lib/esm/presentation-common/PropertyFormatter.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yCAAuD;AACvD,2CAAgF;AAEhF,aAAa;AACA,QAAA,WAAW,GAAG,MAAM,CAAC;AAsBlC,aAAa;AACb,IAAiB,UAAU,CAgD1B;AAhDD,WAAiB,UAAU;IACzB,sCAAsC;IACtC,SAAgB,MAAM,CAAC,GAAe;QACpC,MAAM,IAAI,GAAmB,EAAE,CAAC;QAChC,KAAK,MAAM,MAAM,IAAI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E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,4BAA4B,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACrF,CAAC;IACJ,CAAC;IANe,6BAAQ,WAMvB,CAAA;AACH,CAAC,EA1BgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QA0BpC","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 { NodeKey, NodeKeyJSON } from \"./hierarchy/Key\";\r\nimport { Node, NodeJSON, PartialNode, PartialNodeJSON } from \"./hierarchy/Node\";\r\n\r\n/** @alpha */\r\nexport const UPDATE_FULL = \"FULL\";\r\n\r\n/** @alpha */\r\nexport interface UpdateInfoJSON {\r\n [imodel: string]: {\r\n [rulesetId: string]: {\r\n hierarchy?: HierarchyUpdateInfoJSON;\r\n content?: ContentUpdateInfo;\r\n };\r\n };\r\n}\r\n\r\n/** @alpha */\r\nexport interface UpdateInfo {\r\n [imodel: string]: {\r\n [rulesetId: string]: {\r\n hierarchy?: HierarchyUpdateInfo;\r\n content?: ContentUpdateInfo;\r\n };\r\n };\r\n}\r\n\r\n/** @alpha */\r\nexport namespace UpdateInfo {\r\n /** Serialize given object to JSON. */\r\n export function toJSON(obj: UpdateInfo): UpdateInfoJSON {\r\n const json: UpdateInfoJSON = {};\r\n for (const imodel in obj) {\r\n // istanbul ignore if\r\n if (!obj.hasOwnProperty(imodel))\r\n continue;\r\n\r\n json[imodel] = {};\r\n const rulesetObj = obj[imodel];\r\n for (const rulesetId in rulesetObj) {\r\n // istanbul ignore if\r\n if (!rulesetObj.hasOwnProperty(rulesetId))\r\n continue;\r\n\r\n json[imodel][rulesetId] = {\r\n hierarchy: rulesetObj[rulesetId].hierarchy ? HierarchyUpdateInfo.toJSON(rulesetObj[rulesetId].hierarchy!) : undefined,\r\n content: rulesetObj[rulesetId].content,\r\n };\r\n }\r\n }\r\n return json;\r\n }\r\n\r\n /** Deserialize given object from JSON */\r\n export function fromJSON(json: UpdateInfoJSON): UpdateInfo {\r\n const obj: UpdateInfo = {};\r\n for (const imodel in json) {\r\n // istanbul ignore if\r\n if (!json.hasOwnProperty(imodel))\r\n continue;\r\n\r\n obj[imodel] = {};\r\n const rulesetJson = json[imodel];\r\n for (const rulesetId in rulesetJson) {\r\n // istanbul ignore if\r\n if (!rulesetJson.hasOwnProperty(rulesetId))\r\n continue;\r\n\r\n obj[imodel][rulesetId] = {\r\n hierarchy: rulesetJson[rulesetId].hierarchy ? HierarchyUpdateInfo.fromJSON(rulesetJson[rulesetId].hierarchy!) : undefined,\r\n content: rulesetJson[rulesetId].content,\r\n };\r\n }\r\n }\r\n return obj;\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport interface ExpandedNodeUpdateRecordJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: NodeJSON;\r\n position: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface HierarchyUpdateRecordJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent?: NodeKeyJSON;\r\n nodesCount: number;\r\n expandedNodes?: ExpandedNodeUpdateRecordJSON[];\r\n instanceFilter?: string;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ExpandedNodeUpdateRecord {\r\n node: Node;\r\n position: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface HierarchyUpdateRecord {\r\n parent?: NodeKey;\r\n nodesCount: number;\r\n expandedNodes?: ExpandedNodeUpdateRecord[];\r\n instanceFilter?: string;\r\n}\r\n\r\n/** @alpha */\r\nexport namespace ExpandedNodeUpdateRecord { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Serialize given object to JSON. */\r\n export function toJSON(obj: ExpandedNodeUpdateRecord): ExpandedNodeUpdateRecordJSON {\r\n return {\r\n ...obj,\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: Node.toJSON(obj.node),\r\n };\r\n }\r\n\r\n /** Deserialize given object from JSON */\r\n export function fromJSON(json: ExpandedNodeUpdateRecordJSON): ExpandedNodeUpdateRecord {\r\n return {\r\n ...json,\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: Node.fromJSON(json.node),\r\n };\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport namespace HierarchyUpdateRecord { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Serialize given object to JSON. */\r\n export function toJSON(obj: HierarchyUpdateRecord): HierarchyUpdateRecordJSON {\r\n return {\r\n ...obj,\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: obj.parent ? NodeKey.toJSON(obj.parent) : undefined,\r\n expandedNodes: obj.expandedNodes ? obj.expandedNodes.map(ExpandedNodeUpdateRecord.toJSON) : undefined,\r\n };\r\n }\r\n\r\n /** Deserialize given object from JSON */\r\n export function fromJSON(json: HierarchyUpdateRecordJSON): HierarchyUpdateRecord {\r\n return {\r\n ...json,\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: json.parent ? NodeKey.fromJSON(json.parent) : undefined,\r\n expandedNodes: json.expandedNodes ? json.expandedNodes.map(ExpandedNodeUpdateRecord.fromJSON) : undefined,\r\n };\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport type HierarchyUpdateInfoJSON = typeof UPDATE_FULL | HierarchyUpdateRecordJSON[];\r\n\r\n/** @alpha */\r\nexport type HierarchyUpdateInfo = typeof UPDATE_FULL | HierarchyUpdateRecord[];\r\n\r\n/** @alpha */\r\nexport namespace HierarchyUpdateInfo { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Serialize given object to JSON. */\r\n export function toJSON(obj: HierarchyUpdateInfo): HierarchyUpdateInfoJSON {\r\n if (typeof obj === \"string\")\r\n return obj;\r\n return obj.map(HierarchyUpdateRecord.toJSON);\r\n }\r\n\r\n /** Deserialize given object from JSON */\r\n export function fromJSON(json: HierarchyUpdateInfoJSON): HierarchyUpdateInfo {\r\n if (typeof json === \"string\")\r\n return json;\r\n return json.map(HierarchyUpdateRecord.fromJSON);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport type ContentUpdateInfo = typeof UPDATE_FULL;\r\n\r\n/**\r\n * JSON representation of [[PartialHierarchyModification]].\r\n * @public\r\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport type PartialHierarchyModificationJSON = NodeInsertionInfoJSON | NodeDeletionInfoJSON | NodeUpdateInfoJSON;\r\n\r\n/**\r\n * Information about a hierarchy change: insertion, deletion or node update.\r\n * @public\r\n */\r\nexport type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;\r\n\r\n/** @public */\r\nexport namespace PartialHierarchyModification { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /**\r\n * Serialize given object to JSON.\r\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(obj: PartialHierarchyModification): PartialHierarchyModificationJSON {\r\n switch (obj.type) {\r\n case \"Insert\":\r\n return {\r\n type: \"Insert\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: obj.parent === undefined ? undefined : NodeKey.toJSON(obj.parent),\r\n position: obj.position,\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: Node.toJSON(obj.node),\r\n };\r\n\r\n case \"Update\":\r\n return {\r\n type: \"Update\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n target: NodeKey.toJSON(obj.target),\r\n changes: Node.toPartialJSON(obj.changes),\r\n };\r\n\r\n case \"Delete\":\r\n return {\r\n type: \"Delete\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: obj.parent === undefined ? undefined : NodeKey.toJSON(obj.parent),\r\n position: obj.position,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Deserialize given object from JSON\r\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: PartialHierarchyModificationJSON): PartialHierarchyModification {\r\n switch (json.type) {\r\n case \"Insert\":\r\n return {\r\n type: \"Insert\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: json.parent === undefined ? undefined : NodeKey.fromJSON(json.parent),\r\n position: json.position,\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: Node.fromJSON(json.node),\r\n };\r\n\r\n case \"Update\":\r\n return {\r\n type: \"Update\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n target: NodeKey.fromJSON(json.target),\r\n changes: Node.fromPartialJSON(json.changes),\r\n };\r\n\r\n case \"Delete\":\r\n return {\r\n type: \"Delete\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: json.parent === undefined ? undefined : NodeKey.fromJSON(json.parent),\r\n position: json.position,\r\n };\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Information about node insertion.\r\n * @public\r\n */\r\nexport interface NodeInsertionInfo {\r\n type: \"Insert\";\r\n /** Parent node key */\r\n parent?: NodeKey;\r\n /** Index of the new node under its parent */\r\n position: number;\r\n /** Inserted node */\r\n node: Node;\r\n}\r\n\r\n/**\r\n * JSON representation of [[NodeInsertionInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[NodeInsertionInfo]]\r\n */\r\nexport interface NodeInsertionInfoJSON {\r\n type: \"Insert\";\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent?: NodeKeyJSON;\r\n position: number;\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: NodeJSON;\r\n}\r\n\r\n/**\r\n * Information about node deletion.\r\n * @public\r\n */\r\nexport interface NodeDeletionInfo {\r\n type: \"Delete\";\r\n /** Parent of the deleted node */\r\n parent?: NodeKey;\r\n /** Position of the deleted node among its siblings in the initial, not updated tree */\r\n position: number;\r\n}\r\n\r\n/**\r\n * JSON representation of [[NodeDeletionInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[NodeDeletionInfo]]\r\n */\r\nexport interface NodeDeletionInfoJSON {\r\n type: \"Delete\";\r\n /** Parent of the deleted node */\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent?: NodeKeyJSON;\r\n /** Position of the deleted node among its siblings in the initial, not updated tree */\r\n position: number;\r\n}\r\n\r\n/**\r\n * Information about node update.\r\n * @public\r\n */\r\nexport interface NodeUpdateInfo {\r\n type: \"Update\";\r\n /** Key of the updated node */\r\n target: NodeKey;\r\n /** Updated node attributes */\r\n changes: PartialNode;\r\n}\r\n\r\n/**\r\n * JSON representation of [[NodeUpdateInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[NodeUpdateInfo]]\r\n */\r\nexport interface NodeUpdateInfoJSON {\r\n type: \"Update\";\r\n // eslint-disable-next-line deprecation/deprecation\r\n target: NodeKeyJSON;\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: PartialNodeJSON;\r\n}\r\n\r\n/**\r\n * JSON representation of [[HierarchyCompareInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]].\r\n */\r\nexport interface HierarchyCompareInfoJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: PartialHierarchyModificationJSON[];\r\n continuationToken?: {\r\n prevHierarchyNode: string;\r\n currHierarchyNode: string;\r\n };\r\n}\r\n\r\n/**\r\n * Information about hierarchy modification / differences.\r\n * @public\r\n */\r\nexport interface HierarchyCompareInfo {\r\n /** A list of hierarchy changes */\r\n changes: PartialHierarchyModification[];\r\n /** Continuation token for requesting more changes. */\r\n continuationToken?: {\r\n prevHierarchyNode: string;\r\n currHierarchyNode: string;\r\n };\r\n}\r\n\r\n/** @public */\r\nexport namespace HierarchyCompareInfo {\r\n /**\r\n * Serialize given object to JSON.\r\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(obj: HierarchyCompareInfo): HierarchyCompareInfoJSON {\r\n return {\r\n ...obj,\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: obj.changes.map((change) => PartialHierarchyModification.toJSON(change)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize given object from JSON\r\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: HierarchyCompareInfoJSON): HierarchyCompareInfo {\r\n return {\r\n ...json,\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: json.changes.map((change) => PartialHierarchyModification.fromJSON(change)),\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yCAAuD;AACvD,2CAAgF;AAEhF,aAAa;AACA,QAAA,WAAW,GAAG,MAAM,CAAC;AAgClC,cAAc;AACd,IAAiB,4BAA4B,CAsE5C;AAtED,WAAiB,4BAA4B;IAC3C;;;OAGG;IACH,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAiC;QACtD,QAAQ,GAAG,CAAC,IAAI,EAAE;YAChB,KAAK,QAAQ;gBACX,OAAO;oBACL,IAAI,EAAE,QAAQ;oBACd,mDAAmD;oBACnD,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;oBACzE,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,mDAAmD;oBACnD,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;iBAC5B,CAAC;YAEJ,KAAK,QAAQ;gBACX,OAAO;oBACL,IAAI,EAAE,QAAQ;oBACd,mDAAmD;oBACnD,MAAM,EAAE,aAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;oBAClC,OAAO,EAAE,WAAI,CAAC,aAAa,C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AAC;oBAC7E,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBACxB,CAAC;SACL;IACH,CAAC;IA5Be,qCAAQ,WA4BvB,CAAA;AACH,CAAC,EAtEgB,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAsE5C;AA6GD,cAAc;AACd,IAAiB,oBAAoB,CA0BpC;AA1BD,WAAiB,oBAAoB;IACnC;;;OAGG;IACH,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAyB;QAC9C,OAAO;YACL,GAAG,GAAG;YACN,mDAAmD;YACnD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,4BAA4B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAClF,CAAC;IACJ,CAAC;IANe,2BAAM,SAMrB,CAAA;IAED;;;OAGG;IACH,mDAAmD;IACnD,SAAgB,QAAQ,CAAC,IAA8B;QACrD,OAAO;YACL,GAAG,IAAI;YACP,mDAAmD;YACnD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,4BAA4B,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACrF,CAAC;IACJ,CAAC;IANe,6BAAQ,WAMvB,CAAA;AACH,CAAC,EA1BgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QA0BpC","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 { NodeKey, NodeKeyJSON } from \"./hierarchy/Key\";\r\nimport { Node, NodeJSON, PartialNode, PartialNodeJSON } from \"./hierarchy/Node\";\r\n\r\n/** @alpha */\r\nexport const UPDATE_FULL = \"FULL\";\r\n\r\n/** @alpha */\r\nexport interface UpdateInfo {\r\n [imodel: string]: {\r\n [rulesetId: string]: {\r\n hierarchy?: HierarchyUpdateInfo;\r\n content?: ContentUpdateInfo;\r\n };\r\n };\r\n}\r\n\r\n/** @alpha */\r\nexport type HierarchyUpdateInfo = typeof UPDATE_FULL;\r\n\r\n/** @alpha */\r\nexport type ContentUpdateInfo = typeof UPDATE_FULL;\r\n\r\n/**\r\n * JSON representation of [[PartialHierarchyModification]].\r\n * @public\r\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport type PartialHierarchyModificationJSON = NodeInsertionInfoJSON | NodeDeletionInfoJSON | NodeUpdateInfoJSON;\r\n\r\n/**\r\n * Information about a hierarchy change: insertion, deletion or node update.\r\n * @public\r\n */\r\nexport type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;\r\n\r\n/** @public */\r\nexport namespace PartialHierarchyModification { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /**\r\n * Serialize given object to JSON.\r\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(obj: PartialHierarchyModification): PartialHierarchyModificationJSON {\r\n switch (obj.type) {\r\n case \"Insert\":\r\n return {\r\n type: \"Insert\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: obj.parent === undefined ? undefined : NodeKey.toJSON(obj.parent),\r\n position: obj.position,\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: Node.toJSON(obj.node),\r\n };\r\n\r\n case \"Update\":\r\n return {\r\n type: \"Update\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n target: NodeKey.toJSON(obj.target),\r\n changes: Node.toPartialJSON(obj.changes),\r\n };\r\n\r\n case \"Delete\":\r\n return {\r\n type: \"Delete\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: obj.parent === undefined ? undefined : NodeKey.toJSON(obj.parent),\r\n position: obj.position,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Deserialize given object from JSON\r\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: PartialHierarchyModificationJSON): PartialHierarchyModification {\r\n switch (json.type) {\r\n case \"Insert\":\r\n return {\r\n type: \"Insert\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: json.parent === undefined ? undefined : NodeKey.fromJSON(json.parent),\r\n position: json.position,\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: Node.fromJSON(json.node),\r\n };\r\n\r\n case \"Update\":\r\n return {\r\n type: \"Update\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n target: NodeKey.fromJSON(json.target),\r\n changes: Node.fromPartialJSON(json.changes),\r\n };\r\n\r\n case \"Delete\":\r\n return {\r\n type: \"Delete\",\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent: json.parent === undefined ? undefined : NodeKey.fromJSON(json.parent),\r\n position: json.position,\r\n };\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Information about node insertion.\r\n * @public\r\n */\r\nexport interface NodeInsertionInfo {\r\n type: \"Insert\";\r\n /** Parent node key */\r\n parent?: NodeKey;\r\n /** Index of the new node under its parent */\r\n position: number;\r\n /** Inserted node */\r\n node: Node;\r\n}\r\n\r\n/**\r\n * JSON representation of [[NodeInsertionInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[NodeInsertionInfo]]\r\n */\r\nexport interface NodeInsertionInfoJSON {\r\n type: \"Insert\";\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent?: NodeKeyJSON;\r\n position: number;\r\n // eslint-disable-next-line deprecation/deprecation\r\n node: NodeJSON;\r\n}\r\n\r\n/**\r\n * Information about node deletion.\r\n * @public\r\n */\r\nexport interface NodeDeletionInfo {\r\n type: \"Delete\";\r\n /** Parent of the deleted node */\r\n parent?: NodeKey;\r\n /** Position of the deleted node among its siblings in the initial, not updated tree */\r\n position: number;\r\n}\r\n\r\n/**\r\n * JSON representation of [[NodeDeletionInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[NodeDeletionInfo]]\r\n */\r\nexport interface NodeDeletionInfoJSON {\r\n type: \"Delete\";\r\n /** Parent of the deleted node */\r\n // eslint-disable-next-line deprecation/deprecation\r\n parent?: NodeKeyJSON;\r\n /** Position of the deleted node among its siblings in the initial, not updated tree */\r\n position: number;\r\n}\r\n\r\n/**\r\n * Information about node update.\r\n * @public\r\n */\r\nexport interface NodeUpdateInfo {\r\n type: \"Update\";\r\n /** Key of the updated node */\r\n target: NodeKey;\r\n /** Updated node attributes */\r\n changes: PartialNode;\r\n}\r\n\r\n/**\r\n * JSON representation of [[NodeUpdateInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[NodeUpdateInfo]]\r\n */\r\nexport interface NodeUpdateInfoJSON {\r\n type: \"Update\";\r\n // eslint-disable-next-line deprecation/deprecation\r\n target: NodeKeyJSON;\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: PartialNodeJSON;\r\n}\r\n\r\n/**\r\n * JSON representation of [[HierarchyCompareInfo]].\r\n * @public\r\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]].\r\n */\r\nexport interface HierarchyCompareInfoJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: PartialHierarchyModificationJSON[];\r\n continuationToken?: {\r\n prevHierarchyNode: string;\r\n currHierarchyNode: string;\r\n };\r\n}\r\n\r\n/**\r\n * Information about hierarchy modification / differences.\r\n * @public\r\n */\r\nexport interface HierarchyCompareInfo {\r\n /** A list of hierarchy changes */\r\n changes: PartialHierarchyModification[];\r\n /** Continuation token for requesting more changes. */\r\n continuationToken?: {\r\n prevHierarchyNode: string;\r\n currHierarchyNode: string;\r\n };\r\n}\r\n\r\n/** @public */\r\nexport namespace HierarchyCompareInfo {\r\n /**\r\n * Serialize given object to JSON.\r\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(obj: HierarchyCompareInfo): HierarchyCompareInfoJSON {\r\n return {\r\n ...obj,\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: obj.changes.map((change) => PartialHierarchyModification.toJSON(change)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize given object from JSON\r\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: HierarchyCompareInfoJSON): HierarchyCompareInfo {\r\n return {\r\n ...json,\r\n // eslint-disable-next-line deprecation/deprecation\r\n changes: json.changes.map((change) => PartialHierarchyModification.fromJSON(change)),\r\n };\r\n }\r\n}\r\n"]}
@@ -0,0 +1,29 @@
1
+ /** @packageDocumentation
2
+ * @module Content
3
+ */
4
+ import { UnitSystemKey } from "@itwin/core-quantity";
5
+ import { KoqPropertyValueFormatter } from "../KoqPropertyValueFormatter";
6
+ import { Content } from "./Content";
7
+ import { Field } from "./Fields";
8
+ import { ArrayTypeDescription, PrimitiveTypeDescription, StructTypeDescription, TypeDescription } from "./TypeDescription";
9
+ import { DisplayValue, DisplayValuesMap, Value } from "./Value";
10
+ /** @alpha */
11
+ export declare class ContentFormatter {
12
+ private _propertyValueFormatter;
13
+ private _unitSystem?;
14
+ constructor(_propertyValueFormatter: ContentPropertyValueFormatter, _unitSystem?: UnitSystemKey | undefined);
15
+ formatContent(content: Content): Promise<Content>;
16
+ private formatValues;
17
+ private formatNestedContentDisplayValues;
18
+ }
19
+ /** @alpha */
20
+ export declare class ContentPropertyValueFormatter {
21
+ private _koqValueFormatter;
22
+ constructor(_koqValueFormatter: KoqPropertyValueFormatter);
23
+ formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue>;
24
+ formatValue(type: TypeDescription, value: Value): DisplayValue;
25
+ formatPrimitiveValue(type: PrimitiveTypeDescription, value: Value): string;
26
+ formatStructValue(type: StructTypeDescription, value: Value): DisplayValuesMap;
27
+ formatArrayValue(type: ArrayTypeDescription, value: Value): DisplayValue[];
28
+ }
29
+ //# sourceMappingURL=PropertyValueFormatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAmB,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAuB,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChJ,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAsB,KAAK,EAAE,MAAM,SAAS,CAAC;AAEpF,aAAa;AACb,qBAAa,gBAAgB;IACf,OAAO,CAAC,uBAAuB;IAAiC,OAAO,CAAC,WAAW,CAAC;gBAA5E,uBAAuB,EAAE,6BAA6B,EAAU,WAAW,CAAC,2BAAe;IAElG,aAAa,CAAC,OAAO,EAAE,OAAO;YAQ7B,YAAY;YAqBZ,gCAAgC;CAM/C;AAED,aAAa;AACb,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,yBAAyB;IAEpD,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAWxG,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,YAAY;IAW9D,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK;IAkCjE,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK;IAW3D,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK;CAMjE"}
@@ -0,0 +1,139 @@
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 Content
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ContentPropertyValueFormatter = exports.ContentFormatter = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const TypeDescription_1 = require("./TypeDescription");
13
+ const Value_1 = require("./Value");
14
+ /** @alpha */
15
+ class ContentFormatter {
16
+ constructor(_propertyValueFormatter, _unitSystem) {
17
+ this._propertyValueFormatter = _propertyValueFormatter;
18
+ this._unitSystem = _unitSystem;
19
+ }
20
+ async formatContent(content) {
21
+ const descriptor = content.descriptor;
22
+ for (const item of content.contentSet) {
23
+ await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);
24
+ }
25
+ return content;
26
+ }
27
+ async formatValues(values, displayValues, fields, mergedFields) {
28
+ for (const field of fields) {
29
+ const value = values[field.name];
30
+ // format display value of merged values
31
+ if (mergedFields.includes(field.name)) {
32
+ displayValues[field.name] = "@Presentation:label.varies@";
33
+ continue;
34
+ }
35
+ // format display values of nested content field
36
+ if (field.isNestedContentField()) {
37
+ (0, core_bentley_1.assert)(Value_1.Value.isNestedContent(value));
38
+ await this.formatNestedContentDisplayValues(value, field.nestedFields);
39
+ continue;
40
+ }
41
+ displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);
42
+ }
43
+ }
44
+ async formatNestedContentDisplayValues(nestedValues, fields) {
45
+ for (const nestedValue of nestedValues) {
46
+ await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);
47
+ }
48
+ }
49
+ }
50
+ exports.ContentFormatter = ContentFormatter;
51
+ /** @alpha */
52
+ class ContentPropertyValueFormatter {
53
+ constructor(_koqValueFormatter) {
54
+ this._koqValueFormatter = _koqValueFormatter;
55
+ }
56
+ async formatPropertyValue(field, value, unitSystem) {
57
+ if (isFieldWithKoq(field) && typeof value === "number") {
58
+ const koq = field.properties[0].property.kindOfQuantity;
59
+ const formattedValue = await this._koqValueFormatter.format(value, { koqName: koq.name, unitSystem });
60
+ if (formattedValue !== undefined)
61
+ return formattedValue;
62
+ }
63
+ return this.formatValue(field.type, value);
64
+ }
65
+ formatValue(type, value) {
66
+ switch (type.valueFormat) {
67
+ case TypeDescription_1.PropertyValueFormat.Primitive:
68
+ return this.formatPrimitiveValue(type, value);
69
+ case TypeDescription_1.PropertyValueFormat.Array:
70
+ return this.formatArrayValue(type, value);
71
+ case TypeDescription_1.PropertyValueFormat.Struct:
72
+ return this.formatStructValue(type, value);
73
+ }
74
+ }
75
+ formatPrimitiveValue(type, value) {
76
+ if (value === undefined)
77
+ return "";
78
+ if (type.typeName === "point2d" && isPoint2d(value)) {
79
+ return `X: ${formatDouble(value.x)} Y: ${formatDouble(value.y)}`;
80
+ }
81
+ if (type.typeName === "point3d" && isPoint3d(value)) {
82
+ return `X: ${formatDouble(value.x)} Y: ${formatDouble(value.y)} Z: ${formatDouble(value.z)}`;
83
+ }
84
+ if (type.typeName === "dateTime") {
85
+ (0, core_bentley_1.assert)(typeof value === "string");
86
+ return value;
87
+ }
88
+ if (type.typeName === "bool" || type.typeName === "boolean") {
89
+ (0, core_bentley_1.assert)(typeof value === "boolean");
90
+ return value ? "@Presentation:value.true@" : "@Presentation:value.false@";
91
+ }
92
+ if (type.typeName === "int" || type.typeName === "long") {
93
+ (0, core_bentley_1.assert)(isNumber(value));
94
+ return value.toFixed(0);
95
+ }
96
+ if (type.typeName === "double") {
97
+ (0, core_bentley_1.assert)(isNumber(value));
98
+ return formatDouble(value);
99
+ }
100
+ if (type.typeName === "navigation") {
101
+ (0, core_bentley_1.assert)(Value_1.Value.isNavigationValue(value));
102
+ return value.label.displayValue;
103
+ }
104
+ return value.toString();
105
+ }
106
+ formatStructValue(type, value) {
107
+ if (!Value_1.Value.isMap(value))
108
+ return {};
109
+ const formattedMember = {};
110
+ for (const member of type.members) {
111
+ formattedMember[member.name] = this.formatValue(member.type, value[member.name]);
112
+ }
113
+ return formattedMember;
114
+ }
115
+ formatArrayValue(type, value) {
116
+ if (!Value_1.Value.isArray(value))
117
+ return [];
118
+ return value.map((arrayVal) => this.formatValue(type.memberType, arrayVal));
119
+ }
120
+ }
121
+ exports.ContentPropertyValueFormatter = ContentPropertyValueFormatter;
122
+ function formatDouble(value) {
123
+ return value.toFixed(2);
124
+ }
125
+ function isFieldWithKoq(field) {
126
+ return field.isPropertiesField()
127
+ && field.properties.length > 0
128
+ && field.properties[0].property.kindOfQuantity !== undefined;
129
+ }
130
+ function isPoint2d(obj) {
131
+ return obj !== undefined && isNumber(obj.x) && isNumber(obj.y);
132
+ }
133
+ function isPoint3d(obj) {
134
+ return isPoint2d(obj) && isNumber(obj.z);
135
+ }
136
+ function isNumber(obj) {
137
+ return !isNaN(Number(obj));
138
+ }
139
+ //# sourceMappingURL=PropertyValueFormatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAO7C,uDAAgJ;AAChJ,mCAAoF;AAEpF,aAAa;AACb,MAAa,gBAAgB;IAC3B,YAAoB,uBAAsD,EAAU,WAA2B;QAA3F,4BAAuB,GAAvB,uBAAuB,CAA+B;QAAU,gBAAW,GAAX,WAAW,CAAgB;IAAI,CAAC;IAE7G,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE;YACrC,MAAM,IA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AS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,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/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC\";\r\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\nimport { Content } from \"./Content\";\r\nimport { Field, PropertiesField } from \"./Fields\";\r\nimport { ArrayTypeDescription, PrimitiveTypeDescription, PropertyValueFormat, StructTypeDescription, TypeDescription } from \"./TypeDescription\";\r\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value } from \"./Value\";\r\n\r\n/** @alpha */\r\nexport class ContentFormatter {\r\n constructor(private _propertyValueFormatter: ContentPropertyValueFormatter, private _unitSystem?: UnitSystemKey) { }\r\n\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\r\n // format display value of merged values\r\n if (mergedFields.includes(field.name)) {\r\n displayValues[field.name] = \"@Presentation:label.varies@\";\r\n continue;\r\n }\r\n\r\n // format display values of nested content field\r\n if (field.isNestedContentField()) {\r\n assert(Value.isNestedContent(value));\r\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\r\n continue;\r\n }\r\n\r\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\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}\r\n\r\n/** @alpha */\r\nexport class ContentPropertyValueFormatter {\r\n constructor(private _koqValueFormatter: KoqPropertyValueFormatter) { }\r\n\r\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\r\n if (isFieldWithKoq(field) && typeof value === \"number\") {\r\n const koq = field.properties[0].property.kindOfQuantity;\r\n const formattedValue = await this._koqValueFormatter.format(value, { koqName: koq.name, unitSystem });\r\n if (formattedValue !== undefined)\r\n return formattedValue;\r\n }\r\n\r\n return this.formatValue(field.type, value);\r\n }\r\n\r\n public formatValue(type: TypeDescription, value: Value): DisplayValue {\r\n switch (type.valueFormat) {\r\n case PropertyValueFormat.Primitive:\r\n return this.formatPrimitiveValue(type, value);\r\n case PropertyValueFormat.Array:\r\n return this.formatArrayValue(type, value);\r\n case PropertyValueFormat.Struct:\r\n return this.formatStructValue(type, value);\r\n }\r\n }\r\n\r\n public formatPrimitiveValue(type: PrimitiveTypeDescription, value: Value) {\r\n if (value === undefined)\r\n return \"\";\r\n\r\n if (type.typeName === \"point2d\" && isPoint2d(value)) {\r\n return `X: ${formatDouble(value.x)} Y: ${formatDouble(value.y)}`;\r\n }\r\n if (type.typeName === \"point3d\" && isPoint3d(value)) {\r\n return `X: ${formatDouble(value.x)} Y: ${formatDouble(value.y)} Z: ${formatDouble(value.z)}`;\r\n }\r\n if (type.typeName === \"dateTime\") {\r\n assert(typeof value === \"string\");\r\n return value;\r\n }\r\n if (type.typeName === \"bool\" || type.typeName === \"boolean\") {\r\n assert(typeof value === \"boolean\");\r\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\r\n }\r\n if (type.typeName === \"int\" || type.typeName === \"long\") {\r\n assert(isNumber(value));\r\n return value.toFixed(0);\r\n }\r\n if (type.typeName === \"double\") {\r\n assert(isNumber(value));\r\n return formatDouble(value);\r\n }\r\n if (type.typeName === \"navigation\") {\r\n assert(Value.isNavigationValue(value));\r\n return value.label.displayValue;\r\n }\r\n\r\n return value.toString();\r\n }\r\n\r\n public formatStructValue(type: StructTypeDescription, value: Value) {\r\n if (!Value.isMap(value))\r\n return {};\r\n\r\n const formattedMember: DisplayValuesMap = {};\r\n for (const member of type.members) {\r\n formattedMember[member.name] = this.formatValue(member.type, value[member.name]);\r\n }\r\n return formattedMember;\r\n }\r\n\r\n public formatArrayValue(type: ArrayTypeDescription, value: Value) {\r\n if (!Value.isArray(value))\r\n return [];\r\n\r\n return value.map((arrayVal) => this.formatValue(type.memberType, arrayVal));\r\n }\r\n}\r\n\r\nfunction formatDouble(value: number) {\r\n return value.toFixed(2);\r\n}\r\n\r\ntype FieldWithKoq = PropertiesField & {\r\n properties: [{\r\n property: PropertyInfo & {\r\n kindOfQuantity: KindOfQuantityInfo;\r\n };\r\n }];\r\n};\r\n\r\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\r\n return field.isPropertiesField()\r\n && field.properties.length > 0\r\n && field.properties[0].property.kindOfQuantity !== undefined;\r\n}\r\n\r\nfunction isPoint2d(obj: Value): obj is { x: number, y: number } {\r\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\r\n}\r\n\r\nfunction isPoint3d(obj: Value): obj is { x: number, y: number, z: number } {\r\n return isPoint2d(obj) && isNumber((obj as any).z);\r\n}\r\n\r\nfunction isNumber(obj: Value): obj is number {\r\n return !isNaN(Number(obj));\r\n}\r\n"]}
@@ -1,13 +1,14 @@
1
1
  /** @packageDocumentation
2
2
  * @module Content
3
3
  */
4
- import { InstanceKey } from "../EC";
4
+ import { InstanceId, InstanceKey } from "../EC";
5
+ import { LabelDefinition } from "../LabelDefinition";
5
6
  import { ValuesDictionary } from "../Utils";
6
7
  /**
7
8
  * Raw value type
8
9
  * @public
9
10
  */
10
- export type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NestedContentValue[];
11
+ export type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NavigationPropertyValue | NestedContentValue[];
11
12
  /** @public */
12
13
  export declare namespace Value {
13
14
  /** Is the value a primitive */
@@ -18,6 +19,8 @@ export declare namespace Value {
18
19
  function isMap(value: Value): value is ValuesMap;
19
20
  /** Is the value a nested content value */
20
21
  function isNestedContent(value: Value): value is NestedContentValue[];
22
+ /** Is the value a navigation value */
23
+ function isNavigationValue(value: Value): value is NavigationPropertyValue;
21
24
  /**
22
25
  * Serialize [[Value]] to JSON
23
26
  * @deprecated in 3.x. Use [[Value]]
@@ -91,6 +94,18 @@ export interface NestedContentValue {
91
94
  /** Names of fields whose values are merged */
92
95
  mergedFieldNames: string[];
93
96
  }
97
+ /**
98
+ * Data structure that describes value of the navigation property.
99
+ * @public
100
+ */
101
+ export interface NavigationPropertyValue {
102
+ /** Label of target instance. */
103
+ label: LabelDefinition;
104
+ /** Full class name of target instance in format `SchemaName:ClassName` */
105
+ className: string;
106
+ /** Id of target instance. */
107
+ id: InstanceId;
108
+ }
94
109
  /** @public */
95
110
  export declare namespace NestedContentValue {
96
111
  /**
@@ -109,7 +124,7 @@ export declare namespace NestedContentValue {
109
124
  * @public
110
125
  * @deprecated in 3.x. Use [[Value]]
111
126
  */
112
- export type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NestedContentValueJSON[];
127
+ export type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NavigationPropertyValue | NestedContentValueJSON[];
113
128
  /**
114
129
  * JSON representation of [[ValuesMap]]
115
130
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"Value.d.ts","sourceRoot":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CAOtE;IAED;;;OAGG;IAEH,SAAgB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,iBAAiB,CAOvE;CACF"}
@@ -31,6 +31,14 @@ var Value;
31
31
  return isNestedContentValue(value);
32
32
  }
33
33
  Value.isNestedContent = isNestedContent;
34
+ /** Is the value a navigation value */
35
+ function isNavigationValue(value) {
36
+ return value !== undefined
37
+ && value.id !== undefined
38
+ && value.className !== undefined
39
+ && value.label !== undefined;
40
+ }
41
+ Value.isNavigationValue = isNavigationValue;
34
42
  /**
35
43
  * Serialize [[Value]] to JSON
36
44
  * @deprecated in 3.x. Use [[Value]]
@@ -1 +1 @@
1
- {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,cAAc;AACd,IAAiB,KAAK,CAwDrB;AAxDD,WAAiB,KAAK;IACpB,+BAA+B;IAC/B,SAAgB,WAAW,CAAC,KAAY;QACtC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,iBAAW,cAE1B,CAAA;IAED,4BAA4B;IAC5B,SAAgB,OAAO,CAAC,KAAY;QAClC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAFe,aAAO,UAEtB,CAAA;IAED,kCAAkC;IAClC,SAAgB,KAAK,CAAC,KAAY;QAChC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAFe,WAAK,QAEpB,CAAA;IAED,0CAA0C;IAC1C,SAAgB,eAAe,CAAC,KAAY;QAC1C,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAFe,qBAAe,kBAE9B,CAAA;IAED;;;OAGG;IACH,mDAAmD;IACnD,SAAgB,QAAQ,CAAC,IAAe;QACtC,IAAI,IAAI,KAAK,IAAI;YACf,OAAO,SAAS,CAAC;QACnB,IAAI,oBAAoB,CAAC,IAAI,CAA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AG,CAAC,EAAE;YAC9B,mDAAmD;YACnD,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,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/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { InstanceKey } from \"../EC\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\n\r\n/**\r\n * Raw value type\r\n * @public\r\n */\r\nexport type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NestedContentValue[];\r\n\r\n/** @public */\r\nexport namespace Value { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: Value): value is string | number | boolean | undefined {\r\n return isPrimitiveValue(value);\r\n }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: Value): value is ValuesArray {\r\n return isArrayValue(value);\r\n }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: Value): value is ValuesMap {\r\n return isMapValue(value);\r\n }\r\n\r\n /** Is the value a nested content value */\r\n export function isNestedContent(value: Value): value is NestedContentValue[] {\r\n return isNestedContentValue(value);\r\n }\r\n\r\n /**\r\n * Serialize [[Value]] to JSON\r\n * @deprecated in 3.x. Use [[Value]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: ValueJSON): Value {\r\n if (json === null)\r\n return undefined;\r\n if (isNestedContentValue(json))\r\n // eslint-disable-next-line deprecation/deprecation\r\n return json.map(NestedContentValue.fromJSON);\r\n if (isArrayValue(json))\r\n return valuesArrayFromJSON(json);\r\n if (isMapValue(json))\r\n return valuesMapFromJSON(json);\r\n return json;\r\n }\r\n\r\n /**\r\n * Deserialize [[Value]] from JSON\r\n * @deprecated in 3.x. Use [[Value]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(value: Value): ValueJSON {\r\n if (undefined === value)\r\n return null;\r\n if (isNestedContentValue(value))\r\n // eslint-disable-next-line deprecation/deprecation\r\n return value.map(NestedContentValue.toJSON);\r\n if (isArrayValue(value))\r\n return valuesArrayToJSON(value);\r\n if (isMapValue(value))\r\n return valuesMapToJSON(value);\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * A map of raw values\r\n * @public\r\n */\r\nexport interface ValuesMap extends ValuesDictionary<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * An array of raw values\r\n * @public\r\n */\r\nexport interface ValuesArray extends Array<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Display value type.\r\n * @public\r\n */\r\nexport type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;\r\n\r\n/** @public */\r\nexport namespace DisplayValue { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: DisplayValue): value is string | undefined {\r\n return isPrimitiveValue(value);\r\n }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: DisplayValue): value is DisplayValuesArray {\r\n return isArrayValue(value);\r\n }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: DisplayValue): value is DisplayValuesMap {\r\n return isMapValue(value);\r\n }\r\n\r\n /**\r\n * Serialize [[DisplayValue]] to JSON\r\n * @deprecated in 3.x. Use [[DisplayValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: DisplayValueJSON): DisplayValue {\r\n if (json === null)\r\n return undefined;\r\n if (isArrayValue(json))\r\n return displayValuesArrayFromJSON(json);\r\n if (isMapValue(json))\r\n return displayValuesMapFromJSON(json);\r\n return json;\r\n }\r\n\r\n /**\r\n * Deserialize [[DisplayValue]] from JSON\r\n * @deprecated in 3.x. Use [[DisplayValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(value: DisplayValue): DisplayValueJSON {\r\n if (undefined === value)\r\n return null;\r\n if (isArrayValue(value))\r\n return displayValuesArrayToJSON(value);\r\n if (isMapValue(value))\r\n return displayValuesMapToJSON(value);\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * A map of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesMap extends ValuesDictionary<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * An array of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesArray extends Array<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Data structure that describes nested content value.\r\n * @public\r\n */\r\nexport interface NestedContentValue {\r\n /** Keys of instances whose content is contained in this value */\r\n primaryKeys: InstanceKey[];\r\n /** Content values map */\r\n values: ValuesDictionary<Value>;\r\n /** Content display values map */\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n /** Names of fields whose values are merged */\r\n mergedFieldNames: string[];\r\n}\r\n\r\n/** @public */\r\nexport namespace NestedContentValue {\r\n /**\r\n * Serialize [[NestedContentValue]] to JSON\r\n * @deprecated in 3.x. Use [[NestedContentValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(value: NestedContentValue): NestedContentValueJSON {\r\n return {\r\n ...value,\r\n values: valuesMapToJSON(value.values),\r\n displayValues: displayValuesMapToJSON(value.displayValues),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[NestedContentValue]] from JSON\r\n * @deprecated in 3.x. Use [[NestedContentValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: NestedContentValueJSON): NestedContentValue {\r\n return {\r\n ...json,\r\n values: valuesMapFromJSON(json.values),\r\n displayValues: displayValuesMapFromJSON(json.displayValues),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * JSON representation of [[Value]]\r\n * @public\r\n * @deprecated in 3.x. Use [[Value]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NestedContentValueJSON[];\r\n/**\r\n * JSON representation of [[ValuesMap]]\r\n * @public\r\n * @deprecated in 3.x. Use [[ValuesMap]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface ValuesMapJSON extends ValuesDictionary<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[ValuesArray]]\r\n * @public\r\n * @deprecated in 3.x. Use [[ValuesArray]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface ValuesArrayJSON extends Array<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[DisplayValue]]\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValue]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport type DisplayValueJSON = string | null | DisplayValuesMapJSON | DisplayValuesArrayJSON;\r\n\r\n/**\r\n * JSON representation of [[DisplayValuesMap]]\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValuesMap]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface DisplayValuesMapJSON extends ValuesDictionary<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[DisplayValuesArray]]\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValuesArray]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface DisplayValuesArrayJSON extends Array<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[NestedContentValue]]\r\n * @public\r\n * @deprecated in 3.x. Use [[NestedContentValue]]\r\n */\r\nexport interface NestedContentValueJSON {\r\n primaryKeys: InstanceKey[];\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: ValuesDictionary<ValueJSON>;\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\r\n mergedFieldNames: string[];\r\n}\r\n\r\n/**\r\n * A group of raw values and their common display value.\r\n * @public\r\n */\r\nexport interface DisplayValueGroup {\r\n /** Common display value for all grouped raw values */\r\n displayValue: DisplayValue;\r\n /** A list of grouped raw values */\r\n groupedRawValues: Value[];\r\n}\r\n\r\n/**\r\n * JSON representation of [[DisplayValueGroup]].\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValueGroup]]\r\n */\r\nexport interface DisplayValueGroupJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValue: DisplayValueJSON;\r\n // eslint-disable-next-line deprecation/deprecation\r\n groupedRawValues: ValueJSON[];\r\n}\r\n\r\n/** @public */\r\nexport namespace DisplayValueGroup {\r\n /**\r\n * Serialize [[DisplayValueGroup]] to JSON\r\n * @deprecated in 3.x. Use [[DisplayValueGroup]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(group: DisplayValueGroup): DisplayValueGroupJSON {\r\n return {\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValue: DisplayValue.toJSON(group.displayValue),\r\n // eslint-disable-next-line deprecation/deprecation\r\n groupedRawValues: group.groupedRawValues.map(Value.toJSON),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[DisplayValueGroup]] from JSON\r\n * @deprecated in 3.x. Use [[DisplayValueGroup]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: DisplayValueGroupJSON): DisplayValueGroup {\r\n return {\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValue: DisplayValue.fromJSON(json.displayValue),\r\n // eslint-disable-next-line deprecation/deprecation\r\n groupedRawValues: json.groupedRawValues.map(Value.fromJSON),\r\n };\r\n }\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction isNestedContentValue(v: Value | ValueJSON): v is NestedContentValue[] | NestedContentValueJSON[] {\r\n return (v !== undefined) && Array.isArray(v)\r\n && ((v.length === 0)\r\n || (v[0] as NestedContentValue).primaryKeys !== undefined\r\n && (v[0] as NestedContentValue).values !== undefined\r\n && (v[0] as NestedContentValue).displayValues !== undefined\r\n && (v[0] as NestedContentValue).mergedFieldNames !== undefined);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction isArrayValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesArray | ValuesArrayJSON | DisplayValuesArray | DisplayValuesArrayJSON {\r\n // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.\r\n // we have other means to determine the type of value.\r\n return (v !== undefined) && Array.isArray(v);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction isMapValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesMap | ValuesMapJSON | DisplayValuesMap | DisplayValuesMapJSON {\r\n return (v !== undefined) && (typeof v === \"object\") && !Array.isArray(v);\r\n}\r\nfunction isPrimitiveValue(v: Value | DisplayValue): v is string | number | boolean | undefined {\r\n return !isArrayValue(v) && !isMapValue(v);\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesArrayFromJSON(json: ValuesArrayJSON): ValuesArray {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return json.map(Value.fromJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesArrayToJSON(values: ValuesArray): ValuesArrayJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return values.map(Value.toJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesMapFromJSON(json: ValuesMapJSON): ValuesMap {\r\n const map: ValuesMap = {};\r\n for (const key in json) {\r\n /* istanbul ignore else */\r\n if (json.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = Value.fromJSON(json[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesMapToJSON(values: ValuesMap): ValuesMapJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n const map: ValuesMapJSON = {};\r\n for (const key in values) {\r\n /* istanbul ignore else */\r\n if (values.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = Value.toJSON(values[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesArrayFromJSON(json: DisplayValuesArrayJSON): DisplayValuesArray {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return json.map(DisplayValue.fromJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesArrayToJSON(values: DisplayValuesArray): DisplayValuesArrayJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return values.map(DisplayValue.toJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesMapFromJSON(json: DisplayValuesMapJSON): DisplayValuesMap {\r\n const map: DisplayValuesMap = {};\r\n for (const key in json) {\r\n /* istanbul ignore else */\r\n if (json.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = DisplayValue.fromJSON(json[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesMapToJSON(values: DisplayValuesMap): DisplayValuesMapJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n const map: DisplayValuesMapJSON = {};\r\n for (const key in values) {\r\n /* istanbul ignore else */\r\n if (values.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = DisplayValue.toJSON(values[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n"]}
1
+ {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,cAAc;AACd,IAAiB,KAAK,CAgErB;AAhED,WAA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AC,GAAG,CAAC,CAAC,CAAC;SACtC;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,mDAAmD;AACnD,SAAS,0BAA0B,CAAC,IAA4B;IAC9D,mDAAmD;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AACD,mDAAmD;AACnD,SAAS,wBAAwB,CAAC,MAA0B;IAC1D,mDAAmD;IACnD,OAAO,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AACD,mDAAmD;AACnD,SAAS,wBAAwB,CAAC,IAA0B;IAC1D,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC5B,mDAAmD;YACnD,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AACD,mDAAmD;AACnD,SAAS,sBAAsB,CAAC,MAAwB;IACtD,mDAAmD;IACnD,MAAM,GAAG,GAAyB,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,0BAA0B;QAC1B,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC9B,mDAAmD;YACnD,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,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/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { InstanceId, InstanceKey } from \"../EC\";\r\nimport { LabelDefinition } from \"../LabelDefinition\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\n\r\n/**\r\n * Raw value type\r\n * @public\r\n */\r\nexport type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NavigationPropertyValue | NestedContentValue[];\r\n\r\n/** @public */\r\nexport namespace Value { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: Value): value is string | number | boolean | undefined {\r\n return isPrimitiveValue(value);\r\n }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: Value): value is ValuesArray {\r\n return isArrayValue(value);\r\n }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: Value): value is ValuesMap {\r\n return isMapValue(value);\r\n }\r\n\r\n /** Is the value a nested content value */\r\n export function isNestedContent(value: Value): value is NestedContentValue[] {\r\n return isNestedContentValue(value);\r\n }\r\n\r\n /** Is the value a navigation value */\r\n export function isNavigationValue(value: Value): value is NavigationPropertyValue {\r\n return value !== undefined\r\n && (value as NavigationPropertyValue).id !== undefined\r\n && (value as NavigationPropertyValue).className !== undefined\r\n && (value as NavigationPropertyValue).label !== undefined;\r\n }\r\n\r\n /**\r\n * Serialize [[Value]] to JSON\r\n * @deprecated in 3.x. Use [[Value]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: ValueJSON): Value {\r\n if (json === null)\r\n return undefined;\r\n if (isNestedContentValue(json))\r\n // eslint-disable-next-line deprecation/deprecation\r\n return json.map(NestedContentValue.fromJSON);\r\n if (isArrayValue(json))\r\n return valuesArrayFromJSON(json);\r\n if (isMapValue(json))\r\n return valuesMapFromJSON(json);\r\n return json;\r\n }\r\n\r\n /**\r\n * Deserialize [[Value]] from JSON\r\n * @deprecated in 3.x. Use [[Value]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(value: Value): ValueJSON {\r\n if (undefined === value)\r\n return null;\r\n if (isNestedContentValue(value))\r\n // eslint-disable-next-line deprecation/deprecation\r\n return value.map(NestedContentValue.toJSON);\r\n if (isArrayValue(value))\r\n return valuesArrayToJSON(value);\r\n if (isMapValue(value))\r\n return valuesMapToJSON(value);\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * A map of raw values\r\n * @public\r\n */\r\nexport interface ValuesMap extends ValuesDictionary<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * An array of raw values\r\n * @public\r\n */\r\nexport interface ValuesArray extends Array<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Display value type.\r\n * @public\r\n */\r\nexport type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;\r\n\r\n/** @public */\r\nexport namespace DisplayValue { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: DisplayValue): value is string | undefined {\r\n return isPrimitiveValue(value);\r\n }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: DisplayValue): value is DisplayValuesArray {\r\n return isArrayValue(value);\r\n }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: DisplayValue): value is DisplayValuesMap {\r\n return isMapValue(value);\r\n }\r\n\r\n /**\r\n * Serialize [[DisplayValue]] to JSON\r\n * @deprecated in 3.x. Use [[DisplayValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: DisplayValueJSON): DisplayValue {\r\n if (json === null)\r\n return undefined;\r\n if (isArrayValue(json))\r\n return displayValuesArrayFromJSON(json);\r\n if (isMapValue(json))\r\n return displayValuesMapFromJSON(json);\r\n return json;\r\n }\r\n\r\n /**\r\n * Deserialize [[DisplayValue]] from JSON\r\n * @deprecated in 3.x. Use [[DisplayValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(value: DisplayValue): DisplayValueJSON {\r\n if (undefined === value)\r\n return null;\r\n if (isArrayValue(value))\r\n return displayValuesArrayToJSON(value);\r\n if (isMapValue(value))\r\n return displayValuesMapToJSON(value);\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * A map of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesMap extends ValuesDictionary<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * An array of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesArray extends Array<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Data structure that describes nested content value.\r\n * @public\r\n */\r\nexport interface NestedContentValue {\r\n /** Keys of instances whose content is contained in this value */\r\n primaryKeys: InstanceKey[];\r\n /** Content values map */\r\n values: ValuesDictionary<Value>;\r\n /** Content display values map */\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n /** Names of fields whose values are merged */\r\n mergedFieldNames: string[];\r\n}\r\n\r\n/**\r\n * Data structure that describes value of the navigation property.\r\n * @public\r\n */\r\nexport interface NavigationPropertyValue {\r\n /** Label of target instance. */\r\n label: LabelDefinition;\r\n /** Full class name of target instance in format `SchemaName:ClassName` */\r\n className: string;\r\n /** Id of target instance. */\r\n id: InstanceId;\r\n}\r\n\r\n/** @public */\r\nexport namespace NestedContentValue {\r\n /**\r\n * Serialize [[NestedContentValue]] to JSON\r\n * @deprecated in 3.x. Use [[NestedContentValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(value: NestedContentValue): NestedContentValueJSON {\r\n return {\r\n ...value,\r\n values: valuesMapToJSON(value.values),\r\n displayValues: displayValuesMapToJSON(value.displayValues),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[NestedContentValue]] from JSON\r\n * @deprecated in 3.x. Use [[NestedContentValue]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: NestedContentValueJSON): NestedContentValue {\r\n return {\r\n ...json,\r\n values: valuesMapFromJSON(json.values),\r\n displayValues: displayValuesMapFromJSON(json.displayValues),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * JSON representation of [[Value]]\r\n * @public\r\n * @deprecated in 3.x. Use [[Value]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NavigationPropertyValue | NestedContentValueJSON[];\r\n/**\r\n * JSON representation of [[ValuesMap]]\r\n * @public\r\n * @deprecated in 3.x. Use [[ValuesMap]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface ValuesMapJSON extends ValuesDictionary<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[ValuesArray]]\r\n * @public\r\n * @deprecated in 3.x. Use [[ValuesArray]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface ValuesArrayJSON extends Array<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[DisplayValue]]\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValue]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport type DisplayValueJSON = string | null | DisplayValuesMapJSON | DisplayValuesArrayJSON;\r\n\r\n/**\r\n * JSON representation of [[DisplayValuesMap]]\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValuesMap]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface DisplayValuesMapJSON extends ValuesDictionary<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[DisplayValuesArray]]\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValuesArray]]\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface DisplayValuesArrayJSON extends Array<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[NestedContentValue]]\r\n * @public\r\n * @deprecated in 3.x. Use [[NestedContentValue]]\r\n */\r\nexport interface NestedContentValueJSON {\r\n primaryKeys: InstanceKey[];\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: ValuesDictionary<ValueJSON>;\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\r\n mergedFieldNames: string[];\r\n}\r\n\r\n/**\r\n * A group of raw values and their common display value.\r\n * @public\r\n */\r\nexport interface DisplayValueGroup {\r\n /** Common display value for all grouped raw values */\r\n displayValue: DisplayValue;\r\n /** A list of grouped raw values */\r\n groupedRawValues: Value[];\r\n}\r\n\r\n/**\r\n * JSON representation of [[DisplayValueGroup]].\r\n * @public\r\n * @deprecated in 3.x. Use [[DisplayValueGroup]]\r\n */\r\nexport interface DisplayValueGroupJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValue: DisplayValueJSON;\r\n // eslint-disable-next-line deprecation/deprecation\r\n groupedRawValues: ValueJSON[];\r\n}\r\n\r\n/** @public */\r\nexport namespace DisplayValueGroup {\r\n /**\r\n * Serialize [[DisplayValueGroup]] to JSON\r\n * @deprecated in 3.x. Use [[DisplayValueGroup]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function toJSON(group: DisplayValueGroup): DisplayValueGroupJSON {\r\n return {\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValue: DisplayValue.toJSON(group.displayValue),\r\n // eslint-disable-next-line deprecation/deprecation\r\n groupedRawValues: group.groupedRawValues.map(Value.toJSON),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[DisplayValueGroup]] from JSON\r\n * @deprecated in 3.x. Use [[DisplayValueGroup]]\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n export function fromJSON(json: DisplayValueGroupJSON): DisplayValueGroup {\r\n return {\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValue: DisplayValue.fromJSON(json.displayValue),\r\n // eslint-disable-next-line deprecation/deprecation\r\n groupedRawValues: json.groupedRawValues.map(Value.fromJSON),\r\n };\r\n }\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction isNestedContentValue(v: Value | ValueJSON): v is NestedContentValue[] | NestedContentValueJSON[] {\r\n return (v !== undefined) && Array.isArray(v)\r\n && ((v.length === 0)\r\n || (v[0] as NestedContentValue).primaryKeys !== undefined\r\n && (v[0] as NestedContentValue).values !== undefined\r\n && (v[0] as NestedContentValue).displayValues !== undefined\r\n && (v[0] as NestedContentValue).mergedFieldNames !== undefined);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction isArrayValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesArray | ValuesArrayJSON | DisplayValuesArray | DisplayValuesArrayJSON {\r\n // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.\r\n // we have other means to determine the type of value.\r\n return (v !== undefined) && Array.isArray(v);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction isMapValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesMap | ValuesMapJSON | DisplayValuesMap | DisplayValuesMapJSON {\r\n return (v !== undefined) && (typeof v === \"object\") && !Array.isArray(v);\r\n}\r\nfunction isPrimitiveValue(v: Value | DisplayValue): v is string | number | boolean | undefined {\r\n return !isArrayValue(v) && !isMapValue(v);\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesArrayFromJSON(json: ValuesArrayJSON): ValuesArray {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return json.map(Value.fromJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesArrayToJSON(values: ValuesArray): ValuesArrayJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return values.map(Value.toJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesMapFromJSON(json: ValuesMapJSON): ValuesMap {\r\n const map: ValuesMap = {};\r\n for (const key in json) {\r\n /* istanbul ignore else */\r\n if (json.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = Value.fromJSON(json[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction valuesMapToJSON(values: ValuesMap): ValuesMapJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n const map: ValuesMapJSON = {};\r\n for (const key in values) {\r\n /* istanbul ignore else */\r\n if (values.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = Value.toJSON(values[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesArrayFromJSON(json: DisplayValuesArrayJSON): DisplayValuesArray {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return json.map(DisplayValue.fromJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesArrayToJSON(values: DisplayValuesArray): DisplayValuesArrayJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return values.map(DisplayValue.toJSON);\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesMapFromJSON(json: DisplayValuesMapJSON): DisplayValuesMap {\r\n const map: DisplayValuesMap = {};\r\n for (const key in json) {\r\n /* istanbul ignore else */\r\n if (json.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = DisplayValue.fromJSON(json[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n// eslint-disable-next-line deprecation/deprecation\r\nfunction displayValuesMapToJSON(values: DisplayValuesMap): DisplayValuesMapJSON {\r\n // eslint-disable-next-line deprecation/deprecation\r\n const map: DisplayValuesMapJSON = {};\r\n for (const key in values) {\r\n /* istanbul ignore else */\r\n if (values.hasOwnProperty(key)) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n map[key] = DisplayValue.toJSON(values[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n"]}
@@ -54,5 +54,12 @@ export interface ContentModifier extends RuleBase, ContentModifiersList {
54
54
  * if this attribute is not specified.
55
55
  */
56
56
  class?: SingleSchemaClassSpecification;
57
+ /**
58
+ * Specifies whether [`calculatedProperties`]($docs/presentation/content/CalculatedPropertiesSpecification.md) and
59
+ * [`relatedProperties`]($docs/presentation/content/RelatedPropertiesSpecification.md) specifications should also be applied on
60
+ * [nested content]($docs/presentation/content/Terminology.md#nested-content).
61
+ * @beta
62
+ */
63
+ applyOnNestedContent?: boolean;
57
64
  }
58
65
  //# sourceMappingURL=ContentModifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentModifier.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/ContentModifier.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAErD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,iCAAiC,EAAE,CAAC;IAE3D;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,6BAA6B,EAAE,CAAC;IAErD;;OAEG;IACH,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ,EAAE,oBAAoB;IACrE,oCAAoC;IACpC,QAAQ,EAAE,iBAAiB,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,8BAA8B,CAAC;CACxC"}
1
+ {"version":3,"file":"ContentModifier.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/ContentModifier.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAErD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,iCAAiC,EAAE,CAAC;IAE3D;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,6BAA6B,EAAE,CAAC;IAErD;;OAEG;IACH,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ,EAAE,oBAAoB;IACrE,oCAAoC;IACpC,QAAQ,EAAE,iBAAiB,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,8BAA8B,CAAC;IAEvC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContentModifier.js","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/ContentModifier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PresentationRules\r\n */\r\n\r\nimport { SingleSchemaClassSpecification } from \"../../ClassSpecifications\";\r\nimport { RuleBase } from \"../../Rule\";\r\nimport { PropertySpecification } from \"../PropertySpecification\";\r\nimport { CalculatedPropertiesSpecification } from \"./CalculatedPropertiesSpecification\";\r\nimport { PropertyCategorySpecification } from \"./PropertyCategorySpecification\";\r\nimport { RelatedPropertiesSpecification } from \"./RelatedPropertiesSpecification\";\r\n\r\n/**\r\n * Contains various rule attributes that allow modifying returned content.\r\n *\r\n * This is not expected to be used directly - use through either [[ContentModifier]]\r\n * or [[ContentSpecification]].\r\n *\r\n * @see [Content modifier rule reference documentation page]($docs/presentation/content/ContentModifier.md)\r\n * @public\r\n */\r\nexport interface ContentModifiersList {\r\n /**\r\n * Specifications of [related properties]($docs/presentation/content/RelatedPropertiesSpecification.md) which are\r\n * included in the generated content.\r\n */\r\n relatedProperties?: RelatedPropertiesSpecification[];\r\n\r\n /**\r\n * Specifications of [calculated properties]($docs/presentation/content/CalculatedPropertiesSpecification.md) whose values are\r\n * generated using provided [ECExpressions]($docs/presentation/advanced/ECExpressions.md).\r\n */\r\n calculatedProperties?: CalculatedPropertiesSpecification[];\r\n\r\n /**\r\n * Specifications for [custom categories]($docs/presentation/content/PropertyCategorySpecification.md). Simply defining the categories does\r\n * nothing - they have to be referenced from [property specification]($docs/presentation/content/PropertySpecification.md) defined in\r\n * [[propertyOverrides]] by `id`.\r\n */\r\n propertyCategories?: PropertyCategorySpecification[];\r\n\r\n /**\r\n * Specifications for various [property overrides]($docs/presentation/content/PropertySpecification.md) that allow customizing property display.\r\n */\r\n propertyOverrides?: PropertySpecification[];\r\n}\r\n\r\n/**\r\n * Content modifiers are used to modify how instances of specified ECClasses are displayed in content which is\r\n * produced using [content rules]($docs/presentation/content/ContentRule.md). They do not produce any content\r\n * by themselves.\r\n *\r\n * @see [Content modifier rule reference documentation page]($docs/presentation/content/ContentModifier.md)\r\n * @public\r\n */\r\nexport interface ContentModifier extends RuleBase, ContentModifiersList {\r\n /** Used for serializing to JSON. */\r\n ruleType: \"ContentModifier\";\r\n\r\n /**\r\n * Specification of ECClass whose content should be modified. The modifier is applied to all content\r\n * if this attribute is not specified.\r\n */\r\n class?: SingleSchemaClassSpecification;\r\n}\r\n"]}
1
+ {"version":3,"file":"ContentModifier.js","sourceRoot":"","sources":["../../../../../../src/presentation-common/rules/content/modifiers/ContentModifier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PresentationRules\r\n */\r\n\r\nimport { SingleSchemaClassSpecification } from \"../../ClassSpecifications\";\r\nimport { RuleBase } from \"../../Rule\";\r\nimport { PropertySpecification } from \"../PropertySpecification\";\r\nimport { CalculatedPropertiesSpecification } from \"./CalculatedPropertiesSpecification\";\r\nimport { PropertyCategorySpecification } from \"./PropertyCategorySpecification\";\r\nimport { RelatedPropertiesSpecification } from \"./RelatedPropertiesSpecification\";\r\n\r\n/**\r\n * Contains various rule attributes that allow modifying returned content.\r\n *\r\n * This is not expected to be used directly - use through either [[ContentModifier]]\r\n * or [[ContentSpecification]].\r\n *\r\n * @see [Content modifier rule reference documentation page]($docs/presentation/content/ContentModifier.md)\r\n * @public\r\n */\r\nexport interface ContentModifiersList {\r\n /**\r\n * Specifications of [related properties]($docs/presentation/content/RelatedPropertiesSpecification.md) which are\r\n * included in the generated content.\r\n */\r\n relatedProperties?: RelatedPropertiesSpecification[];\r\n\r\n /**\r\n * Specifications of [calculated properties]($docs/presentation/content/CalculatedPropertiesSpecification.md) whose values are\r\n * generated using provided [ECExpressions]($docs/presentation/advanced/ECExpressions.md).\r\n */\r\n calculatedProperties?: CalculatedPropertiesSpecification[];\r\n\r\n /**\r\n * Specifications for [custom categories]($docs/presentation/content/PropertyCategorySpecification.md). Simply defining the categories does\r\n * nothing - they have to be referenced from [property specification]($docs/presentation/content/PropertySpecification.md) defined in\r\n * [[propertyOverrides]] by `id`.\r\n */\r\n propertyCategories?: PropertyCategorySpecification[];\r\n\r\n /**\r\n * Specifications for various [property overrides]($docs/presentation/content/PropertySpecification.md) that allow customizing property display.\r\n */\r\n propertyOverrides?: PropertySpecification[];\r\n}\r\n\r\n/**\r\n * Content modifiers are used to modify how instances of specified ECClasses are displayed in content which is\r\n * produced using [content rules]($docs/presentation/content/ContentRule.md). They do not produce any content\r\n * by themselves.\r\n *\r\n * @see [Content modifier rule reference documentation page]($docs/presentation/content/ContentModifier.md)\r\n * @public\r\n */\r\nexport interface ContentModifier extends RuleBase, ContentModifiersList {\r\n /** Used for serializing to JSON. */\r\n ruleType: \"ContentModifier\";\r\n\r\n /**\r\n * Specification of ECClass whose content should be modified. The modifier is applied to all content\r\n * if this attribute is not specified.\r\n */\r\n class?: SingleSchemaClassSpecification;\r\n\r\n /**\r\n * Specifies whether [`calculatedProperties`]($docs/presentation/content/CalculatedPropertiesSpecification.md) and\r\n * [`relatedProperties`]($docs/presentation/content/RelatedPropertiesSpecification.md) specifications should also be applied on\r\n * [nested content]($docs/presentation/content/Terminology.md#nested-content).\r\n * @beta\r\n */\r\n applyOnNestedContent?: boolean;\r\n}\r\n"]}
@@ -19,7 +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
+ export * from "./presentation-common/KoqPropertyValueFormatter";
23
23
  /**
24
24
  * @module RPC
25
25
  *
@@ -55,6 +55,7 @@ export * from "./presentation-common/content/Renderer";
55
55
  export * from "./presentation-common/content/TypeDescription";
56
56
  export * from "./presentation-common/content/Value";
57
57
  export * from "./presentation-common/content/ContentTraverser";
58
+ export * from "./presentation-common/content/PropertyValueFormatter";
58
59
  /**
59
60
  * @module Hierarchies
60
61
  *
@@ -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;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"}
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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,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"}
@@ -39,7 +39,7 @@ __exportStar(require("./presentation-common/Utils"), exports);
39
39
  __exportStar(require("./presentation-common/PresentationIpcInterface"), exports);
40
40
  __exportStar(require("./presentation-common/LocalizationHelper"), exports);
41
41
  __exportStar(require("./presentation-common/InstanceFilterDefinition"), exports);
42
- __exportStar(require("./presentation-common/PropertyFormatter"), exports);
42
+ __exportStar(require("./presentation-common/KoqPropertyValueFormatter"), exports);
43
43
  /**
44
44
  * @module RPC
45
45
  *
@@ -75,6 +75,7 @@ __exportStar(require("./presentation-common/content/Renderer"), exports);
75
75
  __exportStar(require("./presentation-common/content/TypeDescription"), exports);
76
76
  __exportStar(require("./presentation-common/content/Value"), exports);
77
77
  __exportStar(require("./presentation-common/content/ContentTraverser"), exports);
78
+ __exportStar(require("./presentation-common/content/PropertyValueFormatter"), exports);
78
79
  /**
79
80
  * @module Hierarchies
80
81
  *