mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Theming API: Added fallback param to inline dt method.
This commit is contained in:
parent
c25b2e0559
commit
468106cfb8
3 changed files with 8 additions and 8 deletions
|
@ -109,7 +109,7 @@ export default {
|
|||
getVariableName(prefix = '', variable = '') {
|
||||
return `--${this.toNormalizeVariable(prefix, variable)}`;
|
||||
},
|
||||
getVariableValue(value, variable = '', prefix = '', excludedKeyRegexes = []) {
|
||||
getVariableValue(value, variable = '', prefix = '', excludedKeyRegexes = [], fallback) {
|
||||
if (this.isString(value)) {
|
||||
const regex = /{([^}]*)}/g;
|
||||
const val = value.trim();
|
||||
|
@ -119,7 +119,7 @@ export default {
|
|||
const path = v.replace(/{|}/g, '');
|
||||
const keys = path.split('.').filter((_v) => !excludedKeyRegexes.some((_r) => this.test(_r, _v)));
|
||||
|
||||
return `var(${this.getVariableName(prefix, this.toKebabCase(keys.join('-')))})`;
|
||||
return `var(${this.getVariableName(prefix, this.toKebabCase(keys.join('-')))}${fallback ? `,${fallback}` : ''})`;
|
||||
});
|
||||
|
||||
const calculationRegex = /(\d+\s+[\+\-\*\/]\s+\d+)/g;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue