@domql/element
Advanced tools
Comparing version 2.5.96 to 2.5.98
@@ -27,2 +27,3 @@ "use strict"; | ||
log: () => log, | ||
lookdown: () => lookdown, | ||
lookup: () => lookup, | ||
@@ -77,2 +78,23 @@ nextElement: () => nextElement, | ||
}; | ||
const lookdown = function(param) { | ||
const el = this; | ||
const { __ref: ref } = el; | ||
const children = ref.__children; | ||
for (let i = 0; i < children.length; i++) { | ||
const v = children[i]; | ||
const childElem = el[v]; | ||
if (v === param) | ||
return childElem; | ||
else if ((0, import_utils.isFunction)(param)) { | ||
const exec = param(childElem, childElem.state, childElem.context); | ||
if (childElem.state && exec) { | ||
return childElem; | ||
} | ||
} | ||
const lookdown2 = childElem.lookdown(param); | ||
if (lookdown2) | ||
return lookdown2; | ||
} | ||
return null; | ||
}; | ||
const remove = function() { | ||
@@ -188,2 +210,3 @@ const element = this; | ||
"lookup", | ||
"lookdown", | ||
"spotByPath", | ||
@@ -190,0 +213,0 @@ "keys", |
@@ -48,2 +48,3 @@ "use strict"; | ||
lookup: import__.lookup.bind(element), | ||
lookdown: import__.lookdown.bind(element), | ||
spotByPath: import__.spotByPath.bind(element), | ||
@@ -50,0 +51,0 @@ parse: import__.parse.bind(element), |
@@ -64,2 +64,3 @@ "use strict"; | ||
lookup: {}, | ||
lookdown: {}, | ||
spotByPath: {}, | ||
@@ -66,0 +67,0 @@ keys: {}, |
@@ -171,3 +171,5 @@ "use strict"; | ||
} | ||
return (0, import_utils.overwriteDeep)(element, (0, import_extend.applyExtend)(variantElement)); | ||
const extendedVariant = (0, import_extend.applyExtend)(variantElement, element.parent); | ||
const { parent, ...rest } = extendedVariant; | ||
return (0, import_utils.overwriteDeep)(element, rest); | ||
}; | ||
@@ -174,0 +176,0 @@ const applyVariant = (element) => { |
@@ -45,2 +45,25 @@ 'use strict' | ||
export const lookdown = function (param) { | ||
const el = this | ||
const { __ref: ref } = el | ||
const children = ref.__children | ||
for (let i = 0; i < children.length; i++) { | ||
const v = children[i] | ||
const childElem = el[v] | ||
if (v === param) return childElem | ||
else if (isFunction(param)) { | ||
const exec = param(childElem, childElem.state, childElem.context) | ||
if (childElem.state && exec) { | ||
return childElem | ||
} | ||
} | ||
const lookdown = childElem.lookdown(param) | ||
if (lookdown) return lookdown | ||
} | ||
return null | ||
} | ||
export const remove = function () { | ||
@@ -163,2 +186,3 @@ const element = this | ||
'lookup', | ||
'lookdown', | ||
'spotByPath', | ||
@@ -165,0 +189,0 @@ 'keys', |
@@ -10,2 +10,3 @@ 'use strict' | ||
lookup, | ||
lookdown, | ||
setProps, | ||
@@ -33,2 +34,3 @@ remove, | ||
lookup: lookup.bind(element), | ||
lookdown: lookdown.bind(element), | ||
spotByPath: spotByPath.bind(element), | ||
@@ -35,0 +37,0 @@ parse: parse.bind(element), |
@@ -48,2 +48,3 @@ 'use strict' | ||
lookup: {}, | ||
lookdown: {}, | ||
spotByPath: {}, | ||
@@ -50,0 +51,0 @@ keys: {}, |
{ | ||
"name": "@domql/element", | ||
"version": "2.5.96", | ||
"version": "2.5.98", | ||
"license": "MIT", | ||
@@ -34,3 +34,3 @@ "type": "module", | ||
}, | ||
"gitHead": "0cecd2c613b24dde1ea12f7e7581a58671dc3ad3", | ||
"gitHead": "6318fa362595b70f826d48c5eb8fffbc2a6a5443", | ||
"devDependencies": { | ||
@@ -37,0 +37,0 @@ "@babel/core": "^7.12.0" |
@@ -158,3 +158,6 @@ 'use strict' | ||
} | ||
return overwriteDeep(element, applyExtend(variantElement)) // TODO: check why string is not working | ||
const extendedVariant = applyExtend(variantElement, element.parent) | ||
const { parent, ...rest } = extendedVariant | ||
return overwriteDeep(element, rest) // TODO: check why string is not working | ||
// return overwriteDeep(element, applyExtend(variantElement, element.parent)) // TODO: check why string is not working | ||
} | ||
@@ -161,0 +164,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186116
5032