ontotext-yasgui-web-component 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/dist/cjs/index-c487dc05.js +1152 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/cjs/ontotext-yasgui-web-component.cjs.js +19 -0
  7. package/dist/cjs/ontotext-yasgui.cjs.entry.js +391 -0
  8. package/dist/collection/collection-manifest.json +12 -0
  9. package/dist/collection/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.css +2361 -0
  10. package/dist/collection/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.js +152 -0
  11. package/dist/collection/components/yasgui/yasgui-script.js +4 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/js/main.js +8 -0
  14. package/dist/collection/models/ontotext-yasgui.js +41 -0
  15. package/dist/collection/models/yasgui-configuration.js +11 -0
  16. package/dist/collection/pages/default-view/main.js +8 -0
  17. package/dist/collection/pages/view-configurations/main.js +31 -0
  18. package/dist/collection/pages/view-modes/main.js +18 -0
  19. package/dist/collection/services/yasgui/configuration/configurator.js +1 -0
  20. package/dist/collection/services/yasgui/configuration/yasgui-configuration-builder.js +28 -0
  21. package/dist/collection/services/yasgui/configuration/yasgui-configurator.js +45 -0
  22. package/dist/collection/services/yasgui/configuration/yasqe-configurator.js +17 -0
  23. package/dist/collection/services/yasgui/configuration/yasr-configurator.js +12 -0
  24. package/dist/collection/services/yasgui/yasgui-builder.js +26 -0
  25. package/dist/components/index.d.ts +22 -0
  26. package/dist/components/index.js +2 -0
  27. package/dist/components/ontotext-yasgui.d.ts +11 -0
  28. package/dist/components/ontotext-yasgui.js +407 -0
  29. package/dist/esm/index-5e3f8118.js +1124 -0
  30. package/dist/esm/index.js +1 -0
  31. package/dist/esm/loader.js +17 -0
  32. package/dist/esm/ontotext-yasgui-web-component.js +17 -0
  33. package/dist/esm/ontotext-yasgui.entry.js +387 -0
  34. package/dist/esm/polyfills/core-js.js +11 -0
  35. package/dist/esm/polyfills/css-shim.js +1 -0
  36. package/dist/esm/polyfills/dom.js +79 -0
  37. package/dist/esm/polyfills/es5-html-element.js +1 -0
  38. package/dist/esm/polyfills/index.js +34 -0
  39. package/dist/esm/polyfills/system.js +6 -0
  40. package/dist/index.cjs.js +1 -0
  41. package/dist/index.js +1 -0
  42. package/dist/ontotext-yasgui-web-component/index.esm.js +0 -0
  43. package/dist/ontotext-yasgui-web-component/ontotext-yasgui-web-component.esm.js +1 -0
  44. package/dist/ontotext-yasgui-web-component/p-498af5d3.js +2 -0
  45. package/dist/ontotext-yasgui-web-component/p-88daf135.entry.js +2 -0
  46. package/dist/types/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.d.ts +21 -0
  47. package/dist/types/components.d.ts +46 -0
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/types/models/ontotext-yasgui.d.ts +17 -0
  50. package/dist/types/models/yasgui-configuration.d.ts +40 -0
  51. package/dist/types/services/yasgui/configuration/configurator.d.ts +15 -0
  52. package/dist/types/services/yasgui/configuration/yasgui-configuration-builder.d.ts +18 -0
  53. package/dist/types/services/yasgui/configuration/yasgui-configurator.d.ts +14 -0
  54. package/dist/types/services/yasgui/configuration/yasqe-configurator.d.ts +8 -0
  55. package/dist/types/services/yasgui/configuration/yasr-configurator.d.ts +8 -0
  56. package/dist/types/services/yasgui/yasgui-builder.d.ts +20 -0
  57. package/dist/types/stencil-public-runtime.d.ts +1581 -0
  58. package/loader/cdn.js +3 -0
  59. package/loader/index.cjs.js +3 -0
  60. package/loader/index.d.ts +12 -0
  61. package/loader/index.es2017.js +3 -0
  62. package/loader/index.js +4 -0
  63. package/loader/package.json +11 -0
  64. package/package.json +41 -0
@@ -0,0 +1,152 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import { YASGUI_MIN_SCRIPT } from '../yasgui/yasgui-script';
3
+ import { YasguiBuilder } from '../../services/yasgui/yasgui-builder';
4
+ export class OntotextYasguiWebComponent {
5
+ constructor() {
6
+ this.config = undefined;
7
+ this.yasguiBuilder = YasguiBuilder;
8
+ }
9
+ componentWillLoad() {
10
+ // @ts-ignore
11
+ if (!window.Yasgui) {
12
+ YASGUI_MIN_SCRIPT();
13
+ }
14
+ }
15
+ componentDidLoad() {
16
+ // As documentation said "The @Watch() decorator does not fire when a component initially loads."
17
+ // yasgui instance will not be created if we set configuration when component is loaded, which
18
+ // will be most case of the component usage. So we call the method manually when component is
19
+ // loaded. More info https://github.com/TriplyDB/Yasgui/issues/143
20
+ this.init(this.config);
21
+ }
22
+ onWindowResize(event) {
23
+ // TODO redraw yasgui if needed. This event will be unsubscribed automatically when component is detached from the DOM.
24
+ console.log(event);
25
+ }
26
+ configurationChanged(newConfig) {
27
+ this.init(newConfig);
28
+ }
29
+ setQuery(query) {
30
+ this.yasgui.setQuery(query);
31
+ return Promise.resolve();
32
+ }
33
+ disconnectedCallback() {
34
+ this.destroy();
35
+ }
36
+ render() {
37
+ return (h(Host, null));
38
+ }
39
+ init(config) {
40
+ this.destroy();
41
+ if (!config) {
42
+ return;
43
+ }
44
+ // @ts-ignore
45
+ if (window.Yasgui) {
46
+ this.yasgui = this.yasguiBuilder.build(this.el, config);
47
+ this.addOnQueryListener();
48
+ }
49
+ }
50
+ addOnQueryListener() {
51
+ this.yasgui.addYasqeListener('query', () => {
52
+ this.queryExecuted.emit(this.yasgui.getQuery());
53
+ });
54
+ }
55
+ destroy() {
56
+ if (this.yasgui) {
57
+ this.yasgui.destroy();
58
+ }
59
+ }
60
+ static get is() { return "ontotext-yasgui"; }
61
+ static get originalStyleUrls() {
62
+ return {
63
+ "$": ["ontotext-yasgui-web-component.scss"]
64
+ };
65
+ }
66
+ static get styleUrls() {
67
+ return {
68
+ "$": ["ontotext-yasgui-web-component.css"]
69
+ };
70
+ }
71
+ static get properties() {
72
+ return {
73
+ "config": {
74
+ "type": "unknown",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "YasguiConfiguration",
78
+ "resolved": "YasguiConfiguration",
79
+ "references": {
80
+ "YasguiConfiguration": {
81
+ "location": "import",
82
+ "path": "../../models/yasgui-configuration"
83
+ }
84
+ }
85
+ },
86
+ "required": false,
87
+ "optional": false,
88
+ "docs": {
89
+ "tags": [],
90
+ "text": ""
91
+ }
92
+ }
93
+ };
94
+ }
95
+ static get events() {
96
+ return [{
97
+ "method": "queryExecuted",
98
+ "name": "queryExecuted",
99
+ "bubbles": true,
100
+ "cancelable": true,
101
+ "composed": true,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": ""
105
+ },
106
+ "complexType": {
107
+ "original": "any",
108
+ "resolved": "any",
109
+ "references": {}
110
+ }
111
+ }];
112
+ }
113
+ static get methods() {
114
+ return {
115
+ "setQuery": {
116
+ "complexType": {
117
+ "signature": "(query: string) => Promise<void>",
118
+ "parameters": [{
119
+ "tags": [],
120
+ "text": ""
121
+ }],
122
+ "references": {
123
+ "Promise": {
124
+ "location": "global"
125
+ }
126
+ },
127
+ "return": "Promise<void>"
128
+ },
129
+ "docs": {
130
+ "text": "",
131
+ "tags": []
132
+ }
133
+ }
134
+ };
135
+ }
136
+ static get elementRef() { return "el"; }
137
+ static get watchers() {
138
+ return [{
139
+ "propName": "config",
140
+ "methodName": "configurationChanged"
141
+ }];
142
+ }
143
+ static get listeners() {
144
+ return [{
145
+ "name": "resize",
146
+ "method": "onWindowResize",
147
+ "target": "window",
148
+ "capture": false,
149
+ "passive": true
150
+ }];
151
+ }
152
+ }