@domql/element 3.7.6 → 3.8.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.
@@ -26,6 +26,7 @@ var import_create = require("../create.js");
26
26
  var import_utils = require("@domql/utils");
27
27
  function text(param, element, node) {
28
28
  let prop = (0, import_utils.exec)(element.props.text || param, element);
29
+ if ((0, import_utils.isFunction)(prop)) prop = (0, import_utils.exec)(prop, element);
29
30
  if ((0, import_utils.isString)(prop) && prop.includes("{{")) {
30
31
  prop = element.call("replaceLiteralsWithObjectFields", prop, element.state);
31
32
  }
@@ -1,7 +1,8 @@
1
1
  import { create } from "../create.js";
2
- import { exec, isString, SVG_TAGS } from "@domql/utils";
2
+ import { exec, isFunction, isString, SVG_TAGS } from "@domql/utils";
3
3
  function text(param, element, node) {
4
4
  let prop = exec(element.props.text || param, element);
5
+ if (isFunction(prop)) prop = exec(prop, element);
5
6
  if (isString(prop) && prop.includes("{{")) {
6
7
  prop = element.call("replaceLiteralsWithObjectFields", prop, element.state);
7
8
  }
@@ -4425,6 +4425,7 @@ ${element}` : "";
4425
4425
  init_esm();
4426
4426
  function text(param, element, node) {
4427
4427
  let prop = exec(element.props.text || param, element);
4428
+ if (isFunction(prop)) prop = exec(prop, element);
4428
4429
  if (isString(prop) && prop.includes("{{")) {
4429
4430
  prop = element.call("replaceLiteralsWithObjectFields", prop, element.state);
4430
4431
  }
package/mixins/text.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { create } from '../create.js'
4
- import { exec, isString, SVG_TAGS } from '@domql/utils'
4
+ import { exec, isFunction, isString, SVG_TAGS } from '@domql/utils'
5
5
 
6
6
  /**
7
7
  * Creates a text node and appends into
@@ -9,6 +9,7 @@ import { exec, isString, SVG_TAGS } from '@domql/utils'
9
9
  */
10
10
  export function text (param, element, node) {
11
11
  let prop = exec(element.props.text || param, element)
12
+ if (isFunction(prop)) prop = exec(prop, element)
12
13
  if (isString(prop) && prop.includes('{{')) {
13
14
  prop = element.call('replaceLiteralsWithObjectFields', prop, element.state)
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "3.7.6",
3
+ "version": "3.8.0",
4
4
  "license": "CC-BY-NC-4.0",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",
@@ -46,10 +46,10 @@
46
46
  "build:iife": "cross-env NODE_ENV=$NODE_ENV esbuild index.js --bundle --target=es2020 --format=iife --global-name=DomqlElement --outfile=dist/iife/index.js --define:process.env.NODE_ENV=process.env.NODE_ENV"
47
47
  },
48
48
  "dependencies": {
49
- "@domql/report": "^3.7.6",
50
- "@domql/state": "^3.7.6",
51
- "@domql/utils": "^3.7.6",
52
- "attrs-in-props": "^3.7.6"
49
+ "@domql/report": "^3.8.0",
50
+ "@domql/state": "^3.8.0",
51
+ "@domql/utils": "^3.8.0",
52
+ "attrs-in-props": "^3.8.0"
53
53
  },
54
54
  "gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
55
55
  "devDependencies": {