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