3 v-model:open="wrappedOpen"
4 class="mw-block-confirm"
5 :use-close-button="true"
6 :primary-action="primaryAction"
7 :default-action="defaultAction"
10 @default="wrappedOpen = false"
17 const { defineComponent, toRef } = require( 'vue' );
18 const { CdxDialog, DialogAction, PrimaryDialogAction, useModelWrapper } = require( '@wikimedia/codex' );
21 * Confirmation dialog component for use by Special:Block.
23 * @todo Abstract for general use in MediaWiki (T375220)
25 module.exports = exports = defineComponent( {
26 name: 'ConfirmationDialog',
31 // eslint-disable-next-line vue/no-unused-properties
41 emits: [ 'update:open', 'confirm' ],
42 setup( props, { emit } ) {
43 const wrappedOpen = useModelWrapper( toRef( props, 'open' ), emit, 'update:open' );
45 /** @type {PrimaryDialogAction} */
46 const primaryAction = {
47 label: mw.msg( 'block-confirm-yes' ),
48 actionType: 'destructive'
51 /** @type {DialogAction} */
52 const defaultAction = {
53 label: mw.msg( 'block-confirm-no' ),
57 function onConfirm() {
58 wrappedOpen.value = false;