@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
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @quasar/quasar-ui-qiconpicker v2.0.3
3
- * (c) 2021 Jeff Galbraith <jeff@quasar.dev>
2
+ * @quasar/quasar-ui-qiconpicker v2.0.5
3
+ * (c) 2022 Jeff Galbraith <jeff@quasar.dev>
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
@@ -10,11 +10,11 @@ import { QScrollArea, QResizeObserver, QPagination, QBtn, QTooltip } from 'quasa
10
10
  /**
11
11
  * QIconPicker Properties
12
12
  */
13
- var useIconPickerProps = {
13
+ const useIconPickerProps = {
14
14
  modelValue: String,
15
15
  iconSet: {
16
16
  type: String,
17
- validator: function (v) { return [
17
+ validator: v => [
18
18
  'material-icons',
19
19
  'material-icons-outlined',
20
20
  'material-icons-round',
@@ -29,7 +29,7 @@ var useIconPickerProps = {
29
29
  'line-awesome',
30
30
  'bootstrap-icons',
31
31
  ''
32
- ].includes(v); },
32
+ ].includes(v),
33
33
  default: ''
34
34
  },
35
35
  icons: Array,
@@ -54,10 +54,10 @@ var useIconPickerProps = {
54
54
  },
55
55
  paginationProps: {
56
56
  type: Object,
57
- default: function () { return ({
57
+ default: () => ({
58
58
  maxPages: 5,
59
59
  input: true
60
- }); }
60
+ })
61
61
  },
62
62
  modelPagination: Object,
63
63
  animated: Boolean,
@@ -71,7 +71,7 @@ var useIconPickerProps = {
71
71
  }
72
72
  };
73
73
 
74
- var direction = {
74
+ const direction = {
75
75
  NEXT: 'next',
76
76
  PREV: 'prev'
77
77
  };
@@ -94,7 +94,7 @@ function useIconPickerPagination(data, props, emit, computedFilteredIcons) {
94
94
  // returns true if the pagination is the same,
95
95
  // otherwise returns false if it has changed
96
96
  function samePagination(oldPag, newPag) {
97
- for (var prop in newPag) {
97
+ for (const prop in newPag) {
98
98
  if (newPag[ prop ] !== oldPag[ prop ]) {
99
99
  return false
100
100
  }
@@ -102,19 +102,23 @@ function useIconPickerPagination(data, props, emit, computedFilteredIcons) {
102
102
  return true
103
103
  }
104
104
 
105
- var computedPagination = computed(function () {
106
- return fixPagination(Object.assign({}, data.innerPagination,
107
- props.modelPagination))
105
+ const computedPagination = computed(() => {
106
+ return fixPagination({
107
+ ...data.innerPagination,
108
+ ...props.modelPagination
109
+ })
108
110
  });
109
111
 
110
- var computedPagesNumber = computed(function () {
112
+ const computedPagesNumber = computed(() => {
111
113
  return computedPagination.value.itemsPerPage === 0 ? 1
112
114
  : Math.max(1, Math.ceil(computedFilteredIcons.value.length / computedPagination.value.itemsPerPage))
113
115
  });
114
116
 
115
117
  function setPagination(val) {
116
- var newPagination = fixPagination(Object.assign({}, computedPagination.value,
117
- val));
118
+ const newPagination = fixPagination({
119
+ ...computedPagination.value,
120
+ ...val
121
+ });
118
122
 
119
123
  if (!samePagination(data.innerPagination, newPagination)) {
120
124
  if (props.modelPagination) {
@@ -131,11 +135,11 @@ function useIconPickerPagination(data, props, emit, computedFilteredIcons) {
131
135
  }
132
136
 
133
137
  return {
134
- samePagination: samePagination,
135
- computedPagination: computedPagination,
136
- setPagination: setPagination,
137
- updatePagination: updatePagination,
138
- computedPagesNumber: computedPagesNumber
138
+ samePagination,
139
+ computedPagination,
140
+ setPagination,
141
+ updatePagination,
142
+ computedPagesNumber
139
143
  }
140
144
  }
141
145
 
@@ -149,29 +153,29 @@ function useIconPickerIcons(data, props, computedFirstItemIndex, computedLastIte
149
153
  if (iconSet) {
150
154
  // detect if UMD version is installed
151
155
  if (window.QIconPicker) {
152
- var name = iconSet.replace(/-([a-z])/g, function (g) { return g[ 1 ].toUpperCase(); });
156
+ const name = iconSet.replace(/-([a-z])/g, g => g[ 1 ].toUpperCase());
153
157
  if (window.QIconPicker.iconSet && window.QIconPicker.iconSet[ name ]) {
154
158
  data.iconsList = window.QIconPicker.iconSet[ name ].icons;
155
159
  }
156
160
  else {
157
- console.error(("QIconPicker: no icon set loaded called " + iconSet));
161
+ console.error(`QIconPicker: no icon set loaded called ${ iconSet }`);
158
162
  console.error('Be sure to load the UMD version of the icon set in a script tag before using QIconPicker UMD version');
159
163
  }
160
164
  }
161
165
  else {
162
166
  try {
163
- data.iconsList = require(("@quasar/quasar-ui-qiconpicker/src/components/icon-set/" + iconSet + ".js")).default.icons;
167
+ data.iconsList = require(`@quasar/quasar-ui-qiconpicker/src/components/icon-set/${ iconSet }.js`).default.icons;
164
168
  }
165
169
  catch (e) {
166
- console.error(("QIconPicker: cannot find icon set found called " + iconSet));
170
+ console.error(`QIconPicker: cannot find icon set found called ${ iconSet }`);
167
171
  }
168
172
  }
169
173
  }
170
- console.info(("Loaded " + (data.iconsList.length) + " icons."));
174
+ console.info(`Loaded ${ data.iconsList.length } icons.`);
171
175
  }
172
176
 
173
- var computedDisplayedIcons = computed(function () {
174
- var icons = [];
177
+ const computedDisplayedIcons = computed(() => {
178
+ let icons = [];
175
179
  if (data.iconsList) {
176
180
  icons = computedFilteredIcons.value;
177
181
 
@@ -183,27 +187,27 @@ function useIconPickerIcons(data, props, computedFirstItemIndex, computedLastIte
183
187
  return icons
184
188
  });
185
189
 
186
- var computedFilteredIcons = computed(function () {
187
- var icons = data.iconsList;
190
+ const computedFilteredIcons = computed(() => {
191
+ let icons = data.iconsList;
188
192
  if (icons) {
189
193
  if (props.tags !== void 0 && props.tags !== '' && props.tags !== null && props.tags.length > 0) {
190
- icons = icons.filter(function (icon) {
191
- return icon.tags.filter(function (tag) { return props.tags.includes(tag); }).length > 0
194
+ icons = icons.filter(icon => {
195
+ return icon.tags.filter(tag => props.tags.includes(tag)).length > 0
192
196
  });
193
197
  }
194
198
  if (props.filter !== void 0 && props.filter !== '' && props.filter !== null) {
195
- icons = icons.filter(function (icon) { return icon.name.includes(props.filter); });
199
+ icons = icons.filter(icon => icon.name.includes(props.filter));
196
200
  }
197
201
  }
198
202
  return icons
199
203
  });
200
204
 
201
205
  function categories() {
202
- var t = [];
203
- data.iconsList.forEach(function (icon) {
204
- var tags = icon.tags;
206
+ const t = [];
207
+ data.iconsList.forEach(icon => {
208
+ const tags = icon.tags;
205
209
  if (tags && tags.length > 0) {
206
- tags.forEach(function (tag) {
210
+ tags.forEach(tag => {
207
211
  if (t.includes(tag) !== true) {
208
212
  t.push(tag);
209
213
  }
@@ -216,10 +220,10 @@ function useIconPickerIcons(data, props, computedFirstItemIndex, computedLastIte
216
220
  }
217
221
 
218
222
  return {
219
- loadIconSet: loadIconSet,
220
- computedDisplayedIcons: computedDisplayedIcons,
221
- computedFilteredIcons: computedFilteredIcons,
222
- categories: categories
223
+ loadIconSet,
224
+ computedDisplayedIcons,
225
+ computedFilteredIcons,
226
+ categories
223
227
  }
224
228
  }
225
229
 
@@ -228,9 +232,8 @@ function useIconPickerIcons(data, props, computedFirstItemIndex, computedLastIte
228
232
  */
229
233
  function exposeIconPickerApi(data, expose, computedPagination, setPagination, computedFirstItemIndex, computedLastItemIndex, computedFilteredIcons, computedPagesNumber) {
230
234
  // goes to previous page
231
- var prevPage = function () {
232
- var ref = computedPagination.value;
233
- var page = ref.page;
235
+ const prevPage = () => {
236
+ const { page } = computedPagination.value;
234
237
  if (page > 1) {
235
238
  setPagination({ page: page - 1 });
236
239
  data.direction = direction.PREV;
@@ -238,10 +241,8 @@ function exposeIconPickerApi(data, expose, computedPagination, setPagination, co
238
241
  };
239
242
 
240
243
  // goes to next page
241
- var nextPage = function () {
242
- var ref = computedPagination.value;
243
- var page = ref.page;
244
- var itemsPerPage = ref.itemsPerPage;
244
+ const nextPage = () => {
245
+ const { page, itemsPerPage } = computedPagination.value;
245
246
  if (computedLastItemIndex.value > 0 && page * itemsPerPage < computedFilteredIcons.value.length) {
246
247
  setPagination({ page: page + 1 });
247
248
  data.direction = direction.NEXT;
@@ -249,17 +250,17 @@ function exposeIconPickerApi(data, expose, computedPagination, setPagination, co
249
250
  };
250
251
 
251
252
  // goes to last page
252
- var lastPage = function () {
253
+ const lastPage = () => {
253
254
  setPagination({ page: computedPagesNumber.value });
254
255
  };
255
256
 
256
257
  // goes to first page
257
- var firstPage = function () {
258
+ const firstPage = () => {
258
259
  setPagination({ page: 0 });
259
260
  };
260
261
 
261
262
  // checks if we are on the last page
262
- var isLastPage = computed(function () {
263
+ const isLastPage = computed(() => {
263
264
  return computedLastItemIndex.value === 0
264
265
  ? true
265
266
  : computedPagination.value.page >= computedPagesNumber.value
@@ -267,17 +268,17 @@ function exposeIconPickerApi(data, expose, computedPagination, setPagination, co
267
268
 
268
269
 
269
270
  // checks if we are on the first page
270
- var isFirstPage = computed(function () {
271
+ const isFirstPage = computed(() => {
271
272
  return computedPagination.value.page === 1
272
273
  });
273
274
 
274
275
  expose({
275
- prevPage: prevPage,
276
- nextPage: nextPage,
277
- lastPage: lastPage,
278
- firstPage: firstPage,
279
- isLastPage: isLastPage,
280
- isFirstPage: isFirstPage
276
+ prevPage,
277
+ nextPage,
278
+ lastPage,
279
+ firstPage,
280
+ isLastPage,
281
+ isFirstPage
281
282
  });
282
283
  }
283
284
 
@@ -285,7 +286,9 @@ function exposeIconPickerApi(data, expose, computedPagination, setPagination, co
285
286
  var QIconPicker = defineComponent({
286
287
  name: 'QIconPicker',
287
288
 
288
- props: Object.assign({}, useIconPickerProps),
289
+ props: {
290
+ ...useIconPickerProps
291
+ },
289
292
 
290
293
  emits: [
291
294
  'update:model-value',
@@ -293,13 +296,9 @@ var QIconPicker = defineComponent({
293
296
  'update:model-pagination'
294
297
  ],
295
298
 
296
- setup: function setup(props, ref$1) {
297
- var slots = ref$1.slots;
298
- var emit = ref$1.emit;
299
- var expose = ref$1.expose;
300
-
301
- var scrollAreaRef = ref(null);
302
- var data = reactive({
299
+ setup(props, { slots, emit, expose }) {
300
+ const scrollAreaRef = ref(null);
301
+ const data = reactive({
303
302
  iconsList: [],
304
303
  innerPagination: {
305
304
  page: 1,
@@ -313,37 +312,35 @@ var QIconPicker = defineComponent({
313
312
  });
314
313
 
315
314
  // index of first item on a page
316
- var computedFirstItemIndex = computed(function () {
317
- var ref = computedPagination.value;
318
- var page = ref.page;
319
- var itemsPerPage = ref.itemsPerPage;
315
+ const computedFirstItemIndex = computed(() => {
316
+ const { page, itemsPerPage } = computedPagination.value;
320
317
  return (page - 1) * itemsPerPage
321
318
  });
322
319
 
323
320
  // index of last item on a page
324
- var computedLastItemIndex = computed(function () {
325
- var ref = computedPagination.value;
326
- var page = ref.page;
327
- var itemsPerPage = ref.itemsPerPage;
321
+ const computedLastItemIndex = computed(() => {
322
+ const { page, itemsPerPage } = computedPagination.value;
328
323
  return page * itemsPerPage
329
324
  });
330
325
 
331
- var ref$2 = useIconPickerIcons(data, props, computedFirstItemIndex, computedLastItemIndex);
332
- var loadIconSet = ref$2.loadIconSet;
333
- var computedDisplayedIcons = ref$2.computedDisplayedIcons;
334
- var computedFilteredIcons = ref$2.computedFilteredIcons;
335
- var categories = ref$2.categories;
336
-
337
- var ref$3 = useIconPickerPagination(data, props, emit, computedFilteredIcons);
338
- var samePagination = ref$3.samePagination;
339
- var computedPagination = ref$3.computedPagination;
340
- var setPagination = ref$3.setPagination;
341
- var updatePagination = ref$3.updatePagination;
342
- var computedPagesNumber = ref$3.computedPagesNumber;
326
+ const {
327
+ loadIconSet,
328
+ computedDisplayedIcons,
329
+ computedFilteredIcons,
330
+ categories
331
+ } = useIconPickerIcons(data, props, computedFirstItemIndex, computedLastItemIndex);
332
+
333
+ const {
334
+ samePagination,
335
+ computedPagination,
336
+ setPagination,
337
+ updatePagination,
338
+ computedPagesNumber
339
+ } = useIconPickerPagination(data, props, emit, computedFilteredIcons);
343
340
 
344
341
  exposeIconPickerApi(data, expose, computedPagination, setPagination, computedFirstItemIndex, computedLastItemIndex, computedFilteredIcons, computedPagesNumber);
345
342
 
346
- onMounted(function () {
343
+ onMounted(() => {
347
344
  if (props.iconSet) {
348
345
  loadIconSet(props.iconSet);
349
346
  }
@@ -354,14 +351,14 @@ var QIconPicker = defineComponent({
354
351
  });
355
352
 
356
353
 
357
- watch(function () { return props.iconSet; }, function (val) {
354
+ watch(() => props.iconSet, (val) => {
358
355
  if (val) {
359
356
  loadIconSet(val);
360
357
  updatePagination();
361
- nextTick(function () {
358
+ nextTick(() => {
362
359
  // whenever the icon set changes, it resets pagination page to page 1
363
360
  setPagination({ page: 1 });
364
- }).catch(function (e) { return console.error(e); });
361
+ }).catch(e => console.error(e));
365
362
  // scroll to top of QScrollArea, if applicable
366
363
  if(scrollAreaRef.value) {
367
364
  scrollAreaRef.value.setScrollPosition(0);
@@ -369,35 +366,35 @@ var QIconPicker = defineComponent({
369
366
  }
370
367
  });
371
368
 
372
- watch(function () { return props.icons; }, function (val) {
369
+ watch(() => props.icons, (val) => {
373
370
  if (props.icons !== void 0 && props.icons.length > 0) {
374
371
  data.iconsList = props.icons;
375
372
  }
376
373
  updatePagination();
377
- nextTick(function () {
374
+ nextTick(() => {
378
375
  // whenever the icon set changes, it resets pagination page to page 1
379
376
  setPagination({ page: 1 });
380
- }).catch(function (e) { return console.error(e); });
377
+ }).catch(e => console.error(e));
381
378
  // scroll to top of QScrollArea, if applicable
382
379
  if(scrollAreaRef.value) {
383
380
  scrollAreaRef.value.setScrollPosition(0);
384
381
  }
385
382
  });
386
383
 
387
- watch(function () { return props.filter; }, function () {
384
+ watch(() => props.filter, () => {
388
385
  // whenever the filter changes, it resets pagination page to page 1
389
386
  setPagination({ page: 1, totalPages: computedPagesNumber.value });
390
387
  updatePagination();
391
388
  });
392
389
 
393
- watch(function () { return props.tags; }, function (val) {
390
+ watch(() => props.tags, (val) => {
394
391
  // whenever the tags change, it resets pagination page to page 1
395
392
  setPagination({ page: 1, totalPages: computedPagesNumber.value });
396
393
  updatePagination();
397
394
  });
398
395
 
399
396
  if (props.modelPagination) {
400
- watch(function () { return props.modelPagination; }, function (newVal, oldVal) {
397
+ watch(() => props.modelPagination, (newVal, oldVal) => {
401
398
  if (!samePagination(oldVal, newVal)) {
402
399
  updatePagination();
403
400
  }
@@ -405,29 +402,28 @@ var QIconPicker = defineComponent({
405
402
  }
406
403
 
407
404
  if (props.modelPagination) {
408
- watch(function () { return props.modelPagination.itemsPerPage; }, function () {
405
+ watch(() => props.modelPagination.itemsPerPage, () => {
409
406
  updatePagination();
410
407
  });
411
408
 
412
- watch(function () { return props.modelPagination.page; }, function () {
409
+ watch(() =>props.modelPagination.page, () => {
413
410
  updatePagination();
414
411
  });
415
412
  }
416
413
 
417
- return function () {
414
+ return () => {
418
415
 
419
416
  function renderPagination() {
420
- if (props.modelPagination && props.modelPagination.itemsPerPage === 0) { return '' }
421
- var slot = (slots.pagination && slots.pagination());
422
- var ref = computedPagination.value;
423
- var page = ref.page;
424
- var totalPages = ref.totalPages;
425
-
426
- return slot || h(QPagination, Object.assign({}, {class: 'q-icon-picker__pagination'},
427
- props.paginationProps,
428
- {modelValue: page,
417
+ if (props.modelPagination && props.modelPagination.itemsPerPage === 0) return ''
418
+ const slot = (slots.pagination && slots.pagination());
419
+ const { page, totalPages } = computedPagination.value;
420
+
421
+ return slot || h(QPagination, {
422
+ class: 'q-icon-picker__pagination',
423
+ ...props.paginationProps,
424
+ modelValue: page,
429
425
  max: totalPages,
430
- 'onUpdate:modelValue': function (value) {
426
+ 'onUpdate:modelValue': value => {
431
427
  if (props.animated) {
432
428
  if (value > page) {
433
429
  data.direction = direction.NEXT;
@@ -437,12 +433,13 @@ var QIconPicker = defineComponent({
437
433
  }
438
434
  }
439
435
  setPagination({ page: value });
440
- }}))
436
+ }
437
+ })
441
438
  }
442
439
 
443
440
  function renderFooter() {
444
441
  if (props.noFooter !== true && props.modelPagination !== void 0) {
445
- var slot = (slots.footer && slots.footer());
442
+ const slot = (slots.footer && slots.footer());
446
443
 
447
444
  return h('div', {
448
445
  class: 'q-icon-picker__footer flex flex-center'
@@ -454,20 +451,20 @@ var QIconPicker = defineComponent({
454
451
 
455
452
  function renderTooltip(name) {
456
453
  if (props.tooltips === true) {
457
- return function () { return h(QTooltip, {}, function () { return name; }); }
454
+ return () => h(QTooltip, {}, () => name)
458
455
  }
459
456
  }
460
457
 
461
458
  function renderIcon(icon) {
462
- var name = (icon.prefix !== void 0 ? icon.prefix + ' ' + icon.name : icon.name);
459
+ const name = (icon.prefix !== void 0 ? icon.prefix + ' ' + icon.name : icon.name);
463
460
 
464
461
  if (slots.icon && slots.icon()) {
465
462
  return slots.icon(name)
466
463
  }
467
- var isSelected = name === props.modelValue;
468
- var textColor = isSelected ? props.selectedTextColor : undefined;
469
- var color = isSelected ? props.selectedColor : undefined;
470
- var size = props.size ? props.size : undefined;
464
+ const isSelected = name === props.modelValue;
465
+ const textColor = isSelected ? props.selectedTextColor : undefined;
466
+ const color = isSelected ? props.selectedColor : undefined;
467
+ const size = props.size ? props.size : undefined;
471
468
 
472
469
  return h(QBtn, {
473
470
  id: name,
@@ -478,26 +475,26 @@ var QIconPicker = defineComponent({
478
475
  textColor: textColor,
479
476
  color: color,
480
477
  icon: name,
481
- onClick: function () { return emit('update:model-value', name); },
478
+ onClick: () => emit('update:model-value', name),
482
479
  }, renderTooltip(name))
483
480
  }
484
481
 
485
482
  function renderIcons() {
486
- return computedDisplayedIcons.value.map(function (icon) { return renderIcon(icon); })
483
+ return computedDisplayedIcons.value.map(icon => renderIcon(icon))
487
484
  }
488
485
 
489
486
  function renderContainer() {
490
- var container = function () { return h('div', {
487
+ const container = () => h('div', {
491
488
  key: computedPagination.value.page,
492
489
  class: 'q-icon-picker__container col'
493
- }, [].concat( renderIcons() )); };
490
+ }, [...renderIcons()]);
494
491
 
495
492
  if (props.animated === true) {
496
- var transition = 'q-transition--' + (data.direction === 'prev' ? props.transitionPrev : props.transitionNext);
497
- return function () { return h(Transition, {
493
+ const transition = 'q-transition--' + (data.direction === 'prev' ? props.transitionPrev : props.transitionNext);
494
+ return () => h(Transition, {
498
495
  name: transition,
499
496
  appear: true
500
- }, container); }
497
+ }, container)
501
498
  }
502
499
 
503
500
  return container
@@ -520,7 +517,7 @@ var QIconPicker = defineComponent({
520
517
  }, [
521
518
  renderScrollArea(),
522
519
  h(QResizeObserver, {
523
- onResize: function (size) {
520
+ onResize: (size) => {
524
521
  data.width = size.width;
525
522
  data.height = size.height;
526
523
  }
@@ -528,31 +525,31 @@ var QIconPicker = defineComponent({
528
525
  ])
529
526
  }
530
527
 
531
- var classes = [
528
+ const classes = [
532
529
  'q-icon-picker',
533
530
  'column'
534
531
  ];
535
- if (props.color) { classes.push('bg-' + props.color); }
536
- if (props.textColor) { classes.push('text-' + props.textColor); }
532
+ if (props.color) classes.push('bg-' + props.color);
533
+ if (props.textColor) classes.push('text-' + props.textColor);
537
534
 
538
- var picker = h('div', {
535
+ const picker = h('div', {
539
536
  class: classes.join(' ')
540
537
  }, [
541
538
  renderBody(),
542
539
  renderFooter()
543
540
  ]);
544
541
 
545
- nextTick(function () {
542
+ nextTick(() => {
546
543
  categories();
547
544
  emit('update:tags', data.categories);
548
- }).catch(function (e) { return console.error(e); });
545
+ }).catch(e => console.error(e));
549
546
 
550
547
  return picker
551
548
  }
552
549
  }
553
550
  });
554
551
 
555
- var version = '2.0.3';
552
+ const version = '2.0.5';
556
553
 
557
554
  function install (app) {
558
555
  app.component(QIconPicker.name, QIconPicker);
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @quasar/quasar-ui-qiconpicker v2.0.3
3
- * (c) 2021 Jeff Galbraith <jeff@quasar.dev>
2
+ * @quasar/quasar-ui-qiconpicker v2.0.5
3
+ * (c) 2022 Jeff Galbraith <jeff@quasar.dev>
4
4
  * Released under the MIT License.
5
5
  */
6
- import{defineComponent,ref,reactive,computed,onMounted,watch,nextTick,h,Transition}from"vue";import{QScrollArea,QResizeObserver,QPagination,QBtn,QTooltip}from"quasar";var 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=computed(function(){return o(Object.assign({},n.innerPagination,t.modelPagination))}),c=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=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=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})},g=function(){o({page:0})},d=computed(function(){return 0===a.value||i.value.page>=c.value}),f=computed(function(){return 1===i.value.page});e({prevPage:u,nextPage:s,lastPage:l,firstPage:g,isLastPage:d,isFirstPage:f})}var QIconPicker=defineComponent({name:"QIconPicker",props:Object.assign({},useIconPickerProps),emits:["update:model-value","update:tags","update:model-pagination"],setup:function(s,e){var l=e.slots,g=e.emit,n=e.expose,d=ref(null),f=reactive({iconsList:[],innerPagination:{page:1,itemsPerPage:0,totalPages:0},categories:[],width:"100",height:"100",direction:""}),t=computed(function(){var e=v.value,n=e.page,e=e.itemsPerPage;return(n-1)*e}),i=computed(function(){var e=v.value,n=e.page,e=e.itemsPerPage;return n*e}),o=useIconPickerIcons(f,s,t,i),a=o.loadIconSet,p=o.computedDisplayedIcons,e=o.computedFilteredIcons,P=o.categories,o=useIconPickerPagination(f,s,g,e),r=o.samePagination,v=o.computedPagination,m=o.setPagination,c=o.updatePagination,u=o.computedPagesNumber;return exposeIconPickerApi(f,n,v,m,t,i,e,u),onMounted(function(){s.iconSet?a(s.iconSet):void 0!==s.icons&&s.icons.length>0&&(f.iconsList=s.icons),c()}),watch(function(){return s.iconSet},function(e){e&&(a(e),c(),nextTick(function(){m({page:1})}).catch(function(e){return console.error(e)}),d.value&&d.value.setScrollPosition(0))}),watch(function(){return s.icons},function(e){void 0!==s.icons&&s.icons.length>0&&(f.iconsList=s.icons),c(),nextTick(function(){m({page:1})}).catch(function(e){return console.error(e)}),d.value&&d.value.setScrollPosition(0)}),watch(function(){return s.filter},function(){m({page:1,totalPages:u.value}),c()}),watch(function(){return s.tags},function(e){m({page:1,totalPages:u.value}),c()}),s.modelPagination&&watch(function(){return s.modelPagination},function(e,n){r(n,e)||c()}),s.modelPagination&&(watch(function(){return s.modelPagination.itemsPerPage},function(){c()}),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=v.value,t=n.page,n=n.totalPages;return e||h(QPagination,Object.assign({},{class:"q-icon-picker__pagination"},s.paginationProps,{modelValue:t,max:n,"onUpdate:modelValue":function(e){s.animated&&(f.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 h("div",{class:"q-icon-picker__footer flex flex-center"},[e?e(v.value):n()])}}function o(e){if(!0===s.tooltips)return function(){return h(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 h(QBtn,{id:n,unelevated:!0,dense:s.dense,noWrap:!0,size:t,textColor:i,color:e,icon:n,onClick:function(){return g("update:model-value",n)}},o(n))}function i(){return p.value.map(function(e){return t(e)})}function a(){var e=function(){return h("div",{key:v.value.page,class:"q-icon-picker__container col"},[].concat(i()))};if(!0!==s.animated)return e;var n="q-transition--"+("prev"===f.direction?s.transitionPrev:s.transitionNext);return function(){return h(Transition,{name:n,appear:!0},e)}}function r(){return h(QScrollArea,{ref:d,style:{width:f.width+"px",height:f.height+"px"}},a())}function c(){return h("div",{class:"q-icon-picker__body col column"},[r(),h(QResizeObserver,{onResize:function(e){f.width=e.width,f.height=e.height}})])}var u=["q-icon-picker","column"];s.color&&u.push("bg-"+s.color),s.textColor&&u.push("text-"+s.textColor);u=h("div",{class:u.join(" ")},[c(),e()]);return nextTick(function(){P(),g("update:tags",f.categories)}).catch(function(e){return console.error(e)}),u}}}),version="2.0.3";function install(e){e.component(QIconPicker.name,QIconPicker)}var VuePlugin=Object.freeze({__proto__:null,version:version,QIconPicker:QIconPicker,install:install});export{QIconPicker,VuePlugin as default,install,version};
6
+ import{defineComponent,ref,reactive,computed,onMounted,watch,nextTick,h,Transition}from"vue";import{QScrollArea,QResizeObserver,QPagination,QBtn,QTooltip}from"quasar";const useIconPickerProps={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"}},direction={NEXT:"next",PREV:"prev"};function useIconPickerPagination(o,t,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,n){for(const o in n)if(n[o]!==e[o])return!1;return!0}const c=computed(()=>{return a({...o.innerPagination,...t.modelPagination})}),n=computed(()=>{return 0===c.value.itemsPerPage?1:Math.max(1,Math.ceil(e.value.length/c.value.itemsPerPage))});function s(e){const n=a({...c.value,...e});r(o.innerPagination,n)||(t.modelPagination&&i("update:model-pagination",n),o.innerPagination=n)}function l(){void 0!==t.modelPagination&&s({total:e.value.length,totalPages:n.value})}return{samePagination:r,computedPagination:c,setPagination:s,updatePagination:l,computedPagesNumber:n}}function useIconPickerIcons(t,n,o,i){function e(n){if(t.iconsList=[],n)if(window.QIconPicker){const e=n.replace(/-([a-z])/g,e=>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.`)}const a=computed(()=>{let e=[];t.iconsList&&(e=r.value,n.modelPagination&&0!==n.modelPagination.itemsPerPage&&(e=e.slice(o.value,i.value)));return e}),r=computed(()=>{let e=t.iconsList;e&&(void 0!==n.tags&&""!==n.tags&&null!==n.tags&&n.tags.length>0&&(e=e.filter(e=>{return e.tags.filter(e=>n.tags.includes(e)).length>0})),void 0!==n.filter&&""!==n.filter&&null!==n.filter&&(e=e.filter(e=>e.name.includes(n.filter))));return e});function c(){const o=[];return t.iconsList.forEach(e=>{const n=e.tags;n&&n.length>0&&n.forEach(e=>{!0!==o.includes(e)&&o.push(e)})}),o.sort(),t.categories=o,!0}return{loadIconSet:e,computedDisplayedIcons:a,computedFilteredIcons:r,categories:c}}function exposeIconPickerApi(o,e,t,i,n,a,r,c){const s=()=>{const e=t.value["page"];e>1&&(i({page:e-1}),o.direction=direction.PREV)},l=()=>{const{page:e,itemsPerPage:n}=t.value;a.value>0&&e*n<r.value.length&&(i({page:e+1}),o.direction=direction.NEXT)},u=()=>{i({page:c.value})},d=()=>{i({page:0})},g=computed(()=>{return 0===a.value||t.value.page>=c.value}),p=computed(()=>{return 1===t.value.page});e({prevPage:s,nextPage:l,lastPage:u,firstPage:d,isLastPage:g,isFirstPage:p})}var QIconPicker=defineComponent({name:"QIconPicker",props:{...useIconPickerProps},emits:["update:model-value","update:tags","update:model-pagination"],setup(u,{slots:d,emit:g,expose:e}){const p=ref(null),P=reactive({iconsList:[],innerPagination:{page:1,itemsPerPage:0,totalPages:0},categories:[],width:"100",height:"100",direction:""}),n=computed(()=>{const{page:e,itemsPerPage:n}=f.value;return(e-1)*n}),o=computed(()=>{const{page:e,itemsPerPage:n}=f.value;return e*n}),{loadIconSet:t,computedDisplayedIcons:m,computedFilteredIcons:i,categories:v}=useIconPickerIcons(P,u,n,o),{samePagination:a,computedPagination:f,setPagination:k,updatePagination:r,computedPagesNumber:c}=useIconPickerPagination(P,u,g,i);return exposeIconPickerApi(P,e,f,k,n,o,i,c),onMounted(()=>{u.iconSet?t(u.iconSet):void 0!==u.icons&&u.icons.length>0&&(P.iconsList=u.icons);r()}),watch(()=>u.iconSet,e=>{e&&(t(e),r(),nextTick(()=>{k({page:1})}).catch(e=>console.error(e)),p.value&&p.value.setScrollPosition(0))}),watch(()=>u.icons,e=>{void 0!==u.icons&&u.icons.length>0&&(P.iconsList=u.icons);r();nextTick(()=>{k({page:1})}).catch(e=>console.error(e));p.value&&p.value.setScrollPosition(0)}),watch(()=>u.filter,()=>{k({page:1,totalPages:c.value});r()}),watch(()=>u.tags,e=>{k({page:1,totalPages:c.value});r()}),u.modelPagination&&watch(()=>u.modelPagination,(e,n)=>{a(n,e)||r()}),u.modelPagination&&(watch(()=>u.modelPagination.itemsPerPage,()=>{r()}),watch(()=>u.modelPagination.page,()=>{r()})),()=>{function n(){if(u.modelPagination&&0===u.modelPagination.itemsPerPage)return"";const e=d.pagination&&d.pagination(),{page:n,totalPages:o}=f.value;return e||h(QPagination,{class:"q-icon-picker__pagination",...u.paginationProps,modelValue:n,max:o,"onUpdate:modelValue":e=>{u.animated&&(e>n?P.direction=direction.NEXT:P.direction=direction.PREV);k({page:e})}})}function e(){if(!0!==u.noFooter&&void 0!==u.modelPagination){const e=d.footer&&d.footer();return h("div",{class:"q-icon-picker__footer flex flex-center"},[e?e(f.value):n()])}}function r(e){if(!0===u.tooltips)return()=>h(QTooltip,{},()=>e)}function o(e){const n=void 0!==e.prefix?e.prefix+" "+e.name:e.name;if(d.icon&&d.icon())return d.icon(n);const o=n===u.modelValue,t=o?u.selectedTextColor:void 0,i=o?u.selectedColor:void 0,a=u.size||void 0;return h(QBtn,{id:n,unelevated:!0,dense:u.dense,noWrap:!0,size:a,textColor:t,color:i,icon:n,onClick:()=>g("update:model-value",n)},r(n))}function t(){return m.value.map(e=>o(e))}function i(){const e=()=>h("div",{key:f.value.page,class:"q-icon-picker__container col"},[...t()]);if(!0!==u.animated)return e;{const n="q-transition--"+("prev"===P.direction?u.transitionPrev:u.transitionNext);return()=>h(Transition,{name:n,appear:!0},e)}}function a(){return h(QScrollArea,{ref:p,style:{width:P.width+"px",height:P.height+"px"}},i())}function c(){return h("div",{class:"q-icon-picker__body col column"},[a(),h(QResizeObserver,{onResize:e=>{P.width=e.width;P.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=h("div",{class:s.join(" ")},[c(),e()]);nextTick(()=>{v();g("update:tags",P.categories)}).catch(e=>console.error(e));return l}}});const version="2.0.5";function install(e){e.component(QIconPicker.name,QIconPicker)}var VuePlugin=Object.freeze({__proto__:null,version:version,QIconPicker:QIconPicker,install:install});export{QIconPicker,VuePlugin as default,install,version};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @quasar/quasar-ui-qiconpicker v2.0.3
3
- * (c) 2021 Jeff Galbraith <jeff@quasar.dev>
2
+ * @quasar/quasar-ui-qiconpicker v2.0.5
3
+ * (c) 2022 Jeff Galbraith <jeff@quasar.dev>
4
4
  * Released under the MIT License.
5
5
  */.q-icon-picker{display:flex;flex-direction:column;flex-wrap:nowrap;width:100%;height:100%}.q-icon-picker__body{position:relative}.q-icon-picker__body,.q-icon-picker__scroll-area{overflow:hidden;flex:1 1 auto;width:100%}.q-icon-picker__container{display:flex;flex:1 1 auto;flex-wrap:wrap;flex-direction:row;justify-content:center;width:100%}.q-icon-picker__footer,.q-icon-picker__header{width:100%}
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @quasar/quasar-ui-qiconpicker v2.0.3
3
- * (c) 2021 Jeff Galbraith <jeff@quasar.dev>
2
+ * @quasar/quasar-ui-qiconpicker v2.0.5
3
+ * (c) 2022 Jeff Galbraith <jeff@quasar.dev>
4
4
  * Released under the MIT License.
5
5
  */
6
6
  .q-icon-picker {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @quasar/quasar-ui-qiconpicker v2.0.3
3
- * (c) 2021 Jeff Galbraith <jeff@quasar.dev>
2
+ * @quasar/quasar-ui-qiconpicker v2.0.5
3
+ * (c) 2022 Jeff Galbraith <jeff@quasar.dev>
4
4
  * Released under the MIT License.
5
5
  */.q-icon-picker{display:flex;flex-direction:column;flex-wrap:nowrap;width:100%;height:100%}.q-icon-picker__body{position:relative}.q-icon-picker__body,.q-icon-picker__scroll-area{overflow:hidden;flex:1 1 auto;width:100%}.q-icon-picker__container{display:flex;flex:1 1 auto;flex-wrap:wrap;flex-direction:row;justify-content:center;width:100%}.q-icon-picker__footer,.q-icon-picker__header{width:100%}