@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.
Files changed (88) hide show
  1. package/README.md +2 -2
  2. package/dist/fore-dev.js +2 -2
  3. package/dist/fore-dev.js.map +1 -1
  4. package/dist/fore.js +2 -2
  5. package/dist/fore.js.map +1 -1
  6. package/index.js +4 -2
  7. package/package.json +10 -38
  8. package/resources/fore.css +263 -262
  9. package/resources/vars.css +8 -0
  10. package/src/DependencyNotifyingDomFacade.js +1 -0
  11. package/src/ForeElementMixin.js +243 -228
  12. package/src/actions/abstract-action.js +407 -398
  13. package/src/actions/fx-action.js +6 -6
  14. package/src/actions/fx-append.js +1 -1
  15. package/src/actions/fx-call.js +63 -62
  16. package/src/actions/fx-confirm.js +11 -11
  17. package/src/actions/fx-construct-done.js +4 -4
  18. package/src/actions/fx-copy.js +36 -36
  19. package/src/actions/fx-delete.js +77 -79
  20. package/src/actions/fx-dispatch.js +14 -14
  21. package/src/actions/fx-hide.js +15 -15
  22. package/src/actions/fx-insert.js +9 -12
  23. package/src/actions/fx-insertchild.js +88 -0
  24. package/src/actions/fx-load.js +188 -185
  25. package/src/actions/fx-message.js +18 -19
  26. package/src/actions/fx-refresh.js +10 -10
  27. package/src/actions/fx-reload.js +16 -14
  28. package/src/actions/fx-replace.js +0 -1
  29. package/src/actions/fx-reset.js +31 -31
  30. package/src/actions/fx-send.js +59 -52
  31. package/src/actions/fx-setattribute.js +48 -49
  32. package/src/actions/fx-setfocus.js +54 -58
  33. package/src/actions/fx-setvalue.js +85 -81
  34. package/src/actions/fx-show.js +11 -11
  35. package/src/actions/fx-toggle.js +2 -2
  36. package/src/actions/fx-toggleboolean.js +38 -39
  37. package/src/actions/fx-unmodified.js +27 -0
  38. package/src/actions/fx-update.js +6 -6
  39. package/src/dep_graph.js +1 -1
  40. package/src/drawdown.js +23 -30
  41. package/src/events.js +19 -19
  42. package/src/fore.js +143 -125
  43. package/src/functions/common-function.js +24 -25
  44. package/src/functions/fx-function.js +6 -99
  45. package/src/functions/fx-functionlib.js +56 -0
  46. package/src/functions/registerFunction.js +112 -0
  47. package/src/fx-bind.js +19 -24
  48. package/src/fx-connection.js +226 -0
  49. package/src/fx-fore.js +844 -815
  50. package/src/fx-header.js +4 -4
  51. package/src/fx-instance.js +25 -29
  52. package/src/fx-model.js +405 -380
  53. package/src/fx-submission.js +399 -397
  54. package/src/fx-var.js +13 -12
  55. package/src/getInScopeContext.js +102 -89
  56. package/src/json-util.js +24 -24
  57. package/src/lab/fore-component.js +48 -52
  58. package/src/lab/instance-inspector.js +13 -16
  59. package/src/modelitem.js +48 -10
  60. package/src/relevance.js +12 -16
  61. package/src/tools/adi.js +858 -812
  62. package/src/tools/fx-action-log.js +377 -295
  63. package/src/tools/fx-devtools.js +210 -210
  64. package/src/tools/fx-dom-inspector.js +123 -122
  65. package/src/tools/fx-json-instance.js +262 -253
  66. package/src/tools/fx-log-item.js +6 -11
  67. package/src/tools/fx-log-settings.js +358 -301
  68. package/src/tools/fx-minimap.js +186 -177
  69. package/src/tools/helpers.js +1 -1
  70. package/src/ui/abstract-control.js +73 -53
  71. package/src/ui/fx-case.js +59 -7
  72. package/src/ui/fx-container.js +13 -14
  73. package/src/ui/fx-control.js +572 -538
  74. package/src/ui/fx-dialog.js +3 -3
  75. package/src/ui/fx-droptarget.js +3 -4
  76. package/src/ui/fx-group.js +4 -2
  77. package/src/ui/fx-hint.js +3 -0
  78. package/src/ui/fx-inspector.js +5 -5
  79. package/src/ui/fx-items.js +11 -11
  80. package/src/ui/fx-output.js +10 -12
  81. package/src/ui/fx-repeat-attributes.js +23 -27
  82. package/src/ui/fx-repeat.js +347 -344
  83. package/src/ui/fx-repeatitem.js +75 -68
  84. package/src/ui/fx-switch.js +39 -14
  85. package/src/ui/fx-trigger.js +4 -4
  86. package/src/withDraggability.js +193 -191
  87. package/src/xpath-evaluation.js +969 -958
  88. package/src/xpath-util.js +161 -134
@@ -0,0 +1,88 @@
1
+ import { AbstractAction } from './abstract-action.js';
2
+ import getInScopeContext from '../getInScopeContext.js';
3
+ import {
4
+ evaluateXPathToNodes,
5
+ evaluateXPathToFirstNode,
6
+ evaluateXPathToNumber,
7
+ } from '../xpath-evaluation.js';
8
+ import { XPathUtil } from '../xpath-util';
9
+ import { Fore } from '../fore.js';
10
+
11
+ /**
12
+ * `fx-insert`
13
+ * inserts nodes into data instances
14
+ *
15
+ * <fx-insertChild parent="instance('i-stopwatches')/stopwatches"
16
+ * child="watch"
17
+ * template="instance('vars')/templates/watch"
18
+ * at="1"
19
+ * position="before"></fx-insertChild>
20
+ * @customElement
21
+ */
22
+ export class FxInsertchild extends AbstractAction {
23
+ static get properties() {
24
+ return {
25
+ ...super.properties,
26
+ at: {
27
+ type: Number,
28
+ },
29
+ child: {
30
+ type: String,
31
+ },
32
+ parent: {
33
+ type: String,
34
+ },
35
+ origin: {
36
+ type: Object,
37
+ },
38
+ keepValues: {
39
+ type: Boolean,
40
+ },
41
+ };
42
+ }
43
+
44
+ constructor() {
45
+ super();
46
+ this.attachShadow({ mode: 'open' });
47
+ }
48
+
49
+ connectedCallback() {
50
+ if (super.connectedCallback) {
51
+ super.connectedCallback();
52
+ }
53
+ this.at = Number(this.hasAttribute('at') ? this.getAttribute('at') : 1); // default: size of nodeset, determined later
54
+ this.child = this.getAttribute('child');
55
+ this.parent = this.getAttribute('parent');
56
+ this.position = this.hasAttribute('position') ? this.getAttribute('position') : 'after';
57
+ this.origin = this.hasAttribute('origin') ? this.getAttribute('origin') : null; // last item of context seq
58
+ this.keepValues = !!this.hasAttribute('keep-values');
59
+
60
+ const style = `
61
+ :host{
62
+ display:none;
63
+ }
64
+ `;
65
+ this.shadowRoot.innerHTML = `
66
+ <style>
67
+ ${style}
68
+ </style>
69
+ <fx-insert context="${this.parent}"
70
+ ref="${this.ref}"
71
+ origin="${this.origin}"
72
+ at="${this.at}"
73
+ position="${this.position}"></fx-insert>
74
+
75
+ `;
76
+ }
77
+
78
+ async perform() {
79
+ super.perform();
80
+ const insert = this.shadowRoot.querySelector('fx-insert');
81
+ await insert.perform();
82
+ this.needsUpdate = true;
83
+ }
84
+ }
85
+
86
+ if (!customElements.get('fx-insertChild')) {
87
+ window.customElements.define('fx-insertchild', FxInsertchild);
88
+ }
@@ -1,8 +1,8 @@
1
- import {AbstractAction} from './abstract-action.js';
2
- import {evaluateXPathToString, resolveId} from "../xpath-evaluation.js";
1
+ import { AbstractAction } from './abstract-action.js';
2
+ import { evaluateXPathToString, resolveId } from '../xpath-evaluation.js';
3
3
  import getInScopeContext from '../getInScopeContext.js';
4
- import {XPathUtil} from "../xpath-util.js";
5
- import {Fore} from "../fore.js";
4
+ import { XPathUtil } from '../xpath-util.js';
5
+ import { Fore } from '../fore.js';
6
6
 
7
7
  /**
8
8
  * `fx-load`
@@ -11,214 +11,217 @@ import {Fore} from "../fore.js";
11
11
  *
12
12
  */
13
13
  class FxLoad extends AbstractAction {
14
-
15
- static get properties() {
16
- return {
17
- ...super.properties,
18
- attachTo: {
19
- type: String
20
- },
21
- url: {
22
- type: String
23
- }
24
- }
25
- }
26
-
27
- constructor() {
28
- super();
29
- this.attachShadow({mode: 'open'});
30
- this.url='';
31
- }
32
-
33
- connectedCallback() {
34
- super.connectedCallback();
35
- this.attachTo = this.hasAttribute('attach-to') ? this.getAttribute('attach-to') : '_self';
36
-
37
- // Add a 'doneEvent' to block the action chain untill the event fired on the element we're
38
- // loading something into.
39
- this.awaitEvent = this.hasAttribute('await') ? this.getAttribute('await') : '';
40
- this.url = this.hasAttribute('url') ? this.getAttribute('url') : '';
41
- const style = `
14
+ static get properties() {
15
+ return {
16
+ ...super.properties,
17
+ attachTo: {
18
+ type: String,
19
+ },
20
+ url: {
21
+ type: String,
22
+ },
23
+ };
24
+ }
25
+
26
+ constructor() {
27
+ super();
28
+ this.attachShadow({ mode: 'open' });
29
+ this.url = '';
30
+ }
31
+
32
+ connectedCallback() {
33
+ super.connectedCallback();
34
+ this.attachTo = this.hasAttribute('attach-to') ? this.getAttribute('attach-to') : '_self';
35
+
36
+ // Add a 'doneEvent' to block the action chain untill the event fired on the element we're
37
+ // loading something into.
38
+ this.awaitEvent = this.hasAttribute('await') ? this.getAttribute('await') : '';
39
+ this.url = this.hasAttribute('url') ? this.getAttribute('url') : '';
40
+ const style = `
42
41
  :host{
43
42
  display:none;
44
43
  }
45
44
  `;
46
- this.shadowRoot.innerHTML = `
45
+ this.shadowRoot.innerHTML = `
47
46
  <style>
48
47
  ${style}
49
48
  </style>
50
49
  ${this.renderHTML()}`;
51
- }
50
+ }
52
51
 
53
- disconnectedCallback() {
54
- // super.disconnectedCallback();
55
- this.targetElement.removeEventListener(this.event, e => this.execute(e));
56
- }
52
+ disconnectedCallback() {
53
+ // super.disconnectedCallback();
54
+ this.targetElement.removeEventListener(this.event, e => this.execute(e));
55
+ }
57
56
 
58
- // eslint-disable-next-line class-methods-use-this
59
- renderHTML() {
60
- return `
57
+ // eslint-disable-next-line class-methods-use-this
58
+ renderHTML() {
59
+ return `
61
60
  <slot></slot>
62
61
  `;
63
- }
64
-
65
- async perform() {
66
- await super.perform();
67
-
68
- // this.getOwnerForm().evaluateTemplateExpression(this.urlContent, this);
69
-
70
- const template = this.querySelector('template');
71
- if(template){
72
- const clone = template.content.cloneNode(true);
73
- const content = document.importNode(clone, true);
74
- // this._attachToElement(content);
75
- if (this.attachTo.startsWith('#')) {
76
- const targetId = this.attachTo.substring(1);
77
- const resolved = resolveId(targetId, this);
78
- // remove all children
79
- while (resolved.firstChild) {
80
- resolved.removeChild(resolved.firstChild);
81
- }
82
- if (this.awaitEvent) {
83
- let resolveEvent;
84
- const waitForEvent = new Promise((resolve) => {
85
- resolveEvent = resolve;
86
- });
87
- const eventListener = () => {
88
- resolveEvent();
89
- resolved.removeEventListener(this.awaitEvent, eventListener);
90
- };
91
-
92
- resolved.appendChild(content);
93
- resolved.addEventListener(this.awaitEvent, eventListener);
94
-
95
- await waitForEvent;
96
-
97
- this.needsUpdate = true;
98
-
99
- Fore.dispatch(this, 'loaded', {attachPoint:this.attachTo, content});
100
- return;
101
- }
102
-
103
- resolved.appendChild(content);
104
-
105
- this.needsUpdate = true;
106
- }
107
- Fore.dispatch(this, 'loaded', {});
108
- return;
62
+ }
63
+
64
+ async perform() {
65
+ await super.perform();
66
+
67
+ // this.getOwnerForm().evaluateTemplateExpression(this.urlContent, this);
68
+
69
+ const template = this.querySelector('template');
70
+ if (template) {
71
+ const clone = template.content.cloneNode(true);
72
+ const content = document.importNode(clone, true);
73
+ // this._attachToElement(content);
74
+ if (this.attachTo.startsWith('#')) {
75
+ const targetId = this.attachTo.substring(1);
76
+ const resolved = resolveId(targetId, this);
77
+ // remove all children
78
+ while (resolved.firstChild) {
79
+ resolved.removeChild(resolved.firstChild);
109
80
  }
81
+ if (this.awaitEvent) {
82
+ let resolveEvent;
83
+ const waitForEvent = new Promise(resolve => {
84
+ resolveEvent = resolve;
85
+ });
86
+ const eventListener = () => {
87
+ resolveEvent();
88
+ resolved.removeEventListener(this.awaitEvent, eventListener);
89
+ };
110
90
 
111
- if(!this.url){
112
- // for authoring errors we log errors directly to DOM
113
-
114
- this.dispatchEvent(
115
- new CustomEvent('error', {
116
- composed: false,
117
- bubbles: true,
118
- cancelable:true,
119
- detail: {
120
- origin:this,
121
- message: `neither template element nor Url was specified.`,
122
- level:'Error'},
123
- }),
124
- );
125
- return;
126
- }
127
- const resolvedUrl = this.evaluateAttributeTemplateExpression(this.url,this);
128
- if (this.attachTo === '_blank') {
129
- window.open(this.url);
130
- }
91
+ resolved.appendChild(content);
92
+ resolved.addEventListener(this.awaitEvent, eventListener);
131
93
 
132
- if (this.attachTo === '_self') {
133
- window.location.href = this.url;
134
- }
94
+ await waitForEvent;
135
95
 
136
- try {
137
- const response = await fetch(resolvedUrl, {
138
- method: 'GET',
139
- mode: 'cors',
140
- credentials: 'same-origin',
141
- headers: {
142
- 'Content-Type': "text/html",
143
- },
144
- });
145
- const data = await response.text();
146
- // console.log('data loaded: ', data);
147
- // const data = Fore.loadHtml(resolvedUrl);
148
-
149
- // todo: if data contain '<template' element as first child instanciate and insert it
150
- if (!this.attachTo) {
151
- this.innerHtml = data;
152
- }
153
- this._attachToElement(data);
154
- Fore.dispatch(this, 'loaded', {url: this.url})
155
- } catch (error) {
156
- throw new Error(`failed loading data ${error}`);
96
+ this.needsUpdate = true;
97
+
98
+ Fore.dispatch(this, 'loaded', { attachPoint: this.attachTo, content });
99
+ return;
157
100
  }
101
+
102
+ resolved.appendChild(content);
103
+
104
+ this.needsUpdate = true;
105
+ }
106
+ Fore.dispatch(this, 'loaded', {});
107
+ return;
158
108
  }
159
109
 
160
- _attachToElement(content){
161
- let effectiveContent;
162
- if(content.nodeType){
163
- effectiveContent = content
164
- }else{
165
- try{
166
- effectiveContent = new DOMParser().parseFromString(content, 'text/html').firstElementChild;
167
- }catch (e) {
168
- Fore.dispatch(this,'error',{message:'parsing of content as HTML failed'})
169
- }
170
- }
110
+ if (!this.url) {
111
+ // for authoring errors we log errors directly to DOM
112
+
113
+ this.dispatchEvent(
114
+ new CustomEvent('error', {
115
+ composed: false,
116
+ bubbles: true,
117
+ cancelable: true,
118
+ detail: {
119
+ origin: this,
120
+ message: 'neither template element nor Url was specified.',
121
+ level: 'Error',
122
+ },
123
+ }),
124
+ );
125
+ return;
126
+ }
127
+ const resolvedUrl = this.evaluateAttributeTemplateExpression(this.url, this);
128
+ if (this.attachTo === '_blank') {
129
+ window.open(this.url);
130
+ }
171
131
 
172
- if(!(this.attachTo.startsWith('_')||this.attachTo.startsWith('#'))){
173
- Fore.dispatch(this,'error',{message:'valid values for "attach-to" start with "_" or "#"'});
174
- }
132
+ if (this.attachTo === '_self') {
133
+ window.location.href = this.url;
134
+ }
175
135
 
176
- if (this.attachTo.startsWith('#')) {
177
- const targetId = this.attachTo.substring(1);
178
- const resolved = resolveId(targetId, this);
179
- resolved.innerHTML = '';
180
- // resolved.innerHTML = effectiveContent;
181
- if(effectiveContent.querySelector('fx-fore')){
182
- resolved.append(effectiveContent.querySelector('fx-fore').cloneNode(true));
183
- return;
184
- }
185
- const body = effectiveContent.querySelector('body').cloneNode(true);
186
- resolved.appendChild( body.firstElementChild);
187
- }
136
+ try {
137
+ const response = await fetch(resolvedUrl, {
138
+ method: 'GET',
139
+ mode: 'cors',
140
+ credentials: 'same-origin',
141
+ headers: {
142
+ 'Content-Type': 'text/html',
143
+ },
144
+ });
145
+ const data = await response.text();
146
+ // console.log('data loaded: ', data);
147
+ // const data = Fore.loadHtml(resolvedUrl);
148
+
149
+ // todo: if data contain '<template' element as first child instanciate and insert it
150
+ if (!this.attachTo) {
151
+ this.innerHtml = data;
152
+ }
153
+ this._attachToElement(data);
154
+ Fore.dispatch(this, 'loaded', { url: this.url });
155
+ } catch (error) {
156
+ throw new Error(`failed loading data ${error}`);
157
+ }
158
+ }
159
+
160
+ _attachToElement(content) {
161
+ let effectiveContent;
162
+ if (content.nodeType) {
163
+ effectiveContent = content;
164
+ } else {
165
+ try {
166
+ effectiveContent = new DOMParser().parseFromString(content, 'text/html').firstElementChild;
167
+ } catch (e) {
168
+ Fore.dispatch(this, 'error', { message: 'parsing of content as HTML failed' });
169
+ }
188
170
  }
189
171
 
190
- _evaluateUrlExpression() {
191
- const url = this.getAttribute('url');
192
- if (!url) {
193
- throw new Error('url not specified');
194
- }
172
+ if (!(this.attachTo.startsWith('_') || this.attachTo.startsWith('#'))) {
173
+ Fore.dispatch(this, 'error', {
174
+ message: 'valid values for "attach-to" start with "_" or "#"',
175
+ });
176
+ }
195
177
 
196
- const replaced = url.replace(/{[^}]*}/g, match => {
197
- if (match === '{}') return match;
198
- const naked = match.substring(1, match.length - 1);
199
- const inscope = getInScopeContext(this, naked);
200
- if (!inscope) {
201
- console.warn('no inscope context for ', this);
202
- return match;
203
- }
204
- // Templates are special: they use the namespace configuration from the place where they are
205
- // being defined
206
- const instanceId = XPathUtil.getInstanceId(naked);
207
-
208
- // If there is an instance referred
209
- const inst = instanceId ? this.getModel().getInstance(instanceId) : this.getModel().getDefaultInstance();
210
- try {
211
- return evaluateXPathToString(naked, inscope, this, null, inst);
212
- } catch (error) {
213
- console.warn('ignoring unparseable url', error);
214
- return match;
215
- }
216
- });
217
- return replaced;
178
+ if (this.attachTo.startsWith('#')) {
179
+ const targetId = this.attachTo.substring(1);
180
+ const resolved = resolveId(targetId, this);
181
+ resolved.innerHTML = '';
182
+ // resolved.innerHTML = effectiveContent;
183
+ if (effectiveContent.querySelector('fx-fore')) {
184
+ resolved.append(effectiveContent.querySelector('fx-fore').cloneNode(true));
185
+ return;
186
+ }
187
+ const body = effectiveContent.querySelector('body').cloneNode(true);
188
+ resolved.appendChild(body.firstElementChild);
189
+ }
190
+ }
191
+
192
+ _evaluateUrlExpression() {
193
+ const url = this.getAttribute('url');
194
+ if (!url) {
195
+ throw new Error('url not specified');
218
196
  }
219
197
 
198
+ const replaced = url.replace(/{[^}]*}/g, match => {
199
+ if (match === '{}') return match;
200
+ const naked = match.substring(1, match.length - 1);
201
+ const inscope = getInScopeContext(this, naked);
202
+ if (!inscope) {
203
+ console.warn('no inscope context for ', this);
204
+ return match;
205
+ }
206
+ // Templates are special: they use the namespace configuration from the place where they are
207
+ // being defined
208
+ const instanceId = XPathUtil.getInstanceId(naked);
209
+
210
+ // If there is an instance referred
211
+ const inst = instanceId
212
+ ? this.getModel().getInstance(instanceId)
213
+ : this.getModel().getDefaultInstance();
214
+ try {
215
+ return evaluateXPathToString(naked, inscope, this, null, inst);
216
+ } catch (error) {
217
+ console.warn('ignoring unparseable url', error);
218
+ return match;
219
+ }
220
+ });
221
+ return replaced;
222
+ }
220
223
  }
221
224
 
222
225
  if (!customElements.get('fx-load')) {
223
- window.customElements.define('fx-load', FxLoad);
226
+ window.customElements.define('fx-load', FxLoad);
224
227
  }
@@ -1,6 +1,6 @@
1
1
  import { AbstractAction } from './abstract-action.js';
2
- import {evaluateXPathToString} from "../xpath-evaluation.js";
3
- import {Fore} from "../fore.js";
2
+ import { evaluateXPathToString } from '../xpath-evaluation.js';
3
+ import { Fore } from '../fore.js';
4
4
  import getInScopeContext from '../getInScopeContext.js';
5
5
 
6
6
  /**
@@ -16,18 +16,18 @@ class FxMessage extends AbstractAction {
16
16
  this.attachShadow({ mode: 'open' });
17
17
  }
18
18
 
19
- static get properties () {
20
- return {
21
- ...AbstractAction.properties,
22
- modelItem:undefined,
23
- messageTextContent: {
24
- type: String,
25
- get value() {
26
- return "here!";
27
- }
28
- }
29
- };
30
- }
19
+ static get properties() {
20
+ return {
21
+ ...AbstractAction.properties,
22
+ modelItem: undefined,
23
+ messageTextContent: {
24
+ type: String,
25
+ get value() {
26
+ return 'here!';
27
+ },
28
+ },
29
+ };
30
+ }
31
31
 
32
32
  connectedCallback() {
33
33
  super.connectedCallback();
@@ -35,7 +35,7 @@ class FxMessage extends AbstractAction {
35
35
  this.level = this.hasAttribute('level') ? this.getAttribute('level') : 'ephemeral';
36
36
  this.message = '';
37
37
 
38
- this.messageTextContent = this.textContent;
38
+ this.messageTextContent = this.textContent;
39
39
  const style = `
40
40
  :host{
41
41
  display:none;
@@ -49,7 +49,7 @@ class FxMessage extends AbstractAction {
49
49
  `;
50
50
  }
51
51
 
52
- /*
52
+ /*
53
53
  disconnectedCallback() {
54
54
  // super.disconnectedCallback();
55
55
  this.targetElement.removeEventListener(this.event, e => this.execute(e));
@@ -68,7 +68,7 @@ class FxMessage extends AbstractAction {
68
68
  if (this.hasAttribute('value')) {
69
69
  this.message = this._getValue();
70
70
  } else {
71
- this.getOwnerForm().evaluateTemplateExpression(this.messageTextContent, this.firstChild);
71
+ this.getOwnerForm().evaluateTemplateExpression(this.messageTextContent, this.firstChild);
72
72
  this.message = this.textContent;
73
73
  }
74
74
 
@@ -76,7 +76,7 @@ class FxMessage extends AbstractAction {
76
76
  new CustomEvent('message', {
77
77
  composed: false,
78
78
  bubbles: true,
79
- detail: { level: this.level, message:this.message },
79
+ detail: { level: this.level, message: this.message },
80
80
  }),
81
81
  );
82
82
  }
@@ -97,7 +97,6 @@ class FxMessage extends AbstractAction {
97
97
  }
98
98
  return null;
99
99
  }
100
-
101
100
  }
102
101
 
103
102
  if (!customElements.get('fx-message')) {
@@ -1,7 +1,7 @@
1
1
  import { AbstractAction } from './abstract-action.js';
2
2
  import { Fore } from '../fore.js';
3
- import {resolveId} from "../xpath-evaluation.js";
4
- import {XPathUtil} from "../xpath-util.js";
3
+ import { resolveId } from '../xpath-evaluation.js';
4
+ import { XPathUtil } from '../xpath-util.js';
5
5
 
6
6
  /**
7
7
  * `fx-refresh`
@@ -12,12 +12,12 @@ import {XPathUtil} from "../xpath-util.js";
12
12
  class FxRefresh extends AbstractAction {
13
13
  async perform() {
14
14
  this.dispatchEvent(
15
- new CustomEvent('execute-action', {
16
- composed: true,
17
- bubbles: true,
18
- cancelable:true,
19
- detail: { action: this, event:this.event},
20
- }),
15
+ new CustomEvent('execute-action', {
16
+ composed: true,
17
+ bubbles: true,
18
+ cancelable: true,
19
+ detail: { action: this, event: this.event },
20
+ }),
21
21
  );
22
22
 
23
23
  if (this.hasAttribute('self')) {
@@ -28,12 +28,12 @@ class FxRefresh extends AbstractAction {
28
28
  return;
29
29
  }
30
30
  }
31
- if(this.hasAttribute('force')){
31
+ if (this.hasAttribute('force')) {
32
32
  console.log(`### <<<<< refresh() force ${this} >>>>>`);
33
33
  this.getOwnerForm().forceRefresh();
34
34
  return;
35
35
  }
36
- if(this.hasAttribute('control')){
36
+ if (this.hasAttribute('control')) {
37
37
  const targetId = this.getAttribute('control');
38
38
  console.log(`### <<<<< refresh() control '${targetId}' >>>>>`);
39
39
  const ctrl = resolveId(targetId, this);
@@ -1,5 +1,5 @@
1
1
  import { AbstractAction } from './abstract-action.js';
2
- import {Fore} from "../fore.js";
2
+ import { Fore } from '../fore.js';
3
3
 
4
4
  /**
5
5
  * `fx-reload`
@@ -10,24 +10,27 @@ import {Fore} from "../fore.js";
10
10
  * @demo demo/project.html
11
11
  */
12
12
  export class FxReload extends AbstractAction {
13
-
14
13
  connectedCallback() {
15
- if(super.connectedCallback){
16
- super.connectedCallback();
14
+ if (super.connectedCallback) {
15
+ super.connectedCallback();
17
16
  }
18
- this.addEventListener('reload', () => {
19
- window.location.reload();
20
- },{once:true});
17
+ this.addEventListener(
18
+ 'reload',
19
+ () => {
20
+ window.location.reload();
21
+ },
22
+ { once: true },
23
+ );
21
24
  }
22
25
 
23
26
  async perform() {
24
27
  this.dispatchEvent(
25
- new CustomEvent('execute-action', {
26
- composed: true,
27
- bubbles: true,
28
- cancelable:true,
29
- detail: { action: this, event:this.event},
30
- }),
28
+ new CustomEvent('execute-action', {
29
+ composed: true,
30
+ bubbles: true,
31
+ cancelable: true,
32
+ detail: { action: this, event: this.event },
33
+ }),
31
34
  );
32
35
 
33
36
  Fore.dispatch(this, 'reload', {});
@@ -37,4 +40,3 @@ export class FxReload extends AbstractAction {
37
40
  if (!customElements.get('fx-reload')) {
38
41
  window.customElements.define('fx-reload', FxReload);
39
42
  }
40
-