feat: refine announcement (#11497)

* wip

* Update read-announcement.ts

* wip

* wip

* wip

* Update index.d.ts

* wip

* Create 1691649257651-refine-announcement.js

* wip

* wip

* wip

* wip

* wip

* wip

* Update announcements.vue

* wip

* wip

* Update announcements.vue

* wip

* Update announcements.vue

* wip

* Update misskey-js.api.md

* Update users.ts

* Create MkAnnouncementDialog.stories.impl.ts

* wip

* wip

* Create AnnouncementService.ts
This commit is contained in:
syuilo 2023-08-13 20:12:29 +09:00 committed by GitHub
parent 2896fc6cb4
commit 9487856495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1226 additions and 223 deletions

View file

@ -12,10 +12,15 @@ SPDX-License-Identifier: AGPL-3.0-only
:class="$style.input"
@keydown.enter="toggle"
>
<XButton :checked="checked" :disabled="disabled" @toggle="toggle" />
<XButton :checked="checked" :disabled="disabled" @toggle="toggle"/>
<span :class="$style.body">
<!-- TODO: 無名slotの方は廃止 -->
<span :class="$style.label" @click="toggle"><slot name="label"></slot><slot></slot></span>
<span :class="$style.label">
<span @click="toggle">
<slot name="label"></slot><slot></slot>
</span>
<span v-if="helpText" v-tooltip:dialog="helpText" class="_button _help" :class="$style.help"><i class="ti ti-help-circle"></i></span>
</span>
<p :class="$style.caption"><slot name="caption"></slot></p>
</span>
</div>
@ -28,6 +33,7 @@ import XButton from '@/components/MkSwitch.button.vue';
const props = defineProps<{
modelValue: boolean | Ref<boolean>;
disabled?: boolean;
helpText?: string;
}>();
const emit = defineEmits<{
@ -38,10 +44,6 @@ const checked = toRefs(props).modelValue;
const toggle = () => {
if (props.disabled) return;
emit('update:modelValue', !checked.value);
if (!checked.value) {
}
};
</script>
@ -98,4 +100,10 @@ const toggle = () => {
display: none;
}
}
.help {
margin-left: 0.5em;
font-size: 85%;
vertical-align: top;
}
</style>