@quasar/quasar-ui-qiconpicker 2.0.3 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/icon-set/bootstrap-icons.umd.js +3 -3
  3. package/dist/icon-set/eva-icons.umd.js +2 -2
  4. package/dist/icon-set/fontawesome-v5.umd.js +2 -2
  5. package/dist/icon-set/ionicons-v4.umd.js +2 -2
  6. package/dist/icon-set/line-awesome.umd.js +2 -2
  7. package/dist/icon-set/material-icons-outlined.umd.js +3 -3
  8. package/dist/icon-set/material-icons-round.umd.js +3 -3
  9. package/dist/icon-set/material-icons-sharp.umd.js +3 -3
  10. package/dist/icon-set/material-icons.umd.js +3 -3
  11. package/dist/icon-set/mdi-v4.umd.js +2 -2
  12. package/dist/icon-set/mdi-v5.umd.js +2 -2
  13. package/dist/icon-set/mdi-v6.umd.js +3 -3
  14. package/dist/icon-set/themify.umd.js +2 -2
  15. package/dist/{index.common.js → index.cjs.js} +128 -131
  16. package/dist/index.cjs.min.js +6 -0
  17. package/dist/index.css +2 -2
  18. package/dist/index.esm.js +128 -131
  19. package/dist/index.esm.min.js +3 -3
  20. package/dist/index.min.css +2 -2
  21. package/dist/index.rtl.css +2 -2
  22. package/dist/index.rtl.min.css +2 -2
  23. package/dist/index.umd.js +128 -131
  24. package/dist/index.umd.min.js +3 -3
  25. package/dist/types/index.d.ts +0 -1
  26. package/package.json +27 -27
  27. package/src/components/icon-set/bootstrap-icons.js +212 -1
  28. package/src/components/icon-set/material-icons-outlined.js +223 -14
  29. package/src/components/icon-set/material-icons-round.js +223 -14
  30. package/src/components/icon-set/material-icons-sharp.js +223 -14
  31. package/src/components/icon-set/material-icons.js +223 -14
  32. package/src/components/icon-set/mdi-v6.js +400 -0
  33. package/src/{index.common.js → index.cjs.js} +0 -0
  34. package/src/index.js +2 -2
  35. package/src/version.js +1 -0
  36. package/src/vue-plugin.js +1 -1
  37. package/dist/index.common.min.js +0 -6
File without changes
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import QIconPicker from './components/QIconPicker'
2
- import pkg from '../package.json'
3
- const { version } = pkg
2
+
3
+ import { version } from './version'
4
4
 
5
5
  export {
6
6
  version,
package/src/version.js ADDED
@@ -0,0 +1 @@
1
+ export const version = '2.0.5'
package/src/vue-plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import QIconPicker from './components/QIconPicker'
2
2
 
3
- const version = __UI_VERSION__
3
+ import { version } from './version'
4
4
 
5
5
  function install (app) {
6
6
  app.component(QIconPicker.name, QIconPicker)
@@ -1,6 +0,0 @@
1
- /*!
2
- * @quasar/quasar-ui-qiconpicker v2.0.3
3
- * (c) 2021 Jeff Galbraith <jeff@quasar.dev>
4
- * Released under the MIT License.
5
- */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue"),quasar=require("quasar"),useIconPickerProps={modelValue:String,iconSet:{type:String,validator:function(e){return["material-icons","material-icons-outlined","material-icons-round","material-icons-sharp","ionicons-v4","mdi-v4","mdi-v5","mdi-v6","fontawesome-v5","eva-icons","themify","line-awesome","bootstrap-icons",""].includes(e)},default:""},icons:Array,filter:String,tags:Array,dense:Boolean,tooltips:Boolean,noFooter:Boolean,size:{type:String,default:"inherit"},color:String,textColor:String,selectedColor:{type:String,default:"primary"},selectedTextColor:{type:String,default:"grey-1"},paginationProps:{type:Object,default:function(){return{maxPages:5,input:!0}}},modelPagination:Object,animated:Boolean,transitionPrev:{type:String,default:"slide-right"},transitionNext:{type:String,default:"slide-left"}},direction={NEXT:"next",PREV:"prev"};function useIconPickerPagination(n,t,i,e){function o(e){return e.page<1&&(e.page=1),(void 0===e.itemsPerPage||e.itemsPerPage<1)&&(e.itemsPerPage=0),e}function a(e,n){for(var t in n)if(n[t]!==e[t])return!1;return!0}var r=vue.computed(function(){return o(Object.assign({},n.innerPagination,t.modelPagination))}),c=vue.computed(function(){return 0===r.value.itemsPerPage?1:Math.max(1,Math.ceil(e.value.length/r.value.itemsPerPage))});function u(e){e=o(Object.assign({},r.value,e));a(n.innerPagination,e)||(t.modelPagination&&i("update:model-pagination",e),n.innerPagination=e)}function s(){void 0!==t.modelPagination&&u({total:e.value.length,totalPages:c.value})}return{samePagination:a,computedPagination:r,setPagination:u,updatePagination:s,computedPagesNumber:c}}function useIconPickerIcons(t,n,i,o){function e(n){if(t.iconsList=[],n)if(window.QIconPicker){var e=n.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()});window.QIconPicker.iconSet&&window.QIconPicker.iconSet[e]?t.iconsList=window.QIconPicker.iconSet[e].icons:(console.error("QIconPicker: no icon set loaded called "+n),console.error("Be sure to load the UMD version of the icon set in a script tag before using QIconPicker UMD version"))}else try{t.iconsList=require("@quasar/quasar-ui-qiconpicker/src/components/icon-set/"+n+".js").default.icons}catch(e){console.error("QIconPicker: cannot find icon set found called "+n)}console.info("Loaded "+t.iconsList.length+" icons.")}var a=vue.computed(function(){var e=[];return t.iconsList&&(e=r.value,n.modelPagination&&0!==n.modelPagination.itemsPerPage&&(e=e.slice(i.value,o.value))),e}),r=vue.computed(function(){var e=t.iconsList;return e&&(void 0!==n.tags&&""!==n.tags&&null!==n.tags&&n.tags.length>0&&(e=e.filter(function(e){return e.tags.filter(function(e){return n.tags.includes(e)}).length>0})),void 0!==n.filter&&""!==n.filter&&null!==n.filter&&(e=e.filter(function(e){return e.name.includes(n.filter)}))),e});function c(){var n=[];return t.iconsList.forEach(function(e){e=e.tags;e&&e.length>0&&e.forEach(function(e){!0!==n.includes(e)&&n.push(e)})}),n.sort(),t.categories=n,!0}return{loadIconSet:e,computedDisplayedIcons:a,computedFilteredIcons:r,categories:c}}function exposeIconPickerApi(t,e,i,o,n,a,r,c){var u=function(){var e=i.value,e=e.page;e>1&&(o({page:e-1}),t.direction=direction.PREV)},s=function(){var e=i.value,n=e.page,e=e.itemsPerPage;a.value>0&&n*e<r.value.length&&(o({page:n+1}),t.direction=direction.NEXT)},l=function(){o({page:c.value})},d=function(){o({page:0})},g=vue.computed(function(){return 0===a.value||i.value.page>=c.value}),v=vue.computed(function(){return 1===i.value.page});e({prevPage:u,nextPage:s,lastPage:l,firstPage:d,isLastPage:g,isFirstPage:v})}var QIconPicker=vue.defineComponent({name:"QIconPicker",props:Object.assign({},useIconPickerProps),emits:["update:model-value","update:tags","update:model-pagination"],setup:function(s,e){var l=e.slots,d=e.emit,n=e.expose,g=vue.ref(null),v=vue.reactive({iconsList:[],innerPagination:{page:1,itemsPerPage:0,totalPages:0},categories:[],width:"100",height:"100",direction:""}),t=vue.computed(function(){var e=P.value,n=e.page,e=e.itemsPerPage;return(n-1)*e}),i=vue.computed(function(){var e=P.value,n=e.page,e=e.itemsPerPage;return n*e}),o=useIconPickerIcons(v,s,t,i),a=o.loadIconSet,f=o.computedDisplayedIcons,e=o.computedFilteredIcons,p=o.categories,o=useIconPickerPagination(v,s,d,e),r=o.samePagination,P=o.computedPagination,m=o.setPagination,c=o.updatePagination,u=o.computedPagesNumber;return exposeIconPickerApi(v,n,P,m,t,i,e,u),vue.onMounted(function(){s.iconSet?a(s.iconSet):void 0!==s.icons&&s.icons.length>0&&(v.iconsList=s.icons),c()}),vue.watch(function(){return s.iconSet},function(e){e&&(a(e),c(),vue.nextTick(function(){m({page:1})}).catch(function(e){return console.error(e)}),g.value&&g.value.setScrollPosition(0))}),vue.watch(function(){return s.icons},function(e){void 0!==s.icons&&s.icons.length>0&&(v.iconsList=s.icons),c(),vue.nextTick(function(){m({page:1})}).catch(function(e){return console.error(e)}),g.value&&g.value.setScrollPosition(0)}),vue.watch(function(){return s.filter},function(){m({page:1,totalPages:u.value}),c()}),vue.watch(function(){return s.tags},function(e){m({page:1,totalPages:u.value}),c()}),s.modelPagination&&vue.watch(function(){return s.modelPagination},function(e,n){r(n,e)||c()}),s.modelPagination&&(vue.watch(function(){return s.modelPagination.itemsPerPage},function(){c()}),vue.watch(function(){return s.modelPagination.page},function(){c()})),function(){function n(){if(s.modelPagination&&0===s.modelPagination.itemsPerPage)return"";var e=l.pagination&&l.pagination(),n=P.value,t=n.page,n=n.totalPages;return e||vue.h(quasar.QPagination,Object.assign({},{class:"q-icon-picker__pagination"},s.paginationProps,{modelValue:t,max:n,"onUpdate:modelValue":function(e){s.animated&&(v.direction=e>t?direction.NEXT:direction.PREV),m({page:e})}}))}function e(){if(!0!==s.noFooter&&void 0!==s.modelPagination){var e=l.footer&&l.footer();return vue.h("div",{class:"q-icon-picker__footer flex flex-center"},[e?e(P.value):n()])}}function o(e){if(!0===s.tooltips)return function(){return vue.h(quasar.QTooltip,{},function(){return e})}}function t(e){var n=void 0!==e.prefix?e.prefix+" "+e.name:e.name;if(l.icon&&l.icon())return l.icon(n);var t=n===s.modelValue,i=t?s.selectedTextColor:void 0,e=t?s.selectedColor:void 0,t=s.size||void 0;return vue.h(quasar.QBtn,{id:n,unelevated:!0,dense:s.dense,noWrap:!0,size:t,textColor:i,color:e,icon:n,onClick:function(){return d("update:model-value",n)}},o(n))}function i(){return f.value.map(function(e){return t(e)})}function a(){var e=function(){return vue.h("div",{key:P.value.page,class:"q-icon-picker__container col"},[].concat(i()))};if(!0!==s.animated)return e;var n="q-transition--"+("prev"===v.direction?s.transitionPrev:s.transitionNext);return function(){return vue.h(vue.Transition,{name:n,appear:!0},e)}}function r(){return vue.h(quasar.QScrollArea,{ref:g,style:{width:v.width+"px",height:v.height+"px"}},a())}function c(){return vue.h("div",{class:"q-icon-picker__body col column"},[r(),vue.h(quasar.QResizeObserver,{onResize:function(e){v.width=e.width,v.height=e.height}})])}var u=["q-icon-picker","column"];s.color&&u.push("bg-"+s.color),s.textColor&&u.push("text-"+s.textColor);u=vue.h("div",{class:u.join(" ")},[c(),e()]);return vue.nextTick(function(){p(),d("update:tags",v.categories)}).catch(function(e){return console.error(e)}),u}}}),version="2.0.3";function install(e){e.component(QIconPicker.name,QIconPicker)}exports.QIconPicker=QIconPicker,exports.install=install,exports.version=version;