All files / src/utils/icons icons.ts

100% Statements 11/11
100% Branches 3/3
100% Functions 5/5
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155    95x 95x                                                                                                                   95x                                                                                                                 95x             1x               97x             3x 1x   2x               5x      
import { IDictionary } from '@zeedhi/core';
 
export class Icons {
	private static mdiIcons: IDictionary<string> = {
		alertOctagon: 'mdi-alert-octagon',
		cancel: 'mdi-close-circle',
		calendar: 'mdi-calendar',
		checkboxIndeterminate: 'mdi-minus-box',
		checkboxOff: 'mdi-checkbox-blank-outline',
		checkboxOn: 'mdi-checkbox-marked',
		chevronUp: 'mdi-chevron-up',
		chevronRight: 'mdi-chevron-right',
		clear: 'mdi-close',
		close: 'mdi-close',
		complete: 'mdi-check',
		contentCopy: 'mdi-content-copy',
		delete: 'mdi-close-circle',
		delimiter: 'mdi-circle',
		dropdown: 'mdi-menu-down',
		edit: 'mdi-pencil',
		error: 'mdi-alert',
		expand: 'mdi-chevron-down',
		eye: 'mdi-eye',
		eyeOff: 'mdi-eye-off',
		file: 'mdi-paperclip',
		fileDownload: 'mdi-file-download-outline',
		first: 'mdi-page-first',
		info: 'mdi-information',
		infoOutline: 'mdi-information-outline',
		last: 'mdi-page-last',
		loading: 'mdi-cached',
		magnify: 'mdi-magnify',
		menu: 'mdi-menu',
		messageAlert: 'mdi-message-alert',
		minus: 'mdi-minus',
		next: 'mdi-chevron-right',
		pencil: 'mdi-pencil',
		pencilOff: 'mdi-pencil-off',
		plus: 'mdi-plus',
		prev: 'mdi-chevron-left',
		radioOff: 'mdi-radiobox-blank',
		radioOn: 'mdi-radiobox-marked',
		shieldCheck: 'mdi-shield-check',
		starOutline: 'mdi-star-outline',
		star: 'mdi-star',
		starHalf: 'mdi-star-half',
		sort: 'mdi-arrow-up',
		subgroup: 'mdi-menu-down',
		success: 'mdi-check-circle',
		tableConfig: 'mdi-table-cog',
		tableColumns: 'mdi-table-headers-eye',
		unfold: 'mdi-unfold-more-horizontal',
		warning: 'mdi-exclamation',
		zoom: 'mdi-magnify',
		zoomIn: 'mdi-plus-circle-outline',
		zoomPanning: 'mdi-hand-back-right-outline',
		zoomOut: 'mdi-minus-circle-outline',
		zoomReset: 'mdi-magnify-close',
		zoomSelection: 'mdi-magnify-scan',
	};
 
	private static faIcons: IDictionary<string> = {
		alertOctagon: 'fa fa-exclamation-circle',
		cancel: 'fa fa-times-circle',
		calendar: 'fa fa-calendar-o',
		checkboxIndeterminate: 'fa fa-minus-square',
		checkboxOff: 'fa fa-square-o',
		checkboxOn: 'fa fa-check-square-o',
		chevronUp: 'fa fa-chevron-up',
		chevronRight: 'fa fa-chevron-right',
		clear: 'fa fa-times',
		close: 'fa fa-times',
		complete: 'fa fa-check',
		contentCopy: 'fa fa-clone',
		delete: 'fa fa-times-circle',
		delimiter: 'fa fa-circle',
		dropdown: 'fa fa-caret-down',
		edit: 'fa fa-pencil',
		error: 'fa fa-exclamation-triangle',
		expand: 'fa fa-chevron-down',
		eye: 'fa fa-eye',
		eyeOff: 'fa fa-eye-slash',
		file: 'fa fa-paperclip',
		fileDownload: 'fas fa-file-download',
		first: 'fa fa-step-backward',
		info: 'fa fa-info-circle',
		infoOutline: 'fa fa-info-circle',
		last: 'fa fa-step-forward',
		loading: 'fa fa-refresh',
		magnify: 'fa fa-search',
		menu: 'fa fa-bars',
		messageAlert: 'fa fa-exclamation',
		minus: 'fa fa-minus',
		next: 'fa fa-chevron-right',
		pencil: 'fa fa-pencil',
		plus: 'fa fa-plus',
		prev: 'fa fa-chevron-left',
		radioOff: 'fa fa-circle-o',
		radioOn: 'fa fa-stop-circle-o',
		shieldCheck: 'far fa-shield-check',
		starOutline: 'fa fa-star-o',
		star: 'fa fa-star',
		starHalf: 'fa fa-star-half-o',
		sort: 'fa fa-arrow-up',
		subgroup: 'fa fa-caret-down',
		success: 'fa fa-check-circle',
		tableConfig: 'fa fa-columns',
		tableColumns: 'fa fa-columns',
		unfold: 'fa fa-sort',
		warning: 'fa fa-exclamation',
		zoom: 'fa fa-search',
		zoomIn: 'fa fa-search-plus',
		zoomPanning: 'fa fa-hand-paper',
		zoomOut: 'fa fa-search-minus',
		zoomReset: 'fa fa-undo',
		zoomSelection: 'fa fa-expand',
	};
 
	private static icons: IDictionary<string> = (() => Icons.mdiIcons)();
 
	/**
	 * Replace all the icons
	 * @param icons icons to be set
	 */
	public static setIcons(icons: IDictionary<string>) {
		Icons.icons = { ...icons };
	}
 
	/**
	 * Add icons, replacing default values
	 * @param icons icons to be added
	 */
	public static addIcons(icons: IDictionary<string>) {
		Icons.icons = { ...Icons.icons, ...icons };
	}
 
	/**
	 * @param library defines the icon library that will be used
	 */
	public static changeIconLibrary(library = 'mdi') {
		if (library === 'fa') {
			Icons.addIcons(Icons.faIcons);
		} else {
			Icons.addIcons(Icons.mdiIcons);
		}
	}
 
	/**
	 * Get icons object
	 */
	public static getIcons(): IDictionary<string> {
		return Icons.icons;
	}
}