@itwin/grouping-mapping-widget 0.8.2 → 0.9.0

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 (47) hide show
  1. package/lib/cjs/test/GroupPropertyUtils.test.d.ts +2 -0
  2. package/lib/cjs/test/GroupPropertyUtils.test.js +590 -0
  3. package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -0
  4. package/lib/cjs/test/MockFactory.d.ts +9 -0
  5. package/lib/cjs/test/MockFactory.js +42 -0
  6. package/lib/cjs/test/MockFactory.js.map +1 -0
  7. package/lib/cjs/test/PropertyFieldsHelpers.d.ts +86 -0
  8. package/lib/cjs/test/PropertyFieldsHelpers.js +80 -0
  9. package/lib/cjs/test/PropertyFieldsHelpers.js.map +1 -0
  10. package/lib/cjs/test/QueryBuilder.test.d.ts +2 -0
  11. package/lib/cjs/test/QueryBuilder.test.js +53 -0
  12. package/lib/cjs/test/QueryBuilder.test.js.map +1 -0
  13. package/lib/cjs/test/QueryBuilder.testdata.d.ts +3 -0
  14. package/lib/cjs/test/QueryBuilder.testdata.js +843 -0
  15. package/lib/cjs/test/QueryBuilder.testdata.js.map +1 -0
  16. package/lib/cjs/test/QueryBuilderTestData.d.ts +50 -0
  17. package/lib/cjs/test/QueryBuilderTestData.js +3 -0
  18. package/lib/cjs/test/QueryBuilderTestData.js.map +1 -0
  19. package/lib/cjs/widget/components/GroupPropertyUtils.js +7 -3
  20. package/lib/cjs/widget/components/GroupPropertyUtils.js.map +1 -1
  21. package/lib/cjs/widget/components/QueryBuilder.d.ts +11 -9
  22. package/lib/cjs/widget/components/QueryBuilder.js +91 -216
  23. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  24. package/lib/esm/test/GroupPropertyUtils.test.d.ts +2 -0
  25. package/lib/esm/test/GroupPropertyUtils.test.js +588 -0
  26. package/lib/esm/test/GroupPropertyUtils.test.js.map +1 -0
  27. package/lib/esm/test/MockFactory.d.ts +9 -0
  28. package/lib/esm/test/MockFactory.js +19 -0
  29. package/lib/esm/test/MockFactory.js.map +1 -0
  30. package/lib/esm/test/PropertyFieldsHelpers.d.ts +86 -0
  31. package/lib/esm/test/PropertyFieldsHelpers.js +69 -0
  32. package/lib/esm/test/PropertyFieldsHelpers.js.map +1 -0
  33. package/lib/esm/test/QueryBuilder.test.d.ts +2 -0
  34. package/lib/esm/test/QueryBuilder.test.js +51 -0
  35. package/lib/esm/test/QueryBuilder.test.js.map +1 -0
  36. package/lib/esm/test/QueryBuilder.testdata.d.ts +3 -0
  37. package/lib/esm/test/QueryBuilder.testdata.js +840 -0
  38. package/lib/esm/test/QueryBuilder.testdata.js.map +1 -0
  39. package/lib/esm/test/QueryBuilderTestData.d.ts +50 -0
  40. package/lib/esm/test/QueryBuilderTestData.js +2 -0
  41. package/lib/esm/test/QueryBuilderTestData.js.map +1 -0
  42. package/lib/esm/widget/components/GroupPropertyUtils.js +7 -3
  43. package/lib/esm/widget/components/GroupPropertyUtils.js.map +1 -1
  44. package/lib/esm/widget/components/QueryBuilder.d.ts +11 -9
  45. package/lib/esm/widget/components/QueryBuilder.js +91 -216
  46. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  47. package/package.json +32 -28
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupPropertyUtils.test.js","sourceRoot":"","sources":["../../../src/test/GroupPropertyUtils.test.ts"],"names":[],"mappings":";;AAKA,4DAAkD;AAElD,gFAA2H;AAC3H,mEAAoL;AACpL,+BAAsC;AAEtC,oEAAsF;AAEtF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,cAAc,GAAG,CAAC,wDAAgC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,8CAAsB,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAEpH,MAAM,MAAM,GAAG,8CAAyB,CAAC,cAAc,CAAC,CAAC;Q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M,MAAM,GAAG,mCAAc,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;QAChE,aAAM,CAAC,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAE/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QAEpF,MAAM,kBAAkB,GAAuB,CAAC;gBAC9C,YAAY,EAAE,OAAO;gBACrB,YAAY,EAAE,GAAG;gBACjB,eAAe,EAAE,GAAG;gBACpB,mBAAmB,EAAE;oBACnB,OAAO;iBACR;gBACD,YAAY,EAAE,0BAAQ,CAAC,MAAM;gBAC7B,wBAAwB,EAAE,+BAA+B;gBACzD,iBAAiB,EAAE,iBAAiB;gBACpC,GAAG,EAAE,iCAAiC;gBACtC,aAAa,EAAE,eAAe;gBAC9B,uBAAuB,EAAE,SAAS;aACnC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAkB;YAClC;gBACE,YAAY,EAAE,GAAG;gBACjB,WAAW,EAAE,GAAG;gBAChB,cAAc,EAAE,0BAAQ,CAAC,MAAM;gBAC/B,cAAc,EAAE,gCAAgC;aACjD;YACD;gBACE,YAAY,EAAE,GAAG;gBACjB,WAAW,EAAE,GAAG;gBAChB,cAAc,EAAE,0BAAQ,CAAC,MAAM;gBAC/B,cAAc,EAAE,gCAAgC;aACjD;SACF,CAAC;QAEF,MAAM,MAAM,GAAG,mCAAc,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;QAChE,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { ECProperty } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport type { PropertyMetaData } from \"../widget/components/GroupPropertyUtils\";\nimport { convertPresentationFields, convertToECProperties, findProperties} from \"../widget/components/GroupPropertyUtils\";\nimport { createTestECClassInfo, createTestNestedContentField, createTestPropertiesContentField, createTestPropertyInfo, createTestRelatedClassInfo } from \"./PropertyFieldsHelpers\";\nimport { assert, expect } from \"chai\";\nimport type { NavigationPropertyInfo, StructTypeDescription } from \"@itwin/presentation-common\";\nimport { PropertyValueFormat, RelationshipMeaning } from \"@itwin/presentation-common\";\n\ndescribe(\"Group properties utilities\", () => {\n it(\"one primitive string property\", () => {\n const propertyFields = [createTestPropertiesContentField({ properties: [{ property: createTestPropertyInfo() }] })];\n\n const result = convertPresentationFields(propertyFields);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"PropertyName\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|PropertyName\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n });\n\n it(\"multiple primitive properies of different types\", () => {\n const testProperties = [createTestPropertyInfo({ name: \"propString\" }),\n createTestPropertyInfo({ name: \"propInt\", type: \"int\" }),\n createTestPropertyInfo({ name: \"propBool\", type: \"boolean\" }),\n createTestPropertyInfo({ name: \"propEnum\", type: \"enum\" }),\n createTestPropertyInfo({ name: \"propLong\", type: \"long\" }),\n createTestPropertyInfo({ name: \"propNumber\", type: \"number\" }),\n ];\n const propertyFields = testProperties.map((p) => createTestPropertiesContentField({ properties: [{ property: p }] }));\n\n const result = convertPresentationFields(propertyFields);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propString\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propString\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propInt\"],\n propertyType: DataType.Integer,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propInt\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propBool\"],\n propertyType: DataType.Boolean,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propBool\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propEnum\"],\n propertyType: DataType.Integer,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propEnum\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propLong\"],\n propertyType: DataType.Integer,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propLong\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propNumber\"],\n propertyType: DataType.Number,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propNumber\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n });\n\n it(\"one BisCore:ElementOwnsUniqueAspect nested property\", () => {\n const propertiesField = createTestPropertiesContentField({\n properties: [{ property: createTestPropertyInfo({ name: \"prop1\" }) }],\n });\n\n const nestedAspectField = createTestNestedContentField({\n nestedFields: [propertiesField],\n relationshipMeaning: RelationshipMeaning.SameInstance,\n pathToPrimaryClass: [\n createTestRelatedClassInfo({\n sourceClassInfo: createTestECClassInfo({ name: \"Some:UniqueAspect\" }),\n relationshipInfo: createTestECClassInfo({ name: \"BisCore:ElementOwnsUniqueAspect\" }),\n targetClassInfo: createTestECClassInfo({ name: \"Schema:Class\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: true,\n }),\n ],\n });\n\n const result = convertPresentationFields([nestedAspectField]);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"SchemaName\",\n sourceClassName: \"ClassName\",\n ecPropertyTraversal: [\"prop1\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: \"SchemaName:ClassName\",\n key: \"SchemaName:ClassName|SchemaName:ClassName|prop1\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n\n });\n\n it(\"one BisCore:ElementOwnsMultiAspects nested property\", () => {\n\n const propertiesField = createTestPropertiesContentField({\n properties: [{ property: createTestPropertyInfo({ name: \"prop1\" }) }],\n });\n\n const nestedAspectField = createTestNestedContentField({\n nestedFields: [propertiesField],\n relationshipMeaning: RelationshipMeaning.SameInstance,\n pathToPrimaryClass: [\n createTestRelatedClassInfo({\n sourceClassInfo: createTestECClassInfo({ name: \"Some:MultiAspect\" }),\n relationshipInfo: createTestECClassInfo({ name: \"BisCore:ElementOwnsMultiAspects\" }),\n targetClassInfo: createTestECClassInfo({ name: \"Schema:Class\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: true,\n }),\n ],\n });\n\n const result = convertPresentationFields([nestedAspectField]);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"SchemaName\",\n sourceClassName: \"ClassName\",\n ecPropertyTraversal: [\"prop1\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: \"SchemaName:ClassName\",\n key: \"SchemaName:ClassName|SchemaName:ClassName|prop1\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n\n });\n\n it(\"one BisCore:GeometricElement3dHasTypeDefinition nested property\", () => {\n\n const propertiesField = createTestPropertiesContentField({\n properties: [{ property: createTestPropertyInfo({ name: \"prop1\" }) }],\n });\n\n const nestedAspectField = createTestNestedContentField({\n nestedFields: [propertiesField],\n relationshipMeaning: RelationshipMeaning.RelatedInstance,\n pathToPrimaryClass: [\n createTestRelatedClassInfo({\n sourceClassInfo: createTestECClassInfo({ name: \"Schema:SomeType\" }),\n relationshipInfo: createTestECClassInfo({ name: \"BisCore:GeometricElement3dHasTypeDefinition\" }),\n targetClassInfo: createTestECClassInfo({ name: \"Schema:Class\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: true,\n }),\n ],\n });\n\n const result = convertPresentationFields([nestedAspectField]);\n\n const expectedResult: PropertyMetaData[] = [\n {\n actualECClassName: \"SchemaName:ClassName\",\n categoryLabel: \"Test Category\",\n displayLabel: \"Properties Field\",\n ecPropertyTraversal: [\"TypeDefinition\", \"prop1\"],\n key: \"SchemaName:ClassName|SchemaName:ClassName|TypeDefinition|prop1\",\n parentPropertyClassName: \"SchemaName:ClassName\",\n primitiveNavigationClass: \"\",\n propertyType: DataType.String,\n sourceClassName: \"*\",\n sourceSchema: \"*\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n\n });\n\n it(\"generate proper external source metadata\", () => {\n\n const propertyName = createTestPropertyInfo({ name: \"name\" });\n const propertyPath = createTestPropertyInfo({ name: \"path\" });\n const repositoryProperties = createTestPropertiesContentField({\n properties: [{ property: propertyName }, { property: propertyPath }],\n });\n\n const nestedExternalSource = createTestNestedContentField({\n nestedFields: [repositoryProperties],\n contentClassInfo: { name: \"BisCore:RepositoryLink\", id: \"\", label: \"\" },\n relationshipMeaning: RelationshipMeaning.SameInstance,\n pathToPrimaryClass: [\n createTestRelatedClassInfo({\n sourceClassInfo: createTestECClassInfo({ name: \"BisCore:ExternalSourceIsInRepository\" }),\n relationshipInfo: createTestECClassInfo({ name: \"BisCore:RepositoryLink\" }),\n targetClassInfo: createTestECClassInfo({ name: \"BisCore:ExternalSource\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: true,\n }),\n createTestRelatedClassInfo({\n sourceClassInfo: createTestECClassInfo({ name: \"BisCore:ElementIsFromSource\" }),\n relationshipInfo: createTestECClassInfo({ name: \"BisCore:ExternalSource\" }),\n targetClassInfo: createTestECClassInfo({ name: \"BisCore:ExternalSourceAspect\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: true,\n }),\n ],\n });\n\n const propertiesField = createTestPropertiesContentField({\n properties: [{ property: createTestPropertyInfo({ name: \"Identifier\" }) }],\n });\n\n const nestedSourceAspectField = createTestNestedContentField({\n nestedFields: [propertiesField, nestedExternalSource],\n relationshipMeaning: RelationshipMeaning.SameInstance,\n pathToPrimaryClass: [\n createTestRelatedClassInfo({\n sourceClassInfo: createTestECClassInfo({ name: \"BisCore:ExternalSourceAspect\" }),\n relationshipInfo: createTestECClassInfo({ name: \"BisCore:ElementOwnsMultiAspects\" }),\n targetClassInfo: createTestECClassInfo({ name: \"Schema:Class\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: true,\n }),\n ],\n });\n\n const result = convertPresentationFields([nestedSourceAspectField]);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"SchemaName\",\n sourceClassName: \"ClassName\",\n ecPropertyTraversal: [\"Identifier\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: \"SchemaName:ClassName\",\n key: \"SchemaName:ClassName|SchemaName:ClassName|Identifier\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"SchemaName\",\n sourceClassName: \"ClassName\",\n ecPropertyTraversal: [\"Source\", \"Repository\", \"name\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: \"BisCore:RepositoryLink\",\n key: \"BisCore:RepositoryLink|SchemaName:ClassName|Source|Repository|name\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"SchemaName\",\n sourceClassName: \"ClassName\",\n ecPropertyTraversal: [\"Source\", \"Repository\", \"path\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: \"BisCore:RepositoryLink\",\n key: \"BisCore:RepositoryLink|SchemaName:ClassName|Source|Repository|path\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n\n });\n\n it(\"handle simple structs correctly\", () => {\n const structPropertyClass = createTestPropertyInfo({ classInfo: { id: \"0\", label: \"\", name: \"Struct:Class\" } });\n\n const structContentFieldDescription: StructTypeDescription = {\n valueFormat: PropertyValueFormat.Struct,\n typeName: \"NestedContentFieldType\",\n members: [{\n name: \"prop1\",\n label: \"prop one\",\n type: {\n typeName: \"string\",\n valueFormat: PropertyValueFormat.Primitive,\n },\n }],\n };\n const simpleStructField = createTestPropertiesContentField({ properties: [{ property: structPropertyClass }], type: structContentFieldDescription });\n\n const result = convertPresentationFields([simpleStructField]);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"prop one\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"PropertyName\", \"prop1\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"Struct:Class\",\n parentPropertyClassName: undefined,\n key: \"undefined|Struct:Class|PropertyName|prop1\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n }\n );\n\n it(\"handle primitive navigation (Model)\", () => {\n const modelClassInfo = createTestECClassInfo({ name: \"BisCore:Element\", label: \"Element\" });\n const navigationClassInfo = createTestECClassInfo({ name: \"BisCore:ModelContainsElements\", label: \"ModelContainsElements\" });\n\n const navigationPropertyInfo: NavigationPropertyInfo = {\n classInfo: navigationClassInfo,\n isForwardRelationship: false,\n // Target class does not matter\n targetClassInfo: createTestECClassInfo(),\n isTargetPolymorphic: true,\n\n };\n\n const modelPropertyInfo = createTestPropertyInfo({ name: \"Model\", classInfo: modelClassInfo, type: \"long\", navigationPropertyInfo });\n\n const simpleModelField = createTestPropertiesContentField({ label: \"Model\", properties: [{ property: modelPropertyInfo }] });\n\n const result = convertPresentationFields([simpleModelField]);\n\n const expectedResult: PropertyMetaData[] = [\n {\n displayLabel: \"Model\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"Model\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"BisCore:ModelContainsElements\",\n actualECClassName: \"BisCore:Element\",\n parentPropertyClassName: undefined,\n key: \"undefined|BisCore:Element|Model\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n }\n );\n\n it(\"convert PropertyMetaData non primitive navigation into ECProperty\", () => {\n const propertyMetaData: PropertyMetaData = {\n displayLabel: \"A Property\",\n sourceSchema: \"Schema\",\n sourceClassName: \"Class\",\n ecPropertyTraversal: [\"PropertyName\", \"SecondProperty\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|PropertyName\",\n categoryLabel: \"Test Category\",\n };\n\n const result = convertToECProperties(propertyMetaData);\n\n const expectedResult: ECProperty[] = [\n {\n ecSchemaName: \"Schema\",\n ecClassName: \"Class\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"PropertyName.SecondProperty\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n });\n\n it(\"convert Model PropertyMetaData primitive navigation into ECProperty\", () => {\n const propertyMetaData: PropertyMetaData = {\n displayLabel: \"Model\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\n \"Model\",\n ],\n propertyType: DataType.String,\n primitiveNavigationClass: \"BisCore:ModelContainsElements\",\n actualECClassName: \"BisCore:Element\",\n key: \"undefined|BisCore:Element|Model\",\n categoryLabel: \"Selected Item\",\n parentPropertyClassName: undefined,\n };\n\n const result = convertToECProperties(propertyMetaData);\n\n const expectedResult: ECProperty[] = [\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Model.ModeledElement.UserLabel\",\n },\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Model.ModeledElement.CodeValue\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n });\n\n it(\"convert Category PropertyMetaData primitive navigation into ECProperty\", () => {\n const propertyMetaData: PropertyMetaData = {\n displayLabel: \"Category\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\n \"Category\",\n ],\n propertyType: DataType.String,\n primitiveNavigationClass: \"BisCore:GeometricElement3dIsInCategory\",\n actualECClassName: \"BisCore:GeometricElement3d\",\n key: \"undefined|BisCore:GeometricElement3d|Category\",\n categoryLabel: \"Selected Item\",\n parentPropertyClassName: undefined,\n };\n\n const result = convertToECProperties(propertyMetaData);\n\n const expectedResult: ECProperty[] = [\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Category.UserLabel\",\n },\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Category.CodeValue\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n });\n\n it(\"convert Physical Material PropertyMetaData primitive navigation into an ECProperty\", () => {\n const propertyMetaData: PropertyMetaData = {\n displayLabel: \"Physical Material\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\n \"PhysicalMaterial\",\n ],\n propertyType: DataType.String,\n primitiveNavigationClass: \"BisCore:PhysicalElementIsOfPhysicalMaterial\",\n actualECClassName: \"BisCore:PhysicalElement\",\n key: \"undefined|BisCore:PhysicalElement|PhysicalMaterial\",\n categoryLabel: \"Selected Item\",\n parentPropertyClassName: undefined,\n };\n\n const result = convertToECProperties(propertyMetaData);\n\n const expectedResult: ECProperty[] = [\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"PhysicalMaterial.UserLabel\",\n },\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"PhysicalMaterial.CodeValue\",\n },\n ];\n\n assert.deepEqual(result, expectedResult);\n });\n\n it(\"find properties correctly\", () => {\n\n const propertiesMetaData: PropertyMetaData[] = [\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propString\"],\n propertyType: DataType.String,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propString\",\n categoryLabel: \"Test Category\",\n },\n {\n displayLabel: \"Properties Field\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\"propInt\"],\n propertyType: DataType.Integer,\n primitiveNavigationClass: \"\",\n actualECClassName: \"SchemaName:ClassName\",\n parentPropertyClassName: undefined,\n key: \"undefined|SchemaName:ClassName|propInt\",\n categoryLabel: \"Test Category\",\n },\n ];\n\n const ecProperties: ECProperty[] = [\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"propString\",\n },\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.Integer,\n ecPropertyName: \"propInt\",\n },\n ];\n\n const result = findProperties(ecProperties, propertiesMetaData);\n\n assert.deepEqual(result, propertiesMetaData);\n\n });\n\n it(\"can find properties generated from a single property\", () => {\n\n const propertiesMetaData: PropertyMetaData[] = [{\n displayLabel: \"Model\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\n \"Model\",\n ],\n propertyType: DataType.String,\n primitiveNavigationClass: \"BisCore:ModelContainsElements\",\n actualECClassName: \"BisCore:Element\",\n key: \"undefined|BisCore:Element|Model\",\n categoryLabel: \"Selected Item\",\n parentPropertyClassName: undefined,\n }];\n\n const ecProperties: ECProperty[] = [\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Model.ModeledElement.UserLabel\",\n },\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Model.ModeledElement.CodeValue\",\n },\n ];\n\n const result = findProperties(ecProperties, propertiesMetaData);\n assert.deepEqual(result, propertiesMetaData);\n\n });\n\n it(\"cannot find properties generated from a single property in the wrong order\", () => {\n\n const propertiesMetaData: PropertyMetaData[] = [{\n displayLabel: \"Model\",\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: [\n \"Model\",\n ],\n propertyType: DataType.String,\n primitiveNavigationClass: \"BisCore:ModelContainsElements\",\n actualECClassName: \"BisCore:Element\",\n key: \"undefined|BisCore:Element|Model\",\n categoryLabel: \"Selected Item\",\n parentPropertyClassName: undefined,\n }];\n\n const ecProperties: ECProperty[] = [\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Model.ModeledElement.CodeValue\",\n },\n {\n ecSchemaName: \"*\",\n ecClassName: \"*\",\n ecPropertyType: DataType.String,\n ecPropertyName: \"Model.ModeledElement.UserLabel\",\n },\n ];\n\n const result = findProperties(ecProperties, propertiesMetaData);\n expect(result).to.be.of.length(0);\n });\n\n});\n"]}
@@ -0,0 +1,9 @@
1
+ import * as sinon from "sinon";
2
+ export declare type StubbedType<T> = sinon.SinonStubbedInstance<T> & T;
3
+ export declare class MockFactory {
4
+ static create<T>(constructor: sinon.StubbableType<T> & {
5
+ prototype: T;
6
+ }): StubbedType<T>;
7
+ static stubProperty(obj: any, property: string, replacement: () => any): void;
8
+ }
9
+ //# sourceMappingURL=MockFactory.d.ts.map
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.MockFactory = void 0;
23
+ /*---------------------------------------------------------------------------------------------
24
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
+ * See LICENSE.md in the project root for license terms and full copyright notice.
26
+ *--------------------------------------------------------------------------------------------*/
27
+ const sinon = __importStar(require("sinon"));
28
+ class MockFactory {
29
+ static create(constructor) {
30
+ return sinon.createStubInstance(constructor);
31
+ }
32
+ static stubProperty(obj, property, replacement) {
33
+ if (property in obj) {
34
+ delete obj[property];
35
+ }
36
+ const stubGetterDescriptor = { get: () => undefined, configurable: true };
37
+ Object.defineProperty(obj, property, stubGetterDescriptor);
38
+ sinon.replaceGetter(obj, property, replacement);
39
+ }
40
+ }
41
+ exports.MockFactory = MockFactory;
42
+ //# sourceMappingURL=MockFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockFactory.js","sourceRoot":"","sources":["../../../src/test/MockFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAI/B,MAAa,WAAW;IACf,MAAM,CAAC,MAAM,CAAI,WAAsD;QAC5E,OAAO,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAmB,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,GAAQ,EAAE,QAAgB,EAAE,WAAsB;QAC3E,IAAI,QAAQ,IAAI,GAAG,EAAE;YACnB,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;SACtB;QAED,MAAM,oBAAoB,GAAuB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;QAC9F,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QAE3D,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IAClD,CAAC;CACF;AAfD,kCAeC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as sinon from \"sinon\";\n\nexport type StubbedType<T> = sinon.SinonStubbedInstance<T> & T;\n\nexport class MockFactory {\n public static create<T>(constructor: sinon.StubbableType<T> & { prototype: T }): StubbedType<T> {\n return sinon.createStubInstance(constructor) as StubbedType<T>;\n }\n\n public static stubProperty(obj: any, property: string, replacement: () => any): void {\n if (property in obj) {\n delete obj[property];\n }\n\n const stubGetterDescriptor: PropertyDescriptor = { get: () => undefined, configurable: true };\n Object.defineProperty(obj, property, stubGetterDescriptor);\n\n sinon.replaceGetter(obj, property, replacement);\n }\n}\n"]}
@@ -0,0 +1,86 @@
1
+ import { Field, NestedContentField, PropertiesField } from "@itwin/presentation-common";
2
+ import type { CategoryDescription, ClassInfo, EditorDescription, Property, PropertyInfo, RelatedClassInfo, RelationshipMeaning, RelationshipPath, RendererDescription, TypeDescription } from "@itwin/presentation-common";
3
+ export declare const createTestPropertyInfo: (props?: Partial<PropertyInfo> | undefined) => {
4
+ classInfo: ClassInfo | {
5
+ id: string;
6
+ name: string;
7
+ label: string;
8
+ };
9
+ name: string;
10
+ type: string;
11
+ enumerationInfo?: import("@itwin/presentation-common").EnumerationInfo | undefined;
12
+ kindOfQuantity?: import("@itwin/presentation-common").KindOfQuantityInfo | undefined;
13
+ extendedType?: string | undefined;
14
+ navigationPropertyInfo?: import("@itwin/presentation-common").NavigationPropertyInfo | undefined;
15
+ };
16
+ export declare const createTestCategoryDescription: (props?: Partial<CategoryDescription> | undefined) => {
17
+ name: string;
18
+ label: string;
19
+ description: string;
20
+ priority: number;
21
+ expand: boolean;
22
+ parent?: CategoryDescription | undefined;
23
+ renderer?: RendererDescription | undefined;
24
+ };
25
+ export declare const createTestECClassInfo: (props?: Partial<ClassInfo> | undefined) => {
26
+ id: string;
27
+ name: string;
28
+ label: string;
29
+ };
30
+ export declare const createTestRelationshipPath: (length?: number) => RelatedClassInfo[];
31
+ export declare const createTestRelatedClassInfo: (props?: Partial<RelatedClassInfo> | undefined) => {
32
+ sourceClassInfo: ClassInfo | {
33
+ id: string;
34
+ name: string;
35
+ label: string;
36
+ };
37
+ targetClassInfo: ClassInfo | {
38
+ id: string;
39
+ name: string;
40
+ label: string;
41
+ };
42
+ isPolymorphicTargetClass: boolean;
43
+ relationshipInfo: ClassInfo | {
44
+ id: string;
45
+ name: string;
46
+ label: string;
47
+ };
48
+ isForwardRelationship: boolean;
49
+ isPolymorphicRelationship: boolean;
50
+ };
51
+ export declare const createTestSimpleContentField: (props?: {
52
+ category?: CategoryDescription | undefined;
53
+ type?: TypeDescription | undefined;
54
+ name?: string | undefined;
55
+ label?: string | undefined;
56
+ isReadonly?: boolean | undefined;
57
+ priority?: number | undefined;
58
+ editor?: EditorDescription | undefined;
59
+ renderer?: RendererDescription | undefined;
60
+ } | undefined) => Field;
61
+ export declare const createTestPropertiesContentField: (props: {
62
+ properties: Property[];
63
+ category?: CategoryDescription;
64
+ type?: TypeDescription;
65
+ name?: string;
66
+ label?: string;
67
+ isReadonly?: boolean;
68
+ priority?: number;
69
+ editor?: EditorDescription;
70
+ renderer?: RendererDescription;
71
+ }) => PropertiesField;
72
+ export declare const createTestNestedContentField: (props: {
73
+ nestedFields: Field[];
74
+ category?: CategoryDescription;
75
+ name?: string;
76
+ label?: string;
77
+ isReadonly?: boolean;
78
+ priority?: number;
79
+ contentClassInfo?: ClassInfo;
80
+ pathToPrimaryClass?: RelationshipPath;
81
+ autoExpand?: boolean;
82
+ editor?: EditorDescription;
83
+ renderer?: RendererDescription;
84
+ relationshipMeaning?: RelationshipMeaning;
85
+ }) => NestedContentField;
86
+ //# sourceMappingURL=PropertyFieldsHelpers.d.ts.map
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTestNestedContentField = exports.createTestPropertiesContentField = exports.createTestSimpleContentField = exports.createTestRelatedClassInfo = exports.createTestRelationshipPath = exports.createTestECClassInfo = exports.createTestCategoryDescription = exports.createTestPropertyInfo = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const presentation_common_1 = require("@itwin/presentation-common");
9
+ const createTestPropertyInfo = (props) => ({
10
+ classInfo: exports.createTestECClassInfo(),
11
+ name: "PropertyName",
12
+ type: "string",
13
+ ...props,
14
+ });
15
+ exports.createTestPropertyInfo = createTestPropertyInfo;
16
+ const createTestCategoryDescription = (props) => ({
17
+ name: "test-category",
18
+ label: "Test Category",
19
+ description: "Test category description",
20
+ priority: 0,
21
+ expand: false,
22
+ ...props,
23
+ });
24
+ exports.createTestCategoryDescription = createTestCategoryDescription;
25
+ const createTestECClassInfo = (props) => ({
26
+ id: "0x1",
27
+ name: "SchemaName:ClassName",
28
+ label: "Class Label",
29
+ ...props,
30
+ });
31
+ exports.createTestECClassInfo = createTestECClassInfo;
32
+ const createTestRelationshipPath = (length = 2) => {
33
+ const path = new Array();
34
+ while (length--)
35
+ path.push(exports.createTestRelatedClassInfo());
36
+ return path;
37
+ };
38
+ exports.createTestRelationshipPath = createTestRelationshipPath;
39
+ const createTestRelatedClassInfo = (props) => ({
40
+ sourceClassInfo: exports.createTestECClassInfo({ id: "0x1", name: "source:class", label: "Source" }),
41
+ targetClassInfo: exports.createTestECClassInfo({ id: "0x2", name: "target:class", label: "Target" }),
42
+ isPolymorphicTargetClass: false,
43
+ relationshipInfo: exports.createTestECClassInfo({ id: "0x3", name: "relationship:class", label: "Relationship" }),
44
+ isForwardRelationship: false,
45
+ isPolymorphicRelationship: false,
46
+ ...props,
47
+ });
48
+ exports.createTestRelatedClassInfo = createTestRelatedClassInfo;
49
+ const createTestSimpleContentField = (props) => {
50
+ var _a, _b, _c, _d, _e, _f;
51
+ return new presentation_common_1.Field((_a = props === null || props === void 0 ? void 0 : props.category) !== null && _a !== void 0 ? _a : exports.createTestCategoryDescription(), (_b = props === null || props === void 0 ? void 0 : props.name) !== null && _b !== void 0 ? _b : "SimpleField", (_c = props === null || props === void 0 ? void 0 : props.label) !== null && _c !== void 0 ? _c : "Simple Field", (_d = props === null || props === void 0 ? void 0 : props.type) !== null && _d !== void 0 ? _d : {
52
+ valueFormat: presentation_common_1.PropertyValueFormat.Primitive,
53
+ typeName: "string",
54
+ }, (_e = props === null || props === void 0 ? void 0 : props.isReadonly) !== null && _e !== void 0 ? _e : false, (_f = props === null || props === void 0 ? void 0 : props.priority) !== null && _f !== void 0 ? _f : 0, props === null || props === void 0 ? void 0 : props.editor, props === null || props === void 0 ? void 0 : props.renderer);
55
+ };
56
+ exports.createTestSimpleContentField = createTestSimpleContentField;
57
+ const createTestPropertiesContentField = (props) => {
58
+ var _a, _b, _c, _d, _e, _f;
59
+ return new presentation_common_1.PropertiesField((_a = props.category) !== null && _a !== void 0 ? _a : exports.createTestCategoryDescription(), (_b = props.name) !== null && _b !== void 0 ? _b : "PropertiesField", (_c = props.label) !== null && _c !== void 0 ? _c : "Properties Field", (_d = props.type) !== null && _d !== void 0 ? _d : { valueFormat: presentation_common_1.PropertyValueFormat.Primitive, typeName: "string" }, (_e = props.isReadonly) !== null && _e !== void 0 ? _e : false, (_f = props.priority) !== null && _f !== void 0 ? _f : 0, props.properties, props.editor, props.renderer);
60
+ };
61
+ exports.createTestPropertiesContentField = createTestPropertiesContentField;
62
+ const createTestNestedContentField = (props) => {
63
+ var _a, _b, _c, _d, _e, _f, _g;
64
+ const nestedContentFieldType = {
65
+ valueFormat: presentation_common_1.PropertyValueFormat.Struct,
66
+ typeName: "NestedContentFieldType",
67
+ members: props.nestedFields.map((f) => ({
68
+ name: f.name,
69
+ label: f.label,
70
+ type: f.type,
71
+ })),
72
+ };
73
+ const field = new presentation_common_1.NestedContentField((_a = props.category) !== null && _a !== void 0 ? _a : exports.createTestCategoryDescription(), (_b = props.name) !== null && _b !== void 0 ? _b : "NestedContentField", (_c = props.label) !== null && _c !== void 0 ? _c : "Nested Content", nestedContentFieldType, (_d = props.isReadonly) !== null && _d !== void 0 ? _d : false, (_e = props.priority) !== null && _e !== void 0 ? _e : 0, (_f = props.contentClassInfo) !== null && _f !== void 0 ? _f : exports.createTestECClassInfo(), (_g = props.pathToPrimaryClass) !== null && _g !== void 0 ? _g : exports.createTestRelationshipPath(1), props.nestedFields, props.editor, !!props.autoExpand, props.renderer);
74
+ if (props.relationshipMeaning)
75
+ field.relationshipMeaning = props.relationshipMeaning;
76
+ field.rebuildParentship();
77
+ return field;
78
+ };
79
+ exports.createTestNestedContentField = createTestNestedContentField;
80
+ //# sourceMappingURL=PropertyFieldsHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyFieldsHelpers.js","sourceRoot":"","sources":["../../../src/test/PropertyFieldsHelpers.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,oEAA6G;AAGtG,MAAM,sBAAsB,GAAG,CAAC,KAA6B,EAAE,EAAE,CAAC,CAAC;IACxE,SAAS,EAAE,6BAAqB,EAAE;IAClC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,QAAQ;IACd,GAAG,KAAK;CACT,CAAC,CAAC;AALU,QAAA,sBAAsB,0BAKhC;AAEI,MAAM,6BAA6B,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,CAAC;IACtF,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,2BAA2B;IACxC,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,KAAK;IACb,GAAG,KAAK;CACT,CAAC,CAAC;AAPU,QAAA,6BAA6B,iCAOvC;AAEI,MAAM,qBAAqB,GAAG,CAAC,KAA0B,EAAE,EAAE,CAAC,CAAC;IACpE,EAAE,EAAE,KAAK;IACT,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,aAAa;IACpB,GAAG,KAAK;CACT,CAAC,CAAC;AALU,QAAA,qBAAqB,yBAK/B;AAEI,MAAM,0BAA0B,GAAG,CAAC,SAAiB,CAAC,EAAE,EAAE;IAC/D,MAAM,IAAI,GAAG,IAAI,KAAK,EAAoB,CAAC;IAC3C,OAAO,MAAM,EAAE;QACb,IAAI,CAAC,IAAI,CAAC,kCAA0B,EAAE,CAAC,CAAC;IAC1C,OAAO,IAAI,C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EACtB,MAAA,KAAK,CAAC,UAAU,mCAAI,KAAK,EACzB,MAAA,KAAK,CAAC,QAAQ,mCAAI,CAAC,EACnB,MAAA,KAAK,CAAC,gBAAgB,mCAAI,6BAAqB,EAAE,EACjD,MAAA,KAAK,CAAC,kBAAkB,mCAAI,kCAA0B,CAAC,CAAC,CAAC,EACzD,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,MAAM,EACZ,CAAC,CAAC,KAAK,CAAC,UAAU,EAClB,KAAK,CAAC,QAAQ,CACf,CAAC;IACF,IAAI,KAAK,CAAC,mBAAmB;QAC3B,KAAK,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;IACxD,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC1B,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAzCW,QAAA,4BAA4B,gCAyCvC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Field, NestedContentField, PropertiesField, PropertyValueFormat } from \"@itwin/presentation-common\";\nimport type { CategoryDescription, ClassInfo, EditorDescription, Property, PropertyInfo, RelatedClassInfo, RelationshipMeaning, RelationshipPath, RendererDescription, StructTypeDescription, TypeDescription } from \"@itwin/presentation-common\";\n\nexport const createTestPropertyInfo = (props?: Partial<PropertyInfo>) => ({\n classInfo: createTestECClassInfo(),\n name: \"PropertyName\",\n type: \"string\",\n ...props,\n});\n\nexport const createTestCategoryDescription = (props?: Partial<CategoryDescription>) => ({\n name: \"test-category\",\n label: \"Test Category\",\n description: \"Test category description\",\n priority: 0,\n expand: false,\n ...props,\n});\n\nexport const createTestECClassInfo = (props?: Partial<ClassInfo>) => ({\n id: \"0x1\",\n name: \"SchemaName:ClassName\",\n label: \"Class Label\",\n ...props,\n});\n\nexport const createTestRelationshipPath = (length: number = 2) => {\n const path = new Array<RelatedClassInfo>();\n while (length--)\n path.push(createTestRelatedClassInfo());\n return path;\n};\n\nexport const createTestRelatedClassInfo = (props?: Partial<RelatedClassInfo>) => ({\n sourceClassInfo: createTestECClassInfo({ id: \"0x1\", name: \"source:class\", label: \"Source\" }),\n targetClassInfo: createTestECClassInfo({ id: \"0x2\", name: \"target:class\", label: \"Target\" }),\n isPolymorphicTargetClass: false,\n relationshipInfo: createTestECClassInfo({ id: \"0x3\", name: \"relationship:class\", label: \"Relationship\" }),\n isForwardRelationship: false,\n isPolymorphicRelationship: false,\n ...props,\n});\n\nexport const createTestSimpleContentField = (props?: {\n category?: CategoryDescription;\n type?: TypeDescription;\n name?: string;\n label?: string;\n isReadonly?: boolean;\n priority?: number;\n editor?: EditorDescription;\n renderer?: RendererDescription;\n}) => {\n return new Field(\n props?.category ?? createTestCategoryDescription(),\n props?.name ?? \"SimpleField\",\n props?.label ?? \"Simple Field\",\n props?.type ?? {\n valueFormat: PropertyValueFormat.Primitive,\n typeName: \"string\",\n },\n props?.isReadonly ?? false,\n props?.priority ?? 0,\n props?.editor,\n props?.renderer\n );\n};\n\nexport const createTestPropertiesContentField = (props: {\n properties: Property[];\n category?: CategoryDescription;\n type?: TypeDescription;\n name?: string;\n label?: string;\n isReadonly?: boolean;\n priority?: number;\n editor?: EditorDescription;\n renderer?: RendererDescription;\n}) => {\n return new PropertiesField(\n props.category ?? createTestCategoryDescription(),\n props.name ?? \"PropertiesField\",\n props.label ?? \"Properties Field\",\n props.type ?? { valueFormat: PropertyValueFormat.Primitive, typeName: \"string\" },\n props.isReadonly ?? false,\n props.priority ?? 0,\n props.properties,\n props.editor,\n props.renderer\n );\n};\n\nexport const createTestNestedContentField = (props: {\n nestedFields: Field[];\n category?: CategoryDescription;\n name?: string;\n label?: string;\n isReadonly?: boolean;\n priority?: number;\n contentClassInfo?: ClassInfo;\n pathToPrimaryClass?: RelationshipPath;\n autoExpand?: boolean;\n editor?: EditorDescription;\n renderer?: RendererDescription;\n relationshipMeaning?: RelationshipMeaning;\n}) => {\n const nestedContentFieldType: StructTypeDescription = {\n valueFormat: PropertyValueFormat.Struct,\n typeName: \"NestedContentFieldType\",\n members: props.nestedFields.map((f) => ({\n name: f.name,\n label: f.label,\n type: f.type,\n })),\n };\n const field = new NestedContentField(\n props.category ?? createTestCategoryDescription(),\n props.name ?? \"NestedContentField\",\n props.label ?? \"Nested Content\",\n nestedContentFieldType,\n props.isReadonly ?? false,\n props.priority ?? 0,\n props.contentClassInfo ?? createTestECClassInfo(),\n props.pathToPrimaryClass ?? createTestRelationshipPath(1),\n props.nestedFields,\n props.editor,\n !!props.autoExpand,\n props.renderer,\n );\n if (props.relationshipMeaning)\n field.relationshipMeaning = props.relationshipMeaning;\n field.rebuildParentship();\n return field;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=QueryBuilder.test.d.ts.map
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /*---------------------------------------------------------------------------------------------
4
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
5
+ * See LICENSE.md in the project root for license terms and full copyright notice.
6
+ *--------------------------------------------------------------------------------------------*/
7
+ const appui_abstract_1 = require("@itwin/appui-abstract");
8
+ const presentation_common_1 = require("@itwin/presentation-common");
9
+ const presentation_components_1 = require("@itwin/presentation-components");
10
+ const chai_1 = require("chai");
11
+ const QueryBuilder_1 = require("../widget/components/QueryBuilder");
12
+ const MockFactory_1 = require("./MockFactory");
13
+ const QueryBuilder_testdata_1 = require("./QueryBuilder.testdata");
14
+ describe("QueryBuilder", () => {
15
+ let sut;
16
+ let dataProvider;
17
+ beforeEach(() => {
18
+ dataProvider = MockFactory_1.MockFactory.create(presentation_components_1.PresentationPropertyDataProvider);
19
+ MockFactory_1.MockFactory.stubProperty(dataProvider, "getContentDescriptor", () => () => true);
20
+ sut = new QueryBuilder_1.QueryBuilder(dataProvider);
21
+ });
22
+ afterEach(() => {
23
+ dataProvider.getFieldByPropertyRecord.restore();
24
+ });
25
+ const testData = QueryBuilder_testdata_1.testCases;
26
+ testData.testCases.forEach((testCase) => {
27
+ it(testCase.name, async () => executeTest(sut, testCase.expectedResult, testCase.operations));
28
+ });
29
+ const createPropertyRecord = (propertyRecord, propertiesField) => {
30
+ const propertiesFieldMock = MockFactory_1.MockFactory.create(presentation_common_1.PropertiesField);
31
+ MockFactory_1.MockFactory.stubProperty(propertiesFieldMock, "parent", () => propertiesField.parent);
32
+ MockFactory_1.MockFactory.stubProperty(propertiesFieldMock, "properties", () => propertiesField.properties);
33
+ MockFactory_1.MockFactory.stubProperty(propertiesFieldMock, "type", () => propertiesField.type);
34
+ const prop = new appui_abstract_1.PropertyRecord(propertyRecord.value, propertyRecord.property);
35
+ dataProvider.getFieldByPropertyRecord.withArgs(prop).resolves(propertiesFieldMock);
36
+ return prop;
37
+ };
38
+ const executeTest = async (queryBuilder, expectedResult, operations) => {
39
+ for (const op of operations) {
40
+ const prop = createPropertyRecord(op.propertyRecord, op.propertiesField);
41
+ if (op.operationType === "addProperty") {
42
+ const result = await queryBuilder.addProperty(prop);
43
+ chai_1.assert.strictEqual(result, op.expectedResult);
44
+ }
45
+ if (op.operationType === "removeProperty") {
46
+ await queryBuilder.removeProperty(prop);
47
+ }
48
+ }
49
+ const result = queryBuilder.buildQueryString();
50
+ chai_1.assert.strictEqual(result, expectedResult);
51
+ };
52
+ });
53
+ //# sourceMappingURL=QueryBuilder.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilder.test.js","sourceRoot":"","sources":["../../../src/test/QueryBuilder.test.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,0DAAuD;AACvD,oEAA6D;AAC7D,4EAAkF;AAClF,+BAA8B;AAC9B,oEAAiE;AACjE,+CAA4C;AAG5C,mEAAoD;AAEpD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,GAAiB,CAAC;IACtB,IAAI,YAA2D,CAAC;IAEhE,UAAU,CAA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C,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACnF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,EAAE,YAA0B,EAAE,cAAsB,EAAE,UAA+B,EAAE,EAAE;QAChH,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE;YAC3B,MAAM,IAAI,GAAG,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,eAAkC,CAAC,CAAC;YAE5F,IAAI,EAAE,CAAC,aAAa,KAAK,aAAa,EAAE;gBACtC,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACpD,aAAM,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC;aAC/C;YACD,IAAI,EAAE,CAAC,aAAa,KAAK,gBAAgB,EAAE;gBACzC,MAAM,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;aACzC;SACF;QAED,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,EAAE,CAAC;QAC/C,aAAM,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertiesField } from \"@itwin/presentation-common\";\nimport { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport { assert } from \"chai\";\nimport { QueryBuilder } from \"../widget/components/QueryBuilder\";\nimport { MockFactory } from \"./MockFactory\";\nimport type { StubbedType } from \"./MockFactory\";\nimport type { OperationTestData, PropertyRecordTestData, QueryBuilderTestData } from \"./QueryBuilderTestData\";\nimport { testCases } from \"./QueryBuilder.testdata\";\n\ndescribe(\"QueryBuilder\", () => {\n let sut: QueryBuilder;\n let dataProvider: StubbedType<PresentationPropertyDataProvider>;\n\n beforeEach(() => {\n dataProvider = MockFactory.create(PresentationPropertyDataProvider);\n MockFactory.stubProperty(dataProvider, \"getContentDescriptor\", () => () => true);\n\n sut = new QueryBuilder(dataProvider);\n });\n\n afterEach(() => {\n dataProvider.getFieldByPropertyRecord.restore();\n });\n\n const testData: QueryBuilderTestData = testCases;\n testData.testCases.forEach((testCase) => {\n it(testCase.name, async () => executeTest(\n sut,\n testCase.expectedResult,\n testCase.operations,\n ));\n });\n\n const createPropertyRecord = (propertyRecord: PropertyRecordTestData, propertiesField: PropertiesField) => {\n const propertiesFieldMock: StubbedType<PropertiesField> = MockFactory.create(PropertiesField);\n\n MockFactory.stubProperty(propertiesFieldMock, \"parent\", () => propertiesField.parent);\n MockFactory.stubProperty(propertiesFieldMock, \"properties\", () => propertiesField.properties);\n MockFactory.stubProperty(propertiesFieldMock, \"type\", () => propertiesField.type);\n\n const prop: PropertyRecord = new PropertyRecord(propertyRecord.value, propertyRecord.property);\n dataProvider.getFieldByPropertyRecord.withArgs(prop).resolves(propertiesFieldMock);\n return prop;\n };\n\n const executeTest = async (queryBuilder: QueryBuilder, expectedResult: string, operations: OperationTestData[]) => {\n for (const op of operations) {\n const prop = createPropertyRecord(op.propertyRecord, op.propertiesField as PropertiesField);\n\n if (op.operationType === \"addProperty\") {\n const result = await queryBuilder.addProperty(prop);\n assert.strictEqual(result, op.expectedResult);\n }\n if (op.operationType === \"removeProperty\") {\n await queryBuilder.removeProperty(prop);\n }\n }\n\n const result = queryBuilder.buildQueryString();\n assert.strictEqual(result, expectedResult);\n };\n});\n"]}
@@ -0,0 +1,3 @@
1
+ import type { QueryBuilderTestData } from "./QueryBuilderTestData";
2
+ export declare const testCases: QueryBuilderTestData;
3
+ //# sourceMappingURL=QueryBuilder.testdata.d.ts.map