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

Haixing-Hu / js-common-ui-quasar / d4ee041b-895b-48d6-8139-752bcbf9b5d7

08 Jan 2025 04:10PM UTC coverage: 73.451% (-1.3%) from 74.725%
d4ee041b-895b-48d6-8139-752bcbf9b5d7

push

circleci

Haixing-Hu
refactor: refactor

35 of 50 branches covered (70.0%)

Branch coverage included in aggregate %.

8 of 15 new or added lines in 4 files covered. (53.33%)

1 existing line in 1 file now uncovered.

48 of 63 relevant lines covered (76.19%)

2.54 hits per line

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

81.82
/src/impl/get-html-icon.js
1
////////////////////////////////////////////////////////////////////////////////
2
//
3
//    Copyright (c) 2022 - 2024.
4
//    Haixing Hu, Qubit Co. Ltd.
5
//
6
//    All rights reserved.
7
//
8
////////////////////////////////////////////////////////////////////////////////
9
import {
10
  getCssColor,
11
  getFontAwesomeIcon,
12
  getBootstrapIcon,
13
  getMaterialSymbolIcon,
14
} from '@qubit-ltd/common-ui';
15
import getIconSetName from '../get-quasar-icon-set';
16

17
/**
18
 * 获取不同类型对话框对应的图标,以 HTML 代码形式表示。
19
 *
20
 * @param {string} type
21
 *     对话框类型。
22
 * @return {string}
23
 *     对应的图标,以 HTML 代码形式表示。
24
 */
25
function getHtmlIcon(type) {
26
  const iconSet = getIconSetName();
2✔
27
  const color = getCssColor(type);
2✔
28
  const baseMaterialStyle = "font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48";
2✔
29
  switch (iconSet) {
2!
30
    case 'fontawesome':
31
      return `<i class="${getFontAwesomeIcon(type)}" style="font-size: 1.5em; color: ${color};"></i>`;
1✔
32
    case 'bootstrap':
NEW
33
      return `<i class="${getBootstrapIcon(type)}" style="font-size: 1.5em; color: ${color};"></i>`;
×
34
    case 'material':
35
    default:
36
      return `<i class="material-symbols-rounded" style="${baseMaterialStyle}; font-size: 1.5em; color: ${color};">${getMaterialSymbolIcon(type)}</i>`;
1✔
37
  }
38
}
39

40
export default getHtmlIcon;
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