Skip to content

Commit

Permalink
Refactor #4473
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Sep 20, 2023
1 parent c634ad5 commit 4421237
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions components/lib/basecomponent/BaseComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,6 @@ export default {
return ObjectUtils.isString(value) || ObjectUtils.isArray(value) ? { class: value } : value;
},
_getPT(pt, key = '', callback) {
const _usept = pt?.['_usept'];
const getValue = (value, checkSameKey = false) => {
const computedValue = callback ? callback(value) : value;
const _key = ObjectUtils.toFlatCase(key);
Expand All @@ -497,9 +495,9 @@ export default {
return (checkSameKey ? (_key !== _cKey ? computedValue?.[_key] : undefined) : computedValue?.[_key]) ?? computedValue;
};
return ObjectUtils.isNotEmpty(_usept)
return pt?.hasOwnProperty('_usept')
? {
_usept,
_usept: pt['_usept'],
originalValue: getValue(pt.originalValue),
value: getValue(pt.value)
}
Expand Down
6 changes: 2 additions & 4 deletions components/lib/basedirective/BaseDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,16 @@ const BaseDirective = {
return mergeSections || (!mergeSections && self) ? (useMergeProps ? mergeProps(global, self, datasets) : { ...global, ...self, ...datasets }) : { ...self, ...datasets };
},
_getPT: (pt, key = '', callback) => {
const _usept = pt?.['_usept'];

const getValue = (value) => {
const computedValue = callback ? callback(value) : value;
const _key = ObjectUtils.toFlatCase(key);

return computedValue?.[_key] ?? computedValue;
};

return ObjectUtils.isNotEmpty(_usept)
return pt?.hasOwnProperty('_usept')
? {
_usept,
_usept: pt['_usept'],
originalValue: getValue(pt.originalValue),
value: getValue(pt.value)
}
Expand Down

0 comments on commit 4421237

Please sign in to comment.