@jinntec/fore 1.0.0-4 → 1.1.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 +26 -38
- package/dist/fore-dev.js +43 -0
- package/dist/fore-dev.js.map +1 -0
- package/dist/fore.js +37 -0
- package/dist/fore.js.map +1 -0
- package/index.js +4 -0
- package/package.json +42 -42
- package/resources/fore.css +186 -0
- package/resources/toastify.css +87 -0
- package/resources/{fore-styles.css → vars.css} +0 -292
- package/src/DependencyNotifyingDomFacade.js +10 -16
- package/src/ForeElementMixin.js +26 -19
- package/src/actions/abstract-action.js +30 -9
- package/src/actions/fx-action.js +6 -4
- package/src/actions/fx-append.js +8 -17
- package/src/actions/fx-confirm.js +5 -3
- package/src/actions/fx-delete.js +6 -3
- package/src/actions/fx-dispatch.js +9 -8
- package/src/actions/fx-hide.js +10 -6
- package/src/actions/fx-insert.js +49 -39
- package/src/actions/fx-message.js +3 -1
- package/src/actions/fx-refresh.js +15 -1
- package/src/actions/fx-replace.js +73 -0
- package/src/actions/fx-return.js +42 -0
- package/src/actions/fx-send.js +3 -1
- package/src/actions/fx-setfocus.js +37 -0
- package/src/actions/fx-setvalue.js +58 -51
- package/src/actions/fx-show.js +12 -4
- package/src/actions/fx-toggle.js +15 -10
- package/src/actions/fx-update.js +3 -1
- package/src/dep_graph.js +4 -2
- package/src/drawdown.js +67 -82
- package/src/fore.js +158 -12
- package/src/functions/fx-function.js +17 -3
- package/src/fx-bind.js +42 -202
- package/src/fx-fore.js +599 -567
- package/src/fx-header.js +3 -1
- package/src/fx-instance.js +9 -1
- package/src/fx-model.js +59 -23
- package/src/fx-submission.js +106 -48
- package/src/fx-var.js +7 -4
- package/src/getInScopeContext.js +37 -11
- package/src/modelitem.js +4 -4
- package/src/relevance.js +64 -0
- package/src/ui/abstract-control.js +64 -37
- package/src/ui/fx-alert.js +7 -1
- package/src/ui/fx-case.js +4 -3
- package/src/ui/fx-container.js +7 -1
- package/src/ui/fx-control.js +309 -34
- package/src/ui/fx-dialog.js +54 -40
- package/src/ui/fx-group.js +3 -1
- package/src/ui/fx-hint.js +4 -1
- package/src/ui/fx-inspector.js +120 -17
- package/src/ui/fx-items.js +8 -8
- package/src/ui/fx-output.js +16 -5
- package/src/ui/fx-repeat.js +33 -41
- package/src/ui/fx-repeatitem.js +10 -4
- package/src/ui/fx-switch.js +5 -3
- package/src/ui/fx-trigger.js +3 -1
- package/src/xpath-evaluation.js +621 -576
- package/src/xpath-util.js +15 -8
- package/dist/fore-all.js +0 -140
- package/dist/fore-debug.js +0 -140
- package/src/.DS_Store +0 -0
- package/src/actions/.DS_Store +0 -0
- package/src/ui/.DS_Store +0 -0
package/src/xpath-util.js
CHANGED
|
@@ -20,7 +20,7 @@ export class XPathUtil {
|
|
|
20
20
|
if (start.parentNode.hasAttribute('ref')) {
|
|
21
21
|
return start.parentNode;
|
|
22
22
|
}
|
|
23
|
-
XPathUtil.getParentBindingElement(start.parentNode);
|
|
23
|
+
return XPathUtil.getParentBindingElement(start.parentNode);
|
|
24
24
|
}
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
@@ -29,10 +29,6 @@ export class XPathUtil {
|
|
|
29
29
|
return path != null && (path.startsWith('/') || path.startsWith('instance('));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
static isRepeated(element) {
|
|
33
|
-
return element.parentElement.closest('fx-repeatitem');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
32
|
static isSelfReference(ref) {
|
|
37
33
|
return ref === '.' || ref === './text()' || ref === 'text()' || ref === '' || ref === null;
|
|
38
34
|
}
|
|
@@ -57,21 +53,32 @@ export class XPathUtil {
|
|
|
57
53
|
throw new Error('no Fore element present');
|
|
58
54
|
}
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
/**
|
|
57
|
+
* returns the instance id from a complete XPath using `instance()` function.
|
|
58
|
+
*
|
|
59
|
+
* Will return 'default' in case no ref is given at all or the `instance()` function is called without arg.
|
|
60
|
+
*
|
|
61
|
+
* Otherwise instance id is extracted from function and returned. If all fails null is returned.
|
|
62
|
+
* @param ref
|
|
63
|
+
* @returns {string}
|
|
64
|
+
*/
|
|
61
65
|
static getInstanceId(ref) {
|
|
62
66
|
if (!ref) {
|
|
63
67
|
return 'default';
|
|
64
68
|
}
|
|
69
|
+
if (ref.startsWith('instance()')) {
|
|
70
|
+
return 'default';
|
|
71
|
+
}
|
|
65
72
|
if (ref.startsWith('instance(')) {
|
|
66
73
|
const result = ref.substring(ref.indexOf('(') + 1);
|
|
67
74
|
return result.substring(1, result.indexOf(')') - 1);
|
|
68
75
|
}
|
|
69
|
-
return
|
|
76
|
+
return null;
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
// todo: certainly not ideal to rely on duplicating instance id on instance document - better way later ;)
|
|
73
80
|
static getPath(node) {
|
|
74
|
-
const path = fx.
|
|
81
|
+
const path = fx.evaluateXPathToString('path()', node);
|
|
75
82
|
/*
|
|
76
83
|
const instanceId = node.ownerDocument.firstElementChild.getAttribute('id');
|
|
77
84
|
if (instanceId !== null && instanceId !== 'default') {
|