@qelos/aidev 1.2.0 → 1.3.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.
- package/.env.aidev.example +12 -1
- package/README.md +23 -6
- package/dist/ai/devin.d.ts +7 -0
- package/dist/ai/devin.d.ts.map +1 -0
- package/dist/ai/devin.js +91 -0
- package/dist/ai/devin.js.map +1 -0
- package/dist/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/cli.js +31 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/hooks.d.ts +5 -0
- package/dist/commands/hooks.d.ts.map +1 -0
- package/dist/commands/hooks.js +86 -0
- package/dist/commands/hooks.js.map +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +18 -109
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/run.d.ts +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +78 -63
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/schedule.js +2 -2
- package/dist/commands/schedule.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -1
- package/dist/config.js.map +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +1 -2
- package/dist/diagnostics.js.map +1 -1
- package/dist/hooks.d.ts +18 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +16 -0
- package/dist/hooks.js.map +1 -1
- package/dist/hooksTemplate.d.ts +14 -0
- package/dist/hooksTemplate.d.ts.map +1 -0
- package/dist/hooksTemplate.js +274 -0
- package/dist/hooksTemplate.js.map +1 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +32 -0
- package/dist/logger.js.map +1 -1
- package/dist/platform.d.ts +2 -2
- package/dist/platform.js +2 -2
- package/dist/safeMode.d.ts +32 -0
- package/dist/safeMode.d.ts.map +1 -0
- package/dist/safeMode.js +192 -0
- package/dist/safeMode.js.map +1 -0
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/ui/.output/nitro.json +1 -1
- package/ui/.output/public/_nuxt/6wLLp9Nc.js +1 -0
- package/ui/.output/public/_nuxt/BGkU0f28.js +1 -0
- package/ui/.output/public/_nuxt/BOIhDy_l.js +4 -0
- package/ui/.output/public/_nuxt/BWJzzHTi.js +1 -0
- package/ui/.output/public/_nuxt/{3LZdFtk_.js → By4xSvKt.js} +3 -3
- package/ui/.output/public/_nuxt/ByAMJ0xS.js +1 -0
- package/ui/.output/public/_nuxt/C1xk3ymy.js +1 -0
- package/ui/.output/public/_nuxt/CBV5GuL6.js +11 -0
- package/ui/.output/public/_nuxt/CTtW-0zG.js +1 -0
- package/ui/.output/public/_nuxt/CX0vIr0s.js +131 -0
- package/ui/.output/public/_nuxt/{LzHPbXPK.js → CYm8nRCj.js} +1 -1
- package/ui/.output/public/_nuxt/CdHqKVo4.js +1 -0
- package/ui/.output/public/_nuxt/CnXdKLRd.js +16 -0
- package/ui/.output/public/_nuxt/Cz9dogwK.js +1 -0
- package/ui/.output/public/_nuxt/DGHfexQZ.js +1 -0
- package/ui/.output/public/_nuxt/{CWjftssB.js → DOoocm0F.js} +1 -1
- package/ui/.output/public/_nuxt/{DZd8Jv5H.js → D_gcbXK2.js} +1 -1
- package/ui/.output/public/_nuxt/{CO4XMBYO.js → Dfhp6TEA.js} +11 -11
- package/ui/.output/public/_nuxt/{BtD1YBwM.js → G5BjvTWO.js} +1 -1
- package/ui/.output/public/_nuxt/H73b_QUy.js +1 -0
- package/ui/.output/public/_nuxt/{BMTHyzVP.js → LCoCV2KL.js} +1 -1
- package/ui/.output/public/_nuxt/Zrl3Utak.js +1 -0
- package/ui/.output/public/_nuxt/config.CaB_F_OT.css +1 -0
- package/ui/.output/public/_nuxt/default.D13_FS9T.css +1 -0
- package/ui/.output/public/_nuxt/hooks.B03-GWTh.css +1 -0
- package/ui/.output/public/_nuxt/kPPYUzXr.js +2 -0
- package/ui/.output/public/_nuxt/logs.DLMkvOEl.css +1 -0
- package/ui/.output/public/_nuxt/mHp9eItY.js +1 -0
- package/ui/.output/public/_nuxt/{BTfAgCfF.js → tyaD1vVi.js} +1 -1
- package/ui/.output/public/_nuxt/{BGlShnpS.js → ynXKxjpn.js} +1 -1
- package/ui/.output/public/_nuxt/{B8sr5ZW-.js → yqBy-NAR.js} +2 -2
- package/ui/.output/server/chunks/_/hooksTemplate.mjs +365 -0
- package/ui/.output/server/chunks/_/hooksTemplate.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{Badge-YPOjmkfv.mjs → Badge-nNgbDd8N.mjs} +2 -2
- package/ui/.output/server/chunks/build/{Badge-YPOjmkfv.mjs.map → Badge-nNgbDd8N.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/{Button-CZHl6fpI.mjs → Button-CQZG7w2L.mjs} +117 -3
- package/ui/.output/server/chunks/build/Button-CQZG7w2L.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{Card--ibiHV_r.mjs → Card-DdEnDTQW.mjs} +2 -2
- package/ui/.output/server/chunks/build/{Card--ibiHV_r.mjs.map → Card-DdEnDTQW.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/{FormGroup-CX5VmH8y.mjs → FormGroup-BfYiVGgN.mjs} +2 -2
- package/ui/.output/server/chunks/build/{FormGroup-CX5VmH8y.mjs.map → FormGroup-BfYiVGgN.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/{Input-kmqS1oY_.mjs → Input-Cnk3P_aB.mjs} +5 -60
- package/ui/.output/server/chunks/build/Input-Cnk3P_aB.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{Modal-DmZs0Ekg.mjs → Modal-DfVO6DJD.mjs} +10 -5
- package/ui/.output/server/chunks/build/Modal-DfVO6DJD.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{Select-n4_YfXfk.mjs → Select-Dc9_TJIR.mjs} +3 -3
- package/ui/.output/server/chunks/build/{Select-n4_YfXfk.mjs.map → Select-Dc9_TJIR.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/ui/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
- package/ui/.output/server/chunks/build/{config-Bkb2wy7R.mjs → config-BUokZPak.mjs} +78 -58
- package/ui/.output/server/chunks/build/config-BUokZPak.mjs.map +1 -0
- package/ui/.output/server/chunks/build/config-styles.irltMnuD.mjs +8 -0
- package/ui/.output/server/chunks/build/config-styles.irltMnuD.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{default-DmD3qBXZ.mjs → default-6TcwTt3p.mjs} +10 -9
- package/ui/.output/server/chunks/build/default-6TcwTt3p.mjs.map +1 -0
- package/ui/.output/server/chunks/build/default-styles.BqL9zxh4.mjs +8 -0
- package/ui/.output/server/chunks/build/default-styles.BqL9zxh4.mjs.map +1 -0
- package/ui/.output/server/chunks/build/entry-styles.q-b4rEBh.mjs +11 -0
- package/ui/.output/server/chunks/build/entry-styles.q-b4rEBh.mjs.map +1 -0
- package/ui/.output/server/chunks/build/hooks-k2ZmlVpA.mjs +4181 -0
- package/ui/.output/server/chunks/build/hooks-k2ZmlVpA.mjs.map +1 -0
- package/ui/.output/server/chunks/build/hooks-styles.Ddk4F_Gj.mjs +8 -0
- package/ui/.output/server/chunks/build/hooks-styles.Ddk4F_Gj.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{index-Dy4Tu7MB.mjs → index-DwMIJp2e.mjs} +7 -3
- package/ui/.output/server/chunks/build/index-DwMIJp2e.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{index-BvfXQQ2n.mjs → index-JLPhao-C.mjs} +5 -5
- package/ui/.output/server/chunks/build/{index-BvfXQQ2n.mjs.map → index-JLPhao-C.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/{interval-DHZqEf-n.mjs → interval-DPa3fpS0.mjs} +3 -3
- package/ui/.output/server/chunks/build/{interval-DHZqEf-n.mjs.map → interval-DPa3fpS0.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/{login-B5YkLJCV.mjs → login-D9DpNq3o.mjs} +6 -5
- package/ui/.output/server/chunks/build/login-D9DpNq3o.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{logs-BvD1Y3HI.mjs → logs-BVuWOSb6.mjs} +49 -31
- package/ui/.output/server/chunks/build/logs-BVuWOSb6.mjs.map +1 -0
- package/ui/.output/server/chunks/build/logs-styles.C2Mi0JvX.mjs +8 -0
- package/ui/.output/server/chunks/build/logs-styles.C2Mi0JvX.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{run-BStPkbGg.mjs → run-BVQZSGcX.mjs} +5 -5
- package/ui/.output/server/chunks/build/{run-BStPkbGg.mjs.map → run-BVQZSGcX.mjs.map} +1 -1
- package/ui/.output/server/chunks/build/{schedule-B2UKsnRW.mjs → schedule-rRz2CwWh.mjs} +10 -9
- package/ui/.output/server/chunks/build/schedule-rRz2CwWh.mjs.map +1 -0
- package/ui/.output/server/chunks/build/server.mjs +14 -9
- package/ui/.output/server/chunks/build/server.mjs.map +1 -1
- package/ui/.output/server/chunks/build/styles.mjs +6 -5
- package/ui/.output/server/chunks/build/styles.mjs.map +1 -1
- package/ui/.output/server/chunks/build/{tasks-DBH3Z6lg.mjs → tasks-DJjZQWcq.mjs} +10 -9
- package/ui/.output/server/chunks/build/tasks-DJjZQWcq.mjs.map +1 -0
- package/ui/.output/server/chunks/build/{useApi-Bqajqsuz.mjs → useApi-Brbyp7hV.mjs} +3 -3
- package/ui/.output/server/chunks/build/useApi-Brbyp7hV.mjs.map +1 -0
- package/ui/.output/server/chunks/build/useFormGroup-DqE91r20.mjs +61 -0
- package/ui/.output/server/chunks/build/useFormGroup-DqE91r20.mjs.map +1 -0
- package/ui/.output/server/chunks/nitro/nitro.mjs +189 -151
- package/ui/.output/server/chunks/routes/api/config/test.post.mjs +1 -1
- package/ui/.output/server/chunks/routes/api/config/test.post.mjs.map +1 -1
- package/ui/.output/server/chunks/routes/api/hooks-execute.post.mjs +83 -0
- package/ui/.output/server/chunks/routes/api/hooks-execute.post.mjs.map +1 -0
- package/ui/.output/server/chunks/routes/api/hooks-regenerate.post.mjs +31 -0
- package/ui/.output/server/chunks/routes/api/hooks-regenerate.post.mjs.map +1 -0
- package/ui/.output/server/chunks/routes/api/hooks-update.post.mjs +31 -0
- package/ui/.output/server/chunks/routes/api/hooks-update.post.mjs.map +1 -0
- package/ui/.output/server/chunks/routes/api/hooks.get.mjs +28 -0
- package/ui/.output/server/chunks/routes/api/hooks.get.mjs.map +1 -0
- package/ui/.output/server/chunks/routes/api/hooks.put.mjs +33 -0
- package/ui/.output/server/chunks/routes/api/hooks.put.mjs.map +1 -0
- package/ui/.output/server/chunks/routes/api/logs.get.mjs +7 -2
- package/ui/.output/server/chunks/routes/api/logs.get.mjs.map +1 -1
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/_virtual/_rollupPluginBabelHelpers.js +123 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/config/index.js +11 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/index.js +9 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/loader/index.js +175 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/utils/compose.js +16 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/utils/curry.js +20 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/utils/deepMerge.js +18 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/utils/isObject.js +9 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/utils/makeCancelable.js +25 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/lib/cjs/validators/index.js +49 -0
- package/ui/.output/server/node_modules/@monaco-editor/loader/package.json +51 -0
- package/ui/.output/server/node_modules/@tanstack/virtual-core/dist/esm/index.js +1197 -0
- package/ui/.output/server/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +34 -0
- package/ui/.output/server/node_modules/@tanstack/virtual-core/dist/esm/utils.js +74 -0
- package/ui/.output/server/node_modules/@tanstack/virtual-core/package.json +56 -0
- package/ui/.output/server/node_modules/@tanstack/vue-virtual/dist/esm/index.js +66 -0
- package/ui/.output/server/node_modules/@tanstack/vue-virtual/package.json +68 -0
- package/ui/.output/server/node_modules/state-local/lib/cjs/state-local.js +195 -0
- package/ui/.output/server/node_modules/state-local/package.json +59 -0
- package/ui/.output/server/package.json +4 -0
- package/ui/package.json +1 -0
- package/ui/.output/public/_nuxt/B93YYUZf.js +0 -1
- package/ui/.output/public/_nuxt/BAs1isOw.js +0 -1
- package/ui/.output/public/_nuxt/BrZL2iQr.js +0 -1
- package/ui/.output/public/_nuxt/Bv6Ws9vz.js +0 -1
- package/ui/.output/public/_nuxt/C2WdrjFS.js +0 -1
- package/ui/.output/public/_nuxt/CVTgFccA.js +0 -2
- package/ui/.output/public/_nuxt/Ceb2855t.js +0 -1
- package/ui/.output/public/_nuxt/Cg55PjEy.js +0 -4
- package/ui/.output/public/_nuxt/D0ZgktSu.js +0 -1
- package/ui/.output/public/_nuxt/DZIUG6ZX.js +0 -1
- package/ui/.output/public/_nuxt/DihqGT4A.js +0 -1
- package/ui/.output/public/_nuxt/MzK2TZ-I.js +0 -16
- package/ui/.output/public/_nuxt/TJXLPQOj.js +0 -1
- package/ui/.output/public/_nuxt/VuiIFQtE.js +0 -1
- package/ui/.output/public/_nuxt/config.C19X1GwO.css +0 -1
- package/ui/.output/public/_nuxt/default.Dw-0Xw5D.css +0 -1
- package/ui/.output/public/_nuxt/logs.PK6CTQHM.css +0 -1
- package/ui/.output/server/chunks/build/Button-CZHl6fpI.mjs.map +0 -1
- package/ui/.output/server/chunks/build/Input-kmqS1oY_.mjs.map +0 -1
- package/ui/.output/server/chunks/build/Modal-DmZs0Ekg.mjs.map +0 -1
- package/ui/.output/server/chunks/build/config-Bkb2wy7R.mjs.map +0 -1
- package/ui/.output/server/chunks/build/config-styles.B4mTchgT.mjs +0 -8
- package/ui/.output/server/chunks/build/config-styles.B4mTchgT.mjs.map +0 -1
- package/ui/.output/server/chunks/build/default-DmD3qBXZ.mjs.map +0 -1
- package/ui/.output/server/chunks/build/default-styles.DmprFUrQ.mjs +0 -8
- package/ui/.output/server/chunks/build/default-styles.DmprFUrQ.mjs.map +0 -1
- package/ui/.output/server/chunks/build/entry-styles.Cg1Sndbr.mjs +0 -11
- package/ui/.output/server/chunks/build/entry-styles.Cg1Sndbr.mjs.map +0 -1
- package/ui/.output/server/chunks/build/index-Dy4Tu7MB.mjs.map +0 -1
- package/ui/.output/server/chunks/build/login-B5YkLJCV.mjs.map +0 -1
- package/ui/.output/server/chunks/build/logs-BvD1Y3HI.mjs.map +0 -1
- package/ui/.output/server/chunks/build/logs-styles.CU5b1wKf.mjs +0 -8
- package/ui/.output/server/chunks/build/logs-styles.CU5b1wKf.mjs.map +0 -1
- package/ui/.output/server/chunks/build/schedule-B2UKsnRW.mjs.map +0 -1
- package/ui/.output/server/chunks/build/tasks-DBH3Z6lg.mjs.map +0 -1
- package/ui/.output/server/chunks/build/useApi-Bqajqsuz.mjs.map +0 -1
|
@@ -0,0 +1,4181 @@
|
|
|
1
|
+
import { _ as __nuxt_component_0 } from './Card-DdEnDTQW.mjs';
|
|
2
|
+
import { a as __nuxt_component_1$1, _ as __nuxt_component_0$1, c as useUI, u as useInjectButtonGroup, s as select, b as selectMenu } from './Button-CQZG7w2L.mjs';
|
|
3
|
+
import { a as __nuxt_component_2, _ as __nuxt_component_1$2, u as useApi } from './useApi-Brbyp7hV.mjs';
|
|
4
|
+
import { defineComponent, ref, watch, mergeProps, withCtx, unref, createVNode, openBlock, createBlock, createCommentVNode, isRef, toDisplayString, createTextVNode, Fragment, renderList, withDirectives, vModelText, nextTick, resolveComponent, resolveDynamicComponent, renderSlot, Transition, toRef, computed, toRaw, watchEffect, provide, h as h$1, inject, reactive, cloneVNode, useId, useSSRContext } from 'vue';
|
|
5
|
+
import { useVirtualizer } from '@tanstack/vue-virtual';
|
|
6
|
+
import { _ as __nuxt_component_7, s as s$4, b as i$5, g as u$5, c as o$1$1, A as A$2, l as l$1, i as i$1$1, w as w$2, j as w$4, h, e as t$2, f as f$1$1, E as E$2, u as u$3, T as T$1, a as i$3, O, N as N$3, o as o$2, t as t$1, d as o$3, n as n$2 } from './Modal-DfVO6DJD.mjs';
|
|
7
|
+
import { useDebounceFn, computedAsync } from '@vueuse/core';
|
|
8
|
+
import { k as defu, B as isEqual } from '../nitro/nitro.mjs';
|
|
9
|
+
import { twJoin } from 'tailwind-merge';
|
|
10
|
+
import { u as useFormGroup } from './useFormGroup-DqE91r20.mjs';
|
|
11
|
+
import { t as twMerge, a as appConfig, g as get, m as mergeConfig } from './server.mjs';
|
|
12
|
+
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderVNode, ssrIncludeBooleanAttr, ssrRenderClass, ssrRenderSlot, ssrRenderStyle } from 'vue/server-renderer';
|
|
13
|
+
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
|
|
14
|
+
import { a as __nuxt_component_4 } from './index-DwMIJp2e.mjs';
|
|
15
|
+
import './nuxt-link-B3UD8izG.mjs';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import 'node:module';
|
|
18
|
+
import 'node:fs';
|
|
19
|
+
import 'node:os';
|
|
20
|
+
import 'dotenv';
|
|
21
|
+
import 'node:http';
|
|
22
|
+
import 'node:https';
|
|
23
|
+
import 'node:events';
|
|
24
|
+
import 'node:buffer';
|
|
25
|
+
import 'node:crypto';
|
|
26
|
+
import 'node:async_hooks';
|
|
27
|
+
import 'node:url';
|
|
28
|
+
import 'node:net';
|
|
29
|
+
import '@iconify/utils';
|
|
30
|
+
import 'consola';
|
|
31
|
+
import 'vue-router';
|
|
32
|
+
import '@iconify/vue';
|
|
33
|
+
import '../routes/renderer.mjs';
|
|
34
|
+
import 'vue-bundle-renderer/runtime';
|
|
35
|
+
import 'unhead/server';
|
|
36
|
+
import 'devalue';
|
|
37
|
+
import 'unhead/utils';
|
|
38
|
+
import 'unhead/plugins';
|
|
39
|
+
import '@iconify/utils/lib/css/icon';
|
|
40
|
+
import 'perfect-debounce';
|
|
41
|
+
|
|
42
|
+
function d(u2, e2, r2) {
|
|
43
|
+
let i2 = ref(r2 == null ? void 0 : r2.value), f2 = computed(() => u2.value !== void 0);
|
|
44
|
+
return [computed(() => f2.value ? u2.value : i2.value), function(t2) {
|
|
45
|
+
return f2.value || (i2.value = t2), e2 == null ? void 0 : e2(t2);
|
|
46
|
+
}];
|
|
47
|
+
}
|
|
48
|
+
function i$1() {
|
|
49
|
+
let o2 = o$3();
|
|
50
|
+
return o2;
|
|
51
|
+
}
|
|
52
|
+
function t() {
|
|
53
|
+
let e2 = i$1();
|
|
54
|
+
return (o2) => {
|
|
55
|
+
e2.dispose(), e2.nextFrame(o2);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function r$1(t2, e2) {
|
|
59
|
+
if (t2) return t2;
|
|
60
|
+
let n2 = e2 != null ? e2 : "button";
|
|
61
|
+
if (typeof n2 == "string" && n2.toLowerCase() === "button") return "button";
|
|
62
|
+
}
|
|
63
|
+
function s(t2, e2) {
|
|
64
|
+
let n2 = ref(r$1(t2.value.type, t2.value.as));
|
|
65
|
+
return watchEffect(() => {
|
|
66
|
+
var u2;
|
|
67
|
+
n2.value || o$1$1(e2) && o$1$1(e2) instanceof HTMLButtonElement && !((u2 = o$1$1(e2)) != null && u2.hasAttribute("type")) && (n2.value = "button");
|
|
68
|
+
}), n2;
|
|
69
|
+
}
|
|
70
|
+
function r(e2) {
|
|
71
|
+
return [e2.screenX, e2.screenY];
|
|
72
|
+
}
|
|
73
|
+
function u$1() {
|
|
74
|
+
let e2 = ref([-1, -1]);
|
|
75
|
+
return { wasMoved(n2) {
|
|
76
|
+
let t2 = r(n2);
|
|
77
|
+
return e2.value[0] === t2[0] && e2.value[1] === t2[1] ? false : (e2.value = t2, true);
|
|
78
|
+
}, update(n2) {
|
|
79
|
+
e2.value = r(n2);
|
|
80
|
+
} };
|
|
81
|
+
}
|
|
82
|
+
function i({ container: e2, accept: t2, walk: d2, enabled: o2 }) {
|
|
83
|
+
watchEffect(() => {
|
|
84
|
+
let r2 = e2.value;
|
|
85
|
+
if (!r2 || o2 !== void 0 && !o2.value) return;
|
|
86
|
+
let l2 = i$3(e2);
|
|
87
|
+
if (!l2) return;
|
|
88
|
+
let c2 = Object.assign((f2) => t2(f2), { acceptNode: t2 }), n2 = l2.createTreeWalker(r2, NodeFilter.SHOW_ELEMENT, c2, false);
|
|
89
|
+
for (; n2.nextNode(); ) d2(n2.currentNode);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
var g$1 = ((f2) => (f2[f2.Left = 0] = "Left", f2[f2.Right = 2] = "Right", f2))(g$1 || {});
|
|
93
|
+
function u(l2) {
|
|
94
|
+
throw new Error("Unexpected object: " + l2);
|
|
95
|
+
}
|
|
96
|
+
var c = ((i2) => (i2[i2.First = 0] = "First", i2[i2.Previous = 1] = "Previous", i2[i2.Next = 2] = "Next", i2[i2.Last = 3] = "Last", i2[i2.Specific = 4] = "Specific", i2[i2.Nothing = 5] = "Nothing", i2))(c || {});
|
|
97
|
+
function f$1(l2, n2) {
|
|
98
|
+
let t2 = n2.resolveItems();
|
|
99
|
+
if (t2.length <= 0) return null;
|
|
100
|
+
let r2 = n2.resolveActiveIndex(), s2 = r2 != null ? r2 : -1;
|
|
101
|
+
switch (l2.focus) {
|
|
102
|
+
case 0: {
|
|
103
|
+
for (let e2 = 0; e2 < t2.length; ++e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2;
|
|
104
|
+
return r2;
|
|
105
|
+
}
|
|
106
|
+
case 1: {
|
|
107
|
+
s2 === -1 && (s2 = t2.length);
|
|
108
|
+
for (let e2 = s2 - 1; e2 >= 0; --e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2;
|
|
109
|
+
return r2;
|
|
110
|
+
}
|
|
111
|
+
case 2: {
|
|
112
|
+
for (let e2 = s2 + 1; e2 < t2.length; ++e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2;
|
|
113
|
+
return r2;
|
|
114
|
+
}
|
|
115
|
+
case 3: {
|
|
116
|
+
for (let e2 = t2.length - 1; e2 >= 0; --e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2;
|
|
117
|
+
return r2;
|
|
118
|
+
}
|
|
119
|
+
case 4: {
|
|
120
|
+
for (let e2 = 0; e2 < t2.length; ++e2) if (n2.resolveId(t2[e2], e2, t2) === l2.id) return e2;
|
|
121
|
+
return r2;
|
|
122
|
+
}
|
|
123
|
+
case 5:
|
|
124
|
+
return null;
|
|
125
|
+
default:
|
|
126
|
+
u(l2);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function e(i2 = {}, s2 = null, t2 = []) {
|
|
130
|
+
for (let [r2, n2] of Object.entries(i2)) o$1(t2, f(s2, r2), n2);
|
|
131
|
+
return t2;
|
|
132
|
+
}
|
|
133
|
+
function f(i2, s2) {
|
|
134
|
+
return i2 ? i2 + "[" + s2 + "]" : s2;
|
|
135
|
+
}
|
|
136
|
+
function o$1(i2, s2, t2) {
|
|
137
|
+
if (Array.isArray(t2)) for (let [r2, n2] of t2.entries()) o$1(i2, f(s2, r2.toString()), n2);
|
|
138
|
+
else t2 instanceof Date ? i2.push([s2, t2.toISOString()]) : typeof t2 == "boolean" ? i2.push([s2, t2 ? "1" : "0"]) : typeof t2 == "string" ? i2.push([s2, t2]) : typeof t2 == "number" ? i2.push([s2, `${t2}`]) : t2 == null ? i2.push([s2, ""]) : e(t2, s2, i2);
|
|
139
|
+
}
|
|
140
|
+
function De(a2, h2) {
|
|
141
|
+
return a2 === h2;
|
|
142
|
+
}
|
|
143
|
+
var Ee = ((r2) => (r2[r2.Open = 0] = "Open", r2[r2.Closed = 1] = "Closed", r2))(Ee || {}), Ve = ((r2) => (r2[r2.Single = 0] = "Single", r2[r2.Multi = 1] = "Multi", r2))(Ve || {}), ke = ((y) => (y[y.Pointer = 0] = "Pointer", y[y.Focus = 1] = "Focus", y[y.Other = 2] = "Other", y))(ke || {});
|
|
144
|
+
let ne = /* @__PURE__ */ Symbol("ComboboxContext");
|
|
145
|
+
function K(a2) {
|
|
146
|
+
let h2 = inject(ne, null);
|
|
147
|
+
if (h2 === null) {
|
|
148
|
+
let r2 = new Error(`<${a2} /> is missing a parent <Combobox /> component.`);
|
|
149
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r2, K), r2;
|
|
150
|
+
}
|
|
151
|
+
return h2;
|
|
152
|
+
}
|
|
153
|
+
let ie = /* @__PURE__ */ Symbol("VirtualContext"), Ae$1 = defineComponent({ name: "VirtualProvider", setup(a2, { slots: h$12 }) {
|
|
154
|
+
let r2 = K("VirtualProvider"), y = computed(() => {
|
|
155
|
+
let c2 = o$1$1(r2.optionsRef);
|
|
156
|
+
if (!c2) return { start: 0, end: 0 };
|
|
157
|
+
let f2 = (void 0).getComputedStyle(c2);
|
|
158
|
+
return { start: parseFloat(f2.paddingBlockStart || f2.paddingTop), end: parseFloat(f2.paddingBlockEnd || f2.paddingBottom) };
|
|
159
|
+
}), o2 = useVirtualizer(computed(() => ({ scrollPaddingStart: y.value.start, scrollPaddingEnd: y.value.end, count: r2.virtual.value.options.length, estimateSize() {
|
|
160
|
+
return 40;
|
|
161
|
+
}, getScrollElement() {
|
|
162
|
+
return o$1$1(r2.optionsRef);
|
|
163
|
+
}, overscan: 12 }))), u2 = computed(() => {
|
|
164
|
+
var c2;
|
|
165
|
+
return (c2 = r2.virtual.value) == null ? void 0 : c2.options;
|
|
166
|
+
}), e2 = ref(0);
|
|
167
|
+
return watch([u2], () => {
|
|
168
|
+
e2.value += 1;
|
|
169
|
+
}), provide(ie, r2.virtual.value ? o2 : null), () => [h$1("div", { style: { position: "relative", width: "100%", height: `${o2.value.getTotalSize()}px` }, ref: (c2) => {
|
|
170
|
+
if (c2) {
|
|
171
|
+
if (typeof process != "undefined" && process.env.JEST_WORKER_ID !== void 0 || r2.activationTrigger.value === 0) return;
|
|
172
|
+
r2.activeOptionIndex.value !== null && r2.virtual.value.options.length > r2.activeOptionIndex.value && o2.value.scrollToIndex(r2.activeOptionIndex.value);
|
|
173
|
+
}
|
|
174
|
+
} }, o2.value.getVirtualItems().map((c2) => cloneVNode(h$12.default({ option: r2.virtual.value.options[c2.index], open: r2.comboboxState.value === 0 })[0], { key: `${e2.value}-${c2.index}`, "data-index": c2.index, "aria-setsize": r2.virtual.value.options.length, "aria-posinset": c2.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${c2.start}px)`, overflowAnchor: "none" } })))];
|
|
175
|
+
} }), lt = defineComponent({ name: "Combobox", emits: { "update:modelValue": (a2) => true }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: false }, by: { type: [String, Function], nullable: true, default: null }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: true }, name: { type: String, optional: true }, nullable: { type: Boolean, default: false }, multiple: { type: [Boolean], default: false }, immediate: { type: [Boolean], default: false }, virtual: { type: Object, default: null } }, inheritAttrs: false, setup(a2, { slots: h$12, attrs: r2, emit: y }) {
|
|
176
|
+
let o2 = ref(1), u2 = ref(null), e$1 = ref(null), c$1 = ref(null), f2 = ref(null), S = ref({ static: false, hold: false }), v = ref([]), d$1 = ref(null), D = ref(2), E$1 = ref(false);
|
|
177
|
+
function w$12(t2 = (n2) => n2) {
|
|
178
|
+
let n2 = d$1.value !== null ? v.value[d$1.value] : null, s2 = t2(v.value.slice()), b = s2.length > 0 && s2[0].dataRef.order.value !== null ? s2.sort((C, A2) => C.dataRef.order.value - A2.dataRef.order.value) : O(s2, (C) => o$1$1(C.dataRef.domRef)), O$1 = n2 ? b.indexOf(n2) : null;
|
|
179
|
+
return O$1 === -1 && (O$1 = null), { options: b, activeOptionIndex: O$1 };
|
|
180
|
+
}
|
|
181
|
+
let M = computed(() => a2.multiple ? 1 : 0), $2 = computed(() => a2.nullable), [B, p2] = d(computed(() => a2.modelValue), (t2) => y("update:modelValue", t2), computed(() => a2.defaultValue)), R = computed(() => B.value === void 0 ? u$5(M.value, { [1]: [], [0]: void 0 }) : B.value), V = null, i2 = null;
|
|
182
|
+
function I(t2) {
|
|
183
|
+
return u$5(M.value, { [0]() {
|
|
184
|
+
return p2 == null ? void 0 : p2(t2);
|
|
185
|
+
}, [1]: () => {
|
|
186
|
+
let n2 = toRaw(l2.value.value).slice(), s2 = toRaw(t2), b = n2.findIndex((O2) => l2.compare(s2, toRaw(O2)));
|
|
187
|
+
return b === -1 ? n2.push(s2) : n2.splice(b, 1), p2 == null ? void 0 : p2(n2);
|
|
188
|
+
} });
|
|
189
|
+
}
|
|
190
|
+
let T$1$1 = computed(() => {
|
|
191
|
+
});
|
|
192
|
+
watch([T$1$1], ([t2], [n2]) => {
|
|
193
|
+
if (l2.virtual.value && t2 && n2 && d$1.value !== null) {
|
|
194
|
+
let s2 = t2.indexOf(n2[d$1.value]);
|
|
195
|
+
s2 !== -1 ? d$1.value = s2 : d$1.value = null;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
let l2 = { comboboxState: o2, value: R, mode: M, compare(t2, n2) {
|
|
199
|
+
if (typeof a2.by == "string") {
|
|
200
|
+
let s2 = a2.by;
|
|
201
|
+
return (t2 == null ? void 0 : t2[s2]) === (n2 == null ? void 0 : n2[s2]);
|
|
202
|
+
}
|
|
203
|
+
return a2.by === null ? De(t2, n2) : a2.by(t2, n2);
|
|
204
|
+
}, calculateIndex(t2) {
|
|
205
|
+
return l2.virtual.value ? a2.by === null ? l2.virtual.value.options.indexOf(t2) : l2.virtual.value.options.findIndex((n2) => l2.compare(n2, t2)) : v.value.findIndex((n2) => l2.compare(n2.dataRef.value, t2));
|
|
206
|
+
}, defaultValue: computed(() => a2.defaultValue), nullable: $2, immediate: computed(() => false), virtual: computed(() => null), inputRef: e$1, labelRef: u2, buttonRef: c$1, optionsRef: f2, disabled: computed(() => a2.disabled), options: v, change(t2) {
|
|
207
|
+
p2(t2);
|
|
208
|
+
}, activeOptionIndex: computed(() => {
|
|
209
|
+
if (E$1.value && d$1.value === null && (l2.virtual.value ? l2.virtual.value.options.length > 0 : v.value.length > 0)) {
|
|
210
|
+
if (l2.virtual.value) {
|
|
211
|
+
let n2 = l2.virtual.value.options.findIndex((s2) => {
|
|
212
|
+
var b;
|
|
213
|
+
return !((b = l2.virtual.value) != null && b.disabled(s2));
|
|
214
|
+
});
|
|
215
|
+
if (n2 !== -1) return n2;
|
|
216
|
+
}
|
|
217
|
+
let t2 = v.value.findIndex((n2) => !n2.dataRef.disabled);
|
|
218
|
+
if (t2 !== -1) return t2;
|
|
219
|
+
}
|
|
220
|
+
return d$1.value;
|
|
221
|
+
}), activationTrigger: D, optionsPropsRef: S, closeCombobox() {
|
|
222
|
+
E$1.value = false, !a2.disabled && o2.value !== 1 && (o2.value = 1, d$1.value = null);
|
|
223
|
+
}, openCombobox() {
|
|
224
|
+
if (E$1.value = true, !a2.disabled && o2.value !== 0) {
|
|
225
|
+
if (l2.value.value) {
|
|
226
|
+
let t2 = l2.calculateIndex(l2.value.value);
|
|
227
|
+
t2 !== -1 && (d$1.value = t2);
|
|
228
|
+
}
|
|
229
|
+
o2.value = 0;
|
|
230
|
+
}
|
|
231
|
+
}, setActivationTrigger(t2) {
|
|
232
|
+
D.value = t2;
|
|
233
|
+
}, goToOption(t2, n2, s2) {
|
|
234
|
+
E$1.value = false, V !== null && cancelAnimationFrame(V), V = requestAnimationFrame(() => {
|
|
235
|
+
if (a2.disabled || f2.value && !S.value.static && o2.value === 1) return;
|
|
236
|
+
if (l2.virtual.value) {
|
|
237
|
+
d$1.value = t2 === c.Specific ? n2 : f$1({ focus: t2 }, { resolveItems: () => l2.virtual.value.options, resolveActiveIndex: () => {
|
|
238
|
+
var C, A2;
|
|
239
|
+
return (A2 = (C = l2.activeOptionIndex.value) != null ? C : l2.virtual.value.options.findIndex((j) => {
|
|
240
|
+
var q;
|
|
241
|
+
return !((q = l2.virtual.value) != null && q.disabled(j));
|
|
242
|
+
})) != null ? A2 : null;
|
|
243
|
+
}, resolveDisabled: (C) => l2.virtual.value.disabled(C), resolveId() {
|
|
244
|
+
throw new Error("Function not implemented.");
|
|
245
|
+
} }), D.value = s2 != null ? s2 : 2;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
let b = w$12();
|
|
249
|
+
if (b.activeOptionIndex === null) {
|
|
250
|
+
let C = b.options.findIndex((A2) => !A2.dataRef.disabled);
|
|
251
|
+
C !== -1 && (b.activeOptionIndex = C);
|
|
252
|
+
}
|
|
253
|
+
let O2 = t2 === c.Specific ? n2 : f$1({ focus: t2 }, { resolveItems: () => b.options, resolveActiveIndex: () => b.activeOptionIndex, resolveId: (C) => C.id, resolveDisabled: (C) => C.dataRef.disabled });
|
|
254
|
+
d$1.value = O2, D.value = s2 != null ? s2 : 2, v.value = b.options;
|
|
255
|
+
});
|
|
256
|
+
}, selectOption(t2) {
|
|
257
|
+
let n2 = v.value.find((b) => b.id === t2);
|
|
258
|
+
if (!n2) return;
|
|
259
|
+
let { dataRef: s2 } = n2;
|
|
260
|
+
I(s2.value);
|
|
261
|
+
}, selectActiveOption() {
|
|
262
|
+
if (l2.activeOptionIndex.value !== null) {
|
|
263
|
+
if (l2.virtual.value) I(l2.virtual.value.options[l2.activeOptionIndex.value]);
|
|
264
|
+
else {
|
|
265
|
+
let { dataRef: t2 } = v.value[l2.activeOptionIndex.value];
|
|
266
|
+
I(t2.value);
|
|
267
|
+
}
|
|
268
|
+
l2.goToOption(c.Specific, l2.activeOptionIndex.value);
|
|
269
|
+
}
|
|
270
|
+
}, registerOption(t2, n2) {
|
|
271
|
+
let s2 = reactive({ id: t2, dataRef: n2 });
|
|
272
|
+
if (l2.virtual.value) {
|
|
273
|
+
v.value.push(s2);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
i2 && cancelAnimationFrame(i2);
|
|
277
|
+
let b = w$12((O2) => (O2.push(s2), O2));
|
|
278
|
+
d$1.value === null && l2.isSelected(n2.value.value) && (b.activeOptionIndex = b.options.indexOf(s2)), v.value = b.options, d$1.value = b.activeOptionIndex, D.value = 2, b.options.some((O2) => !o$1$1(O2.dataRef.domRef)) && (i2 = requestAnimationFrame(() => {
|
|
279
|
+
let O2 = w$12();
|
|
280
|
+
v.value = O2.options, d$1.value = O2.activeOptionIndex;
|
|
281
|
+
}));
|
|
282
|
+
}, unregisterOption(t2, n2) {
|
|
283
|
+
if (V !== null && cancelAnimationFrame(V), n2 && (E$1.value = true), l2.virtual.value) {
|
|
284
|
+
v.value = v.value.filter((b) => b.id !== t2);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
let s2 = w$12((b) => {
|
|
288
|
+
let O2 = b.findIndex((C) => C.id === t2);
|
|
289
|
+
return O2 !== -1 && b.splice(O2, 1), b;
|
|
290
|
+
});
|
|
291
|
+
v.value = s2.options, d$1.value = s2.activeOptionIndex, D.value = 2;
|
|
292
|
+
}, isSelected(t2) {
|
|
293
|
+
return u$5(M.value, { [0]: () => l2.compare(toRaw(l2.value.value), toRaw(t2)), [1]: () => toRaw(l2.value.value).some((n2) => l2.compare(toRaw(n2), toRaw(t2))) });
|
|
294
|
+
}, isActive(t2) {
|
|
295
|
+
return d$1.value === l2.calculateIndex(t2);
|
|
296
|
+
} };
|
|
297
|
+
w$2([e$1, c$1, f2], () => l2.closeCombobox(), computed(() => o2.value === 0)), provide(ne, l2), t$2(computed(() => u$5(o2.value, { [0]: i$1$1.Open, [1]: i$1$1.Closed })));
|
|
298
|
+
computed(() => {
|
|
299
|
+
var t2;
|
|
300
|
+
return (t2 = o$1$1(e$1)) == null ? void 0 : t2.closest("form");
|
|
301
|
+
});
|
|
302
|
+
return () => {
|
|
303
|
+
var C, A2, j;
|
|
304
|
+
let { name: t2, disabled: n2, form: s2, ...b } = a2, O2 = { open: o2.value === 0, disabled: n2, activeIndex: l2.activeOptionIndex.value, activeOption: l2.activeOptionIndex.value === null ? null : l2.virtual.value ? l2.virtual.value.options[(C = l2.activeOptionIndex.value) != null ? C : 0] : (j = (A2 = l2.options.value[l2.activeOptionIndex.value]) == null ? void 0 : A2.dataRef.value) != null ? j : null, value: R.value };
|
|
305
|
+
return h$1(Fragment, [...t2 != null && R.value != null ? e({ [t2]: R.value }).map(([q, ue]) => h$1(f$1$1, E$2({ features: u$3.Hidden, key: q, as: "input", type: "hidden", hidden: true, readOnly: true, form: s2, disabled: n2, name: q, value: ue }))) : [], A$2({ theirProps: { ...r2, ...T$1(b, ["by", "defaultValue", "immediate", "modelValue", "multiple", "nullable", "onUpdate:modelValue", "virtual"]) }, ourProps: {}, slot: O2, slots: h$12, attrs: r2, name: "Combobox" })]);
|
|
306
|
+
};
|
|
307
|
+
} });
|
|
308
|
+
defineComponent({ name: "ComboboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(a2, { attrs: h2, slots: r2 }) {
|
|
309
|
+
var e2;
|
|
310
|
+
let y = (e2 = a2.id) != null ? e2 : `headlessui-combobox-label-${i$5()}`, o2 = K("ComboboxLabel");
|
|
311
|
+
function u2() {
|
|
312
|
+
var c2;
|
|
313
|
+
(c2 = o$1$1(o2.inputRef)) == null || c2.focus({ preventScroll: true });
|
|
314
|
+
}
|
|
315
|
+
return () => {
|
|
316
|
+
let c2 = { open: o2.comboboxState.value === 0, disabled: o2.disabled.value }, { ...f2 } = a2, S = { id: y, ref: o2.labelRef, onClick: u2 };
|
|
317
|
+
return A$2({ ourProps: S, theirProps: f2, slot: c2, attrs: h2, slots: r2, name: "ComboboxLabel" });
|
|
318
|
+
};
|
|
319
|
+
} });
|
|
320
|
+
let nt = defineComponent({ name: "ComboboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: null } }, setup(a2, { attrs: h2, slots: r2, expose: y }) {
|
|
321
|
+
var S;
|
|
322
|
+
let o2 = (S = a2.id) != null ? S : `headlessui-combobox-button-${i$5()}`, u2 = K("ComboboxButton");
|
|
323
|
+
y({ el: u2.buttonRef, $el: u2.buttonRef });
|
|
324
|
+
function e2(v) {
|
|
325
|
+
u2.disabled.value || (u2.comboboxState.value === 0 ? u2.closeCombobox() : (v.preventDefault(), u2.openCombobox()), nextTick(() => {
|
|
326
|
+
var d2;
|
|
327
|
+
return (d2 = o$1$1(u2.inputRef)) == null ? void 0 : d2.focus({ preventScroll: true });
|
|
328
|
+
}));
|
|
329
|
+
}
|
|
330
|
+
function c$1(v) {
|
|
331
|
+
switch (v.key) {
|
|
332
|
+
case o$2.ArrowDown:
|
|
333
|
+
v.preventDefault(), v.stopPropagation(), u2.comboboxState.value === 1 && u2.openCombobox(), nextTick(() => {
|
|
334
|
+
var d2;
|
|
335
|
+
return (d2 = u2.inputRef.value) == null ? void 0 : d2.focus({ preventScroll: true });
|
|
336
|
+
});
|
|
337
|
+
return;
|
|
338
|
+
case o$2.ArrowUp:
|
|
339
|
+
v.preventDefault(), v.stopPropagation(), u2.comboboxState.value === 1 && (u2.openCombobox(), nextTick(() => {
|
|
340
|
+
u2.value.value || u2.goToOption(c.Last);
|
|
341
|
+
})), nextTick(() => {
|
|
342
|
+
var d2;
|
|
343
|
+
return (d2 = u2.inputRef.value) == null ? void 0 : d2.focus({ preventScroll: true });
|
|
344
|
+
});
|
|
345
|
+
return;
|
|
346
|
+
case o$2.Escape:
|
|
347
|
+
if (u2.comboboxState.value !== 0) return;
|
|
348
|
+
v.preventDefault(), u2.optionsRef.value && !u2.optionsPropsRef.value.static && v.stopPropagation(), u2.closeCombobox(), nextTick(() => {
|
|
349
|
+
var d2;
|
|
350
|
+
return (d2 = u2.inputRef.value) == null ? void 0 : d2.focus({ preventScroll: true });
|
|
351
|
+
});
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
let f2 = s(computed(() => ({ as: a2.as, type: h2.type })), u2.buttonRef);
|
|
356
|
+
return () => {
|
|
357
|
+
var E2, w2;
|
|
358
|
+
let v = { open: u2.comboboxState.value === 0, disabled: u2.disabled.value, value: u2.value.value }, { ...d2 } = a2, D = { ref: u2.buttonRef, id: o2, type: f2.value, tabindex: "-1", "aria-haspopup": "listbox", "aria-controls": (E2 = o$1$1(u2.optionsRef)) == null ? void 0 : E2.id, "aria-expanded": u2.comboboxState.value === 0, "aria-labelledby": u2.labelRef.value ? [(w2 = o$1$1(u2.labelRef)) == null ? void 0 : w2.id, o2].join(" ") : void 0, disabled: u2.disabled.value === true ? true : void 0, onKeydown: c$1, onClick: e2 };
|
|
359
|
+
return A$2({ ourProps: D, theirProps: d2, slot: v, attrs: h2, slots: r2, name: "ComboboxButton" });
|
|
360
|
+
};
|
|
361
|
+
} }), it = defineComponent({ name: "ComboboxInput", props: { as: { type: [Object, String], default: "input" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, displayValue: { type: Function }, defaultValue: { type: String, default: void 0 }, id: { type: String, default: null } }, emits: { change: (a2) => true }, setup(a2, { emit: h2, attrs: r2, slots: y, expose: o2 }) {
|
|
362
|
+
var V;
|
|
363
|
+
let u2 = (V = a2.id) != null ? V : `headlessui-combobox-input-${i$5()}`, e2 = K("ComboboxInput");
|
|
364
|
+
computed(() => i$3(o$1$1(e2.inputRef)));
|
|
365
|
+
o2({ el: e2.inputRef, $el: e2.inputRef });
|
|
366
|
+
function S() {
|
|
367
|
+
e2.change(null);
|
|
368
|
+
let i2 = o$1$1(e2.optionsRef);
|
|
369
|
+
i2 && (i2.scrollTop = 0), e2.goToOption(c.Nothing);
|
|
370
|
+
}
|
|
371
|
+
computed(() => {
|
|
372
|
+
var I;
|
|
373
|
+
let i2 = e2.value.value;
|
|
374
|
+
return o$1$1(e2.inputRef) ? typeof a2.displayValue != "undefined" && i2 !== void 0 ? (I = a2.displayValue(i2)) != null ? I : "" : typeof i2 == "string" ? i2 : "" : "";
|
|
375
|
+
});
|
|
376
|
+
let d2 = ref(false);
|
|
377
|
+
function D() {
|
|
378
|
+
d2.value = true;
|
|
379
|
+
}
|
|
380
|
+
function E2() {
|
|
381
|
+
o$3().nextFrame(() => {
|
|
382
|
+
d2.value = false;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
let w2 = t();
|
|
386
|
+
function M(i2) {
|
|
387
|
+
switch (w2(() => {
|
|
388
|
+
}), i2.key) {
|
|
389
|
+
case o$2.Enter:
|
|
390
|
+
if (e2.comboboxState.value !== 0 || d2.value) return;
|
|
391
|
+
if (i2.preventDefault(), i2.stopPropagation(), e2.activeOptionIndex.value === null) {
|
|
392
|
+
e2.closeCombobox();
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
e2.selectActiveOption(), e2.mode.value === 0 && e2.closeCombobox();
|
|
396
|
+
break;
|
|
397
|
+
case o$2.ArrowDown:
|
|
398
|
+
return i2.preventDefault(), i2.stopPropagation(), u$5(e2.comboboxState.value, { [0]: () => e2.goToOption(c.Next), [1]: () => e2.openCombobox() });
|
|
399
|
+
case o$2.ArrowUp:
|
|
400
|
+
return i2.preventDefault(), i2.stopPropagation(), u$5(e2.comboboxState.value, { [0]: () => e2.goToOption(c.Previous), [1]: () => {
|
|
401
|
+
e2.openCombobox(), nextTick(() => {
|
|
402
|
+
e2.value.value || e2.goToOption(c.Last);
|
|
403
|
+
});
|
|
404
|
+
} });
|
|
405
|
+
case o$2.Home:
|
|
406
|
+
if (i2.shiftKey) break;
|
|
407
|
+
return i2.preventDefault(), i2.stopPropagation(), e2.goToOption(c.First);
|
|
408
|
+
case o$2.PageUp:
|
|
409
|
+
return i2.preventDefault(), i2.stopPropagation(), e2.goToOption(c.First);
|
|
410
|
+
case o$2.End:
|
|
411
|
+
if (i2.shiftKey) break;
|
|
412
|
+
return i2.preventDefault(), i2.stopPropagation(), e2.goToOption(c.Last);
|
|
413
|
+
case o$2.PageDown:
|
|
414
|
+
return i2.preventDefault(), i2.stopPropagation(), e2.goToOption(c.Last);
|
|
415
|
+
case o$2.Escape:
|
|
416
|
+
if (e2.comboboxState.value !== 0) return;
|
|
417
|
+
i2.preventDefault(), e2.optionsRef.value && !e2.optionsPropsRef.value.static && i2.stopPropagation(), e2.nullable.value && e2.mode.value === 0 && e2.value.value === null && S(), e2.closeCombobox();
|
|
418
|
+
break;
|
|
419
|
+
case o$2.Tab:
|
|
420
|
+
if (e2.comboboxState.value !== 0) return;
|
|
421
|
+
e2.mode.value === 0 && e2.activationTrigger.value !== 1 && e2.selectActiveOption(), e2.closeCombobox();
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function $2(i2) {
|
|
426
|
+
h2("change", i2), e2.nullable.value && e2.mode.value === 0 && i2.target.value === "" && S(), e2.openCombobox();
|
|
427
|
+
}
|
|
428
|
+
function B(i2) {
|
|
429
|
+
var T2, l2, g2;
|
|
430
|
+
let I = (T2 = i2.relatedTarget) != null ? T2 : t$1.find((t2) => t2 !== i2.currentTarget);
|
|
431
|
+
if (!((l2 = o$1$1(e2.optionsRef)) != null && l2.contains(I)) && !((g2 = o$1$1(e2.buttonRef)) != null && g2.contains(I)) && e2.comboboxState.value === 0) return i2.preventDefault(), e2.mode.value === 0 && (e2.nullable.value && e2.value.value === null ? S() : e2.activationTrigger.value !== 1 && e2.selectActiveOption()), e2.closeCombobox();
|
|
432
|
+
}
|
|
433
|
+
function p2(i2) {
|
|
434
|
+
var T2, l2, g2;
|
|
435
|
+
let I = (T2 = i2.relatedTarget) != null ? T2 : t$1.find((t2) => t2 !== i2.currentTarget);
|
|
436
|
+
(l2 = o$1$1(e2.buttonRef)) != null && l2.contains(I) || (g2 = o$1$1(e2.optionsRef)) != null && g2.contains(I) || e2.disabled.value || e2.immediate.value && e2.comboboxState.value !== 0 && (e2.openCombobox(), o$3().nextFrame(() => {
|
|
437
|
+
e2.setActivationTrigger(1);
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
let R = computed(() => {
|
|
441
|
+
var i2, I, T2, l2;
|
|
442
|
+
return (l2 = (T2 = (I = a2.defaultValue) != null ? I : e2.defaultValue.value !== void 0 ? (i2 = a2.displayValue) == null ? void 0 : i2.call(a2, e2.defaultValue.value) : null) != null ? T2 : e2.defaultValue.value) != null ? l2 : "";
|
|
443
|
+
});
|
|
444
|
+
return () => {
|
|
445
|
+
var t2, n2, s2, b, O2, C, A2;
|
|
446
|
+
let i2 = { open: e2.comboboxState.value === 0 }, { displayValue: I, onChange: T2, ...l2 } = a2, g2 = { "aria-controls": (t2 = e2.optionsRef.value) == null ? void 0 : t2.id, "aria-expanded": e2.comboboxState.value === 0, "aria-activedescendant": e2.activeOptionIndex.value === null ? void 0 : e2.virtual.value ? (n2 = e2.options.value.find((j) => !e2.virtual.value.disabled(j.dataRef.value) && e2.compare(j.dataRef.value, e2.virtual.value.options[e2.activeOptionIndex.value]))) == null ? void 0 : n2.id : (s2 = e2.options.value[e2.activeOptionIndex.value]) == null ? void 0 : s2.id, "aria-labelledby": (C = (b = o$1$1(e2.labelRef)) == null ? void 0 : b.id) != null ? C : (O2 = o$1$1(e2.buttonRef)) == null ? void 0 : O2.id, "aria-autocomplete": "list", id: u2, onCompositionstart: D, onCompositionend: E2, onKeydown: M, onInput: $2, onFocus: p2, onBlur: B, role: "combobox", type: (A2 = r2.type) != null ? A2 : "text", tabIndex: 0, ref: e2.inputRef, defaultValue: R.value, disabled: e2.disabled.value === true ? true : void 0 };
|
|
447
|
+
return A$2({ ourProps: g2, theirProps: l2, slot: i2, attrs: r2, slots: y, features: N$3.RenderStrategy | N$3.Static, name: "ComboboxInput" });
|
|
448
|
+
};
|
|
449
|
+
} }), ut = defineComponent({ name: "ComboboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, hold: { type: [Boolean], default: false } }, setup(a2, { attrs: h$12, slots: r2, expose: y }) {
|
|
450
|
+
let o2 = K("ComboboxOptions"), u2 = `headlessui-combobox-options-${i$5()}`;
|
|
451
|
+
y({ el: o2.optionsRef, $el: o2.optionsRef }), watchEffect(() => {
|
|
452
|
+
o2.optionsPropsRef.value.static = a2.static;
|
|
453
|
+
}), watchEffect(() => {
|
|
454
|
+
o2.optionsPropsRef.value.hold = a2.hold;
|
|
455
|
+
});
|
|
456
|
+
let e2 = l$1(), c2 = computed(() => e2 !== null ? (e2.value & i$1$1.Open) === i$1$1.Open : o2.comboboxState.value === 0);
|
|
457
|
+
i({ container: computed(() => o$1$1(o2.optionsRef)), enabled: computed(() => o2.comboboxState.value === 0), accept(S) {
|
|
458
|
+
return S.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : S.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
459
|
+
}, walk(S) {
|
|
460
|
+
S.setAttribute("role", "none");
|
|
461
|
+
} });
|
|
462
|
+
function f2(S) {
|
|
463
|
+
S.preventDefault();
|
|
464
|
+
}
|
|
465
|
+
return () => {
|
|
466
|
+
var D, E2, w2;
|
|
467
|
+
let S = { open: o2.comboboxState.value === 0 }, v = { "aria-labelledby": (w2 = (D = o$1$1(o2.labelRef)) == null ? void 0 : D.id) != null ? w2 : (E2 = o$1$1(o2.buttonRef)) == null ? void 0 : E2.id, id: u2, ref: o2.optionsRef, role: "listbox", "aria-multiselectable": o2.mode.value === 1 ? true : void 0, onMousedown: f2 }, d2 = T$1(a2, ["hold"]);
|
|
468
|
+
return A$2({ ourProps: v, theirProps: d2, slot: S, attrs: h$12, slots: o2.virtual.value && o2.comboboxState.value === 0 ? { ...r2, default: () => [h$1(Ae$1, {}, r2.default)] } : r2, features: N$3.RenderStrategy | N$3.Static, visible: c2.value, name: "ComboboxOptions" });
|
|
469
|
+
};
|
|
470
|
+
} }), rt = defineComponent({ name: "ComboboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: false }, order: { type: [Number], default: null } }, setup(a2, { slots: h2, attrs: r2, expose: y }) {
|
|
471
|
+
let o2 = K("ComboboxOption"), u2 = `headlessui-combobox-option-${i$5()}`, e2 = ref(null), c$1 = computed(() => a2.disabled);
|
|
472
|
+
y({ el: e2, $el: e2 });
|
|
473
|
+
let f2 = computed(() => {
|
|
474
|
+
var p2;
|
|
475
|
+
return o2.virtual.value ? o2.activeOptionIndex.value === o2.calculateIndex(a2.value) : o2.activeOptionIndex.value === null ? false : ((p2 = o2.options.value[o2.activeOptionIndex.value]) == null ? void 0 : p2.id) === u2;
|
|
476
|
+
}), S = computed(() => o2.isSelected(a2.value)), v = inject(ie, null);
|
|
477
|
+
computed(() => ({ disabled: a2.disabled, value: a2.value, domRef: e2, order: computed(() => a2.order) }));
|
|
478
|
+
watchEffect(() => {
|
|
479
|
+
let p2 = o$1$1(e2);
|
|
480
|
+
p2 && (v == null || v.value.measureElement(p2));
|
|
481
|
+
}), watchEffect(() => {
|
|
482
|
+
o2.comboboxState.value === 0 && f2.value && (o2.virtual.value || o2.activationTrigger.value !== 0 && nextTick(() => {
|
|
483
|
+
var p2, R;
|
|
484
|
+
return (R = (p2 = o$1$1(e2)) == null ? void 0 : p2.scrollIntoView) == null ? void 0 : R.call(p2, { block: "nearest" });
|
|
485
|
+
}));
|
|
486
|
+
});
|
|
487
|
+
function D(p2) {
|
|
488
|
+
p2.preventDefault(), p2.button === g$1.Left && (c$1.value || (o2.selectOption(u2), n$2() || requestAnimationFrame(() => {
|
|
489
|
+
var R;
|
|
490
|
+
return (R = o$1$1(o2.inputRef)) == null ? void 0 : R.focus({ preventScroll: true });
|
|
491
|
+
}), o2.mode.value === 0 && o2.closeCombobox()));
|
|
492
|
+
}
|
|
493
|
+
function E2() {
|
|
494
|
+
var R;
|
|
495
|
+
if (a2.disabled || (R = o2.virtual.value) != null && R.disabled(a2.value)) return o2.goToOption(c.Nothing);
|
|
496
|
+
let p2 = o2.calculateIndex(a2.value);
|
|
497
|
+
o2.goToOption(c.Specific, p2);
|
|
498
|
+
}
|
|
499
|
+
let w2 = u$1();
|
|
500
|
+
function M(p2) {
|
|
501
|
+
w2.update(p2);
|
|
502
|
+
}
|
|
503
|
+
function $2(p2) {
|
|
504
|
+
var V;
|
|
505
|
+
if (!w2.wasMoved(p2) || a2.disabled || (V = o2.virtual.value) != null && V.disabled(a2.value) || f2.value) return;
|
|
506
|
+
let R = o2.calculateIndex(a2.value);
|
|
507
|
+
o2.goToOption(c.Specific, R, 0);
|
|
508
|
+
}
|
|
509
|
+
function B(p2) {
|
|
510
|
+
var R;
|
|
511
|
+
w2.wasMoved(p2) && (a2.disabled || (R = o2.virtual.value) != null && R.disabled(a2.value) || f2.value && (o2.optionsPropsRef.value.hold || o2.goToOption(c.Nothing)));
|
|
512
|
+
}
|
|
513
|
+
return () => {
|
|
514
|
+
let { disabled: p2 } = a2, R = { active: f2.value, selected: S.value, disabled: p2 }, V = { id: u2, ref: e2, role: "option", tabIndex: p2 === true ? void 0 : -1, "aria-disabled": p2 === true ? true : void 0, "aria-selected": S.value, disabled: void 0, onMousedown: D, onFocus: E2, onPointerenter: M, onMouseenter: M, onPointermove: $2, onMousemove: $2, onPointerleave: B, onMouseleave: B }, i2 = T$1(a2, ["order", "value"]);
|
|
515
|
+
return A$2({ ourProps: V, theirProps: i2, slot: R, attrs: r2, slots: h2, name: "ComboboxOption" });
|
|
516
|
+
};
|
|
517
|
+
} });
|
|
518
|
+
let a = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
|
|
519
|
+
function o(e2) {
|
|
520
|
+
var r2, i2;
|
|
521
|
+
let n2 = (r2 = e2.innerText) != null ? r2 : "", t2 = e2.cloneNode(true);
|
|
522
|
+
if (!(t2 instanceof HTMLElement)) return n2;
|
|
523
|
+
let u2 = false;
|
|
524
|
+
for (let f2 of t2.querySelectorAll('[hidden],[aria-hidden],[role="img"]')) f2.remove(), u2 = true;
|
|
525
|
+
let l2 = u2 ? (i2 = t2.innerText) != null ? i2 : "" : n2;
|
|
526
|
+
return a.test(l2) && (l2 = l2.replace(a, "")), l2;
|
|
527
|
+
}
|
|
528
|
+
function g(e2) {
|
|
529
|
+
let n2 = e2.getAttribute("aria-label");
|
|
530
|
+
if (typeof n2 == "string") return n2.trim();
|
|
531
|
+
let t2 = e2.getAttribute("aria-labelledby");
|
|
532
|
+
if (t2) {
|
|
533
|
+
let u2 = t2.split(" ").map((l2) => {
|
|
534
|
+
let r2 = (void 0).getElementById(l2);
|
|
535
|
+
if (r2) {
|
|
536
|
+
let i2 = r2.getAttribute("aria-label");
|
|
537
|
+
return typeof i2 == "string" ? i2.trim() : o(r2).trim();
|
|
538
|
+
}
|
|
539
|
+
return null;
|
|
540
|
+
}).filter(Boolean);
|
|
541
|
+
if (u2.length > 0) return u2.join(", ");
|
|
542
|
+
}
|
|
543
|
+
return o(e2).trim();
|
|
544
|
+
}
|
|
545
|
+
function p(a2) {
|
|
546
|
+
let t2 = ref(""), r2 = ref("");
|
|
547
|
+
return () => {
|
|
548
|
+
let e2 = o$1$1(a2);
|
|
549
|
+
if (!e2) return "";
|
|
550
|
+
let l2 = e2.innerText;
|
|
551
|
+
if (t2.value === l2) return r2.value;
|
|
552
|
+
let u2 = g(e2).trim().toLowerCase();
|
|
553
|
+
return t2.value = l2, r2.value = u2, u2;
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
function pe(o2, b) {
|
|
557
|
+
return o2 === b;
|
|
558
|
+
}
|
|
559
|
+
var ce = ((r2) => (r2[r2.Open = 0] = "Open", r2[r2.Closed = 1] = "Closed", r2))(ce || {}), ve = ((r2) => (r2[r2.Single = 0] = "Single", r2[r2.Multi = 1] = "Multi", r2))(ve || {}), be = ((r2) => (r2[r2.Pointer = 0] = "Pointer", r2[r2.Other = 1] = "Other", r2))(be || {});
|
|
560
|
+
function me(o2) {
|
|
561
|
+
requestAnimationFrame(() => requestAnimationFrame(o2));
|
|
562
|
+
}
|
|
563
|
+
let $ = /* @__PURE__ */ Symbol("ListboxContext");
|
|
564
|
+
function A(o2) {
|
|
565
|
+
let b = inject($, null);
|
|
566
|
+
if (b === null) {
|
|
567
|
+
let r2 = new Error(`<${o2} /> is missing a parent <Listbox /> component.`);
|
|
568
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r2, A), r2;
|
|
569
|
+
}
|
|
570
|
+
return b;
|
|
571
|
+
}
|
|
572
|
+
let Ie = defineComponent({ name: "Listbox", emits: { "update:modelValue": (o2) => true }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: false }, by: { type: [String, Function], default: () => pe }, horizontal: { type: [Boolean], default: false }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: true }, name: { type: String, optional: true }, multiple: { type: [Boolean], default: false } }, inheritAttrs: false, setup(o2, { slots: b, attrs: r2, emit: w$2$1 }) {
|
|
573
|
+
let n2 = ref(1), e$1 = ref(null), f2 = ref(null), v = ref(null), s2 = ref([]), m = ref(""), p2 = ref(null), a2 = ref(1);
|
|
574
|
+
function u2(t2 = (i2) => i2) {
|
|
575
|
+
let i2 = p2.value !== null ? s2.value[p2.value] : null, l2 = O(t2(s2.value.slice()), (O2) => o$1$1(O2.dataRef.domRef)), d2 = i2 ? l2.indexOf(i2) : null;
|
|
576
|
+
return d2 === -1 && (d2 = null), { options: l2, activeOptionIndex: d2 };
|
|
577
|
+
}
|
|
578
|
+
let D = computed(() => o2.multiple ? 1 : 0), [y, L] = d(computed(() => o2.modelValue), (t2) => w$2$1("update:modelValue", t2), computed(() => o2.defaultValue)), M = computed(() => y.value === void 0 ? u$5(D.value, { [1]: [], [0]: void 0 }) : y.value), k = { listboxState: n2, value: M, mode: D, compare(t2, i2) {
|
|
579
|
+
if (typeof o2.by == "string") {
|
|
580
|
+
let l2 = o2.by;
|
|
581
|
+
return (t2 == null ? void 0 : t2[l2]) === (i2 == null ? void 0 : i2[l2]);
|
|
582
|
+
}
|
|
583
|
+
return o2.by(t2, i2);
|
|
584
|
+
}, orientation: computed(() => o2.horizontal ? "horizontal" : "vertical"), labelRef: e$1, buttonRef: f2, optionsRef: v, disabled: computed(() => o2.disabled), options: s2, searchQuery: m, activeOptionIndex: p2, activationTrigger: a2, closeListbox() {
|
|
585
|
+
o2.disabled || n2.value !== 1 && (n2.value = 1, p2.value = null);
|
|
586
|
+
}, openListbox() {
|
|
587
|
+
o2.disabled || n2.value !== 0 && (n2.value = 0);
|
|
588
|
+
}, goToOption(t2, i2, l2) {
|
|
589
|
+
if (o2.disabled || n2.value === 1) return;
|
|
590
|
+
let d2 = u2(), O2 = f$1(t2 === c.Specific ? { focus: c.Specific, id: i2 } : { focus: t2 }, { resolveItems: () => d2.options, resolveActiveIndex: () => d2.activeOptionIndex, resolveId: (h2) => h2.id, resolveDisabled: (h2) => h2.dataRef.disabled });
|
|
591
|
+
m.value = "", p2.value = O2, a2.value = l2 != null ? l2 : 1, s2.value = d2.options;
|
|
592
|
+
}, search(t2) {
|
|
593
|
+
if (o2.disabled || n2.value === 1) return;
|
|
594
|
+
let l2 = m.value !== "" ? 0 : 1;
|
|
595
|
+
m.value += t2.toLowerCase();
|
|
596
|
+
let O2 = (p2.value !== null ? s2.value.slice(p2.value + l2).concat(s2.value.slice(0, p2.value + l2)) : s2.value).find((I) => I.dataRef.textValue.startsWith(m.value) && !I.dataRef.disabled), h2 = O2 ? s2.value.indexOf(O2) : -1;
|
|
597
|
+
h2 === -1 || h2 === p2.value || (p2.value = h2, a2.value = 1);
|
|
598
|
+
}, clearSearch() {
|
|
599
|
+
o2.disabled || n2.value !== 1 && m.value !== "" && (m.value = "");
|
|
600
|
+
}, registerOption(t2, i2) {
|
|
601
|
+
let l2 = u2((d2) => [...d2, { id: t2, dataRef: i2 }]);
|
|
602
|
+
s2.value = l2.options, p2.value = l2.activeOptionIndex;
|
|
603
|
+
}, unregisterOption(t2) {
|
|
604
|
+
let i2 = u2((l2) => {
|
|
605
|
+
let d2 = l2.findIndex((O2) => O2.id === t2);
|
|
606
|
+
return d2 !== -1 && l2.splice(d2, 1), l2;
|
|
607
|
+
});
|
|
608
|
+
s2.value = i2.options, p2.value = i2.activeOptionIndex, a2.value = 1;
|
|
609
|
+
}, theirOnChange(t2) {
|
|
610
|
+
o2.disabled || L(t2);
|
|
611
|
+
}, select(t2) {
|
|
612
|
+
o2.disabled || L(u$5(D.value, { [0]: () => t2, [1]: () => {
|
|
613
|
+
let i2 = toRaw(k.value.value).slice(), l2 = toRaw(t2), d2 = i2.findIndex((O2) => k.compare(l2, toRaw(O2)));
|
|
614
|
+
return d2 === -1 ? i2.push(l2) : i2.splice(d2, 1), i2;
|
|
615
|
+
} }));
|
|
616
|
+
} };
|
|
617
|
+
w$2([f2, v], (t2, i2) => {
|
|
618
|
+
var l2;
|
|
619
|
+
k.closeListbox(), w$4(i2, h.Loose) || (t2.preventDefault(), (l2 = o$1$1(f2)) == null || l2.focus());
|
|
620
|
+
}, computed(() => n2.value === 0)), provide($, k), t$2(computed(() => u$5(n2.value, { [0]: i$1$1.Open, [1]: i$1$1.Closed })));
|
|
621
|
+
computed(() => {
|
|
622
|
+
var t2;
|
|
623
|
+
return (t2 = o$1$1(f2)) == null ? void 0 : t2.closest("form");
|
|
624
|
+
});
|
|
625
|
+
return () => {
|
|
626
|
+
let { name: t2, modelValue: i2, disabled: l2, form: d2, ...O2 } = o2, h$12 = { open: n2.value === 0, disabled: l2, value: M.value };
|
|
627
|
+
return h$1(Fragment, [...t2 != null && M.value != null ? e({ [t2]: M.value }).map(([I, Q]) => h$1(f$1$1, E$2({ features: u$3.Hidden, key: I, as: "input", type: "hidden", hidden: true, readOnly: true, form: d2, disabled: l2, name: I, value: Q }))) : [], A$2({ ourProps: {}, theirProps: { ...r2, ...T$1(O2, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"]) }, slot: h$12, slots: b, attrs: r2, name: "Listbox" })]);
|
|
628
|
+
};
|
|
629
|
+
} });
|
|
630
|
+
defineComponent({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(o2, { attrs: b, slots: r2 }) {
|
|
631
|
+
var f2;
|
|
632
|
+
let w2 = (f2 = o2.id) != null ? f2 : `headlessui-listbox-label-${i$5()}`, n2 = A("ListboxLabel");
|
|
633
|
+
function e2() {
|
|
634
|
+
var v;
|
|
635
|
+
(v = o$1$1(n2.buttonRef)) == null || v.focus({ preventScroll: true });
|
|
636
|
+
}
|
|
637
|
+
return () => {
|
|
638
|
+
let v = { open: n2.listboxState.value === 0, disabled: n2.disabled.value }, { ...s2 } = o2, m = { id: w2, ref: n2.labelRef, onClick: e2 };
|
|
639
|
+
return A$2({ ourProps: m, theirProps: s2, slot: v, attrs: b, slots: r2, name: "ListboxLabel" });
|
|
640
|
+
};
|
|
641
|
+
} });
|
|
642
|
+
let je = defineComponent({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: null } }, setup(o2, { attrs: b, slots: r2, expose: w2 }) {
|
|
643
|
+
var p2;
|
|
644
|
+
let n2 = (p2 = o2.id) != null ? p2 : `headlessui-listbox-button-${i$5()}`, e2 = A("ListboxButton");
|
|
645
|
+
w2({ el: e2.buttonRef, $el: e2.buttonRef });
|
|
646
|
+
function f2(a2) {
|
|
647
|
+
switch (a2.key) {
|
|
648
|
+
case o$2.Space:
|
|
649
|
+
case o$2.Enter:
|
|
650
|
+
case o$2.ArrowDown:
|
|
651
|
+
a2.preventDefault(), e2.openListbox(), nextTick(() => {
|
|
652
|
+
var u2;
|
|
653
|
+
(u2 = o$1$1(e2.optionsRef)) == null || u2.focus({ preventScroll: true }), e2.value.value || e2.goToOption(c.First);
|
|
654
|
+
});
|
|
655
|
+
break;
|
|
656
|
+
case o$2.ArrowUp:
|
|
657
|
+
a2.preventDefault(), e2.openListbox(), nextTick(() => {
|
|
658
|
+
var u2;
|
|
659
|
+
(u2 = o$1$1(e2.optionsRef)) == null || u2.focus({ preventScroll: true }), e2.value.value || e2.goToOption(c.Last);
|
|
660
|
+
});
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function v(a2) {
|
|
665
|
+
switch (a2.key) {
|
|
666
|
+
case o$2.Space:
|
|
667
|
+
a2.preventDefault();
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
function s$12(a2) {
|
|
672
|
+
e2.disabled.value || (e2.listboxState.value === 0 ? (e2.closeListbox(), nextTick(() => {
|
|
673
|
+
var u2;
|
|
674
|
+
return (u2 = o$1$1(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true });
|
|
675
|
+
})) : (a2.preventDefault(), e2.openListbox(), me(() => {
|
|
676
|
+
var u2;
|
|
677
|
+
return (u2 = o$1$1(e2.optionsRef)) == null ? void 0 : u2.focus({ preventScroll: true });
|
|
678
|
+
})));
|
|
679
|
+
}
|
|
680
|
+
let m = s(computed(() => ({ as: o2.as, type: b.type })), e2.buttonRef);
|
|
681
|
+
return () => {
|
|
682
|
+
var y, L;
|
|
683
|
+
let a2 = { open: e2.listboxState.value === 0, disabled: e2.disabled.value, value: e2.value.value }, { ...u2 } = o2, D = { ref: e2.buttonRef, id: n2, type: m.value, "aria-haspopup": "listbox", "aria-controls": (y = o$1$1(e2.optionsRef)) == null ? void 0 : y.id, "aria-expanded": e2.listboxState.value === 0, "aria-labelledby": e2.labelRef.value ? [(L = o$1$1(e2.labelRef)) == null ? void 0 : L.id, n2].join(" ") : void 0, disabled: e2.disabled.value === true ? true : void 0, onKeydown: f2, onKeyup: v, onClick: s$12 };
|
|
684
|
+
return A$2({ ourProps: D, theirProps: u2, slot: a2, attrs: b, slots: r2, name: "ListboxButton" });
|
|
685
|
+
};
|
|
686
|
+
} }), Ae = defineComponent({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: null } }, setup(o2, { attrs: b, slots: r2, expose: w2 }) {
|
|
687
|
+
var p2;
|
|
688
|
+
let n2 = (p2 = o2.id) != null ? p2 : `headlessui-listbox-options-${i$5()}`, e2 = A("ListboxOptions"), f2 = ref(null);
|
|
689
|
+
w2({ el: e2.optionsRef, $el: e2.optionsRef });
|
|
690
|
+
function v(a2) {
|
|
691
|
+
switch (f2.value && clearTimeout(f2.value), a2.key) {
|
|
692
|
+
case o$2.Space:
|
|
693
|
+
if (e2.searchQuery.value !== "") return a2.preventDefault(), a2.stopPropagation(), e2.search(a2.key);
|
|
694
|
+
case o$2.Enter:
|
|
695
|
+
if (a2.preventDefault(), a2.stopPropagation(), e2.activeOptionIndex.value !== null) {
|
|
696
|
+
let u2 = e2.options.value[e2.activeOptionIndex.value];
|
|
697
|
+
e2.select(u2.dataRef.value);
|
|
698
|
+
}
|
|
699
|
+
e2.mode.value === 0 && (e2.closeListbox(), nextTick(() => {
|
|
700
|
+
var u2;
|
|
701
|
+
return (u2 = o$1$1(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true });
|
|
702
|
+
}));
|
|
703
|
+
break;
|
|
704
|
+
case u$5(e2.orientation.value, { vertical: o$2.ArrowDown, horizontal: o$2.ArrowRight }):
|
|
705
|
+
return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.Next);
|
|
706
|
+
case u$5(e2.orientation.value, { vertical: o$2.ArrowUp, horizontal: o$2.ArrowLeft }):
|
|
707
|
+
return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.Previous);
|
|
708
|
+
case o$2.Home:
|
|
709
|
+
case o$2.PageUp:
|
|
710
|
+
return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.First);
|
|
711
|
+
case o$2.End:
|
|
712
|
+
case o$2.PageDown:
|
|
713
|
+
return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.Last);
|
|
714
|
+
case o$2.Escape:
|
|
715
|
+
a2.preventDefault(), a2.stopPropagation(), e2.closeListbox(), nextTick(() => {
|
|
716
|
+
var u2;
|
|
717
|
+
return (u2 = o$1$1(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true });
|
|
718
|
+
});
|
|
719
|
+
break;
|
|
720
|
+
case o$2.Tab:
|
|
721
|
+
a2.preventDefault(), a2.stopPropagation();
|
|
722
|
+
break;
|
|
723
|
+
default:
|
|
724
|
+
a2.key.length === 1 && (e2.search(a2.key), f2.value = setTimeout(() => e2.clearSearch(), 350));
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
let s2 = l$1(), m = computed(() => s2 !== null ? (s2.value & i$1$1.Open) === i$1$1.Open : e2.listboxState.value === 0);
|
|
729
|
+
return () => {
|
|
730
|
+
var y, L;
|
|
731
|
+
let a2 = { open: e2.listboxState.value === 0 }, { ...u2 } = o2, D = { "aria-activedescendant": e2.activeOptionIndex.value === null || (y = e2.options.value[e2.activeOptionIndex.value]) == null ? void 0 : y.id, "aria-multiselectable": e2.mode.value === 1 ? true : void 0, "aria-labelledby": (L = o$1$1(e2.buttonRef)) == null ? void 0 : L.id, "aria-orientation": e2.orientation.value, id: n2, onKeydown: v, role: "listbox", tabIndex: 0, ref: e2.optionsRef };
|
|
732
|
+
return A$2({ ourProps: D, theirProps: u2, slot: a2, attrs: b, slots: r2, features: N$3.RenderStrategy | N$3.Static, visible: m.value, name: "ListboxOptions" });
|
|
733
|
+
};
|
|
734
|
+
} }), Fe = defineComponent({ name: "ListboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: false }, id: { type: String, default: null } }, setup(o2, { slots: b, attrs: r2, expose: w2 }) {
|
|
735
|
+
var C;
|
|
736
|
+
let n2 = (C = o2.id) != null ? C : `headlessui-listbox-option-${i$5()}`, e2 = A("ListboxOption"), f2 = ref(null);
|
|
737
|
+
w2({ el: f2, $el: f2 });
|
|
738
|
+
let v = computed(() => e2.activeOptionIndex.value !== null ? e2.options.value[e2.activeOptionIndex.value].id === n2 : false), s2 = computed(() => u$5(e2.mode.value, { [0]: () => e2.compare(toRaw(e2.value.value), toRaw(o2.value)), [1]: () => toRaw(e2.value.value).some((t2) => e2.compare(toRaw(t2), toRaw(o2.value))) }));
|
|
739
|
+
computed(() => u$5(e2.mode.value, { [1]: () => {
|
|
740
|
+
var i2;
|
|
741
|
+
let t2 = toRaw(e2.value.value);
|
|
742
|
+
return ((i2 = e2.options.value.find((l2) => t2.some((d2) => e2.compare(toRaw(d2), toRaw(l2.dataRef.value))))) == null ? void 0 : i2.id) === n2;
|
|
743
|
+
}, [0]: () => s2.value }));
|
|
744
|
+
let p$1 = p(f2);
|
|
745
|
+
computed(() => ({ disabled: o2.disabled, value: o2.value, get textValue() {
|
|
746
|
+
return p$1();
|
|
747
|
+
}, domRef: f2 }));
|
|
748
|
+
watchEffect(() => {
|
|
749
|
+
e2.listboxState.value === 0 && v.value && e2.activationTrigger.value !== 0 && nextTick(() => {
|
|
750
|
+
var t2, i2;
|
|
751
|
+
return (i2 = (t2 = o$1$1(f2)) == null ? void 0 : t2.scrollIntoView) == null ? void 0 : i2.call(t2, { block: "nearest" });
|
|
752
|
+
});
|
|
753
|
+
});
|
|
754
|
+
function u2(t2) {
|
|
755
|
+
if (o2.disabled) return t2.preventDefault();
|
|
756
|
+
e2.select(o2.value), e2.mode.value === 0 && (e2.closeListbox(), nextTick(() => {
|
|
757
|
+
var i2;
|
|
758
|
+
return (i2 = o$1$1(e2.buttonRef)) == null ? void 0 : i2.focus({ preventScroll: true });
|
|
759
|
+
}));
|
|
760
|
+
}
|
|
761
|
+
function D() {
|
|
762
|
+
if (o2.disabled) return e2.goToOption(c.Nothing);
|
|
763
|
+
e2.goToOption(c.Specific, n2);
|
|
764
|
+
}
|
|
765
|
+
let y = u$1();
|
|
766
|
+
function L(t2) {
|
|
767
|
+
y.update(t2);
|
|
768
|
+
}
|
|
769
|
+
function M(t2) {
|
|
770
|
+
y.wasMoved(t2) && (o2.disabled || v.value || e2.goToOption(c.Specific, n2, 0));
|
|
771
|
+
}
|
|
772
|
+
function k(t2) {
|
|
773
|
+
y.wasMoved(t2) && (o2.disabled || v.value && e2.goToOption(c.Nothing));
|
|
774
|
+
}
|
|
775
|
+
return () => {
|
|
776
|
+
let { disabled: t2 } = o2, i2 = { active: v.value, selected: s2.value, disabled: t2 }, { value: l2, disabled: d2, ...O2 } = o2, h2 = { id: n2, ref: f2, role: "option", tabIndex: t2 === true ? void 0 : -1, "aria-disabled": t2 === true ? true : void 0, "aria-selected": s2.value, disabled: void 0, onClick: u2, onFocus: D, onPointerenter: L, onMouseenter: L, onPointermove: M, onMousemove: M, onPointerleave: k, onMouseleave: k };
|
|
777
|
+
return A$2({ ourProps: h2, theirProps: O2, slot: i2, attrs: r2, slots: b, name: "ListboxOption" });
|
|
778
|
+
};
|
|
779
|
+
} });
|
|
780
|
+
function getWindow(node) {
|
|
781
|
+
if (node == null) {
|
|
782
|
+
return void 0;
|
|
783
|
+
}
|
|
784
|
+
if (node.toString() !== "[object Window]") {
|
|
785
|
+
var ownerDocument = node.ownerDocument;
|
|
786
|
+
return ownerDocument ? ownerDocument.defaultView || void 0 : void 0;
|
|
787
|
+
}
|
|
788
|
+
return node;
|
|
789
|
+
}
|
|
790
|
+
function isElement(node) {
|
|
791
|
+
var OwnElement = getWindow(node).Element;
|
|
792
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
793
|
+
}
|
|
794
|
+
function isHTMLElement(node) {
|
|
795
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
796
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
797
|
+
}
|
|
798
|
+
function isShadowRoot(node) {
|
|
799
|
+
if (typeof ShadowRoot === "undefined") {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
803
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
804
|
+
}
|
|
805
|
+
var max = Math.max;
|
|
806
|
+
var min = Math.min;
|
|
807
|
+
var round = Math.round;
|
|
808
|
+
function getUAString() {
|
|
809
|
+
var uaData = (void 0).userAgentData;
|
|
810
|
+
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
811
|
+
return uaData.brands.map(function(item) {
|
|
812
|
+
return item.brand + "/" + item.version;
|
|
813
|
+
}).join(" ");
|
|
814
|
+
}
|
|
815
|
+
return (void 0).userAgent;
|
|
816
|
+
}
|
|
817
|
+
function isLayoutViewport() {
|
|
818
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
819
|
+
}
|
|
820
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
821
|
+
if (includeScale === void 0) {
|
|
822
|
+
includeScale = false;
|
|
823
|
+
}
|
|
824
|
+
if (isFixedStrategy === void 0) {
|
|
825
|
+
isFixedStrategy = false;
|
|
826
|
+
}
|
|
827
|
+
var clientRect = element.getBoundingClientRect();
|
|
828
|
+
var scaleX = 1;
|
|
829
|
+
var scaleY = 1;
|
|
830
|
+
if (includeScale && isHTMLElement(element)) {
|
|
831
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
832
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
833
|
+
}
|
|
834
|
+
var _ref = isElement(element) ? getWindow(element) : void 0, visualViewport = _ref.visualViewport;
|
|
835
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
836
|
+
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
837
|
+
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
838
|
+
var width = clientRect.width / scaleX;
|
|
839
|
+
var height = clientRect.height / scaleY;
|
|
840
|
+
return {
|
|
841
|
+
width,
|
|
842
|
+
height,
|
|
843
|
+
top: y,
|
|
844
|
+
right: x + width,
|
|
845
|
+
bottom: y + height,
|
|
846
|
+
left: x,
|
|
847
|
+
x,
|
|
848
|
+
y
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
function getWindowScroll(node) {
|
|
852
|
+
var win = getWindow(node);
|
|
853
|
+
var scrollLeft = win.pageXOffset;
|
|
854
|
+
var scrollTop = win.pageYOffset;
|
|
855
|
+
return {
|
|
856
|
+
scrollLeft,
|
|
857
|
+
scrollTop
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
function getHTMLElementScroll(element) {
|
|
861
|
+
return {
|
|
862
|
+
scrollLeft: element.scrollLeft,
|
|
863
|
+
scrollTop: element.scrollTop
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
function getNodeScroll(node) {
|
|
867
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
868
|
+
return getWindowScroll(node);
|
|
869
|
+
} else {
|
|
870
|
+
return getHTMLElementScroll(node);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function getNodeName(element) {
|
|
874
|
+
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
875
|
+
}
|
|
876
|
+
function getDocumentElement(element) {
|
|
877
|
+
return ((isElement(element) ? element.ownerDocument : (
|
|
878
|
+
// $FlowFixMe[prop-missing]
|
|
879
|
+
element.document
|
|
880
|
+
)) || (void 0).document).documentElement;
|
|
881
|
+
}
|
|
882
|
+
function getWindowScrollBarX(element) {
|
|
883
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
884
|
+
}
|
|
885
|
+
function getComputedStyle(element) {
|
|
886
|
+
return getWindow(element).getComputedStyle(element);
|
|
887
|
+
}
|
|
888
|
+
function isScrollParent(element) {
|
|
889
|
+
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
890
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
891
|
+
}
|
|
892
|
+
function isElementScaled(element) {
|
|
893
|
+
var rect = element.getBoundingClientRect();
|
|
894
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
895
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
896
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
897
|
+
}
|
|
898
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
899
|
+
if (isFixed === void 0) {
|
|
900
|
+
isFixed = false;
|
|
901
|
+
}
|
|
902
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
903
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
904
|
+
var documentElement = getDocumentElement(offsetParent);
|
|
905
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
906
|
+
var scroll = {
|
|
907
|
+
scrollLeft: 0,
|
|
908
|
+
scrollTop: 0
|
|
909
|
+
};
|
|
910
|
+
var offsets = {
|
|
911
|
+
x: 0,
|
|
912
|
+
y: 0
|
|
913
|
+
};
|
|
914
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
915
|
+
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
916
|
+
isScrollParent(documentElement)) {
|
|
917
|
+
scroll = getNodeScroll(offsetParent);
|
|
918
|
+
}
|
|
919
|
+
if (isHTMLElement(offsetParent)) {
|
|
920
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
921
|
+
offsets.x += offsetParent.clientLeft;
|
|
922
|
+
offsets.y += offsetParent.clientTop;
|
|
923
|
+
} else if (documentElement) {
|
|
924
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
return {
|
|
928
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
929
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
930
|
+
width: rect.width,
|
|
931
|
+
height: rect.height
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
function getLayoutRect(element) {
|
|
935
|
+
var clientRect = getBoundingClientRect(element);
|
|
936
|
+
var width = element.offsetWidth;
|
|
937
|
+
var height = element.offsetHeight;
|
|
938
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
939
|
+
width = clientRect.width;
|
|
940
|
+
}
|
|
941
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
942
|
+
height = clientRect.height;
|
|
943
|
+
}
|
|
944
|
+
return {
|
|
945
|
+
x: element.offsetLeft,
|
|
946
|
+
y: element.offsetTop,
|
|
947
|
+
width,
|
|
948
|
+
height
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
function getParentNode(element) {
|
|
952
|
+
if (getNodeName(element) === "html") {
|
|
953
|
+
return element;
|
|
954
|
+
}
|
|
955
|
+
return (
|
|
956
|
+
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
957
|
+
// $FlowFixMe[incompatible-return]
|
|
958
|
+
// $FlowFixMe[prop-missing]
|
|
959
|
+
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
960
|
+
element.parentNode || // DOM Element detected
|
|
961
|
+
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
962
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
963
|
+
getDocumentElement(element)
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
function getScrollParent(node) {
|
|
967
|
+
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
968
|
+
return node.ownerDocument.body;
|
|
969
|
+
}
|
|
970
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
971
|
+
return node;
|
|
972
|
+
}
|
|
973
|
+
return getScrollParent(getParentNode(node));
|
|
974
|
+
}
|
|
975
|
+
function listScrollParents(element, list) {
|
|
976
|
+
var _element$ownerDocumen;
|
|
977
|
+
if (list === void 0) {
|
|
978
|
+
list = [];
|
|
979
|
+
}
|
|
980
|
+
var scrollParent = getScrollParent(element);
|
|
981
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
982
|
+
var win = getWindow(scrollParent);
|
|
983
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
984
|
+
var updatedList = list.concat(target);
|
|
985
|
+
return isBody ? updatedList : (
|
|
986
|
+
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
987
|
+
updatedList.concat(listScrollParents(getParentNode(target)))
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
function isTableElement(element) {
|
|
991
|
+
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
992
|
+
}
|
|
993
|
+
function getTrueOffsetParent(element) {
|
|
994
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
995
|
+
getComputedStyle(element).position === "fixed") {
|
|
996
|
+
return null;
|
|
997
|
+
}
|
|
998
|
+
return element.offsetParent;
|
|
999
|
+
}
|
|
1000
|
+
function getContainingBlock(element) {
|
|
1001
|
+
var isFirefox = /firefox/i.test(getUAString());
|
|
1002
|
+
var isIE = /Trident/i.test(getUAString());
|
|
1003
|
+
if (isIE && isHTMLElement(element)) {
|
|
1004
|
+
var elementCss = getComputedStyle(element);
|
|
1005
|
+
if (elementCss.position === "fixed") {
|
|
1006
|
+
return null;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
var currentNode = getParentNode(element);
|
|
1010
|
+
if (isShadowRoot(currentNode)) {
|
|
1011
|
+
currentNode = currentNode.host;
|
|
1012
|
+
}
|
|
1013
|
+
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
1014
|
+
var css = getComputedStyle(currentNode);
|
|
1015
|
+
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
|
1016
|
+
return currentNode;
|
|
1017
|
+
} else {
|
|
1018
|
+
currentNode = currentNode.parentNode;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
return null;
|
|
1022
|
+
}
|
|
1023
|
+
function getOffsetParent(element) {
|
|
1024
|
+
var window = getWindow(element);
|
|
1025
|
+
var offsetParent = getTrueOffsetParent(element);
|
|
1026
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
1027
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1028
|
+
}
|
|
1029
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
|
1030
|
+
return window;
|
|
1031
|
+
}
|
|
1032
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
1033
|
+
}
|
|
1034
|
+
var top = "top";
|
|
1035
|
+
var bottom = "bottom";
|
|
1036
|
+
var right = "right";
|
|
1037
|
+
var left = "left";
|
|
1038
|
+
var auto = "auto";
|
|
1039
|
+
var basePlacements = [top, bottom, right, left];
|
|
1040
|
+
var start = "start";
|
|
1041
|
+
var end = "end";
|
|
1042
|
+
var clippingParents = "clippingParents";
|
|
1043
|
+
var viewport = "viewport";
|
|
1044
|
+
var popper = "popper";
|
|
1045
|
+
var reference = "reference";
|
|
1046
|
+
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
|
1047
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
1048
|
+
}, []);
|
|
1049
|
+
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
1050
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
1051
|
+
}, []);
|
|
1052
|
+
var beforeRead = "beforeRead";
|
|
1053
|
+
var read = "read";
|
|
1054
|
+
var afterRead = "afterRead";
|
|
1055
|
+
var beforeMain = "beforeMain";
|
|
1056
|
+
var main = "main";
|
|
1057
|
+
var afterMain = "afterMain";
|
|
1058
|
+
var beforeWrite = "beforeWrite";
|
|
1059
|
+
var write = "write";
|
|
1060
|
+
var afterWrite = "afterWrite";
|
|
1061
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
1062
|
+
function order(modifiers) {
|
|
1063
|
+
var map = /* @__PURE__ */ new Map();
|
|
1064
|
+
var visited = /* @__PURE__ */ new Set();
|
|
1065
|
+
var result = [];
|
|
1066
|
+
modifiers.forEach(function(modifier) {
|
|
1067
|
+
map.set(modifier.name, modifier);
|
|
1068
|
+
});
|
|
1069
|
+
function sort(modifier) {
|
|
1070
|
+
visited.add(modifier.name);
|
|
1071
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
1072
|
+
requires.forEach(function(dep) {
|
|
1073
|
+
if (!visited.has(dep)) {
|
|
1074
|
+
var depModifier = map.get(dep);
|
|
1075
|
+
if (depModifier) {
|
|
1076
|
+
sort(depModifier);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
result.push(modifier);
|
|
1081
|
+
}
|
|
1082
|
+
modifiers.forEach(function(modifier) {
|
|
1083
|
+
if (!visited.has(modifier.name)) {
|
|
1084
|
+
sort(modifier);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
return result;
|
|
1088
|
+
}
|
|
1089
|
+
function orderModifiers(modifiers) {
|
|
1090
|
+
var orderedModifiers = order(modifiers);
|
|
1091
|
+
return modifierPhases.reduce(function(acc, phase) {
|
|
1092
|
+
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
1093
|
+
return modifier.phase === phase;
|
|
1094
|
+
}));
|
|
1095
|
+
}, []);
|
|
1096
|
+
}
|
|
1097
|
+
function debounce(fn2) {
|
|
1098
|
+
var pending;
|
|
1099
|
+
return function() {
|
|
1100
|
+
if (!pending) {
|
|
1101
|
+
pending = new Promise(function(resolve) {
|
|
1102
|
+
Promise.resolve().then(function() {
|
|
1103
|
+
pending = void 0;
|
|
1104
|
+
resolve(fn2());
|
|
1105
|
+
});
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
return pending;
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
function mergeByName(modifiers) {
|
|
1112
|
+
var merged = modifiers.reduce(function(merged2, current) {
|
|
1113
|
+
var existing = merged2[current.name];
|
|
1114
|
+
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
1115
|
+
options: Object.assign({}, existing.options, current.options),
|
|
1116
|
+
data: Object.assign({}, existing.data, current.data)
|
|
1117
|
+
}) : current;
|
|
1118
|
+
return merged2;
|
|
1119
|
+
}, {});
|
|
1120
|
+
return Object.keys(merged).map(function(key) {
|
|
1121
|
+
return merged[key];
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
function getViewportRect(element, strategy) {
|
|
1125
|
+
var win = getWindow(element);
|
|
1126
|
+
var html = getDocumentElement(element);
|
|
1127
|
+
var visualViewport = win.visualViewport;
|
|
1128
|
+
var width = html.clientWidth;
|
|
1129
|
+
var height = html.clientHeight;
|
|
1130
|
+
var x = 0;
|
|
1131
|
+
var y = 0;
|
|
1132
|
+
if (visualViewport) {
|
|
1133
|
+
width = visualViewport.width;
|
|
1134
|
+
height = visualViewport.height;
|
|
1135
|
+
var layoutViewport = isLayoutViewport();
|
|
1136
|
+
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
1137
|
+
x = visualViewport.offsetLeft;
|
|
1138
|
+
y = visualViewport.offsetTop;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
return {
|
|
1142
|
+
width,
|
|
1143
|
+
height,
|
|
1144
|
+
x: x + getWindowScrollBarX(element),
|
|
1145
|
+
y
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
function getDocumentRect(element) {
|
|
1149
|
+
var _element$ownerDocumen;
|
|
1150
|
+
var html = getDocumentElement(element);
|
|
1151
|
+
var winScroll = getWindowScroll(element);
|
|
1152
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
1153
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
1154
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
1155
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
1156
|
+
var y = -winScroll.scrollTop;
|
|
1157
|
+
if (getComputedStyle(body || html).direction === "rtl") {
|
|
1158
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1159
|
+
}
|
|
1160
|
+
return {
|
|
1161
|
+
width,
|
|
1162
|
+
height,
|
|
1163
|
+
x,
|
|
1164
|
+
y
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
function contains(parent, child) {
|
|
1168
|
+
var rootNode = child.getRootNode && child.getRootNode();
|
|
1169
|
+
if (parent.contains(child)) {
|
|
1170
|
+
return true;
|
|
1171
|
+
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
1172
|
+
var next = child;
|
|
1173
|
+
do {
|
|
1174
|
+
if (next && parent.isSameNode(next)) {
|
|
1175
|
+
return true;
|
|
1176
|
+
}
|
|
1177
|
+
next = next.parentNode || next.host;
|
|
1178
|
+
} while (next);
|
|
1179
|
+
}
|
|
1180
|
+
return false;
|
|
1181
|
+
}
|
|
1182
|
+
function rectToClientRect(rect) {
|
|
1183
|
+
return Object.assign({}, rect, {
|
|
1184
|
+
left: rect.x,
|
|
1185
|
+
top: rect.y,
|
|
1186
|
+
right: rect.x + rect.width,
|
|
1187
|
+
bottom: rect.y + rect.height
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1191
|
+
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
1192
|
+
rect.top = rect.top + element.clientTop;
|
|
1193
|
+
rect.left = rect.left + element.clientLeft;
|
|
1194
|
+
rect.bottom = rect.top + element.clientHeight;
|
|
1195
|
+
rect.right = rect.left + element.clientWidth;
|
|
1196
|
+
rect.width = element.clientWidth;
|
|
1197
|
+
rect.height = element.clientHeight;
|
|
1198
|
+
rect.x = rect.left;
|
|
1199
|
+
rect.y = rect.top;
|
|
1200
|
+
return rect;
|
|
1201
|
+
}
|
|
1202
|
+
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
1203
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1204
|
+
}
|
|
1205
|
+
function getClippingParents(element) {
|
|
1206
|
+
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
1207
|
+
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
|
|
1208
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
1209
|
+
if (!isElement(clipperElement)) {
|
|
1210
|
+
return [];
|
|
1211
|
+
}
|
|
1212
|
+
return clippingParents2.filter(function(clippingParent) {
|
|
1213
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
1217
|
+
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
1218
|
+
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
1219
|
+
var firstClippingParent = clippingParents2[0];
|
|
1220
|
+
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
1221
|
+
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
1222
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1223
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1224
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1225
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1226
|
+
return accRect;
|
|
1227
|
+
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
1228
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
1229
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
1230
|
+
clippingRect.x = clippingRect.left;
|
|
1231
|
+
clippingRect.y = clippingRect.top;
|
|
1232
|
+
return clippingRect;
|
|
1233
|
+
}
|
|
1234
|
+
function getBasePlacement(placement) {
|
|
1235
|
+
return placement.split("-")[0];
|
|
1236
|
+
}
|
|
1237
|
+
function getVariation(placement) {
|
|
1238
|
+
return placement.split("-")[1];
|
|
1239
|
+
}
|
|
1240
|
+
function getMainAxisFromPlacement(placement) {
|
|
1241
|
+
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
1242
|
+
}
|
|
1243
|
+
function computeOffsets(_ref) {
|
|
1244
|
+
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
1245
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
1246
|
+
var variation = placement ? getVariation(placement) : null;
|
|
1247
|
+
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
|
1248
|
+
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
|
1249
|
+
var offsets;
|
|
1250
|
+
switch (basePlacement) {
|
|
1251
|
+
case top:
|
|
1252
|
+
offsets = {
|
|
1253
|
+
x: commonX,
|
|
1254
|
+
y: reference2.y - element.height
|
|
1255
|
+
};
|
|
1256
|
+
break;
|
|
1257
|
+
case bottom:
|
|
1258
|
+
offsets = {
|
|
1259
|
+
x: commonX,
|
|
1260
|
+
y: reference2.y + reference2.height
|
|
1261
|
+
};
|
|
1262
|
+
break;
|
|
1263
|
+
case right:
|
|
1264
|
+
offsets = {
|
|
1265
|
+
x: reference2.x + reference2.width,
|
|
1266
|
+
y: commonY
|
|
1267
|
+
};
|
|
1268
|
+
break;
|
|
1269
|
+
case left:
|
|
1270
|
+
offsets = {
|
|
1271
|
+
x: reference2.x - element.width,
|
|
1272
|
+
y: commonY
|
|
1273
|
+
};
|
|
1274
|
+
break;
|
|
1275
|
+
default:
|
|
1276
|
+
offsets = {
|
|
1277
|
+
x: reference2.x,
|
|
1278
|
+
y: reference2.y
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
1282
|
+
if (mainAxis != null) {
|
|
1283
|
+
var len = mainAxis === "y" ? "height" : "width";
|
|
1284
|
+
switch (variation) {
|
|
1285
|
+
case start:
|
|
1286
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
|
1287
|
+
break;
|
|
1288
|
+
case end:
|
|
1289
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
|
1290
|
+
break;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return offsets;
|
|
1294
|
+
}
|
|
1295
|
+
function getFreshSideObject() {
|
|
1296
|
+
return {
|
|
1297
|
+
top: 0,
|
|
1298
|
+
right: 0,
|
|
1299
|
+
bottom: 0,
|
|
1300
|
+
left: 0
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
function mergePaddingObject(paddingObject) {
|
|
1304
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
1305
|
+
}
|
|
1306
|
+
function expandToHashMap(value, keys) {
|
|
1307
|
+
return keys.reduce(function(hashMap, key) {
|
|
1308
|
+
hashMap[key] = value;
|
|
1309
|
+
return hashMap;
|
|
1310
|
+
}, {});
|
|
1311
|
+
}
|
|
1312
|
+
function detectOverflow(state, options) {
|
|
1313
|
+
if (options === void 0) {
|
|
1314
|
+
options = {};
|
|
1315
|
+
}
|
|
1316
|
+
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
1317
|
+
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
1318
|
+
var altContext = elementContext === popper ? reference : popper;
|
|
1319
|
+
var popperRect = state.rects.popper;
|
|
1320
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
1321
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
1322
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
1323
|
+
var popperOffsets2 = computeOffsets({
|
|
1324
|
+
reference: referenceClientRect,
|
|
1325
|
+
element: popperRect,
|
|
1326
|
+
placement
|
|
1327
|
+
});
|
|
1328
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
1329
|
+
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
1330
|
+
var overflowOffsets = {
|
|
1331
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
1332
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
1333
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
1334
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
1335
|
+
};
|
|
1336
|
+
var offsetData = state.modifiersData.offset;
|
|
1337
|
+
if (elementContext === popper && offsetData) {
|
|
1338
|
+
var offset2 = offsetData[placement];
|
|
1339
|
+
Object.keys(overflowOffsets).forEach(function(key) {
|
|
1340
|
+
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
1341
|
+
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
|
|
1342
|
+
overflowOffsets[key] += offset2[axis] * multiply;
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
return overflowOffsets;
|
|
1346
|
+
}
|
|
1347
|
+
var DEFAULT_OPTIONS = {
|
|
1348
|
+
placement: "bottom",
|
|
1349
|
+
modifiers: [],
|
|
1350
|
+
strategy: "absolute"
|
|
1351
|
+
};
|
|
1352
|
+
function areValidElements() {
|
|
1353
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1354
|
+
args[_key] = arguments[_key];
|
|
1355
|
+
}
|
|
1356
|
+
return !args.some(function(element) {
|
|
1357
|
+
return !(element && typeof element.getBoundingClientRect === "function");
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
function popperGenerator(generatorOptions) {
|
|
1361
|
+
if (generatorOptions === void 0) {
|
|
1362
|
+
generatorOptions = {};
|
|
1363
|
+
}
|
|
1364
|
+
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
1365
|
+
return function createPopper(reference2, popper2, options) {
|
|
1366
|
+
if (options === void 0) {
|
|
1367
|
+
options = defaultOptions;
|
|
1368
|
+
}
|
|
1369
|
+
var state = {
|
|
1370
|
+
placement: "bottom",
|
|
1371
|
+
orderedModifiers: [],
|
|
1372
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
1373
|
+
modifiersData: {},
|
|
1374
|
+
elements: {
|
|
1375
|
+
reference: reference2,
|
|
1376
|
+
popper: popper2
|
|
1377
|
+
},
|
|
1378
|
+
attributes: {},
|
|
1379
|
+
styles: {}
|
|
1380
|
+
};
|
|
1381
|
+
var effectCleanupFns = [];
|
|
1382
|
+
var isDestroyed = false;
|
|
1383
|
+
var instance = {
|
|
1384
|
+
state,
|
|
1385
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
1386
|
+
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
1387
|
+
cleanupModifierEffects();
|
|
1388
|
+
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
1389
|
+
state.scrollParents = {
|
|
1390
|
+
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
1391
|
+
popper: listScrollParents(popper2)
|
|
1392
|
+
};
|
|
1393
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
1394
|
+
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
|
1395
|
+
return m.enabled;
|
|
1396
|
+
});
|
|
1397
|
+
runModifierEffects();
|
|
1398
|
+
return instance.update();
|
|
1399
|
+
},
|
|
1400
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
1401
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
1402
|
+
// logic.
|
|
1403
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
1404
|
+
// prefer the async Popper#update method
|
|
1405
|
+
forceUpdate: function forceUpdate() {
|
|
1406
|
+
if (isDestroyed) {
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
|
1410
|
+
if (!areValidElements(reference3, popper3)) {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
state.rects = {
|
|
1414
|
+
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
|
1415
|
+
popper: getLayoutRect(popper3)
|
|
1416
|
+
};
|
|
1417
|
+
state.reset = false;
|
|
1418
|
+
state.placement = state.options.placement;
|
|
1419
|
+
state.orderedModifiers.forEach(function(modifier) {
|
|
1420
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
1421
|
+
});
|
|
1422
|
+
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
1423
|
+
if (state.reset === true) {
|
|
1424
|
+
state.reset = false;
|
|
1425
|
+
index = -1;
|
|
1426
|
+
continue;
|
|
1427
|
+
}
|
|
1428
|
+
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
1429
|
+
if (typeof fn2 === "function") {
|
|
1430
|
+
state = fn2({
|
|
1431
|
+
state,
|
|
1432
|
+
options: _options,
|
|
1433
|
+
name,
|
|
1434
|
+
instance
|
|
1435
|
+
}) || state;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
1440
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
1441
|
+
update: debounce(function() {
|
|
1442
|
+
return new Promise(function(resolve) {
|
|
1443
|
+
instance.forceUpdate();
|
|
1444
|
+
resolve(state);
|
|
1445
|
+
});
|
|
1446
|
+
}),
|
|
1447
|
+
destroy: function destroy() {
|
|
1448
|
+
cleanupModifierEffects();
|
|
1449
|
+
isDestroyed = true;
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
if (!areValidElements(reference2, popper2)) {
|
|
1453
|
+
return instance;
|
|
1454
|
+
}
|
|
1455
|
+
instance.setOptions(options).then(function(state2) {
|
|
1456
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
|
1457
|
+
options.onFirstUpdate(state2);
|
|
1458
|
+
}
|
|
1459
|
+
});
|
|
1460
|
+
function runModifierEffects() {
|
|
1461
|
+
state.orderedModifiers.forEach(function(_ref) {
|
|
1462
|
+
var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect2 = _ref.effect;
|
|
1463
|
+
if (typeof effect2 === "function") {
|
|
1464
|
+
var cleanupFn = effect2({
|
|
1465
|
+
state,
|
|
1466
|
+
name,
|
|
1467
|
+
instance,
|
|
1468
|
+
options: options2
|
|
1469
|
+
});
|
|
1470
|
+
var noopFn = function noopFn2() {
|
|
1471
|
+
};
|
|
1472
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
|
1473
|
+
}
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
function cleanupModifierEffects() {
|
|
1477
|
+
effectCleanupFns.forEach(function(fn2) {
|
|
1478
|
+
return fn2();
|
|
1479
|
+
});
|
|
1480
|
+
effectCleanupFns = [];
|
|
1481
|
+
}
|
|
1482
|
+
return instance;
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
var passive = {
|
|
1486
|
+
passive: true
|
|
1487
|
+
};
|
|
1488
|
+
function effect$2(_ref) {
|
|
1489
|
+
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
1490
|
+
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
1491
|
+
var window = getWindow(state.elements.popper);
|
|
1492
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
1493
|
+
if (scroll) {
|
|
1494
|
+
scrollParents.forEach(function(scrollParent) {
|
|
1495
|
+
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
if (resize) {
|
|
1499
|
+
window.addEventListener("resize", instance.update, passive);
|
|
1500
|
+
}
|
|
1501
|
+
return function() {
|
|
1502
|
+
if (scroll) {
|
|
1503
|
+
scrollParents.forEach(function(scrollParent) {
|
|
1504
|
+
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
if (resize) {
|
|
1508
|
+
window.removeEventListener("resize", instance.update, passive);
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
const eventListeners = {
|
|
1513
|
+
name: "eventListeners",
|
|
1514
|
+
enabled: true,
|
|
1515
|
+
phase: "write",
|
|
1516
|
+
fn: function fn() {
|
|
1517
|
+
},
|
|
1518
|
+
effect: effect$2,
|
|
1519
|
+
data: {}
|
|
1520
|
+
};
|
|
1521
|
+
function popperOffsets(_ref) {
|
|
1522
|
+
var state = _ref.state, name = _ref.name;
|
|
1523
|
+
state.modifiersData[name] = computeOffsets({
|
|
1524
|
+
reference: state.rects.reference,
|
|
1525
|
+
element: state.rects.popper,
|
|
1526
|
+
placement: state.placement
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
const popperOffsets$1 = {
|
|
1530
|
+
name: "popperOffsets",
|
|
1531
|
+
enabled: true,
|
|
1532
|
+
phase: "read",
|
|
1533
|
+
fn: popperOffsets,
|
|
1534
|
+
data: {}
|
|
1535
|
+
};
|
|
1536
|
+
var unsetSides = {
|
|
1537
|
+
top: "auto",
|
|
1538
|
+
right: "auto",
|
|
1539
|
+
bottom: "auto",
|
|
1540
|
+
left: "auto"
|
|
1541
|
+
};
|
|
1542
|
+
function roundOffsetsByDPR(_ref, win) {
|
|
1543
|
+
var x = _ref.x, y = _ref.y;
|
|
1544
|
+
var dpr = win.devicePixelRatio || 1;
|
|
1545
|
+
return {
|
|
1546
|
+
x: round(x * dpr) / dpr || 0,
|
|
1547
|
+
y: round(y * dpr) / dpr || 0
|
|
1548
|
+
};
|
|
1549
|
+
}
|
|
1550
|
+
function mapToStyles(_ref2) {
|
|
1551
|
+
var _Object$assign2;
|
|
1552
|
+
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
|
1553
|
+
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
1554
|
+
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
1555
|
+
x,
|
|
1556
|
+
y
|
|
1557
|
+
}) : {
|
|
1558
|
+
x,
|
|
1559
|
+
y
|
|
1560
|
+
};
|
|
1561
|
+
x = _ref3.x;
|
|
1562
|
+
y = _ref3.y;
|
|
1563
|
+
var hasX = offsets.hasOwnProperty("x");
|
|
1564
|
+
var hasY = offsets.hasOwnProperty("y");
|
|
1565
|
+
var sideX = left;
|
|
1566
|
+
var sideY = top;
|
|
1567
|
+
var win = void 0;
|
|
1568
|
+
if (adaptive) {
|
|
1569
|
+
var offsetParent = getOffsetParent(popper2);
|
|
1570
|
+
var heightProp = "clientHeight";
|
|
1571
|
+
var widthProp = "clientWidth";
|
|
1572
|
+
if (offsetParent === getWindow(popper2)) {
|
|
1573
|
+
offsetParent = getDocumentElement(popper2);
|
|
1574
|
+
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
|
1575
|
+
heightProp = "scrollHeight";
|
|
1576
|
+
widthProp = "scrollWidth";
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
offsetParent = offsetParent;
|
|
1580
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
1581
|
+
sideY = bottom;
|
|
1582
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
|
|
1583
|
+
// $FlowFixMe[prop-missing]
|
|
1584
|
+
offsetParent[heightProp]
|
|
1585
|
+
);
|
|
1586
|
+
y -= offsetY - popperRect.height;
|
|
1587
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
1588
|
+
}
|
|
1589
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
1590
|
+
sideX = right;
|
|
1591
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
|
|
1592
|
+
// $FlowFixMe[prop-missing]
|
|
1593
|
+
offsetParent[widthProp]
|
|
1594
|
+
);
|
|
1595
|
+
x -= offsetX - popperRect.width;
|
|
1596
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
var commonStyles = Object.assign({
|
|
1600
|
+
position
|
|
1601
|
+
}, adaptive && unsetSides);
|
|
1602
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
1603
|
+
x,
|
|
1604
|
+
y
|
|
1605
|
+
}, getWindow(popper2)) : {
|
|
1606
|
+
x,
|
|
1607
|
+
y
|
|
1608
|
+
};
|
|
1609
|
+
x = _ref4.x;
|
|
1610
|
+
y = _ref4.y;
|
|
1611
|
+
if (gpuAcceleration) {
|
|
1612
|
+
var _Object$assign;
|
|
1613
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
1614
|
+
}
|
|
1615
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
1616
|
+
}
|
|
1617
|
+
function computeStyles(_ref5) {
|
|
1618
|
+
var state = _ref5.state, options = _ref5.options;
|
|
1619
|
+
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
1620
|
+
var commonStyles = {
|
|
1621
|
+
placement: getBasePlacement(state.placement),
|
|
1622
|
+
variation: getVariation(state.placement),
|
|
1623
|
+
popper: state.elements.popper,
|
|
1624
|
+
popperRect: state.rects.popper,
|
|
1625
|
+
gpuAcceleration,
|
|
1626
|
+
isFixed: state.options.strategy === "fixed"
|
|
1627
|
+
};
|
|
1628
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
1629
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
1630
|
+
offsets: state.modifiersData.popperOffsets,
|
|
1631
|
+
position: state.options.strategy,
|
|
1632
|
+
adaptive,
|
|
1633
|
+
roundOffsets
|
|
1634
|
+
})));
|
|
1635
|
+
}
|
|
1636
|
+
if (state.modifiersData.arrow != null) {
|
|
1637
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
1638
|
+
offsets: state.modifiersData.arrow,
|
|
1639
|
+
position: "absolute",
|
|
1640
|
+
adaptive: false,
|
|
1641
|
+
roundOffsets
|
|
1642
|
+
})));
|
|
1643
|
+
}
|
|
1644
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
1645
|
+
"data-popper-placement": state.placement
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
const computeStyles$1 = {
|
|
1649
|
+
name: "computeStyles",
|
|
1650
|
+
enabled: true,
|
|
1651
|
+
phase: "beforeWrite",
|
|
1652
|
+
fn: computeStyles,
|
|
1653
|
+
data: {}
|
|
1654
|
+
};
|
|
1655
|
+
function applyStyles(_ref) {
|
|
1656
|
+
var state = _ref.state;
|
|
1657
|
+
Object.keys(state.elements).forEach(function(name) {
|
|
1658
|
+
var style = state.styles[name] || {};
|
|
1659
|
+
var attributes = state.attributes[name] || {};
|
|
1660
|
+
var element = state.elements[name];
|
|
1661
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
Object.assign(element.style, style);
|
|
1665
|
+
Object.keys(attributes).forEach(function(name2) {
|
|
1666
|
+
var value = attributes[name2];
|
|
1667
|
+
if (value === false) {
|
|
1668
|
+
element.removeAttribute(name2);
|
|
1669
|
+
} else {
|
|
1670
|
+
element.setAttribute(name2, value === true ? "" : value);
|
|
1671
|
+
}
|
|
1672
|
+
});
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
function effect$1(_ref2) {
|
|
1676
|
+
var state = _ref2.state;
|
|
1677
|
+
var initialStyles = {
|
|
1678
|
+
popper: {
|
|
1679
|
+
position: state.options.strategy,
|
|
1680
|
+
left: "0",
|
|
1681
|
+
top: "0",
|
|
1682
|
+
margin: "0"
|
|
1683
|
+
},
|
|
1684
|
+
arrow: {
|
|
1685
|
+
position: "absolute"
|
|
1686
|
+
},
|
|
1687
|
+
reference: {}
|
|
1688
|
+
};
|
|
1689
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
1690
|
+
state.styles = initialStyles;
|
|
1691
|
+
if (state.elements.arrow) {
|
|
1692
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
1693
|
+
}
|
|
1694
|
+
return function() {
|
|
1695
|
+
Object.keys(state.elements).forEach(function(name) {
|
|
1696
|
+
var element = state.elements[name];
|
|
1697
|
+
var attributes = state.attributes[name] || {};
|
|
1698
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
1699
|
+
var style = styleProperties.reduce(function(style2, property) {
|
|
1700
|
+
style2[property] = "";
|
|
1701
|
+
return style2;
|
|
1702
|
+
}, {});
|
|
1703
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
Object.assign(element.style, style);
|
|
1707
|
+
Object.keys(attributes).forEach(function(attribute) {
|
|
1708
|
+
element.removeAttribute(attribute);
|
|
1709
|
+
});
|
|
1710
|
+
});
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
const applyStyles$1 = {
|
|
1714
|
+
name: "applyStyles",
|
|
1715
|
+
enabled: true,
|
|
1716
|
+
phase: "write",
|
|
1717
|
+
fn: applyStyles,
|
|
1718
|
+
effect: effect$1,
|
|
1719
|
+
requires: ["computeStyles"]
|
|
1720
|
+
};
|
|
1721
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
|
1722
|
+
var hash$1 = {
|
|
1723
|
+
left: "right",
|
|
1724
|
+
right: "left",
|
|
1725
|
+
bottom: "top",
|
|
1726
|
+
top: "bottom"
|
|
1727
|
+
};
|
|
1728
|
+
function getOppositePlacement(placement) {
|
|
1729
|
+
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
1730
|
+
return hash$1[matched];
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
var hash = {
|
|
1734
|
+
start: "end",
|
|
1735
|
+
end: "start"
|
|
1736
|
+
};
|
|
1737
|
+
function getOppositeVariationPlacement(placement) {
|
|
1738
|
+
return placement.replace(/start|end/g, function(matched) {
|
|
1739
|
+
return hash[matched];
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
function computeAutoPlacement(state, options) {
|
|
1743
|
+
if (options === void 0) {
|
|
1744
|
+
options = {};
|
|
1745
|
+
}
|
|
1746
|
+
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
1747
|
+
var variation = getVariation(placement);
|
|
1748
|
+
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
1749
|
+
return getVariation(placement2) === variation;
|
|
1750
|
+
}) : basePlacements;
|
|
1751
|
+
var allowedPlacements = placements$1.filter(function(placement2) {
|
|
1752
|
+
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
1753
|
+
});
|
|
1754
|
+
if (allowedPlacements.length === 0) {
|
|
1755
|
+
allowedPlacements = placements$1;
|
|
1756
|
+
}
|
|
1757
|
+
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
1758
|
+
acc[placement2] = detectOverflow(state, {
|
|
1759
|
+
placement: placement2,
|
|
1760
|
+
boundary,
|
|
1761
|
+
rootBoundary,
|
|
1762
|
+
padding
|
|
1763
|
+
})[getBasePlacement(placement2)];
|
|
1764
|
+
return acc;
|
|
1765
|
+
}, {});
|
|
1766
|
+
return Object.keys(overflows).sort(function(a2, b) {
|
|
1767
|
+
return overflows[a2] - overflows[b];
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
function getExpandedFallbackPlacements(placement) {
|
|
1771
|
+
if (getBasePlacement(placement) === auto) {
|
|
1772
|
+
return [];
|
|
1773
|
+
}
|
|
1774
|
+
var oppositePlacement = getOppositePlacement(placement);
|
|
1775
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
1776
|
+
}
|
|
1777
|
+
function flip(_ref) {
|
|
1778
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
1779
|
+
if (state.modifiersData[name]._skip) {
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1782
|
+
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
|
1783
|
+
var preferredPlacement = state.options.placement;
|
|
1784
|
+
var basePlacement = getBasePlacement(preferredPlacement);
|
|
1785
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
|
1786
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
1787
|
+
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
|
1788
|
+
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
|
1789
|
+
placement: placement2,
|
|
1790
|
+
boundary,
|
|
1791
|
+
rootBoundary,
|
|
1792
|
+
padding,
|
|
1793
|
+
flipVariations,
|
|
1794
|
+
allowedAutoPlacements
|
|
1795
|
+
}) : placement2);
|
|
1796
|
+
}, []);
|
|
1797
|
+
var referenceRect = state.rects.reference;
|
|
1798
|
+
var popperRect = state.rects.popper;
|
|
1799
|
+
var checksMap = /* @__PURE__ */ new Map();
|
|
1800
|
+
var makeFallbackChecks = true;
|
|
1801
|
+
var firstFittingPlacement = placements2[0];
|
|
1802
|
+
for (var i2 = 0; i2 < placements2.length; i2++) {
|
|
1803
|
+
var placement = placements2[i2];
|
|
1804
|
+
var _basePlacement = getBasePlacement(placement);
|
|
1805
|
+
var isStartVariation = getVariation(placement) === start;
|
|
1806
|
+
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
1807
|
+
var len = isVertical ? "width" : "height";
|
|
1808
|
+
var overflow = detectOverflow(state, {
|
|
1809
|
+
placement,
|
|
1810
|
+
boundary,
|
|
1811
|
+
rootBoundary,
|
|
1812
|
+
altBoundary,
|
|
1813
|
+
padding
|
|
1814
|
+
});
|
|
1815
|
+
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
1816
|
+
if (referenceRect[len] > popperRect[len]) {
|
|
1817
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
1818
|
+
}
|
|
1819
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
1820
|
+
var checks = [];
|
|
1821
|
+
if (checkMainAxis) {
|
|
1822
|
+
checks.push(overflow[_basePlacement] <= 0);
|
|
1823
|
+
}
|
|
1824
|
+
if (checkAltAxis) {
|
|
1825
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
1826
|
+
}
|
|
1827
|
+
if (checks.every(function(check) {
|
|
1828
|
+
return check;
|
|
1829
|
+
})) {
|
|
1830
|
+
firstFittingPlacement = placement;
|
|
1831
|
+
makeFallbackChecks = false;
|
|
1832
|
+
break;
|
|
1833
|
+
}
|
|
1834
|
+
checksMap.set(placement, checks);
|
|
1835
|
+
}
|
|
1836
|
+
if (makeFallbackChecks) {
|
|
1837
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
|
1838
|
+
var _loop = function _loop2(_i2) {
|
|
1839
|
+
var fittingPlacement = placements2.find(function(placement2) {
|
|
1840
|
+
var checks2 = checksMap.get(placement2);
|
|
1841
|
+
if (checks2) {
|
|
1842
|
+
return checks2.slice(0, _i2).every(function(check) {
|
|
1843
|
+
return check;
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
});
|
|
1847
|
+
if (fittingPlacement) {
|
|
1848
|
+
firstFittingPlacement = fittingPlacement;
|
|
1849
|
+
return "break";
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
1853
|
+
var _ret = _loop(_i);
|
|
1854
|
+
if (_ret === "break") break;
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
if (state.placement !== firstFittingPlacement) {
|
|
1858
|
+
state.modifiersData[name]._skip = true;
|
|
1859
|
+
state.placement = firstFittingPlacement;
|
|
1860
|
+
state.reset = true;
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
const flip$1 = {
|
|
1864
|
+
name: "flip",
|
|
1865
|
+
enabled: true,
|
|
1866
|
+
phase: "main",
|
|
1867
|
+
fn: flip,
|
|
1868
|
+
requiresIfExists: ["offset"],
|
|
1869
|
+
data: {
|
|
1870
|
+
_skip: false
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
1874
|
+
var basePlacement = getBasePlacement(placement);
|
|
1875
|
+
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
1876
|
+
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
|
1877
|
+
placement
|
|
1878
|
+
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
|
1879
|
+
skidding = skidding || 0;
|
|
1880
|
+
distance = (distance || 0) * invertDistance;
|
|
1881
|
+
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
1882
|
+
x: distance,
|
|
1883
|
+
y: skidding
|
|
1884
|
+
} : {
|
|
1885
|
+
x: skidding,
|
|
1886
|
+
y: distance
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
function offset(_ref2) {
|
|
1890
|
+
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
1891
|
+
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
1892
|
+
var data = placements.reduce(function(acc, placement) {
|
|
1893
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
|
1894
|
+
return acc;
|
|
1895
|
+
}, {});
|
|
1896
|
+
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
|
1897
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
1898
|
+
state.modifiersData.popperOffsets.x += x;
|
|
1899
|
+
state.modifiersData.popperOffsets.y += y;
|
|
1900
|
+
}
|
|
1901
|
+
state.modifiersData[name] = data;
|
|
1902
|
+
}
|
|
1903
|
+
const offset$1 = {
|
|
1904
|
+
name: "offset",
|
|
1905
|
+
enabled: true,
|
|
1906
|
+
phase: "main",
|
|
1907
|
+
requires: ["popperOffsets"],
|
|
1908
|
+
fn: offset
|
|
1909
|
+
};
|
|
1910
|
+
function getAltAxis(axis) {
|
|
1911
|
+
return axis === "x" ? "y" : "x";
|
|
1912
|
+
}
|
|
1913
|
+
function within(min$1, value, max$1) {
|
|
1914
|
+
return max(min$1, min(value, max$1));
|
|
1915
|
+
}
|
|
1916
|
+
function withinMaxClamp(min2, value, max2) {
|
|
1917
|
+
var v = within(min2, value, max2);
|
|
1918
|
+
return v > max2 ? max2 : v;
|
|
1919
|
+
}
|
|
1920
|
+
function preventOverflow(_ref) {
|
|
1921
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
1922
|
+
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
1923
|
+
var overflow = detectOverflow(state, {
|
|
1924
|
+
boundary,
|
|
1925
|
+
rootBoundary,
|
|
1926
|
+
padding,
|
|
1927
|
+
altBoundary
|
|
1928
|
+
});
|
|
1929
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
1930
|
+
var variation = getVariation(state.placement);
|
|
1931
|
+
var isBasePlacement = !variation;
|
|
1932
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
1933
|
+
var altAxis = getAltAxis(mainAxis);
|
|
1934
|
+
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
1935
|
+
var referenceRect = state.rects.reference;
|
|
1936
|
+
var popperRect = state.rects.popper;
|
|
1937
|
+
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
|
1938
|
+
placement: state.placement
|
|
1939
|
+
})) : tetherOffset;
|
|
1940
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
|
1941
|
+
mainAxis: tetherOffsetValue,
|
|
1942
|
+
altAxis: tetherOffsetValue
|
|
1943
|
+
} : Object.assign({
|
|
1944
|
+
mainAxis: 0,
|
|
1945
|
+
altAxis: 0
|
|
1946
|
+
}, tetherOffsetValue);
|
|
1947
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
1948
|
+
var data = {
|
|
1949
|
+
x: 0,
|
|
1950
|
+
y: 0
|
|
1951
|
+
};
|
|
1952
|
+
if (!popperOffsets2) {
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1955
|
+
if (checkMainAxis) {
|
|
1956
|
+
var _offsetModifierState$;
|
|
1957
|
+
var mainSide = mainAxis === "y" ? top : left;
|
|
1958
|
+
var altSide = mainAxis === "y" ? bottom : right;
|
|
1959
|
+
var len = mainAxis === "y" ? "height" : "width";
|
|
1960
|
+
var offset2 = popperOffsets2[mainAxis];
|
|
1961
|
+
var min$1 = offset2 + overflow[mainSide];
|
|
1962
|
+
var max$1 = offset2 - overflow[altSide];
|
|
1963
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1964
|
+
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
1965
|
+
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
1966
|
+
var arrowElement = state.elements.arrow;
|
|
1967
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
1968
|
+
width: 0,
|
|
1969
|
+
height: 0
|
|
1970
|
+
};
|
|
1971
|
+
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
|
1972
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
1973
|
+
var arrowPaddingMax = arrowPaddingObject[altSide];
|
|
1974
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
1975
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
1976
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
1977
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
1978
|
+
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
1979
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
1980
|
+
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
1981
|
+
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
1982
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1);
|
|
1983
|
+
popperOffsets2[mainAxis] = preventedOffset;
|
|
1984
|
+
data[mainAxis] = preventedOffset - offset2;
|
|
1985
|
+
}
|
|
1986
|
+
if (checkAltAxis) {
|
|
1987
|
+
var _offsetModifierState$2;
|
|
1988
|
+
var _mainSide = mainAxis === "x" ? top : left;
|
|
1989
|
+
var _altSide = mainAxis === "x" ? bottom : right;
|
|
1990
|
+
var _offset = popperOffsets2[altAxis];
|
|
1991
|
+
var _len = altAxis === "y" ? "height" : "width";
|
|
1992
|
+
var _min = _offset + overflow[_mainSide];
|
|
1993
|
+
var _max = _offset - overflow[_altSide];
|
|
1994
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
1995
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
1996
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
1997
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
1998
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
1999
|
+
popperOffsets2[altAxis] = _preventedOffset;
|
|
2000
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
2001
|
+
}
|
|
2002
|
+
state.modifiersData[name] = data;
|
|
2003
|
+
}
|
|
2004
|
+
const preventOverflow$1 = {
|
|
2005
|
+
name: "preventOverflow",
|
|
2006
|
+
enabled: true,
|
|
2007
|
+
phase: "main",
|
|
2008
|
+
fn: preventOverflow,
|
|
2009
|
+
requiresIfExists: ["offset"]
|
|
2010
|
+
};
|
|
2011
|
+
var toPaddingObject = function toPaddingObject2(padding, state) {
|
|
2012
|
+
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
|
|
2013
|
+
placement: state.placement
|
|
2014
|
+
})) : padding;
|
|
2015
|
+
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
2016
|
+
};
|
|
2017
|
+
function arrow(_ref) {
|
|
2018
|
+
var _state$modifiersData$;
|
|
2019
|
+
var state = _ref.state, name = _ref.name, options = _ref.options;
|
|
2020
|
+
var arrowElement = state.elements.arrow;
|
|
2021
|
+
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
2022
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
2023
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
|
2024
|
+
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
2025
|
+
var len = isVertical ? "height" : "width";
|
|
2026
|
+
if (!arrowElement || !popperOffsets2) {
|
|
2027
|
+
return;
|
|
2028
|
+
}
|
|
2029
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
2030
|
+
var arrowRect = getLayoutRect(arrowElement);
|
|
2031
|
+
var minProp = axis === "y" ? top : left;
|
|
2032
|
+
var maxProp = axis === "y" ? bottom : right;
|
|
2033
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
|
2034
|
+
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
|
2035
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
2036
|
+
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
2037
|
+
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
2038
|
+
var min2 = paddingObject[minProp];
|
|
2039
|
+
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
2040
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
2041
|
+
var offset2 = within(min2, center, max2);
|
|
2042
|
+
var axisProp = axis;
|
|
2043
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
|
2044
|
+
}
|
|
2045
|
+
function effect(_ref2) {
|
|
2046
|
+
var state = _ref2.state, options = _ref2.options;
|
|
2047
|
+
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
|
2048
|
+
if (arrowElement == null) {
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
if (typeof arrowElement === "string") {
|
|
2052
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
2053
|
+
if (!arrowElement) {
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
state.elements.arrow = arrowElement;
|
|
2061
|
+
}
|
|
2062
|
+
const arrowModifier = {
|
|
2063
|
+
name: "arrow",
|
|
2064
|
+
enabled: true,
|
|
2065
|
+
phase: "main",
|
|
2066
|
+
fn: arrow,
|
|
2067
|
+
effect,
|
|
2068
|
+
requires: ["popperOffsets"],
|
|
2069
|
+
requiresIfExists: ["preventOverflow"]
|
|
2070
|
+
};
|
|
2071
|
+
popperGenerator({
|
|
2072
|
+
defaultModifiers: [...defaultModifiers, offset$1, flip$1, preventOverflow$1, computeStyles$1, eventListeners, arrowModifier]
|
|
2073
|
+
});
|
|
2074
|
+
function usePopper({
|
|
2075
|
+
locked = false,
|
|
2076
|
+
overflowPadding = 8,
|
|
2077
|
+
offsetDistance = 8,
|
|
2078
|
+
offsetSkid = 0,
|
|
2079
|
+
gpuAcceleration = true,
|
|
2080
|
+
adaptive = true,
|
|
2081
|
+
scroll = true,
|
|
2082
|
+
resize = true,
|
|
2083
|
+
arrow: arrow2 = false,
|
|
2084
|
+
placement,
|
|
2085
|
+
strategy
|
|
2086
|
+
}, virtualReference) {
|
|
2087
|
+
const reference2 = ref(null);
|
|
2088
|
+
const popper2 = ref(null);
|
|
2089
|
+
const instance = ref(null);
|
|
2090
|
+
return [reference2, popper2, instance];
|
|
2091
|
+
}
|
|
2092
|
+
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.select, select);
|
|
2093
|
+
const configMenu = mergeConfig(appConfig.ui.strategy, appConfig.ui.selectMenu, selectMenu);
|
|
2094
|
+
const _sfc_main$1 = defineComponent({
|
|
2095
|
+
components: {
|
|
2096
|
+
HCombobox: lt,
|
|
2097
|
+
HComboboxButton: nt,
|
|
2098
|
+
HComboboxOptions: ut,
|
|
2099
|
+
HComboboxOption: rt,
|
|
2100
|
+
HComboboxInput: it,
|
|
2101
|
+
HListbox: Ie,
|
|
2102
|
+
HListboxButton: je,
|
|
2103
|
+
HListboxOptions: Ae,
|
|
2104
|
+
HListboxOption: Fe,
|
|
2105
|
+
UIcon: __nuxt_component_0$1,
|
|
2106
|
+
UAvatar: __nuxt_component_1$2
|
|
2107
|
+
},
|
|
2108
|
+
inheritAttrs: false,
|
|
2109
|
+
props: {
|
|
2110
|
+
modelValue: {
|
|
2111
|
+
type: [String, Number, Object, Array, Boolean],
|
|
2112
|
+
default: ""
|
|
2113
|
+
},
|
|
2114
|
+
query: {
|
|
2115
|
+
type: String,
|
|
2116
|
+
default: null
|
|
2117
|
+
},
|
|
2118
|
+
by: {
|
|
2119
|
+
type: String,
|
|
2120
|
+
default: void 0
|
|
2121
|
+
},
|
|
2122
|
+
options: {
|
|
2123
|
+
type: Array,
|
|
2124
|
+
default: () => []
|
|
2125
|
+
},
|
|
2126
|
+
id: {
|
|
2127
|
+
type: String,
|
|
2128
|
+
default: null
|
|
2129
|
+
},
|
|
2130
|
+
name: {
|
|
2131
|
+
type: String,
|
|
2132
|
+
default: null
|
|
2133
|
+
},
|
|
2134
|
+
required: {
|
|
2135
|
+
type: Boolean,
|
|
2136
|
+
default: false
|
|
2137
|
+
},
|
|
2138
|
+
icon: {
|
|
2139
|
+
type: String,
|
|
2140
|
+
default: null
|
|
2141
|
+
},
|
|
2142
|
+
loadingIcon: {
|
|
2143
|
+
type: String,
|
|
2144
|
+
default: () => config.default.loadingIcon
|
|
2145
|
+
},
|
|
2146
|
+
leadingIcon: {
|
|
2147
|
+
type: String,
|
|
2148
|
+
default: null
|
|
2149
|
+
},
|
|
2150
|
+
trailingIcon: {
|
|
2151
|
+
type: String,
|
|
2152
|
+
default: () => config.default.trailingIcon
|
|
2153
|
+
},
|
|
2154
|
+
trailing: {
|
|
2155
|
+
type: Boolean,
|
|
2156
|
+
default: false
|
|
2157
|
+
},
|
|
2158
|
+
leading: {
|
|
2159
|
+
type: Boolean,
|
|
2160
|
+
default: false
|
|
2161
|
+
},
|
|
2162
|
+
loading: {
|
|
2163
|
+
type: Boolean,
|
|
2164
|
+
default: false
|
|
2165
|
+
},
|
|
2166
|
+
selectedIcon: {
|
|
2167
|
+
type: String,
|
|
2168
|
+
default: () => configMenu.default.selectedIcon
|
|
2169
|
+
},
|
|
2170
|
+
disabled: {
|
|
2171
|
+
type: Boolean,
|
|
2172
|
+
default: false
|
|
2173
|
+
},
|
|
2174
|
+
multiple: {
|
|
2175
|
+
type: Boolean,
|
|
2176
|
+
default: false
|
|
2177
|
+
},
|
|
2178
|
+
searchable: {
|
|
2179
|
+
type: [Boolean, Function],
|
|
2180
|
+
default: false
|
|
2181
|
+
},
|
|
2182
|
+
searchablePlaceholder: {
|
|
2183
|
+
type: String,
|
|
2184
|
+
default: () => configMenu.default.searchablePlaceholder.label
|
|
2185
|
+
},
|
|
2186
|
+
searchableLazy: {
|
|
2187
|
+
type: Boolean,
|
|
2188
|
+
default: false
|
|
2189
|
+
},
|
|
2190
|
+
clearSearchOnClose: {
|
|
2191
|
+
type: Boolean,
|
|
2192
|
+
default: () => configMenu.default.clearSearchOnClose
|
|
2193
|
+
},
|
|
2194
|
+
debounce: {
|
|
2195
|
+
type: Number,
|
|
2196
|
+
default: 200
|
|
2197
|
+
},
|
|
2198
|
+
creatable: {
|
|
2199
|
+
type: Boolean,
|
|
2200
|
+
default: false
|
|
2201
|
+
},
|
|
2202
|
+
showCreateOptionWhen: {
|
|
2203
|
+
type: [String, Function],
|
|
2204
|
+
default: () => configMenu.default.showCreateOptionWhen
|
|
2205
|
+
},
|
|
2206
|
+
placeholder: {
|
|
2207
|
+
type: String,
|
|
2208
|
+
default: null
|
|
2209
|
+
},
|
|
2210
|
+
padded: {
|
|
2211
|
+
type: Boolean,
|
|
2212
|
+
default: true
|
|
2213
|
+
},
|
|
2214
|
+
size: {
|
|
2215
|
+
type: String,
|
|
2216
|
+
default: null,
|
|
2217
|
+
validator(value) {
|
|
2218
|
+
return Object.keys(config.size).includes(value);
|
|
2219
|
+
}
|
|
2220
|
+
},
|
|
2221
|
+
color: {
|
|
2222
|
+
type: String,
|
|
2223
|
+
default: () => config.default.color,
|
|
2224
|
+
validator(value) {
|
|
2225
|
+
return [...appConfig.ui.colors, ...Object.keys(config.color)].includes(value);
|
|
2226
|
+
}
|
|
2227
|
+
},
|
|
2228
|
+
variant: {
|
|
2229
|
+
type: String,
|
|
2230
|
+
default: () => config.default.variant,
|
|
2231
|
+
validator(value) {
|
|
2232
|
+
return [
|
|
2233
|
+
...Object.keys(config.variant),
|
|
2234
|
+
...Object.values(config.color).flatMap((value2) => Object.keys(value2))
|
|
2235
|
+
].includes(value);
|
|
2236
|
+
}
|
|
2237
|
+
},
|
|
2238
|
+
optionAttribute: {
|
|
2239
|
+
type: String,
|
|
2240
|
+
default: "label"
|
|
2241
|
+
},
|
|
2242
|
+
valueAttribute: {
|
|
2243
|
+
type: String,
|
|
2244
|
+
default: null
|
|
2245
|
+
},
|
|
2246
|
+
searchAttributes: {
|
|
2247
|
+
type: Array,
|
|
2248
|
+
default: null
|
|
2249
|
+
},
|
|
2250
|
+
inputTargetForm: {
|
|
2251
|
+
type: String,
|
|
2252
|
+
default: null
|
|
2253
|
+
},
|
|
2254
|
+
popper: {
|
|
2255
|
+
type: Object,
|
|
2256
|
+
default: () => ({})
|
|
2257
|
+
},
|
|
2258
|
+
selectClass: {
|
|
2259
|
+
type: String,
|
|
2260
|
+
default: null
|
|
2261
|
+
},
|
|
2262
|
+
class: {
|
|
2263
|
+
type: [String, Object, Array],
|
|
2264
|
+
default: () => ""
|
|
2265
|
+
},
|
|
2266
|
+
ui: {
|
|
2267
|
+
type: Object,
|
|
2268
|
+
default: () => ({})
|
|
2269
|
+
},
|
|
2270
|
+
uiMenu: {
|
|
2271
|
+
type: Object,
|
|
2272
|
+
default: () => ({})
|
|
2273
|
+
}
|
|
2274
|
+
},
|
|
2275
|
+
emits: ["update:modelValue", "update:query", "open", "close", "change"],
|
|
2276
|
+
setup(props, { emit, slots }) {
|
|
2277
|
+
const { ui, attrs } = useUI("select", toRef(props, "ui"), config, toRef(props, "class"));
|
|
2278
|
+
const { ui: uiMenu } = useUI("selectMenu", toRef(props, "uiMenu"), configMenu);
|
|
2279
|
+
const popper2 = computed(() => defu({}, props.popper, uiMenu.value.popper));
|
|
2280
|
+
const [trigger, container] = usePopper(popper2.value);
|
|
2281
|
+
const by = computed(() => {
|
|
2282
|
+
if (!props.by) return void 0;
|
|
2283
|
+
if (typeof props.by === "function") {
|
|
2284
|
+
return props.by;
|
|
2285
|
+
}
|
|
2286
|
+
const key = props.by;
|
|
2287
|
+
const hasDot = key.indexOf(".");
|
|
2288
|
+
if (hasDot > 0) {
|
|
2289
|
+
return (a2, z) => {
|
|
2290
|
+
return accessor(a2, key) === accessor(z, key);
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
return key;
|
|
2294
|
+
});
|
|
2295
|
+
const { size: sizeButtonGroup, rounded } = useInjectButtonGroup({ ui, props });
|
|
2296
|
+
const { emitFormBlur, emitFormChange, inputId, color, size: sizeFormGroup, name } = useFormGroup(props, config);
|
|
2297
|
+
const size = computed(() => {
|
|
2298
|
+
var _a;
|
|
2299
|
+
return (_a = sizeButtonGroup.value) != null ? _a : sizeFormGroup.value;
|
|
2300
|
+
});
|
|
2301
|
+
const internalQuery = ref("");
|
|
2302
|
+
const query = computed({
|
|
2303
|
+
get() {
|
|
2304
|
+
var _a;
|
|
2305
|
+
return (_a = props.query) != null ? _a : internalQuery.value;
|
|
2306
|
+
},
|
|
2307
|
+
set(value) {
|
|
2308
|
+
internalQuery.value = value;
|
|
2309
|
+
emit("update:query", value);
|
|
2310
|
+
}
|
|
2311
|
+
});
|
|
2312
|
+
const selected = computed(() => {
|
|
2313
|
+
var _a;
|
|
2314
|
+
function compareValues(value1, value2) {
|
|
2315
|
+
if (by.value && typeof by.value !== "function" && isObject(value1) && isObject(value2)) {
|
|
2316
|
+
return isEqual(value1[by.value], value2[by.value]);
|
|
2317
|
+
}
|
|
2318
|
+
return isEqual(value1, value2);
|
|
2319
|
+
}
|
|
2320
|
+
function getValue(value) {
|
|
2321
|
+
if (props.valueAttribute) {
|
|
2322
|
+
return accessor(value, props.valueAttribute);
|
|
2323
|
+
}
|
|
2324
|
+
return value;
|
|
2325
|
+
}
|
|
2326
|
+
if (props.multiple) {
|
|
2327
|
+
const modelValue = props.modelValue;
|
|
2328
|
+
if (!Array.isArray(modelValue) || !modelValue.length) {
|
|
2329
|
+
return [];
|
|
2330
|
+
}
|
|
2331
|
+
return options.value.filter((option) => {
|
|
2332
|
+
const optionValue = getValue(option);
|
|
2333
|
+
return modelValue.some((value) => compareValues(value, optionValue));
|
|
2334
|
+
});
|
|
2335
|
+
}
|
|
2336
|
+
return (_a = options.value.find((option) => {
|
|
2337
|
+
const optionValue = getValue(option);
|
|
2338
|
+
return compareValues(optionValue, toRaw(props.modelValue));
|
|
2339
|
+
})) != null ? _a : props.modelValue;
|
|
2340
|
+
});
|
|
2341
|
+
const label = computed(() => {
|
|
2342
|
+
if (!props.modelValue) return null;
|
|
2343
|
+
if (Array.isArray(props.modelValue) && props.modelValue.length) {
|
|
2344
|
+
return `${props.modelValue.length} selected`;
|
|
2345
|
+
} else if (["string", "number"].includes(typeof props.modelValue)) {
|
|
2346
|
+
return props.valueAttribute ? accessor(selected.value, props.optionAttribute) : props.modelValue;
|
|
2347
|
+
}
|
|
2348
|
+
return accessor(props.modelValue, props.optionAttribute);
|
|
2349
|
+
});
|
|
2350
|
+
const selectClass = computed(() => {
|
|
2351
|
+
var _a, _b;
|
|
2352
|
+
const variant = ((_b = (_a = ui.value.color) == null ? void 0 : _a[color.value]) == null ? void 0 : _b[props.variant]) || ui.value.variant[props.variant];
|
|
2353
|
+
return twMerge(twJoin(
|
|
2354
|
+
ui.value.base,
|
|
2355
|
+
uiMenu.value.select,
|
|
2356
|
+
rounded.value,
|
|
2357
|
+
ui.value.size[size.value],
|
|
2358
|
+
ui.value.gap[size.value],
|
|
2359
|
+
props.padded ? ui.value.padding[size.value] : "p-0",
|
|
2360
|
+
variant == null ? void 0 : variant.replaceAll("{color}", color.value),
|
|
2361
|
+
(isLeading.value || slots.leading) && ui.value.leading.padding[size.value],
|
|
2362
|
+
(isTrailing.value || slots.trailing) && ui.value.trailing.padding[size.value]
|
|
2363
|
+
), props.placeholder && (!props.modelValue || Array.isArray(props.modelValue) && !props.modelValue.length) && ui.value.placeholder, props.selectClass);
|
|
2364
|
+
});
|
|
2365
|
+
const isLeading = computed(() => {
|
|
2366
|
+
return props.icon && props.leading || props.icon && !props.trailing || props.loading && !props.trailing || props.leadingIcon;
|
|
2367
|
+
});
|
|
2368
|
+
const isTrailing = computed(() => {
|
|
2369
|
+
return props.icon && props.trailing || props.loading && props.trailing || props.trailingIcon;
|
|
2370
|
+
});
|
|
2371
|
+
const leadingIconName = computed(() => {
|
|
2372
|
+
if (props.loading) {
|
|
2373
|
+
return props.loadingIcon;
|
|
2374
|
+
}
|
|
2375
|
+
return props.leadingIcon || props.icon;
|
|
2376
|
+
});
|
|
2377
|
+
const trailingIconName = computed(() => {
|
|
2378
|
+
if (props.loading && !isLeading.value) {
|
|
2379
|
+
return props.loadingIcon;
|
|
2380
|
+
}
|
|
2381
|
+
return props.trailingIcon || props.icon;
|
|
2382
|
+
});
|
|
2383
|
+
const leadingWrapperIconClass = computed(() => {
|
|
2384
|
+
return twJoin(
|
|
2385
|
+
ui.value.icon.leading.wrapper,
|
|
2386
|
+
ui.value.icon.leading.pointer,
|
|
2387
|
+
ui.value.icon.leading.padding[size.value]
|
|
2388
|
+
);
|
|
2389
|
+
});
|
|
2390
|
+
const leadingIconClass = computed(() => {
|
|
2391
|
+
return twJoin(
|
|
2392
|
+
ui.value.icon.base,
|
|
2393
|
+
color.value && appConfig.ui.colors.includes(color.value) && ui.value.icon.color.replaceAll("{color}", color.value),
|
|
2394
|
+
ui.value.icon.size[size.value],
|
|
2395
|
+
props.loading && ui.value.icon.loading
|
|
2396
|
+
);
|
|
2397
|
+
});
|
|
2398
|
+
const trailingWrapperIconClass = computed(() => {
|
|
2399
|
+
return twJoin(
|
|
2400
|
+
ui.value.icon.trailing.wrapper,
|
|
2401
|
+
ui.value.icon.trailing.pointer,
|
|
2402
|
+
ui.value.icon.trailing.padding[size.value]
|
|
2403
|
+
);
|
|
2404
|
+
});
|
|
2405
|
+
const trailingIconClass = computed(() => {
|
|
2406
|
+
return twJoin(
|
|
2407
|
+
ui.value.icon.base,
|
|
2408
|
+
color.value && appConfig.ui.colors.includes(color.value) && ui.value.icon.color.replaceAll("{color}", color.value),
|
|
2409
|
+
ui.value.icon.size[size.value],
|
|
2410
|
+
props.loading && !isLeading.value && ui.value.icon.loading
|
|
2411
|
+
);
|
|
2412
|
+
});
|
|
2413
|
+
const debouncedSearch = props.searchable && typeof props.searchable === "function" ? useDebounceFn(props.searchable, props.debounce) : void 0;
|
|
2414
|
+
const options = computedAsync(async () => {
|
|
2415
|
+
if (debouncedSearch) {
|
|
2416
|
+
return await debouncedSearch(query.value);
|
|
2417
|
+
}
|
|
2418
|
+
return props.options || [];
|
|
2419
|
+
}, [], {
|
|
2420
|
+
lazy: props.searchableLazy
|
|
2421
|
+
});
|
|
2422
|
+
function escapeRegExp(string) {
|
|
2423
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, (match) => `\\${match}`);
|
|
2424
|
+
}
|
|
2425
|
+
function accessor(obj, key) {
|
|
2426
|
+
return get(obj, key);
|
|
2427
|
+
}
|
|
2428
|
+
function isObject(object) {
|
|
2429
|
+
return !Array.isArray(object) && object !== null && typeof object === "object";
|
|
2430
|
+
}
|
|
2431
|
+
const filteredOptions = computed(() => {
|
|
2432
|
+
if (!query.value || debouncedSearch) {
|
|
2433
|
+
return options.value;
|
|
2434
|
+
}
|
|
2435
|
+
const escapedQuery = escapeRegExp(query.value);
|
|
2436
|
+
return options.value.filter((option) => {
|
|
2437
|
+
var _a;
|
|
2438
|
+
return (((_a = props.searchAttributes) == null ? void 0 : _a.length) ? props.searchAttributes : [props.optionAttribute]).some((searchAttribute) => {
|
|
2439
|
+
if (["string", "number"].includes(typeof option)) {
|
|
2440
|
+
return String(option).search(new RegExp(escapedQuery, "i")) !== -1;
|
|
2441
|
+
}
|
|
2442
|
+
const child = get(option, searchAttribute);
|
|
2443
|
+
return child !== null && child !== void 0 && String(child).search(new RegExp(escapedQuery, "i")) !== -1;
|
|
2444
|
+
});
|
|
2445
|
+
});
|
|
2446
|
+
});
|
|
2447
|
+
const createOption = computed(() => {
|
|
2448
|
+
if (query.value === "") {
|
|
2449
|
+
return null;
|
|
2450
|
+
}
|
|
2451
|
+
if (props.showCreateOptionWhen === "empty" && filteredOptions.value.length) {
|
|
2452
|
+
return null;
|
|
2453
|
+
}
|
|
2454
|
+
if (props.showCreateOptionWhen === "always") {
|
|
2455
|
+
const existingOption = filteredOptions.value.find((option) => ["string", "number"].includes(typeof option) ? option === query.value : accessor(option, props.optionAttribute) === query.value);
|
|
2456
|
+
if (existingOption) {
|
|
2457
|
+
return null;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
if (typeof props.showCreateOptionWhen === "function") {
|
|
2461
|
+
if (!props.showCreateOptionWhen(query.value, filteredOptions.value)) {
|
|
2462
|
+
return null;
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
return ["string", "number"].includes(typeof props.modelValue) ? query.value : { [props.optionAttribute]: query.value };
|
|
2466
|
+
});
|
|
2467
|
+
function clearOnClose() {
|
|
2468
|
+
if (props.clearSearchOnClose) {
|
|
2469
|
+
query.value = "";
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
watch(container, (value) => {
|
|
2473
|
+
if (value) {
|
|
2474
|
+
emit("open");
|
|
2475
|
+
} else {
|
|
2476
|
+
clearOnClose();
|
|
2477
|
+
emit("close");
|
|
2478
|
+
emitFormBlur();
|
|
2479
|
+
}
|
|
2480
|
+
});
|
|
2481
|
+
function onUpdate(value) {
|
|
2482
|
+
if (toRaw(props.modelValue) === value) {
|
|
2483
|
+
return;
|
|
2484
|
+
}
|
|
2485
|
+
emit("update:modelValue", value);
|
|
2486
|
+
emit("change", value);
|
|
2487
|
+
emitFormChange();
|
|
2488
|
+
}
|
|
2489
|
+
function onQueryChange(event) {
|
|
2490
|
+
query.value = event.target.value;
|
|
2491
|
+
}
|
|
2492
|
+
s$4(() => useId());
|
|
2493
|
+
return {
|
|
2494
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2495
|
+
ui,
|
|
2496
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2497
|
+
uiMenu,
|
|
2498
|
+
attrs,
|
|
2499
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2500
|
+
name,
|
|
2501
|
+
inputId,
|
|
2502
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2503
|
+
popper: popper2,
|
|
2504
|
+
trigger,
|
|
2505
|
+
container,
|
|
2506
|
+
selected,
|
|
2507
|
+
label,
|
|
2508
|
+
accessor,
|
|
2509
|
+
isLeading,
|
|
2510
|
+
isTrailing,
|
|
2511
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2512
|
+
selectClass,
|
|
2513
|
+
leadingIconName,
|
|
2514
|
+
leadingIconClass,
|
|
2515
|
+
leadingWrapperIconClass,
|
|
2516
|
+
trailingIconName,
|
|
2517
|
+
trailingIconClass,
|
|
2518
|
+
trailingWrapperIconClass,
|
|
2519
|
+
filteredOptions,
|
|
2520
|
+
createOption,
|
|
2521
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2522
|
+
query,
|
|
2523
|
+
onUpdate,
|
|
2524
|
+
onQueryChange,
|
|
2525
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
2526
|
+
by
|
|
2527
|
+
};
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2531
|
+
const _component_UIcon = __nuxt_component_0$1;
|
|
2532
|
+
const _component_HComboboxInput = resolveComponent("HComboboxInput");
|
|
2533
|
+
const _component_UAvatar = __nuxt_component_1$2;
|
|
2534
|
+
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(_ctx.searchable ? "HCombobox" : "HListbox"), mergeProps({
|
|
2535
|
+
by: _ctx.by,
|
|
2536
|
+
name: _ctx.name,
|
|
2537
|
+
"model-value": _ctx.multiple ? Array.isArray(_ctx.modelValue) ? _ctx.modelValue : [] : _ctx.modelValue,
|
|
2538
|
+
multiple: _ctx.multiple,
|
|
2539
|
+
disabled: _ctx.disabled,
|
|
2540
|
+
as: "div",
|
|
2541
|
+
class: _ctx.ui.wrapper,
|
|
2542
|
+
"onUpdate:modelValue": _ctx.onUpdate
|
|
2543
|
+
}, _attrs), {
|
|
2544
|
+
default: withCtx(({ open }, _push2, _parent2, _scopeId) => {
|
|
2545
|
+
if (_push2) {
|
|
2546
|
+
if (_ctx.required) {
|
|
2547
|
+
_push2(`<input${ssrRenderAttr("value", _ctx.modelValue)}${ssrIncludeBooleanAttr(_ctx.required) ? " required" : ""} class="${ssrRenderClass(_ctx.uiMenu.required)}"${ssrRenderAttr("form", _ctx.inputTargetForm)} tabindex="-1" aria-hidden="true"${_scopeId}>`);
|
|
2548
|
+
} else {
|
|
2549
|
+
_push2(`<!---->`);
|
|
2550
|
+
}
|
|
2551
|
+
ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(_ctx.searchable ? "HComboboxButton" : "HListboxButton"), {
|
|
2552
|
+
ref: "trigger",
|
|
2553
|
+
as: "div",
|
|
2554
|
+
role: "button",
|
|
2555
|
+
class: _ctx.uiMenu.trigger
|
|
2556
|
+
}, {
|
|
2557
|
+
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2558
|
+
if (_push3) {
|
|
2559
|
+
ssrRenderSlot(_ctx.$slots, "default", {
|
|
2560
|
+
open,
|
|
2561
|
+
disabled: _ctx.disabled,
|
|
2562
|
+
loading: _ctx.loading
|
|
2563
|
+
}, () => {
|
|
2564
|
+
_push3(`<button${ssrRenderAttrs(mergeProps({
|
|
2565
|
+
id: _ctx.inputId,
|
|
2566
|
+
class: _ctx.selectClass,
|
|
2567
|
+
disabled: _ctx.disabled,
|
|
2568
|
+
type: "button"
|
|
2569
|
+
}, _ctx.attrs))}${_scopeId2}>`);
|
|
2570
|
+
if (_ctx.isLeading && _ctx.leadingIconName || _ctx.$slots.leading) {
|
|
2571
|
+
_push3(`<span class="${ssrRenderClass(_ctx.leadingWrapperIconClass)}"${_scopeId2}>`);
|
|
2572
|
+
ssrRenderSlot(_ctx.$slots, "leading", {
|
|
2573
|
+
selected: _ctx.selected,
|
|
2574
|
+
disabled: _ctx.disabled,
|
|
2575
|
+
loading: _ctx.loading
|
|
2576
|
+
}, () => {
|
|
2577
|
+
_push3(ssrRenderComponent(_component_UIcon, {
|
|
2578
|
+
name: _ctx.leadingIconName,
|
|
2579
|
+
class: _ctx.leadingIconClass
|
|
2580
|
+
}, null, _parent3, _scopeId2));
|
|
2581
|
+
}, _push3, _parent3, _scopeId2);
|
|
2582
|
+
_push3(`</span>`);
|
|
2583
|
+
} else {
|
|
2584
|
+
_push3(`<!---->`);
|
|
2585
|
+
}
|
|
2586
|
+
ssrRenderSlot(_ctx.$slots, "label", { selected: _ctx.selected }, () => {
|
|
2587
|
+
if (_ctx.label) {
|
|
2588
|
+
_push3(`<span class="${ssrRenderClass(_ctx.uiMenu.label)}"${_scopeId2}>${ssrInterpolate(_ctx.label)}</span>`);
|
|
2589
|
+
} else {
|
|
2590
|
+
_push3(`<span class="${ssrRenderClass(_ctx.uiMenu.label)}"${_scopeId2}>${ssrInterpolate(_ctx.placeholder || "\xA0")}</span>`);
|
|
2591
|
+
}
|
|
2592
|
+
}, _push3, _parent3, _scopeId2);
|
|
2593
|
+
if (_ctx.isTrailing && _ctx.trailingIconName || _ctx.$slots.trailing) {
|
|
2594
|
+
_push3(`<span class="${ssrRenderClass(_ctx.trailingWrapperIconClass)}"${_scopeId2}>`);
|
|
2595
|
+
ssrRenderSlot(_ctx.$slots, "trailing", {
|
|
2596
|
+
selected: _ctx.selected,
|
|
2597
|
+
disabled: _ctx.disabled,
|
|
2598
|
+
loading: _ctx.loading
|
|
2599
|
+
}, () => {
|
|
2600
|
+
_push3(ssrRenderComponent(_component_UIcon, {
|
|
2601
|
+
name: _ctx.trailingIconName,
|
|
2602
|
+
class: _ctx.trailingIconClass,
|
|
2603
|
+
"aria-hidden": "true"
|
|
2604
|
+
}, null, _parent3, _scopeId2));
|
|
2605
|
+
}, _push3, _parent3, _scopeId2);
|
|
2606
|
+
_push3(`</span>`);
|
|
2607
|
+
} else {
|
|
2608
|
+
_push3(`<!---->`);
|
|
2609
|
+
}
|
|
2610
|
+
_push3(`</button>`);
|
|
2611
|
+
}, _push3, _parent3, _scopeId2);
|
|
2612
|
+
} else {
|
|
2613
|
+
return [
|
|
2614
|
+
renderSlot(_ctx.$slots, "default", {
|
|
2615
|
+
open,
|
|
2616
|
+
disabled: _ctx.disabled,
|
|
2617
|
+
loading: _ctx.loading
|
|
2618
|
+
}, () => [
|
|
2619
|
+
createVNode("button", mergeProps({
|
|
2620
|
+
id: _ctx.inputId,
|
|
2621
|
+
class: _ctx.selectClass,
|
|
2622
|
+
disabled: _ctx.disabled,
|
|
2623
|
+
type: "button"
|
|
2624
|
+
}, _ctx.attrs), [
|
|
2625
|
+
_ctx.isLeading && _ctx.leadingIconName || _ctx.$slots.leading ? (openBlock(), createBlock("span", {
|
|
2626
|
+
key: 0,
|
|
2627
|
+
class: _ctx.leadingWrapperIconClass
|
|
2628
|
+
}, [
|
|
2629
|
+
renderSlot(_ctx.$slots, "leading", {
|
|
2630
|
+
selected: _ctx.selected,
|
|
2631
|
+
disabled: _ctx.disabled,
|
|
2632
|
+
loading: _ctx.loading
|
|
2633
|
+
}, () => [
|
|
2634
|
+
createVNode(_component_UIcon, {
|
|
2635
|
+
name: _ctx.leadingIconName,
|
|
2636
|
+
class: _ctx.leadingIconClass
|
|
2637
|
+
}, null, 8, ["name", "class"])
|
|
2638
|
+
])
|
|
2639
|
+
], 2)) : createCommentVNode("", true),
|
|
2640
|
+
renderSlot(_ctx.$slots, "label", { selected: _ctx.selected }, () => [
|
|
2641
|
+
_ctx.label ? (openBlock(), createBlock("span", {
|
|
2642
|
+
key: 0,
|
|
2643
|
+
class: _ctx.uiMenu.label
|
|
2644
|
+
}, toDisplayString(_ctx.label), 3)) : (openBlock(), createBlock("span", {
|
|
2645
|
+
key: 1,
|
|
2646
|
+
class: _ctx.uiMenu.label
|
|
2647
|
+
}, toDisplayString(_ctx.placeholder || "\xA0"), 3))
|
|
2648
|
+
]),
|
|
2649
|
+
_ctx.isTrailing && _ctx.trailingIconName || _ctx.$slots.trailing ? (openBlock(), createBlock("span", {
|
|
2650
|
+
key: 1,
|
|
2651
|
+
class: _ctx.trailingWrapperIconClass
|
|
2652
|
+
}, [
|
|
2653
|
+
renderSlot(_ctx.$slots, "trailing", {
|
|
2654
|
+
selected: _ctx.selected,
|
|
2655
|
+
disabled: _ctx.disabled,
|
|
2656
|
+
loading: _ctx.loading
|
|
2657
|
+
}, () => [
|
|
2658
|
+
createVNode(_component_UIcon, {
|
|
2659
|
+
name: _ctx.trailingIconName,
|
|
2660
|
+
class: _ctx.trailingIconClass,
|
|
2661
|
+
"aria-hidden": "true"
|
|
2662
|
+
}, null, 8, ["name", "class"])
|
|
2663
|
+
])
|
|
2664
|
+
], 2)) : createCommentVNode("", true)
|
|
2665
|
+
], 16, ["id", "disabled"])
|
|
2666
|
+
])
|
|
2667
|
+
];
|
|
2668
|
+
}
|
|
2669
|
+
}),
|
|
2670
|
+
_: 2
|
|
2671
|
+
}), _parent2, _scopeId);
|
|
2672
|
+
if (open) {
|
|
2673
|
+
_push2(`<div class="${ssrRenderClass([_ctx.uiMenu.container, _ctx.uiMenu.width])}"${_scopeId}><template><div${_scopeId}>`);
|
|
2674
|
+
if (_ctx.popper.arrow) {
|
|
2675
|
+
_push2(`<div data-popper-arrow class="${ssrRenderClass(Object.values(_ctx.uiMenu.arrow))}"${_scopeId}></div>`);
|
|
2676
|
+
} else {
|
|
2677
|
+
_push2(`<!---->`);
|
|
2678
|
+
}
|
|
2679
|
+
ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(_ctx.searchable ? "HComboboxOptions" : "HListboxOptions"), {
|
|
2680
|
+
static: "",
|
|
2681
|
+
class: [_ctx.uiMenu.base, _ctx.uiMenu.ring, _ctx.uiMenu.rounded, _ctx.uiMenu.shadow, _ctx.uiMenu.background, _ctx.uiMenu.padding, _ctx.uiMenu.height]
|
|
2682
|
+
}, {
|
|
2683
|
+
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2684
|
+
var _a, _b, _c, _d;
|
|
2685
|
+
if (_push3) {
|
|
2686
|
+
if (_ctx.searchable) {
|
|
2687
|
+
_push3(ssrRenderComponent(_component_HComboboxInput, {
|
|
2688
|
+
"display-value": () => _ctx.query,
|
|
2689
|
+
name: "q",
|
|
2690
|
+
placeholder: _ctx.searchablePlaceholder,
|
|
2691
|
+
autofocus: "",
|
|
2692
|
+
autocomplete: "off",
|
|
2693
|
+
class: _ctx.uiMenu.input,
|
|
2694
|
+
onChange: _ctx.onQueryChange
|
|
2695
|
+
}, null, _parent3, _scopeId2));
|
|
2696
|
+
} else {
|
|
2697
|
+
_push3(`<!---->`);
|
|
2698
|
+
}
|
|
2699
|
+
_push3(`<!--[-->`);
|
|
2700
|
+
ssrRenderList(_ctx.filteredOptions, (option, index) => {
|
|
2701
|
+
ssrRenderVNode(_push3, createVNode(resolveDynamicComponent(_ctx.searchable ? "HComboboxOption" : "HListboxOption"), {
|
|
2702
|
+
key: index,
|
|
2703
|
+
as: "template",
|
|
2704
|
+
value: _ctx.valueAttribute ? _ctx.accessor(option, _ctx.valueAttribute) : option,
|
|
2705
|
+
disabled: option.disabled
|
|
2706
|
+
}, {
|
|
2707
|
+
default: withCtx(({ active, selected: optionSelected, disabled: optionDisabled }, _push4, _parent4, _scopeId3) => {
|
|
2708
|
+
if (_push4) {
|
|
2709
|
+
_push4(`<li class="${ssrRenderClass([_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive, optionSelected && _ctx.uiMenu.option.selected, optionDisabled && _ctx.uiMenu.option.disabled])}"${_scopeId3}><div class="${ssrRenderClass(_ctx.uiMenu.option.container)}"${_scopeId3}>`);
|
|
2710
|
+
ssrRenderSlot(_ctx.$slots, "option", {
|
|
2711
|
+
option,
|
|
2712
|
+
active,
|
|
2713
|
+
selected: optionSelected
|
|
2714
|
+
}, () => {
|
|
2715
|
+
if (option.icon) {
|
|
2716
|
+
_push4(ssrRenderComponent(_component_UIcon, {
|
|
2717
|
+
name: option.icon,
|
|
2718
|
+
class: [_ctx.uiMenu.option.icon.base, active ? _ctx.uiMenu.option.icon.active : _ctx.uiMenu.option.icon.inactive, option.iconClass],
|
|
2719
|
+
"aria-hidden": "true"
|
|
2720
|
+
}, null, _parent4, _scopeId3));
|
|
2721
|
+
} else if (option.avatar) {
|
|
2722
|
+
_push4(ssrRenderComponent(_component_UAvatar, mergeProps({ ref_for: true }, { size: _ctx.uiMenu.option.avatar.size, ...option.avatar }, {
|
|
2723
|
+
class: _ctx.uiMenu.option.avatar.base,
|
|
2724
|
+
"aria-hidden": "true"
|
|
2725
|
+
}), null, _parent4, _scopeId3));
|
|
2726
|
+
} else if (option.chip) {
|
|
2727
|
+
_push4(`<span class="${ssrRenderClass(_ctx.uiMenu.option.chip.base)}" style="${ssrRenderStyle({ background: `#${option.chip}` })}"${_scopeId3}></span>`);
|
|
2728
|
+
} else {
|
|
2729
|
+
_push4(`<!---->`);
|
|
2730
|
+
}
|
|
2731
|
+
_push4(`<span class="truncate"${_scopeId3}>${ssrInterpolate(["string", "number"].includes(typeof option) ? option : _ctx.accessor(option, _ctx.optionAttribute))}</span>`);
|
|
2732
|
+
}, _push4, _parent4, _scopeId3);
|
|
2733
|
+
_push4(`</div>`);
|
|
2734
|
+
if (optionSelected) {
|
|
2735
|
+
_push4(`<span class="${ssrRenderClass([_ctx.uiMenu.option.selectedIcon.wrapper, _ctx.uiMenu.option.selectedIcon.padding])}"${_scopeId3}>`);
|
|
2736
|
+
_push4(ssrRenderComponent(_component_UIcon, {
|
|
2737
|
+
name: _ctx.selectedIcon,
|
|
2738
|
+
class: _ctx.uiMenu.option.selectedIcon.base,
|
|
2739
|
+
"aria-hidden": "true"
|
|
2740
|
+
}, null, _parent4, _scopeId3));
|
|
2741
|
+
_push4(`</span>`);
|
|
2742
|
+
} else {
|
|
2743
|
+
_push4(`<!---->`);
|
|
2744
|
+
}
|
|
2745
|
+
_push4(`</li>`);
|
|
2746
|
+
} else {
|
|
2747
|
+
return [
|
|
2748
|
+
createVNode("li", {
|
|
2749
|
+
class: [_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive, optionSelected && _ctx.uiMenu.option.selected, optionDisabled && _ctx.uiMenu.option.disabled]
|
|
2750
|
+
}, [
|
|
2751
|
+
createVNode("div", {
|
|
2752
|
+
class: _ctx.uiMenu.option.container
|
|
2753
|
+
}, [
|
|
2754
|
+
renderSlot(_ctx.$slots, "option", {
|
|
2755
|
+
option,
|
|
2756
|
+
active,
|
|
2757
|
+
selected: optionSelected
|
|
2758
|
+
}, () => [
|
|
2759
|
+
option.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
2760
|
+
key: 0,
|
|
2761
|
+
name: option.icon,
|
|
2762
|
+
class: [_ctx.uiMenu.option.icon.base, active ? _ctx.uiMenu.option.icon.active : _ctx.uiMenu.option.icon.inactive, option.iconClass],
|
|
2763
|
+
"aria-hidden": "true"
|
|
2764
|
+
}, null, 8, ["name", "class"])) : option.avatar ? (openBlock(), createBlock(_component_UAvatar, mergeProps({
|
|
2765
|
+
key: 1,
|
|
2766
|
+
ref_for: true
|
|
2767
|
+
}, { size: _ctx.uiMenu.option.avatar.size, ...option.avatar }, {
|
|
2768
|
+
class: _ctx.uiMenu.option.avatar.base,
|
|
2769
|
+
"aria-hidden": "true"
|
|
2770
|
+
}), null, 16, ["class"])) : option.chip ? (openBlock(), createBlock("span", {
|
|
2771
|
+
key: 2,
|
|
2772
|
+
class: _ctx.uiMenu.option.chip.base,
|
|
2773
|
+
style: { background: `#${option.chip}` }
|
|
2774
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
2775
|
+
createVNode("span", { class: "truncate" }, toDisplayString(["string", "number"].includes(typeof option) ? option : _ctx.accessor(option, _ctx.optionAttribute)), 1)
|
|
2776
|
+
])
|
|
2777
|
+
], 2),
|
|
2778
|
+
optionSelected ? (openBlock(), createBlock("span", {
|
|
2779
|
+
key: 0,
|
|
2780
|
+
class: [_ctx.uiMenu.option.selectedIcon.wrapper, _ctx.uiMenu.option.selectedIcon.padding]
|
|
2781
|
+
}, [
|
|
2782
|
+
createVNode(_component_UIcon, {
|
|
2783
|
+
name: _ctx.selectedIcon,
|
|
2784
|
+
class: _ctx.uiMenu.option.selectedIcon.base,
|
|
2785
|
+
"aria-hidden": "true"
|
|
2786
|
+
}, null, 8, ["name", "class"])
|
|
2787
|
+
], 2)) : createCommentVNode("", true)
|
|
2788
|
+
], 2)
|
|
2789
|
+
];
|
|
2790
|
+
}
|
|
2791
|
+
}),
|
|
2792
|
+
_: 2
|
|
2793
|
+
}), _parent3, _scopeId2);
|
|
2794
|
+
});
|
|
2795
|
+
_push3(`<!--]-->`);
|
|
2796
|
+
if (_ctx.creatable && _ctx.createOption) {
|
|
2797
|
+
ssrRenderVNode(_push3, createVNode(resolveDynamicComponent(_ctx.searchable ? "HComboboxOption" : "HListboxOption"), {
|
|
2798
|
+
value: _ctx.createOption,
|
|
2799
|
+
as: "template"
|
|
2800
|
+
}, {
|
|
2801
|
+
default: withCtx(({ active, selected: optionSelected }, _push4, _parent4, _scopeId3) => {
|
|
2802
|
+
if (_push4) {
|
|
2803
|
+
_push4(`<li class="${ssrRenderClass([_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive])}"${_scopeId3}><div class="${ssrRenderClass(_ctx.uiMenu.option.container)}"${_scopeId3}>`);
|
|
2804
|
+
ssrRenderSlot(_ctx.$slots, "option-create", {
|
|
2805
|
+
option: _ctx.createOption,
|
|
2806
|
+
active,
|
|
2807
|
+
selected: optionSelected
|
|
2808
|
+
}, () => {
|
|
2809
|
+
_push4(`<span class="${ssrRenderClass(_ctx.uiMenu.option.create)}"${_scopeId3}>Create "${ssrInterpolate(typeof _ctx.createOption === "string" ? _ctx.createOption : _ctx.accessor(_ctx.createOption, _ctx.optionAttribute))}"</span>`);
|
|
2810
|
+
}, _push4, _parent4, _scopeId3);
|
|
2811
|
+
_push4(`</div></li>`);
|
|
2812
|
+
} else {
|
|
2813
|
+
return [
|
|
2814
|
+
createVNode("li", {
|
|
2815
|
+
class: [_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive]
|
|
2816
|
+
}, [
|
|
2817
|
+
createVNode("div", {
|
|
2818
|
+
class: _ctx.uiMenu.option.container
|
|
2819
|
+
}, [
|
|
2820
|
+
renderSlot(_ctx.$slots, "option-create", {
|
|
2821
|
+
option: _ctx.createOption,
|
|
2822
|
+
active,
|
|
2823
|
+
selected: optionSelected
|
|
2824
|
+
}, () => [
|
|
2825
|
+
createVNode("span", {
|
|
2826
|
+
class: _ctx.uiMenu.option.create
|
|
2827
|
+
}, 'Create "' + toDisplayString(typeof _ctx.createOption === "string" ? _ctx.createOption : _ctx.accessor(_ctx.createOption, _ctx.optionAttribute)) + '"', 3)
|
|
2828
|
+
])
|
|
2829
|
+
], 2)
|
|
2830
|
+
], 2)
|
|
2831
|
+
];
|
|
2832
|
+
}
|
|
2833
|
+
}),
|
|
2834
|
+
_: 2
|
|
2835
|
+
}), _parent3, _scopeId2);
|
|
2836
|
+
} else if (_ctx.searchable && _ctx.query && !((_a = _ctx.filteredOptions) == null ? void 0 : _a.length)) {
|
|
2837
|
+
_push3(`<p class="${ssrRenderClass(_ctx.uiMenu.option.empty)}"${_scopeId2}>`);
|
|
2838
|
+
ssrRenderSlot(_ctx.$slots, "option-empty", { query: _ctx.query }, () => {
|
|
2839
|
+
_push3(`${ssrInterpolate(_ctx.uiMenu.default.optionEmpty.label.replace("{query}", _ctx.query))}`);
|
|
2840
|
+
}, _push3, _parent3, _scopeId2);
|
|
2841
|
+
_push3(`</p>`);
|
|
2842
|
+
} else if (!((_b = _ctx.filteredOptions) == null ? void 0 : _b.length)) {
|
|
2843
|
+
_push3(`<p class="${ssrRenderClass(_ctx.uiMenu.empty)}"${_scopeId2}>`);
|
|
2844
|
+
ssrRenderSlot(_ctx.$slots, "empty", { query: _ctx.query }, () => {
|
|
2845
|
+
_push3(`${ssrInterpolate(_ctx.uiMenu.default.empty.label)}`);
|
|
2846
|
+
}, _push3, _parent3, _scopeId2);
|
|
2847
|
+
_push3(`</p>`);
|
|
2848
|
+
} else {
|
|
2849
|
+
_push3(`<!---->`);
|
|
2850
|
+
}
|
|
2851
|
+
} else {
|
|
2852
|
+
return [
|
|
2853
|
+
_ctx.searchable ? (openBlock(), createBlock(_component_HComboboxInput, {
|
|
2854
|
+
key: 0,
|
|
2855
|
+
"display-value": () => _ctx.query,
|
|
2856
|
+
name: "q",
|
|
2857
|
+
placeholder: _ctx.searchablePlaceholder,
|
|
2858
|
+
autofocus: "",
|
|
2859
|
+
autocomplete: "off",
|
|
2860
|
+
class: _ctx.uiMenu.input,
|
|
2861
|
+
onChange: _ctx.onQueryChange
|
|
2862
|
+
}, null, 8, ["display-value", "placeholder", "class", "onChange"])) : createCommentVNode("", true),
|
|
2863
|
+
(openBlock(true), createBlock(Fragment, null, renderList(_ctx.filteredOptions, (option, index) => {
|
|
2864
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.searchable ? "HComboboxOption" : "HListboxOption"), {
|
|
2865
|
+
key: index,
|
|
2866
|
+
as: "template",
|
|
2867
|
+
value: _ctx.valueAttribute ? _ctx.accessor(option, _ctx.valueAttribute) : option,
|
|
2868
|
+
disabled: option.disabled
|
|
2869
|
+
}, {
|
|
2870
|
+
default: withCtx(({ active, selected: optionSelected, disabled: optionDisabled }) => [
|
|
2871
|
+
createVNode("li", {
|
|
2872
|
+
class: [_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive, optionSelected && _ctx.uiMenu.option.selected, optionDisabled && _ctx.uiMenu.option.disabled]
|
|
2873
|
+
}, [
|
|
2874
|
+
createVNode("div", {
|
|
2875
|
+
class: _ctx.uiMenu.option.container
|
|
2876
|
+
}, [
|
|
2877
|
+
renderSlot(_ctx.$slots, "option", {
|
|
2878
|
+
option,
|
|
2879
|
+
active,
|
|
2880
|
+
selected: optionSelected
|
|
2881
|
+
}, () => [
|
|
2882
|
+
option.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
2883
|
+
key: 0,
|
|
2884
|
+
name: option.icon,
|
|
2885
|
+
class: [_ctx.uiMenu.option.icon.base, active ? _ctx.uiMenu.option.icon.active : _ctx.uiMenu.option.icon.inactive, option.iconClass],
|
|
2886
|
+
"aria-hidden": "true"
|
|
2887
|
+
}, null, 8, ["name", "class"])) : option.avatar ? (openBlock(), createBlock(_component_UAvatar, mergeProps({
|
|
2888
|
+
key: 1,
|
|
2889
|
+
ref_for: true
|
|
2890
|
+
}, { size: _ctx.uiMenu.option.avatar.size, ...option.avatar }, {
|
|
2891
|
+
class: _ctx.uiMenu.option.avatar.base,
|
|
2892
|
+
"aria-hidden": "true"
|
|
2893
|
+
}), null, 16, ["class"])) : option.chip ? (openBlock(), createBlock("span", {
|
|
2894
|
+
key: 2,
|
|
2895
|
+
class: _ctx.uiMenu.option.chip.base,
|
|
2896
|
+
style: { background: `#${option.chip}` }
|
|
2897
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
2898
|
+
createVNode("span", { class: "truncate" }, toDisplayString(["string", "number"].includes(typeof option) ? option : _ctx.accessor(option, _ctx.optionAttribute)), 1)
|
|
2899
|
+
])
|
|
2900
|
+
], 2),
|
|
2901
|
+
optionSelected ? (openBlock(), createBlock("span", {
|
|
2902
|
+
key: 0,
|
|
2903
|
+
class: [_ctx.uiMenu.option.selectedIcon.wrapper, _ctx.uiMenu.option.selectedIcon.padding]
|
|
2904
|
+
}, [
|
|
2905
|
+
createVNode(_component_UIcon, {
|
|
2906
|
+
name: _ctx.selectedIcon,
|
|
2907
|
+
class: _ctx.uiMenu.option.selectedIcon.base,
|
|
2908
|
+
"aria-hidden": "true"
|
|
2909
|
+
}, null, 8, ["name", "class"])
|
|
2910
|
+
], 2)) : createCommentVNode("", true)
|
|
2911
|
+
], 2)
|
|
2912
|
+
]),
|
|
2913
|
+
_: 2
|
|
2914
|
+
}, 1032, ["value", "disabled"]);
|
|
2915
|
+
}), 128)),
|
|
2916
|
+
_ctx.creatable && _ctx.createOption ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.searchable ? "HComboboxOption" : "HListboxOption"), {
|
|
2917
|
+
key: 1,
|
|
2918
|
+
value: _ctx.createOption,
|
|
2919
|
+
as: "template"
|
|
2920
|
+
}, {
|
|
2921
|
+
default: withCtx(({ active, selected: optionSelected }) => [
|
|
2922
|
+
createVNode("li", {
|
|
2923
|
+
class: [_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive]
|
|
2924
|
+
}, [
|
|
2925
|
+
createVNode("div", {
|
|
2926
|
+
class: _ctx.uiMenu.option.container
|
|
2927
|
+
}, [
|
|
2928
|
+
renderSlot(_ctx.$slots, "option-create", {
|
|
2929
|
+
option: _ctx.createOption,
|
|
2930
|
+
active,
|
|
2931
|
+
selected: optionSelected
|
|
2932
|
+
}, () => [
|
|
2933
|
+
createVNode("span", {
|
|
2934
|
+
class: _ctx.uiMenu.option.create
|
|
2935
|
+
}, 'Create "' + toDisplayString(typeof _ctx.createOption === "string" ? _ctx.createOption : _ctx.accessor(_ctx.createOption, _ctx.optionAttribute)) + '"', 3)
|
|
2936
|
+
])
|
|
2937
|
+
], 2)
|
|
2938
|
+
], 2)
|
|
2939
|
+
]),
|
|
2940
|
+
_: 3
|
|
2941
|
+
}, 8, ["value"])) : _ctx.searchable && _ctx.query && !((_c = _ctx.filteredOptions) == null ? void 0 : _c.length) ? (openBlock(), createBlock("p", {
|
|
2942
|
+
key: 2,
|
|
2943
|
+
class: _ctx.uiMenu.option.empty
|
|
2944
|
+
}, [
|
|
2945
|
+
renderSlot(_ctx.$slots, "option-empty", { query: _ctx.query }, () => [
|
|
2946
|
+
createTextVNode(toDisplayString(_ctx.uiMenu.default.optionEmpty.label.replace("{query}", _ctx.query)), 1)
|
|
2947
|
+
])
|
|
2948
|
+
], 2)) : !((_d = _ctx.filteredOptions) == null ? void 0 : _d.length) ? (openBlock(), createBlock("p", {
|
|
2949
|
+
key: 3,
|
|
2950
|
+
class: _ctx.uiMenu.empty
|
|
2951
|
+
}, [
|
|
2952
|
+
renderSlot(_ctx.$slots, "empty", { query: _ctx.query }, () => [
|
|
2953
|
+
createTextVNode(toDisplayString(_ctx.uiMenu.default.empty.label), 1)
|
|
2954
|
+
])
|
|
2955
|
+
], 2)) : createCommentVNode("", true)
|
|
2956
|
+
];
|
|
2957
|
+
}
|
|
2958
|
+
}),
|
|
2959
|
+
_: 2
|
|
2960
|
+
}), _parent2, _scopeId);
|
|
2961
|
+
_push2(`</div></template></div>`);
|
|
2962
|
+
} else {
|
|
2963
|
+
_push2(`<!---->`);
|
|
2964
|
+
}
|
|
2965
|
+
} else {
|
|
2966
|
+
return [
|
|
2967
|
+
_ctx.required ? (openBlock(), createBlock("input", {
|
|
2968
|
+
key: 0,
|
|
2969
|
+
value: _ctx.modelValue,
|
|
2970
|
+
required: _ctx.required,
|
|
2971
|
+
class: _ctx.uiMenu.required,
|
|
2972
|
+
form: _ctx.inputTargetForm,
|
|
2973
|
+
tabindex: "-1",
|
|
2974
|
+
"aria-hidden": "true"
|
|
2975
|
+
}, null, 10, ["value", "required", "form"])) : createCommentVNode("", true),
|
|
2976
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.searchable ? "HComboboxButton" : "HListboxButton"), {
|
|
2977
|
+
ref: "trigger",
|
|
2978
|
+
as: "div",
|
|
2979
|
+
role: "button",
|
|
2980
|
+
class: _ctx.uiMenu.trigger
|
|
2981
|
+
}, {
|
|
2982
|
+
default: withCtx(() => [
|
|
2983
|
+
renderSlot(_ctx.$slots, "default", {
|
|
2984
|
+
open,
|
|
2985
|
+
disabled: _ctx.disabled,
|
|
2986
|
+
loading: _ctx.loading
|
|
2987
|
+
}, () => [
|
|
2988
|
+
createVNode("button", mergeProps({
|
|
2989
|
+
id: _ctx.inputId,
|
|
2990
|
+
class: _ctx.selectClass,
|
|
2991
|
+
disabled: _ctx.disabled,
|
|
2992
|
+
type: "button"
|
|
2993
|
+
}, _ctx.attrs), [
|
|
2994
|
+
_ctx.isLeading && _ctx.leadingIconName || _ctx.$slots.leading ? (openBlock(), createBlock("span", {
|
|
2995
|
+
key: 0,
|
|
2996
|
+
class: _ctx.leadingWrapperIconClass
|
|
2997
|
+
}, [
|
|
2998
|
+
renderSlot(_ctx.$slots, "leading", {
|
|
2999
|
+
selected: _ctx.selected,
|
|
3000
|
+
disabled: _ctx.disabled,
|
|
3001
|
+
loading: _ctx.loading
|
|
3002
|
+
}, () => [
|
|
3003
|
+
createVNode(_component_UIcon, {
|
|
3004
|
+
name: _ctx.leadingIconName,
|
|
3005
|
+
class: _ctx.leadingIconClass
|
|
3006
|
+
}, null, 8, ["name", "class"])
|
|
3007
|
+
])
|
|
3008
|
+
], 2)) : createCommentVNode("", true),
|
|
3009
|
+
renderSlot(_ctx.$slots, "label", { selected: _ctx.selected }, () => [
|
|
3010
|
+
_ctx.label ? (openBlock(), createBlock("span", {
|
|
3011
|
+
key: 0,
|
|
3012
|
+
class: _ctx.uiMenu.label
|
|
3013
|
+
}, toDisplayString(_ctx.label), 3)) : (openBlock(), createBlock("span", {
|
|
3014
|
+
key: 1,
|
|
3015
|
+
class: _ctx.uiMenu.label
|
|
3016
|
+
}, toDisplayString(_ctx.placeholder || "\xA0"), 3))
|
|
3017
|
+
]),
|
|
3018
|
+
_ctx.isTrailing && _ctx.trailingIconName || _ctx.$slots.trailing ? (openBlock(), createBlock("span", {
|
|
3019
|
+
key: 1,
|
|
3020
|
+
class: _ctx.trailingWrapperIconClass
|
|
3021
|
+
}, [
|
|
3022
|
+
renderSlot(_ctx.$slots, "trailing", {
|
|
3023
|
+
selected: _ctx.selected,
|
|
3024
|
+
disabled: _ctx.disabled,
|
|
3025
|
+
loading: _ctx.loading
|
|
3026
|
+
}, () => [
|
|
3027
|
+
createVNode(_component_UIcon, {
|
|
3028
|
+
name: _ctx.trailingIconName,
|
|
3029
|
+
class: _ctx.trailingIconClass,
|
|
3030
|
+
"aria-hidden": "true"
|
|
3031
|
+
}, null, 8, ["name", "class"])
|
|
3032
|
+
])
|
|
3033
|
+
], 2)) : createCommentVNode("", true)
|
|
3034
|
+
], 16, ["id", "disabled"])
|
|
3035
|
+
])
|
|
3036
|
+
]),
|
|
3037
|
+
_: 2
|
|
3038
|
+
}, 1032, ["class"])),
|
|
3039
|
+
open ? (openBlock(), createBlock("div", {
|
|
3040
|
+
key: 1,
|
|
3041
|
+
ref: "container",
|
|
3042
|
+
class: [_ctx.uiMenu.container, _ctx.uiMenu.width]
|
|
3043
|
+
}, [
|
|
3044
|
+
createVNode(Transition, mergeProps({ appear: "" }, _ctx.uiMenu.transition), {
|
|
3045
|
+
default: withCtx(() => [
|
|
3046
|
+
createVNode("div", null, [
|
|
3047
|
+
_ctx.popper.arrow ? (openBlock(), createBlock("div", {
|
|
3048
|
+
key: 0,
|
|
3049
|
+
"data-popper-arrow": "",
|
|
3050
|
+
class: Object.values(_ctx.uiMenu.arrow)
|
|
3051
|
+
}, null, 2)) : createCommentVNode("", true),
|
|
3052
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.searchable ? "HComboboxOptions" : "HListboxOptions"), {
|
|
3053
|
+
static: "",
|
|
3054
|
+
class: [_ctx.uiMenu.base, _ctx.uiMenu.ring, _ctx.uiMenu.rounded, _ctx.uiMenu.shadow, _ctx.uiMenu.background, _ctx.uiMenu.padding, _ctx.uiMenu.height]
|
|
3055
|
+
}, {
|
|
3056
|
+
default: withCtx(() => {
|
|
3057
|
+
var _a, _b;
|
|
3058
|
+
return [
|
|
3059
|
+
_ctx.searchable ? (openBlock(), createBlock(_component_HComboboxInput, {
|
|
3060
|
+
key: 0,
|
|
3061
|
+
"display-value": () => _ctx.query,
|
|
3062
|
+
name: "q",
|
|
3063
|
+
placeholder: _ctx.searchablePlaceholder,
|
|
3064
|
+
autofocus: "",
|
|
3065
|
+
autocomplete: "off",
|
|
3066
|
+
class: _ctx.uiMenu.input,
|
|
3067
|
+
onChange: _ctx.onQueryChange
|
|
3068
|
+
}, null, 8, ["display-value", "placeholder", "class", "onChange"])) : createCommentVNode("", true),
|
|
3069
|
+
(openBlock(true), createBlock(Fragment, null, renderList(_ctx.filteredOptions, (option, index) => {
|
|
3070
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.searchable ? "HComboboxOption" : "HListboxOption"), {
|
|
3071
|
+
key: index,
|
|
3072
|
+
as: "template",
|
|
3073
|
+
value: _ctx.valueAttribute ? _ctx.accessor(option, _ctx.valueAttribute) : option,
|
|
3074
|
+
disabled: option.disabled
|
|
3075
|
+
}, {
|
|
3076
|
+
default: withCtx(({ active, selected: optionSelected, disabled: optionDisabled }) => [
|
|
3077
|
+
createVNode("li", {
|
|
3078
|
+
class: [_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive, optionSelected && _ctx.uiMenu.option.selected, optionDisabled && _ctx.uiMenu.option.disabled]
|
|
3079
|
+
}, [
|
|
3080
|
+
createVNode("div", {
|
|
3081
|
+
class: _ctx.uiMenu.option.container
|
|
3082
|
+
}, [
|
|
3083
|
+
renderSlot(_ctx.$slots, "option", {
|
|
3084
|
+
option,
|
|
3085
|
+
active,
|
|
3086
|
+
selected: optionSelected
|
|
3087
|
+
}, () => [
|
|
3088
|
+
option.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
3089
|
+
key: 0,
|
|
3090
|
+
name: option.icon,
|
|
3091
|
+
class: [_ctx.uiMenu.option.icon.base, active ? _ctx.uiMenu.option.icon.active : _ctx.uiMenu.option.icon.inactive, option.iconClass],
|
|
3092
|
+
"aria-hidden": "true"
|
|
3093
|
+
}, null, 8, ["name", "class"])) : option.avatar ? (openBlock(), createBlock(_component_UAvatar, mergeProps({
|
|
3094
|
+
key: 1,
|
|
3095
|
+
ref_for: true
|
|
3096
|
+
}, { size: _ctx.uiMenu.option.avatar.size, ...option.avatar }, {
|
|
3097
|
+
class: _ctx.uiMenu.option.avatar.base,
|
|
3098
|
+
"aria-hidden": "true"
|
|
3099
|
+
}), null, 16, ["class"])) : option.chip ? (openBlock(), createBlock("span", {
|
|
3100
|
+
key: 2,
|
|
3101
|
+
class: _ctx.uiMenu.option.chip.base,
|
|
3102
|
+
style: { background: `#${option.chip}` }
|
|
3103
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
3104
|
+
createVNode("span", { class: "truncate" }, toDisplayString(["string", "number"].includes(typeof option) ? option : _ctx.accessor(option, _ctx.optionAttribute)), 1)
|
|
3105
|
+
])
|
|
3106
|
+
], 2),
|
|
3107
|
+
optionSelected ? (openBlock(), createBlock("span", {
|
|
3108
|
+
key: 0,
|
|
3109
|
+
class: [_ctx.uiMenu.option.selectedIcon.wrapper, _ctx.uiMenu.option.selectedIcon.padding]
|
|
3110
|
+
}, [
|
|
3111
|
+
createVNode(_component_UIcon, {
|
|
3112
|
+
name: _ctx.selectedIcon,
|
|
3113
|
+
class: _ctx.uiMenu.option.selectedIcon.base,
|
|
3114
|
+
"aria-hidden": "true"
|
|
3115
|
+
}, null, 8, ["name", "class"])
|
|
3116
|
+
], 2)) : createCommentVNode("", true)
|
|
3117
|
+
], 2)
|
|
3118
|
+
]),
|
|
3119
|
+
_: 2
|
|
3120
|
+
}, 1032, ["value", "disabled"]);
|
|
3121
|
+
}), 128)),
|
|
3122
|
+
_ctx.creatable && _ctx.createOption ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.searchable ? "HComboboxOption" : "HListboxOption"), {
|
|
3123
|
+
key: 1,
|
|
3124
|
+
value: _ctx.createOption,
|
|
3125
|
+
as: "template"
|
|
3126
|
+
}, {
|
|
3127
|
+
default: withCtx(({ active, selected: optionSelected }) => [
|
|
3128
|
+
createVNode("li", {
|
|
3129
|
+
class: [_ctx.uiMenu.option.base, _ctx.uiMenu.option.rounded, _ctx.uiMenu.option.padding, _ctx.uiMenu.option.size, _ctx.uiMenu.option.color, active ? _ctx.uiMenu.option.active : _ctx.uiMenu.option.inactive]
|
|
3130
|
+
}, [
|
|
3131
|
+
createVNode("div", {
|
|
3132
|
+
class: _ctx.uiMenu.option.container
|
|
3133
|
+
}, [
|
|
3134
|
+
renderSlot(_ctx.$slots, "option-create", {
|
|
3135
|
+
option: _ctx.createOption,
|
|
3136
|
+
active,
|
|
3137
|
+
selected: optionSelected
|
|
3138
|
+
}, () => [
|
|
3139
|
+
createVNode("span", {
|
|
3140
|
+
class: _ctx.uiMenu.option.create
|
|
3141
|
+
}, 'Create "' + toDisplayString(typeof _ctx.createOption === "string" ? _ctx.createOption : _ctx.accessor(_ctx.createOption, _ctx.optionAttribute)) + '"', 3)
|
|
3142
|
+
])
|
|
3143
|
+
], 2)
|
|
3144
|
+
], 2)
|
|
3145
|
+
]),
|
|
3146
|
+
_: 3
|
|
3147
|
+
}, 8, ["value"])) : _ctx.searchable && _ctx.query && !((_a = _ctx.filteredOptions) == null ? void 0 : _a.length) ? (openBlock(), createBlock("p", {
|
|
3148
|
+
key: 2,
|
|
3149
|
+
class: _ctx.uiMenu.option.empty
|
|
3150
|
+
}, [
|
|
3151
|
+
renderSlot(_ctx.$slots, "option-empty", { query: _ctx.query }, () => [
|
|
3152
|
+
createTextVNode(toDisplayString(_ctx.uiMenu.default.optionEmpty.label.replace("{query}", _ctx.query)), 1)
|
|
3153
|
+
])
|
|
3154
|
+
], 2)) : !((_b = _ctx.filteredOptions) == null ? void 0 : _b.length) ? (openBlock(), createBlock("p", {
|
|
3155
|
+
key: 3,
|
|
3156
|
+
class: _ctx.uiMenu.empty
|
|
3157
|
+
}, [
|
|
3158
|
+
renderSlot(_ctx.$slots, "empty", { query: _ctx.query }, () => [
|
|
3159
|
+
createTextVNode(toDisplayString(_ctx.uiMenu.default.empty.label), 1)
|
|
3160
|
+
])
|
|
3161
|
+
], 2)) : createCommentVNode("", true)
|
|
3162
|
+
];
|
|
3163
|
+
}),
|
|
3164
|
+
_: 3
|
|
3165
|
+
}, 8, ["class"]))
|
|
3166
|
+
])
|
|
3167
|
+
]),
|
|
3168
|
+
_: 3
|
|
3169
|
+
}, 16)
|
|
3170
|
+
], 2)) : createCommentVNode("", true)
|
|
3171
|
+
];
|
|
3172
|
+
}
|
|
3173
|
+
}),
|
|
3174
|
+
_: 3
|
|
3175
|
+
}), _parent);
|
|
3176
|
+
}
|
|
3177
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
3178
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
3179
|
+
const ssrContext = useSSRContext();
|
|
3180
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/@nuxt/ui/dist/runtime/components/forms/SelectMenu.vue");
|
|
3181
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
3182
|
+
};
|
|
3183
|
+
const __nuxt_component_1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender]]);
|
|
3184
|
+
const AMBIENT_TYPES = `
|
|
3185
|
+
interface RunContext {
|
|
3186
|
+
config: Record<string, unknown>;
|
|
3187
|
+
filter: string;
|
|
3188
|
+
taskCount: number;
|
|
3189
|
+
}
|
|
3190
|
+
interface TaskContext {
|
|
3191
|
+
task: { id: string; name: string; description: string; status: string; url: string; tags: string[] };
|
|
3192
|
+
config: Record<string, unknown>;
|
|
3193
|
+
branchName: string;
|
|
3194
|
+
prompt: string;
|
|
3195
|
+
}
|
|
3196
|
+
interface ResolveConflictsContext {
|
|
3197
|
+
task: { id: string; name: string; description: string; status: string; url: string; tags: string[] };
|
|
3198
|
+
config: Record<string, unknown>;
|
|
3199
|
+
branchName: string;
|
|
3200
|
+
conflictFiles: string[];
|
|
3201
|
+
prompt: string;
|
|
3202
|
+
}
|
|
3203
|
+
interface NonCodeTaskContext {
|
|
3204
|
+
task: { id: string; name: string; description: string; status: string; url: string; tags: string[] };
|
|
3205
|
+
config: Record<string, unknown>;
|
|
3206
|
+
prompt: string;
|
|
3207
|
+
}
|
|
3208
|
+
interface ThinkingTaskContext {
|
|
3209
|
+
task: { id: string; name: string; description: string; status: string; url: string; tags: string[] };
|
|
3210
|
+
config: Record<string, unknown>;
|
|
3211
|
+
branchName: string;
|
|
3212
|
+
subtasks: Array<{ id: number; title: string; description: string; status: string }>;
|
|
3213
|
+
}
|
|
3214
|
+
interface ReviewTaskContext {
|
|
3215
|
+
task: { id: string; name: string; description: string; status: string; url: string; tags: string[] };
|
|
3216
|
+
config: Record<string, unknown>;
|
|
3217
|
+
branchName: string;
|
|
3218
|
+
threads: Array<{ id: string; body: string; resolved: boolean }>;
|
|
3219
|
+
prompt: string;
|
|
3220
|
+
}
|
|
3221
|
+
interface CommentContext {
|
|
3222
|
+
task: { id: string; name: string; description: string; status: string; url: string; tags: string[] };
|
|
3223
|
+
config: Record<string, unknown>;
|
|
3224
|
+
text: string;
|
|
3225
|
+
}
|
|
3226
|
+
interface HookVM {
|
|
3227
|
+
runAI(prompt: string): Promise<{ success: boolean; output: string; error: string }>;
|
|
3228
|
+
postComment(taskId: string, text: string): Promise<void>;
|
|
3229
|
+
updateStatus(taskId: string, status: string): Promise<void>;
|
|
3230
|
+
getComments(taskId: string): Promise<Array<{ id: string; text: string; author: string }>>;
|
|
3231
|
+
log: { info(msg: string): void; warn(msg: string): void; error(msg: string): void };
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
interface AidevHooks {
|
|
3235
|
+
beforeRun?(context: RunContext, vm: HookVM): Promise<RunContext | void>;
|
|
3236
|
+
afterRun?(context: RunContext & { processed: number; skipped: number }, vm: HookVM): Promise<void>;
|
|
3237
|
+
beforeEachTask?(context: TaskContext, vm: HookVM): Promise<TaskContext | void>;
|
|
3238
|
+
afterEachTask?(context: TaskContext & { success: boolean }, vm: HookVM): Promise<void>;
|
|
3239
|
+
beforeResolveConflicts?(context: ResolveConflictsContext, vm: HookVM): Promise<ResolveConflictsContext | void>;
|
|
3240
|
+
afterResolveConflicts?(context: ResolveConflictsContext & { resolved: boolean }, vm: HookVM): Promise<void>;
|
|
3241
|
+
beforeNonCodeTask?(context: NonCodeTaskContext, vm: HookVM): Promise<NonCodeTaskContext | void>;
|
|
3242
|
+
afterNonCodeTask?(context: NonCodeTaskContext & { success: boolean; output: string }, vm: HookVM): Promise<void>;
|
|
3243
|
+
beforeThinkingTask?(context: ThinkingTaskContext, vm: HookVM): Promise<ThinkingTaskContext | void>;
|
|
3244
|
+
afterThinkingTask?(context: ThinkingTaskContext & { success: boolean }, vm: HookVM): Promise<void>;
|
|
3245
|
+
beforeReviewTask?(context: ReviewTaskContext, vm: HookVM): Promise<ReviewTaskContext | void>;
|
|
3246
|
+
afterReviewTask?(context: ReviewTaskContext & { success: boolean; resolvedCount: number }, vm: HookVM): Promise<void>;
|
|
3247
|
+
beforeComment?(context: CommentContext, vm: HookVM): Promise<CommentContext | void>;
|
|
3248
|
+
afterComment?(context: CommentContext, vm: HookVM): Promise<void>;
|
|
3249
|
+
}
|
|
3250
|
+
`;
|
|
3251
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3252
|
+
__name: "hooks",
|
|
3253
|
+
__ssrInlineRender: true,
|
|
3254
|
+
setup(__props) {
|
|
3255
|
+
const HOOK_NAMES = [
|
|
3256
|
+
"beforeRun",
|
|
3257
|
+
"afterRun",
|
|
3258
|
+
"beforeEachTask",
|
|
3259
|
+
"afterEachTask",
|
|
3260
|
+
"beforeResolveConflicts",
|
|
3261
|
+
"afterResolveConflicts",
|
|
3262
|
+
"beforeNonCodeTask",
|
|
3263
|
+
"afterNonCodeTask",
|
|
3264
|
+
"beforeThinkingTask",
|
|
3265
|
+
"afterThinkingTask",
|
|
3266
|
+
"beforeReviewTask",
|
|
3267
|
+
"afterReviewTask",
|
|
3268
|
+
"beforeComment",
|
|
3269
|
+
"afterComment"
|
|
3270
|
+
];
|
|
3271
|
+
const _TASK = {
|
|
3272
|
+
id: "T-1",
|
|
3273
|
+
name: "Example task",
|
|
3274
|
+
description: "Build a feature",
|
|
3275
|
+
status: "in-progress",
|
|
3276
|
+
url: "",
|
|
3277
|
+
tags: []
|
|
3278
|
+
};
|
|
3279
|
+
const DEFAULT_MOCK_DATA = {
|
|
3280
|
+
beforeRun: JSON.stringify({ config: {}, filter: "", taskCount: 3 }, null, 2),
|
|
3281
|
+
afterRun: JSON.stringify({ config: {}, filter: "", taskCount: 3, processed: 2, skipped: 1 }, null, 2),
|
|
3282
|
+
beforeEachTask: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", prompt: "Implement the feature." }, null, 2),
|
|
3283
|
+
afterEachTask: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", prompt: "Implement the feature.", success: true }, null, 2),
|
|
3284
|
+
beforeResolveConflicts: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", conflictFiles: ["src/index.ts"], prompt: "Resolve conflicts." }, null, 2),
|
|
3285
|
+
afterResolveConflicts: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", conflictFiles: ["src/index.ts"], prompt: "Resolve conflicts.", resolved: true }, null, 2),
|
|
3286
|
+
beforeNonCodeTask: JSON.stringify({ task: _TASK, config: {}, prompt: "Answer the question." }, null, 2),
|
|
3287
|
+
afterNonCodeTask: JSON.stringify({ task: _TASK, config: {}, prompt: "Answer the question.", success: true, output: "AI response." }, null, 2),
|
|
3288
|
+
beforeThinkingTask: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", subtasks: [{ id: 1, title: "Subtask 1", description: "Do X", status: "open" }] }, null, 2),
|
|
3289
|
+
afterThinkingTask: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", subtasks: [{ id: 1, title: "Subtask 1", description: "Do X", status: "done" }], success: true }, null, 2),
|
|
3290
|
+
beforeReviewTask: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", threads: [{ id: "r-1", body: "Fix X", resolved: false }], prompt: "Address review comments." }, null, 2),
|
|
3291
|
+
afterReviewTask: JSON.stringify({ task: _TASK, config: {}, branchName: "feature/example", threads: [{ id: "r-1", body: "Fix X", resolved: true }], prompt: "Address review comments.", success: true, resolvedCount: 1 }, null, 2),
|
|
3292
|
+
beforeComment: JSON.stringify({ task: _TASK, config: {}, text: "Work complete. Tests pass." }, null, 2),
|
|
3293
|
+
afterComment: JSON.stringify({ task: _TASK, config: {}, text: "Work complete. Tests pass." }, null, 2)
|
|
3294
|
+
};
|
|
3295
|
+
const CODE_SAMPLES = [
|
|
3296
|
+
{
|
|
3297
|
+
title: "1. Safety guard \u2014 beforeEachTask",
|
|
3298
|
+
hookName: "beforeEachTask",
|
|
3299
|
+
code: `export async function beforeEachTask(context, vm) {
|
|
3300
|
+
const { output } = await vm.runAI(
|
|
3301
|
+
\`Is this task potentially destructive or irreversible?\\nTask: \${context.task.name}\\nReply only YES or NO.\`
|
|
3302
|
+
);
|
|
3303
|
+
if (output.trim().toUpperCase().startsWith('YES')) {
|
|
3304
|
+
throw new Error(\`Safety guard blocked "\${context.task.name}" \u2014 looks destructive\`);
|
|
3305
|
+
}
|
|
3306
|
+
return context;
|
|
3307
|
+
}`
|
|
3308
|
+
},
|
|
3309
|
+
{
|
|
3310
|
+
title: "2. TypeScript type-check \u2014 afterEachTask",
|
|
3311
|
+
hookName: "afterEachTask",
|
|
3312
|
+
code: `import { spawnSync } from 'node:child_process';
|
|
3313
|
+
|
|
3314
|
+
export async function afterEachTask(context, vm) {
|
|
3315
|
+
const result = spawnSync('npx', ['tsc', '--noEmit'], { cwd: process.cwd(), encoding: 'utf8' });
|
|
3316
|
+
if (result.status !== 0) {
|
|
3317
|
+
vm.log.error('TypeScript errors:\\n' + result.stdout);
|
|
3318
|
+
throw new Error('TypeScript type-check failed');
|
|
3319
|
+
}
|
|
3320
|
+
vm.log.info('TypeScript check passed');
|
|
3321
|
+
}`
|
|
3322
|
+
},
|
|
3323
|
+
{
|
|
3324
|
+
title: "3. Lint & format \u2014 afterEachTask",
|
|
3325
|
+
hookName: "afterEachTask",
|
|
3326
|
+
code: `import { spawnSync } from 'node:child_process';
|
|
3327
|
+
|
|
3328
|
+
export async function afterEachTask(context, vm) {
|
|
3329
|
+
spawnSync('npx', ['eslint', '--fix', '.'], { cwd: process.cwd() });
|
|
3330
|
+
spawnSync('npx', ['prettier', '--write', '.'], { cwd: process.cwd() });
|
|
3331
|
+
vm.log.info('Lint and format complete');
|
|
3332
|
+
}`
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
title: "4. Slack notification \u2014 afterRun",
|
|
3336
|
+
hookName: "afterRun",
|
|
3337
|
+
code: `export async function afterRun(context, vm) {
|
|
3338
|
+
const webhookUrl = process.env.SLACK_WEBHOOK_URL;
|
|
3339
|
+
if (!webhookUrl) return;
|
|
3340
|
+
await fetch(webhookUrl, {
|
|
3341
|
+
method: 'POST',
|
|
3342
|
+
headers: { 'Content-Type': 'application/json' },
|
|
3343
|
+
body: JSON.stringify({
|
|
3344
|
+
text: \`aidev run complete: \${context.processed} processed, \${context.skipped} skipped\`,
|
|
3345
|
+
}),
|
|
3346
|
+
});
|
|
3347
|
+
vm.log.info('Slack notification sent');
|
|
3348
|
+
}`
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
title: "5. Append ticket ID to prompt \u2014 beforeEachTask",
|
|
3352
|
+
hookName: "beforeEachTask",
|
|
3353
|
+
code: `export async function beforeEachTask(context, vm) {
|
|
3354
|
+
context.prompt = \`[Ticket: \${context.task.id}]\\n\${context.prompt}\`;
|
|
3355
|
+
vm.log.info('Prefixed prompt with ticket ID: ' + context.task.id);
|
|
3356
|
+
return context;
|
|
3357
|
+
}`
|
|
3358
|
+
},
|
|
3359
|
+
{
|
|
3360
|
+
title: '6. Post "Starting\u2026" comment \u2014 beforeEachTask',
|
|
3361
|
+
hookName: "beforeEachTask",
|
|
3362
|
+
code: `export async function beforeEachTask(context, vm) {
|
|
3363
|
+
await vm.postComment(context.task.id, \`\u{1F916} Starting implementation of: \${context.task.name}\`);
|
|
3364
|
+
return context;
|
|
3365
|
+
}`
|
|
3366
|
+
},
|
|
3367
|
+
{
|
|
3368
|
+
title: "7. npm audit security scan \u2014 beforeEachTask",
|
|
3369
|
+
hookName: "beforeEachTask",
|
|
3370
|
+
code: `import { spawnSync } from 'node:child_process';
|
|
3371
|
+
|
|
3372
|
+
export async function beforeEachTask(context, vm) {
|
|
3373
|
+
const result = spawnSync('npm', ['audit', '--audit-level=high'], { cwd: process.cwd(), encoding: 'utf8' });
|
|
3374
|
+
if (result.status !== 0) {
|
|
3375
|
+
vm.log.error('npm audit found high-severity issues:\\n' + result.stdout);
|
|
3376
|
+
throw new Error('Security audit failed \u2014 fix vulnerabilities before running AI tasks');
|
|
3377
|
+
}
|
|
3378
|
+
vm.log.info('npm audit passed');
|
|
3379
|
+
return context;
|
|
3380
|
+
}`
|
|
3381
|
+
},
|
|
3382
|
+
{
|
|
3383
|
+
title: "8. Test suite gate \u2014 afterEachTask",
|
|
3384
|
+
hookName: "afterEachTask",
|
|
3385
|
+
code: `import { spawnSync } from 'node:child_process';
|
|
3386
|
+
|
|
3387
|
+
export async function afterEachTask(context, vm) {
|
|
3388
|
+
if (!context.success) return;
|
|
3389
|
+
const result = spawnSync('npm', ['test', '--', '--passWithNoTests'], { cwd: process.cwd(), encoding: 'utf8' });
|
|
3390
|
+
if (result.status !== 0) {
|
|
3391
|
+
vm.log.error('Test suite failed:\\n' + (result.stdout || result.stderr || ''));
|
|
3392
|
+
throw new Error('Tests failed after task completion');
|
|
3393
|
+
}
|
|
3394
|
+
vm.log.info('All tests passed');
|
|
3395
|
+
}`
|
|
3396
|
+
},
|
|
3397
|
+
{
|
|
3398
|
+
title: "9. Reject non-code tasks \u2014 beforeNonCodeTask",
|
|
3399
|
+
hookName: "beforeNonCodeTask",
|
|
3400
|
+
code: `export async function beforeNonCodeTask(context, vm) {
|
|
3401
|
+
vm.log.info('Skipping non-code task: ' + context.task.name);
|
|
3402
|
+
throw new Error('Non-code tasks are disabled in this project');
|
|
3403
|
+
}`
|
|
3404
|
+
},
|
|
3405
|
+
{
|
|
3406
|
+
title: "10. Append signature to comments \u2014 beforeComment",
|
|
3407
|
+
hookName: "beforeComment",
|
|
3408
|
+
code: `export async function beforeComment(context, vm) {
|
|
3409
|
+
const signature = '\\n\\n---\\n*Generated by aidev*';
|
|
3410
|
+
context.text = context.text + signature;
|
|
3411
|
+
vm.log.info('Signature appended to comment');
|
|
3412
|
+
return context;
|
|
3413
|
+
}`
|
|
3414
|
+
}
|
|
3415
|
+
];
|
|
3416
|
+
const api = useApi();
|
|
3417
|
+
const hooksPath = ref("");
|
|
3418
|
+
const editorContent = ref("");
|
|
3419
|
+
const loading = ref(false);
|
|
3420
|
+
const saving = ref(false);
|
|
3421
|
+
const regenerating = ref(false);
|
|
3422
|
+
const addingMissing = ref(false);
|
|
3423
|
+
const loadError = ref("");
|
|
3424
|
+
const actionMessage = ref("");
|
|
3425
|
+
const actionOk = ref(false);
|
|
3426
|
+
const mockDataMap = ref(
|
|
3427
|
+
Object.fromEntries(HOOK_NAMES.map((n2) => [n2, DEFAULT_MOCK_DATA[n2]]))
|
|
3428
|
+
);
|
|
3429
|
+
const executingHook = ref(null);
|
|
3430
|
+
const showModal = ref(false);
|
|
3431
|
+
const modalLoading = ref(false);
|
|
3432
|
+
const modalTitle = ref("");
|
|
3433
|
+
const modalOk = ref(true);
|
|
3434
|
+
const modalError = ref("");
|
|
3435
|
+
const modalLogs = ref([]);
|
|
3436
|
+
const editorContainer = ref(null);
|
|
3437
|
+
let _monaco = null;
|
|
3438
|
+
let _editor = null;
|
|
3439
|
+
watch(
|
|
3440
|
+
editorContainer,
|
|
3441
|
+
async (container) => {
|
|
3442
|
+
if (!container || _monaco) return;
|
|
3443
|
+
const { default: loader } = await import('@monaco-editor/loader');
|
|
3444
|
+
_monaco = await loader.init();
|
|
3445
|
+
const ts = _monaco.languages.typescript;
|
|
3446
|
+
ts.typescriptDefaults.setCompilerOptions({
|
|
3447
|
+
target: ts.ScriptTarget.ES2020,
|
|
3448
|
+
module: ts.ModuleKind.ESNext,
|
|
3449
|
+
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
3450
|
+
allowNonTsExtensions: true,
|
|
3451
|
+
strict: true,
|
|
3452
|
+
noEmit: true,
|
|
3453
|
+
esModuleInterop: true
|
|
3454
|
+
});
|
|
3455
|
+
ts.typescriptDefaults.setDiagnosticsOptions({
|
|
3456
|
+
noSemanticValidation: false,
|
|
3457
|
+
noSyntaxValidation: false
|
|
3458
|
+
});
|
|
3459
|
+
ts.typescriptDefaults.addExtraLib(AMBIENT_TYPES, "file:///aidev-hooks.d.ts");
|
|
3460
|
+
_editor = _monaco.editor.create(container, {
|
|
3461
|
+
value: editorContent.value,
|
|
3462
|
+
language: "typescript",
|
|
3463
|
+
theme: "vs",
|
|
3464
|
+
minimap: { enabled: false },
|
|
3465
|
+
automaticLayout: true,
|
|
3466
|
+
fontSize: 13,
|
|
3467
|
+
scrollBeyondLastLine: false,
|
|
3468
|
+
tabSize: 2
|
|
3469
|
+
});
|
|
3470
|
+
_editor.onDidChangeModelContent(() => {
|
|
3471
|
+
editorContent.value = _editor.getValue();
|
|
3472
|
+
});
|
|
3473
|
+
},
|
|
3474
|
+
{ flush: "post" }
|
|
3475
|
+
);
|
|
3476
|
+
function extractMessage(err, fallback) {
|
|
3477
|
+
var _a, _b, _c;
|
|
3478
|
+
return (_c = (_b = (_a = err == null ? void 0 : err.data) == null ? void 0 : _a.statusMessage) != null ? _b : err == null ? void 0 : err.message) != null ? _c : fallback;
|
|
3479
|
+
}
|
|
3480
|
+
function flash(ok, message) {
|
|
3481
|
+
actionOk.value = ok;
|
|
3482
|
+
actionMessage.value = message;
|
|
3483
|
+
}
|
|
3484
|
+
async function loadHooks() {
|
|
3485
|
+
loading.value = true;
|
|
3486
|
+
loadError.value = "";
|
|
3487
|
+
actionMessage.value = "";
|
|
3488
|
+
try {
|
|
3489
|
+
const data = await api("/api/hooks");
|
|
3490
|
+
hooksPath.value = data.path;
|
|
3491
|
+
editorContent.value = data.content;
|
|
3492
|
+
if (_editor) _editor.setValue(data.content);
|
|
3493
|
+
} catch (err) {
|
|
3494
|
+
loadError.value = extractMessage(err, "Failed to load hooks file");
|
|
3495
|
+
} finally {
|
|
3496
|
+
loading.value = false;
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3499
|
+
async function save() {
|
|
3500
|
+
saving.value = true;
|
|
3501
|
+
actionMessage.value = "";
|
|
3502
|
+
const content = _editor ? _editor.getValue() : editorContent.value;
|
|
3503
|
+
try {
|
|
3504
|
+
await api("/api/hooks", { method: "PUT", body: { content } });
|
|
3505
|
+
flash(true, "Hooks file saved.");
|
|
3506
|
+
} catch (err) {
|
|
3507
|
+
flash(false, extractMessage(err, "Failed to save"));
|
|
3508
|
+
} finally {
|
|
3509
|
+
saving.value = false;
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
async function regenerate() {
|
|
3513
|
+
if (!confirm("Replace the entire hooks file with the default template? Unsaved editor changes will be lost.")) {
|
|
3514
|
+
return;
|
|
3515
|
+
}
|
|
3516
|
+
regenerating.value = true;
|
|
3517
|
+
actionMessage.value = "";
|
|
3518
|
+
try {
|
|
3519
|
+
const data = await api("/api/hooks-regenerate", { method: "POST" });
|
|
3520
|
+
editorContent.value = data.content;
|
|
3521
|
+
if (_editor) _editor.setValue(data.content);
|
|
3522
|
+
flash(true, "Hooks file regenerated from template.");
|
|
3523
|
+
} catch (err) {
|
|
3524
|
+
flash(false, extractMessage(err, "Failed to regenerate"));
|
|
3525
|
+
} finally {
|
|
3526
|
+
regenerating.value = false;
|
|
3527
|
+
}
|
|
3528
|
+
}
|
|
3529
|
+
async function addMissingHooks() {
|
|
3530
|
+
addingMissing.value = true;
|
|
3531
|
+
actionMessage.value = "";
|
|
3532
|
+
try {
|
|
3533
|
+
const data = await api("/api/hooks-update", { method: "POST" });
|
|
3534
|
+
editorContent.value = data.content;
|
|
3535
|
+
if (_editor) _editor.setValue(data.content);
|
|
3536
|
+
flash(
|
|
3537
|
+
true,
|
|
3538
|
+
data.added.length ? `Added missing hooks: ${data.added.join(", ")}` : "All hooks are already present."
|
|
3539
|
+
);
|
|
3540
|
+
} catch (err) {
|
|
3541
|
+
flash(false, extractMessage(err, "Failed to update hooks"));
|
|
3542
|
+
} finally {
|
|
3543
|
+
addingMissing.value = false;
|
|
3544
|
+
}
|
|
3545
|
+
}
|
|
3546
|
+
async function executeHook(hookName) {
|
|
3547
|
+
var _a, _b;
|
|
3548
|
+
executingHook.value = hookName;
|
|
3549
|
+
modalTitle.value = `Execute: ${hookName}`;
|
|
3550
|
+
modalOk.value = true;
|
|
3551
|
+
modalError.value = "";
|
|
3552
|
+
modalLogs.value = [];
|
|
3553
|
+
modalLoading.value = true;
|
|
3554
|
+
showModal.value = true;
|
|
3555
|
+
let mockData = {};
|
|
3556
|
+
try {
|
|
3557
|
+
mockData = JSON.parse((_a = mockDataMap.value[hookName]) != null ? _a : "{}");
|
|
3558
|
+
} catch {
|
|
3559
|
+
modalLoading.value = false;
|
|
3560
|
+
modalOk.value = false;
|
|
3561
|
+
modalError.value = "Mock data is not valid JSON";
|
|
3562
|
+
executingHook.value = null;
|
|
3563
|
+
return;
|
|
3564
|
+
}
|
|
3565
|
+
try {
|
|
3566
|
+
const result = await api("/api/hooks-execute", {
|
|
3567
|
+
method: "POST",
|
|
3568
|
+
body: { hookName, mockData }
|
|
3569
|
+
});
|
|
3570
|
+
modalOk.value = result.ok;
|
|
3571
|
+
modalError.value = (_b = result.error) != null ? _b : "";
|
|
3572
|
+
modalLogs.value = result.logs;
|
|
3573
|
+
} catch (err) {
|
|
3574
|
+
modalOk.value = false;
|
|
3575
|
+
modalError.value = extractMessage(err, "Request failed");
|
|
3576
|
+
modalLogs.value = [];
|
|
3577
|
+
} finally {
|
|
3578
|
+
executingHook.value = null;
|
|
3579
|
+
modalLoading.value = false;
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
const selectedSample = ref(null);
|
|
3583
|
+
const sampleOptions = CODE_SAMPLES.map((s2, i2) => ({
|
|
3584
|
+
label: s2.title,
|
|
3585
|
+
hookName: s2.hookName,
|
|
3586
|
+
idx: i2
|
|
3587
|
+
}));
|
|
3588
|
+
function onSampleSelect(option) {
|
|
3589
|
+
var _a;
|
|
3590
|
+
if (!option) return;
|
|
3591
|
+
nextTick(() => {
|
|
3592
|
+
selectedSample.value = null;
|
|
3593
|
+
});
|
|
3594
|
+
const sample = CODE_SAMPLES[option.idx];
|
|
3595
|
+
if (!sample) return;
|
|
3596
|
+
if (_editor && _monaco) {
|
|
3597
|
+
const selection = _editor.getSelection();
|
|
3598
|
+
const pos = (_a = selection == null ? void 0 : selection.getStartPosition()) != null ? _a : { lineNumber: 1, column: 1 };
|
|
3599
|
+
_editor.executeEdits("sample-insert", [
|
|
3600
|
+
{
|
|
3601
|
+
range: new _monaco.Range(pos.lineNumber, pos.column, pos.lineNumber, pos.column),
|
|
3602
|
+
text: "\n" + sample.code + "\n"
|
|
3603
|
+
}
|
|
3604
|
+
]);
|
|
3605
|
+
_editor.focus();
|
|
3606
|
+
}
|
|
3607
|
+
const panelEl = (void 0).getElementById(`hook-panel-${sample.hookName}`);
|
|
3608
|
+
if (panelEl) {
|
|
3609
|
+
panelEl.open = true;
|
|
3610
|
+
panelEl.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
3611
|
+
panelEl.classList.add("hook-panel-highlight");
|
|
3612
|
+
setTimeout(() => panelEl.classList.remove("hook-panel-highlight"), 1200);
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3615
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
3616
|
+
const _component_UCard = __nuxt_component_0;
|
|
3617
|
+
const _component_USelectMenu = __nuxt_component_1;
|
|
3618
|
+
const _component_UButton = __nuxt_component_1$1;
|
|
3619
|
+
const _component_UAlert = __nuxt_component_2;
|
|
3620
|
+
const _component_ClientOnly = __nuxt_component_4;
|
|
3621
|
+
const _component_UModal = __nuxt_component_7;
|
|
3622
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "hooks-page" }, _attrs))} data-v-ad1d8ba7>`);
|
|
3623
|
+
_push(ssrRenderComponent(_component_UCard, null, {
|
|
3624
|
+
header: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3625
|
+
if (_push2) {
|
|
3626
|
+
_push2(`<div class="flex items-center justify-between gap-3 flex-wrap" data-v-ad1d8ba7${_scopeId}><div data-v-ad1d8ba7${_scopeId}><h1 class="text-lg font-semibold" data-v-ad1d8ba7${_scopeId}>Hooks</h1><p class="text-xs text-gray-500 mt-1" data-v-ad1d8ba7${_scopeId}>`);
|
|
3627
|
+
if (unref(hooksPath)) {
|
|
3628
|
+
_push2(`<span data-v-ad1d8ba7${_scopeId}>Editing <code data-v-ad1d8ba7${_scopeId}>${ssrInterpolate(unref(hooksPath))}</code></span>`);
|
|
3629
|
+
} else {
|
|
3630
|
+
_push2(`<span class="text-amber-600" data-v-ad1d8ba7${_scopeId}>AIDEV_HOOKS_PATH not configured</span>`);
|
|
3631
|
+
}
|
|
3632
|
+
_push2(`</p></div><div class="flex items-center gap-2 flex-wrap" data-v-ad1d8ba7${_scopeId}>`);
|
|
3633
|
+
_push2(ssrRenderComponent(_component_USelectMenu, {
|
|
3634
|
+
modelValue: unref(selectedSample),
|
|
3635
|
+
"onUpdate:modelValue": [($event) => isRef(selectedSample) ? selectedSample.value = $event : null, onSampleSelect],
|
|
3636
|
+
options: unref(sampleOptions),
|
|
3637
|
+
"option-attribute": "label",
|
|
3638
|
+
placeholder: "Insert sample\u2026",
|
|
3639
|
+
size: "sm",
|
|
3640
|
+
class: "sample-select-menu"
|
|
3641
|
+
}, {
|
|
3642
|
+
option: withCtx(({ option }, _push3, _parent3, _scopeId2) => {
|
|
3643
|
+
if (_push3) {
|
|
3644
|
+
_push3(`<div class="flex flex-col" data-v-ad1d8ba7${_scopeId2}><span class="text-sm" data-v-ad1d8ba7${_scopeId2}>${ssrInterpolate(option.label)}</span><span class="text-xs text-gray-400" data-v-ad1d8ba7${_scopeId2}>${ssrInterpolate(option.hookName)}</span></div>`);
|
|
3645
|
+
} else {
|
|
3646
|
+
return [
|
|
3647
|
+
createVNode("div", { class: "flex flex-col" }, [
|
|
3648
|
+
createVNode("span", { class: "text-sm" }, toDisplayString(option.label), 1),
|
|
3649
|
+
createVNode("span", { class: "text-xs text-gray-400" }, toDisplayString(option.hookName), 1)
|
|
3650
|
+
])
|
|
3651
|
+
];
|
|
3652
|
+
}
|
|
3653
|
+
}),
|
|
3654
|
+
_: 1
|
|
3655
|
+
}, _parent2, _scopeId));
|
|
3656
|
+
_push2(ssrRenderComponent(_component_UButton, {
|
|
3657
|
+
color: "gray",
|
|
3658
|
+
variant: "ghost",
|
|
3659
|
+
size: "sm",
|
|
3660
|
+
loading: unref(loading),
|
|
3661
|
+
disabled: unref(loading),
|
|
3662
|
+
onClick: loadHooks
|
|
3663
|
+
}, {
|
|
3664
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3665
|
+
if (_push3) {
|
|
3666
|
+
_push3(` Refresh `);
|
|
3667
|
+
} else {
|
|
3668
|
+
return [
|
|
3669
|
+
createTextVNode(" Refresh ")
|
|
3670
|
+
];
|
|
3671
|
+
}
|
|
3672
|
+
}),
|
|
3673
|
+
_: 1
|
|
3674
|
+
}, _parent2, _scopeId));
|
|
3675
|
+
_push2(ssrRenderComponent(_component_UButton, {
|
|
3676
|
+
color: "gray",
|
|
3677
|
+
variant: "soft",
|
|
3678
|
+
size: "sm",
|
|
3679
|
+
loading: unref(addingMissing),
|
|
3680
|
+
disabled: unref(addingMissing),
|
|
3681
|
+
onClick: addMissingHooks
|
|
3682
|
+
}, {
|
|
3683
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3684
|
+
if (_push3) {
|
|
3685
|
+
_push3(` Add missing `);
|
|
3686
|
+
} else {
|
|
3687
|
+
return [
|
|
3688
|
+
createTextVNode(" Add missing ")
|
|
3689
|
+
];
|
|
3690
|
+
}
|
|
3691
|
+
}),
|
|
3692
|
+
_: 1
|
|
3693
|
+
}, _parent2, _scopeId));
|
|
3694
|
+
_push2(ssrRenderComponent(_component_UButton, {
|
|
3695
|
+
color: "amber",
|
|
3696
|
+
variant: "soft",
|
|
3697
|
+
size: "sm",
|
|
3698
|
+
loading: unref(regenerating),
|
|
3699
|
+
disabled: unref(regenerating),
|
|
3700
|
+
onClick: regenerate
|
|
3701
|
+
}, {
|
|
3702
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3703
|
+
if (_push3) {
|
|
3704
|
+
_push3(` Regenerate `);
|
|
3705
|
+
} else {
|
|
3706
|
+
return [
|
|
3707
|
+
createTextVNode(" Regenerate ")
|
|
3708
|
+
];
|
|
3709
|
+
}
|
|
3710
|
+
}),
|
|
3711
|
+
_: 1
|
|
3712
|
+
}, _parent2, _scopeId));
|
|
3713
|
+
_push2(ssrRenderComponent(_component_UButton, {
|
|
3714
|
+
color: "primary",
|
|
3715
|
+
size: "sm",
|
|
3716
|
+
loading: unref(saving),
|
|
3717
|
+
disabled: unref(saving),
|
|
3718
|
+
onClick: save
|
|
3719
|
+
}, {
|
|
3720
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3721
|
+
if (_push3) {
|
|
3722
|
+
_push3(` Save `);
|
|
3723
|
+
} else {
|
|
3724
|
+
return [
|
|
3725
|
+
createTextVNode(" Save ")
|
|
3726
|
+
];
|
|
3727
|
+
}
|
|
3728
|
+
}),
|
|
3729
|
+
_: 1
|
|
3730
|
+
}, _parent2, _scopeId));
|
|
3731
|
+
_push2(`</div></div>`);
|
|
3732
|
+
} else {
|
|
3733
|
+
return [
|
|
3734
|
+
createVNode("div", { class: "flex items-center justify-between gap-3 flex-wrap" }, [
|
|
3735
|
+
createVNode("div", null, [
|
|
3736
|
+
createVNode("h1", { class: "text-lg font-semibold" }, "Hooks"),
|
|
3737
|
+
createVNode("p", { class: "text-xs text-gray-500 mt-1" }, [
|
|
3738
|
+
unref(hooksPath) ? (openBlock(), createBlock("span", { key: 0 }, [
|
|
3739
|
+
createTextVNode("Editing "),
|
|
3740
|
+
createVNode("code", null, toDisplayString(unref(hooksPath)), 1)
|
|
3741
|
+
])) : (openBlock(), createBlock("span", {
|
|
3742
|
+
key: 1,
|
|
3743
|
+
class: "text-amber-600"
|
|
3744
|
+
}, "AIDEV_HOOKS_PATH not configured"))
|
|
3745
|
+
])
|
|
3746
|
+
]),
|
|
3747
|
+
createVNode("div", { class: "flex items-center gap-2 flex-wrap" }, [
|
|
3748
|
+
createVNode(_component_USelectMenu, {
|
|
3749
|
+
modelValue: unref(selectedSample),
|
|
3750
|
+
"onUpdate:modelValue": [($event) => isRef(selectedSample) ? selectedSample.value = $event : null, onSampleSelect],
|
|
3751
|
+
options: unref(sampleOptions),
|
|
3752
|
+
"option-attribute": "label",
|
|
3753
|
+
placeholder: "Insert sample\u2026",
|
|
3754
|
+
size: "sm",
|
|
3755
|
+
class: "sample-select-menu"
|
|
3756
|
+
}, {
|
|
3757
|
+
option: withCtx(({ option }) => [
|
|
3758
|
+
createVNode("div", { class: "flex flex-col" }, [
|
|
3759
|
+
createVNode("span", { class: "text-sm" }, toDisplayString(option.label), 1),
|
|
3760
|
+
createVNode("span", { class: "text-xs text-gray-400" }, toDisplayString(option.hookName), 1)
|
|
3761
|
+
])
|
|
3762
|
+
]),
|
|
3763
|
+
_: 1
|
|
3764
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "options"]),
|
|
3765
|
+
createVNode(_component_UButton, {
|
|
3766
|
+
color: "gray",
|
|
3767
|
+
variant: "ghost",
|
|
3768
|
+
size: "sm",
|
|
3769
|
+
loading: unref(loading),
|
|
3770
|
+
disabled: unref(loading),
|
|
3771
|
+
onClick: loadHooks
|
|
3772
|
+
}, {
|
|
3773
|
+
default: withCtx(() => [
|
|
3774
|
+
createTextVNode(" Refresh ")
|
|
3775
|
+
]),
|
|
3776
|
+
_: 1
|
|
3777
|
+
}, 8, ["loading", "disabled"]),
|
|
3778
|
+
createVNode(_component_UButton, {
|
|
3779
|
+
color: "gray",
|
|
3780
|
+
variant: "soft",
|
|
3781
|
+
size: "sm",
|
|
3782
|
+
loading: unref(addingMissing),
|
|
3783
|
+
disabled: unref(addingMissing),
|
|
3784
|
+
onClick: addMissingHooks
|
|
3785
|
+
}, {
|
|
3786
|
+
default: withCtx(() => [
|
|
3787
|
+
createTextVNode(" Add missing ")
|
|
3788
|
+
]),
|
|
3789
|
+
_: 1
|
|
3790
|
+
}, 8, ["loading", "disabled"]),
|
|
3791
|
+
createVNode(_component_UButton, {
|
|
3792
|
+
color: "amber",
|
|
3793
|
+
variant: "soft",
|
|
3794
|
+
size: "sm",
|
|
3795
|
+
loading: unref(regenerating),
|
|
3796
|
+
disabled: unref(regenerating),
|
|
3797
|
+
onClick: regenerate
|
|
3798
|
+
}, {
|
|
3799
|
+
default: withCtx(() => [
|
|
3800
|
+
createTextVNode(" Regenerate ")
|
|
3801
|
+
]),
|
|
3802
|
+
_: 1
|
|
3803
|
+
}, 8, ["loading", "disabled"]),
|
|
3804
|
+
createVNode(_component_UButton, {
|
|
3805
|
+
color: "primary",
|
|
3806
|
+
size: "sm",
|
|
3807
|
+
loading: unref(saving),
|
|
3808
|
+
disabled: unref(saving),
|
|
3809
|
+
onClick: save
|
|
3810
|
+
}, {
|
|
3811
|
+
default: withCtx(() => [
|
|
3812
|
+
createTextVNode(" Save ")
|
|
3813
|
+
]),
|
|
3814
|
+
_: 1
|
|
3815
|
+
}, 8, ["loading", "disabled"])
|
|
3816
|
+
])
|
|
3817
|
+
])
|
|
3818
|
+
];
|
|
3819
|
+
}
|
|
3820
|
+
}),
|
|
3821
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3822
|
+
if (_push2) {
|
|
3823
|
+
if (unref(loadError)) {
|
|
3824
|
+
_push2(ssrRenderComponent(_component_UAlert, {
|
|
3825
|
+
color: "red",
|
|
3826
|
+
variant: "soft",
|
|
3827
|
+
title: unref(loadError),
|
|
3828
|
+
class: "mb-4"
|
|
3829
|
+
}, null, _parent2, _scopeId));
|
|
3830
|
+
} else {
|
|
3831
|
+
_push2(`<!---->`);
|
|
3832
|
+
}
|
|
3833
|
+
if (unref(actionMessage)) {
|
|
3834
|
+
_push2(ssrRenderComponent(_component_UAlert, {
|
|
3835
|
+
color: unref(actionOk) ? "green" : "red",
|
|
3836
|
+
variant: "soft",
|
|
3837
|
+
title: unref(actionOk) ? "Done" : "Error",
|
|
3838
|
+
description: unref(actionMessage),
|
|
3839
|
+
class: "mb-4"
|
|
3840
|
+
}, null, _parent2, _scopeId));
|
|
3841
|
+
} else {
|
|
3842
|
+
_push2(`<!---->`);
|
|
3843
|
+
}
|
|
3844
|
+
_push2(ssrRenderComponent(_component_ClientOnly, null, {
|
|
3845
|
+
fallback: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3846
|
+
if (_push3) {
|
|
3847
|
+
_push3(`<div class="editor-placeholder" data-v-ad1d8ba7${_scopeId2}>Loading editor\u2026</div>`);
|
|
3848
|
+
} else {
|
|
3849
|
+
return [
|
|
3850
|
+
createVNode("div", { class: "editor-placeholder" }, "Loading editor\u2026")
|
|
3851
|
+
];
|
|
3852
|
+
}
|
|
3853
|
+
})
|
|
3854
|
+
}, _parent2, _scopeId));
|
|
3855
|
+
} else {
|
|
3856
|
+
return [
|
|
3857
|
+
unref(loadError) ? (openBlock(), createBlock(_component_UAlert, {
|
|
3858
|
+
key: 0,
|
|
3859
|
+
color: "red",
|
|
3860
|
+
variant: "soft",
|
|
3861
|
+
title: unref(loadError),
|
|
3862
|
+
class: "mb-4"
|
|
3863
|
+
}, null, 8, ["title"])) : createCommentVNode("", true),
|
|
3864
|
+
unref(actionMessage) ? (openBlock(), createBlock(_component_UAlert, {
|
|
3865
|
+
key: 1,
|
|
3866
|
+
color: unref(actionOk) ? "green" : "red",
|
|
3867
|
+
variant: "soft",
|
|
3868
|
+
title: unref(actionOk) ? "Done" : "Error",
|
|
3869
|
+
description: unref(actionMessage),
|
|
3870
|
+
class: "mb-4"
|
|
3871
|
+
}, null, 8, ["color", "title", "description"])) : createCommentVNode("", true),
|
|
3872
|
+
createVNode(_component_ClientOnly, null, {
|
|
3873
|
+
fallback: withCtx(() => [
|
|
3874
|
+
createVNode("div", { class: "editor-placeholder" }, "Loading editor\u2026")
|
|
3875
|
+
]),
|
|
3876
|
+
default: withCtx(() => [
|
|
3877
|
+
createVNode("div", {
|
|
3878
|
+
ref_key: "editorContainer",
|
|
3879
|
+
ref: editorContainer,
|
|
3880
|
+
class: "editor-container"
|
|
3881
|
+
}, null, 512)
|
|
3882
|
+
]),
|
|
3883
|
+
_: 1
|
|
3884
|
+
})
|
|
3885
|
+
];
|
|
3886
|
+
}
|
|
3887
|
+
}),
|
|
3888
|
+
_: 1
|
|
3889
|
+
}, _parent));
|
|
3890
|
+
_push(ssrRenderComponent(_component_UCard, { class: "mt-4" }, {
|
|
3891
|
+
header: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3892
|
+
if (_push2) {
|
|
3893
|
+
_push2(`<h2 class="text-base font-semibold" data-v-ad1d8ba7${_scopeId}>Test hooks</h2>`);
|
|
3894
|
+
} else {
|
|
3895
|
+
return [
|
|
3896
|
+
createVNode("h2", { class: "text-base font-semibold" }, "Test hooks")
|
|
3897
|
+
];
|
|
3898
|
+
}
|
|
3899
|
+
}),
|
|
3900
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3901
|
+
if (_push2) {
|
|
3902
|
+
_push2(`<!--[-->`);
|
|
3903
|
+
ssrRenderList(HOOK_NAMES, (hookName) => {
|
|
3904
|
+
_push2(`<div class="mb-2" data-v-ad1d8ba7${_scopeId}><details${ssrRenderAttr("id", `hook-panel-${hookName}`)} class="hook-panel" data-v-ad1d8ba7${_scopeId}><summary class="hook-panel-summary" data-v-ad1d8ba7${_scopeId}><code data-v-ad1d8ba7${_scopeId}>${ssrInterpolate(hookName)}</code></summary><div class="hook-panel-body" data-v-ad1d8ba7${_scopeId}><label class="block text-xs font-medium text-gray-500 mb-1" data-v-ad1d8ba7${_scopeId}>Mock data (JSON)</label><textarea class="mock-json" rows="5" spellcheck="false" data-v-ad1d8ba7${_scopeId}>${ssrInterpolate(unref(mockDataMap)[hookName])}</textarea><div class="mt-2" data-v-ad1d8ba7${_scopeId}>`);
|
|
3905
|
+
_push2(ssrRenderComponent(_component_UButton, {
|
|
3906
|
+
color: "primary",
|
|
3907
|
+
variant: "soft",
|
|
3908
|
+
size: "sm",
|
|
3909
|
+
loading: unref(executingHook) === hookName,
|
|
3910
|
+
disabled: unref(executingHook) !== null,
|
|
3911
|
+
onClick: ($event) => executeHook(hookName)
|
|
3912
|
+
}, {
|
|
3913
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3914
|
+
if (_push3) {
|
|
3915
|
+
_push3(` Execute now `);
|
|
3916
|
+
} else {
|
|
3917
|
+
return [
|
|
3918
|
+
createTextVNode(" Execute now ")
|
|
3919
|
+
];
|
|
3920
|
+
}
|
|
3921
|
+
}),
|
|
3922
|
+
_: 2
|
|
3923
|
+
}, _parent2, _scopeId));
|
|
3924
|
+
_push2(`</div></div></details></div>`);
|
|
3925
|
+
});
|
|
3926
|
+
_push2(`<!--]-->`);
|
|
3927
|
+
} else {
|
|
3928
|
+
return [
|
|
3929
|
+
(openBlock(), createBlock(Fragment, null, renderList(HOOK_NAMES, (hookName) => {
|
|
3930
|
+
return createVNode("div", {
|
|
3931
|
+
key: hookName,
|
|
3932
|
+
class: "mb-2"
|
|
3933
|
+
}, [
|
|
3934
|
+
createVNode("details", {
|
|
3935
|
+
id: `hook-panel-${hookName}`,
|
|
3936
|
+
class: "hook-panel"
|
|
3937
|
+
}, [
|
|
3938
|
+
createVNode("summary", { class: "hook-panel-summary" }, [
|
|
3939
|
+
createVNode("code", null, toDisplayString(hookName), 1)
|
|
3940
|
+
]),
|
|
3941
|
+
createVNode("div", { class: "hook-panel-body" }, [
|
|
3942
|
+
createVNode("label", { class: "block text-xs font-medium text-gray-500 mb-1" }, "Mock data (JSON)"),
|
|
3943
|
+
withDirectives(createVNode("textarea", {
|
|
3944
|
+
"onUpdate:modelValue": ($event) => unref(mockDataMap)[hookName] = $event,
|
|
3945
|
+
class: "mock-json",
|
|
3946
|
+
rows: "5",
|
|
3947
|
+
spellcheck: "false"
|
|
3948
|
+
}, null, 8, ["onUpdate:modelValue"]), [
|
|
3949
|
+
[vModelText, unref(mockDataMap)[hookName]]
|
|
3950
|
+
]),
|
|
3951
|
+
createVNode("div", { class: "mt-2" }, [
|
|
3952
|
+
createVNode(_component_UButton, {
|
|
3953
|
+
color: "primary",
|
|
3954
|
+
variant: "soft",
|
|
3955
|
+
size: "sm",
|
|
3956
|
+
loading: unref(executingHook) === hookName,
|
|
3957
|
+
disabled: unref(executingHook) !== null,
|
|
3958
|
+
onClick: ($event) => executeHook(hookName)
|
|
3959
|
+
}, {
|
|
3960
|
+
default: withCtx(() => [
|
|
3961
|
+
createTextVNode(" Execute now ")
|
|
3962
|
+
]),
|
|
3963
|
+
_: 1
|
|
3964
|
+
}, 8, ["loading", "disabled", "onClick"])
|
|
3965
|
+
])
|
|
3966
|
+
])
|
|
3967
|
+
], 8, ["id"])
|
|
3968
|
+
]);
|
|
3969
|
+
}), 64))
|
|
3970
|
+
];
|
|
3971
|
+
}
|
|
3972
|
+
}),
|
|
3973
|
+
_: 1
|
|
3974
|
+
}, _parent));
|
|
3975
|
+
_push(ssrRenderComponent(_component_UModal, {
|
|
3976
|
+
modelValue: unref(showModal),
|
|
3977
|
+
"onUpdate:modelValue": ($event) => isRef(showModal) ? showModal.value = $event : null
|
|
3978
|
+
}, {
|
|
3979
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3980
|
+
if (_push2) {
|
|
3981
|
+
_push2(ssrRenderComponent(_component_UCard, { ui: { ring: "", divide: "divide-y divide-gray-100 dark:divide-gray-800" } }, {
|
|
3982
|
+
header: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
3983
|
+
if (_push3) {
|
|
3984
|
+
_push3(`<div class="flex items-center justify-between" data-v-ad1d8ba7${_scopeId2}><h3 class="text-sm font-semibold" data-v-ad1d8ba7${_scopeId2}>${ssrInterpolate(unref(modalTitle))}</h3>`);
|
|
3985
|
+
_push3(ssrRenderComponent(_component_UButton, {
|
|
3986
|
+
color: "gray",
|
|
3987
|
+
variant: "ghost",
|
|
3988
|
+
size: "xs",
|
|
3989
|
+
onClick: ($event) => showModal.value = false
|
|
3990
|
+
}, {
|
|
3991
|
+
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
3992
|
+
if (_push4) {
|
|
3993
|
+
_push4(`\u2715`);
|
|
3994
|
+
} else {
|
|
3995
|
+
return [
|
|
3996
|
+
createTextVNode("\u2715")
|
|
3997
|
+
];
|
|
3998
|
+
}
|
|
3999
|
+
}),
|
|
4000
|
+
_: 1
|
|
4001
|
+
}, _parent3, _scopeId2));
|
|
4002
|
+
_push3(`</div>`);
|
|
4003
|
+
} else {
|
|
4004
|
+
return [
|
|
4005
|
+
createVNode("div", { class: "flex items-center justify-between" }, [
|
|
4006
|
+
createVNode("h3", { class: "text-sm font-semibold" }, toDisplayString(unref(modalTitle)), 1),
|
|
4007
|
+
createVNode(_component_UButton, {
|
|
4008
|
+
color: "gray",
|
|
4009
|
+
variant: "ghost",
|
|
4010
|
+
size: "xs",
|
|
4011
|
+
onClick: ($event) => showModal.value = false
|
|
4012
|
+
}, {
|
|
4013
|
+
default: withCtx(() => [
|
|
4014
|
+
createTextVNode("\u2715")
|
|
4015
|
+
]),
|
|
4016
|
+
_: 1
|
|
4017
|
+
}, 8, ["onClick"])
|
|
4018
|
+
])
|
|
4019
|
+
];
|
|
4020
|
+
}
|
|
4021
|
+
}),
|
|
4022
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
4023
|
+
if (_push3) {
|
|
4024
|
+
if (unref(modalLoading)) {
|
|
4025
|
+
_push3(`<div class="modal-loading" data-v-ad1d8ba7${_scopeId2}><div class="modal-spinner" aria-hidden="true" data-v-ad1d8ba7${_scopeId2}></div><p class="text-sm text-gray-500" data-v-ad1d8ba7${_scopeId2}>Executing hook\u2026</p></div>`);
|
|
4026
|
+
} else {
|
|
4027
|
+
_push3(`<div class="space-y-3" data-v-ad1d8ba7${_scopeId2}>`);
|
|
4028
|
+
if (!unref(modalOk)) {
|
|
4029
|
+
_push3(ssrRenderComponent(_component_UAlert, {
|
|
4030
|
+
color: "red",
|
|
4031
|
+
variant: "soft",
|
|
4032
|
+
title: "Hook failed",
|
|
4033
|
+
description: unref(modalError) || void 0
|
|
4034
|
+
}, null, _parent3, _scopeId2));
|
|
4035
|
+
} else {
|
|
4036
|
+
_push3(ssrRenderComponent(_component_UAlert, {
|
|
4037
|
+
color: "green",
|
|
4038
|
+
variant: "soft",
|
|
4039
|
+
title: "Hook executed successfully"
|
|
4040
|
+
}, null, _parent3, _scopeId2));
|
|
4041
|
+
}
|
|
4042
|
+
if (unref(modalLogs).length) {
|
|
4043
|
+
_push3(`<div class="log-output" data-v-ad1d8ba7${_scopeId2}><!--[-->`);
|
|
4044
|
+
ssrRenderList(unref(modalLogs), (line, i2) => {
|
|
4045
|
+
_push3(`<div class="log-line" data-v-ad1d8ba7${_scopeId2}>${ssrInterpolate(line)}</div>`);
|
|
4046
|
+
});
|
|
4047
|
+
_push3(`<!--]--></div>`);
|
|
4048
|
+
} else {
|
|
4049
|
+
_push3(`<p class="text-sm text-gray-500 italic" data-v-ad1d8ba7${_scopeId2}>No log output.</p>`);
|
|
4050
|
+
}
|
|
4051
|
+
_push3(`</div>`);
|
|
4052
|
+
}
|
|
4053
|
+
} else {
|
|
4054
|
+
return [
|
|
4055
|
+
unref(modalLoading) ? (openBlock(), createBlock("div", {
|
|
4056
|
+
key: 0,
|
|
4057
|
+
class: "modal-loading"
|
|
4058
|
+
}, [
|
|
4059
|
+
createVNode("div", {
|
|
4060
|
+
class: "modal-spinner",
|
|
4061
|
+
"aria-hidden": "true"
|
|
4062
|
+
}),
|
|
4063
|
+
createVNode("p", { class: "text-sm text-gray-500" }, "Executing hook\u2026")
|
|
4064
|
+
])) : (openBlock(), createBlock("div", {
|
|
4065
|
+
key: 1,
|
|
4066
|
+
class: "space-y-3"
|
|
4067
|
+
}, [
|
|
4068
|
+
!unref(modalOk) ? (openBlock(), createBlock(_component_UAlert, {
|
|
4069
|
+
key: 0,
|
|
4070
|
+
color: "red",
|
|
4071
|
+
variant: "soft",
|
|
4072
|
+
title: "Hook failed",
|
|
4073
|
+
description: unref(modalError) || void 0
|
|
4074
|
+
}, null, 8, ["description"])) : (openBlock(), createBlock(_component_UAlert, {
|
|
4075
|
+
key: 1,
|
|
4076
|
+
color: "green",
|
|
4077
|
+
variant: "soft",
|
|
4078
|
+
title: "Hook executed successfully"
|
|
4079
|
+
})),
|
|
4080
|
+
unref(modalLogs).length ? (openBlock(), createBlock("div", {
|
|
4081
|
+
key: 2,
|
|
4082
|
+
class: "log-output"
|
|
4083
|
+
}, [
|
|
4084
|
+
(openBlock(true), createBlock(Fragment, null, renderList(unref(modalLogs), (line, i2) => {
|
|
4085
|
+
return openBlock(), createBlock("div", {
|
|
4086
|
+
key: i2,
|
|
4087
|
+
class: "log-line"
|
|
4088
|
+
}, toDisplayString(line), 1);
|
|
4089
|
+
}), 128))
|
|
4090
|
+
])) : (openBlock(), createBlock("p", {
|
|
4091
|
+
key: 3,
|
|
4092
|
+
class: "text-sm text-gray-500 italic"
|
|
4093
|
+
}, "No log output."))
|
|
4094
|
+
]))
|
|
4095
|
+
];
|
|
4096
|
+
}
|
|
4097
|
+
}),
|
|
4098
|
+
_: 1
|
|
4099
|
+
}, _parent2, _scopeId));
|
|
4100
|
+
} else {
|
|
4101
|
+
return [
|
|
4102
|
+
createVNode(_component_UCard, { ui: { ring: "", divide: "divide-y divide-gray-100 dark:divide-gray-800" } }, {
|
|
4103
|
+
header: withCtx(() => [
|
|
4104
|
+
createVNode("div", { class: "flex items-center justify-between" }, [
|
|
4105
|
+
createVNode("h3", { class: "text-sm font-semibold" }, toDisplayString(unref(modalTitle)), 1),
|
|
4106
|
+
createVNode(_component_UButton, {
|
|
4107
|
+
color: "gray",
|
|
4108
|
+
variant: "ghost",
|
|
4109
|
+
size: "xs",
|
|
4110
|
+
onClick: ($event) => showModal.value = false
|
|
4111
|
+
}, {
|
|
4112
|
+
default: withCtx(() => [
|
|
4113
|
+
createTextVNode("\u2715")
|
|
4114
|
+
]),
|
|
4115
|
+
_: 1
|
|
4116
|
+
}, 8, ["onClick"])
|
|
4117
|
+
])
|
|
4118
|
+
]),
|
|
4119
|
+
default: withCtx(() => [
|
|
4120
|
+
unref(modalLoading) ? (openBlock(), createBlock("div", {
|
|
4121
|
+
key: 0,
|
|
4122
|
+
class: "modal-loading"
|
|
4123
|
+
}, [
|
|
4124
|
+
createVNode("div", {
|
|
4125
|
+
class: "modal-spinner",
|
|
4126
|
+
"aria-hidden": "true"
|
|
4127
|
+
}),
|
|
4128
|
+
createVNode("p", { class: "text-sm text-gray-500" }, "Executing hook\u2026")
|
|
4129
|
+
])) : (openBlock(), createBlock("div", {
|
|
4130
|
+
key: 1,
|
|
4131
|
+
class: "space-y-3"
|
|
4132
|
+
}, [
|
|
4133
|
+
!unref(modalOk) ? (openBlock(), createBlock(_component_UAlert, {
|
|
4134
|
+
key: 0,
|
|
4135
|
+
color: "red",
|
|
4136
|
+
variant: "soft",
|
|
4137
|
+
title: "Hook failed",
|
|
4138
|
+
description: unref(modalError) || void 0
|
|
4139
|
+
}, null, 8, ["description"])) : (openBlock(), createBlock(_component_UAlert, {
|
|
4140
|
+
key: 1,
|
|
4141
|
+
color: "green",
|
|
4142
|
+
variant: "soft",
|
|
4143
|
+
title: "Hook executed successfully"
|
|
4144
|
+
})),
|
|
4145
|
+
unref(modalLogs).length ? (openBlock(), createBlock("div", {
|
|
4146
|
+
key: 2,
|
|
4147
|
+
class: "log-output"
|
|
4148
|
+
}, [
|
|
4149
|
+
(openBlock(true), createBlock(Fragment, null, renderList(unref(modalLogs), (line, i2) => {
|
|
4150
|
+
return openBlock(), createBlock("div", {
|
|
4151
|
+
key: i2,
|
|
4152
|
+
class: "log-line"
|
|
4153
|
+
}, toDisplayString(line), 1);
|
|
4154
|
+
}), 128))
|
|
4155
|
+
])) : (openBlock(), createBlock("p", {
|
|
4156
|
+
key: 3,
|
|
4157
|
+
class: "text-sm text-gray-500 italic"
|
|
4158
|
+
}, "No log output."))
|
|
4159
|
+
]))
|
|
4160
|
+
]),
|
|
4161
|
+
_: 1
|
|
4162
|
+
})
|
|
4163
|
+
];
|
|
4164
|
+
}
|
|
4165
|
+
}),
|
|
4166
|
+
_: 1
|
|
4167
|
+
}, _parent));
|
|
4168
|
+
_push(`</div>`);
|
|
4169
|
+
};
|
|
4170
|
+
}
|
|
4171
|
+
});
|
|
4172
|
+
const _sfc_setup = _sfc_main.setup;
|
|
4173
|
+
_sfc_main.setup = (props, ctx) => {
|
|
4174
|
+
const ssrContext = useSSRContext();
|
|
4175
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/hooks.vue");
|
|
4176
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
4177
|
+
};
|
|
4178
|
+
const hooks = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ad1d8ba7"]]);
|
|
4179
|
+
|
|
4180
|
+
export { hooks as default };
|
|
4181
|
+
//# sourceMappingURL=hooks-k2ZmlVpA.mjs.map
|