orgin/master #1

Merged
uniccoo merged 257 commits from orgin/master into master 2024-06-18 15:49:12 +00:00
8 changed files with 145 additions and 129 deletions
Showing only changes of commit cdd1d0f83d - Show all commits

View File

@ -10,25 +10,30 @@
* duotone 支持
*/
import { FontAwesomeIconProps } from '@/components/FontAwesomeIcon/props';
import { computed, ref } from 'vue';
const props = defineProps(FontAwesomeIconProps);
const emit = defineEmits<{
(e: 'click'): void;
}>();
const singleBeat = props.beat && !props.fade;
const singleFade = !props.beat && props.fade;
const beatFade = props.beat && props.fade;
const count =
props.counter > props.counterMax ? `${props.counterMax}+` : props.counter;
const wrapClassObject = [
const singleBeat = ref(props.beat && !props.fade);
const singleFade = ref(!props.beat && props.fade);
const beatFade = ref(props.beat && props.fade);
const count = computed(() => {
return props.counter > props.counterMax
? `${props.counterMax}+`
: props.counter;
});
const wrapClassObject = computed(() => {
return [
props.float ? `fa-pull-${props.float}` : '',
props.border ? 'fa-border' : '',
props.rotate ? 'fa-rotate-by' : '',
props.rotateFlip ? `fa-flip-${props.rotateFlip}` : '',
singleBeat ? `fa-beat` : '',
singleFade ? `fa-fade` : '',
beatFade ? `fa-beat-fade` : '',
singleBeat.value ? `fa-beat` : '',
singleFade.value ? `fa-fade` : '',
beatFade.value ? `fa-beat-fade` : '',
props.bounce ? 'fa-bounce' : '',
props.flip ? 'fa-flip' : '',
props.shake ? 'fa-shake' : '',
@ -40,8 +45,9 @@
props.stackInverse ? 'fa-inverse' : '',
props.counter ? 'layers' : '',
];
const wrapStyleObject = Object.assign(
});
const wrapStyleObject = computed(() => {
return Object.assign(
{
'--fa-animation-duration': `${props.duration}s`,
},
@ -51,9 +57,9 @@
}
: {},
props.rotate ? { '--fa-rotate-angle': `${props.rotate}deg` } : {},
singleBeat ? { '--fa-beat-scale': `${props.scale}` } : {},
singleFade ? { '--fa-fade-opacity': `${props.opacity}` } : {},
beatFade
singleBeat.value ? { '--fa-beat-scale': `${props.scale}` } : {},
singleFade.value ? { '--fa-fade-opacity': `${props.opacity}` } : {},
beatFade.value
? {
'--fa-beat-fade-scale': `${props.scale}`,
'--fa-beat-fade-opacity': `${props.opacity}`,
@ -63,12 +69,16 @@
? {
'--fa-bounce-rebound': props.bounceConfig?.rebound || '-0.125em',
'--fa-bounce-height': props.bounceConfig?.height || '-0.5em',
'--fa-bounce-start-scale-x': props.bounceConfig?.startScaleX || '1.1',
'--fa-bounce-start-scale-y': props.bounceConfig?.startScaleY || '0.9',
'--fa-bounce-start-scale-x':
props.bounceConfig?.startScaleX || '1.1',
'--fa-bounce-start-scale-y':
props.bounceConfig?.startScaleY || '0.9',
'--fa-bounce-jump-scale-x': props.bounceConfig?.jumpScaleX || '0.9',
'--fa-bounce-jump-scale-y': props.bounceConfig?.jumpScaleY || '1.1',
'--fa-bounce-land-scale-x': props.bounceConfig?.landScaleX || '1.05',
'--fa-bounce-land-scale-y': props.bounceConfig?.landScaleY || '0.95',
'--fa-bounce-land-scale-x':
props.bounceConfig?.landScaleX || '1.05',
'--fa-bounce-land-scale-y':
props.bounceConfig?.landScaleY || '0.95',
}
: {},
props.flip
@ -111,14 +121,18 @@
}
: {},
);
});
const iconClassObject = [
const iconClassObject = computed(() => {
return [
`fa-${props.mode}`,
`fa-${props.name}`,
props.frameSize ? `fa-flip-${props.frameSize}` : '',
props.sharp ? 'fass' : '',
];
const iconStyleObject = Object.assign(
});
const iconStyleObject = computed(() => {
return Object.assign(
{},
props.color
? {
@ -131,10 +145,13 @@
}
: {},
);
});
const counterStyleObject = {
const counterStyleObject = computed(() => {
return {
'--fa-counter-background-color': props.counterMgColor,
};
});
const onClick = () => {
emit('click');

View File

@ -66,17 +66,20 @@ export const FontAwesomeIconProps = {
* @description
*/
rotate: {
type: [Number, String],
default: 0,
type: [Number, String, Boolean],
default: false,
},
/** icon rotateFlip
* @description -
*/
rotateFlip: {
type: String,
type: [String, Boolean],
default: false,
validator(value: string) {
// The value must match one of these strings
return ['horizontal', 'vertical', 'both'].includes(value);
return ['horizontal', 'vertical', 'both', 'inherit', false].includes(
value,
);
},
},
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.