prettier fixups
This commit is contained in:
parent
15117f6f27
commit
e8652bfc78
|
@ -0,0 +1,3 @@
|
|||
.keep
|
||||
node_modules
|
||||
npm-packages
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"bracketSameLine": false,
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"printWidth": 160,
|
||||
"quoteProps": "consistent",
|
||||
"semi": false,
|
||||
"singleAttributePerLine": true,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"useTabs": false,
|
||||
"vueIndentScriptAndStyle": true
|
||||
}
|
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
|
@ -67,24 +67,26 @@
|
|||
"@babel/preset-env": "^7.18.2",
|
||||
"@fortawesome/fontawesome-svg-core": "~6",
|
||||
"@fortawesome/free-solid-svg-icons": "^6",
|
||||
"@rollup/plugin-babel": "^5.3.1",
|
||||
"@rollup/plugin-commonjs": "^22.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@vue/test-utils": "^2.0.0-beta.2",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-jest": "^28.1.1",
|
||||
"concurrently": "^7.2.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"humps": "^2.0.1",
|
||||
"husky": "^8.0.1",
|
||||
"install": "^0.13.0",
|
||||
"jest": "^28.1.1",
|
||||
"jest-environment-jsdom": "^28.1.1",
|
||||
"lint-staged": "^13.0.0",
|
||||
"markdown-toc": "^1.2.0",
|
||||
"npm": "^10.2.2",
|
||||
"prettier": "^3.0.3",
|
||||
"rollup": "^2.75.6",
|
||||
"@rollup/plugin-babel": "^5.3.1",
|
||||
"@rollup/plugin-commonjs": "^22.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@vue/test-utils": "^2.0.0-beta.2",
|
||||
"vue": "^3"
|
||||
},
|
||||
"dependencies": {},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
|
|
|
@ -4,7 +4,7 @@ import convert from '../converter'
|
|||
import log from '../logger'
|
||||
import { objectWithKey, classList } from '../utils'
|
||||
|
||||
function normalizeIconArgs (icon) {
|
||||
function normalizeIconArgs(icon) {
|
||||
if (icon && typeof icon === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
||||
return icon
|
||||
}
|
||||
|
@ -133,35 +133,36 @@ export default defineComponent({
|
|||
spinReverse: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
setup (props, { attrs }) {
|
||||
setup(props, { attrs }) {
|
||||
const icon = computed(() => normalizeIconArgs(props.icon))
|
||||
const classes = computed(() => objectWithKey('classes', classList(props)))
|
||||
const transform = computed(() => objectWithKey(
|
||||
'transform',
|
||||
(typeof props.transform === 'string')
|
||||
? faParse.transform(props.transform)
|
||||
: props.transform
|
||||
))
|
||||
const transform = computed(() => objectWithKey('transform', typeof props.transform === 'string' ? faParse.transform(props.transform) : props.transform))
|
||||
const mask = computed(() => objectWithKey('mask', normalizeIconArgs(props.mask)))
|
||||
|
||||
const renderedIcon = computed(() => faIcon(icon.value, {
|
||||
...classes.value,
|
||||
...transform.value,
|
||||
...mask.value,
|
||||
symbol: props.symbol,
|
||||
title: props.title
|
||||
}))
|
||||
const renderedIcon = computed(() =>
|
||||
faIcon(icon.value, {
|
||||
...classes.value,
|
||||
...transform.value,
|
||||
...mask.value,
|
||||
symbol: props.symbol,
|
||||
title: props.title
|
||||
})
|
||||
)
|
||||
|
||||
watch(renderedIcon, (value) => {
|
||||
if (!value) {
|
||||
return log('Could not find one or more icon(s)', icon.value, mask.value)
|
||||
}
|
||||
}, { immediate: true })
|
||||
watch(
|
||||
renderedIcon,
|
||||
(value) => {
|
||||
if (!value) {
|
||||
return log('Could not find one or more icon(s)', icon.value, mask.value)
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const vnode = computed(() => renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null)
|
||||
const vnode = computed(() => (renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null))
|
||||
return () => vnode.value
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue