mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Theming API: Add new helper methods and remove useColorScheme
This commit is contained in:
parent
064f7f9b02
commit
7bd88de07b
13 changed files with 155 additions and 113 deletions
|
@ -44,6 +44,23 @@ export default {
|
|||
Object.assign(value1, value2);
|
||||
}
|
||||
},
|
||||
mergeKeysByRegex(target = {}, source = {}, regex) {
|
||||
const mergedObj = { ...target };
|
||||
|
||||
Object.keys(source).forEach((key) => {
|
||||
if (this.test(regex, key)) {
|
||||
if (this.isObject(source[key]) && key in target && this.isObject(target[key])) {
|
||||
mergedObj[key] = this.mergeKeysByRegex(target[key], source[key], regex);
|
||||
} else {
|
||||
mergedObj[key] = source[key];
|
||||
}
|
||||
} else {
|
||||
mergedObj[key] = source[key];
|
||||
}
|
||||
});
|
||||
|
||||
return mergedObj;
|
||||
},
|
||||
getItemValue(obj, ...params) {
|
||||
return this.isFunction(obj) ? obj(...params) : obj;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue