This commit is contained in:
syuilo
2020-09-05 10:06:59 +09:00
parent c49e5a80be
commit 190486d841
69 changed files with 284 additions and 284 deletions

View File

@@ -110,7 +110,7 @@ export default defineComponent({
}
},
callback(response?: string) {
this.$emit('input', typeof response == 'string' ? response : null);
this.$emit('update:value', typeof response == 'string' ? response : null);
},
},
});

View File

@@ -36,7 +36,7 @@ export default defineComponent({
length,
toggle() {
this.$emit('input', !this.value);
this.$emit('update:value', !this.value);
}
}
});

View File

@@ -5,7 +5,7 @@
<div class="wtdtxvec">
<template v-if="edit">
<header>
<mk-select v-model="widgetAdderSelected" style="margin-bottom: var(--margin)">
<mk-select v-model:value="widgetAdderSelected" style="margin-bottom: var(--margin)">
<template #label>{{ $t('selectWidget') }}</template>
<option v-for="widget in widgets" :value="widget" :key="widget">{{ $t(`_widgets.${widget}`) }}</option>
</mk-select>

View File

@@ -23,9 +23,9 @@
<header v-if="title" v-html="title"></header>
<header v-if="title == null && user">{{ $t('enterUsername') }}</header>
<div class="body" v-if="text" v-html="text"></div>
<mk-input v-if="input" v-model="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder" @keydown="onInputKeydown"></mk-input>
<mk-input v-if="user" v-model="userInputValue" autofocus @keydown="onInputKeydown"><template #prefix>@</template></mk-input>
<mk-select v-if="select" v-model="selectedValue" autofocus>
<mk-input v-if="input" v-model:value="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder" @keydown="onInputKeydown"></mk-input>
<mk-input v-if="user" v-model:value="userInputValue" autofocus @keydown="onInputKeydown"><template #prefix>@</template></mk-input>
<mk-select v-if="select" v-model:value="selectedValue" autofocus>
<template v-if="select.items">
<option v-for="item in select.items" :value="item.value">{{ item.text }}</option>
</template>

View File

@@ -5,19 +5,19 @@
</template>
<div class="xkpnjxcv">
<label v-for="item in Object.keys(form).filter(item => !form[item].hidden)" :key="item">
<mk-input v-if="form[item].type === 'number'" v-model="values[item]" type="number" :step="form[item].step || 1">
<mk-input v-if="form[item].type === 'number'" v-model:value="values[item]" type="number" :step="form[item].step || 1">
<span v-text="form[item].label || item"></span>
<template v-if="form[item].description" #desc>{{ form[item].description }}</template>
</mk-input>
<mk-input v-else-if="form[item].type === 'string' && !item.multiline" v-model="values[item]" type="text">
<mk-input v-else-if="form[item].type === 'string' && !item.multiline" v-model:value="values[item]" type="text">
<span v-text="form[item].label || item"></span>
<template v-if="form[item].description" #desc>{{ form[item].description }}</template>
</mk-input>
<mk-textarea v-else-if="form[item].type === 'string' && item.multiline" v-model="values[item]">
<mk-textarea v-else-if="form[item].type === 'string' && item.multiline" v-model:value="values[item]">
<span v-text="form[item].label || item"></span>
<template v-if="form[item].description" #desc>{{ form[item].description }}</template>
</mk-textarea>
<mk-switch v-else-if="form[item].type === 'boolean'" v-model="values[item]">
<mk-switch v-else-if="form[item].type === 'boolean'" v-model:value="values[item]">
<span v-text="form[item].label || item"></span>
<template v-if="form[item].description" #desc>{{ form[item].description }}</template>
</mk-switch>

View File

@@ -87,7 +87,7 @@
<div class="_title" style="position: relative;"><fa :icon="faChartBar"/> {{ $t('statistics') }}<button @click="fetchChart" class="_button" style="position: absolute; right: 0; bottom: 0; top: 0; padding: inherit;"><fa :icon="faSync"/></button></div>
<div class="_content" style="margin-top: -8px;">
<div class="selects" style="display: flex;">
<mk-select v-model="chartSrc" style="margin: 0; flex: 1;">
<mk-select v-model:value="chartSrc" style="margin: 0; flex: 1;">
<optgroup :label="$t('federation')">
<option value="federation-instances">{{ $t('_charts.federationInstancesIncDec') }}</option>
<option value="federation-instances-total">{{ $t('_charts.federationInstancesTotal') }}</option>
@@ -110,7 +110,7 @@
<option value="drive-total">{{ $t('_charts.storageUsageTotal') }}</option>
</optgroup>
</mk-select>
<mk-select v-model="chartSpan" style="margin: 0;">
<mk-select v-model:value="chartSpan" style="margin: 0;">
<option value="hour">{{ $t('perHour') }}</option>
<option value="day">{{ $t('perDay') }}</option>
</mk-select>

View File

@@ -6,7 +6,7 @@
<div class="body">
<p v-if="note.cw != null" class="cw">
<span class="text" v-if="note.cw != ''">{{ note.cw }}</span>
<x-cw-button v-model="showContent" :note="note"/>
<x-cw-button v-model:value="showContent" :note="note"/>
</p>
<div class="content" v-show="note.cw == null || showContent">
<x-sub-note-content class="text" :note="note"/>

View File

@@ -7,7 +7,7 @@
<div class="body">
<p v-if="note.cw != null" class="cw">
<mfm v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis" />
<x-cw-button v-model="showContent" :note="note"/>
<x-cw-button v-model:value="showContent" :note="note"/>
</p>
<div class="content" v-show="note.cw == null || showContent">
<x-sub-note-content class="text" :note="note"/>

View File

@@ -41,7 +41,7 @@
<div class="body" ref="noteBody">
<p v-if="appearNote.cw != null" class="cw">
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis"/>
<x-cw-button v-model="showContent" :note="appearNote"/>
<x-cw-button v-model:value="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
<div class="text">

View File

@@ -3,7 +3,7 @@
<template #header>{{ $t('notificationSetting') }}</template>
<div class="vv94n3oa">
<div v-if="showGlobalToggle">
<mk-switch v-model="useGlobalSetting">
<mk-switch v-model:value="useGlobalSetting">
{{ $t('useGlobalSetting') }}
<template #desc>{{ $t('useGlobalSettingDesc') }}</template>
</mk-switch>
@@ -12,7 +12,7 @@
<mk-info>{{ $t('notificationSettingDesc') }}</mk-info>
<mk-button inline @click="disableAll">{{ $t('disableAll') }}</mk-button>
<mk-button inline @click="enableAll">{{ $t('enableAll') }}</mk-button>
<mk-switch v-for="type in notificationTypes" :key="type" v-model="typesMap[type]">{{ $t(`_notification._types.${type}`) }}</mk-switch>
<mk-switch v-for="type in notificationTypes" :key="type" v-model:value="typesMap[type]">{{ $t(`_notification._types.${type}`) }}</mk-switch>
</div>
</div>
</x-window>

View File

@@ -1,6 +1,6 @@
<template>
<div>
<mk-input class="kudkigyw" v-model="v" type="number">{{ hpml.interpolate(value.text) }}</mk-input>
<mk-input class="kudkigyw" v-model:value="v" type="number">{{ hpml.interpolate(value.text) }}</mk-input>
</div>
</template>

View File

@@ -1,7 +1,7 @@
<template>
<div>
<div>{{ hpml.interpolate(value.title) }}</div>
<mk-radio v-for="x in value.values" v-model="v" :value="x" :key="x">{{ x }}</mk-radio>
<mk-radio v-for="x in value.values" v-model:value="v" :value="x" :key="x">{{ x }}</mk-radio>
</div>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<div class="hkcxmtwj">
<mk-switch v-model="v">{{ hpml.interpolate(value.text) }}</mk-switch>
<mk-switch v-model:value="v">{{ hpml.interpolate(value.text) }}</mk-switch>
</div>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<div>
<mk-input class="kudkigyw" v-model="v" type="text">{{ hpml.interpolate(value.text) }}</mk-input>
<mk-input class="kudkigyw" v-model:value="v" type="text">{{ hpml.interpolate(value.text) }}</mk-input>
</div>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<div>
<mk-textarea v-model="v">{{ hpml.interpolate(value.text) }}</mk-textarea>
<mk-textarea v-model:value="v">{{ hpml.interpolate(value.text) }}</mk-textarea>
</div>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<div class="iroscrza" :class="{ center: page.alignCenter, serif: page.font === 'serif' }" v-if="hpml">
<x-block v-for="child in page.content" :value="child" @input="v => updateBlock(v)" :page="page" :hpml="hpml" :key="child.id" :h="2"/>
<x-block v-for="child in page.content" :value="child" @onUpdate:value="v => updateBlock(v)" :page="page" :hpml="hpml" :key="child.id" :h="2"/>
</div>
</template>

View File

@@ -5,7 +5,7 @@
</p>
<ul ref="choices">
<li v-for="(choice, i) in choices" :key="i">
<mk-input class="input" :value="choice" @input="onInput(i, $event)">
<mk-input class="input" :value="choice" @onUpdate:value="onInput(i, $event)">
<span>{{ $t('_poll.choiceN', { n: i + 1 }) }}</span>
</mk-input>
<button @click="remove(i)" class="_button">
@@ -16,27 +16,27 @@
<mk-button class="add" v-if="choices.length < 10" @click="add">{{ $t('add') }}</mk-button>
<mk-button class="add" v-else disabled>{{ $t('_poll.noMore') }}</mk-button>
<section>
<mk-switch v-model="multiple">{{ $t('_poll.canMultipleVote') }}</mk-switch>
<mk-switch v-model:value="multiple">{{ $t('_poll.canMultipleVote') }}</mk-switch>
<div>
<mk-select v-model="expiration">
<mk-select v-model:value="expiration">
<template #label>{{ $t('_poll.expiration') }}</template>
<option value="infinite">{{ $t('_poll.infinite') }}</option>
<option value="at">{{ $t('_poll.at') }}</option>
<option value="after">{{ $t('_poll.after') }}</option>
</mk-select>
<section v-if="expiration === 'at'">
<mk-input v-model="atDate" type="date" class="input">
<mk-input v-model:value="atDate" type="date" class="input">
<span>{{ $t('_poll.deadlineDate') }}</span>
</mk-input>
<mk-input v-model="atTime" type="time" class="input">
<mk-input v-model:value="atTime" type="time" class="input">
<span>{{ $t('_poll.deadlineTime') }}</span>
</mk-input>
</section>
<section v-if="expiration === 'after'">
<mk-input v-model="after" type="number" class="input">
<mk-input v-model:value="after" type="number" class="input">
<span>{{ $t('_poll.duration') }}</span>
</mk-input>
<mk-select v-model="unit">
<mk-select v-model:value="unit">
<option value="second">{{ $t('_time.second') }}</option>
<option value="minute">{{ $t('_time.minute') }}</option>
<option value="hour">{{ $t('_time.hour') }}</option>

View File

@@ -2,12 +2,12 @@
<form class="eppvobhk" :class="{ signing, totpLogin }" @submit.prevent="onSubmit">
<div class="avatar" :style="{ backgroundImage: user ? `url('${ user.avatarUrl }')` : null }" v-show="withAvatar"></div>
<div class="normal-signin" v-if="!totpLogin">
<mk-input v-model="username" type="text" pattern="^[a-zA-Z0-9_]+$" spellcheck="false" autofocus required @input="onUsernameChange">
<mk-input v-model:value="username" type="text" pattern="^[a-zA-Z0-9_]+$" spellcheck="false" autofocus required @onUpdate:value="onUsernameChange">
<span>{{ $t('username') }}</span>
<template #prefix>@</template>
<template #suffix>@{{ host }}</template>
</mk-input>
<mk-input v-model="password" type="password" :with-password-toggle="true" v-if="!user || user && !user.usePasswordLessLogin" required>
<mk-input v-model:value="password" type="password" :with-password-toggle="true" v-if="!user || user && !user.usePasswordLessLogin" required>
<span>{{ $t('password') }}</span>
<template #prefix><fa :icon="faLock"/></template>
</mk-input>
@@ -28,11 +28,11 @@
</div>
<div class="twofa-group totp-group">
<p style="margin-bottom:0;">{{ $t('twoStepAuthentication') }}</p>
<mk-input v-model="password" type="password" :with-password-toggle="true" v-if="user && user.usePasswordLessLogin" required>
<mk-input v-model:value="password" type="password" :with-password-toggle="true" v-if="user && user.usePasswordLessLogin" required>
<span>{{ $t('password') }}</span>
<template #prefix><fa :icon="faLock"/></template>
</mk-input>
<mk-input v-model="token" type="text" pattern="^[0-9]{6}$" autocomplete="off" spellcheck="false" required>
<mk-input v-model:value="token" type="text" pattern="^[0-9]{6}$" autocomplete="off" spellcheck="false" required>
<span>{{ $t('token') }}</span>
<template #prefix><fa :icon="faGavel"/></template>
</mk-input>

View File

@@ -1,11 +1,11 @@
<template>
<form class="mk-signup" @submit.prevent="onSubmit" :autocomplete="Math.random()">
<template v-if="meta">
<mk-input v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required>
<mk-input v-if="meta.disableRegistration" v-model:value="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required>
<span>{{ $t('invitationCode') }}</span>
<template #prefix><fa :icon="faKey"/></template>
</mk-input>
<mk-input v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @input="onChangeUsername">
<mk-input v-model:value="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @onUpdate:value="onChangeUsername">
<span>{{ $t('username') }}</span>
<template #prefix>@</template>
<template #suffix>@{{ host }}</template>
@@ -19,7 +19,7 @@
<span v-if="usernameState == 'max-range'" style="color:#FF1161"><fa :icon="faExclamationTriangle" fixed-width/> {{ $t('tooLong') }}</span>
</template>
</mk-input>
<mk-input v-model="password" type="password" :autocomplete="Math.random()" required @input="onChangePassword">
<mk-input v-model:value="password" type="password" :autocomplete="Math.random()" required @onUpdate:value="onChangePassword">
<span>{{ $t('password') }}</span>
<template #prefix><fa :icon="faLock"/></template>
<template #desc>
@@ -28,7 +28,7 @@
<p v-if="passwordStrength == 'high'" style="color:#3CB7B5"><fa :icon="faCheck" fixed-width/> {{ $t('strongPassword') }}</p>
</template>
</mk-input>
<mk-input v-model="retypedPassword" type="password" :autocomplete="Math.random()" required @input="onChangePasswordRetype">
<mk-input v-model:value="retypedPassword" type="password" :autocomplete="Math.random()" required @onUpdate:value="onChangePasswordRetype">
<span>{{ $t('password') }} ({{ $t('retype') }})</span>
<template #prefix><fa :icon="faLock"/></template>
<template #desc>
@@ -36,13 +36,13 @@
<p v-if="passwordRetypeState == 'not-match'" style="color:#FF1161"><fa :icon="faExclamationTriangle" fixed-width/> {{ $t('passwordNotMatched') }}</p>
</template>
</mk-input>
<mk-switch v-model="ToSAgreement" v-if="meta.tosUrl">
<mk-switch v-model:value="ToSAgreement" v-if="meta.tosUrl">
<i18n-t path="agreeTo">
<a :href="meta.tosUrl" class="_link" target="_blank">{{ $t('tos') }}</a>
</i18n-t>
</mk-switch>
<captcha v-if="meta.enableHcaptcha" class="captcha" provider="hcaptcha" ref="hcaptcha" v-model="hCaptchaResponse" :sitekey="meta.hcaptchaSiteKey"/>
<captcha v-if="meta.enableRecaptcha" class="captcha" provider="grecaptcha" ref="recaptcha" v-model="reCaptchaResponse" :sitekey="meta.recaptchaSiteKey"/>
<captcha v-if="meta.enableHcaptcha" class="captcha" provider="hcaptcha" ref="hcaptcha" v-model:value="hCaptchaResponse" :sitekey="meta.hcaptchaSiteKey"/>
<captcha v-if="meta.enableRecaptcha" class="captcha" provider="grecaptcha" ref="recaptcha" v-model:value="reCaptchaResponse" :sitekey="meta.recaptchaSiteKey"/>
<mk-button type="submit" :disabled="shouldDisableSubmitting" primary>{{ $t('start') }}</mk-button>
</template>
</form>

View File

@@ -1,6 +1,6 @@
<template>
<div class="pxhvhrfw" v-size="{ max: [500] }">
<button v-for="item in items" class="_button" @click="$emit('input', item.value)" :class="{ active: value === item.value }" :key="item.value"><fa v-if="item.icon" :icon="item.icon" class="icon"/>{{ item.label }}</button>
<button v-for="item in items" class="_button" @click="$emit('update:value', item.value)" :class="{ active: value === item.value }" :key="item.value"><fa v-if="item.icon" :icon="item.icon" class="icon"/>{{ item.label }}</button>
</div>
</template>

View File

@@ -6,13 +6,13 @@
<mk-info warn>{{ information }}</mk-info>
</div>
<div>
<mk-input v-model="name">{{ $t('name') }}</mk-input>
<mk-input v-model:value="name">{{ $t('name') }}</mk-input>
</div>
<div>
<div style="margin-bottom: 16px;"><b>{{ $t('permission') }}</b></div>
<mk-button inline @click="disableAll">{{ $t('disableAll') }}</mk-button>
<mk-button inline @click="enableAll">{{ $t('enableAll') }}</mk-button>
<mk-switch v-for="kind in (initialPermissions || kinds)" :key="kind" v-model="permissions[kind]">{{ $t(`_permissions.${kind}`) }}</mk-switch>
<mk-switch v-for="kind in (initialPermissions || kinds)" :key="kind" v-model:value="permissions[kind]">{{ $t(`_permissions.${kind}`) }}</mk-switch>
</div>
</div>
</x-window>

View File

@@ -169,9 +169,9 @@ export default defineComponent({
},
v(v) {
if (this.type === 'number') {
this.$emit('input', parseFloat(v));
this.$emit('update:value', parseFloat(v));
} else {
this.$emit('input', v);
this.$emit('update:value', v);
}
this.invalid = this.$refs.input.validity.badInput;
@@ -228,7 +228,7 @@ export default defineComponent({
},
onChangeFile() {
this.v = Array.from((this.$refs.file as any).files);
this.$emit('input', this.v);
this.$emit('update:value', this.v);
this.$emit('change', this.v);
},
onInput(ev) {

View File

@@ -13,7 +13,7 @@
:autofocus="autofocus"
@focus="focused = true"
@blur="focused = false"
@input="$emit('input', $event.target.value)"
@input="$emit('update:value', $event.target.value)"
/>
</div>
</template>

View File

@@ -58,7 +58,7 @@ export default defineComponent({
return this.value;
},
set(v) {
this.$emit('input', v);
this.$emit('update:value', v);
}
},
filled(): boolean {

View File

@@ -74,7 +74,7 @@ export default defineComponent({
},
onInput(ev) {
this.changed = true;
this.$emit('input', ev.target.value);
this.$emit('update:value', ev.target.value);
}
}
});

View File

@@ -3,8 +3,8 @@
<template #header>{{ $t('selectUser') }}</template>
<div class="tbhwbxda">
<div class="inputs">
<mk-input v-model="username" class="input" @input="search" ref="username"><span>{{ $t('username') }}</span><template #prefix>@</template></mk-input>
<mk-input v-model="host" class="input" @input="search"><span>{{ $t('host') }}</span><template #prefix>@</template></mk-input>
<mk-input v-model:value="username" class="input" @onUpdate:value="search" ref="username"><span>{{ $t('username') }}</span><template #prefix>@</template></mk-input>
<mk-input v-model:value="host" class="input" @onUpdate:value="search"><span>{{ $t('host') }}</span><template #prefix>@</template></mk-input>
</div>
<div class="users">
<div class="user" v-for="user in users" :key="user.id" :class="{ selected: selected && selected.id === user.id }" @click="selected = user" @dblclick="ok()">