@itwin/grouping-mapping-widget 0.17.5 → 0.18.1

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 (196) hide show
  1. package/lib/cjs/formula/FormulaDataTypeResolver.js +4 -4
  2. package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
  3. package/lib/cjs/formula/FormulaFunctionProvider.js +4 -4
  4. package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
  5. package/lib/cjs/formula/FormulaSplitter.js +12 -12
  6. package/lib/cjs/formula/FormulaSplitter.js.map +1 -1
  7. package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +6 -6
  8. package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
  9. package/lib/cjs/formula/InfixToPostfixConverter.js +11 -11
  10. package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -1
  11. package/lib/cjs/grouping-mapping-widget.d.ts +3 -1
  12. package/lib/cjs/grouping-mapping-widget.js +7 -3
  13. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  14. package/lib/cjs/test/GroupPropertyUtils.test.js +74 -74
  15. package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -1
  16. package/lib/cjs/test/GroupingMappingCustomUI.test.js +9 -9
  17. package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
  18. package/lib/cjs/test/PropertyFieldsHelpers.js +8 -8
  19. package/lib/cjs/test/PropertyFieldsHelpers.js.map +1 -1
  20. package/lib/cjs/test/WidgetHeader.test.js +2 -2
  21. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  22. package/lib/cjs/test/test-utils.js +1 -1
  23. package/lib/cjs/test/test-utils.js.map +1 -1
  24. package/lib/cjs/widget/components/BlockingOverlay.js +1 -1
  25. package/lib/cjs/widget/components/BlockingOverlay.js.map +1 -1
  26. package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -7
  27. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  28. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +21 -21
  29. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -1
  30. package/lib/cjs/widget/components/CalculatedPropertyTable.js +4 -4
  31. package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
  32. package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +1 -1
  33. package/lib/cjs/widget/components/ConfirmMappingsImport.js +8 -8
  34. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  35. package/lib/cjs/widget/components/CustomCalculationAction.js +17 -17
  36. package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
  37. package/lib/cjs/widget/components/CustomCalculationTable.js +4 -4
  38. package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
  39. package/lib/cjs/widget/components/DeleteModal.js +2 -2
  40. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  41. package/lib/cjs/widget/components/GroupAction.js +16 -16
  42. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  43. package/lib/cjs/widget/components/GroupColorLegend.js +1 -1
  44. package/lib/cjs/widget/components/GroupColorLegend.js.map +1 -1
  45. package/lib/cjs/widget/components/GroupColorToggle.js +9 -9
  46. package/lib/cjs/widget/components/GroupColorToggle.js.map +1 -1
  47. package/lib/cjs/widget/components/GroupDetails.js +3 -3
  48. package/lib/cjs/widget/components/GroupDetails.js.map +1 -1
  49. package/lib/cjs/widget/components/GroupMenuActions.js +2 -2
  50. package/lib/cjs/widget/components/GroupMenuActions.js.map +1 -1
  51. package/lib/cjs/widget/components/GroupPropertyAction.js +35 -35
  52. package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
  53. package/lib/cjs/widget/components/GroupPropertyTable.js +4 -4
  54. package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
  55. package/lib/cjs/widget/components/GroupPropertyUtils.js +2 -2
  56. package/lib/cjs/widget/components/GroupPropertyUtils.js.map +1 -1
  57. package/lib/cjs/widget/components/Grouping.d.ts +2 -1
  58. package/lib/cjs/widget/components/Grouping.js +16 -13
  59. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  60. package/lib/cjs/widget/components/Grouping.scss +8 -0
  61. package/lib/cjs/widget/components/GroupingMapping.js +5 -5
  62. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  63. package/lib/cjs/widget/components/GroupingMappingContent.js +4 -4
  64. package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
  65. package/lib/cjs/widget/components/GroupingMappingContext.js +24 -21
  66. package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
  67. package/lib/cjs/widget/components/GroupingMappingRouter.js +3 -3
  68. package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
  69. package/lib/cjs/widget/components/GroupsShowHideButtons.js +3 -3
  70. package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +1 -1
  71. package/lib/cjs/widget/components/GroupsVisualization.js +38 -28
  72. package/lib/cjs/widget/components/GroupsVisualization.js.map +1 -1
  73. package/lib/cjs/widget/components/GroupsVisualizationActions.js +1 -1
  74. package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +1 -1
  75. package/lib/cjs/widget/components/HorizontalTile.js +1 -1
  76. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
  77. package/lib/cjs/widget/components/MappingAction.js +9 -9
  78. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  79. package/lib/cjs/widget/components/MappingImportWizardModal.d.ts +2 -2
  80. package/lib/cjs/widget/components/MappingImportWizardModal.js +13 -13
  81. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  82. package/lib/cjs/widget/components/MappingViewActionGroup.d.ts +12 -0
  83. package/lib/cjs/widget/components/MappingViewActionGroup.js +34 -0
  84. package/lib/cjs/widget/components/MappingViewActionGroup.js.map +1 -0
  85. package/lib/cjs/widget/components/Mappings.d.ts +13 -0
  86. package/lib/cjs/widget/components/Mappings.js +45 -0
  87. package/lib/cjs/widget/components/Mappings.js.map +1 -0
  88. package/lib/cjs/widget/components/MappingsView.d.ts +33 -0
  89. package/lib/cjs/widget/components/MappingsView.js +54 -0
  90. package/lib/cjs/widget/components/MappingsView.js.map +1 -0
  91. package/lib/{esm/widget/components/Mapping.scss → cjs/widget/components/MappingsView.scss} +6 -2
  92. package/lib/cjs/widget/components/PropertyAction.js +7 -7
  93. package/lib/cjs/widget/components/PropertyAction.js.map +1 -1
  94. package/lib/cjs/widget/components/PropertyMenu.js +9 -9
  95. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  96. package/lib/cjs/widget/components/PropertyMenuWithVisualization.js +1 -1
  97. package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +1 -1
  98. package/lib/cjs/widget/components/PropertyTable.js +4 -4
  99. package/lib/cjs/widget/components/PropertyTable.js.map +1 -1
  100. package/lib/cjs/widget/components/SelectIModel.js +9 -9
  101. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  102. package/lib/cjs/widget/components/SelectITwin.js +10 -10
  103. package/lib/cjs/widget/components/SelectITwin.js.map +1 -1
  104. package/lib/cjs/widget/components/SelectMappings.d.ts +1 -1
  105. package/lib/cjs/widget/components/SelectMappings.js +10 -10
  106. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  107. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js +1 -1
  108. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +1 -1
  109. package/lib/cjs/widget/components/SortableHorizontalTile.js +2 -2
  110. package/lib/cjs/widget/components/SortableHorizontalTile.js.map +1 -1
  111. package/lib/cjs/widget/components/StatusIcon.js +1 -1
  112. package/lib/cjs/widget/components/StatusIcon.js.map +1 -1
  113. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +2 -0
  114. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +2 -0
  115. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  116. package/lib/cjs/widget/components/context/GroupingApiConfigContext.js +1 -1
  117. package/lib/cjs/widget/components/context/GroupingApiConfigContext.js.map +1 -1
  118. package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js +2 -2
  119. package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js.map +1 -1
  120. package/lib/cjs/widget/components/context/IModelsClientContext.js +2 -2
  121. package/lib/cjs/widget/components/context/IModelsClientContext.js.map +1 -1
  122. package/lib/cjs/widget/components/context/ITwinsClientContext.js +2 -2
  123. package/lib/cjs/widget/components/context/ITwinsClientContext.js.map +1 -1
  124. package/lib/cjs/widget/components/context/MappingClientContext.js +3 -3
  125. package/lib/cjs/widget/components/context/MappingClientContext.js.map +1 -1
  126. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +10 -10
  127. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  128. package/lib/cjs/widget/components/groupsHelpers.d.ts +1 -1
  129. package/lib/cjs/widget/components/groupsHelpers.js +14 -13
  130. package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
  131. package/lib/cjs/widget/components/hooks/useMappingsOperations.d.ts +21 -0
  132. package/lib/cjs/widget/components/hooks/useMappingsOperations.js +62 -0
  133. package/lib/cjs/widget/components/hooks/useMappingsOperations.js.map +1 -0
  134. package/lib/cjs/widget/components/utils.d.ts +1 -0
  135. package/lib/cjs/widget/components/utils.js +19 -23
  136. package/lib/cjs/widget/components/utils.js.map +1 -1
  137. package/lib/cjs/widget/components/viewerUtils.js +12 -12
  138. package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
  139. package/lib/cjs/widget/hooks/useFetchData.js +6 -6
  140. package/lib/cjs/widget/hooks/useFetchData.js.map +1 -1
  141. package/lib/cjs/widget/hooks/useFormulaValidation.js +4 -4
  142. package/lib/cjs/widget/hooks/useFormulaValidation.js.map +1 -1
  143. package/lib/cjs/widget/hooks/useValidator.js +1 -1
  144. package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
  145. package/lib/cjs/widget/hooks/useVisualization.js +15 -15
  146. package/lib/cjs/widget/hooks/useVisualization.js.map +1 -1
  147. package/lib/esm/grouping-mapping-widget.d.ts +3 -1
  148. package/lib/esm/grouping-mapping-widget.js +3 -1
  149. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  150. package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +1 -1
  151. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  152. package/lib/esm/widget/components/Grouping.d.ts +2 -1
  153. package/lib/esm/widget/components/Grouping.js +7 -4
  154. package/lib/esm/widget/components/Grouping.js.map +1 -1
  155. package/lib/esm/widget/components/Grouping.scss +8 -0
  156. package/lib/esm/widget/components/GroupingMappingContext.js +4 -1
  157. package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
  158. package/lib/esm/widget/components/GroupingMappingRouter.js +1 -1
  159. package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
  160. package/lib/esm/widget/components/GroupsVisualization.js +14 -4
  161. package/lib/esm/widget/components/GroupsVisualization.js.map +1 -1
  162. package/lib/esm/widget/components/MappingImportWizardModal.d.ts +2 -2
  163. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  164. package/lib/esm/widget/components/MappingViewActionGroup.d.ts +12 -0
  165. package/lib/esm/widget/components/MappingViewActionGroup.js +27 -0
  166. package/lib/esm/widget/components/MappingViewActionGroup.js.map +1 -0
  167. package/lib/esm/widget/components/Mappings.d.ts +13 -0
  168. package/lib/esm/widget/components/Mappings.js +22 -0
  169. package/lib/esm/widget/components/Mappings.js.map +1 -0
  170. package/lib/esm/widget/components/MappingsView.d.ts +33 -0
  171. package/lib/esm/widget/components/MappingsView.js +47 -0
  172. package/lib/esm/widget/components/MappingsView.js.map +1 -0
  173. package/lib/{cjs/widget/components/Mapping.scss → esm/widget/components/MappingsView.scss} +6 -2
  174. package/lib/esm/widget/components/SelectMappings.d.ts +1 -1
  175. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  176. package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +2 -0
  177. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +2 -0
  178. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  179. package/lib/esm/widget/components/groupsHelpers.d.ts +1 -1
  180. package/lib/esm/widget/components/groupsHelpers.js +4 -3
  181. package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
  182. package/lib/esm/widget/components/hooks/useMappingsOperations.d.ts +21 -0
  183. package/lib/esm/widget/components/hooks/useMappingsOperations.js +58 -0
  184. package/lib/esm/widget/components/hooks/useMappingsOperations.js.map +1 -0
  185. package/lib/esm/widget/components/utils.d.ts +1 -0
  186. package/lib/esm/widget/components/utils.js +17 -22
  187. package/lib/esm/widget/components/utils.js.map +1 -1
  188. package/lib/esm/widget/hooks/useVisualization.js +3 -3
  189. package/lib/esm/widget/hooks/useVisualization.js.map +1 -1
  190. package/package.json +2 -2
  191. package/lib/cjs/widget/components/Mapping.d.ts +0 -24
  192. package/lib/cjs/widget/components/Mapping.js +0 -136
  193. package/lib/cjs/widget/components/Mapping.js.map +0 -1
  194. package/lib/esm/widget/components/Mapping.d.ts +0 -24
  195. package/lib/esm/widget/components/Mapping.js +0 -110
  196. package/lib/esm/widget/components/Mapping.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"InfixToPostfixConverter.js","sourceRoot":"","sources":["../../../src/formula/InfixToPostfixConverter.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,uEAAuD;AACvD,yEAA0L;AAE1L,mCAAgC;AAChC,mCAAgC;AAChC,mCAA4C;AAE5C,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,IAAI,KAA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AAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC9F,aAAa,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YACvD,iBAAiB,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SACjF,CAAC;QAEF,MAAM,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAE,CAAC;QAExD,MAAM,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,SAAS,KAAK,SAAS,CAAC,KAAK,EAAE;YACjC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,CAAC;SACjD;KACF;IAED,OAAO,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,EAAG,CAAC,CAAC;QAE1C,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,SAAS,KAAK,eAAe,EAAE;YACjC,iBAAiB,CAAC,eAAe,CAAC,CAAC;SACpC;KACF;IAED,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC;AAlCD,sDAkCC","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 { isFunction } from \"./FormulaFunctionProvider\";\nimport { getBinaryOperator, getOperatorAssociativity, getOperatorPrecedence, getUnaryOperator, isOperator, isSupportedOperator, OperatorAssociativity } from \"./FormulaOperatorsProvider\";\nimport type { IResult } from \"./IResult\";\nimport { Queue } from \"./Queue\";\nimport { Stack } from \"./Stack\";\nimport { isStringDelimiter } from \"./Utils\";\n\nfunction isNumber(part: string): boolean {\n return !isNaN(Number(part)) || !isNaN(parseFloat(part));\n}\n\nfunction isStringLiteral(token: string): boolean {\n if (token.length < 2) {\n return false;\n }\n\n const firstCharacter = token[0];\n const lastCharacter = token[token.length - 1];\n return firstCharacter === lastCharacter && isStringDelimiter(firstCharacter);\n}\n\nfunction isBoolean(token: string): boolean {\n const lower = token.toLowerCase();\n return lower === \"true\" || lower === \"false\";\n}\n\nfunction isNull(token: string): boolean {\n return token.toLowerCase() === \"null\";\n}\n\nexport enum TokenType {\n Number = 0,\n Function = 1,\n Operator = 2,\n Variable = 3,\n String = 4,\n Boolean = 5,\n Null = 6,\n}\n\nenum InternalTokenType {\n Number = 0,\n Function = 1,\n Operator = 2,\n Variable = 3,\n OpeningParenthesis = 4,\n ClosingParenthesis = 5,\n ArgumentSeparator = 6,\n String = 7,\n Boolean = 8,\n Null = 9,\n}\n\nexport interface Token {\n value: string;\n type: TokenType;\n argCount: number;\n}\n\ninterface InternalToken {\n value: string;\n type: InternalTokenType;\n argCount: number;\n argCountIncremented: boolean;\n}\n\nfunction getExternalQueue(internal: Queue<InternalToken>): IResult<Queue<Token>> {\n const external = new Queue<Token>();\n while (internal.length > 0) {\n const t = internal.dequeue()!;\n\n switch (t.type) {\n case InternalTokenType.Number:\n external.enqueue({ value: t.value, type: TokenType.Number, argCount: t.argCount });\n break;\n case InternalTokenType.Function:\n external.enqueue({ value: t.value, type: TokenType.Function, argCount: t.argCount });\n break;\n case InternalTokenType.Operator:\n external.enqueue({ value: t.value, type: TokenType.Operator, argCount: t.argCount });\n break;\n case InternalTokenType.Variable:\n external.enqueue({ value: t.value, type: TokenType.Variable, argCount: t.argCount });\n break;\n case InternalTokenType.String:\n external.enqueue({ value: t.value, type: TokenType.String, argCount: t.argCount });\n break;\n case InternalTokenType.Boolean:\n external.enqueue({ value: t.value, type: TokenType.Boolean, argCount: t.argCount });\n break;\n case InternalTokenType.Null:\n external.enqueue({ value: t.value, type: TokenType.Null, argCount: t.argCount });\n break;\n default:\n return { errorMessage: `Missing closing parenthesis \")\".` };\n }\n }\n\n return { value: external };\n}\n\ninterface IConverterContext {\n resultQueue: Queue<InternalToken>;\n operatorStack: Stack<InternalToken>;\n currentToken: string;\n currentTokenType: InternalTokenType;\n previousToken?: string;\n previousTokenType?: InternalTokenType;\n}\n\ntype TokenInterpreter = (ctx: IConverterContext) => IResult<boolean>;\n\nfunction incrementArgCount(token: InternalToken) {\n if (!token.argCountIncremented) {\n token.argCount++;\n token.argCountIncremented = true;\n }\n}\n\nfunction addOperand(ctx: IConverterContext, type: InternalTokenType) {\n ctx.resultQueue.enqueue({ value: ctx.currentToken, type, argCount: 0, argCountIncremented: false });\n\n const currentOperators = ctx.operatorStack.peekN(2);\n const op1 = currentOperators[0];\n if (undefined !== op1) {\n incrementArgCount(op1);\n if (op1.argCount === 1) {\n const op2 = currentOperators[1];\n if (undefined !== op2 && op2.argCount !== 0) {\n incrementArgCount(op2);\n }\n }\n }\n}\n\nconst addNumber: TokenInterpreter = (ctx: IConverterContext) => {\n addOperand(ctx, InternalTokenType.Number);\n return { value: true };\n};\n\nconst addVariable: TokenInterpreter = (ctx: IConverterContext) => {\n ctx = { ...ctx, currentToken: ctx.currentToken.toLowerCase() };\n if (undefined !== ctx.previousToken && isNumber(ctx.previousToken)) {\n addOperator({ ...ctx, currentToken: \"*\" });\n addOperand({ ...ctx, previousToken: \"*\" }, InternalTokenType.Variable);\n } else {\n addOperand(ctx, InternalTokenType.Variable);\n }\n return { value: true };\n};\n\nconst addFunction: TokenInterpreter = (ctx: IConverterContext) => {\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n\n ctx.operatorStack.push({ value: ctx.currentToken, type: InternalTokenType.Function, argCount: 0, argCountIncremented: false });\n return { value: true };\n};\n\nconst addOperator: TokenInterpreter = (ctx: IConverterContext) => {\n if (!isSupportedOperator(ctx.currentToken)) {\n return { errorMessage: `Operator \"${ctx.currentToken}\" is not supported.` };\n }\n\n const binary = undefined !== ctx.previousToken && \"(\" !== ctx.previousToken && \",\" !== ctx.previousToken && !isOperator(ctx.previousToken);\n const unary = !binary;\n\n const op = unary ? getUnaryOperator(ctx.currentToken) : getBinaryOperator(ctx.currentToken);\n if (unary && undefined === op) {\n return { errorMessage: `Unary \"${ctx.currentToken}\" is not supported.` };\n }\n\n const o1 = ctx.currentToken;\n const o1Associativity = getOperatorAssociativity(op);\n const o1Precedence = getOperatorPrecedence(op);\n while (ctx.operatorStack.length > 0) {\n const o2 = ctx.operatorStack.peek()!;\n\n if (o2.value === \"(\") {\n break;\n }\n\n const o2Unary = (o2.argCount === 0) || (o2.argCount === 1 && o2.argCountIncremented === true);\n const op2 = o2Unary ? getUnaryOperator(o2.value) : getBinaryOperator(o2.value);\n const o2Precedence = getOperatorPrecedence(op2);\n if (!(o2Precedence > o1Precedence || (o2Precedence === o1Precedence && o1Associativity === OperatorAssociativity.Left))) {\n break;\n }\n\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n }\n\n ctx.operatorStack.push({\n value: o1,\n type: InternalTokenType.Operator,\n argCount: binary ? 1 : 0,\n argCountIncremented: false,\n });\n\n return { value: true };\n};\n\nconst openParenthesis: TokenInterpreter = (ctx: IConverterContext) => {\n if (undefined !== ctx.previousToken) {\n if (InternalTokenType.Number === ctx.previousTokenType || InternalTokenType.ClosingParenthesis === ctx.previousTokenType) {\n addOperator({ ...ctx, currentToken: \"*\" });\n } else if (InternalTokenType.Variable === ctx.previousTokenType) {\n return { errorMessage: `Function \"${ctx.previousToken}\" is not supported.` };\n }\n }\n\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator && currentOperator.type !== InternalTokenType.Function) {\n incrementArgCount(currentOperator);\n }\n\n ctx.operatorStack.push({ value: \"(\", type: InternalTokenType.OpeningParenthesis, argCount: 0, argCountIncremented: false });\n return { value: true };\n};\n\nconst closeParenthesis: TokenInterpreter = (ctx: IConverterContext) => {\n while (ctx.operatorStack.length > 0 && ctx.operatorStack.peek()!.value !== \"(\") {\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n }\n\n const leftParenthesis = ctx.operatorStack.pop();\n if (undefined === leftParenthesis) {\n return { errorMessage: `Closing parenthesis \")\" found, but the opening parenthesis \"(\" is missing.` };\n }\n\n const potentialFnToken = ctx.operatorStack.peek();\n if (undefined !== potentialFnToken && isFunction(potentialFnToken.value)) {\n potentialFnToken.argCount = leftParenthesis.argCount;\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n }\n\n return { value: true };\n};\n\nconst addString: TokenInterpreter = (ctx: IConverterContext) => {\n const withoutDelimiters = ctx.currentToken.substring(1, ctx.currentToken.length - 1);\n addOperand({ ...ctx, currentToken: withoutDelimiters }, InternalTokenType.String);\n return { value: true };\n};\n\nconst addBoolean: TokenInterpreter = (ctx: IConverterContext) => {\n addOperand({ ...ctx, currentToken: ctx.currentToken.toLowerCase() }, InternalTokenType.Boolean);\n return { value: true };\n};\n\nconst addNull: TokenInterpreter = (ctx: IConverterContext) => {\n addOperand({ ...ctx, currentToken: ctx.currentToken.toLowerCase() }, InternalTokenType.Null);\n return { value: true };\n};\n\nconst separateFunctionArgumentSeparator: TokenInterpreter = (ctx: IConverterContext) => {\n while (ctx.operatorStack.length > 0 && ctx.operatorStack.peek()!.value !== \"(\") {\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n }\n\n const last2Operators = ctx.operatorStack.peekN(2);\n if (last2Operators.length < 2 || last2Operators[0].type !== InternalTokenType.OpeningParenthesis || last2Operators[1].type !== InternalTokenType.Function) {\n return { errorMessage: `Function argument separator \",\" found outside of a function call.` };\n }\n\n last2Operators[0].argCountIncremented = false;\n return { value: true };\n};\n\nfunction getTokenType(token: string, nextToken: string | undefined): InternalTokenType {\n if (isNumber(token)) {\n return InternalTokenType.Number;\n } else if (isStringLiteral(token)) {\n return InternalTokenType.String;\n } else if (isBoolean(token)) {\n return InternalTokenType.Boolean;\n } else if (isNull(token)) {\n return InternalTokenType.Null;\n } else if (isFunction(token) && \"(\" === nextToken) {\n return InternalTokenType.Function;\n } else if (isOperator(token)) {\n return InternalTokenType.Operator;\n } else if (\"(\" === token) {\n return InternalTokenType.OpeningParenthesis;\n } else if (\")\" === token) {\n return InternalTokenType.ClosingParenthesis;\n } else if (\",\" === token) {\n return InternalTokenType.ArgumentSeparator;\n } else {\n return InternalTokenType.Variable;\n }\n}\n\nconst tokenInterpreters: Map<InternalTokenType, TokenInterpreter> = new Map([\n [InternalTokenType.Number, addNumber],\n [InternalTokenType.ArgumentSeparator, separateFunctionArgumentSeparator],\n [InternalTokenType.ClosingParenthesis, closeParenthesis],\n [InternalTokenType.Function, addFunction],\n [InternalTokenType.OpeningParenthesis, openParenthesis],\n [InternalTokenType.Operator, addOperator],\n [InternalTokenType.Variable, addVariable],\n [InternalTokenType.String, addString],\n [InternalTokenType.Boolean, addBoolean],\n [InternalTokenType.Null, addNull],\n]);\n\nexport function convertInfixToPostfix(infix: string[]): IResult<Queue<Token>> {\n const resultQueue = new Queue<InternalToken>();\n const operatorStack = new Stack<InternalToken>();\n\n for (let index = 0; index < infix.length; index++) {\n const token = infix[index];\n\n const ctx: IConverterContext = {\n resultQueue,\n operatorStack,\n currentToken: token,\n currentTokenType: getTokenType(token, index < infix.length - 1 ? infix[index + 1] : undefined),\n previousToken: index > 0 ? infix[index - 1] : undefined,\n previousTokenType: index > 0 ? getTokenType(infix[index - 1], token) : undefined,\n };\n\n const fn = tokenInterpreters.get(ctx.currentTokenType)!;\n\n const tmpResult = fn(ctx);\n if (undefined === tmpResult.value) {\n return { errorMessage: tmpResult.errorMessage };\n }\n }\n\n while (operatorStack.length > 0) {\n resultQueue.enqueue(operatorStack.pop()!);\n\n const currentOperator = operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n }\n\n return getExternalQueue(resultQueue);\n}\n"]}
1
+ {"version":3,"file":"InfixToPostfixConverter.js","sourceRoot":"","sources":["../../../src/formula/InfixToPostfixConverter.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,uEAAuD;AACvD,yEAA0L;AAE1L,mCAAgC;AAChC,mCAAgC;AAChC,mCAA4C;AAE5C,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,cAAc,KAAK,aAAa,IAAI,IAAA,yBAAiB,EAAC,cAAc,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,CAAC;AAC/C,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;AACxC,CAAC;AAED,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,6CAAU,CAAA;IACV,iDAAY,CAAA;IACZ,iDAA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AG,CAAC,CAAC;QAC1B,IAAI,SAAS,KAAK,SAAS,CAAC,KAAK,EAAE;YACjC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,CAAC;SACjD;KACF;IAED,OAAO,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,EAAG,CAAC,CAAC;QAE1C,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,SAAS,KAAK,eAAe,EAAE;YACjC,iBAAiB,CAAC,eAAe,CAAC,CAAC;SACpC;KACF;IAED,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC;AAlCD,sDAkCC","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 { isFunction } from \"./FormulaFunctionProvider\";\nimport { getBinaryOperator, getOperatorAssociativity, getOperatorPrecedence, getUnaryOperator, isOperator, isSupportedOperator, OperatorAssociativity } from \"./FormulaOperatorsProvider\";\nimport type { IResult } from \"./IResult\";\nimport { Queue } from \"./Queue\";\nimport { Stack } from \"./Stack\";\nimport { isStringDelimiter } from \"./Utils\";\n\nfunction isNumber(part: string): boolean {\n return !isNaN(Number(part)) || !isNaN(parseFloat(part));\n}\n\nfunction isStringLiteral(token: string): boolean {\n if (token.length < 2) {\n return false;\n }\n\n const firstCharacter = token[0];\n const lastCharacter = token[token.length - 1];\n return firstCharacter === lastCharacter && isStringDelimiter(firstCharacter);\n}\n\nfunction isBoolean(token: string): boolean {\n const lower = token.toLowerCase();\n return lower === \"true\" || lower === \"false\";\n}\n\nfunction isNull(token: string): boolean {\n return token.toLowerCase() === \"null\";\n}\n\nexport enum TokenType {\n Number = 0,\n Function = 1,\n Operator = 2,\n Variable = 3,\n String = 4,\n Boolean = 5,\n Null = 6,\n}\n\nenum InternalTokenType {\n Number = 0,\n Function = 1,\n Operator = 2,\n Variable = 3,\n OpeningParenthesis = 4,\n ClosingParenthesis = 5,\n ArgumentSeparator = 6,\n String = 7,\n Boolean = 8,\n Null = 9,\n}\n\nexport interface Token {\n value: string;\n type: TokenType;\n argCount: number;\n}\n\ninterface InternalToken {\n value: string;\n type: InternalTokenType;\n argCount: number;\n argCountIncremented: boolean;\n}\n\nfunction getExternalQueue(internal: Queue<InternalToken>): IResult<Queue<Token>> {\n const external = new Queue<Token>();\n while (internal.length > 0) {\n const t = internal.dequeue()!;\n\n switch (t.type) {\n case InternalTokenType.Number:\n external.enqueue({ value: t.value, type: TokenType.Number, argCount: t.argCount });\n break;\n case InternalTokenType.Function:\n external.enqueue({ value: t.value, type: TokenType.Function, argCount: t.argCount });\n break;\n case InternalTokenType.Operator:\n external.enqueue({ value: t.value, type: TokenType.Operator, argCount: t.argCount });\n break;\n case InternalTokenType.Variable:\n external.enqueue({ value: t.value, type: TokenType.Variable, argCount: t.argCount });\n break;\n case InternalTokenType.String:\n external.enqueue({ value: t.value, type: TokenType.String, argCount: t.argCount });\n break;\n case InternalTokenType.Boolean:\n external.enqueue({ value: t.value, type: TokenType.Boolean, argCount: t.argCount });\n break;\n case InternalTokenType.Null:\n external.enqueue({ value: t.value, type: TokenType.Null, argCount: t.argCount });\n break;\n default:\n return { errorMessage: `Missing closing parenthesis \")\".` };\n }\n }\n\n return { value: external };\n}\n\ninterface IConverterContext {\n resultQueue: Queue<InternalToken>;\n operatorStack: Stack<InternalToken>;\n currentToken: string;\n currentTokenType: InternalTokenType;\n previousToken?: string;\n previousTokenType?: InternalTokenType;\n}\n\ntype TokenInterpreter = (ctx: IConverterContext) => IResult<boolean>;\n\nfunction incrementArgCount(token: InternalToken) {\n if (!token.argCountIncremented) {\n token.argCount++;\n token.argCountIncremented = true;\n }\n}\n\nfunction addOperand(ctx: IConverterContext, type: InternalTokenType) {\n ctx.resultQueue.enqueue({ value: ctx.currentToken, type, argCount: 0, argCountIncremented: false });\n\n const currentOperators = ctx.operatorStack.peekN(2);\n const op1 = currentOperators[0];\n if (undefined !== op1) {\n incrementArgCount(op1);\n if (op1.argCount === 1) {\n const op2 = currentOperators[1];\n if (undefined !== op2 && op2.argCount !== 0) {\n incrementArgCount(op2);\n }\n }\n }\n}\n\nconst addNumber: TokenInterpreter = (ctx: IConverterContext) => {\n addOperand(ctx, InternalTokenType.Number);\n return { value: true };\n};\n\nconst addVariable: TokenInterpreter = (ctx: IConverterContext) => {\n ctx = { ...ctx, currentToken: ctx.currentToken.toLowerCase() };\n if (undefined !== ctx.previousToken && isNumber(ctx.previousToken)) {\n addOperator({ ...ctx, currentToken: \"*\" });\n addOperand({ ...ctx, previousToken: \"*\" }, InternalTokenType.Variable);\n } else {\n addOperand(ctx, InternalTokenType.Variable);\n }\n return { value: true };\n};\n\nconst addFunction: TokenInterpreter = (ctx: IConverterContext) => {\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n\n ctx.operatorStack.push({ value: ctx.currentToken, type: InternalTokenType.Function, argCount: 0, argCountIncremented: false });\n return { value: true };\n};\n\nconst addOperator: TokenInterpreter = (ctx: IConverterContext) => {\n if (!isSupportedOperator(ctx.currentToken)) {\n return { errorMessage: `Operator \"${ctx.currentToken}\" is not supported.` };\n }\n\n const binary = undefined !== ctx.previousToken && \"(\" !== ctx.previousToken && \",\" !== ctx.previousToken && !isOperator(ctx.previousToken);\n const unary = !binary;\n\n const op = unary ? getUnaryOperator(ctx.currentToken) : getBinaryOperator(ctx.currentToken);\n if (unary && undefined === op) {\n return { errorMessage: `Unary \"${ctx.currentToken}\" is not supported.` };\n }\n\n const o1 = ctx.currentToken;\n const o1Associativity = getOperatorAssociativity(op);\n const o1Precedence = getOperatorPrecedence(op);\n while (ctx.operatorStack.length > 0) {\n const o2 = ctx.operatorStack.peek()!;\n\n if (o2.value === \"(\") {\n break;\n }\n\n const o2Unary = (o2.argCount === 0) || (o2.argCount === 1 && o2.argCountIncremented === true);\n const op2 = o2Unary ? getUnaryOperator(o2.value) : getBinaryOperator(o2.value);\n const o2Precedence = getOperatorPrecedence(op2);\n if (!(o2Precedence > o1Precedence || (o2Precedence === o1Precedence && o1Associativity === OperatorAssociativity.Left))) {\n break;\n }\n\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n }\n\n ctx.operatorStack.push({\n value: o1,\n type: InternalTokenType.Operator,\n argCount: binary ? 1 : 0,\n argCountIncremented: false,\n });\n\n return { value: true };\n};\n\nconst openParenthesis: TokenInterpreter = (ctx: IConverterContext) => {\n if (undefined !== ctx.previousToken) {\n if (InternalTokenType.Number === ctx.previousTokenType || InternalTokenType.ClosingParenthesis === ctx.previousTokenType) {\n addOperator({ ...ctx, currentToken: \"*\" });\n } else if (InternalTokenType.Variable === ctx.previousTokenType) {\n return { errorMessage: `Function \"${ctx.previousToken}\" is not supported.` };\n }\n }\n\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator && currentOperator.type !== InternalTokenType.Function) {\n incrementArgCount(currentOperator);\n }\n\n ctx.operatorStack.push({ value: \"(\", type: InternalTokenType.OpeningParenthesis, argCount: 0, argCountIncremented: false });\n return { value: true };\n};\n\nconst closeParenthesis: TokenInterpreter = (ctx: IConverterContext) => {\n while (ctx.operatorStack.length > 0 && ctx.operatorStack.peek()!.value !== \"(\") {\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n }\n\n const leftParenthesis = ctx.operatorStack.pop();\n if (undefined === leftParenthesis) {\n return { errorMessage: `Closing parenthesis \")\" found, but the opening parenthesis \"(\" is missing.` };\n }\n\n const potentialFnToken = ctx.operatorStack.peek();\n if (undefined !== potentialFnToken && isFunction(potentialFnToken.value)) {\n potentialFnToken.argCount = leftParenthesis.argCount;\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n }\n\n return { value: true };\n};\n\nconst addString: TokenInterpreter = (ctx: IConverterContext) => {\n const withoutDelimiters = ctx.currentToken.substring(1, ctx.currentToken.length - 1);\n addOperand({ ...ctx, currentToken: withoutDelimiters }, InternalTokenType.String);\n return { value: true };\n};\n\nconst addBoolean: TokenInterpreter = (ctx: IConverterContext) => {\n addOperand({ ...ctx, currentToken: ctx.currentToken.toLowerCase() }, InternalTokenType.Boolean);\n return { value: true };\n};\n\nconst addNull: TokenInterpreter = (ctx: IConverterContext) => {\n addOperand({ ...ctx, currentToken: ctx.currentToken.toLowerCase() }, InternalTokenType.Null);\n return { value: true };\n};\n\nconst separateFunctionArgumentSeparator: TokenInterpreter = (ctx: IConverterContext) => {\n while (ctx.operatorStack.length > 0 && ctx.operatorStack.peek()!.value !== \"(\") {\n ctx.resultQueue.enqueue(ctx.operatorStack.pop()!);\n\n const currentOperator = ctx.operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n }\n\n const last2Operators = ctx.operatorStack.peekN(2);\n if (last2Operators.length < 2 || last2Operators[0].type !== InternalTokenType.OpeningParenthesis || last2Operators[1].type !== InternalTokenType.Function) {\n return { errorMessage: `Function argument separator \",\" found outside of a function call.` };\n }\n\n last2Operators[0].argCountIncremented = false;\n return { value: true };\n};\n\nfunction getTokenType(token: string, nextToken: string | undefined): InternalTokenType {\n if (isNumber(token)) {\n return InternalTokenType.Number;\n } else if (isStringLiteral(token)) {\n return InternalTokenType.String;\n } else if (isBoolean(token)) {\n return InternalTokenType.Boolean;\n } else if (isNull(token)) {\n return InternalTokenType.Null;\n } else if (isFunction(token) && \"(\" === nextToken) {\n return InternalTokenType.Function;\n } else if (isOperator(token)) {\n return InternalTokenType.Operator;\n } else if (\"(\" === token) {\n return InternalTokenType.OpeningParenthesis;\n } else if (\")\" === token) {\n return InternalTokenType.ClosingParenthesis;\n } else if (\",\" === token) {\n return InternalTokenType.ArgumentSeparator;\n } else {\n return InternalTokenType.Variable;\n }\n}\n\nconst tokenInterpreters: Map<InternalTokenType, TokenInterpreter> = new Map([\n [InternalTokenType.Number, addNumber],\n [InternalTokenType.ArgumentSeparator, separateFunctionArgumentSeparator],\n [InternalTokenType.ClosingParenthesis, closeParenthesis],\n [InternalTokenType.Function, addFunction],\n [InternalTokenType.OpeningParenthesis, openParenthesis],\n [InternalTokenType.Operator, addOperator],\n [InternalTokenType.Variable, addVariable],\n [InternalTokenType.String, addString],\n [InternalTokenType.Boolean, addBoolean],\n [InternalTokenType.Null, addNull],\n]);\n\nexport function convertInfixToPostfix(infix: string[]): IResult<Queue<Token>> {\n const resultQueue = new Queue<InternalToken>();\n const operatorStack = new Stack<InternalToken>();\n\n for (let index = 0; index < infix.length; index++) {\n const token = infix[index];\n\n const ctx: IConverterContext = {\n resultQueue,\n operatorStack,\n currentToken: token,\n currentTokenType: getTokenType(token, index < infix.length - 1 ? infix[index + 1] : undefined),\n previousToken: index > 0 ? infix[index - 1] : undefined,\n previousTokenType: index > 0 ? getTokenType(infix[index - 1], token) : undefined,\n };\n\n const fn = tokenInterpreters.get(ctx.currentTokenType)!;\n\n const tmpResult = fn(ctx);\n if (undefined === tmpResult.value) {\n return { errorMessage: tmpResult.errorMessage };\n }\n }\n\n while (operatorStack.length > 0) {\n resultQueue.enqueue(operatorStack.pop()!);\n\n const currentOperator = operatorStack.peek();\n if (undefined !== currentOperator) {\n incrementArgCount(currentOperator);\n }\n }\n\n return getExternalQueue(resultQueue);\n}\n"]}
@@ -5,8 +5,10 @@ export { createDefaultMappingClient, createMappingClient, MappingClientContext,
5
5
  export { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig, GroupingMappingApiConfigContext, useGroupingMappingApiConfig } from "./widget/components/context/GroupingApiConfigContext";
6
6
  export * from "@itwin/insights-client";
7
7
  /** Internal components for custom UIs */
8
- export { Mappings, MappingsProps } from "./widget/components/Mapping";
8
+ export { Mappings, MappingsProps } from "./widget/components/Mappings";
9
+ export { useMappingsOperations, MappingsOperationsProps } from "./widget/components/hooks/useMappingsOperations";
9
10
  export { MappingAction, MappingActionProps } from "./widget/components/MappingAction";
11
+ export { MappingsView, MappingsViewProps } from "./widget/components/MappingsView";
10
12
  export { GroupingMappingContext, GroupingMappingContextProps } from "./widget/components/GroupingMappingContext";
11
13
  export { Groupings, GroupingProps } from "./widget/components/Grouping";
12
14
  export { GroupsVisualization, GroupsVisualizationProps } from "./widget/components/GroupsVisualization";
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.resolveFormulaDataType = exports.GroupingMappingCustomUIType = exports.GroupQueryBuilderCustomUI = exports.ManualGroupingCustomUI = exports.SearchGroupingCustomUI = exports.CustomCalculationAction = exports.CalculatedPropertyActionWithVisuals = exports.CalculatedPropertyAction = exports.GroupPropertyAction = exports.PropertyMenuWithVisualization = exports.PropertyMenu = exports.GroupAction = exports.GroupsVisualization = exports.Groupings = exports.GroupingMappingContext = exports.MappingAction = exports.Mappings = exports.useGroupingMappingApiConfig = exports.GroupingMappingApiConfigContext = exports.useMappingClient = exports.MappingClientContext = exports.createMappingClient = exports.createDefaultMappingClient = void 0;
13
+ exports.resolveFormulaDataType = exports.GroupingMappingCustomUIType = exports.GroupQueryBuilderCustomUI = exports.ManualGroupingCustomUI = exports.SearchGroupingCustomUI = exports.CustomCalculationAction = exports.CalculatedPropertyActionWithVisuals = exports.CalculatedPropertyAction = exports.GroupPropertyAction = exports.PropertyMenuWithVisualization = exports.PropertyMenu = exports.GroupAction = exports.GroupsVisualization = exports.Groupings = exports.GroupingMappingContext = exports.MappingsView = exports.MappingAction = exports.useMappingsOperations = exports.Mappings = exports.useGroupingMappingApiConfig = exports.GroupingMappingApiConfigContext = exports.useMappingClient = exports.MappingClientContext = exports.createMappingClient = exports.createDefaultMappingClient = void 0;
14
14
  /*---------------------------------------------------------------------------------------------
15
15
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
16
16
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -28,10 +28,14 @@ Object.defineProperty(exports, "GroupingMappingApiConfigContext", { enumerable:
28
28
  Object.defineProperty(exports, "useGroupingMappingApiConfig", { enumerable: true, get: function () { return GroupingApiConfigContext_1.useGroupingMappingApiConfig; } });
29
29
  __exportStar(require("@itwin/insights-client"), exports);
30
30
  /** Internal components for custom UIs */
31
- var Mapping_1 = require("./widget/components/Mapping");
32
- Object.defineProperty(exports, "Mappings", { enumerable: true, get: function () { return Mapping_1.Mappings; } });
31
+ var Mappings_1 = require("./widget/components/Mappings");
32
+ Object.defineProperty(exports, "Mappings", { enumerable: true, get: function () { return Mappings_1.Mappings; } });
33
+ var useMappingsOperations_1 = require("./widget/components/hooks/useMappingsOperations");
34
+ Object.defineProperty(exports, "useMappingsOperations", { enumerable: true, get: function () { return useMappingsOperations_1.useMappingsOperations; } });
33
35
  var MappingAction_1 = require("./widget/components/MappingAction");
34
36
  Object.defineProperty(exports, "MappingAction", { enumerable: true, get: function () { return MappingAction_1.MappingAction; } });
37
+ var MappingsView_1 = require("./widget/components/MappingsView");
38
+ Object.defineProperty(exports, "MappingsView", { enumerable: true, get: function () { return MappingsView_1.MappingsView; } });
35
39
  var GroupingMappingContext_1 = require("./widget/components/GroupingMappingContext");
36
40
  Object.defineProperty(exports, "GroupingMappingContext", { enumerable: true, get: function () { return GroupingMappingContext_1.GroupingMappingContext; } });
37
41
  var Grouping_1 = require("./widget/components/Grouping");
@@ -1 +1 @@
1
- {"version":3,"file":"grouping-mapping-widget.js","sourceRoot":"","sources":["../../src/grouping-mapping-widget.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gDAAgD;AAChD,iEAA+C;AAE/C,0EAA0E;AAC1E,yFAA2J;AAAlJ,kIAAA,0BAA0B,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AAAE,wHAAA,gBAAgB,OAAA;AAChG,iGAA8L;AAA3H,2IAAA,+BAA+B,OAAA;AAAE,uIAAA,2BAA2B,OAAA;AAC/H,yDAAuC;AAEvC,yCAAyC;AACzC,uDAAsE;AAA7D,mGAAA,QAAQ,OAAA;AACjB,mEAAsF;AAA7E,8GAAA,aAAa,OAAA;AACtB,qFAAiH;AAAxG,gIAAA,sBAAsB,OAAA;AAC/B,yDAAwE;AAA/D,qGAAA,SAAS,OAAA;AAClB,+EAAwG;AAA/F,0HAAA,mBAAmB,OAAA;AAC5B,+DAAgF;AAAvE,0GAAA,WAAW,OAAA;AACpB,iEAAmF;AAA1E,4GAAA,YAAY,OAAA;AACrB,mGAAsI;AAA7H,8IAAA,6BAA6B,OAAA;AACtC,+EAAwG;AAA/F,0HAAA,mBAAmB,OAAA;AAC5B,yFAAuH;AAA9G,oIAAA,wBAAwB,OAAA;AACjC,+GAAwJ;AAA/I,0JAAA,mCAAmC,OAAA;AAC5C,uFAAoH;AAA3G,kIAAA,uBAAuB,OAAA;AAChC,8FAA6F;AAApF,gIAAA,sBAAsB,OAAA;AAC/B,8FAA6F;AAApF,gIAAA,sBAAsB,OAAA;AAC/B,oGAAmG;AAA1F,sIAAA,yBAAyB,OAAA;AAClC,gGAA4M;AAA1K,sIAAA,2BAA2B,OAAA;AAE7D,gCAAgC;AAChC,6EAA2E;AAAlE,iIAAA,sBAAsB,OAAA","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*--------------------------------------------------------------------------------------------*/\n/** UI Provider for iTwin Viewer Applications */\nexport * from \"./widget/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./widget/components/context/MappingClientContext\";\nexport { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig, GroupingMappingApiConfigContext, useGroupingMappingApiConfig } from \"./widget/components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./widget/components/Mapping\";\nexport { MappingAction, MappingActionProps } from \"./widget/components/MappingAction\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./widget/components/GroupingMappingContext\";\nexport { Groupings, GroupingProps } from \"./widget/components/Grouping\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./widget/components/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./widget/components/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./widget/components/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./widget/components/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./widget/components/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./widget/components/CalculatedPropertyAction\";\nexport { CalculatedPropertyActionWithVisuals, CalculatedPropertyActionWithVisualsProps } from \"./widget/components/CalculatedPropertyActionWithVisuals\";\nexport { CustomCalculationAction, CustomCalculationActionProps } from \"./widget/components/CustomCalculationAction\";\nexport { SearchGroupingCustomUI } from \"./widget/components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./widget/components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./widget/components/customUI/GroupQueryBuilderCustomUI\";\nexport { GroupingMappingCustomUI, GroupingMappingCustomUIType, ContextCustomUI, GroupingCustomUI, GroupingCustomUIProps, ContextCustomUIProps } from \"./widget/components/customUI/GroupingMappingCustomUI\";\n\n/** Formula DataType resolver */\nexport { resolveFormulaDataType } from \"./formula/FormulaDataTypeResolver\";\nexport { DataType, PropertyMap } from \"./formula/Types\";\nexport { IResult } from \"./formula/IResult\";\n"]}
1
+ {"version":3,"file":"grouping-mapping-widget.js","sourceRoot":"","sources":["../../src/grouping-mapping-widget.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gDAAgD;AAChD,iEAA+C;AAE/C,0EAA0E;AAC1E,yFAA2J;AAAlJ,kIAAA,0BAA0B,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AAAE,wHAAA,gBAAgB,OAAA;AAChG,iGAA8L;AAA3H,2IAAA,+BAA+B,OAAA;AAAE,uIAAA,2BAA2B,OAAA;AAC/H,yDAAuC;AAEvC,yCAAyC;AACzC,yDAAuE;AAA9D,oGAAA,QAAQ,OAAA;AACjB,yFAAiH;AAAxG,8HAAA,qBAAqB,OAAA;AAC9B,mEAAsF;AAA7E,8GAAA,aAAa,OAAA;AACtB,iEAAmF;AAA1E,4GAAA,YAAY,OAAA;AACrB,qFAAiH;AAAxG,gIAAA,sBAAsB,OAAA;AAC/B,yDAAwE;AAA/D,qGAAA,SAAS,OAAA;AAClB,+EAAwG;AAA/F,0HAAA,mBAAmB,OAAA;AAC5B,+DAAgF;AAAvE,0GAAA,WAAW,OAAA;AACpB,iEAAmF;AAA1E,4GAAA,YAAY,OAAA;AACrB,mGAAsI;AAA7H,8IAAA,6BAA6B,OAAA;AACtC,+EAAwG;AAA/F,0HAAA,mBAAmB,OAAA;AAC5B,yFAAuH;AAA9G,oIAAA,wBAAwB,OAAA;AACjC,+GAAwJ;AAA/I,0JAAA,mCAAmC,OAAA;AAC5C,uFAAoH;AAA3G,kIAAA,uBAAuB,OAAA;AAChC,8FAA6F;AAApF,gIAAA,sBAAsB,OAAA;AAC/B,8FAA6F;AAApF,gIAAA,sBAAsB,OAAA;AAC/B,oGAAmG;AAA1F,sIAAA,yBAAyB,OAAA;AAClC,gGAA4M;AAA1K,sIAAA,2BAA2B,OAAA;AAE7D,gCAAgC;AAChC,6EAA2E;AAAlE,iIAAA,sBAAsB,OAAA","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*--------------------------------------------------------------------------------------------*/\n/** UI Provider for iTwin Viewer Applications */\nexport * from \"./widget/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./widget/components/context/MappingClientContext\";\nexport { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig, GroupingMappingApiConfigContext, useGroupingMappingApiConfig } from \"./widget/components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./widget/components/Mappings\";\nexport { useMappingsOperations, MappingsOperationsProps } from \"./widget/components/hooks/useMappingsOperations\";\nexport { MappingAction, MappingActionProps } from \"./widget/components/MappingAction\";\nexport { MappingsView, MappingsViewProps } from \"./widget/components/MappingsView\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./widget/components/GroupingMappingContext\";\nexport { Groupings, GroupingProps } from \"./widget/components/Grouping\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./widget/components/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./widget/components/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./widget/components/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./widget/components/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./widget/components/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./widget/components/CalculatedPropertyAction\";\nexport { CalculatedPropertyActionWithVisuals, CalculatedPropertyActionWithVisualsProps } from \"./widget/components/CalculatedPropertyActionWithVisuals\";\nexport { CustomCalculationAction, CustomCalculationActionProps } from \"./widget/components/CustomCalculationAction\";\nexport { SearchGroupingCustomUI } from \"./widget/components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./widget/components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./widget/components/customUI/GroupQueryBuilderCustomUI\";\nexport { GroupingMappingCustomUI, GroupingMappingCustomUIType, ContextCustomUI, GroupingCustomUI, GroupingCustomUIProps, ContextCustomUIProps } from \"./widget/components/customUI/GroupingMappingCustomUI\";\n\n/** Formula DataType resolver */\nexport { resolveFormulaDataType } from \"./formula/FormulaDataTypeResolver\";\nexport { DataType, PropertyMap } from \"./formula/Types\";\nexport { IResult } from \"./formula/IResult\";\n"]}
@@ -7,8 +7,8 @@ const chai_1 = require("chai");
7
7
  const presentation_common_1 = require("@itwin/presentation-common");
8
8
  describe("Group properties utilities", () => {
9
9
  it("one primitive string property", () => {
10
- const propertyFields = [PropertyFieldsHelpers_1.createTestPropertiesContentField({ properties: [{ property: PropertyFieldsHelpers_1.createTestPropertyInfo() }] })];
11
- const result = GroupPropertyUtils_1.convertPresentationFields(propertyFields);
10
+ const propertyFields = [(0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({ properties: [{ property: (0, PropertyFieldsHelpers_1.createTestPropertyInfo)() }] })];
11
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)(propertyFields);
12
12
  const expectedResult = [
13
13
  {
14
14
  displayLabel: "Properties Field",
@@ -26,15 +26,15 @@ describe("Group properties utilities", () => {
26
26
  chai_1.assert.deepEqual(result, expectedResult);
27
27
  });
28
28
  it("multiple primitive properies of different types", () => {
29
- const testProperties = [PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "propString" }),
30
- PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "propInt", type: "int" }),
31
- PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "propBool", type: "boolean" }),
32
- PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "propEnum", type: "enum" }),
33
- PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "propLong", type: "long" }),
34
- PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "propNumber", type: "number" }),
29
+ const testProperties = [(0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "propString" }),
30
+ (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "propInt", type: "int" }),
31
+ (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "propBool", type: "boolean" }),
32
+ (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "propEnum", type: "enum" }),
33
+ (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "propLong", type: "long" }),
34
+ (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "propNumber", type: "number" }),
35
35
  ];
36
- const propertyFields = testProperties.map((p) => PropertyFieldsHelpers_1.createTestPropertiesContentField({ properties: [{ property: p }] }));
37
- const result = GroupPropertyUtils_1.convertPresentationFields(propertyFields);
36
+ const propertyFields = testProperties.map((p) => (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({ properties: [{ property: p }] }));
37
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)(propertyFields);
38
38
  const expectedResult = [
39
39
  {
40
40
  displayLabel: "Properties Field",
@@ -112,23 +112,23 @@ describe("Group properties utilities", () => {
112
112
  chai_1.assert.deepEqual(result, expectedResult);
113
113
  });
114
114
  it("one BisCore:ElementOwnsUniqueAspect nested property", () => {
115
- const propertiesField = PropertyFieldsHelpers_1.createTestPropertiesContentField({
116
- properties: [{ property: PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "prop1" }) }],
115
+ const propertiesField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({
116
+ properties: [{ property: (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "prop1" }) }],
117
117
  });
118
- const nestedAspectField = PropertyFieldsHelpers_1.createTestNestedContentField({
118
+ const nestedAspectField = (0, PropertyFieldsHelpers_1.createTestNestedContentField)({
119
119
  nestedFields: [propertiesField],
120
120
  relationshipMeaning: presentation_common_1.RelationshipMeaning.SameInstance,
121
121
  pathToPrimaryClass: [
122
- PropertyFieldsHelpers_1.createTestRelatedClassInfo({
123
- sourceClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Some:UniqueAspect" }),
124
- relationshipInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ElementOwnsUniqueAspect" }),
125
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Schema:Class" }),
122
+ (0, PropertyFieldsHelpers_1.createTestRelatedClassInfo)({
123
+ sourceClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Some:UniqueAspect" }),
124
+ relationshipInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ElementOwnsUniqueAspect" }),
125
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Schema:Class" }),
126
126
  isForwardRelationship: false,
127
127
  isPolymorphicRelationship: true,
128
128
  }),
129
129
  ],
130
130
  });
131
- const result = GroupPropertyUtils_1.convertPresentationFields([nestedAspectField]);
131
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([nestedAspectField]);
132
132
  const expectedResult = [
133
133
  {
134
134
  displayLabel: "Properties Field",
@@ -146,23 +146,23 @@ describe("Group properties utilities", () => {
146
146
  chai_1.assert.deepEqual(result, expectedResult);
147
147
  });
148
148
  it("one BisCore:ElementOwnsMultiAspects nested property", () => {
149
- const propertiesField = PropertyFieldsHelpers_1.createTestPropertiesContentField({
150
- properties: [{ property: PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "prop1" }) }],
149
+ const propertiesField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({
150
+ properties: [{ property: (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "prop1" }) }],
151
151
  });
152
- const nestedAspectField = PropertyFieldsHelpers_1.createTestNestedContentField({
152
+ const nestedAspectField = (0, PropertyFieldsHelpers_1.createTestNestedContentField)({
153
153
  nestedFields: [propertiesField],
154
154
  relationshipMeaning: presentation_common_1.RelationshipMeaning.SameInstance,
155
155
  pathToPrimaryClass: [
156
- PropertyFieldsHelpers_1.createTestRelatedClassInfo({
157
- sourceClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Some:MultiAspect" }),
158
- relationshipInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ElementOwnsMultiAspects" }),
159
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Schema:Class" }),
156
+ (0, PropertyFieldsHelpers_1.createTestRelatedClassInfo)({
157
+ sourceClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Some:MultiAspect" }),
158
+ relationshipInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ElementOwnsMultiAspects" }),
159
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Schema:Class" }),
160
160
  isForwardRelationship: false,
161
161
  isPolymorphicRelationship: true,
162
162
  }),
163
163
  ],
164
164
  });
165
- const result = GroupPropertyUtils_1.convertPresentationFields([nestedAspectField]);
165
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([nestedAspectField]);
166
166
  const expectedResult = [
167
167
  {
168
168
  displayLabel: "Properties Field",
@@ -180,23 +180,23 @@ describe("Group properties utilities", () => {
180
180
  chai_1.assert.deepEqual(result, expectedResult);
181
181
  });
182
182
  it("one BisCore:GeometricElement3dHasTypeDefinition nested property", () => {
183
- const propertiesField = PropertyFieldsHelpers_1.createTestPropertiesContentField({
184
- properties: [{ property: PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "prop1" }) }],
183
+ const propertiesField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({
184
+ properties: [{ property: (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "prop1" }) }],
185
185
  });
186
- const nestedAspectField = PropertyFieldsHelpers_1.createTestNestedContentField({
186
+ const nestedAspectField = (0, PropertyFieldsHelpers_1.createTestNestedContentField)({
187
187
  nestedFields: [propertiesField],
188
188
  relationshipMeaning: presentation_common_1.RelationshipMeaning.RelatedInstance,
189
189
  pathToPrimaryClass: [
190
- PropertyFieldsHelpers_1.createTestRelatedClassInfo({
191
- sourceClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Schema:SomeType" }),
192
- relationshipInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:GeometricElement3dHasTypeDefinition" }),
193
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Schema:Class" }),
190
+ (0, PropertyFieldsHelpers_1.createTestRelatedClassInfo)({
191
+ sourceClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Schema:SomeType" }),
192
+ relationshipInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:GeometricElement3dHasTypeDefinition" }),
193
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Schema:Class" }),
194
194
  isForwardRelationship: false,
195
195
  isPolymorphicRelationship: true,
196
196
  }),
197
197
  ],
198
198
  });
199
- const result = GroupPropertyUtils_1.convertPresentationFields([nestedAspectField]);
199
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([nestedAspectField]);
200
200
  const expectedResult = [
201
201
  {
202
202
  actualECClassName: "SchemaName:ClassName",
@@ -214,49 +214,49 @@ describe("Group properties utilities", () => {
214
214
  chai_1.assert.deepEqual(result, expectedResult);
215
215
  });
216
216
  it("generate proper external source metadata", () => {
217
- const propertyName = PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "name" });
218
- const propertyPath = PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "path" });
219
- const repositoryProperties = PropertyFieldsHelpers_1.createTestPropertiesContentField({
217
+ const propertyName = (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "name" });
218
+ const propertyPath = (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "path" });
219
+ const repositoryProperties = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({
220
220
  properties: [{ property: propertyName }, { property: propertyPath }],
221
221
  });
222
- const nestedExternalSource = PropertyFieldsHelpers_1.createTestNestedContentField({
222
+ const nestedExternalSource = (0, PropertyFieldsHelpers_1.createTestNestedContentField)({
223
223
  nestedFields: [repositoryProperties],
224
224
  contentClassInfo: { name: "BisCore:RepositoryLink", id: "", label: "" },
225
225
  relationshipMeaning: presentation_common_1.RelationshipMeaning.SameInstance,
226
226
  pathToPrimaryClass: [
227
- PropertyFieldsHelpers_1.createTestRelatedClassInfo({
228
- sourceClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ExternalSourceIsInRepository" }),
229
- relationshipInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:RepositoryLink" }),
230
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ExternalSource" }),
227
+ (0, PropertyFieldsHelpers_1.createTestRelatedClassInfo)({
228
+ sourceClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ExternalSourceIsInRepository" }),
229
+ relationshipInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:RepositoryLink" }),
230
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ExternalSource" }),
231
231
  isForwardRelationship: false,
232
232
  isPolymorphicRelationship: true,
233
233
  }),
234
- PropertyFieldsHelpers_1.createTestRelatedClassInfo({
235
- sourceClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ElementIsFromSource" }),
236
- relationshipInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ExternalSource" }),
237
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ExternalSourceAspect" }),
234
+ (0, PropertyFieldsHelpers_1.createTestRelatedClassInfo)({
235
+ sourceClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ElementIsFromSource" }),
236
+ relationshipInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ExternalSource" }),
237
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ExternalSourceAspect" }),
238
238
  isForwardRelationship: false,
239
239
  isPolymorphicRelationship: true,
240
240
  }),
241
241
  ],
242
242
  });
243
- const propertiesField = PropertyFieldsHelpers_1.createTestPropertiesContentField({
244
- properties: [{ property: PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "Identifier" }) }],
243
+ const propertiesField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({
244
+ properties: [{ property: (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "Identifier" }) }],
245
245
  });
246
- const nestedSourceAspectField = PropertyFieldsHelpers_1.createTestNestedContentField({
246
+ const nestedSourceAspectField = (0, PropertyFieldsHelpers_1.createTestNestedContentField)({
247
247
  nestedFields: [propertiesField, nestedExternalSource],
248
248
  relationshipMeaning: presentation_common_1.RelationshipMeaning.SameInstance,
249
249
  pathToPrimaryClass: [
250
- PropertyFieldsHelpers_1.createTestRelatedClassInfo({
251
- sourceClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ExternalSourceAspect" }),
252
- relationshipInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ElementOwnsMultiAspects" }),
253
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo({ name: "Schema:Class" }),
250
+ (0, PropertyFieldsHelpers_1.createTestRelatedClassInfo)({
251
+ sourceClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ExternalSourceAspect" }),
252
+ relationshipInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ElementOwnsMultiAspects" }),
253
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "Schema:Class" }),
254
254
  isForwardRelationship: false,
255
255
  isPolymorphicRelationship: true,
256
256
  }),
257
257
  ],
258
258
  });
259
- const result = GroupPropertyUtils_1.convertPresentationFields([nestedSourceAspectField]);
259
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([nestedSourceAspectField]);
260
260
  const expectedResult = [
261
261
  {
262
262
  displayLabel: "Properties Field",
@@ -298,7 +298,7 @@ describe("Group properties utilities", () => {
298
298
  chai_1.assert.deepEqual(result, expectedResult);
299
299
  });
300
300
  it("handle simple structs correctly", () => {
301
- const structPropertyClass = PropertyFieldsHelpers_1.createTestPropertyInfo({ classInfo: { id: "0", label: "", name: "Struct:Class" } });
301
+ const structPropertyClass = (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ classInfo: { id: "0", label: "", name: "Struct:Class" } });
302
302
  const structContentFieldDescription = {
303
303
  valueFormat: presentation_common_1.PropertyValueFormat.Struct,
304
304
  typeName: "StructType",
@@ -311,8 +311,8 @@ describe("Group properties utilities", () => {
311
311
  },
312
312
  }],
313
313
  };
314
- const simpleStructField = PropertyFieldsHelpers_1.createTestPropertiesContentField({ properties: [{ property: structPropertyClass }], type: structContentFieldDescription });
315
- const result = GroupPropertyUtils_1.convertPresentationFields([simpleStructField]);
314
+ const simpleStructField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({ properties: [{ property: structPropertyClass }], type: structContentFieldDescription });
315
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([simpleStructField]);
316
316
  const expectedResult = [
317
317
  {
318
318
  displayLabel: "prop one",
@@ -330,7 +330,7 @@ describe("Group properties utilities", () => {
330
330
  chai_1.assert.deepEqual(result, expectedResult);
331
331
  });
332
332
  it("handle simple nested structs correctly", () => {
333
- const structPropertyClass = PropertyFieldsHelpers_1.createTestPropertyInfo({ classInfo: { id: "0", label: "", name: "Struct:Class" } });
333
+ const structPropertyClass = (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ classInfo: { id: "0", label: "", name: "Struct:Class" } });
334
334
  const structContentFieldDescription = {
335
335
  valueFormat: presentation_common_1.PropertyValueFormat.Struct,
336
336
  typeName: "StructType",
@@ -359,8 +359,8 @@ describe("Group properties utilities", () => {
359
359
  },
360
360
  }],
361
361
  };
362
- const simpleStructField = PropertyFieldsHelpers_1.createTestPropertiesContentField({ properties: [{ property: structPropertyClass }], type: structContentFieldDescription });
363
- const result = GroupPropertyUtils_1.convertPresentationFields([simpleStructField]);
362
+ const simpleStructField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({ properties: [{ property: structPropertyClass }], type: structContentFieldDescription });
363
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([simpleStructField]);
364
364
  const expectedResult = [
365
365
  {
366
366
  displayLabel: "prop one",
@@ -390,18 +390,18 @@ describe("Group properties utilities", () => {
390
390
  chai_1.assert.deepEqual(result, expectedResult);
391
391
  });
392
392
  it("handle primitive navigation (Model)", () => {
393
- const modelClassInfo = PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:Element", label: "Element" });
394
- const navigationClassInfo = PropertyFieldsHelpers_1.createTestECClassInfo({ name: "BisCore:ModelContainsElements", label: "ModelContainsElements" });
393
+ const modelClassInfo = (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:Element", label: "Element" });
394
+ const navigationClassInfo = (0, PropertyFieldsHelpers_1.createTestECClassInfo)({ name: "BisCore:ModelContainsElements", label: "ModelContainsElements" });
395
395
  const navigationPropertyInfo = {
396
396
  classInfo: navigationClassInfo,
397
397
  isForwardRelationship: false,
398
398
  // Target class does not matter
399
- targetClassInfo: PropertyFieldsHelpers_1.createTestECClassInfo(),
399
+ targetClassInfo: (0, PropertyFieldsHelpers_1.createTestECClassInfo)(),
400
400
  isTargetPolymorphic: true,
401
401
  };
402
- const modelPropertyInfo = PropertyFieldsHelpers_1.createTestPropertyInfo({ name: "Model", classInfo: modelClassInfo, type: "long", navigationPropertyInfo });
403
- const simpleModelField = PropertyFieldsHelpers_1.createTestPropertiesContentField({ label: "Model", properties: [{ property: modelPropertyInfo }] });
404
- const result = GroupPropertyUtils_1.convertPresentationFields([simpleModelField]);
402
+ const modelPropertyInfo = (0, PropertyFieldsHelpers_1.createTestPropertyInfo)({ name: "Model", classInfo: modelClassInfo, type: "long", navigationPropertyInfo });
403
+ const simpleModelField = (0, PropertyFieldsHelpers_1.createTestPropertiesContentField)({ label: "Model", properties: [{ property: modelPropertyInfo }] });
404
+ const result = (0, GroupPropertyUtils_1.convertPresentationFields)([simpleModelField]);
405
405
  const expectedResult = [
406
406
  {
407
407
  displayLabel: "Model",
@@ -431,7 +431,7 @@ describe("Group properties utilities", () => {
431
431
  key: "undefined|SchemaName:ClassName|PropertyName",
432
432
  categoryLabel: "Test Category",
433
433
  };
434
- const result = GroupPropertyUtils_1.convertToECProperties(propertyMetaData);
434
+ const result = (0, GroupPropertyUtils_1.convertToECProperties)(propertyMetaData);
435
435
  const expectedResult = [
436
436
  {
437
437
  ecSchemaName: "Schema",
@@ -457,7 +457,7 @@ describe("Group properties utilities", () => {
457
457
  categoryLabel: "Selected Item",
458
458
  parentPropertyClassName: undefined,
459
459
  };
460
- const result = GroupPropertyUtils_1.convertToECProperties(propertyMetaData);
460
+ const result = (0, GroupPropertyUtils_1.convertToECProperties)(propertyMetaData);
461
461
  const expectedResult = [
462
462
  {
463
463
  ecSchemaName: "*",
@@ -489,7 +489,7 @@ describe("Group properties utilities", () => {
489
489
  categoryLabel: "Selected Item",
490
490
  parentPropertyClassName: undefined,
491
491
  };
492
- const result = GroupPropertyUtils_1.convertToECProperties(propertyMetaData);
492
+ const result = (0, GroupPropertyUtils_1.convertToECProperties)(propertyMetaData);
493
493
  const expectedResult = [
494
494
  {
495
495
  ecSchemaName: "*",
@@ -521,7 +521,7 @@ describe("Group properties utilities", () => {
521
521
  categoryLabel: "Selected Item",
522
522
  parentPropertyClassName: undefined,
523
523
  };
524
- const result = GroupPropertyUtils_1.convertToECProperties(propertyMetaData);
524
+ const result = (0, GroupPropertyUtils_1.convertToECProperties)(propertyMetaData);
525
525
  const expectedResult = [
526
526
  {
527
527
  ecSchemaName: "*",
@@ -579,7 +579,7 @@ describe("Group properties utilities", () => {
579
579
  ecPropertyName: "propInt",
580
580
  },
581
581
  ];
582
- const result = GroupPropertyUtils_1.findProperties(ecProperties, propertiesMetaData);
582
+ const result = (0, GroupPropertyUtils_1.findProperties)(ecProperties, propertiesMetaData);
583
583
  chai_1.assert.deepEqual(result, propertiesMetaData);
584
584
  });
585
585
  it("can find properties generated from a single property", () => {
@@ -611,7 +611,7 @@ describe("Group properties utilities", () => {
611
611
  ecPropertyName: "Model.ModeledElement.CodeValue",
612
612
  },
613
613
  ];
614
- const result = GroupPropertyUtils_1.findProperties(ecProperties, propertiesMetaData);
614
+ const result = (0, GroupPropertyUtils_1.findProperties)(ecProperties, propertiesMetaData);
615
615
  chai_1.assert.deepEqual(result, propertiesMetaData);
616
616
  });
617
617
  it("cannot find properties generated from a single property in the wrong order", () => {
@@ -643,8 +643,8 @@ describe("Group properties utilities", () => {
643
643
  ecPropertyName: "Model.ModeledElement.UserLabel",
644
644
  },
645
645
  ];
646
- const result = GroupPropertyUtils_1.findProperties(ecProperties, propertiesMetaData);
647
- chai_1.expect(result).to.be.of.length(0);
646
+ const result = (0, GroupPropertyUtils_1.findProperties)(ecProperties, propertiesMetaData);
647
+ (0, chai_1.expect)(result).to.be.of.length(0);
648
648
  });
649
649
  });
650
650
  //# sourceMappingURL=GroupPropertyUtils.test.js.map