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.
- package/LICENSE +21 -0
- package/README.md +72 -0
- package/dist/cjs/index-c487dc05.js +1152 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/ontotext-yasgui-web-component.cjs.js +19 -0
- package/dist/cjs/ontotext-yasgui.cjs.entry.js +391 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.css +2361 -0
- package/dist/collection/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.js +152 -0
- package/dist/collection/components/yasgui/yasgui-script.js +4 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/js/main.js +8 -0
- package/dist/collection/models/ontotext-yasgui.js +41 -0
- package/dist/collection/models/yasgui-configuration.js +11 -0
- package/dist/collection/pages/default-view/main.js +8 -0
- package/dist/collection/pages/view-configurations/main.js +31 -0
- package/dist/collection/pages/view-modes/main.js +18 -0
- package/dist/collection/services/yasgui/configuration/configurator.js +1 -0
- package/dist/collection/services/yasgui/configuration/yasgui-configuration-builder.js +28 -0
- package/dist/collection/services/yasgui/configuration/yasgui-configurator.js +45 -0
- package/dist/collection/services/yasgui/configuration/yasqe-configurator.js +17 -0
- package/dist/collection/services/yasgui/configuration/yasr-configurator.js +12 -0
- package/dist/collection/services/yasgui/yasgui-builder.js +26 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.js +2 -0
- package/dist/components/ontotext-yasgui.d.ts +11 -0
- package/dist/components/ontotext-yasgui.js +407 -0
- package/dist/esm/index-5e3f8118.js +1124 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/ontotext-yasgui-web-component.js +17 -0
- package/dist/esm/ontotext-yasgui.entry.js +387 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/ontotext-yasgui-web-component/index.esm.js +0 -0
- package/dist/ontotext-yasgui-web-component/ontotext-yasgui-web-component.esm.js +1 -0
- package/dist/ontotext-yasgui-web-component/p-498af5d3.js +2 -0
- package/dist/ontotext-yasgui-web-component/p-88daf135.entry.js +2 -0
- package/dist/types/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.d.ts +21 -0
- package/dist/types/components.d.ts +46 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/ontotext-yasgui.d.ts +17 -0
- package/dist/types/models/yasgui-configuration.d.ts +40 -0
- package/dist/types/services/yasgui/configuration/configurator.d.ts +15 -0
- package/dist/types/services/yasgui/configuration/yasgui-configuration-builder.d.ts +18 -0
- package/dist/types/services/yasgui/configuration/yasgui-configurator.d.ts +14 -0
- package/dist/types/services/yasgui/configuration/yasqe-configurator.d.ts +8 -0
- package/dist/types/services/yasgui/configuration/yasr-configurator.d.ts +8 -0
- package/dist/types/services/yasgui/yasgui-builder.d.ts +20 -0
- package/dist/types/stencil-public-runtime.d.ts +1581 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +41 -0
package/dist/collection/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.js
ADDED
|
@@ -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
|
+
}
|