@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,853 @@
|
|
1
|
+
import { withDirectives as S, openBlock as n, createElementBlock as l, vModelText as j, createCommentVNode as f, resolveComponent as N, normalizeClass as y, normalizeStyle as $, createElementVNode as m, Fragment as O, renderList as I, renderSlot as h, toDisplayString as D, createBlock as P, vShow as A, mergeProps as K, withKeys as k, ref as w, computed as b, createVNode as q, unref as E } from "vue";
|
2
|
+
import { g as L } from "./index-a661083c.mjs";
|
3
|
+
import { _ as M } from "./_plugin-vue_export-helper-dad06003.mjs";
|
4
|
+
var z = function e(t, s) {
|
5
|
+
if (t === s)
|
6
|
+
return !0;
|
7
|
+
if (t && s && typeof t == "object" && typeof s == "object") {
|
8
|
+
if (t.constructor !== s.constructor)
|
9
|
+
return !1;
|
10
|
+
var i, o, d;
|
11
|
+
if (Array.isArray(t)) {
|
12
|
+
if (i = t.length, i != s.length)
|
13
|
+
return !1;
|
14
|
+
for (o = i; o-- !== 0; )
|
15
|
+
if (!e(t[o], s[o]))
|
16
|
+
return !1;
|
17
|
+
return !0;
|
18
|
+
}
|
19
|
+
if (t.constructor === RegExp)
|
20
|
+
return t.source === s.source && t.flags === s.flags;
|
21
|
+
if (t.valueOf !== Object.prototype.valueOf)
|
22
|
+
return t.valueOf() === s.valueOf();
|
23
|
+
if (t.toString !== Object.prototype.toString)
|
24
|
+
return t.toString() === s.toString();
|
25
|
+
if (d = Object.keys(t), i = d.length, i !== Object.keys(s).length)
|
26
|
+
return !1;
|
27
|
+
for (o = i; o-- !== 0; )
|
28
|
+
if (!Object.prototype.hasOwnProperty.call(s, d[o]))
|
29
|
+
return !1;
|
30
|
+
for (o = i; o-- !== 0; ) {
|
31
|
+
var u = d[o];
|
32
|
+
if (!e(t[u], s[u]))
|
33
|
+
return !1;
|
34
|
+
}
|
35
|
+
return !0;
|
36
|
+
}
|
37
|
+
return t !== t && s !== s;
|
38
|
+
};
|
39
|
+
const U = /* @__PURE__ */ L(z), J = (e, t) => t.filter((s) => {
|
40
|
+
const { text: i } = e;
|
41
|
+
if (typeof s.rule == "string")
|
42
|
+
return !new RegExp(s.rule).test(i);
|
43
|
+
if (s.rule instanceof RegExp)
|
44
|
+
return !s.rule.test(i);
|
45
|
+
if ({}.toString.call(s.rule) === "[object Function]")
|
46
|
+
return s.rule(e);
|
47
|
+
}).map((s) => s.classes), T = (e) => JSON.parse(JSON.stringify(e)), W = (e, t) => {
|
48
|
+
let s = 0;
|
49
|
+
for (; s < e.length; ) {
|
50
|
+
if (t(e[s], s, e))
|
51
|
+
return s;
|
52
|
+
s++;
|
53
|
+
}
|
54
|
+
return -1;
|
55
|
+
}, V = (e, t, s = [], i) => {
|
56
|
+
e.text === void 0 && (e = { text: e });
|
57
|
+
const o = J(e, s), d = W(t, (g) => g === e), u = T(t), a = d !== -1 ? u.splice(d, 1)[0] : T(e);
|
58
|
+
return (i ? i(u, a) : u.map((g) => g.text).indexOf(a.text) !== -1) && o.push("ti-duplicate"), o.length === 0 ? o.push("ti-valid") : o.push("ti-invalid"), o;
|
59
|
+
}, v = (e, ...t) => {
|
60
|
+
e.text === void 0 && (e = { text: e });
|
61
|
+
const s = T(e);
|
62
|
+
return s.tiClasses = V(e, ...t), s;
|
63
|
+
}, Y = (e, ...t) => e.map((s) => v(s, e, ...t));
|
64
|
+
const G = {
|
65
|
+
name: "TagInput",
|
66
|
+
props: {
|
67
|
+
scope: {
|
68
|
+
type: Object
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}, H = ["maxlength"];
|
72
|
+
function Q(e, t, s, i, o, d) {
|
73
|
+
return s.scope.edit ? S((n(), l("input", {
|
74
|
+
key: 0,
|
75
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => s.scope.tag.text = u),
|
76
|
+
maxlength: s.scope.maxlength,
|
77
|
+
type: "text",
|
78
|
+
class: "ti-tag-input",
|
79
|
+
size: "1",
|
80
|
+
onInput: t[1] || (t[1] = (u) => s.scope.validateTag(s.scope.index, u)),
|
81
|
+
onBlur: t[2] || (t[2] = (u) => s.scope.performCancelEdit(s.scope.index)),
|
82
|
+
onKeydown: t[3] || (t[3] = (u) => s.scope.performSaveEdit(s.scope.index, u))
|
83
|
+
}, null, 40, H)), [
|
84
|
+
[j, s.scope.tag.text]
|
85
|
+
]) : f("", !0);
|
86
|
+
}
|
87
|
+
const X = /* @__PURE__ */ M(G, [["render", Q], ["__scopeId", "data-v-a1f1c345"]]), F = (e) => !e.some((t) => {
|
88
|
+
const s = !t.text;
|
89
|
+
s && console.warn('Missing property "text"', t);
|
90
|
+
let i = !1;
|
91
|
+
return t.classes && (i = typeof t.classes != "string"), i && console.warn('Property "classes" must be type of string', t), s || i;
|
92
|
+
}), B = (e) => !e.some((t) => {
|
93
|
+
if (typeof t == "number") {
|
94
|
+
const s = isFinite(t) && Math.floor(t) === t;
|
95
|
+
return s || console.warn("Only numerics are allowed for this prop. Found:", t), !s;
|
96
|
+
} else if (typeof t == "string") {
|
97
|
+
const s = /\W|[a-z]|!\d/i.test(t);
|
98
|
+
return s || console.warn("Only alpha strings are allowed for this prop. Found:", t), !s;
|
99
|
+
} else
|
100
|
+
return console.warn("Only numeric and string values are allowed. Found:", t), !1;
|
101
|
+
}), Z = {
|
102
|
+
/**
|
103
|
+
* @description Property to bind a model to the input.
|
104
|
+
If the user changes the input value, the model updates, too.
|
105
|
+
If the user presses enter with an valid input,
|
106
|
+
a new tag is created with the value of this model.
|
107
|
+
After creating the new tag, the model is cleared.
|
108
|
+
* @property {props}
|
109
|
+
* @required
|
110
|
+
* @type {String}
|
111
|
+
* @model
|
112
|
+
* @default ''
|
113
|
+
*/
|
114
|
+
modelValue: {
|
115
|
+
type: String,
|
116
|
+
default: "",
|
117
|
+
required: !0
|
118
|
+
},
|
119
|
+
/**
|
120
|
+
* @description Pass an array containing objects like in the example below.
|
121
|
+
The properties 'style' and 'class' are optional. Of course it is possible to add custom
|
122
|
+
properties to a tag object. vue-tags-input won't change the key and value.
|
123
|
+
* @property {props}
|
124
|
+
* @type {Array}
|
125
|
+
* @sync
|
126
|
+
* @default []
|
127
|
+
* @example
|
128
|
+
{
|
129
|
+
 text: 'My tag value', /* The visible text on display */
|
130
|
+
 style: 'background-color: #ccc', /* Adding inline styles is possible */
|
131
|
+
 classes: 'custom-class another', /* The value will be added as css classes */
|
132
|
+
}
|
133
|
+
*/
|
134
|
+
tags: {
|
135
|
+
type: Array,
|
136
|
+
default: () => [],
|
137
|
+
validator: F
|
138
|
+
},
|
139
|
+
/**
|
140
|
+
* @description Expects an array containing objects inside. The objects
|
141
|
+
can have the same properties as a tag object.
|
142
|
+
* @property {props}
|
143
|
+
* @type {Array}
|
144
|
+
* @default []
|
145
|
+
*/
|
146
|
+
autocompleteItems: {
|
147
|
+
type: Array,
|
148
|
+
default: () => [],
|
149
|
+
validator: F
|
150
|
+
},
|
151
|
+
/**
|
152
|
+
* @description Defines whether a tag is editable after creation or not.
|
153
|
+
* @property {props}
|
154
|
+
* @type {Boolean}
|
155
|
+
* @default false
|
156
|
+
*/
|
157
|
+
allowEditTags: {
|
158
|
+
type: Boolean,
|
159
|
+
default: !1
|
160
|
+
},
|
161
|
+
/**
|
162
|
+
* @description Defines if duplicate autocomplete items are filtered out from the view or not.
|
163
|
+
* @property {props}
|
164
|
+
* @type {Boolean}
|
165
|
+
* @default true
|
166
|
+
*/
|
167
|
+
autocompleteFilterDuplicates: {
|
168
|
+
default: !0,
|
169
|
+
type: Boolean
|
170
|
+
},
|
171
|
+
/**
|
172
|
+
* @description If it's true, the user can add tags only via the autocomplete layer.
|
173
|
+
* @property {props}
|
174
|
+
* @type {Boolean}
|
175
|
+
* @default false
|
176
|
+
*/
|
177
|
+
addOnlyFromAutocomplete: {
|
178
|
+
type: Boolean,
|
179
|
+
default: !1
|
180
|
+
},
|
181
|
+
/**
|
182
|
+
* @description The minimum character length which is required
|
183
|
+
until the autocomplete layer is shown. If set to 0,
|
184
|
+
then it'll be shown on focus.
|
185
|
+
* @property {props}
|
186
|
+
* @type {Number}
|
187
|
+
* @default 1
|
188
|
+
*/
|
189
|
+
autocompleteMinLength: {
|
190
|
+
type: Number,
|
191
|
+
default: 1
|
192
|
+
},
|
193
|
+
/**
|
194
|
+
* @description If it's true, the autocomplete layer is always shown, regardless if
|
195
|
+
an input or an autocomplete items exists.
|
196
|
+
* @property {props}
|
197
|
+
* @type {Boolean}
|
198
|
+
* @default false
|
199
|
+
*/
|
200
|
+
autocompleteAlwaysOpen: {
|
201
|
+
type: Boolean,
|
202
|
+
default: !1
|
203
|
+
},
|
204
|
+
/**
|
205
|
+
* @description Property to disable vue-tags-input.
|
206
|
+
* @property {props}
|
207
|
+
* @type {Boolean}
|
208
|
+
* @default false
|
209
|
+
*/
|
210
|
+
disabled: {
|
211
|
+
type: Boolean,
|
212
|
+
default: !1
|
213
|
+
},
|
214
|
+
/**
|
215
|
+
* @description The placeholder text which is shown in the input, when it's empty.
|
216
|
+
* @property {props}
|
217
|
+
* @type {String}
|
218
|
+
* @default Add Tag
|
219
|
+
*/
|
220
|
+
placeholder: {
|
221
|
+
type: String,
|
222
|
+
default: "Add Tag"
|
223
|
+
},
|
224
|
+
/**
|
225
|
+
* @description Custom trigger key codes can be registrated. If the user presses one of these,
|
226
|
+
a tag will be generated out of the input value. Can be either a numeric keyCode or the key
|
227
|
+
as a string.
|
228
|
+
* @property {props}
|
229
|
+
* @type {Array}
|
230
|
+
* @default [13]
|
231
|
+
* @example add-on-key="[13, ':', ';']"
|
232
|
+
*/
|
233
|
+
addOnKey: {
|
234
|
+
type: Array,
|
235
|
+
default: () => [13],
|
236
|
+
validator: B
|
237
|
+
},
|
238
|
+
/**
|
239
|
+
* @description Custom trigger key codes can be registrated. If the user edits a tag
|
240
|
+
and presses one of these, the edited tag will be saved.
|
241
|
+
Can be either a numeric keyCode or the key as a string.
|
242
|
+
* @property {props}
|
243
|
+
* @type {Array}
|
244
|
+
* @default [13]
|
245
|
+
* @example save-on-key="[13, ':', ';']"
|
246
|
+
*/
|
247
|
+
saveOnKey: {
|
248
|
+
type: Array,
|
249
|
+
default: () => [13],
|
250
|
+
validator: B
|
251
|
+
},
|
252
|
+
/**
|
253
|
+
* @description The maximum amount the tags array is allowed to hold.
|
254
|
+
* @property {props}
|
255
|
+
* @type {Number}
|
256
|
+
*/
|
257
|
+
maxTags: {
|
258
|
+
type: Number
|
259
|
+
},
|
260
|
+
/**
|
261
|
+
* @description The maximum amount of characters the input is allowed to hold.
|
262
|
+
* @property {props}
|
263
|
+
* @type {Number}
|
264
|
+
*/
|
265
|
+
maxlength: {
|
266
|
+
type: Number
|
267
|
+
},
|
268
|
+
/**
|
269
|
+
* @description Pass an array containing objects like in the example below.
|
270
|
+
The property 'classes' will be added as css classes, if the property 'rule' matches the text
|
271
|
+
of a tag, an autocomplete item or the input. The property 'rule' can be type of
|
272
|
+
RegExp or function. If the property 'disableAdd' is 'true', the item can't be added
|
273
|
+
to the tags array, if the appropriated rule matches.
|
274
|
+
* @property {props}
|
275
|
+
* @type {Array}
|
276
|
+
* @default []
|
277
|
+
* @example
|
278
|
+
{
|
279
|
+
 classes: 'class', /* css class */
|
280
|
+
 rule: /^([^0-9]*)$/, /* RegExp */
|
281
|
+
}, {
|
282
|
+
 classes: 'no-braces', /* css class */
|
283
|
+
 rule(text) { /* function with text as param */
|
284
|
+
  return text.indexOf('{') !== -1 || text.indexOf('}') !== -1;
|
285
|
+
 },
|
286
|
+
 disableAdd: true, /* if the rule matches, the item cannot be added */,
|
287
|
+
},
|
288
|
+
*/
|
289
|
+
validation: {
|
290
|
+
type: Array,
|
291
|
+
default: () => [],
|
292
|
+
validator(e) {
|
293
|
+
return !e.some((t) => {
|
294
|
+
const s = !t.rule;
|
295
|
+
s && console.warn('Property "rule" is missing', t);
|
296
|
+
const i = t.rule && (typeof t.rule == "string" || t.rule instanceof RegExp || {}.toString.call(t.rule) === "[object Function]");
|
297
|
+
i || console.warn(
|
298
|
+
"A rule must be type of string, RegExp or function. Found:",
|
299
|
+
JSON.stringify(t.rule)
|
300
|
+
);
|
301
|
+
const o = !t.classes;
|
302
|
+
o && console.warn('Property "classes" is missing', t);
|
303
|
+
const d = t.type && typeof t.type != "string";
|
304
|
+
return d && console.warn('Property "type" must be type of string. Found:', t), !i || s || o || d;
|
305
|
+
});
|
306
|
+
}
|
307
|
+
},
|
308
|
+
/**
|
309
|
+
* @description Defines the characters which splits a text into different pieces,
|
310
|
+
to generate tags out of this pieces.
|
311
|
+
* @property {props}
|
312
|
+
* @type {Array}
|
313
|
+
* @default [';']
|
314
|
+
* @example
|
315
|
+
separators: [';', ',']
|
316
|
+
input: some; user input, has random; commas, an,d semicolons
|
317
|
+
will split into: some - user input - has random - commas - an - d semicolons
|
318
|
+
*/
|
319
|
+
separators: {
|
320
|
+
type: Array,
|
321
|
+
default: () => [";"],
|
322
|
+
validator(e) {
|
323
|
+
return !e.some((t) => {
|
324
|
+
const s = typeof t != "string";
|
325
|
+
return s && console.warn("Separators must be type of string. Found:", t), s;
|
326
|
+
});
|
327
|
+
}
|
328
|
+
},
|
329
|
+
/**
|
330
|
+
* @description If it's true, the user can't add or save a tag,
|
331
|
+
if another exists, with the same text value.
|
332
|
+
* @property {props}
|
333
|
+
* @type {Boolean}
|
334
|
+
* @default true
|
335
|
+
*/
|
336
|
+
avoidAddingDuplicates: {
|
337
|
+
type: Boolean,
|
338
|
+
default: !0
|
339
|
+
},
|
340
|
+
/**
|
341
|
+
* @description If the input holds a value and loses the focus,
|
342
|
+
a tag will be generated out of this value, if possible.
|
343
|
+
* @property {props}
|
344
|
+
* @type {Boolean}
|
345
|
+
* @default true
|
346
|
+
*/
|
347
|
+
addOnBlur: {
|
348
|
+
type: Boolean,
|
349
|
+
default: !0
|
350
|
+
},
|
351
|
+
/**
|
352
|
+
* @description Custom function to detect duplicates. If the function returns 'true',
|
353
|
+
the tag will be marked as duplicate.
|
354
|
+
* @property {props}
|
355
|
+
* @type {Function}
|
356
|
+
* @param {Array} tagsarray The Array of tags minus the one which is edited/created.
|
357
|
+
* @param {Object} tag The tag which is edited or should be added to the tags array.
|
358
|
+
* @example
|
359
|
+
// The duplicate function to recreate the default behaviour, would look like this:
|
360
|
+
isDuplicate(tags, tag) {
|
361
|
+
 return tags.map(t => t.text).indexOf(tag.text) !== -1;
|
362
|
+
}
|
363
|
+
*/
|
364
|
+
isDuplicate: {
|
365
|
+
type: Function,
|
366
|
+
default: null
|
367
|
+
},
|
368
|
+
/**
|
369
|
+
* @description If it's true, the user can paste into the input element and
|
370
|
+
vue-tags-input will create tags out of the incoming text.
|
371
|
+
* @property {props}
|
372
|
+
* @type {Boolean}
|
373
|
+
* @default true
|
374
|
+
*/
|
375
|
+
addFromPaste: {
|
376
|
+
type: Boolean,
|
377
|
+
default: !0
|
378
|
+
},
|
379
|
+
/**
|
380
|
+
* @description Defines if it's possible to delete tags by pressing backspace.
|
381
|
+
If so and the user wants to delete a tag,
|
382
|
+
the tag gets the css class 'deletion-mark' for 1 second.
|
383
|
+
If the user presses backspace again in that time period,
|
384
|
+
the tag is removed from the tags array and the view.
|
385
|
+
* @property {props}
|
386
|
+
* @type {Boolean}
|
387
|
+
* @default true
|
388
|
+
*/
|
389
|
+
deleteOnBackspace: {
|
390
|
+
default: !0,
|
391
|
+
type: Boolean
|
392
|
+
},
|
393
|
+
// event handlers
|
394
|
+
onBeforeAddingTag: Function,
|
395
|
+
onBeforeDeletingTag: Function,
|
396
|
+
onBeforeEditingTag: Function,
|
397
|
+
onBeforeSavingTag: Function
|
398
|
+
}, _ = {
|
399
|
+
name: "VueTagsInput",
|
400
|
+
components: { TagInput: X },
|
401
|
+
props: Z,
|
402
|
+
emits: [
|
403
|
+
"adding-duplicate",
|
404
|
+
"before-adding-tag",
|
405
|
+
"before-deleting-tag",
|
406
|
+
"before-editing-tag",
|
407
|
+
"before-saving-tag",
|
408
|
+
"max-tags-reached",
|
409
|
+
"saving-duplicate",
|
410
|
+
"tags-changed",
|
411
|
+
"tag-clicked",
|
412
|
+
"update:modelValue",
|
413
|
+
"update:tags"
|
414
|
+
],
|
415
|
+
inheritAttrs: !1,
|
416
|
+
data() {
|
417
|
+
return {
|
418
|
+
tagCenter: [],
|
419
|
+
newTag: null,
|
420
|
+
tagsCopy: [],
|
421
|
+
tagsEditStatus: null,
|
422
|
+
deletionMark: null,
|
423
|
+
deletionMarkTime: null,
|
424
|
+
selectedItem: null,
|
425
|
+
focused: null
|
426
|
+
};
|
427
|
+
},
|
428
|
+
computed: {
|
429
|
+
// Property which calculates if the autocomplete should be opened or not
|
430
|
+
autocompleteOpen() {
|
431
|
+
return this.autocompleteAlwaysOpen ? !0 : this.newTag !== null && this.newTag.length >= this.autocompleteMinLength && this.filteredAutocompleteItems.length > 0 && this.focused;
|
432
|
+
},
|
433
|
+
// Returns validated autocomplete items. Maybe duplicates are filtered out
|
434
|
+
filteredAutocompleteItems() {
|
435
|
+
const e = this.autocompleteItems.map((t) => v(t, this.tags, this.validation, this.isDuplicate));
|
436
|
+
return this.autocompleteFilterDuplicates ? e.filter(this.duplicateFilter) : e;
|
437
|
+
}
|
438
|
+
},
|
439
|
+
methods: {
|
440
|
+
createClasses: V,
|
441
|
+
// Returns the index which item should be selected, based on the parameter 'method'
|
442
|
+
getSelectedIndex(e) {
|
443
|
+
const t = this.filteredAutocompleteItems, s = this.selectedItem, i = t.length - 1;
|
444
|
+
if (t.length !== 0)
|
445
|
+
return s === null ? 0 : e === "before" && s === 0 ? i : e === "after" && s === i ? 0 : e === "after" ? s + 1 : s - 1;
|
446
|
+
},
|
447
|
+
selectDefaultItem() {
|
448
|
+
this.addOnlyFromAutocomplete && this.filteredAutocompleteItems.length > 0 ? this.selectedItem = 0 : this.selectedItem = null;
|
449
|
+
},
|
450
|
+
selectItem(e, t) {
|
451
|
+
e.preventDefault(), this.selectedItem = this.getSelectedIndex(t);
|
452
|
+
},
|
453
|
+
isSelected(e) {
|
454
|
+
return this.selectedItem === e;
|
455
|
+
},
|
456
|
+
isMarked(e) {
|
457
|
+
return this.deletionMark === e;
|
458
|
+
},
|
459
|
+
// Save ref for tag
|
460
|
+
setTagCenter(e) {
|
461
|
+
e && this.tagCenter.push(e);
|
462
|
+
},
|
463
|
+
// Method which is called when the user presses backspace → remove the last tag
|
464
|
+
invokeDelete() {
|
465
|
+
if (!this.deleteOnBackspace || this.newTag.length > 0)
|
466
|
+
return;
|
467
|
+
const e = this.tagsCopy.length - 1;
|
468
|
+
this.deletionMark === null ? (this.deletionMarkTime = setTimeout(() => this.deletionMark = null, 1e3), this.deletionMark = e) : this.performDeleteTag(e);
|
469
|
+
},
|
470
|
+
addTagsFromPaste() {
|
471
|
+
this.addFromPaste && setTimeout(() => this.performAddTags(this.newTag), 10);
|
472
|
+
},
|
473
|
+
// Method to call if a tag should switch to it's edit mode
|
474
|
+
performEditTag(e) {
|
475
|
+
this.allowEditTags && (this.onBeforeAddingTag || this.editTag(e), this.$emit("before-editing-tag", {
|
476
|
+
index: e,
|
477
|
+
tag: this.tagsCopy[e],
|
478
|
+
editTag: () => this.editTag(e)
|
479
|
+
}));
|
480
|
+
},
|
481
|
+
// Opens the edit mode for a tag and focuses it
|
482
|
+
editTag(e) {
|
483
|
+
this.allowEditTags && (this.toggleEditMode(e), this.focus(e));
|
484
|
+
},
|
485
|
+
// Toggles the edit mode for a tag
|
486
|
+
toggleEditMode(e) {
|
487
|
+
!this.allowEditTags || this.disabled || (this.tagsEditStatus[e] = !this.tagsEditStatus[e]);
|
488
|
+
},
|
489
|
+
// only called by the @input event from TagInput.
|
490
|
+
// Creates a new tag model and applys it to this.tagsCopy[index]
|
491
|
+
createChangedTag(e, t) {
|
492
|
+
const s = this.tagsCopy[e];
|
493
|
+
s.text = t ? t.target.value : this.tagsCopy[e].text, this.tagsCopy[e] = v(s, this.tagsCopy, this.validation, this.isDuplicate);
|
494
|
+
},
|
495
|
+
// Focuses the input of a tag
|
496
|
+
focus(e) {
|
497
|
+
this.$nextTick(() => {
|
498
|
+
const t = this.tagCenter[e].querySelector("input.ti-tag-input");
|
499
|
+
t && t.focus();
|
500
|
+
});
|
501
|
+
},
|
502
|
+
quote(e) {
|
503
|
+
return e.replace(/([()[{*+.$^\\|?])/g, "\\$1");
|
504
|
+
},
|
505
|
+
// Cancels the edit mode for a tag → resets the tag to it's original model!
|
506
|
+
cancelEdit(e) {
|
507
|
+
this.tags[e] && (this.tagsCopy[e] = T(
|
508
|
+
v(this.tags[e], this.tags, this.validation, this.isDuplicate)
|
509
|
+
), this.tagsEditStatus[e] = !1);
|
510
|
+
},
|
511
|
+
hasForbiddingAddRule(e) {
|
512
|
+
return e.some((t) => {
|
513
|
+
const s = this.validation.find((i) => t === i.classes);
|
514
|
+
return s ? s.disableAdd : !1;
|
515
|
+
});
|
516
|
+
},
|
517
|
+
// Creates multiple tags out of a string, based on the prop separators
|
518
|
+
createTagTexts(e) {
|
519
|
+
const t = new RegExp(this.separators.map((s) => this.quote(s)).join("|"));
|
520
|
+
return e.split(t).map((s) => ({ text: s }));
|
521
|
+
},
|
522
|
+
// Method to call to delete a tag
|
523
|
+
performDeleteTag(e) {
|
524
|
+
this.onBeforeDeletingTag || this.deleteTag(e), this.$emit("before-deleting-tag", {
|
525
|
+
index: e,
|
526
|
+
tag: this.tagsCopy[e],
|
527
|
+
deleteTag: () => this.deleteTag(e)
|
528
|
+
});
|
529
|
+
},
|
530
|
+
deleteTag(e) {
|
531
|
+
this.disabled || (this.deletionMark = null, clearTimeout(this.deletionMarkTime), this.tagsCopy.splice(e, 1), this.$emit("update:tags", this.tagsCopy), this.$emit("tags-changed", this.tagsCopy));
|
532
|
+
},
|
533
|
+
// Decides wether the input keyCode is one, which is allowed to modify/add tags
|
534
|
+
noTriggerKey(e, t) {
|
535
|
+
const s = this[t].indexOf(e.keyCode) !== -1 || this[t].indexOf(e.key) !== -1;
|
536
|
+
return s && e.preventDefault(), !s;
|
537
|
+
},
|
538
|
+
// Method to call to add a tag
|
539
|
+
performAddTags(e, t, s) {
|
540
|
+
if (this.disabled || t && this.noTriggerKey(t, "addOnKey"))
|
541
|
+
return;
|
542
|
+
let i = [];
|
543
|
+
typeof e == "object" && (i = [e]), typeof e == "string" && (i = this.createTagTexts(e)), i = i.filter((o) => o.text.trim().length > 0), i.forEach((o) => {
|
544
|
+
o = v(o, this.tags, this.validation, this.isDuplicate), this.onBeforeAddingTag || this.addTag(o, s), this.$emit("before-adding-tag", {
|
545
|
+
tag: o,
|
546
|
+
addTag: () => this.addTag(o, s)
|
547
|
+
});
|
548
|
+
});
|
549
|
+
},
|
550
|
+
duplicateFilter(e) {
|
551
|
+
return this.isDuplicate ? !this.isDuplicate(this.tagsCopy, e) : !this.tagsCopy.find((t) => t.text === e.text);
|
552
|
+
},
|
553
|
+
addTag(e, t = "new-tag-input") {
|
554
|
+
const s = this.filteredAutocompleteItems.map((i) => i.text);
|
555
|
+
this.addOnlyFromAutocomplete && s.indexOf(e.text) === -1 || this.$nextTick(() => {
|
556
|
+
if (this.maxTags && this.maxTags <= this.tagsCopy.length)
|
557
|
+
return this.$emit("max-tags-reached", e);
|
558
|
+
if (this.avoidAddingDuplicates && !this.duplicateFilter(e))
|
559
|
+
return this.$emit("adding-duplicate", e);
|
560
|
+
this.hasForbiddingAddRule(e.tiClasses) || (this.newTag = "", this.tagsCopy.push(e), this.$emit("update:tags", this.tagsCopy), t === "autocomplete" && this.$refs.newTagInput.focus(), this.$emit("tags-changed", this.tagsCopy));
|
561
|
+
});
|
562
|
+
},
|
563
|
+
// Method to call to save a tag
|
564
|
+
performSaveTag(e, t) {
|
565
|
+
const s = this.tagsCopy[e];
|
566
|
+
this.disabled || t && this.noTriggerKey(t, "addOnKey") || s.text.trim().length !== 0 && (this["on-before-saving-tag"] || this.saveTag(e, s), this.$emit("before-saving-tag", {
|
567
|
+
index: e,
|
568
|
+
tag: s,
|
569
|
+
saveTag: () => this.saveTag(e, s)
|
570
|
+
}));
|
571
|
+
},
|
572
|
+
saveTag(e, t) {
|
573
|
+
if (this.avoidAddingDuplicates) {
|
574
|
+
const s = T(this.tagsCopy), i = s.splice(e, 1)[0];
|
575
|
+
if (this.isDuplicate ? this.isDuplicate(s, i) : s.map((d) => d.text).indexOf(i.text) !== -1)
|
576
|
+
return this.$emit("saving-duplicate", t);
|
577
|
+
}
|
578
|
+
this.hasForbiddingAddRule(t.tiClasses) || (this.tagsCopy[e] = t, this.toggleEditMode(e), this.$emit("update:tags", this.tagsCopy), this.$emit("tags-changed", this.tagsCopy));
|
579
|
+
},
|
580
|
+
tagsEqual() {
|
581
|
+
return !this.tagsCopy.some((e, t) => !U(e, this.tags[t]));
|
582
|
+
},
|
583
|
+
updateNewTag(e) {
|
584
|
+
const t = e.target.value;
|
585
|
+
this.newTag = t, this.$emit("update:modelValue", t);
|
586
|
+
},
|
587
|
+
initTags() {
|
588
|
+
this.tagsCopy = Y(this.tags, this.validation, this.isDuplicate), this.tagsEditStatus = T(this.tags).map(() => !1), this.tagsEqual() || this.$emit("update:tags", this.tagsCopy);
|
589
|
+
},
|
590
|
+
blurredOnClick(e) {
|
591
|
+
this.$el.contains(e.target) || this.$el.contains(document.activeElement) || this.performBlur(e);
|
592
|
+
},
|
593
|
+
performBlur() {
|
594
|
+
this.addOnBlur && this.focused && this.performAddTags(this.newTag), this.focused = !1;
|
595
|
+
}
|
596
|
+
},
|
597
|
+
watch: {
|
598
|
+
modelValue(e) {
|
599
|
+
this.addOnlyFromAutocomplete || (this.selectedItem = null), this.newTag = e;
|
600
|
+
},
|
601
|
+
tags: {
|
602
|
+
handler() {
|
603
|
+
this.initTags();
|
604
|
+
},
|
605
|
+
deep: !0
|
606
|
+
},
|
607
|
+
autocompleteOpen: "selectDefaultItem"
|
608
|
+
},
|
609
|
+
created() {
|
610
|
+
this.newTag = this.modelValue, this.initTags();
|
611
|
+
},
|
612
|
+
mounted() {
|
613
|
+
this.selectDefaultItem(), document.addEventListener("click", this.blurredOnClick);
|
614
|
+
},
|
615
|
+
beforeUpdate() {
|
616
|
+
this.tagCenter = [];
|
617
|
+
},
|
618
|
+
unmounted() {
|
619
|
+
document.removeEventListener("click", this.blurredOnClick);
|
620
|
+
}
|
621
|
+
};
|
622
|
+
const x = { class: "ti-input" }, ee = {
|
623
|
+
key: 0,
|
624
|
+
class: "ti-tags"
|
625
|
+
}, te = ["onClick"], se = { class: "ti-content" }, ie = {
|
626
|
+
key: 0,
|
627
|
+
class: "ti-tag-left"
|
628
|
+
}, ae = ["onClick"], oe = {
|
629
|
+
key: 1,
|
630
|
+
class: "ti-tag-right"
|
631
|
+
}, re = { class: "ti-actions" }, ne = ["onClick"], le = ["onClick"], de = { class: "ti-new-tag-input-wrapper" }, ue = ["placeholder", "value", "maxlength", "disabled"], ge = ["onMouseover"], pe = ["onClick"];
|
632
|
+
function fe(e, t, s, i, o, d) {
|
633
|
+
const u = N("tag-input");
|
634
|
+
return n(), l("div", {
|
635
|
+
class: y(["vue-tags-input", [{ "ti-disabled": e.disabled }, { "ti-focus": e.focused }, e.$attrs.class]]),
|
636
|
+
style: $(e.$attrs.style)
|
637
|
+
}, [
|
638
|
+
m("div", x, [
|
639
|
+
e.tagsCopy ? (n(), l("ul", ee, [
|
640
|
+
(n(!0), l(O, null, I(e.tagsCopy, (a, r) => (n(), l("li", {
|
641
|
+
key: r,
|
642
|
+
style: $(a.style),
|
643
|
+
class: y([[
|
644
|
+
{ "ti-editing": e.tagsEditStatus[r] },
|
645
|
+
a.tiClasses,
|
646
|
+
a.classes,
|
647
|
+
{ "ti-deletion-mark": e.isMarked(r) }
|
648
|
+
], "ti-tag"]),
|
649
|
+
tabindex: "0",
|
650
|
+
onClick: (g) => e.$emit("tag-clicked", { tag: a, index: r })
|
651
|
+
}, [
|
652
|
+
m("div", se, [
|
653
|
+
e.$slots["tag-left"] ? (n(), l("div", ie, [
|
654
|
+
h(e.$slots, "tag-left", {
|
655
|
+
tag: a,
|
656
|
+
index: r,
|
657
|
+
edit: e.tagsEditStatus[r],
|
658
|
+
performSaveEdit: e.performSaveTag,
|
659
|
+
performDelete: e.performDeleteTag,
|
660
|
+
performCancelEdit: e.cancelEdit,
|
661
|
+
performOpenEdit: e.performEditTag,
|
662
|
+
deletionMark: e.isMarked(r)
|
663
|
+
}, void 0, !0)
|
664
|
+
])) : f("", !0),
|
665
|
+
m("div", {
|
666
|
+
ref_for: !0,
|
667
|
+
ref: e.setTagCenter,
|
668
|
+
class: "ti-tag-center"
|
669
|
+
}, [
|
670
|
+
e.$slots["tag-center"] ? f("", !0) : (n(), l("span", {
|
671
|
+
key: 0,
|
672
|
+
class: y({ "ti-hidden": e.tagsEditStatus[r] }),
|
673
|
+
onClick: (g) => e.performEditTag(r)
|
674
|
+
}, D(a.text), 11, ae)),
|
675
|
+
e.$slots["tag-center"] ? f("", !0) : (n(), P(u, {
|
676
|
+
key: 1,
|
677
|
+
scope: {
|
678
|
+
edit: e.tagsEditStatus[r],
|
679
|
+
maxlength: e.maxlength,
|
680
|
+
tag: a,
|
681
|
+
index: r,
|
682
|
+
validateTag: e.createChangedTag,
|
683
|
+
performCancelEdit: e.cancelEdit,
|
684
|
+
performSaveEdit: e.performSaveTag
|
685
|
+
}
|
686
|
+
}, null, 8, ["scope"])),
|
687
|
+
h(e.$slots, "tag-center", {
|
688
|
+
tag: a,
|
689
|
+
index: r,
|
690
|
+
maxlength: e.maxlength,
|
691
|
+
edit: e.tagsEditStatus[r],
|
692
|
+
performSaveEdit: e.performSaveTag,
|
693
|
+
performDelete: e.performDeleteTag,
|
694
|
+
performCancelEdit: e.cancelEdit,
|
695
|
+
validateTag: e.createChangedTag,
|
696
|
+
performOpenEdit: e.performEditTag,
|
697
|
+
deletionMark: e.isMarked(r)
|
698
|
+
}, void 0, !0)
|
699
|
+
], 512),
|
700
|
+
e.$slots["tag-right"] ? (n(), l("div", oe, [
|
701
|
+
h(e.$slots, "tag-right", {
|
702
|
+
tag: a,
|
703
|
+
index: r,
|
704
|
+
edit: e.tagsEditStatus[r],
|
705
|
+
performSaveEdit: e.performSaveTag,
|
706
|
+
performDelete: e.performDeleteTag,
|
707
|
+
performCancelEdit: e.cancelEdit,
|
708
|
+
performOpenEdit: e.performEditTag,
|
709
|
+
deletionMark: e.isMarked(r)
|
710
|
+
}, void 0, !0)
|
711
|
+
])) : f("", !0)
|
712
|
+
]),
|
713
|
+
m("div", re, [
|
714
|
+
e.$slots["tag-actions"] ? f("", !0) : S((n(), l("i", {
|
715
|
+
key: 0,
|
716
|
+
class: "ti-icon-undo",
|
717
|
+
onClick: (g) => e.cancelEdit(r)
|
718
|
+
}, null, 8, ne)), [
|
719
|
+
[A, e.tagsEditStatus[r]]
|
720
|
+
]),
|
721
|
+
e.$slots["tag-actions"] ? f("", !0) : S((n(), l("i", {
|
722
|
+
key: 1,
|
723
|
+
class: "ti-icon-close",
|
724
|
+
onClick: (g) => e.performDeleteTag(r)
|
725
|
+
}, null, 8, le)), [
|
726
|
+
[A, !e.tagsEditStatus[r]]
|
727
|
+
]),
|
728
|
+
e.$slots["tag-actions"] ? h(e.$slots, "tag-actions", {
|
729
|
+
key: 2,
|
730
|
+
tag: a,
|
731
|
+
index: r,
|
732
|
+
edit: e.tagsEditStatus[r],
|
733
|
+
performSaveEdit: e.performSaveTag,
|
734
|
+
performDelete: e.performDeleteTag,
|
735
|
+
performCancelEdit: e.cancelEdit,
|
736
|
+
performOpenEdit: e.performEditTag,
|
737
|
+
deletionMark: e.isMarked(r)
|
738
|
+
}, void 0, !0) : f("", !0)
|
739
|
+
])
|
740
|
+
], 14, te))), 128)),
|
741
|
+
m("li", de, [
|
742
|
+
m("input", K({ ref: "newTagInput" }, e.$attrs, {
|
743
|
+
class: [[e.createClasses(e.newTag, e.tags, e.validation, e.isDuplicate)], "ti-new-tag-input"],
|
744
|
+
placeholder: e.placeholder,
|
745
|
+
value: e.newTag,
|
746
|
+
maxlength: e.maxlength,
|
747
|
+
disabled: e.disabled,
|
748
|
+
type: "text",
|
749
|
+
size: "1",
|
750
|
+
onKeydown: [
|
751
|
+
t[0] || (t[0] = (a) => e.performAddTags(
|
752
|
+
e.filteredAutocompleteItems[e.selectedItem] || e.newTag,
|
753
|
+
a
|
754
|
+
)),
|
755
|
+
t[2] || (t[2] = k((...a) => e.invokeDelete && e.invokeDelete(...a), ["delete"])),
|
756
|
+
t[3] || (t[3] = k((...a) => e.performBlur && e.performBlur(...a), ["tab"])),
|
757
|
+
t[4] || (t[4] = k((a) => e.selectItem(a, "before"), ["up"])),
|
758
|
+
t[5] || (t[5] = k((a) => e.selectItem(a, "after"), ["down"]))
|
759
|
+
],
|
760
|
+
onPaste: t[1] || (t[1] = (...a) => e.addTagsFromPaste && e.addTagsFromPaste(...a)),
|
761
|
+
onInput: t[6] || (t[6] = (...a) => e.updateNewTag && e.updateNewTag(...a)),
|
762
|
+
onFocus: t[7] || (t[7] = (a) => e.focused = !0),
|
763
|
+
onClick: t[8] || (t[8] = (a) => e.addOnlyFromAutocomplete ? !1 : e.selectedItem = null)
|
764
|
+
}), null, 16, ue)
|
765
|
+
])
|
766
|
+
])) : f("", !0)
|
767
|
+
]),
|
768
|
+
h(e.$slots, "between-elements", {}, void 0, !0),
|
769
|
+
e.autocompleteOpen ? (n(), l("div", {
|
770
|
+
key: 0,
|
771
|
+
class: y(["ti-autocomplete", e.$attrs.class]),
|
772
|
+
onMouseout: t[9] || (t[9] = (a) => e.selectedItem = null)
|
773
|
+
}, [
|
774
|
+
h(e.$slots, "autocomplete-header", {}, void 0, !0),
|
775
|
+
m("ul", null, [
|
776
|
+
(n(!0), l(O, null, I(e.filteredAutocompleteItems, (a, r) => (n(), l("li", {
|
777
|
+
key: r,
|
778
|
+
style: $(a.style),
|
779
|
+
class: y([[
|
780
|
+
a.tiClasses,
|
781
|
+
a.classes,
|
782
|
+
{ "ti-selected-item": e.isSelected(r) }
|
783
|
+
], "ti-item"]),
|
784
|
+
onMouseover: (g) => e.disabled ? !1 : e.selectedItem = r
|
785
|
+
}, [
|
786
|
+
e.$slots["autocomplete-item"] ? h(e.$slots, "autocomplete-item", {
|
787
|
+
key: 1,
|
788
|
+
item: a,
|
789
|
+
index: r,
|
790
|
+
performAdd: (g) => e.performAddTags(g, void 0, "autocomplete"),
|
791
|
+
selected: e.isSelected(r)
|
792
|
+
}, void 0, !0) : (n(), l("div", {
|
793
|
+
key: 0,
|
794
|
+
onClick: (g) => e.performAddTags(a, void 0, "autocomplete")
|
795
|
+
}, D(a.text), 9, pe))
|
796
|
+
], 46, ge))), 128))
|
797
|
+
]),
|
798
|
+
h(e.$slots, "autocomplete-footer", {}, void 0, !0)
|
799
|
+
], 34)) : f("", !0)
|
800
|
+
], 6);
|
801
|
+
}
|
802
|
+
const me = /* @__PURE__ */ M(_, [["render", fe], ["__scopeId", "data-v-d14eec25"]]);
|
803
|
+
const ce = /* @__PURE__ */ m("h5", { class: "mn-thin" }, "Tags (maximum 20):", -1), he = { class: "mn-medium" }, ye = /* @__PURE__ */ m("p", { class: "p-small mn-thin" }, "Suggested:", -1), Te = ["onClick"], ve = { key: 1 }, we = {
|
804
|
+
__name: "BlockTags",
|
805
|
+
props: ["tags"],
|
806
|
+
emits: ["tags-changed"],
|
807
|
+
setup(e, { emit: t }) {
|
808
|
+
const s = e, i = w(""), o = w([]), d = w([
|
809
|
+
{ text: "story" },
|
810
|
+
{ text: "news" },
|
811
|
+
{ text: "guide" },
|
812
|
+
{ text: "discussion" },
|
813
|
+
{ text: "photos" }
|
814
|
+
]);
|
815
|
+
s.tags && (o.value = s.tags.map((p) => ({ text: p })));
|
816
|
+
const u = b(() => d.value.filter((p) => p.text.toLowerCase().includes(i.value.toLowerCase()))), a = b(() => d.value.filter((p) => !o.value.some((c) => c.text === p.text)));
|
817
|
+
function r(p) {
|
818
|
+
o.value.push(p), t("tags-changed", o.value.map((c) => c.text));
|
819
|
+
}
|
820
|
+
function g(p) {
|
821
|
+
o.value = p, t("tags-changed", o.value.map((c) => c.text));
|
822
|
+
}
|
823
|
+
return (p, c) => (n(), l("div", null, [
|
824
|
+
ce,
|
825
|
+
q(me, {
|
826
|
+
modelValue: i.value,
|
827
|
+
"onUpdate:modelValue": c[0] || (c[0] = (C) => i.value = C),
|
828
|
+
tags: o.value,
|
829
|
+
"autocomplete-items": E(u),
|
830
|
+
"add-on-key": [13, ":", ";", ","],
|
831
|
+
"save-on-key": [13, ":", ";", ","],
|
832
|
+
separators: [";", ","],
|
833
|
+
"max-tags": 20,
|
834
|
+
maxlength: 20,
|
835
|
+
placeholder: "Please add tags",
|
836
|
+
"add-from-paste": !0,
|
837
|
+
"allow-edit-tags": !0,
|
838
|
+
onTagsChanged: g,
|
839
|
+
class: "mn-thin bg-grey radius-medium pd-small"
|
840
|
+
}, null, 8, ["modelValue", "tags", "autocomplete-items"]),
|
841
|
+
m("p", he, [
|
842
|
+
ye,
|
843
|
+
E(a).length > 0 ? (n(!0), l(O, { key: 0 }, I(E(a), (C, R) => (n(), l("span", {
|
844
|
+
onClick: (Ce) => r(C),
|
845
|
+
class: y(["cursor-pointer ti-tag-toDefactor", { "mn-r-micro": R !== E(a).length - 1 }])
|
846
|
+
}, D(C.text), 11, Te))), 256)) : (n(), l("span", ve, "You added all suggested tags"))
|
847
|
+
])
|
848
|
+
]));
|
849
|
+
}
|
850
|
+
};
|
851
|
+
export {
|
852
|
+
we as _
|
853
|
+
};
|