@api-client/ui 0.2.2 → 0.2.4

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 (371) hide show
  1. package/.vscode/settings.json +3 -3
  2. package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts +1 -1
  3. package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts.map +1 -1
  4. package/build/src/elements/authorization/ui/ApiKeyAuthorization.js +7 -7
  5. package/build/src/elements/authorization/ui/ApiKeyAuthorization.js.map +1 -1
  6. package/build/src/elements/authorization/ui/Authorization.styles.js +4 -4
  7. package/build/src/elements/authorization/ui/Authorization.styles.js.map +1 -1
  8. package/build/src/elements/authorization/ui/BasicAuthorization.d.ts +1 -1
  9. package/build/src/elements/authorization/ui/BasicAuthorization.d.ts.map +1 -1
  10. package/build/src/elements/authorization/ui/BasicAuthorization.js +5 -5
  11. package/build/src/elements/authorization/ui/BasicAuthorization.js.map +1 -1
  12. package/build/src/elements/authorization/ui/BearerAuthorization.d.ts +1 -1
  13. package/build/src/elements/authorization/ui/BearerAuthorization.d.ts.map +1 -1
  14. package/build/src/elements/authorization/ui/BearerAuthorization.js +3 -3
  15. package/build/src/elements/authorization/ui/BearerAuthorization.js.map +1 -1
  16. package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts +1 -1
  17. package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts.map +1 -1
  18. package/build/src/elements/authorization/ui/NtlmAuthorization.js +7 -7
  19. package/build/src/elements/authorization/ui/NtlmAuthorization.js.map +1 -1
  20. package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts +1 -1
  21. package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts.map +1 -1
  22. package/build/src/elements/authorization/ui/OAuth2Authorization.js +32 -27
  23. package/build/src/elements/authorization/ui/OAuth2Authorization.js.map +1 -1
  24. package/build/src/elements/authorization/ui/OidcAuthorization.js +4 -4
  25. package/build/src/elements/authorization/ui/OidcAuthorization.js.map +1 -1
  26. package/build/src/elements/autocomplete/autocomplete-input.d.ts +10 -0
  27. package/build/src/elements/autocomplete/autocomplete-input.d.ts.map +1 -0
  28. package/build/src/{md/text-field/ui-text-field.js → elements/autocomplete/autocomplete-input.js} +9 -9
  29. package/build/src/elements/autocomplete/autocomplete-input.js.map +1 -0
  30. package/build/src/elements/autocomplete/internals/autocomplete.d.ts +209 -0
  31. package/build/src/elements/autocomplete/internals/autocomplete.d.ts.map +1 -0
  32. package/build/src/elements/autocomplete/internals/autocomplete.js +493 -0
  33. package/build/src/elements/autocomplete/internals/autocomplete.js.map +1 -0
  34. package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts +3 -0
  35. package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts.map +1 -0
  36. package/build/src/elements/autocomplete/internals/autocomplete.styles.js +25 -0
  37. package/build/src/elements/autocomplete/internals/autocomplete.styles.js.map +1 -0
  38. package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts +1 -1
  39. package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts.map +1 -1
  40. package/build/src/elements/dialog/internals/DeleteCookieAction.element.js +5 -5
  41. package/build/src/elements/dialog/internals/DeleteCookieAction.element.js.map +1 -1
  42. package/build/src/elements/dialog/internals/Rename.d.ts +1 -1
  43. package/build/src/elements/dialog/internals/Rename.d.ts.map +1 -1
  44. package/build/src/elements/dialog/internals/Rename.js +3 -3
  45. package/build/src/elements/dialog/internals/Rename.js.map +1 -1
  46. package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts +1 -1
  47. package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts.map +1 -1
  48. package/build/src/elements/dialog/internals/SetCookieAction.element.js +9 -9
  49. package/build/src/elements/dialog/internals/SetCookieAction.element.js.map +1 -1
  50. package/build/src/elements/environment/EnvironmentEditor.d.ts +1 -1
  51. package/build/src/elements/environment/EnvironmentEditor.d.ts.map +1 -1
  52. package/build/src/elements/environment/EnvironmentEditor.js +3 -3
  53. package/build/src/elements/environment/EnvironmentEditor.js.map +1 -1
  54. package/build/src/elements/environment/EnvironmentEditor.styles.js +1 -1
  55. package/build/src/elements/environment/EnvironmentEditor.styles.js.map +1 -1
  56. package/build/src/elements/environment/ServerEditor.d.ts +1 -1
  57. package/build/src/elements/environment/ServerEditor.d.ts.map +1 -1
  58. package/build/src/elements/environment/ServerEditor.js +7 -7
  59. package/build/src/elements/environment/ServerEditor.js.map +1 -1
  60. package/build/src/elements/environment/ServerEditor.styles.js +1 -1
  61. package/build/src/elements/environment/ServerEditor.styles.js.map +1 -1
  62. package/build/src/elements/http/BodyMultipartEditor.d.ts.map +1 -1
  63. package/build/src/elements/http/BodyMultipartEditor.js +4 -0
  64. package/build/src/elements/http/BodyMultipartEditor.js.map +1 -1
  65. package/build/src/elements/http/CertificateAdd.element.d.ts +1 -1
  66. package/build/src/elements/http/CertificateAdd.element.d.ts.map +1 -1
  67. package/build/src/elements/http/CertificateAdd.element.js +8 -8
  68. package/build/src/elements/http/CertificateAdd.element.js.map +1 -1
  69. package/build/src/elements/http/CertificateAdd.styles.js +1 -1
  70. package/build/src/elements/http/CertificateAdd.styles.js.map +1 -1
  71. package/build/src/elements/http/HttpAssertions.element.js +3 -3
  72. package/build/src/elements/http/HttpAssertions.element.js.map +1 -1
  73. package/build/src/elements/http/HttpFlows.element.js +3 -3
  74. package/build/src/elements/http/HttpFlows.element.js.map +1 -1
  75. package/build/src/elements/http/HttpFlowsUi.d.ts +1 -1
  76. package/build/src/elements/http/HttpFlowsUi.d.ts.map +1 -1
  77. package/build/src/elements/http/HttpFlowsUi.js +31 -31
  78. package/build/src/elements/http/HttpFlowsUi.js.map +1 -1
  79. package/build/src/elements/http/RequestConfigElement.d.ts +1 -1
  80. package/build/src/elements/http/RequestConfigElement.d.ts.map +1 -1
  81. package/build/src/elements/http/RequestConfigElement.js +7 -7
  82. package/build/src/elements/http/RequestConfigElement.js.map +1 -1
  83. package/build/src/elements/http/UrlParamsForm.d.ts +1 -1
  84. package/build/src/elements/http/UrlParamsForm.d.ts.map +1 -1
  85. package/build/src/elements/http/UrlParamsForm.js +1 -1
  86. package/build/src/elements/http/UrlParamsForm.js.map +1 -1
  87. package/build/src/elements/project/ProjectRunner.d.ts +1 -1
  88. package/build/src/elements/project/ProjectRunner.d.ts.map +1 -1
  89. package/build/src/elements/project/ProjectRunner.js +5 -5
  90. package/build/src/elements/project/ProjectRunner.js.map +1 -1
  91. package/build/src/md/input/Input.d.ts +0 -15
  92. package/build/src/md/input/Input.d.ts.map +1 -1
  93. package/build/src/md/input/Input.js +7 -42
  94. package/build/src/md/input/Input.js.map +1 -1
  95. package/build/src/md/list/internals/List.d.ts +7 -2
  96. package/build/src/md/list/internals/List.d.ts.map +1 -1
  97. package/build/src/md/list/internals/List.js +6 -0
  98. package/build/src/md/list/internals/List.js.map +1 -1
  99. package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
  100. package/build/src/md/list/internals/ListItem.styles.js +8 -0
  101. package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
  102. package/build/src/md/listbox/internals/Listbox.d.ts +2 -2
  103. package/build/src/md/listbox/internals/Listbox.d.ts.map +1 -1
  104. package/build/src/md/listbox/internals/Listbox.js.map +1 -1
  105. package/build/src/md/text-area/internals/TextAreaElement.d.ts.map +1 -1
  106. package/build/src/md/text-area/internals/TextAreaElement.js +0 -5
  107. package/build/src/md/text-area/internals/TextAreaElement.js.map +1 -1
  108. package/build/src/md/text-area/ui-text-area.d.ts.map +1 -1
  109. package/build/src/md/text-area/ui-text-area.js +3 -2
  110. package/build/src/md/text-area/ui-text-area.js.map +1 -1
  111. package/build/src/md/text-field/internals/{TextFieldElement.d.ts → TextField.d.ts} +2 -2
  112. package/build/src/md/text-field/internals/TextField.d.ts.map +1 -0
  113. package/build/src/md/text-field/internals/{TextFieldElement.js → TextField.js} +2 -5
  114. package/build/src/md/text-field/internals/TextField.js.map +1 -0
  115. package/build/src/{visualization/elements/WorkspaceStyles.d.ts → md/text-field/internals/common.styles.d.ts} +1 -1
  116. package/build/src/md/text-field/internals/common.styles.d.ts.map +1 -0
  117. package/build/src/md/text-field/internals/{TextField.styles.js → common.styles.js} +8 -94
  118. package/build/src/md/text-field/internals/common.styles.js.map +1 -0
  119. package/build/src/md/text-field/internals/{TextField.styles.d.ts → filled.styles.d.ts} +1 -1
  120. package/build/src/md/text-field/internals/filled.styles.d.ts.map +1 -0
  121. package/build/src/md/text-field/internals/filled.styles.js +107 -0
  122. package/build/src/md/text-field/internals/filled.styles.js.map +1 -0
  123. package/build/src/md/text-field/internals/outlined.styles.d.ts +3 -0
  124. package/build/src/md/text-field/internals/outlined.styles.d.ts.map +1 -0
  125. package/build/src/md/text-field/internals/outlined.styles.js +43 -0
  126. package/build/src/md/text-field/internals/outlined.styles.js.map +1 -0
  127. package/build/src/md/text-field/ui-filled-text-field.d.ts +11 -0
  128. package/build/src/md/text-field/ui-filled-text-field.d.ts.map +1 -0
  129. package/build/src/md/text-field/ui-filled-text-field.js +28 -0
  130. package/build/src/md/text-field/ui-filled-text-field.js.map +1 -0
  131. package/build/src/md/text-field/ui-outlined-text-field.d.ts +11 -0
  132. package/build/src/md/text-field/ui-outlined-text-field.d.ts.map +1 -0
  133. package/build/src/md/text-field/ui-outlined-text-field.js +28 -0
  134. package/build/src/md/text-field/ui-outlined-text-field.js.map +1 -0
  135. package/build/src/types/input.d.ts +1 -1
  136. package/build/src/types/input.d.ts.map +1 -1
  137. package/build/src/types/input.js.map +1 -1
  138. package/demo/elements/authorization/oauth-authorize.html +4 -4
  139. package/demo/elements/authorization/oauth-authorize.ts +1 -1
  140. package/demo/elements/autocomplete/index.html +24 -0
  141. package/demo/elements/autocomplete/index.ts +123 -0
  142. package/demo/elements/http/body-editor.ts +3 -3
  143. package/demo/elements/index.html +15 -11
  144. package/demo/md/index.html +1 -1
  145. package/demo/md/inputs/input.html +10 -15
  146. package/demo/md/inputs/input.ts +389 -101
  147. package/demo/page.css +4 -0
  148. package/package.json +7 -2
  149. package/src/elements/authorization/ui/ApiKeyAuthorization.ts +7 -7
  150. package/src/elements/authorization/ui/Authorization.styles.ts +4 -4
  151. package/src/elements/authorization/ui/BasicAuthorization.ts +5 -5
  152. package/src/elements/authorization/ui/BearerAuthorization.ts +3 -3
  153. package/src/elements/authorization/ui/NtlmAuthorization.ts +7 -7
  154. package/src/elements/authorization/ui/OAuth2Authorization.ts +32 -27
  155. package/src/elements/authorization/ui/OidcAuthorization.ts +4 -4
  156. package/src/elements/autocomplete/autocomplete-input.ts +14 -0
  157. package/src/elements/autocomplete/internals/autocomplete.styles.ts +25 -0
  158. package/src/elements/autocomplete/internals/autocomplete.ts +490 -0
  159. package/src/elements/dialog/internals/DeleteCookieAction.element.ts +5 -5
  160. package/src/elements/dialog/internals/Rename.ts +3 -3
  161. package/src/elements/dialog/internals/SetCookieAction.element.ts +9 -9
  162. package/src/elements/environment/EnvironmentEditor.styles.ts +1 -1
  163. package/src/elements/environment/EnvironmentEditor.ts +3 -3
  164. package/src/elements/environment/ServerEditor.styles.ts +1 -1
  165. package/src/elements/environment/ServerEditor.ts +7 -7
  166. package/src/elements/http/BodyMultipartEditor.ts +4 -0
  167. package/src/elements/http/CertificateAdd.element.ts +8 -8
  168. package/src/elements/http/CertificateAdd.styles.ts +1 -1
  169. package/src/elements/http/HttpAssertions.element.ts +3 -3
  170. package/src/elements/http/HttpFlows.element.ts +3 -3
  171. package/src/elements/http/HttpFlowsUi.ts +31 -31
  172. package/src/elements/http/RequestConfigElement.ts +7 -7
  173. package/src/elements/http/UrlParamsForm.ts +1 -1
  174. package/src/elements/project/ProjectRunner.ts +5 -5
  175. package/src/md/input/Input.ts +6 -21
  176. package/src/md/list/internals/List.ts +14 -2
  177. package/src/md/list/internals/ListItem.styles.ts +8 -0
  178. package/src/md/listbox/internals/Listbox.ts +2 -2
  179. package/src/md/text-area/internals/TextAreaElement.ts +0 -5
  180. package/src/md/text-area/ui-text-area.ts +3 -2
  181. package/src/md/text-field/internals/{TextFieldElement.ts → TextField.ts} +1 -4
  182. package/src/md/text-field/internals/{TextField.styles.ts → common.styles.ts} +7 -93
  183. package/src/md/text-field/internals/filled.styles.ts +107 -0
  184. package/src/md/text-field/internals/outlined.styles.ts +43 -0
  185. package/src/md/text-field/ui-filled-text-field.ts +16 -0
  186. package/src/md/text-field/ui-outlined-text-field.ts +16 -0
  187. package/src/types/input.ts +0 -1
  188. package/test/elements/authorization/basic-method.test.ts +3 -3
  189. package/test/elements/authorization/bearer-method.test.ts +2 -2
  190. package/test/elements/authorization/ntlm-method.test.ts +4 -4
  191. package/test/elements/autocomplete/autocomplete-input.spec.ts +448 -0
  192. package/test/elements/http/BodyMultipartEditorElement.test.ts +15 -16
  193. package/test/elements/http/CertificateAdd.test.ts +11 -11
  194. package/test/elements/http/HttpAssertions.test.ts +9 -9
  195. package/test/elements/http/HttpFlows.test.ts +4 -4
  196. package/test/env.ts +15 -0
  197. package/test/tsconfig.json +1 -7
  198. package/web-test-runner.config.js +5 -1
  199. package/build/src/md/text-field/internals/TextField.styles.d.ts.map +0 -1
  200. package/build/src/md/text-field/internals/TextField.styles.js.map +0 -1
  201. package/build/src/md/text-field/internals/TextFieldElement.d.ts.map +0 -1
  202. package/build/src/md/text-field/internals/TextFieldElement.js.map +0 -1
  203. package/build/src/md/text-field/ui-text-field.d.ts +0 -11
  204. package/build/src/md/text-field/ui-text-field.d.ts.map +0 -1
  205. package/build/src/md/text-field/ui-text-field.js.map +0 -1
  206. package/build/src/visualization/elements/VizAssociationElement.d.ts +0 -4
  207. package/build/src/visualization/elements/VizAssociationElement.d.ts.map +0 -1
  208. package/build/src/visualization/elements/VizAssociationElement.js +0 -4
  209. package/build/src/visualization/elements/VizAssociationElement.js.map +0 -1
  210. package/build/src/visualization/elements/VizWorkspaceElement.d.ts +0 -110
  211. package/build/src/visualization/elements/VizWorkspaceElement.d.ts.map +0 -1
  212. package/build/src/visualization/elements/VizWorkspaceElement.js +0 -321
  213. package/build/src/visualization/elements/VizWorkspaceElement.js.map +0 -1
  214. package/build/src/visualization/elements/WorkspaceStyles.d.ts.map +0 -1
  215. package/build/src/visualization/elements/WorkspaceStyles.js +0 -168
  216. package/build/src/visualization/elements/WorkspaceStyles.js.map +0 -1
  217. package/build/src/visualization/lib/AnchorFinder.d.ts +0 -64
  218. package/build/src/visualization/lib/AnchorFinder.d.ts.map +0 -1
  219. package/build/src/visualization/lib/AnchorFinder.js +0 -107
  220. package/build/src/visualization/lib/AnchorFinder.js.map +0 -1
  221. package/build/src/visualization/lib/AnchorUtils.d.ts +0 -10
  222. package/build/src/visualization/lib/AnchorUtils.d.ts.map +0 -1
  223. package/build/src/visualization/lib/AnchorUtils.js +0 -44
  224. package/build/src/visualization/lib/AnchorUtils.js.map +0 -1
  225. package/build/src/visualization/lib/AssociationAnchors.d.ts +0 -134
  226. package/build/src/visualization/lib/AssociationAnchors.d.ts.map +0 -1
  227. package/build/src/visualization/lib/AssociationAnchors.js +0 -351
  228. package/build/src/visualization/lib/AssociationAnchors.js.map +0 -1
  229. package/build/src/visualization/lib/LabelSketch.d.ts +0 -16
  230. package/build/src/visualization/lib/LabelSketch.d.ts.map +0 -1
  231. package/build/src/visualization/lib/LabelSketch.js +0 -53
  232. package/build/src/visualization/lib/LabelSketch.js.map +0 -1
  233. package/build/src/visualization/lib/LineSketch.d.ts +0 -26
  234. package/build/src/visualization/lib/LineSketch.d.ts.map +0 -1
  235. package/build/src/visualization/lib/LineSketch.js +0 -55
  236. package/build/src/visualization/lib/LineSketch.js.map +0 -1
  237. package/build/src/visualization/lib/Point.d.ts +0 -74
  238. package/build/src/visualization/lib/Point.d.ts.map +0 -1
  239. package/build/src/visualization/lib/Point.js +0 -121
  240. package/build/src/visualization/lib/Point.js.map +0 -1
  241. package/build/src/visualization/lib/PositionUtils.d.ts +0 -65
  242. package/build/src/visualization/lib/PositionUtils.d.ts.map +0 -1
  243. package/build/src/visualization/lib/PositionUtils.js +0 -205
  244. package/build/src/visualization/lib/PositionUtils.js.map +0 -1
  245. package/build/src/visualization/lib/SelectionManager.d.ts +0 -183
  246. package/build/src/visualization/lib/SelectionManager.d.ts.map +0 -1
  247. package/build/src/visualization/lib/SelectionManager.js +0 -481
  248. package/build/src/visualization/lib/SelectionManager.js.map +0 -1
  249. package/build/src/visualization/lib/ShapeArtist.d.ts +0 -45
  250. package/build/src/visualization/lib/ShapeArtist.d.ts.map +0 -1
  251. package/build/src/visualization/lib/ShapeArtist.js +0 -209
  252. package/build/src/visualization/lib/ShapeArtist.js.map +0 -1
  253. package/build/src/visualization/lib/SvgMarkers.d.ts +0 -14
  254. package/build/src/visualization/lib/SvgMarkers.d.ts.map +0 -1
  255. package/build/src/visualization/lib/SvgMarkers.js +0 -77
  256. package/build/src/visualization/lib/SvgMarkers.js.map +0 -1
  257. package/build/src/visualization/lib/TipSketch.d.ts +0 -26
  258. package/build/src/visualization/lib/TipSketch.d.ts.map +0 -1
  259. package/build/src/visualization/lib/TipSketch.js +0 -77
  260. package/build/src/visualization/lib/TipSketch.js.map +0 -1
  261. package/build/src/visualization/lib/TouchSupport.d.ts +0 -14
  262. package/build/src/visualization/lib/TouchSupport.d.ts.map +0 -1
  263. package/build/src/visualization/lib/TouchSupport.js +0 -55
  264. package/build/src/visualization/lib/TouchSupport.js.map +0 -1
  265. package/build/src/visualization/lib/Utils.d.ts +0 -25
  266. package/build/src/visualization/lib/Utils.d.ts.map +0 -1
  267. package/build/src/visualization/lib/Utils.js +0 -59
  268. package/build/src/visualization/lib/Utils.js.map +0 -1
  269. package/build/src/visualization/lib/VisualizationTypes.d.ts +0 -216
  270. package/build/src/visualization/lib/VisualizationTypes.d.ts.map +0 -1
  271. package/build/src/visualization/lib/VisualizationTypes.js +0 -3
  272. package/build/src/visualization/lib/VisualizationTypes.js.map +0 -1
  273. package/build/src/visualization/lib/WorkspaceAlignment.d.ts +0 -51
  274. package/build/src/visualization/lib/WorkspaceAlignment.d.ts.map +0 -1
  275. package/build/src/visualization/lib/WorkspaceAlignment.js +0 -243
  276. package/build/src/visualization/lib/WorkspaceAlignment.js.map +0 -1
  277. package/build/src/visualization/lib/WorkspaceDebugging.d.ts +0 -104
  278. package/build/src/visualization/lib/WorkspaceDebugging.d.ts.map +0 -1
  279. package/build/src/visualization/lib/WorkspaceDebugging.js +0 -286
  280. package/build/src/visualization/lib/WorkspaceDebugging.js.map +0 -1
  281. package/build/src/visualization/lib/WorkspaceEdges.d.ts +0 -293
  282. package/build/src/visualization/lib/WorkspaceEdges.d.ts.map +0 -1
  283. package/build/src/visualization/lib/WorkspaceEdges.js +0 -1073
  284. package/build/src/visualization/lib/WorkspaceEdges.js.map +0 -1
  285. package/build/src/visualization/lib/WorkspaceGestures.d.ts +0 -119
  286. package/build/src/visualization/lib/WorkspaceGestures.d.ts.map +0 -1
  287. package/build/src/visualization/lib/WorkspaceGestures.js +0 -376
  288. package/build/src/visualization/lib/WorkspaceGestures.js.map +0 -1
  289. package/build/src/visualization/lib/WorkspaceSizing.d.ts +0 -66
  290. package/build/src/visualization/lib/WorkspaceSizing.d.ts.map +0 -1
  291. package/build/src/visualization/lib/WorkspaceSizing.js +0 -168
  292. package/build/src/visualization/lib/WorkspaceSizing.js.map +0 -1
  293. package/build/src/visualization/lib/lines/RectilinearLine.d.ts +0 -114
  294. package/build/src/visualization/lib/lines/RectilinearLine.d.ts.map +0 -1
  295. package/build/src/visualization/lib/lines/RectilinearLine.js +0 -605
  296. package/build/src/visualization/lib/lines/RectilinearLine.js.map +0 -1
  297. package/build/src/visualization/lib/tips/RectilinearTip.d.ts +0 -26
  298. package/build/src/visualization/lib/tips/RectilinearTip.d.ts.map +0 -1
  299. package/build/src/visualization/lib/tips/RectilinearTip.js +0 -149
  300. package/build/src/visualization/lib/tips/RectilinearTip.js.map +0 -1
  301. package/build/src/visualization/lib/tips/TipArtist.d.ts +0 -22
  302. package/build/src/visualization/lib/tips/TipArtist.d.ts.map +0 -1
  303. package/build/src/visualization/lib/tips/TipArtist.js +0 -31
  304. package/build/src/visualization/lib/tips/TipArtist.js.map +0 -1
  305. package/build/src/visualization/lib/types.d.ts +0 -164
  306. package/build/src/visualization/lib/types.d.ts.map +0 -1
  307. package/build/src/visualization/lib/types.js +0 -2
  308. package/build/src/visualization/lib/types.js.map +0 -1
  309. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts +0 -126
  310. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts.map +0 -1
  311. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js +0 -260
  312. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js.map +0 -1
  313. package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts +0 -93
  314. package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts.map +0 -1
  315. package/build/src/visualization/plugin/group-selection/GroupSelection.js +0 -250
  316. package/build/src/visualization/plugin/group-selection/GroupSelection.js.map +0 -1
  317. package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts +0 -10
  318. package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts.map +0 -1
  319. package/build/src/visualization/plugin/positioning/DataModelLayout.js +0 -105
  320. package/build/src/visualization/plugin/positioning/DataModelLayout.js.map +0 -1
  321. package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts +0 -93
  322. package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts.map +0 -1
  323. package/build/src/visualization/plugin/positioning/WorkspaceLayout.js +0 -96
  324. package/build/src/visualization/plugin/positioning/WorkspaceLayout.js.map +0 -1
  325. package/build/src/visualization/viz-association.d.ts +0 -7
  326. package/build/src/visualization/viz-association.d.ts.map +0 -1
  327. package/build/src/visualization/viz-association.js +0 -3
  328. package/build/src/visualization/viz-association.js.map +0 -1
  329. package/build/src/visualization/viz-workspace.d.ts +0 -7
  330. package/build/src/visualization/viz-workspace.d.ts.map +0 -1
  331. package/build/src/visualization/viz-workspace.js +0 -3
  332. package/build/src/visualization/viz-workspace.js.map +0 -1
  333. package/src/md/text-field/ui-text-field.ts +0 -15
  334. package/src/visualization/elements/VizAssociationElement.ts +0 -3
  335. package/src/visualization/elements/VizWorkspaceElement.ts +0 -302
  336. package/src/visualization/elements/WorkspaceStyles.ts +0 -168
  337. package/src/visualization/lib/AnchorFinder.ts +0 -112
  338. package/src/visualization/lib/AnchorUtils.ts +0 -53
  339. package/src/visualization/lib/AssociationAnchors.ts +0 -418
  340. package/src/visualization/lib/LabelSketch.ts +0 -67
  341. package/src/visualization/lib/LineSketch.ts +0 -62
  342. package/src/visualization/lib/Point.ts +0 -134
  343. package/src/visualization/lib/PositionUtils.ts +0 -218
  344. package/src/visualization/lib/SelectionManager.ts +0 -513
  345. package/src/visualization/lib/ShapeArtist.ts +0 -222
  346. package/src/visualization/lib/SvgMarkers.ts +0 -80
  347. package/src/visualization/lib/TipSketch.ts +0 -91
  348. package/src/visualization/lib/TouchSupport.ts +0 -72
  349. package/src/visualization/lib/Utils.ts +0 -63
  350. package/src/visualization/lib/VisualizationTypes.ts +0 -232
  351. package/src/visualization/lib/WorkspaceAlignment.ts +0 -261
  352. package/src/visualization/lib/WorkspaceDebugging.ts +0 -313
  353. package/src/visualization/lib/WorkspaceEdges.ts +0 -1153
  354. package/src/visualization/lib/WorkspaceGestures.ts +0 -400
  355. package/src/visualization/lib/WorkspaceSizing.ts +0 -181
  356. package/src/visualization/lib/lines/RectilinearLine.ts +0 -589
  357. package/src/visualization/lib/tips/RectilinearTip.ts +0 -156
  358. package/src/visualization/lib/tips/TipArtist.ts +0 -34
  359. package/src/visualization/lib/types.ts +0 -173
  360. package/src/visualization/plugin/dnd/DragAndDropPlugin.ts +0 -294
  361. package/src/visualization/plugin/group-selection/GroupSelection.ts +0 -271
  362. package/src/visualization/plugin/positioning/DataModelLayout.ts +0 -114
  363. package/src/visualization/plugin/positioning/WorkspaceLayout.ts +0 -149
  364. package/src/visualization/viz-association.ts +0 -9
  365. package/src/visualization/viz-workspace.ts +0 -9
  366. package/test/env.d.ts +0 -9
  367. package/test/env.js +0 -7
  368. package/test/visualization/lib/AnchorFinder.test.ts +0 -313
  369. package/test/visualization/lib/AnchorUtils.test.ts +0 -178
  370. package/test/visualization/lib/PositionUtils.test.ts +0 -406
  371. package/test/visualization/lib/test-styles.css +0 -80
@@ -1,205 +0,0 @@
1
- import { Point } from './Point.js';
2
- /**
3
- * Computes a point from the `x` and `y` coordinates of the viewport and applies
4
- * the current scale to it to correctly position the click coordinates.
5
- *
6
- * @param wrapper The relatively positioned wrapper
7
- * @param container The absolutely positioned container
8
- * @param scale The current scale applied to the container
9
- * @returns A point with x and y scaled coordinates.
10
- */
11
- export function clickPoint(x, y, wrapper, container, scale) {
12
- const { left: vLeft, top: vTop } = wrapper.getBoundingClientRect();
13
- const { left: cLeft, top: cTop } = container.getBoundingClientRect();
14
- const workspaceRelativeX = cLeft - vLeft;
15
- const workspaceRelativeY = cTop - vTop;
16
- const viewportRelativeXClick = x - vLeft;
17
- const viewportRelativeYClick = y - vTop;
18
- const realWorkspaceXClick = viewportRelativeXClick - workspaceRelativeX;
19
- const realWorkspaceYClick = viewportRelativeYClick - workspaceRelativeY;
20
- const relativeXClick = realWorkspaceXClick / scale;
21
- const relativeYClick = realWorkspaceYClick / scale;
22
- return new Point(relativeXClick, relativeYClick);
23
- }
24
- /**
25
- * Computes a point from the `x` and `y` coordinates of the viewport and applies
26
- * the current scale to it to correctly position the click coordinates.
27
- *
28
- * @param workspace The workspace element
29
- * @returns A point with x and y scaled coordinates.
30
- */
31
- export function getRelativeClickPoint(x, y, workspace) {
32
- const { scale, canvas } = workspace;
33
- return clickPoint(x, y, workspace, canvas, scale);
34
- }
35
- /**
36
- * Computes the direction for both start and end points relative to their
37
- * shapes.
38
- * The `end` property describes the direction of an abstract arrow would be pointing to.
39
- * The `start` is the direction facing the beginning of the path.
40
- *
41
- * @param sp The start point to calculate the direction from
42
- * @param ep The end point to calculate the direction to
43
- * @param sBox DOM rectangle of the source
44
- * @param eBox DOM rectangle of the target
45
- */
46
- export function findDirection(sp, ep, sBox, eBox) {
47
- const padding = 10;
48
- let end;
49
- let start;
50
- if (Math.abs(eBox.left - ep.x) < padding) {
51
- end = 'east';
52
- }
53
- else if (Math.abs(eBox.right - ep.x) < padding) {
54
- end = 'west';
55
- }
56
- else if (Math.abs(eBox.bottom - ep.y) < padding) {
57
- end = 'south';
58
- }
59
- else {
60
- end = 'north';
61
- }
62
- if (Math.abs(sBox.left - sp.x) < padding) {
63
- start = 'west';
64
- }
65
- else if (Math.abs(sBox.right - sp.x) < padding) {
66
- start = 'east';
67
- }
68
- else if (Math.abs(sBox.top - sp.y) < padding) {
69
- start = 'north';
70
- }
71
- else {
72
- start = 'south';
73
- }
74
- return {
75
- end,
76
- start,
77
- };
78
- }
79
- // /**
80
- // * @param {Point} p1
81
- // * @param {Point} p2
82
- // * @param {Point} p3
83
- // * @param {Point} p4
84
- // * @returns {boolean} True when the pair of points (p1, p2) and (p3, p4) are the same on any order.
85
- // */
86
- // export function theSamePair(p1, p2, p3, p4) {
87
- // if (p1.x === p3.x && p1.y === p3.y && p2.x === p4.x && p2.y === p4.y) {
88
- // return true;
89
- // }
90
- // if (p1.x === p4.x && p1.y === p4.y && p2.x === p3.x && p2.y === p3.y) {
91
- // return true;
92
- // }
93
- // return false;
94
- // }
95
- /**
96
- * Finds a pair of points closest to each other but from both sets.
97
- *
98
- * @param s1 First set.
99
- * @param s2 Second set.
100
- * @param avoid1 Avoid these points (when possible) from the set1
101
- * @param avoid2 Avoid these points (when possible) from the set2
102
- * @returns A list of two points closest to each other or null if there were no points in the set.
103
- */
104
- export function closetsPair(s1, s2, avoid1 = [], avoid2 = []) {
105
- const avoidSet1 = new Set(avoid1.map((p) => `${p.x},${p.y}`));
106
- const avoidSet2 = new Set(avoid2.map((p) => `${p.x},${p.y}`));
107
- const filteredS1 = s1.filter((p) => !avoidSet1.has(`${p.x},${p.y}`));
108
- const filteredS2 = s2.filter((p) => !avoidSet2.has(`${p.x},${p.y}`));
109
- if (filteredS1.length === 0 || filteredS2.length === 0) {
110
- return null;
111
- }
112
- let minSquaredDistance = Number.MAX_SAFE_INTEGER;
113
- let p;
114
- let q;
115
- filteredS1.forEach((sp) => {
116
- filteredS2.forEach((sq) => {
117
- const squaredDistance = (sp.x - sq.x) ** 2 + (sp.y - sq.y) ** 2;
118
- if (squaredDistance < minSquaredDistance) {
119
- minSquaredDistance = squaredDistance;
120
- p = sp;
121
- q = sq;
122
- }
123
- });
124
- });
125
- if (p && q) {
126
- return [p, q];
127
- }
128
- return null; // Return null if no pair is found.
129
- }
130
- // export function closetsPair(s1: Point[], s2: Point[], avoid1: Point[] = [], avoid2: Point[] = []): Point[] | null {
131
- // let distance = Number.MAX_SAFE_INTEGER
132
- // let p: Point | undefined
133
- // let q: Point | undefined
134
- // s1.forEach((sp) => {
135
- // if (avoid1.some((i) => i.x === sp.x && i.y === sp.y)) {
136
- // return
137
- // }
138
- // s2.forEach((sq) => {
139
- // if (avoid2.some((i) => i.x === sq.x && i.y === sq.y)) {
140
- // return
141
- // }
142
- // const d = sp.distance(sq)
143
- // if (d < distance) {
144
- // distance = d
145
- // p = sp
146
- // q = sq
147
- // }
148
- // })
149
- // })
150
- // if (!p && !!(avoid1.length || avoid2.length)) {
151
- // return closetsPair(s1, s2)
152
- // }
153
- // if (!p) {
154
- // return null
155
- // }
156
- // if (q) {
157
- // return [p, q]
158
- // }
159
- // return [p]
160
- // }
161
- /**
162
- * Filters out invalid points
163
- */
164
- export function filterPoints(points) {
165
- return points.filter((v) => v.validate());
166
- }
167
- /**
168
- * Computes a point of the click inside the workspace element (not the content wrapper).
169
- * This then can be used to position elements that are not inside the visualization
170
- * workspace.
171
- *
172
- * @param workspace The workspace element
173
- * @returns A point with x and y scaled coordinates.
174
- */
175
- export function getWorkspaceClick(x, y, workspace) {
176
- const { left, top } = workspace.getBoundingClientRect();
177
- const workspaceX = x - left;
178
- const workspaceY = y - top;
179
- return new Point(workspaceX, workspaceY);
180
- }
181
- export function getObjectBoundingClientRect(element, workspace) {
182
- const box = element.getBoundingClientRect();
183
- const { x, y } = getRelativeClickPoint(box.x, box.y, workspace);
184
- const { scale } = workspace;
185
- return new DOMRect(x, y, box.width / scale, box.height / scale);
186
- }
187
- /**
188
- * Dispatches the `positionchange` custom event on an element that has been positioned.
189
- *
190
- * @param dx The difference in the `x` position in relation to the object position before the move
191
- * @param dy The difference in the `y` position in relation to the object position before the move
192
- */
193
- export function notifyMoved(element, dx, dy) {
194
- const e = new CustomEvent('positionchange', {
195
- composed: true,
196
- cancelable: true,
197
- bubbles: true,
198
- detail: {
199
- dx,
200
- dy,
201
- },
202
- });
203
- element.dispatchEvent(e);
204
- }
205
- //# sourceMappingURL=PositionUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PositionUtils.js","sourceRoot":"","sources":["../../../../src/visualization/lib/PositionUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,CAAS,EAAE,CAAS,EAAE,OAAoB,EAAE,SAAsB,EAAE,KAAa;IAC1G,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;IAClE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAA;IACpE,MAAM,kBAAkB,GAAG,KAAK,GAAG,KAAK,CAAA;IACxC,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAAA;IACtC,MAAM,sBAAsB,GAAG,CAAC,GAAG,KAAK,CAAA;IACxC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,CAAA;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,GAAG,kBAAkB,CAAA;IACvE,MAAM,mBAAmB,GAAG,sBAAsB,GAAG,kBAAkB,CAAA;IACvE,MAAM,cAAc,GAAG,mBAAmB,GAAG,KAAK,CAAA;IAClD,MAAM,cAAc,G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B,EAAE;QAC1C,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACN,EAAE;YACF,EAAE;SACH;KACF,CAAC,CAAA;IACF,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport VizWorkspaceElement from '../elements/VizWorkspaceElement.js'\nimport { Point } from './Point.js'\nimport { IEdgeDirections, GeoDirection } from './types.js'\n\n/**\n * Computes a point from the `x` and `y` coordinates of the viewport and applies\n * the current scale to it to correctly position the click coordinates.\n *\n * @param wrapper The relatively positioned wrapper\n * @param container The absolutely positioned container\n * @param scale The current scale applied to the container\n * @returns A point with x and y scaled coordinates.\n */\nexport function clickPoint(x: number, y: number, wrapper: HTMLElement, container: HTMLElement, scale: number): Point {\n const { left: vLeft, top: vTop } = wrapper.getBoundingClientRect()\n const { left: cLeft, top: cTop } = container.getBoundingClientRect()\n const workspaceRelativeX = cLeft - vLeft\n const workspaceRelativeY = cTop - vTop\n const viewportRelativeXClick = x - vLeft\n const viewportRelativeYClick = y - vTop\n const realWorkspaceXClick = viewportRelativeXClick - workspaceRelativeX\n const realWorkspaceYClick = viewportRelativeYClick - workspaceRelativeY\n const relativeXClick = realWorkspaceXClick / scale\n const relativeYClick = realWorkspaceYClick / scale\n return new Point(relativeXClick, relativeYClick)\n}\n\n/**\n * Computes a point from the `x` and `y` coordinates of the viewport and applies\n * the current scale to it to correctly position the click coordinates.\n *\n * @param workspace The workspace element\n * @returns A point with x and y scaled coordinates.\n */\nexport function getRelativeClickPoint(x: number, y: number, workspace: VizWorkspaceElement): Point {\n const { scale, canvas } = workspace\n return clickPoint(x, y, workspace, canvas!, scale)\n}\n\n/**\n * Computes the direction for both start and end points relative to their\n * shapes.\n * The `end` property describes the direction of an abstract arrow would be pointing to.\n * The `start` is the direction facing the beginning of the path.\n *\n * @param sp The start point to calculate the direction from\n * @param ep The end point to calculate the direction to\n * @param sBox DOM rectangle of the source\n * @param eBox DOM rectangle of the target\n */\nexport function findDirection(sp: Point, ep: Point, sBox: DOMRect, eBox: DOMRect): IEdgeDirections {\n const padding = 10\n let end: GeoDirection\n let start: GeoDirection\n if (Math.abs(eBox.left - ep.x) < padding) {\n end = 'east'\n } else if (Math.abs(eBox.right - ep.x) < padding) {\n end = 'west'\n } else if (Math.abs(eBox.bottom - ep.y) < padding) {\n end = 'south'\n } else {\n end = 'north'\n }\n\n if (Math.abs(sBox.left - sp.x) < padding) {\n start = 'west'\n } else if (Math.abs(sBox.right - sp.x) < padding) {\n start = 'east'\n } else if (Math.abs(sBox.top - sp.y) < padding) {\n start = 'north'\n } else {\n start = 'south'\n }\n\n return {\n end,\n start,\n }\n}\n\n// /**\n// * @param {Point} p1\n// * @param {Point} p2\n// * @param {Point} p3\n// * @param {Point} p4\n// * @returns {boolean} True when the pair of points (p1, p2) and (p3, p4) are the same on any order.\n// */\n// export function theSamePair(p1, p2, p3, p4) {\n// if (p1.x === p3.x && p1.y === p3.y && p2.x === p4.x && p2.y === p4.y) {\n// return true;\n// }\n// if (p1.x === p4.x && p1.y === p4.y && p2.x === p3.x && p2.y === p3.y) {\n// return true;\n// }\n// return false;\n// }\n\n/**\n * Finds a pair of points closest to each other but from both sets.\n *\n * @param s1 First set.\n * @param s2 Second set.\n * @param avoid1 Avoid these points (when possible) from the set1\n * @param avoid2 Avoid these points (when possible) from the set2\n * @returns A list of two points closest to each other or null if there were no points in the set.\n */\nexport function closetsPair(s1: Point[], s2: Point[], avoid1: Point[] = [], avoid2: Point[] = []): Point[] | null {\n const avoidSet1 = new Set(avoid1.map((p) => `${p.x},${p.y}`))\n const avoidSet2 = new Set(avoid2.map((p) => `${p.x},${p.y}`))\n\n const filteredS1 = s1.filter((p) => !avoidSet1.has(`${p.x},${p.y}`))\n const filteredS2 = s2.filter((p) => !avoidSet2.has(`${p.x},${p.y}`))\n\n if (filteredS1.length === 0 || filteredS2.length === 0) {\n return null\n }\n\n let minSquaredDistance = Number.MAX_SAFE_INTEGER\n let p: Point | undefined\n let q: Point | undefined\n\n filteredS1.forEach((sp) => {\n filteredS2.forEach((sq) => {\n const squaredDistance = (sp.x - sq.x) ** 2 + (sp.y - sq.y) ** 2\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance\n p = sp\n q = sq\n }\n })\n })\n\n if (p && q) {\n return [p, q]\n }\n\n return null // Return null if no pair is found.\n}\n// export function closetsPair(s1: Point[], s2: Point[], avoid1: Point[] = [], avoid2: Point[] = []): Point[] | null {\n// let distance = Number.MAX_SAFE_INTEGER\n// let p: Point | undefined\n// let q: Point | undefined\n// s1.forEach((sp) => {\n// if (avoid1.some((i) => i.x === sp.x && i.y === sp.y)) {\n// return\n// }\n// s2.forEach((sq) => {\n// if (avoid2.some((i) => i.x === sq.x && i.y === sq.y)) {\n// return\n// }\n// const d = sp.distance(sq)\n// if (d < distance) {\n// distance = d\n// p = sp\n// q = sq\n// }\n// })\n// })\n// if (!p && !!(avoid1.length || avoid2.length)) {\n// return closetsPair(s1, s2)\n// }\n// if (!p) {\n// return null\n// }\n// if (q) {\n// return [p, q]\n// }\n// return [p]\n// }\n\n/**\n * Filters out invalid points\n */\nexport function filterPoints(points: Point[]): Point[] {\n return points.filter((v) => v.validate())\n}\n\n/**\n * Computes a point of the click inside the workspace element (not the content wrapper).\n * This then can be used to position elements that are not inside the visualization\n * workspace.\n *\n * @param workspace The workspace element\n * @returns A point with x and y scaled coordinates.\n */\nexport function getWorkspaceClick(x: number, y: number, workspace: VizWorkspaceElement): Point {\n const { left, top } = workspace.getBoundingClientRect()\n const workspaceX = x - left\n const workspaceY = y - top\n return new Point(workspaceX, workspaceY)\n}\n\nexport function getObjectBoundingClientRect(element: Element, workspace: VizWorkspaceElement): DOMRect {\n const box = element.getBoundingClientRect()\n const { x, y } = getRelativeClickPoint(box.x, box.y, workspace)\n const { scale } = workspace\n return new DOMRect(x, y, box.width / scale, box.height / scale)\n}\n\n/**\n * Dispatches the `positionchange` custom event on an element that has been positioned.\n *\n * @param dx The difference in the `x` position in relation to the object position before the move\n * @param dy The difference in the `y` position in relation to the object position before the move\n */\nexport function notifyMoved(element: EventTarget, dx: number, dy: number): void {\n const e = new CustomEvent('positionchange', {\n composed: true,\n cancelable: true,\n bubbles: true,\n detail: {\n dx,\n dy,\n },\n })\n element.dispatchEvent(e)\n}\n"]}
@@ -1,183 +0,0 @@
1
- import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
2
- import { ISelectedDomain } from './types.js';
3
- export declare const clickHandler: unique symbol;
4
- export declare const observeItems: unique symbol;
5
- export declare const mutationHandler: unique symbol;
6
- export declare const mutationObserver: unique symbol;
7
- export declare const processAddedNodes: unique symbol;
8
- export declare const processRemovedNodes: unique symbol;
9
- export declare const processAttributeChanged: unique symbol;
10
- export declare const propagateSelection: unique symbol;
11
- export declare const selectAssociations: unique symbol;
12
- export declare const selectReverseAssociations: unique symbol;
13
- export declare const propagateDeselection: unique symbol;
14
- export declare const deselectAssociations: unique symbol;
15
- export declare const deselectReverseAssociations: unique symbol;
16
- export declare const notifyChanged: unique symbol;
17
- export declare const selectedItemsValue: unique symbol;
18
- export declare const selectedIdsValue: unique symbol;
19
- /**
20
- * A class that takes care of selection in the visualization workspace.
21
- */
22
- export declare class SelectionManager {
23
- target: VizWorkspaceElement;
24
- /**
25
- * The list of currently selected elements
26
- */
27
- [selectedItemsValue]: Set<Element>;
28
- /**
29
- * The list of currently selected domain ids
30
- */
31
- [selectedIdsValue]: ISelectedDomain[];
32
- [mutationObserver]?: MutationObserver;
33
- /**
34
- * @returns A set of currently selected items.
35
- */
36
- get selectedItems(): Set<Element>;
37
- /**
38
- * @returns A list of currently selected domain ids.
39
- */
40
- get selected(): ISelectedDomain[];
41
- /**
42
- * @returns A list of all selectable items
43
- */
44
- get selectable(): Element[];
45
- constructor(target: VizWorkspaceElement);
46
- /**
47
- * Initializes the library. Should be called when the workspace is ready to render content.
48
- */
49
- connect(): void;
50
- /**
51
- * Cleans up and removes listeners
52
- */
53
- disconnect(): void;
54
- /**
55
- * Checks if given element is marked as selectable target
56
- * @param selectable The element to test for `selectable` or `data-selectable` attribute
57
- * @returns True if the element can be selected
58
- */
59
- isSelectable(selectable: Element): boolean;
60
- /**
61
- * Checks if given element is marked as selected
62
- * @param selectable The element to test for `selected` or `data-selected` attribute
63
- * @returns True if the element is marked as selected
64
- */
65
- isSelected(selectable: Element): boolean;
66
- /**
67
- * Marks an element as selected
68
- * @param selectable The element to add the selected mark to.
69
- */
70
- setSelected(selectable: Element): void;
71
- /**
72
- * Marks an element as not selected
73
- * @param selectable The element to remove the selected mark from.
74
- */
75
- setUnselected(selectable: Element): void;
76
- /**
77
- * Deselects all currently selected items.
78
- */
79
- selectAll(): void;
80
- /**
81
- * Deselects all currently selected items.
82
- */
83
- deselectAll(): void;
84
- /**
85
- * Selects objects that are selectable by their `key`.
86
- *
87
- * The `addToSelection` argument is equivalent of calling `deselectAll()` and then `select(...)`.
88
- *
89
- * @param keys The list of domain ids of objects to select.
90
- * @param addToSelection If true it adds to the current selection rather than replacing it.
91
- */
92
- select(keys: string[], addToSelection?: boolean): void;
93
- /**
94
- * Removes objects from selection.
95
- *
96
- * @param keys The list of domain ids of objects to deselect.
97
- */
98
- deselect(keys: string[]): void;
99
- /**
100
- * Synchronizes the selection state with the view
101
- */
102
- syncView(): void;
103
- /**
104
- * Reads the attribute value to get the `key` property.
105
- * @param selectable
106
- * @returns The domain id of the object or `null` when not found
107
- */
108
- readKey(selectable: Element): string | null;
109
- /**
110
- * Finds a workspace element that has the domain id.
111
- * @param id Target domain id
112
- */
113
- getDomainTarget(id: string): Element | null;
114
- /**
115
- * Finds a workspace element that has the domain id and is selectable.
116
- * @param id Target domain id
117
- */
118
- getSelectableDomainTarget(id: string): Element | null;
119
- [clickHandler](e: PointerEvent): void;
120
- /**
121
- * Observe items change in the element's light DOM
122
- * @returns The observer handler
123
- */
124
- [observeItems](): MutationObserver;
125
- /**
126
- * Processes mutations in the workspace and manages selection state.
127
- * @param mutationsList List of mutations.
128
- */
129
- [mutationHandler](mutationsList: MutationRecord[]): void;
130
- /**
131
- * Processes added to the canvas elements.
132
- * @param nodes The list of added nodes
133
- */
134
- [processAddedNodes](nodes: NodeList): void;
135
- /**
136
- * Processes removed from the canvas elements.
137
- * @param nodes The list of removed nodes
138
- */
139
- [processRemovedNodes](nodes: NodeList): void;
140
- /**
141
- * Processes changed attribute on any element in the canvas
142
- * @param node Changed element
143
- * @param prop Changed property
144
- */
145
- [processAttributeChanged](node: Element, prop: string): void;
146
- /**
147
- * Sets selection to the elements that are related to the `selectable` element.
148
- *
149
- * A related element is an element that is an association target to the `selectable`
150
- * ot the `selectable` has `parent` attribute.
151
- *
152
- * The related are not added to the `selectedItems` set and does not have `selected` attribute.
153
- * They are marked with `second-selected` attribute.
154
- */
155
- [propagateSelection](selectable: Element): void;
156
- /**
157
- * Marks `viz-association` and referenced targets of the `selectable` as a secondary selection.
158
- */
159
- [selectAssociations](selectable: Element): void;
160
- /**
161
- * Similar to `[selectAssociations]()` but it selects associations where
162
- * the `selectable` is the target.
163
- */
164
- [selectReverseAssociations](selectable: Element): void;
165
- /**
166
- * Removes secondary selection from the elements that are related to the `selectable` element.
167
- *
168
- * A related element is an element that is an association target to the `selectable`
169
- * ot the `selectable` has `parent` attribute.
170
- */
171
- [propagateDeselection](selectable: Element): void;
172
- /**
173
- * Removes secondary selection mark from `viz-association`
174
- */
175
- [deselectAssociations](selectable: Element): void;
176
- /**
177
- * Similar to `[selectAssociation]()` but it selects associations where
178
- * the `selectable` is the target.
179
- */
180
- [deselectReverseAssociations](selectable: Element): void;
181
- [notifyChanged](): void;
182
- }
183
- //# sourceMappingURL=SelectionManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectionManager.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/SelectionManager.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,oCAA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