@quasar/quasar-ui-qiconpicker 2.0.2 → 2.0.5
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.
- package/README.md +1 -1
- package/dist/index.css +2 -2
- package/dist/index.min.css +2 -2
- package/dist/index.rtl.css +2 -2
- package/dist/index.rtl.min.css +2 -2
- package/package.json +29 -29
- package/src/index.js +2 -2
- package/src/version.js +1 -0
- package/src/vue-plugin.js +1 -1
- package/dist/icon-set/bootstrap-icons.umd.js +0 -6
- package/dist/icon-set/eva-icons.umd.js +0 -6
- package/dist/icon-set/fontawesome-v5.umd.js +0 -6
- package/dist/icon-set/ionicons-v4.umd.js +0 -6
- package/dist/icon-set/line-awesome.umd.js +0 -6
- package/dist/icon-set/material-icons-outlined.umd.js +0 -6
- package/dist/icon-set/material-icons-round.umd.js +0 -6
- package/dist/icon-set/material-icons-sharp.umd.js +0 -6
- package/dist/icon-set/material-icons.umd.js +0 -6
- package/dist/icon-set/mdi-v4.umd.js +0 -6
- package/dist/icon-set/mdi-v5.umd.js +0 -6
- package/dist/icon-set/mdi-v6.umd.js +0 -6
- package/dist/icon-set/themify.umd.js +0 -6
- package/dist/index.common.js +0 -567
- package/dist/index.common.min.js +0 -6
- package/dist/index.esm.js +0 -568
- package/dist/index.esm.min.js +0 -6
- package/dist/index.umd.js +0 -570
- package/dist/index.umd.min.js +0 -6
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @quasar/quasar-ui-qiconpicker v2.0.2
|
|
3
|
-
* (c) 2021 Jeff Galbraith <jeff@quasar.dev>
|
|
4
|
-
* Released under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
(function(t,a){"object"===typeof exports&&"undefined"!==typeof module?module.exports=a():"function"===typeof define&&define.amd?define(a):(t="undefined"!==typeof globalThis?globalThis:t||self,t.QIconPicker=t.QIconPicker||{},t.QIconPicker.iconSet=t.QIconPicker.iconSet||{},t.QIconPicker.iconSet.themify=a())})(this,function(){"use strict";var t={name:"themify",icons:[{name:"ti-wand",tags:[]},{name:"ti-volume",tags:[]},{name:"ti-user",tags:[]},{name:"ti-unlock",tags:[]},{name:"ti-unlink",tags:[]},{name:"ti-trash",tags:[]},{name:"ti-thought",tags:[]},{name:"ti-target",tags:[]},{name:"ti-tag",tags:[]},{name:"ti-tablet",tags:[]},{name:"ti-star",tags:[]},{name:"ti-spray",tags:[]},{name:"ti-signal",tags:[]},{name:"ti-shopping-cart",tags:[]},{name:"ti-shopping-cart-full",tags:[]},{name:"ti-settings",tags:[]},{name:"ti-search",tags:[]},{name:"ti-zoom-in",tags:[]},{name:"ti-zoom-out",tags:[]},{name:"ti-cut",tags:[]},{name:"ti-ruler",tags:[]},{name:"ti-ruler-pencil",tags:[]},{name:"ti-ruler-alt",tags:[]},{name:"ti-bookmark",tags:[]},{name:"ti-bookmark-alt",tags:[]},{name:"ti-reload",tags:[]},{name:"ti-plus",tags:[]},{name:"ti-pin",tags:[]},{name:"ti-pencil",tags:[]},{name:"ti-pencil-alt",tags:[]},{name:"ti-paint-roller",tags:[]},{name:"ti-paint-bucket",tags:[]},{name:"ti-na",tags:[]},{name:"ti-mobile",tags:[]},{name:"ti-minus",tags:[]},{name:"ti-medall",tags:[]},{name:"ti-medall-alt",tags:[]},{name:"ti-marker",tags:[]},{name:"ti-marker-alt",tags:[]},{name:"ti-arrow-up",tags:[]},{name:"ti-arrow-right",tags:[]},{name:"ti-arrow-left",tags:[]},{name:"ti-arrow-down",tags:[]},{name:"ti-lock",tags:[]},{name:"ti-location-arrow",tags:[]},{name:"ti-link",tags:[]},{name:"ti-layout",tags:[]},{name:"ti-layers",tags:[]},{name:"ti-layers-alt",tags:[]},{name:"ti-key",tags:[]},{name:"ti-import",tags:[]},{name:"ti-image",tags:[]},{name:"ti-heart",tags:[]},{name:"ti-heart-broken",tags:[]},{name:"ti-hand-stop",tags:[]},{name:"ti-hand-open",tags:[]},{name:"ti-hand-drag",tags:[]},{name:"ti-folder",tags:[]},{name:"ti-flag",tags:[]},{name:"ti-flag-alt",tags:[]},{name:"ti-flag-alt-2",tags:[]},{name:"ti-eye",tags:[]},{name:"ti-export",tags:[]},{name:"ti-exchange-vertical",tags:[]},{name:"ti-desktop",tags:[]},{name:"ti-cup",tags:[]},{name:"ti-crown",tags:[]},{name:"ti-comments",tags:[]},{name:"ti-comment",tags:[]},{name:"ti-comment-alt",tags:[]},{name:"ti-close",tags:[]},{name:"ti-clip",tags:[]},{name:"ti-angle-up",tags:[]},{name:"ti-angle-right",tags:[]},{name:"ti-angle-left",tags:[]},{name:"ti-angle-down",tags:[]},{name:"ti-check",tags:[]},{name:"ti-check-box",tags:[]},{name:"ti-camera",tags:[]},{name:"ti-announcement",tags:[]},{name:"ti-brush",tags:[]},{name:"ti-briefcase",tags:[]},{name:"ti-bolt",tags:[]},{name:"ti-bolt-alt",tags:[]},{name:"ti-blackboard",tags:[]},{name:"ti-bag",tags:[]},{name:"ti-move",tags:[]},{name:"ti-arrows-vertical",tags:[]},{name:"ti-arrows-horizontal",tags:[]},{name:"ti-fullscreen",tags:[]},{name:"ti-arrow-top-right",tags:[]},{name:"ti-arrow-top-left",tags:[]},{name:"ti-arrow-circle-up",tags:[]},{name:"ti-arrow-circle-right",tags:[]},{name:"ti-arrow-circle-left",tags:[]},{name:"ti-arrow-circle-down",tags:[]},{name:"ti-angle-double-up",tags:[]},{name:"ti-angle-double-right",tags:[]},{name:"ti-angle-double-left",tags:[]},{name:"ti-angle-double-down",tags:[]},{name:"ti-zip",tags:[]},{name:"ti-world",tags:[]},{name:"ti-wheelchair",tags:[]},{name:"ti-view-list",tags:[]},{name:"ti-view-list-alt",tags:[]},{name:"ti-view-grid",tags:[]},{name:"ti-uppercase",tags:[]},{name:"ti-upload",tags:[]},{name:"ti-underline",tags:[]},{name:"ti-truck",tags:[]},{name:"ti-timer",tags:[]},{name:"ti-ticket",tags:[]},{name:"ti-thumb-up",tags:[]},{name:"ti-thumb-down",tags:[]},{name:"ti-text",tags:[]},{name:"ti-stats-up",tags:[]},{name:"ti-stats-down",tags:[]},{name:"ti-split-v",tags:[]},{name:"ti-split-h",tags:[]},{name:"ti-smallcap",tags:[]},{name:"ti-shine",tags:[]},{name:"ti-shift-right",tags:[]},{name:"ti-shift-left",tags:[]},{name:"ti-shield",tags:[]},{name:"ti-notepad",tags:[]},{name:"ti-server",tags:[]},{name:"ti-quote-right",tags:[]},{name:"ti-quote-left",tags:[]},{name:"ti-pulse",tags:[]},{name:"ti-printer",tags:[]},{name:"ti-power-off",tags:[]},{name:"ti-plug",tags:[]},{name:"ti-pie-chart",tags:[]},{name:"ti-paragraph",tags:[]},{name:"ti-panel",tags:[]},{name:"ti-package",tags:[]},{name:"ti-music",tags:[]},{name:"ti-music-alt",tags:[]},{name:"ti-mouse",tags:[]},{name:"ti-mouse-alt",tags:[]},{name:"ti-money",tags:[]},{name:"ti-microphone",tags:[]},{name:"ti-menu",tags:[]},{name:"ti-menu-alt",tags:[]},{name:"ti-map",tags:[]},{name:"ti-map-alt",tags:[]},{name:"ti-loop",tags:[]},{name:"ti-location-pin",tags:[]},{name:"ti-list",tags:[]},{name:"ti-light-bulb",tags:[]},{name:"ti-Italic",tags:[]},{name:"ti-info",tags:[]},{name:"ti-infinite",tags:[]},{name:"ti-id-badge",tags:[]},{name:"ti-hummer",tags:[]},{name:"ti-home",tags:[]},{name:"ti-help",tags:[]},{name:"ti-headphone",tags:[]},{name:"ti-harddrives",tags:[]},{name:"ti-harddrive",tags:[]},{name:"ti-gift",tags:[]},{name:"ti-game",tags:[]},{name:"ti-filter",tags:[]},{name:"ti-files",tags:[]},{name:"ti-file",tags:[]},{name:"ti-eraser",tags:[]},{name:"ti-envelope",tags:[]},{name:"ti-download",tags:[]},{name:"ti-direction",tags:[]},{name:"ti-direction-alt",tags:[]},{name:"ti-dashboard",tags:[]},{name:"ti-control-stop",tags:[]},{name:"ti-control-shuffle",tags:[]},{name:"ti-control-play",tags:[]},{name:"ti-control-pause",tags:[]},{name:"ti-control-forward",tags:[]},{name:"ti-control-backward",tags:[]},{name:"ti-cloud",tags:[]},{name:"ti-cloud-up",tags:[]},{name:"ti-cloud-down",tags:[]},{name:"ti-clipboard",tags:[]},{name:"ti-car",tags:[]},{name:"ti-calendar",tags:[]},{name:"ti-book",tags:[]},{name:"ti-bell",tags:[]},{name:"ti-basketball",tags:[]},{name:"ti-bar-chart",tags:[]},{name:"ti-bar-chart-alt",tags:[]},{name:"ti-back-right",tags:[]},{name:"ti-back-left",tags:[]},{name:"ti-arrows-corner",tags:[]},{name:"ti-archive",tags:[]},{name:"ti-anchor",tags:[]},{name:"ti-align-right",tags:[]},{name:"ti-align-left",tags:[]},{name:"ti-align-justify",tags:[]},{name:"ti-align-center",tags:[]},{name:"ti-alert",tags:[]},{name:"ti-alarm-clock",tags:[]},{name:"ti-agenda",tags:[]},{name:"ti-write",tags:[]},{name:"ti-window",tags:[]},{name:"ti-widgetized",tags:[]},{name:"ti-widget",tags:[]},{name:"ti-widget-alt",tags:[]},{name:"ti-wallet",tags:[]},{name:"ti-video-clapper",tags:[]},{name:"ti-video-camera",tags:[]},{name:"ti-vector",tags:[]},{name:"ti-themify-logo",tags:[]},{name:"ti-themify-favicon",tags:[]},{name:"ti-themify-favicon-alt",tags:[]},{name:"ti-support",tags:[]},{name:"ti-stamp",tags:[]},{name:"ti-split-v-alt",tags:[]},{name:"ti-slice",tags:[]},{name:"ti-shortcode",tags:[]},{name:"ti-shift-right-alt",tags:[]},{name:"ti-shift-left-alt",tags:[]},{name:"ti-ruler-alt-2",tags:[]},{name:"ti-receipt",tags:[]},{name:"ti-pin2",tags:[]},{name:"ti-pin-alt",tags:[]},{name:"ti-pencil-alt2",tags:[]},{name:"ti-palette",tags:[]},{name:"ti-more",tags:[]},{name:"ti-more-alt",tags:[]},{name:"ti-microphone-alt",tags:[]},{name:"ti-magnet",tags:[]},{name:"ti-line-double",tags:[]},{name:"ti-line-dotted",tags:[]},{name:"ti-line-dashed",tags:[]},{name:"ti-layout-width-full",tags:[]},{name:"ti-layout-width-default",tags:[]},{name:"ti-layout-width-default-alt",tags:[]},{name:"ti-layout-tab",tags:[]},{name:"ti-layout-tab-window",tags:[]},{name:"ti-layout-tab-v",tags:[]},{name:"ti-layout-tab-min",tags:[]},{name:"ti-layout-slider",tags:[]},{name:"ti-layout-slider-alt",tags:[]},{name:"ti-layout-sidebar-right",tags:[]},{name:"ti-layout-sidebar-none",tags:[]},{name:"ti-layout-sidebar-left",tags:[]},{name:"ti-layout-placeholder",tags:[]},{name:"ti-layout-menu",tags:[]},{name:"ti-layout-menu-v",tags:[]},{name:"ti-layout-menu-separated",tags:[]},{name:"ti-layout-menu-full",tags:[]},{name:"ti-layout-media-right-alt",tags:[]},{name:"ti-layout-media-right",tags:[]},{name:"ti-layout-media-overlay",tags:[]},{name:"ti-layout-media-overlay-alt",tags:[]},{name:"ti-layout-media-overlay-alt-2",tags:[]},{name:"ti-layout-media-left-alt",tags:[]},{name:"ti-layout-media-left",tags:[]},{name:"ti-layout-media-center-alt",tags:[]},{name:"ti-layout-media-center",tags:[]},{name:"ti-layout-list-thumb",tags:[]},{name:"ti-layout-list-thumb-alt",tags:[]},{name:"ti-layout-list-post",tags:[]},{name:"ti-layout-list-large-image",tags:[]},{name:"ti-layout-line-solid",tags:[]},{name:"ti-layout-grid4",tags:[]},{name:"ti-layout-grid3",tags:[]},{name:"ti-layout-grid2",tags:[]},{name:"ti-layout-grid2-thumb",tags:[]},{name:"ti-layout-cta-right",tags:[]},{name:"ti-layout-cta-left",tags:[]},{name:"ti-layout-cta-center",tags:[]},{name:"ti-layout-cta-btn-right",tags:[]},{name:"ti-layout-cta-btn-left",tags:[]},{name:"ti-layout-column4",tags:[]},{name:"ti-layout-column3",tags:[]},{name:"ti-layout-column2",tags:[]},{name:"ti-layout-accordion-separated",tags:[]},{name:"ti-layout-accordion-merged",tags:[]},{name:"ti-layout-accordion-list",tags:[]},{name:"ti-ink-pen",tags:[]},{name:"ti-info-alt",tags:[]},{name:"ti-help-alt",tags:[]},{name:"ti-headphone-alt",tags:[]},{name:"ti-hand-point-up",tags:[]},{name:"ti-hand-point-right",tags:[]},{name:"ti-hand-point-left",tags:[]},{name:"ti-hand-point-down",tags:[]},{name:"ti-gallery",tags:[]},{name:"ti-face-smile",tags:[]},{name:"ti-face-sad",tags:[]},{name:"ti-credit-card",tags:[]},{name:"ti-control-skip-forward",tags:[]},{name:"ti-control-skip-backward",tags:[]},{name:"ti-control-record",tags:[]},{name:"ti-control-eject",tags:[]},{name:"ti-comments-smiley",tags:[]},{name:"ti-brush-alt",tags:[]},{name:"ti-youtube",tags:[]},{name:"ti-vimeo",tags:[]},{name:"ti-twitter",tags:[]},{name:"ti-time",tags:[]},{name:"ti-tumblr",tags:[]},{name:"ti-skype",tags:[]},{name:"ti-share",tags:[]},{name:"ti-share-alt",tags:[]},{name:"ti-rocket",tags:[]},{name:"ti-pinterest",tags:[]},{name:"ti-new-window",tags:[]},{name:"ti-microsoft",tags:[]},{name:"ti-list-ol",tags:[]},{name:"ti-linkedin",tags:[]},{name:"ti-layout-sidebar-2",tags:[]},{name:"ti-layout-grid4-alt",tags:[]},{name:"ti-layout-grid3-alt",tags:[]},{name:"ti-layout-grid2-alt",tags:[]},{name:"ti-layout-column4-alt",tags:[]},{name:"ti-layout-column3-alt",tags:[]},{name:"ti-layout-column2-alt",tags:[]},{name:"ti-instagram",tags:[]},{name:"ti-google",tags:[]},{name:"ti-github",tags:[]},{name:"ti-flickr",tags:[]},{name:"ti-facebook",tags:[]},{name:"ti-dropbox",tags:[]},{name:"ti-dribbble",tags:[]},{name:"ti-apple",tags:[]},{name:"ti-android",tags:[]},{name:"ti-save",tags:[]},{name:"ti-save-alt",tags:[]},{name:"ti-yahoo",tags:[]},{name:"ti-wordpress",tags:[]},{name:"ti-vimeo-alt",tags:[]},{name:"ti-twitter-alt",tags:[]},{name:"ti-tumblr-alt",tags:[]},{name:"ti-trello",tags:[]},{name:"ti-stack-overflow",tags:[]},{name:"ti-soundcloud",tags:[]},{name:"ti-sharethis",tags:[]},{name:"ti-sharethis-alt",tags:[]},{name:"ti-reddit",tags:[]},{name:"ti-pinterest-alt",tags:[]},{name:"ti-microsoft-alt",tags:[]},{name:"ti-linux",tags:[]},{name:"ti-jsfiddle",tags:[]},{name:"ti-joomla",tags:[]},{name:"ti-html5",tags:[]},{name:"ti-flickr-alt",tags:[]},{name:"ti-email",tags:[]},{name:"ti-drupal",tags:[]},{name:"ti-dropbox-alt",tags:[]},{name:"ti-css3",tags:[]},{name:"ti-rss",tags:[]},{name:"ti-rss-alt",tags:[]}]};return t});
|
package/dist/index.common.js
DELETED
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @quasar/quasar-ui-qiconpicker v2.0.2
|
|
3
|
-
* (c) 2021 Jeff Galbraith <jeff@quasar.dev>
|
|
4
|
-
* Released under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
|
-
|
|
11
|
-
var vue = require('vue');
|
|
12
|
-
var quasar = require('quasar');
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* QIconPicker Properties
|
|
16
|
-
*/
|
|
17
|
-
var useIconPickerProps = {
|
|
18
|
-
modelValue: String,
|
|
19
|
-
iconSet: {
|
|
20
|
-
type: String,
|
|
21
|
-
validator: function (v) { return [
|
|
22
|
-
'material-icons',
|
|
23
|
-
'material-icons-outlined',
|
|
24
|
-
'material-icons-round',
|
|
25
|
-
'material-icons-sharp',
|
|
26
|
-
'ionicons-v4',
|
|
27
|
-
'mdi-v4',
|
|
28
|
-
'mdi-v5',
|
|
29
|
-
'mdi-v6',
|
|
30
|
-
'fontawesome-v5',
|
|
31
|
-
'eva-icons',
|
|
32
|
-
'themify',
|
|
33
|
-
'line-awesome',
|
|
34
|
-
'bootstrap-icons',
|
|
35
|
-
''
|
|
36
|
-
].includes(v); },
|
|
37
|
-
default: ''
|
|
38
|
-
},
|
|
39
|
-
icons: Array,
|
|
40
|
-
filter: String,
|
|
41
|
-
tags: Array,
|
|
42
|
-
dense: Boolean,
|
|
43
|
-
tooltips: Boolean,
|
|
44
|
-
noFooter: Boolean,
|
|
45
|
-
size: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: 'inherit'
|
|
48
|
-
},
|
|
49
|
-
color: String,
|
|
50
|
-
textColor: String,
|
|
51
|
-
selectedColor: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: 'primary'
|
|
54
|
-
},
|
|
55
|
-
selectedTextColor: {
|
|
56
|
-
type: String,
|
|
57
|
-
default: 'grey-1'
|
|
58
|
-
},
|
|
59
|
-
paginationProps: {
|
|
60
|
-
type: Object,
|
|
61
|
-
default: function () { return ({
|
|
62
|
-
maxPages: 5,
|
|
63
|
-
input: true
|
|
64
|
-
}); }
|
|
65
|
-
},
|
|
66
|
-
modelPagination: Object,
|
|
67
|
-
animated: Boolean,
|
|
68
|
-
transitionPrev: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: 'slide-right'
|
|
71
|
-
},
|
|
72
|
-
transitionNext: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: 'slide-left'
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
var direction = {
|
|
79
|
-
NEXT: 'next',
|
|
80
|
-
PREV: 'prev'
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Pagination
|
|
85
|
-
*/
|
|
86
|
-
function useIconPickerPagination(data, props, emit, computedFilteredIcons) {
|
|
87
|
-
|
|
88
|
-
function fixPagination(p) {
|
|
89
|
-
if (p.page < 1) {
|
|
90
|
-
p.page = 1;
|
|
91
|
-
}
|
|
92
|
-
if (p.itemsPerPage === void 0 || p.itemsPerPage < 1) {
|
|
93
|
-
p.itemsPerPage = 0; // all
|
|
94
|
-
}
|
|
95
|
-
return p
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// returns true if the pagination is the same,
|
|
99
|
-
// otherwise returns false if it has changed
|
|
100
|
-
function samePagination(oldPag, newPag) {
|
|
101
|
-
for (var prop in newPag) {
|
|
102
|
-
if (newPag[ prop ] !== oldPag[ prop ]) {
|
|
103
|
-
return false
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return true
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
var computedPagination = vue.computed(function () {
|
|
110
|
-
return fixPagination(Object.assign({}, data.innerPagination,
|
|
111
|
-
props.modelPagination))
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
var computedPagesNumber = vue.computed(function () {
|
|
115
|
-
return computedPagination.value.itemsPerPage === 0 ? 1
|
|
116
|
-
: Math.max(1, Math.ceil(computedFilteredIcons.value.length / computedPagination.value.itemsPerPage))
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
function setPagination(val) {
|
|
120
|
-
var newPagination = fixPagination(Object.assign({}, computedPagination.value,
|
|
121
|
-
val));
|
|
122
|
-
|
|
123
|
-
if (!samePagination(data.innerPagination, newPagination)) {
|
|
124
|
-
if (props.modelPagination) {
|
|
125
|
-
emit('update:model-pagination', newPagination);
|
|
126
|
-
}
|
|
127
|
-
data.innerPagination = newPagination;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function updatePagination() {
|
|
132
|
-
if (props.modelPagination !== void 0) {
|
|
133
|
-
setPagination({ total: computedFilteredIcons.value.length, totalPages: computedPagesNumber.value });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
samePagination: samePagination,
|
|
139
|
-
computedPagination: computedPagination,
|
|
140
|
-
setPagination: setPagination,
|
|
141
|
-
updatePagination: updatePagination,
|
|
142
|
-
computedPagesNumber: computedPagesNumber
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Icons
|
|
148
|
-
*/
|
|
149
|
-
function useIconPickerIcons(data, props, computedFirstItemIndex, computedLastItemIndex) {
|
|
150
|
-
|
|
151
|
-
function loadIconSet(iconSet) {
|
|
152
|
-
data.iconsList = [];
|
|
153
|
-
if (iconSet) {
|
|
154
|
-
// detect if UMD version is installed
|
|
155
|
-
if (window.QIconPicker) {
|
|
156
|
-
var name = iconSet.replace(/-([a-z])/g, function (g) { return g[ 1 ].toUpperCase(); });
|
|
157
|
-
if (window.QIconPicker.iconSet && window.QIconPicker.iconSet[ name ]) {
|
|
158
|
-
data.iconsList = window.QIconPicker.iconSet[ name ].icons;
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
console.error(("QIconPicker: no icon set loaded called " + iconSet));
|
|
162
|
-
console.error('Be sure to load the UMD version of the icon set in a script tag before using QIconPicker UMD version');
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
try {
|
|
167
|
-
data.iconsList = require(("@quasar/quasar-ui-qiconpicker/src/components/icon-set/" + iconSet + ".js")).default.icons;
|
|
168
|
-
}
|
|
169
|
-
catch (e) {
|
|
170
|
-
console.error(("QIconPicker: cannot find icon set found called " + iconSet));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
console.info(("Loaded " + (data.iconsList.length) + " icons."));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
var computedDisplayedIcons = vue.computed(function () {
|
|
178
|
-
var icons = [];
|
|
179
|
-
if (data.iconsList) {
|
|
180
|
-
icons = computedFilteredIcons.value;
|
|
181
|
-
|
|
182
|
-
// should the icons be paged?
|
|
183
|
-
if (props.modelPagination && props.modelPagination.itemsPerPage !== 0) {
|
|
184
|
-
icons = icons.slice(computedFirstItemIndex.value, computedLastItemIndex.value);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return icons
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var computedFilteredIcons = vue.computed(function () {
|
|
191
|
-
var icons = data.iconsList;
|
|
192
|
-
if (icons) {
|
|
193
|
-
if (props.tags !== void 0 && props.tags !== '' && props.tags !== null && props.tags.length > 0) {
|
|
194
|
-
icons = icons.filter(function (icon) {
|
|
195
|
-
return icon.tags.filter(function (tag) { return props.tags.includes(tag); }).length > 0
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
if (props.filter !== void 0 && props.filter !== '' && props.filter !== null) {
|
|
199
|
-
icons = icons.filter(function (icon) { return icon.name.includes(props.filter); });
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return icons
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
function categories() {
|
|
206
|
-
var t = [];
|
|
207
|
-
data.iconsList.forEach(function (icon) {
|
|
208
|
-
var tags = icon.tags;
|
|
209
|
-
if (tags && tags.length > 0) {
|
|
210
|
-
tags.forEach(function (tag) {
|
|
211
|
-
if (t.includes(tag) !== true) {
|
|
212
|
-
t.push(tag);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
t.sort();
|
|
218
|
-
data.categories = t;
|
|
219
|
-
return true
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
loadIconSet: loadIconSet,
|
|
224
|
-
computedDisplayedIcons: computedDisplayedIcons,
|
|
225
|
-
computedFilteredIcons: computedFilteredIcons,
|
|
226
|
-
categories: categories
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Exposes api functions
|
|
232
|
-
*/
|
|
233
|
-
function exposeIconPickerApi(data, expose, computedPagination, setPagination, computedFirstItemIndex, computedLastItemIndex, computedFilteredIcons, computedPagesNumber) {
|
|
234
|
-
// goes to previous page
|
|
235
|
-
var prevPage = function () {
|
|
236
|
-
var ref = computedPagination.value;
|
|
237
|
-
var page = ref.page;
|
|
238
|
-
if (page > 1) {
|
|
239
|
-
setPagination({ page: page - 1 });
|
|
240
|
-
data.direction = direction.PREV;
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
// goes to next page
|
|
245
|
-
var nextPage = function () {
|
|
246
|
-
var ref = computedPagination.value;
|
|
247
|
-
var page = ref.page;
|
|
248
|
-
var itemsPerPage = ref.itemsPerPage;
|
|
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
|
-
var lastPage = function () {
|
|
257
|
-
setPagination({ page: computedPagesNumber.value });
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
// goes to first page
|
|
261
|
-
var firstPage = function () {
|
|
262
|
-
setPagination({ page: 0 });
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
// checks if we are on the last page
|
|
266
|
-
var isLastPage = vue.computed(function () {
|
|
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
|
-
var isFirstPage = vue.computed(function () {
|
|
275
|
-
return computedPagination.value.page === 1
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
expose({
|
|
279
|
-
prevPage: prevPage,
|
|
280
|
-
nextPage: nextPage,
|
|
281
|
-
lastPage: lastPage,
|
|
282
|
-
firstPage: firstPage,
|
|
283
|
-
isLastPage: isLastPage,
|
|
284
|
-
isFirstPage: isFirstPage
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
var QIconPicker = vue.defineComponent({
|
|
290
|
-
name: 'QIconPicker',
|
|
291
|
-
|
|
292
|
-
props: Object.assign({}, useIconPickerProps),
|
|
293
|
-
|
|
294
|
-
emits: [
|
|
295
|
-
'update:model-value',
|
|
296
|
-
'update:tags',
|
|
297
|
-
'update:model-pagination'
|
|
298
|
-
],
|
|
299
|
-
|
|
300
|
-
setup: function setup(props, ref$1) {
|
|
301
|
-
var slots = ref$1.slots;
|
|
302
|
-
var emit = ref$1.emit;
|
|
303
|
-
var expose = ref$1.expose;
|
|
304
|
-
|
|
305
|
-
var scrollAreaRef = vue.ref(null);
|
|
306
|
-
var data = vue.reactive({
|
|
307
|
-
iconsList: [],
|
|
308
|
-
innerPagination: {
|
|
309
|
-
page: 1,
|
|
310
|
-
itemsPerPage: 0,
|
|
311
|
-
totalPages: 0
|
|
312
|
-
},
|
|
313
|
-
categories: [],
|
|
314
|
-
width: '100',
|
|
315
|
-
height: '100',
|
|
316
|
-
direction: ''
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
// index of first item on a page
|
|
320
|
-
var computedFirstItemIndex = vue.computed(function () {
|
|
321
|
-
var ref = computedPagination.value;
|
|
322
|
-
var page = ref.page;
|
|
323
|
-
var itemsPerPage = ref.itemsPerPage;
|
|
324
|
-
return (page - 1) * itemsPerPage
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
// index of last item on a page
|
|
328
|
-
var computedLastItemIndex = vue.computed(function () {
|
|
329
|
-
var ref = computedPagination.value;
|
|
330
|
-
var page = ref.page;
|
|
331
|
-
var itemsPerPage = ref.itemsPerPage;
|
|
332
|
-
return page * itemsPerPage
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
var ref$2 = useIconPickerIcons(data, props, computedFirstItemIndex, computedLastItemIndex);
|
|
336
|
-
var loadIconSet = ref$2.loadIconSet;
|
|
337
|
-
var computedDisplayedIcons = ref$2.computedDisplayedIcons;
|
|
338
|
-
var computedFilteredIcons = ref$2.computedFilteredIcons;
|
|
339
|
-
var categories = ref$2.categories;
|
|
340
|
-
|
|
341
|
-
var ref$3 = useIconPickerPagination(data, props, emit, computedFilteredIcons);
|
|
342
|
-
var samePagination = ref$3.samePagination;
|
|
343
|
-
var computedPagination = ref$3.computedPagination;
|
|
344
|
-
var setPagination = ref$3.setPagination;
|
|
345
|
-
var updatePagination = ref$3.updatePagination;
|
|
346
|
-
var computedPagesNumber = ref$3.computedPagesNumber;
|
|
347
|
-
|
|
348
|
-
exposeIconPickerApi(data, expose, computedPagination, setPagination, computedFirstItemIndex, computedLastItemIndex, computedFilteredIcons, computedPagesNumber);
|
|
349
|
-
|
|
350
|
-
vue.onMounted(function () {
|
|
351
|
-
if (props.iconSet) {
|
|
352
|
-
loadIconSet(props.iconSet);
|
|
353
|
-
}
|
|
354
|
-
else if (props.icons !== void 0 && props.icons.length > 0) {
|
|
355
|
-
data.iconsList = props.icons;
|
|
356
|
-
}
|
|
357
|
-
updatePagination();
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
vue.watch(function () { return props.iconSet; }, function (val) {
|
|
362
|
-
if (val) {
|
|
363
|
-
loadIconSet(val);
|
|
364
|
-
updatePagination();
|
|
365
|
-
vue.nextTick(function () {
|
|
366
|
-
// whenever the icon set changes, it resets pagination page to page 1
|
|
367
|
-
setPagination({ page: 1 });
|
|
368
|
-
}).catch(function (e) { return console.error(e); });
|
|
369
|
-
// scroll to top of QScrollArea, if applicable
|
|
370
|
-
if(scrollAreaRef.value) {
|
|
371
|
-
scrollAreaRef.value.setScrollPosition(0);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
vue.watch(function () { return props.icons; }, function (val) {
|
|
377
|
-
if (props.icons !== void 0 && props.icons.length > 0) {
|
|
378
|
-
data.iconsList = props.icons;
|
|
379
|
-
}
|
|
380
|
-
updatePagination();
|
|
381
|
-
vue.nextTick(function () {
|
|
382
|
-
// whenever the icon set changes, it resets pagination page to page 1
|
|
383
|
-
setPagination({ page: 1 });
|
|
384
|
-
}).catch(function (e) { return console.error(e); });
|
|
385
|
-
// scroll to top of QScrollArea, if applicable
|
|
386
|
-
if(scrollAreaRef.value) {
|
|
387
|
-
scrollAreaRef.value.setScrollPosition(0);
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
vue.watch(function () { return props.filter; }, function () {
|
|
392
|
-
// whenever the filter changes, it resets pagination page to page 1
|
|
393
|
-
setPagination({ page: 1, totalPages: computedPagesNumber.value });
|
|
394
|
-
updatePagination();
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
vue.watch(function () { return props.tags; }, function (val) {
|
|
398
|
-
// whenever the tags change, it resets pagination page to page 1
|
|
399
|
-
setPagination({ page: 1, totalPages: computedPagesNumber.value });
|
|
400
|
-
updatePagination();
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
if (props.modelPagination) {
|
|
404
|
-
vue.watch(function () { return props.modelPagination; }, function (newVal, oldVal) {
|
|
405
|
-
if (!samePagination(oldVal, newVal)) {
|
|
406
|
-
updatePagination();
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
if (props.modelPagination) {
|
|
412
|
-
vue.watch(function () { return props.modelPagination.itemsPerPage; }, function () {
|
|
413
|
-
updatePagination();
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
vue.watch(function () { return props.modelPagination.page; }, function () {
|
|
417
|
-
updatePagination();
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return function () {
|
|
422
|
-
|
|
423
|
-
function renderPagination() {
|
|
424
|
-
if (props.modelPagination && props.modelPagination.itemsPerPage === 0) { return '' }
|
|
425
|
-
var slot = (slots.pagination && slots.pagination());
|
|
426
|
-
var ref = computedPagination.value;
|
|
427
|
-
var page = ref.page;
|
|
428
|
-
var totalPages = ref.totalPages;
|
|
429
|
-
|
|
430
|
-
return slot || vue.h(quasar.QPagination, Object.assign({}, {class: 'q-icon-picker__pagination'},
|
|
431
|
-
props.paginationProps,
|
|
432
|
-
{modelValue: page,
|
|
433
|
-
max: totalPages,
|
|
434
|
-
'onUpdate:modelValue': function (value) {
|
|
435
|
-
if (props.animated) {
|
|
436
|
-
if (value > page) {
|
|
437
|
-
data.direction = direction.NEXT;
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
data.direction = direction.PREV;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
setPagination({ page: value });
|
|
444
|
-
}}))
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
function renderFooter() {
|
|
448
|
-
if (props.noFooter !== true && props.modelPagination !== void 0) {
|
|
449
|
-
var slot = (slots.footer && slots.footer());
|
|
450
|
-
|
|
451
|
-
return vue.h('div', {
|
|
452
|
-
class: 'q-icon-picker__footer flex flex-center'
|
|
453
|
-
}, [
|
|
454
|
-
slot ? slot(computedPagination.value) : renderPagination()
|
|
455
|
-
])
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
function renderTooltip(name) {
|
|
460
|
-
if (props.tooltips === true) {
|
|
461
|
-
return function () { return vue.h(quasar.QTooltip, {}, function () { return name; }); }
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
function renderIcon(icon) {
|
|
466
|
-
var name = (icon.prefix !== void 0 ? icon.prefix + ' ' + icon.name : icon.name);
|
|
467
|
-
|
|
468
|
-
if (slots.icon && slots.icon()) {
|
|
469
|
-
return slots.icon(name)
|
|
470
|
-
}
|
|
471
|
-
var isSelected = name === props.modelValue;
|
|
472
|
-
var textColor = isSelected ? props.selectedTextColor : undefined;
|
|
473
|
-
var color = isSelected ? props.selectedColor : undefined;
|
|
474
|
-
var size = props.size ? props.size : undefined;
|
|
475
|
-
|
|
476
|
-
return vue.h(quasar.QBtn, {
|
|
477
|
-
id: name,
|
|
478
|
-
unelevated: true,
|
|
479
|
-
dense: props.dense,
|
|
480
|
-
noWrap: true,
|
|
481
|
-
size: size,
|
|
482
|
-
textColor: textColor,
|
|
483
|
-
color: color,
|
|
484
|
-
icon: name,
|
|
485
|
-
onClick: function () { return emit('update:model-value', name); },
|
|
486
|
-
}, renderTooltip(name))
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
function renderIcons() {
|
|
490
|
-
return computedDisplayedIcons.value.map(function (icon) { return renderIcon(icon); })
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
function renderContainer() {
|
|
494
|
-
var container = function () { return vue.h('div', {
|
|
495
|
-
key: computedPagination.value.page,
|
|
496
|
-
class: 'q-icon-picker__container col'
|
|
497
|
-
}, [].concat( renderIcons() )); };
|
|
498
|
-
|
|
499
|
-
if (props.animated === true) {
|
|
500
|
-
var transition = 'q-transition--' + (data.direction === 'prev' ? props.transitionPrev : props.transitionNext);
|
|
501
|
-
return function () { return vue.h(vue.Transition, {
|
|
502
|
-
name: transition,
|
|
503
|
-
appear: true
|
|
504
|
-
}, container); }
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
return container
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
function renderScrollArea() {
|
|
512
|
-
return vue.h(quasar.QScrollArea, {
|
|
513
|
-
ref: scrollAreaRef,
|
|
514
|
-
style: {
|
|
515
|
-
width: data.width + 'px',
|
|
516
|
-
height: data.height + 'px'
|
|
517
|
-
}
|
|
518
|
-
}, renderContainer())
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
function renderBody() {
|
|
522
|
-
return vue.h('div', {
|
|
523
|
-
class: 'q-icon-picker__body col column'
|
|
524
|
-
}, [
|
|
525
|
-
renderScrollArea(),
|
|
526
|
-
vue.h(quasar.QResizeObserver, {
|
|
527
|
-
onResize: function (size) {
|
|
528
|
-
data.width = size.width;
|
|
529
|
-
data.height = size.height;
|
|
530
|
-
}
|
|
531
|
-
})
|
|
532
|
-
])
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
var classes = [
|
|
536
|
-
'q-icon-picker',
|
|
537
|
-
'column'
|
|
538
|
-
];
|
|
539
|
-
if (props.color) { classes.push('bg-' + props.color); }
|
|
540
|
-
if (props.textColor) { classes.push('text-' + props.textColor); }
|
|
541
|
-
|
|
542
|
-
var picker = vue.h('div', {
|
|
543
|
-
class: classes.join(' ')
|
|
544
|
-
}, [
|
|
545
|
-
renderBody(),
|
|
546
|
-
renderFooter()
|
|
547
|
-
]);
|
|
548
|
-
|
|
549
|
-
vue.nextTick(function () {
|
|
550
|
-
categories();
|
|
551
|
-
emit('update:tags', data.categories);
|
|
552
|
-
}).catch(function (e) { return console.error(e); });
|
|
553
|
-
|
|
554
|
-
return picker
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
|
|
559
|
-
var version = '2.0.2';
|
|
560
|
-
|
|
561
|
-
function install (app) {
|
|
562
|
-
app.component(QIconPicker.name, QIconPicker);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
exports.QIconPicker = QIconPicker;
|
|
566
|
-
exports.install = install;
|
|
567
|
-
exports.version = version;
|
package/dist/index.common.min.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @quasar/quasar-ui-qiconpicker v2.0.2
|
|
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.2";function install(e){e.component(QIconPicker.name,QIconPicker)}exports.QIconPicker=QIconPicker,exports.install=install,exports.version=version;
|