@ozdao/prometheus-framework 0.1.68 → 0.1.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. package/dist/BackofficeGallery-59a591ab.js +1 -0
  2. package/dist/BackofficeGallery-be6f69a9.mjs +307 -0
  3. package/dist/BackofficeReports-06166952.js +1 -0
  4. package/dist/BackofficeReports-50fd799c.mjs +44 -0
  5. package/dist/BlockTags-00325fa0.mjs +853 -0
  6. package/dist/BlockTags-58f95c8a.js +1 -0
  7. package/dist/ButtonToggleMembership-84d0e018.mjs +90 -0
  8. package/dist/ButtonToggleMembership-b905812f.js +1 -0
  9. package/dist/CardBlogpost-1b81b54e.mjs +246 -0
  10. package/dist/CardBlogpost-7107e04a.js +1 -0
  11. package/dist/CardOrganization-49ab5190.mjs +234 -0
  12. package/dist/CardOrganization-e6ac27f1.js +1 -0
  13. package/dist/CardProduct-4c0cb9a1.js +1 -0
  14. package/dist/CardProduct-ea0e1f84.mjs +192 -0
  15. package/dist/Chips-817cf959.js +1 -0
  16. package/dist/Chips-8c836ba6.mjs +213 -0
  17. package/dist/Community-8c4e011b.js +1 -0
  18. package/dist/Community-bd6f0cbb.mjs +131 -0
  19. package/dist/Dashboard-73b50724.js +1 -0
  20. package/dist/Dashboard-bc81b5f6.mjs +151 -0
  21. package/dist/Dropdown-60e3dc6c.js +1 -0
  22. package/dist/Dropdown-d1c81d45.mjs +169 -0
  23. package/dist/EditOrder-2b746caf.mjs +221 -0
  24. package/dist/EditOrder-e632f0cc.js +1 -0
  25. package/dist/Events-999cc8ed.js +1 -0
  26. package/dist/Events-ad8bbf27.mjs +134 -0
  27. package/dist/Feed-35e13c22.mjs +156 -0
  28. package/dist/Feed-53d96b18.mjs +361 -0
  29. package/dist/Feed-694a2fad.js +1 -0
  30. package/dist/Feed-ac4bb6ea.js +1 -0
  31. package/dist/Feed-d1d01771.js +1 -0
  32. package/dist/Feed-f7c04014.mjs +124 -0
  33. package/dist/Image-61cfd52d.js +9 -0
  34. package/dist/Image-e8be4acc.mjs +480 -0
  35. package/dist/LeftoverAdd-a268a95c.js +1 -0
  36. package/dist/LeftoverAdd-e4d93760.mjs +229 -0
  37. package/dist/Leftovers-6976802d.mjs +135 -0
  38. package/dist/Leftovers-d8f1d152.js +1 -0
  39. package/dist/Members-aeb2bca1.mjs +109 -0
  40. package/dist/Members-b9664e83.js +1 -0
  41. package/dist/Menu-93d34d9f.js +1 -0
  42. package/dist/Menu-eaf6b44c.mjs +13 -0
  43. package/dist/MenuItem-4a5881bd.mjs +85 -0
  44. package/dist/MenuItem-f35cad93.js +1 -0
  45. package/dist/Orders-8bc8963c.js +1 -0
  46. package/dist/Orders-eb262d8c.mjs +75 -0
  47. package/dist/Organizations-9926aa51.mjs +72 -0
  48. package/dist/Organizations-c653d814.js +1 -0
  49. package/dist/Payments-98328000.js +1 -0
  50. package/dist/Payments-a9066cdf.mjs +11 -0
  51. package/dist/Popup-0d8e1392.mjs +96 -0
  52. package/dist/Popup-eb11fa82.js +1 -0
  53. package/dist/Product-15043af7.mjs +651 -0
  54. package/dist/Product-82c022a4.js +7 -0
  55. package/dist/ProductEdit-05da9866.mjs +258 -0
  56. package/dist/ProductEdit-2f075296.js +1 -0
  57. package/dist/ProductsBackoffice-8462f626.js +1 -0
  58. package/dist/ProductsBackoffice-8d0f0ee8.mjs +85 -0
  59. package/dist/ProfileBlogposts-43855cb9.js +1 -0
  60. package/dist/ProfileBlogposts-f32170a3.mjs +78 -0
  61. package/dist/ProfileEvents-54be2d43.mjs +69 -0
  62. package/dist/ProfileEvents-ab69e27e.js +1 -0
  63. package/dist/ProfileOrganizations-0787cf34.mjs +72 -0
  64. package/dist/ProfileOrganizations-eb62dde4.js +1 -0
  65. package/dist/Publics-8e726d20.mjs +45 -0
  66. package/dist/Publics-ae589bf1.js +1 -0
  67. package/dist/Select-95f4701a.js +1 -0
  68. package/dist/Select-dab17282.mjs +80 -0
  69. package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js +1 -0
  70. package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs +1 -0
  71. package/dist/Socials-43293869.js +1 -0
  72. package/dist/Socials-8193477c.mjs +189 -0
  73. package/dist/UploadImage-0e8e4278.mjs +83 -0
  74. package/dist/UploadImage-8c71bda6.js +1 -0
  75. package/dist/UploadImageMultiple-c34a6c6f.mjs +58 -0
  76. package/dist/UploadImageMultiple-d1316df5.js +1 -0
  77. package/dist/Wallet-727195d9.mjs +21700 -0
  78. package/dist/Wallet-f4dda407.js +10 -0
  79. package/dist/auth-04684a60.js +7 -0
  80. package/dist/auth-7e39361f.mjs +633 -0
  81. package/dist/auth.client.cjs +1 -1
  82. package/dist/auth.client.js +5 -5
  83. package/dist/auth.validation-d614130d.js +1 -0
  84. package/dist/auth.validation-f4bf1deb.mjs +24 -0
  85. package/dist/axios-33aeb810.mjs +1435 -0
  86. package/dist/axios-ceccf20e.js +5 -0
  87. package/dist/backoffice.client.cjs +1 -1
  88. package/dist/backoffice.client.js +20 -20
  89. package/dist/categories-7e17a7eb.js +1 -0
  90. package/dist/categories-b7f9e8c0.mjs +122 -0
  91. package/dist/community.client.cjs +1 -1
  92. package/dist/community.client.js +209 -202
  93. package/dist/events.client.cjs +2 -2
  94. package/dist/events.client.js +24 -27
  95. package/dist/landing.client.cjs +1 -1
  96. package/dist/landing.client.js +64 -40
  97. package/dist/leftovers-86e7d438.mjs +67 -0
  98. package/dist/leftovers-c9f70579.js +1 -0
  99. package/dist/legal.client.cjs +1 -1
  100. package/dist/legal.client.js +6 -7
  101. package/dist/memberships-559590ad.mjs +68 -0
  102. package/dist/memberships-58af22e0.js +1 -0
  103. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -1
  104. package/dist/orders-1325c51b.js +1 -0
  105. package/dist/orders-c7cbe706.mjs +85 -0
  106. package/dist/organizations-71777b32.js +1 -0
  107. package/dist/organizations-93f7b610.mjs +122 -0
  108. package/dist/organizations.client-6ca27fb3.js +3 -0
  109. package/dist/organizations.client-bd63a7b2.mjs +2997 -0
  110. package/dist/organizations.client.cjs +1 -1
  111. package/dist/organizations.client.js +56 -61
  112. package/dist/products-61d83d74.js +1 -0
  113. package/dist/products-7f1e5a75.mjs +108 -0
  114. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -2
  116. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  117. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -72
  118. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
  120. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  121. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
  122. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  124. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  126. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
  127. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +61 -2
  128. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
  129. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -61
  130. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  134. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  136. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +24 -21
  138. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  140. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  142. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  144. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  146. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  148. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  150. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  152. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  154. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  156. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  160. package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.js +1 -1
  162. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  164. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  166. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  168. package/dist/reports-a67b4fb4.js +1 -0
  169. package/dist/reports-c579b02a.mjs +91 -0
  170. package/dist/reports.client.cjs +1 -1
  171. package/dist/reports.client.js +2 -2
  172. package/dist/states.validation-3b4604bc.mjs +13 -0
  173. package/dist/states.validation-9b43a097.js +1 -0
  174. package/dist/style.css +1 -1
  175. package/dist/users.client.cjs +1 -1
  176. package/dist/users.client.js +279 -208
  177. package/package.json +1 -1
  178. package/src/components/Search/Search.vue +1 -1
  179. package/src/components/Status/Status.vue +1 -1
  180. package/src/modules/backoffice/components/admin/Backcalls.vue +1 -1
  181. package/src/modules/backoffice/components/admin/Categories.vue +1 -1
  182. package/src/modules/backoffice/components/admin/CategoryEdit.vue +1 -1
  183. package/src/modules/backoffice/components/admin/Dashboard.vue +1 -1
  184. package/src/modules/backoffice/components/admin/FastOrders.vue +1 -1
  185. package/src/modules/backoffice/components/admin/PageEdit.vue +1 -1
  186. package/src/modules/backoffice/components/admin/Pages.vue +1 -1
  187. package/src/modules/backoffice/components/admin/User.vue +1 -1
  188. package/src/modules/backoffice/components/admin/Users.vue +1 -1
  189. package/src/modules/events/components/pages/Events.vue +2 -2
  190. package/src/modules/orders/components/blocks/Positions.vue +1 -1
  191. package/src/modules/orders/components/pages/ViewOrder.vue +1 -1
  192. package/src/modules/products/components/sections/ProductInformationSection.vue +2 -5
@@ -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 "./auth-7e39361f.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
+ &emsp;text: 'My tag value', &#47;* The visible text on display *&#47;
130
+ &emsp;style: 'background-color: #ccc', &#47;* Adding inline styles is possible *&#47;
131
+ &emsp;classes: 'custom-class another', &#47;* The value will be added as css classes *&#47;
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
+ &ensp;classes: 'class', &#47;* css class *&#47;
280
+ &ensp;rule: /^([^0-9]*)$/, &#47;* RegExp *&#47;
281
+ }, {
282
+ &ensp;classes: 'no-braces', &#47;* css class *&#47;
283
+ &ensp;rule(text) { &#47;* function with text as param *&#47;
284
+ &ensp;&ensp;return text.indexOf('{') !== -1 || text.indexOf('}') !== -1;
285
+ &ensp;},
286
+ &ensp;disableAdd: true, &#47;* if the rule matches, the item cannot be added *&#47;,
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
+ &ensp;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
+ };