@domql/element 2.32.7 → 2.32.9

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,7 +27,8 @@ var import_utils = require("@domql/utils");
27
27
  async function state(params, element, node, opts) {
28
28
  const state2 = (0, import_utils.exec)(params, element, element.state, element.context, opts);
29
29
  if ((0, import_utils.isObject)(state2)) {
30
- for (const param in state2) {
30
+ const keys = Object.keys(state2);
31
+ for (const param of keys) {
31
32
  if (import_state.IGNORE_STATE_PARAMS.includes(param)) continue;
32
33
  if (!Object.hasOwnProperty.call(state2, param)) continue;
33
34
  }
package/dist/cjs/set.js CHANGED
@@ -72,7 +72,7 @@ const set = async function(params, options = {}, el) {
72
72
  const lazyLoad = element.props && element.props.lazyLoad;
73
73
  const hasCollection = element.$collection || element.$stateCollection || element.$propsCollection || ((_c = element.props) == null ? void 0 : _c.children);
74
74
  if (options.preventContentUpdate === true && !hasCollection) return;
75
- if (!options.forceReset && (ref.__noCollectionDifference || __contentRef && __contentRef.__cached && (0, import_utils.deepContains)(params, content))) {
75
+ if (options.forceUpdate && !options.forceReset && (ref.__noCollectionDifference || __contentRef && __contentRef.__cached && (0, import_utils.deepContains)(params, content))) {
76
76
  if (!options.preventBeforeUpdateListener && !options.preventListeners) {
77
77
  const beforeUpdateReturns = await (0, import_event.triggerEventOnUpdate)(
78
78
  "beforeUpdate",
@@ -3,7 +3,8 @@ import { exec, isObject } from "@domql/utils";
3
3
  async function state(params, element, node, opts) {
4
4
  const state2 = exec(params, element, element.state, element.context, opts);
5
5
  if (isObject(state2)) {
6
- for (const param in state2) {
6
+ const keys = Object.keys(state2);
7
+ for (const param of keys) {
7
8
  if (IGNORE_STATE_PARAMS.includes(param)) continue;
8
9
  if (!Object.hasOwnProperty.call(state2, param)) continue;
9
10
  }
package/dist/esm/set.js CHANGED
@@ -46,7 +46,7 @@ const set = async function(params, options = {}, el) {
46
46
  const lazyLoad = element.props && element.props.lazyLoad;
47
47
  const hasCollection = element.$collection || element.$stateCollection || element.$propsCollection || ((_c = element.props) == null ? void 0 : _c.children);
48
48
  if (options.preventContentUpdate === true && !hasCollection) return;
49
- if (!options.forceReset && (ref.__noCollectionDifference || __contentRef && __contentRef.__cached && deepContains(params, content))) {
49
+ if (options.forceUpdate && !options.forceReset && (ref.__noCollectionDifference || __contentRef && __contentRef.__cached && deepContains(params, content))) {
50
50
  if (!options.preventBeforeUpdateListener && !options.preventListeners) {
51
51
  const beforeUpdateReturns = await triggerEventOnUpdate(
52
52
  "beforeUpdate",
package/mixins/state.js CHANGED
@@ -7,7 +7,8 @@ export async function state(params, element, node, opts) {
7
7
  const state = exec(params, element, element.state, element.context, opts)
8
8
 
9
9
  if (isObject(state)) {
10
- for (const param in state) {
10
+ const keys = Object.keys(state)
11
+ for (const param of keys) {
11
12
  if (IGNORE_STATE_PARAMS.includes(param)) continue
12
13
  if (!Object.hasOwnProperty.call(state, param)) continue
13
14
  // element.state[param] = exec(state[param], element)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.32.7",
3
+ "version": "2.32.9",
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.32.7",
31
- "@domql/render": "^2.32.7",
32
- "@domql/state": "^2.32.7",
33
- "@domql/utils": "^2.32.7"
30
+ "@domql/event": "^2.32.9",
31
+ "@domql/render": "^2.32.9",
32
+ "@domql/state": "^2.32.9",
33
+ "@domql/utils": "^2.32.9"
34
34
  },
35
- "gitHead": "c99355e8e88604af8376bebbf553e559c3f2db76",
35
+ "gitHead": "6b5bbf4c7ffd0eaa9b47ebc87496ef1026a17cf3",
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.27.1"
38
38
  }
package/set.js CHANGED
@@ -69,6 +69,7 @@ export const set = async function (params, options = {}, el) {
69
69
  // console.log(deepContains(params, content))
70
70
 
71
71
  if (
72
+ options.forceUpdate &&
72
73
  !options.forceReset &&
73
74
  (ref.__noCollectionDifference ||
74
75
  (__contentRef && __contentRef.__cached && deepContains(params, content)))