• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uiv-lib / uiv / 28288252252

27 Jun 2026 11:46AM UTC coverage: 89.623% (+2.8%) from 86.862%
28288252252

push

github

wxsms
fix(ci): generate lcov.info for Coveralls

The vitest coverage config only emitted text and html reporters, so
the Coveralls step in CI failed with ENOENT on ./coverage/lcov.info.
Add the lcov reporter to match what the workflow expects.

Co-Authored-By: zhipu/glm-5 <zai-org@claude-code-best.win>

1119 of 1296 branches covered (86.34%)

Branch coverage included in aggregate %.

1688 of 1836 relevant lines covered (91.94%)

165.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.31
/src/components/messagebox/MessageBox.vue
1
<template>
2
  <modal
32✔
3
    ref="modal"
4
    v-model="show"
16✔
5
    auto-focus
6
    :size="size"
7
    :title="title"
8
    :header="!!title"
9
    :backdrop="closeOnBackdropClick"
10
    :cancel-text="cancelText"
11
    :ok-text="okText"
12
    :class="customClass"
13
    @hide="cb"
14
  >
15
    <div v-if="html" v-html="content"></div>
38✔
16
    <p v-else>{{ content }}</p>
17
    <div v-if="type === TYPES.PROMPT">
18✔
18
      <div class="form-group" :class="{ 'has-error': inputNotValid }">
19
        <input
20
          v-model="input"
3✔
21
          :type="inputType"
22
          class="form-control"
23
          required
24
          data-action="auto-focus"
25
          @change="dirty = true"
✔
26
          @keyup.enter="validate"
27
        />
28
        <span v-show="inputNotValid" class="help-block">{{ inputError }}</span>
29
      </div>
30
    </div>
31
    <template v-if="type === TYPES.ALERT" #footer>
32
      <btn
33
        :type="okType"
34
        :data-action="autoFocus === 'ok' ? 'auto-focus' : ''"
12!
35
        @click="hide('ok')"
5✔
36
        >{{ okBtnText }}</btn
12✔
37
      >
12✔
38
    </template>
39
    <template v-else #footer>
40
      <template v-if="reverseButtons">
26!
41
        <btn
42
          v-if="type === TYPES.CONFIRM"
×
43
          :type="okType"
44
          :data-action="autoFocus === 'ok' ? 'auto-focus' : ''"
×
45
          @click="hide('ok')"
×
46
          >{{ okBtnText }}</btn
×
47
        >
48
        <btn v-else :type="okType" @click="validate">{{ okBtnText }}</btn>
×
49
        <btn
50
          :type="cancelType"
51
          :data-action="autoFocus === 'cancel' ? 'auto-focus' : ''"
×
52
          @click="hide('cancel')"
×
53
          >{{ cancelBtnText }}</btn
×
54
        >
55
      </template>
26✔
56
      <template v-else>
57
        <btn
58
          :type="cancelType"
59
          :data-action="autoFocus === 'cancel' ? 'auto-focus' : ''"
26!
60
          @click="hide('cancel')"
6✔
61
          >{{ cancelBtnText }}</btn
26✔
62
        >
63
        <btn
64
          v-if="type === TYPES.CONFIRM"
26✔
65
          :type="okType"
66
          :data-action="autoFocus === 'ok' ? 'auto-focus' : ''"
8!
67
          @click="hide('ok')"
2✔
68
          >{{ okBtnText }}</btn
8✔
69
        >
70
        <btn v-else :type="okType" @click="validate">{{ okBtnText }}</btn>
18✔
71
      </template>
72
    </template>
73
  </modal>
74
</template>
75

76
<script setup>
77
import { TYPES } from '../../constants/messagebox.constants';
78
import { t } from '../../locale';
79
import Modal from '../../components/modal/Modal.vue';
80
import Btn from '../../components/button/Btn.vue';
81
import { isExist } from '../../utils/object.utils';
82
import { computed, ref } from 'vue';
83

84
const props = defineProps({
16✔
85
  backdrop: { type: null, default: undefined },
86
  title: { type: String, default: undefined },
87
  content: { type: String, default: undefined },
88
  html: { type: Boolean, default: false },
89
  okText: { type: String, default: undefined },
90
  okType: { type: String, default: 'primary' },
91
  cancelText: { type: String, default: undefined },
92
  cancelType: { type: String, default: 'default' },
93
  type: { type: Number, default: 0 },
94
  size: { type: String, default: 'sm' },
95
  cb: { type: Function, required: true },
96
  validator: {
97
    type: Function,
98
    default: () => null,
99
  },
100
  customClass: { type: null, default: undefined },
101
  defaultValue: { type: String, default: undefined },
102
  inputType: { type: String, default: 'text' },
103
  autoFocus: { type: String, default: 'ok' },
104
  reverseButtons: { type: Boolean, default: false },
105
});
106

107
const show = ref(true);
16✔
108
const input = ref(props.defaultValue ?? '');
16✔
109
const dirty = ref(false);
16✔
110
const modal = ref(null);
16✔
111

112
const closeOnBackdropClick = computed(() =>
16✔
113
  isExist(props.backdrop) ? !!props.backdrop : props.type !== TYPES.ALERT
16✔
114
);
115
const inputError = computed(() => props.validator(input.value));
16✔
116
const inputNotValid = computed(() => dirty.value && inputError.value);
16✔
117
const okBtnText = computed(() => props.okText || t('uiv.modal.ok'));
16✔
118
const cancelBtnText = computed(() => props.cancelText || t('uiv.modal.cancel'));
16✔
119

120
function hide(msg) {
121
  modal.value?.hideModal(msg);
15✔
122
}
123

124
function validate() {
125
  dirty.value = true;
3✔
126
  if (!isExist(inputError.value)) {
3✔
127
    hide({ value: input.value });
2✔
128
  }
129
}
130
</script>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc