@itwin/presentation-hierarchies 0.2.0 → 0.4.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 (136) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +15 -11
  3. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts +13 -2
  4. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts.map +1 -1
  5. package/lib/cjs/hierarchies/HierarchyDefinition.js +2 -2
  6. package/lib/cjs/hierarchies/HierarchyDefinition.js.map +1 -1
  7. package/lib/cjs/hierarchies/HierarchyNode.d.ts +56 -14
  8. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  10. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +25 -6
  11. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  12. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
  13. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +13 -1
  14. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  15. package/lib/cjs/hierarchies/HierarchyProvider.js +33 -19
  16. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  17. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  18. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js +33 -13
  19. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -1
  20. package/lib/cjs/hierarchies/Logging.js +2 -3
  21. package/lib/cjs/hierarchies/Logging.js.map +1 -1
  22. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts +28 -4
  23. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -1
  24. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js +9 -9
  25. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js.map +1 -1
  26. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -1
  27. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js +3 -3
  28. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -1
  29. package/lib/cjs/hierarchies/internal/Common.d.ts +25 -5
  30. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
  31. package/lib/cjs/hierarchies/internal/Common.js +41 -21
  32. package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
  33. package/lib/cjs/hierarchies/internal/EachValueFrom.js +1 -2
  34. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -1
  35. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts +5 -4
  36. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -1
  37. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js +29 -24
  38. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -1
  39. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +1 -3
  40. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +1 -1
  41. package/lib/cjs/hierarchies/internal/LoggingUtils.js +2 -21
  42. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +1 -1
  43. package/lib/cjs/hierarchies/internal/TreeNodesReader.js +2 -3
  44. package/lib/cjs/hierarchies/internal/TreeNodesReader.js.map +1 -1
  45. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -1
  46. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js +3 -3
  47. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js.map +1 -1
  48. package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts.map +1 -1
  49. package/lib/cjs/hierarchies/internal/operators/Grouping.js +13 -12
  50. package/lib/cjs/hierarchies/internal/operators/Grouping.js.map +1 -1
  51. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -1
  52. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js +3 -3
  53. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -1
  54. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -1
  55. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js +3 -3
  56. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -1
  57. package/lib/cjs/hierarchies/internal/operators/Partition.js +1 -2
  58. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +1 -1
  59. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  60. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +2 -3
  61. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -1
  62. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -1
  63. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +1 -2
  64. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -1
  65. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +1 -2
  66. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -1
  67. package/lib/cjs/hierarchies/internal/operators/Sorting.js +1 -2
  68. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
  69. package/lib/cjs/hierarchies/internal/operators/TapOnce.js +1 -2
  70. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +1 -1
  71. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js +1 -2
  72. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js.map +1 -1
  73. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js +3 -4
  74. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +1 -1
  75. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js +1 -2
  76. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js.map +1 -1
  77. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js +1 -2
  78. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js.map +1 -1
  79. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js +1 -2
  80. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js.map +1 -1
  81. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js +7 -8
  82. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -1
  83. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js +1 -2
  84. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js.map +1 -1
  85. package/lib/esm/hierarchies/HierarchyDefinition.d.ts +13 -2
  86. package/lib/esm/hierarchies/HierarchyDefinition.d.ts.map +1 -1
  87. package/lib/esm/hierarchies/HierarchyDefinition.js.map +1 -1
  88. package/lib/esm/hierarchies/HierarchyNode.d.ts +56 -14
  89. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  90. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  91. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +25 -6
  92. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  93. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
  94. package/lib/esm/hierarchies/HierarchyProvider.d.ts +13 -1
  95. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  96. package/lib/esm/hierarchies/HierarchyProvider.js +34 -19
  97. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  98. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  99. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js +35 -14
  100. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -1
  101. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts +28 -4
  102. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -1
  103. package/lib/esm/hierarchies/NodeSelectQueryFactory.js +7 -7
  104. package/lib/esm/hierarchies/NodeSelectQueryFactory.js.map +1 -1
  105. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -1
  106. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js +3 -3
  107. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -1
  108. package/lib/esm/hierarchies/internal/Common.d.ts +25 -5
  109. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
  110. package/lib/esm/hierarchies/internal/Common.js +35 -15
  111. package/lib/esm/hierarchies/internal/Common.js.map +1 -1
  112. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts +5 -4
  113. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -1
  114. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js +27 -22
  115. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -1
  116. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +1 -3
  117. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +1 -1
  118. package/lib/esm/hierarchies/internal/LoggingUtils.js +0 -17
  119. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +1 -1
  120. package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -1
  121. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js +2 -2
  122. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js.map +1 -1
  123. package/lib/esm/hierarchies/internal/operators/Grouping.d.ts.map +1 -1
  124. package/lib/esm/hierarchies/internal/operators/Grouping.js +11 -10
  125. package/lib/esm/hierarchies/internal/operators/Grouping.js.map +1 -1
  126. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -1
  127. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js +2 -2
  128. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -1
  129. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -1
  130. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js +2 -2
  131. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -1
  132. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  133. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -1
  134. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js +2 -2
  135. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -1
  136. package/package.json +16 -13
@@ -4,9 +4,9 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createQueryLogMessage = exports.log = exports.doLog = void 0;
7
+ exports.doLog = doLog;
8
+ exports.log = log;
8
9
  const rxjs_1 = require("rxjs");
9
- const presentation_shared_1 = require("@itwin/presentation-shared");
10
10
  const Logging_1 = require("../Logging");
11
11
  /** @internal */
12
12
  function doLog(props) {
@@ -18,7 +18,6 @@ function doLog(props) {
18
18
  const logFunc = getLogFunc(logger, severity);
19
19
  logFunc(props.category, props.message());
20
20
  }
21
- exports.doLog = doLog;
22
21
  function getLogFunc(logger, severity) {
23
22
  switch (severity) {
24
23
  case "error":
@@ -35,22 +34,4 @@ function getLogFunc(logger, severity) {
35
34
  function log(props) {
36
35
  return (0, rxjs_1.tap)((n) => doLog({ ...props, message: () => props.message(n) }));
37
36
  }
38
- exports.log = log;
39
- /** @internal */
40
- // istanbul ignore next
41
- function createQueryLogMessage(query) {
42
- const ctes = query.ctes?.map((cte) => ` ${(0, presentation_shared_1.trimWhitespace)(cte)}`).join(", \n");
43
- const bindings = query.bindings?.map((b) => JSON.stringify(b.value)).join(", ");
44
- let output = "{\n";
45
- if (ctes) {
46
- output += ` ctes: [ \n${ctes} \n], \n`;
47
- }
48
- output += ` ecsql: ${(0, presentation_shared_1.trimWhitespace)(query.ecsql)}, \n`;
49
- if (bindings) {
50
- output += ` bindings: [${bindings}], \n`;
51
- }
52
- output += "}";
53
- return output;
54
- }
55
- exports.createQueryLogMessage = createQueryLogMessage;
56
37
  //# sourceMappingURL=LoggingUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoggingUtils.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/LoggingUtils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAA2B;AAC3B,oEAA8F;AAC9F,wCAAuC;AASvC,gBAAgB;AAChB,SAAgB,KAAK,CAAC,KAAsB;IAC1C,MAAM,MAAM,GAAG,IAAA,mBAAS,GAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QAChD,OAAO;IACT,CAAC;IACD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3C,CAAC;AARD,sBAQC;AAED,SAAS,UAAU,CAAC,MAAe,EAAE,QAAkB;IACrD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED,gBAAgB;AAChB,SAAgB,GAAG,CAAc,KAAmC;IAClE,OAAO,IAAA,UAAG,EAAc,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvF,CAAC;AAFD,kBAEC;AAED,gBAAgB;AAChB,uBAAuB;AACvB,SAAgB,qBAAqB,CAAC,KAAoB;IACxD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,IAAA,oCAAc,EAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChF,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,eAAe,IAAI,UAAU,CAAC;IAC1C,CAAC;IACD,MAAM,IAAI,YAAY,IAAA,oCAAc,EAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;IACxD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,gBAAgB,QAAQ,OAAO,CAAC;IAC5C,CAAC;IACD,MAAM,IAAI,GAAG,CAAC;IACd,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,sDAaC","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\nimport { tap } from \"rxjs\";\nimport { ECSqlQueryDef, ILogger, LogLevel, trimWhitespace } from \"@itwin/presentation-shared\";\nimport { getLogger } from \"../Logging\";\n\n/** @internal */\nexport interface LogMessageProps<TMessageArg = void> {\n category: string;\n severity?: LogLevel;\n message: (arg: TMessageArg) => string;\n}\n\n/** @internal */\nexport function doLog(props: LogMessageProps) {\n const logger = getLogger();\n const severity = props.severity ?? \"trace\";\n if (!logger.isEnabled(props.category, severity)) {\n return;\n }\n const logFunc = getLogFunc(logger, severity);\n logFunc(props.category, props.message());\n}\n\nfunction getLogFunc(logger: ILogger, severity: LogLevel) {\n switch (severity) {\n case \"error\":\n return logger.logError.bind(logger);\n case \"warning\":\n return logger.logWarning.bind(logger);\n case \"info\":\n return logger.logInfo.bind(logger);\n case \"trace\":\n return logger.logTrace.bind(logger);\n }\n}\n\n/** @internal */\nexport function log<TMessageArg>(props: LogMessageProps<TMessageArg>) {\n return tap<TMessageArg>((n) => doLog({ ...props, message: () => props.message(n) }));\n}\n\n/** @internal */\n// istanbul ignore next\nexport function createQueryLogMessage(query: ECSqlQueryDef): string {\n const ctes = query.ctes?.map((cte) => ` ${trimWhitespace(cte)}`).join(\", \\n\");\n const bindings = query.bindings?.map((b) => JSON.stringify(b.value)).join(\", \");\n let output = \"{\\n\";\n if (ctes) {\n output += ` ctes: [ \\n${ctes} \\n], \\n`;\n }\n output += ` ecsql: ${trimWhitespace(query.ecsql)}, \\n`;\n if (bindings) {\n output += ` bindings: [${bindings}], \\n`;\n }\n output += \"}\";\n return output;\n}\n"]}
1
+ {"version":3,"file":"LoggingUtils.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/LoggingUtils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAchG,sBAQC;AAgBD,kBAEC;AAtCD,+BAA2B;AAE3B,wCAAuC;AASvC,gBAAgB;AAChB,SAAgB,KAAK,CAAC,KAAsB;IAC1C,MAAM,MAAM,GAAG,IAAA,mBAAS,GAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QAChD,OAAO;IACT,CAAC;IACD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,UAAU,CAAC,MAAe,EAAE,QAAkB;IACrD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED,gBAAgB;AAChB,SAAgB,GAAG,CAAc,KAAmC;IAClE,OAAO,IAAA,UAAG,EAAc,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvF,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 *--------------------------------------------------------------------------------------------*/\n\nimport { tap } from \"rxjs\";\nimport { ILogger, LogLevel } from \"@itwin/presentation-shared\";\nimport { getLogger } from \"../Logging\";\n\n/** @internal */\nexport interface LogMessageProps<TMessageArg = void> {\n category: string;\n severity?: LogLevel;\n message: (arg: TMessageArg) => string;\n}\n\n/** @internal */\nexport function doLog(props: LogMessageProps) {\n const logger = getLogger();\n const severity = props.severity ?? \"trace\";\n if (!logger.isEnabled(props.category, severity)) {\n return;\n }\n const logFunc = getLogFunc(logger, severity);\n logFunc(props.category, props.message());\n}\n\nfunction getLogFunc(logger: ILogger, severity: LogLevel) {\n switch (severity) {\n case \"error\":\n return logger.logError.bind(logger);\n case \"warning\":\n return logger.logWarning.bind(logger);\n case \"info\":\n return logger.logInfo.bind(logger);\n case \"trace\":\n return logger.logTrace.bind(logger);\n }\n}\n\n/** @internal */\nexport function log<TMessageArg>(props: LogMessageProps<TMessageArg>) {\n return tap<TMessageArg>((n) => doLog({ ...props, message: () => props.message(n) }));\n}\n"]}
@@ -4,7 +4,8 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.defaultNodesParser = exports.readNodes = void 0;
7
+ exports.readNodes = readNodes;
8
+ exports.defaultNodesParser = defaultNodesParser;
8
9
  const rxjs_1 = require("rxjs");
9
10
  const presentation_shared_1 = require("@itwin/presentation-shared");
10
11
  const NodeSelectQueryFactory_1 = require("../NodeSelectQueryFactory");
@@ -18,7 +19,6 @@ function readNodes(props) {
18
19
  };
19
20
  return (0, rxjs_1.from)(queryExecutor.createQueryReader(query, config)).pipe((0, rxjs_1.map)(parser));
20
21
  }
21
- exports.readNodes = readNodes;
22
22
  /* eslint-enable @typescript-eslint/naming-convention */
23
23
  /** @internal */
24
24
  function defaultNodesParser(row) {
@@ -42,5 +42,4 @@ function defaultNodesParser(row) {
42
42
  ...(Object.keys(processingParams).length > 0 ? { processingParams } : undefined),
43
43
  };
44
44
  }
45
- exports.defaultNodesParser = defaultNodesParser;
46
45
  //# sourceMappingURL=TreeNodesReader.js.map
@@ -1 +1 @@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AAO;QACL,8HAA8H;QAC9H,KAAK,EAAE,IAAA,wCAAkB,EAAC,QAAQ,CAAC,YAAY,CAAC;QAChD,GAAG,EAAE;YACH,IAAI,EAAE,WAAW;YACjB,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC;SACnG;QACD,GAAG,CAAC,QAAQ,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1F,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5F,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACjF,CAAC;AACJ,CAAC;AApBD,gDAoBC","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\nimport { from, map, Observable } from \"rxjs\";\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ECSqlQueryDef, parseInstanceLabel } from \"@itwin/presentation-shared\";\nimport { NodeParser } from \"../HierarchyDefinition\";\nimport { InstanceHierarchyNodeProcessingParams, ParsedHierarchyNode, ParsedInstanceHierarchyNode } from \"../HierarchyNode\";\nimport { LimitingECSqlQueryExecutor } from \"../LimitingECSqlQueryExecutor\";\nimport { NodeSelectClauseColumnNames } from \"../NodeSelectQueryFactory\";\n\ninterface ReadNodesProps {\n queryExecutor: LimitingECSqlQueryExecutor;\n query: ECSqlQueryDef;\n limit?: number | \"unbounded\";\n parser?: NodeParser;\n}\n\n/** @internal */\nexport function readNodes(props: ReadNodesProps): Observable<ParsedHierarchyNode> {\n const { queryExecutor, query, limit } = props;\n const parser = props?.parser ?? defaultNodesParser;\n const config: Parameters<LimitingECSqlQueryExecutor[\"createQueryReader\"]>[1] = {\n rowFormat: \"ECSqlPropertyNames\",\n ...(limit !== undefined ? { limit } : undefined),\n };\n return from(queryExecutor.createQueryReader(query, config)).pipe(map(parser));\n}\n\n/**\n * The interface should contain a member for each `NodeSelectClauseColumnNames` value.\n * @internal\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nexport interface RowDef {\n [NodeSelectClauseColumnNames.FullClassName]: string;\n [NodeSelectClauseColumnNames.ECInstanceId]: Id64String;\n [NodeSelectClauseColumnNames.DisplayLabel]: string;\n [NodeSelectClauseColumnNames.HasChildren]?: boolean;\n [NodeSelectClauseColumnNames.HideIfNoChildren]?: boolean;\n [NodeSelectClauseColumnNames.HideNodeInHierarchy]?: boolean;\n [NodeSelectClauseColumnNames.Grouping]?: string;\n [NodeSelectClauseColumnNames.ExtendedData]?: string;\n [NodeSelectClauseColumnNames.AutoExpand]?: boolean;\n [NodeSelectClauseColumnNames.SupportsFiltering]?: boolean;\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/** @internal */\nexport function defaultNodesParser(row: { [columnName: string]: any }): ParsedInstanceHierarchyNode {\n const typedRow = row as RowDef;\n const processingParams: InstanceHierarchyNodeProcessingParams = {\n ...(typedRow.HideIfNoChildren ? { hideIfNoChildren: true } : undefined),\n ...(typedRow.HideNodeInHierarchy ? { hideInHierarchy: true } : undefined),\n ...(typedRow.Grouping ? { grouping: JSON.parse(typedRow.Grouping) } : undefined),\n };\n return {\n // don't format the label here - we're going to do that at node pre-processing step to handle both - instance and custom nodes\n label: parseInstanceLabel(typedRow.DisplayLabel),\n key: {\n type: \"instances\",\n instanceKeys: [{ className: typedRow.FullClassName.replace(\":\", \".\"), id: typedRow.ECInstanceId }],\n },\n ...(typedRow.HasChildren !== undefined ? { children: !!typedRow.HasChildren } : undefined),\n ...(typedRow.AutoExpand ? { autoExpand: true } : undefined),\n ...(typedRow.SupportsFiltering ? { supportsFiltering: true } : undefined),\n ...(typedRow.ExtendedData ? { extendedData: JSON.parse(typedRow.ExtendedData) } : undefined),\n ...(Object.keys(processingParams).length > 0 ? { processingParams } : undefined),\n };\n}\n"]}
1
+ {"version":3,"file":"TreeNodesReader.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/TreeNodesReader.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAkBhG,8BAQC;AAsBD,gDAoBC;AAlED,+BAA6C;AAE7C,oEAA+E;AAI/E,sEAAwE;AASxE,gBAAgB;AAChB,SAAgB,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC9C,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,kBAAkB,CAAC;IACnD,MAAM,MAAM,GAAmE;QAC7E,SAAS,EAAE,oBAAoB;QAC/B,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACjD,CAAC;IACF,OAAO,IAAA,WAAI,EAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,UAAG,EAAC,MAAM,CAAC,CAAC,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AAS,CAAC;QACzE,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5F,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACjF,CAAC;AACJ,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 *--------------------------------------------------------------------------------------------*/\n\nimport { from, map, Observable } from \"rxjs\";\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ECSqlQueryDef, parseInstanceLabel } from \"@itwin/presentation-shared\";\nimport { NodeParser } from \"../HierarchyDefinition\";\nimport { InstanceHierarchyNodeProcessingParams, ParsedHierarchyNode, ParsedInstanceHierarchyNode } from \"../HierarchyNode\";\nimport { LimitingECSqlQueryExecutor } from \"../LimitingECSqlQueryExecutor\";\nimport { NodeSelectClauseColumnNames } from \"../NodeSelectQueryFactory\";\n\ninterface ReadNodesProps {\n queryExecutor: LimitingECSqlQueryExecutor;\n query: ECSqlQueryDef;\n limit?: number | \"unbounded\";\n parser?: NodeParser;\n}\n\n/** @internal */\nexport function readNodes(props: ReadNodesProps): Observable<ParsedHierarchyNode> {\n const { queryExecutor, query, limit } = props;\n const parser = props?.parser ?? defaultNodesParser;\n const config: Parameters<LimitingECSqlQueryExecutor[\"createQueryReader\"]>[1] = {\n rowFormat: \"ECSqlPropertyNames\",\n ...(limit !== undefined ? { limit } : undefined),\n };\n return from(queryExecutor.createQueryReader(query, config)).pipe(map(parser));\n}\n\n/**\n * The interface should contain a member for each `NodeSelectClauseColumnNames` value.\n * @internal\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nexport interface RowDef {\n [NodeSelectClauseColumnNames.FullClassName]: string;\n [NodeSelectClauseColumnNames.ECInstanceId]: Id64String;\n [NodeSelectClauseColumnNames.DisplayLabel]: string;\n [NodeSelectClauseColumnNames.HasChildren]?: boolean;\n [NodeSelectClauseColumnNames.HideIfNoChildren]?: boolean;\n [NodeSelectClauseColumnNames.HideNodeInHierarchy]?: boolean;\n [NodeSelectClauseColumnNames.Grouping]?: string;\n [NodeSelectClauseColumnNames.ExtendedData]?: string;\n [NodeSelectClauseColumnNames.AutoExpand]?: boolean;\n [NodeSelectClauseColumnNames.SupportsFiltering]?: boolean;\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/** @internal */\nexport function defaultNodesParser(row: { [columnName: string]: any }): ParsedInstanceHierarchyNode {\n const typedRow = row as RowDef;\n const processingParams: InstanceHierarchyNodeProcessingParams = {\n ...(typedRow.HideIfNoChildren ? { hideIfNoChildren: true } : undefined),\n ...(typedRow.HideNodeInHierarchy ? { hideInHierarchy: true } : undefined),\n ...(typedRow.Grouping ? { grouping: JSON.parse(typedRow.Grouping) } : undefined),\n };\n return {\n // don't format the label here - we're going to do that at node pre-processing step to handle both - instance and custom nodes\n label: parseInstanceLabel(typedRow.DisplayLabel),\n key: {\n type: \"instances\",\n instanceKeys: [{ className: typedRow.FullClassName.replace(\":\", \".\"), id: typedRow.ECInstanceId }],\n },\n ...(typedRow.HasChildren !== undefined ? { children: !!typedRow.HasChildren } : undefined),\n ...(typedRow.AutoExpand ? { autoExpand: true } : undefined),\n ...(typedRow.SupportsFiltering ? { supportsFiltering: true } : undefined),\n ...(typedRow.ExtendedData ? { extendedData: JSON.parse(typedRow.ExtendedData) } : undefined),\n ...(Object.keys(processingParams).length > 0 ? { processingParams } : undefined),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DetermineChildren.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/DetermineChildren.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,UAAU,EAAM,MAAM,MAAM,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAAgD,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,UAAU,CAAC,OAAO,CAAC,WACrF,WAAW,sBAAsB,CAAC,KAAG,WAAW,sBAAsB,CAAC,CAmBhG"}
1
+ {"version":3,"file":"DetermineChildren.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/DetermineChildren.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,UAAU,EAAM,MAAM,MAAM,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAA4E,CAAC;AAE3G;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,UAAU,CAAC,OAAO,CAAC,WACrF,UAAU,CAAC,sBAAsB,CAAC,KAAG,UAAU,CAAC,sBAAsB,CAAC,CAmBhG"}
@@ -4,14 +4,15 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createDetermineChildrenOperator = exports.LOGGING_NAMESPACE = void 0;
7
+ exports.LOGGING_NAMESPACE = void 0;
8
+ exports.createDetermineChildrenOperator = createDetermineChildrenOperator;
8
9
  const rxjs_1 = require("rxjs");
9
10
  const Common_1 = require("../Common");
10
11
  const LoggingUtils_1 = require("../LoggingUtils");
11
12
  const ReleaseMainThread_1 = require("./ReleaseMainThread");
12
13
  const OPERATOR_NAME = "DetermineChildren";
13
14
  /** @internal */
14
- exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME);
15
+ exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME, Common_1.LOGGING_NAMESPACE_INTERNAL);
15
16
  /**
16
17
  * Ensures all input nodes have their children determined.
17
18
  *
@@ -30,5 +31,4 @@ function createDetermineChildrenOperator(hasNodes) {
30
31
  }), (0, LoggingUtils_1.log)({ category: exports.LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${(0, Common_1.createNodeIdentifierForLogging)(n)}` }));
31
32
  };
32
33
  }
33
- exports.createDetermineChildrenOperator = createDetermineChildrenOperator;
34
34
  //# sourceMappingURL=DetermineChildren.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetermineChildren.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/DetermineChildren.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAAsD;AAEtD,sCAA2F;AAC3F,kDAAsC;AACtC,2DAAoE;AAEpE,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAC1C,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,CAAC,CAAC;AAE/E;;;;GAIG;AACH,SAAgB,+BAA+B,CAAC,QAA+D;IAC7G,OAAO,UAAU,KAAyC;QACxD,OAAO,KAAK,CAAC,IAAI,CACf,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAC3H,IAAA,iDAA6B,EAAC,GAAG,CAAC,EAClC,IAAA,gBAAS,EAAC,CAAC,CAAyB,EAAsC,EAAE;YAC1E,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC7B,OAAO,IAAA,SAAE,EAAC,CAAC,CAAC,CAAC;YACf,CAAC;YACD,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CACrB,IAAA,kBAAG,EAAC;gBACF,QAAQ,EAAE,yBAAiB;gBAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,IAAA,uCAA8B,EAAC,CAAC,CAAC,0BAA0B,eAAe,EAAE;aACzI,CAAC,EACF,IAAA,UAAG,EAAC,CAAC,eAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC,CAC1E,CAAC;QACJ,CAAC,CAAC,EACF,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC7H,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AApBD,0EAoBC","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\nimport { concatMap, map, Observable, of } from \"rxjs\";\nimport { ProcessedHierarchyNode } from \"../../HierarchyNode\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace } from \"../Common\";\nimport { log } from \"../LoggingUtils\";\nimport { releaseMainThreadOnItemsCount } from \"./ReleaseMainThread\";\n\nconst OPERATOR_NAME = \"DetermineChildren\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\n\n/**\n * Ensures all input nodes have their children determined.\n *\n * @internal\n */\nexport function createDetermineChildrenOperator(hasNodes: (node: ProcessedHierarchyNode) => Observable<boolean>) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n return nodes.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }),\n releaseMainThreadOnItemsCount(200),\n concatMap((n: ProcessedHierarchyNode): Observable<ProcessedHierarchyNode> => {\n if (n.children !== undefined) {\n return of(n);\n }\n return hasNodes(n).pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (hasChildrenFlag) => `${createNodeIdentifierForLogging(n)}: determined children: ${hasChildrenFlag}`,\n }),\n map((hasChildrenFlag) => Object.assign(n, { children: hasChildrenFlag })),\n );\n }),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }),\n );\n };\n}\n"]}
1
+ {"version":3,"file":"DetermineChildren.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/DetermineChildren.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAiBhG,0EAoBC;AAnCD,+BAAsD;AAEtD,sCAAuH;AACvH,kDAAsC;AACtC,2DAAoE;AAEpE,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAC1C,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,EAAE,mCAA0B,CAAC,CAAC;AAE3G;;;;GAIG;AACH,SAAgB,+BAA+B,CAAC,QAA+D;IAC7G,OAAO,UAAU,KAAyC;QACxD,OAAO,KAAK,CAAC,IAAI,CACf,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAC3H,IAAA,iDAA6B,EAAC,GAAG,CAAC,EAClC,IAAA,gBAAS,EAAC,CAAC,CAAyB,EAAsC,EAAE;YAC1E,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC7B,OAAO,IAAA,SAAE,EAAC,CAAC,CAAC,CAAC;YACf,CAAC;YACD,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CACrB,IAAA,kBAAG,EAAC;gBACF,QAAQ,EAAE,yBAAiB;gBAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,IAAA,uCAA8B,EAAC,CAAC,CAAC,0BAA0B,eAAe,EAAE;aACzI,CAAC,EACF,IAAA,UAAG,EAAC,CAAC,eAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC,CAC1E,CAAC;QACJ,CAAC,CAAC,EACF,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC7H,CAAC;IACJ,CAAC,CAAC;AACJ,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 *--------------------------------------------------------------------------------------------*/\n\nimport { concatMap, map, Observable, of } from \"rxjs\";\nimport { ProcessedHierarchyNode } from \"../../HierarchyNode\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, LOGGING_NAMESPACE_INTERNAL } from \"../Common\";\nimport { log } from \"../LoggingUtils\";\nimport { releaseMainThreadOnItemsCount } from \"./ReleaseMainThread\";\n\nconst OPERATOR_NAME = \"DetermineChildren\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME, LOGGING_NAMESPACE_INTERNAL);\n\n/**\n * Ensures all input nodes have their children determined.\n *\n * @internal\n */\nexport function createDetermineChildrenOperator(hasNodes: (node: ProcessedHierarchyNode) => Observable<boolean>) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n return nodes.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }),\n releaseMainThreadOnItemsCount(200),\n concatMap((n: ProcessedHierarchyNode): Observable<ProcessedHierarchyNode> => {\n if (n.children !== undefined) {\n return of(n);\n }\n return hasNodes(n).pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (hasChildrenFlag) => `${createNodeIdentifierForLogging(n)}: determined children: ${hasChildrenFlag}`,\n }),\n map((hasChildrenFlag) => Object.assign(n, { children: hasChildrenFlag })),\n );\n }),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }),\n );\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Grouping.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/Grouping.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuF,UAAU,EAA4B,MAAM,MAAM,CAAC;AAEjJ,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnH,OAAO,EAEL,mBAAmB,EACnB,8BAA8B,EAC9B,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAAoC,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AAKrH,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAAgD,CAAC;AAG/E,gBAAgB;AAChB,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,EAC1D,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,cAAc,EAAE,wBAAwB,EACxC,gBAAgB,EAAE,kCAAkC,EACpD,qBAAqB,CAAC,EAAE,CAAC,YAAY,EAAE,8BAA8B,KAAK,IAAI,EAC9E,gBAAgB,CAAC,EAAE,eAAe,EAAE,WAEZ,WAAW,sBAAsB,CAAC,KAAG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,UAAU,CAAC,eAAe,CAAC,CA+B7B"}
@@ -4,7 +4,9 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createGroupingHandlers = exports.createGroupingOperator = exports.LOGGING_NAMESPACE = void 0;
7
+ exports.LOGGING_NAMESPACE = void 0;
8
+ exports.createGroupingOperator = createGroupingOperator;
9
+ exports.createGroupingHandlers = createGroupingHandlers;
8
10
  const rxjs_1 = require("rxjs");
9
11
  const core_bentley_1 = require("@itwin/core-bentley");
10
12
  const HierarchyNode_1 = require("../../HierarchyNode");
@@ -21,13 +23,14 @@ const TapOnce_1 = require("./TapOnce");
21
23
  const OPERATOR_NAME = "Grouping";
22
24
  /** @internal */
23
25
  exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME);
24
- const PERF_LOGGING_NAMESPACE = `${exports.LOGGING_NAMESPACE}.Performance`;
26
+ const LOGGING_NAMESPACE_PERFORMANCE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME, Common_1.LOGGING_NAMESPACE_PERFORMANCE);
27
+ const LOGGING_NAMESPACE_PERFORMANCE_INTERNAL = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME, Common_1.LOGGING_NAMESPACE_PERFORMANCE_INTERNAL);
25
28
  /** @internal */
26
29
  function createGroupingOperator(imodelAccess, parentNode, valueFormatter, localizedStrings, onGroupingNodeCreated, groupingHandlers) {
27
30
  return function (nodes) {
28
31
  return nodes.pipe((0, LoggingUtils_1.log)({ category: exports.LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${(0, Common_1.createNodeIdentifierForLogging)(n)}` }), (0, TapOnce_1.tapOnce)(() => {
29
32
  (0, LoggingUtils_1.doLog)({
30
- category: PERF_LOGGING_NAMESPACE,
33
+ category: LOGGING_NAMESPACE_PERFORMANCE,
31
34
  message: /* istanbul ignore next */ () => `Starting grouping (parent: ${(0, Common_1.createNodeIdentifierForLogging)(parentNode)})`,
32
35
  });
33
36
  }), (0, rxjs_1.reduce)((resolvedNodes, node) => {
@@ -40,7 +43,7 @@ function createGroupingOperator(imodelAccess, parentNode, valueFormatter, locali
40
43
  return resolvedNodes;
41
44
  }, { instanceNodes: [], restNodes: [] }), (0, rxjs_1.tap)(({ instanceNodes, restNodes }) => {
42
45
  (0, LoggingUtils_1.doLog)({
43
- category: PERF_LOGGING_NAMESPACE,
46
+ category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,
44
47
  message: /* istanbul ignore next */ () => `Nodes partitioned. Got ${instanceNodes.length} instance nodes and ${restNodes.length} rest nodes.`,
45
48
  });
46
49
  }), (0, rxjs_1.mergeMap)((res) => {
@@ -55,14 +58,13 @@ function createGroupingOperator(imodelAccess, parentNode, valueFormatter, locali
55
58
  : createGroupingHandlers(imodelAccess, parentNode, instanceNodes, valueFormatter, localizedStrings);
56
59
  return (0, rxjs_1.merge)(groupingHandlersObs.pipe((0, rxjs_1.toArray)(), (0, rxjs_1.mergeMap)((createdGroupingHandlers) => groupInstanceNodes(instanceNodes, restNodes.length, createdGroupingHandlers, parentNode, onGroupingNodeCreated)), (0, rxjs_1.finalize)(() => {
57
60
  (0, LoggingUtils_1.doLog)({
58
- category: PERF_LOGGING_NAMESPACE,
61
+ category: LOGGING_NAMESPACE_PERFORMANCE,
59
62
  message: /* istanbul ignore next */ () => `Grouping ${instanceNodes.length} nodes took ${timer.elapsedSeconds.toFixed(3)} s`,
60
63
  });
61
64
  })), (0, rxjs_1.from)(restNodes));
62
65
  }), (0, ReleaseMainThread_1.releaseMainThreadOnItemsCount)(500), (0, LoggingUtils_1.log)({ category: exports.LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${(0, Common_1.createNodeIdentifierForLogging)(n)}` }));
63
66
  };
64
67
  }
65
- exports.createGroupingOperator = createGroupingOperator;
66
68
  function groupInstanceNodes(nodes, extraSiblings, groupingHandlers, parentNode, onGroupingNodeCreated) {
67
69
  if (groupingHandlers.length === 0) {
68
70
  return (0, rxjs_1.from)(nodes);
@@ -74,7 +76,7 @@ function groupInstanceNodes(nodes, extraSiblings, groupingHandlers, parentNode,
74
76
  const timer = new core_bentley_1.StopWatch(undefined, true);
75
77
  const currentHandler = groupingHandlers[handlerIndex];
76
78
  return (0, rxjs_1.from)(currentHandler(curr?.ungrouped ?? nodes, curr?.grouped ?? [])).pipe((0, LoggingUtils_1.log)({
77
- category: PERF_LOGGING_NAMESPACE,
79
+ category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,
78
80
  message: /* istanbul ignore next */ () => `Grouping handler ${handlerIndex} exclusively took ${timer.elapsedSeconds.toFixed(3)} s.`,
79
81
  }), (0, rxjs_1.mergeMap)((result) => {
80
82
  if (result.grouped.length === 0) {
@@ -82,11 +84,11 @@ function groupInstanceNodes(nodes, extraSiblings, groupingHandlers, parentNode,
82
84
  }
83
85
  const groupingPostProcessingTimer = new core_bentley_1.StopWatch(undefined, true);
84
86
  return (0, rxjs_1.of)(result).pipe((0, rxjs_1.map)((r) => (0, GroupHiding_1.applyGroupHidingParams)(r, extraSiblings)), (0, rxjs_1.map)((r) => (0, AutoExpand_1.assignAutoExpand)(r)), (0, rxjs_1.map)((r) => ({ handlerIndex: handlerIndex + 1, result: { ...r, grouped: mergeInPlace(curr?.grouped, r.grouped) } })), (0, LoggingUtils_1.log)({
85
- category: PERF_LOGGING_NAMESPACE,
87
+ category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,
86
88
  message: /* istanbul ignore next */ () => `Post-processing grouping handler ${handlerIndex} exclusively took ${groupingPostProcessingTimer.elapsedSeconds.toFixed(3)} s.`,
87
89
  }), (0, rxjs_1.delay)(0));
88
90
  }), (0, LoggingUtils_1.log)({
89
- category: PERF_LOGGING_NAMESPACE,
91
+ category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,
90
92
  message: /* istanbul ignore next */ () => `Total time for grouping handler ${handlerIndex}: ${timer.elapsedSeconds.toFixed(3)} s.`,
91
93
  }));
92
94
  }), (0, rxjs_1.last)(), (0, rxjs_1.mergeMap)(({ result }) => {
@@ -126,19 +128,18 @@ function createGroupingHandlers(imodelAccess, parentNode, processedInstanceNodes
126
128
  : rxjs_1.EMPTY, groupingLevel < GroupingLevel.Label ? (0, rxjs_1.of)(async (allNodes) => (0, LabelGrouping_1.createLabelGroups)(allNodes)) : rxjs_1.EMPTY).pipe((0, rxjs_1.tap)({
127
129
  subscribe: () => {
128
130
  (0, LoggingUtils_1.doLog)({
129
- category: PERF_LOGGING_NAMESPACE,
131
+ category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,
130
132
  message: /* istanbul ignore next */ () => `Start creating grouping handlers`,
131
133
  });
132
134
  timer.start();
133
135
  },
134
136
  }), (0, rxjs_1.finalize)(() => {
135
137
  (0, LoggingUtils_1.doLog)({
136
- category: PERF_LOGGING_NAMESPACE,
138
+ category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,
137
139
  message: /* istanbul ignore next */ () => `Creating grouping handlers took ${timer.elapsedSeconds.toFixed(3)} s`,
138
140
  });
139
141
  }));
140
142
  }
141
- exports.createGroupingHandlers = createGroupingHandlers;
142
143
  function getNodeGroupingLevel(node) {
143
144
  if (node && HierarchyNode_1.HierarchyNode.isClassGroupingNode(node)) {
144
145
  return GroupingLevel.Class;
@@ -1 +1 @@
1
- {"version":3,"file":"Grouping.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/Grouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAAiJ;AACjJ,sDAAwD;AAExD,uDAM6B;AAC7B,sCAA2F;AAC3F,kDAA6C;AAC7C,sDAAyD;AACzD,oEAA+E;AAC/E,4DAA6D;AAC7D,wDAAgE;AAChE,4DAA6D;AAC7D,sEAAqH;AACrH,2DAAoE;AACpE,uCAAoC;AAEpC,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,gBAAgB;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AAC;QAChB,CAAC;KACF,CAAC,EACF,IAAA,eAAQ,EAAC,GAAG,EAAE;QACZ,IAAA,oBAAK,EAAC;YACJ,QAAQ,EAAE,sBAAsB;YAChC,OAAO,EAAE,0BAA0B,CAAC,GAAG,EAAE,CAAC,mCAAmC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;SACjH,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AArCD,wDAqCC;AAED,SAAS,oBAAoB,CAAC,IAAqC;IACjE,IAAI,IAAI,IAAI,6BAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,IAAI,IAAI,IAAI,6BAAa,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,OAAO,aAAa,CAAC,QAAQ,CAAC;IAChC,CAAC;IACD,IAAI,IAAI,IAAI,6BAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,OAAO,aAAa,CAAC,IAAI,CAAC;AAC5B,CAAC;AAED,IAAK,aAKJ;AALD,WAAK,aAAa;IAChB,iDAAQ,CAAA;IACR,mDAAS,CAAA;IACT,yDAAY,CAAA;IACZ,mDAAS,CAAA;AACX,CAAC,EALI,aAAa,KAAb,aAAa,QAKjB","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\nimport { concat, concatAll, delay, EMPTY, expand, finalize, from, last, map, merge, mergeMap, Observable, of, reduce, tap, toArray } from \"rxjs\";\nimport { assert, StopWatch } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, ECSchemaProvider, IPrimitiveValueFormatter } from \"@itwin/presentation-shared\";\nimport {\n HierarchyNode,\n ParentHierarchyNode,\n ProcessedGroupingHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n} from \"../../HierarchyNode\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { assignAutoExpand } from \"./grouping/AutoExpand\";\nimport { createBaseClassGroupingHandlers } from \"./grouping/BaseClassGrouping\";\nimport { createClassGroups } from \"./grouping/ClassGrouping\";\nimport { applyGroupHidingParams } from \"./grouping/GroupHiding\";\nimport { createLabelGroups } from \"./grouping/LabelGrouping\";\nimport { createPropertiesGroupingHandlers, PropertiesGroupingLocalizedStrings } from \"./grouping/PropertiesGrouping\";\nimport { releaseMainThreadOnItemsCount } from \"./ReleaseMainThread\";\nimport { tapOnce } from \"./TapOnce\";\n\nconst OPERATOR_NAME = \"Grouping\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\nconst PERF_LOGGING_NAMESPACE = `${LOGGING_NAMESPACE}.Performance`;\n\n/** @internal */\nexport function createGroupingOperator(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n onGroupingNodeCreated?: (groupingNode: ProcessedGroupingHierarchyNode) => void,\n groupingHandlers?: GroupingHandler[],\n) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n return nodes.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }),\n tapOnce(() => {\n doLog({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Starting grouping (parent: ${createNodeIdentifierForLogging(parentNode)})`,\n });\n }),\n reduce<ProcessedHierarchyNode, { instanceNodes: ProcessedInstanceHierarchyNode[]; restNodes: ProcessedHierarchyNode[] }>(\n (resolvedNodes, node) => {\n if (HierarchyNode.isInstancesNode(node)) {\n resolvedNodes.instanceNodes.push(node);\n } else {\n resolvedNodes.restNodes.push(node);\n }\n return resolvedNodes;\n },\n { instanceNodes: [], restNodes: [] },\n ),\n tap(({ instanceNodes, restNodes }) => {\n doLog({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Nodes partitioned. Got ${instanceNodes.length} instance nodes and ${restNodes.length} rest nodes.`,\n });\n }),\n mergeMap((res) => {\n const out = of(res);\n const totalNodes = res.instanceNodes.length + res.restNodes.length;\n // istanbul ignore next\n return totalNodes <= 1000 ? out : out.pipe(delay(0));\n }),\n mergeMap(({ instanceNodes, restNodes }): Observable<ProcessedHierarchyNode> => {\n const timer = new StopWatch(undefined, true);\n const groupingHandlersObs: Observable<GroupingHandler> = groupingHandlers\n ? from(groupingHandlers)\n : createGroupingHandlers(imodelAccess, parentNode, instanceNodes, valueFormatter, localizedStrings);\n return merge(\n groupingHandlersObs.pipe(\n toArray(),\n mergeMap((createdGroupingHandlers) =>\n groupInstanceNodes(instanceNodes, restNodes.length, createdGroupingHandlers, parentNode, onGroupingNodeCreated),\n ),\n finalize(() => {\n doLog({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Grouping ${instanceNodes.length} nodes took ${timer.elapsedSeconds.toFixed(3)} s`,\n });\n }),\n ),\n from(restNodes),\n );\n }),\n releaseMainThreadOnItemsCount(500),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }),\n );\n };\n}\n\n/** @internal */\nexport type ProcessedInstancesGroupingHierarchyNode = Omit<ProcessedGroupingHierarchyNode, \"children\"> & { children: ProcessedInstanceHierarchyNode[] };\n\n/** @internal */\nexport interface GroupingHandlerResult {\n /** Expected to be sorted by label. */\n grouped: Array<ProcessedInstancesGroupingHierarchyNode>;\n /** Expected to be sorted by label. */\n ungrouped: ProcessedInstanceHierarchyNode[];\n groupingType: GroupingType;\n}\n\n/** @internal */\nexport type GroupingType = \"label\" | \"class\" | \"base-class\" | \"property\";\n\n/** @internal */\nexport type GroupingHandler = (\n nodesToGroup: ProcessedInstanceHierarchyNode[],\n nodesAlreadyGrouped: ProcessedInstancesGroupingHierarchyNode[],\n) => Promise<GroupingHandlerResult>;\n\nfunction groupInstanceNodes(\n nodes: ProcessedInstanceHierarchyNode[],\n extraSiblings: number,\n groupingHandlers: GroupingHandler[],\n parentNode: ParentHierarchyNode | undefined,\n onGroupingNodeCreated?: (groupingNode: ProcessedGroupingHierarchyNode) => void,\n): Observable<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode> {\n if (groupingHandlers.length === 0) {\n return from(nodes);\n }\n return of<{ handlerIndex: number; result?: GroupingHandlerResult | undefined }>({ handlerIndex: 0 }).pipe(\n expand(({ handlerIndex, result: curr }) => {\n if (handlerIndex >= groupingHandlers.length) {\n return EMPTY;\n }\n const timer = new StopWatch(undefined, true);\n const currentHandler = groupingHandlers[handlerIndex];\n return from(currentHandler(curr?.ungrouped ?? nodes, curr?.grouped ?? [])).pipe(\n log({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Grouping handler ${handlerIndex} exclusively took ${timer.elapsedSeconds.toFixed(3)} s.`,\n }),\n mergeMap((result) => {\n if (result.grouped.length === 0) {\n return of({ handlerIndex: handlerIndex + 1, result: { ...result, grouped: curr?.grouped ?? [] } });\n }\n const groupingPostProcessingTimer = new StopWatch(undefined, true);\n return of(result).pipe(\n map((r) => applyGroupHidingParams(r, extraSiblings)),\n map((r) => assignAutoExpand(r)),\n map((r) => ({ handlerIndex: handlerIndex + 1, result: { ...r, grouped: mergeInPlace(curr?.grouped, r.grouped) } })),\n log({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () =>\n `Post-processing grouping handler ${handlerIndex} exclusively took ${groupingPostProcessingTimer.elapsedSeconds.toFixed(3)} s.`,\n }),\n delay(0),\n );\n }),\n log({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Total time for grouping handler ${handlerIndex}: ${timer.elapsedSeconds.toFixed(3)} s.`,\n }),\n );\n }),\n last(),\n mergeMap(({ result }) => {\n result.grouped.forEach((groupingNode) => {\n onGroupingNodeCreated?.(groupingNode);\n if (!parentNode) {\n return;\n }\n if (HierarchyNode.isGroupingNode(parentNode)) {\n groupingNode.nonGroupingAncestor = parentNode.nonGroupingAncestor;\n return;\n }\n // not sure why type checker doesn't pick this up\n assert(HierarchyNode.isCustom(parentNode) || HierarchyNode.isInstancesNode(parentNode));\n groupingNode.nonGroupingAncestor = parentNode;\n });\n return mergeInPlace<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>(result.grouped, result.ungrouped);\n }),\n );\n}\n\nfunction mergeInPlace<T>(target: T[] | undefined, source: T[]) {\n if (!target || target.length === 0) {\n return source;\n }\n for (const item of source) {\n target.push(item);\n }\n return target;\n}\n\n/** @internal */\nexport function createGroupingHandlers(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n processedInstanceNodes: ProcessedInstanceHierarchyNode[],\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n): Observable<GroupingHandler> {\n const timer = new StopWatch();\n const groupingLevel = getNodeGroupingLevel(parentNode);\n return concat(\n groupingLevel <= GroupingLevel.Class\n ? concat(\n from(createBaseClassGroupingHandlers(imodelAccess, parentNode, processedInstanceNodes)).pipe(concatAll()),\n of<GroupingHandler>(async (allNodes) => createClassGroups(imodelAccess, parentNode, allNodes)),\n )\n : EMPTY,\n groupingLevel <= GroupingLevel.Property\n ? from(createPropertiesGroupingHandlers(imodelAccess, parentNode, processedInstanceNodes, valueFormatter, localizedStrings)).pipe(concatAll())\n : EMPTY,\n groupingLevel < GroupingLevel.Label ? of<GroupingHandler>(async (allNodes) => createLabelGroups(allNodes)) : EMPTY,\n ).pipe(\n tap({\n subscribe: () => {\n doLog({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Start creating grouping handlers`,\n });\n timer.start();\n },\n }),\n finalize(() => {\n doLog({\n category: PERF_LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `Creating grouping handlers took ${timer.elapsedSeconds.toFixed(3)} s`,\n });\n }),\n );\n}\n\nfunction getNodeGroupingLevel(node: ParentHierarchyNode | undefined): GroupingLevel {\n if (node && HierarchyNode.isClassGroupingNode(node)) {\n return GroupingLevel.Class;\n }\n if (node && HierarchyNode.isPropertyGroupingNode(node)) {\n return GroupingLevel.Property;\n }\n if (node && HierarchyNode.isLabelGroupingNode(node)) {\n return GroupingLevel.Label;\n }\n return GroupingLevel.None;\n}\n\nenum GroupingLevel {\n None = 0,\n Class = 2,\n Property = 3,\n Label = 4,\n}\n"]}
1
+ {"version":3,"file":"Grouping.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/Grouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAmChG,wDAiEC;AAmGD,wDAqCC;AA1OD,+BAAiJ;AACjJ,sDAAwD;AAExD,uDAM6B;AAC7B,sCAKmB;AACnB,kDAA6C;AAC7C,sDAAyD;AACzD,oEAA+E;AAC/E,4DAA6D;AAC7D,wDAAgE;AAChE,4DAA6D;AAC7D,sEAAqH;AACrH,2DAAoE;AACpE,uCAAoC;AAEpC,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,CAAC,CAAC;AAC/E,MAAM,6BAA6B,GAAG,IAAA,uCAA8B,EAAC,aAAa,EAAE,sCAAkC,CAAC,CAAC;AACxH,MAAM,sCAAsC,GAAG,IAAA,uCAA8B,EAAC,aAAa,EAAE,+CAA2C,CAAC,CAAC;AAE1I,gBAAgB;AAChB,SAAgB,sBAAsB,CACpC,YAA0D,EAC1D,UAA2C,EAC3C,cA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CAAC,CAAC,CAAC,IAAI;SACjH,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAqC;IACjE,IAAI,IAAI,IAAI,6BAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,IAAI,IAAI,IAAI,6BAAa,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,OAAO,aAAa,CAAC,QAAQ,CAAC;IAChC,CAAC;IACD,IAAI,IAAI,IAAI,6BAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,OAAO,aAAa,CAAC,IAAI,CAAC;AAC5B,CAAC;AAED,IAAK,aAKJ;AALD,WAAK,aAAa;IAChB,iDAAQ,CAAA;IACR,mDAAS,CAAA;IACT,yDAAY,CAAA;IACZ,mDAAS,CAAA;AACX,CAAC,EALI,aAAa,KAAb,aAAa,QAKjB","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\nimport { concat, concatAll, delay, EMPTY, expand, finalize, from, last, map, merge, mergeMap, Observable, of, reduce, tap, toArray } from \"rxjs\";\nimport { assert, StopWatch } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, ECSchemaProvider, IPrimitiveValueFormatter } from \"@itwin/presentation-shared\";\nimport {\n HierarchyNode,\n ParentHierarchyNode,\n ProcessedGroupingHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n} from \"../../HierarchyNode\";\nimport {\n LOGGING_NAMESPACE_PERFORMANCE as BASE_LOGGING_NAMESPACE_PERFORMANCE,\n LOGGING_NAMESPACE_PERFORMANCE_INTERNAL as BASE_LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n createNodeIdentifierForLogging,\n createOperatorLoggingNamespace,\n} from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { assignAutoExpand } from \"./grouping/AutoExpand\";\nimport { createBaseClassGroupingHandlers } from \"./grouping/BaseClassGrouping\";\nimport { createClassGroups } from \"./grouping/ClassGrouping\";\nimport { applyGroupHidingParams } from \"./grouping/GroupHiding\";\nimport { createLabelGroups } from \"./grouping/LabelGrouping\";\nimport { createPropertiesGroupingHandlers, PropertiesGroupingLocalizedStrings } from \"./grouping/PropertiesGrouping\";\nimport { releaseMainThreadOnItemsCount } from \"./ReleaseMainThread\";\nimport { tapOnce } from \"./TapOnce\";\n\nconst OPERATOR_NAME = \"Grouping\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\nconst LOGGING_NAMESPACE_PERFORMANCE = createOperatorLoggingNamespace(OPERATOR_NAME, BASE_LOGGING_NAMESPACE_PERFORMANCE);\nconst LOGGING_NAMESPACE_PERFORMANCE_INTERNAL = createOperatorLoggingNamespace(OPERATOR_NAME, BASE_LOGGING_NAMESPACE_PERFORMANCE_INTERNAL);\n\n/** @internal */\nexport function createGroupingOperator(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n onGroupingNodeCreated?: (groupingNode: ProcessedGroupingHierarchyNode) => void,\n groupingHandlers?: GroupingHandler[],\n) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n return nodes.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }),\n tapOnce(() => {\n doLog({\n category: LOGGING_NAMESPACE_PERFORMANCE,\n message: /* istanbul ignore next */ () => `Starting grouping (parent: ${createNodeIdentifierForLogging(parentNode)})`,\n });\n }),\n reduce<ProcessedHierarchyNode, { instanceNodes: ProcessedInstanceHierarchyNode[]; restNodes: ProcessedHierarchyNode[] }>(\n (resolvedNodes, node) => {\n if (HierarchyNode.isInstancesNode(node)) {\n resolvedNodes.instanceNodes.push(node);\n } else {\n resolvedNodes.restNodes.push(node);\n }\n return resolvedNodes;\n },\n { instanceNodes: [], restNodes: [] },\n ),\n tap(({ instanceNodes, restNodes }) => {\n doLog({\n category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n message: /* istanbul ignore next */ () => `Nodes partitioned. Got ${instanceNodes.length} instance nodes and ${restNodes.length} rest nodes.`,\n });\n }),\n mergeMap((res) => {\n const out = of(res);\n const totalNodes = res.instanceNodes.length + res.restNodes.length;\n // istanbul ignore next\n return totalNodes <= 1000 ? out : out.pipe(delay(0));\n }),\n mergeMap(({ instanceNodes, restNodes }): Observable<ProcessedHierarchyNode> => {\n const timer = new StopWatch(undefined, true);\n const groupingHandlersObs: Observable<GroupingHandler> = groupingHandlers\n ? from(groupingHandlers)\n : createGroupingHandlers(imodelAccess, parentNode, instanceNodes, valueFormatter, localizedStrings);\n return merge(\n groupingHandlersObs.pipe(\n toArray(),\n mergeMap((createdGroupingHandlers) =>\n groupInstanceNodes(instanceNodes, restNodes.length, createdGroupingHandlers, parentNode, onGroupingNodeCreated),\n ),\n finalize(() => {\n doLog({\n category: LOGGING_NAMESPACE_PERFORMANCE,\n message: /* istanbul ignore next */ () => `Grouping ${instanceNodes.length} nodes took ${timer.elapsedSeconds.toFixed(3)} s`,\n });\n }),\n ),\n from(restNodes),\n );\n }),\n releaseMainThreadOnItemsCount(500),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }),\n );\n };\n}\n\n/** @internal */\nexport type ProcessedInstancesGroupingHierarchyNode = Omit<ProcessedGroupingHierarchyNode, \"children\"> & { children: ProcessedInstanceHierarchyNode[] };\n\n/** @internal */\nexport interface GroupingHandlerResult {\n /** Expected to be sorted by label. */\n grouped: Array<ProcessedInstancesGroupingHierarchyNode>;\n /** Expected to be sorted by label. */\n ungrouped: ProcessedInstanceHierarchyNode[];\n groupingType: GroupingType;\n}\n\n/** @internal */\nexport type GroupingType = \"label\" | \"class\" | \"base-class\" | \"property\";\n\n/** @internal */\nexport type GroupingHandler = (\n nodesToGroup: ProcessedInstanceHierarchyNode[],\n nodesAlreadyGrouped: ProcessedInstancesGroupingHierarchyNode[],\n) => Promise<GroupingHandlerResult>;\n\nfunction groupInstanceNodes(\n nodes: ProcessedInstanceHierarchyNode[],\n extraSiblings: number,\n groupingHandlers: GroupingHandler[],\n parentNode: ParentHierarchyNode | undefined,\n onGroupingNodeCreated?: (groupingNode: ProcessedGroupingHierarchyNode) => void,\n): Observable<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode> {\n if (groupingHandlers.length === 0) {\n return from(nodes);\n }\n return of<{ handlerIndex: number; result?: GroupingHandlerResult | undefined }>({ handlerIndex: 0 }).pipe(\n expand(({ handlerIndex, result: curr }) => {\n if (handlerIndex >= groupingHandlers.length) {\n return EMPTY;\n }\n const timer = new StopWatch(undefined, true);\n const currentHandler = groupingHandlers[handlerIndex];\n return from(currentHandler(curr?.ungrouped ?? nodes, curr?.grouped ?? [])).pipe(\n log({\n category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n message: /* istanbul ignore next */ () => `Grouping handler ${handlerIndex} exclusively took ${timer.elapsedSeconds.toFixed(3)} s.`,\n }),\n mergeMap((result) => {\n if (result.grouped.length === 0) {\n return of({ handlerIndex: handlerIndex + 1, result: { ...result, grouped: curr?.grouped ?? [] } });\n }\n const groupingPostProcessingTimer = new StopWatch(undefined, true);\n return of(result).pipe(\n map((r) => applyGroupHidingParams(r, extraSiblings)),\n map((r) => assignAutoExpand(r)),\n map((r) => ({ handlerIndex: handlerIndex + 1, result: { ...r, grouped: mergeInPlace(curr?.grouped, r.grouped) } })),\n log({\n category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n message: /* istanbul ignore next */ () =>\n `Post-processing grouping handler ${handlerIndex} exclusively took ${groupingPostProcessingTimer.elapsedSeconds.toFixed(3)} s.`,\n }),\n delay(0),\n );\n }),\n log({\n category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n message: /* istanbul ignore next */ () => `Total time for grouping handler ${handlerIndex}: ${timer.elapsedSeconds.toFixed(3)} s.`,\n }),\n );\n }),\n last(),\n mergeMap(({ result }) => {\n result.grouped.forEach((groupingNode) => {\n onGroupingNodeCreated?.(groupingNode);\n if (!parentNode) {\n return;\n }\n if (HierarchyNode.isGroupingNode(parentNode)) {\n groupingNode.nonGroupingAncestor = parentNode.nonGroupingAncestor;\n return;\n }\n // not sure why type checker doesn't pick this up\n assert(HierarchyNode.isCustom(parentNode) || HierarchyNode.isInstancesNode(parentNode));\n groupingNode.nonGroupingAncestor = parentNode;\n });\n return mergeInPlace<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>(result.grouped, result.ungrouped);\n }),\n );\n}\n\nfunction mergeInPlace<T>(target: T[] | undefined, source: T[]) {\n if (!target || target.length === 0) {\n return source;\n }\n for (const item of source) {\n target.push(item);\n }\n return target;\n}\n\n/** @internal */\nexport function createGroupingHandlers(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n processedInstanceNodes: ProcessedInstanceHierarchyNode[],\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n): Observable<GroupingHandler> {\n const timer = new StopWatch();\n const groupingLevel = getNodeGroupingLevel(parentNode);\n return concat(\n groupingLevel <= GroupingLevel.Class\n ? concat(\n from(createBaseClassGroupingHandlers(imodelAccess, parentNode, processedInstanceNodes)).pipe(concatAll()),\n of<GroupingHandler>(async (allNodes) => createClassGroups(imodelAccess, parentNode, allNodes)),\n )\n : EMPTY,\n groupingLevel <= GroupingLevel.Property\n ? from(createPropertiesGroupingHandlers(imodelAccess, parentNode, processedInstanceNodes, valueFormatter, localizedStrings)).pipe(concatAll())\n : EMPTY,\n groupingLevel < GroupingLevel.Label ? of<GroupingHandler>(async (allNodes) => createLabelGroups(allNodes)) : EMPTY,\n ).pipe(\n tap({\n subscribe: () => {\n doLog({\n category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n message: /* istanbul ignore next */ () => `Start creating grouping handlers`,\n });\n timer.start();\n },\n }),\n finalize(() => {\n doLog({\n category: LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n message: /* istanbul ignore next */ () => `Creating grouping handlers took ${timer.elapsedSeconds.toFixed(3)} s`,\n });\n }),\n );\n}\n\nfunction getNodeGroupingLevel(node: ParentHierarchyNode | undefined): GroupingLevel {\n if (node && HierarchyNode.isClassGroupingNode(node)) {\n return GroupingLevel.Class;\n }\n if (node && HierarchyNode.isPropertyGroupingNode(node)) {\n return GroupingLevel.Property;\n }\n if (node && HierarchyNode.isLabelGroupingNode(node)) {\n return GroupingLevel.Label;\n }\n return GroupingLevel.None;\n}\n\nenum GroupingLevel {\n None = 0,\n Class = 2,\n Property = 3,\n Label = 4,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HideIfNoChildren.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideIfNoChildren.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuC,UAAU,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,EAA+C,sBAAsB,EAAkC,MAAM,qBAAqB,CAAC;AAM1I,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAAgD,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,UAAU,CAAC,OAAO,CAAC,WACpF,WAAW,sBAAsB,CAAC,KAAG,WAAW,sBAAsB,CAAC,CAoDhG"}
1
+ {"version":3,"file":"HideIfNoChildren.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideIfNoChildren.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuC,UAAU,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,EAA+C,sBAAsB,EAAkC,MAAM,qBAAqB,CAAC;AAM1I,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAA4E,CAAC;AAE3G;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,UAAU,CAAC,OAAO,CAAC,WACpF,UAAU,CAAC,sBAAsB,CAAC,KAAG,UAAU,CAAC,sBAAsB,CAAC,CAoDhG"}
@@ -4,7 +4,8 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createHideIfNoChildrenOperator = exports.LOGGING_NAMESPACE = void 0;
7
+ exports.LOGGING_NAMESPACE = void 0;
8
+ exports.createHideIfNoChildrenOperator = createHideIfNoChildrenOperator;
8
9
  const rxjs_1 = require("rxjs");
9
10
  const HierarchyNode_1 = require("../../HierarchyNode");
10
11
  const Common_1 = require("../Common");
@@ -12,7 +13,7 @@ const LoggingUtils_1 = require("../LoggingUtils");
12
13
  const Partition_1 = require("./Partition");
13
14
  const OPERATOR_NAME = "HideIfNoChildren";
14
15
  /** @internal */
15
- exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME);
16
+ exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME, Common_1.LOGGING_NAMESPACE_INTERNAL);
16
17
  /**
17
18
  * Creates an operator that hides nodes with no children if they have a `hideIfNoChildren` handling param.
18
19
  *
@@ -48,5 +49,4 @@ function createHideIfNoChildrenOperator(hasNodes) {
48
49
  }))).pipe((0, rxjs_1.filter)(Common_1.hasChildren))).pipe((0, LoggingUtils_1.log)({ category: exports.LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${(0, Common_1.createNodeIdentifierForLogging)(n)}` }));
49
50
  };
50
51
  }
51
- exports.createHideIfNoChildrenOperator = createHideIfNoChildrenOperator;
52
52
  //# sourceMappingURL=HideIfNoChildren.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HideIfNoChildren.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideIfNoChildren.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAAuE;AACvE,uDAA0I;AAC1I,sCAAwG;AACxG,kDAA6C;AAC7C,2CAAwC;AAExC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,CAAC,CAAC;AAE/E;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,QAA+D;IAC5G,OAAO,UAAU,KAAyC;QACxD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3J,6BAA6B;QAC7B,8FAA8F;QAC9F,kEAAkE;QAClE,sEAAsE;QACtE,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,IAAA,qBAAS,EAC3C,UAAU,EACV,CAAC,CAAC,EAAsE,EAAE,CACxE,CAAC,6BAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,CAC5G,CAAC;QACF,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,GAAG,IAAA,qBAAS,EAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,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EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAClD,CAAC;QACJ,CAAC,CAAC;QACJ,kFAAkF;QAClF,sBAAsB;QACtB,2FAA2F;QAC3F,8FAA8F;QAC9F,oFAAoF;QACpF,CAAC,CACF,EACD,IAAA,kBAAG,EAAC;YACF,QAAQ,EAAE,yBAAiB;YAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAA,uCAA8B,EAAC,CAAC,CAAC,sCAAsC,IAAA,oBAAW,EAAC,CAAC,CAAC,EAAE;SACtI,CAAC,CACH,CACF,CAAC,IAAI,CAAC,IAAA,aAAM,EAAC,oBAAW,CAAC,CAAC,CAC5B,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvI,CAAC,CAAC;AACJ,CAAC;AArDD,wEAqDC","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\nimport { defer, filter, map, merge, mergeMap, Observable } from \"rxjs\";\nimport { HierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from \"../../HierarchyNode\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { partition } from \"./Partition\";\n\nconst OPERATOR_NAME = \"HideIfNoChildren\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\n\n/**\n * Creates an operator that hides nodes with no children if they have a `hideIfNoChildren` handling param.\n *\n * @internal\n */\nexport function createHideIfNoChildrenOperator(hasNodes: (node: ProcessedHierarchyNode) => Observable<boolean>) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n const inputNodes = nodes.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));\n // split input into 3 pieces:\n // - `doesntNeedHide` - nodes without the flag (return no matter if they have children or not)\n // - `determinedChildren` - nodes with the flag and known children\n // - `undeterminedChildren` - nodes with the flag and unknown children\n const [needsHide, doesntNeedHide] = partition(\n inputNodes,\n (n): n is ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode =>\n (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideIfNoChildren,\n );\n const [determinedChildren, undeterminedChildren] = partition(needsHide, (n) => n.children !== undefined);\n return merge(\n doesntNeedHide.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: doesn't need hide` }),\n ),\n merge(\n determinedChildren.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, has children` }),\n ),\n undeterminedChildren.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, needs children` }),\n mergeMap(\n (n) =>\n defer(() => {\n doLog({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `${createNodeIdentifierForLogging(n)}: requesting children flag`,\n });\n return hasNodes(n).pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (childrenFlag) => `${createNodeIdentifierForLogging(n)}: determined children: ${childrenFlag}`,\n }),\n map((children) => Object.assign(n, { children })),\n );\n }),\n // Sending child check requests for all nodes without any limit greatly slows down\n // the following case:\n // - NodeX (determining children) -> ... lots of children with \"hide if no children\" -> ...\n // We check the nodes with \"hide if no children\" at most 2 at a time to prefer going deep into\n // the hierarchy, where we're more likely to find an answer, rather than going wide.\n 2,\n ),\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, determined children: ${hasChildren(n)}`,\n }),\n ),\n ).pipe(filter(hasChildren)),\n ).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));\n };\n}\n"]}
1
+ {"version":3,"file":"HideIfNoChildren.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideIfNoChildren.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAiBhG,wEAqDC;AApED,+BAAuE;AACvE,uDAA0I;AAC1I,sCAAoI;AACpI,kDAA6C;AAC7C,2CAAwC;AAExC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,EAAE,mCAA0B,CAAC,CAAC;AAE3G;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,QAA+D;IAC5G,OAAO,UAAU,KAAyC;QACxD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3J,6BAA6B;QAC7B,8FAA8F;QAC9F,kEAAkE;QAClE,sEAAsE;QACtE,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,IAAA,qBAAS,EAC3C,UAAU,EACV,CAAC,CAAC,EAAsE,EAAE,CACxE,CAAC,6BAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,eAAe,CAAC,CAAC,CAAC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yBAAiB;gBAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,IAAA,uCAA8B,EAAC,CAAC,CAAC,0BAA0B,YAAY,EAAE;aACnI,CAAC,EACF,IAAA,UAAG,EAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAClD,CAAC;QACJ,CAAC,CAAC;QACJ,kFAAkF;QAClF,sBAAsB;QACtB,2FAA2F;QAC3F,8FAA8F;QAC9F,oFAAoF;QACpF,CAAC,CACF,EACD,IAAA,kBAAG,EAAC;YACF,QAAQ,EAAE,yBAAiB;YAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAA,uCAA8B,EAAC,CAAC,CAAC,sCAAsC,IAAA,oBAAW,EAAC,CAAC,CAAC,EAAE;SACtI,CAAC,CACH,CACF,CAAC,IAAI,CAAC,IAAA,aAAM,EAAC,oBAAW,CAAC,CAAC,CAC5B,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvI,CAAC,CAAC;AACJ,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 *--------------------------------------------------------------------------------------------*/\n\nimport { defer, filter, map, merge, mergeMap, Observable } from \"rxjs\";\nimport { HierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from \"../../HierarchyNode\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren, LOGGING_NAMESPACE_INTERNAL } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { partition } from \"./Partition\";\n\nconst OPERATOR_NAME = \"HideIfNoChildren\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME, LOGGING_NAMESPACE_INTERNAL);\n\n/**\n * Creates an operator that hides nodes with no children if they have a `hideIfNoChildren` handling param.\n *\n * @internal\n */\nexport function createHideIfNoChildrenOperator(hasNodes: (node: ProcessedHierarchyNode) => Observable<boolean>) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n const inputNodes = nodes.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));\n // split input into 3 pieces:\n // - `doesntNeedHide` - nodes without the flag (return no matter if they have children or not)\n // - `determinedChildren` - nodes with the flag and known children\n // - `undeterminedChildren` - nodes with the flag and unknown children\n const [needsHide, doesntNeedHide] = partition(\n inputNodes,\n (n): n is ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode =>\n (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideIfNoChildren,\n );\n const [determinedChildren, undeterminedChildren] = partition(needsHide, (n) => n.children !== undefined);\n return merge(\n doesntNeedHide.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: doesn't need hide` }),\n ),\n merge(\n determinedChildren.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, has children` }),\n ),\n undeterminedChildren.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, needs children` }),\n mergeMap(\n (n) =>\n defer(() => {\n doLog({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `${createNodeIdentifierForLogging(n)}: requesting children flag`,\n });\n return hasNodes(n).pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (childrenFlag) => `${createNodeIdentifierForLogging(n)}: determined children: ${childrenFlag}`,\n }),\n map((children) => Object.assign(n, { children })),\n );\n }),\n // Sending child check requests for all nodes without any limit greatly slows down\n // the following case:\n // - NodeX (determining children) -> ... lots of children with \"hide if no children\" -> ...\n // We check the nodes with \"hide if no children\" at most 2 at a time to prefer going deep into\n // the hierarchy, where we're more likely to find an answer, rather than going wide.\n 2,\n ),\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, determined children: ${hasChildren(n)}`,\n }),\n ),\n ).pipe(filter(hasChildren)),\n ).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HideNodesInHierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0E,UAAU,EAAQ,MAAM,MAAM,CAAC;AAChH,OAAO,EAA+C,sBAAsB,EAAkC,MAAM,qBAAqB,CAAC;AAQ1I,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAAgD,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,UAAU,CAAC,sBAAsB,CAAC,EACpF,gBAAgB,EAAE,OAAO,WAED,WAAW,sBAAsB,CAAC,KAAG,WAAW,sBAAsB,CAAC,CA2DhG"}
1
+ {"version":3,"file":"HideNodesInHierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0E,UAAU,EAAQ,MAAM,MAAM,CAAC;AAChH,OAAO,EAA+C,sBAAsB,EAAkC,MAAM,qBAAqB,CAAC;AAQ1I,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAA4E,CAAC;AAE3G;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,UAAU,CAAC,sBAAsB,CAAC,EACpF,gBAAgB,EAAE,OAAO,WAED,UAAU,CAAC,sBAAsB,CAAC,KAAG,UAAU,CAAC,sBAAsB,CAAC,CA2DhG"}
@@ -4,7 +4,8 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createHideNodesInHierarchyOperator = exports.LOGGING_NAMESPACE = void 0;
7
+ exports.LOGGING_NAMESPACE = void 0;
8
+ exports.createHideNodesInHierarchyOperator = createHideNodesInHierarchyOperator;
8
9
  const rxjs_1 = require("rxjs");
9
10
  const HierarchyNode_1 = require("../../HierarchyNode");
10
11
  const Common_1 = require("../Common");
@@ -13,7 +14,7 @@ const Partition_1 = require("./Partition");
13
14
  const ReduceToMergeMap_1 = require("./ReduceToMergeMap");
14
15
  const OPERATOR_NAME = "HideNodesInHierarchy";
15
16
  /** @internal */
16
- exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME);
17
+ exports.LOGGING_NAMESPACE = (0, Common_1.createOperatorLoggingNamespace)(OPERATOR_NAME, Common_1.LOGGING_NAMESPACE_INTERNAL);
17
18
  /**
18
19
  * Creates an operator that hides nodes and instead returns their children if the nodes have a `hideInHierarchy` handling param.
19
20
  *
@@ -45,7 +46,6 @@ function createHideNodesInHierarchyOperator(getNodes, stopOnFirstChild) {
45
46
  : withLoadedChildren).pipe((0, LoggingUtils_1.log)({ category: exports.LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${(0, Common_1.createNodeIdentifierForLogging)(n)}` }));
46
47
  };
47
48
  }
48
- exports.createHideNodesInHierarchyOperator = createHideNodesInHierarchyOperator;
49
49
  function createMergeMapKey(node) {
50
50
  if (typeof node.key === "string") {
51
51
  return node.key;
@@ -1 +1 @@
1
- {"version":3,"file":"HideNodesInHierarchy.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAAgH;AAChH,uDAA0I;AAE1I,sCAAoH;AACpH,kDAA6C;AAC7C,2CAAwC;AACxC,yDAA0D;AAE1D,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAC7C,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,CAAC,CAAC;AAE/E;;;;GAIG;AACH,SAAgB,kCAAkC,CAChD,QAAoF,EACpF,gBAAyB;IAEzB,OAAO,UAAU,KAAyC;QACxD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3J,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,qBAAS,EACvC,UAAU,EACV,CAAC,CAAC,EAAsE,EAAE,CACxE,CAAC,6BAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,eAAe,CAC3G,CAAC;QACF,2DAA2D;QAC3D,MAAM,kBAAkB,GAAG,IAAA,YAAK,EAAC,GAAG,EAAE,CACpC,QAAQ,CAAC,IAAI,CACX,IAAA,kBAAG,EAAC;YACF,QAAQ,EAAE,yBAAiB;YAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG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,CAAC,EACnB,IAAA,kBAAG,EAAC;gBACF,QAAQ,EAAE,yBAAiB;gBAC3B,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CACxC,wCAAwC,IAAA,uCAA8B,EAAC,CAAC,CAAC,gFAAgF;aAC5J,CAAC,CACH,EACD,YAAK,CAAC,IAAI,CACR,IAAA,eAAQ,EAAC,GAAG,EAAE,CACZ,IAAA,oBAAK,EAAC;gBACJ,QAAQ,EAAE,yBAAiB;gBAC3B,OAAO,EAAE,0BAA0B,CAAC,GAAG,EAAE,CACvC,0GAA0G;aAC7G,CAAC,CACH,CACF,EACD,kBAAkB,CACnB,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,kBAAkB,CACvB,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvI,CAAC,CAAC;AACJ,CAAC;AA/DD,gFA+DC;AAED,SAAS,iBAAiB,CAAmD,IAAW;IACtF,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,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 *--------------------------------------------------------------------------------------------*/\n\nimport { concat, defer, EMPTY, filter, finalize, map, merge, mergeAll, mergeMap, Observable, take } from \"rxjs\";\nimport { HierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from \"../../HierarchyNode\";\nimport { InstancesNodeKey } from \"../../HierarchyNodeKey\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren, mergeNodes } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { partition } from \"./Partition\";\nimport { reduceToMergeMapItem } from \"./ReduceToMergeMap\";\n\nconst OPERATOR_NAME = \"HideNodesInHierarchy\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\n\n/**\n * Creates an operator that hides nodes and instead returns their children if the nodes have a `hideInHierarchy` handling param.\n *\n * @internal\n */\nexport function createHideNodesInHierarchyOperator(\n getNodes: (parentNode: ProcessedHierarchyNode) => Observable<ProcessedHierarchyNode>,\n stopOnFirstChild: boolean,\n) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n const inputNodes = nodes.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));\n const [withFlag, withoutFlag] = partition(\n inputNodes,\n (n): n is ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode =>\n (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideInHierarchy,\n );\n // Defer to create a new seed for reduce on every subscribe\n const withLoadedChildren = defer(() =>\n withFlag.pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)} needs hide and needs children to be loaded`,\n }),\n filter((node) => node.children !== false),\n reduceToMergeMapItem(\n (node) => createMergeMapKey(node),\n (node, mergedNode: ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | undefined) => (mergedNode ? mergeNodes(mergedNode, node) : node),\n ),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (mm) => `created a merge map of size ${mm.size}` }),\n mergeMap((mm) => [...mm.values()].map((mergedNode) => defer(() => getNodes(mergedNode)))),\n mergeAll(),\n map((n): ProcessedHierarchyNode => n),\n ),\n );\n\n return merge(\n withoutFlag.pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)} doesn't need hide, return the node`,\n }),\n ),\n stopOnFirstChild\n ? concat(\n // a small hack to handle situation when we're here to only check if parent node has children and one of them has `hideIfNoChildren` flag\n // with a `hasChildren = true` - we just return the hidden node itself in that case to avoid digging deeper into the hierarchy\n inputNodes.pipe(\n filter(hasChildren),\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) =>\n `\\`stopOnFirstChild = true\\` and node ${createNodeIdentifierForLogging(n)} is set to always have nodes - return the hidden node without loading children`,\n }),\n ),\n EMPTY.pipe(\n finalize(() =>\n doLog({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () =>\n `\\`stopOnFirstChild = true\\` but none of the nodes had children determined to \\`true\\` - do load children`,\n }),\n ),\n ),\n withLoadedChildren,\n ).pipe(take(1))\n : withLoadedChildren,\n ).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));\n };\n}\n\nfunction createMergeMapKey<TNode extends { key: InstancesNodeKey | string }>(node: TNode): string {\n if (typeof node.key === \"string\") {\n return node.key;\n }\n return node.key.instanceKeys[0].className;\n}\n"]}
1
+ {"version":3,"file":"HideNodesInHierarchy.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAmBhG,gFA+DC;AAhFD,+BAAgH;AAChH,uDAA0I;AAE1I,sCAAgJ;AAChJ,kDAA6C;AAC7C,2CAAwC;AACxC,yDAA0D;AAE1D,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAC7C,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,uCAA8B,EAAC,aAAa,EAAE,mCAA0B,CAAC,CAAC;AAE3G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AI,EAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,kBAAkB,CACvB,CAAC,IAAI,CAAC,IAAA,kBAAG,EAAC,EAAE,QAAQ,EAAE,yBAAiB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAA,uCAA8B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvI,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAmD,IAAW;IACtF,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,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 *--------------------------------------------------------------------------------------------*/\n\nimport { concat, defer, EMPTY, filter, finalize, map, merge, mergeAll, mergeMap, Observable, take } from \"rxjs\";\nimport { HierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from \"../../HierarchyNode\";\nimport { InstancesNodeKey } from \"../../HierarchyNodeKey\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren, LOGGING_NAMESPACE_INTERNAL, mergeNodes } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { partition } from \"./Partition\";\nimport { reduceToMergeMapItem } from \"./ReduceToMergeMap\";\n\nconst OPERATOR_NAME = \"HideNodesInHierarchy\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME, LOGGING_NAMESPACE_INTERNAL);\n\n/**\n * Creates an operator that hides nodes and instead returns their children if the nodes have a `hideInHierarchy` handling param.\n *\n * @internal\n */\nexport function createHideNodesInHierarchyOperator(\n getNodes: (parentNode: ProcessedHierarchyNode) => Observable<ProcessedHierarchyNode>,\n stopOnFirstChild: boolean,\n) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n const inputNodes = nodes.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));\n const [withFlag, withoutFlag] = partition(\n inputNodes,\n (n): n is ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode =>\n (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideInHierarchy,\n );\n // Defer to create a new seed for reduce on every subscribe\n const withLoadedChildren = defer(() =>\n withFlag.pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)} needs hide and needs children to be loaded`,\n }),\n filter((node) => node.children !== false),\n reduceToMergeMapItem(\n (node) => createMergeMapKey(node),\n (node, mergedNode: ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | undefined) => (mergedNode ? mergeNodes(mergedNode, node) : node),\n ),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (mm) => `created a merge map of size ${mm.size}` }),\n mergeMap((mm) => [...mm.values()].map((mergedNode) => defer(() => getNodes(mergedNode)))),\n mergeAll(),\n map((n): ProcessedHierarchyNode => n),\n ),\n );\n\n return merge(\n withoutFlag.pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)} doesn't need hide, return the node`,\n }),\n ),\n stopOnFirstChild\n ? concat(\n // a small hack to handle situation when we're here to only check if parent node has children and one of them has `hideIfNoChildren` flag\n // with a `hasChildren = true` - we just return the hidden node itself in that case to avoid digging deeper into the hierarchy\n inputNodes.pipe(\n filter(hasChildren),\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) =>\n `\\`stopOnFirstChild = true\\` and node ${createNodeIdentifierForLogging(n)} is set to always have nodes - return the hidden node without loading children`,\n }),\n ),\n EMPTY.pipe(\n finalize(() =>\n doLog({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () =>\n `\\`stopOnFirstChild = true\\` but none of the nodes had children determined to \\`true\\` - do load children`,\n }),\n ),\n ),\n withLoadedChildren,\n ).pipe(take(1))\n : withLoadedChildren,\n ).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));\n };\n}\n\nfunction createMergeMapKey<TNode extends { key: InstancesNodeKey | string }>(node: TNode): string {\n if (typeof node.key === \"string\") {\n return node.key;\n }\n return node.key.instanceKeys[0].className;\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.partition = void 0;
7
+ exports.partition = partition;
8
8
  const rxjs_1 = require("rxjs");
9
9
  const core_bentley_1 = require("@itwin/core-bentley");
10
10
  /**
@@ -57,5 +57,4 @@ function partition(source, predicate) {
57
57
  };
58
58
  }));
59
59
  }
60
- exports.partition = partition;
61
60
  //# sourceMappingURL=Partition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/Partition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAAsF;AACtF,sDAA6C;AAO7C;;;GAGG;AACH,SAAgB,SAAS,CAAI,MAA0B,EAAE,SAAgC;IACvF,MAAM,OAAO,GAAG,IAAI,oBAAa,EAAK,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,oBAAa,EAAK,CAAC;IAC1C,IAAI,kBAA4C,CAAC;IACjD,IAAI,wBAAwB,GAAG,CAAC,CAAC;IACjC,SAAS,iBAAiB;QACxB,IAAI,wBAAwB,EAAE,GAAG,CAAC,EAAE,CAAC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,CAAC,CAAC;IACJ,CAAC,CAAC,CAC6B,CAAC;AACtC,CAAC;AA/CD,8BA+CC","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\nimport { from, Observable, ObservableInput, ReplaySubject, Subscription } from \"rxjs\";\nimport { assert } from \"@itwin/core-bentley\";\n\n/** @internal */\nexport function partition<T, U extends T>(source: ObservableInput<T>, predicate: (value: T) => value is U): [Observable<U>, Observable<Exclude<T, U>>];\n/** @internal */\nexport function partition<T>(source: ObservableInput<T>, predicate: (value: T) => boolean): [Observable<T>, Observable<T>];\n\n/**\n * This is similar to `rxjs` `partition` operator, but it subscribes to source observable only once.\n * @internal\n */\nexport function partition<T>(source: ObservableInput<T>, predicate: (value: T) => boolean): [Observable<T>, Observable<T>] {\n const matches = new ReplaySubject<T>();\n const nonMatches = new ReplaySubject<T>();\n let sourceSubscription: Subscription | undefined;\n let sourceSubscriptionsCount = 0;\n function subscribeToSource() {\n if (sourceSubscriptionsCount++ > 0) {\n return;\n }\n assert(!sourceSubscription);\n sourceSubscription = from(source).subscribe({\n next(value) {\n if (predicate(value)) {\n matches.next(value);\n } else {\n nonMatches.next(value);\n }\n },\n error(error) {\n matches.error(error);\n nonMatches.error(error);\n },\n complete() {\n matches.complete();\n nonMatches.complete();\n },\n });\n }\n function unsubscribeFromSource() {\n assert(sourceSubscriptionsCount > 0);\n if (--sourceSubscriptionsCount === 0) {\n assert(!!sourceSubscription);\n sourceSubscription.unsubscribe();\n sourceSubscription = undefined;\n }\n }\n return [matches, nonMatches].map(\n (subject) =>\n new Observable((subscriber) => {\n const subjectSubscription = subject.subscribe(subscriber);\n subscribeToSource();\n return () => {\n subjectSubscription.unsubscribe();\n unsubscribeFromSource();\n };\n }),\n ) as [Observable<T>, Observable<T>];\n}\n"]}
1
+ {"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../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AC,WAAW,EAAE,CAAC;YACjC,kBAAkB,GAAG,SAAS,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,GAAG,CAC9B,CAAC,OAAO,EAAE,EAAE,CACV,IAAI,iBAAU,CAAC,CAAC,UAAU,EAAE,EAAE;QAC5B,MAAM,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC1D,iBAAiB,EAAE,CAAC;QACpB,OAAO,GAAG,EAAE;YACV,mBAAmB,CAAC,WAAW,EAAE,CAAC;YAClC,qBAAqB,EAAE,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,CAAC,CAC6B,CAAC;AACtC,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 *--------------------------------------------------------------------------------------------*/\n\nimport { from, Observable, ObservableInput, ReplaySubject, Subscription } from \"rxjs\";\nimport { assert } from \"@itwin/core-bentley\";\n\n/** @internal */\nexport function partition<T, U extends T>(source: ObservableInput<T>, predicate: (value: T) => value is U): [Observable<U>, Observable<Exclude<T, U>>];\n/** @internal */\nexport function partition<T>(source: ObservableInput<T>, predicate: (value: T) => boolean): [Observable<T>, Observable<T>];\n\n/**\n * This is similar to `rxjs` `partition` operator, but it subscribes to source observable only once.\n * @internal\n */\nexport function partition<T>(source: ObservableInput<T>, predicate: (value: T) => boolean): [Observable<T>, Observable<T>] {\n const matches = new ReplaySubject<T>();\n const nonMatches = new ReplaySubject<T>();\n let sourceSubscription: Subscription | undefined;\n let sourceSubscriptionsCount = 0;\n function subscribeToSource() {\n if (sourceSubscriptionsCount++ > 0) {\n return;\n }\n assert(!sourceSubscription);\n sourceSubscription = from(source).subscribe({\n next(value) {\n if (predicate(value)) {\n matches.next(value);\n } else {\n nonMatches.next(value);\n }\n },\n error(error) {\n matches.error(error);\n nonMatches.error(error);\n },\n complete() {\n matches.complete();\n nonMatches.complete();\n },\n });\n }\n function unsubscribeFromSource() {\n assert(sourceSubscriptionsCount > 0);\n if (--sourceSubscriptionsCount === 0) {\n assert(!!sourceSubscription);\n sourceSubscription.unsubscribe();\n sourceSubscription = undefined;\n }\n }\n return [matches, nonMatches].map(\n (subject) =>\n new Observable((subscriber) => {\n const subjectSubscription = subject.subscribe(subscriber);\n subscribeToSource();\n return () => {\n subjectSubscription.unsubscribe();\n unsubscribeFromSource();\n };\n }),\n ) as [Observable<T>, Observable<T>];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ReduceToMergeMap.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/ReduceToMergeMap.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,eAAe,EAAU,MAAM,MAAM,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,QAAQ,gGAQrI;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EACxD,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAClC,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,GAAG,SAAS,KAAK,QAAQ,YAE/D,gBAAgB,WAAW,CAAC,sDAa7C"}
1
+ {"version":3,"file":"ReduceToMergeMap.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/ReduceToMergeMap.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,eAAe,EAAU,MAAM,MAAM,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,QAAQ,gGAQrI;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EACxD,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAClC,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,GAAG,SAAS,KAAK,QAAQ,YAE/D,eAAe,CAAC,WAAW,CAAC,sDAa7C"}
@@ -4,7 +4,8 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.reduceToMergeMapItem = exports.reduceToMergeMapList = void 0;
7
+ exports.reduceToMergeMapList = reduceToMergeMapList;
8
+ exports.reduceToMergeMapItem = reduceToMergeMapItem;
8
9
  const rxjs_1 = require("rxjs");
9
10
  /**
10
11
  * Reduces the source observable into a `Map<string, TMapItem[]>`, where all input items are grouped based on their key
@@ -24,7 +25,6 @@ function reduceToMergeMapList(key, value) {
24
25
  return list;
25
26
  });
26
27
  }
27
- exports.reduceToMergeMapList = reduceToMergeMapList;
28
28
  /**
29
29
  * Reduces the source observable into a `Map<string, TMapItem>`, where all input items are grouped based on their key
30
30
  * and merged into a single value using provided merge function.
@@ -46,6 +46,5 @@ function reduceToMergeMapItem(key, mergeFunc) {
46
46
  return mergedMap;
47
47
  }, EMPTY_MAP));
48
48
  }
49
- exports.reduceToMergeMapItem = reduceToMergeMapItem;
50
49
  const EMPTY_MAP = new Map();
51
50
  //# sourceMappingURL=ReduceToMergeMap.js.map