diff --git a/packages/docs/src/locales/en/en.json b/packages/docs/src/locales/en/en.json
index 2916baccc1..c5a0ae50fd 100644
--- a/packages/docs/src/locales/en/en.json
+++ b/packages/docs/src/locales/en/en.json
@@ -1381,7 +1381,7 @@
},
"aliasAndFontExample": {
"twitterColor": "Twitter blue brand color",
- "VuesticColor": "Vuestic green brand color",
+ "vuesticColor": "Vuestic green brand color",
"from": "from",
"alias": "alias",
"font": "font",
@@ -3483,7 +3483,7 @@
"about": "We want to use the `
+ {
+ name: ,
+
+ resolveFromRegex:
+ ( {{ regexParams }} ) => ({ class: `{{ resolved }}` })
+
+ }
+
@@ -33,6 +42,22 @@ export default {
return groups.value.reduce((acc, v) => `${acc} ${v},`, '').slice(0, -1)
})
+ const regexIconName = ref('/(fas|far|fal|fad|fab)-(.*)/')
+ const regexParams = computed(() => {
+ const map = ['code', 'type']
+
+ return regexIconName.value
+ .split('(')
+ .map((g) => {
+ const group = '(' + g
+
+ return (group.match(/\(.*\)/) || [])[0]
+ })
+ .filter((g) => g)
+ .map((g, i) => map[i] || `group${i - 1}`)
+ .join(', ')
+ })
+
const resolved = computed(() => {
const classes = groups.value.map((item) => 'fa-${' + `${item}` + '}')
return `fa ${classes.join(' ')}`
@@ -42,6 +67,8 @@ export default {
params,
iconName,
resolved,
+ regexIconName,
+ regexParams,
}
},
}
@@ -52,9 +79,11 @@ export default {
background: #f4f8fa;
color: var(--va-dark);
padding: 0.5rem;
+ width: 100%;
.tab {
padding-left: 1rem;
+ display: block;
}
.params {
diff --git a/packages/docs/src/page-configs/services/icons-config/page-config.ts b/packages/docs/src/page-configs/services/icons-config/page-config.ts
index 44734f3209..9b21724bca 100644
--- a/packages/docs/src/page-configs/services/icons-config/page-config.ts
+++ b/packages/docs/src/page-configs/services/icons-config/page-config.ts
@@ -17,15 +17,14 @@ const columns: TableColumn[] = [
]
const tableData: TableData = [
- ['name', 'string | RegExp', 'iconsConfig.api.name'],
[
'class',
- 'string | ((...dynamicSegments: string[]) => string) | undefined',
+ 'string | undefined',
'iconsConfig.api.iconClass',
],
[
'content',
- 'string | ((...dynamicSegments: string[]) => string | undefined) | undefined',
+ 'string | undefined',
'iconsConfig.api.content',
],
[
@@ -34,8 +33,8 @@ const tableData: TableData = [
'iconsConfig.api.component',
],
[
- 'componentProps',
- '`Record