@domql/element 2.33.27 → 2.33.29

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/create.js CHANGED
@@ -435,11 +435,8 @@ const createScope = (element, parent) => {
435
435
 
436
436
  const createIfConditionFlag = (element, parent) => {
437
437
  const { __ref: ref } = element
438
-
439
- if (
440
- isFunction(element.if) &&
441
- !element.if(element, element.state, element.context)
442
- ) {
438
+ const ifFn = element.props?.if || element.if
439
+ if (isFunction(ifFn) && !ifFn(element, element.state, element.context)) {
443
440
  delete ref.__if
444
441
  } else ref.__if = true
445
442
  }
@@ -301,8 +301,10 @@ const createScope = (element, parent2) => {
301
301
  if (!element.scope) element.scope = parent2.scope || ref.root.scope || {};
302
302
  };
303
303
  const createIfConditionFlag = (element, parent2) => {
304
+ var _a;
304
305
  const { __ref: ref } = element;
305
- if ((0, import_utils.isFunction)(element.if) && !element.if(element, element.state, element.context)) {
306
+ const ifFn = ((_a = element.props) == null ? void 0 : _a.if) || element.if;
307
+ if ((0, import_utils.isFunction)(ifFn) && !ifFn(element, element.state, element.context)) {
306
308
  delete ref.__if;
307
309
  } else ref.__if = true;
308
310
  };
package/dist/cjs/set.js CHANGED
@@ -86,12 +86,16 @@ const set = async function(params, options = {}, el) {
86
86
  return;
87
87
  }
88
88
  if (params) {
89
- let { childExtend, props } = params;
89
+ let { childExtend, childExtendRecursive, props } = params;
90
90
  if (!props) props = params.props = {};
91
91
  if (!childExtend && element.childExtend) {
92
92
  params.childExtend = element.childExtend;
93
93
  props.ignoreChildExtend = true;
94
94
  }
95
+ if (!childExtendRecursive && element.childExtendRecursive) {
96
+ params.childExtendRecursive = element.childExtendRecursive;
97
+ props.ignoreChildExtendRecursive = true;
98
+ }
95
99
  if (!(props == null ? void 0 : props.childProps) && ((_d = element.props) == null ? void 0 : _d.childProps)) {
96
100
  props.childProps = element.props.childProps;
97
101
  props.ignoreChildProps = true;
@@ -200,16 +200,11 @@ const captureSnapshot = (element, options) => {
200
200
  return [snapshotOnCallee, calleeElement];
201
201
  };
202
202
  const checkIfOnUpdate = (element, parent, options) => {
203
- var _a, _b, _c;
204
- if (!(0, import_utils.isFunction)(element.if) && !(0, import_utils.isFunction)((_a = element.props) == null ? void 0 : _a.if) || !parent)
205
- return;
203
+ var _a, _b;
204
+ const ifFn = ((_a = element.props) == null ? void 0 : _a.if) || element.if;
205
+ if (!(0, import_utils.isFunction)(ifFn) || !parent) return;
206
206
  const ref = element.__ref;
207
- const ifPassed = (element.if || ((_b = element.props) == null ? void 0 : _b.if))(
208
- element,
209
- element.state,
210
- element.context,
211
- options
212
- );
207
+ const ifPassed = ifFn(element, element.state, element.context, options);
213
208
  const itWasFalse = ref.__if !== true;
214
209
  if (ifPassed) {
215
210
  ref.__if = true;
@@ -232,7 +227,7 @@ const checkIfOnUpdate = (element, parent, options) => {
232
227
  const contentKey = ref.contentElementKey;
233
228
  if (element.$collection || element.$stateCollection || element.$propsCollection) {
234
229
  element.removeContent();
235
- } else if ((_c = element[contentKey]) == null ? void 0 : _c.parseDeep)
230
+ } else if ((_b = element[contentKey]) == null ? void 0 : _b.parseDeep)
236
231
  element[contentKey] = element[contentKey].parseDeep();
237
232
  const previousElement = element.previousElement();
238
233
  const previousNode = previousElement == null ? void 0 : previousElement.node;
@@ -297,8 +297,10 @@ const createScope = (element, parent2) => {
297
297
  if (!element.scope) element.scope = parent2.scope || ref.root.scope || {};
298
298
  };
299
299
  const createIfConditionFlag = (element, parent2) => {
300
+ var _a;
300
301
  const { __ref: ref } = element;
301
- if (isFunction(element.if) && !element.if(element, element.state, element.context)) {
302
+ const ifFn = ((_a = element.props) == null ? void 0 : _a.if) || element.if;
303
+ if (isFunction(ifFn) && !ifFn(element, element.state, element.context)) {
302
304
  delete ref.__if;
303
305
  } else ref.__if = true;
304
306
  };
package/dist/esm/set.js CHANGED
@@ -60,12 +60,16 @@ const set = async function(params, options = {}, el) {
60
60
  return;
61
61
  }
62
62
  if (params) {
63
- let { childExtend, props } = params;
63
+ let { childExtend, childExtendRecursive, props } = params;
64
64
  if (!props) props = params.props = {};
65
65
  if (!childExtend && element.childExtend) {
66
66
  params.childExtend = element.childExtend;
67
67
  props.ignoreChildExtend = true;
68
68
  }
69
+ if (!childExtendRecursive && element.childExtendRecursive) {
70
+ params.childExtendRecursive = element.childExtendRecursive;
71
+ props.ignoreChildExtendRecursive = true;
72
+ }
69
73
  if (!(props == null ? void 0 : props.childProps) && ((_d = element.props) == null ? void 0 : _d.childProps)) {
70
74
  props.childProps = element.props.childProps;
71
75
  props.ignoreChildProps = true;
@@ -194,16 +194,11 @@ const captureSnapshot = (element, options) => {
194
194
  return [snapshotOnCallee, calleeElement];
195
195
  };
196
196
  const checkIfOnUpdate = (element, parent, options) => {
197
- var _a, _b, _c;
198
- if (!isFunction(element.if) && !isFunction((_a = element.props) == null ? void 0 : _a.if) || !parent)
199
- return;
197
+ var _a, _b;
198
+ const ifFn = ((_a = element.props) == null ? void 0 : _a.if) || element.if;
199
+ if (!isFunction(ifFn) || !parent) return;
200
200
  const ref = element.__ref;
201
- const ifPassed = (element.if || ((_b = element.props) == null ? void 0 : _b.if))(
202
- element,
203
- element.state,
204
- element.context,
205
- options
206
- );
201
+ const ifPassed = ifFn(element, element.state, element.context, options);
207
202
  const itWasFalse = ref.__if !== true;
208
203
  if (ifPassed) {
209
204
  ref.__if = true;
@@ -226,7 +221,7 @@ const checkIfOnUpdate = (element, parent, options) => {
226
221
  const contentKey = ref.contentElementKey;
227
222
  if (element.$collection || element.$stateCollection || element.$propsCollection) {
228
223
  element.removeContent();
229
- } else if ((_c = element[contentKey]) == null ? void 0 : _c.parseDeep)
224
+ } else if ((_b = element[contentKey]) == null ? void 0 : _b.parseDeep)
230
225
  element[contentKey] = element[contentKey].parseDeep();
231
226
  const previousElement = element.previousElement();
232
227
  const previousNode = previousElement == null ? void 0 : previousElement.node;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.33.27",
3
+ "version": "2.33.29",
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.33.27",
31
- "@domql/render": "^2.33.27",
32
- "@domql/state": "^2.33.27",
33
- "@domql/utils": "^2.33.27"
30
+ "@domql/event": "^2.33.29",
31
+ "@domql/render": "^2.33.29",
32
+ "@domql/state": "^2.33.29",
33
+ "@domql/utils": "^2.33.29"
34
34
  },
35
- "gitHead": "305c78c0cd824b365d3e464dc3ede6b250c8baf1",
35
+ "gitHead": "4a29b29c86a47fa047345b16120cc426bbe57f41",
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.27.1"
38
38
  }
package/set.js CHANGED
@@ -88,12 +88,16 @@ export const set = async function (params, options = {}, el) {
88
88
  }
89
89
 
90
90
  if (params) {
91
- let { childExtend, props } = params
91
+ let { childExtend, childExtendRecursive, props } = params
92
92
  if (!props) props = params.props = {}
93
93
  if (!childExtend && element.childExtend) {
94
94
  params.childExtend = element.childExtend
95
95
  props.ignoreChildExtend = true
96
96
  }
97
+ if (!childExtendRecursive && element.childExtendRecursive) {
98
+ params.childExtendRecursive = element.childExtendRecursive
99
+ props.ignoreChildExtendRecursive = true
100
+ }
97
101
  if (!props?.childProps && element.props?.childProps) {
98
102
  props.childProps = element.props.childProps
99
103
  props.ignoreChildProps = true
package/update.js CHANGED
@@ -286,16 +286,11 @@ const captureSnapshot = (element, options) => {
286
286
  }
287
287
 
288
288
  const checkIfOnUpdate = (element, parent, options) => {
289
- if ((!isFunction(element.if) && !isFunction(element.props?.if)) || !parent)
290
- return
289
+ const ifFn = element.props?.if || element.if
290
+ if (!isFunction(ifFn) || !parent) return
291
291
 
292
292
  const ref = element.__ref
293
- const ifPassed = (element.if || element.props?.if)(
294
- element,
295
- element.state,
296
- element.context,
297
- options
298
- )
293
+ const ifPassed = ifFn(element, element.state, element.context, options)
299
294
  const itWasFalse = ref.__if !== true
300
295
 
301
296
  if (ifPassed) {