From 906345d15b8a9f90de063e4afe55bdb0d1a7388a Mon Sep 17 00:00:00 2001 From: woothu <32914662+woothu@users.noreply.github.com> Date: Fri, 14 Jun 2019 11:06:46 +0200 Subject: [PATCH] refactor: remove external icon libraries --- package.json | 3 - src/App.vue | 8 - src/_nav.js | 18 +- src/icons.js | 48 + src/main.js | 4 +- src/router/index.js | 20 +- src/views/Dashboard.vue | 52 +- src/views/buttons/BrandButtons.vue | 429 ++-- src/views/icons/CoreUIIcons.vue | 11 +- src/views/icons/Flags.vue | 1016 +--------- src/views/icons/FontAwesome.vue | 2848 --------------------------- src/views/icons/SimpleLineIcons.vue | 751 ------- 12 files changed, 245 insertions(+), 4963 deletions(-) create mode 100644 src/icons.js delete mode 100644 src/views/icons/FontAwesome.vue delete mode 100644 src/views/icons/SimpleLineIcons.vue diff --git a/package.json b/package.json index a7337bd6..e0da24df 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,7 @@ "css-vars-ponyfill": "^1.11.1", "current-script-polyfill": "^1.0.0", "element-resize-detector": "^1.2.0", - "flag-icon-css": "^3.2.0", - "font-awesome": "^4.7.0", "perfect-scrollbar": "^1.4.0", - "simple-line-icons": "^2.4.1", "tooltip.js": "^1.3.1", "vue": "^2.6.6", "vue-chartjs": "^3.4.0", diff --git a/src/App.vue b/src/App.vue index 95a34f57..07353025 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,14 +11,6 @@ export default { diff --git a/src/_nav.js b/src/_nav.js index cf64ed56..2504cee7 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -157,12 +157,12 @@ export default { icon: 'cui-pie-chart' }, { - name: 'Icons', + name: 'CoreUI Icons', url: '/icons', icon: 'cui-star', children: [ { - name: 'CoreUI Icons', + name: 'Icons library', url: '/icons/coreui-icons', icon: 'cui-star', badge: { @@ -174,20 +174,6 @@ export default { name: 'Flags', url: '/icons/flags', icon: 'cui-star' - }, - { - name: 'Font Awesome', - url: '/icons/font-awesome', - icon: 'cui-star', - badge: { - variant: 'secondary', - text: '4.7' - } - }, - { - name: 'Simple Line Icons', - url: '/icons/simple-line-icons', - icon: 'cui-star' } ] }, diff --git a/src/icons.js b/src/icons.js new file mode 100644 index 00000000..fc18d52c --- /dev/null +++ b/src/icons.js @@ -0,0 +1,48 @@ +import { + facebook, + twitter, + linkedin, + flickr, + tumblr, + xing, + github, + stackOverflow, + youtube, + dribbble, + instagram, + pinterest, + vk, + yahoo, + behance, + reddit, + vimeo, + ccMastercard, ccVisa, stripe, paypal, googleWallet, ccAmex +} from '@coreui/icons/brands' +import { US, BR, IN, FR, ES, PL } from '@coreui/icons/flags' +import { iconSet } from '@coreui/icons' + +export const iconsSet = Object.assign( + {}, + iconSet, + { US, BR, IN, FR, ES, PL }, + { + facebook, + twitter, + linkedin, + flickr, + tumblr, + xing, + github, + stackOverflow, + youtube, + dribbble, + instagram, + pinterest, + vk, + yahoo, + behance, + reddit, + vimeo, + ccMastercard, ccVisa, stripe, paypal, googleWallet, ccAmex + } +) diff --git a/src/main.js b/src/main.js index df9356c6..34c8b3dd 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ import App from './App' import router from './router' import CoreuiVue from '@coreui/vue/src' import { CIconPlugin } from '@coreui/icons/vue' +import { iconsSet } from './icons.js' // import CoreuiVue from '@coreui/vue' // import CoreuiVue from '@coreui/vue/dist/custom.common.js' @@ -21,7 +22,8 @@ Vue.config.performance = true // todo // cssVars() Vue.use(CoreuiVue) -Vue.use(CIconPlugin) +// console.log(iconsSet) +Vue.use(CIconPlugin, iconsSet) /* eslint-disable no-new */ var vm = new Vue({ diff --git a/src/router/index.js b/src/router/index.js index 146b4676..2a22e85e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -39,8 +39,6 @@ const BrandButtons = () => import('@/views/buttons/BrandButtons') // Views - Icons const Flags = () => import('@/views/icons/Flags') -const FontAwesome = () => import('@/views/icons/FontAwesome') -const SimpleLineIcons = () => import('@/views/icons/SimpleLineIcons') const CoreUIIcons = () => import('@/views/icons/CoreUIIcons') // Views - Notifications @@ -62,7 +60,7 @@ Vue.use(Router) export default new Router({ mode: 'hash', // https://router.vuejs.org/api/#mode - linkActiveClass: 'active', + linkActiveClass: 'c-active', scrollBehavior: () => ({ y: 0 }), routes: [ { @@ -247,31 +245,21 @@ export default new Router({ }, { path: 'icons', - redirect: '/icons/font-awesome', - name: 'Icons', + redirect: '/icons/coreui-icons', + name: 'CoreUI Icons', component: { render (c) { return c('router-view') } }, children: [ { path: 'coreui-icons', - name: 'CoreUI Icons', + name: 'Icons library', component: CoreUIIcons }, { path: 'flags', name: 'Flags', component: Flags - }, - { - path: 'font-awesome', - name: 'Font Awesome', - component: FontAwesome - }, - { - path: 'simple-line-icons', - name: 'Simple Line Icons', - component: SimpleLineIcons } ] }, diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index d03477c0..f919afe7 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -384,9 +384,6 @@ head-variant="light" no-sorting > -
@@ -410,15 +407,13 @@ slot-scope="{item}" class="c-text-center" > - + -
+
{{item.usage.value}}%
@@ -437,7 +432,10 @@ slot-scope="{item}" class="c-text-center" > - +
Last login
@@ -457,7 +455,6 @@ import WidgetsSocial from './widgets/WidgetsSocial' import CalloutChartExample from './charts/CalloutChartExample' import CChartLineSimple from './charts/CChartLineSimple' - export default { name: 'Dashboard', components: { @@ -467,61 +464,61 @@ export default { WidgetsSocial, CChartLineSimple }, - data: function () { + data () { return { selected: 'Month', tableItems: [ { avatar: { url: 'img/avatars/1.jpg', status: 'success' }, user: { name: 'Yiorgos Avraamu', new: true, registered: 'Jan 1, 2015' }, - country: { name: 'USA', flag: 'us' }, + country: { name: 'USA', flag: 'US' }, usage: { value: 50, period: 'Jun 11, 2015 - Jul 10, 2015' }, - payment: { name: 'Mastercard', icon: 'fa fa-cc-mastercard' }, + payment: { name: 'Mastercard', icon: 'cc-mastercard' }, activity: '10 sec ago' }, { avatar: { url: 'img/avatars/2.jpg', status: 'danger' }, user: { name: 'Avram Tarasios', new: false, registered: 'Jan 1, 2015' }, - country: { name: 'Brazil', flag: 'br' }, + country: { name: 'Brazil', flag: 'BR' }, usage: { value: 22, period: 'Jun 11, 2015 - Jul 10, 2015' }, - payment: { name: 'Visa', icon: 'fa fa-cc-visa' }, + payment: { name: 'Visa', icon: 'cc-visa' }, activity: '5 minutes ago' }, { avatar: { url: 'img/avatars/3.jpg', status: 'warning' }, user: { name: 'Quintin Ed', new: true, registered: 'Jan 1, 2015' }, - country: { name: 'India', flag: 'in' }, + country: { name: 'India', flag: 'IN' }, usage: { value: 74, period: 'Jun 11, 2015 - Jul 10, 2015' }, - payment: { name: 'Stripe', icon: 'fa fa-cc-stripe' }, + payment: { name: 'Stripe', icon: 'stripe' }, activity: '1 hour ago' }, { avatar: { url: 'img/avatars/4.jpg', status: '' }, user: { name: 'Enéas Kwadwo', new: true, registered: 'Jan 1, 2015' }, - country: { name: 'France', flag: 'fr' }, + country: { name: 'France', flag: 'FR' }, usage: { value: 98, period: 'Jun 11, 2015 - Jul 10, 2015' }, - payment: { name: 'PayPal', icon: 'fa fa-paypal' }, + payment: { name: 'PayPal', icon: 'paypal' }, activity: 'Last month' }, { avatar: { url: 'img/avatars/5.jpg', status: 'success' }, user: { name: 'Agapetus Tadeáš', new: true, registered: 'Jan 1, 2015' }, - country: { name: 'Spain', flag: 'es' }, + country: { name: 'Spain', flag: 'ES' }, usage: { value: 22, period: 'Jun 11, 2015 - Jul 10, 2015' }, - payment: { name: 'Google Wallet', icon: 'fa fa-google-wallet' }, + payment: { name: 'Google Wallet', icon: 'google-wallet' }, activity: 'Last week' }, { avatar: { url: 'img/avatars/6.jpg', status: 'danger' }, user: { name: 'Friderik Dávid', new: true, registered: 'Jan 1, 2015' }, - country: { name: 'Poland', flag: 'pl' }, + country: { name: 'Poland', flag: 'PL' }, usage: { value: 43, period: 'Jun 11, 2015 - Jul 10, 2015' }, - payment: { name: 'Amex', icon: 'fa fa-cc-amex' }, + payment: { name: 'Amex', icon: 'cc-amex' }, activity: 'Last week' } ], tableFields: [ - { key: 'avatar', _classes: 'c-text-center' }, + { key: 'avatar', label: '', _classes: 'c-text-center' }, { key: 'user' }, { key: 'country', _classes: 'c-text-center' }, { key: 'usage' }, @@ -543,9 +540,6 @@ export default { $variant = 'danger' } return $variant - }, - flag (value) { - return 'flag-icon flag-icon-' + value } } } diff --git a/src/views/buttons/BrandButtons.vue b/src/views/buttons/BrandButtons.vue index ce5d6a84..1dbce303 100644 --- a/src/views/buttons/BrandButtons.vue +++ b/src/views/buttons/BrandButtons.vue @@ -8,154 +8,53 @@ Usage - <CButton variant="facebook"><span>Facebook</span></CButton> + + <CButton variant="facebook"><span>Facebook</span></CButton> +
Size Small Add size="sm"

- - - Facebook - - - Twitter - - - LinkedIn - - - Flickr - - - Tumblr - - - Xing - - - Github - - - HTML5 - - - OpenID - - - StackOverflow - - - CSS3 - - - YouTube - - - Dribbble - - - Google+ - - - Instagram - - - Pinterest - - - VK - - - Yahoo - - - Behance - - - Dropbox - - - Reddit - - - Spotify - - - Vine - - - Forsquare - - - Vimeo - + + {{brandName}} + +

Size Normal

- Facebook - Twitter - LinkedIn - Flickr - Tumblr - Xing - Github - HTML5 - OpenID - StackOverflow - CSS3 - YouTube - Dribbble - Google+ - Instagram - Pinterest - VK - Yahoo - Behance - Dropbox - Reddit - Spotify - Vine - Forsquare - Vimeo +

Size Large Add size="lg"

- Facebook - Twitter - LinkedIn - Flickr - Tumblr - Xing - Github - HTML5 - OpenID - StackOverflow - CSS3 - YouTube - Dribbble - Google+ - Instagram - Pinterest - VK - Yahoo - Behance - Dropbox - Reddit - Spotify - Vine - Forsquare - Vimeo +

@@ -166,91 +65,48 @@ Brand Button Icons only - Usage <CButton variant="facebook icon"><span>Facebook</span></CButton> + Usage + + {{ `` }} +
Size Small Add size="sm"

- - - - - - - - - - - - - - - - - - - - - - - - - +

Size Normal

- - - - - - - - - - - - - - - - - - - - - - - - - +

Size Large Add size="lg"

- - - - - - - - - - - - - - - - - - - - - - - - - +

@@ -262,91 +118,45 @@ Brand Button Text only - Usage <CButton variant="facebook text"><span>Facebook</span></CButton> + Usage <CButton variant="facebook"><span>Facebook</span></CButton>
Size Small Add size="sm"

- Facebook - Twitter - LinkedIn - Flickr - Tumblr - Xing - Github - HTML5 - OpenID - StackOverflow - CSS3 - YouTube - Dribbble - Google+ - Instagram - Pinterest - VK - Yahoo - Behance - Dropbox - Reddit - Spotify - Vine - Forsquare - Vimeo +

Size Normal

- Facebook - Twitter - LinkedIn - Flickr - Tumblr - Xing - Github - HTML5 - OpenID - StackOverflow - CSS3 - YouTube - Dribbble - Google+ - Instagram - Pinterest - VK - Yahoo - Behance - Dropbox - Reddit - Spotify - Vine - Forsquare - Vimeo +

Size Large Add size="lg"

- Facebook - Twitter - LinkedIn - Flickr - Tumblr - Xing - Github - HTML5 - OpenID - StackOverflow - CSS3 - YouTube - Dribbble - Google+ - Instagram - Pinterest - VK - Yahoo - Behance - Dropbox - Reddit - Spotify - Vine - Forsquare - Vimeo +

@@ -358,12 +168,53 @@ diff --git a/src/views/icons/CoreUIIcons.vue b/src/views/icons/CoreUIIcons.vue index a88cb16a..70dd9379 100644 --- a/src/views/icons/CoreUIIcons.vue +++ b/src/views/icons/CoreUIIcons.vue @@ -431,14 +431,15 @@
diff --git a/src/views/icons/Flags.vue b/src/views/icons/Flags.vue index a51ff33c..b023ac2a 100644 --- a/src/views/icons/Flags.vue +++ b/src/views/icons/Flags.vue @@ -13,1002 +13,17 @@ span. If you want to have a squared version flag then add the class flag-icon-squared as well. - - -
flag-icon-ad
-
- - -
flag-icon-ae
-
- - -
flag-icon-af
-
- - -
flag-icon-ag
-
- - -
flag-icon-ai
-
- - -
flag-icon-al
-
- - -
flag-icon-am
-
- - -
flag-icon-ao
-
- - -
flag-icon-aq
-
- - -
flag-icon-ar
-
- - -
flag-icon-as
-
- - -
flag-icon-at
-
- - -
flag-icon-au
-
- - -
flag-icon-aw
-
- - -
flag-icon-ax
-
- - -
flag-icon-az
-
- - -
flag-icon-ba
-
- - -
flag-icon-bb
-
- - -
flag-icon-bd
-
- - -
flag-icon-be
-
- - -
flag-icon-bf
-
- - -
flag-icon-bg
-
- - -
flag-icon-bh
-
- - -
flag-icon-bi
-
- - -
flag-icon-bj
-
- - -
flag-icon-bl
-
- - -
flag-icon-bm
-
- - -
flag-icon-bn
-
- - -
flag-icon-bo
-
- - -
flag-icon-bq
-
- - -
flag-icon-br
-
- - -
flag-icon-bs
-
- - -
flag-icon-bt
-
- - -
flag-icon-bv
-
- - -
flag-icon-bw
-
- - -
flag-icon-by
-
- - -
flag-icon-bz
-
- - -
flag-icon-ca
-
- - -
flag-icon-cc
-
- - -
flag-icon-cd
-
- - -
flag-icon-cf
-
- - -
flag-icon-cg
-
- - -
flag-icon-ch
-
- - -
flag-icon-ci
-
- - -
flag-icon-ck
-
- - -
flag-icon-cl
-
- - -
flag-icon-cm
-
- - -
flag-icon-cn
-
- - -
flag-icon-co
-
- - -
flag-icon-cr
-
- - -
flag-icon-cu
-
- - -
flag-icon-cv
-
- - -
flag-icon-cw
-
- - -
flag-icon-cx
-
- - -
flag-icon-cy
-
- - -
flag-icon-cz
-
- - -
flag-icon-de
-
- - -
flag-icon-dj
-
- - -
flag-icon-dk
-
- - -
flag-icon-dm
-
- - -
flag-icon-do
-
- - -
flag-icon-dz
-
- - -
flag-icon-ec
-
- - -
flag-icon-ee
-
- - -
flag-icon-eg
-
- - -
flag-icon-eh
-
- - -
flag-icon-er
-
- - -
flag-icon-es
-
- - -
flag-icon-et
-
- - -
flag-icon-fi
-
- - -
flag-icon-fj
-
- - -
flag-icon-fk
-
- - -
flag-icon-fm
-
- - -
flag-icon-fo
-
- - -
flag-icon-fr
-
- - -
flag-icon-ga
-
- - -
flag-icon-gb
-
- - -
flag-icon-gd
-
- - -
flag-icon-ge
-
- - -
flag-icon-gf
-
- - -
flag-icon-gg
-
- - -
flag-icon-gh
-
- - -
flag-icon-gi
-
- - -
flag-icon-gl
-
- - -
flag-icon-gm
-
- - -
flag-icon-gn
-
- - -
flag-icon-gp
-
- - -
flag-icon-gq
-
- - -
flag-icon-gr
-
- - -
flag-icon-gs
-
- - -
flag-icon-gt
-
- - -
flag-icon-gu
-
- - -
flag-icon-gw
-
- - -
flag-icon-gy
-
- - -
flag-icon-hk
-
- - -
flag-icon-hm
-
- - -
flag-icon-hn
-
- - -
flag-icon-hr
-
- - -
flag-icon-ht
-
- - -
flag-icon-hu
-
- - -
flag-icon-id
-
- - -
flag-icon-ie
-
- - -
flag-icon-il
-
- - -
flag-icon-im
-
- - -
flag-icon-in
-
- - -
flag-icon-io
-
- - -
flag-icon-iq
-
- - -
flag-icon-ir
-
- - -
flag-icon-is
-
- - -
flag-icon-it
-
- - -
flag-icon-je
-
- - -
flag-icon-jm
-
- - -
flag-icon-jo
-
- - -
flag-icon-jp
-
- - -
flag-icon-ke
-
- - -
flag-icon-kg
-
- - -
flag-icon-kh
-
- - -
flag-icon-ki
-
- - -
flag-icon-km
-
- - -
flag-icon-kn
-
- - -
flag-icon-kp
-
- - -
flag-icon-kr
-
- - -
flag-icon-kw
-
- - -
flag-icon-ky
-
- - -
flag-icon-kz
-
- - -
flag-icon-la
-
- - -
flag-icon-lb
-
- - -
flag-icon-lc
-
- - -
flag-icon-li
-
- - -
flag-icon-lk
-
- - -
flag-icon-lr
-
- - -
flag-icon-ls
-
- - -
flag-icon-lt
-
- - -
flag-icon-lu
-
- - -
flag-icon-lv
-
- - -
flag-icon-ly
-
- - -
flag-icon-ma
-
- - -
flag-icon-mc
-
- - -
flag-icon-md
-
- - -
flag-icon-me
-
- - -
flag-icon-mf
-
- - -
flag-icon-mg
-
- - -
flag-icon-mh
-
- - -
flag-icon-mk
-
- - -
flag-icon-ml
-
- - -
flag-icon-mm
-
- - -
flag-icon-mn
-
- - -
flag-icon-mo
-
- - -
flag-icon-mp
-
- - -
flag-icon-mq
-
- - -
flag-icon-mr
-
- - -
flag-icon-ms
-
- - -
flag-icon-mt
-
- - -
flag-icon-mu
-
- - -
flag-icon-mv
-
- - -
flag-icon-mw
-
- - -
flag-icon-mx
-
- - -
flag-icon-my
-
- - -
flag-icon-mz
-
- - -
flag-icon-na
-
- - -
flag-icon-nc
-
- - -
flag-icon-ne
-
- - -
flag-icon-nf
-
- - -
flag-icon-ng
-
- - -
flag-icon-ni
-
- - -
flag-icon-nl
-
- - -
flag-icon-no
-
- - -
flag-icon-np
-
- - -
flag-icon-nr
-
- - -
flag-icon-nu
-
- - -
flag-icon-nz
-
- - -
flag-icon-om
-
- - -
flag-icon-pa
-
- - -
flag-icon-pe
-
- - -
flag-icon-pf
-
- - -
flag-icon-pg
-
- - -
flag-icon-ph
-
- - -
flag-icon-pk
-
- - -
flag-icon-pl
-
- - -
flag-icon-pm
-
- - -
flag-icon-pn
-
- - -
flag-icon-pr
-
- - -
flag-icon-ps
-
- - -
flag-icon-pt
-
- - -
flag-icon-pw
-
- - -
flag-icon-py
-
- - -
flag-icon-qa
-
- - -
flag-icon-re
-
- - -
flag-icon-ro
-
- - -
flag-icon-rs
-
- - -
flag-icon-ru
-
- - -
flag-icon-rw
-
- - -
flag-icon-sa
-
- - -
flag-icon-sb
-
- - -
flag-icon-sc
-
- - -
flag-icon-sd
-
- - -
flag-icon-se
-
- - -
flag-icon-sg
-
- - -
flag-icon-sh
-
- - -
flag-icon-si
-
- - -
flag-icon-sj
-
- - -
flag-icon-sk
-
- - -
flag-icon-sl
-
- - -
flag-icon-sm
-
- - -
flag-icon-sn
-
- - -
flag-icon-so
-
- - -
flag-icon-sr
-
- - -
flag-icon-ss
-
- - -
flag-icon-st
-
- - -
flag-icon-sv
-
- - -
flag-icon-sx
-
- - -
flag-icon-sy
-
- - -
flag-icon-sz
-
- - -
flag-icon-tc
-
- - -
flag-icon-td
-
- - -
flag-icon-tf
-
- - -
flag-icon-tg
-
- - -
flag-icon-th
-
- - -
flag-icon-tj
-
- - -
flag-icon-tk
-
- - -
flag-icon-tl
-
- - -
flag-icon-tm
-
- - -
flag-icon-tn
-
- - -
flag-icon-to
-
- - -
flag-icon-tr
-
- - -
flag-icon-tt
-
- - -
flag-icon-tv
-
- - -
flag-icon-tw
-
- - -
flag-icon-tz
-
- - -
flag-icon-ua
-
- - -
flag-icon-ug
-
- - -
flag-icon-um
-
- - -
flag-icon-us
-
- - -
flag-icon-uy
-
- - -
flag-icon-uz
-
- - -
flag-icon-va
-
- - -
flag-icon-vc
-
- - -
flag-icon-ve
-
- - -
flag-icon-vg
-
- - -
flag-icon-vi
-
- - -
flag-icon-vn
-
- - -
flag-icon-vu
-
- - -
flag-icon-wf
-
- - -
flag-icon-ws
-
- - -
flag-icon-ye
-
- - -
flag-icon-yt
-
- - -
flag-icon-za
-
- - -
flag-icon-zm
-
- - -
flag-icon-zw
-
+ @@ -1016,7 +31,14 @@ diff --git a/src/views/icons/FontAwesome.vue b/src/views/icons/FontAwesome.vue deleted file mode 100644 index 3037e8f3..00000000 --- a/src/views/icons/FontAwesome.vue +++ /dev/null @@ -1,2848 +0,0 @@ - - - diff --git a/src/views/icons/SimpleLineIcons.vue b/src/views/icons/SimpleLineIcons.vue deleted file mode 100644 index 23ab452d..00000000 --- a/src/views/icons/SimpleLineIcons.vue +++ /dev/null @@ -1,751 +0,0 @@ - - -