@knime/jsonforms 0.1.7 → 1.0.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 (223) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +71 -70
  3. package/dist/AnyOfTwinlist-B_ZhgekG.js +20 -0
  4. package/dist/BaseButton-arvXMjXG.js +112 -0
  5. package/dist/Button-Bc51Uur8.js +83 -0
  6. package/dist/Checkbox-BxPISyW3.js +75 -0
  7. package/dist/CheckboxControl-B-RyvD0K.js +42 -0
  8. package/dist/{Checkboxes-C6FkTqJJ.js → Checkboxes-COtqblKj.js} +11 -10
  9. package/dist/CheckboxesControl-YyKWzrxj.js +38 -0
  10. package/dist/ColumnFilter-bO-fKaHD.js +22 -0
  11. package/dist/ColumnSelect-D0vqxZ2B.js +65 -0
  12. package/dist/{ComboBoxControl-ZCl7sHRN.js → ComboBoxControl-CLL5eRHX.js} +127 -126
  13. package/dist/DateControl-v0qHckKz.js +27 -0
  14. package/dist/DateTimeControl-COnMFfMd.js +47 -0
  15. package/dist/DateTimeInput-ltP7o2TE.js +11059 -0
  16. package/dist/Dropdown-By1NMrXZ.js +691 -0
  17. package/dist/{DropdownControl-BFnea4SN.js → DropdownControl-Eb3G4P0X.js} +1 -1
  18. package/dist/DropdownControl.vue_vue_type_script_setup_true_lang-Cfmqdv7v.js +223 -0
  19. package/dist/ErrorMessage-fuIcc8xw.js +23 -0
  20. package/dist/FunctionButton-DBec3TQi.js +75 -0
  21. package/dist/HorizontalLayout-Dsv1qfyL.js +30 -0
  22. package/dist/InputField-BKH5rtn3.js +148 -0
  23. package/dist/IntegerControl-CBuOHc4B.js +18 -0
  24. package/dist/{IntervalControl-CsuXbPwA.js → IntervalControl-JL6QGHT2.js} +214 -216
  25. package/dist/{MultiselectListBox-BWKtEC8t.js → MultiselectListBox-Dv5n9S3f.js} +4 -3
  26. package/dist/NameFilter-oHBcHQTY.js +22 -0
  27. package/dist/NumberControl-Cwf50Oe-.js +18 -0
  28. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-C_g1bVI2.js +42 -0
  29. package/dist/{NumberInput-84bJjfB4.js → NumberInput-DERn3NyL.js} +9 -7
  30. package/dist/OneOfDropdown-kY3PQFJX.js +32 -0
  31. package/dist/RadioControl-DsVkQLSI.js +22 -0
  32. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-BsA00YLx.js +106 -0
  33. package/dist/{RichTextControl-DgdPhNzf.js → RichTextControl-DXH5XiAI.js} +4595 -3481
  34. package/dist/SectionLayout-BDgtf57K.js +43 -0
  35. package/dist/SimpleButtonControl-6d7wNl3P.js +58 -0
  36. package/dist/SimpleTwinlistControl-CJyR3gN8.js +48 -0
  37. package/dist/SortListControl-On9GHu_U.js +356 -0
  38. package/dist/TextAreaControl-DF_pLD80.js +108 -0
  39. package/dist/TextControl-BTZ4ONmV.js +4 -0
  40. package/dist/TextControl.vue_vue_type_script_setup_true_lang-CYfvYMWm.js +65 -0
  41. package/dist/{TimeControl-D07XI-Sl.js → TimeControl-D2j2e_nC.js} +122 -124
  42. package/dist/TwinlistControl-DcFpZrni.js +553 -0
  43. package/dist/{TwinlistLoadingInfo-DHKwC-WM.js → TwinlistLoadingInfo-CTVlN9EZ.js} +183 -175
  44. package/dist/{ValueSwitch-DXmeJXda.js → ValueSwitch-CpE1f4ie.js} +1 -1
  45. package/dist/ValueSwitchControl-BQFL8H6P.js +18 -0
  46. package/dist/VerticalLayout-D1KXulG4.js +30 -0
  47. package/dist/{VerticalLayoutBase-CI2PQj0c.js → VerticalLayoutBase-D-NdtOho.js} +2 -2
  48. package/dist/VerticalLayoutBase.vue_vue_type_style_index_0_scoped_03d90ec1_lang-BmCXzwjJ.js +13201 -0
  49. package/dist/_baseAssignValue-C56BMUo_.js +19 -0
  50. package/dist/_baseEach-1sO8_8tT.js +31 -0
  51. package/dist/_baseIsEqual-d71B2UwX.js +248 -0
  52. package/dist/_baseIteratee-BgB8cpN8.js +104 -0
  53. package/dist/_getTag-BiNJdVyP.js +314 -0
  54. package/dist/arrow-dropdown-DjUxzjqC.js +17 -0
  55. package/dist/close-h7XT0ja0.js +17 -0
  56. package/dist/floating-ui.vue.esm-CDpUY3-t.js +986 -0
  57. package/dist/getPossibleValuesFromUiSchema-BFJtj-id.js +40 -0
  58. package/dist/index-BrIvBSNK-BRWnkVln.js +685 -0
  59. package/dist/index-C1PjXAJX.js +17 -0
  60. package/dist/index-Cp7Xre_V.js +331 -0
  61. package/dist/isObject-B53jY8Qg.js +7 -0
  62. package/dist/isSymbol-DLKDpjGl.js +8 -0
  63. package/dist/knime-jsonforms.css +1 -1
  64. package/dist/knime-jsonforms.d.ts +2 -0
  65. package/dist/knime-jsonforms.js +119 -3
  66. package/dist/magic-string.es-DFyz70Kz.js +860 -0
  67. package/dist/popper-1JCni0RT.js +907 -0
  68. package/dist/reload-BhzcZRFp.js +17 -0
  69. package/dist/src/JsonFormsDialog.vue.d.ts +50 -0
  70. package/dist/src/constants/index.d.ts +2 -0
  71. package/dist/src/constants/inputFormats.d.ts +25 -0
  72. package/dist/src/constants/priorityRanks.d.ts +4 -0
  73. package/dist/src/higherOrderComponents/control/LabeledControl.vue.d.ts +31 -0
  74. package/dist/src/higherOrderComponents/control/addLabel.d.ts +6 -0
  75. package/dist/src/higherOrderComponents/control/controlToRenderer.d.ts +6 -0
  76. package/dist/src/higherOrderComponents/control/handleVisibility.d.ts +2 -0
  77. package/dist/src/higherOrderComponents/control/index.d.ts +7 -0
  78. package/dist/src/higherOrderComponents/control/types.d.ts +36 -0
  79. package/dist/src/higherOrderComponents/control/util.d.ts +44 -0
  80. package/dist/src/higherOrderComponents/index.d.ts +3 -0
  81. package/dist/src/higherOrderComponents/layout/handleVisibility.d.ts +2 -0
  82. package/dist/src/higherOrderComponents/layout/index.d.ts +4 -0
  83. package/dist/src/higherOrderComponents/layout/layoutToRenderer.d.ts +6 -0
  84. package/dist/src/higherOrderComponents/layout/types.d.ts +28 -0
  85. package/dist/src/higherOrderComponents/layout/util.d.ts +25 -0
  86. package/dist/src/higherOrderComponents/types.d.ts +25 -0
  87. package/dist/src/index.d.ts +9 -0
  88. package/dist/src/layoutComponents/Form.vue.d.ts +10 -0
  89. package/dist/src/layoutComponents/HorizontalLayout.vue.d.ts +12 -0
  90. package/dist/src/layoutComponents/SectionLayout.vue.d.ts +21 -0
  91. package/dist/src/layoutComponents/VerticalLayout.vue.d.ts +12 -0
  92. package/dist/src/layoutComponents/VerticalLayoutBase.vue.d.ts +26 -0
  93. package/dist/src/layoutComponents/index.d.ts +3 -0
  94. package/dist/src/loading/LoadingDialog.vue.d.ts +2 -0
  95. package/dist/src/renderers/checkboxRenderer.d.ts +192 -0
  96. package/dist/src/renderers/checkboxesRenderer.d.ts +7 -0
  97. package/dist/src/renderers/columnFilterRenderer.d.ts +5 -0
  98. package/dist/src/renderers/columnSelectRenderer.d.ts +209 -0
  99. package/dist/src/renderers/comboBoxRenderer.d.ts +6 -0
  100. package/dist/src/renderers/dateTimeRenderer.d.ts +5 -0
  101. package/dist/src/renderers/defaultRenderers.d.ts +1898 -0
  102. package/dist/src/renderers/dropdownRenderer.d.ts +253 -0
  103. package/dist/src/renderers/fallbackRenderers.d.ts +649 -0
  104. package/dist/src/renderers/horizontalLayoutRenderer.d.ts +48 -0
  105. package/dist/src/renderers/index.d.ts +1 -0
  106. package/dist/src/renderers/integerRenderer.d.ts +5 -0
  107. package/dist/src/renderers/intervalRenderer.d.ts +5 -0
  108. package/dist/src/renderers/localDateRenderer.d.ts +5 -0
  109. package/dist/src/renderers/localTimeRenderer.d.ts +5 -0
  110. package/dist/src/renderers/nameFilterRenderer.d.ts +5 -0
  111. package/dist/src/renderers/numberRenderer.d.ts +5 -0
  112. package/dist/src/renderers/radioRenderer.d.ts +5 -0
  113. package/dist/src/renderers/richTextRenderer.d.ts +5 -0
  114. package/dist/src/renderers/sectionLayoutRenderer.d.ts +108 -0
  115. package/dist/src/renderers/simpleButtonRenderer.d.ts +121 -0
  116. package/dist/src/renderers/sortListRenderer.d.ts +288 -0
  117. package/dist/src/renderers/textAreaRenderer.d.ts +5 -0
  118. package/dist/src/renderers/textMessageRenderer.d.ts +89 -0
  119. package/dist/src/renderers/textRenderer.d.ts +193 -0
  120. package/dist/src/renderers/twinlistRenderer.d.ts +13 -0
  121. package/dist/src/renderers/valueSwitchRenderer.d.ts +5 -0
  122. package/dist/src/renderers/verticalLayoutRenderer.d.ts +94 -0
  123. package/dist/src/types/ChoicesUiSchema.d.ts +21 -0
  124. package/dist/src/types/Control.d.ts +2 -0
  125. package/dist/src/types/alert.d.ts +5 -0
  126. package/dist/src/types/provided.d.ts +25 -0
  127. package/dist/src/uiComponents/CheckboxControl.vue.d.ts +22 -0
  128. package/dist/src/uiComponents/CheckboxesControl.vue.d.ts +12 -0
  129. package/dist/src/uiComponents/ColumnSelect.vue.d.ts +26 -0
  130. package/dist/src/uiComponents/ComboBoxControl.vue.d.ts +12 -0
  131. package/dist/src/uiComponents/DateControl.vue.d.ts +12 -0
  132. package/dist/src/uiComponents/DateTimeControl.vue.d.ts +12 -0
  133. package/dist/src/uiComponents/DropdownControl.vue.d.ts +52 -0
  134. package/dist/src/uiComponents/DynamicIcon.vue.d.ts +16 -0
  135. package/dist/src/uiComponents/ErrorMessage.vue.d.ts +23 -0
  136. package/dist/src/uiComponents/IntegerControl.vue.d.ts +12 -0
  137. package/dist/src/uiComponents/IntervalControl.vue.d.ts +12 -0
  138. package/dist/src/uiComponents/NumberControl.vue.d.ts +12 -0
  139. package/dist/src/uiComponents/NumberControlBase.vue.d.ts +19 -0
  140. package/dist/src/uiComponents/OneOfDropdown.vue.d.ts +23 -0
  141. package/dist/src/uiComponents/RadioControl.vue.d.ts +12 -0
  142. package/dist/src/uiComponents/RadioControlBase.vue.d.ts +19 -0
  143. package/dist/src/uiComponents/SimpleButtonControl.vue.d.ts +121 -0
  144. package/dist/src/uiComponents/SortListControl.vue.d.ts +93 -0
  145. package/dist/src/uiComponents/TextAreaControl.vue.d.ts +12 -0
  146. package/dist/src/uiComponents/TextControl.vue.d.ts +23 -0
  147. package/dist/src/uiComponents/TextMessageControl.vue.d.ts +12 -0
  148. package/dist/src/uiComponents/TimeControl.vue.d.ts +12 -0
  149. package/dist/src/uiComponents/ValueSwitchControl.vue.d.ts +12 -0
  150. package/dist/src/uiComponents/composables/useHideOnNull.d.ts +28 -0
  151. package/dist/src/uiComponents/composables/useProvidedState.d.ts +3 -0
  152. package/dist/src/uiComponents/index.d.ts +4 -0
  153. package/dist/src/uiComponents/loading/LoadingDropdown.vue.d.ts +12 -0
  154. package/dist/src/uiComponents/loading/TwinlistLoadingInfo.vue.d.ts +2 -0
  155. package/dist/src/uiComponents/loading/types/LoadingDropdownProps.d.ts +8 -0
  156. package/dist/src/uiComponents/richTextControl/DialogLinkModal.vue.d.ts +29 -0
  157. package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +12 -0
  158. package/dist/src/uiComponents/twinlist/AnyOfTwinlist.vue.d.ts +12 -0
  159. package/dist/src/uiComponents/twinlist/ColumnFilter.vue.d.ts +13 -0
  160. package/dist/src/uiComponents/twinlist/NameFilter.vue.d.ts +13 -0
  161. package/dist/src/uiComponents/twinlist/SimpleTwinlistControl.vue.d.ts +109 -0
  162. package/dist/src/uiComponents/twinlist/TwinlistControl.vue.d.ts +67 -0
  163. package/dist/src/uiComponents/twinlist/useUnknownValuesInTwinlist.d.ts +19 -0
  164. package/dist/src/utils/getFlattenedSettings.d.ts +5 -0
  165. package/dist/src/utils/getPossibleValuesFromUiSchema.d.ts +10 -0
  166. package/dist/src/utils/index.d.ts +15 -0
  167. package/dist/src/utils/inject.d.ts +3 -0
  168. package/dist/src/utils/localTimeUtils.d.ts +16 -0
  169. package/dist/svgWithTitle-zrGi2kyc.js +18 -0
  170. package/dist/testUtils/component.d.ts +190 -0
  171. package/dist/testUtils/index.d.ts +2 -0
  172. package/dist/testUtils/renderer.d.ts +6 -0
  173. package/dist/testing.d.ts +2 -0
  174. package/dist/testing.js +18889 -0
  175. package/dist/toString-C9vll-oa.js +26 -0
  176. package/dist/useSearch-hpyYQ_6y.js +74 -0
  177. package/package.json +11 -7
  178. package/dist/AnyOfTwinlist-BAbzoFfn.js +0 -17
  179. package/dist/ArrayLayout-Cfdlkm_T.js +0 -487
  180. package/dist/ButtonControl-yAb2GdQI.js +0 -127
  181. package/dist/CheckboxControl-Ck45Jycu.js +0 -50
  182. package/dist/CheckboxesControl-Xx9tpOL6.js +0 -39
  183. package/dist/ColumnFilter-u7yVpuFC.js +0 -17
  184. package/dist/ColumnSelect-DfXHTA0Z.js +0 -60
  185. package/dist/CredentialsControl-D1Te47JG.js +0 -20
  186. package/dist/CredentialsControlBase-Dqhh-4hT.js +0 -110
  187. package/dist/DateControl-CuV2lKvs.js +0 -30
  188. package/dist/DateTimeControl-BDZ18Hzl.js +0 -4
  189. package/dist/DropdownControl.vue_vue_type_script_setup_true_lang-BRWvAXuk.js +0 -171
  190. package/dist/DynamicValuesControl-BgNPwoHm.js +0 -127
  191. package/dist/FileChooserControl-HX_GjlNB.js +0 -605
  192. package/dist/FileExplorerTab-FjmnUl9M.js +0 -3951
  193. package/dist/HorizontalLayout-BrHkxvnP.js +0 -39
  194. package/dist/IntegerControl-Dxk1Y8LA.js +0 -13
  195. package/dist/LayoutComponentWrapper-VvzxL4qE.js +0 -36
  196. package/dist/LegacyCredentialsControl-p5U7Vp0h.js +0 -62
  197. package/dist/LocalFileChooserControl-Cr0A0dg6.js +0 -57
  198. package/dist/MenuItems.vue_vue_type_style_index_0_lang-BiJVA2Wt.js +0 -464
  199. package/dist/NameFilter-CsfBC6e2.js +0 -17
  200. package/dist/NodeDialog.vue.d.ts +0 -8
  201. package/dist/NumberControl-BJCFqjn3.js +0 -13
  202. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-DkAPaKAi.js +0 -43
  203. package/dist/OneOfDropdown-CBLlPlxh.js +0 -15
  204. package/dist/RadioControl-BZEV6NYx.js +0 -13
  205. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-DvA87Y4C.js +0 -128
  206. package/dist/SectionLayout-DtVREvcv.js +0 -54
  207. package/dist/SimpleButtonControl-D2kCPiU9.js +0 -59
  208. package/dist/SimpleTwinlistControl-D6E8DEoD.js +0 -68
  209. package/dist/SortListControl-DcW5Ofs5.js +0 -316
  210. package/dist/TextAreaControl-DTw_oBDS.js +0 -111
  211. package/dist/TextControl-BlfySQDC.js +0 -49
  212. package/dist/TwinlistControl-BqoP2Kbq.js +0 -587
  213. package/dist/ValueSwitchControl-CyDbUKLv.js +0 -13
  214. package/dist/VennDiagramLayout-DXH6CUzc.js +0 -104
  215. package/dist/VerticalLayout-CTFSrGS8.js +0 -39
  216. package/dist/arrow-up-Dsq3EgtE.js +0 -30
  217. package/dist/floating-ui.vue.esm-D_FlISFP.js +0 -94
  218. package/dist/getFlattenedSettings-D64OwqpI.js +0 -7
  219. package/dist/index-1mTLieVA.js +0 -32714
  220. package/dist/index.d.ts +0 -3
  221. package/dist/layoutComponents/Form.vue.d.ts +0 -2
  222. package/dist/link-BA69Hfx6.js +0 -17
  223. package/dist/loading/LoadingDialog.vue.d.ts +0 -2
@@ -0,0 +1,691 @@
1
+ import { getCurrentScope as Q, onScopeDispose as J, unref as Z, toRef as $, readonly as ee, customRef as te, ref as x, watch as E, defineComponent as ne, h as se, computed as W, toRefs as oe, nextTick as ie, resolveComponent as S, openBlock as m, createBlock as I, withCtx as D, createElementVNode as w, normalizeClass as V, normalizeStyle as re, createElementBlock as g, withModifiers as C, renderSlot as _, toDisplayString as T, createCommentVNode as k, withKeys as le, createVNode as R, withDirectives as ae, Fragment as O, renderList as K, createTextVNode as de, vShow as ue, pushScopeId as ce, popScopeId as fe } from "vue";
2
+ import { A as pe } from "./arrow-dropdown-DjUxzjqC.js";
3
+ import { C as he } from "./close-h7XT0ja0.js";
4
+ /* empty css */
5
+ import { u as me } from "./useSearch-hpyYQ_6y.js";
6
+ import { F as ge } from "./FunctionButton-DBec3TQi.js";
7
+ import { a as ye, b as we, d as ve, f as xe, g as Ve, h as be, j as Ee } from "./_getTag-BiNJdVyP.js";
8
+ import { i as Se } from "./toString-C9vll-oa.js";
9
+ import { _ as Ce } from "./VerticalLayoutBase.vue_vue_type_style_index_0_scoped_03d90ec1_lang-BmCXzwjJ.js";
10
+ var ke = "[object Map]", Oe = "[object Set]", Ie = Object.prototype, De = Ie.hasOwnProperty;
11
+ function _e(e) {
12
+ if (e == null)
13
+ return !0;
14
+ if (ye(e) && (Se(e) || typeof e == "string" || typeof e.splice == "function" || we(e) || ve(e) || xe(e)))
15
+ return !e.length;
16
+ var t = Ve(e);
17
+ if (t == ke || t == Oe)
18
+ return !e.size;
19
+ if (be(e))
20
+ return !Ee(e).length;
21
+ for (var n in e)
22
+ if (De.call(e, n))
23
+ return !1;
24
+ return !0;
25
+ }
26
+ function L(e) {
27
+ return Q() ? (J(e), !0) : !1;
28
+ }
29
+ function y(e) {
30
+ return typeof e == "function" ? e() : Z(e);
31
+ }
32
+ const N = typeof window < "u" && typeof document < "u";
33
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
34
+ const Te = Object.prototype.toString, F = (e) => Te.call(e) === "[object Object]", v = () => {
35
+ }, M = /* @__PURE__ */ Ae();
36
+ function Ae() {
37
+ var e, t;
38
+ return N && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
39
+ }
40
+ function Be(...e) {
41
+ if (e.length !== 1)
42
+ return $(...e);
43
+ const t = e[0];
44
+ return typeof t == "function" ? ee(te(() => ({ get: t, set: v }))) : x(t);
45
+ }
46
+ function b(e) {
47
+ var t;
48
+ const n = y(e);
49
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
50
+ }
51
+ const j = N ? window : void 0;
52
+ function A(...e) {
53
+ let t, n, o, i;
54
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = j) : [t, n, o, i] = e, !t)
55
+ return v;
56
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
57
+ const s = [], h = () => {
58
+ s.forEach((u) => u()), s.length = 0;
59
+ }, a = (u, d, l, r) => (u.addEventListener(d, l, r), () => u.removeEventListener(d, l, r)), f = E(
60
+ () => [b(t), y(i)],
61
+ ([u, d]) => {
62
+ if (h(), !u)
63
+ return;
64
+ const l = F(d) ? { ...d } : d;
65
+ s.push(
66
+ ...n.flatMap((r) => o.map((c) => a(u, r, c, l)))
67
+ );
68
+ },
69
+ { immediate: !0, flush: "post" }
70
+ ), p = () => {
71
+ f(), h();
72
+ };
73
+ return L(p), p;
74
+ }
75
+ let H = !1;
76
+ function Pe(e, t, n = {}) {
77
+ const { window: o = j, ignore: i = [], capture: s = !0, detectIframe: h = !1 } = n;
78
+ if (!o)
79
+ return v;
80
+ M && !H && (H = !0, Array.from(o.document.body.children).forEach((l) => l.addEventListener("click", v)), o.document.documentElement.addEventListener("click", v));
81
+ let a = !0;
82
+ const f = (l) => i.some((r) => {
83
+ if (typeof r == "string")
84
+ return Array.from(o.document.querySelectorAll(r)).some((c) => c === l.target || l.composedPath().includes(c));
85
+ {
86
+ const c = b(r);
87
+ return c && (l.target === c || l.composedPath().includes(c));
88
+ }
89
+ }), u = [
90
+ A(o, "click", (l) => {
91
+ const r = b(e);
92
+ if (!(!r || r === l.target || l.composedPath().includes(r))) {
93
+ if (l.detail === 0 && (a = !f(l)), !a) {
94
+ a = !0;
95
+ return;
96
+ }
97
+ t(l);
98
+ }
99
+ }, { passive: !0, capture: s }),
100
+ A(o, "pointerdown", (l) => {
101
+ const r = b(e);
102
+ a = !f(l) && !!(r && !l.composedPath().includes(r));
103
+ }, { passive: !0 }),
104
+ h && A(o, "blur", (l) => {
105
+ setTimeout(() => {
106
+ var r;
107
+ const c = b(e);
108
+ ((r = o.document.activeElement) == null ? void 0 : r.tagName) === "IFRAME" && !(c != null && c.contains(o.document.activeElement)) && t(l);
109
+ }, 0);
110
+ })
111
+ ].filter(Boolean);
112
+ return () => u.forEach((l) => l());
113
+ }
114
+ const Me = /* @__PURE__ */ ne({
115
+ name: "OnClickOutside",
116
+ props: ["as", "options"],
117
+ emits: ["trigger"],
118
+ setup(e, { slots: t, emit: n }) {
119
+ const o = x();
120
+ return Pe(o, (i) => {
121
+ n("trigger", i);
122
+ }, e.options), () => {
123
+ if (t.default)
124
+ return se(e.as || "div", { ref: o }, t.default());
125
+ };
126
+ }
127
+ });
128
+ function Le(e) {
129
+ var t;
130
+ const n = y(e);
131
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
132
+ }
133
+ const Ne = N ? window : void 0;
134
+ function Re(...e) {
135
+ let t, n, o, i;
136
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = Ne) : [t, n, o, i] = e, !t)
137
+ return v;
138
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
139
+ const s = [], h = () => {
140
+ s.forEach((u) => u()), s.length = 0;
141
+ }, a = (u, d, l, r) => (u.addEventListener(d, l, r), () => u.removeEventListener(d, l, r)), f = E(
142
+ () => [Le(t), y(i)],
143
+ ([u, d]) => {
144
+ if (h(), !u)
145
+ return;
146
+ const l = F(d) ? { ...d } : d;
147
+ s.push(
148
+ ...n.flatMap((r) => o.map((c) => a(u, r, c, l)))
149
+ );
150
+ },
151
+ { immediate: !0, flush: "post" }
152
+ ), p = () => {
153
+ f(), h();
154
+ };
155
+ return L(p), p;
156
+ }
157
+ function B(e) {
158
+ return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
159
+ }
160
+ function Y(e) {
161
+ const t = window.getComputedStyle(e);
162
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
163
+ return !0;
164
+ {
165
+ const n = e.parentNode;
166
+ return !n || n.tagName === "BODY" ? !1 : Y(n);
167
+ }
168
+ }
169
+ function Ke(e) {
170
+ const t = e || window.event, n = t.target;
171
+ return Y(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
172
+ }
173
+ const P = /* @__PURE__ */ new WeakMap();
174
+ function He(e, t = !1) {
175
+ const n = x(t);
176
+ let o = null, i = "";
177
+ E(Be(e), (a) => {
178
+ const f = B(y(a));
179
+ if (f) {
180
+ const p = f;
181
+ if (P.get(p) || P.set(p, p.style.overflow), p.style.overflow !== "hidden" && (i = p.style.overflow), p.style.overflow === "hidden")
182
+ return n.value = !0;
183
+ if (n.value)
184
+ return p.style.overflow = "hidden";
185
+ }
186
+ }, {
187
+ immediate: !0
188
+ });
189
+ const s = () => {
190
+ const a = B(y(e));
191
+ !a || n.value || (M && (o = Re(
192
+ a,
193
+ "touchmove",
194
+ (f) => {
195
+ Ke(f);
196
+ },
197
+ { passive: !1 }
198
+ )), a.style.overflow = "hidden", n.value = !0);
199
+ }, h = () => {
200
+ const a = B(y(e));
201
+ !a || !n.value || (M && (o == null || o()), a.style.overflow = i, P.delete(a), n.value = !1);
202
+ };
203
+ return L(h), W({
204
+ get() {
205
+ return n.value;
206
+ },
207
+ set(a) {
208
+ a ? s() : h();
209
+ }
210
+ });
211
+ }
212
+ function We() {
213
+ let e = !1;
214
+ const t = x(!1);
215
+ return (n, o) => {
216
+ if (t.value = o.value, e)
217
+ return;
218
+ e = !0;
219
+ const i = He(n, o.value);
220
+ E(t, (s) => i.value = s);
221
+ };
222
+ }
223
+ We();
224
+ let Fe = 0;
225
+ const G = "ArrowDown", z = "ArrowUp", U = "Home", q = "End", je = "Escape", X = "Enter", Ye = [G, z, U, q, X], Ge = {
226
+ name: "Dropdown",
227
+ components: {
228
+ DropdownIcon: pe,
229
+ OnClickOutside: Me,
230
+ FunctionButton: ge,
231
+ CloseIcon: he
232
+ },
233
+ props: {
234
+ id: {
235
+ type: String,
236
+ default() {
237
+ return `Dropdown-${Fe++}`;
238
+ }
239
+ },
240
+ modelValue: {
241
+ type: String,
242
+ default: null
243
+ },
244
+ name: {
245
+ type: String,
246
+ default: null
247
+ },
248
+ placeholder: {
249
+ type: String,
250
+ default: null
251
+ },
252
+ ariaLabel: {
253
+ type: String,
254
+ required: !0
255
+ },
256
+ isValid: {
257
+ default: !0,
258
+ type: Boolean
259
+ },
260
+ disabled: {
261
+ default: !1,
262
+ type: Boolean
263
+ },
264
+ /**
265
+ * The direction of the dropdown menu. When set to 'up', the menu will appear above the input field.
266
+ * Defaults to 'down'.
267
+ */
268
+ direction: {
269
+ default: "down",
270
+ type: String
271
+ },
272
+ /**
273
+ * List of possible values. Each item must have an `id` and a `text` property. To use slots an additional
274
+ * slotData object must be passed which contains the data to be displayed.
275
+ *
276
+ * IMPORTANT: All values have to have a slotData object otherwise the slot will not be displayed and the
277
+ * usual text is rendered instead.
278
+ * @example
279
+ * [{
280
+ * id: 'pdf',
281
+ * text: 'PDF'
282
+ * }, {
283
+ * id: 'XLS',
284
+ * text: 'Excel',
285
+ * }, {
286
+ * id: 'JPG',
287
+ * text: 'Jpeg',
288
+ * slotData: {
289
+ * fullName: 'Joint Photographic Experts Group',
290
+ * year: '1992'
291
+ * description: 'Commonly used method of lossy compression for digital images'
292
+ * }
293
+ * }]
294
+ */
295
+ possibleValues: {
296
+ type: Array,
297
+ default: () => []
298
+ },
299
+ caseSensitiveSearch: {
300
+ type: Boolean,
301
+ default: !1
302
+ },
303
+ compact: {
304
+ type: Boolean,
305
+ default: !1
306
+ }
307
+ },
308
+ emits: ["update:modelValue"],
309
+ setup(e) {
310
+ const { caseSensitiveSearch: t, possibleValues: n } = oe(e), o = x(!1), i = W(() => {
311
+ let a = {};
312
+ for (let f of n.value)
313
+ a[f.id] = f.text;
314
+ return a;
315
+ }), s = x(i.value[e.modelValue]);
316
+ E(
317
+ () => e.modelValue,
318
+ (a) => {
319
+ s.value = i.value[a];
320
+ }
321
+ );
322
+ const h = me(
323
+ s,
324
+ t,
325
+ n,
326
+ o
327
+ );
328
+ return {
329
+ searchValue: s,
330
+ useFilterValues: o,
331
+ currentPossibleValues: h
332
+ };
333
+ },
334
+ data() {
335
+ return {
336
+ typingTimeout: null,
337
+ isExpanded: !1,
338
+ searchQuery: "",
339
+ candidate: this.modelValue,
340
+ emptyState: "Nothing found",
341
+ optionRefs: /* @__PURE__ */ new Map(),
342
+ slotContainerHeight: 0
343
+ };
344
+ },
345
+ computed: {
346
+ groupedValues() {
347
+ const e = {};
348
+ for (const t of this.currentPossibleValues) {
349
+ const n = t.group || "";
350
+ e[n] || (e[n] = { label: t.group, items: [] }), e[n].items.push(t);
351
+ }
352
+ return Object.values(e);
353
+ },
354
+ orderedGroupedValues() {
355
+ const e = this.groupedValues.filter(
356
+ (n) => n.items[0].group
357
+ ), t = this.groupedValues.filter(
358
+ (n) => !n.items[0].group
359
+ );
360
+ return [...e, ...t];
361
+ },
362
+ flatOrderedValues() {
363
+ return this.orderedGroupedValues.flatMap((e) => e.items);
364
+ },
365
+ selectedIndex() {
366
+ return this.flatOrderedValues.map((e) => e.id).indexOf(this.candidate);
367
+ },
368
+ showPlaceholder() {
369
+ return !this.modelValue;
370
+ },
371
+ displayTextMap() {
372
+ let e = {};
373
+ for (let t of this.possibleValues)
374
+ e[t.id] = t.text;
375
+ return e;
376
+ },
377
+ displayText() {
378
+ return this.showPlaceholder ? this.placeholder : this.displayTextMap.hasOwnProperty(this.modelValue) ? this.displayTextMap[this.modelValue] : `(MISSING) ${this.modelValue.toString()}`;
379
+ },
380
+ isMissing() {
381
+ return this.modelValue && !this.displayTextMap.hasOwnProperty(this.modelValue);
382
+ },
383
+ hasRightIcon() {
384
+ var e, t;
385
+ return (t = (e = this.$slots)["icon-right"]) == null ? void 0 : t.call(e).length;
386
+ },
387
+ hasOptionTemplate() {
388
+ return this.possibleValues.length === 0 ? !1 : this.possibleValues.every(
389
+ (e) => e.slotData && !_e(e.slotData)
390
+ );
391
+ },
392
+ selectedOption() {
393
+ return this.possibleValues.find((e) => e.id === this.modelValue);
394
+ },
395
+ hasNoFilteredPossibleValues() {
396
+ return this.currentPossibleValues.length === 0;
397
+ },
398
+ nonEmptySearchValue() {
399
+ var e;
400
+ return ((e = this.searchValue) == null ? void 0 : e.length) > 0;
401
+ },
402
+ possibleValuesIsProvided() {
403
+ return !!this.possibleValues.length;
404
+ },
405
+ isDisabled() {
406
+ return this.disabled || !this.possibleValuesIsProvided;
407
+ },
408
+ closeIconTooltip() {
409
+ return "Clear";
410
+ }
411
+ },
412
+ watch: {
413
+ currentPossibleValues(e) {
414
+ var t;
415
+ this.candidate = (t = e[0]) == null ? void 0 : t.id;
416
+ },
417
+ isExpanded() {
418
+ this.useFilterValues = !1;
419
+ }
420
+ },
421
+ methods: {
422
+ updateCandidate(e) {
423
+ this.candidate = e;
424
+ },
425
+ isCurrentValue(e) {
426
+ return this.candidate === e;
427
+ },
428
+ getButtonRef() {
429
+ return this.$refs.button;
430
+ },
431
+ getOptionsRefs() {
432
+ return this.$refs.options;
433
+ },
434
+ getSearchInput() {
435
+ return this.$refs.searchInput;
436
+ },
437
+ getListBoxNodeRef() {
438
+ return this.$refs.ul;
439
+ },
440
+ emitAndClose(e) {
441
+ this.$emit("update:modelValue", e), this.toggleExpanded();
442
+ },
443
+ scrollTo(e) {
444
+ let t = this.getListBoxNodeRef();
445
+ if (t.scrollHeight >= t.clientHeight) {
446
+ let n = this.optionRefs.get(e);
447
+ if (!n) {
448
+ consola.error(
449
+ `trying to scroll to element with Id ${e.toString()} which does not exist`
450
+ );
451
+ return;
452
+ }
453
+ let o = t.clientHeight + t.scrollTop, i = n.offsetTop + n.offsetHeight;
454
+ i > o ? t.scrollTop = i - t.clientHeight : n.offsetTop < t.scrollTop && (t.scrollTop = n.offsetTop);
455
+ }
456
+ },
457
+ onArrowDown() {
458
+ let e = this.selectedIndex + 1;
459
+ if (e >= this.flatOrderedValues.length)
460
+ return;
461
+ const t = this.flatOrderedValues[e].id;
462
+ this.updateCandidate(t), this.scrollTo(t);
463
+ },
464
+ onArrowUp() {
465
+ let e = this.selectedIndex - 1;
466
+ if (e < 0)
467
+ return;
468
+ const t = this.flatOrderedValues[e].id;
469
+ this.updateCandidate(t), this.scrollTo(t);
470
+ },
471
+ onEnter() {
472
+ this.hasNoFilteredPossibleValues || typeof this.candidate > "u" || this.emitAndClose(this.candidate);
473
+ },
474
+ onEndKey() {
475
+ let e = this.flatOrderedValues.length - 1;
476
+ this.updateCandidate(this.flatOrderedValues[e].id);
477
+ const t = this.getListBoxNodeRef();
478
+ t.scrollTop = t.scrollHeight;
479
+ },
480
+ onHomeKey() {
481
+ this.updateCandidate(this.flatOrderedValues[0].id), this.getListBoxNodeRef().scrollTop = 0;
482
+ },
483
+ toggleExpanded() {
484
+ this.isExpanded ? this.collapse() : this.expand();
485
+ },
486
+ async expand() {
487
+ var e, t;
488
+ this.isDisabled || (this.searchValue = this.displayTextMap[this.modelValue], this.hasOptionTemplate && (this.slotContainerHeight = ((e = this.$refs.slotContainer) == null ? void 0 : e.clientHeight) ?? 0), this.isExpanded = !0, this.candidate === this.modelValue && (this.isMissing || this.showPlaceholder) && this.updateCandidate((t = this.currentPossibleValues[0]) == null ? void 0 : t.id), await ie(), this.getSearchInput().focus(), this.getSearchInput().select(), this.candidate && this.scrollTo(this.candidate));
489
+ },
490
+ collapse() {
491
+ this.isExpanded = !1, this.getButtonRef().focus();
492
+ },
493
+ /* NOTE: we use a single keyDown method because @keydown.up bindings are not testable. */
494
+ handleKeyDownButton(e) {
495
+ this.isExpanded ? this.handleKeyDownOnExpanded(e) : Ye.includes(e.key) && (this.expand(), e.preventDefault());
496
+ },
497
+ handleKeyDownOnExpanded(e) {
498
+ e.key === G && (this.onArrowDown(), e.preventDefault()), e.key === z && (this.onArrowUp(), e.preventDefault()), e.key === q && (this.onEndKey(), e.preventDefault()), e.key === U && (this.onHomeKey(), e.preventDefault()), e.key === je && (this.collapse(), e.preventDefault(), e.stopPropagation()), e.key === X && (this.onEnter(), e.preventDefault());
499
+ },
500
+ hasSelection() {
501
+ return !!(this.modelValue && !this.isMissing);
502
+ },
503
+ getCurrentSelectedId() {
504
+ try {
505
+ return this.flatOrderedValues[this.selectedIndex].id;
506
+ } catch {
507
+ return "";
508
+ }
509
+ },
510
+ generateId(e, t = null) {
511
+ if (!t)
512
+ return `${e}-${this.id}`;
513
+ let n = String(t).replace(/[^\w]/gi, "");
514
+ return `${e}-${this.id}-${n}`;
515
+ },
516
+ closeDropdown() {
517
+ this.searchValue = this.displayTextMap[this.modelValue], this.isExpanded = !1;
518
+ },
519
+ handleSearch(e) {
520
+ this.useFilterValues = !0, this.searchValue = e;
521
+ },
522
+ handleResetInput() {
523
+ this.searchValue = "", this.getSearchInput().focus();
524
+ }
525
+ }
526
+ }, ze = (e) => (ce("data-v-e5d7b590"), e = e(), fe(), e), Ue = ["id"], qe = ["id", "aria-label", "aria-labelledby", "aria-expanded"], Xe = ["value"], Qe = {
527
+ key: 1,
528
+ ref: "slotContainer"
529
+ }, Je = { class: "right" }, Ze = {
530
+ key: 0,
531
+ class: "loading-icon"
532
+ }, $e = ["aria-activedescendant"], et = {
533
+ key: 0,
534
+ class: "empty-state"
535
+ }, tt = /* @__PURE__ */ ze(() => /* @__PURE__ */ w("span", { class: "group-divider" }, null, -1)), nt = ["id", "title", "aria-selected", "onMouseenter", "onClick"], st = ["id", "name", "value"];
536
+ function ot(e, t, n, o, i, s) {
537
+ const h = S("CloseIcon"), a = S("FunctionButton"), f = S("DropdownIcon"), p = S("OnClickOutside");
538
+ return m(), I(p, { onTrigger: s.closeDropdown }, {
539
+ default: D(() => {
540
+ var u;
541
+ return [
542
+ w("div", {
543
+ id: n.id,
544
+ class: V([
545
+ "dropdown",
546
+ {
547
+ collapsed: !i.isExpanded,
548
+ invalid: !n.isValid,
549
+ disabled: s.isDisabled,
550
+ compact: n.compact
551
+ }
552
+ ])
553
+ }, [
554
+ w("div", {
555
+ id: s.generateId("button"),
556
+ ref: "button",
557
+ role: "button",
558
+ tabindex: "0",
559
+ "aria-haspopup": "listbox",
560
+ class: V({
561
+ placeholder: s.showPlaceholder && !i.isExpanded,
562
+ missing: s.isMissing && !i.isExpanded,
563
+ "has-option-template": s.hasOptionTemplate && !i.isExpanded
564
+ }),
565
+ style: re({
566
+ ...i.isExpanded && s.hasOptionTemplate && {
567
+ height: `calc(${i.slotContainerHeight}px + 0 * var(--form-border-width))`,
568
+ boxSizing: "content-box"
569
+ }
570
+ }),
571
+ "aria-label": n.ariaLabel,
572
+ "aria-labelledby": s.generateId("button"),
573
+ "aria-expanded": i.isExpanded,
574
+ onClick: t[3] || (t[3] = (...d) => s.toggleExpanded && s.toggleExpanded(...d)),
575
+ onKeydown: t[4] || (t[4] = (...d) => s.handleKeyDownButton && s.handleKeyDownButton(...d))
576
+ }, [
577
+ i.isExpanded ? (m(), g("input", {
578
+ key: 0,
579
+ ref: "searchInput",
580
+ value: o.searchValue,
581
+ tabindex: "0",
582
+ role: "searchbox",
583
+ class: "search-input",
584
+ type: "text",
585
+ onClick: t[0] || (t[0] = C(() => {
586
+ }, ["stop"])),
587
+ onInput: t[1] || (t[1] = (d) => s.handleSearch(d.target.value))
588
+ }, null, 40, Xe)) : s.hasOptionTemplate ? (m(), g("div", Qe, [
589
+ _(e.$slots, "option", {
590
+ slotData: (u = s.selectedOption) == null ? void 0 : u.slotData,
591
+ isMissing: s.isMissing,
592
+ selectedValue: n.modelValue,
593
+ expanded: !1
594
+ })
595
+ ], 512)) : (m(), g("span", {
596
+ key: 2,
597
+ ref: "span"
598
+ }, T(s.displayText), 513)),
599
+ w("div", Je, [
600
+ s.hasRightIcon ? (m(), g("div", Ze, [
601
+ _(e.$slots, "icon-right")
602
+ ])) : k("", !0),
603
+ i.isExpanded && s.nonEmptySearchValue ? (m(), I(a, {
604
+ key: 1,
605
+ ref: "closeButton",
606
+ title: "Close",
607
+ tabindex: "0",
608
+ class: "button",
609
+ compact: n.compact,
610
+ onKeydown: t[2] || (t[2] = le(C(() => {
611
+ }, ["stop"]), ["enter"])),
612
+ onClick: C(s.handleResetInput, ["stop"])
613
+ }, {
614
+ default: D(() => [
615
+ R(h, { class: "icon" })
616
+ ]),
617
+ _: 1
618
+ }, 8, ["compact", "onClick"])) : k("", !0),
619
+ !i.isExpanded || !s.nonEmptySearchValue ? (m(), I(a, {
620
+ key: 2,
621
+ class: "button",
622
+ compact: n.compact,
623
+ disabled: s.isDisabled,
624
+ title: i.isExpanded ? "Cancel" : "Expand",
625
+ tabindex: i.isExpanded ? 0 : -1,
626
+ onClick: C(s.toggleExpanded, ["stop"])
627
+ }, {
628
+ default: D(() => [
629
+ R(f, {
630
+ class: V(["dropdown-icon", "icon"])
631
+ })
632
+ ]),
633
+ _: 1
634
+ }, 8, ["compact", "disabled", "title", "tabindex", "onClick"])) : k("", !0)
635
+ ])
636
+ ], 46, qe),
637
+ ae(w("ul", {
638
+ ref: "ul",
639
+ role: "listbox",
640
+ tabindex: "-1",
641
+ "aria-activedescendant": i.isExpanded ? s.generateId("option", s.getCurrentSelectedId()) : void 0,
642
+ class: V({ "drops-upwards": n.direction === "up" })
643
+ }, [
644
+ s.hasNoFilteredPossibleValues ? (m(), g("div", et, T(i.emptyState), 1)) : k("", !0),
645
+ (m(!0), g(O, null, K(s.orderedGroupedValues, (d, l) => (m(), g(O, { key: l }, [
646
+ tt,
647
+ (m(!0), g(O, null, K(d.items, (r) => (m(), g("li", {
648
+ id: s.generateId("option", r.id),
649
+ key: `listbox-${r.id}`,
650
+ ref_for: !0,
651
+ ref: (c) => i.optionRefs.set(r.id, c),
652
+ role: "option",
653
+ title: typeof r.title > "u" ? r.text : r.title,
654
+ class: V({
655
+ focused: s.isCurrentValue(r.id),
656
+ noselect: !0,
657
+ empty: r.text.trim() === "",
658
+ "has-option-template": s.hasOptionTemplate
659
+ }),
660
+ "aria-selected": s.isCurrentValue(r.id),
661
+ onMouseenter: (c) => s.updateCandidate(r.id),
662
+ onClick: (c) => s.emitAndClose(r.id)
663
+ }, [
664
+ s.hasOptionTemplate ? _(e.$slots, "option", {
665
+ key: 0,
666
+ slotData: r.slotData,
667
+ expanded: !0
668
+ }) : (m(), g(O, { key: 1 }, [
669
+ de(T(r.text), 1)
670
+ ], 64))
671
+ ], 42, nt))), 128))
672
+ ], 64))), 128))
673
+ ], 10, $e), [
674
+ [ue, i.isExpanded]
675
+ ]),
676
+ w("input", {
677
+ id: n.id,
678
+ type: "hidden",
679
+ name: n.name,
680
+ value: n.modelValue
681
+ }, null, 8, st)
682
+ ], 10, Ue)
683
+ ];
684
+ }),
685
+ _: 3
686
+ }, 8, ["onTrigger"]);
687
+ }
688
+ const ht = /* @__PURE__ */ Ce(Ge, [["render", ot], ["__scopeId", "data-v-e5d7b590"]]);
689
+ export {
690
+ ht as D
691
+ };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./DropdownControl.vue_vue_type_script_setup_true_lang-BRWvAXuk.js";
1
+ import { _ as f } from "./DropdownControl.vue_vue_type_script_setup_true_lang-Cfmqdv7v.js";
2
2
  export {
3
3
  f as default
4
4
  };