@quasar/quasar-ui-qiconpicker 2.0.5 → 2.0.7

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.
@@ -0,0 +1,565 @@
1
+ /*!
2
+ * @quasar/quasar-ui-qiconpicker v2.0.7
3
+ * (c) 2023 Jeff Galbraith <jeff@quasar.dev>
4
+ * Released under the MIT License.
5
+ */
6
+
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('quasar')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', 'vue', 'quasar'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.QIconPicker = {}, global.Vue, global.Quasar));
11
+ })(this, (function (exports, vue, quasar) { 'use strict';
12
+
13
+ /**
14
+ * QIconPicker Properties
15
+ */
16
+ const useIconPickerProps = {
17
+ modelValue: String,
18
+ iconSet: {
19
+ type: String,
20
+ validator: v => [
21
+ 'material-icons',
22
+ 'material-icons-outlined',
23
+ 'material-icons-round',
24
+ 'material-icons-sharp',
25
+ 'ionicons-v4',
26
+ 'mdi-v4',
27
+ 'mdi-v5',
28
+ 'mdi-v6',
29
+ 'fontawesome-v5',
30
+ 'eva-icons',
31
+ 'themify',
32
+ 'line-awesome',
33
+ 'bootstrap-icons',
34
+ ''
35
+ ].includes(v),
36
+ default: ''
37
+ },
38
+ icons: Array,
39
+ filter: String,
40
+ tags: Array,
41
+ dense: Boolean,
42
+ tooltips: Boolean,
43
+ noFooter: Boolean,
44
+ size: {
45
+ type: String,
46
+ default: 'inherit'
47
+ },
48
+ color: String,
49
+ textColor: String,
50
+ selectedColor: {
51
+ type: String,
52
+ default: 'primary'
53
+ },
54
+ selectedTextColor: {
55
+ type: String,
56
+ default: 'grey-1'
57
+ },
58
+ paginationProps: {
59
+ type: Object,
60
+ default: () => ({
61
+ maxPages: 5,
62
+ input: true
63
+ })
64
+ },
65
+ modelPagination: Object,
66
+ animated: Boolean,
67
+ transitionPrev: {
68
+ type: String,
69
+ default: 'slide-right'
70
+ },
71
+ transitionNext: {
72
+ type: String,
73
+ default: 'slide-left'
74
+ }
75
+ };
76
+
77
+ const direction = {
78
+ NEXT: 'next',
79
+ PREV: 'prev'
80
+ };
81
+
82
+ /**
83
+ * Pagination
84
+ */
85
+ function useIconPickerPagination(data, props, emit, computedFilteredIcons) {
86
+
87
+ function fixPagination(p) {
88
+ if (p.page < 1) {
89
+ p.page = 1;
90
+ }
91
+ if (p.itemsPerPage === void 0 || p.itemsPerPage < 1) {
92
+ p.itemsPerPage = 0; // all
93
+ }
94
+ return p
95
+ }
96
+
97
+ // returns true if the pagination is the same,
98
+ // otherwise returns false if it has changed
99
+ function samePagination(oldPag, newPag) {
100
+ for (const prop in newPag) {
101
+ if (newPag[ prop ] !== oldPag[ prop ]) {
102
+ return false
103
+ }
104
+ }
105
+ return true
106
+ }
107
+
108
+ const computedPagination = vue.computed(() => {
109
+ return fixPagination({
110
+ ...data.innerPagination,
111
+ ...props.modelPagination
112
+ })
113
+ });
114
+
115
+ const computedPagesNumber = vue.computed(() => {
116
+ return computedPagination.value.itemsPerPage === 0 ? 1
117
+ : Math.max(1, Math.ceil(computedFilteredIcons.value.length / computedPagination.value.itemsPerPage))
118
+ });
119
+
120
+ function setPagination(val) {
121
+ const newPagination = fixPagination({
122
+ ...computedPagination.value,
123
+ ...val
124
+ });
125
+
126
+ if (!samePagination(data.innerPagination, newPagination)) {
127
+ if (props.modelPagination) {
128
+ emit('update:model-pagination', newPagination);
129
+ }
130
+ data.innerPagination = newPagination;
131
+ }
132
+ }
133
+
134
+ function updatePagination() {
135
+ if (props.modelPagination !== void 0) {
136
+ setPagination({ total: computedFilteredIcons.value.length, totalPages: computedPagesNumber.value });
137
+ }
138
+ }
139
+
140
+ return {
141
+ samePagination,
142
+ computedPagination,
143
+ setPagination,
144
+ updatePagination,
145
+ computedPagesNumber
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Icons
151
+ */
152
+ function useIconPickerIcons(data, props, computedFirstItemIndex, computedLastItemIndex) {
153
+
154
+ function loadIconSet(iconSet) {
155
+ data.iconsList = [];
156
+ if (iconSet) {
157
+ // detect if UMD version is installed
158
+ if (window.QIconPicker) {
159
+ const name = iconSet.replace(/-([a-z])/g, g => g[ 1 ].toUpperCase());
160
+ if (window.QIconPicker.iconSet && window.QIconPicker.iconSet[ name ]) {
161
+ data.iconsList = window.QIconPicker.iconSet[ name ].icons;
162
+ }
163
+ else {
164
+ console.error(`QIconPicker: no icon set loaded called ${ iconSet }`);
165
+ console.error('Be sure to load the UMD version of the icon set in a script tag before using QIconPicker UMD version');
166
+ }
167
+ }
168
+ else {
169
+ try {
170
+ data.iconsList = require(`@quasar/quasar-ui-qiconpicker/src/components/icon-set/${ iconSet }.js`).default.icons;
171
+ }
172
+ catch (e) {
173
+ console.error(`QIconPicker: cannot find icon set found called ${ iconSet }`);
174
+ }
175
+ }
176
+ }
177
+ console.info(`Loaded ${ data.iconsList.length } icons.`);
178
+ }
179
+
180
+ const computedDisplayedIcons = vue.computed(() => {
181
+ let icons = [];
182
+ if (data.iconsList) {
183
+ icons = computedFilteredIcons.value;
184
+
185
+ // should the icons be paged?
186
+ if (props.modelPagination && props.modelPagination.itemsPerPage !== 0) {
187
+ icons = icons.slice(computedFirstItemIndex.value, computedLastItemIndex.value);
188
+ }
189
+ }
190
+ return icons
191
+ });
192
+
193
+ const computedFilteredIcons = vue.computed(() => {
194
+ let icons = data.iconsList;
195
+ if (icons) {
196
+ if (props.tags !== void 0 && props.tags !== '' && props.tags !== null && props.tags.length > 0) {
197
+ icons = icons.filter(icon => {
198
+ return icon.tags.filter(tag => props.tags.includes(tag)).length > 0
199
+ });
200
+ }
201
+ if (props.filter !== void 0 && props.filter !== '' && props.filter !== null) {
202
+ icons = icons.filter(icon => icon.name.includes(props.filter));
203
+ }
204
+ }
205
+ return icons
206
+ });
207
+
208
+ function categories() {
209
+ const t = [];
210
+ data.iconsList.forEach(icon => {
211
+ const tags = icon.tags;
212
+ if (tags && tags.length > 0) {
213
+ tags.forEach(tag => {
214
+ if (t.includes(tag) !== true) {
215
+ t.push(tag);
216
+ }
217
+ });
218
+ }
219
+ });
220
+ t.sort();
221
+ data.categories = t;
222
+ return true
223
+ }
224
+
225
+ return {
226
+ loadIconSet,
227
+ computedDisplayedIcons,
228
+ computedFilteredIcons,
229
+ categories
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Exposes api functions
235
+ */
236
+ function exposeIconPickerApi(data, expose, computedPagination, setPagination, computedFirstItemIndex, computedLastItemIndex, computedFilteredIcons, computedPagesNumber) {
237
+ // goes to previous page
238
+ const prevPage = () => {
239
+ const { page } = computedPagination.value;
240
+ if (page > 1) {
241
+ setPagination({ page: page - 1 });
242
+ data.direction = direction.PREV;
243
+ }
244
+ };
245
+
246
+ // goes to next page
247
+ const nextPage = () => {
248
+ const { page, itemsPerPage } = computedPagination.value;
249
+ if (computedLastItemIndex.value > 0 && page * itemsPerPage < computedFilteredIcons.value.length) {
250
+ setPagination({ page: page + 1 });
251
+ data.direction = direction.NEXT;
252
+ }
253
+ };
254
+
255
+ // goes to last page
256
+ const lastPage = () => {
257
+ setPagination({ page: computedPagesNumber.value });
258
+ };
259
+
260
+ // goes to first page
261
+ const firstPage = () => {
262
+ setPagination({ page: 0 });
263
+ };
264
+
265
+ // checks if we are on the last page
266
+ const isLastPage = vue.computed(() => {
267
+ return computedLastItemIndex.value === 0
268
+ ? true
269
+ : computedPagination.value.page >= computedPagesNumber.value
270
+ });
271
+
272
+
273
+ // checks if we are on the first page
274
+ const isFirstPage = vue.computed(() => {
275
+ return computedPagination.value.page === 1
276
+ });
277
+
278
+ expose({
279
+ prevPage,
280
+ nextPage,
281
+ lastPage,
282
+ firstPage,
283
+ isLastPage,
284
+ isFirstPage
285
+ });
286
+ }
287
+
288
+
289
+ var QIconPicker = vue.defineComponent({
290
+ name: 'QIconPicker',
291
+
292
+ props: {
293
+ ...useIconPickerProps
294
+ },
295
+
296
+ emits: [
297
+ 'update:model-value',
298
+ 'update:tags',
299
+ 'update:model-pagination'
300
+ ],
301
+
302
+ setup(props, { slots, emit, expose }) {
303
+ const scrollAreaRef = vue.ref(null);
304
+ const data = vue.reactive({
305
+ iconsList: [],
306
+ innerPagination: {
307
+ page: 1,
308
+ itemsPerPage: 0,
309
+ totalPages: 0
310
+ },
311
+ categories: [],
312
+ width: '100',
313
+ height: '100',
314
+ direction: ''
315
+ });
316
+
317
+ // index of first item on a page
318
+ const computedFirstItemIndex = vue.computed(() => {
319
+ const { page, itemsPerPage } = computedPagination.value;
320
+ return (page - 1) * itemsPerPage
321
+ });
322
+
323
+ // index of last item on a page
324
+ const computedLastItemIndex = vue.computed(() => {
325
+ const { page, itemsPerPage } = computedPagination.value;
326
+ return page * itemsPerPage
327
+ });
328
+
329
+ const {
330
+ loadIconSet,
331
+ computedDisplayedIcons,
332
+ computedFilteredIcons,
333
+ categories
334
+ } = useIconPickerIcons(data, props, computedFirstItemIndex, computedLastItemIndex);
335
+
336
+ const {
337
+ samePagination,
338
+ computedPagination,
339
+ setPagination,
340
+ updatePagination,
341
+ computedPagesNumber
342
+ } = useIconPickerPagination(data, props, emit, computedFilteredIcons);
343
+
344
+ exposeIconPickerApi(data, expose, computedPagination, setPagination, computedFirstItemIndex, computedLastItemIndex, computedFilteredIcons, computedPagesNumber);
345
+
346
+ vue.onMounted(() => {
347
+ if (props.iconSet) {
348
+ loadIconSet(props.iconSet);
349
+ }
350
+ else if (props.icons !== void 0 && props.icons.length > 0) {
351
+ data.iconsList = props.icons;
352
+ }
353
+ updatePagination();
354
+ });
355
+
356
+
357
+ vue.watch(() => props.iconSet, (val) => {
358
+ if (val) {
359
+ loadIconSet(val);
360
+ updatePagination();
361
+ vue.nextTick(() => {
362
+ // whenever the icon set changes, it resets pagination page to page 1
363
+ setPagination({ page: 1 });
364
+ }).catch(e => console.error(e));
365
+ // scroll to top of QScrollArea, if applicable
366
+ if(scrollAreaRef.value) {
367
+ scrollAreaRef.value.setScrollPosition(0);
368
+ }
369
+ }
370
+ });
371
+
372
+ vue.watch(() => props.icons, (val) => {
373
+ if (props.icons !== void 0 && props.icons.length > 0) {
374
+ data.iconsList = props.icons;
375
+ }
376
+ updatePagination();
377
+ vue.nextTick(() => {
378
+ // whenever the icon set changes, it resets pagination page to page 1
379
+ setPagination({ page: 1 });
380
+ }).catch(e => console.error(e));
381
+ // scroll to top of QScrollArea, if applicable
382
+ if(scrollAreaRef.value) {
383
+ scrollAreaRef.value.setScrollPosition(0);
384
+ }
385
+ });
386
+
387
+ vue.watch(() => props.filter, () => {
388
+ // whenever the filter changes, it resets pagination page to page 1
389
+ setPagination({ page: 1, totalPages: computedPagesNumber.value });
390
+ updatePagination();
391
+ });
392
+
393
+ vue.watch(() => props.tags, (val) => {
394
+ // whenever the tags change, it resets pagination page to page 1
395
+ setPagination({ page: 1, totalPages: computedPagesNumber.value });
396
+ updatePagination();
397
+ });
398
+
399
+ if (props.modelPagination) {
400
+ vue.watch(() => props.modelPagination, (newVal, oldVal) => {
401
+ if (!samePagination(oldVal, newVal)) {
402
+ updatePagination();
403
+ }
404
+ });
405
+ }
406
+
407
+ if (props.modelPagination) {
408
+ vue.watch(() => props.modelPagination.itemsPerPage, () => {
409
+ updatePagination();
410
+ });
411
+
412
+ vue.watch(() =>props.modelPagination.page, () => {
413
+ updatePagination();
414
+ });
415
+ }
416
+
417
+ return () => {
418
+
419
+ function renderPagination() {
420
+ if (props.modelPagination && props.modelPagination.itemsPerPage === 0) return ''
421
+ const slot = (slots.pagination && slots.pagination());
422
+ const { page, totalPages } = computedPagination.value;
423
+
424
+ return slot || vue.h(quasar.QPagination, {
425
+ class: 'q-icon-picker__pagination',
426
+ ...props.paginationProps,
427
+ modelValue: page,
428
+ max: totalPages,
429
+ 'onUpdate:modelValue': value => {
430
+ if (props.animated) {
431
+ if (value > page) {
432
+ data.direction = direction.NEXT;
433
+ }
434
+ else {
435
+ data.direction = direction.PREV;
436
+ }
437
+ }
438
+ setPagination({ page: value });
439
+ }
440
+ })
441
+ }
442
+
443
+ function renderFooter() {
444
+ if (props.noFooter !== true && props.modelPagination !== void 0) {
445
+ const slot = (slots.footer && slots.footer());
446
+
447
+ return vue.h('div', {
448
+ class: 'q-icon-picker__footer flex flex-center'
449
+ }, [
450
+ slot ? slot(computedPagination.value) : renderPagination()
451
+ ])
452
+ }
453
+ }
454
+
455
+ function renderTooltip(name) {
456
+ if (props.tooltips === true) {
457
+ return () => vue.h(quasar.QTooltip, {}, () => name)
458
+ }
459
+ }
460
+
461
+ function renderIcon(icon) {
462
+ const name = (icon.prefix !== void 0 ? icon.prefix + ' ' + icon.name : icon.name);
463
+
464
+ if (slots.icon && slots.icon()) {
465
+ return slots.icon(name)
466
+ }
467
+ const isSelected = name === props.modelValue;
468
+ const textColor = isSelected ? props.selectedTextColor : undefined;
469
+ const color = isSelected ? props.selectedColor : undefined;
470
+ const size = props.size ? props.size : undefined;
471
+
472
+ return vue.h(quasar.QBtn, {
473
+ id: name,
474
+ unelevated: true,
475
+ dense: props.dense,
476
+ noWrap: true,
477
+ size: size,
478
+ textColor: textColor,
479
+ color: color,
480
+ icon: name,
481
+ onClick: () => emit('update:model-value', name),
482
+ }, renderTooltip(name))
483
+ }
484
+
485
+ function renderIcons() {
486
+ return computedDisplayedIcons.value.map(icon => renderIcon(icon))
487
+ }
488
+
489
+ function renderContainer() {
490
+ const container = () => vue.h('div', {
491
+ key: computedPagination.value.page,
492
+ class: 'q-icon-picker__container col'
493
+ }, [...renderIcons()]);
494
+
495
+ if (props.animated === true) {
496
+ const transition = 'q-transition--' + (data.direction === 'prev' ? props.transitionPrev : props.transitionNext);
497
+ return () => vue.h(vue.Transition, {
498
+ name: transition,
499
+ appear: true
500
+ }, container)
501
+ }
502
+
503
+ return container
504
+ }
505
+
506
+
507
+ function renderScrollArea() {
508
+ return vue.h(quasar.QScrollArea, {
509
+ ref: scrollAreaRef,
510
+ style: {
511
+ width: data.width + 'px',
512
+ height: data.height + 'px'
513
+ }
514
+ }, renderContainer())
515
+ }
516
+
517
+ function renderBody() {
518
+ return vue.h('div', {
519
+ class: 'q-icon-picker__body col column'
520
+ }, [
521
+ renderScrollArea(),
522
+ vue.h(quasar.QResizeObserver, {
523
+ onResize: (size) => {
524
+ data.width = size.width;
525
+ data.height = size.height;
526
+ }
527
+ })
528
+ ])
529
+ }
530
+
531
+ const classes = [
532
+ 'q-icon-picker',
533
+ 'column'
534
+ ];
535
+ if (props.color) classes.push('bg-' + props.color);
536
+ if (props.textColor) classes.push('text-' + props.textColor);
537
+
538
+ const picker = vue.h('div', {
539
+ class: classes.join(' ')
540
+ }, [
541
+ renderBody(),
542
+ renderFooter()
543
+ ]);
544
+
545
+ vue.nextTick(() => {
546
+ categories();
547
+ emit('update:tags', data.categories);
548
+ }).catch(e => console.error(e));
549
+
550
+ return picker
551
+ }
552
+ }
553
+ });
554
+
555
+ const version = '2.0.7';
556
+
557
+ function install (app) {
558
+ app.component(QIconPicker.name, QIconPicker);
559
+ }
560
+
561
+ exports.QIconPicker = QIconPicker;
562
+ exports.install = install;
563
+ exports.version = version;
564
+
565
+ }));
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * @quasar/quasar-ui-qiconpicker v2.0.7
3
+ * (c) 2023 Jeff Galbraith <jeff@quasar.dev>
4
+ * Released under the MIT License.
5
+ */
6
+ (function(e,t){"object"===typeof exports&&"undefined"!==typeof module?t(exports,require("vue"),require("quasar")):"function"===typeof define&&define.amd?define(["exports","vue","quasar"],t):(e="undefined"!==typeof globalThis?globalThis:e||self,t(e.QIconPicker={},e.Vue,e.Quasar))})(this,function(e,x,w){"use strict";const t={modelValue:String,iconSet:{type:String,validator:e=>["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:()=>({maxPages:5,input:!0})},modelPagination:Object,animated:Boolean,transitionPrev:{type:String,default:"slide-right"},transitionNext:{type:String,default:"slide-left"}},y={NEXT:"next",PREV:"prev"};function s(n,o,i,e){function a(e){return e.page<1&&(e.page=1),(void 0===e.itemsPerPage||e.itemsPerPage<1)&&(e.itemsPerPage=0),e}function r(e,t){for(const n in t)if(t[n]!==e[n])return!1;return!0}const c=x.computed(()=>{return a({...n.innerPagination,...o.modelPagination})}),t=x.computed(()=>{return 0===c.value.itemsPerPage?1:Math.max(1,Math.ceil(e.value.length/c.value.itemsPerPage))});function s(e){const t=a({...c.value,...e});r(n.innerPagination,t)||(o.modelPagination&&i("update:model-pagination",t),n.innerPagination=t)}function l(){void 0!==o.modelPagination&&s({total:e.value.length,totalPages:t.value})}return{samePagination:r,computedPagination:c,setPagination:s,updatePagination:l,computedPagesNumber:t}}function l(o,t,n,i){function e(t){if(o.iconsList=[],t)if(window.QIconPicker){const e=t.replace(/-([a-z])/g,e=>e[1].toUpperCase());window.QIconPicker.iconSet&&window.QIconPicker.iconSet[e]?o.iconsList=window.QIconPicker.iconSet[e].icons:(console.error("QIconPicker: no icon set loaded called "+t),console.error("Be sure to load the UMD version of the icon set in a script tag before using QIconPicker UMD version"))}else try{o.iconsList=require(`@quasar/quasar-ui-qiconpicker/src/components/icon-set/${t}.js`).default.icons}catch(e){console.error("QIconPicker: cannot find icon set found called "+t)}console.info(`Loaded ${o.iconsList.length} icons.`)}const a=x.computed(()=>{let e=[];o.iconsList&&(e=r.value,t.modelPagination)&&0!==t.modelPagination.itemsPerPage&&(e=e.slice(n.value,i.value));return e}),r=x.computed(()=>{let e=o.iconsList;e&&(void 0!==t.tags&&""!==t.tags&&null!==t.tags&&t.tags.length>0&&(e=e.filter(e=>{return e.tags.filter(e=>t.tags.includes(e)).length>0})),void 0!==t.filter)&&""!==t.filter&&null!==t.filter&&(e=e.filter(e=>e.name.includes(t.filter)));return e});function c(){const n=[];return o.iconsList.forEach(e=>{const t=e.tags;t&&t.length>0&&t.forEach(e=>{!0!==n.includes(e)&&n.push(e)})}),n.sort(),o.categories=n,!0}return{loadIconSet:e,computedDisplayedIcons:a,computedFilteredIcons:r,categories:c}}function S(n,e,o,i,t,a,r,c){const s=()=>{const e=o.value["page"];e>1&&(i({page:e-1}),n.direction=y.PREV)},l=()=>{const{page:e,itemsPerPage:t}=o.value;a.value>0&&e*t<r.value.length&&(i({page:e+1}),n.direction=y.NEXT)},u=()=>{i({page:c.value})},d=()=>{i({page:0})},g=x.computed(()=>{return 0===a.value||o.value.page>=c.value}),p=x.computed(()=>{return 1===o.value.page});e({prevPage:s,nextPage:l,lastPage:u,firstPage:d,isLastPage:g,isFirstPage:p})}var n=x.defineComponent({name:"QIconPicker",props:{...t},emits:["update:model-value","update:tags","update:model-pagination"],setup(u,{slots:d,emit:g,expose:e}){const p=x.ref(null),m=x.reactive({iconsList:[],innerPagination:{page:1,itemsPerPage:0,totalPages:0},categories:[],width:"100",height:"100",direction:""}),t=x.computed(()=>{const{page:e,itemsPerPage:t}=v.value;return(e-1)*t}),n=x.computed(()=>{const{page:e,itemsPerPage:t}=v.value;return e*t}),{loadIconSet:o,computedDisplayedIcons:P,computedFilteredIcons:i,categories:f}=l(m,u,t,n),{samePagination:a,computedPagination:v,setPagination:h,updatePagination:r,computedPagesNumber:c}=s(m,u,g,i);return S(m,e,v,h,t,n,i,c),x.onMounted(()=>{u.iconSet?o(u.iconSet):void 0!==u.icons&&u.icons.length>0&&(m.iconsList=u.icons);r()}),x.watch(()=>u.iconSet,e=>{e&&(o(e),r(),x.nextTick(()=>{h({page:1})}).catch(e=>console.error(e)),p.value)&&p.value.setScrollPosition(0)}),x.watch(()=>u.icons,e=>{void 0!==u.icons&&u.icons.length>0&&(m.iconsList=u.icons);r();x.nextTick(()=>{h({page:1})}).catch(e=>console.error(e));p.value&&p.value.setScrollPosition(0)}),x.watch(()=>u.filter,()=>{h({page:1,totalPages:c.value});r()}),x.watch(()=>u.tags,e=>{h({page:1,totalPages:c.value});r()}),u.modelPagination&&x.watch(()=>u.modelPagination,(e,t)=>{a(t,e)||r()}),u.modelPagination&&(x.watch(()=>u.modelPagination.itemsPerPage,()=>{r()}),x.watch(()=>u.modelPagination.page,()=>{r()})),()=>{function t(){if(u.modelPagination&&0===u.modelPagination.itemsPerPage)return"";const e=d.pagination&&d.pagination(),{page:t,totalPages:n}=v.value;return e||x.h(w.QPagination,{class:"q-icon-picker__pagination",...u.paginationProps,modelValue:t,max:n,"onUpdate:modelValue":e=>{u.animated&&(e>t?m.direction=y.NEXT:m.direction=y.PREV);h({page:e})}})}function e(){if(!0!==u.noFooter&&void 0!==u.modelPagination){const e=d.footer&&d.footer();return x.h("div",{class:"q-icon-picker__footer flex flex-center"},[e?e(v.value):t()])}}function r(e){if(!0===u.tooltips)return()=>x.h(w.QTooltip,{},()=>e)}function n(e){const t=void 0!==e.prefix?e.prefix+" "+e.name:e.name;if(d.icon&&d.icon())return d.icon(t);const n=t===u.modelValue,o=n?u.selectedTextColor:void 0,i=n?u.selectedColor:void 0,a=u.size||void 0;return x.h(w.QBtn,{id:t,unelevated:!0,dense:u.dense,noWrap:!0,size:a,textColor:o,color:i,icon:t,onClick:()=>g("update:model-value",t)},r(t))}function o(){return P.value.map(e=>n(e))}function i(){const e=()=>x.h("div",{key:v.value.page,class:"q-icon-picker__container col"},[...o()]);if(!0!==u.animated)return e;{const t="q-transition--"+("prev"===m.direction?u.transitionPrev:u.transitionNext);return()=>x.h(x.Transition,{name:t,appear:!0},e)}}function a(){return x.h(w.QScrollArea,{ref:p,style:{width:m.width+"px",height:m.height+"px"}},i())}function c(){return x.h("div",{class:"q-icon-picker__body col column"},[a(),x.h(w.QResizeObserver,{onResize:e=>{m.width=e.width;m.height=e.height}})])}const s=["q-icon-picker","column"];u.color&&s.push("bg-"+u.color);u.textColor&&s.push("text-"+u.textColor);const l=x.h("div",{class:s.join(" ")},[c(),e()]);x.nextTick(()=>{f();g("update:tags",m.categories)}).catch(e=>console.error(e));return l}}});const o="2.0.7";function i(e){e.component(n.name,n)}e.QIconPicker=n,e.install=i,e.version=o});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quasar/quasar-ui-qiconpicker",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "author": "Jeff Galbraith <jeff@quasar.dev>",
5
5
  "description": "QIconPicker - Quasar component",
6
6
  "contributors": [
@@ -35,6 +35,7 @@
35
35
  "icons:themify": "node build/icons/build.themify.js",
36
36
  "icons:bootstrap-icons": "node build/icons/build.bootstrap-icons.js",
37
37
  "icons:fontawesome": "node build/icons/build.fontawesome.js",
38
+ "icons:material": "node build/icons/build.google.material-icons.js",
38
39
  "icons:all": "node build/icons/build.all.js"
39
40
  },
40
41
  "funding": {
@@ -62,41 +63,41 @@
62
63
  "attributes": "dist/vetur/attributes.json"
63
64
  },
64
65
  "devDependencies": {
65
- "@babel/core": "^7.17.5",
66
- "@babel/eslint-parser": "^7.17.0",
66
+ "@babel/core": "^7.22.1",
67
+ "@babel/eslint-parser": "^7.21.8",
67
68
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
68
- "@babel/preset-env": "^7.16.11",
69
- "@quasar/extras": "^1.13.0",
70
- "@rollup/plugin-buble": "^0.21.3",
71
- "@rollup/plugin-json": "^4.1.0",
72
- "@rollup/plugin-node-resolve": "^13.1.3",
73
- "@rollup/plugin-replace": "^4.0.0",
74
- "@types/node": "^17.0.21",
75
- "@typescript-eslint/eslint-plugin": "^5.14.0",
76
- "@typescript-eslint/parser": "^5.14.0",
77
- "autoprefixer": "^10.4.2",
78
- "cross-fetch": "^3.1.5",
79
- "cssnano": "^5.1.4",
80
- "eslint": "^8.11.0",
81
- "eslint-config-standard": "^16.0.3",
82
- "eslint-plugin-import": "^2.25.4",
83
- "eslint-plugin-jsdoc": "^38.0.3",
69
+ "@babel/preset-env": "^7.22.4",
70
+ "@quasar/extras": "^1.16.4",
71
+ "@rollup/plugin-buble": "^1.0.2",
72
+ "@rollup/plugin-json": "^6.0.0",
73
+ "@rollup/plugin-node-resolve": "^15.0.2",
74
+ "@rollup/plugin-replace": "^5.0.2",
75
+ "@types/node": "^20.2.5",
76
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
77
+ "@typescript-eslint/parser": "^5.59.8",
78
+ "autoprefixer": "^10.4.14",
79
+ "cross-fetch": "^3.1.6",
80
+ "cssnano": "^6.0.1",
81
+ "eslint": "^8.41.0",
82
+ "eslint-config-standard": "^17.1.0",
83
+ "eslint-plugin-import": "^2.27.5",
84
+ "eslint-plugin-jsdoc": "^45.0.0",
84
85
  "eslint-plugin-node": "^11.1.0",
85
- "eslint-plugin-promise": "^6.0.0",
86
+ "eslint-plugin-promise": "^6.1.1",
86
87
  "eslint-plugin-quasar": "^1.1.0",
87
- "eslint-plugin-vue": "^8.5.0",
88
- "eslint-webpack-plugin": "^3.1.1",
89
- "fs-extra": "^10.0.1",
90
- "kolorist": "^1.5.1",
91
- "open": "^8.4.0",
92
- "postcss": "^8.4.8",
93
- "quasar": "^2.5.5",
88
+ "eslint-plugin-vue": "^9.14.1",
89
+ "eslint-webpack-plugin": "^4.0.1",
90
+ "fs-extra": "^11.1.1",
91
+ "kolorist": "^1.8.0",
92
+ "open": "^9.1.0",
93
+ "postcss": "^8.4.24",
94
+ "quasar": "^2.12.0",
94
95
  "quasar-json-api": "^2.0.0-alpha.3",
95
- "rimraf": "^3.0.2",
96
- "rollup": "^2.70.0",
97
- "rtlcss": "^3.5.0",
98
- "sass": "^1.49.9",
99
- "uglify-js": "^3.15.3",
96
+ "rimraf": "^5.0.1",
97
+ "rollup": "^3.23.0",
98
+ "rtlcss": "^4.1.0",
99
+ "sass": "^1.62.1",
100
+ "uglify-js": "^3.17.4",
100
101
  "zlib": "^1.0.5"
101
102
  },
102
103
  "browserslist": [
@@ -109,4 +110,4 @@
109
110
  "last 4 FirefoxAndroid versions",
110
111
  "last 4 iOS versions"
111
112
  ]
112
- }
113
+ }