Use FontAwesome as web font instead of vue component (#7469)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * Update yarn.lock * wip * wip
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<div class="sub">
|
||||
<slot name="func"></slot>
|
||||
<button class="_button" v-if="foldable" @click="() => showBody = !showBody">
|
||||
<template v-if="showBody"><Fa :icon="faAngleUp"/></template>
|
||||
<template v-else><Fa :icon="faAngleDown"/></template>
|
||||
<template v-if="showBody"><i class="fas fa-angle-up"></i></template>
|
||||
<template v-else><i class="fas fa-angle-down"></i></template>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faAngleUp, faAngleDown } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
@@ -68,7 +67,6 @@ export default defineComponent({
|
||||
showBody: this.expanded,
|
||||
omitted: null,
|
||||
ignoreOmit: false,
|
||||
faAngleUp, faAngleDown
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -169,7 +167,7 @@ export default defineComponent({
|
||||
margin: 0;
|
||||
padding: 12px 16px;
|
||||
|
||||
> ::v-deep([data-icon]) {
|
||||
> ::v-deep(i) {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
|
@@ -4,8 +4,8 @@
|
||||
<div class="title"><slot name="header"></slot></div>
|
||||
<div class="divider"></div>
|
||||
<button class="_button">
|
||||
<template v-if="showBody"><Fa :icon="faAngleUp"/></template>
|
||||
<template v-else><Fa :icon="faAngleDown"/></template>
|
||||
<template v-if="showBody"><i class="fas fa-angle-up"></i></template>
|
||||
<template v-else><i class="fas fa-angle-down"></i></template>
|
||||
</button>
|
||||
</header>
|
||||
<transition name="folder-toggle"
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faAngleUp, faAngleDown } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const localStoragePrefix = 'ui:folder:';
|
||||
|
||||
@@ -43,7 +42,6 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
showBody: (this.persistKey && localStorage.getItem(localStoragePrefix + this.persistKey)) ? localStorage.getItem(localStoragePrefix + this.persistKey) === 't' : this.expanded,
|
||||
faAngleUp, faAngleDown
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -109,7 +107,7 @@ export default defineComponent({
|
||||
margin: 0;
|
||||
padding: 12px 16px 12px 0;
|
||||
|
||||
> [data-icon] {
|
||||
> i {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,13 @@
|
||||
<template>
|
||||
<div class="fpezltsf" :class="{ warn }">
|
||||
<i v-if="warn"><Fa :icon="faExclamationTriangle"/></i>
|
||||
<i v-else><Fa :icon="faInfoCircle"/></i>
|
||||
<i v-if="warn" class="fas fa-exclamation-triangle"></i>
|
||||
<i v-else class="fas fa-info-circle"></i>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faInfoCircle, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
||||
import * as os from '@client/os';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -21,7 +20,6 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
faInfoCircle, faExclamationTriangle
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<span class="label" ref="labelEl"><slot></slot></span>
|
||||
<span class="title" ref="title">
|
||||
<slot name="title"></slot>
|
||||
<span class="warning" v-if="invalid"><Fa :icon="faExclamationCircle"/>{{ $refs.input.validationMessage }}</span>
|
||||
<span class="warning" v-if="invalid"><i class="fas fa-exclamation-circle"></i>{{ $refs.input.validationMessage }}</span>
|
||||
</span>
|
||||
<div class="prefix" ref="prefixEl"><slot name="prefix"></slot></div>
|
||||
<input v-if="debounce" ref="inputEl"
|
||||
@@ -56,7 +56,6 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, onUnmounted, nextTick, ref, watch, computed, toRefs } from 'vue';
|
||||
import debounce from 'v-debounce';
|
||||
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
|
||||
import * as os from '@client/os';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -205,7 +204,6 @@ export default defineComponent({
|
||||
focus,
|
||||
onInput,
|
||||
onKeydown,
|
||||
faExclamationCircle,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
@@ -13,25 +13,25 @@
|
||||
<span><MkEllipsis/></span>
|
||||
</span>
|
||||
<MkA v-else-if="item.type === 'link'" :to="item.to" @click.passive="close()" :tabindex="i" class="_button item">
|
||||
<Fa v-if="item.icon" :icon="item.icon" fixed-width/>
|
||||
<i v-if="item.icon" class="fa-fw" :class="item.icon"></i>
|
||||
<MkAvatar v-if="item.avatar" :user="item.avatar" class="avatar"/>
|
||||
<span>{{ item.text }}</span>
|
||||
<i v-if="item.indicate"><Fa :icon="faCircle"/></i>
|
||||
<span v-if="item.indicate" class="indicator"><i class="fas fa-circle"></i></span>
|
||||
</MkA>
|
||||
<a v-else-if="item.type === 'a'" :href="item.href" :target="item.target" :download="item.download" @click="close()" :tabindex="i" class="_button item">
|
||||
<Fa v-if="item.icon" :icon="item.icon" fixed-width/>
|
||||
<i v-if="item.icon" class="fa-fw" :class="item.icon"></i>
|
||||
<span>{{ item.text }}</span>
|
||||
<i v-if="item.indicate"><Fa :icon="faCircle"/></i>
|
||||
<span v-if="item.indicate" class="indicator"><i class="fas fa-circle"></i></span>
|
||||
</a>
|
||||
<button v-else-if="item.type === 'user'" @click="clicked(item.action, $event)" :tabindex="i" class="_button item">
|
||||
<MkAvatar :user="item.user" class="avatar"/><MkUserName :user="item.user"/>
|
||||
<i v-if="item.indicate"><Fa :icon="faCircle"/></i>
|
||||
<span v-if="item.indicate" class="indicator"><i class="fas fa-circle"></i></span>
|
||||
</button>
|
||||
<button v-else @click="clicked(item.action, $event)" :tabindex="i" class="_button item" :class="{ danger: item.danger }">
|
||||
<Fa v-if="item.icon" :icon="item.icon" fixed-width/>
|
||||
<i v-if="item.icon" class="fa-fw" :class="item.icon"></i>
|
||||
<MkAvatar v-if="item.avatar" :user="item.avatar" class="avatar"/>
|
||||
<span>{{ item.text }}</span>
|
||||
<i v-if="item.indicate"><Fa :icon="faCircle"/></i>
|
||||
<span v-if="item.indicate" class="indicator"><i class="fas fa-circle"></i></span>
|
||||
</button>
|
||||
</template>
|
||||
<span v-if="_items.length === 0" class="none item">
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import { faCircle } from '@fortawesome/free-solid-svg-icons';
|
||||
import { focusPrev, focusNext } from '@client/scripts/focus';
|
||||
import contains from '@client/scripts/contains';
|
||||
|
||||
@@ -65,7 +64,6 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
_items: [],
|
||||
faCircle,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -207,7 +205,7 @@ export default defineComponent({
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
> [data-icon] {
|
||||
> i {
|
||||
margin-right: 4px;
|
||||
width: 20px;
|
||||
}
|
||||
@@ -218,7 +216,7 @@ export default defineComponent({
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
> i {
|
||||
> .indicator {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 13px;
|
||||
|
@@ -2,12 +2,12 @@
|
||||
<MkModal ref="modal" @click="$emit('click')" @closed="$emit('closed')">
|
||||
<div class="ebkgoccj _popup _narrow_" @keydown="onKeydown" :style="{ width: `${width}px`, height: scroll ? (height ? `${height}px` : null) : (height ? `min(${height}px, 100%)` : '100%') }">
|
||||
<div class="header">
|
||||
<button class="_button" v-if="withOkButton" @click="$emit('close')"><Fa :icon="faTimes"/></button>
|
||||
<button class="_button" v-if="withOkButton" @click="$emit('close')"><i class="fas fa-times"></i></button>
|
||||
<span class="title">
|
||||
<slot name="header"></slot>
|
||||
</span>
|
||||
<button class="_button" v-if="!withOkButton" @click="$emit('close')"><Fa :icon="faTimes"/></button>
|
||||
<button class="_button" v-if="withOkButton" @click="$emit('ok')" :disabled="okButtonDisabled"><Fa :icon="faCheck"/></button>
|
||||
<button class="_button" v-if="!withOkButton" @click="$emit('close')"><i class="fas fa-times"></i></button>
|
||||
<button class="_button" v-if="withOkButton" @click="$emit('ok')" :disabled="okButtonDisabled"><i class="fas fa-check"></i></button>
|
||||
</div>
|
||||
<div class="body" v-if="padding">
|
||||
<div class="_section">
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faTimes, faCheck } from '@fortawesome/free-solid-svg-icons';
|
||||
import MkModal from './modal.vue';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -72,7 +71,6 @@ export default defineComponent({
|
||||
|
||||
data() {
|
||||
return {
|
||||
faTimes, faCheck
|
||||
};
|
||||
},
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
</select>
|
||||
<div class="suffix">
|
||||
<slot name="suffix">
|
||||
<Fa :icon="faChevronDown"/>
|
||||
<i class="fas fa-chevron-down"></i>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faChevronDown } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
@@ -49,7 +48,6 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
focused: false,
|
||||
faChevronDown,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@@ -4,13 +4,13 @@
|
||||
<div class="body _popup _shadow _narrow_" @mousedown="onBodyMousedown" @keydown="onKeydown">
|
||||
<div class="header" :class="{ mini }" @contextmenu.prevent.stop="onContextmenu">
|
||||
<slot v-if="closeRight" name="buttons"><button class="_button" style="pointer-events: none;"></button></slot>
|
||||
<button v-else class="_button" @click="close()"><Fa :icon="faTimes"/></button>
|
||||
<button v-else class="_button" @click="close()"><i class="fas fa-times"></i></button>
|
||||
|
||||
<span class="title" @mousedown.prevent="onHeaderMousedown" @touchstart.prevent="onHeaderMousedown">
|
||||
<slot name="header"></slot>
|
||||
</span>
|
||||
|
||||
<button v-if="closeRight" class="_button" @click="close()"><Fa :icon="faTimes"/></button>
|
||||
<button v-if="closeRight" class="_button" @click="close()"><i class="fas fa-times"></i></button>
|
||||
<slot v-else name="buttons"><button class="_button" style="pointer-events: none;"></button></slot>
|
||||
</div>
|
||||
<div class="body" v-if="padding">
|
||||
@@ -38,7 +38,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { faTimes, faCheck } from '@fortawesome/free-solid-svg-icons';
|
||||
import contains from '@client/scripts/contains';
|
||||
import * as os from '@client/os';
|
||||
|
||||
@@ -114,7 +113,6 @@ export default defineComponent({
|
||||
return {
|
||||
showing: true,
|
||||
id: Math.random().toString(), // TODO: UUIDとかにする
|
||||
faTimes
|
||||
};
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user