@jinntec/fore 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/fore-dev.js +2 -2
- package/dist/fore-dev.js.map +1 -1
- package/dist/fore.js +2 -2
- package/dist/fore.js.map +1 -1
- package/index.js +4 -2
- package/package.json +10 -38
- package/resources/fore.css +263 -262
- package/resources/vars.css +8 -0
- package/src/DependencyNotifyingDomFacade.js +1 -0
- package/src/ForeElementMixin.js +243 -228
- package/src/actions/abstract-action.js +407 -398
- package/src/actions/fx-action.js +6 -6
- package/src/actions/fx-append.js +1 -1
- package/src/actions/fx-call.js +63 -62
- package/src/actions/fx-confirm.js +11 -11
- package/src/actions/fx-construct-done.js +4 -4
- package/src/actions/fx-copy.js +36 -36
- package/src/actions/fx-delete.js +77 -79
- package/src/actions/fx-dispatch.js +14 -14
- package/src/actions/fx-hide.js +15 -15
- package/src/actions/fx-insert.js +9 -12
- package/src/actions/fx-insertchild.js +88 -0
- package/src/actions/fx-load.js +188 -185
- package/src/actions/fx-message.js +18 -19
- package/src/actions/fx-refresh.js +10 -10
- package/src/actions/fx-reload.js +16 -14
- package/src/actions/fx-replace.js +0 -1
- package/src/actions/fx-reset.js +31 -31
- package/src/actions/fx-send.js +59 -52
- package/src/actions/fx-setattribute.js +48 -49
- package/src/actions/fx-setfocus.js +54 -58
- package/src/actions/fx-setvalue.js +85 -81
- package/src/actions/fx-show.js +11 -11
- package/src/actions/fx-toggle.js +2 -2
- package/src/actions/fx-toggleboolean.js +38 -39
- package/src/actions/fx-unmodified.js +27 -0
- package/src/actions/fx-update.js +6 -6
- package/src/dep_graph.js +1 -1
- package/src/drawdown.js +23 -30
- package/src/events.js +19 -19
- package/src/fore.js +143 -125
- package/src/functions/common-function.js +24 -25
- package/src/functions/fx-function.js +6 -99
- package/src/functions/fx-functionlib.js +56 -0
- package/src/functions/registerFunction.js +112 -0
- package/src/fx-bind.js +19 -24
- package/src/fx-connection.js +226 -0
- package/src/fx-fore.js +844 -815
- package/src/fx-header.js +4 -4
- package/src/fx-instance.js +25 -29
- package/src/fx-model.js +405 -380
- package/src/fx-submission.js +399 -397
- package/src/fx-var.js +13 -12
- package/src/getInScopeContext.js +102 -89
- package/src/json-util.js +24 -24
- package/src/lab/fore-component.js +48 -52
- package/src/lab/instance-inspector.js +13 -16
- package/src/modelitem.js +48 -10
- package/src/relevance.js +12 -16
- package/src/tools/adi.js +858 -812
- package/src/tools/fx-action-log.js +377 -295
- package/src/tools/fx-devtools.js +210 -210
- package/src/tools/fx-dom-inspector.js +123 -122
- package/src/tools/fx-json-instance.js +262 -253
- package/src/tools/fx-log-item.js +6 -11
- package/src/tools/fx-log-settings.js +358 -301
- package/src/tools/fx-minimap.js +186 -177
- package/src/tools/helpers.js +1 -1
- package/src/ui/abstract-control.js +73 -53
- package/src/ui/fx-case.js +59 -7
- package/src/ui/fx-container.js +13 -14
- package/src/ui/fx-control.js +572 -538
- package/src/ui/fx-dialog.js +3 -3
- package/src/ui/fx-droptarget.js +3 -4
- package/src/ui/fx-group.js +4 -2
- package/src/ui/fx-hint.js +3 -0
- package/src/ui/fx-inspector.js +5 -5
- package/src/ui/fx-items.js +11 -11
- package/src/ui/fx-output.js +10 -12
- package/src/ui/fx-repeat-attributes.js +23 -27
- package/src/ui/fx-repeat.js +347 -344
- package/src/ui/fx-repeatitem.js +75 -68
- package/src/ui/fx-switch.js +39 -14
- package/src/ui/fx-trigger.js +4 -4
- package/src/withDraggability.js +193 -191
- package/src/xpath-evaluation.js +969 -958
- package/src/xpath-util.js +161 -134
|
@@ -1,118 +1,120 @@
|
|
|
1
1
|
import ADI from './adi.js';
|
|
2
2
|
|
|
3
3
|
export class FxDomInspector extends HTMLElement {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.attachShadow({ mode: 'open' });
|
|
7
|
+
this.instanceName = null;
|
|
8
|
+
this.instance = null;
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
this.render();
|
|
13
|
+
if (this.instance) {
|
|
14
|
+
this.shadowRoot.querySelector('#focus-button').style = 'display: none';
|
|
15
|
+
} else {
|
|
16
|
+
this.setupFocusButton();
|
|
18
17
|
}
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
disconnectedCallback(){
|
|
25
|
-
this.adiInstance = null;
|
|
20
|
+
setInstance(instance) {
|
|
21
|
+
this.instance = instance;
|
|
22
|
+
}
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
this.adiInstance = null;
|
|
26
|
+
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
setupFocusButton() {
|
|
29
|
+
let styleBackup = '';
|
|
30
|
+
let focusedElement = null;
|
|
31
|
+
const removeFocus = () => {
|
|
32
|
+
if (styleBackup === '') {
|
|
33
|
+
focusedElement.removeAttribute('style');
|
|
34
|
+
} else {
|
|
35
|
+
focusedElement.setAttribute('style', styleBackup);
|
|
36
|
+
}
|
|
37
|
+
focusedElement = null;
|
|
38
|
+
};
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
const onHover = event => {
|
|
41
|
+
const { target } = event;
|
|
42
|
+
if (event.type === 'mouseover') {
|
|
43
|
+
styleBackup = target.getAttribute('style') || '';
|
|
44
|
+
target.setAttribute('style', `outline: 2px solid blue; ${styleBackup}`);
|
|
45
|
+
focusedElement = target;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (focusedElement) {
|
|
49
|
+
removeFocus();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
const focusButton = this.shadowRoot.querySelector('#focus-button');
|
|
54
|
+
let isFocussing = false;
|
|
55
|
+
const styleElement = window.document.head.appendChild(document.createElement('style'));
|
|
56
|
+
const stopFocussing = () => {
|
|
57
|
+
isFocussing = false;
|
|
58
|
+
window.document.body.removeEventListener('click', listener);
|
|
59
|
+
focusButton.classList.remove('selected-btn');
|
|
60
|
+
styleElement.innerHTML = '';
|
|
61
|
+
document.body.style.cursor = 'auto';
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
window.document.body.removeEventListener('mouseover', onHover);
|
|
64
|
+
window.document.body.removeEventListener('mouseout', onHover);
|
|
65
|
+
if (focusedElement) {
|
|
66
|
+
removeFocus();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const listener = event => {
|
|
70
|
+
stopFocussing();
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
if (event.target !== focusButton) {
|
|
75
|
+
// Do not 'click on the focusbutton. It's a cancel.
|
|
76
|
+
// console.log('done', event.target);
|
|
77
|
+
window.document.dispatchEvent(
|
|
78
|
+
new CustomEvent('log-active-element', { detail: { target: event.target } }),
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const startFocussing = () => {
|
|
83
|
+
isFocussing = true;
|
|
84
|
+
focusButton.classList.add('selected-btn');
|
|
85
|
+
document.body.style.cursor = 'crosshair';
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
window.document.body.removeEventListener('click', listener);
|
|
88
|
+
styleElement.innerHTML =
|
|
89
|
+
'fx-fore::before { color:blue; content: "Sub fore!" } fx-fore {border: solid 1px blue}';
|
|
90
|
+
window.document.body.addEventListener('click', listener);
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
window.document.body.addEventListener('mouseover', onHover);
|
|
93
|
+
window.document.body.addEventListener('mouseout', onHover);
|
|
94
|
+
};
|
|
95
|
+
window.document.addEventListener('keyup', event => {
|
|
96
|
+
if (isFocussing && event.code === 'Escape') {
|
|
97
|
+
stopFocussing();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!isFocussing && event.code === 'KeyI' && event.ctrlKey) {
|
|
101
|
+
startFocussing();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
focusButton.addEventListener('click', clickEvent => {
|
|
105
|
+
if (isFocussing) {
|
|
106
|
+
stopFocussing();
|
|
107
|
+
} else {
|
|
108
|
+
startFocussing();
|
|
109
|
+
}
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
clickEvent.preventDefault();
|
|
112
|
+
clickEvent.stopPropagation();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
render() {
|
|
117
|
+
const style = `
|
|
116
118
|
@import '../../resources/fore.css';
|
|
117
119
|
|
|
118
120
|
:host {
|
|
@@ -566,44 +568,43 @@ export class FxDomInspector extends HTMLElement {
|
|
|
566
568
|
.selected-btn { color: orange }
|
|
567
569
|
`;
|
|
568
570
|
|
|
569
|
-
|
|
571
|
+
const html = `
|
|
570
572
|
<slot name="header"></slot>
|
|
571
573
|
<button id="focus-button">Focus</button>
|
|
572
574
|
<slot></slot>
|
|
573
575
|
`;
|
|
574
576
|
|
|
575
|
-
|
|
577
|
+
this.shadowRoot.innerHTML = `
|
|
576
578
|
<style>
|
|
577
579
|
${style}
|
|
578
580
|
</style>
|
|
579
581
|
${html}
|
|
580
582
|
`;
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
verticalResize(e) {
|
|
588
|
-
if (!this.vertResizing) {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
583
|
+
const inst = this.hasAttribute('instance') ? this.getAttribute('instance') : '#document';
|
|
584
|
+
this.adiInstance = new ADI(
|
|
585
|
+
this.shadowRoot,
|
|
586
|
+
this.hasAttribute('instance') ? this.instance : '#document',
|
|
587
|
+
);
|
|
588
|
+
}
|
|
591
589
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
590
|
+
verticalResize(e) {
|
|
591
|
+
if (!this.vertResizing) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
595
594
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
this.refreshUI();
|
|
600
|
-
this.saveOptions();
|
|
601
|
-
}
|
|
595
|
+
e = e || window.event;
|
|
596
|
+
document.documentElement.style.cursor = 'e-resize';
|
|
597
|
+
const nWidth = this.options.width + this.xPos - e.clientX;
|
|
602
598
|
|
|
599
|
+
if (nWidth >= this.options.minWidth) {
|
|
600
|
+
this.options.width = nWidth;
|
|
601
|
+
this.xPos = e.clientX;
|
|
602
|
+
this.refreshUI();
|
|
603
|
+
this.saveOptions();
|
|
603
604
|
}
|
|
604
|
-
|
|
605
|
+
}
|
|
605
606
|
}
|
|
606
607
|
|
|
607
608
|
if (!customElements.get('fx-dom-inspector')) {
|
|
608
|
-
|
|
609
|
+
customElements.define('fx-dom-inspector', FxDomInspector);
|
|
609
610
|
}
|