graphdb-workbench 3.1.1 → 3.2.0-TR1

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 (353) hide show
  1. package/README.md +45 -0
  2. package/dist/10142.f47cd2aec05492fce7ce.bundle.js +2 -0
  3. package/dist/10142.f47cd2aec05492fce7ce.bundle.js.map +1 -0
  4. package/dist/10406.52677950658780fd8859.bundle.js +2 -0
  5. package/dist/{10406.7fed4b667b0d2813b305.bundle.js.map → 10406.52677950658780fd8859.bundle.js.map} +1 -1
  6. package/dist/12358.2061f29dc113149946a3.bundle.js +3 -0
  7. package/dist/12358.2061f29dc113149946a3.bundle.js.map +1 -0
  8. package/dist/12396.4c26c8da50c790b0f39a.bundle.js +2 -0
  9. package/dist/12396.4c26c8da50c790b0f39a.bundle.js.map +1 -0
  10. package/dist/14874.d6973a34188c0335fa12.bundle.js +2 -0
  11. package/dist/14874.d6973a34188c0335fa12.bundle.js.map +1 -0
  12. package/dist/15535.ce8d657c04f3401b9539.bundle.js +2 -0
  13. package/dist/15535.ce8d657c04f3401b9539.bundle.js.map +1 -0
  14. package/dist/16162.8f482628d1b34d41d496.bundle.js +2 -0
  15. package/dist/16162.8f482628d1b34d41d496.bundle.js.map +1 -0
  16. package/dist/{18961.d83ba5fd0855f3cfa7d7.bundle.js → 18961.c6505525fb0491b48f8b.bundle.js} +2 -2
  17. package/dist/{18961.d83ba5fd0855f3cfa7d7.bundle.js.map → 18961.c6505525fb0491b48f8b.bundle.js.map} +1 -1
  18. package/dist/19968.fdb823f9a12e11a633ec.bundle.js +2 -0
  19. package/dist/19968.fdb823f9a12e11a633ec.bundle.js.map +1 -0
  20. package/dist/20287.c42f9d1d913c36e46931.bundle.js +2 -0
  21. package/dist/20287.c42f9d1d913c36e46931.bundle.js.map +1 -0
  22. package/dist/20694.70b6e390d6397249c72d.bundle.js.map +1 -1
  23. package/dist/21136.199caea09a1c9ad90393.bundle.js +2 -0
  24. package/dist/21136.199caea09a1c9ad90393.bundle.js.map +1 -0
  25. package/dist/21142.b690e00c8884fddb2bb3.bundle.js +2 -0
  26. package/dist/21142.b690e00c8884fddb2bb3.bundle.js.map +1 -0
  27. package/dist/21170.d5e3041241741d21080c.bundle.js +2 -0
  28. package/dist/21170.d5e3041241741d21080c.bundle.js.map +1 -0
  29. package/dist/21195.267abc9d42b711d0f17a.bundle.js +2 -0
  30. package/dist/21195.267abc9d42b711d0f17a.bundle.js.map +1 -0
  31. package/dist/25747.4e00941ec221c4d6ce8f.bundle.js +2 -0
  32. package/dist/25747.4e00941ec221c4d6ce8f.bundle.js.map +1 -0
  33. package/dist/27580.f71ebbc69dd1c7785ef3.bundle.js +2 -0
  34. package/dist/27580.f71ebbc69dd1c7785ef3.bundle.js.map +1 -0
  35. package/dist/28050.8ca1fa760c892bfc5466.bundle.js +2 -0
  36. package/dist/28050.8ca1fa760c892bfc5466.bundle.js.map +1 -0
  37. package/dist/31636.e34ccc2d6f2dec577446.bundle.js +2 -0
  38. package/dist/31636.e34ccc2d6f2dec577446.bundle.js.map +1 -0
  39. package/dist/32489.97fac2c3daa49b143d13.bundle.js +2 -0
  40. package/dist/32489.97fac2c3daa49b143d13.bundle.js.map +1 -0
  41. package/dist/32534.fb6ef715bfb44761ec63.bundle.js +2 -0
  42. package/dist/32534.fb6ef715bfb44761ec63.bundle.js.map +1 -0
  43. package/dist/34495.cfa15bda8009fa37c6ff.bundle.js +2 -0
  44. package/dist/34495.cfa15bda8009fa37c6ff.bundle.js.map +1 -0
  45. package/dist/{38360.437a12fa59878d1d43b9.bundle.js → 38360.0a90e77042876c86b279.bundle.js} +2 -2
  46. package/dist/38360.0a90e77042876c86b279.bundle.js.map +1 -0
  47. package/dist/38412.fa86361561ffa367709f.bundle.js +2 -0
  48. package/dist/38412.fa86361561ffa367709f.bundle.js.map +1 -0
  49. package/dist/38644.3a0954c798ec413a3810.bundle.js +2 -0
  50. package/dist/38644.3a0954c798ec413a3810.bundle.js.map +1 -0
  51. package/dist/38843.5ef7a063337524ce3bb2.bundle.js +2 -0
  52. package/dist/38843.5ef7a063337524ce3bb2.bundle.js.map +1 -0
  53. package/dist/39518.4199684f3273d29d9105.bundle.js +2 -0
  54. package/dist/{39518.0ee809a85c83dba1f56a.bundle.js.map → 39518.4199684f3273d29d9105.bundle.js.map} +1 -1
  55. package/dist/39539.c23e4878044d73f2505b.bundle.js +2 -0
  56. package/dist/39539.c23e4878044d73f2505b.bundle.js.map +1 -0
  57. package/dist/{39874.c2d7cab1a65e5a869e78.bundle.js → 39874.f94a5059e1ae4f4a87e9.bundle.js} +2 -2
  58. package/dist/39874.f94a5059e1ae4f4a87e9.bundle.js.map +1 -0
  59. package/dist/41453.8bb4c783da2c5077a6e9.bundle.js +2 -0
  60. package/dist/41453.8bb4c783da2c5077a6e9.bundle.js.map +1 -0
  61. package/dist/42129.f44b7b20f9cd376c6e59.bundle.js +2 -0
  62. package/dist/42129.f44b7b20f9cd376c6e59.bundle.js.map +1 -0
  63. package/dist/44444.ad66c8256bc5b653de1a.bundle.js +2 -0
  64. package/dist/44444.ad66c8256bc5b653de1a.bundle.js.map +1 -0
  65. package/dist/44874.5854c207bbe2c4f2438e.bundle.js +2 -0
  66. package/dist/44874.5854c207bbe2c4f2438e.bundle.js.map +1 -0
  67. package/dist/45149.2f77aa736bbfb13fd987.bundle.js +2 -0
  68. package/dist/45149.2f77aa736bbfb13fd987.bundle.js.map +1 -0
  69. package/dist/45758.6ceb731cbe0576149f31.bundle.js +2 -0
  70. package/dist/45758.6ceb731cbe0576149f31.bundle.js.map +1 -0
  71. package/dist/{46591.ac9d19fd699104a9ed9b.bundle.js → 46591.0b142aa76a8991a89848.bundle.js} +2 -2
  72. package/dist/46591.0b142aa76a8991a89848.bundle.js.map +1 -0
  73. package/dist/55862.1fb5abd075ba11a7e93c.bundle.js +2 -0
  74. package/dist/55862.1fb5abd075ba11a7e93c.bundle.js.map +1 -0
  75. package/dist/58306.ba9545cbaee021ebcbce.bundle.js +2 -0
  76. package/dist/58306.ba9545cbaee021ebcbce.bundle.js.map +1 -0
  77. package/dist/{60560.024578077d95b851beea.bundle.js → 60560.37740d97b418899a5d21.bundle.js} +2 -2
  78. package/dist/{60560.024578077d95b851beea.bundle.js.map → 60560.37740d97b418899a5d21.bundle.js.map} +1 -1
  79. package/dist/67232.e76f40f9d09e64ebb365.bundle.js.map +1 -1
  80. package/dist/67888.7d4966e0a22ba655f1b8.bundle.js +2 -0
  81. package/dist/67888.7d4966e0a22ba655f1b8.bundle.js.map +1 -0
  82. package/dist/72379.bac50d0011665a85b6cd.bundle.js +2 -0
  83. package/dist/72379.bac50d0011665a85b6cd.bundle.js.map +1 -0
  84. package/dist/73667.3dd4f377e7ef54fd8758.bundle.js +2 -0
  85. package/dist/73667.3dd4f377e7ef54fd8758.bundle.js.map +1 -0
  86. package/dist/73779.193df86f08e3a1d06d67.bundle.js +2 -0
  87. package/dist/73779.193df86f08e3a1d06d67.bundle.js.map +1 -0
  88. package/dist/73793.6d80d47c26ed60a587fd.bundle.js +2 -0
  89. package/dist/73793.6d80d47c26ed60a587fd.bundle.js.map +1 -0
  90. package/dist/75282.88819e851ed18720b275.bundle.js +2 -0
  91. package/dist/75282.88819e851ed18720b275.bundle.js.map +1 -0
  92. package/dist/75849.51ade15bf0074eab76f3.bundle.js +2 -0
  93. package/dist/75849.51ade15bf0074eab76f3.bundle.js.map +1 -0
  94. package/dist/78013.e32fade7ad42b64c8122.bundle.js +2 -0
  95. package/dist/78013.e32fade7ad42b64c8122.bundle.js.map +1 -0
  96. package/dist/78250.6db42146a120459280e4.bundle.js +2 -0
  97. package/dist/78250.6db42146a120459280e4.bundle.js.map +1 -0
  98. package/dist/{78681.e44a1eb1dce4a8a29f57.bundle.js → 78681.39694d37c0f75ea04df6.bundle.js} +2 -2
  99. package/dist/{78681.e44a1eb1dce4a8a29f57.bundle.js.map → 78681.39694d37c0f75ea04df6.bundle.js.map} +1 -1
  100. package/dist/79329.5a5cbfa466d1c62af915.bundle.js +2 -0
  101. package/dist/79329.5a5cbfa466d1c62af915.bundle.js.map +1 -0
  102. package/dist/82206.8ec983edcf675cfd4531.bundle.js +2 -0
  103. package/dist/82206.8ec983edcf675cfd4531.bundle.js.map +1 -0
  104. package/dist/82896.9aed45baf67510717c6f.bundle.js +2 -0
  105. package/dist/82896.9aed45baf67510717c6f.bundle.js.map +1 -0
  106. package/dist/{82926.f625cc022724426fb8fb.bundle.js → 82926.93dbf44f2bcccba34e9b.bundle.js} +2 -2
  107. package/dist/{82926.f625cc022724426fb8fb.bundle.js.map → 82926.93dbf44f2bcccba34e9b.bundle.js.map} +1 -1
  108. package/dist/85281.27b5a1eb8e7ac2cf8459.bundle.js +2 -0
  109. package/dist/85281.27b5a1eb8e7ac2cf8459.bundle.js.map +1 -0
  110. package/dist/{88206.fbbcf8ccd9460c579e87.bundle.js → 88206.28c337e2edbf17928836.bundle.js} +2 -2
  111. package/dist/88206.28c337e2edbf17928836.bundle.js.map +1 -0
  112. package/dist/9062.d9049833d076191d3e1a.bundle.js +2 -0
  113. package/dist/9062.d9049833d076191d3e1a.bundle.js.map +1 -0
  114. package/dist/99379.be6c85ef305af6667dc1.bundle.js +2 -0
  115. package/dist/99379.be6c85ef305af6667dc1.bundle.js.map +1 -0
  116. package/dist/99448.314018d0afb1af150ddf.bundle.js +2 -0
  117. package/dist/99448.314018d0afb1af150ddf.bundle.js.map +1 -0
  118. package/dist/api/error/error-base.d.ts +1 -1
  119. package/dist/api/ontotext-workbench-api.js +1 -1
  120. package/dist/api/ontotext-workbench-api.js.map +1 -1
  121. package/dist/i18n/locale-en.json +31 -0
  122. package/dist/i18n/locale-fr.json +31 -0
  123. package/dist/index.html +8 -8
  124. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  125. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  126. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  127. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  128. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  129. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  130. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  131. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  132. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  133. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  134. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  135. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  136. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +4 -3
  137. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  138. package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
  139. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  140. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  141. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  142. package/dist/js/angular/security/templates/user.html +2 -2
  143. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  144. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  145. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  146. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  147. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  148. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  149. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
  150. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  151. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  152. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  153. package/dist/legacyWorkbench.57fc12c172f6350ac4c5.js +3 -0
  154. package/dist/{legacyWorkbench.ad1d42d21ac42beabeb4.js.map → legacyWorkbench.57fc12c172f6350ac4c5.js.map} +1 -1
  155. package/dist/{main.400f2248f076a2d31d80.js → main.b9a83da68ffc43c91de0.js} +3 -3
  156. package/dist/{main.400f2248f076a2d31d80.js.map → main.b9a83da68ffc43c91de0.js.map} +1 -1
  157. package/dist/pages/aclmanagement.html +2 -2
  158. package/dist/pages/autocomplete.html +1 -1
  159. package/dist/pages/choose-repository-type.html +1 -1
  160. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  161. package/dist/pages/create-index.html +1 -1
  162. package/dist/pages/dependencies.html +1 -1
  163. package/dist/pages/domainRangeInfo.html +2 -2
  164. package/dist/pages/edit.html +1 -1
  165. package/dist/pages/explore.html +1 -1
  166. package/dist/pages/export.html +1 -1
  167. package/dist/pages/find.html +1 -1
  168. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  169. package/dist/pages/graphs-visualizations.html +7 -7
  170. package/dist/pages/guides.html +1 -1
  171. package/dist/pages/import.html +2 -2
  172. package/dist/pages/jdbc-create.html +1 -1
  173. package/dist/pages/login.html +1 -1
  174. package/dist/pages/monitor/backup-and-restore.html +1 -1
  175. package/dist/pages/monitor/queries.html +1 -1
  176. package/dist/pages/monitor/resources.html +1 -1
  177. package/dist/pages/namespaces.html +2 -2
  178. package/dist/pages/plugins.html +1 -1
  179. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  180. package/dist/pages/rdfrank.html +2 -2
  181. package/dist/pages/repositories.html +1 -1
  182. package/dist/pages/repository.html +1 -1
  183. package/dist/pages/similarity-indexes.html +1 -1
  184. package/dist/pages/sparql-editor.html +1 -1
  185. package/dist/pages/sparql-template-create.html +1 -1
  186. package/dist/pages/ux-test1.html +2 -2
  187. package/dist/pages/webapi.html +2 -2
  188. package/dist/plugins.js +1 -1
  189. package/dist/res/swagger5/css/onto-theme.css +1 -1
  190. package/dist/res/swagger5/index.html +11 -11
  191. package/dist/shared-components/cjs/onto-cookie-consent_2.cjs.entry.js +1 -1
  192. package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
  193. package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
  194. package/dist/shared-components/cjs/onto-footer_6.cjs.entry.js +1 -1
  195. package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
  196. package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
  197. package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
  198. package/dist/shared-components/collection/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.js +1 -1
  199. package/dist/shared-components/collection/components/dialogs/onto-dialog.js +1 -1
  200. package/dist/shared-components/collection/components/onto-cookie-consent/onto-cookie-consent.js +1 -1
  201. package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
  202. package/dist/shared-components/collection/components/onto-footer/onto-footer.js +1 -1
  203. package/dist/shared-components/collection/components/onto-header/onto-header.js +1 -1
  204. package/dist/shared-components/collection/components/onto-language-selector/onto-language-selector.js +1 -1
  205. package/dist/shared-components/collection/components/onto-layout/onto-layout.js +1 -1
  206. package/dist/shared-components/collection/components/onto-navbar/navbar-model.js +1 -1
  207. package/dist/shared-components/collection/components/onto-navbar/navbar-service.js +1 -1
  208. package/dist/shared-components/collection/components/onto-operations-notification/onto-operations-notification.js +1 -1
  209. package/dist/shared-components/collection/components/onto-rdf-search/onto-rdf-search.js +1 -1
  210. package/dist/shared-components/collection/components/onto-repository-selector/onto-repository-selector.js +1 -1
  211. package/dist/shared-components/collection/components/onto-search-icon/onto-search-icon.js +1 -1
  212. package/dist/shared-components/collection/components/onto-search-resource-input/onto-search-resource-input.js +1 -1
  213. package/dist/shared-components/collection/components/onto-toastr/onto-toastr.js +1 -1
  214. package/dist/shared-components/collection/components/onto-toggle-switch/onto-toggle-switch.js +1 -1
  215. package/dist/shared-components/collection/components/onto-tooltip/onto-tooltip.js +1 -1
  216. package/dist/shared-components/collection/components/translate-label/translate-label.js +1 -1
  217. package/dist/shared-components/esm/onto-cookie-consent_2.entry.js +1 -1
  218. package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
  219. package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
  220. package/dist/shared-components/esm/onto-footer_6.entry.js +1 -1
  221. package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
  222. package/dist/shared-components/esm/onto-layout.entry.js +1 -1
  223. package/dist/shared-components/esm/translate-label.entry.js +1 -1
  224. package/dist/shared-components/shared-components/p-17bac1e3.entry.js +1 -0
  225. package/dist/shared-components/shared-components/p-1bc2ac8e.entry.js +1 -0
  226. package/dist/shared-components/shared-components/p-2433b25f.entry.js +1 -0
  227. package/dist/shared-components/shared-components/p-25fa0ee5.entry.js +1 -0
  228. package/dist/shared-components/shared-components/{p-a4e82a3f.entry.js → p-6266be98.entry.js} +1 -1
  229. package/dist/shared-components/shared-components/{p-eed8b067.entry.js → p-91ad7f7f.entry.js} +1 -1
  230. package/dist/shared-components/shared-components/p-aef0b970.entry.js +1 -0
  231. package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
  232. package/dist/shared-components/types/components/onto-dropdown/onto-dropdown.d.ts +2 -2
  233. package/dist/shared-components/types/components/onto-navbar/navbar-model.d.ts +4 -1
  234. package/dist/shared-components/types/components/onto-navbar/navbar-toggled-event.d.ts +1 -1
  235. package/dist/shared-components/types/components/onto-navbar/onto-navbar.d.ts +2 -2
  236. package/dist/shared-components/types/components/onto-test-context/onto-test-context.d.ts +23 -23
  237. package/dist/shared-components/types/components/onto-tooltip/models/onto-tooltip-configuration.d.ts +1 -2
  238. package/dist/shared-components/types/components.d.ts +4 -4
  239. package/dist/shared-components/types/models/component-event.d.ts +1 -1
  240. package/dist/shared-components/types/utils/function-utils.d.ts +1 -1
  241. package/dist/shared-components/types/utils/tooltip-util.d.ts +2 -2
  242. package/dist/workbench/workbench/workbenchApp.js +1 -1
  243. package/package.json +8 -2
  244. package/dist/10142.6a276ff32f58aa4d1b72.bundle.js +0 -2
  245. package/dist/10142.6a276ff32f58aa4d1b72.bundle.js.map +0 -1
  246. package/dist/10153.1532fddd43604bf408c3.bundle.js +0 -2
  247. package/dist/10153.1532fddd43604bf408c3.bundle.js.map +0 -1
  248. package/dist/10406.7fed4b667b0d2813b305.bundle.js +0 -2
  249. package/dist/12358.736ea9c178c92655de3a.bundle.js +0 -3
  250. package/dist/12358.736ea9c178c92655de3a.bundle.js.map +0 -1
  251. package/dist/12396.47201b3f37dcfe963353.bundle.js +0 -2
  252. package/dist/12396.47201b3f37dcfe963353.bundle.js.map +0 -1
  253. package/dist/14874.17bc671b6ff6123b9eb1.bundle.js +0 -2
  254. package/dist/14874.17bc671b6ff6123b9eb1.bundle.js.map +0 -1
  255. package/dist/15535.e3d3f8071a4cc462b5eb.bundle.js +0 -2
  256. package/dist/15535.e3d3f8071a4cc462b5eb.bundle.js.map +0 -1
  257. package/dist/16162.bc70365c3f546e70a3e9.bundle.js +0 -2
  258. package/dist/16162.bc70365c3f546e70a3e9.bundle.js.map +0 -1
  259. package/dist/20287.c3d0095a3a5f18cd0087.bundle.js +0 -2
  260. package/dist/20287.c3d0095a3a5f18cd0087.bundle.js.map +0 -1
  261. package/dist/21136.fb6d69cd9e6dd31a65b2.bundle.js +0 -2
  262. package/dist/21136.fb6d69cd9e6dd31a65b2.bundle.js.map +0 -1
  263. package/dist/21142.0589f58f1a3b49b4fcfa.bundle.js +0 -2
  264. package/dist/21142.0589f58f1a3b49b4fcfa.bundle.js.map +0 -1
  265. package/dist/21170.8126948c956555b4f9ff.bundle.js +0 -2
  266. package/dist/21170.8126948c956555b4f9ff.bundle.js.map +0 -1
  267. package/dist/21195.77df14ed68c1f286839a.bundle.js +0 -2
  268. package/dist/21195.77df14ed68c1f286839a.bundle.js.map +0 -1
  269. package/dist/25747.612b1bce6250300d137f.bundle.js +0 -2
  270. package/dist/25747.612b1bce6250300d137f.bundle.js.map +0 -1
  271. package/dist/27580.88bc1444d863327a3697.bundle.js +0 -2
  272. package/dist/27580.88bc1444d863327a3697.bundle.js.map +0 -1
  273. package/dist/28050.1359d262b2e2c497ad6d.bundle.js +0 -2
  274. package/dist/28050.1359d262b2e2c497ad6d.bundle.js.map +0 -1
  275. package/dist/31636.625df78d380dadd69c07.bundle.js +0 -2
  276. package/dist/31636.625df78d380dadd69c07.bundle.js.map +0 -1
  277. package/dist/32489.5f438460389d65300913.bundle.js +0 -2
  278. package/dist/32489.5f438460389d65300913.bundle.js.map +0 -1
  279. package/dist/32534.73081e468e918a03bd70.bundle.js +0 -2
  280. package/dist/32534.73081e468e918a03bd70.bundle.js.map +0 -1
  281. package/dist/32606.376e14770ba6e81b7159.bundle.js +0 -2
  282. package/dist/32606.376e14770ba6e81b7159.bundle.js.map +0 -1
  283. package/dist/34495.e0f8e26f32d7d8def627.bundle.js +0 -2
  284. package/dist/34495.e0f8e26f32d7d8def627.bundle.js.map +0 -1
  285. package/dist/38360.437a12fa59878d1d43b9.bundle.js.map +0 -1
  286. package/dist/38412.85b4c12f5ed5ffb6e4dd.bundle.js +0 -2
  287. package/dist/38412.85b4c12f5ed5ffb6e4dd.bundle.js.map +0 -1
  288. package/dist/38644.6e82d4276df028701834.bundle.js +0 -2
  289. package/dist/38644.6e82d4276df028701834.bundle.js.map +0 -1
  290. package/dist/38843.428e7caf2e6805840b83.bundle.js +0 -2
  291. package/dist/38843.428e7caf2e6805840b83.bundle.js.map +0 -1
  292. package/dist/39518.0ee809a85c83dba1f56a.bundle.js +0 -2
  293. package/dist/39539.2a03bf4161ee846817d3.bundle.js +0 -2
  294. package/dist/39539.2a03bf4161ee846817d3.bundle.js.map +0 -1
  295. package/dist/39874.c2d7cab1a65e5a869e78.bundle.js.map +0 -1
  296. package/dist/41453.5370acf9540ff5382268.bundle.js +0 -2
  297. package/dist/41453.5370acf9540ff5382268.bundle.js.map +0 -1
  298. package/dist/42129.02f0b477c276dceb732c.bundle.js +0 -2
  299. package/dist/42129.02f0b477c276dceb732c.bundle.js.map +0 -1
  300. package/dist/44444.57b74adca89db793b77c.bundle.js +0 -2
  301. package/dist/44444.57b74adca89db793b77c.bundle.js.map +0 -1
  302. package/dist/44874.60bab9adf89019b35654.bundle.js +0 -2
  303. package/dist/44874.60bab9adf89019b35654.bundle.js.map +0 -1
  304. package/dist/45758.4e363b98020c3460b4ff.bundle.js +0 -2
  305. package/dist/45758.4e363b98020c3460b4ff.bundle.js.map +0 -1
  306. package/dist/46591.ac9d19fd699104a9ed9b.bundle.js.map +0 -1
  307. package/dist/55862.81467f263f3c46d9d889.bundle.js +0 -2
  308. package/dist/55862.81467f263f3c46d9d889.bundle.js.map +0 -1
  309. package/dist/58163.747b20ea052b22b24bd0.bundle.js +0 -2
  310. package/dist/58163.747b20ea052b22b24bd0.bundle.js.map +0 -1
  311. package/dist/58306.0ca44cc562ab1135c44b.bundle.js +0 -2
  312. package/dist/58306.0ca44cc562ab1135c44b.bundle.js.map +0 -1
  313. package/dist/67888.cc78716f885f98366859.bundle.js +0 -2
  314. package/dist/67888.cc78716f885f98366859.bundle.js.map +0 -1
  315. package/dist/72379.4023fb8f5c0dd8f32faa.bundle.js +0 -2
  316. package/dist/72379.4023fb8f5c0dd8f32faa.bundle.js.map +0 -1
  317. package/dist/73667.6925315f2649c49bade2.bundle.js +0 -2
  318. package/dist/73667.6925315f2649c49bade2.bundle.js.map +0 -1
  319. package/dist/73779.c4608b73b63083cb3352.bundle.js +0 -2
  320. package/dist/73779.c4608b73b63083cb3352.bundle.js.map +0 -1
  321. package/dist/73793.0cd99844e3792d5beb8c.bundle.js +0 -2
  322. package/dist/73793.0cd99844e3792d5beb8c.bundle.js.map +0 -1
  323. package/dist/75282.1005c493f43b9d6dcc5a.bundle.js +0 -2
  324. package/dist/75282.1005c493f43b9d6dcc5a.bundle.js.map +0 -1
  325. package/dist/75849.39b30ee4eb2f1b35f762.bundle.js +0 -2
  326. package/dist/75849.39b30ee4eb2f1b35f762.bundle.js.map +0 -1
  327. package/dist/78250.8462f5662da1fd9ece0b.bundle.js +0 -2
  328. package/dist/78250.8462f5662da1fd9ece0b.bundle.js.map +0 -1
  329. package/dist/79329.cd81f51fd3aed8ca8359.bundle.js +0 -2
  330. package/dist/79329.cd81f51fd3aed8ca8359.bundle.js.map +0 -1
  331. package/dist/82206.b3b37c3e0cc1aa18148c.bundle.js +0 -2
  332. package/dist/82206.b3b37c3e0cc1aa18148c.bundle.js.map +0 -1
  333. package/dist/85281.049ddec87de0b8b07e79.bundle.js +0 -2
  334. package/dist/85281.049ddec87de0b8b07e79.bundle.js.map +0 -1
  335. package/dist/88206.fbbcf8ccd9460c579e87.bundle.js.map +0 -1
  336. package/dist/9062.2b577ad9fc05b48b64a3.bundle.js +0 -2
  337. package/dist/9062.2b577ad9fc05b48b64a3.bundle.js.map +0 -1
  338. package/dist/99379.d5dffb14dd46150e91f9.bundle.js +0 -2
  339. package/dist/99379.d5dffb14dd46150e91f9.bundle.js.map +0 -1
  340. package/dist/99448.98a68cbf8bf84857b615.bundle.js +0 -2
  341. package/dist/99448.98a68cbf8bf84857b615.bundle.js.map +0 -1
  342. package/dist/legacyWorkbench.ad1d42d21ac42beabeb4.js +0 -3
  343. package/dist/shared-components/shared-components/p-106d7df8.entry.js +0 -1
  344. package/dist/shared-components/shared-components/p-17ce51bb.entry.js +0 -1
  345. package/dist/shared-components/shared-components/p-306527cc.entry.js +0 -1
  346. package/dist/shared-components/shared-components/p-96e87635.entry.js +0 -1
  347. package/dist/shared-components/shared-components/p-af359495.entry.js +0 -1
  348. /package/dist/{12358.736ea9c178c92655de3a.bundle.js.LICENSE.txt → 12358.2061f29dc113149946a3.bundle.js.LICENSE.txt} +0 -0
  349. /package/dist/{legacyWorkbench.ad1d42d21ac42beabeb4.js.LICENSE.txt → legacyWorkbench.57fc12c172f6350ac4c5.js.LICENSE.txt} +0 -0
  350. /package/dist/{main.400f2248f076a2d31d80.js.LICENSE.txt → main.b9a83da68ffc43c91de0.js.LICENSE.txt} +0 -0
  351. /package/dist/shared-components/cjs/{tooltip-util-CmDLnWqH.js → tooltip-util-CnEXLMnw.js} +0 -0
  352. /package/dist/shared-components/esm/{tooltip-util-C1So-qrf.js → tooltip-util-BqOc8q8q.js} +0 -0
  353. /package/dist/shared-components/shared-components/{p-Bisudk7O.js → p-DzOPDgzQ.js} +0 -0
@@ -1 +1 @@
1
- "use strict";var index=require("./index-jdsA9lN2.js"),workbenchApi=require("@ontotext/workbench-api");function debounce(e,i=300){let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>e.apply(this,s),i)}}const RESPONSIVE_BREAKPOINTS={MD:768},WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR=RESPONSIVE_BREAKPOINTS.MD,ontoLayoutCss=':host{display:block;height:100%}.wb-layout{display:grid;grid-template-columns:15rem minmax(200px, 1fr);grid-template-rows:auto 1fr auto;grid-template-areas:"nav header" "nav main" "nav footer";min-height:100vh;margin:0}.wb-layout.expanded{grid-template-columns:4.375rem 1fr}.wb-layout nav{grid-area:nav}.wb-layout header{grid-area:header}.wb-layout main{grid-area:main}.wb-layout main .main-container{margin-left:0}.wb-layout .default-slot-wrapper{display:none}.wb-layout footer{grid-area:footer}.wb-header{position:sticky;top:0;z-index:999}',OntoLayout=class{constructor(e){index.registerInstance(this,e),this.securityContextService=workbenchApi.ServiceProvider.get(workbenchApi.SecurityContextService),this.authenticationService=workbenchApi.ServiceProvider.get(workbenchApi.AuthenticationService),this.navigationContextService=workbenchApi.ServiceProvider.get(workbenchApi.NavigationContextService),this.isLowResolution=!1,this.hasPermission=!0,this.showHeader=this.isAuthenticatedFully(),this.subscriptions=new workbenchApi.SubscriptionList,this.isNavbarCollapsed=!1,this.windowResizeObserver=debounce(()=>this.windowResizeHandler(),50),workbenchApi.WindowService.getWindow().addEventListener("storage",this.handleStorageChange)}componentDidLoad(){this.windowResizeHandler()}connectedCallback(){this.subscribeToSecurityChanges(),this.updateVisibility(),this.subscriptions.add(this.securityContextService.onRestrictedPagesChanged(e=>this.setPermission(e))),this.subscriptions.add(workbenchApi.ServiceProvider.get(workbenchApi.EventService).subscribe(workbenchApi.EventName.NAVIGATION_END,e=>{this.navigationContextService.updatePreviousRoute(e.oldUrl),this.setPermission(this.securityContextService.getRestrictedPages())})),this.setPermission(this.securityContextService.getRestrictedPages())}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return index.h(index.Host,{key:"8ac7b898ae52fb40814ae664c1666ac3d05e3263",class:"wb-layout"},index.h("div",{key:"2672ccbf6b5f17a25cca8e4db244705ac0fc333d",class:"default-slot-wrapper"},index.h("slot",{key:"24543fc3c526950e944dc4e37e4ed559fae1c389",name:"default"})),index.h("header",{key:"a67d6e4932aae82b474d70d220415cea271ffeb9",class:"wb-header"},this.showHeader&&index.h("onto-header",{key:"8bb74bfea276d89824ead02609e80c070582d35e"})),index.h("nav",{key:"e5f83abdc3d6f1d89d9e6e2f83b7c6a62bc22389",class:"wb-navbar"},index.h("onto-navbar",{key:"2265c999b7650d255f28efd07b1f9977b7a9498f",ref:this.assignNavbarRef(),"navbar-collapsed":this.isLowResolution})),this.hasPermission?index.h("div",{class:"main-slot-wrapper"},index.h("slot",{name:"main"})):index.h("onto-permission-banner",null),index.h("footer",{key:"016c8d0c9c1de47b9c4ccf64a0f717ee67f4fcbc",class:"wb-footer"},index.h("onto-footer",{key:"90787f7d2c4cf1840ae3048d4b60f4f7c1ea948f"})),index.h("onto-tooltip",{key:"329f4cf1b14442c59da0125bc8b607185d402134"}),index.h("onto-toastr",{key:"615db8b9c70a90521ff393c5f98ff1d0c2f511b4"}))}onNavbarToggled(e){this.isNavbarCollapsed=e.detail.payload,this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}onResize(){this.windowResizeObserver()}windowResizeHandler(){this.isLowResolution=workbenchApi.WindowService.getWindow().innerWidth<=WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR,this.isLowResolution||this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}handleStorageChange(e){workbenchApi.ServiceProvider.get(workbenchApi.LocalStorageSubscriptionHandlerService).handleStorageChange(e)}subscribeToSecurityChanges(){const e=workbenchApi.ServiceProvider.get(workbenchApi.SecurityContextService);this.subscriptions.add(e.onAuthenticatedUserChanged(e=>{this.authenticatedUser=e,this.updateVisibility()})),this.subscriptions.add(e.onSecurityConfigChanged(e=>{this.securityConfig=e,this.updateVisibility()})),this.subscriptions.add(workbenchApi.ServiceProvider.get(workbenchApi.EventService).subscribe(workbenchApi.EventName.LOGOUT,()=>{this.setNavbarItemVisibility(),this.updateVisibility()})),this.subscriptions.add(e.onAuthTokenChanged(()=>{this.setNavbarItemVisibility(),this.updateVisibility()}))}setPermission(e){if(e){const i=workbenchApi.getPathName();this.hasPermission=!e.isRestricted(i)}else this.hasPermission=!0;const i=document.querySelector(".wb-layout main");i&&(i.style.display=this.hasPermission?"block":"none")}updateVisibility(){this.authenticationService.isSecurityEnabled()?this.showHeader=this.authenticationService.isLoggedIn()||this.authenticationService.hasFreeAccess():this.showHeader=!0}isAuthenticatedFully(){const e=workbenchApi.ServiceProvider.get(workbenchApi.AuthenticationService);return!e.isSecurityEnabled()||e.isLoggedIn()||e.hasFreeAccess()}shouldShowMenu(e){return this.isAuthenticatedFully()&&workbenchApi.ServiceProvider.get(workbenchApi.AuthenticationService).hasRole(e)}assignNavbarRef(){return e=>{this.navbarRef=e,this.navbarRef.menuItems=workbenchApi.WindowService.getWindow().PluginRegistry.get("main.menu"),this.setNavbarItemVisibility()}}setNavbarItemVisibility(){var e,i,t;if(!(null===(e=this.navbarRef)||void 0===e?void 0:e.menuItems))return;const s=e=>{var i;e.shouldShow=this.shouldShowMenu(e.role),(null===(i=e.children)||void 0===i?void 0:i.length)&&e.children.forEach(s)};null===(t=null===(i=this.navbarRef)||void 0===i?void 0:i.menuItems)||void 0===t||t.forEach(e=>{e.items.forEach(s)}),this.navbarRef.menuItems=[...this.navbarRef.menuItems]}get hostElement(){return index.getElement(this)}};OntoLayout.style=ontoLayoutCss,exports.onto_layout=OntoLayout;
1
+ "use strict";var index=require("./index-jdsA9lN2.js"),workbenchApi=require("@ontotext/workbench-api");function debounce(e,i=300){let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>e.apply(this,s),i)}}const RESPONSIVE_BREAKPOINTS={MD:768},WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR=RESPONSIVE_BREAKPOINTS.MD,ontoLayoutCss=':host{display:block;height:100%}.wb-layout{display:grid;grid-template-columns:15rem minmax(200px, 1fr);grid-template-rows:auto 1fr auto;grid-template-areas:"nav header" "nav main" "nav footer";min-height:100vh;margin:0}.wb-layout.expanded{grid-template-columns:4.375rem 1fr}.wb-layout nav{grid-area:nav}.wb-layout header{grid-area:header}.wb-layout main{grid-area:main}.wb-layout main .main-container{margin-left:0}.wb-layout .default-slot-wrapper{display:none}.wb-layout footer{grid-area:footer}.wb-header{position:sticky;top:0;z-index:999}',OntoLayout=class{constructor(e){index.registerInstance(this,e),this.securityContextService=workbenchApi.ServiceProvider.get(workbenchApi.SecurityContextService),this.authenticationService=workbenchApi.ServiceProvider.get(workbenchApi.AuthenticationService),this.navigationContextService=workbenchApi.ServiceProvider.get(workbenchApi.NavigationContextService),this.isLowResolution=!1,this.hasPermission=!0,this.showHeader=this.isAuthenticatedFully(),this.subscriptions=new workbenchApi.SubscriptionList,this.isNavbarCollapsed=!1,this.windowResizeObserver=debounce(()=>this.windowResizeHandler(),50),workbenchApi.WindowService.getWindow().addEventListener("storage",this.handleStorageChange)}componentDidLoad(){this.windowResizeHandler()}connectedCallback(){this.subscribeToSecurityChanges(),this.updateVisibility(),this.subscriptions.add(this.securityContextService.onRestrictedPagesChanged(e=>this.setPermission(e))),this.subscriptions.add(workbenchApi.ServiceProvider.get(workbenchApi.EventService).subscribe(workbenchApi.EventName.NAVIGATION_END,e=>{this.navigationContextService.updatePreviousRoute(e.oldUrl),this.setPermission(this.securityContextService.getRestrictedPages())})),this.setPermission(this.securityContextService.getRestrictedPages())}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return index.h(index.Host,{key:"90a5dad7d845cea4850e1c30536d342b2818675e",class:"wb-layout"},index.h("div",{key:"f0696fdfd37916dce67c19b0e24e9ea8ab8ca25e",class:"default-slot-wrapper"},index.h("slot",{key:"fc64ae48959eab6701fb525ce3cba116b6d5f691",name:"default"})),index.h("header",{key:"0707ae4470abc2fce8a04c76bf06ad5e6d140851",class:"wb-header"},this.showHeader&&index.h("onto-header",{key:"3f449a558cd503feba57d0cdbafe57d3552065a2"})),index.h("nav",{key:"2b36a84437f77c6e3712ec6d8859bb49f580dba4",class:"wb-navbar"},index.h("onto-navbar",{key:"528842ea4de9302d682b613fea34f35ee5a56ef4",ref:this.assignNavbarRef(),"navbar-collapsed":this.isLowResolution})),this.hasPermission?index.h("div",{class:"main-slot-wrapper"},index.h("slot",{name:"main"})):index.h("onto-permission-banner",null),index.h("footer",{key:"0c47d98ea4aec920ce7cdd47ae2f8d1055a6ca1e",class:"wb-footer"},index.h("onto-footer",{key:"56fd061c93680623d7e8e67129a16e6aec4517cf"})),index.h("onto-tooltip",{key:"63ff5af241e77411cc5bb8ebf66a349330a69447"}),index.h("onto-toastr",{key:"ca03acdceccfe38dce6440ebe0b71d71ad26b1d3"}))}onNavbarToggled(e){this.isNavbarCollapsed=e.detail.payload,this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}onResize(){this.windowResizeObserver()}windowResizeHandler(){this.isLowResolution=workbenchApi.WindowService.getWindow().innerWidth<=WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR,this.isLowResolution||this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}handleStorageChange(e){workbenchApi.ServiceProvider.get(workbenchApi.LocalStorageSubscriptionHandlerService).handleStorageChange(e)}subscribeToSecurityChanges(){const e=workbenchApi.ServiceProvider.get(workbenchApi.SecurityContextService);this.subscriptions.add(e.onAuthenticatedUserChanged(e=>{this.authenticatedUser=e,this.updateVisibility()})),this.subscriptions.add(e.onSecurityConfigChanged(e=>{this.securityConfig=e,this.updateVisibility()})),this.subscriptions.add(workbenchApi.ServiceProvider.get(workbenchApi.EventService).subscribe(workbenchApi.EventName.LOGOUT,()=>{this.setNavbarItemVisibility(),this.updateVisibility()})),this.subscriptions.add(e.onAuthTokenChanged(()=>{this.setNavbarItemVisibility(),this.updateVisibility()}))}setPermission(e){if(e){const i=workbenchApi.getPathName();this.hasPermission=!e.isRestricted(i)}else this.hasPermission=!0;const i=document.querySelector(".wb-layout main");i&&(i.style.display=this.hasPermission?"block":"none")}updateVisibility(){this.authenticationService.isSecurityEnabled()?this.showHeader=this.authenticationService.isLoggedIn()||this.authenticationService.hasFreeAccess():this.showHeader=!0}isAuthenticatedFully(){const e=workbenchApi.ServiceProvider.get(workbenchApi.AuthenticationService);return!e.isSecurityEnabled()||e.isLoggedIn()||e.hasFreeAccess()}shouldShowMenu(e){return this.isAuthenticatedFully()&&workbenchApi.ServiceProvider.get(workbenchApi.AuthenticationService).hasRole(e)}assignNavbarRef(){return e=>{this.navbarRef=e,this.navbarRef.menuItems=workbenchApi.WindowService.getWindow().PluginRegistry.get("main.menu"),this.setNavbarItemVisibility()}}setNavbarItemVisibility(){var e,i,t;if(!(null===(e=this.navbarRef)||void 0===e?void 0:e.menuItems))return;const s=e=>{var i;e.shouldShow=this.shouldShowMenu(e.role),(null===(i=e.children)||void 0===i?void 0:i.length)&&e.children.forEach(s)};null===(t=null===(i=this.navbarRef)||void 0===i?void 0:i.menuItems)||void 0===t||t.forEach(e=>{e.items.forEach(s)}),this.navbarRef.menuItems=[...this.navbarRef.menuItems]}get hostElement(){return index.getElement(this)}};OntoLayout.style=ontoLayoutCss,exports.onto_layout=OntoLayout;
@@ -1 +1 @@
1
- "use strict";var index=require("./index-jdsA9lN2.js"),translation_service=require("./translation.service-DjdwDpXN.js");require("@ontotext/workbench-api");const translateLabelCss=":host{display:inline}",TranslateLabel=class{constructor(e){index.registerInstance(this,e),this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=translation_service.TranslationService.onTranslate(this.labelKey,this.translationParameters,e=>this.translatedLabel=e)}disconnectedCallback(){this.unsubscribeTranslationChanged&&this.unsubscribeTranslationChanged()}render(){return index.h(index.Host,{key:"379e2bf98a702473ef9753bde148d608f2b27509"},this.translatedLabel)}};TranslateLabel.style=translateLabelCss,exports.translate_label=TranslateLabel;
1
+ "use strict";var index=require("./index-jdsA9lN2.js"),translation_service=require("./translation.service-DjdwDpXN.js");require("@ontotext/workbench-api");const translateLabelCss=":host{display:inline}",TranslateLabel=class{constructor(a){index.registerInstance(this,a),this.unsubscribeTranslationChanged=null,this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=translation_service.TranslationService.onTranslate(this.labelKey,this.translationParameters,a=>this.translatedLabel=a)}disconnectedCallback(){this.unsubscribeTranslationChanged&&(this.unsubscribeTranslationChanged(),this.unsubscribeTranslationChanged=null)}render(){return index.h(index.Host,{key:"ae48f9b9f9d91494190d3666aa96f77c98da20f1"},this.translatedLabel)}};TranslateLabel.style=translateLabelCss,exports.translate_label=TranslateLabel;
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{TranslationService}from"../../../services/translation.service";import{SecurityContextService,ServiceProvider,CookieConsent,SecurityService}from"../../../../../../api/dist/ontotext-workbench-api";var CookieType;!function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(CookieType||(CookieType={}));export class OntoCookiePolicyDialog{constructor(){this.user=ServiceProvider.get(SecurityContextService).getAuthenticatedUser(),this.securityService=ServiceProvider.get(SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(console.error)}render(){var e,a;const t={dialogTitle:TranslationService.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},o=new CookieConsent(null===(a=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return h("onto-dialog",{key:"5c9716eebf02b30a51d90af98775d7e183618290",config:t},h("div",{key:"afdaebff817f24cfda4bafbcc386a741f7907674",slot:"body"},h("section",{key:"5387b27738aaba232f3646a1a71fbe1bc7b5332f"},h("h4",{key:"ab64a92c9e72bfa48868b5e8e8055eb674e40eda"},h("translate-label",{key:"b7f62e750e65a6d354e2f3bc9bfaf6d5eca304d4",labelKey:"cookie.policy.purpose_heading"})),h("p",{key:"0354cbaf054caa4680d548f33434bbee4527c40e"},h("translate-label",{key:"69c60946be613dea36d2690d287e645edb71483a",labelKey:"cookie.policy.purpose_text"})),h("p",{key:"055e50c6a516413f46a35c7b85952e4aa1a9f9df"},h("translate-label",{key:"70857b357e74bb7dfb8c384883668c8b2482ca4a",labelKey:"cookie.policy.purpose_enterprise_text"}))),h("section",{key:"6e71eb5aae17c6da27bf257cae2a0760860df5d1"},h("h4",{key:"83b3b663f46498e43c7ab30410de8f074243c3ae"},h("translate-label",{key:"2f6b5c9c10ace40140ecafbcd7d10709df14b1ab",labelKey:"cookie.policy.privacy_commitment_heading"})),h("p",{key:"09f6d19d59629866fa3b21842831d392b9e555ec"},h("translate-label",{key:"4c8f23a3c88299a4fd5d390eaa4a7afa5862d9ad",labelKey:"cookie.policy.privacy_commitment_text"})),h("ul",{key:"09b90acc150cf43a9e59297b34657d9c0d6f58cf"},h("li",{key:"703ef7e25fb39d5d42980653b1fcf86d8a94557c"},h("translate-label",{key:"df7d2a7233e3c18a068fa9058c3c193d3cd29aa9",labelKey:"cookie.policy.privacy_commitment_1"})),h("li",{key:"8d31ea369caab98410d1ca4d10ca56acbf712b4d"},h("translate-label",{key:"4cf9f87d207ae4a56f5ef25ad5e61ae49229a66d",labelKey:"cookie.policy.privacy_commitment_2"})))),h("section",{key:"11a8ff13f5ccf5ce1ee72a6ddd14f7a15aaf28a8"},h("h4",{key:"05c721ac41e0ce384336f36efbed649cdf3c8521"},h("translate-label",{key:"0311734172a238e9a34d5b646ce7226146ca4fb4",labelKey:"cookie.policy.cookies_heading"})),h("p",{key:"9b6348c8749b252e1308c2217753333d7f34510d"},h("translate-label",{key:"ec1a61b4d8c13ade4a3596818916bd4fb0ea9250",labelKey:"cookie.policy.cookies_text"}))),h("section",{key:"0a56afdf911e56f1e857bd9c8141214b841cfab6"},h("h4",{key:"1aab64214b9a77114cd6a57ad32386dcc7361f92"},h("translate-label",{key:"124cd6d94ab003ee056b8f57a1550604500d2af8",labelKey:"cookie.policy.manage_cookies_heading"})),h("onto-toggle-switch",{key:"d5e9c3008e8286bc6223fe46d955b8f40e229401",checked:null==o?void 0:o.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:CookieType.STATISTIC}),h("p",{key:"950ed4231c70d11951d75d5c7e2f4baa3b037a29"},h("translate-label",{key:"89d34f7bdedcb706c873f14d7cab5cc3d7c02f24",labelKey:"cookie.policy.statistic_text"})),h("onto-toggle-switch",{key:"ec5ad346c46f236b53738df40661b39581441c76",checked:null==o?void 0:o.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:CookieType.THIRD_PARTY}),h("p",{key:"dcb9444ad459d3ae88200c4d6aabb60ac32ac0b2"},h("translate-label",{key:"7f8f517ed2b9eb396cda52247f93e2269e081169",labelKey:"cookie.policy.third_party_cookies_text"}))),h("p",{key:"bd784e85cfbd3189e52ce75159a7c2727c8b71bc"},h("span",{key:"5cd30d116bf907e58ee72b5b9d87c46895287085"},h("translate-label",{key:"bc7ef9a8f755ec932c93eb6f37f47646c3d9d4db",labelKey:"cookie.policy.change_cookies"}),h("i",{key:"f77778f441780569f9519112b54827f64ef45c4b"}," ",h("translate-label",{key:"327b6accb62caf5075e2d7d5191b55a375cbd7e8",labelKey:"menu.setup.label"})," > ",h("translate-label",{key:"f4d1aa6a0ff386f5dcc91644c444c0cbdb31de93",labelKey:"menu.my.settings.label"})," > ",h("translate-label",{key:"6addb466067cca060041f13085d1bad6d8dada18",labelKey:"security.user.settings"})," > ",h("translate-label",{key:"40348ad073e5b407aa077a64ac19c4a4fcd5deec",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new CookieConsent(null===(t=null===(a=this.user)||void 0===a?void 0:a.appSettings)||void 0===t?void 0:t.COOKIE_CONSENT);return o[e.context]=e.checked,o.updatedAt=(new Date).getTime(),o}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings={}),this.user.appSettings.COOKIE_CONSENT=e}static get is(){return"onto-cookie-policy-dialog"}static get originalStyleUrls(){return{$:["onto-cookie-policy-dialog.scss"]}}static get styleUrls(){return{$:["onto-cookie-policy-dialog.css"]}}static get properties(){return{dialogHandler:{type:"unknown",attribute:"dialog-handler",mutable:!1,complexType:{original:"DialogHandler",resolved:"DialogHandler",references:{DialogHandler:{location:"import",path:"../../../models/dialog/dialog-handler",id:"src/models/dialog/dialog-handler.ts::DialogHandler"}}},required:!0,optional:!1,docs:{tags:[],text:"The dialog handler for managing the dialog's behavior."},getter:!1,setter:!1}}}static get listeners(){return[{name:"toggleChanged",method:"toggleChanged",target:void 0,capture:!1,passive:!1}]}}
1
+ import{h}from"@stencil/core";import{TranslationService}from"../../../services/translation.service";import{SecurityContextService,ServiceProvider,CookieConsent,SecurityService}from"../../../../../../api/dist/ontotext-workbench-api";var CookieType;!function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(CookieType||(CookieType={}));export class OntoCookiePolicyDialog{constructor(){this.user=ServiceProvider.get(SecurityContextService).getAuthenticatedUser(),this.securityService=ServiceProvider.get(SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(console.error)}render(){var e,a;const t={dialogTitle:TranslationService.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},o=new CookieConsent(null===(a=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return h("onto-dialog",{key:"5c9716eebf02b30a51d90af98775d7e183618290",config:t},h("div",{key:"afdaebff817f24cfda4bafbcc386a741f7907674",slot:"body"},h("section",{key:"5387b27738aaba232f3646a1a71fbe1bc7b5332f"},h("h4",{key:"ab64a92c9e72bfa48868b5e8e8055eb674e40eda"},h("translate-label",{key:"b7f62e750e65a6d354e2f3bc9bfaf6d5eca304d4",labelKey:"cookie.policy.purpose_heading"})),h("p",{key:"0354cbaf054caa4680d548f33434bbee4527c40e"},h("translate-label",{key:"69c60946be613dea36d2690d287e645edb71483a",labelKey:"cookie.policy.purpose_text"})),h("p",{key:"055e50c6a516413f46a35c7b85952e4aa1a9f9df"},h("translate-label",{key:"70857b357e74bb7dfb8c384883668c8b2482ca4a",labelKey:"cookie.policy.purpose_enterprise_text"}))),h("section",{key:"6e71eb5aae17c6da27bf257cae2a0760860df5d1"},h("h4",{key:"83b3b663f46498e43c7ab30410de8f074243c3ae"},h("translate-label",{key:"2f6b5c9c10ace40140ecafbcd7d10709df14b1ab",labelKey:"cookie.policy.privacy_commitment_heading"})),h("p",{key:"09f6d19d59629866fa3b21842831d392b9e555ec"},h("translate-label",{key:"4c8f23a3c88299a4fd5d390eaa4a7afa5862d9ad",labelKey:"cookie.policy.privacy_commitment_text"})),h("ul",{key:"09b90acc150cf43a9e59297b34657d9c0d6f58cf"},h("li",{key:"703ef7e25fb39d5d42980653b1fcf86d8a94557c"},h("translate-label",{key:"df7d2a7233e3c18a068fa9058c3c193d3cd29aa9",labelKey:"cookie.policy.privacy_commitment_1"})),h("li",{key:"8d31ea369caab98410d1ca4d10ca56acbf712b4d"},h("translate-label",{key:"4cf9f87d207ae4a56f5ef25ad5e61ae49229a66d",labelKey:"cookie.policy.privacy_commitment_2"})))),h("section",{key:"11a8ff13f5ccf5ce1ee72a6ddd14f7a15aaf28a8"},h("h4",{key:"05c721ac41e0ce384336f36efbed649cdf3c8521"},h("translate-label",{key:"0311734172a238e9a34d5b646ce7226146ca4fb4",labelKey:"cookie.policy.cookies_heading"})),h("p",{key:"9b6348c8749b252e1308c2217753333d7f34510d"},h("translate-label",{key:"ec1a61b4d8c13ade4a3596818916bd4fb0ea9250",labelKey:"cookie.policy.cookies_text"}))),h("section",{key:"0a56afdf911e56f1e857bd9c8141214b841cfab6"},h("h4",{key:"1aab64214b9a77114cd6a57ad32386dcc7361f92"},h("translate-label",{key:"124cd6d94ab003ee056b8f57a1550604500d2af8",labelKey:"cookie.policy.manage_cookies_heading"})),h("onto-toggle-switch",{key:"5cd4f7185729ac4741a1128b9be06d31ac7d7779",checked:null==o?void 0:o.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:CookieType.STATISTIC}),h("p",{key:"e4605b7731672924542ff9578bb7a4d631822927"},h("translate-label",{key:"3f119b863505286c2627a4f40327f81173c7df09",labelKey:"cookie.policy.statistic_text"})),h("onto-toggle-switch",{key:"12b41157eced1f90357f3e9780cd36694f2903e7",checked:null==o?void 0:o.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:CookieType.THIRD_PARTY}),h("p",{key:"1c93b76d442412854746e6aa75891a4a26664d88"},h("translate-label",{key:"52f2a72c222f2195b034c9e082b3848638382663",labelKey:"cookie.policy.third_party_cookies_text"}))),h("p",{key:"0a5b47d04abdec566b262fe469c30586f24f1b3e"},h("span",{key:"aabe70fb4f363aa7e1ce8db10c38215bc61ddbb9"},h("translate-label",{key:"b05702891f3c98aa7a404171a7db2fa77748d789",labelKey:"cookie.policy.change_cookies"}),h("i",{key:"24915a3359d6dfe55ff690035a2065f11178344a"}," ",h("translate-label",{key:"1e2318b63e72bc275ae3f6622a7a194d9d0b643e",labelKey:"menu.setup.label"})," > ",h("translate-label",{key:"24003f231854abb864c935f2931439dcf87c715f",labelKey:"menu.my.settings.label"})," > ",h("translate-label",{key:"b6dd2de94d005f6b6ad6495d680b66b11c02a035",labelKey:"security.user.settings"})," > ",h("translate-label",{key:"259fe2888ca703acc53ca90036686f8ba5cbc25d",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new CookieConsent(null===(t=null===(a=this.user)||void 0===a?void 0:a.appSettings)||void 0===t?void 0:t.COOKIE_CONSENT);return o[e.context]=e.checked,o.updatedAt=(new Date).getTime(),o}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings={}),this.user.appSettings.COOKIE_CONSENT=e}static get is(){return"onto-cookie-policy-dialog"}static get originalStyleUrls(){return{$:["onto-cookie-policy-dialog.scss"]}}static get styleUrls(){return{$:["onto-cookie-policy-dialog.css"]}}static get properties(){return{dialogHandler:{type:"unknown",attribute:"dialog-handler",mutable:!1,complexType:{original:"DialogHandler",resolved:"DialogHandler",references:{DialogHandler:{location:"import",path:"../../../models/dialog/dialog-handler",id:"src/models/dialog/dialog-handler.ts::DialogHandler"}}},required:!0,optional:!1,docs:{tags:[],text:"The dialog handler for managing the dialog's behavior."},getter:!1,setter:!1}}}static get listeners(){return[{name:"toggleChanged",method:"toggleChanged",target:void 0,capture:!1,passive:!1}]}}
@@ -1 +1 @@
1
- import{Host,h}from"@stencil/core";import{HtmlUtil}from"../../utils/html-util";export class OntoDialog{constructor(){this.handleClose=e=>{this.config.onClose(e)}}componentDidLoad(){this.documentOverflow=HtmlUtil.hideDocumentBodyOverflow(),this.hostElement.addEventListener("keydown",this.preventLeavingDialog.bind(this)),this.closeButton.focus()}disconnectedCallback(){this.hostElement.removeEventListener("keydown",this.preventLeavingDialog.bind(this)),HtmlUtil.setDocumentBodyOverflow(this.documentOverflow)}render(){return h(Host,{key:"eeffeaac1aa5b80b89d0d176d89dc44291fd0cbb",tabindex:"-1"},h("div",{key:"2ba8415fa038ad2666cc0b340a3ceba6f0919bc6",class:`dialog-overlay ${this.config.modalClass?this.config.modalClass:""}`},h("dialog",{key:"39b9fc94944e12e8dcae98a65e74593dc173b336",class:"dialog"},h("header",{key:"183327aad084ff6fd619d204a537871cace84684",class:"dialog-header"},h("h3",{key:"ae4c514e0f75e46d5787d284154392de808100ca",class:"dialog-title"},this.config.dialogTitle)),h("main",{key:"dc991f0ef3baa22f42f683528a4ca67ab8d5e7f4",class:"dialog-body"},h("slot",{key:"ddc1c5176d976f5a518fed1d2faa138d0bc5082a",name:"body"})),h("footer",{key:"b3cb9449b54583a7b5489b7d56fa084e456b4d75",class:"dialog-footer"},h("slot",{key:"b3bc85bdfe12da62019be2e542737e5b6f7db4f6",name:"footer"}),h("button",{key:"c91a35cc01761c22f59ec28ab7fd6f76604eb180",class:"onto-btn onto-btn-primary",onClick:this.handleClose,ref:e=>this.closeButton=e},h("translate-label",{key:"661aa6b5dd885b9c4496cac2d977e912209294ba",labelKey:"common.button.close"}))))))}preventLeavingDialog(e){HtmlUtil.preventLeavingDialog(this.hostElement,e)}static get is(){return"onto-dialog"}static get originalStyleUrls(){return{$:["onto-dialog.scss"]}}static get styleUrls(){return{$:["onto-dialog.css"]}}static get properties(){return{config:{type:"unknown",attribute:"config",mutable:!1,complexType:{original:"DialogConfig",resolved:"{ dialogTitle: string; onClose: (evt: KeyboardEvent | MouseEvent) => void; modalClass?: string; }",references:{DialogConfig:{location:"local",path:"/home/ubuntu/workspace/PRO/GraphDB UI Jobs/workbench/graphdb-workbench-release/packages/shared-components/src/components/dialogs/onto-dialog.tsx",id:"src/components/dialogs/onto-dialog.tsx::DialogConfig"}}},required:!1,optional:!1,docs:{tags:[],text:"Configuration object for the dialog."},getter:!1,setter:!1}}}static get elementRef(){return"hostElement"}}
1
+ import{Host,h}from"@stencil/core";import{HtmlUtil}from"../../utils/html-util";export class OntoDialog{constructor(){this.handleClose=e=>{this.config.onClose(e)}}componentDidLoad(){this.documentOverflow=HtmlUtil.hideDocumentBodyOverflow(),this.hostElement.addEventListener("keydown",this.preventLeavingDialog.bind(this)),this.closeButton.focus()}disconnectedCallback(){this.hostElement.removeEventListener("keydown",this.preventLeavingDialog.bind(this)),HtmlUtil.setDocumentBodyOverflow(this.documentOverflow)}render(){return h(Host,{key:"eeffeaac1aa5b80b89d0d176d89dc44291fd0cbb",tabindex:"-1"},h("div",{key:"2ba8415fa038ad2666cc0b340a3ceba6f0919bc6",class:`dialog-overlay ${this.config.modalClass?this.config.modalClass:""}`},h("dialog",{key:"39b9fc94944e12e8dcae98a65e74593dc173b336",class:"dialog"},h("header",{key:"183327aad084ff6fd619d204a537871cace84684",class:"dialog-header"},h("h3",{key:"ae4c514e0f75e46d5787d284154392de808100ca",class:"dialog-title"},this.config.dialogTitle)),h("main",{key:"dc991f0ef3baa22f42f683528a4ca67ab8d5e7f4",class:"dialog-body"},h("slot",{key:"ddc1c5176d976f5a518fed1d2faa138d0bc5082a",name:"body"})),h("footer",{key:"b3cb9449b54583a7b5489b7d56fa084e456b4d75",class:"dialog-footer"},h("slot",{key:"b3bc85bdfe12da62019be2e542737e5b6f7db4f6",name:"footer"}),h("button",{key:"c58a84d33d8d07ae67a9988adaa320166371cc5b",class:"onto-btn onto-btn-primary",onClick:this.handleClose,ref:e=>this.closeButton=e},h("translate-label",{key:"b593b5e113baa66e6878a2e885a46bc6581bf27f",labelKey:"common.button.close"}))))))}preventLeavingDialog(e){HtmlUtil.preventLeavingDialog(this.hostElement,e)}static get is(){return"onto-dialog"}static get originalStyleUrls(){return{$:["onto-dialog.scss"]}}static get styleUrls(){return{$:["onto-dialog.css"]}}static get properties(){return{config:{type:"unknown",attribute:"config",mutable:!1,complexType:{original:"DialogConfig",resolved:"{ dialogTitle: string; onClose: (evt: KeyboardEvent | MouseEvent) => void; modalClass?: string; }",references:{DialogConfig:{location:"local",path:"/home/ubuntu/workspace/PRO/GraphDB UI Jobs/workbench/graphdb-workbench-release/packages/shared-components/src/components/dialogs/onto-dialog.tsx",id:"src/components/dialogs/onto-dialog.tsx::DialogConfig"}}},required:!1,optional:!1,docs:{tags:[],text:"Configuration object for the dialog."},getter:!1,setter:!1}}}static get elementRef(){return"hostElement"}}
@@ -1 +1 @@
1
- import{h,Host}from"@stencil/core";export class OntoCookieConsent{constructor(){this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return h(Host,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},h("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},h("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},h("span",{key:"1b60fbb2c50049e568ac0cc34875a0df388ea176"},h("translate-label",{key:"f64506a6ea5d01ac231a3f06377c84654cf8e0c7",labelKey:"cookie.cookie_consent"}),h("a",{key:"bd467bae7911ec9248f6296a655651fee07db73c",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},h("translate-label",{key:"3c43ff2eb701200253fffb1c17f53355f52af11a",labelKey:"cookie.cookie_policy_url_label"})),"."),h("button",{key:"6a6c6029a325cd39fbdf0b74c3bd2ca6157f81ae",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},h("translate-label",{key:"b7dfb20b211927f2aec4199beb35e582768db96c",labelKey:"common.button.ok"})))),this.showModal&&h("onto-cookie-policy-dialog",{key:"b3a905894b4683b6b7b45809f1e97139cd998088",dialogHandler:this}))}static get is(){return"onto-cookie-consent"}static get originalStyleUrls(){return{$:["onto-cookie-consent.scss"]}}static get styleUrls(){return{$:["onto-cookie-consent.css"]}}static get states(){return{showModal:{}}}static get events(){return[{method:"consentGiven",name:"consentGiven",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Event emitter for when consent is given"},complexType:{original:"void",resolved:"void",references:{}}}]}}
1
+ import{h,Host}from"@stencil/core";export class OntoCookieConsent{constructor(){this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return h(Host,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},h("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},h("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},h("span",{key:"aa62410b522125feeb48eaa568a78c761e6b9596"},h("translate-label",{key:"0696068c1aa8738bb3ddf0e548d9140ba12609e1",labelKey:"cookie.cookie_consent"}),h("a",{key:"efd9792a6a424b86606b3904615c53f19a2cdb6e",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},h("translate-label",{key:"12e95d1446f81b47c973e285ee71da5fbfa4934f",labelKey:"cookie.cookie_policy_url_label"})),"."),h("button",{key:"a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},h("translate-label",{key:"5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a",labelKey:"common.button.ok"})))),this.showModal&&h("onto-cookie-policy-dialog",{key:"e54d3f134771ff5f59a288d0d6c9949c6f59567f",dialogHandler:this}))}static get is(){return"onto-cookie-consent"}static get originalStyleUrls(){return{$:["onto-cookie-consent.scss"]}}static get styleUrls(){return{$:["onto-cookie-consent.css"]}}static get states(){return{showModal:{}}}static get events(){return[{method:"consentGiven",name:"consentGiven",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Event emitter for when consent is given"},complexType:{original:"void",resolved:"void",references:{}}}]}}
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";import{DropdownItemAlignment}from"../../models/dropdown/dropdown-item-alignment";import{TooltipUtil}from"../../utils/tooltip-util";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoDropdown{constructor(){this.GUIDE_SELECTOR_ATTR="guide-selector",this.open=!1,this.buttonTooltipContent="",this.dropdownTooltipTrigger="manual",this.iconClass="",this.tooltipPlacement=OntoTooltipPlacement.LEFT,this.dropdownAlignment=DropdownItemAlignment.LEFT,this.autoClose=!0,this.toggleButtonClickHandler=()=>{TooltipUtil.destroyTooltip(this.dropdownButtonElement),this.buttonTooltipContent="",this.toggleComponent()}}keydownListener(t){"Escape"===t.key&&this.closeMenu()}mouseClickListener(t){const e=t.target;this.autoClose&&!this.hostElement.contains(e)&&this.closeMenu()}componentDidUpdate(){this.dropdownButtonElement&&(this.buttonTooltipContent&&""!==this.buttonTooltipContent?TooltipUtil.updateTooltipContent(this.dropdownButtonElement,this.buttonTooltipContent):TooltipUtil.destroyTooltip(this.dropdownButtonElement))}render(){var t,e;const o=this.dropdownAlignment===DropdownItemAlignment.RIGHT?"onto-dropdown-right-item-alignment":"onto-dropdown-left-item-alignment",n="function"==typeof this.tooltipPlacement?this.tooltipPlacement(this.open):this.tooltipPlacement;return h("div",{key:"942c4ef2b310ba3919fb8c2f45a23c08baae3e0c",class:"onto-dropdown "+(this.open?"open":"closed")},h("button",Object.assign({key:"c8a99d149031b6eed3e588bb0a5701c423709b42",class:"onto-dropdown-button",ref:t=>this.dropdownButtonElement=t},this.dropdownButtonGuideSelector?{[this.GUIDE_SELECTOR_ATTR]:this.dropdownButtonGuideSelector}:{},{"tooltip-placement":n,"tooltip-trigger":this.dropdownTooltipTrigger,"tooltip-content":this.buttonTooltipContent},this.tooltipTheme?{"tooltip-theme":this.tooltipTheme}:{},{onMouseEnter:this.setDropdownButtonTooltip(),onClick:this.toggleButtonClickHandler}),this.iconClass?h("i",{class:"button-icon "+this.iconClass}):"",h("span",{key:"3bf548f42fcd7bc6d41e4c1418c2dc2f69f2aea6",class:"button-name"},null!==(t=this.dropdownButtonName)&&void 0!==t?t:this.translate(this.dropdownButtonNameLabelKey)),h("i",{key:"d83fb64fcf1b06ed61d8dcde8830641ede615274",class:"fa-light fa-angle-down "+(this.open?"fa-rotate-180":"")})),h("div",{key:"7d2b9d955ce207afd7e37c8e21b4488fa2a07ba8",class:"onto-dropdown-menu "+o},null===(e=this.items)||void 0===e?void 0:e.map(t=>{var e;return h("button",Object.assign({class:"onto-dropdown-menu-item "+t.cssClass},t.guideSelector?{[this.GUIDE_SELECTOR_ATTR]:t.guideSelector}:{},{"tooltip-placement":OntoTooltipPlacement.LEFT,"tooltip-trigger":t.dropdownTooltipTrigger},this.tooltipTheme?{"tooltip-theme":this.tooltipTheme}:{},{onMouseEnter:this.setDropdownItemTooltip(t),onClick:this.itemClickHandler(t.value)}),t.iconClass?h("span",{class:"onto-dropdown-option-icon "+t.iconClass}):"",h("span",null,null!==(e=t.name)&&void 0!==e?e:this.translate(t.nameLabelKey)))})))}setDropdownButtonTooltip(){return async()=>{var t;let e;e="function"==typeof this.dropdownButtonTooltip?await this.getTooltipContent(this.dropdownButtonTooltip):null!==(t=this.dropdownButtonTooltip)&&void 0!==t?t:this.translate(this.dropdownButtonTooltipLabelKey),this.buttonTooltipContent=e}}setDropdownItemTooltip(t){return async e=>{var o;const n=e.currentTarget;if("function"==typeof t.tooltip){let e=await this.getTooltipContent(t.tooltip);n.setAttribute("tooltip-content",e)}else n.setAttribute("tooltip-content",null!==(o=t.tooltip)&&void 0!==o?o:this.translate(t.tooltipLabelKey))}}itemClickHandler(t){return()=>this.onSelect(t)}translate(t){return t?TranslationService.translate(t):""}onSelect(t){this.open=!1,this.valueChanged.emit(t)}toggleComponent(){this.open=!this.open}closeMenu(){this.open=!1}async getTooltipContent(t){let e="";try{e=await t()}catch(t){console.error(t)}return e}static get is(){return"onto-dropdown"}static get originalStyleUrls(){return{$:["onto-dropdown.scss"]}}static get styleUrls(){return{$:["onto-dropdown.css"]}}static get properties(){return{dropdownButtonName:{type:"string",attribute:"dropdown-button-name",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The name for the dropdown button. This can either be a string (used directly as the button label)\nor a Stencil component (used to render the button content). It will be used if present;\notherwise, the {@link OntoDropdown#dropdownButtonNameLabelKey } will be used."},getter:!1,setter:!1,reflect:!1},dropdownButtonNameLabelKey:{type:"string",attribute:"dropdown-button-name-label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The translation label key for the dropdown button name. It will be used if {@link OntoDropdown#dropdownButtonName } is not present."},getter:!1,setter:!1,reflect:!1},dropdownButtonGuideSelector:{type:"string",attribute:"dropdown-button-guide-selector",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Defines the value of the `guide-selector` attribute for the dropdown trigger button."},getter:!1,setter:!1,reflect:!1},dropdownButtonTooltip:{type:"string",attribute:"dropdown-button-tooltip",mutable:!1,complexType:{original:"string | Awaitable<string>",resolved:"(() => Promise<string>) | string",references:{Awaitable:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Awaitable"}}},required:!1,optional:!1,docs:{tags:[],text:"The dropdown button tooltip. It will be used if present; otherwise, the {@link OntoDropdown#dropdownButtonTooltipLabelKey } will be used."},getter:!1,setter:!1,reflect:!1},dropdownButtonTooltipLabelKey:{type:"string",attribute:"dropdown-button-tooltip-label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The translation label key for the dropdown button tooltip. It will be used if {@link OntoDropdown#dropdownButtonTooltip } is not present."},getter:!1,setter:!1,reflect:!1},dropdownTooltipTrigger:{type:"string",attribute:"dropdown-tooltip-trigger",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the events that trigger the dropdown button tooltip to appear. Multiple event names should be separated by spaces."},getter:!1,setter:!1,reflect:!1,defaultValue:"'manual'"},iconClass:{type:"string",attribute:"icon-class",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Icon class for the main dropdown button."},getter:!1,setter:!1,reflect:!1,defaultValue:"''"},items:{type:"unknown",attribute:"items",mutable:!1,complexType:{original:"DropdownItem<any>[]",resolved:"DropdownItem<any>[]",references:{DropdownItem:{location:"import",path:"../../models/dropdown/dropdown-item",id:"src/models/dropdown/dropdown-item.ts::DropdownItem"}}},required:!1,optional:!1,docs:{tags:[],text:"Array of dropdown options."},getter:!1,setter:!1},tooltipTheme:{type:"string",attribute:"tooltip-theme",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The tooltip theme to be used. For more information {@link OntoTooltipConfiguration#theme }."},getter:!1,setter:!1,reflect:!1},tooltipPlacement:{type:"string",attribute:"tooltip-placement",mutable:!1,complexType:{original:"OntoTooltipPlacement | ((isOpen: boolean) => OntoTooltipPlacement)",resolved:"((isOpen: boolean) => OntoTooltipPlacement) | OntoTooltipPlacement.AUTO | OntoTooltipPlacement.BOTTOM | OntoTooltipPlacement.LEFT | OntoTooltipPlacement.RIGHT | OntoTooltipPlacement.TOP",references:{OntoTooltipPlacement:{location:"import",path:"../onto-tooltip/models/onto-tooltip-placement",id:"src/components/onto-tooltip/models/onto-tooltip-placement.ts::OntoTooltipPlacement"}}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the items tooltip placement. Accepts a string of the placement or a function that returns the placement.\nThe function takes the isOpen parameter as a boolean and returns the placement as a string.\nIf not provided, the tooltip will be placed to the left."},getter:!1,setter:!1,reflect:!1,defaultValue:"OntoTooltipPlacement.LEFT"},dropdownAlignment:{type:"string",attribute:"dropdown-alignment",mutable:!1,complexType:{original:"DropdownItemAlignment",resolved:"DropdownItemAlignment.LEFT | DropdownItemAlignment.RIGHT",references:{DropdownItemAlignment:{location:"import",path:"../../models/dropdown/dropdown-item-alignment",id:"src/models/dropdown/dropdown-item-alignment.ts::DropdownItemAlignment"}}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the dropdown items' alignment. If not provided, the items and the dropdown button will be aligned to the left."},getter:!1,setter:!1,reflect:!1,defaultValue:"DropdownItemAlignment.LEFT"},autoClose:{type:"boolean",attribute:"auto-close",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Flag to determine if the dropdown should close automatically when a click occurs outside the dropdown."},getter:!1,setter:!1,reflect:!1,defaultValue:"true"}}}static get states(){return{open:{},buttonTooltipContent:{}}}static get events(){return[{method:"valueChanged",name:"valueChanged",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Event emitted when a dropdown item is selected.\nThe event payload contains the value of the selected item."},complexType:{original:"any",resolved:"any",references:{}}}]}static get elementRef(){return"hostElement"}static get listeners(){return[{name:"keydown",method:"keydownListener",target:"window",capture:!1,passive:!1},{name:"click",method:"mouseClickListener",target:"window",capture:!1,passive:!1}]}}
1
+ import{h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";import{DropdownItemAlignment}from"../../models/dropdown/dropdown-item-alignment";import{TooltipUtil}from"../../utils/tooltip-util";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoDropdown{constructor(){this.GUIDE_SELECTOR_ATTR="guide-selector",this.open=!1,this.buttonTooltipContent="",this.dropdownTooltipTrigger="manual",this.iconClass="",this.tooltipPlacement=OntoTooltipPlacement.LEFT,this.dropdownAlignment=DropdownItemAlignment.LEFT,this.autoClose=!1,this.toggleButtonClickHandler=()=>{TooltipUtil.destroyTooltip(this.dropdownButtonElement),this.buttonTooltipContent="",this.toggleComponent()}}keydownListener(t){"Escape"===t.key&&this.closeMenu()}mouseClickListener(t){const e=t.target;this.autoClose&&!this.hostElement.contains(e)&&this.closeMenu()}componentDidUpdate(){this.dropdownButtonElement&&(this.buttonTooltipContent&&""!==this.buttonTooltipContent?TooltipUtil.updateTooltipContent(this.dropdownButtonElement,this.buttonTooltipContent):TooltipUtil.destroyTooltip(this.dropdownButtonElement))}render(){var t,e;const o=this.dropdownAlignment===DropdownItemAlignment.RIGHT?"onto-dropdown-right-item-alignment":"onto-dropdown-left-item-alignment",n="function"==typeof this.tooltipPlacement?this.tooltipPlacement(this.open):this.tooltipPlacement;return h("div",{key:"e4996c54c5dc7b3686f6282ec7d318ca22ffa581",class:"onto-dropdown "+(this.open?"open":"closed")},h("button",Object.assign({key:"4cacba07d1f592851e389b39df5f48a6d4ef2bf6",class:"onto-dropdown-button",ref:t=>this.dropdownButtonElement=t},this.dropdownButtonGuideSelector?{[this.GUIDE_SELECTOR_ATTR]:this.dropdownButtonGuideSelector}:{},{"tooltip-placement":n,"tooltip-trigger":this.dropdownTooltipTrigger,"tooltip-content":this.buttonTooltipContent},this.tooltipTheme?{"tooltip-theme":this.tooltipTheme}:{},{onMouseEnter:this.setDropdownButtonTooltip(),onClick:this.toggleButtonClickHandler}),this.iconClass?h("i",{class:"button-icon "+this.iconClass}):"",h("span",{key:"7a281a842edc21e0602ad9d3773c04eab66956c2",class:"button-name"},null!==(t=this.dropdownButtonName)&&void 0!==t?t:this.translate(this.dropdownButtonNameLabelKey)),h("i",{key:"64dc597c9655fee83daa044090051ff0b273c5ac",class:"fa-light fa-angle-down "+(this.open?"fa-rotate-180":"")})),h("div",{key:"9c6e420756b9f6b854ed7da1a6ce666abef37108",class:"onto-dropdown-menu "+o},null===(e=this.items)||void 0===e?void 0:e.map(t=>{var e;return h("button",Object.assign({class:"onto-dropdown-menu-item "+t.cssClass},t.guideSelector?{[this.GUIDE_SELECTOR_ATTR]:t.guideSelector}:{},{"tooltip-placement":OntoTooltipPlacement.LEFT,"tooltip-trigger":t.dropdownTooltipTrigger},this.tooltipTheme?{"tooltip-theme":this.tooltipTheme}:{},{onMouseEnter:this.setDropdownItemTooltip(t),onClick:this.itemClickHandler(t.value)}),t.iconClass?h("span",{class:"onto-dropdown-option-icon "+t.iconClass}):"",h("span",null,null!==(e=t.name)&&void 0!==e?e:this.translate(t.nameLabelKey)))})))}setDropdownButtonTooltip(){return async()=>{var t;let e;e="function"==typeof this.dropdownButtonTooltip?await this.getTooltipContent(this.dropdownButtonTooltip):null!==(t=this.dropdownButtonTooltip)&&void 0!==t?t:this.translate(this.dropdownButtonTooltipLabelKey),this.buttonTooltipContent=e}}setDropdownItemTooltip(t){return async e=>{var o;const n=e.currentTarget;if("function"==typeof t.tooltip){let e=await this.getTooltipContent(t.tooltip);n.setAttribute("tooltip-content",e)}else n.setAttribute("tooltip-content",null!==(o=t.tooltip)&&void 0!==o?o:this.translate(t.tooltipLabelKey))}}itemClickHandler(t){return()=>this.onSelect(t)}translate(t){return t?TranslationService.translate(t):""}onSelect(t){this.open=!1,this.valueChanged.emit(t)}toggleComponent(){this.open=!this.open}closeMenu(){this.open=!1}async getTooltipContent(t){let e="";try{e=await t()}catch(t){console.error(t)}return e}static get is(){return"onto-dropdown"}static get originalStyleUrls(){return{$:["onto-dropdown.scss"]}}static get styleUrls(){return{$:["onto-dropdown.css"]}}static get properties(){return{dropdownButtonName:{type:"string",attribute:"dropdown-button-name",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The name for the dropdown button. This can either be a string (used directly as the button label)\nor a Stencil component (used to render the button content). It will be used if present;\notherwise, the {@link OntoDropdown#dropdownButtonNameLabelKey } will be used."},getter:!1,setter:!1,reflect:!1},dropdownButtonNameLabelKey:{type:"string",attribute:"dropdown-button-name-label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The translation label key for the dropdown button name. It will be used if {@link OntoDropdown#dropdownButtonName } is not present."},getter:!1,setter:!1,reflect:!1},dropdownButtonGuideSelector:{type:"string",attribute:"dropdown-button-guide-selector",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Defines the value of the `guide-selector` attribute for the dropdown trigger button."},getter:!1,setter:!1,reflect:!1},dropdownButtonTooltip:{type:"string",attribute:"dropdown-button-tooltip",mutable:!1,complexType:{original:"string | Awaitable<string>",resolved:"(() => Promise<string>) | string",references:{Awaitable:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Awaitable"}}},required:!1,optional:!1,docs:{tags:[],text:"The dropdown button tooltip. It will be used if present; otherwise, the {@link OntoDropdown#dropdownButtonTooltipLabelKey } will be used."},getter:!1,setter:!1,reflect:!1},dropdownButtonTooltipLabelKey:{type:"string",attribute:"dropdown-button-tooltip-label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The translation label key for the dropdown button tooltip. It will be used if {@link OntoDropdown#dropdownButtonTooltip } is not present."},getter:!1,setter:!1,reflect:!1},dropdownTooltipTrigger:{type:"string",attribute:"dropdown-tooltip-trigger",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the events that trigger the dropdown button tooltip to appear. Multiple event names should be separated by spaces."},getter:!1,setter:!1,reflect:!1,defaultValue:"'manual'"},iconClass:{type:"string",attribute:"icon-class",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Icon class for the main dropdown button."},getter:!1,setter:!1,reflect:!1,defaultValue:"''"},items:{type:"unknown",attribute:"items",mutable:!1,complexType:{original:"DropdownItem<unknown>[]",resolved:"DropdownItem<unknown>[]",references:{DropdownItem:{location:"import",path:"../../models/dropdown/dropdown-item",id:"src/models/dropdown/dropdown-item.ts::DropdownItem"}}},required:!1,optional:!1,docs:{tags:[],text:"Array of dropdown options."},getter:!1,setter:!1},tooltipTheme:{type:"string",attribute:"tooltip-theme",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The tooltip theme to be used. For more information {@link OntoTooltipConfiguration#theme }."},getter:!1,setter:!1,reflect:!1},tooltipPlacement:{type:"string",attribute:"tooltip-placement",mutable:!1,complexType:{original:"OntoTooltipPlacement | ((isOpen: boolean) => OntoTooltipPlacement)",resolved:"((isOpen: boolean) => OntoTooltipPlacement) | OntoTooltipPlacement.AUTO | OntoTooltipPlacement.BOTTOM | OntoTooltipPlacement.LEFT | OntoTooltipPlacement.RIGHT | OntoTooltipPlacement.TOP",references:{OntoTooltipPlacement:{location:"import",path:"../onto-tooltip/models/onto-tooltip-placement",id:"src/components/onto-tooltip/models/onto-tooltip-placement.ts::OntoTooltipPlacement"}}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the items tooltip placement. Accepts a string of the placement or a function that returns the placement.\nThe function takes the isOpen parameter as a boolean and returns the placement as a string.\nIf not provided, the tooltip will be placed to the left."},getter:!1,setter:!1,reflect:!1,defaultValue:"OntoTooltipPlacement.LEFT"},dropdownAlignment:{type:"string",attribute:"dropdown-alignment",mutable:!1,complexType:{original:"DropdownItemAlignment",resolved:"DropdownItemAlignment.LEFT | DropdownItemAlignment.RIGHT",references:{DropdownItemAlignment:{location:"import",path:"../../models/dropdown/dropdown-item-alignment",id:"src/models/dropdown/dropdown-item-alignment.ts::DropdownItemAlignment"}}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the dropdown items' alignment. If not provided, the items and the dropdown button will be aligned to the left."},getter:!1,setter:!1,reflect:!1,defaultValue:"DropdownItemAlignment.LEFT"},autoClose:{type:"boolean",attribute:"auto-close",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Flag to determine if the dropdown should close automatically when a click occurs outside the dropdown."},getter:!1,setter:!1,reflect:!1,defaultValue:"false"}}}static get states(){return{open:{},buttonTooltipContent:{}}}static get events(){return[{method:"valueChanged",name:"valueChanged",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Event emitted when a dropdown item is selected.\nThe event payload contains the value of the selected item."},complexType:{original:"any",resolved:"any",references:{}}}]}static get elementRef(){return"hostElement"}static get listeners(){return[{name:"keydown",method:"keydownListener",target:"window",capture:!1,passive:!1},{name:"click",method:"mouseClickListener",target:"window",capture:!1,passive:!1}]}}
@@ -1 +1 @@
1
- import{Host,h}from"@stencil/core";import{ServiceProvider,SubscriptionList,ProductInfoContextService,LicenseService,SecurityContextService,CookieConsent,CookieService,LicenseContextService,WindowService}from"../../../../../api/dist/ontotext-workbench-api";export class OntoFooter{constructor(){this.subscriptions=new SubscriptionList,this.currentYear=(new Date).getFullYear(),this.securityContextService=ServiceProvider.get(SecurityContextService),this.licenseContextService=ServiceProvider.get(LicenseContextService),this.cookieService=ServiceProvider.get(CookieService)}handleConsentGiven(){this.cookieService.acceptCookiePolicy().then(()=>this.shouldShowCookieConsent=!1)}render(){var e,t,o,i;return h(Host,{key:"c5bbe0151e3eb14932bacecaad88b7e529e3a1f1"},h("div",{key:"5d4e0501b872ccbaa2e48f99361a948e83191b65",class:"footer-component"},h("a",{key:"80ed7acc465b754ed295d2931d3c38549e2fa4f8",href:"http://graphdb.ontotext.com",target:"_blank",rel:"noopener noreferrer"},"GraphDB")," ",null===(e=this.productInfo)||void 0===e?void 0:e.productVersion," • ",h("a",{key:"df2a6a80c117d91be1a45f4021987b24d0eaaa06",href:"http://rdf4j.org",target:"_blank",rel:"noopener noreferrer"},"RDF4J "),null===(t=this.productInfo)||void 0===t?void 0:t.sesame," • Connectors ",null===(o=this.productInfo)||void 0===o?void 0:o.connectors," • Workbench ",null===(i=this.productInfo)||void 0===i?void 0:i.workbench," • © 2002–",this.currentYear," ",h("a",{key:"2477c4b7e24a304904b1a9e113e562a3e2a68193",href:"http://ontotext.com",target:"_blank",rel:"noopener noreferrer"},"Ontotext AD"),". ",h("translate-label",{key:"e5f700a69d2f129d883af745a415027532b52531",labelKey:"footer.label.all_rights_reserved"})),this.shouldShowCookieConsent&&h("onto-cookie-consent",{key:"42138884db38d3813072b574d8c4b84f2acb2c9d"}))}connectedCallback(){this.subscribeToProductInfoChange(),this.subscribeToUserChange(),this.subscribeToLicenseChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}subscribeToProductInfoChange(){this.subscriptions.add(ServiceProvider.get(ProductInfoContextService).onProductInfoChanged(e=>{this.productInfo=e}))}isTrackingAllowed(){return ServiceProvider.get(LicenseService).isTrackableLicense()&&!WindowService.getWindow().wbDevMode}subscribeToUserChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(()=>{this.setCookieConsentVisibility()}))}setCookieConsentVisibility(){var e;const t=this.securityContextService.getAuthenticatedUser();this.shouldShowCookieConsent=this.isTrackingAllowed()&&!new CookieConsent(null===(e=null==t?void 0:t.appSettings)||void 0===e?void 0:e.COOKIE_CONSENT).policyAccepted}subscribeToLicenseChange(){this.subscriptions.add(this.licenseContextService.onLicenseChanged(()=>{this.setCookieConsentVisibility()}))}static get is(){return"onto-footer"}static get originalStyleUrls(){return{$:["onto-footer.scss"]}}static get styleUrls(){return{$:["onto-footer.css"]}}static get states(){return{productInfo:{},shouldShowCookieConsent:{}}}static get listeners(){return[{name:"consentGiven",method:"handleConsentGiven",target:void 0,capture:!1,passive:!1}]}}
1
+ import{Host,h}from"@stencil/core";import{ServiceProvider,SubscriptionList,ProductInfoContextService,LicenseService,SecurityContextService,CookieConsent,CookieService,LicenseContextService,WindowService}from"../../../../../api/dist/ontotext-workbench-api";export class OntoFooter{constructor(){this.subscriptions=new SubscriptionList,this.currentYear=(new Date).getFullYear(),this.securityContextService=ServiceProvider.get(SecurityContextService),this.licenseContextService=ServiceProvider.get(LicenseContextService),this.cookieService=ServiceProvider.get(CookieService)}handleConsentGiven(){this.cookieService.acceptCookiePolicy().then(()=>this.shouldShowCookieConsent=!1)}render(){var e,t,o,i;return h(Host,{key:"c5bbe0151e3eb14932bacecaad88b7e529e3a1f1"},h("div",{key:"5d4e0501b872ccbaa2e48f99361a948e83191b65",class:"footer-component"},h("a",{key:"e81e156b6b691a0a05275ee399ccf26438ba5729",href:"http://graphdb.ontotext.com",target:"_blank",rel:"noopener noreferrer"},"GraphDB")," ",null===(e=this.productInfo)||void 0===e?void 0:e.productVersion," • ",h("a",{key:"018b1772807248dfd83e0c2ca57fde6bd848e9c9",href:"http://rdf4j.org",target:"_blank",rel:"noopener noreferrer"},"RDF4J "),null===(t=this.productInfo)||void 0===t?void 0:t.sesame," • Connectors ",null===(o=this.productInfo)||void 0===o?void 0:o.connectors," • Workbench ",null===(i=this.productInfo)||void 0===i?void 0:i.workbench," • © 2002–",this.currentYear," ",h("a",{key:"20e70771852b0c504e86e36a1b9fdb9b61d5963c",href:"http://ontotext.com",target:"_blank",rel:"noopener noreferrer"},"Ontotext AD"),". ",h("translate-label",{key:"8df55b8d224ae50ca9de3fd038c0285ee01b4ff3",labelKey:"footer.label.all_rights_reserved"})),this.shouldShowCookieConsent&&h("onto-cookie-consent",{key:"80f9c1af70db76ef4c6680dacf7022eb1262f049"}))}connectedCallback(){this.subscribeToProductInfoChange(),this.subscribeToUserChange(),this.subscribeToLicenseChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}subscribeToProductInfoChange(){this.subscriptions.add(ServiceProvider.get(ProductInfoContextService).onProductInfoChanged(e=>{this.productInfo=e}))}isTrackingAllowed(){return ServiceProvider.get(LicenseService).isTrackableLicense()&&!WindowService.getWindow().wbDevMode}subscribeToUserChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(()=>{this.setCookieConsentVisibility()}))}setCookieConsentVisibility(){var e;const t=this.securityContextService.getAuthenticatedUser();this.shouldShowCookieConsent=this.isTrackingAllowed()&&!new CookieConsent(null===(e=null==t?void 0:t.appSettings)||void 0===e?void 0:e.COOKIE_CONSENT).policyAccepted}subscribeToLicenseChange(){this.subscriptions.add(this.licenseContextService.onLicenseChanged(()=>{this.setCookieConsentVisibility()}))}static get is(){return"onto-footer"}static get originalStyleUrls(){return{$:["onto-footer.scss"]}}static get styleUrls(){return{$:["onto-footer.css"]}}static get states(){return{productInfo:{},shouldShowCookieConsent:{}}}static get listeners(){return[{name:"consentGiven",method:"handleConsentGiven",target:void 0,capture:!1,passive:!1}]}}
@@ -1 +1 @@
1
- import{Host,h}from"@stencil/core";import{ServiceProvider,LicenseContextService,SubscriptionList,MonitoringService,RepositoryContextService,SecurityContextService,FibonacciGenerator,OntoToastrService,RepositoryLocationContextService,EventService,EventName,getPathName,isHomePage,NamespacesService,NamespacesContextService,RepositoryList,RepositoryService,LanguageService,LanguageContextService,ObjectUtil,getCurrentRoute,AuthenticationService,WindowService}from"../../../../../api/dist/ontotext-workbench-api";import{TranslationService}from"../../services/translation.service";import{HtmlUtil}from"../../utils/html-util";import{DropdownItem}from"../../models/dropdown/dropdown-item";import{SelectorItemButton}from"../onto-repository-selector/selector-item";import{ResourceSearchConstants}from"../../models/resource-search/resource-search-constants";export class OntoHeader{constructor(){this.monitoringService=ServiceProvider.get(MonitoringService),this.repositoryContextService=ServiceProvider.get(RepositoryContextService),this.repositoryLocationContextService=ServiceProvider.get(RepositoryLocationContextService),this.repositoryService=ServiceProvider.get(RepositoryService),this.securityContextService=ServiceProvider.get(SecurityContextService),this.toastrService=ServiceProvider.get(OntoToastrService),this.namespacesService=ServiceProvider.get(NamespacesService),this.namespaceContextService=ServiceProvider.get(NamespacesContextService),this.languageService=ServiceProvider.get(LanguageService),this.UPDATE_ACTIVE_OPERATION_TIME_INTERVAL=2e3,this.fibonacciGenerator=new FibonacciGenerator,this.authService=ServiceProvider.get(AuthenticationService),this.eventService=ServiceProvider.get(EventService),this.shouldShowSearch=!0,this.isHomePage=isHomePage(),this.isActiveLocationLoading=!1,this.repositoryItems=[],this.subscriptions=new SubscriptionList,this.skipUpdateActiveOperationsTimes=0,this.canWriteRepo=e=>this.canWriteRepoInLocation(e),this.repositorySizeInfoFetcher=e=>this.repositoryService.getRepositorySizeInfo(e),this.showViewResourceMessage=e=>{e.stopPropagation(),this.toastrService.info(TranslationService.translate("rdf_search.toasts.use_view_resource")),this.shouldShowSearch=!1,HtmlUtil.focusElement("#search-resource-input-home input"),this.eventService.emit({NAME:ResourceSearchConstants.RDF_SEARCH_ICON_CLICKED})}}disconnectedCallback(){this.subscriptions.unsubscribeAll(),this.stopOperationPolling()}connectedCallback(){this.currentRepository=this.repositoryContextService.getSelectedRepository(),this.setupTotalRepositoryFormater(),this.subscribeToEvents(),this.currentRoute=getCurrentRoute(),this.startOperationPolling()}render(){var e,t,i,s,o,r;return h(Host,{key:"60ef798ee0a5b5043d612783b6709da8abe15c18"},h("div",{key:"565c25d359cee0198ce4e592ff4b6fdc5644e293",class:"header-component"},h("onto-search-icon",{key:"3b7952c7659e5132be140d655d26d158b5e0c64d",class:"rdf-search-button",onClick:this.showViewResourceMessage,"data-test":"onto-show-view-resource-message",style:{display:this.shouldShowSearch&&this.isHomePage?"block":"none"}}),h("onto-rdf-search",{key:"701e918ba7f5a79746e58e4c22255cea0ab7bc75","data-test":"onto-open-rdf-search-button",style:{display:this.shouldShowSearch&&!this.isHomePage?"block":"none"}}),(null===(e=this.activeOperations)||void 0===e?void 0:e.allRunningOperations.getItems().length)?h("onto-operations-notification",{activeOperations:this.activeOperations}):"",this.license&&!(null===(t=this.license)||void 0===t?void 0:t.valid)?h("onto-license-alert",{license:this.license}):"",h("onto-repository-selector",{key:"9e667b3d74535ce362b34c83d3b565a4402ae008",currentRepository:this.currentRepository,items:this.repositoryItems,repositorySizeInfoFetcher:this.repositorySizeInfoFetcher,totalTripletsFormatter:this.totalTripletsFormatter,canWriteRepo:this.canWriteRepo}),(null===(i=this.securityConfig)||void 0===i?void 0:i.enabled)&&(null===(s=this.securityConfig)||void 0===s?void 0:s.userLoggedIn)?h("onto-user-menu",{user:this.user,securityConfig:this.securityConfig}):"",(null===(o=this.securityConfig)||void 0===o?void 0:o.enabled)&&!(null===(r=this.securityConfig)||void 0===r?void 0:r.userLoggedIn)&&"login"!==this.currentRoute?h("onto-user-login",null):"",h("onto-language-selector",{key:"b34af4a3d3f1aea20bce671123314966ca6f24e8","dropdown-alignment":"right"})))}subscribeToEvents(){this.subscribeToSecurityContextChange(),this.subscribeToRepositoryListChanged(),this.subscribeToLicenseChange(),this.subscribeToRepositoryChange(),this.subscribeToActiveRepositoryLocationChange(),this.subscribeToActiveRepoLoadingChange(),this.subscribeToNavigationEnd(),this.subscribeToLanguageChanged(),this.subscribeToAuthenticatedUserChange()}subscribeToRepositoryListChanged(){return this.repositoryContextService.onRepositoryListChanged(e=>{(null==e?void 0:e.getItems().length)?this.initOnRepositoryListChanged(e):this.resetOnMissingRepositories()})}subscribeToLicenseChange(){this.subscriptions.add(ServiceProvider.get(LicenseContextService).onLicenseChanged(e=>{this.license=e}))}subscribeToRepositoryChange(){this.subscriptions.add(this.repositoryContextService.onSelectedRepositoryChanged(e=>{this.currentRepository=e,this.shouldShowSearch=this.shouldShowRdfSearch(),this.loadNamespaces(),this.updateRepositoryItems()}))}subscribeToSecurityContextChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(e=>{this.user=e})),this.subscriptions.add(this.securityContextService.onSecurityConfigChanged(e=>{this.securityConfig=e}))}subscribeToAuthenticatedUserChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(()=>{this.updateRepositoryItems()}))}subscribeToActiveRepositoryLocationChange(){this.subscriptions.add(this.repositoryLocationContextService.onActiveLocationChanged(()=>{this.shouldShowSearch=this.shouldShowRdfSearch()}))}subscribeToActiveRepoLoadingChange(){this.subscriptions.add(this.repositoryLocationContextService.onIsLoadingChanged(e=>{this.isActiveLocationLoading=e,this.shouldShowSearch=this.shouldShowRdfSearch()}))}subscribeToNavigationEnd(){this.subscriptions.add(this.eventService.subscribe(EventName.NAVIGATION_END,()=>{this.shouldShowSearch=this.shouldShowRdfSearch(),this.isHomePage=isHomePage(),this.currentRoute=getCurrentRoute()}))}subscribeToLanguageChanged(){this.subscriptions.add(ServiceProvider.get(LanguageContextService).onSelectedLanguageChanged(e=>this.setupTotalRepositoryFormater(e)))}resetOnMissingRepositories(){this.repositoryItems=[],this.repositoryList=new RepositoryList,this.currentRepository=void 0}initOnRepositoryListChanged(e){this.repositoryList=e,this.updateRepositoryItems()}updateRepositoryItems(){this.repositoryItems=this.getRepositoriesDropdownItems()}getRepositoriesDropdownItems(){var e;if(!(null===(e=this.repositoryList)||void 0===e?void 0:e.getItems().length))return[];let t;return this.repositoryList.sortByLocationAndId(),t=this.currentRepository?this.repositoryList.filterByRepository([this.currentRepository]):this.repositoryList.getItems(),t.filter(e=>this.authService.canReadRepo(e)||this.authService.canReadGqlRepo(e)).map(e=>(new DropdownItem).setName(h(SelectorItemButton,{repository:e})).setValue(e).setDropdownTooltipTrigger("mouseenter focus").setGuideSelector(`repository-id-${e.id}`))}canWriteRepoInLocation(e){return!0}loadNamespaces(){this.currentRepository&&this.authService.canReadRepo(this.currentRepository)&&this.namespacesService.getNamespaces(this.currentRepository.id).then(e=>this.namespaceContextService.updateNamespaces(e))}startOperationPolling(){clearInterval(this.pollingInterval),this.pollingInterval=WindowService.getWindow().setInterval(()=>{this.authService.isAuthenticated()?this.skipUpdateActiveOperationsTimes>0?this.skipUpdateActiveOperationsTimes--:this.currentRepository&&this.monitoringService.getOperations(this.currentRepository.id).then(e=>{ObjectUtil.deepEqual(this.activeOperations,e)||(this.activeOperations=e),this.fibonacciGenerator.reset(),this.skipUpdateActiveOperationsTimes=0}).catch(()=>{this.activeOperations=void 0,this.skipUpdateActiveOperationsTimes=this.fibonacciGenerator.next()}):this.activeOperations=void 0},this.UPDATE_ACTIVE_OPERATION_TIME_INTERVAL)}stopOperationPolling(){clearInterval(this.pollingInterval),this.activeOperations=void 0}shouldShowRdfSearch(){return!!this.currentRepository&&(!this.isActiveLocationLoading||"/repository"===getPathName())&&this.authService.canReadRepo(this.currentRepository)}setupTotalRepositoryFormater(e){e||(e=this.languageService.getDefaultLanguage()),this.totalTripletsFormatter=new Intl.NumberFormat(e,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})}static get is(){return"onto-header"}static get originalStyleUrls(){return{$:["onto-header.scss"]}}static get styleUrls(){return{$:["onto-header.css"]}}static get states(){return{activeOperations:{},license:{},isFreeAccessEnabled:{},shouldShowSearch:{},isHomePage:{},repositoryList:{},currentRoute:{},currentRepository:{},securityConfig:{}}}}
1
+ import{Host,h}from"@stencil/core";import{ServiceProvider,LicenseContextService,SubscriptionList,MonitoringService,RepositoryContextService,SecurityContextService,FibonacciGenerator,OntoToastrService,RepositoryLocationContextService,EventService,EventName,getPathName,isHomePage,NamespacesService,NamespacesContextService,RepositoryList,RepositoryService,LanguageService,LanguageContextService,ObjectUtil,getCurrentRoute,AuthenticationService,WindowService}from"../../../../../api/dist/ontotext-workbench-api";import{TranslationService}from"../../services/translation.service";import{HtmlUtil}from"../../utils/html-util";import{DropdownItem}from"../../models/dropdown/dropdown-item";import{SelectorItemButton}from"../onto-repository-selector/selector-item";import{ResourceSearchConstants}from"../../models/resource-search/resource-search-constants";export class OntoHeader{constructor(){this.monitoringService=ServiceProvider.get(MonitoringService),this.repositoryContextService=ServiceProvider.get(RepositoryContextService),this.repositoryLocationContextService=ServiceProvider.get(RepositoryLocationContextService),this.repositoryService=ServiceProvider.get(RepositoryService),this.securityContextService=ServiceProvider.get(SecurityContextService),this.toastrService=ServiceProvider.get(OntoToastrService),this.namespacesService=ServiceProvider.get(NamespacesService),this.namespaceContextService=ServiceProvider.get(NamespacesContextService),this.languageService=ServiceProvider.get(LanguageService),this.UPDATE_ACTIVE_OPERATION_TIME_INTERVAL=2e3,this.fibonacciGenerator=new FibonacciGenerator,this.authService=ServiceProvider.get(AuthenticationService),this.eventService=ServiceProvider.get(EventService),this.shouldShowSearch=!0,this.isHomePage=isHomePage(),this.isActiveLocationLoading=!1,this.repositoryItems=[],this.subscriptions=new SubscriptionList,this.skipUpdateActiveOperationsTimes=0,this.canWriteRepo=e=>this.canWriteRepoInLocation(e),this.repositorySizeInfoFetcher=e=>this.repositoryService.getRepositorySizeInfo(e),this.showViewResourceMessage=e=>{e.stopPropagation(),this.toastrService.info(TranslationService.translate("rdf_search.toasts.use_view_resource")),this.shouldShowSearch=!1,HtmlUtil.focusElement("#search-resource-input-home input"),this.eventService.emit({NAME:ResourceSearchConstants.RDF_SEARCH_ICON_CLICKED})}}disconnectedCallback(){this.subscriptions.unsubscribeAll(),this.stopOperationPolling()}connectedCallback(){this.currentRepository=this.repositoryContextService.getSelectedRepository(),this.setupTotalRepositoryFormater(),this.subscribeToEvents(),this.currentRoute=getCurrentRoute(),this.startOperationPolling()}render(){var e,t,i,s,o,r;return h(Host,{key:"8222e10554a901e025c47424aea4b6294f240ea4"},h("div",{key:"8a0b771d5dbddcb7acff61e7a436d2e4a097277f",class:"header-component"},h("onto-search-icon",{key:"d24c7f1be0241391078cc730a1ef2a5a86172e8f",class:"rdf-search-button",onClick:this.showViewResourceMessage,"data-test":"onto-show-view-resource-message",style:{display:this.shouldShowSearch&&this.isHomePage?"block":"none"}}),h("onto-rdf-search",{key:"b75323ddf445ea121fd6067723bf8550b861f4e5","data-test":"onto-open-rdf-search-button",style:{display:this.shouldShowSearch&&!this.isHomePage?"block":"none"}}),(null===(e=this.activeOperations)||void 0===e?void 0:e.allRunningOperations.getItems().length)?h("onto-operations-notification",{activeOperations:this.activeOperations}):"",this.license&&!(null===(t=this.license)||void 0===t?void 0:t.valid)?h("onto-license-alert",{license:this.license}):"",h("onto-repository-selector",{key:"25a3345c6482a2794032b161a78bc98204aff061",currentRepository:this.currentRepository,items:this.repositoryItems,repositorySizeInfoFetcher:this.repositorySizeInfoFetcher,totalTripletsFormatter:this.totalTripletsFormatter,canWriteRepo:this.canWriteRepo}),(null===(i=this.securityConfig)||void 0===i?void 0:i.enabled)&&(null===(s=this.securityConfig)||void 0===s?void 0:s.userLoggedIn)?h("onto-user-menu",{user:this.user,securityConfig:this.securityConfig}):"",(null===(o=this.securityConfig)||void 0===o?void 0:o.enabled)&&!(null===(r=this.securityConfig)||void 0===r?void 0:r.userLoggedIn)&&"login"!==this.currentRoute?h("onto-user-login",null):"",h("onto-language-selector",{key:"16cba1ff6d691fe0b7442d88940ec9f9ee22aebd","dropdown-alignment":"right"})))}subscribeToEvents(){this.subscribeToSecurityContextChange(),this.subscribeToRepositoryListChanged(),this.subscribeToLicenseChange(),this.subscribeToRepositoryChange(),this.subscribeToActiveRepositoryLocationChange(),this.subscribeToActiveRepoLoadingChange(),this.subscribeToNavigationEnd(),this.subscribeToLanguageChanged(),this.subscribeToAuthenticatedUserChange()}subscribeToRepositoryListChanged(){return this.repositoryContextService.onRepositoryListChanged(e=>{(null==e?void 0:e.getItems().length)?this.initOnRepositoryListChanged(e):this.resetOnMissingRepositories()})}subscribeToLicenseChange(){this.subscriptions.add(ServiceProvider.get(LicenseContextService).onLicenseChanged(e=>{this.license=e}))}subscribeToRepositoryChange(){this.subscriptions.add(this.repositoryContextService.onSelectedRepositoryChanged(e=>{this.currentRepository=e,this.shouldShowSearch=this.shouldShowRdfSearch(),this.loadNamespaces(),this.updateRepositoryItems()}))}subscribeToSecurityContextChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(e=>{this.user=e})),this.subscriptions.add(this.securityContextService.onSecurityConfigChanged(e=>{this.securityConfig=e}))}subscribeToAuthenticatedUserChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(()=>{this.updateRepositoryItems()}))}subscribeToActiveRepositoryLocationChange(){this.subscriptions.add(this.repositoryLocationContextService.onActiveLocationChanged(()=>{this.shouldShowSearch=this.shouldShowRdfSearch()}))}subscribeToActiveRepoLoadingChange(){this.subscriptions.add(this.repositoryLocationContextService.onIsLoadingChanged(e=>{this.isActiveLocationLoading=e,this.shouldShowSearch=this.shouldShowRdfSearch()}))}subscribeToNavigationEnd(){this.subscriptions.add(this.eventService.subscribe(EventName.NAVIGATION_END,()=>{this.shouldShowSearch=this.shouldShowRdfSearch(),this.isHomePage=isHomePage(),this.currentRoute=getCurrentRoute()}))}subscribeToLanguageChanged(){this.subscriptions.add(ServiceProvider.get(LanguageContextService).onSelectedLanguageChanged(e=>this.setupTotalRepositoryFormater(e)))}resetOnMissingRepositories(){this.repositoryItems=[],this.repositoryList=new RepositoryList,this.currentRepository=void 0}initOnRepositoryListChanged(e){this.repositoryList=e,this.updateRepositoryItems()}updateRepositoryItems(){this.repositoryItems=this.getRepositoriesDropdownItems()}getRepositoriesDropdownItems(){var e;if(!(null===(e=this.repositoryList)||void 0===e?void 0:e.getItems().length))return[];let t;return this.repositoryList.sortByLocationAndId(),t=this.currentRepository?this.repositoryList.filterByRepository([this.currentRepository]):this.repositoryList.getItems(),t.filter(e=>this.authService.canReadRepo(e)||this.authService.canReadGqlRepo(e)).map(e=>(new DropdownItem).setName(h(SelectorItemButton,{repository:e})).setValue(e).setDropdownTooltipTrigger("mouseenter focus").setGuideSelector(`repository-id-${e.id}`))}canWriteRepoInLocation(e){return!0}loadNamespaces(){this.currentRepository&&this.authService.canReadRepo(this.currentRepository)&&this.namespacesService.getNamespaces(this.currentRepository.id).then(e=>this.namespaceContextService.updateNamespaces(e))}startOperationPolling(){clearInterval(this.pollingInterval),this.pollingInterval=WindowService.getWindow().setInterval(()=>{this.authService.isAuthenticated()?this.skipUpdateActiveOperationsTimes>0?this.skipUpdateActiveOperationsTimes--:this.currentRepository&&this.monitoringService.getOperations(this.currentRepository.id).then(e=>{ObjectUtil.deepEqual(this.activeOperations,e)||(this.activeOperations=e),this.fibonacciGenerator.reset(),this.skipUpdateActiveOperationsTimes=0}).catch(()=>{this.activeOperations=void 0,this.skipUpdateActiveOperationsTimes=this.fibonacciGenerator.next()}):this.activeOperations=void 0},this.UPDATE_ACTIVE_OPERATION_TIME_INTERVAL)}stopOperationPolling(){clearInterval(this.pollingInterval),this.activeOperations=void 0}shouldShowRdfSearch(){return!!this.currentRepository&&(!this.isActiveLocationLoading||"/repository"===getPathName())&&this.authService.canReadRepo(this.currentRepository)}setupTotalRepositoryFormater(e){e||(e=this.languageService.getDefaultLanguage()),this.totalTripletsFormatter=new Intl.NumberFormat(e,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})}static get is(){return"onto-header"}static get originalStyleUrls(){return{$:["onto-header.scss"]}}static get styleUrls(){return{$:["onto-header.css"]}}static get states(){return{activeOperations:{},license:{},isFreeAccessEnabled:{},shouldShowSearch:{},isHomePage:{},repositoryList:{},currentRoute:{},currentRepository:{},securityConfig:{}}}}
@@ -1 +1 @@
1
- import{Host,h}from"@stencil/core";import{DropdownItem}from"../../models/dropdown/dropdown-item";import{ServiceProvider,LanguageService,LanguageContextService}from"../../../../../api/dist/ontotext-workbench-api";import{DropdownItemAlignment}from"../../models/dropdown/dropdown-item-alignment";export class OntoLanguageSelector{constructor(){this.languageService=ServiceProvider.get(LanguageService),this.languageContextService=ServiceProvider.get(LanguageContextService),this.items=[],this.dropdownAlignment=DropdownItemAlignment.LEFT}connectedCallback(){this.onLanguageChangeSubscription=this.languageContextService.onSelectedLanguageChanged(e=>this.changeLanguage(e)),this.items=this.getLanguageDropdownOptions()}disconnectedCallback(){this.onLanguageChangeSubscription&&this.onLanguageChangeSubscription()}render(){var e,t;return h(Host,{key:"faabdc9c474b053c32f4ae2c45cd79bd6166a255"},h("onto-dropdown",{key:"6c169e99e7bbddb3c76a126e83d05de1be615add",class:"onto-language-selector",onValueChanged:this.valueChangeHandler(),dropdownButtonNameLabelKey:this.currentLanguage?void 0:"language_selector.toggle_menu.label",dropdownButtonName:null!==(e=this.currentLanguage)&&void 0!==e?e:void 0,dropdownButtonTooltipLabelKey:this.currentLanguage?"language_selector.toggle_menu.tooltip":"language_selector.toggle_menu.label",dropdownAlignment:null!==(t=this.dropdownAlignment)&&void 0!==t?t:DropdownItemAlignment.RIGHT,dropdownTooltipTrigger:"mouseenter focus",iconClass:"icon-translation",items:this.items}))}valueChangeHandler(){return e=>this.onSelectedLanguageChanged(e)}changeLanguage(e){let t=e;t||(t=this.languageService.getDefaultLanguage()),this.currentLanguage=t,this.items=this.getLanguageDropdownOptions()}onSelectedLanguageChanged(e){this.languageContextService.updateSelectedLanguage(e.detail)}getLanguageDropdownOptions(){return this.languageService.getSupportedLanguages().map(e=>{const t=this.currentLanguage===e?"icon-tick":"";return(new DropdownItem).setNameLabelKey(`language_selector.language.${e}.label`).setTooltipLabelKey(`language_selector.language.${e}.tooltip.`+(this.currentLanguage===e?"selected":"not_selected")).setIconClass(t).setCssClass(e).setValue(e).setDropdownTooltipTrigger("mouseenter focus")})}static get is(){return"onto-language-selector"}static get originalStyleUrls(){return{$:["onto-language-selector.scss"]}}static get styleUrls(){return{$:["onto-language-selector.css"]}}static get properties(){return{dropdownAlignment:{type:"string",attribute:"dropdown-alignment",mutable:!1,complexType:{original:"DropdownItemAlignment",resolved:"DropdownItemAlignment.LEFT | DropdownItemAlignment.RIGHT",references:{DropdownItemAlignment:{location:"import",path:"../../models/dropdown/dropdown-item-alignment",id:"src/models/dropdown/dropdown-item-alignment.ts::DropdownItemAlignment"}}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the dropdown items' alignment. If not provided, the items and the dropdown button will be aligned to the left."},getter:!1,setter:!1,reflect:!1,defaultValue:"DropdownItemAlignment.LEFT"}}}static get states(){return{currentLanguage:{}}}}
1
+ import{Host,h}from"@stencil/core";import{DropdownItem}from"../../models/dropdown/dropdown-item";import{ServiceProvider,LanguageService,LanguageContextService}from"../../../../../api/dist/ontotext-workbench-api";import{DropdownItemAlignment}from"../../models/dropdown/dropdown-item-alignment";export class OntoLanguageSelector{constructor(){this.languageService=ServiceProvider.get(LanguageService),this.languageContextService=ServiceProvider.get(LanguageContextService),this.items=[],this.dropdownAlignment=DropdownItemAlignment.LEFT}connectedCallback(){this.onLanguageChangeSubscription=this.languageContextService.onSelectedLanguageChanged(e=>this.changeLanguage(e)),this.items=this.getLanguageDropdownOptions()}disconnectedCallback(){this.onLanguageChangeSubscription&&this.onLanguageChangeSubscription()}render(){var e,t;return h(Host,{key:"faabdc9c474b053c32f4ae2c45cd79bd6166a255"},h("onto-dropdown",{key:"e15d2c8478c85c3a37c99d22f91602ea17730e67",class:"onto-language-selector",onValueChanged:this.valueChangeHandler(),dropdownButtonNameLabelKey:this.currentLanguage?void 0:"language_selector.toggle_menu.label",dropdownButtonName:null!==(e=this.currentLanguage)&&void 0!==e?e:void 0,dropdownButtonTooltipLabelKey:this.currentLanguage?"language_selector.toggle_menu.tooltip":"language_selector.toggle_menu.label",dropdownAlignment:null!==(t=this.dropdownAlignment)&&void 0!==t?t:DropdownItemAlignment.RIGHT,dropdownTooltipTrigger:"mouseenter focus",iconClass:"icon-translation",items:this.items,"auto-close":!0}))}valueChangeHandler(){return e=>this.onSelectedLanguageChanged(e)}changeLanguage(e){let t=e;t||(t=this.languageService.getDefaultLanguage()),this.currentLanguage=t,this.items=this.getLanguageDropdownOptions()}onSelectedLanguageChanged(e){this.languageContextService.updateSelectedLanguage(e.detail)}getLanguageDropdownOptions(){return this.languageService.getSupportedLanguages().map(e=>{const t=this.currentLanguage===e?"icon-tick":"";return(new DropdownItem).setNameLabelKey(`language_selector.language.${e}.label`).setTooltipLabelKey(`language_selector.language.${e}.tooltip.`+(this.currentLanguage===e?"selected":"not_selected")).setIconClass(t).setCssClass(e).setValue(e).setDropdownTooltipTrigger("mouseenter focus")})}static get is(){return"onto-language-selector"}static get originalStyleUrls(){return{$:["onto-language-selector.scss"]}}static get styleUrls(){return{$:["onto-language-selector.css"]}}static get properties(){return{dropdownAlignment:{type:"string",attribute:"dropdown-alignment",mutable:!1,complexType:{original:"DropdownItemAlignment",resolved:"DropdownItemAlignment.LEFT | DropdownItemAlignment.RIGHT",references:{DropdownItemAlignment:{location:"import",path:"../../models/dropdown/dropdown-item-alignment",id:"src/models/dropdown/dropdown-item-alignment.ts::DropdownItemAlignment"}}},required:!1,optional:!1,docs:{tags:[],text:"Specifies the dropdown items' alignment. If not provided, the items and the dropdown button will be aligned to the left."},getter:!1,setter:!1,reflect:!1,defaultValue:"DropdownItemAlignment.LEFT"}}}static get states(){return{currentLanguage:{}}}}
@@ -1 +1 @@
1
- import{h,Host}from"@stencil/core";import{debounce}from"../../utils/function-utils";import{WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR}from"../../models/constants";import{AuthenticationService,EventName,EventService,getPathName,LocalStorageSubscriptionHandlerService,NavigationContextService,SecurityContextService,ServiceProvider,SubscriptionList,WindowService}from"../../../../../api/dist/ontotext-workbench-api";export class OntoLayout{constructor(){this.securityContextService=ServiceProvider.get(SecurityContextService),this.authenticationService=ServiceProvider.get(AuthenticationService),this.navigationContextService=ServiceProvider.get(NavigationContextService),this.isLowResolution=!1,this.hasPermission=!0,this.showHeader=this.isAuthenticatedFully(),this.subscriptions=new SubscriptionList,this.isNavbarCollapsed=!1,this.windowResizeObserver=debounce(()=>this.windowResizeHandler(),50),WindowService.getWindow().addEventListener("storage",this.handleStorageChange)}componentDidLoad(){this.windowResizeHandler()}connectedCallback(){this.subscribeToSecurityChanges(),this.updateVisibility(),this.subscriptions.add(this.securityContextService.onRestrictedPagesChanged(e=>this.setPermission(e))),this.subscriptions.add(ServiceProvider.get(EventService).subscribe(EventName.NAVIGATION_END,e=>{this.navigationContextService.updatePreviousRoute(e.oldUrl),this.setPermission(this.securityContextService.getRestrictedPages())})),this.setPermission(this.securityContextService.getRestrictedPages())}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return h(Host,{key:"8ac7b898ae52fb40814ae664c1666ac3d05e3263",class:"wb-layout"},h("div",{key:"2672ccbf6b5f17a25cca8e4db244705ac0fc333d",class:"default-slot-wrapper"},h("slot",{key:"24543fc3c526950e944dc4e37e4ed559fae1c389",name:"default"})),h("header",{key:"a67d6e4932aae82b474d70d220415cea271ffeb9",class:"wb-header"},this.showHeader&&h("onto-header",{key:"8bb74bfea276d89824ead02609e80c070582d35e"})),h("nav",{key:"e5f83abdc3d6f1d89d9e6e2f83b7c6a62bc22389",class:"wb-navbar"},h("onto-navbar",{key:"2265c999b7650d255f28efd07b1f9977b7a9498f",ref:this.assignNavbarRef(),"navbar-collapsed":this.isLowResolution})),this.hasPermission?h("div",{class:"main-slot-wrapper"},h("slot",{name:"main"})):h("onto-permission-banner",null),h("footer",{key:"016c8d0c9c1de47b9c4ccf64a0f717ee67f4fcbc",class:"wb-footer"},h("onto-footer",{key:"90787f7d2c4cf1840ae3048d4b60f4f7c1ea948f"})),h("onto-tooltip",{key:"329f4cf1b14442c59da0125bc8b607185d402134"}),h("onto-toastr",{key:"615db8b9c70a90521ff393c5f98ff1d0c2f511b4"}))}onNavbarToggled(e){this.isNavbarCollapsed=e.detail.payload,this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}onResize(){this.windowResizeObserver()}windowResizeHandler(){this.isLowResolution=WindowService.getWindow().innerWidth<=WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR,this.isLowResolution||this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}handleStorageChange(e){ServiceProvider.get(LocalStorageSubscriptionHandlerService).handleStorageChange(e)}subscribeToSecurityChanges(){const e=ServiceProvider.get(SecurityContextService);this.subscriptions.add(e.onAuthenticatedUserChanged(e=>{this.authenticatedUser=e,this.updateVisibility()})),this.subscriptions.add(e.onSecurityConfigChanged(e=>{this.securityConfig=e,this.updateVisibility()})),this.subscriptions.add(ServiceProvider.get(EventService).subscribe(EventName.LOGOUT,()=>{this.setNavbarItemVisibility(),this.updateVisibility()})),this.subscriptions.add(e.onAuthTokenChanged(()=>{this.setNavbarItemVisibility(),this.updateVisibility()}))}setPermission(e){if(e){const t=getPathName();this.hasPermission=!e.isRestricted(t)}else this.hasPermission=!0;const t=document.querySelector(".wb-layout main");t&&(t.style.display=this.hasPermission?"block":"none")}updateVisibility(){this.authenticationService.isSecurityEnabled()?this.showHeader=this.authenticationService.isLoggedIn()||this.authenticationService.hasFreeAccess():this.showHeader=!0}isAuthenticatedFully(){const e=ServiceProvider.get(AuthenticationService);return!e.isSecurityEnabled()||e.isLoggedIn()||e.hasFreeAccess()}shouldShowMenu(e){return this.isAuthenticatedFully()&&ServiceProvider.get(AuthenticationService).hasRole(e)}assignNavbarRef(){return e=>{this.navbarRef=e,this.navbarRef.menuItems=WindowService.getWindow().PluginRegistry.get("main.menu"),this.setNavbarItemVisibility()}}setNavbarItemVisibility(){var e,t,i;if(!(null===(e=this.navbarRef)||void 0===e?void 0:e.menuItems))return;const s=e=>{var t;e.shouldShow=this.shouldShowMenu(e.role),(null===(t=e.children)||void 0===t?void 0:t.length)&&e.children.forEach(s)};null===(i=null===(t=this.navbarRef)||void 0===t?void 0:t.menuItems)||void 0===i||i.forEach(e=>{e.items.forEach(s)}),this.navbarRef.menuItems=[...this.navbarRef.menuItems]}static get is(){return"onto-layout"}static get originalStyleUrls(){return{$:["onto-layout.scss"]}}static get styleUrls(){return{$:["onto-layout.css"]}}static get states(){return{authenticatedUser:{},authToken:{},securityConfig:{},isLowResolution:{},hasPermission:{},showHeader:{}}}static get elementRef(){return"hostElement"}static get listeners(){return[{name:"navbarToggled",method:"onNavbarToggled",target:void 0,capture:!1,passive:!1},{name:"resize",method:"onResize",target:"window",capture:!1,passive:!0}]}}
1
+ import{h,Host}from"@stencil/core";import{debounce}from"../../utils/function-utils";import{WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR}from"../../models/constants";import{AuthenticationService,EventName,EventService,getPathName,LocalStorageSubscriptionHandlerService,NavigationContextService,SecurityContextService,ServiceProvider,SubscriptionList,WindowService}from"../../../../../api/dist/ontotext-workbench-api";export class OntoLayout{constructor(){this.securityContextService=ServiceProvider.get(SecurityContextService),this.authenticationService=ServiceProvider.get(AuthenticationService),this.navigationContextService=ServiceProvider.get(NavigationContextService),this.isLowResolution=!1,this.hasPermission=!0,this.showHeader=this.isAuthenticatedFully(),this.subscriptions=new SubscriptionList,this.isNavbarCollapsed=!1,this.windowResizeObserver=debounce(()=>this.windowResizeHandler(),50),WindowService.getWindow().addEventListener("storage",this.handleStorageChange)}componentDidLoad(){this.windowResizeHandler()}connectedCallback(){this.subscribeToSecurityChanges(),this.updateVisibility(),this.subscriptions.add(this.securityContextService.onRestrictedPagesChanged(e=>this.setPermission(e))),this.subscriptions.add(ServiceProvider.get(EventService).subscribe(EventName.NAVIGATION_END,e=>{this.navigationContextService.updatePreviousRoute(e.oldUrl),this.setPermission(this.securityContextService.getRestrictedPages())})),this.setPermission(this.securityContextService.getRestrictedPages())}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return h(Host,{key:"90a5dad7d845cea4850e1c30536d342b2818675e",class:"wb-layout"},h("div",{key:"f0696fdfd37916dce67c19b0e24e9ea8ab8ca25e",class:"default-slot-wrapper"},h("slot",{key:"fc64ae48959eab6701fb525ce3cba116b6d5f691",name:"default"})),h("header",{key:"0707ae4470abc2fce8a04c76bf06ad5e6d140851",class:"wb-header"},this.showHeader&&h("onto-header",{key:"3f449a558cd503feba57d0cdbafe57d3552065a2"})),h("nav",{key:"2b36a84437f77c6e3712ec6d8859bb49f580dba4",class:"wb-navbar"},h("onto-navbar",{key:"528842ea4de9302d682b613fea34f35ee5a56ef4",ref:this.assignNavbarRef(),"navbar-collapsed":this.isLowResolution})),this.hasPermission?h("div",{class:"main-slot-wrapper"},h("slot",{name:"main"})):h("onto-permission-banner",null),h("footer",{key:"0c47d98ea4aec920ce7cdd47ae2f8d1055a6ca1e",class:"wb-footer"},h("onto-footer",{key:"56fd061c93680623d7e8e67129a16e6aec4517cf"})),h("onto-tooltip",{key:"63ff5af241e77411cc5bb8ebf66a349330a69447"}),h("onto-toastr",{key:"ca03acdceccfe38dce6440ebe0b71d71ad26b1d3"}))}onNavbarToggled(e){this.isNavbarCollapsed=e.detail.payload,this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}onResize(){this.windowResizeObserver()}windowResizeHandler(){this.isLowResolution=WindowService.getWindow().innerWidth<=WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR,this.isLowResolution||this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}handleStorageChange(e){ServiceProvider.get(LocalStorageSubscriptionHandlerService).handleStorageChange(e)}subscribeToSecurityChanges(){const e=ServiceProvider.get(SecurityContextService);this.subscriptions.add(e.onAuthenticatedUserChanged(e=>{this.authenticatedUser=e,this.updateVisibility()})),this.subscriptions.add(e.onSecurityConfigChanged(e=>{this.securityConfig=e,this.updateVisibility()})),this.subscriptions.add(ServiceProvider.get(EventService).subscribe(EventName.LOGOUT,()=>{this.setNavbarItemVisibility(),this.updateVisibility()})),this.subscriptions.add(e.onAuthTokenChanged(()=>{this.setNavbarItemVisibility(),this.updateVisibility()}))}setPermission(e){if(e){const t=getPathName();this.hasPermission=!e.isRestricted(t)}else this.hasPermission=!0;const t=document.querySelector(".wb-layout main");t&&(t.style.display=this.hasPermission?"block":"none")}updateVisibility(){this.authenticationService.isSecurityEnabled()?this.showHeader=this.authenticationService.isLoggedIn()||this.authenticationService.hasFreeAccess():this.showHeader=!0}isAuthenticatedFully(){const e=ServiceProvider.get(AuthenticationService);return!e.isSecurityEnabled()||e.isLoggedIn()||e.hasFreeAccess()}shouldShowMenu(e){return this.isAuthenticatedFully()&&ServiceProvider.get(AuthenticationService).hasRole(e)}assignNavbarRef(){return e=>{this.navbarRef=e,this.navbarRef.menuItems=WindowService.getWindow().PluginRegistry.get("main.menu"),this.setNavbarItemVisibility()}}setNavbarItemVisibility(){var e,t,i;if(!(null===(e=this.navbarRef)||void 0===e?void 0:e.menuItems))return;const s=e=>{var t;e.shouldShow=this.shouldShowMenu(e.role),(null===(t=e.children)||void 0===t?void 0:t.length)&&e.children.forEach(s)};null===(i=null===(t=this.navbarRef)||void 0===t?void 0:t.menuItems)||void 0===i||i.forEach(e=>{e.items.forEach(s)}),this.navbarRef.menuItems=[...this.navbarRef.menuItems]}static get is(){return"onto-layout"}static get originalStyleUrls(){return{$:["onto-layout.scss"]}}static get styleUrls(){return{$:["onto-layout.css"]}}static get states(){return{authenticatedUser:{},authToken:{},securityConfig:{},isLowResolution:{},hasPermission:{},showHeader:{}}}static get elementRef(){return"hostElement"}static get listeners(){return[{name:"navbarToggled",method:"onNavbarToggled",target:void 0,capture:!1,passive:!1},{name:"resize",method:"onResize",target:"window",capture:!1,passive:!0}]}}
@@ -1 +1 @@
1
- export class NavbarModel{constructor(e=[]){this._items=e}hasParent(e){return this._items.some(t=>e===t.label)}getModel(){const e=t=>{const s=t.children.map(e);return new NavbarItemModel(Object.assign(Object.assign({},t),{children:s}))};return this._items.map(e)}addItem(e){this._items.push(e)}getSelectedRootItem(){return this._items.find(e=>e.selected)}isParentOpened(e){var t;return!!(null===(t=this.getParentItem(e))||void 0===t?void 0:t.open)}getTopLevelItem(e){return this._items.find(t=>t.label===e)}getParentItem(e){return this._items.find(t=>t.label===e.parent)}deselectAll(){this.walk(e=>{e.selected=!1})}closeAll(){this.walk(e=>{e.open=!1})}deselectItem(e){e.selected=!1}selectItem(e){e.label?e.selected=!0:this.selectItem(e.parentModel)}hasSelectedSubmenu(e){return!!e.children&&e.children.some(e=>this.hasSelection(e))}hasSelection(e){return!!e.selected||!!e.children&&e.children.some(e=>this.hasSelection(e))}closeOpened(){const e=this._items.find(e=>e.open);e&&(this.hasSelectedSubmenu(e)&&this.selectItem(e),e.open=!1)}open(e){this.walk(e=>{e.open=!1}),this.openItemAndParent(e)}openItemAndParent(e){e.parentModel&&this.openItemAndParent(e.parentModel),e.open=!0}closeOtherParents(e){const t=e.parent;this.walk(e=>{e.label!==t&&(e.open=!1)})}highlightSelected(){const e=this.getSelectedItem();(null==e?void 0:e.hasParent)&&this.selectItem(this.getParentItem(e))}unhighlightSelected(){const e=this.getSelectedRootItem();e&&e.children.length&&e.open&&this.deselectItem(e)}getSelectedItem(){let e=null;const t=s=>{if(s.selected)return e=s,!0;if(s.children)for(const e of s.children)if(t(e))return!0;return!1};return this._items.some(t),e}expandSelected(){const e=this.getSelectedItem();e&&(e.hasParent?this.open(this.getParentItem(e)):this.open(e))}initSelected(e){this.walk(t=>{var s;let r=e;(null===(s=t.href)||void 0===s?void 0:s.includes("*"))&&(r=this.getWildcardPath(e,t.href)),t.href===r&&(t.hasParent&&this.open(t),this.selectItem(t))})}getWildcardPath(e,t){const s=e.split("/"),r=t.split("/");if(s.length!==r.length)return e;const i=[];for(let t=0;t<r.length;t++)if("*"===r[t])i.push("*");else{if(r[t]!==s[t])return e;i.push(r[t])}return i.join("/")}sorted(){return this._items.filter(e=>e.children).forEach(e=>{e.children.sort(NavbarModel.compare)}),this._items.sort(NavbarModel.compare),this}static compare(e,t){return e.order-t.order}walk(e){this.walkRecursively(this.items,e)}walkRecursively(e,t){e.forEach(e=>{var s;t(e),(null===(s=e.children)||void 0===s?void 0:s.length)&&this.walkRecursively(e.children,t)})}get items(){return this._items}}export class NavbarItemModel{constructor(e){var t;this._selected=!1,this._open=!1,this._order=e.order,this._label=e.label,this._labelKey=e.labelKey,this._href=e.href,this._children=[...null!==(t=e.children)&&void 0!==t?t:[]],this._hasParent=e.hasParent,this._parent=e.parent,this._selected=e.selected,this._open=e.open,this._documentationHref=e.documentationHref,this._hrefFun=e.hrefFun,this._editions=e.editions,this._icon=e.icon,this._role=e.role,this._guideSelector=e.guideSelector,this._testSelector=e.testSelector,this._parentModel=e.parentModel}addChild(e){this.children.push(e),e.setParent(this)}addChildren(...e){e.forEach(e=>{this.addChild(e)})}hasSubmenus(){return"#"===this._href}get parent(){return this._parent}set parent(e){this._parent=e}get order(){return this._order}set order(e){this._order=e}get label(){return this._label}set label(e){this._label=e}get labelKey(){return this._labelKey}set labelKey(e){this._labelKey=e}get documentationHref(){return this._documentationHref}set documentationHref(e){this._documentationHref=e}get href(){return this._href}set href(e){this._href=e}get children(){return this._children}set children(e){this._children=e}get hasParent(){return this._hasParent}set hasParent(e){this._hasParent=e}get selected(){return this._selected}set selected(e){this._selected=e}get open(){return this._open}set open(e){this._open=e}get hrefFun(){return this._hrefFun}set hrefFun(e){this._hrefFun=e}get editions(){return this._editions}set editions(e){this._editions=e}get icon(){return this._icon}set icon(e){this._icon=e}get role(){return this._role}set role(e){this._role=e}get guideSelector(){return this._guideSelector}set guideSelector(e){this._guideSelector=e}get testSelector(){return this._testSelector}set testSelector(e){this._testSelector=e}get parentModel(){return this._parentModel}set parentModel(e){this._parentModel=e}setParent(e){this.parentModel=e,this.hasParent=!!e}}
1
+ export class NavbarModel{constructor(e=[]){this._items=e}hasParent(e){return this._items.some(t=>e===t.label)}getModel(){const e=t=>{const s=t.children.map(e);return new NavbarItemModel(Object.assign(Object.assign({},t),{children:s}))};return this._items.map(e)}addItem(e){this._items.push(e)}getSelectedRootItem(){return this._items.find(e=>e.selected)}isParentOpened(e){var t;return!!(null===(t=this.getParentItem(e))||void 0===t?void 0:t.open)}getTopLevelItem(e){return this._items.find(t=>t.label===e)}getParentItem(e){return this._items.find(t=>t.label===e.parent)}deselectAll(){this.walk(e=>{e.selected=!1})}closeAll(){this.walk(e=>{e.open=!1})}deselectItem(e){e.selected=!1}selectItem(e){e.label?e.selected=!0:this.selectItem(e.parentModel)}hasSelectedSubmenu(e){return!!e.children&&e.children.some(e=>this.hasSelection(e))}hasSelection(e){return!!e.selected||!!e.children&&e.children.some(e=>this.hasSelection(e))}closeOpened(){const e=this._items.find(e=>e.open);e&&(this.hasSelectedSubmenu(e)&&this.selectItem(e),e.open=!1)}open(e){this.walk(e=>{e.open=!1}),this.openItemAndParent(e)}openItemAndParent(e){e.parentModel&&this.openItemAndParent(e.parentModel),e.open=!0}closeOtherParents(e){const t=e.parent;this.walk(e=>{e.label!==t&&(e.open=!1)})}highlightSelected(){const e=this.getSelectedItem();(null==e?void 0:e.hasParent)&&this.selectItem(this.getParentItem(e))}unhighlightSelected(){const e=this.getSelectedRootItem();e&&e.children.length&&e.open&&this.deselectItem(e)}getSelectedItem(){let e=null;const t=s=>{if(s.selected)return e=s,!0;if(s.children)for(const e of s.children)if(t(e))return!0;return!1};return this._items.some(t),e}expandSelected(){const e=this.getSelectedItem();e&&(e.hasParent?this.open(this.getParentItem(e)):this.open(e))}initSelected(e){this.walk(t=>{var s;let r=e;(null===(s=t.href)||void 0===s?void 0:s.includes("*"))&&(r=this.getWildcardPath(e,t.href)),t.href===r&&(t.hasParent&&this.open(t),this.selectItem(t))})}getWildcardPath(e,t){const s=e.split("/"),r=t.split("/");if(s.length!==r.length)return e;const i=[];for(let t=0;t<r.length;t++)if("*"===r[t])i.push("*");else{if(r[t]!==s[t])return e;i.push(r[t])}return i.join("/")}sorted(){return this._items.filter(e=>e.children).forEach(e=>{e.children.sort(NavbarModel.compare)}),this._items.sort(NavbarModel.compare),this}static compare(e,t){return e.order-t.order}walk(e){this.walkRecursively(this.items,e)}walkRecursively(e,t){e.forEach(e=>{var s;t(e),(null===(s=e.children)||void 0===s?void 0:s.length)&&this.walkRecursively(e.children,t)})}get items(){return this._items}}export class NavbarItemModel{constructor(e){var t;this._selected=!1,this._open=!1,this._order=e.order,this._label=e.label,this._labelKey=e.labelKey,this._href=e.href,this._children=[...null!==(t=e.children)&&void 0!==t?t:[]],this._hasParent=e.hasParent,this._parent=e.parent,this._selected=e.selected,this._open=e.open,this._documentationHref=e.documentationHref,this._hrefFun=e.hrefFun,this._editions=e.editions,this._icon=e.icon,this._role=e.role,this._guideSelector=e.guideSelector,this._testSelector=e.testSelector,this._shouldShow=e.shouldShow,this._parentModel=e.parentModel}addChild(e){this.children.push(e),e.setParent(this)}addChildren(...e){e.forEach(e=>{this.addChild(e)})}hasSubmenus(){return"#"===this._href}get parent(){return this._parent}set parent(e){this._parent=e}get order(){return this._order}set order(e){this._order=e}get label(){return this._label}set label(e){this._label=e}get labelKey(){return this._labelKey}set labelKey(e){this._labelKey=e}get documentationHref(){return this._documentationHref}set documentationHref(e){this._documentationHref=e}get href(){return this._href}set href(e){this._href=e}get children(){return this._children}set children(e){this._children=e}get hasParent(){return this._hasParent}set hasParent(e){this._hasParent=e}get selected(){return this._selected}set selected(e){this._selected=e}get open(){return this._open}set open(e){this._open=e}get hrefFun(){return this._hrefFun}set hrefFun(e){this._hrefFun=e}get editions(){return this._editions}set editions(e){this._editions=e}get icon(){return this._icon}set icon(e){this._icon=e}get role(){return this._role}set role(e){this._role=e}get guideSelector(){return this._guideSelector}set guideSelector(e){this._guideSelector=e}get testSelector(){return this._testSelector}set testSelector(e){this._testSelector=e}get parentModel(){return this._parentModel}set parentModel(e){this._parentModel=e}get shouldShow(){return this._shouldShow}set shouldShow(e){this._shouldShow=e}setParent(e){this.parentModel=e,this.hasParent=!!e}}
@@ -1 +1 @@
1
- import{NavbarItemModel,NavbarModel}from"./navbar-model";import{UriUtil}from"../../../../../api/dist/ontotext-workbench-api";export class NavbarService{static map(e,t){const o=new NavbarModel;return NavbarService.setTopLevelMenuItems(e,o,t),NavbarService.setSubmenuItems(e,o,t),o.sorted()}static setTopLevelMenuItems(e,t,o){e.forEach(e=>{e.items.filter(e=>!e.parent&&e.shouldShow).forEach(e=>{t.hasParent(e.label)?console.warn("Doubled parent definition: ",e):t.addItem(this.toMenuItemModel(e,void 0,o,e.children))})})}static setSubmenuItems(e,t,o){e.forEach(e=>{e.items.filter(e=>e.parent&&e.shouldShow).forEach(e=>{const r=t.getTopLevelItem(e.parent);null==r||r.addChildren(this.toMenuItemModel(e,r,o,e.children))})})}static toMenuItemModel(e,t,o,r=[]){let n;e.documentationHref&&(n=UriUtil.resolveDocumentationUrl(null==o?void 0:o.shortVersion,e.documentationHref));const a=new NavbarItemModel({label:e.label,labelKey:e.labelKey,href:n||e.href,documentationHref:e.documentationHref,hrefFun:e.hrefFun,order:e.order,role:e.role,editions:e.editions,icon:e.icon,guideSelector:e.guideSelector,hasParent:!!t,parentModel:t,parent:e.parent,selected:!1,testSelector:e.testSelector}),l=r.map(e=>this.toMenuItemModel(e,a,o,e.children));return a.addChildren(...l),a}}
1
+ import{NavbarItemModel,NavbarModel}from"./navbar-model";import{UriUtil}from"../../../../../api/dist/ontotext-workbench-api";export class NavbarService{static map(e,t){const o=new NavbarModel;return NavbarService.setTopLevelMenuItems(e,o,t),NavbarService.setSubmenuItems(e,o,t),o.sorted()}static setTopLevelMenuItems(e,t,o){e.forEach(e=>{e.items.filter(e=>!e.parent&&e.shouldShow).forEach(e=>{t.hasParent(e.label)?console.warn("Doubled parent definition: ",e):t.addItem(this.toMenuItemModel(e,void 0,o,e.children))})})}static setSubmenuItems(e,t,o){e.forEach(e=>{e.items.filter(e=>e.parent&&e.shouldShow).forEach(e=>{const r=t.getTopLevelItem(e.parent);null==r||r.addChildren(this.toMenuItemModel(e,r,o,e.children))})})}static toMenuItemModel(e,t,o,r=[]){let n;e.documentationHref&&(n=UriUtil.resolveDocumentationUrl(null==o?void 0:o.shortVersion,e.documentationHref));const a=new NavbarItemModel({label:e.label,labelKey:e.labelKey,href:n||e.href,documentationHref:e.documentationHref,hrefFun:e.hrefFun,order:e.order,role:e.role,editions:e.editions,icon:e.icon,guideSelector:e.guideSelector,hasParent:!!t,parentModel:t,parent:e.parent,selected:!1,shouldShow:e.shouldShow,testSelector:e.testSelector}),l=r.map(e=>this.toMenuItemModel(e,a,o,e.children));return a.addChildren(...l),a}}
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{OperationGroup,OperationStatus,MapperProvider,OperationGroupSummaryListMapper,navigateTo}from"../../../../../api/dist/ontotext-workbench-api";const operationGroupToIcon={[OperationGroup.BACKUP]:"fa-regular fa-archive",[OperationGroup.QUERY]:"fa-regular fa-arrow-right-arrow-left",[OperationGroup.CLUSTER]:"fa-regular fa-sitemap",[OperationGroup.IMPORT]:"icon-import"},operationStatusToWarningClass={[OperationStatus.WARNING]:"status-warning",[OperationStatus.INFORMATION]:"status-information",[OperationStatus.CRITICAL]:"status-critical"},operationStatusToFadeClass={[OperationStatus.WARNING]:"onto-btn-fade-warning",[OperationStatus.CRITICAL]:"onto-btn-fade-danger"};export class OntoOperationsNotification{constructor(){this.isOpen=!1,this.toggleDropdown=t=>{t.stopPropagation(),this.isOpen=!this.isOpen}}handleOutsideClick(){this.isOpen&&(this.isOpen=!1)}render(){var t;return this.operationGroups=MapperProvider.get(OperationGroupSummaryListMapper).mapToModel(this.activeOperations.toOperationsGroupSummary()),h("section",{key:"712c1ce182b57a0a7f76b73adbc8ffd6330307a1",class:"operations-statuses"},h("button",{key:"3fee287a7da339edad363fa7f738ebedfd1e0380",class:`operations-statuses-dropdown-toggle ${this.isOpen?"open":"closed"} ${null!==(t=operationStatusToFadeClass[this.activeOperations.status])&&void 0!==t?t:""}`,onClick:this.toggleDropdown},this.operationGroups.getItems().map(t=>h("section",{key:t.id,class:"operation-status-header"},h("i",{class:`${operationGroupToIcon[t.group]} ${operationStatusToWarningClass[t.status]}`}),t.totalOperations?h("sup",{class:"running-operation-count tag-info"},t.totalOperations):"")),h("i",{key:"35affed15d885565af6cc4d615ecbda718420574",class:"fa-light fa-angle-down "+(this.isOpen?"fa-rotate-180":"")})),this.isOpen&&h("ul",{key:"34e850882c6ffdeaa66c7c5569926e9e3936637c",class:"operations-dropdown"},h("section",{key:"d9632ebdb5ca258a51d89fe5e28e3230f5e8e6b1",class:"operations-statuses-content"},this.activeOperations.allRunningOperations.getItems().map(t=>h("li",{key:t.id},h("a",{class:`operation-status-content onto-btn no-underline ${operationStatusToWarningClass[t.status]}`,target:"_blank",onClick:navigateTo(t.href)},h("i",{class:operationGroupToIcon[t.group]}),h("span",{class:"operation-status-label"},h("translate-label",{labelKey:`operations_notification.links.${t.labelKey}`})),h("span",{class:"operation-number"},t.count?h("span",{class:"operation-status-running-operation-count"},t.count):"")))))))}static get is(){return"onto-operations-notification"}static get originalStyleUrls(){return{$:["onto-operations-notification.scss"]}}static get styleUrls(){return{$:["onto-operations-notification.css"]}}static get properties(){return{activeOperations:{type:"unknown",attribute:"active-operations",mutable:!1,complexType:{original:"OperationStatusSummary",resolved:"OperationStatusSummary",references:{OperationStatusSummary:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::OperationStatusSummary"}}},required:!1,optional:!1,docs:{tags:[],text:"The active operations summary. Holds general status and all current operations"},getter:!1,setter:!1}}}static get states(){return{isOpen:{}}}static get elementRef(){return"el"}static get listeners(){return[{name:"click",method:"handleOutsideClick",target:"window",capture:!1,passive:!1}]}}
1
+ import{h}from"@stencil/core";import{OperationGroup,OperationStatus,MapperProvider,OperationGroupSummaryListMapper,navigateTo}from"../../../../../api/dist/ontotext-workbench-api";const operationGroupToIcon={[OperationGroup.BACKUP]:"fa-regular fa-archive",[OperationGroup.QUERY]:"fa-regular fa-arrow-right-arrow-left",[OperationGroup.CLUSTER]:"fa-regular fa-sitemap",[OperationGroup.IMPORT]:"icon-import"},operationStatusToWarningClass={[OperationStatus.WARNING]:"status-warning",[OperationStatus.INFORMATION]:"status-information",[OperationStatus.CRITICAL]:"status-critical"},operationStatusToFadeClass={[OperationStatus.WARNING]:"onto-btn-fade-warning",[OperationStatus.CRITICAL]:"onto-btn-fade-danger"};export class OntoOperationsNotification{constructor(){this.isOpen=!1,this.toggleDropdown=t=>{t.stopPropagation(),this.isOpen=!this.isOpen}}handleOutsideClick(){this.isOpen&&(this.isOpen=!1)}render(){var t;return this.operationGroups=MapperProvider.get(OperationGroupSummaryListMapper).mapToModel(this.activeOperations.toOperationsGroupSummary()),h("section",{key:"9f3f9af5fc9db87aebe2196011f5aea788d54c28",class:"operations-statuses"},h("button",{key:"3e29170276812080c7c587aefff605f31b869584",class:`operations-statuses-dropdown-toggle ${this.isOpen?"open":"closed"} ${null!==(t=operationStatusToFadeClass[this.activeOperations.status])&&void 0!==t?t:""}`,onClick:this.toggleDropdown},this.operationGroups.getItems().map(t=>h("section",{key:t.id,class:"operation-status-header"},h("i",{class:`${operationGroupToIcon[t.group]} ${operationStatusToWarningClass[t.status]}`}),t.totalOperations?h("sup",{class:"running-operation-count tag-info"},t.totalOperations):"")),h("i",{key:"3d4657cd5feda18c83690033f86401f4cd032fd5",class:"fa-light fa-angle-down "+(this.isOpen?"fa-rotate-180":"")})),this.isOpen&&h("ul",{key:"16f0e84d431de676bf61ad6ee4e2238e051aebd6",class:"operations-dropdown"},h("section",{key:"f9cf81d115e5ec7bdd15d9cbdc2f451bc5505440",class:"operations-statuses-content"},this.activeOperations.allRunningOperations.getItems().map(t=>h("li",{key:t.id},h("a",{class:`operation-status-content onto-btn no-underline ${operationStatusToWarningClass[t.status]}`,target:"_blank",onClick:navigateTo(t.href)},h("i",{class:operationGroupToIcon[t.group]}),h("span",{class:"operation-status-label"},h("translate-label",{labelKey:`operations_notification.links.${t.labelKey}`})),h("span",{class:"operation-number"},t.count?h("span",{class:"operation-status-running-operation-count"},t.count):"")))))))}static get is(){return"onto-operations-notification"}static get originalStyleUrls(){return{$:["onto-operations-notification.scss"]}}static get styleUrls(){return{$:["onto-operations-notification.css"]}}static get properties(){return{activeOperations:{type:"unknown",attribute:"active-operations",mutable:!1,complexType:{original:"OperationStatusSummary",resolved:"OperationStatusSummary",references:{OperationStatusSummary:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::OperationStatusSummary"}}},required:!1,optional:!1,docs:{tags:[],text:"The active operations summary. Holds general status and all current operations"},getter:!1,setter:!1}}}static get states(){return{isOpen:{}}}static get elementRef(){return"el"}static get listeners(){return[{name:"click",method:"handleOutsideClick",target:"window",capture:!1,passive:!1}]}}
@@ -1 +1 @@
1
- import{EventService,openInNewTab,ResourceSearchStorageService,SearchButton,SearchButtonConfig,ServiceProvider,SubscriptionList,UriUtil}from"../../../../../api/dist/ontotext-workbench-api";import{h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";import{HtmlUtil}from"../../utils/html-util";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";import{ResourceSearchConstants}from"../../models/resource-search/resource-search-constants";export class OntoRdfSearch{constructor(){this.subscriptions=new SubscriptionList,this.eventService=ServiceProvider.get(EventService),this.resourceSearchStorageService=ServiceProvider.get(ResourceSearchStorageService),this.RDF_CONTEXT="rdfSearchContext",this.isOpen=!1,this.redirectUrl=UriUtil.RESOURCE_URL}handleClick(e){var t;this.isOpen&&((null===(t=this.rdfSearchRef)||void 0===t?void 0:t.contains(e.target))||(this.isOpen=!1))}connectedCallback(){this.onSuggestionSelected()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}componentDidRender(){this.focusSearchInput()}componentDidLoad(){this.buttonConfig=this.createButtonConfig()}render(){return h("section",{key:"1e1a1cee99df6649be6576f9016145517a8d0f7d",ref:e=>this.rdfSearchRef=e,class:"onto-rdf-search",onKeyDown:this.onKeyDown(),"data-test":"onto-rdf-search-component"},h("section",{key:"c9ece5ee22594314fc6bac0ff869282c9354e943",class:"search-area "+(this.isOpen?"visible":"invisible")},h("i",{key:"72d62b9b17a55a6ace4bce5e64ddf3a0726e049f",onClick:this.setIsOpen(!1),"tooltip-content":TranslationService.translate("rdf_search.tooltips.close_search_area"),"tooltip-placement":OntoTooltipPlacement.BOTTOM,"data-test":"onto-rdf-resource-search-close-btn",class:"fa-light fa-xmark-large close-btn"}),h("onto-search-resource-input",{key:"c81d0f967b5f2e5e6a78d6818029fc08bec6e2d2",buttonConfig:this.buttonConfig,preserveSearch:!0,isHidden:!this.isOpen,"data-test":"onto-rdf-resource-search-input",context:this.RDF_CONTEXT})),this.isOpen?"":h("onto-search-icon",{onClick:this.setIsOpen(!0)}))}setIsOpen(e){return()=>{this.isOpen=e,this.isOpen&&this.loadSelectedViewFromStorage()}}createButtonConfig(){return new SearchButtonConfig({isRadio:!0,buttons:[this.createSearchButton(ResourceSearchConstants.TABLE_VIEW,"rdf_search.buttons.table",()=>{this.redirectUrl=UriUtil.RESOURCE_URL,this.resourceSearchStorageService.setSelectedView(ResourceSearchConstants.TABLE_VIEW)},!0),this.createSearchButton(ResourceSearchConstants.VISUAL_VIEW,"rdf_search.buttons.visual",()=>{this.redirectUrl=UriUtil.GRAPHS_VISUALIZATIONS_URL,this.resourceSearchStorageService.setSelectedView(ResourceSearchConstants.VISUAL_VIEW)},!1)]})}createSearchButton(e,t,r,s){return new SearchButton({label:TranslationService.translate(t),id:e,callback:r,selected:s})}onSuggestionSelected(){this.subscriptions.add(this.eventService.subscribe(ResourceSearchConstants.SUGGESTION_SELECTED_EVENT,e=>{if(e.getContext()===this.RDF_CONTEXT){const t=e.getSuggestion().getOverrideToVisual()?UriUtil.GRAPHS_VISUALIZATIONS_URL:this.redirectUrl;openInNewTab(UriUtil.createAutocompleteRedirect(t,e.getSuggestion().getValue()))}}))}onKeyDown(){return e=>{"Escape"===e.key&&(this.isOpen=!1)}}focusSearchInput(){this.isOpen&&HtmlUtil.focusElement(`#${this.RDF_CONTEXT}`)}loadSelectedViewFromStorage(){const e=this.resourceSearchStorageService.getSelectedView();if(e){const t=this.buttonConfig.getButtons().find(t=>t.id===e);t&&(this.buttonConfig=this.buttonConfig.selectButton(t))}}static get is(){return"onto-rdf-search"}static get originalStyleUrls(){return{$:["onto-rdf-search.scss"]}}static get styleUrls(){return{$:["onto-rdf-search.css"]}}static get states(){return{isOpen:{},buttonConfig:{}}}static get listeners(){return[{name:"click",method:"handleClick",target:"window",capture:!1,passive:!1}]}}
1
+ import{EventService,openInNewTab,ResourceSearchStorageService,SearchButton,SearchButtonConfig,ServiceProvider,SubscriptionList,UriUtil}from"../../../../../api/dist/ontotext-workbench-api";import{h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";import{HtmlUtil}from"../../utils/html-util";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";import{ResourceSearchConstants}from"../../models/resource-search/resource-search-constants";export class OntoRdfSearch{constructor(){this.subscriptions=new SubscriptionList,this.eventService=ServiceProvider.get(EventService),this.resourceSearchStorageService=ServiceProvider.get(ResourceSearchStorageService),this.RDF_CONTEXT="rdfSearchContext",this.isOpen=!1,this.redirectUrl=UriUtil.RESOURCE_URL}handleClick(e){var t;this.isOpen&&((null===(t=this.rdfSearchRef)||void 0===t?void 0:t.contains(e.target))||(this.isOpen=!1))}connectedCallback(){this.onSuggestionSelected()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}componentDidRender(){this.focusSearchInput()}componentDidLoad(){this.buttonConfig=this.createButtonConfig()}render(){return h("section",{key:"c06727ea1f5985617e1434015c6a4bcf270f4f46",ref:e=>this.rdfSearchRef=e,class:"onto-rdf-search",onKeyDown:this.onKeyDown(),"data-test":"onto-rdf-search-component"},h("section",{key:"8f87cca4fb3b5be1f953140fde83b7b9ce538a09",class:"search-area "+(this.isOpen?"visible":"invisible")},h("i",{key:"f65a0d5445c1da7ba859c554a0811a93ac1fdaf6",onClick:this.setIsOpen(!1),"tooltip-content":TranslationService.translate("rdf_search.tooltips.close_search_area"),"tooltip-placement":OntoTooltipPlacement.BOTTOM,"data-test":"onto-rdf-resource-search-close-btn",class:"fa-light fa-xmark-large close-btn"}),h("onto-search-resource-input",{key:"2b6919e5ce2ba385729e5920450b19481d18d37d",buttonConfig:this.buttonConfig,preserveSearch:!0,isHidden:!this.isOpen,"data-test":"onto-rdf-resource-search-input",context:this.RDF_CONTEXT})),this.isOpen?"":h("onto-search-icon",{onClick:this.setIsOpen(!0)}))}setIsOpen(e){return()=>{this.isOpen=e,this.isOpen&&this.loadSelectedViewFromStorage()}}createButtonConfig(){return new SearchButtonConfig({isRadio:!0,buttons:[this.createSearchButton(ResourceSearchConstants.TABLE_VIEW,"rdf_search.buttons.table",()=>{this.redirectUrl=UriUtil.RESOURCE_URL,this.resourceSearchStorageService.setSelectedView(ResourceSearchConstants.TABLE_VIEW)},!0),this.createSearchButton(ResourceSearchConstants.VISUAL_VIEW,"rdf_search.buttons.visual",()=>{this.redirectUrl=UriUtil.GRAPHS_VISUALIZATIONS_URL,this.resourceSearchStorageService.setSelectedView(ResourceSearchConstants.VISUAL_VIEW)},!1)]})}createSearchButton(e,t,r,s){return new SearchButton({label:TranslationService.translate(t),id:e,callback:r,selected:s})}onSuggestionSelected(){this.subscriptions.add(this.eventService.subscribe(ResourceSearchConstants.SUGGESTION_SELECTED_EVENT,e=>{if(e.getContext()===this.RDF_CONTEXT){const t=e.getSuggestion().getOverrideToVisual()?UriUtil.GRAPHS_VISUALIZATIONS_URL:this.redirectUrl;openInNewTab(UriUtil.createAutocompleteRedirect(t,e.getSuggestion().getValue()))}}))}onKeyDown(){return e=>{"Escape"===e.key&&(this.isOpen=!1)}}focusSearchInput(){this.isOpen&&HtmlUtil.focusElement(`#${this.RDF_CONTEXT}`)}loadSelectedViewFromStorage(){const e=this.resourceSearchStorageService.getSelectedView();if(e){const t=this.buttonConfig.getButtons().find(t=>t.id===e);t&&(this.buttonConfig=this.buttonConfig.selectButton(t))}}static get is(){return"onto-rdf-search"}static get originalStyleUrls(){return{$:["onto-rdf-search.scss"]}}static get styleUrls(){return{$:["onto-rdf-search.css"]}}static get states(){return{isOpen:{},buttonConfig:{}}}static get listeners(){return[{name:"click",method:"handleClick",target:"window",capture:!1,passive:!1}]}}
@@ -1 +1 @@
1
- import{Host,h}from"@stencil/core";import{ServiceProvider,RepositoryContextService,UriUtil}from"../../../../../api/dist/ontotext-workbench-api";import{DropdownItemAlignment}from"../../models/dropdown/dropdown-item-alignment";import{RepositorySelection}from"./repository-selection";import{TranslationService}from"../../services/translation.service";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoRepositorySelector{constructor(){this.repositoryContextService=ServiceProvider.get(RepositoryContextService),this.subscriptions=[]}onItemsChanged(t){(null==t?void 0:t.length)?this.dropdownItems=this.attachTooltipsToItems(this.items):this.dropdownItems=[]}connectedCallback(){var t;this.subscriptions.push(...this.subscribeToTranslationChanged()),(null===(t=this.items)||void 0===t?void 0:t.length)?this.dropdownItems=this.attachTooltipsToItems(this.items):this.dropdownItems=[]}disconnectedCallback(){this.subscriptions.forEach(t=>t())}render(){const t=h(RepositorySelection,{key:"713344a720b1cbd39899946f688ccc00e0e67715",repository:this.currentRepository,defaultToggleButtonName:this.getButtonLabel(),location:this.getLocation()});return h(Host,{key:"91a8cfbe304712bf2393666a524c5f88134a667c"},h("onto-dropdown",Object.assign({key:"632f81fc84d682b8812c95ed579330e324f02866",class:"onto-repository-selector","data-test":"onto-repository-selector",onValueChanged:this.onValueChanged(),dropdownButtonName:t,dropdownButtonTooltip:this.createTooltipFunctionForRepository(this.currentRepository)},this.currentRepository?{dropdownButtonGuideSelector:`repository-id-${this.currentRepository.id}`}:{},{dropdownTooltipTrigger:"mouseenter focus",dropdownAlignment:DropdownItemAlignment.RIGHT,tooltipPlacement:this.tooltipAlignment,tooltipTheme:"light-border",items:this.dropdownItems})))}attachTooltipsToItems(t){return t?t.map(t=>t.setTooltip(this.createTooltipFunctionForRepository(t.value))):[]}tooltipAlignment(t){return t?OntoTooltipPlacement.LEFT:OntoTooltipPlacement.BOTTOM}onValueChanged(){return t=>this.onRepositoryChanged(t.detail)}createTooltipFunctionForRepository(t){return async()=>{if(!t)return"";const o=await this.repositorySizeInfoFetcher(t);return this.buildRepositoryTooltipHtml(t,o)}}buildRepositoryTooltipHtml(t,o){let e=`\n <div class="repository-tooltip-title">\n <span class="label">${TranslationService.translate("repository-selector.tooltip.repository")}</span>\n <span class="value">${t.id}</span>\n </div>\n <div class="repository-tooltip-content">\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.location")}:</div>\n <div class="value">${t.location?t.location:TranslationService.translate("repository-selector.tooltip.local")}</div>\n </div>\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.type")}:</div>\n <div class="value">${TranslationService.translate("repository-selector.tooltip.types."+(t.type||"unknown"))}</div>\n </div>\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.access")}:</div>\n <div class="value">${TranslationService.translate(this.canWriteRepo(t)?"repository-selector.tooltip.accesses.read_write":"repository-selector.tooltip.accesses.read")}</div>\n </div>`;return e+=this.buildRepositorySizeInfoHtml(o),e+="</div>",e}buildRepositorySizeInfoHtml(t){if(!t||t.total<0)return"";let o=`\n <div class="repository-tooltip-row total">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.total")}:</div>\n <div class="value">${this.totalTripletsFormatter.format(t.total)}</div>\n </div>`;if(t.explicit>=0&&(o+=`\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.explicit")}:</div>\n <div class="value">${this.totalTripletsFormatter.format(t.explicit)}</div>\n </div>`),t.inferred>=0&&(o+=`\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.inferred")}:</div>\n <div class="value">${this.totalTripletsFormatter.format(t.inferred)}</div>\n </div>`),t.total>=0){let e="-";t.explicit>0&&(e=this.totalTripletsFormatter.format(t.total/t.explicit)),o+=`\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.expansion_ratio")}:</div>\n <div class="value">${e}</div>\n </div>`}return o}subscribeToTranslationChanged(){return[TranslationService.onTranslate("repository-selector.btn.toggle",[],t=>{this.defaultToggleButtonName=t}),TranslationService.onTranslate("repository-selector.btn.no_repositories",[],t=>{this.noRepositoriesButtonMessage=t})]}onRepositoryChanged(t){this.repositoryContextService.updateSelectedRepository(t)}getLocation(){var t;return(null===(t=this.currentRepository)||void 0===t?void 0:t.location)?`@${UriUtil.shortenIri(this.currentRepository.location)}`:""}getButtonLabel(){var t;return(null===(t=this.items)||void 0===t?void 0:t.length)?this.defaultToggleButtonName:this.noRepositoriesButtonMessage}static get is(){return"onto-repository-selector"}static get originalStyleUrls(){return{$:["onto-repository-selector.scss"]}}static get styleUrls(){return{$:["onto-repository-selector.css"]}}static get properties(){return{currentRepository:{type:"unknown",attribute:"current-repository",mutable:!1,complexType:{original:"Repository",resolved:"Repository",references:{Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"}}},required:!1,optional:!1,docs:{tags:[],text:"The currently selected repository."},getter:!1,setter:!1},items:{type:"unknown",attribute:"items",mutable:!1,complexType:{original:"DropdownItem<Repository>[]",resolved:"DropdownItem<Repository>[]",references:{DropdownItem:{location:"import",path:"../../models/dropdown/dropdown-item",id:"src/models/dropdown/dropdown-item.ts::DropdownItem"},Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"}}},required:!1,optional:!1,docs:{tags:[],text:"The list of repositories to show in the dropdown."},getter:!1,setter:!1},repositorySizeInfoFetcher:{type:"unknown",attribute:"repository-size-info-fetcher",mutable:!1,complexType:{original:"(repo: Repository) => Promise<RepositorySizeInfo>",resolved:"(repo: Repository) => Promise<RepositorySizeInfo>",references:{Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"},Promise:{location:"global",id:"global::Promise"},RepositorySizeInfo:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::RepositorySizeInfo"}}},required:!1,optional:!1,docs:{tags:[],text:"Fetches repository size info used to build tooltips."},getter:!1,setter:!1},totalTripletsFormatter:{type:"unknown",attribute:"total-triplets-formatter",mutable:!1,complexType:{original:"Intl.NumberFormat",resolved:"NumberFormat",references:{Intl:{location:"global",id:"global::Intl"}}},required:!1,optional:!1,docs:{tags:[],text:"Formatter for numeric values in tooltips."},getter:!1,setter:!1},canWriteRepo:{type:"unknown",attribute:"can-write-repo",mutable:!1,complexType:{original:"(repo: Repository) => boolean",resolved:"(repo: Repository) => boolean",references:{Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"}}},required:!1,optional:!1,docs:{tags:[],text:"Determines whether the current user has write access to the repository."},getter:!1,setter:!1}}}static get states(){return{defaultToggleButtonName:{},noRepositoriesButtonMessage:{}}}static get watchers(){return[{propName:"items",methodName:"onItemsChanged"}]}}
1
+ import{Host,h}from"@stencil/core";import{ServiceProvider,RepositoryContextService,UriUtil}from"../../../../../api/dist/ontotext-workbench-api";import{DropdownItemAlignment}from"../../models/dropdown/dropdown-item-alignment";import{RepositorySelection}from"./repository-selection";import{TranslationService}from"../../services/translation.service";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoRepositorySelector{constructor(){this.repositoryContextService=ServiceProvider.get(RepositoryContextService),this.subscriptions=[]}onItemsChanged(t){(null==t?void 0:t.length)?this.dropdownItems=this.attachTooltipsToItems(this.items):this.dropdownItems=[]}connectedCallback(){var t;this.subscriptions.push(...this.subscribeToTranslationChanged()),(null===(t=this.items)||void 0===t?void 0:t.length)?this.dropdownItems=this.attachTooltipsToItems(this.items):this.dropdownItems=[]}disconnectedCallback(){this.subscriptions.forEach(t=>t())}render(){const t=h(RepositorySelection,{key:"6cfae687d07dbbf4525b134273719fbec29ec23c",repository:this.currentRepository,defaultToggleButtonName:this.getButtonLabel(),location:this.getLocation()});return h(Host,{key:"10c2e949fd0f2bf1cc0f3520d1f19361f2b8a1d1"},h("onto-dropdown",Object.assign({key:"ef9c8f245b7e00e31c78c2989d556c21b9333865",class:"onto-repository-selector","data-test":"onto-repository-selector",onValueChanged:this.onValueChanged(),dropdownButtonName:t,dropdownButtonTooltip:this.createTooltipFunctionForRepository(this.currentRepository)},this.currentRepository?{dropdownButtonGuideSelector:`repository-id-${this.currentRepository.id}`}:{},{dropdownTooltipTrigger:"mouseenter focus",dropdownAlignment:DropdownItemAlignment.RIGHT,tooltipPlacement:this.tooltipAlignment,tooltipTheme:"light-border",items:this.dropdownItems,"auto-close":!0})))}attachTooltipsToItems(t){return t?t.map(t=>t.setTooltip(this.createTooltipFunctionForRepository(t.value))):[]}tooltipAlignment(t){return t?OntoTooltipPlacement.LEFT:OntoTooltipPlacement.BOTTOM}onValueChanged(){return t=>this.onRepositoryChanged(t.detail)}createTooltipFunctionForRepository(t){return async()=>{if(!t)return"";const o=await this.repositorySizeInfoFetcher(t);return this.buildRepositoryTooltipHtml(t,o)}}buildRepositoryTooltipHtml(t,o){let e=`\n <div class="repository-tooltip-title">\n <span class="label">${TranslationService.translate("repository-selector.tooltip.repository")}</span>\n <span class="value">${t.id}</span>\n </div>\n <div class="repository-tooltip-content">\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.location")}:</div>\n <div class="value">${t.location?t.location:TranslationService.translate("repository-selector.tooltip.local")}</div>\n </div>\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.type")}:</div>\n <div class="value">${TranslationService.translate("repository-selector.tooltip.types."+(t.type||"unknown"))}</div>\n </div>\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.access")}:</div>\n <div class="value">${TranslationService.translate(this.canWriteRepo(t)?"repository-selector.tooltip.accesses.read_write":"repository-selector.tooltip.accesses.read")}</div>\n </div>`;return e+=this.buildRepositorySizeInfoHtml(o),e+="</div>",e}buildRepositorySizeInfoHtml(t){if(!t||t.total<0)return"";let o=`\n <div class="repository-tooltip-row total">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.total")}:</div>\n <div class="value">${this.totalTripletsFormatter.format(t.total)}</div>\n </div>`;if(t.explicit>=0&&(o+=`\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.explicit")}:</div>\n <div class="value">${this.totalTripletsFormatter.format(t.explicit)}</div>\n </div>`),t.inferred>=0&&(o+=`\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.inferred")}:</div>\n <div class="value">${this.totalTripletsFormatter.format(t.inferred)}</div>\n </div>`),t.total>=0){let e="-";t.explicit>0&&(e=this.totalTripletsFormatter.format(t.total/t.explicit)),o+=`\n <div class="repository-tooltip-row">\n <div class="label">${TranslationService.translate("repository-selector.tooltip.repository-size.expansion_ratio")}:</div>\n <div class="value">${e}</div>\n </div>`}return o}subscribeToTranslationChanged(){return[TranslationService.onTranslate("repository-selector.btn.toggle",[],t=>{this.defaultToggleButtonName=t}),TranslationService.onTranslate("repository-selector.btn.no_repositories",[],t=>{this.noRepositoriesButtonMessage=t})]}onRepositoryChanged(t){this.repositoryContextService.updateSelectedRepository(t)}getLocation(){var t;return(null===(t=this.currentRepository)||void 0===t?void 0:t.location)?`@${UriUtil.shortenIri(this.currentRepository.location)}`:""}getButtonLabel(){var t;return(null===(t=this.items)||void 0===t?void 0:t.length)?this.defaultToggleButtonName:this.noRepositoriesButtonMessage}static get is(){return"onto-repository-selector"}static get originalStyleUrls(){return{$:["onto-repository-selector.scss"]}}static get styleUrls(){return{$:["onto-repository-selector.css"]}}static get properties(){return{currentRepository:{type:"unknown",attribute:"current-repository",mutable:!1,complexType:{original:"Repository",resolved:"Repository",references:{Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"}}},required:!1,optional:!1,docs:{tags:[],text:"The currently selected repository."},getter:!1,setter:!1},items:{type:"unknown",attribute:"items",mutable:!1,complexType:{original:"DropdownItem<Repository>[]",resolved:"DropdownItem<Repository>[]",references:{DropdownItem:{location:"import",path:"../../models/dropdown/dropdown-item",id:"src/models/dropdown/dropdown-item.ts::DropdownItem"},Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"}}},required:!1,optional:!1,docs:{tags:[],text:"The list of repositories to show in the dropdown."},getter:!1,setter:!1},repositorySizeInfoFetcher:{type:"unknown",attribute:"repository-size-info-fetcher",mutable:!1,complexType:{original:"(repo: Repository) => Promise<RepositorySizeInfo>",resolved:"(repo: Repository) => Promise<RepositorySizeInfo>",references:{Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"},Promise:{location:"global",id:"global::Promise"},RepositorySizeInfo:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::RepositorySizeInfo"}}},required:!1,optional:!1,docs:{tags:[],text:"Fetches repository size info used to build tooltips."},getter:!1,setter:!1},totalTripletsFormatter:{type:"unknown",attribute:"total-triplets-formatter",mutable:!1,complexType:{original:"Intl.NumberFormat",resolved:"NumberFormat",references:{Intl:{location:"global",id:"global::Intl"}}},required:!1,optional:!1,docs:{tags:[],text:"Formatter for numeric values in tooltips."},getter:!1,setter:!1},canWriteRepo:{type:"unknown",attribute:"can-write-repo",mutable:!1,complexType:{original:"(repo: Repository) => boolean",resolved:"(repo: Repository) => boolean",references:{Repository:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::Repository"}}},required:!1,optional:!1,docs:{tags:[],text:"Determines whether the current user has write access to the repository."},getter:!1,setter:!1}}}static get states(){return{defaultToggleButtonName:{},noRepositoriesButtonMessage:{}}}static get watchers(){return[{propName:"items",methodName:"onItemsChanged"}]}}
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{SubscriptionList}from"../../../../../api/dist/ontotext-workbench-api";import{TranslationService}from"../../services/translation.service";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoSearchIcon{constructor(){this.tooltipKey="rdf_search.labels.search",this.subscriptions=new SubscriptionList}connectedCallback(){this.onTooltipChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return h("i",{key:"0f4007de16d840b3de144efb0dd046196a6de10b","tooltip-content":this.tooltipLabel,"tooltip-placement":OntoTooltipPlacement.BOTTOM,class:"onto-search-icon fa-light fa-magnifying-glass"})}onTooltipChange(){this.subscriptions.add(TranslationService.onTranslate(this.tooltipKey,[],t=>this.tooltipLabel=t))}static get is(){return"onto-search-icon"}static get originalStyleUrls(){return{$:["onto-search-icon.scss"]}}static get styleUrls(){return{$:["onto-search-icon.css"]}}static get states(){return{tooltipLabel:{}}}}
1
+ import{h}from"@stencil/core";import{SubscriptionList}from"../../../../../api/dist/ontotext-workbench-api";import{TranslationService}from"../../services/translation.service";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoSearchIcon{constructor(){this.tooltipKey="rdf_search.labels.search",this.subscriptions=new SubscriptionList}connectedCallback(){this.onTooltipChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return h("i",{key:"b87075f89ce2ee1f85d5ed1bd0d69c1f9f310b88","tooltip-content":this.tooltipLabel,"tooltip-placement":OntoTooltipPlacement.BOTTOM,class:"onto-search-icon fa-light fa-magnifying-glass"})}onTooltipChange(){this.subscriptions.add(TranslationService.onTranslate(this.tooltipKey,[],t=>this.tooltipLabel=t))}static get is(){return"onto-search-icon"}static get originalStyleUrls(){return{$:["onto-search-icon.scss"]}}static get styleUrls(){return{$:["onto-search-icon.css"]}}static get states(){return{tooltipLabel:{}}}}
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{AutocompleteContextService,AutocompleteService,AutocompleteStorageService,EventService,NamespacesContextService,navigateTo,OntoToastrService,ResourceSearchStorageService,ServiceProvider,SubscriptionList,Suggestion,SuggestionSelectedPayload,SuggestionType,UriUtil}from"../../../../../api/dist/ontotext-workbench-api";import{TranslationService}from"../../services/translation.service";import{HtmlUtil}from"../../utils/html-util";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";import{ResourceSearchConstants}from"../../models/resource-search/resource-search-constants";export class OntoSearchResourceInput{constructor(){this.autocompleteService=ServiceProvider.get(AutocompleteService),this.autocompleteContextService=ServiceProvider.get(AutocompleteContextService),this.autocompleteStorageService=ServiceProvider.get(AutocompleteStorageService),this.resourceSearchStorageService=ServiceProvider.get(ResourceSearchStorageService),this.toastrService=ServiceProvider.get(OntoToastrService),this.eventService=ServiceProvider.get(EventService),this.namespaceContextService=ServiceProvider.get(NamespacesContextService),this.subscriptions=new SubscriptionList,this.autocompleteWarningShown=!1,this.skipValidation=!1,this.isHidden=!1,this.isAutocompleteEnabled=!1,this.handleInput=e=>{const t=e.target;t.value?(this.setInputValue(t.value),this.checkForAutocomplete()):this.clearInput()},this.clearInput=()=>{this.setInputValue(""),this.preserveSearch&&this.resourceSearchStorageService.clearStoredSearch()},this.onKeyDown=e=>{switch(e.key){case"Enter":this.onEnter(e);break;case"Escape":this.onEscape();break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowDown":this.onArrowDown(e)}}}onVisibilityChange(e){var t;e?null===(t=this.searchResult)||void 0===t||t.clearSuggestions():this.setInputValue(this.resourceSearchStorageService.getInputValue())}connectedCallback(){this.onAutocompleteEnabledChange(),this.onNamespaceChange(),this.loadInputFromStorage()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){var e,t,s;return h("section",{key:"62cc53dd259de23a622c5403e245cd184bbed457",class:"search-resources-input"},h("div",{key:"1f01096b931e6b00d11a589469e2c0d6f0a482fa",class:"input-row"},h("span",{key:"69d07343236d427e97c152113c2298a877d51d92",class:"input-wrapper"},h("input",{key:"bb345a34a7db8965b8ba1753347d5fa8875f37eb",value:this.inputValue,id:this.context,type:"text",autocomplete:"off",placeholder:`${TranslationService.translate("rdf_search.labels.search")}...`,ref:e=>this.inputRef=e,onKeyDown:this.onKeyDown,"data-test":this.context,onInput:this.handleInput}),(null===(e=this.inputValue)||void 0===e?void 0:e.length)?h("i",{onClick:this.clearInput,"tooltip-content":TranslationService.translate("rdf_search.tooltips.clear"),"tooltip-placement":OntoTooltipPlacement.BOTTOM,class:"fa-light fa-xmark clear-input"}):""),null===(t=this.buttonConfig)||void 0===t?void 0:t.getButtons().getItems().map(e=>h("button",{key:e.label,onClick:this.handleButtonClick(e),class:e.selected?"selected":""},e.label))),h("span",{key:"aa0b7701e0c8eee0b7eee02253b7da9989ff0bf6",class:"hint"},TranslationService.translate("rdf_search.labels.hint")),h("section",{key:"16930ff94cd1e182c73bf93127472806f00cccb2",class:"autocomplete-results-wrapper","data-test":"onto-autocomplete-results"},null===(s=this.searchResult)||void 0===s?void 0:s.getSuggestions().getItems().map(e=>h("p",{key:e.getId(),onClick:this.onSuggestionClick(e),"data-test":"onto-autocomplete-suggestion",onMouseMove:this.hoverSuggestion(e),class:`${e.isHovered()?"hovered":""} ${e.isSelected()?"selected":""}`,innerHTML:e.getDescription()}))))}handleButtonClick(e){return()=>this.buttonConfig=this.buttonConfig.selectButton(e)}loadAutocompleteResults(){var e;this.inputValue?this.isAutocompleteEnabled&&this.autocompleteService.search(this.inputValue).then(e=>{this.onResultsReceived(e)}):null===(e=this.searchResult)||void 0===e||e.clearSuggestions()}hoverSuggestion(e){return()=>this.searchResult=this.searchResult.hoverSuggestion(e)}onAutocompleteEnabledChange(){this.isAutocompleteEnabled=this.autocompleteStorageService.isEnabled(),this.subscriptions.add(this.autocompleteContextService.onAutocompleteEnabledChanged(e=>{this.isAutocompleteEnabled=null!=e?e:this.isAutocompleteEnabled}))}checkForAutocomplete(){if(this.inputValue.length>0&&!this.isAutocompleteEnabled&&!this.autocompleteWarningShown){this.autocompleteWarningShown=!0;const e=TranslationService.translate("rdf_search.toasts.autocomplete_is_off");this.toastrService.warning(`<a class="no-underline" style="font-weight: 500">${e}</a>`,{onClick:navigateTo("autocomplete"),removeOnClick:!0})}}onSuggestionClick(e){return t=>{e.setOverrideToVisual(t.ctrlKey||t.metaKey),this.searchRdfResource(e)}}searchRdfResource(e){e.getType()===SuggestionType.PREFIX?this.expandPrefix(e):(this.notifyRdfResourceSelected(e),this.preserveSearch&&this.resourceSearchStorageService.setLastSelected(e))}notifyRdfResourceSelected(e){var t;this.searchResult=null===(t=this.searchResult)||void 0===t?void 0:t.selectSuggestion(e),this.eventService.emit({NAME:ResourceSearchConstants.SUGGESTION_SELECTED_EVENT,payload:new SuggestionSelectedPayload(e,this.context)})}expandPrefix(e){this.setInputValue(this.namespaces.getByPrefix(e.getValue())),this.inputRef.focus()}setInputValue(e){this.inputValue=e,this.preserveSearch&&this.resourceSearchStorageService.setInputValue(this.inputValue),this.loadAutocompleteResults()}onNamespaceChange(){this.subscriptions.add(this.namespaceContextService.onNamespacesChanged(e=>{this.namespaces=e}))}onEnter(e){var t;let s=null===(t=this.searchResult)||void 0===t?void 0:t.getHoveredSuggestion();s||(s=new Suggestion({value:UriUtil.removeAngleBrackets(this.inputValue),type:SuggestionType.URI})),s.setOverrideToVisual(e.ctrlKey||e.metaKey),this.validateAndSearch(s)}onArrowUp(e){this.searchResult=this.searchResult.hoverPreviousSuggestion(),this.displaySuggestion(e)}onArrowDown(e){this.searchResult=this.searchResult.hoverNextSuggestion(),this.displaySuggestion(e)}displaySuggestion(e){e.preventDefault(),this.inputRef.value=this.searchResult.getHoveredSuggestion().getValue(),this.scrollToSuggestionBySelector("p.hovered")}getSuggestionValue(e){return e.getType()===SuggestionType.PREFIX?this.namespaces.getByPrefix(e.getValue()):e.getValue()}scrollToSuggestionBySelector(e,t){HtmlUtil.waitForElement(e).then(()=>{HtmlUtil.scrollElementIntoView(e,t)})}validateAndSearch(e){if(!this.skipValidation){if(!e.getValue())return void this.toastrService.error(TranslationService.translate("rdf_search.toasts.empty_input"));if(!UriUtil.isValidUri(this.getSuggestionValue(e)))return void this.toastrService.error(TranslationService.translate("rdf_search.toasts.invalid_uri"))}this.searchRdfResource(e)}onEscape(){this.preserveSearch||this.clearInput()}loadInputFromStorage(){this.preserveSearch&&(this.inputValue=this.resourceSearchStorageService.getInputValue()||"")}onResultsReceived(e){const t=null==e?void 0:e.getByValue(this.resourceSearchStorageService.getLastSelectedValue());t&&this.preserveSearch?(e.hoverSuggestion(t),this.searchResult=e.selectSuggestion(t),this.scrollToSuggestionBySelector("p.hovered.selected",{block:"start"})):(this.searchResult=e.hoverFirstSuggestion(),this.scrollToSuggestionBySelector("p.hovered",{block:"start"}))}static get is(){return"onto-search-resource-input"}static get originalStyleUrls(){return{$:["onto-search-resource-input.scss"]}}static get styleUrls(){return{$:["onto-search-resource-input.css"]}}static get properties(){return{context:{type:"string",attribute:"context",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The search resource component can appear more than once per page. This context\nis used to differentiate them. When a suggestion is selected different parents\nmay need to do different things. The context is emitted alongside the suggestion\nupon select."},getter:!1,setter:!1,reflect:!1},skipValidation:{type:"boolean",attribute:"skip-validation",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether the rdf resource pre-search validation should be skipped."},getter:!1,setter:!1,reflect:!1,defaultValue:"false"},preserveSearch:{type:"boolean",attribute:"preserve-search",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether to preserve the input value and last selected suggestion\nIf true, both will be stored in local storage and loaded, when the component is rendered"},getter:!1,setter:!1,reflect:!1},isHidden:{type:"boolean",attribute:"is-hidden",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether the search component is currently hidden. Can be shown/hidden in the RDF search"},getter:!1,setter:!1,reflect:!1,defaultValue:"false"},buttonConfig:{type:"unknown",attribute:"button-config",mutable:!1,complexType:{original:"SearchButtonConfig",resolved:"SearchButtonConfig",references:{SearchButtonConfig:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::SearchButtonConfig"}}},required:!1,optional:!1,docs:{tags:[],text:"Button configuration for the search resource input.\nHolds buttons to be displayed, as well as additional configuration,\nsuch as whether the buttons should be treated as radio buttons."},getter:!1,setter:!1}}}static get states(){return{inputValue:{},searchResult:{},isAutocompleteEnabled:{}}}static get watchers(){return[{propName:"isHidden",methodName:"onVisibilityChange"}]}}
1
+ import{h}from"@stencil/core";import{AutocompleteContextService,AutocompleteService,AutocompleteStorageService,EventService,NamespacesContextService,navigateTo,OntoToastrService,ResourceSearchStorageService,ServiceProvider,SubscriptionList,Suggestion,SuggestionSelectedPayload,SuggestionType,UriUtil}from"../../../../../api/dist/ontotext-workbench-api";import{TranslationService}from"../../services/translation.service";import{HtmlUtil}from"../../utils/html-util";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";import{ResourceSearchConstants}from"../../models/resource-search/resource-search-constants";export class OntoSearchResourceInput{constructor(){this.autocompleteService=ServiceProvider.get(AutocompleteService),this.autocompleteContextService=ServiceProvider.get(AutocompleteContextService),this.autocompleteStorageService=ServiceProvider.get(AutocompleteStorageService),this.resourceSearchStorageService=ServiceProvider.get(ResourceSearchStorageService),this.toastrService=ServiceProvider.get(OntoToastrService),this.eventService=ServiceProvider.get(EventService),this.namespaceContextService=ServiceProvider.get(NamespacesContextService),this.subscriptions=new SubscriptionList,this.autocompleteWarningShown=!1,this.skipValidation=!1,this.isHidden=!1,this.isAutocompleteEnabled=!1,this.handleInput=e=>{const t=e.target;t.value?(this.setInputValue(t.value),this.checkForAutocomplete()):this.clearInput()},this.clearInput=()=>{this.setInputValue(""),this.preserveSearch&&this.resourceSearchStorageService.clearStoredSearch()},this.onKeyDown=e=>{switch(e.key){case"Enter":this.onEnter(e);break;case"Escape":this.onEscape();break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowDown":this.onArrowDown(e)}}}onVisibilityChange(e){var t;e?null===(t=this.searchResult)||void 0===t||t.clearSuggestions():this.setInputValue(this.resourceSearchStorageService.getInputValue())}connectedCallback(){this.onAutocompleteEnabledChange(),this.onNamespaceChange(),this.loadInputFromStorage()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){var e,t,s;return h("section",{key:"62cc53dd259de23a622c5403e245cd184bbed457",class:"search-resources-input"},h("div",{key:"1f01096b931e6b00d11a589469e2c0d6f0a482fa",class:"input-row"},h("span",{key:"69d07343236d427e97c152113c2298a877d51d92",class:"input-wrapper"},h("input",{key:"0ec0f300079485b4f914bd119bd8e7589ae82434",value:this.inputValue,id:this.context,type:"text",autocomplete:"off",placeholder:`${TranslationService.translate("rdf_search.labels.search")}...`,ref:e=>this.inputRef=e,onKeyDown:this.onKeyDown,"data-test":this.context,onInput:this.handleInput}),(null===(e=this.inputValue)||void 0===e?void 0:e.length)?h("i",{onClick:this.clearInput,"tooltip-content":TranslationService.translate("rdf_search.tooltips.clear"),"tooltip-placement":OntoTooltipPlacement.BOTTOM,class:"fa-light fa-xmark clear-input"}):""),null===(t=this.buttonConfig)||void 0===t?void 0:t.getButtons().getItems().map(e=>h("button",{key:e.label,onClick:this.handleButtonClick(e),class:e.selected?"selected":""},e.label))),h("span",{key:"1a7d99dea661767b08c2303f657f7747ba682bb6",class:"hint"},TranslationService.translate("rdf_search.labels.hint")),h("section",{key:"aeeca649489ee2e1436a365f80e34daf577c7f30",class:"autocomplete-results-wrapper","data-test":"onto-autocomplete-results"},null===(s=this.searchResult)||void 0===s?void 0:s.getSuggestions().getItems().map(e=>h("p",{key:e.getId(),onClick:this.onSuggestionClick(e),"data-test":"onto-autocomplete-suggestion",onMouseMove:this.hoverSuggestion(e),class:`${e.isHovered()?"hovered":""} ${e.isSelected()?"selected":""}`,innerHTML:e.getDescription()}))))}handleButtonClick(e){return()=>this.buttonConfig=this.buttonConfig.selectButton(e)}loadAutocompleteResults(){var e;this.inputValue?this.isAutocompleteEnabled&&this.autocompleteService.search(this.inputValue).then(e=>{this.onResultsReceived(e)}):null===(e=this.searchResult)||void 0===e||e.clearSuggestions()}hoverSuggestion(e){return()=>this.searchResult=this.searchResult.hoverSuggestion(e)}onAutocompleteEnabledChange(){this.isAutocompleteEnabled=this.autocompleteStorageService.isEnabled(),this.subscriptions.add(this.autocompleteContextService.onAutocompleteEnabledChanged(e=>{this.isAutocompleteEnabled=null!=e?e:this.isAutocompleteEnabled}))}checkForAutocomplete(){if(this.inputValue.length>0&&!this.isAutocompleteEnabled&&!this.autocompleteWarningShown){this.autocompleteWarningShown=!0;const e=TranslationService.translate("rdf_search.toasts.autocomplete_is_off");this.toastrService.warning(`<a class="no-underline" style="font-weight: 500">${e}</a>`,{onClick:navigateTo("autocomplete"),removeOnClick:!0})}}onSuggestionClick(e){return t=>{e.setOverrideToVisual(t.ctrlKey||t.metaKey),this.searchRdfResource(e)}}searchRdfResource(e){e.getType()===SuggestionType.PREFIX?this.expandPrefix(e):(this.notifyRdfResourceSelected(e),this.preserveSearch&&this.resourceSearchStorageService.setLastSelected(e))}notifyRdfResourceSelected(e){var t;this.searchResult=null===(t=this.searchResult)||void 0===t?void 0:t.selectSuggestion(e),this.eventService.emit({NAME:ResourceSearchConstants.SUGGESTION_SELECTED_EVENT,payload:new SuggestionSelectedPayload(e,this.context)})}expandPrefix(e){this.setInputValue(this.namespaces.getByPrefix(e.getValue())),this.inputRef.focus()}setInputValue(e){this.inputValue=e,this.preserveSearch&&this.resourceSearchStorageService.setInputValue(this.inputValue),this.loadAutocompleteResults()}onNamespaceChange(){this.subscriptions.add(this.namespaceContextService.onNamespacesChanged(e=>{this.namespaces=e}))}onEnter(e){var t;let s=null===(t=this.searchResult)||void 0===t?void 0:t.getHoveredSuggestion();s||(s=new Suggestion({value:UriUtil.removeAngleBrackets(this.inputValue),type:SuggestionType.URI})),s.setOverrideToVisual(e.ctrlKey||e.metaKey),this.validateAndSearch(s)}onArrowUp(e){this.searchResult=this.searchResult.hoverPreviousSuggestion(),this.displaySuggestion(e)}onArrowDown(e){this.searchResult=this.searchResult.hoverNextSuggestion(),this.displaySuggestion(e)}displaySuggestion(e){e.preventDefault(),this.inputRef.value=this.searchResult.getHoveredSuggestion().getValue(),this.scrollToSuggestionBySelector("p.hovered")}getSuggestionValue(e){return e.getType()===SuggestionType.PREFIX?this.namespaces.getByPrefix(e.getValue()):e.getValue()}scrollToSuggestionBySelector(e,t){HtmlUtil.waitForElement(e).then(()=>{HtmlUtil.scrollElementIntoView(e,t)})}validateAndSearch(e){if(!this.skipValidation){if(!e.getValue())return void this.toastrService.error(TranslationService.translate("rdf_search.toasts.empty_input"));if(!UriUtil.isValidUri(this.getSuggestionValue(e)))return void this.toastrService.error(TranslationService.translate("rdf_search.toasts.invalid_uri"))}this.searchRdfResource(e)}onEscape(){this.preserveSearch||this.clearInput()}loadInputFromStorage(){this.preserveSearch&&(this.inputValue=this.resourceSearchStorageService.getInputValue()||"")}onResultsReceived(e){const t=null==e?void 0:e.getByValue(this.resourceSearchStorageService.getLastSelectedValue());t&&this.preserveSearch?(e.hoverSuggestion(t),this.searchResult=e.selectSuggestion(t),this.scrollToSuggestionBySelector("p.hovered.selected",{block:"start"})):(this.searchResult=e.hoverFirstSuggestion(),this.scrollToSuggestionBySelector("p.hovered",{block:"start"}))}static get is(){return"onto-search-resource-input"}static get originalStyleUrls(){return{$:["onto-search-resource-input.scss"]}}static get styleUrls(){return{$:["onto-search-resource-input.css"]}}static get properties(){return{context:{type:"string",attribute:"context",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The search resource component can appear more than once per page. This context\nis used to differentiate them. When a suggestion is selected different parents\nmay need to do different things. The context is emitted alongside the suggestion\nupon select."},getter:!1,setter:!1,reflect:!1},skipValidation:{type:"boolean",attribute:"skip-validation",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether the rdf resource pre-search validation should be skipped."},getter:!1,setter:!1,reflect:!1,defaultValue:"false"},preserveSearch:{type:"boolean",attribute:"preserve-search",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether to preserve the input value and last selected suggestion\nIf true, both will be stored in local storage and loaded, when the component is rendered"},getter:!1,setter:!1,reflect:!1},isHidden:{type:"boolean",attribute:"is-hidden",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether the search component is currently hidden. Can be shown/hidden in the RDF search"},getter:!1,setter:!1,reflect:!1,defaultValue:"false"},buttonConfig:{type:"unknown",attribute:"button-config",mutable:!1,complexType:{original:"SearchButtonConfig",resolved:"SearchButtonConfig",references:{SearchButtonConfig:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::SearchButtonConfig"}}},required:!1,optional:!1,docs:{tags:[],text:"Button configuration for the search resource input.\nHolds buttons to be displayed, as well as additional configuration,\nsuch as whether the buttons should be treated as radio buttons."},getter:!1,setter:!1}}}static get states(){return{inputValue:{},searchResult:{},isAutocompleteEnabled:{}}}static get watchers(){return[{propName:"isHidden",methodName:"onVisibilityChange"}]}}
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{ToastType,ToastMessageList,ToastrConfig,WindowService}from"../../../../../api/dist/ontotext-workbench-api";import{sanitizeHTML}from"../../utils/html-utils";const toastTypeToIconMap={[ToastType.INFO]:"fa-circle-info",[ToastType.SUCCESS]:"fa-circle-check",[ToastType.WARNING]:"fa-message-lines",[ToastType.ERROR]:"fa-triangle-exclamation"};export class OntoToastr{constructor(){this.toasts=new ToastMessageList([]),this.toastToTimeout=new Map,this.config=ToastrConfig.getDefaultConfig(),this.onToastMouseEnter=t=>()=>{this.clearToastTimeout(t)},this.onToastMouseLeave=t=>()=>{this.setTimeoutForToast(t)}}handleToastCreate(t){this.addToast(t.detail)}render(){var t;return h("section",{key:"a65e3c5c600cf24dce3c7b591be08641a98fefa4",style:{display:this.toasts.isEmpty()?"none":"flex"},class:`onto-toastr-container ${this.config.position}`},null===(t=this.toasts)||void 0===t?void 0:t.getItems().map(t=>h("div",{class:`onto-toast ${t.type}`,key:t.id,onMouseEnter:this.onToastMouseEnter(t),onMouseLeave:this.onToastMouseLeave(t)},h("i",{class:`fa-regular ${toastTypeToIconMap[t.type]}`}),h("span",{onClick:this.handleToastClick(t),class:"toast-message",innerHTML:sanitizeHTML(t.message)}))))}addToast(t){this.toasts.addToStart(t),this.setTimeoutForToast(t),this.updateToastrReference()}setTimeoutForToast(t){var s;const e=WindowService.getWindow().setTimeout(()=>{this.toasts.remove(t),this.clearToastTimeout(t)},(null===(s=t.config)||void 0===s?void 0:s.timeout)||this.config.timeout);this.toastToTimeout.set(t,e)}updateToastrReference(){this.toasts=new ToastMessageList(this.toasts.getItems())}clearToastTimeout(t){const s=this.toastToTimeout.get(t);clearTimeout(s),this.toastToTimeout.delete(t),this.updateToastrReference()}handleToastClick(t){return s=>{var e,o;(null===(e=t.config)||void 0===e?void 0:e.onClick)&&t.config.onClick(s),(null===(o=t.config)||void 0===o?void 0:o.removeOnClick)&&(this.toasts.remove(t),this.clearToastTimeout(t))}}static get is(){return"onto-toastr"}static get originalStyleUrls(){return{$:["onto-toastr.scss"]}}static get styleUrls(){return{$:["onto-toastr.css"]}}static get states(){return{toasts:{}}}static get listeners(){return[{name:"create-toast-event",method:"handleToastCreate",target:"body",capture:!1,passive:!1}]}}
1
+ import{h}from"@stencil/core";import{ToastType,ToastMessageList,ToastrConfig,WindowService}from"../../../../../api/dist/ontotext-workbench-api";import{sanitizeHTML}from"../../utils/html-utils";const toastTypeToIconMap={[ToastType.INFO]:"fa-circle-info",[ToastType.SUCCESS]:"fa-circle-check",[ToastType.WARNING]:"fa-message-lines",[ToastType.ERROR]:"fa-triangle-exclamation"};export class OntoToastr{constructor(){this.toasts=new ToastMessageList([]),this.toastToTimeout=new Map,this.config=ToastrConfig.getDefaultConfig(),this.onToastMouseEnter=t=>()=>{this.clearToastTimeout(t)},this.onToastMouseLeave=t=>()=>{this.setTimeoutForToast(t)}}handleToastCreate(t){this.addToast(t.detail)}render(){var t;return h("section",{key:"7a0b219aed04de688d5f743a7dc326be9daf3518",style:{display:this.toasts.isEmpty()?"none":"flex"},class:`onto-toastr-container ${this.config.position}`},null===(t=this.toasts)||void 0===t?void 0:t.getItems().map(t=>h("div",{class:`onto-toast ${t.type}`,key:t.id,onMouseEnter:this.onToastMouseEnter(t),onMouseLeave:this.onToastMouseLeave(t)},h("i",{class:`fa-regular ${toastTypeToIconMap[t.type]}`}),h("span",{onClick:this.handleToastClick(t),class:"toast-message",innerHTML:sanitizeHTML(t.message)}))))}addToast(t){this.toasts.addToStart(t),this.setTimeoutForToast(t),this.updateToastrReference()}setTimeoutForToast(t){var s;const e=WindowService.getWindow().setTimeout(()=>{this.toasts.remove(t),this.clearToastTimeout(t)},(null===(s=t.config)||void 0===s?void 0:s.timeout)||this.config.timeout);this.toastToTimeout.set(t,e)}updateToastrReference(){this.toasts=new ToastMessageList(this.toasts.getItems())}clearToastTimeout(t){const s=this.toastToTimeout.get(t);clearTimeout(s),this.toastToTimeout.delete(t),this.updateToastrReference()}handleToastClick(t){return s=>{var e,o;(null===(e=t.config)||void 0===e?void 0:e.onClick)&&t.config.onClick(s),(null===(o=t.config)||void 0===o?void 0:o.removeOnClick)&&(this.toasts.remove(t),this.clearToastTimeout(t))}}static get is(){return"onto-toastr"}static get originalStyleUrls(){return{$:["onto-toastr.scss"]}}static get styleUrls(){return{$:["onto-toastr.css"]}}static get states(){return{toasts:{}}}static get listeners(){return[{name:"create-toast-event",method:"handleToastCreate",target:"body",capture:!1,passive:!1}]}}
@@ -1 +1 @@
1
- import{h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";import{SubscriptionList}from"../../../../api/src/models/common";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoToggleSwitch{constructor(){this.subscriptions=new SubscriptionList,this.checked=!1,this.toggle=()=>{this.checked=!this.checked,this.toggleChanged.emit({checked:this.checked,context:this.context})}}subscribeToLanguageChange(){this.tooltipTranslationKey&&this.subscriptions.add(TranslationService.onTranslate(this.tooltipTranslationKey,[],e=>{this.tooltipLabel=e}))}disconnectedCallback(){this.subscriptions.unsubscribeAll()}connectedCallback(){this.subscribeToLanguageChange()}render(){return h("section",{key:"61f57d75ab3c41db9ce033d883c3efd9e50ae789"},this.labelKey&&h("label",{key:"5e62380c1ea0a4b20d9294d76d3ab8d05a95cd60"},h("strong",{key:"93072a39d05f6af3e445f001f93ce5071dd20d44"},h("translate-label",{key:"4a40640f84224fbeb55e80a2a1779fe0d212fb10",labelKey:this.labelKey})," ")),h("button",{key:"d9cea7b80df3b02a719899c7a067bbdbe86e08f4",class:"toggle-switch",onClick:this.toggle,"tooltip-append-to":"parent","tooltip-content":this.tooltipLabel,"tooltip-placement":OntoTooltipPlacement.TOP},h("input",{key:"3f665f7b2b420292a2df994137277e71c908b0ed",type:"checkbox",checked:this.checked}),h("label",{key:"c15661c93f86abb868e536a3dae9a0fc89719d91"})))}static get is(){return"onto-toggle-switch"}static get originalStyleUrls(){return{$:["onto-toggle-switch.scss"]}}static get styleUrls(){return{$:["onto-toggle-switch.css"]}}static get properties(){return{checked:{type:"boolean",attribute:"checked",mutable:!0,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Determines whether the toggle switch is checked or not."},getter:!1,setter:!1,reflect:!1,defaultValue:"false"},labelKey:{type:"string",attribute:"label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!0,docs:{tags:[],text:"The key used for translating the label text, if supplied."},getter:!1,setter:!1,reflect:!1},tooltipTranslationKey:{type:"string",attribute:"tooltip-translation-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!0,docs:{tags:[],text:"The translation label key for the tooltip message, if supplied."},getter:!1,setter:!1,reflect:!1},context:{type:"string",attribute:"context",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!0,docs:{tags:[],text:"The context for the tooltip, if supplied. This is useful if you have multiple toggle switches, to know which one\nis being toggled."},getter:!1,setter:!1,reflect:!1}}}static get states(){return{tooltipLabel:{}}}static get events(){return[{method:"toggleChanged",name:"toggleChanged",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Event emitted when the toggle switch is clicked, carrying the new checked status."},complexType:{original:"ToggleEventPayload",resolved:"ToggleEventPayload",references:{ToggleEventPayload:{location:"import",path:"../../models/toggle-switch/toggle-event-payload",id:"src/models/toggle-switch/toggle-event-payload.ts::ToggleEventPayload"}}}}]}}
1
+ import{h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";import{SubscriptionList}from"../../../../api/src/models/common";import{OntoTooltipPlacement}from"../onto-tooltip/models/onto-tooltip-placement";export class OntoToggleSwitch{constructor(){this.subscriptions=new SubscriptionList,this.checked=!1,this.toggle=()=>{this.checked=!this.checked,this.toggleChanged.emit({checked:this.checked,context:this.context})}}subscribeToLanguageChange(){this.tooltipTranslationKey&&this.subscriptions.add(TranslationService.onTranslate(this.tooltipTranslationKey,[],e=>{this.tooltipLabel=e}))}disconnectedCallback(){this.subscriptions.unsubscribeAll()}connectedCallback(){this.subscribeToLanguageChange()}render(){return h("section",{key:"61f57d75ab3c41db9ce033d883c3efd9e50ae789"},this.labelKey&&h("label",{key:"5e62380c1ea0a4b20d9294d76d3ab8d05a95cd60"},h("strong",{key:"93072a39d05f6af3e445f001f93ce5071dd20d44"},h("translate-label",{key:"4a40640f84224fbeb55e80a2a1779fe0d212fb10",labelKey:this.labelKey})," ")),h("button",{key:"c4d70e37ea61c8e5977f432a898e63c091f431be",class:"toggle-switch",onClick:this.toggle,"tooltip-append-to":"parent","tooltip-content":this.tooltipLabel,"tooltip-placement":OntoTooltipPlacement.TOP},h("input",{key:"b5a46c098d733281fa9e0a5e4e068e708860c1ca",type:"checkbox",checked:this.checked}),h("label",{key:"588d5db134666764d02ec1b7e7ea7a336a709e44"})))}static get is(){return"onto-toggle-switch"}static get originalStyleUrls(){return{$:["onto-toggle-switch.scss"]}}static get styleUrls(){return{$:["onto-toggle-switch.css"]}}static get properties(){return{checked:{type:"boolean",attribute:"checked",mutable:!0,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Determines whether the toggle switch is checked or not."},getter:!1,setter:!1,reflect:!1,defaultValue:"false"},labelKey:{type:"string",attribute:"label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!0,docs:{tags:[],text:"The key used for translating the label text, if supplied."},getter:!1,setter:!1,reflect:!1},tooltipTranslationKey:{type:"string",attribute:"tooltip-translation-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!0,docs:{tags:[],text:"The translation label key for the tooltip message, if supplied."},getter:!1,setter:!1,reflect:!1},context:{type:"string",attribute:"context",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!0,docs:{tags:[],text:"The context for the tooltip, if supplied. This is useful if you have multiple toggle switches, to know which one\nis being toggled."},getter:!1,setter:!1,reflect:!1}}}static get states(){return{tooltipLabel:{}}}static get events(){return[{method:"toggleChanged",name:"toggleChanged",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Event emitted when the toggle switch is clicked, carrying the new checked status."},complexType:{original:"ToggleEventPayload",resolved:"ToggleEventPayload",references:{ToggleEventPayload:{location:"import",path:"../../models/toggle-switch/toggle-event-payload",id:"src/models/toggle-switch/toggle-event-payload.ts::ToggleEventPayload"}}}}]}}
@@ -1 +1 @@
1
- import{h,Host}from"@stencil/core";import{TooltipUtil}from"../../utils/tooltip-util";export class OntoTooltip{constructor(){this.clearTooltipsForRemovedElements=o=>{for(const t of o)for(const o of Array.from(t.removedNodes))if(this.removeTooltipFromNode(o))return},this.removeTooltipFromNode=o=>{if(o instanceof HTMLElement){if(TooltipUtil.getTooltipInstance(o))return TooltipUtil.destroyTooltip(o),!0;o.childNodes.forEach(this.removeTooltipFromNode)}return!1}}onMouseover(o){const t=TooltipUtil.getTooltipTarget(o.target);if(!t)return;const e=TooltipUtil.getOrCreateTooltipInstance(t);e.show(),t.hideTooltip=()=>{e.hide()}}onMouseout(o){const t=TooltipUtil.getTooltipTarget(o.target);if(!t)return;const e=o.relatedTarget;if(!e||!t.contains(e)){const o=TooltipUtil.getTooltipInstance(t);o&&"manual"===o.props.trigger&&TooltipUtil.destroyTooltip(t)}}connectedCallback(){this.handleRemovedNodes()}disconnectedCallback(){var o;null===(o=this.observer)||void 0===o||o.disconnect()}render(){return h(Host,{key:"4f7858dee4268ac1ea1496e16b7c6a3f31e3fb0c"})}handleRemovedNodes(){this.observer=new MutationObserver(this.clearTooltipsForRemovedElements),this.observer.observe(document.body,{childList:!0,subtree:!0})}static get is(){return"onto-tooltip"}static get originalStyleUrls(){return{$:["onto-tooltip.scss"]}}static get styleUrls(){return{$:["onto-tooltip.css"]}}static get listeners(){return[{name:"mouseover",method:"onMouseover",target:"document",capture:!1,passive:!0},{name:"mouseout",method:"onMouseout",target:"document",capture:!1,passive:!0}]}}
1
+ import{h,Host}from"@stencil/core";import{TooltipUtil}from"../../utils/tooltip-util";export class OntoTooltip{constructor(){this.clearTooltipsForRemovedElements=o=>{for(const t of o)for(const o of Array.from(t.removedNodes))if(this.removeTooltipFromNode(o))return},this.removeTooltipFromNode=o=>{if(o instanceof HTMLElement){if(TooltipUtil.getTooltipInstance(o))return TooltipUtil.destroyTooltip(o),!0;o.childNodes.forEach(this.removeTooltipFromNode)}return!1}}onMouseover(o){const t=TooltipUtil.getTooltipTarget(o.target);if(!t)return;const e=TooltipUtil.getOrCreateTooltipInstance(t);e.show(),t.hideTooltip=()=>{e.hide()}}onMouseout(o){const t=TooltipUtil.getTooltipTarget(o.target);if(!t)return;const e=o.relatedTarget;if(!e||!t.contains(e)){const o=TooltipUtil.getTooltipInstance(t);o&&"manual"===o.props.trigger&&TooltipUtil.destroyTooltip(t)}}connectedCallback(){this.handleRemovedNodes()}disconnectedCallback(){var o;null===(o=this.observer)||void 0===o||o.disconnect()}render(){return h(Host,{key:"8f26e2fba0d096f6e13ebe85f7c6a3f1f14b8950"})}handleRemovedNodes(){this.observer=new MutationObserver(this.clearTooltipsForRemovedElements),this.observer.observe(document.body,{childList:!0,subtree:!0})}static get is(){return"onto-tooltip"}static get originalStyleUrls(){return{$:["onto-tooltip.scss"]}}static get styleUrls(){return{$:["onto-tooltip.css"]}}static get listeners(){return[{name:"mouseover",method:"onMouseover",target:"document",capture:!1,passive:!0},{name:"mouseout",method:"onMouseout",target:"document",capture:!1,passive:!0}]}}
@@ -1 +1 @@
1
- import{Host,h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";export class TranslateLabel{constructor(){this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=TranslationService.onTranslate(this.labelKey,this.translationParameters,e=>this.translatedLabel=e)}disconnectedCallback(){this.unsubscribeTranslationChanged&&this.unsubscribeTranslationChanged()}render(){return h(Host,{key:"379e2bf98a702473ef9753bde148d608f2b27509"},this.translatedLabel)}static get is(){return"translate-label"}static get originalStyleUrls(){return{$:["translate-label.scss"]}}static get styleUrls(){return{$:["translate-label.css"]}}static get properties(){return{labelKey:{type:"string",attribute:"label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Represents a label key."},getter:!1,setter:!1,reflect:!1},translationParameters:{type:"unknown",attribute:"translation-parameters",mutable:!1,complexType:{original:"TranslationParameter[]",resolved:"TranslationParameter[]",references:{TranslationParameter:{location:"import",path:"../../models/translation/translation-parameter",id:"src/models/translation/translation-parameter.ts::TranslationParameter"}}},required:!1,optional:!1,docs:{tags:[],text:"Represents an array of translation parameters."},getter:!1,setter:!1,defaultValue:"[]"}}}static get states(){return{translatedLabel:{}}}}
1
+ import{Host,h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";export class TranslateLabel{constructor(){this.unsubscribeTranslationChanged=null,this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=TranslationService.onTranslate(this.labelKey,this.translationParameters,t=>this.translatedLabel=t)}disconnectedCallback(){this.unsubscribeTranslationChanged&&(this.unsubscribeTranslationChanged(),this.unsubscribeTranslationChanged=null)}render(){return h(Host,{key:"ae48f9b9f9d91494190d3666aa96f77c98da20f1"},this.translatedLabel)}static get is(){return"translate-label"}static get originalStyleUrls(){return{$:["translate-label.scss"]}}static get styleUrls(){return{$:["translate-label.css"]}}static get properties(){return{labelKey:{type:"string",attribute:"label-key",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Represents a label key."},getter:!1,setter:!1,reflect:!1},translationParameters:{type:"unknown",attribute:"translation-parameters",mutable:!1,complexType:{original:"TranslationParameter[]",resolved:"TranslationParameter[]",references:{TranslationParameter:{location:"import",path:"../../models/translation/translation-parameter",id:"src/models/translation/translation-parameter.ts::TranslationParameter"}}},required:!1,optional:!1,docs:{tags:[],text:"Represents an array of translation parameters."},getter:!1,setter:!1,defaultValue:"[]"}}}static get states(){return{translatedLabel:{}}}}