@quoreadmin/ui 1.4.8 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +59 -57
  3. package/dist/index10.js +234 -45
  4. package/dist/index100.js +10 -0
  5. package/dist/index102.js +39 -0
  6. package/dist/{index101.js → index104.js} +2 -2
  7. package/dist/{index103.js → index106.js} +1 -1
  8. package/dist/{index105.js → index108.js} +4 -4
  9. package/dist/index11.js +50 -178
  10. package/dist/{index107.js → index110.js} +7 -7
  11. package/dist/{index109.js → index112.js} +1 -1
  12. package/dist/{index111.js → index114.js} +5 -5
  13. package/dist/{index115.js → index118.js} +1 -1
  14. package/dist/index12.js +174 -65
  15. package/dist/{index123.js → index126.js} +2 -2
  16. package/dist/{index125.js → index128.js} +1 -1
  17. package/dist/index13.js +70 -28
  18. package/dist/{index129.js → index132.js} +1 -1
  19. package/dist/{index133.js → index136.js} +113 -112
  20. package/dist/{index135.js → index138.js} +9 -9
  21. package/dist/index14.js +29 -187
  22. package/dist/{index137.js → index140.js} +11 -11
  23. package/dist/{index145.js → index148.js} +1 -1
  24. package/dist/index15.js +180 -128
  25. package/dist/{index147.js → index150.js} +1 -1
  26. package/dist/{index149.js → index152.js} +2 -2
  27. package/dist/index154.js +205 -111
  28. package/dist/index157.js +110 -87
  29. package/dist/index158.js +478 -844
  30. package/dist/index159.js +5520 -36
  31. package/dist/index16.js +123 -303
  32. package/dist/index160.js +90 -279
  33. package/dist/index161.js +833 -122
  34. package/dist/index162.js +36 -1197
  35. package/dist/index163.js +268 -760
  36. package/dist/index164.js +146 -1304
  37. package/dist/index165.js +1151 -228
  38. package/dist/index166.js +754 -88
  39. package/dist/index167.js +1308 -2
  40. package/dist/index168.js +259 -1359
  41. package/dist/index169.js +108 -0
  42. package/dist/index17.js +314 -21
  43. package/dist/index170.js +2 -18
  44. package/dist/index171.js +1372 -14
  45. package/dist/index173.js +8 -8
  46. package/dist/index174.js +10 -17
  47. package/dist/index175.js +18 -759
  48. package/dist/index176.js +18 -1100
  49. package/dist/index177.js +22 -1231
  50. package/dist/index178.js +740 -11258
  51. package/dist/index179.js +1100 -36
  52. package/dist/index18.js +20 -43
  53. package/dist/index180.js +1200 -81
  54. package/dist/index181.js +11276 -43
  55. package/dist/index182.js +36 -1190
  56. package/dist/{index91.js → index183.js} +4 -4
  57. package/dist/index184.js +44 -5938
  58. package/dist/index185.js +5830 -99
  59. package/dist/index186.js +188 -16
  60. package/dist/index187.js +25 -8
  61. package/dist/index188.js +16 -76
  62. package/dist/index189.js +1172 -235
  63. package/dist/index19.js +44 -49
  64. package/dist/index191.js +77 -26
  65. package/dist/index192.js +245 -55
  66. package/dist/index193.js +13655 -209
  67. package/dist/index194.js +26 -307
  68. package/dist/index195.js +43 -268
  69. package/dist/index196.js +231 -81
  70. package/dist/index197.js +288 -387
  71. package/dist/index198.js +287 -21
  72. package/dist/index199.js +84 -29
  73. package/dist/index2.js +2 -2
  74. package/dist/index20.js +49 -31
  75. package/dist/index200.js +400 -109
  76. package/dist/index201.js +22 -36
  77. package/dist/index202.js +33 -26
  78. package/dist/index203.js +111 -31
  79. package/dist/index204.js +36 -9
  80. package/dist/index205.js +26 -19
  81. package/dist/index206.js +36 -10
  82. package/dist/index207.js +9 -10
  83. package/dist/index208.js +18 -50
  84. package/dist/index209.js +10 -43
  85. package/dist/index21.js +32 -65
  86. package/dist/index210.js +10 -4
  87. package/dist/index211.js +48 -36
  88. package/dist/index212.js +43 -21
  89. package/dist/index213.js +3 -160
  90. package/dist/index214.js +38 -19
  91. package/dist/index215.js +21 -20
  92. package/dist/index216.js +160 -21
  93. package/dist/index217.js +218 -189
  94. package/dist/index218.js +36 -69
  95. package/dist/index219.js +10 -34
  96. package/dist/index22.js +61 -170
  97. package/dist/index220.js +123 -36
  98. package/dist/index221.js +37 -21
  99. package/dist/index222.js +80 -22
  100. package/dist/index223.js +10 -10
  101. package/dist/index224.js +20 -836
  102. package/dist/index225.js +19 -701
  103. package/dist/index226.js +19 -175
  104. package/dist/index227.js +11 -11
  105. package/dist/index228.js +14 -12
  106. package/dist/index229.js +6 -6
  107. package/dist/index23.js +173 -10
  108. package/dist/index230.js +7 -7
  109. package/dist/index231.js +836 -20
  110. package/dist/index232.js +702 -3
  111. package/dist/index233.js +172 -183
  112. package/dist/index234.js +21 -132
  113. package/dist/index235.js +20 -1223
  114. package/dist/index236.js +19 -126
  115. package/dist/index237.js +3 -20
  116. package/dist/index238.js +186 -21
  117. package/dist/index239.js +132 -21
  118. package/dist/index24.js +9 -38
  119. package/dist/index240.js +148 -25
  120. package/dist/index241.js +1223 -29
  121. package/dist/index242.js +12 -12
  122. package/dist/index243.js +15 -13
  123. package/dist/index244.js +20 -2
  124. package/dist/index245.js +22 -2
  125. package/dist/index246.js +29 -3632
  126. package/dist/index247.js +20 -55
  127. package/dist/index248.js +20 -77
  128. package/dist/index249.js +2 -52
  129. package/dist/index25.js +36 -116
  130. package/dist/index250.js +2 -215
  131. package/dist/index251.js +3631 -9
  132. package/dist/index252.js +37 -39
  133. package/dist/index253.js +60 -44
  134. package/dist/index254.js +34 -36
  135. package/dist/index255.js +184 -44
  136. package/dist/index256.js +9 -722
  137. package/dist/index257.js +39 -21
  138. package/dist/index258.js +44 -47
  139. package/dist/index259.js +53 -10
  140. package/dist/index26.js +116 -22
  141. package/dist/index260.js +66 -696
  142. package/dist/index261.js +706 -803
  143. package/dist/index262.js +38 -160
  144. package/dist/index263.js +61 -225
  145. package/dist/index264.js +11 -37
  146. package/dist/index265.js +704 -9
  147. package/dist/index266.js +819 -79
  148. package/dist/index267.js +15 -13
  149. package/dist/index268.js +198 -19
  150. package/dist/index269.js +65 -248
  151. package/dist/index27.js +24 -158
  152. package/dist/index270.js +31 -5
  153. package/dist/index271.js +36 -134
  154. package/dist/index272.js +232 -62
  155. package/dist/index273.js +7 -53
  156. package/dist/index274.js +118 -59
  157. package/dist/index275.js +83 -26
  158. package/dist/index276.js +3 -22
  159. package/dist/index277.js +26 -21
  160. package/dist/index278.js +2 -16
  161. package/dist/index279.js +78 -16
  162. package/dist/index28.js +141 -264
  163. package/dist/index280.js +77 -21
  164. package/dist/index281.js +22 -3
  165. package/dist/index282.js +932 -24
  166. package/dist/index283.js +22 -1518
  167. package/dist/index284.js +20 -386
  168. package/dist/index285.js +20 -2731
  169. package/dist/index286.js +67 -84
  170. package/dist/index287.js +19 -3770
  171. package/dist/index288.js +19 -60
  172. package/dist/index289.js +38 -63
  173. package/dist/index29.js +279 -62
  174. package/dist/index290.js +16 -16
  175. package/dist/index291.js +22 -935
  176. package/dist/index292.js +63 -22
  177. package/dist/index293.js +234 -19
  178. package/dist/index294.js +5 -19
  179. package/dist/index295.js +128 -63
  180. package/dist/index296.js +68 -19
  181. package/dist/index297.js +85 -17
  182. package/dist/index298.js +28 -21
  183. package/dist/index299.js +7 -20
  184. package/dist/index3.js +2 -2
  185. package/dist/index30.js +64 -178
  186. package/dist/index300.js +75 -63
  187. package/dist/index301.js +4 -2
  188. package/dist/index302.js +2 -15
  189. package/dist/index303.js +76 -77
  190. package/dist/index304.js +52 -200
  191. package/dist/index305.js +4 -244
  192. package/dist/index306.js +4 -234
  193. package/dist/index307.js +178 -5
  194. package/dist/index308.js +56 -127
  195. package/dist/index309.js +75 -68
  196. package/dist/index31.js +177 -38
  197. package/dist/index310.js +1509 -78
  198. package/dist/index311.js +383 -26
  199. package/dist/index312.js +2731 -9
  200. package/dist/index313.js +83 -72
  201. package/dist/index314.js +3769 -3
  202. package/dist/index315.js +60 -2
  203. package/dist/index316.js +15 -83
  204. package/dist/index317.js +83 -53
  205. package/dist/index318.js +200 -4
  206. package/dist/index319.js +245 -4
  207. package/dist/index32.js +38 -49
  208. package/dist/index320.js +25 -178
  209. package/dist/index321.js +21 -62
  210. package/dist/index322.js +22 -75
  211. package/dist/index323.js +15 -36
  212. package/dist/index324.js +17 -9
  213. package/dist/index325.js +23 -13
  214. package/dist/index326.js +8 -54
  215. package/dist/index327.js +12 -11
  216. package/dist/index328.js +52 -11
  217. package/dist/index329.js +9 -55
  218. package/dist/index33.js +47 -30
  219. package/dist/index330.js +13 -51
  220. package/dist/index331.js +51 -24
  221. package/dist/index332.js +52 -2
  222. package/dist/index333.js +31 -5
  223. package/dist/index334.js +2 -2
  224. package/dist/index335.js +4 -22
  225. package/dist/index336.js +2 -41
  226. package/dist/index337.js +23 -2
  227. package/dist/index338.js +40 -10
  228. package/dist/index339.js +2 -20
  229. package/dist/index34.js +31 -28
  230. package/dist/index340.js +10 -16
  231. package/dist/index341.js +20 -10
  232. package/dist/index342.js +16 -9
  233. package/dist/index343.js +10 -2
  234. package/dist/index344.js +9 -8
  235. package/dist/index345.js +2 -10
  236. package/dist/index346.js +8 -13
  237. package/dist/index347.js +9 -19
  238. package/dist/index348.js +14 -20
  239. package/dist/index349.js +33 -60
  240. package/dist/index35.js +29 -13
  241. package/dist/index350.js +20 -37
  242. package/dist/index351.js +19 -20
  243. package/dist/index352.js +61 -53
  244. package/dist/index353.js +37 -29
  245. package/dist/index354.js +20 -6
  246. package/dist/index355.js +53 -49
  247. package/dist/index356.js +29 -6
  248. package/dist/index357.js +6 -11
  249. package/dist/index358.js +49 -4
  250. package/dist/index359.js +5 -27
  251. package/dist/index36.js +15 -43
  252. package/dist/index360.js +12 -2
  253. package/dist/index361.js +6 -69
  254. package/dist/index362.js +27 -166
  255. package/dist/index363.js +2 -17
  256. package/dist/index364.js +69 -100
  257. package/dist/index365.js +167 -91
  258. package/dist/index366.js +16 -97
  259. package/dist/index367.js +1 -1
  260. package/dist/index368.js +3 -3
  261. package/dist/index37.js +42 -37
  262. package/dist/index371.js +3 -3
  263. package/dist/index373.js +1 -1
  264. package/dist/index375.js +3 -3
  265. package/dist/index376.js +8 -8
  266. package/dist/index377.js +3 -3
  267. package/dist/index379.js +100 -2
  268. package/dist/index38.js +36 -26
  269. package/dist/index380.js +91 -2
  270. package/dist/index381.js +98 -2
  271. package/dist/index382.js +3 -17
  272. package/dist/index383.js +2 -13
  273. package/dist/index384.js +2 -6
  274. package/dist/index385.js +17 -32
  275. package/dist/index386.js +15 -0
  276. package/dist/index387.js +8 -0
  277. package/dist/index388.js +34 -0
  278. package/dist/index39.js +25 -32
  279. package/dist/index4.js +2 -2
  280. package/dist/index40.js +32 -37
  281. package/dist/index41.js +37 -1068
  282. package/dist/index42.js +1045 -309
  283. package/dist/index43.js +326 -146
  284. package/dist/index44.js +155 -18
  285. package/dist/index45.js +16 -36
  286. package/dist/index46.js +38 -68
  287. package/dist/index47.js +67 -60
  288. package/dist/index48.js +56 -175
  289. package/dist/index49.js +173 -77
  290. package/dist/index5.js +2 -2
  291. package/dist/index50.js +79 -200
  292. package/dist/index51.js +206 -68
  293. package/dist/index52.js +69 -20
  294. package/dist/index53.js +20 -11
  295. package/dist/index54.js +10 -6
  296. package/dist/index55.js +5 -209
  297. package/dist/index56.js +210 -12
  298. package/dist/index57.js +12 -184
  299. package/dist/index58.js +176 -68
  300. package/dist/index59.js +79 -0
  301. package/dist/index6.js +2 -2
  302. package/dist/index61.js +7 -63
  303. package/dist/index62.js +65 -0
  304. package/dist/index7.js +2 -2
  305. package/dist/{index69.js → index70.js} +2 -2
  306. package/dist/index74.js +35 -78
  307. package/dist/index75.js +326 -0
  308. package/dist/index77.js +105 -0
  309. package/dist/{index76.js → index79.js} +7 -7
  310. package/dist/index8.js +3 -3
  311. package/dist/index81.js +77 -109
  312. package/dist/index83.js +22 -127
  313. package/dist/index84.js +140 -0
  314. package/dist/index86.js +141 -0
  315. package/dist/{index85.js → index88.js} +7 -7
  316. package/dist/index9.js +2 -2
  317. package/dist/{index89.js → index92.js} +1 -1
  318. package/dist/index94.js +105 -22
  319. package/dist/index96.js +16 -129
  320. package/dist/index97.js +30 -6
  321. package/dist/index99.js +128 -25
  322. package/dist/src/components/calendar/calendar.d.ts +290 -0
  323. package/dist/src/components/calendar/calendar.stories.d.ts +37 -0
  324. package/dist/src/components/calendar/calendar.vue.d.ts +2 -0
  325. package/dist/src/components/date-picker/date-picker.d.ts +2 -2
  326. package/dist/src/components/date-picker/date-picker.stories.d.ts +4 -4
  327. package/dist/src/components/grid/grid.stories.d.ts +10 -10
  328. package/dist/src/components/list/list.stories.d.ts +5 -5
  329. package/dist/src/components/modal/modal.stories.d.ts +5 -5
  330. package/dist/src/components/room-details-popover/room-details-popover.d.ts +3 -3
  331. package/dist/src/components/select/select.d.ts +6 -5
  332. package/dist/src/components/select/select.stories.d.ts +15 -15
  333. package/dist/src/components/textarea/textarea.d.ts +1 -1
  334. package/dist/src/components/textarea/textarea.stories.d.ts +1 -1
  335. package/dist/src/index.d.ts +2 -0
  336. package/package.json +1 -1
  337. package/dist/index151.js +0 -210
  338. package/dist/index155.js +0 -497
  339. package/dist/index156.js +0 -5524
  340. package/dist/index172.js +0 -20
  341. package/dist/index190.js +0 -13686
  342. package/dist/index60.js +0 -9
  343. package/dist/index73.js +0 -62
  344. package/dist/index78.js +0 -108
  345. package/dist/index80.js +0 -36
  346. package/dist/index93.js +0 -29
  347. /package/dist/{index113.js → index116.js} +0 -0
  348. /package/dist/{index117.js → index120.js} +0 -0
  349. /package/dist/{index119.js → index122.js} +0 -0
  350. /package/dist/{index121.js → index124.js} +0 -0
  351. /package/dist/{index127.js → index130.js} +0 -0
  352. /package/dist/{index131.js → index134.js} +0 -0
  353. /package/dist/{index139.js → index142.js} +0 -0
  354. /package/dist/{index141.js → index144.js} +0 -0
  355. /package/dist/{index143.js → index146.js} +0 -0
  356. /package/dist/{index63.js → index64.js} +0 -0
  357. /package/dist/{index65.js → index66.js} +0 -0
  358. /package/dist/{index67.js → index68.js} +0 -0
  359. /package/dist/{index71.js → index72.js} +0 -0
  360. /package/dist/{index87.js → index90.js} +0 -0
package/dist/index189.js CHANGED
@@ -1,255 +1,1192 @@
1
- import { Editor as p } from "./index246.js";
2
- import { CommandManager as y, Extendable as M, Extension as T, InputRule as F, MappablePosition as I, Mark as B, Node as O, NodePos as D, PasteRule as _, callOrReturn as j, canInsertNode as V, combineTransactionSteps as q, commands as z, createAtomBlockMarkdownSpec as L, createBlockMarkdownSpec as U, createChainableState as $, createDocument as H, createInlineMarkdownSpec as W, createMappablePosition as G, createNodeFromContent as J, createStyleTag as K, defaultBlockAt as Q, deleteProps as X, elementFromString as Y, extensions as Z, findChildrenInRange as ee, findDuplicates as te, findParentNode as ne, findParentNodeClosestToPos as re, flattenExtensions as ie, fromString as oe, getAttributes as ae, getAttributesFromExtensions as se, getChangedRanges as le, getExtensionField as de, getHTMLFromFragment as ue, getMarkAttributes as ce, getMarkRange as pe, getMarkType as ge, getMarksBetween as me, getNodeAtPosition as ve, getNodeAttributes as Se, getNodeType as he, getRenderedAttributes as xe, getSchemaByResolvedExtensions as fe, getSchemaTypeByName as we, getSchemaTypeNameByName as Ee, getSplittedAttributes as Ne, getText as be, getTextBetween as Ce, getTextContentFromNodes as ke, getTextSerializersFromSchema as Ae, getUpdatedPosition as Re, injectExtensionAttributesToParseRule as Pe, inputRulesPlugin as ye, isActive as Me, isAndroid as Te, isAtEndOfNode as Fe, isAtStartOfNode as Ie, isEmptyObject as Be, isExtensionRulesEnabled as Oe, isFunction as De, isList as _e, isMacOS as je, isMarkActive as Ve, isNodeActive as qe, isNodeEmpty as ze, isNodeSelection as Le, isNumber as Ue, isPlainObject as $e, isRegExp as He, isSafari as We, isTextSelection as Ge, isiOS as Je, markInputRule as Ke, markPasteRule as Qe, markdown as Xe, mergeAttributes as Ye, mergeDeep as Ze, minMax as et, nodeInputRule as tt, objectIncludes as nt, parseAttributes as rt, parseIndentedBlocks as it, pasteRulesPlugin as ot, removeDuplicates as at, renderNestedMarkdownContent as st, resolveExtensions as lt, resolveFocusPosition as dt, selectionToInsertionEnd as ut, serializeAttributes as ct, sortExtensions as pt, splitExtensions as gt, textblockTypeInputRule as mt, updateMarkViewAttributes as vt, wrappingInputRule as St } from "./index246.js";
3
- import { defineComponent as s, h as l, ref as g, getCurrentInstance as m, watchEffect as v, nextTick as S, unref as h, onBeforeUnmount as u, shallowRef as x, onMounted as f, markRaw as w, customRef as E } from "vue";
4
- function d(t) {
5
- return E((e, r) => ({
6
- get() {
7
- return e(), t;
8
- },
9
- set(n) {
10
- t = n, requestAnimationFrame(() => {
11
- requestAnimationFrame(() => {
12
- r();
13
- });
14
- });
15
- }
16
- }));
1
+ import { createElementBlock as d, openBlock as p, withKeys as f, normalizeClass as V, withModifiers as r, renderSlot as u, createElementVNode as o, createVNode as L, createCommentVNode as c, withDirectives as b, Fragment as $, renderList as B, toDisplayString as g, vShow as y, Transition as k, withCtx as D, normalizeStyle as O, createTextVNode as v } from "vue";
2
+ function S(e) {
3
+ return e === 0 ? !1 : Array.isArray(e) && e.length === 0 ? !0 : !e;
17
4
  }
18
- var N = class extends p {
19
- constructor(t = {}) {
20
- return super(t), this.contentComponent = null, this.appContext = null, this.reactiveState = d(this.view.state), this.reactiveExtensionStorage = d(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
21
- this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
22
- }), w(this);
23
- }
24
- get state() {
25
- return this.reactiveState ? this.reactiveState.value : this.view.state;
26
- }
27
- get storage() {
28
- return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage;
29
- }
30
- /**
31
- * Register a ProseMirror plugin.
32
- */
33
- registerPlugin(t, e) {
34
- const r = super.registerPlugin(t, e);
35
- return this.reactiveState && (this.reactiveState.value = r), r;
36
- }
37
- /**
38
- * Unregister a ProseMirror plugin.
39
- */
40
- unregisterPlugin(t) {
41
- const e = super.unregisterPlugin(t);
42
- return this.reactiveState && e && (this.reactiveState.value = e), e;
43
- }
44
- }, k = s({
45
- name: "EditorContent",
5
+ function T(e) {
6
+ return (...t) => !e(...t);
7
+ }
8
+ function A(e, t) {
9
+ return e === void 0 && (e = "undefined"), e === null && (e = "null"), e === !1 && (e = "false"), e.toString().toLowerCase().indexOf(t.trim()) !== -1;
10
+ }
11
+ function M(e) {
12
+ return e.filter((t) => !t.$isLabel);
13
+ }
14
+ function w(e, t) {
15
+ return (i) => i.reduce((l, a) => a[e] && a[e].length ? (l.push({
16
+ $groupLabel: a[t],
17
+ $isLabel: !0
18
+ }), l.concat(a[e])) : l, []);
19
+ }
20
+ const E = (...e) => (t) => e.reduce((i, l) => l(i), t);
21
+ var P = {
22
+ data() {
23
+ return {
24
+ search: "",
25
+ isOpen: !1,
26
+ preferredOpenDirection: "below",
27
+ optimizedHeight: this.maxHeight
28
+ };
29
+ },
46
30
  props: {
47
- editor: {
48
- default: null,
49
- type: Object
31
+ /**
32
+ * Decide whether to filter the results based on search query.
33
+ * Useful for async filtering, where we search through more complex data.
34
+ * @type {Boolean}
35
+ */
36
+ internalSearch: {
37
+ type: Boolean,
38
+ default: !0
39
+ },
40
+ /**
41
+ * Array of available options: Objects, Strings or Integers.
42
+ * If array of objects, visible label will default to option.label.
43
+ * If `labal` prop is passed, label will equal option['label']
44
+ * @type {Array}
45
+ */
46
+ options: {
47
+ type: Array,
48
+ required: !0
49
+ },
50
+ /**
51
+ * Equivalent to the `multiple` attribute on a `<select>` input.
52
+ * @default false
53
+ * @type {Boolean}
54
+ */
55
+ multiple: {
56
+ type: Boolean,
57
+ default: !1
58
+ },
59
+ /**
60
+ * Key to compare objects
61
+ * @default 'id'
62
+ * @type {String}
63
+ */
64
+ trackBy: {
65
+ type: String
66
+ },
67
+ /**
68
+ * Label to look for in option Object
69
+ * @default 'label'
70
+ * @type {String}
71
+ */
72
+ label: {
73
+ type: String
74
+ },
75
+ /**
76
+ * Enable/disable search in options
77
+ * @default true
78
+ * @type {Boolean}
79
+ */
80
+ searchable: {
81
+ type: Boolean,
82
+ default: !0
83
+ },
84
+ /**
85
+ * Clear the search input after `)
86
+ * @default true
87
+ * @type {Boolean}
88
+ */
89
+ clearOnSelect: {
90
+ type: Boolean,
91
+ default: !0
92
+ },
93
+ /**
94
+ * Hide already selected options
95
+ * @default false
96
+ * @type {Boolean}
97
+ */
98
+ hideSelected: {
99
+ type: Boolean,
100
+ default: !1
101
+ },
102
+ /**
103
+ * Equivalent to the `placeholder` attribute on a `<select>` input.
104
+ * @default 'Select option'
105
+ * @type {String}
106
+ */
107
+ placeholder: {
108
+ type: String,
109
+ default: "Select option"
110
+ },
111
+ /**
112
+ * Allow to remove all selected values
113
+ * @default true
114
+ * @type {Boolean}
115
+ */
116
+ allowEmpty: {
117
+ type: Boolean,
118
+ default: !0
119
+ },
120
+ /**
121
+ * Reset this.internalValue, this.search after this.internalValue changes.
122
+ * Useful if want to create a stateless dropdown.
123
+ * @default false
124
+ * @type {Boolean}
125
+ */
126
+ resetAfter: {
127
+ type: Boolean,
128
+ default: !1
129
+ },
130
+ /**
131
+ * Enable/disable closing after selecting an option
132
+ * @default true
133
+ * @type {Boolean}
134
+ */
135
+ closeOnSelect: {
136
+ type: Boolean,
137
+ default: !0
138
+ },
139
+ /**
140
+ * Function to interpolate the custom label
141
+ * @default false
142
+ * @type {Function}
143
+ */
144
+ customLabel: {
145
+ type: Function,
146
+ default(e, t) {
147
+ return S(e) ? "" : t ? e[t] : e;
148
+ }
149
+ },
150
+ /**
151
+ * Disable / Enable tagging
152
+ * @default false
153
+ * @type {Boolean}
154
+ */
155
+ taggable: {
156
+ type: Boolean,
157
+ default: !1
158
+ },
159
+ /**
160
+ * String to show when highlighting a potential tag
161
+ * @default 'Press enter to create a tag'
162
+ * @type {String}
163
+ */
164
+ tagPlaceholder: {
165
+ type: String,
166
+ default: "Press enter to create a tag"
167
+ },
168
+ /**
169
+ * By default new tags will appear above the search results.
170
+ * Changing to 'bottom' will revert this behaviour
171
+ * and will proritize the search results
172
+ * @default 'top'
173
+ * @type {String}
174
+ */
175
+ tagPosition: {
176
+ type: String,
177
+ default: "top"
178
+ },
179
+ /**
180
+ * Number of allowed selected options. No limit if 0.
181
+ * @default 0
182
+ * @type {Number}
183
+ */
184
+ max: {
185
+ type: [Number, Boolean],
186
+ default: !1
187
+ },
188
+ /**
189
+ * Will be passed with all events as second param.
190
+ * Useful for identifying events origin.
191
+ * @default null
192
+ * @type {String|Integer}
193
+ */
194
+ id: {
195
+ default: null
196
+ },
197
+ /**
198
+ * Limits the options displayed in the dropdown
199
+ * to the first X options.
200
+ * @default 1000
201
+ * @type {Integer}
202
+ */
203
+ optionsLimit: {
204
+ type: Number,
205
+ default: 1e3
206
+ },
207
+ /**
208
+ * Name of the property containing
209
+ * the group values
210
+ * @default 1000
211
+ * @type {String}
212
+ */
213
+ groupValues: {
214
+ type: String
215
+ },
216
+ /**
217
+ * Name of the property containing
218
+ * the group label
219
+ * @default 1000
220
+ * @type {String}
221
+ */
222
+ groupLabel: {
223
+ type: String
224
+ },
225
+ /**
226
+ * Allow to select all group values
227
+ * by selecting the group label
228
+ * @default false
229
+ * @type {Boolean}
230
+ */
231
+ groupSelect: {
232
+ type: Boolean,
233
+ default: !1
234
+ },
235
+ /**
236
+ * Array of keyboard keys to block
237
+ * when selecting
238
+ * @default 1000
239
+ * @type {String}
240
+ */
241
+ blockKeys: {
242
+ type: Array,
243
+ default() {
244
+ return [];
245
+ }
246
+ },
247
+ /**
248
+ * Prevent from wiping up the search value
249
+ * @default false
250
+ * @type {Boolean}
251
+ */
252
+ preserveSearch: {
253
+ type: Boolean,
254
+ default: !1
255
+ },
256
+ /**
257
+ * Select 1st options if value is empty
258
+ * @default false
259
+ * @type {Boolean}
260
+ */
261
+ preselectFirst: {
262
+ type: Boolean,
263
+ default: !1
264
+ },
265
+ /**
266
+ * Prevent autofocus
267
+ * @default false
268
+ * @type {Boolean}
269
+ */
270
+ preventAutofocus: {
271
+ type: Boolean,
272
+ default: !1
273
+ },
274
+ /**
275
+ * Allows a custom function for sorting search/filtered results.
276
+ * @default null
277
+ * @type {Function}
278
+ */
279
+ filteringSortFunc: {
280
+ type: Function,
281
+ default: null
50
282
  }
51
283
  },
52
- setup(t) {
53
- const e = g(), r = m();
54
- return v(() => {
55
- const n = t.editor;
56
- n && n.options.element && e.value && S(() => {
57
- var i;
58
- if (!e.value || !((i = n.view.dom) != null && i.parentNode))
59
- return;
60
- const a = h(e.value);
61
- e.value.append(...n.view.dom.parentNode.childNodes), n.contentComponent = r.ctx._, r && (n.appContext = {
62
- ...r.appContext,
63
- // Vue internally uses prototype chain to forward/shadow injects across the entire component chain
64
- // so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext
65
- // @ts-expect-error forward instance's 'provides' into appContext
66
- provides: r.provides
67
- }), n.setOptions({
68
- element: a
69
- }), n.createNodeViews();
70
- });
71
- }), u(() => {
72
- const n = t.editor;
73
- n && (n.contentComponent = null, n.appContext = null);
74
- }), { rootEl: e };
284
+ mounted() {
285
+ !this.multiple && this.max && console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."), this.preselectFirst && !this.internalValue.length && this.options.length && this.select(this.filteredOptions[0]);
75
286
  },
76
- render() {
77
- return l("div", {
78
- ref: (t) => {
79
- this.rootEl = t;
80
- }
81
- });
82
- }
83
- });
84
- s({
85
- name: "NodeViewContent",
86
- props: {
87
- as: {
88
- type: String,
89
- default: "div"
287
+ computed: {
288
+ internalValue() {
289
+ return this.modelValue || this.modelValue === 0 ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] : [];
290
+ },
291
+ filteredOptions() {
292
+ const e = this.search || "", t = e.toLowerCase().trim();
293
+ let i = this.options.concat();
294
+ return this.internalSearch ? i = this.groupValues ? this.filterAndFlat(i, t, this.label) : this.filterOptions(i, t, this.label, this.customLabel) : i = this.groupValues ? w(this.groupValues, this.groupLabel)(i) : i, i = this.hideSelected ? i.filter(T(this.isSelected)) : i, this.taggable && t.length && !this.isExistingOption(t) && (this.tagPosition === "bottom" ? i.push({ isTag: !0, label: e }) : i.unshift({ isTag: !0, label: e })), i.slice(0, this.optionsLimit);
295
+ },
296
+ valueKeys() {
297
+ return this.trackBy ? this.internalValue.map((e) => e[this.trackBy]) : this.internalValue;
298
+ },
299
+ optionKeys() {
300
+ return (this.groupValues ? this.flatAndStrip(this.options) : this.options).map((t) => this.customLabel(t, this.label).toString().toLowerCase());
301
+ },
302
+ currentOptionLabel() {
303
+ return this.multiple ? this.searchable ? "" : this.placeholder : this.internalValue.length ? this.getOptionLabel(this.internalValue[0]) : this.searchable ? "" : this.placeholder;
90
304
  }
91
305
  },
92
- render() {
93
- return l(this.as, {
94
- style: {
95
- whiteSpace: "pre-wrap"
306
+ watch: {
307
+ internalValue: {
308
+ handler() {
309
+ this.resetAfter && this.internalValue.length && (this.search = "", this.$emit("update:modelValue", this.multiple ? [] : null));
96
310
  },
97
- "data-node-view-content": ""
98
- });
311
+ deep: !0
312
+ },
313
+ search() {
314
+ this.$emit("search-change", this.search);
315
+ }
316
+ },
317
+ emits: ["open", "search-change", "close", "select", "update:modelValue", "remove", "tag"],
318
+ methods: {
319
+ /**
320
+ * Returns the internalValue in a way it can be emited to the parent
321
+ * @returns {Object||Array||String||Integer}
322
+ */
323
+ getValue() {
324
+ return this.multiple ? this.internalValue : this.internalValue.length === 0 ? null : this.internalValue[0];
325
+ },
326
+ /**
327
+ * Filters and then flattens the options list
328
+ * @param {Array}
329
+ * @return {Array} returns a filtered and flat options list
330
+ */
331
+ filterAndFlat(e, t, i) {
332
+ return E(
333
+ this.filterGroups(t, i, this.groupValues, this.groupLabel, this.customLabel),
334
+ w(this.groupValues, this.groupLabel)
335
+ )(e);
336
+ },
337
+ /**
338
+ * Flattens and then strips the group labels from the options list
339
+ * @param {Array}
340
+ * @return {Array} returns a flat options list without group labels
341
+ */
342
+ flatAndStrip(e) {
343
+ return E(
344
+ w(this.groupValues, this.groupLabel),
345
+ M
346
+ )(e);
347
+ },
348
+ /**
349
+ * Updates the search value
350
+ * @param {String}
351
+ */
352
+ updateSearch(e) {
353
+ this.search = e;
354
+ },
355
+ /**
356
+ * Finds out if the given query is already present
357
+ * in the available options
358
+ * @param {String}
359
+ * @return {Boolean} returns true if element is available
360
+ */
361
+ isExistingOption(e) {
362
+ return this.options ? this.optionKeys.indexOf(e) > -1 : !1;
363
+ },
364
+ /**
365
+ * Finds out if the given element is already present
366
+ * in the result value
367
+ * @param {Object||String||Integer} option passed element to check
368
+ * @returns {Boolean} returns true if element is selected
369
+ */
370
+ isSelected(e) {
371
+ const t = this.trackBy ? e[this.trackBy] : e;
372
+ return this.valueKeys.indexOf(t) > -1;
373
+ },
374
+ /**
375
+ * Finds out if the given option is disabled
376
+ * @param {Object||String||Integer} option passed element to check
377
+ * @returns {Boolean} returns true if element is disabled
378
+ */
379
+ isOptionDisabled(e) {
380
+ return !!e.$isDisabled;
381
+ },
382
+ /**
383
+ * Returns empty string when options is null/undefined
384
+ * Returns tag query if option is tag.
385
+ * Returns the customLabel() results and casts it to string.
386
+ *
387
+ * @param {Object||String||Integer} Passed option
388
+ * @returns {Object||String}
389
+ */
390
+ getOptionLabel(e) {
391
+ if (S(e)) return "";
392
+ if (e.isTag) return e.label;
393
+ if (e.$isLabel) return e.$groupLabel;
394
+ const t = this.customLabel(e, this.label);
395
+ return S(t) ? "" : t;
396
+ },
397
+ /**
398
+ * Add the given option to the list of selected options
399
+ * or sets the option as the selected option.
400
+ * If option is already selected -> remove it from the results.
401
+ *
402
+ * @param {Object||String||Integer} option to select/deselect
403
+ * @param {Boolean} block removing
404
+ */
405
+ select(e, t) {
406
+ if (e.$isLabel && this.groupSelect) {
407
+ this.selectGroup(e);
408
+ return;
409
+ }
410
+ if (!(this.blockKeys.indexOf(t) !== -1 || this.disabled || e.$isDisabled || e.$isLabel) && !(this.max && this.multiple && this.internalValue.length === this.max) && !(t === "Tab" && !this.pointerDirty)) {
411
+ if (e.isTag)
412
+ this.$emit("tag", e.label, this.id), this.search = "", this.closeOnSelect && !this.multiple && this.deactivate();
413
+ else {
414
+ if (this.isSelected(e)) {
415
+ t !== "Tab" && this.removeElement(e);
416
+ return;
417
+ }
418
+ this.multiple ? this.$emit("update:modelValue", this.internalValue.concat([e])) : this.$emit("update:modelValue", e), this.$emit("select", e, this.id), this.clearOnSelect && (this.search = "");
419
+ }
420
+ this.closeOnSelect && this.deactivate();
421
+ }
422
+ },
423
+ /**
424
+ * Add the given group options to the list of selected options
425
+ * If all group optiona are already selected -> remove it from the results.
426
+ *
427
+ * @param {Object||String||Integer} group to select/deselect
428
+ */
429
+ selectGroup(e) {
430
+ const t = this.options.find((i) => i[this.groupLabel] === e.$groupLabel);
431
+ if (t) {
432
+ if (this.wholeGroupSelected(t)) {
433
+ this.$emit("remove", t[this.groupValues], this.id);
434
+ const i = this.trackBy ? t[this.groupValues].map((a) => a[this.trackBy]) : t[this.groupValues], l = this.internalValue.filter(
435
+ (a) => i.indexOf(this.trackBy ? a[this.trackBy] : a) === -1
436
+ );
437
+ this.$emit("update:modelValue", l);
438
+ } else {
439
+ const i = t[this.groupValues].filter(
440
+ (l) => !(this.isOptionDisabled(l) || this.isSelected(l))
441
+ );
442
+ this.max && i.splice(this.max - this.internalValue.length), this.$emit("select", i, this.id), this.$emit(
443
+ "update:modelValue",
444
+ this.internalValue.concat(i)
445
+ );
446
+ }
447
+ this.closeOnSelect && this.deactivate();
448
+ }
449
+ },
450
+ /**
451
+ * Helper to identify if all values in a group are selected
452
+ *
453
+ * @param {Object} group to validated selected values against
454
+ */
455
+ wholeGroupSelected(e) {
456
+ return e[this.groupValues].every(
457
+ (t) => this.isSelected(t) || this.isOptionDisabled(t)
458
+ );
459
+ },
460
+ /**
461
+ * Helper to identify if all values in a group are disabled
462
+ *
463
+ * @param {Object} group to check for disabled values
464
+ */
465
+ wholeGroupDisabled(e) {
466
+ return e[this.groupValues].every(this.isOptionDisabled);
467
+ },
468
+ /**
469
+ * Removes the given option from the selected options.
470
+ * Additionally checks this.allowEmpty prop if option can be removed when
471
+ * it is the last selected option.
472
+ *
473
+ * @param {type} option description
474
+ * @return {type} description
475
+ */
476
+ removeElement(e, t = !0) {
477
+ if (this.disabled || e.$isDisabled) return;
478
+ if (!this.allowEmpty && this.internalValue.length <= 1) {
479
+ this.deactivate();
480
+ return;
481
+ }
482
+ const i = typeof e == "object" ? this.valueKeys.indexOf(e[this.trackBy]) : this.valueKeys.indexOf(e);
483
+ if (this.multiple) {
484
+ const l = this.internalValue.slice(0, i).concat(this.internalValue.slice(i + 1));
485
+ this.$emit("update:modelValue", l);
486
+ } else
487
+ this.$emit("update:modelValue", null);
488
+ this.$emit("remove", e, this.id), this.closeOnSelect && t && this.deactivate();
489
+ },
490
+ /**
491
+ * Calls this.removeElement() with the last element
492
+ * from this.internalValue (selected element Array)
493
+ *
494
+ * @fires this#removeElement
495
+ */
496
+ removeLastElement() {
497
+ this.blockKeys.indexOf("Delete") === -1 && this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length && this.removeElement(this.internalValue[this.internalValue.length - 1], !1);
498
+ },
499
+ /**
500
+ * Opens the multiselect’s dropdown.
501
+ * Sets this.isOpen to TRUE
502
+ */
503
+ activate() {
504
+ this.isOpen || this.disabled || (this.adjustPosition(), this.groupValues && this.pointer === 0 && this.filteredOptions.length && (this.pointer = 1), this.isOpen = !0, this.searchable ? (this.preserveSearch || (this.search = ""), this.preventAutofocus || this.$nextTick(() => this.$refs.search && this.$refs.search.focus())) : this.preventAutofocus || typeof this.$el < "u" && this.$el.focus(), this.$emit("open", this.id));
505
+ },
506
+ /**
507
+ * Closes the multiselect’s dropdown.
508
+ * Sets this.isOpen to FALSE
509
+ */
510
+ deactivate() {
511
+ this.isOpen && (this.isOpen = !1, this.searchable ? this.$refs.search !== null && typeof this.$refs.search < "u" && this.$refs.search.blur() : typeof this.$el < "u" && this.$el.blur(), this.preserveSearch || (this.search = ""), this.$emit("close", this.getValue(), this.id));
512
+ },
513
+ /**
514
+ * Call this.activate() or this.deactivate()
515
+ * depending on this.isOpen value.
516
+ *
517
+ * @fires this#activate || this#deactivate
518
+ * @property {Boolean} isOpen indicates if dropdown is open
519
+ */
520
+ toggle() {
521
+ this.isOpen ? this.deactivate() : this.activate();
522
+ },
523
+ /**
524
+ * Updates the hasEnoughSpace variable used for
525
+ * detecting where to expand the dropdown
526
+ */
527
+ adjustPosition() {
528
+ if (typeof window > "u") return;
529
+ const e = this.$el.getBoundingClientRect().top, t = window.innerHeight - this.$el.getBoundingClientRect().bottom;
530
+ t > this.maxHeight || t > e || this.openDirection === "below" || this.openDirection === "bottom" ? (this.preferredOpenDirection = "below", this.optimizedHeight = Math.min(t - 40, this.maxHeight)) : (this.preferredOpenDirection = "above", this.optimizedHeight = Math.min(e - 40, this.maxHeight));
531
+ },
532
+ /**
533
+ * Filters and sorts the options ready for selection
534
+ * @param {Array} options
535
+ * @param {String} search
536
+ * @param {String} label
537
+ * @param {Function} customLabel
538
+ * @returns {Array}
539
+ */
540
+ filterOptions(e, t, i, l) {
541
+ return t ? e.filter((a) => A(l(a, i), t)).sort((a, n) => typeof this.filteringSortFunc == "function" ? this.filteringSortFunc(a, n) : l(a, i).length - l(n, i).length) : e;
542
+ },
543
+ /**
544
+ *
545
+ * @param {String} search
546
+ * @param {String} label
547
+ * @param {String} values
548
+ * @param {String} groupLabel
549
+ * @param {function} customLabel
550
+ * @returns {function(*): *}
551
+ */
552
+ filterGroups(e, t, i, l, a) {
553
+ return (n) => n.map((s) => {
554
+ if (!s[i])
555
+ return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."), [];
556
+ const h = this.filterOptions(s[i], e, t, a);
557
+ return h.length ? {
558
+ [l]: s[l],
559
+ [i]: h
560
+ } : [];
561
+ });
562
+ }
99
563
  }
100
- });
101
- s({
102
- name: "NodeViewWrapper",
564
+ }, F = {
565
+ data() {
566
+ return {
567
+ pointer: 0,
568
+ pointerDirty: !1
569
+ };
570
+ },
103
571
  props: {
104
- as: {
105
- type: String,
106
- default: "div"
572
+ /**
573
+ * Enable/disable highlighting of the pointed value.
574
+ * @type {Boolean}
575
+ * @default true
576
+ */
577
+ showPointer: {
578
+ type: Boolean,
579
+ default: !0
580
+ },
581
+ optionHeight: {
582
+ type: Number,
583
+ default: 40
107
584
  }
108
585
  },
109
- inject: ["onDragStart", "decorationClasses"],
110
- render() {
111
- var t, e;
112
- return l(
113
- this.as,
114
- {
115
- // @ts-ignore
116
- class: this.decorationClasses,
117
- style: {
118
- whiteSpace: "normal"
119
- },
120
- "data-node-view-wrapper": "",
121
- // @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
122
- onDragstart: this.onDragStart
123
- },
124
- (e = (t = this.$slots).default) == null ? void 0 : e.call(t)
125
- );
586
+ computed: {
587
+ pointerPosition() {
588
+ return this.pointer * this.optionHeight;
589
+ },
590
+ visibleElements() {
591
+ return this.optimizedHeight / this.optionHeight;
592
+ }
593
+ },
594
+ watch: {
595
+ filteredOptions() {
596
+ this.pointerAdjust();
597
+ },
598
+ isOpen() {
599
+ this.pointerDirty = !1;
600
+ },
601
+ pointer() {
602
+ this.$refs.search && this.$refs.search.setAttribute("aria-activedescendant", this.id + "-" + this.pointer.toString());
603
+ }
604
+ },
605
+ methods: {
606
+ optionHighlight(e, t) {
607
+ return {
608
+ "multiselect__option--highlight": e === this.pointer && this.showPointer,
609
+ "multiselect__option--selected": this.isSelected(t)
610
+ };
611
+ },
612
+ groupHighlight(e, t) {
613
+ if (!this.groupSelect)
614
+ return [
615
+ "multiselect__option--disabled",
616
+ { "multiselect__option--group": t.$isLabel }
617
+ ];
618
+ const i = this.options.find((l) => l[this.groupLabel] === t.$groupLabel);
619
+ return i && !this.wholeGroupDisabled(i) ? [
620
+ "multiselect__option--group",
621
+ { "multiselect__option--highlight": e === this.pointer && this.showPointer },
622
+ { "multiselect__option--group-selected": this.wholeGroupSelected(i) }
623
+ ] : "multiselect__option--disabled";
624
+ },
625
+ addPointerElement({ key: e } = "Enter") {
626
+ this.filteredOptions.length > 0 && this.select(this.filteredOptions[this.pointer], e), this.pointerReset();
627
+ },
628
+ pointerForward() {
629
+ this.pointer < this.filteredOptions.length - 1 && (this.pointer++, this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight && (this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward()), this.pointerDirty = !0;
630
+ },
631
+ pointerBackward() {
632
+ this.pointer > 0 ? (this.pointer--, this.$refs.list.scrollTop >= this.pointerPosition && (this.$refs.list.scrollTop = this.pointerPosition), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerBackward()) : this.filteredOptions[this.pointer] && this.filteredOptions[0].$isLabel && !this.groupSelect && this.pointerForward(), this.pointerDirty = !0;
633
+ },
634
+ pointerReset() {
635
+ this.closeOnSelect && (this.pointer = 0, this.$refs.list && (this.$refs.list.scrollTop = 0));
636
+ },
637
+ pointerAdjust() {
638
+ this.pointer >= this.filteredOptions.length - 1 && (this.pointer = this.filteredOptions.length ? this.filteredOptions.length - 1 : 0), this.filteredOptions.length > 0 && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward();
639
+ },
640
+ pointerSet(e) {
641
+ this.pointer = e, this.pointerDirty = !0;
642
+ }
126
643
  }
127
- });
128
- var A = (t = {}) => {
129
- const e = x();
130
- return f(() => {
131
- e.value = new N(t);
132
- }), u(() => {
133
- var r, n, i, a;
134
- const o = (n = (r = e.value) == null ? void 0 : r.view.dom) == null ? void 0 : n.parentNode, c = o?.cloneNode(!0);
135
- (i = o?.parentNode) == null || i.replaceChild(c, o), (a = e.value) == null || a.destroy();
136
- }), e;
137
- };
138
- s({
139
- name: "MarkViewContent",
644
+ }, G = {
645
+ name: "vue-multiselect",
646
+ mixins: [P, F],
647
+ compatConfig: {
648
+ MODE: 3,
649
+ ATTR_ENUMERATED_COERCION: !1
650
+ },
140
651
  props: {
141
- as: {
652
+ /**
653
+ * name attribute to match optional label element
654
+ * @default ''
655
+ * @type {String}
656
+ */
657
+ name: {
658
+ type: String,
659
+ default: ""
660
+ },
661
+ /**
662
+ * Presets the selected options value.
663
+ * @type {Object||Array||String||Integer}
664
+ */
665
+ modelValue: {
666
+ type: null,
667
+ default() {
668
+ return [];
669
+ }
670
+ },
671
+ /**
672
+ * String to show when pointing to an option
673
+ * @default 'Press enter to select'
674
+ * @type {String}
675
+ */
676
+ selectLabel: {
677
+ type: String,
678
+ default: "Press enter to select"
679
+ },
680
+ /**
681
+ * String to show when pointing to an option
682
+ * @default 'Press enter to select'
683
+ * @type {String}
684
+ */
685
+ selectGroupLabel: {
686
+ type: String,
687
+ default: "Press enter to select group"
688
+ },
689
+ /**
690
+ * String to show next to selected option
691
+ * @default 'Selected'
692
+ * @type {String}
693
+ */
694
+ selectedLabel: {
142
695
  type: String,
143
- default: "span"
696
+ default: "Selected"
697
+ },
698
+ /**
699
+ * String to show when pointing to an already selected option
700
+ * @default 'Press enter to remove'
701
+ * @type {String}
702
+ */
703
+ deselectLabel: {
704
+ type: String,
705
+ default: "Press enter to remove"
706
+ },
707
+ /**
708
+ * String to show when pointing to an already selected option
709
+ * @default 'Press enter to remove'
710
+ * @type {String}
711
+ */
712
+ deselectGroupLabel: {
713
+ type: String,
714
+ default: "Press enter to deselect group"
715
+ },
716
+ /**
717
+ * Decide whether to show pointer labels
718
+ * @default true
719
+ * @type {Boolean}
720
+ */
721
+ showLabels: {
722
+ type: Boolean,
723
+ default: !0
724
+ },
725
+ /**
726
+ * Limit the display of selected options. The rest will be hidden within the limitText string.
727
+ * @default 99999
728
+ * @type {Integer}
729
+ */
730
+ limit: {
731
+ type: Number,
732
+ default: 99999
733
+ },
734
+ /**
735
+ * Sets maxHeight style value of the dropdown
736
+ * @default 300
737
+ * @type {Integer}
738
+ */
739
+ maxHeight: {
740
+ type: Number,
741
+ default: 300
742
+ },
743
+ /**
744
+ * Function that process the message shown when selected
745
+ * elements pass the defined limit.
746
+ * @default 'and * more'
747
+ * @param {Int} count Number of elements more than limit
748
+ * @type {Function}
749
+ */
750
+ limitText: {
751
+ type: Function,
752
+ default: (e) => `and ${e} more`
753
+ },
754
+ /**
755
+ * Set true to trigger the loading spinner.
756
+ * @default False
757
+ * @type {Boolean}
758
+ */
759
+ loading: {
760
+ type: Boolean,
761
+ default: !1
762
+ },
763
+ /**
764
+ * Disables the multiselect if true.
765
+ * @default false
766
+ * @type {Boolean}
767
+ */
768
+ disabled: {
769
+ type: Boolean,
770
+ default: !1
771
+ },
772
+ /**
773
+ * Enables search input's spellcheck if true.
774
+ * @default false
775
+ * @type {Boolean}
776
+ */
777
+ spellcheck: {
778
+ type: Boolean,
779
+ default: !1
780
+ },
781
+ /**
782
+ * Fixed opening direction
783
+ * @default ''
784
+ * @type {String}
785
+ */
786
+ openDirection: {
787
+ type: String,
788
+ default: ""
789
+ },
790
+ /**
791
+ * Shows slot with message about empty options
792
+ * @default true
793
+ * @type {Boolean}
794
+ */
795
+ showNoOptions: {
796
+ type: Boolean,
797
+ default: !0
798
+ },
799
+ showNoResults: {
800
+ type: Boolean,
801
+ default: !0
802
+ },
803
+ tabindex: {
804
+ type: Number,
805
+ default: 0
806
+ },
807
+ /**
808
+ * Adds Required attribute to the input element when there is no value selected
809
+ * @default false
810
+ * @type {Boolean}
811
+ */
812
+ required: {
813
+ type: Boolean,
814
+ default: !1
144
815
  }
145
816
  },
146
- render() {
147
- return l(this.as, {
148
- style: {
149
- whiteSpace: "inherit"
150
- },
151
- "data-mark-view-content": ""
152
- });
817
+ computed: {
818
+ hasOptionGroup() {
819
+ return this.groupValues && this.groupLabel && this.groupSelect;
820
+ },
821
+ isSingleLabelVisible() {
822
+ return (this.singleValue || this.singleValue === 0) && (!this.isOpen || !this.searchable) && !this.visibleValues.length;
823
+ },
824
+ isPlaceholderVisible() {
825
+ return !this.internalValue.length && (!this.searchable || !this.isOpen);
826
+ },
827
+ visibleValues() {
828
+ return this.multiple ? this.internalValue.slice(0, this.limit) : [];
829
+ },
830
+ singleValue() {
831
+ return this.internalValue[0];
832
+ },
833
+ deselectLabelText() {
834
+ return this.showLabels ? this.deselectLabel : "";
835
+ },
836
+ deselectGroupLabelText() {
837
+ return this.showLabels ? this.deselectGroupLabel : "";
838
+ },
839
+ selectLabelText() {
840
+ return this.showLabels ? this.selectLabel : "";
841
+ },
842
+ selectGroupLabelText() {
843
+ return this.showLabels ? this.selectGroupLabel : "";
844
+ },
845
+ selectedLabelText() {
846
+ return this.showLabels ? this.selectedLabel : "";
847
+ },
848
+ inputStyle() {
849
+ return this.searchable || this.multiple && this.modelValue && this.modelValue.length ? this.isOpen ? { width: "100%" } : { width: "0", position: "absolute", padding: "0" } : "";
850
+ },
851
+ contentStyle() {
852
+ return this.options.length ? { display: "inline-block" } : { display: "block" };
853
+ },
854
+ isAbove() {
855
+ return this.openDirection === "above" || this.openDirection === "top" ? !0 : this.openDirection === "below" || this.openDirection === "bottom" ? !1 : this.preferredOpenDirection === "above";
856
+ },
857
+ showSearchInput() {
858
+ return this.searchable && (this.hasSingleSelectedSlot && (this.visibleSingleValue || this.visibleSingleValue === 0) ? this.isOpen : !0);
859
+ },
860
+ isRequired() {
861
+ return this.required === !1 ? !1 : this.internalValue.length <= 0;
862
+ }
153
863
  }
154
- });
864
+ };
865
+ const H = ["tabindex", "aria-expanded", "aria-owns", "aria-activedescendant"], C = {
866
+ ref: "tags",
867
+ class: "multiselect__tags"
868
+ }, K = { class: "multiselect__tags-wrap" }, N = ["textContent"], R = ["onKeypress", "onMousedown"], q = ["textContent"], z = { class: "multiselect__spinner" }, j = ["name", "id", "spellcheck", "placeholder", "required", "value", "disabled", "tabindex", "aria-label", "aria-controls"], I = ["id", "aria-multiselectable"], U = { key: 0 }, J = { class: "multiselect__option" }, Q = ["aria-selected", "id", "role"], W = ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"], X = ["data-select", "data-deselect", "onMouseenter", "onMousedown"], Y = { class: "multiselect__option" }, Z = { class: "multiselect__option" };
869
+ function x(e, t, i, l, a, n) {
870
+ return p(), d("div", {
871
+ tabindex: e.searchable ? -1 : i.tabindex,
872
+ class: V([{ "multiselect--active": e.isOpen, "multiselect--disabled": i.disabled, "multiselect--above": n.isAbove, "multiselect--has-options-group": n.hasOptionGroup }, "multiselect"]),
873
+ onFocus: t[14] || (t[14] = (s) => e.activate()),
874
+ onBlur: t[15] || (t[15] = (s) => e.searchable ? !1 : e.deactivate()),
875
+ onKeydown: [
876
+ t[16] || (t[16] = f(r((s) => e.pointerForward(), ["self", "prevent"]), ["down"])),
877
+ t[17] || (t[17] = f(r((s) => e.pointerBackward(), ["self", "prevent"]), ["up"]))
878
+ ],
879
+ onKeypress: t[18] || (t[18] = f(r((s) => e.addPointerElement(s), ["stop", "self"]), ["enter", "tab"])),
880
+ onKeyup: t[19] || (t[19] = f((s) => e.deactivate(), ["esc"])),
881
+ role: "combobox",
882
+ "aria-expanded": e.isOpen,
883
+ "aria-owns": "listbox-" + e.id,
884
+ "aria-activedescendant": e.isOpen && e.pointer !== null ? e.id + "-" + e.pointer : null
885
+ }, [
886
+ u(e.$slots, "caret", { toggle: e.toggle }, () => [
887
+ o(
888
+ "div",
889
+ {
890
+ onMousedown: t[0] || (t[0] = r((s) => e.toggle(), ["prevent", "stop"])),
891
+ class: "multiselect__select"
892
+ },
893
+ null,
894
+ 32
895
+ /* NEED_HYDRATION */
896
+ )
897
+ ]),
898
+ u(e.$slots, "clear", { search: e.search }),
899
+ o(
900
+ "div",
901
+ C,
902
+ [
903
+ u(e.$slots, "selection", {
904
+ search: e.search,
905
+ remove: e.removeElement,
906
+ values: n.visibleValues,
907
+ isOpen: e.isOpen
908
+ }, () => [
909
+ b(o(
910
+ "div",
911
+ K,
912
+ [
913
+ (p(!0), d(
914
+ $,
915
+ null,
916
+ B(n.visibleValues, (s, h) => u(e.$slots, "tag", {
917
+ option: s,
918
+ search: e.search,
919
+ remove: e.removeElement
920
+ }, () => [
921
+ (p(), d(
922
+ "span",
923
+ {
924
+ class: "multiselect__tag",
925
+ key: h,
926
+ onMousedown: t[1] || (t[1] = r(() => {
927
+ }, ["prevent"]))
928
+ },
929
+ [
930
+ o("span", {
931
+ textContent: g(e.getOptionLabel(s))
932
+ }, null, 8, N),
933
+ o("i", {
934
+ tabindex: "1",
935
+ onKeypress: f(r((m) => e.removeElement(s), ["prevent"]), ["enter"]),
936
+ onMousedown: r((m) => e.removeElement(s), ["prevent"]),
937
+ class: "multiselect__tag-icon"
938
+ }, null, 40, R)
939
+ ],
940
+ 32
941
+ /* NEED_HYDRATION */
942
+ ))
943
+ ])),
944
+ 256
945
+ /* UNKEYED_FRAGMENT */
946
+ ))
947
+ ],
948
+ 512
949
+ /* NEED_PATCH */
950
+ ), [
951
+ [y, n.visibleValues.length > 0]
952
+ ]),
953
+ e.internalValue && e.internalValue.length > i.limit ? u(e.$slots, "limit", { key: 0 }, () => [
954
+ o("strong", {
955
+ class: "multiselect__strong",
956
+ textContent: g(i.limitText(e.internalValue.length - i.limit))
957
+ }, null, 8, q)
958
+ ]) : c("v-if", !0)
959
+ ]),
960
+ L(k, { name: "multiselect__loading" }, {
961
+ default: D(() => [
962
+ u(e.$slots, "loading", {}, () => [
963
+ b(o(
964
+ "div",
965
+ z,
966
+ null,
967
+ 512
968
+ /* NEED_PATCH */
969
+ ), [
970
+ [y, i.loading]
971
+ ])
972
+ ])
973
+ ]),
974
+ _: 3
975
+ /* FORWARDED */
976
+ }),
977
+ e.searchable ? (p(), d("input", {
978
+ key: 0,
979
+ ref: "search",
980
+ name: i.name,
981
+ id: e.id,
982
+ type: "text",
983
+ autocomplete: "off",
984
+ spellcheck: i.spellcheck,
985
+ placeholder: e.placeholder,
986
+ required: n.isRequired,
987
+ style: O(n.inputStyle),
988
+ value: e.search,
989
+ disabled: i.disabled,
990
+ tabindex: i.tabindex,
991
+ "aria-label": i.name + "-searchbox",
992
+ onInput: t[2] || (t[2] = (s) => e.updateSearch(s.target.value)),
993
+ onFocus: t[3] || (t[3] = r((s) => e.activate(), ["prevent"])),
994
+ onBlur: t[4] || (t[4] = r((s) => e.deactivate(), ["prevent"])),
995
+ onKeyup: t[5] || (t[5] = f((s) => e.deactivate(), ["esc"])),
996
+ onKeydown: [
997
+ t[6] || (t[6] = f(r((s) => e.pointerForward(), ["prevent"]), ["down"])),
998
+ t[7] || (t[7] = f(r((s) => e.pointerBackward(), ["prevent"]), ["up"])),
999
+ t[9] || (t[9] = f(r((s) => e.removeLastElement(), ["stop"]), ["delete"]))
1000
+ ],
1001
+ onKeypress: t[8] || (t[8] = f(r((s) => e.addPointerElement(s), ["prevent", "stop", "self"]), ["enter"])),
1002
+ class: "multiselect__input",
1003
+ "aria-controls": "listbox-" + e.id
1004
+ }, null, 44, j)) : c("v-if", !0),
1005
+ n.isSingleLabelVisible ? (p(), d(
1006
+ "span",
1007
+ {
1008
+ key: 1,
1009
+ class: "multiselect__single",
1010
+ onMousedown: t[10] || (t[10] = r((...s) => e.toggle && e.toggle(...s), ["prevent"]))
1011
+ },
1012
+ [
1013
+ u(e.$slots, "singleLabel", { option: n.singleValue }, () => [
1014
+ v(
1015
+ g(e.currentOptionLabel),
1016
+ 1
1017
+ /* TEXT */
1018
+ )
1019
+ ])
1020
+ ],
1021
+ 32
1022
+ /* NEED_HYDRATION */
1023
+ )) : c("v-if", !0),
1024
+ n.isPlaceholderVisible ? (p(), d(
1025
+ "span",
1026
+ {
1027
+ key: 2,
1028
+ class: "multiselect__placeholder",
1029
+ onMousedown: t[11] || (t[11] = r((...s) => e.toggle && e.toggle(...s), ["prevent"]))
1030
+ },
1031
+ [
1032
+ u(e.$slots, "placeholder", {}, () => [
1033
+ v(
1034
+ g(e.placeholder),
1035
+ 1
1036
+ /* TEXT */
1037
+ )
1038
+ ])
1039
+ ],
1040
+ 32
1041
+ /* NEED_HYDRATION */
1042
+ )) : c("v-if", !0)
1043
+ ],
1044
+ 512
1045
+ /* NEED_PATCH */
1046
+ ),
1047
+ L(k, {
1048
+ name: "multiselect",
1049
+ persisted: ""
1050
+ }, {
1051
+ default: D(() => [
1052
+ b(o(
1053
+ "div",
1054
+ {
1055
+ class: "multiselect__content-wrapper",
1056
+ onFocus: t[12] || (t[12] = (...s) => e.activate && e.activate(...s)),
1057
+ tabindex: "-1",
1058
+ onMousedown: t[13] || (t[13] = r(() => {
1059
+ }, ["prevent"])),
1060
+ style: O({ maxHeight: e.optimizedHeight + "px" }),
1061
+ ref: "list"
1062
+ },
1063
+ [
1064
+ o("ul", {
1065
+ class: "multiselect__content",
1066
+ style: O(n.contentStyle),
1067
+ role: "listbox",
1068
+ id: "listbox-" + e.id,
1069
+ "aria-multiselectable": e.multiple
1070
+ }, [
1071
+ u(e.$slots, "beforeList"),
1072
+ e.multiple && e.max === e.internalValue.length ? (p(), d("li", U, [
1073
+ o("span", J, [
1074
+ u(e.$slots, "maxElements", {}, () => [
1075
+ v(
1076
+ "Maximum of " + g(e.max) + " options selected. First remove a selected option to select another.",
1077
+ 1
1078
+ /* TEXT */
1079
+ )
1080
+ ])
1081
+ ])
1082
+ ])) : c("v-if", !0),
1083
+ !e.max || e.internalValue.length < e.max ? (p(!0), d(
1084
+ $,
1085
+ { key: 1 },
1086
+ B(e.filteredOptions, (s, h) => (p(), d("li", {
1087
+ class: "multiselect__element",
1088
+ key: h,
1089
+ "aria-selected": e.isSelected(s),
1090
+ id: e.id + "-" + h,
1091
+ role: s && (s.$isLabel || s.$isDisabled) ? null : "option"
1092
+ }, [
1093
+ s && (s.$isLabel || s.$isDisabled) ? c("v-if", !0) : (p(), d("span", {
1094
+ key: 0,
1095
+ class: V([e.optionHighlight(h, s), "multiselect__option"]),
1096
+ onClick: r((m) => e.select(s), ["stop"]),
1097
+ onMouseenter: r((m) => e.pointerSet(h), ["self"]),
1098
+ "data-select": s && s.isTag ? e.tagPlaceholder : n.selectLabelText,
1099
+ "data-selected": n.selectedLabelText,
1100
+ "data-deselect": n.deselectLabelText
1101
+ }, [
1102
+ u(e.$slots, "option", {
1103
+ option: s,
1104
+ search: e.search,
1105
+ index: h
1106
+ }, () => [
1107
+ o(
1108
+ "span",
1109
+ null,
1110
+ g(e.getOptionLabel(s)),
1111
+ 1
1112
+ /* TEXT */
1113
+ )
1114
+ ])
1115
+ ], 42, W)),
1116
+ s && (s.$isLabel || s.$isDisabled) ? (p(), d("span", {
1117
+ key: 1,
1118
+ "data-select": e.groupSelect && n.selectGroupLabelText,
1119
+ "data-deselect": e.groupSelect && n.deselectGroupLabelText,
1120
+ class: V([e.groupHighlight(h, s), "multiselect__option"]),
1121
+ onMouseenter: r((m) => e.groupSelect && e.pointerSet(h), ["self"]),
1122
+ onMousedown: r((m) => e.selectGroup(s), ["prevent"])
1123
+ }, [
1124
+ u(e.$slots, "option", {
1125
+ option: s,
1126
+ search: e.search,
1127
+ index: h
1128
+ }, () => [
1129
+ o(
1130
+ "span",
1131
+ null,
1132
+ g(e.getOptionLabel(s)),
1133
+ 1
1134
+ /* TEXT */
1135
+ )
1136
+ ])
1137
+ ], 42, X)) : c("v-if", !0)
1138
+ ], 8, Q))),
1139
+ 128
1140
+ /* KEYED_FRAGMENT */
1141
+ )) : c("v-if", !0),
1142
+ b(o(
1143
+ "li",
1144
+ null,
1145
+ [
1146
+ o("span", Y, [
1147
+ u(e.$slots, "noResult", { search: e.search }, () => [
1148
+ t[20] || (t[20] = v("No elements found. Consider changing the search query."))
1149
+ ])
1150
+ ])
1151
+ ],
1152
+ 512
1153
+ /* NEED_PATCH */
1154
+ ), [
1155
+ [y, i.showNoResults && e.filteredOptions.length === 0 && e.search && !i.loading]
1156
+ ]),
1157
+ b(o(
1158
+ "li",
1159
+ null,
1160
+ [
1161
+ o("span", Z, [
1162
+ u(e.$slots, "noOptions", {}, () => [
1163
+ t[21] || (t[21] = v("List is empty."))
1164
+ ])
1165
+ ])
1166
+ ],
1167
+ 512
1168
+ /* NEED_PATCH */
1169
+ ), [
1170
+ [y, i.showNoOptions && (e.options.length === 0 || n.hasOptionGroup === !0 && e.filteredOptions.length === 0) && !e.search && !i.loading]
1171
+ ]),
1172
+ u(e.$slots, "afterList")
1173
+ ], 12, I)
1174
+ ],
1175
+ 36
1176
+ /* STYLE, NEED_HYDRATION */
1177
+ ), [
1178
+ [y, e.isOpen]
1179
+ ])
1180
+ ]),
1181
+ _: 3
1182
+ /* FORWARDED */
1183
+ })
1184
+ ], 42, H);
1185
+ }
1186
+ G.render = x;
155
1187
  export {
156
- y as CommandManager,
157
- N as Editor,
158
- k as EditorContent,
159
- M as Extendable,
160
- T as Extension,
161
- F as InputRule,
162
- I as MappablePosition,
163
- B as Mark,
164
- O as Node,
165
- D as NodePos,
166
- _ as PasteRule,
167
- j as callOrReturn,
168
- V as canInsertNode,
169
- q as combineTransactionSteps,
170
- z as commands,
171
- L as createAtomBlockMarkdownSpec,
172
- U as createBlockMarkdownSpec,
173
- $ as createChainableState,
174
- H as createDocument,
175
- W as createInlineMarkdownSpec,
176
- G as createMappablePosition,
177
- J as createNodeFromContent,
178
- K as createStyleTag,
179
- Q as defaultBlockAt,
180
- X as deleteProps,
181
- Y as elementFromString,
182
- Z as extensions,
183
- ee as findChildrenInRange,
184
- te as findDuplicates,
185
- ne as findParentNode,
186
- re as findParentNodeClosestToPos,
187
- ie as flattenExtensions,
188
- oe as fromString,
189
- ae as getAttributes,
190
- se as getAttributesFromExtensions,
191
- le as getChangedRanges,
192
- de as getExtensionField,
193
- ue as getHTMLFromFragment,
194
- ce as getMarkAttributes,
195
- pe as getMarkRange,
196
- ge as getMarkType,
197
- me as getMarksBetween,
198
- ve as getNodeAtPosition,
199
- Se as getNodeAttributes,
200
- he as getNodeType,
201
- xe as getRenderedAttributes,
202
- fe as getSchemaByResolvedExtensions,
203
- we as getSchemaTypeByName,
204
- Ee as getSchemaTypeNameByName,
205
- Ne as getSplittedAttributes,
206
- be as getText,
207
- Ce as getTextBetween,
208
- ke as getTextContentFromNodes,
209
- Ae as getTextSerializersFromSchema,
210
- Re as getUpdatedPosition,
211
- Pe as injectExtensionAttributesToParseRule,
212
- ye as inputRulesPlugin,
213
- Me as isActive,
214
- Te as isAndroid,
215
- Fe as isAtEndOfNode,
216
- Ie as isAtStartOfNode,
217
- Be as isEmptyObject,
218
- Oe as isExtensionRulesEnabled,
219
- De as isFunction,
220
- _e as isList,
221
- je as isMacOS,
222
- Ve as isMarkActive,
223
- qe as isNodeActive,
224
- ze as isNodeEmpty,
225
- Le as isNodeSelection,
226
- Ue as isNumber,
227
- $e as isPlainObject,
228
- He as isRegExp,
229
- We as isSafari,
230
- Ge as isTextSelection,
231
- Je as isiOS,
232
- Ke as markInputRule,
233
- Qe as markPasteRule,
234
- Xe as markdown,
235
- Ye as mergeAttributes,
236
- Ze as mergeDeep,
237
- et as minMax,
238
- tt as nodeInputRule,
239
- nt as objectIncludes,
240
- rt as parseAttributes,
241
- it as parseIndentedBlocks,
242
- ot as pasteRulesPlugin,
243
- at as removeDuplicates,
244
- st as renderNestedMarkdownContent,
245
- lt as resolveExtensions,
246
- dt as resolveFocusPosition,
247
- ut as selectionToInsertionEnd,
248
- ct as serializeAttributes,
249
- pt as sortExtensions,
250
- gt as splitExtensions,
251
- mt as textblockTypeInputRule,
252
- vt as updateMarkViewAttributes,
253
- A as useEditor,
254
- St as wrappingInputRule
1188
+ G as Multiselect,
1189
+ G as default,
1190
+ P as multiselectMixin,
1191
+ F as pointerMixin
255
1192
  };