@domql/element 2.29.79 → 2.29.81

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.
@@ -27,6 +27,8 @@ __export(methods_exports, {
27
27
  getChildren: () => getChildren,
28
28
  getPath: () => getPath,
29
29
  getRef: () => getRef,
30
+ groupLog: () => groupLog,
31
+ groupLogEnd: () => groupLogEnd,
30
32
  isMethod: () => isMethod,
31
33
  keys: () => keys,
32
34
  log: () => log,
@@ -234,6 +236,12 @@ function verbose(element, ...args) {
234
236
  console.groupEnd(parent.key);
235
237
  return parent;
236
238
  }
239
+ function groupLog(...params) {
240
+ console.group(...params);
241
+ }
242
+ function groupLogEnd(...params) {
243
+ console.groupEnd(...params);
244
+ }
237
245
  function log(...params) {
238
246
  console.log(...params);
239
247
  }
@@ -334,6 +342,8 @@ const METHODS = [
334
342
  "if",
335
343
  "log",
336
344
  "verbose",
345
+ "groupLog",
346
+ "groupLogEnd",
337
347
  "warn",
338
348
  "error",
339
349
  "call",
@@ -33,7 +33,8 @@ function attr(params, element, node) {
33
33
  if (props.attr) (0, import_utils2.deepMerge)(params, props.attr);
34
34
  for (const attr2 in params) {
35
35
  const val = (0, import_utils.exec)(params[attr2], element);
36
- if (val !== false && !(0, import_utils.isUndefined)(val) && !(0, import_utils.isNull)(val) && node.setAttribute) node.setAttribute(attr2, val);
36
+ if (val !== false && !(0, import_utils.isUndefined)(val) && !(0, import_utils.isNull)(val) && node.setAttribute)
37
+ node.setAttribute(attr2, (0, import_utils.exec)(val, element));
37
38
  else if (node.removeAttribute) node.removeAttribute(attr2);
38
39
  __attr[attr2] = val;
39
40
  }
@@ -194,6 +194,12 @@ function verbose(element, ...args) {
194
194
  console.groupEnd(parent.key);
195
195
  return parent;
196
196
  }
197
+ function groupLog(...params) {
198
+ console.group(...params);
199
+ }
200
+ function groupLogEnd(...params) {
201
+ console.groupEnd(...params);
202
+ }
197
203
  function log(...params) {
198
204
  console.log(...params);
199
205
  }
@@ -294,6 +300,8 @@ const METHODS = [
294
300
  "if",
295
301
  "log",
296
302
  "verbose",
303
+ "groupLog",
304
+ "groupLogEnd",
297
305
  "warn",
298
306
  "error",
299
307
  "call",
@@ -315,6 +323,8 @@ export {
315
323
  getChildren,
316
324
  getPath,
317
325
  getRef,
326
+ groupLog,
327
+ groupLogEnd,
318
328
  isMethod,
319
329
  keys,
320
330
  log,
@@ -9,7 +9,8 @@ function attr(params, element, node) {
9
9
  if (props.attr) deepMerge(params, props.attr);
10
10
  for (const attr2 in params) {
11
11
  const val = exec(params[attr2], element);
12
- if (val !== false && !isUndefined(val) && !isNull(val) && node.setAttribute) node.setAttribute(attr2, val);
12
+ if (val !== false && !isUndefined(val) && !isNull(val) && node.setAttribute)
13
+ node.setAttribute(attr2, exec(val, element));
13
14
  else if (node.removeAttribute) node.removeAttribute(attr2);
14
15
  __attr[attr2] = val;
15
16
  }
package/methods/index.js CHANGED
@@ -240,6 +240,18 @@ export function verbose(element, ...args) {
240
240
  return parent
241
241
  }
242
242
 
243
+ export function groupLog(...params) {
244
+ // if (isNotProduction()) {
245
+ console.group(...params)
246
+ // }
247
+ }
248
+
249
+ export function groupLogEnd(...params) {
250
+ // if (isNotProduction()) {
251
+ console.groupEnd(...params)
252
+ // }
253
+ }
254
+
243
255
  export function log(...params) {
244
256
  // if (isNotProduction()) {
245
257
  console.log(...params)
@@ -378,6 +390,8 @@ export const METHODS = [
378
390
  'if',
379
391
  'log',
380
392
  'verbose',
393
+ 'groupLog',
394
+ 'groupLogEnd',
381
395
  'warn',
382
396
  'error',
383
397
  'call',
package/mixins/attr.js CHANGED
@@ -7,7 +7,7 @@ import { deepMerge } from '../utils/index.js'
7
7
  /**
8
8
  * Recursively add attributes to a DOM node
9
9
  */
10
- export function attr (params, element, node) {
10
+ export function attr(params, element, node) {
11
11
  const { __ref: ref, props } = element
12
12
  const { __attr } = ref
13
13
  if (isNot('object')) report('HTMLInvalidAttr', params)
@@ -16,7 +16,13 @@ export function attr (params, element, node) {
16
16
  for (const attr in params) {
17
17
  const val = exec(params[attr], element)
18
18
  // if (__attr[attr] === val) return
19
- if (val !== false && !isUndefined(val) && !isNull(val) && node.setAttribute) node.setAttribute(attr, val)
19
+ if (
20
+ val !== false &&
21
+ !isUndefined(val) &&
22
+ !isNull(val) &&
23
+ node.setAttribute
24
+ )
25
+ node.setAttribute(attr, exec(val, element))
20
26
  else if (node.removeAttribute) node.removeAttribute(attr)
21
27
  __attr[attr] = val
22
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.29.79",
3
+ "version": "2.29.81",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -27,12 +27,12 @@
27
27
  "prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
28
28
  },
29
29
  "dependencies": {
30
- "@domql/event": "^2.29.79",
31
- "@domql/render": "^2.29.79",
32
- "@domql/state": "^2.29.79",
33
- "@domql/utils": "^2.29.79"
30
+ "@domql/event": "^2.29.81",
31
+ "@domql/render": "^2.29.81",
32
+ "@domql/state": "^2.29.81",
33
+ "@domql/utils": "^2.29.81"
34
34
  },
35
- "gitHead": "aefa41e70ddc76983c23822905afa22a2b944299",
35
+ "gitHead": "bd0e154d7fd091d33b99e5c8da9011de0e4abea4",
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.27.1"
38
38
  }