@ozdao/prometheus-framework 0.1.61 → 0.1.63
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-30022293.js +1 -0
- package/dist/BackofficeGallery-f64daa0d.mjs +264 -0
- package/dist/BackofficeReports-cb4b180d.mjs +44 -0
- package/dist/BackofficeReports-d021871f.js +1 -0
- package/dist/BlockTags-8cddaef7.js +1 -0
- package/dist/BlockTags-ee310572.mjs +853 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Button-7643c9aa.js +1 -0
- package/dist/Button-9e1a9284.mjs +226 -0
- package/dist/Button.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/ButtonToggleMembership-7ee4dc8e.mjs +90 -0
- package/dist/ButtonToggleMembership-b9352cec.js +1 -0
- package/dist/CardBlogpost-3c92fbc9.mjs +246 -0
- package/dist/CardBlogpost-c7364b1e.js +1 -0
- package/dist/CardOrganization-647cb571.js +1 -0
- package/dist/CardOrganization-facb77f7.mjs +234 -0
- package/dist/CardProduct-92affca1.js +1 -0
- package/dist/CardProduct-fca53299.mjs +193 -0
- package/dist/Checkbox-5dbe7b23.mjs +62 -0
- package/dist/Checkbox-76f09248.js +1 -0
- package/dist/Chips-0fdb31c9.js +1 -0
- package/dist/Chips-f1a0d085.mjs +214 -0
- package/dist/Community-534d473c.mjs +132 -0
- package/dist/Community-e9aff969.js +1 -0
- package/dist/Dashboard-91d73bc5.js +1 -0
- package/dist/Dashboard-ea9035bc.mjs +152 -0
- package/dist/Dropdown-31115457.js +1 -0
- package/dist/Dropdown-cab3605b.mjs +146 -0
- package/dist/EULA-aba6a807.js +1 -0
- package/dist/EULA-e05236af.mjs +4210 -0
- package/dist/EditOrder-94bbebff.mjs +221 -0
- package/dist/EditOrder-c070d474.js +1 -0
- package/dist/EmptyState-d65bab5b.js +1 -0
- package/dist/EmptyState-e404b05d.mjs +36 -0
- package/dist/Events-46ae8fc6.mjs +123 -0
- package/dist/Events-813c8c7b.js +1 -0
- package/dist/Feed-2d443ad2.mjs +146 -0
- package/dist/Feed-3a4e7a9c.js +1 -0
- package/dist/Feed-8b554fc1.js +1 -0
- package/dist/Feed-98b47c6f.js +1 -0
- package/dist/Feed-a21d6007.mjs +124 -0
- package/dist/Feed-b39138c8.js +1 -0
- package/dist/Feed-c41ef736.mjs +361 -0
- package/dist/Feed-d114330c.mjs +112 -0
- package/dist/Field-e2a43424.js +1 -0
- package/dist/Field-e5ad88d3.mjs +75 -0
- package/dist/Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-0ea8fbf8.js +1 -0
- package/dist/Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-4ed993c7.mjs +1 -0
- package/dist/Gallery-46b5f939.js +1 -0
- package/dist/Gallery-762a9c2d.mjs +241 -0
- package/dist/IconChevronRight-a55f838e.js +1 -0
- package/dist/IconChevronRight-fae9d012.mjs +28 -0
- package/dist/IconCommunity-468dc457.mjs +65 -0
- package/dist/IconCommunity-b339e806.js +1 -0
- package/dist/IconCross-5bf93179.js +1 -0
- package/dist/IconCross-84cb1292.mjs +28 -0
- package/dist/IconEdit-9edfd74d.mjs +21 -0
- package/dist/IconEdit-c0469b45.js +1 -0
- package/dist/Image-4dcfddb8.js +9 -0
- package/dist/Image-e0da17ac.mjs +571 -0
- package/dist/LabelGooglePlay-24feb437.mjs +31 -0
- package/dist/LabelGooglePlay-f80e5ff0.js +1 -0
- package/dist/LeftoverAdd-5a8988d9.js +1 -0
- package/dist/LeftoverAdd-c4f37f47.mjs +227 -0
- package/dist/Leftovers-470a1689.js +1 -0
- package/dist/Leftovers-69c7dcd9.mjs +136 -0
- package/dist/Loader-21f016da.js +1 -0
- package/dist/Loader-cd422786.mjs +41 -0
- package/dist/Loader.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Loader.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Members-04273cd4.mjs +114 -0
- package/dist/Members-0685a15f.js +1 -0
- package/dist/Menu-b5d6a0c7.js +1 -0
- package/dist/Menu-dd7645c1.mjs +13 -0
- package/dist/MenuItem-56ae7f94.js +1 -0
- package/dist/MenuItem-6296d02f.mjs +63 -0
- package/dist/Orders-b64e8cb9.js +1 -0
- package/dist/Orders-ff30db05.mjs +75 -0
- package/dist/Organizations-46aab2c8.mjs +73 -0
- package/dist/Organizations-a8627bc5.js +1 -0
- package/dist/Payments-53e5fecf.js +1 -0
- package/dist/Payments-82e545e1.mjs +87 -0
- package/dist/PlaceholderUserpic-14c6ea7e.mjs +28 -0
- package/dist/PlaceholderUserpic-47f6f319.js +1 -0
- package/dist/Popup-0915427c.mjs +74 -0
- package/dist/Popup-795f5c88.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Product-7e001b81.js +7 -0
- package/dist/Product-f3f42158.mjs +653 -0
- package/dist/ProductEdit-959b3cd3.mjs +295 -0
- package/dist/ProductEdit-bae5e898.js +1 -0
- package/dist/ProductsBackoffice-0716123f.js +1 -0
- package/dist/ProductsBackoffice-a36ecbc6.mjs +85 -0
- package/dist/ProfileBlogposts-c790d1b2.js +1 -0
- package/dist/ProfileBlogposts-f43cf32e.mjs +79 -0
- package/dist/ProfileEvents-12f80fff.mjs +70 -0
- package/dist/ProfileEvents-585570a3.js +1 -0
- package/dist/ProfileOrganizations-bbc2cf40.mjs +73 -0
- package/dist/ProfileOrganizations-d7103514.js +1 -0
- package/dist/Publics-094f3c2c.mjs +45 -0
- package/dist/Publics-1032c0f4.js +1 -0
- package/dist/Select-11ddabf5.mjs +79 -0
- package/dist/Select-3ca5ab39.js +1 -0
- package/dist/SelectMulti-58704d69.mjs +1038 -0
- package/dist/SelectMulti-c25765cf.js +1 -0
- package/dist/SkeletonBlogpost-95db0fa9.js +1 -0
- package/dist/SkeletonBlogpost-e0621af7.mjs +16 -0
- package/dist/SkeletonEvent-8690422d.mjs +16 -0
- package/dist/SkeletonEvent-eb284de8.js +1 -0
- package/dist/SkeletonEventShort-6c9e3940.js +1 -0
- package/dist/SkeletonEventShort-f030e56f.mjs +16 -0
- package/dist/SkeletonOrganization-5c09cfc5.js +1 -0
- package/dist/SkeletonOrganization-8690422d.mjs +16 -0
- package/dist/Socials-31c06635.mjs +74 -0
- package/dist/Socials-cceaeaf2.js +1 -0
- package/dist/Tab-054b61f7.mjs +46 -0
- package/dist/Tab-2c1e4224.js +1 -0
- package/dist/Tab.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Tab.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Upload-06d93178.js +1 -0
- package/dist/Upload-23212d9d.mjs +74 -0
- package/dist/UploadImage-0f488170.js +1 -0
- package/dist/UploadImage-3c627d89.mjs +83 -0
- package/dist/UploadImageMultiple-cb6c7188.mjs +58 -0
- package/dist/UploadImageMultiple-eddaac87.js +1 -0
- package/dist/Wallet-2043b611.mjs +24682 -0
- package/dist/Wallet-8fa7386a.js +55 -0
- package/dist/_plugin-vue_export-helper-dad06003.mjs +9 -0
- package/dist/_plugin-vue_export-helper-f246444f.js +1 -0
- package/dist/auth-56dc2ba7.mjs +607 -0
- package/dist/auth-f018f5b3.js +7 -0
- package/dist/auth.client.cjs +7 -0
- package/dist/auth.client.js +3874 -0
- package/dist/auth.validation-c31a60e7.mjs +24 -0
- package/dist/auth.validation-d049b341.js +1 -0
- package/dist/backoffice.client.cjs +1 -0
- package/dist/backoffice.client.js +265 -0
- package/dist/carousel.es-44c501bc.mjs +383 -0
- package/dist/carousel.es-cdfb392c.js +5 -0
- package/dist/categories-5b08da53.mjs +121 -0
- package/dist/categories-7ccd6be9.js +1 -0
- package/dist/click-outside-0b0727d1.js +2 -0
- package/dist/click-outside-6101836c.mjs +19 -0
- package/dist/community.client.cjs +1 -0
- package/dist/community.client.js +692 -0
- package/dist/dribbble-8e8e169b.js +1 -0
- package/dist/dribbble-ae37c2ac.mjs +127 -0
- package/dist/events.client.cjs +2 -0
- package/dist/events.client.js +8885 -0
- package/dist/files.client.cjs +1 -0
- package/dist/files.client.js +1 -0
- package/dist/gallery-d4297191.mjs +54 -0
- package/dist/gallery-f92912df.js +1 -0
- package/dist/gallery.client.cjs +1 -0
- package/dist/gallery.client.js +18 -0
- package/dist/globals-928eb13c.js +1 -0
- package/dist/globals-96ba60e4.mjs +91 -0
- package/dist/globals.client.cjs +1 -0
- package/dist/globals.client.js +12 -0
- package/dist/icons.client.cjs +1 -0
- package/dist/icons.client.js +84 -0
- package/dist/index-a661083c.mjs +934 -0
- package/dist/index-b41aac19.js +2 -0
- package/dist/inputs.validation-d7cef32b.js +1 -0
- package/dist/inputs.validation-db65277a.mjs +83 -0
- package/dist/landing.client.cjs +1 -0
- package/dist/landing.client.js +111 -0
- package/dist/leftovers-5d1ff88b.mjs +67 -0
- package/dist/leftovers-b60180cf.js +1 -0
- package/dist/legal.client.cjs +1 -0
- package/dist/legal.client.js +8512 -0
- package/dist/memberships-12210953.mjs +68 -0
- package/dist/memberships-393765d8.js +1 -0
- package/dist/middlewares.client.cjs +1 -0
- package/dist/middlewares.client.js +1 -0
- package/dist/orders-13c10d49.mjs +85 -0
- package/dist/orders-37f041aa.js +1 -0
- package/dist/organizations-587d5a4d.mjs +122 -0
- package/dist/organizations-b4d902a2.js +1 -0
- package/dist/organizations.client-35b74e44.mjs +2997 -0
- package/dist/organizations.client-f982f55a.js +3 -0
- package/dist/organizations.client.cjs +1 -0
- package/dist/organizations.client.js +86 -0
- package/dist/products-3c43eb18.js +1 -0
- package/dist/products-943fb95e.mjs +107 -0
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -72
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +75 -93
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +61 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -61
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +19 -19
- package/dist/prometheus-framework.es.js +2208 -2198
- package/dist/reports-270f69df.js +1 -0
- package/dist/reports-79cd9459.mjs +91 -0
- package/dist/reports.client.cjs +1 -0
- package/dist/reports.client.js +8 -0
- package/dist/states.validation-3b70f83a.js +1 -0
- package/dist/states.validation-944e334c.mjs +13 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -0
- package/dist/users.client.js +632 -0
- package/dist/vue-draggable-next.esm-bundler-21a209c6.js +10 -0
- package/dist/vue-draggable-next.esm-bundler-ff6e3f52.mjs +1557 -0
- package/dist/vuex.esm-bundler-57d8b6ba.mjs +750 -0
- package/dist/vuex.esm-bundler-685cf29f.js +5 -0
- package/package.json +1 -1
- package/src/modules/auth/store/auth.js +20 -20
@@ -0,0 +1,1038 @@
|
|
1
|
+
import { openBlock as d, createElementBlock as p, normalizeClass as V, withKeys as f, withModifiers as r, renderSlot as o, createElementVNode as a, withDirectives as b, Fragment as L, renderList as $, toDisplayString as g, vShow as y, createCommentVNode as c, createVNode as B, Transition as D, withCtx as E, normalizeStyle as S, createTextVNode as v } from "vue";
|
2
|
+
import { _ as A } from "./_plugin-vue_export-helper-dad06003.mjs";
|
3
|
+
function O(e) {
|
4
|
+
return e === 0 ? !1 : Array.isArray(e) && e.length === 0 ? !0 : !e;
|
5
|
+
}
|
6
|
+
function M(e) {
|
7
|
+
return (...t) => !e(...t);
|
8
|
+
}
|
9
|
+
function P(e, t) {
|
10
|
+
return e === void 0 && (e = "undefined"), e === null && (e = "null"), e === !1 && (e = "false"), e.toString().toLowerCase().indexOf(t.trim()) !== -1;
|
11
|
+
}
|
12
|
+
function k(e, t, i, l) {
|
13
|
+
return t ? e.filter((u) => P(l(u, i), t)).sort((u, n) => l(u, i).length - l(n, i).length) : e;
|
14
|
+
}
|
15
|
+
function H(e) {
|
16
|
+
return e.filter((t) => !t.$isLabel);
|
17
|
+
}
|
18
|
+
function w(e, t) {
|
19
|
+
return (i) => i.reduce((l, u) => u[e] && u[e].length ? (l.push({
|
20
|
+
$groupLabel: u[t],
|
21
|
+
$isLabel: !0
|
22
|
+
}), l.concat(u[e])) : l, []);
|
23
|
+
}
|
24
|
+
function G(e, t, i, l, u) {
|
25
|
+
return (n) => n.map((s) => {
|
26
|
+
if (!s[i])
|
27
|
+
return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."), [];
|
28
|
+
const h = k(s[i], e, t, u);
|
29
|
+
return h.length ? {
|
30
|
+
[l]: s[l],
|
31
|
+
[i]: h
|
32
|
+
} : [];
|
33
|
+
});
|
34
|
+
}
|
35
|
+
const T = (...e) => (t) => e.reduce((i, l) => l(i), t), C = {
|
36
|
+
data() {
|
37
|
+
return {
|
38
|
+
search: "",
|
39
|
+
isOpen: !1,
|
40
|
+
preferredOpenDirection: "below",
|
41
|
+
optimizedHeight: this.maxHeight
|
42
|
+
};
|
43
|
+
},
|
44
|
+
props: {
|
45
|
+
/**
|
46
|
+
* Decide whether to filter the results based on search query.
|
47
|
+
* Useful for async filtering, where we search through more complex data.
|
48
|
+
* @type {Boolean}
|
49
|
+
*/
|
50
|
+
internalSearch: {
|
51
|
+
type: Boolean,
|
52
|
+
default: !0
|
53
|
+
},
|
54
|
+
/**
|
55
|
+
* Array of available options: Objects, Strings or Integers.
|
56
|
+
* If array of objects, visible label will default to option.label.
|
57
|
+
* If `labal` prop is passed, label will equal option['label']
|
58
|
+
* @type {Array}
|
59
|
+
*/
|
60
|
+
options: {
|
61
|
+
type: Array,
|
62
|
+
required: !0
|
63
|
+
},
|
64
|
+
/**
|
65
|
+
* Equivalent to the `multiple` attribute on a `<select>` input.
|
66
|
+
* @default false
|
67
|
+
* @type {Boolean}
|
68
|
+
*/
|
69
|
+
multiple: {
|
70
|
+
type: Boolean,
|
71
|
+
default: !1
|
72
|
+
},
|
73
|
+
/**
|
74
|
+
* Key to compare objects
|
75
|
+
* @default 'id'
|
76
|
+
* @type {String}
|
77
|
+
*/
|
78
|
+
trackBy: {
|
79
|
+
type: String
|
80
|
+
},
|
81
|
+
/**
|
82
|
+
* Label to look for in option Object
|
83
|
+
* @default 'label'
|
84
|
+
* @type {String}
|
85
|
+
*/
|
86
|
+
label: {
|
87
|
+
type: String
|
88
|
+
},
|
89
|
+
/**
|
90
|
+
* Enable/disable search in options
|
91
|
+
* @default true
|
92
|
+
* @type {Boolean}
|
93
|
+
*/
|
94
|
+
searchable: {
|
95
|
+
type: Boolean,
|
96
|
+
default: !0
|
97
|
+
},
|
98
|
+
/**
|
99
|
+
* Clear the search input after `)
|
100
|
+
* @default true
|
101
|
+
* @type {Boolean}
|
102
|
+
*/
|
103
|
+
clearOnSelect: {
|
104
|
+
type: Boolean,
|
105
|
+
default: !0
|
106
|
+
},
|
107
|
+
/**
|
108
|
+
* Hide already selected options
|
109
|
+
* @default false
|
110
|
+
* @type {Boolean}
|
111
|
+
*/
|
112
|
+
hideSelected: {
|
113
|
+
type: Boolean,
|
114
|
+
default: !1
|
115
|
+
},
|
116
|
+
/**
|
117
|
+
* Equivalent to the `placeholder` attribute on a `<select>` input.
|
118
|
+
* @default 'Select option'
|
119
|
+
* @type {String}
|
120
|
+
*/
|
121
|
+
placeholder: {
|
122
|
+
type: String,
|
123
|
+
default: "Select option"
|
124
|
+
},
|
125
|
+
/**
|
126
|
+
* Allow to remove all selected values
|
127
|
+
* @default true
|
128
|
+
* @type {Boolean}
|
129
|
+
*/
|
130
|
+
allowEmpty: {
|
131
|
+
type: Boolean,
|
132
|
+
default: !0
|
133
|
+
},
|
134
|
+
/**
|
135
|
+
* Reset this.internalValue, this.search after this.internalValue changes.
|
136
|
+
* Useful if want to create a stateless dropdown.
|
137
|
+
* @default false
|
138
|
+
* @type {Boolean}
|
139
|
+
*/
|
140
|
+
resetAfter: {
|
141
|
+
type: Boolean,
|
142
|
+
default: !1
|
143
|
+
},
|
144
|
+
/**
|
145
|
+
* Enable/disable closing after selecting an option
|
146
|
+
* @default true
|
147
|
+
* @type {Boolean}
|
148
|
+
*/
|
149
|
+
closeOnSelect: {
|
150
|
+
type: Boolean,
|
151
|
+
default: !0
|
152
|
+
},
|
153
|
+
/**
|
154
|
+
* Function to interpolate the custom label
|
155
|
+
* @default false
|
156
|
+
* @type {Function}
|
157
|
+
*/
|
158
|
+
customLabel: {
|
159
|
+
type: Function,
|
160
|
+
default(e, t) {
|
161
|
+
return O(e) ? "" : t ? e[t] : e;
|
162
|
+
}
|
163
|
+
},
|
164
|
+
/**
|
165
|
+
* Disable / Enable tagging
|
166
|
+
* @default false
|
167
|
+
* @type {Boolean}
|
168
|
+
*/
|
169
|
+
taggable: {
|
170
|
+
type: Boolean,
|
171
|
+
default: !1
|
172
|
+
},
|
173
|
+
/**
|
174
|
+
* String to show when highlighting a potential tag
|
175
|
+
* @default 'Press enter to create a tag'
|
176
|
+
* @type {String}
|
177
|
+
*/
|
178
|
+
tagPlaceholder: {
|
179
|
+
type: String,
|
180
|
+
default: "Press enter to create a tag"
|
181
|
+
},
|
182
|
+
/**
|
183
|
+
* By default new tags will appear above the search results.
|
184
|
+
* Changing to 'bottom' will revert this behaviour
|
185
|
+
* and will proritize the search results
|
186
|
+
* @default 'top'
|
187
|
+
* @type {String}
|
188
|
+
*/
|
189
|
+
tagPosition: {
|
190
|
+
type: String,
|
191
|
+
default: "top"
|
192
|
+
},
|
193
|
+
/**
|
194
|
+
* Number of allowed selected options. No limit if 0.
|
195
|
+
* @default 0
|
196
|
+
* @type {Number}
|
197
|
+
*/
|
198
|
+
max: {
|
199
|
+
type: [Number, Boolean],
|
200
|
+
default: !1
|
201
|
+
},
|
202
|
+
/**
|
203
|
+
* Will be passed with all events as second param.
|
204
|
+
* Useful for identifying events origin.
|
205
|
+
* @default null
|
206
|
+
* @type {String|Integer}
|
207
|
+
*/
|
208
|
+
id: {
|
209
|
+
default: null
|
210
|
+
},
|
211
|
+
/**
|
212
|
+
* Limits the options displayed in the dropdown
|
213
|
+
* to the first X options.
|
214
|
+
* @default 1000
|
215
|
+
* @type {Integer}
|
216
|
+
*/
|
217
|
+
optionsLimit: {
|
218
|
+
type: Number,
|
219
|
+
default: 1e3
|
220
|
+
},
|
221
|
+
/**
|
222
|
+
* Name of the property containing
|
223
|
+
* the group values
|
224
|
+
* @default 1000
|
225
|
+
* @type {String}
|
226
|
+
*/
|
227
|
+
groupValues: {
|
228
|
+
type: String
|
229
|
+
},
|
230
|
+
/**
|
231
|
+
* Name of the property containing
|
232
|
+
* the group label
|
233
|
+
* @default 1000
|
234
|
+
* @type {String}
|
235
|
+
*/
|
236
|
+
groupLabel: {
|
237
|
+
type: String
|
238
|
+
},
|
239
|
+
/**
|
240
|
+
* Allow to select all group values
|
241
|
+
* by selecting the group label
|
242
|
+
* @default false
|
243
|
+
* @type {Boolean}
|
244
|
+
*/
|
245
|
+
groupSelect: {
|
246
|
+
type: Boolean,
|
247
|
+
default: !1
|
248
|
+
},
|
249
|
+
/**
|
250
|
+
* Array of keyboard keys to block
|
251
|
+
* when selecting
|
252
|
+
* @default 1000
|
253
|
+
* @type {String}
|
254
|
+
*/
|
255
|
+
blockKeys: {
|
256
|
+
type: Array,
|
257
|
+
default() {
|
258
|
+
return [];
|
259
|
+
}
|
260
|
+
},
|
261
|
+
/**
|
262
|
+
* Prevent from wiping up the search value
|
263
|
+
* @default false
|
264
|
+
* @type {Boolean}
|
265
|
+
*/
|
266
|
+
preserveSearch: {
|
267
|
+
type: Boolean,
|
268
|
+
default: !1
|
269
|
+
},
|
270
|
+
/**
|
271
|
+
* Select 1st options if value is empty
|
272
|
+
* @default false
|
273
|
+
* @type {Boolean}
|
274
|
+
*/
|
275
|
+
preselectFirst: {
|
276
|
+
type: Boolean,
|
277
|
+
default: !1
|
278
|
+
},
|
279
|
+
/**
|
280
|
+
* Prevent autofocus
|
281
|
+
* @default false
|
282
|
+
* @type {Boolean}
|
283
|
+
*/
|
284
|
+
preventAutofocus: {
|
285
|
+
type: Boolean,
|
286
|
+
default: !1
|
287
|
+
}
|
288
|
+
},
|
289
|
+
mounted() {
|
290
|
+
!this.multiple && this.max && console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."), this.preselectFirst && !this.internalValue.length && this.options.length && this.select(this.filteredOptions[0]);
|
291
|
+
},
|
292
|
+
computed: {
|
293
|
+
internalValue() {
|
294
|
+
return this.modelValue || this.modelValue === 0 ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] : [];
|
295
|
+
},
|
296
|
+
filteredOptions() {
|
297
|
+
const e = this.search || "", t = e.toLowerCase().trim();
|
298
|
+
let i = this.options.concat();
|
299
|
+
return this.internalSearch ? i = this.groupValues ? this.filterAndFlat(i, t, this.label) : k(i, t, this.label, this.customLabel) : i = this.groupValues ? w(this.groupValues, this.groupLabel)(i) : i, i = this.hideSelected ? i.filter(M(this.isSelected)) : i, this.taggable && t.length && !this.isExistingOption(t) && (this.tagPosition === "bottom" ? i.push({ isTag: !0, label: e }) : i.unshift({ isTag: !0, label: e })), i.slice(0, this.optionsLimit);
|
300
|
+
},
|
301
|
+
valueKeys() {
|
302
|
+
return this.trackBy ? this.internalValue.map((e) => e[this.trackBy]) : this.internalValue;
|
303
|
+
},
|
304
|
+
optionKeys() {
|
305
|
+
return (this.groupValues ? this.flatAndStrip(this.options) : this.options).map((t) => this.customLabel(t, this.label).toString().toLowerCase());
|
306
|
+
},
|
307
|
+
currentOptionLabel() {
|
308
|
+
return this.multiple ? this.searchable ? "" : this.placeholder : this.internalValue.length ? this.getOptionLabel(this.internalValue[0]) : this.searchable ? "" : this.placeholder;
|
309
|
+
}
|
310
|
+
},
|
311
|
+
watch: {
|
312
|
+
internalValue: {
|
313
|
+
handler() {
|
314
|
+
this.resetAfter && this.internalValue.length && (this.search = "", this.$emit("update:modelValue", this.multiple ? [] : null));
|
315
|
+
},
|
316
|
+
deep: !0
|
317
|
+
},
|
318
|
+
search() {
|
319
|
+
this.$emit("search-change", this.search);
|
320
|
+
}
|
321
|
+
},
|
322
|
+
emits: ["open", "search-change", "close", "select", "update:modelValue", "remove", "tag"],
|
323
|
+
methods: {
|
324
|
+
/**
|
325
|
+
* Returns the internalValue in a way it can be emited to the parent
|
326
|
+
* @returns {Object||Array||String||Integer}
|
327
|
+
*/
|
328
|
+
getValue() {
|
329
|
+
return this.multiple ? this.internalValue : this.internalValue.length === 0 ? null : this.internalValue[0];
|
330
|
+
},
|
331
|
+
/**
|
332
|
+
* Filters and then flattens the options list
|
333
|
+
* @param {Array}
|
334
|
+
* @return {Array} returns a filtered and flat options list
|
335
|
+
*/
|
336
|
+
filterAndFlat(e, t, i) {
|
337
|
+
return T(
|
338
|
+
G(t, i, this.groupValues, this.groupLabel, this.customLabel),
|
339
|
+
w(this.groupValues, this.groupLabel)
|
340
|
+
)(e);
|
341
|
+
},
|
342
|
+
/**
|
343
|
+
* Flattens and then strips the group labels from the options list
|
344
|
+
* @param {Array}
|
345
|
+
* @return {Array} returns a flat options list without group labels
|
346
|
+
*/
|
347
|
+
flatAndStrip(e) {
|
348
|
+
return T(
|
349
|
+
w(this.groupValues, this.groupLabel),
|
350
|
+
H
|
351
|
+
)(e);
|
352
|
+
},
|
353
|
+
/**
|
354
|
+
* Updates the search value
|
355
|
+
* @param {String}
|
356
|
+
*/
|
357
|
+
updateSearch(e) {
|
358
|
+
this.search = e;
|
359
|
+
},
|
360
|
+
/**
|
361
|
+
* Finds out if the given query is already present
|
362
|
+
* in the available options
|
363
|
+
* @param {String}
|
364
|
+
* @return {Boolean} returns true if element is available
|
365
|
+
*/
|
366
|
+
isExistingOption(e) {
|
367
|
+
return this.options ? this.optionKeys.indexOf(e) > -1 : !1;
|
368
|
+
},
|
369
|
+
/**
|
370
|
+
* Finds out if the given element is already present
|
371
|
+
* in the result value
|
372
|
+
* @param {Object||String||Integer} option passed element to check
|
373
|
+
* @returns {Boolean} returns true if element is selected
|
374
|
+
*/
|
375
|
+
isSelected(e) {
|
376
|
+
const t = this.trackBy ? e[this.trackBy] : e;
|
377
|
+
return this.valueKeys.indexOf(t) > -1;
|
378
|
+
},
|
379
|
+
/**
|
380
|
+
* Finds out if the given option is disabled
|
381
|
+
* @param {Object||String||Integer} option passed element to check
|
382
|
+
* @returns {Boolean} returns true if element is disabled
|
383
|
+
*/
|
384
|
+
isOptionDisabled(e) {
|
385
|
+
return !!e.$isDisabled;
|
386
|
+
},
|
387
|
+
/**
|
388
|
+
* Returns empty string when options is null/undefined
|
389
|
+
* Returns tag query if option is tag.
|
390
|
+
* Returns the customLabel() results and casts it to string.
|
391
|
+
*
|
392
|
+
* @param {Object||String||Integer} Passed option
|
393
|
+
* @returns {Object||String}
|
394
|
+
*/
|
395
|
+
getOptionLabel(e) {
|
396
|
+
if (O(e))
|
397
|
+
return "";
|
398
|
+
if (e.isTag)
|
399
|
+
return e.label;
|
400
|
+
if (e.$isLabel)
|
401
|
+
return e.$groupLabel;
|
402
|
+
const t = this.customLabel(e, this.label);
|
403
|
+
return O(t) ? "" : t;
|
404
|
+
},
|
405
|
+
/**
|
406
|
+
* Add the given option to the list of selected options
|
407
|
+
* or sets the option as the selected option.
|
408
|
+
* If option is already selected -> remove it from the results.
|
409
|
+
*
|
410
|
+
* @param {Object||String||Integer} option to select/deselect
|
411
|
+
* @param {Boolean} block removing
|
412
|
+
*/
|
413
|
+
select(e, t) {
|
414
|
+
if (e.$isLabel && this.groupSelect) {
|
415
|
+
this.selectGroup(e);
|
416
|
+
return;
|
417
|
+
}
|
418
|
+
if (!(this.blockKeys.indexOf(t) !== -1 || this.disabled || e.$isDisabled || e.$isLabel) && !(this.max && this.multiple && this.internalValue.length === this.max) && !(t === "Tab" && !this.pointerDirty)) {
|
419
|
+
if (e.isTag)
|
420
|
+
this.$emit("tag", e.label, this.id), this.search = "", this.closeOnSelect && !this.multiple && this.deactivate();
|
421
|
+
else {
|
422
|
+
if (this.isSelected(e)) {
|
423
|
+
t !== "Tab" && this.removeElement(e);
|
424
|
+
return;
|
425
|
+
}
|
426
|
+
this.multiple ? this.$emit("update:modelValue", this.internalValue.concat([e])) : this.$emit("update:modelValue", e), this.$emit("select", e, this.id), this.clearOnSelect && (this.search = "");
|
427
|
+
}
|
428
|
+
this.closeOnSelect && this.deactivate();
|
429
|
+
}
|
430
|
+
},
|
431
|
+
/**
|
432
|
+
* Add the given group options to the list of selected options
|
433
|
+
* If all group optiona are already selected -> remove it from the results.
|
434
|
+
*
|
435
|
+
* @param {Object||String||Integer} group to select/deselect
|
436
|
+
*/
|
437
|
+
selectGroup(e) {
|
438
|
+
const t = this.options.find((i) => i[this.groupLabel] === e.$groupLabel);
|
439
|
+
if (t) {
|
440
|
+
if (this.wholeGroupSelected(t)) {
|
441
|
+
this.$emit("remove", t[this.groupValues], this.id);
|
442
|
+
const i = this.internalValue.filter(
|
443
|
+
(l) => t[this.groupValues].indexOf(l) === -1
|
444
|
+
);
|
445
|
+
this.$emit("update:modelValue", i);
|
446
|
+
} else {
|
447
|
+
let i = t[this.groupValues].filter(
|
448
|
+
(l) => !(this.isOptionDisabled(l) || this.isSelected(l))
|
449
|
+
);
|
450
|
+
this.max && i.splice(this.max - this.internalValue.length), this.$emit("select", i, this.id), this.$emit(
|
451
|
+
"update:modelValue",
|
452
|
+
this.internalValue.concat(i)
|
453
|
+
);
|
454
|
+
}
|
455
|
+
this.closeOnSelect && this.deactivate();
|
456
|
+
}
|
457
|
+
},
|
458
|
+
/**
|
459
|
+
* Helper to identify if all values in a group are selected
|
460
|
+
*
|
461
|
+
* @param {Object} group to validated selected values against
|
462
|
+
*/
|
463
|
+
wholeGroupSelected(e) {
|
464
|
+
return e[this.groupValues].every(
|
465
|
+
(t) => this.isSelected(t) || this.isOptionDisabled(t)
|
466
|
+
);
|
467
|
+
},
|
468
|
+
/**
|
469
|
+
* Helper to identify if all values in a group are disabled
|
470
|
+
*
|
471
|
+
* @param {Object} group to check for disabled values
|
472
|
+
*/
|
473
|
+
wholeGroupDisabled(e) {
|
474
|
+
return e[this.groupValues].every(this.isOptionDisabled);
|
475
|
+
},
|
476
|
+
/**
|
477
|
+
* Removes the given option from the selected options.
|
478
|
+
* Additionally checks this.allowEmpty prop if option can be removed when
|
479
|
+
* it is the last selected option.
|
480
|
+
*
|
481
|
+
* @param {type} option description
|
482
|
+
* @return {type} description
|
483
|
+
*/
|
484
|
+
removeElement(e, t = !0) {
|
485
|
+
if (this.disabled || e.$isDisabled)
|
486
|
+
return;
|
487
|
+
if (!this.allowEmpty && this.internalValue.length <= 1) {
|
488
|
+
this.deactivate();
|
489
|
+
return;
|
490
|
+
}
|
491
|
+
const i = typeof e == "object" ? this.valueKeys.indexOf(e[this.trackBy]) : this.valueKeys.indexOf(e);
|
492
|
+
if (this.multiple) {
|
493
|
+
const l = this.internalValue.slice(0, i).concat(this.internalValue.slice(i + 1));
|
494
|
+
this.$emit("update:modelValue", l);
|
495
|
+
} else
|
496
|
+
this.$emit("update:modelValue", null);
|
497
|
+
this.$emit("remove", e, this.id), this.closeOnSelect && t && this.deactivate();
|
498
|
+
},
|
499
|
+
/**
|
500
|
+
* Calls this.removeElement() with the last element
|
501
|
+
* from this.internalValue (selected element Array)
|
502
|
+
*
|
503
|
+
* @fires this#removeElement
|
504
|
+
*/
|
505
|
+
removeLastElement() {
|
506
|
+
this.blockKeys.indexOf("Delete") === -1 && this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length && this.removeElement(this.internalValue[this.internalValue.length - 1], !1);
|
507
|
+
},
|
508
|
+
/**
|
509
|
+
* Opens the multiselect’s dropdown.
|
510
|
+
* Sets this.isOpen to TRUE
|
511
|
+
*/
|
512
|
+
activate() {
|
513
|
+
this.isOpen || this.disabled || (this.adjustPosition(), this.groupValues && this.pointer === 0 && this.filteredOptions.length && (this.pointer = 1), this.isOpen = !0, this.searchable ? (this.preserveSearch || (this.search = ""), this.preventAutofocus || this.$nextTick(() => this.$refs.search && this.$refs.search.focus())) : this.preventAutofocus || typeof this.$el < "u" && this.$el.focus(), this.$emit("open", this.id));
|
514
|
+
},
|
515
|
+
/**
|
516
|
+
* Closes the multiselect’s dropdown.
|
517
|
+
* Sets this.isOpen to FALSE
|
518
|
+
*/
|
519
|
+
deactivate() {
|
520
|
+
this.isOpen && (this.isOpen = !1, this.searchable ? typeof this.$refs.search < "u" && this.$refs.search.blur() : typeof this.$el < "u" && this.$el.blur(), this.preserveSearch || (this.search = ""), this.$emit("close", this.getValue(), this.id));
|
521
|
+
},
|
522
|
+
/**
|
523
|
+
* Call this.activate() or this.deactivate()
|
524
|
+
* depending on this.isOpen value.
|
525
|
+
*
|
526
|
+
* @fires this#activate || this#deactivate
|
527
|
+
* @property {Boolean} isOpen indicates if dropdown is open
|
528
|
+
*/
|
529
|
+
toggle() {
|
530
|
+
this.isOpen ? this.deactivate() : this.activate();
|
531
|
+
},
|
532
|
+
/**
|
533
|
+
* Updates the hasEnoughSpace variable used for
|
534
|
+
* detecting where to expand the dropdown
|
535
|
+
*/
|
536
|
+
adjustPosition() {
|
537
|
+
if (typeof window > "u")
|
538
|
+
return;
|
539
|
+
const e = this.$el.getBoundingClientRect().top, t = window.innerHeight - this.$el.getBoundingClientRect().bottom;
|
540
|
+
t > this.maxHeight || t > e || this.openDirection === "below" || this.openDirection === "bottom" ? (this.preferredOpenDirection = "below", this.optimizedHeight = Math.min(t - 40, this.maxHeight)) : (this.preferredOpenDirection = "above", this.optimizedHeight = Math.min(e - 40, this.maxHeight));
|
541
|
+
}
|
542
|
+
}
|
543
|
+
}, K = {
|
544
|
+
data() {
|
545
|
+
return {
|
546
|
+
pointer: 0,
|
547
|
+
pointerDirty: !1
|
548
|
+
};
|
549
|
+
},
|
550
|
+
props: {
|
551
|
+
/**
|
552
|
+
* Enable/disable highlighting of the pointed value.
|
553
|
+
* @type {Boolean}
|
554
|
+
* @default true
|
555
|
+
*/
|
556
|
+
showPointer: {
|
557
|
+
type: Boolean,
|
558
|
+
default: !0
|
559
|
+
},
|
560
|
+
optionHeight: {
|
561
|
+
type: Number,
|
562
|
+
default: 40
|
563
|
+
}
|
564
|
+
},
|
565
|
+
computed: {
|
566
|
+
pointerPosition() {
|
567
|
+
return this.pointer * this.optionHeight;
|
568
|
+
},
|
569
|
+
visibleElements() {
|
570
|
+
return this.optimizedHeight / this.optionHeight;
|
571
|
+
}
|
572
|
+
},
|
573
|
+
watch: {
|
574
|
+
filteredOptions() {
|
575
|
+
this.pointerAdjust();
|
576
|
+
},
|
577
|
+
isOpen() {
|
578
|
+
this.pointerDirty = !1;
|
579
|
+
},
|
580
|
+
pointer() {
|
581
|
+
this.$refs.search && this.$refs.search.setAttribute("aria-activedescendant", this.id + "-" + this.pointer.toString());
|
582
|
+
}
|
583
|
+
},
|
584
|
+
methods: {
|
585
|
+
optionHighlight(e, t) {
|
586
|
+
return {
|
587
|
+
"multiselect__option--highlight": e === this.pointer && this.showPointer,
|
588
|
+
"multiselect__option--selected": this.isSelected(t)
|
589
|
+
};
|
590
|
+
},
|
591
|
+
groupHighlight(e, t) {
|
592
|
+
if (!this.groupSelect)
|
593
|
+
return [
|
594
|
+
"multiselect__option--disabled",
|
595
|
+
{ "multiselect__option--group": t.$isLabel }
|
596
|
+
];
|
597
|
+
const i = this.options.find((l) => l[this.groupLabel] === t.$groupLabel);
|
598
|
+
return i && !this.wholeGroupDisabled(i) ? [
|
599
|
+
"multiselect__option--group",
|
600
|
+
{ "multiselect__option--highlight": e === this.pointer && this.showPointer },
|
601
|
+
{ "multiselect__option--group-selected": this.wholeGroupSelected(i) }
|
602
|
+
] : "multiselect__option--disabled";
|
603
|
+
},
|
604
|
+
addPointerElement({ key: e } = "Enter") {
|
605
|
+
this.filteredOptions.length > 0 && this.select(this.filteredOptions[this.pointer], e), this.pointerReset();
|
606
|
+
},
|
607
|
+
pointerForward() {
|
608
|
+
this.pointer < this.filteredOptions.length - 1 && (this.pointer++, this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight && (this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward()), this.pointerDirty = !0;
|
609
|
+
},
|
610
|
+
pointerBackward() {
|
611
|
+
this.pointer > 0 ? (this.pointer--, this.$refs.list.scrollTop >= this.pointerPosition && (this.$refs.list.scrollTop = this.pointerPosition), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerBackward()) : this.filteredOptions[this.pointer] && this.filteredOptions[0].$isLabel && !this.groupSelect && this.pointerForward(), this.pointerDirty = !0;
|
612
|
+
},
|
613
|
+
pointerReset() {
|
614
|
+
this.closeOnSelect && (this.pointer = 0, this.$refs.list && (this.$refs.list.scrollTop = 0));
|
615
|
+
},
|
616
|
+
pointerAdjust() {
|
617
|
+
this.pointer >= this.filteredOptions.length - 1 && (this.pointer = this.filteredOptions.length ? this.filteredOptions.length - 1 : 0), this.filteredOptions.length > 0 && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward();
|
618
|
+
},
|
619
|
+
pointerSet(e) {
|
620
|
+
this.pointer = e, this.pointerDirty = !0;
|
621
|
+
}
|
622
|
+
}
|
623
|
+
};
|
624
|
+
const F = {
|
625
|
+
name: "vue-multiselect",
|
626
|
+
mixins: [C, K],
|
627
|
+
compatConfig: {
|
628
|
+
MODE: 3,
|
629
|
+
ATTR_ENUMERATED_COERCION: !1
|
630
|
+
},
|
631
|
+
props: {
|
632
|
+
/**
|
633
|
+
* name attribute to match optional label element
|
634
|
+
* @default ''
|
635
|
+
* @type {String}
|
636
|
+
*/
|
637
|
+
name: {
|
638
|
+
type: String,
|
639
|
+
default: ""
|
640
|
+
},
|
641
|
+
/**
|
642
|
+
* Presets the selected options value.
|
643
|
+
* @type {Object||Array||String||Integer}
|
644
|
+
*/
|
645
|
+
modelValue: {
|
646
|
+
type: null,
|
647
|
+
default() {
|
648
|
+
return [];
|
649
|
+
}
|
650
|
+
},
|
651
|
+
/**
|
652
|
+
* String to show when pointing to an option
|
653
|
+
* @default 'Press enter to select'
|
654
|
+
* @type {String}
|
655
|
+
*/
|
656
|
+
selectLabel: {
|
657
|
+
type: String,
|
658
|
+
default: "Press enter to select"
|
659
|
+
},
|
660
|
+
/**
|
661
|
+
* String to show when pointing to an option
|
662
|
+
* @default 'Press enter to select'
|
663
|
+
* @type {String}
|
664
|
+
*/
|
665
|
+
selectGroupLabel: {
|
666
|
+
type: String,
|
667
|
+
default: "Press enter to select group"
|
668
|
+
},
|
669
|
+
/**
|
670
|
+
* String to show next to selected option
|
671
|
+
* @default 'Selected'
|
672
|
+
* @type {String}
|
673
|
+
*/
|
674
|
+
selectedLabel: {
|
675
|
+
type: String,
|
676
|
+
default: "Selected"
|
677
|
+
},
|
678
|
+
/**
|
679
|
+
* String to show when pointing to an already selected option
|
680
|
+
* @default 'Press enter to remove'
|
681
|
+
* @type {String}
|
682
|
+
*/
|
683
|
+
deselectLabel: {
|
684
|
+
type: String,
|
685
|
+
default: "Press enter to remove"
|
686
|
+
},
|
687
|
+
/**
|
688
|
+
* String to show when pointing to an already selected option
|
689
|
+
* @default 'Press enter to remove'
|
690
|
+
* @type {String}
|
691
|
+
*/
|
692
|
+
deselectGroupLabel: {
|
693
|
+
type: String,
|
694
|
+
default: "Press enter to deselect group"
|
695
|
+
},
|
696
|
+
/**
|
697
|
+
* Decide whether to show pointer labels
|
698
|
+
* @default true
|
699
|
+
* @type {Boolean}
|
700
|
+
*/
|
701
|
+
showLabels: {
|
702
|
+
type: Boolean,
|
703
|
+
default: !0
|
704
|
+
},
|
705
|
+
/**
|
706
|
+
* Limit the display of selected options. The rest will be hidden within the limitText string.
|
707
|
+
* @default 99999
|
708
|
+
* @type {Integer}
|
709
|
+
*/
|
710
|
+
limit: {
|
711
|
+
type: Number,
|
712
|
+
default: 99999
|
713
|
+
},
|
714
|
+
/**
|
715
|
+
* Sets maxHeight style value of the dropdown
|
716
|
+
* @default 300
|
717
|
+
* @type {Integer}
|
718
|
+
*/
|
719
|
+
maxHeight: {
|
720
|
+
type: Number,
|
721
|
+
default: 300
|
722
|
+
},
|
723
|
+
/**
|
724
|
+
* Function that process the message shown when selected
|
725
|
+
* elements pass the defined limit.
|
726
|
+
* @default 'and * more'
|
727
|
+
* @param {Int} count Number of elements more than limit
|
728
|
+
* @type {Function}
|
729
|
+
*/
|
730
|
+
limitText: {
|
731
|
+
type: Function,
|
732
|
+
default: (e) => `and ${e} more`
|
733
|
+
},
|
734
|
+
/**
|
735
|
+
* Set true to trigger the loading spinner.
|
736
|
+
* @default False
|
737
|
+
* @type {Boolean}
|
738
|
+
*/
|
739
|
+
loading: {
|
740
|
+
type: Boolean,
|
741
|
+
default: !1
|
742
|
+
},
|
743
|
+
/**
|
744
|
+
* Disables the multiselect if true.
|
745
|
+
* @default false
|
746
|
+
* @type {Boolean}
|
747
|
+
*/
|
748
|
+
disabled: {
|
749
|
+
type: Boolean,
|
750
|
+
default: !1
|
751
|
+
},
|
752
|
+
/**
|
753
|
+
* Fixed opening direction
|
754
|
+
* @default ''
|
755
|
+
* @type {String}
|
756
|
+
*/
|
757
|
+
openDirection: {
|
758
|
+
type: String,
|
759
|
+
default: ""
|
760
|
+
},
|
761
|
+
/**
|
762
|
+
* Shows slot with message about empty options
|
763
|
+
* @default true
|
764
|
+
* @type {Boolean}
|
765
|
+
*/
|
766
|
+
showNoOptions: {
|
767
|
+
type: Boolean,
|
768
|
+
default: !0
|
769
|
+
},
|
770
|
+
showNoResults: {
|
771
|
+
type: Boolean,
|
772
|
+
default: !0
|
773
|
+
},
|
774
|
+
tabindex: {
|
775
|
+
type: Number,
|
776
|
+
default: 0
|
777
|
+
}
|
778
|
+
},
|
779
|
+
computed: {
|
780
|
+
hasOptionGroup() {
|
781
|
+
return this.groupValues && this.groupLabel && this.groupSelect;
|
782
|
+
},
|
783
|
+
isSingleLabelVisible() {
|
784
|
+
return (this.singleValue || this.singleValue === 0) && (!this.isOpen || !this.searchable) && !this.visibleValues.length;
|
785
|
+
},
|
786
|
+
isPlaceholderVisible() {
|
787
|
+
return !this.internalValue.length && (!this.searchable || !this.isOpen);
|
788
|
+
},
|
789
|
+
visibleValues() {
|
790
|
+
return this.multiple ? this.internalValue.slice(0, this.limit) : [];
|
791
|
+
},
|
792
|
+
singleValue() {
|
793
|
+
return this.internalValue[0];
|
794
|
+
},
|
795
|
+
deselectLabelText() {
|
796
|
+
return this.showLabels ? this.deselectLabel : "";
|
797
|
+
},
|
798
|
+
deselectGroupLabelText() {
|
799
|
+
return this.showLabels ? this.deselectGroupLabel : "";
|
800
|
+
},
|
801
|
+
selectLabelText() {
|
802
|
+
return this.showLabels ? this.selectLabel : "";
|
803
|
+
},
|
804
|
+
selectGroupLabelText() {
|
805
|
+
return this.showLabels ? this.selectGroupLabel : "";
|
806
|
+
},
|
807
|
+
selectedLabelText() {
|
808
|
+
return this.showLabels ? this.selectedLabel : "";
|
809
|
+
},
|
810
|
+
inputStyle() {
|
811
|
+
return this.searchable || this.multiple && this.modelValue && this.modelValue.length ? this.isOpen ? { width: "100%" } : { width: "0", position: "absolute", padding: "0" } : "";
|
812
|
+
},
|
813
|
+
contentStyle() {
|
814
|
+
return this.options.length ? { display: "inline-block" } : { display: "block" };
|
815
|
+
},
|
816
|
+
isAbove() {
|
817
|
+
return this.openDirection === "above" || this.openDirection === "top" ? !0 : this.openDirection === "below" || this.openDirection === "bottom" ? !1 : this.preferredOpenDirection === "above";
|
818
|
+
},
|
819
|
+
showSearchInput() {
|
820
|
+
return this.searchable && (this.hasSingleSelectedSlot && (this.visibleSingleValue || this.visibleSingleValue === 0) ? this.isOpen : !0);
|
821
|
+
}
|
822
|
+
}
|
823
|
+
}, N = ["tabindex", "aria-owns"], R = {
|
824
|
+
ref: "tags",
|
825
|
+
class: "multiselect__tags"
|
826
|
+
}, z = { class: "multiselect__tags-wrap" }, j = ["textContent"], q = ["onKeypress", "onMousedown"], I = ["textContent"], U = { class: "multiselect__spinner" }, J = ["name", "id", "placeholder", "value", "disabled", "tabindex", "aria-controls"], Q = ["id"], W = { key: 0 }, X = { class: "multiselect__option" }, Y = ["id", "role"], Z = ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"], x = ["data-select", "data-deselect", "onMouseenter", "onMousedown"], _ = { class: "multiselect__option" }, ee = { class: "multiselect__option" };
|
827
|
+
function te(e, t, i, l, u, n) {
|
828
|
+
return d(), p("div", {
|
829
|
+
tabindex: e.searchable ? -1 : i.tabindex,
|
830
|
+
class: V([{ "multiselect--active": e.isOpen, "multiselect--disabled": i.disabled, "multiselect--above": n.isAbove, "multiselect--has-options-group": n.hasOptionGroup }, "multiselect"]),
|
831
|
+
onFocus: t[13] || (t[13] = (s) => e.activate()),
|
832
|
+
onBlur: t[14] || (t[14] = (s) => e.searchable ? !1 : e.deactivate()),
|
833
|
+
onKeydown: [
|
834
|
+
t[15] || (t[15] = f(r((s) => e.pointerForward(), ["self", "prevent"]), ["down"])),
|
835
|
+
t[16] || (t[16] = f(r((s) => e.pointerBackward(), ["self", "prevent"]), ["up"]))
|
836
|
+
],
|
837
|
+
onKeypress: t[17] || (t[17] = f(r((s) => e.addPointerElement(s), ["stop", "self"]), ["enter", "tab"])),
|
838
|
+
onKeyup: t[18] || (t[18] = f((s) => e.deactivate(), ["esc"])),
|
839
|
+
role: "combobox",
|
840
|
+
"aria-owns": "listbox-" + e.id
|
841
|
+
}, [
|
842
|
+
o(e.$slots, "caret", { toggle: e.toggle }, () => [
|
843
|
+
a("div", {
|
844
|
+
onMousedown: t[0] || (t[0] = r((s) => e.toggle(), ["prevent", "stop"])),
|
845
|
+
class: "multiselect__select"
|
846
|
+
}, null, 32)
|
847
|
+
]),
|
848
|
+
o(e.$slots, "clear", { search: e.search }),
|
849
|
+
a("div", R, [
|
850
|
+
o(e.$slots, "selection", {
|
851
|
+
search: e.search,
|
852
|
+
remove: e.removeElement,
|
853
|
+
values: n.visibleValues,
|
854
|
+
isOpen: e.isOpen
|
855
|
+
}, () => [
|
856
|
+
b(a("div", z, [
|
857
|
+
(d(!0), p(L, null, $(n.visibleValues, (s, h) => o(e.$slots, "tag", {
|
858
|
+
option: s,
|
859
|
+
search: e.search,
|
860
|
+
remove: e.removeElement
|
861
|
+
}, () => [
|
862
|
+
(d(), p("span", {
|
863
|
+
class: "multiselect__tag",
|
864
|
+
key: h
|
865
|
+
}, [
|
866
|
+
a("span", {
|
867
|
+
textContent: g(e.getOptionLabel(s))
|
868
|
+
}, null, 8, j),
|
869
|
+
a("i", {
|
870
|
+
tabindex: "1",
|
871
|
+
onKeypress: f(r((m) => e.removeElement(s), ["prevent"]), ["enter"]),
|
872
|
+
onMousedown: r((m) => e.removeElement(s), ["prevent"]),
|
873
|
+
class: "multiselect__tag-icon"
|
874
|
+
}, null, 40, q)
|
875
|
+
]))
|
876
|
+
])), 256))
|
877
|
+
], 512), [
|
878
|
+
[y, n.visibleValues.length > 0]
|
879
|
+
]),
|
880
|
+
e.internalValue && e.internalValue.length > i.limit ? o(e.$slots, "limit", { key: 0 }, () => [
|
881
|
+
a("strong", {
|
882
|
+
class: "multiselect__strong",
|
883
|
+
textContent: g(i.limitText(e.internalValue.length - i.limit))
|
884
|
+
}, null, 8, I)
|
885
|
+
]) : c("", !0)
|
886
|
+
]),
|
887
|
+
B(D, { name: "multiselect__loading" }, {
|
888
|
+
default: E(() => [
|
889
|
+
o(e.$slots, "loading", {}, () => [
|
890
|
+
b(a("div", U, null, 512), [
|
891
|
+
[y, i.loading]
|
892
|
+
])
|
893
|
+
])
|
894
|
+
]),
|
895
|
+
_: 3
|
896
|
+
}),
|
897
|
+
e.searchable ? (d(), p("input", {
|
898
|
+
key: 0,
|
899
|
+
ref: "search",
|
900
|
+
name: i.name,
|
901
|
+
id: e.id,
|
902
|
+
type: "text",
|
903
|
+
autocomplete: "off",
|
904
|
+
spellcheck: "false",
|
905
|
+
placeholder: e.placeholder,
|
906
|
+
style: S(n.inputStyle),
|
907
|
+
value: e.search,
|
908
|
+
disabled: i.disabled,
|
909
|
+
tabindex: i.tabindex,
|
910
|
+
onInput: t[1] || (t[1] = (s) => e.updateSearch(s.target.value)),
|
911
|
+
onFocus: t[2] || (t[2] = r((s) => e.activate(), ["prevent"])),
|
912
|
+
onBlur: t[3] || (t[3] = r((s) => e.deactivate(), ["prevent"])),
|
913
|
+
onKeyup: t[4] || (t[4] = f((s) => e.deactivate(), ["esc"])),
|
914
|
+
onKeydown: [
|
915
|
+
t[5] || (t[5] = f(r((s) => e.pointerForward(), ["prevent"]), ["down"])),
|
916
|
+
t[6] || (t[6] = f(r((s) => e.pointerBackward(), ["prevent"]), ["up"])),
|
917
|
+
t[8] || (t[8] = f(r((s) => e.removeLastElement(), ["stop"]), ["delete"]))
|
918
|
+
],
|
919
|
+
onKeypress: t[7] || (t[7] = f(r((s) => e.addPointerElement(s), ["prevent", "stop", "self"]), ["enter"])),
|
920
|
+
class: "multiselect__input",
|
921
|
+
"aria-controls": "listbox-" + e.id
|
922
|
+
}, null, 44, J)) : c("", !0),
|
923
|
+
n.isSingleLabelVisible ? (d(), p("span", {
|
924
|
+
key: 1,
|
925
|
+
class: "multiselect__single",
|
926
|
+
onMousedown: t[9] || (t[9] = r((...s) => e.toggle && e.toggle(...s), ["prevent"]))
|
927
|
+
}, [
|
928
|
+
o(e.$slots, "singleLabel", { option: n.singleValue }, () => [
|
929
|
+
v(g(e.currentOptionLabel), 1)
|
930
|
+
])
|
931
|
+
], 32)) : c("", !0),
|
932
|
+
n.isPlaceholderVisible ? (d(), p("span", {
|
933
|
+
key: 2,
|
934
|
+
class: "multiselect__placeholder",
|
935
|
+
onMousedown: t[10] || (t[10] = r((...s) => e.toggle && e.toggle(...s), ["prevent"]))
|
936
|
+
}, [
|
937
|
+
o(e.$slots, "placeholder", {}, () => [
|
938
|
+
v(g(e.placeholder), 1)
|
939
|
+
])
|
940
|
+
], 32)) : c("", !0)
|
941
|
+
], 512),
|
942
|
+
B(D, { name: "multiselect" }, {
|
943
|
+
default: E(() => [
|
944
|
+
b(a("div", {
|
945
|
+
class: V(["multiselect__content-wrapper", e.$attrs.class]),
|
946
|
+
onFocus: t[11] || (t[11] = (...s) => e.activate && e.activate(...s)),
|
947
|
+
tabindex: "-1",
|
948
|
+
onMousedown: t[12] || (t[12] = r(() => {
|
949
|
+
}, ["prevent"])),
|
950
|
+
style: S({ maxHeight: e.optimizedHeight + "px" }),
|
951
|
+
ref: "list"
|
952
|
+
}, [
|
953
|
+
a("ul", {
|
954
|
+
class: "multiselect__content",
|
955
|
+
style: S(n.contentStyle),
|
956
|
+
role: "listbox",
|
957
|
+
id: "listbox-" + e.id
|
958
|
+
}, [
|
959
|
+
o(e.$slots, "beforeList"),
|
960
|
+
e.multiple && e.max === e.internalValue.length ? (d(), p("li", W, [
|
961
|
+
a("span", X, [
|
962
|
+
o(e.$slots, "maxElements", {}, () => [
|
963
|
+
v("Maximum of " + g(e.max) + " options selected. First remove a selected option to select another.", 1)
|
964
|
+
])
|
965
|
+
])
|
966
|
+
])) : c("", !0),
|
967
|
+
!e.max || e.internalValue.length < e.max ? (d(!0), p(L, { key: 1 }, $(e.filteredOptions, (s, h) => (d(), p("li", {
|
968
|
+
class: "multiselect__element",
|
969
|
+
key: h,
|
970
|
+
id: e.id + "-" + h,
|
971
|
+
role: s && (s.$isLabel || s.$isDisabled) ? null : "option"
|
972
|
+
}, [
|
973
|
+
s && (s.$isLabel || s.$isDisabled) ? c("", !0) : (d(), p("span", {
|
974
|
+
key: 0,
|
975
|
+
class: V([e.optionHighlight(h, s), "multiselect__option"]),
|
976
|
+
onClick: r((m) => e.select(s), ["stop"]),
|
977
|
+
onMouseenter: r((m) => e.pointerSet(h), ["self"]),
|
978
|
+
"data-select": s && s.isTag ? e.tagPlaceholder : n.selectLabelText,
|
979
|
+
"data-selected": n.selectedLabelText,
|
980
|
+
"data-deselect": n.deselectLabelText
|
981
|
+
}, [
|
982
|
+
o(e.$slots, "option", {
|
983
|
+
option: s,
|
984
|
+
search: e.search,
|
985
|
+
index: h
|
986
|
+
}, () => [
|
987
|
+
a("span", null, g(e.getOptionLabel(s)), 1)
|
988
|
+
])
|
989
|
+
], 42, Z)),
|
990
|
+
s && (s.$isLabel || s.$isDisabled) ? (d(), p("span", {
|
991
|
+
key: 1,
|
992
|
+
"data-select": e.groupSelect && n.selectGroupLabelText,
|
993
|
+
"data-deselect": e.groupSelect && n.deselectGroupLabelText,
|
994
|
+
class: V([e.groupHighlight(h, s), "multiselect__option"]),
|
995
|
+
onMouseenter: r((m) => e.groupSelect && e.pointerSet(h), ["self"]),
|
996
|
+
onMousedown: r((m) => e.selectGroup(s), ["prevent"])
|
997
|
+
}, [
|
998
|
+
o(e.$slots, "option", {
|
999
|
+
option: s,
|
1000
|
+
search: e.search,
|
1001
|
+
index: h
|
1002
|
+
}, () => [
|
1003
|
+
a("span", null, g(e.getOptionLabel(s)), 1)
|
1004
|
+
])
|
1005
|
+
], 42, x)) : c("", !0)
|
1006
|
+
], 8, Y))), 128)) : c("", !0),
|
1007
|
+
b(a("li", null, [
|
1008
|
+
a("span", _, [
|
1009
|
+
o(e.$slots, "noResult", { search: e.search }, () => [
|
1010
|
+
v("No elements found. Consider changing the search query.")
|
1011
|
+
])
|
1012
|
+
])
|
1013
|
+
], 512), [
|
1014
|
+
[y, i.showNoResults && e.filteredOptions.length === 0 && e.search && !i.loading]
|
1015
|
+
]),
|
1016
|
+
b(a("li", null, [
|
1017
|
+
a("span", ee, [
|
1018
|
+
o(e.$slots, "noOptions", {}, () => [
|
1019
|
+
v("List is empty.")
|
1020
|
+
])
|
1021
|
+
])
|
1022
|
+
], 512), [
|
1023
|
+
[y, i.showNoOptions && (e.options.length === 0 || n.hasOptionGroup === !0 && e.filteredOptions.length === 0) && !e.search && !i.loading]
|
1024
|
+
]),
|
1025
|
+
o(e.$slots, "afterList")
|
1026
|
+
], 12, Q)
|
1027
|
+
], 38), [
|
1028
|
+
[y, e.isOpen]
|
1029
|
+
])
|
1030
|
+
]),
|
1031
|
+
_: 3
|
1032
|
+
})
|
1033
|
+
], 42, N);
|
1034
|
+
}
|
1035
|
+
const le = /* @__PURE__ */ A(F, [["render", te]]);
|
1036
|
+
export {
|
1037
|
+
le as S
|
1038
|
+
};
|