@jinntec/fore 2.1.0 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jinntec/fore",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Fore - declarative user interfaces in plain HTML",
5
5
  "module": "./index.js",
6
6
  "publishConfig": {
package/src/fx-var.js CHANGED
@@ -25,8 +25,13 @@ export class FxVariable extends foreElementMixin(HTMLElement) {
25
25
  refresh() {
26
26
  const inscope = getInScopeContext(this, this.valueQuery);
27
27
 
28
- const values = evaluateXPath(this.valueQuery, inscope, this, this.precedingVariables);
29
- [this.value] = values;
28
+ const values = evaluateXPath(this.valueQuery, inscope, this, this.precedingVariables);
29
+ if (values.length) {
30
+ [this.value] = values;
31
+ } else {
32
+ // There is no value: set to null so it's interpreted as empty-sequence later on
33
+ this.value = null;
34
+ }
30
35
  }
31
36
 
32
37
  setInScopeVariables(inScopeVariables) {
@@ -23,7 +23,9 @@ export class FxTrigger extends XfAbstractControl {
23
23
  const slot = this.shadowRoot.querySelector('slot');
24
24
  slot.addEventListener('slotchange', () => {
25
25
  const elements = slot.assignedElements({ flatten: true });
26
- elements[0].setAttribute('tabindex', '0');
26
+ if(!elements[0].getAttribute('tabindex')){
27
+ elements[0].setAttribute('tabindex', '0');
28
+ }
27
29
  if(elements[0].nodeName !== 'BUTTON'){
28
30
  elements[0].setAttribute('role', 'button');
29
31
  }
@@ -384,7 +384,9 @@ function functionNameResolver({prefix, localName}, _arity) {
384
384
  function getVariablesInScope(formElement) {
385
385
  let closestActualFormElement = formElement;
386
386
  while (closestActualFormElement && !('inScopeVariables' in closestActualFormElement)) {
387
- closestActualFormElement = closestActualFormElement.parentNode;
387
+ closestActualFormElement = closestActualFormElement.nodeType === Node.ATTRIBUTE_NODE ?
388
+ closestActualFormElement.ownerElement :
389
+ closestActualFormElement.parentNode;
388
390
  }
389
391
 
390
392
  if (!closestActualFormElement) {