@deck9/ui 0.12.13 → 0.13.2
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/dist/Button/Button.vue.d.ts +47 -128
- package/dist/Checkbox/Checkbox.vue.d.ts +32 -42
- package/dist/Icon/Icon.vue.d.ts +26 -21
- package/dist/Input/Input.vue.d.ts +56 -2
- package/dist/Label/Label.vue.d.ts +14 -26
- package/dist/Menu/MenuContainer.vue.d.ts +39 -154
- package/dist/Menu/MenuLink.vue.d.ts +21 -74
- package/dist/Select/Select.vue.d.ts +56 -2
- package/dist/Skeleton/Skeleton.vue.d.ts +36 -55
- package/dist/Spinner/Spinner.vue.d.ts +2 -25
- package/dist/SplitButton/SplitButton.vue.d.ts +52 -0
- package/dist/SplitButton/index.d.ts +1 -0
- package/dist/Switch/Switch.vue.d.ts +47 -129
- package/dist/Textarea/Textarea.vue.d.ts +47 -2
- package/dist/index.d.ts +1 -0
- package/dist/src/ui.mjs +3894 -0
- package/dist/src/ui.umd.js +9 -0
- package/dist/utils/useFormClasses.d.ts +1 -1
- package/package.json +39 -27
- package/tailwind.config.js +0 -5
- package/dist/Icon/custom/numeric-input.d.ts +0 -15
- package/dist/env.d.ts +0 -8
- package/dist/src/index.es.js +0 -2864
- package/dist/src/index.umd.js +0 -5
- package/dist/types.d.ts +0 -7
package/dist/src/index.es.js
DELETED
|
@@ -1,2864 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a2, b2) => {
|
|
9
|
-
for (var prop in b2 || (b2 = {}))
|
|
10
|
-
if (__hasOwnProp.call(b2, prop))
|
|
11
|
-
__defNormalProp(a2, prop, b2[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b2)) {
|
|
14
|
-
if (__propIsEnum.call(b2, prop))
|
|
15
|
-
__defNormalProp(a2, prop, b2[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a2;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import { defineComponent, computed as computed$2, unref, openBlock, createBlock, mergeProps, createCommentVNode, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, getCurrentInstance, onMounted, nextTick, ref, watch, Fragment, withDirectives, vModelText, normalizeStyle, cloneVNode, h as h$1, inject, provide, watchEffect, onUnmounted, toRaw as toRaw$1, withCtx, renderSlot, Teleport, Transition, normalizeProps, guardReactiveProps, resolveDynamicComponent, isRef, renderList, createTextVNode } from "vue";
|
|
33
|
-
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
|
34
|
-
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
35
|
-
import * as fasIcons from "@fortawesome/free-solid-svg-icons";
|
|
36
|
-
var faLinkedin = {
|
|
37
|
-
prefix: "fab",
|
|
38
|
-
iconName: "linkedin",
|
|
39
|
-
icon: [448, 512, [], "f08c", "M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"]
|
|
40
|
-
};
|
|
41
|
-
var faInstagram = {
|
|
42
|
-
prefix: "fab",
|
|
43
|
-
iconName: "instagram",
|
|
44
|
-
icon: [448, 512, [], "f16d", "M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"]
|
|
45
|
-
};
|
|
46
|
-
var faFacebook = {
|
|
47
|
-
prefix: "fab",
|
|
48
|
-
iconName: "facebook",
|
|
49
|
-
icon: [512, 512, [62e3], "f09a", "M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"]
|
|
50
|
-
};
|
|
51
|
-
var faGithub = {
|
|
52
|
-
prefix: "fab",
|
|
53
|
-
iconName: "github",
|
|
54
|
-
icon: [496, 512, [], "f09b", "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"]
|
|
55
|
-
};
|
|
56
|
-
var faTwitter = {
|
|
57
|
-
prefix: "fab",
|
|
58
|
-
iconName: "twitter",
|
|
59
|
-
icon: [512, 512, [], "f099", "M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]
|
|
60
|
-
};
|
|
61
|
-
var prefix = "fas";
|
|
62
|
-
var iconName = "numeric-input";
|
|
63
|
-
var width = 512;
|
|
64
|
-
var height = 512;
|
|
65
|
-
var aliases = [];
|
|
66
|
-
var unicode = "";
|
|
67
|
-
var svgPathData = "m409.445 111 2.112.004c34.066.146 46.74 3.848 59.517 10.681 13.037 6.973 23.268 17.204 30.24 30.241l.415.782c6.705 12.782 10.271 25.9 10.271 60.847v72.002c-.15 34.066-3.852 46.74-10.685 59.517-6.973 13.037-17.204 23.268-30.241 30.24l-.782.415C457.51 382.434 444.392 386 409.445 386h-306.89l-2.112-.004c-34.066-.146-46.74-3.848-59.517-10.681-13.037-6.973-23.268-17.204-30.24-30.241l-.415-.782C3.566 331.51 0 318.392 0 283.445v-69.89c0-35.66 3.713-48.592 10.685-61.629 6.973-13.037 17.204-23.268 30.241-30.24l.782-.415C54.49 114.566 67.608 111 102.555 111h306.89Zm.806 36H102.555l-2.387.005c-22.69.089-31.789 1.488-39.667 5.128l-.523.246c-.696.332-1.385.683-2.074 1.052-6.764 3.617-11.856 8.71-15.473 15.473l-.282.533c-4.492 8.62-6.116 17.401-6.148 43.312v71.502l.012 3.09c.161 24.044 1.9 32.308 6.418 40.755 3.617 6.764 8.71 11.856 15.473 15.473l.533.282c8.62 4.492 17.401 6.116 43.312 6.149h307.696c27.078 0 35.763-1.677 44.651-6.43 6.764-3.618 11.856-8.71 15.473-15.474l.282-.533c4.492-8.62 6.116-17.401 6.149-43.312v-70.696c0-27.078-1.677-35.763-6.43-44.651-3.618-6.764-8.71-11.856-15.474-15.473l-.533-.282c-8.62-4.492-17.401-6.116-43.312-6.149Zm-164.715 19c11.682 0 22.013 1.976 30.994 5.929 8.98 3.952 16.005 9.38 21.074 16.284 5.07 6.904 7.578 14.797 7.527 23.677.103 8.829-2.92 16.066-9.07 21.713-6.15 5.646-13.935 8.983-23.353 10.01v1.231c12.764 1.386 22.362 5.274 28.794 11.665 6.433 6.39 9.598 14.411 9.496 24.061.051 9.24-2.715 17.427-8.299 24.562-5.584 7.135-13.33 12.73-23.236 16.785-9.907 4.055-21.319 6.083-34.236 6.083-12.454 0-23.506-2.143-33.156-6.43-9.65-4.285-17.227-10.201-22.734-17.747-5.506-7.545-8.286-16.22-8.337-26.025h43.23c.051 3.029.99 5.737 2.817 8.124 1.827 2.386 4.336 4.247 7.527 5.582 3.19 1.334 6.845 2.002 10.962 2.002 3.962 0 7.462-.706 10.498-2.118 3.037-1.411 5.404-3.375 7.102-5.89 1.699-2.515 2.522-5.39 2.47-8.623.052-3.183-.913-6.006-2.894-8.47-1.982-2.464-4.748-4.389-8.299-5.775-3.55-1.386-7.642-2.079-12.274-2.079h-16.057v-29.566h16.057c4.271 0 8.041-.693 11.31-2.08 3.267-1.385 5.815-3.31 7.642-5.774s2.714-5.287 2.663-8.47c.051-3.08-.695-5.8-2.239-8.161-1.544-2.361-3.692-4.21-6.446-5.544-2.753-1.334-5.93-2.002-9.533-2.002-3.912 0-7.398.693-10.46 2.08-3.063 1.385-5.468 3.31-7.218 5.774s-2.65 5.287-2.702 8.47h-41.068c.051-9.65 2.715-18.172 7.99-25.563 5.275-7.392 12.518-13.192 21.73-17.401 9.212-4.21 19.788-6.314 31.728-6.314Zm-133.074 0c12.615 0 23.55 2.017 32.807 6.05 9.257 4.033 16.41 9.698 21.462 16.994 5.051 7.296 7.577 15.851 7.577 25.665 0 6.063-1.257 12.087-3.77 18.073-2.512 5.986-7.025 12.601-13.538 19.846-6.513 7.245-15.77 15.877-27.77 25.896l-14.768 12.331v.925H176V326H55.077v-30.829l58.77-48.709c3.897-3.237 7.243-6.28 10.038-9.133 2.794-2.851 4.948-5.793 6.461-8.824 1.513-3.032 2.27-6.397 2.27-10.097 0-4.059-.86-7.527-2.578-10.404-1.717-2.877-4.09-5.1-7.115-6.667-3.026-1.567-6.513-2.35-10.461-2.35-3.95 0-7.424.796-10.424 2.389-3 1.593-5.32 3.93-6.961 7.013-1.641 3.083-2.462 6.834-2.462 11.253H52c0-11.099 2.487-20.655 7.462-28.67 4.974-8.016 12-14.182 21.076-18.498 9.077-4.316 19.718-6.474 31.924-6.474Z";
|
|
68
|
-
const definition = {
|
|
69
|
-
prefix,
|
|
70
|
-
iconName,
|
|
71
|
-
icon: [width, height, aliases, unicode, svgPathData]
|
|
72
|
-
};
|
|
73
|
-
var numericInput = {
|
|
74
|
-
definition,
|
|
75
|
-
faAlignJustify: definition,
|
|
76
|
-
prefix,
|
|
77
|
-
iconName,
|
|
78
|
-
width,
|
|
79
|
-
height,
|
|
80
|
-
ligatures: aliases,
|
|
81
|
-
unicode,
|
|
82
|
-
svgPathData,
|
|
83
|
-
aliases
|
|
84
|
-
};
|
|
85
|
-
library.add(fasIcons.faArrowUp19, fasIcons.faAt, fasIcons.faBold, fasIcons.faBolt, fasIcons.faCalendar, fasIcons.faChartPie, fasIcons.faCheck, fasIcons.faCheckCircle, fasIcons.faChevronDown, fasIcons.faChevronLeft, fasIcons.faChevronRight, fasIcons.faChevronUp, fasIcons.faCircleCheck, fasIcons.faCircleNotch, fasIcons.faClipboard, fasIcons.faCloudDownload, fasIcons.faCloudUpload, fasIcons.faCog, fasIcons.faCrown, fasIcons.faDoorOpen, fasIcons.faDotCircle, fasIcons.faEllipsis, fasIcons.faEllipsisVertical, fasIcons.faEnvelope, fasIcons.faExclamationTriangle, fasIcons.faExternalLink, fasIcons.faEyeDropper, fasIcons.faFileLines, fasIcons.faFileUpload, fasIcons.faFilter, fasIcons.faFingerprint, fasIcons.faGlobe, fasIcons.faGripHorizontal, fasIcons.faGripVertical, fasIcons.faHandPointRight, fasIcons.faHashtag, fasIcons.faHeart, fasIcons.faInfoCircle, fasIcons.faItalic, fasIcons.faLink, fasIcons.faLock, fasIcons.faLockOpen, fasIcons.faMedal, fasIcons.faMessage, fasIcons.faPencilAlt, fasIcons.faPenToSquare, fasIcons.faPhone, fasIcons.faPlayCircle, fasIcons.faPlus, fasIcons.faPlusCircle, fasIcons.faPoo, fasIcons.faPuzzlePiece, fasIcons.faReply, fasIcons.faReplyAll, fasIcons.faRobot, fasIcons.faSave, fasIcons.faShield, fasIcons.faSignal, fasIcons.faSignature, fasIcons.faSquareCheck, fasIcons.faStar, fasIcons.faTimes, fasIcons.faTrash, fasIcons.faTree, fasIcons.faTrophy, fasIcons.faTurnDown, fasIcons.faUpload, fasIcons.faUser, fasIcons.faUserShield, faTwitter, faInstagram, faGithub, faLinkedin, faFacebook, numericInput.definition);
|
|
86
|
-
var icons = [...Object.keys(library.definitions.fas)].sort();
|
|
87
|
-
const brands = [...Object.keys(library.definitions.fab)].sort();
|
|
88
|
-
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
89
|
-
__name: "Icon",
|
|
90
|
-
props: {
|
|
91
|
-
name: { default: "user" }
|
|
92
|
-
},
|
|
93
|
-
setup(__props) {
|
|
94
|
-
const props = __props;
|
|
95
|
-
const iconBag = computed$2(() => {
|
|
96
|
-
if (brands.includes(props.name)) {
|
|
97
|
-
return "fab";
|
|
98
|
-
}
|
|
99
|
-
return "fas";
|
|
100
|
-
});
|
|
101
|
-
const isIconAvailable = computed$2(() => {
|
|
102
|
-
if (icons.includes(props.name) || brands.includes(props.name)) {
|
|
103
|
-
return true;
|
|
104
|
-
} else {
|
|
105
|
-
console.warn("could not load icon, because it is not available", props.name);
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return (_ctx, _cache) => {
|
|
110
|
-
return unref(isIconAvailable) ? (openBlock(), createBlock(unref(FontAwesomeIcon), mergeProps({
|
|
111
|
-
key: 0,
|
|
112
|
-
icon: [unref(iconBag), __props.name]
|
|
113
|
-
}, _ctx.$attrs), null, 16, ["icon"])) : createCommentVNode("", true);
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
const _hoisted_1$8 = ["aria-label", "tabindex"];
|
|
118
|
-
const _hoisted_2$6 = {
|
|
119
|
-
key: 0,
|
|
120
|
-
class: "absolute inset-0 flex items-center justify-center"
|
|
121
|
-
};
|
|
122
|
-
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
123
|
-
__name: "Button",
|
|
124
|
-
props: {
|
|
125
|
-
label: null,
|
|
126
|
-
size: { default: "medium" },
|
|
127
|
-
color: { default: "primary" },
|
|
128
|
-
isLoading: { type: Boolean, default: false },
|
|
129
|
-
isDisabled: { type: Boolean, default: false },
|
|
130
|
-
icon: null,
|
|
131
|
-
iconPosition: { default: "right" }
|
|
132
|
-
},
|
|
133
|
-
emits: ["onClick"],
|
|
134
|
-
setup(__props, { emit }) {
|
|
135
|
-
const props = __props;
|
|
136
|
-
const buttonClasses = computed$2(() => {
|
|
137
|
-
const colors = {
|
|
138
|
-
"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": props.color === "primary",
|
|
139
|
-
"text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": props.color === "light",
|
|
140
|
-
"text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": props.color === "dark",
|
|
141
|
-
"text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": props.color === "danger"
|
|
142
|
-
};
|
|
143
|
-
const disabledClasses = {
|
|
144
|
-
"pointer-events-none opacity-75 cursor-not-allowed": props.isDisabled
|
|
145
|
-
};
|
|
146
|
-
const sizes = {
|
|
147
|
-
"px-4 py-1 text-xs leading-5 mono-100 rounded-lg": props.size === "small",
|
|
148
|
-
"px-5 py-2 text-sm leading-4 font-medium rounded-lg": props.size === "medium",
|
|
149
|
-
"px-8 py-3 text-base leading-6 font-medium rounded-lg": props.size === "large"
|
|
150
|
-
};
|
|
151
|
-
return __spreadValues(__spreadValues(__spreadValues({}, colors), disabledClasses), sizes);
|
|
152
|
-
});
|
|
153
|
-
const iconClasses = computed$2(() => {
|
|
154
|
-
const iconLeft = {
|
|
155
|
-
"mr-2 -ml-1": ["small", "medium"].includes(props.size) && props.iconPosition === "left",
|
|
156
|
-
"mr-4 -ml-2": ["large"].includes(props.size) && props.iconPosition === "left"
|
|
157
|
-
};
|
|
158
|
-
const iconRight = {
|
|
159
|
-
"ml-3 -mr-1": ["small", "medium"].includes(props.size) && props.iconPosition === "right",
|
|
160
|
-
"ml-3 -mr-3": ["large"].includes(props.size) && props.iconPosition === "right"
|
|
161
|
-
};
|
|
162
|
-
const colors = {
|
|
163
|
-
"text-white": props.color === "primary",
|
|
164
|
-
"text-blue-600": props.color === "light",
|
|
165
|
-
"text-grey-50": props.color === "dark"
|
|
166
|
-
};
|
|
167
|
-
return __spreadValues(__spreadValues(__spreadValues({}, iconLeft), iconRight), colors);
|
|
168
|
-
});
|
|
169
|
-
function onClick() {
|
|
170
|
-
if (props.isDisabled) {
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
emit("onClick");
|
|
174
|
-
}
|
|
175
|
-
return (_ctx, _cache) => {
|
|
176
|
-
return openBlock(), createElementBlock("button", {
|
|
177
|
-
class: normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", unref(buttonClasses)]),
|
|
178
|
-
type: "button",
|
|
179
|
-
"aria-label": __props.label,
|
|
180
|
-
tabindex: __props.isDisabled ? "-1" : void 0,
|
|
181
|
-
onClick
|
|
182
|
-
}, [
|
|
183
|
-
createElementVNode("div", {
|
|
184
|
-
class: normalizeClass(!__props.isLoading || "invisible")
|
|
185
|
-
}, [
|
|
186
|
-
__props.icon && __props.iconPosition === "left" ? (openBlock(), createBlock(_sfc_main$b, {
|
|
187
|
-
key: 0,
|
|
188
|
-
name: __props.icon,
|
|
189
|
-
class: normalizeClass(unref(iconClasses))
|
|
190
|
-
}, null, 8, ["name", "class"])) : createCommentVNode("", true),
|
|
191
|
-
createElementVNode("span", null, toDisplayString(__props.label), 1),
|
|
192
|
-
__props.icon && __props.iconPosition === "right" ? (openBlock(), createBlock(_sfc_main$b, {
|
|
193
|
-
key: 1,
|
|
194
|
-
name: __props.icon,
|
|
195
|
-
class: normalizeClass(unref(iconClasses))
|
|
196
|
-
}, null, 8, ["name", "class"])) : createCommentVNode("", true)
|
|
197
|
-
], 2),
|
|
198
|
-
__props.isLoading ? (openBlock(), createElementBlock("span", _hoisted_2$6, [
|
|
199
|
-
createVNode(_sfc_main$b, {
|
|
200
|
-
class: "animate-spin",
|
|
201
|
-
name: "circle-notch"
|
|
202
|
-
})
|
|
203
|
-
])) : createCommentVNode("", true)
|
|
204
|
-
], 10, _hoisted_1$8);
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
var getRandomValues;
|
|
209
|
-
var rnds8 = new Uint8Array(16);
|
|
210
|
-
function rng() {
|
|
211
|
-
if (!getRandomValues) {
|
|
212
|
-
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
|
|
213
|
-
if (!getRandomValues) {
|
|
214
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return getRandomValues(rnds8);
|
|
218
|
-
}
|
|
219
|
-
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
220
|
-
function validate(uuid) {
|
|
221
|
-
return typeof uuid === "string" && REGEX.test(uuid);
|
|
222
|
-
}
|
|
223
|
-
var byteToHex = [];
|
|
224
|
-
for (var i = 0; i < 256; ++i) {
|
|
225
|
-
byteToHex.push((i + 256).toString(16).substr(1));
|
|
226
|
-
}
|
|
227
|
-
function stringify(arr) {
|
|
228
|
-
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
229
|
-
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
230
|
-
if (!validate(uuid)) {
|
|
231
|
-
throw TypeError("Stringified UUID is invalid");
|
|
232
|
-
}
|
|
233
|
-
return uuid;
|
|
234
|
-
}
|
|
235
|
-
function v4(options, buf, offset) {
|
|
236
|
-
options = options || {};
|
|
237
|
-
var rnds = options.random || (options.rng || rng)();
|
|
238
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
239
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
240
|
-
if (buf) {
|
|
241
|
-
offset = offset || 0;
|
|
242
|
-
for (var i = 0; i < 16; ++i) {
|
|
243
|
-
buf[offset + i] = rnds[i];
|
|
244
|
-
}
|
|
245
|
-
return buf;
|
|
246
|
-
}
|
|
247
|
-
return stringify(rnds);
|
|
248
|
-
}
|
|
249
|
-
const _hoisted_1$7 = { class: "relative flex items-start" };
|
|
250
|
-
const _hoisted_2$5 = { class: "flex items-center h-5" };
|
|
251
|
-
const _hoisted_3$3 = ["checked", "id"];
|
|
252
|
-
const _hoisted_4$2 = { class: "ml-2 text-sm leading-5" };
|
|
253
|
-
const _hoisted_5$2 = ["for"];
|
|
254
|
-
const _hoisted_6$2 = {
|
|
255
|
-
key: 0,
|
|
256
|
-
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
257
|
-
};
|
|
258
|
-
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
259
|
-
__name: "Checkbox",
|
|
260
|
-
props: {
|
|
261
|
-
id: { default: v4() },
|
|
262
|
-
label: null,
|
|
263
|
-
modelValue: { type: Boolean },
|
|
264
|
-
description: null
|
|
265
|
-
},
|
|
266
|
-
emits: ["update:modelValue"],
|
|
267
|
-
setup(__props, { emit: emits }) {
|
|
268
|
-
const update = (value) => {
|
|
269
|
-
emits("update:modelValue", value.target.checked);
|
|
270
|
-
};
|
|
271
|
-
return (_ctx, _cache) => {
|
|
272
|
-
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
273
|
-
createElementVNode("div", _hoisted_2$5, [
|
|
274
|
-
createElementVNode("input", {
|
|
275
|
-
class: "h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm",
|
|
276
|
-
type: "checkbox",
|
|
277
|
-
checked: __props.modelValue,
|
|
278
|
-
onChange: update,
|
|
279
|
-
id: __props.id
|
|
280
|
-
}, null, 40, _hoisted_3$3)
|
|
281
|
-
]),
|
|
282
|
-
createElementVNode("div", _hoisted_4$2, [
|
|
283
|
-
createElementVNode("label", {
|
|
284
|
-
for: __props.id,
|
|
285
|
-
class: "font-medium text-grey-700 dark:text-grey-200 casual-25"
|
|
286
|
-
}, toDisplayString(__props.label), 9, _hoisted_5$2),
|
|
287
|
-
__props.description ? (openBlock(), createElementBlock("p", _hoisted_6$2, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
288
|
-
])
|
|
289
|
-
]);
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
var _a;
|
|
294
|
-
const isClient = typeof window !== "undefined";
|
|
295
|
-
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
296
|
-
function identity(arg) {
|
|
297
|
-
return arg;
|
|
298
|
-
}
|
|
299
|
-
function tryOnMounted(fn2, sync = true) {
|
|
300
|
-
if (getCurrentInstance())
|
|
301
|
-
onMounted(fn2);
|
|
302
|
-
else if (sync)
|
|
303
|
-
fn2();
|
|
304
|
-
else
|
|
305
|
-
nextTick(fn2);
|
|
306
|
-
}
|
|
307
|
-
isClient ? window : void 0;
|
|
308
|
-
isClient ? window.document : void 0;
|
|
309
|
-
isClient ? window.navigator : void 0;
|
|
310
|
-
isClient ? window.location : void 0;
|
|
311
|
-
function useSupported(callback, sync = false) {
|
|
312
|
-
const isSupported = ref();
|
|
313
|
-
const update = () => isSupported.value = Boolean(callback());
|
|
314
|
-
update();
|
|
315
|
-
tryOnMounted(update, sync);
|
|
316
|
-
return isSupported;
|
|
317
|
-
}
|
|
318
|
-
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
319
|
-
const globalKey = "__vueuse_ssr_handlers__";
|
|
320
|
-
_global[globalKey] = _global[globalKey] || {};
|
|
321
|
-
_global[globalKey];
|
|
322
|
-
function useEyeDropper(options = {}) {
|
|
323
|
-
const { initialValue = "" } = options;
|
|
324
|
-
const isSupported = useSupported(() => typeof window !== "undefined" && "EyeDropper" in window);
|
|
325
|
-
const sRGBHex = ref(initialValue);
|
|
326
|
-
async function open(openOptions) {
|
|
327
|
-
if (!isSupported.value)
|
|
328
|
-
return;
|
|
329
|
-
const eyeDropper = new window.EyeDropper();
|
|
330
|
-
const result = await eyeDropper.open(openOptions);
|
|
331
|
-
sRGBHex.value = result.sRGBHex;
|
|
332
|
-
return result;
|
|
333
|
-
}
|
|
334
|
-
return { isSupported, sRGBHex, open };
|
|
335
|
-
}
|
|
336
|
-
var SwipeDirection;
|
|
337
|
-
(function(SwipeDirection2) {
|
|
338
|
-
SwipeDirection2["UP"] = "UP";
|
|
339
|
-
SwipeDirection2["RIGHT"] = "RIGHT";
|
|
340
|
-
SwipeDirection2["DOWN"] = "DOWN";
|
|
341
|
-
SwipeDirection2["LEFT"] = "LEFT";
|
|
342
|
-
SwipeDirection2["NONE"] = "NONE";
|
|
343
|
-
})(SwipeDirection || (SwipeDirection = {}));
|
|
344
|
-
var __defProp2 = Object.defineProperty;
|
|
345
|
-
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
346
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
347
|
-
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
348
|
-
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
349
|
-
var __spreadValues2 = (a2, b2) => {
|
|
350
|
-
for (var prop in b2 || (b2 = {}))
|
|
351
|
-
if (__hasOwnProp2.call(b2, prop))
|
|
352
|
-
__defNormalProp2(a2, prop, b2[prop]);
|
|
353
|
-
if (__getOwnPropSymbols2)
|
|
354
|
-
for (var prop of __getOwnPropSymbols2(b2)) {
|
|
355
|
-
if (__propIsEnum2.call(b2, prop))
|
|
356
|
-
__defNormalProp2(a2, prop, b2[prop]);
|
|
357
|
-
}
|
|
358
|
-
return a2;
|
|
359
|
-
};
|
|
360
|
-
const _TransitionPresets = {
|
|
361
|
-
easeInSine: [0.12, 0, 0.39, 0],
|
|
362
|
-
easeOutSine: [0.61, 1, 0.88, 1],
|
|
363
|
-
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
364
|
-
easeInQuad: [0.11, 0, 0.5, 0],
|
|
365
|
-
easeOutQuad: [0.5, 1, 0.89, 1],
|
|
366
|
-
easeInOutQuad: [0.45, 0, 0.55, 1],
|
|
367
|
-
easeInCubic: [0.32, 0, 0.67, 0],
|
|
368
|
-
easeOutCubic: [0.33, 1, 0.68, 1],
|
|
369
|
-
easeInOutCubic: [0.65, 0, 0.35, 1],
|
|
370
|
-
easeInQuart: [0.5, 0, 0.75, 0],
|
|
371
|
-
easeOutQuart: [0.25, 1, 0.5, 1],
|
|
372
|
-
easeInOutQuart: [0.76, 0, 0.24, 1],
|
|
373
|
-
easeInQuint: [0.64, 0, 0.78, 0],
|
|
374
|
-
easeOutQuint: [0.22, 1, 0.36, 1],
|
|
375
|
-
easeInOutQuint: [0.83, 0, 0.17, 1],
|
|
376
|
-
easeInExpo: [0.7, 0, 0.84, 0],
|
|
377
|
-
easeOutExpo: [0.16, 1, 0.3, 1],
|
|
378
|
-
easeInOutExpo: [0.87, 0, 0.13, 1],
|
|
379
|
-
easeInCirc: [0.55, 0, 1, 0.45],
|
|
380
|
-
easeOutCirc: [0, 0.55, 0.45, 1],
|
|
381
|
-
easeInOutCirc: [0.85, 0, 0.15, 1],
|
|
382
|
-
easeInBack: [0.36, 0, 0.66, -0.56],
|
|
383
|
-
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
384
|
-
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
385
|
-
};
|
|
386
|
-
__spreadValues2({
|
|
387
|
-
linear: identity
|
|
388
|
-
}, _TransitionPresets);
|
|
389
|
-
const NOOP = () => {
|
|
390
|
-
};
|
|
391
|
-
const NO = () => false;
|
|
392
|
-
const isArray = Array.isArray;
|
|
393
|
-
const isFunction = (val) => typeof val === "function";
|
|
394
|
-
let activeEffectScope;
|
|
395
|
-
function recordEffectScope(effect2, scope = activeEffectScope) {
|
|
396
|
-
if (scope && scope.active) {
|
|
397
|
-
scope.effects.push(effect2);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
const createDep = (effects) => {
|
|
401
|
-
const dep = new Set(effects);
|
|
402
|
-
dep.w = 0;
|
|
403
|
-
dep.n = 0;
|
|
404
|
-
return dep;
|
|
405
|
-
};
|
|
406
|
-
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
407
|
-
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
408
|
-
const initDepMarkers = ({ deps }) => {
|
|
409
|
-
if (deps.length) {
|
|
410
|
-
for (let i = 0; i < deps.length; i++) {
|
|
411
|
-
deps[i].w |= trackOpBit;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
const finalizeDepMarkers = (effect2) => {
|
|
416
|
-
const { deps } = effect2;
|
|
417
|
-
if (deps.length) {
|
|
418
|
-
let ptr = 0;
|
|
419
|
-
for (let i = 0; i < deps.length; i++) {
|
|
420
|
-
const dep = deps[i];
|
|
421
|
-
if (wasTracked(dep) && !newTracked(dep)) {
|
|
422
|
-
dep.delete(effect2);
|
|
423
|
-
} else {
|
|
424
|
-
deps[ptr++] = dep;
|
|
425
|
-
}
|
|
426
|
-
dep.w &= ~trackOpBit;
|
|
427
|
-
dep.n &= ~trackOpBit;
|
|
428
|
-
}
|
|
429
|
-
deps.length = ptr;
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
let effectTrackDepth = 0;
|
|
433
|
-
let trackOpBit = 1;
|
|
434
|
-
const maxMarkerBits = 30;
|
|
435
|
-
let activeEffect;
|
|
436
|
-
class ReactiveEffect {
|
|
437
|
-
constructor(fn2, scheduler = null, scope) {
|
|
438
|
-
this.fn = fn2;
|
|
439
|
-
this.scheduler = scheduler;
|
|
440
|
-
this.active = true;
|
|
441
|
-
this.deps = [];
|
|
442
|
-
this.parent = void 0;
|
|
443
|
-
recordEffectScope(this, scope);
|
|
444
|
-
}
|
|
445
|
-
run() {
|
|
446
|
-
if (!this.active) {
|
|
447
|
-
return this.fn();
|
|
448
|
-
}
|
|
449
|
-
let parent = activeEffect;
|
|
450
|
-
let lastShouldTrack = shouldTrack;
|
|
451
|
-
while (parent) {
|
|
452
|
-
if (parent === this) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
parent = parent.parent;
|
|
456
|
-
}
|
|
457
|
-
try {
|
|
458
|
-
this.parent = activeEffect;
|
|
459
|
-
activeEffect = this;
|
|
460
|
-
shouldTrack = true;
|
|
461
|
-
trackOpBit = 1 << ++effectTrackDepth;
|
|
462
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
463
|
-
initDepMarkers(this);
|
|
464
|
-
} else {
|
|
465
|
-
cleanupEffect(this);
|
|
466
|
-
}
|
|
467
|
-
return this.fn();
|
|
468
|
-
} finally {
|
|
469
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
470
|
-
finalizeDepMarkers(this);
|
|
471
|
-
}
|
|
472
|
-
trackOpBit = 1 << --effectTrackDepth;
|
|
473
|
-
activeEffect = this.parent;
|
|
474
|
-
shouldTrack = lastShouldTrack;
|
|
475
|
-
this.parent = void 0;
|
|
476
|
-
if (this.deferStop) {
|
|
477
|
-
this.stop();
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
stop() {
|
|
482
|
-
if (activeEffect === this) {
|
|
483
|
-
this.deferStop = true;
|
|
484
|
-
} else if (this.active) {
|
|
485
|
-
cleanupEffect(this);
|
|
486
|
-
if (this.onStop) {
|
|
487
|
-
this.onStop();
|
|
488
|
-
}
|
|
489
|
-
this.active = false;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
function cleanupEffect(effect2) {
|
|
494
|
-
const { deps } = effect2;
|
|
495
|
-
if (deps.length) {
|
|
496
|
-
for (let i = 0; i < deps.length; i++) {
|
|
497
|
-
deps[i].delete(effect2);
|
|
498
|
-
}
|
|
499
|
-
deps.length = 0;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
let shouldTrack = true;
|
|
503
|
-
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
504
|
-
let shouldTrack2 = false;
|
|
505
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
506
|
-
if (!newTracked(dep)) {
|
|
507
|
-
dep.n |= trackOpBit;
|
|
508
|
-
shouldTrack2 = !wasTracked(dep);
|
|
509
|
-
}
|
|
510
|
-
} else {
|
|
511
|
-
shouldTrack2 = !dep.has(activeEffect);
|
|
512
|
-
}
|
|
513
|
-
if (shouldTrack2) {
|
|
514
|
-
dep.add(activeEffect);
|
|
515
|
-
activeEffect.deps.push(dep);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
519
|
-
const effects = isArray(dep) ? dep : [...dep];
|
|
520
|
-
for (const effect2 of effects) {
|
|
521
|
-
if (effect2.computed) {
|
|
522
|
-
triggerEffect(effect2);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
for (const effect2 of effects) {
|
|
526
|
-
if (!effect2.computed) {
|
|
527
|
-
triggerEffect(effect2);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
532
|
-
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
533
|
-
if (effect2.scheduler) {
|
|
534
|
-
effect2.scheduler();
|
|
535
|
-
} else {
|
|
536
|
-
effect2.run();
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
function toRaw(observed) {
|
|
541
|
-
const raw = observed && observed["__v_raw"];
|
|
542
|
-
return raw ? toRaw(raw) : observed;
|
|
543
|
-
}
|
|
544
|
-
function trackRefValue(ref2) {
|
|
545
|
-
if (shouldTrack && activeEffect) {
|
|
546
|
-
ref2 = toRaw(ref2);
|
|
547
|
-
{
|
|
548
|
-
trackEffects(ref2.dep || (ref2.dep = createDep()));
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
function triggerRefValue(ref2, newVal) {
|
|
553
|
-
ref2 = toRaw(ref2);
|
|
554
|
-
const dep = ref2.dep;
|
|
555
|
-
if (dep) {
|
|
556
|
-
{
|
|
557
|
-
triggerEffects(dep);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
var _a$1;
|
|
562
|
-
class ComputedRefImpl {
|
|
563
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
564
|
-
this._setter = _setter;
|
|
565
|
-
this.dep = void 0;
|
|
566
|
-
this.__v_isRef = true;
|
|
567
|
-
this[_a$1] = false;
|
|
568
|
-
this._dirty = true;
|
|
569
|
-
this.effect = new ReactiveEffect(getter, () => {
|
|
570
|
-
if (!this._dirty) {
|
|
571
|
-
this._dirty = true;
|
|
572
|
-
triggerRefValue(this);
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
this.effect.computed = this;
|
|
576
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
577
|
-
this["__v_isReadonly"] = isReadonly;
|
|
578
|
-
}
|
|
579
|
-
get value() {
|
|
580
|
-
const self2 = toRaw(this);
|
|
581
|
-
trackRefValue(self2);
|
|
582
|
-
if (self2._dirty || !self2._cacheable) {
|
|
583
|
-
self2._dirty = false;
|
|
584
|
-
self2._value = self2.effect.run();
|
|
585
|
-
}
|
|
586
|
-
return self2._value;
|
|
587
|
-
}
|
|
588
|
-
set value(newValue) {
|
|
589
|
-
this._setter(newValue);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
_a$1 = "__v_isReadonly";
|
|
593
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
594
|
-
let getter;
|
|
595
|
-
let setter;
|
|
596
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
597
|
-
if (onlyGetter) {
|
|
598
|
-
getter = getterOrOptions;
|
|
599
|
-
setter = NOOP;
|
|
600
|
-
} else {
|
|
601
|
-
getter = getterOrOptions.get;
|
|
602
|
-
setter = getterOrOptions.set;
|
|
603
|
-
}
|
|
604
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
605
|
-
return cRef;
|
|
606
|
-
}
|
|
607
|
-
function createAppContext() {
|
|
608
|
-
return {
|
|
609
|
-
app: null,
|
|
610
|
-
config: {
|
|
611
|
-
isNativeTag: NO,
|
|
612
|
-
performance: false,
|
|
613
|
-
globalProperties: {},
|
|
614
|
-
optionMergeStrategies: {},
|
|
615
|
-
errorHandler: void 0,
|
|
616
|
-
warnHandler: void 0,
|
|
617
|
-
compilerOptions: {}
|
|
618
|
-
},
|
|
619
|
-
mixins: [],
|
|
620
|
-
components: {},
|
|
621
|
-
directives: {},
|
|
622
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
623
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
624
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
625
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
createAppContext();
|
|
629
|
-
let isInSSRComponentSetup = false;
|
|
630
|
-
const computed = (getterOrOptions, debugOptions) => {
|
|
631
|
-
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
632
|
-
};
|
|
633
|
-
function useFormClasses(props) {
|
|
634
|
-
const inputClasses = computed(() => {
|
|
635
|
-
return {
|
|
636
|
-
"pl-3 pr-10 py-2": !props.icon && props.type !== "color" && props.size === "small",
|
|
637
|
-
"pl-4 pr-10 py-3": !props.icon && props.type !== "color" && props.size === "medium",
|
|
638
|
-
"pl-6 pr-10 py-3": !props.icon && props.type !== "color" && props.size === "large",
|
|
639
|
-
"pl-10 pr-10 py-1": (props.icon || props.type === "color") && props.size === "small",
|
|
640
|
-
"pl-12 pr-10 py-3": (props.icon || props.type === "color") && (props.size === "medium" || props.size === "large"),
|
|
641
|
-
"w-full block": props.block === true
|
|
642
|
-
};
|
|
643
|
-
});
|
|
644
|
-
const disabledClasses = computed(() => {
|
|
645
|
-
return {
|
|
646
|
-
"pointer-events-none opacity-50 cursor-not-allowed": props.isDisabled
|
|
647
|
-
};
|
|
648
|
-
});
|
|
649
|
-
const textSizeClasses = computed(() => {
|
|
650
|
-
return {
|
|
651
|
-
"text-xs leading-4": props.size === "small",
|
|
652
|
-
"text-sm leading-4": props.size === "medium",
|
|
653
|
-
"text-base leading-5": props.size === "large"
|
|
654
|
-
};
|
|
655
|
-
});
|
|
656
|
-
return {
|
|
657
|
-
inputClasses,
|
|
658
|
-
disabledClasses,
|
|
659
|
-
textSizeClasses
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
const _hoisted_1$6 = ["placeholder", "type", "tabindex", "value"];
|
|
663
|
-
const _hoisted_2$4 = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" };
|
|
664
|
-
const __default__$1 = {
|
|
665
|
-
inheritAttrs: false
|
|
666
|
-
};
|
|
667
|
-
const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
668
|
-
__name: "Input",
|
|
669
|
-
props: {
|
|
670
|
-
modelValue: null,
|
|
671
|
-
type: { default: "text" },
|
|
672
|
-
placeholder: null,
|
|
673
|
-
size: { default: "medium" },
|
|
674
|
-
icon: null,
|
|
675
|
-
isDisabled: { type: Boolean, default: false },
|
|
676
|
-
block: { type: Boolean },
|
|
677
|
-
showColorPicker: { type: Boolean }
|
|
678
|
-
},
|
|
679
|
-
emits: ["update:modelValue"],
|
|
680
|
-
setup(__props, { expose, emit }) {
|
|
681
|
-
var _a2;
|
|
682
|
-
const props = __props;
|
|
683
|
-
const localValue = ref((_a2 = props.modelValue) != null ? _a2 : "");
|
|
684
|
-
watch(() => props.modelValue, (newValue) => {
|
|
685
|
-
if (typeof newValue === "string" && newValue !== localValue.value) {
|
|
686
|
-
localValue.value = newValue;
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
const { inputClasses, disabledClasses, textSizeClasses } = useFormClasses(props);
|
|
690
|
-
const resolvedInputType = computed$2(() => {
|
|
691
|
-
if (props.type === "color") {
|
|
692
|
-
return "text";
|
|
693
|
-
}
|
|
694
|
-
return props.type;
|
|
695
|
-
});
|
|
696
|
-
const {
|
|
697
|
-
isSupported: isColorPickerSupported,
|
|
698
|
-
open: openColorPicker,
|
|
699
|
-
sRGBHex
|
|
700
|
-
} = useEyeDropper();
|
|
701
|
-
const openPicker = () => {
|
|
702
|
-
openColorPicker();
|
|
703
|
-
};
|
|
704
|
-
watch(sRGBHex, (value) => {
|
|
705
|
-
localValue.value = value;
|
|
706
|
-
emit("update:modelValue", value);
|
|
707
|
-
});
|
|
708
|
-
const onInput = function(payload) {
|
|
709
|
-
localValue.value = (payload == null ? void 0 : payload.target).value;
|
|
710
|
-
emit("update:modelValue", (payload == null ? void 0 : payload.target).value);
|
|
711
|
-
};
|
|
712
|
-
const input = ref(null);
|
|
713
|
-
const focus = () => {
|
|
714
|
-
if (!props.isDisabled) {
|
|
715
|
-
input.value.focus();
|
|
716
|
-
}
|
|
717
|
-
};
|
|
718
|
-
expose({
|
|
719
|
-
focus
|
|
720
|
-
});
|
|
721
|
-
return (_ctx, _cache) => {
|
|
722
|
-
return openBlock(), createElementBlock("div", {
|
|
723
|
-
class: normalizeClass(["relative", [__props.block ? "w-full block" : "inline-block"]])
|
|
724
|
-
}, [
|
|
725
|
-
createElementVNode("input", mergeProps({
|
|
726
|
-
class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [unref(inputClasses), unref(textSizeClasses), unref(disabledClasses)]],
|
|
727
|
-
placeholder: __props.placeholder,
|
|
728
|
-
type: unref(resolvedInputType),
|
|
729
|
-
tabindex: __props.isDisabled ? "-1" : void 0,
|
|
730
|
-
value: localValue.value
|
|
731
|
-
}, _ctx.$attrs, {
|
|
732
|
-
ref_key: "input",
|
|
733
|
-
ref: input,
|
|
734
|
-
onInput
|
|
735
|
-
}), null, 16, _hoisted_1$6),
|
|
736
|
-
__props.type === "color" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
737
|
-
createElementVNode("label", _hoisted_2$4, [
|
|
738
|
-
withDirectives(createElementVNode("input", {
|
|
739
|
-
class: "invisible",
|
|
740
|
-
type: "color",
|
|
741
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localValue.value = $event),
|
|
742
|
-
onInput
|
|
743
|
-
}, null, 544), [
|
|
744
|
-
[vModelText, localValue.value]
|
|
745
|
-
]),
|
|
746
|
-
createElementVNode("span", {
|
|
747
|
-
class: "border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",
|
|
748
|
-
style: normalizeStyle(`background-color: ${localValue.value}`)
|
|
749
|
-
}, null, 4)
|
|
750
|
-
]),
|
|
751
|
-
unref(isColorPickerSupported) && __props.showColorPicker ? (openBlock(), createElementBlock("button", {
|
|
752
|
-
key: 0,
|
|
753
|
-
type: "button",
|
|
754
|
-
class: "absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",
|
|
755
|
-
onClick: openPicker
|
|
756
|
-
}, [
|
|
757
|
-
createVNode(_sfc_main$b, {
|
|
758
|
-
size: "xs",
|
|
759
|
-
name: "eyedropper"
|
|
760
|
-
})
|
|
761
|
-
])) : createCommentVNode("", true)
|
|
762
|
-
], 64)) : __props.icon ? (openBlock(), createElementBlock("span", {
|
|
763
|
-
key: 1,
|
|
764
|
-
class: normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", unref(textSizeClasses)])
|
|
765
|
-
}, [
|
|
766
|
-
createVNode(_sfc_main$b, { name: __props.icon }, null, 8, ["name"])
|
|
767
|
-
], 2)) : createCommentVNode("", true)
|
|
768
|
-
], 2);
|
|
769
|
-
};
|
|
770
|
-
}
|
|
771
|
-
}));
|
|
772
|
-
const _hoisted_1$5 = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" };
|
|
773
|
-
const _hoisted_2$3 = ["for"];
|
|
774
|
-
const _hoisted_3$2 = {
|
|
775
|
-
key: 0,
|
|
776
|
-
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
777
|
-
};
|
|
778
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
779
|
-
__name: "Label",
|
|
780
|
-
props: {
|
|
781
|
-
id: null,
|
|
782
|
-
label: null,
|
|
783
|
-
description: null
|
|
784
|
-
},
|
|
785
|
-
setup(__props) {
|
|
786
|
-
return (_ctx, _cache) => {
|
|
787
|
-
return openBlock(), createElementBlock("span", _hoisted_1$5, [
|
|
788
|
-
createElementVNode("label", { for: __props.id }, toDisplayString(__props.label), 9, _hoisted_2$3),
|
|
789
|
-
__props.description ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
790
|
-
]);
|
|
791
|
-
};
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
function u$2(r2, n2, ...a2) {
|
|
795
|
-
if (r2 in n2) {
|
|
796
|
-
let e2 = n2[r2];
|
|
797
|
-
return typeof e2 == "function" ? e2(...a2) : e2;
|
|
798
|
-
}
|
|
799
|
-
let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((e2) => `"${e2}"`).join(", ")}.`);
|
|
800
|
-
throw Error.captureStackTrace && Error.captureStackTrace(t2, u$2), t2;
|
|
801
|
-
}
|
|
802
|
-
var N$1 = ((o2) => (o2[o2.None = 0] = "None", o2[o2.RenderStrategy = 1] = "RenderStrategy", o2[o2.Static = 2] = "Static", o2))(N$1 || {}), S$2 = ((e2) => (e2[e2.Unmount = 0] = "Unmount", e2[e2.Hidden = 1] = "Hidden", e2))(S$2 || {});
|
|
803
|
-
function H$1(_a2) {
|
|
804
|
-
var _b = _a2, { visible: r2 = true, features: t2 = 0, ourProps: e2, theirProps: o2 } = _b, i = __objRest(_b, ["visible", "features", "ourProps", "theirProps"]);
|
|
805
|
-
var a2;
|
|
806
|
-
let n2 = j(o2, e2), l2 = Object.assign(i, { props: n2 });
|
|
807
|
-
if (r2 || t2 & 2 && n2.static)
|
|
808
|
-
return y$1(l2);
|
|
809
|
-
if (t2 & 1) {
|
|
810
|
-
let d2 = (a2 = n2.unmount) == null || a2 ? 0 : 1;
|
|
811
|
-
return u$2(d2, { [0]() {
|
|
812
|
-
return null;
|
|
813
|
-
}, [1]() {
|
|
814
|
-
return y$1(__spreadProps(__spreadValues({}, i), { props: __spreadProps(__spreadValues({}, n2), { hidden: true, style: { display: "none" } }) }));
|
|
815
|
-
} });
|
|
816
|
-
}
|
|
817
|
-
return y$1(l2);
|
|
818
|
-
}
|
|
819
|
-
function y$1({ props: r2, attrs: t2, slots: e2, slot: o2, name: i }) {
|
|
820
|
-
var m2, h2;
|
|
821
|
-
let _a2 = T$2(r2, ["unmount", "static"]), { as: n2 } = _a2, l2 = __objRest(_a2, ["as"]), a2 = (m2 = e2.default) == null ? void 0 : m2.call(e2, o2), d2 = {};
|
|
822
|
-
if (o2) {
|
|
823
|
-
let u2 = false, c2 = [];
|
|
824
|
-
for (let [p2, f2] of Object.entries(o2))
|
|
825
|
-
typeof f2 == "boolean" && (u2 = true), f2 === true && c2.push(p2);
|
|
826
|
-
u2 && (d2["data-headlessui-state"] = c2.join(" "));
|
|
827
|
-
}
|
|
828
|
-
if (n2 === "template") {
|
|
829
|
-
if (a2 = b$2(a2 != null ? a2 : []), Object.keys(l2).length > 0 || Object.keys(t2).length > 0) {
|
|
830
|
-
let [u2, ...c2] = a2 != null ? a2 : [];
|
|
831
|
-
if (!v$1(u2) || c2.length > 0)
|
|
832
|
-
throw new Error(['Passing props on "template"!', "", `The current component <${i} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(l2).concat(Object.keys(t2)).map((s2) => s2.trim()).filter((s2, g, R) => R.indexOf(s2) === g).sort((s2, g) => s2.localeCompare(g)).map((s2) => ` - ${s2}`).join(`
|
|
833
|
-
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((s2) => ` - ${s2}`).join(`
|
|
834
|
-
`)].join(`
|
|
835
|
-
`));
|
|
836
|
-
let p2 = j((h2 = u2.props) != null ? h2 : {}, l2), f2 = cloneVNode(u2, p2);
|
|
837
|
-
for (let s2 in p2)
|
|
838
|
-
s2.startsWith("on") && (f2.props || (f2.props = {}), f2.props[s2] = p2[s2]);
|
|
839
|
-
return f2;
|
|
840
|
-
}
|
|
841
|
-
return Array.isArray(a2) && a2.length === 1 ? a2[0] : a2;
|
|
842
|
-
}
|
|
843
|
-
return h$1(n2, Object.assign({}, l2, d2), { default: () => a2 });
|
|
844
|
-
}
|
|
845
|
-
function b$2(r2) {
|
|
846
|
-
return r2.flatMap((t2) => t2.type === Fragment ? b$2(t2.children) : [t2]);
|
|
847
|
-
}
|
|
848
|
-
function j(...r2) {
|
|
849
|
-
if (r2.length === 0)
|
|
850
|
-
return {};
|
|
851
|
-
if (r2.length === 1)
|
|
852
|
-
return r2[0];
|
|
853
|
-
let t2 = {}, e2 = {};
|
|
854
|
-
for (let i of r2)
|
|
855
|
-
for (let n2 in i)
|
|
856
|
-
n2.startsWith("on") && typeof i[n2] == "function" ? (e2[n2] != null || (e2[n2] = []), e2[n2].push(i[n2])) : t2[n2] = i[n2];
|
|
857
|
-
if (t2.disabled || t2["aria-disabled"])
|
|
858
|
-
return Object.assign(t2, Object.fromEntries(Object.keys(e2).map((i) => [i, void 0])));
|
|
859
|
-
for (let i in e2)
|
|
860
|
-
Object.assign(t2, { [i](n2, ...l2) {
|
|
861
|
-
let a2 = e2[i];
|
|
862
|
-
for (let d2 of a2) {
|
|
863
|
-
if (n2 instanceof Event && n2.defaultPrevented)
|
|
864
|
-
return;
|
|
865
|
-
d2(n2, ...l2);
|
|
866
|
-
}
|
|
867
|
-
} });
|
|
868
|
-
return t2;
|
|
869
|
-
}
|
|
870
|
-
function K$1(r2) {
|
|
871
|
-
let t2 = Object.assign({}, r2);
|
|
872
|
-
for (let e2 in t2)
|
|
873
|
-
t2[e2] === void 0 && delete t2[e2];
|
|
874
|
-
return t2;
|
|
875
|
-
}
|
|
876
|
-
function T$2(r2, t2 = []) {
|
|
877
|
-
let e2 = Object.assign({}, r2);
|
|
878
|
-
for (let o2 of t2)
|
|
879
|
-
o2 in e2 && delete e2[o2];
|
|
880
|
-
return e2;
|
|
881
|
-
}
|
|
882
|
-
function v$1(r2) {
|
|
883
|
-
return r2 == null ? false : typeof r2.type == "string" || typeof r2.type == "object" || typeof r2.type == "function";
|
|
884
|
-
}
|
|
885
|
-
let e$1 = 0;
|
|
886
|
-
function n$2() {
|
|
887
|
-
return ++e$1;
|
|
888
|
-
}
|
|
889
|
-
function t$1() {
|
|
890
|
-
return n$2();
|
|
891
|
-
}
|
|
892
|
-
var o$1 = ((r2) => (r2.Space = " ", r2.Enter = "Enter", r2.Escape = "Escape", r2.Backspace = "Backspace", r2.Delete = "Delete", r2.ArrowLeft = "ArrowLeft", r2.ArrowUp = "ArrowUp", r2.ArrowRight = "ArrowRight", r2.ArrowDown = "ArrowDown", r2.Home = "Home", r2.End = "End", r2.PageUp = "PageUp", r2.PageDown = "PageDown", r2.Tab = "Tab", r2))(o$1 || {});
|
|
893
|
-
function f$3(r2) {
|
|
894
|
-
throw new Error("Unexpected object: " + r2);
|
|
895
|
-
}
|
|
896
|
-
var a$2 = ((e2) => (e2[e2.First = 0] = "First", e2[e2.Previous = 1] = "Previous", e2[e2.Next = 2] = "Next", e2[e2.Last = 3] = "Last", e2[e2.Specific = 4] = "Specific", e2[e2.Nothing = 5] = "Nothing", e2))(a$2 || {});
|
|
897
|
-
function x(r2, n2) {
|
|
898
|
-
let t2 = n2.resolveItems();
|
|
899
|
-
if (t2.length <= 0)
|
|
900
|
-
return null;
|
|
901
|
-
let l2 = n2.resolveActiveIndex(), s2 = l2 != null ? l2 : -1, d2 = (() => {
|
|
902
|
-
switch (r2.focus) {
|
|
903
|
-
case 0:
|
|
904
|
-
return t2.findIndex((e2) => !n2.resolveDisabled(e2));
|
|
905
|
-
case 1: {
|
|
906
|
-
let e2 = t2.slice().reverse().findIndex((i, c2, u2) => s2 !== -1 && u2.length - c2 - 1 >= s2 ? false : !n2.resolveDisabled(i));
|
|
907
|
-
return e2 === -1 ? e2 : t2.length - 1 - e2;
|
|
908
|
-
}
|
|
909
|
-
case 2:
|
|
910
|
-
return t2.findIndex((e2, i) => i <= s2 ? false : !n2.resolveDisabled(e2));
|
|
911
|
-
case 3: {
|
|
912
|
-
let e2 = t2.slice().reverse().findIndex((i) => !n2.resolveDisabled(i));
|
|
913
|
-
return e2 === -1 ? e2 : t2.length - 1 - e2;
|
|
914
|
-
}
|
|
915
|
-
case 4:
|
|
916
|
-
return t2.findIndex((e2) => n2.resolveId(e2) === r2.id);
|
|
917
|
-
case 5:
|
|
918
|
-
return null;
|
|
919
|
-
default:
|
|
920
|
-
f$3(r2);
|
|
921
|
-
}
|
|
922
|
-
})();
|
|
923
|
-
return d2 === -1 ? l2 : d2;
|
|
924
|
-
}
|
|
925
|
-
function o(n2) {
|
|
926
|
-
var l2;
|
|
927
|
-
return n2 == null || n2.value == null ? null : (l2 = n2.value.$el) != null ? l2 : n2.value;
|
|
928
|
-
}
|
|
929
|
-
let n$1 = Symbol("Context");
|
|
930
|
-
var l = ((e2) => (e2[e2.Open = 1] = "Open", e2[e2.Closed = 2] = "Closed", e2[e2.Closing = 4] = "Closing", e2[e2.Opening = 8] = "Opening", e2))(l || {});
|
|
931
|
-
function p$3() {
|
|
932
|
-
return inject(n$1, null);
|
|
933
|
-
}
|
|
934
|
-
function c(o2) {
|
|
935
|
-
provide(n$1, o2);
|
|
936
|
-
}
|
|
937
|
-
function r$1(t2, e2) {
|
|
938
|
-
if (t2)
|
|
939
|
-
return t2;
|
|
940
|
-
let n2 = e2 != null ? e2 : "button";
|
|
941
|
-
if (typeof n2 == "string" && n2.toLowerCase() === "button")
|
|
942
|
-
return "button";
|
|
943
|
-
}
|
|
944
|
-
function b$1(t2, e2) {
|
|
945
|
-
let n2 = ref(r$1(t2.value.type, t2.value.as));
|
|
946
|
-
return onMounted(() => {
|
|
947
|
-
n2.value = r$1(t2.value.type, t2.value.as);
|
|
948
|
-
}), watchEffect(() => {
|
|
949
|
-
var o$12;
|
|
950
|
-
n2.value || o(e2) && o(e2) instanceof HTMLButtonElement && !((o$12 = o(e2)) != null && o$12.hasAttribute("type")) && (n2.value = "button");
|
|
951
|
-
}), n2;
|
|
952
|
-
}
|
|
953
|
-
class t {
|
|
954
|
-
constructor() {
|
|
955
|
-
this.current = this.detect();
|
|
956
|
-
this.currentId = 0;
|
|
957
|
-
}
|
|
958
|
-
set(e2) {
|
|
959
|
-
this.current !== e2 && (this.currentId = 0, this.current = e2);
|
|
960
|
-
}
|
|
961
|
-
reset() {
|
|
962
|
-
this.set(this.detect());
|
|
963
|
-
}
|
|
964
|
-
nextId() {
|
|
965
|
-
return ++this.currentId;
|
|
966
|
-
}
|
|
967
|
-
get isServer() {
|
|
968
|
-
return this.current === "server";
|
|
969
|
-
}
|
|
970
|
-
get isClient() {
|
|
971
|
-
return this.current === "client";
|
|
972
|
-
}
|
|
973
|
-
detect() {
|
|
974
|
-
return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client";
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
let n = new t();
|
|
978
|
-
function m(r2) {
|
|
979
|
-
if (n.isServer)
|
|
980
|
-
return null;
|
|
981
|
-
if (r2 instanceof Node)
|
|
982
|
-
return r2.ownerDocument;
|
|
983
|
-
if (r2 != null && r2.hasOwnProperty("value")) {
|
|
984
|
-
let n2 = o(r2);
|
|
985
|
-
if (n2)
|
|
986
|
-
return n2.ownerDocument;
|
|
987
|
-
}
|
|
988
|
-
return document;
|
|
989
|
-
}
|
|
990
|
-
function p$2({ container: e2, accept: t2, walk: d2, enabled: o2 }) {
|
|
991
|
-
watchEffect(() => {
|
|
992
|
-
let r2 = e2.value;
|
|
993
|
-
if (!r2 || o2 !== void 0 && !o2.value)
|
|
994
|
-
return;
|
|
995
|
-
let l2 = m(e2);
|
|
996
|
-
if (!l2)
|
|
997
|
-
return;
|
|
998
|
-
let c2 = Object.assign((f2) => t2(f2), { acceptNode: t2 }), n2 = l2.createTreeWalker(r2, NodeFilter.SHOW_ELEMENT, c2, false);
|
|
999
|
-
for (; n2.nextNode(); )
|
|
1000
|
-
d2(n2.currentNode);
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
let f$2 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e2) => `${e2}:not([tabindex='-1'])`).join(",");
|
|
1004
|
-
var N = ((r2) => (r2[r2.First = 1] = "First", r2[r2.Previous = 2] = "Previous", r2[r2.Next = 4] = "Next", r2[r2.Last = 8] = "Last", r2[r2.WrapAround = 16] = "WrapAround", r2[r2.NoScroll = 32] = "NoScroll", r2))(N || {}), T$1 = ((o2) => (o2[o2.Error = 0] = "Error", o2[o2.Overflow = 1] = "Overflow", o2[o2.Success = 2] = "Success", o2[o2.Underflow = 3] = "Underflow", o2))(T$1 || {}), h = ((n2) => (n2[n2.Previous = -1] = "Previous", n2[n2.Next = 1] = "Next", n2))(h || {});
|
|
1005
|
-
function d$2(e2 = document.body) {
|
|
1006
|
-
return e2 == null ? [] : Array.from(e2.querySelectorAll(f$2)).sort((t2, n2) => Math.sign((t2.tabIndex || Number.MAX_SAFE_INTEGER) - (n2.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
1007
|
-
}
|
|
1008
|
-
var F = ((n2) => (n2[n2.Strict = 0] = "Strict", n2[n2.Loose = 1] = "Loose", n2))(F || {});
|
|
1009
|
-
function S$1(e2, t2 = 0) {
|
|
1010
|
-
var n2;
|
|
1011
|
-
return e2 === ((n2 = m(e2)) == null ? void 0 : n2.body) ? false : u$2(t2, { [0]() {
|
|
1012
|
-
return e2.matches(f$2);
|
|
1013
|
-
}, [1]() {
|
|
1014
|
-
let l2 = e2;
|
|
1015
|
-
for (; l2 !== null; ) {
|
|
1016
|
-
if (l2.matches(f$2))
|
|
1017
|
-
return true;
|
|
1018
|
-
l2 = l2.parentElement;
|
|
1019
|
-
}
|
|
1020
|
-
return false;
|
|
1021
|
-
} });
|
|
1022
|
-
}
|
|
1023
|
-
function v(e2) {
|
|
1024
|
-
let t2 = m(e2);
|
|
1025
|
-
nextTick(() => {
|
|
1026
|
-
t2 && !S$1(t2.activeElement, 0) && H(e2);
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
function H(e2) {
|
|
1030
|
-
e2 == null || e2.focus({ preventScroll: true });
|
|
1031
|
-
}
|
|
1032
|
-
let w = ["textarea", "input"].join(",");
|
|
1033
|
-
function A$1(e2) {
|
|
1034
|
-
var t2, n2;
|
|
1035
|
-
return (n2 = (t2 = e2 == null ? void 0 : e2.matches) == null ? void 0 : t2.call(e2, w)) != null ? n2 : false;
|
|
1036
|
-
}
|
|
1037
|
-
function I(e2, t2 = (n2) => n2) {
|
|
1038
|
-
return e2.slice().sort((n2, l2) => {
|
|
1039
|
-
let o2 = t2(n2), i = t2(l2);
|
|
1040
|
-
if (o2 === null || i === null)
|
|
1041
|
-
return 0;
|
|
1042
|
-
let r2 = o2.compareDocumentPosition(i);
|
|
1043
|
-
return r2 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : r2 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
function D(e2, t2) {
|
|
1047
|
-
return O(d$2(), t2, { relativeTo: e2 });
|
|
1048
|
-
}
|
|
1049
|
-
function O(e2, t2, { sorted: n2 = true, relativeTo: l2 = null, skipElements: o2 = [] } = {}) {
|
|
1050
|
-
var m2;
|
|
1051
|
-
let i = (m2 = Array.isArray(e2) ? e2.length > 0 ? e2[0].ownerDocument : document : e2 == null ? void 0 : e2.ownerDocument) != null ? m2 : document, r2 = Array.isArray(e2) ? n2 ? I(e2) : e2 : d$2(e2);
|
|
1052
|
-
o2.length > 0 && r2.length > 1 && (r2 = r2.filter((s2) => !o2.includes(s2))), l2 = l2 != null ? l2 : i.activeElement;
|
|
1053
|
-
let x2 = (() => {
|
|
1054
|
-
if (t2 & 5)
|
|
1055
|
-
return 1;
|
|
1056
|
-
if (t2 & 10)
|
|
1057
|
-
return -1;
|
|
1058
|
-
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1059
|
-
})(), p2 = (() => {
|
|
1060
|
-
if (t2 & 1)
|
|
1061
|
-
return 0;
|
|
1062
|
-
if (t2 & 2)
|
|
1063
|
-
return Math.max(0, r2.indexOf(l2)) - 1;
|
|
1064
|
-
if (t2 & 4)
|
|
1065
|
-
return Math.max(0, r2.indexOf(l2)) + 1;
|
|
1066
|
-
if (t2 & 8)
|
|
1067
|
-
return r2.length - 1;
|
|
1068
|
-
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1069
|
-
})(), M2 = t2 & 32 ? { preventScroll: true } : {}, c2 = 0, a2 = r2.length, u2;
|
|
1070
|
-
do {
|
|
1071
|
-
if (c2 >= a2 || c2 + a2 <= 0)
|
|
1072
|
-
return 0;
|
|
1073
|
-
let s2 = p2 + c2;
|
|
1074
|
-
if (t2 & 16)
|
|
1075
|
-
s2 = (s2 + a2) % a2;
|
|
1076
|
-
else {
|
|
1077
|
-
if (s2 < 0)
|
|
1078
|
-
return 3;
|
|
1079
|
-
if (s2 >= a2)
|
|
1080
|
-
return 1;
|
|
1081
|
-
}
|
|
1082
|
-
u2 = r2[s2], u2 == null || u2.focus(M2), c2 += x2;
|
|
1083
|
-
} while (u2 !== i.activeElement);
|
|
1084
|
-
return t2 & 6 && A$1(u2) && u2.select(), u2.hasAttribute("tabindex") || u2.setAttribute("tabindex", "0"), 2;
|
|
1085
|
-
}
|
|
1086
|
-
function u$1(e2, t2, n$12) {
|
|
1087
|
-
n.isServer || watchEffect((o2) => {
|
|
1088
|
-
document.addEventListener(e2, t2, n$12), o2(() => document.removeEventListener(e2, t2, n$12));
|
|
1089
|
-
});
|
|
1090
|
-
}
|
|
1091
|
-
function y(f2, m2, i = computed$2(() => true)) {
|
|
1092
|
-
function a2(e2, u2) {
|
|
1093
|
-
if (!i.value || e2.defaultPrevented)
|
|
1094
|
-
return;
|
|
1095
|
-
let n2 = u2(e2);
|
|
1096
|
-
if (n2 === null || !n2.getRootNode().contains(n2))
|
|
1097
|
-
return;
|
|
1098
|
-
let c2 = function o2(t2) {
|
|
1099
|
-
return typeof t2 == "function" ? o2(t2()) : Array.isArray(t2) || t2 instanceof Set ? t2 : [t2];
|
|
1100
|
-
}(f2);
|
|
1101
|
-
for (let o$12 of c2) {
|
|
1102
|
-
if (o$12 === null)
|
|
1103
|
-
continue;
|
|
1104
|
-
let t2 = o$12 instanceof HTMLElement ? o$12 : o(o$12);
|
|
1105
|
-
if (t2 != null && t2.contains(n2) || e2.composed && e2.composedPath().includes(t2))
|
|
1106
|
-
return;
|
|
1107
|
-
}
|
|
1108
|
-
return !S$1(n2, F.Loose) && n2.tabIndex !== -1 && e2.preventDefault(), m2(e2, n2);
|
|
1109
|
-
}
|
|
1110
|
-
let r2 = ref(null);
|
|
1111
|
-
u$1("mousedown", (e2) => {
|
|
1112
|
-
var u2, n2;
|
|
1113
|
-
i.value && (r2.value = ((n2 = (u2 = e2.composedPath) == null ? void 0 : u2.call(e2)) == null ? void 0 : n2[0]) || e2.target);
|
|
1114
|
-
}, true), u$1("click", (e2) => {
|
|
1115
|
-
r2.value && (a2(e2, () => r2.value), r2.value = null);
|
|
1116
|
-
}, true), u$1("blur", (e2) => a2(e2, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), true);
|
|
1117
|
-
}
|
|
1118
|
-
var a$1 = ((e2) => (e2[e2.None = 1] = "None", e2[e2.Focusable = 2] = "Focusable", e2[e2.Hidden = 4] = "Hidden", e2))(a$1 || {});
|
|
1119
|
-
let f$1 = defineComponent({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(r2, { slots: t2, attrs: d2 }) {
|
|
1120
|
-
return () => {
|
|
1121
|
-
let _a2 = r2, { features: e2 } = _a2, o2 = __objRest(_a2, ["features"]), n2 = { "aria-hidden": (e2 & 2) === 2 ? true : void 0, style: __spreadValues({ position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" }, (e2 & 4) === 4 && (e2 & 2) !== 2 && { display: "none" }) };
|
|
1122
|
-
return H$1({ ourProps: n2, theirProps: o2, slot: {}, attrs: d2, slots: t2, name: "Hidden" });
|
|
1123
|
-
};
|
|
1124
|
-
} });
|
|
1125
|
-
function e(n2 = {}, r2 = null, t2 = []) {
|
|
1126
|
-
for (let [i, o2] of Object.entries(n2))
|
|
1127
|
-
f(t2, s(r2, i), o2);
|
|
1128
|
-
return t2;
|
|
1129
|
-
}
|
|
1130
|
-
function s(n2, r2) {
|
|
1131
|
-
return n2 ? n2 + "[" + r2 + "]" : r2;
|
|
1132
|
-
}
|
|
1133
|
-
function f(n2, r2, t2) {
|
|
1134
|
-
if (Array.isArray(t2))
|
|
1135
|
-
for (let [i, o2] of t2.entries())
|
|
1136
|
-
f(n2, s(r2, i.toString()), o2);
|
|
1137
|
-
else
|
|
1138
|
-
t2 instanceof Date ? n2.push([r2, t2.toISOString()]) : typeof t2 == "boolean" ? n2.push([r2, t2 ? "1" : "0"]) : typeof t2 == "string" ? n2.push([r2, t2]) : typeof t2 == "number" ? n2.push([r2, `${t2}`]) : t2 == null ? n2.push([r2, ""]) : e(t2, r2, n2);
|
|
1139
|
-
}
|
|
1140
|
-
function p$1(n2) {
|
|
1141
|
-
var t2;
|
|
1142
|
-
let r2 = (t2 = n2 == null ? void 0 : n2.form) != null ? t2 : n2.closest("form");
|
|
1143
|
-
if (r2) {
|
|
1144
|
-
for (let i of r2.elements)
|
|
1145
|
-
if (i.tagName === "INPUT" && i.type === "submit" || i.tagName === "BUTTON" && i.type === "submit" || i.nodeName === "INPUT" && i.type === "image") {
|
|
1146
|
-
i.click();
|
|
1147
|
-
return;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
function d$1(u2, e2, r2) {
|
|
1152
|
-
let i = ref(r2 == null ? void 0 : r2.value), f2 = computed$2(() => u2.value !== void 0);
|
|
1153
|
-
return [computed$2(() => f2.value ? u2.value : i.value), function(t2) {
|
|
1154
|
-
return f2.value || (i.value = t2), e2 == null ? void 0 : e2(t2);
|
|
1155
|
-
}];
|
|
1156
|
-
}
|
|
1157
|
-
function r(e2) {
|
|
1158
|
-
return [e2.screenX, e2.screenY];
|
|
1159
|
-
}
|
|
1160
|
-
function u() {
|
|
1161
|
-
let e2 = ref([-1, -1]);
|
|
1162
|
-
return { wasMoved(n2) {
|
|
1163
|
-
let t2 = r(n2);
|
|
1164
|
-
return e2.value[0] === t2[0] && e2.value[1] === t2[1] ? false : (e2.value = t2, true);
|
|
1165
|
-
}, update(n2) {
|
|
1166
|
-
e2.value = r(n2);
|
|
1167
|
-
} };
|
|
1168
|
-
}
|
|
1169
|
-
let p = Symbol("DescriptionContext");
|
|
1170
|
-
function b() {
|
|
1171
|
-
let t2 = inject(p, null);
|
|
1172
|
-
if (t2 === null)
|
|
1173
|
-
throw new Error("Missing parent");
|
|
1174
|
-
return t2;
|
|
1175
|
-
}
|
|
1176
|
-
function M({ slot: t2 = ref({}), name: i = "Description", props: o2 = {} } = {}) {
|
|
1177
|
-
let e2 = ref([]);
|
|
1178
|
-
function s2(n2) {
|
|
1179
|
-
return e2.value.push(n2), () => {
|
|
1180
|
-
let r2 = e2.value.indexOf(n2);
|
|
1181
|
-
r2 !== -1 && e2.value.splice(r2, 1);
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
return provide(p, { register: s2, slot: t2, name: i, props: o2 }), computed$2(() => e2.value.length > 0 ? e2.value.join(" ") : void 0);
|
|
1185
|
-
}
|
|
1186
|
-
let E$1 = defineComponent({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: () => `headlessui-description-${t$1()}` } }, setup(t2, { attrs: i, slots: o2 }) {
|
|
1187
|
-
let e2 = b();
|
|
1188
|
-
return onMounted(() => onUnmounted(e2.register(t2.id))), () => {
|
|
1189
|
-
let { name: s2 = "Description", slot: n2 = ref({}), props: r2 = {} } = e2, _a2 = t2, { id: d2 } = _a2, l2 = __objRest(_a2, ["id"]), c2 = __spreadProps(__spreadValues({}, Object.entries(r2).reduce((f2, [a2, g]) => Object.assign(f2, { [a2]: unref(g) }), {})), { id: d2 });
|
|
1190
|
-
return H$1({ ourProps: c2, theirProps: l2, slot: n2.value, attrs: i, slots: o2, name: s2 });
|
|
1191
|
-
};
|
|
1192
|
-
} });
|
|
1193
|
-
function se(t2, b2) {
|
|
1194
|
-
return t2 === b2;
|
|
1195
|
-
}
|
|
1196
|
-
var de = ((u2) => (u2[u2.Open = 0] = "Open", u2[u2.Closed = 1] = "Closed", u2))(de || {}), fe = ((u2) => (u2[u2.Single = 0] = "Single", u2[u2.Multi = 1] = "Multi", u2))(fe || {}), pe = ((u2) => (u2[u2.Pointer = 0] = "Pointer", u2[u2.Other = 1] = "Other", u2))(pe || {});
|
|
1197
|
-
function ce(t2) {
|
|
1198
|
-
requestAnimationFrame(() => requestAnimationFrame(t2));
|
|
1199
|
-
}
|
|
1200
|
-
let U = Symbol("ListboxContext");
|
|
1201
|
-
function E(t2) {
|
|
1202
|
-
let b2 = inject(U, null);
|
|
1203
|
-
if (b2 === null) {
|
|
1204
|
-
let u2 = new Error(`<${t2} /> is missing a parent <Listbox /> component.`);
|
|
1205
|
-
throw Error.captureStackTrace && Error.captureStackTrace(u2, E), u2;
|
|
1206
|
-
}
|
|
1207
|
-
return b2;
|
|
1208
|
-
}
|
|
1209
|
-
let Ee = defineComponent({ name: "Listbox", emits: { "update:modelValue": (t2) => true }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: false }, by: { type: [String, Function], default: () => se }, horizontal: { type: [Boolean], default: false }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, name: { type: String, optional: true }, multiple: { type: [Boolean], default: false } }, inheritAttrs: false, setup(t2, { slots: b2, attrs: u2, emit: L }) {
|
|
1210
|
-
let e$12 = ref(1), d2 = ref(null), m2 = ref(null), x$1 = ref(null), f2 = ref([]), o$12 = ref(""), i = ref(null), w2 = ref(1);
|
|
1211
|
-
function R(a2 = (l2) => l2) {
|
|
1212
|
-
let l2 = i.value !== null ? f2.value[i.value] : null, r2 = I(a2(f2.value.slice()), (S2) => o(S2.dataRef.domRef)), s2 = l2 ? r2.indexOf(l2) : null;
|
|
1213
|
-
return s2 === -1 && (s2 = null), { options: r2, activeOptionIndex: s2 };
|
|
1214
|
-
}
|
|
1215
|
-
let h2 = computed$2(() => t2.multiple ? 1 : 0), [y$12, M2] = d$1(computed$2(() => t2.modelValue === void 0 ? u$2(h2.value, { [1]: [], [0]: void 0 }) : t2.modelValue), (a2) => L("update:modelValue", a2), computed$2(() => t2.defaultValue)), n2 = { listboxState: e$12, value: y$12, mode: h2, compare(a2, l2) {
|
|
1216
|
-
if (typeof t2.by == "string") {
|
|
1217
|
-
let r2 = t2.by;
|
|
1218
|
-
return (a2 == null ? void 0 : a2[r2]) === (l2 == null ? void 0 : l2[r2]);
|
|
1219
|
-
}
|
|
1220
|
-
return t2.by(a2, l2);
|
|
1221
|
-
}, orientation: computed$2(() => t2.horizontal ? "horizontal" : "vertical"), labelRef: d2, buttonRef: m2, optionsRef: x$1, disabled: computed$2(() => t2.disabled), options: f2, searchQuery: o$12, activeOptionIndex: i, activationTrigger: w2, closeListbox() {
|
|
1222
|
-
t2.disabled || e$12.value !== 1 && (e$12.value = 1, i.value = null);
|
|
1223
|
-
}, openListbox() {
|
|
1224
|
-
t2.disabled || e$12.value !== 0 && (e$12.value = 0);
|
|
1225
|
-
}, goToOption(a2, l2, r2) {
|
|
1226
|
-
if (t2.disabled || e$12.value === 1)
|
|
1227
|
-
return;
|
|
1228
|
-
let s2 = R(), S2 = x(a2 === a$2.Specific ? { focus: a$2.Specific, id: l2 } : { focus: a2 }, { resolveItems: () => s2.options, resolveActiveIndex: () => s2.activeOptionIndex, resolveId: (D2) => D2.id, resolveDisabled: (D2) => D2.dataRef.disabled });
|
|
1229
|
-
o$12.value = "", i.value = S2, w2.value = r2 != null ? r2 : 1, f2.value = s2.options;
|
|
1230
|
-
}, search(a2) {
|
|
1231
|
-
if (t2.disabled || e$12.value === 1)
|
|
1232
|
-
return;
|
|
1233
|
-
let r2 = o$12.value !== "" ? 0 : 1;
|
|
1234
|
-
o$12.value += a2.toLowerCase();
|
|
1235
|
-
let S2 = (i.value !== null ? f2.value.slice(i.value + r2).concat(f2.value.slice(0, i.value + r2)) : f2.value).find((j2) => j2.dataRef.textValue.startsWith(o$12.value) && !j2.dataRef.disabled), D2 = S2 ? f2.value.indexOf(S2) : -1;
|
|
1236
|
-
D2 === -1 || D2 === i.value || (i.value = D2, w2.value = 1);
|
|
1237
|
-
}, clearSearch() {
|
|
1238
|
-
t2.disabled || e$12.value !== 1 && o$12.value !== "" && (o$12.value = "");
|
|
1239
|
-
}, registerOption(a2, l2) {
|
|
1240
|
-
let r2 = R((s2) => [...s2, { id: a2, dataRef: l2 }]);
|
|
1241
|
-
f2.value = r2.options, i.value = r2.activeOptionIndex;
|
|
1242
|
-
}, unregisterOption(a2) {
|
|
1243
|
-
let l2 = R((r2) => {
|
|
1244
|
-
let s2 = r2.findIndex((S2) => S2.id === a2);
|
|
1245
|
-
return s2 !== -1 && r2.splice(s2, 1), r2;
|
|
1246
|
-
});
|
|
1247
|
-
f2.value = l2.options, i.value = l2.activeOptionIndex, w2.value = 1;
|
|
1248
|
-
}, select(a2) {
|
|
1249
|
-
t2.disabled || M2(u$2(h2.value, { [0]: () => a2, [1]: () => {
|
|
1250
|
-
let l2 = toRaw$1(n2.value.value).slice(), r2 = toRaw$1(a2), s2 = l2.findIndex((S2) => n2.compare(r2, toRaw$1(S2)));
|
|
1251
|
-
return s2 === -1 ? l2.push(r2) : l2.splice(s2, 1), l2;
|
|
1252
|
-
} }));
|
|
1253
|
-
} };
|
|
1254
|
-
y([m2, x$1], (a2, l2) => {
|
|
1255
|
-
var r2;
|
|
1256
|
-
n2.closeListbox(), S$1(l2, F.Loose) || (a2.preventDefault(), (r2 = o(m2)) == null || r2.focus());
|
|
1257
|
-
}, computed$2(() => e$12.value === 0)), provide(U, n2), c(computed$2(() => u$2(e$12.value, { [0]: l.Open, [1]: l.Closed })));
|
|
1258
|
-
let p2 = computed$2(() => {
|
|
1259
|
-
var a2;
|
|
1260
|
-
return (a2 = o(m2)) == null ? void 0 : a2.closest("form");
|
|
1261
|
-
});
|
|
1262
|
-
return onMounted(() => {
|
|
1263
|
-
watch([p2], () => {
|
|
1264
|
-
if (!p2.value || t2.defaultValue === void 0)
|
|
1265
|
-
return;
|
|
1266
|
-
function a2() {
|
|
1267
|
-
n2.select(t2.defaultValue);
|
|
1268
|
-
}
|
|
1269
|
-
return p2.value.addEventListener("reset", a2), () => {
|
|
1270
|
-
var l2;
|
|
1271
|
-
(l2 = p2.value) == null || l2.removeEventListener("reset", a2);
|
|
1272
|
-
};
|
|
1273
|
-
}, { immediate: true });
|
|
1274
|
-
}), () => {
|
|
1275
|
-
let _a2 = t2, { name: a2, modelValue: l2, disabled: r2 } = _a2, s2 = __objRest(_a2, ["name", "modelValue", "disabled"]), S2 = { open: e$12.value === 0, disabled: r2, value: y$12.value };
|
|
1276
|
-
return h$1(Fragment, [...a2 != null && y$12.value != null ? e({ [a2]: y$12.value }).map(([D2, j2]) => h$1(f$1, K$1({ features: a$1.Hidden, key: D2, as: "input", type: "hidden", hidden: true, readOnly: true, name: D2, value: j2 }))) : [], H$1({ ourProps: {}, theirProps: __spreadValues(__spreadValues({}, u2), T$2(s2, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"])), slot: S2, slots: b2, attrs: u2, name: "Listbox" })]);
|
|
1277
|
-
};
|
|
1278
|
-
} });
|
|
1279
|
-
defineComponent({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: () => `headlessui-listbox-label-${t$1()}` } }, setup(t2, { attrs: b2, slots: u2 }) {
|
|
1280
|
-
let L = E("ListboxLabel");
|
|
1281
|
-
function e2() {
|
|
1282
|
-
var d2;
|
|
1283
|
-
(d2 = o(L.buttonRef)) == null || d2.focus({ preventScroll: true });
|
|
1284
|
-
}
|
|
1285
|
-
return () => {
|
|
1286
|
-
let d2 = { open: L.listboxState.value === 0, disabled: L.disabled.value }, _a2 = t2, { id: m2 } = _a2, x2 = __objRest(_a2, ["id"]), f2 = { id: m2, ref: L.labelRef, onClick: e2 };
|
|
1287
|
-
return H$1({ ourProps: f2, theirProps: x2, slot: d2, attrs: b2, slots: u2, name: "ListboxLabel" });
|
|
1288
|
-
};
|
|
1289
|
-
} });
|
|
1290
|
-
let Ae = defineComponent({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-listbox-button-${t$1()}` } }, setup(t2, { attrs: b2, slots: u2, expose: L }) {
|
|
1291
|
-
let e2 = E("ListboxButton");
|
|
1292
|
-
L({ el: e2.buttonRef, $el: e2.buttonRef });
|
|
1293
|
-
function d2(o$2) {
|
|
1294
|
-
switch (o$2.key) {
|
|
1295
|
-
case o$1.Space:
|
|
1296
|
-
case o$1.Enter:
|
|
1297
|
-
case o$1.ArrowDown:
|
|
1298
|
-
o$2.preventDefault(), e2.openListbox(), nextTick(() => {
|
|
1299
|
-
var i;
|
|
1300
|
-
(i = o(e2.optionsRef)) == null || i.focus({ preventScroll: true }), e2.value.value || e2.goToOption(a$2.First);
|
|
1301
|
-
});
|
|
1302
|
-
break;
|
|
1303
|
-
case o$1.ArrowUp:
|
|
1304
|
-
o$2.preventDefault(), e2.openListbox(), nextTick(() => {
|
|
1305
|
-
var i;
|
|
1306
|
-
(i = o(e2.optionsRef)) == null || i.focus({ preventScroll: true }), e2.value.value || e2.goToOption(a$2.Last);
|
|
1307
|
-
});
|
|
1308
|
-
break;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
function m2(o2) {
|
|
1312
|
-
switch (o2.key) {
|
|
1313
|
-
case o$1.Space:
|
|
1314
|
-
o2.preventDefault();
|
|
1315
|
-
break;
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
function x2(o$12) {
|
|
1319
|
-
e2.disabled.value || (e2.listboxState.value === 0 ? (e2.closeListbox(), nextTick(() => {
|
|
1320
|
-
var i;
|
|
1321
|
-
return (i = o(e2.buttonRef)) == null ? void 0 : i.focus({ preventScroll: true });
|
|
1322
|
-
})) : (o$12.preventDefault(), e2.openListbox(), ce(() => {
|
|
1323
|
-
var i;
|
|
1324
|
-
return (i = o(e2.optionsRef)) == null ? void 0 : i.focus({ preventScroll: true });
|
|
1325
|
-
})));
|
|
1326
|
-
}
|
|
1327
|
-
let f2 = b$1(computed$2(() => ({ as: t2.as, type: b2.type })), e2.buttonRef);
|
|
1328
|
-
return () => {
|
|
1329
|
-
var h2, y2;
|
|
1330
|
-
let o$12 = { open: e2.listboxState.value === 0, disabled: e2.disabled.value, value: e2.value.value }, _a2 = t2, { id: i } = _a2, w2 = __objRest(_a2, ["id"]), R = { ref: e2.buttonRef, id: i, type: f2.value, "aria-haspopup": "listbox", "aria-controls": (h2 = o(e2.optionsRef)) == null ? void 0 : h2.id, "aria-expanded": e2.disabled.value ? void 0 : e2.listboxState.value === 0, "aria-labelledby": e2.labelRef.value ? [(y2 = o(e2.labelRef)) == null ? void 0 : y2.id, i].join(" ") : void 0, disabled: e2.disabled.value === true ? true : void 0, onKeydown: d2, onKeyup: m2, onClick: x2 };
|
|
1331
|
-
return H$1({ ourProps: R, theirProps: w2, slot: o$12, attrs: b2, slots: u2, name: "ListboxButton" });
|
|
1332
|
-
};
|
|
1333
|
-
} }), Fe = defineComponent({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: () => `headlessui-listbox-options-${t$1()}` } }, setup(t2, { attrs: b2, slots: u2, expose: L }) {
|
|
1334
|
-
let e2 = E("ListboxOptions"), d2 = ref(null);
|
|
1335
|
-
L({ el: e2.optionsRef, $el: e2.optionsRef });
|
|
1336
|
-
function m2(o$2) {
|
|
1337
|
-
switch (d2.value && clearTimeout(d2.value), o$2.key) {
|
|
1338
|
-
case o$1.Space:
|
|
1339
|
-
if (e2.searchQuery.value !== "")
|
|
1340
|
-
return o$2.preventDefault(), o$2.stopPropagation(), e2.search(o$2.key);
|
|
1341
|
-
case o$1.Enter:
|
|
1342
|
-
if (o$2.preventDefault(), o$2.stopPropagation(), e2.activeOptionIndex.value !== null) {
|
|
1343
|
-
let i = e2.options.value[e2.activeOptionIndex.value];
|
|
1344
|
-
e2.select(i.dataRef.value);
|
|
1345
|
-
}
|
|
1346
|
-
e2.mode.value === 0 && (e2.closeListbox(), nextTick(() => {
|
|
1347
|
-
var i;
|
|
1348
|
-
return (i = o(e2.buttonRef)) == null ? void 0 : i.focus({ preventScroll: true });
|
|
1349
|
-
}));
|
|
1350
|
-
break;
|
|
1351
|
-
case u$2(e2.orientation.value, { vertical: o$1.ArrowDown, horizontal: o$1.ArrowRight }):
|
|
1352
|
-
return o$2.preventDefault(), o$2.stopPropagation(), e2.goToOption(a$2.Next);
|
|
1353
|
-
case u$2(e2.orientation.value, { vertical: o$1.ArrowUp, horizontal: o$1.ArrowLeft }):
|
|
1354
|
-
return o$2.preventDefault(), o$2.stopPropagation(), e2.goToOption(a$2.Previous);
|
|
1355
|
-
case o$1.Home:
|
|
1356
|
-
case o$1.PageUp:
|
|
1357
|
-
return o$2.preventDefault(), o$2.stopPropagation(), e2.goToOption(a$2.First);
|
|
1358
|
-
case o$1.End:
|
|
1359
|
-
case o$1.PageDown:
|
|
1360
|
-
return o$2.preventDefault(), o$2.stopPropagation(), e2.goToOption(a$2.Last);
|
|
1361
|
-
case o$1.Escape:
|
|
1362
|
-
o$2.preventDefault(), o$2.stopPropagation(), e2.closeListbox(), nextTick(() => {
|
|
1363
|
-
var i;
|
|
1364
|
-
return (i = o(e2.buttonRef)) == null ? void 0 : i.focus({ preventScroll: true });
|
|
1365
|
-
});
|
|
1366
|
-
break;
|
|
1367
|
-
case o$1.Tab:
|
|
1368
|
-
o$2.preventDefault(), o$2.stopPropagation();
|
|
1369
|
-
break;
|
|
1370
|
-
default:
|
|
1371
|
-
o$2.key.length === 1 && (e2.search(o$2.key), d2.value = setTimeout(() => e2.clearSearch(), 350));
|
|
1372
|
-
break;
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
let x2 = p$3(), f2 = computed$2(() => x2 !== null ? (x2.value & l.Open) === l.Open : e2.listboxState.value === 0);
|
|
1376
|
-
return () => {
|
|
1377
|
-
var h2, y2, M2, n2;
|
|
1378
|
-
let o$12 = { open: e2.listboxState.value === 0 }, _a2 = t2, { id: i } = _a2, w2 = __objRest(_a2, ["id"]), R = { "aria-activedescendant": e2.activeOptionIndex.value === null || (h2 = e2.options.value[e2.activeOptionIndex.value]) == null ? void 0 : h2.id, "aria-multiselectable": e2.mode.value === 1 ? true : void 0, "aria-labelledby": (n2 = (y2 = o(e2.labelRef)) == null ? void 0 : y2.id) != null ? n2 : (M2 = o(e2.buttonRef)) == null ? void 0 : M2.id, "aria-orientation": e2.orientation.value, id: i, onKeydown: m2, role: "listbox", tabIndex: 0, ref: e2.optionsRef };
|
|
1379
|
-
return H$1({ ourProps: R, theirProps: w2, slot: o$12, attrs: b2, slots: u2, features: N$1.RenderStrategy | N$1.Static, visible: f2.value, name: "ListboxOptions" });
|
|
1380
|
-
};
|
|
1381
|
-
} }), Be = 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: () => `headlessui-listbox.option-${t$1()}` } }, setup(t2, { slots: b2, attrs: u$12, expose: L }) {
|
|
1382
|
-
let e2 = E("ListboxOption"), d2 = ref(null);
|
|
1383
|
-
L({ el: d2, $el: d2 });
|
|
1384
|
-
let m2 = computed$2(() => e2.activeOptionIndex.value !== null ? e2.options.value[e2.activeOptionIndex.value].id === t2.id : false), x2 = computed$2(() => u$2(e2.mode.value, { [0]: () => e2.compare(toRaw$1(e2.value.value), toRaw$1(t2.value)), [1]: () => toRaw$1(e2.value.value).some((n2) => e2.compare(toRaw$1(n2), toRaw$1(t2.value))) })), f2 = computed$2(() => u$2(e2.mode.value, { [1]: () => {
|
|
1385
|
-
var p2;
|
|
1386
|
-
let n2 = toRaw$1(e2.value.value);
|
|
1387
|
-
return ((p2 = e2.options.value.find((a2) => n2.some((l2) => e2.compare(toRaw$1(l2), toRaw$1(a2.dataRef.value))))) == null ? void 0 : p2.id) === t2.id;
|
|
1388
|
-
}, [0]: () => x2.value })), o$12 = computed$2(() => ({ disabled: t2.disabled, value: t2.value, textValue: "", domRef: d2 }));
|
|
1389
|
-
onMounted(() => {
|
|
1390
|
-
var p2, a2;
|
|
1391
|
-
let n2 = (a2 = (p2 = o(d2)) == null ? void 0 : p2.textContent) == null ? void 0 : a2.toLowerCase().trim();
|
|
1392
|
-
n2 !== void 0 && (o$12.value.textValue = n2);
|
|
1393
|
-
}), onMounted(() => e2.registerOption(t2.id, o$12)), onUnmounted(() => e2.unregisterOption(t2.id)), onMounted(() => {
|
|
1394
|
-
watch([e2.listboxState, x2], () => {
|
|
1395
|
-
e2.listboxState.value === 0 && x2.value && u$2(e2.mode.value, { [1]: () => {
|
|
1396
|
-
f2.value && e2.goToOption(a$2.Specific, t2.id);
|
|
1397
|
-
}, [0]: () => {
|
|
1398
|
-
e2.goToOption(a$2.Specific, t2.id);
|
|
1399
|
-
} });
|
|
1400
|
-
}, { immediate: true });
|
|
1401
|
-
}), watchEffect(() => {
|
|
1402
|
-
e2.listboxState.value === 0 && m2.value && e2.activationTrigger.value !== 0 && nextTick(() => {
|
|
1403
|
-
var n2, p2;
|
|
1404
|
-
return (p2 = (n2 = o(d2)) == null ? void 0 : n2.scrollIntoView) == null ? void 0 : p2.call(n2, { block: "nearest" });
|
|
1405
|
-
});
|
|
1406
|
-
});
|
|
1407
|
-
function i(n2) {
|
|
1408
|
-
if (t2.disabled)
|
|
1409
|
-
return n2.preventDefault();
|
|
1410
|
-
e2.select(t2.value), e2.mode.value === 0 && (e2.closeListbox(), nextTick(() => {
|
|
1411
|
-
var p2;
|
|
1412
|
-
return (p2 = o(e2.buttonRef)) == null ? void 0 : p2.focus({ preventScroll: true });
|
|
1413
|
-
}));
|
|
1414
|
-
}
|
|
1415
|
-
function w2() {
|
|
1416
|
-
if (t2.disabled)
|
|
1417
|
-
return e2.goToOption(a$2.Nothing);
|
|
1418
|
-
e2.goToOption(a$2.Specific, t2.id);
|
|
1419
|
-
}
|
|
1420
|
-
let R = u();
|
|
1421
|
-
function h2(n2) {
|
|
1422
|
-
R.update(n2);
|
|
1423
|
-
}
|
|
1424
|
-
function y2(n2) {
|
|
1425
|
-
R.wasMoved(n2) && (t2.disabled || m2.value || e2.goToOption(a$2.Specific, t2.id, 0));
|
|
1426
|
-
}
|
|
1427
|
-
function M2(n2) {
|
|
1428
|
-
R.wasMoved(n2) && (t2.disabled || m2.value && e2.goToOption(a$2.Nothing));
|
|
1429
|
-
}
|
|
1430
|
-
return () => {
|
|
1431
|
-
let { disabled: n2 } = t2, p2 = { active: m2.value, selected: x2.value, disabled: n2 }, _a2 = t2, { id: a2, value: l2, disabled: r2 } = _a2, s2 = __objRest(_a2, ["id", "value", "disabled"]), S2 = { id: a2, ref: d2, role: "option", tabIndex: n2 === true ? void 0 : -1, "aria-disabled": n2 === true ? true : void 0, "aria-selected": x2.value, disabled: void 0, onClick: i, onFocus: w2, onPointerenter: h2, onMouseenter: h2, onPointermove: y2, onMousemove: y2, onPointerleave: M2, onMouseleave: M2 };
|
|
1432
|
-
return H$1({ ourProps: S2, theirProps: s2, slot: p2, attrs: u$12, slots: b2, name: "ListboxOption" });
|
|
1433
|
-
};
|
|
1434
|
-
} });
|
|
1435
|
-
var X = ((l2) => (l2[l2.Open = 0] = "Open", l2[l2.Closed = 1] = "Closed", l2))(X || {}), Y = ((l2) => (l2[l2.Pointer = 0] = "Pointer", l2[l2.Other = 1] = "Other", l2))(Y || {});
|
|
1436
|
-
function Z(a2) {
|
|
1437
|
-
requestAnimationFrame(() => requestAnimationFrame(a2));
|
|
1438
|
-
}
|
|
1439
|
-
let A = Symbol("MenuContext");
|
|
1440
|
-
function P(a2) {
|
|
1441
|
-
let b2 = inject(A, null);
|
|
1442
|
-
if (b2 === null) {
|
|
1443
|
-
let l2 = new Error(`<${a2} /> is missing a parent <Menu /> component.`);
|
|
1444
|
-
throw Error.captureStackTrace && Error.captureStackTrace(l2, P), l2;
|
|
1445
|
-
}
|
|
1446
|
-
return b2;
|
|
1447
|
-
}
|
|
1448
|
-
let ge = defineComponent({ name: "Menu", props: { as: { type: [Object, String], default: "template" } }, setup(a2, { slots: b2, attrs: l$1 }) {
|
|
1449
|
-
let g = ref(1), e2 = ref(null), m2 = ref(null), s2 = ref([]), p2 = ref(""), d2 = ref(null), o$12 = ref(1);
|
|
1450
|
-
function t2(u2 = (r2) => r2) {
|
|
1451
|
-
let r2 = d2.value !== null ? s2.value[d2.value] : null, n2 = I(u2(s2.value.slice()), (I2) => o(I2.dataRef.domRef)), i = r2 ? n2.indexOf(r2) : null;
|
|
1452
|
-
return i === -1 && (i = null), { items: n2, activeItemIndex: i };
|
|
1453
|
-
}
|
|
1454
|
-
let v2 = { menuState: g, buttonRef: e2, itemsRef: m2, items: s2, searchQuery: p2, activeItemIndex: d2, activationTrigger: o$12, closeMenu: () => {
|
|
1455
|
-
g.value = 1, d2.value = null;
|
|
1456
|
-
}, openMenu: () => g.value = 0, goToItem(u2, r2, n2) {
|
|
1457
|
-
let i = t2(), I2 = x(u2 === a$2.Specific ? { focus: a$2.Specific, id: r2 } : { focus: u2 }, { resolveItems: () => i.items, resolveActiveIndex: () => i.activeItemIndex, resolveId: (M2) => M2.id, resolveDisabled: (M2) => M2.dataRef.disabled });
|
|
1458
|
-
p2.value = "", d2.value = I2, o$12.value = n2 != null ? n2 : 1, s2.value = i.items;
|
|
1459
|
-
}, search(u2) {
|
|
1460
|
-
let n2 = p2.value !== "" ? 0 : 1;
|
|
1461
|
-
p2.value += u2.toLowerCase();
|
|
1462
|
-
let I2 = (d2.value !== null ? s2.value.slice(d2.value + n2).concat(s2.value.slice(0, d2.value + n2)) : s2.value).find((O2) => O2.dataRef.textValue.startsWith(p2.value) && !O2.dataRef.disabled), M2 = I2 ? s2.value.indexOf(I2) : -1;
|
|
1463
|
-
M2 === -1 || M2 === d2.value || (d2.value = M2, o$12.value = 1);
|
|
1464
|
-
}, clearSearch() {
|
|
1465
|
-
p2.value = "";
|
|
1466
|
-
}, registerItem(u2, r2) {
|
|
1467
|
-
let n2 = t2((i) => [...i, { id: u2, dataRef: r2 }]);
|
|
1468
|
-
s2.value = n2.items, d2.value = n2.activeItemIndex, o$12.value = 1;
|
|
1469
|
-
}, unregisterItem(u2) {
|
|
1470
|
-
let r2 = t2((n2) => {
|
|
1471
|
-
let i = n2.findIndex((I2) => I2.id === u2);
|
|
1472
|
-
return i !== -1 && n2.splice(i, 1), n2;
|
|
1473
|
-
});
|
|
1474
|
-
s2.value = r2.items, d2.value = r2.activeItemIndex, o$12.value = 1;
|
|
1475
|
-
} };
|
|
1476
|
-
return y([e2, m2], (u2, r2) => {
|
|
1477
|
-
var n2;
|
|
1478
|
-
v2.closeMenu(), S$1(r2, F.Loose) || (u2.preventDefault(), (n2 = o(e2)) == null || n2.focus());
|
|
1479
|
-
}, computed$2(() => g.value === 0)), provide(A, v2), c(computed$2(() => u$2(g.value, { [0]: l.Open, [1]: l.Closed }))), () => {
|
|
1480
|
-
let u2 = { open: g.value === 0, close: v2.closeMenu };
|
|
1481
|
-
return H$1({ ourProps: {}, theirProps: a2, slot: u2, slots: b2, attrs: l$1, name: "Menu" });
|
|
1482
|
-
};
|
|
1483
|
-
} }), Se = defineComponent({ name: "MenuButton", props: { disabled: { type: Boolean, default: false }, as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-menu-button-${t$1()}` } }, setup(a2, { attrs: b2, slots: l2, expose: g }) {
|
|
1484
|
-
let e2 = P("MenuButton");
|
|
1485
|
-
g({ el: e2.buttonRef, $el: e2.buttonRef });
|
|
1486
|
-
function m2(o$2) {
|
|
1487
|
-
switch (o$2.key) {
|
|
1488
|
-
case o$1.Space:
|
|
1489
|
-
case o$1.Enter:
|
|
1490
|
-
case o$1.ArrowDown:
|
|
1491
|
-
o$2.preventDefault(), o$2.stopPropagation(), e2.openMenu(), nextTick(() => {
|
|
1492
|
-
var t2;
|
|
1493
|
-
(t2 = o(e2.itemsRef)) == null || t2.focus({ preventScroll: true }), e2.goToItem(a$2.First);
|
|
1494
|
-
});
|
|
1495
|
-
break;
|
|
1496
|
-
case o$1.ArrowUp:
|
|
1497
|
-
o$2.preventDefault(), o$2.stopPropagation(), e2.openMenu(), nextTick(() => {
|
|
1498
|
-
var t2;
|
|
1499
|
-
(t2 = o(e2.itemsRef)) == null || t2.focus({ preventScroll: true }), e2.goToItem(a$2.Last);
|
|
1500
|
-
});
|
|
1501
|
-
break;
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
function s2(o2) {
|
|
1505
|
-
switch (o2.key) {
|
|
1506
|
-
case o$1.Space:
|
|
1507
|
-
o2.preventDefault();
|
|
1508
|
-
break;
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
function p2(o$12) {
|
|
1512
|
-
a2.disabled || (e2.menuState.value === 0 ? (e2.closeMenu(), nextTick(() => {
|
|
1513
|
-
var t2;
|
|
1514
|
-
return (t2 = o(e2.buttonRef)) == null ? void 0 : t2.focus({ preventScroll: true });
|
|
1515
|
-
})) : (o$12.preventDefault(), e2.openMenu(), Z(() => {
|
|
1516
|
-
var t2;
|
|
1517
|
-
return (t2 = o(e2.itemsRef)) == null ? void 0 : t2.focus({ preventScroll: true });
|
|
1518
|
-
})));
|
|
1519
|
-
}
|
|
1520
|
-
let d2 = b$1(computed$2(() => ({ as: a2.as, type: b2.type })), e2.buttonRef);
|
|
1521
|
-
return () => {
|
|
1522
|
-
var r2;
|
|
1523
|
-
let o$12 = { open: e2.menuState.value === 0 }, _a2 = a2, { id: t2 } = _a2, v2 = __objRest(_a2, ["id"]), u2 = { ref: e2.buttonRef, id: t2, type: d2.value, "aria-haspopup": "menu", "aria-controls": (r2 = o(e2.itemsRef)) == null ? void 0 : r2.id, "aria-expanded": a2.disabled ? void 0 : e2.menuState.value === 0, onKeydown: m2, onKeyup: s2, onClick: p2 };
|
|
1524
|
-
return H$1({ ourProps: u2, theirProps: v2, slot: o$12, attrs: b2, slots: l2, name: "MenuButton" });
|
|
1525
|
-
};
|
|
1526
|
-
} }), be = defineComponent({ name: "MenuItems", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: () => `headlessui-menu-items-${t$1()}` } }, setup(a2, { attrs: b2, slots: l$1, expose: g }) {
|
|
1527
|
-
let e2 = P("MenuItems"), m2 = ref(null);
|
|
1528
|
-
g({ el: e2.itemsRef, $el: e2.itemsRef }), p$2({ container: computed$2(() => o(e2.itemsRef)), enabled: computed$2(() => e2.menuState.value === 0), accept(t2) {
|
|
1529
|
-
return t2.getAttribute("role") === "menuitem" ? NodeFilter.FILTER_REJECT : t2.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
1530
|
-
}, walk(t2) {
|
|
1531
|
-
t2.setAttribute("role", "none");
|
|
1532
|
-
} });
|
|
1533
|
-
function s2(t2) {
|
|
1534
|
-
var v$12;
|
|
1535
|
-
switch (m2.value && clearTimeout(m2.value), t2.key) {
|
|
1536
|
-
case o$1.Space:
|
|
1537
|
-
if (e2.searchQuery.value !== "")
|
|
1538
|
-
return t2.preventDefault(), t2.stopPropagation(), e2.search(t2.key);
|
|
1539
|
-
case o$1.Enter:
|
|
1540
|
-
if (t2.preventDefault(), t2.stopPropagation(), e2.activeItemIndex.value !== null) {
|
|
1541
|
-
let r2 = e2.items.value[e2.activeItemIndex.value];
|
|
1542
|
-
(v$12 = o(r2.dataRef.domRef)) == null || v$12.click();
|
|
1543
|
-
}
|
|
1544
|
-
e2.closeMenu(), v(o(e2.buttonRef));
|
|
1545
|
-
break;
|
|
1546
|
-
case o$1.ArrowDown:
|
|
1547
|
-
return t2.preventDefault(), t2.stopPropagation(), e2.goToItem(a$2.Next);
|
|
1548
|
-
case o$1.ArrowUp:
|
|
1549
|
-
return t2.preventDefault(), t2.stopPropagation(), e2.goToItem(a$2.Previous);
|
|
1550
|
-
case o$1.Home:
|
|
1551
|
-
case o$1.PageUp:
|
|
1552
|
-
return t2.preventDefault(), t2.stopPropagation(), e2.goToItem(a$2.First);
|
|
1553
|
-
case o$1.End:
|
|
1554
|
-
case o$1.PageDown:
|
|
1555
|
-
return t2.preventDefault(), t2.stopPropagation(), e2.goToItem(a$2.Last);
|
|
1556
|
-
case o$1.Escape:
|
|
1557
|
-
t2.preventDefault(), t2.stopPropagation(), e2.closeMenu(), nextTick(() => {
|
|
1558
|
-
var u2;
|
|
1559
|
-
return (u2 = o(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true });
|
|
1560
|
-
});
|
|
1561
|
-
break;
|
|
1562
|
-
case o$1.Tab:
|
|
1563
|
-
t2.preventDefault(), t2.stopPropagation(), e2.closeMenu(), nextTick(() => D(o(e2.buttonRef), t2.shiftKey ? N.Previous : N.Next));
|
|
1564
|
-
break;
|
|
1565
|
-
default:
|
|
1566
|
-
t2.key.length === 1 && (e2.search(t2.key), m2.value = setTimeout(() => e2.clearSearch(), 350));
|
|
1567
|
-
break;
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
function p2(t2) {
|
|
1571
|
-
switch (t2.key) {
|
|
1572
|
-
case o$1.Space:
|
|
1573
|
-
t2.preventDefault();
|
|
1574
|
-
break;
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
let d2 = p$3(), o$2 = computed$2(() => d2 !== null ? (d2.value & l.Open) === l.Open : e2.menuState.value === 0);
|
|
1578
|
-
return () => {
|
|
1579
|
-
var n2, i;
|
|
1580
|
-
let t2 = { open: e2.menuState.value === 0 }, _a2 = a2, { id: v2 } = _a2, u2 = __objRest(_a2, ["id"]), r2 = { "aria-activedescendant": e2.activeItemIndex.value === null || (n2 = e2.items.value[e2.activeItemIndex.value]) == null ? void 0 : n2.id, "aria-labelledby": (i = o(e2.buttonRef)) == null ? void 0 : i.id, id: v2, onKeydown: s2, onKeyup: p2, role: "menu", tabIndex: 0, ref: e2.itemsRef };
|
|
1581
|
-
return H$1({ ourProps: r2, theirProps: u2, slot: t2, attrs: b2, slots: l$1, features: N$1.RenderStrategy | N$1.Static, visible: o$2.value, name: "MenuItems" });
|
|
1582
|
-
};
|
|
1583
|
-
} }), Me = defineComponent({ name: "MenuItem", inheritAttrs: false, props: { as: { type: [Object, String], default: "template" }, disabled: { type: Boolean, default: false }, id: { type: String, default: () => `headlessui-menu-item-${t$1()}` } }, setup(a2, { slots: b2, attrs: l2, expose: g }) {
|
|
1584
|
-
let e2 = P("MenuItem"), m2 = ref(null);
|
|
1585
|
-
g({ el: m2, $el: m2 });
|
|
1586
|
-
let s2 = computed$2(() => e2.activeItemIndex.value !== null ? e2.items.value[e2.activeItemIndex.value].id === a2.id : false), p2 = computed$2(() => ({ disabled: a2.disabled, textValue: "", domRef: m2 }));
|
|
1587
|
-
onMounted(() => {
|
|
1588
|
-
var i, I2;
|
|
1589
|
-
let n2 = (I2 = (i = o(m2)) == null ? void 0 : i.textContent) == null ? void 0 : I2.toLowerCase().trim();
|
|
1590
|
-
n2 !== void 0 && (p2.value.textValue = n2);
|
|
1591
|
-
}), onMounted(() => e2.registerItem(a2.id, p2)), onUnmounted(() => e2.unregisterItem(a2.id)), watchEffect(() => {
|
|
1592
|
-
e2.menuState.value === 0 && s2.value && e2.activationTrigger.value !== 0 && nextTick(() => {
|
|
1593
|
-
var n2, i;
|
|
1594
|
-
return (i = (n2 = o(m2)) == null ? void 0 : n2.scrollIntoView) == null ? void 0 : i.call(n2, { block: "nearest" });
|
|
1595
|
-
});
|
|
1596
|
-
});
|
|
1597
|
-
function d2(n2) {
|
|
1598
|
-
if (a2.disabled)
|
|
1599
|
-
return n2.preventDefault();
|
|
1600
|
-
e2.closeMenu(), v(o(e2.buttonRef));
|
|
1601
|
-
}
|
|
1602
|
-
function o$12() {
|
|
1603
|
-
if (a2.disabled)
|
|
1604
|
-
return e2.goToItem(a$2.Nothing);
|
|
1605
|
-
e2.goToItem(a$2.Specific, a2.id);
|
|
1606
|
-
}
|
|
1607
|
-
let t2 = u();
|
|
1608
|
-
function v$12(n2) {
|
|
1609
|
-
t2.update(n2);
|
|
1610
|
-
}
|
|
1611
|
-
function u$12(n2) {
|
|
1612
|
-
t2.wasMoved(n2) && (a2.disabled || s2.value || e2.goToItem(a$2.Specific, a2.id, 0));
|
|
1613
|
-
}
|
|
1614
|
-
function r2(n2) {
|
|
1615
|
-
t2.wasMoved(n2) && (a2.disabled || s2.value && e2.goToItem(a$2.Nothing));
|
|
1616
|
-
}
|
|
1617
|
-
return () => {
|
|
1618
|
-
let { disabled: n2 } = a2, i = { active: s2.value, disabled: n2, close: e2.closeMenu }, _a2 = a2, { id: I2 } = _a2, M2 = __objRest(_a2, ["id"]);
|
|
1619
|
-
return H$1({ ourProps: { id: I2, ref: m2, role: "menuitem", tabIndex: n2 === true ? void 0 : -1, "aria-disabled": n2 === true ? true : void 0, disabled: void 0, onClick: d2, onFocus: o$12, onPointerenter: v$12, onMouseenter: v$12, onPointermove: u$12, onMousemove: u$12, onPointerleave: r2, onMouseleave: r2 }, theirProps: __spreadValues(__spreadValues({}, l2), M2), slot: i, attrs: l2, slots: b2, name: "MenuItem" });
|
|
1620
|
-
};
|
|
1621
|
-
} });
|
|
1622
|
-
let a = Symbol("LabelContext");
|
|
1623
|
-
function d() {
|
|
1624
|
-
let t2 = inject(a, null);
|
|
1625
|
-
if (t2 === null) {
|
|
1626
|
-
let n2 = new Error("You used a <Label /> component, but it is not inside a parent.");
|
|
1627
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n2, d), n2;
|
|
1628
|
-
}
|
|
1629
|
-
return t2;
|
|
1630
|
-
}
|
|
1631
|
-
function K({ slot: t2 = {}, name: n2 = "Label", props: i = {} } = {}) {
|
|
1632
|
-
let e2 = ref([]);
|
|
1633
|
-
function l2(r2) {
|
|
1634
|
-
return e2.value.push(r2), () => {
|
|
1635
|
-
let o2 = e2.value.indexOf(r2);
|
|
1636
|
-
o2 !== -1 && e2.value.splice(o2, 1);
|
|
1637
|
-
};
|
|
1638
|
-
}
|
|
1639
|
-
return provide(a, { register: l2, slot: t2, name: n2, props: i }), computed$2(() => e2.value.length > 0 ? e2.value.join(" ") : void 0);
|
|
1640
|
-
}
|
|
1641
|
-
let T = defineComponent({ name: "Label", props: { as: { type: [Object, String], default: "label" }, passive: { type: [Boolean], default: false }, id: { type: String, default: () => `headlessui-label-${t$1()}` } }, setup(t2, { slots: n2, attrs: i }) {
|
|
1642
|
-
let e2 = d();
|
|
1643
|
-
return onMounted(() => onUnmounted(e2.register(t2.id))), () => {
|
|
1644
|
-
let { name: l2 = "Label", slot: r2 = {}, props: o2 = {} } = e2, _a2 = t2, { id: p2, passive: c2 } = _a2, s2 = __objRest(_a2, ["id", "passive"]), u2 = __spreadProps(__spreadValues({}, Object.entries(o2).reduce((f2, [b2, g]) => Object.assign(f2, { [b2]: unref(g) }), {})), { id: p2 });
|
|
1645
|
-
return c2 && (delete u2.onClick, delete s2.onClick), H$1({ ourProps: u2, theirProps: s2, slot: r2, attrs: i, slots: n2, name: l2 });
|
|
1646
|
-
};
|
|
1647
|
-
} });
|
|
1648
|
-
let S = Symbol("GroupContext");
|
|
1649
|
-
defineComponent({ name: "SwitchGroup", props: { as: { type: [Object, String], default: "template" } }, setup(l2, { slots: c2, attrs: o2 }) {
|
|
1650
|
-
let r2 = ref(null), p2 = K({ name: "SwitchLabel", props: { onClick() {
|
|
1651
|
-
r2.value && (r2.value.click(), r2.value.focus({ preventScroll: true }));
|
|
1652
|
-
} } }), t2 = M({ name: "SwitchDescription" });
|
|
1653
|
-
return provide(S, { switchRef: r2, labelledby: p2, describedby: t2 }), () => H$1({ theirProps: l2, ourProps: {}, slot: {}, slots: c2, attrs: o2, name: "SwitchGroup" });
|
|
1654
|
-
} });
|
|
1655
|
-
let ue = defineComponent({ name: "Switch", emits: { "update:modelValue": (l2) => true }, props: { as: { type: [Object, String], default: "button" }, modelValue: { type: Boolean, default: void 0 }, defaultChecked: { type: Boolean, optional: true }, name: { type: String, optional: true }, value: { type: String, optional: true }, id: { type: String, default: () => `headlessui-switch-${t$1()}` } }, inheritAttrs: false, setup(l2, { emit: c2, attrs: o$2, slots: r2, expose: p2 }) {
|
|
1656
|
-
let t2 = inject(S, null), [i, s2] = d$1(computed$2(() => l2.modelValue), (e2) => c2("update:modelValue", e2), computed$2(() => l2.defaultChecked));
|
|
1657
|
-
function f2() {
|
|
1658
|
-
s2(!i.value);
|
|
1659
|
-
}
|
|
1660
|
-
let w2 = ref(null), u2 = t2 === null ? w2 : t2.switchRef, k = b$1(computed$2(() => ({ as: l2.as, type: o$2.type })), u2);
|
|
1661
|
-
p2({ el: u2, $el: u2 });
|
|
1662
|
-
function C(e2) {
|
|
1663
|
-
e2.preventDefault(), f2();
|
|
1664
|
-
}
|
|
1665
|
-
function g(e2) {
|
|
1666
|
-
e2.key === o$1.Space ? (e2.preventDefault(), f2()) : e2.key === o$1.Enter && p$1(e2.currentTarget);
|
|
1667
|
-
}
|
|
1668
|
-
function R(e2) {
|
|
1669
|
-
e2.preventDefault();
|
|
1670
|
-
}
|
|
1671
|
-
let a2 = computed$2(() => {
|
|
1672
|
-
var e2, n2;
|
|
1673
|
-
return (n2 = (e2 = o(u2)) == null ? void 0 : e2.closest) == null ? void 0 : n2.call(e2, "form");
|
|
1674
|
-
});
|
|
1675
|
-
return onMounted(() => {
|
|
1676
|
-
watch([a2], () => {
|
|
1677
|
-
if (!a2.value || l2.defaultChecked === void 0)
|
|
1678
|
-
return;
|
|
1679
|
-
function e2() {
|
|
1680
|
-
s2(l2.defaultChecked);
|
|
1681
|
-
}
|
|
1682
|
-
return a2.value.addEventListener("reset", e2), () => {
|
|
1683
|
-
var n2;
|
|
1684
|
-
(n2 = a2.value) == null || n2.removeEventListener("reset", e2);
|
|
1685
|
-
};
|
|
1686
|
-
}, { immediate: true });
|
|
1687
|
-
}), () => {
|
|
1688
|
-
let _a2 = l2, { id: e2, name: n2, value: D2 } = _a2, E2 = __objRest(_a2, ["id", "name", "value"]), K2 = { checked: i.value }, L = { id: e2, ref: u2, role: "switch", type: k.value, tabIndex: 0, "aria-checked": i.value, "aria-labelledby": t2 == null ? void 0 : t2.labelledby.value, "aria-describedby": t2 == null ? void 0 : t2.describedby.value, onClick: C, onKeyup: g, onKeypress: R };
|
|
1689
|
-
return h$1(Fragment, [n2 != null && i.value != null ? h$1(f$1, K$1({ features: a$1.Hidden, as: "input", type: "checkbox", hidden: true, readOnly: true, checked: i.value, name: n2, value: D2 })) : null, H$1({ ourProps: L, theirProps: __spreadValues(__spreadValues({}, o$2), T$2(E2, ["modelValue", "defaultChecked"])), slot: K2, attrs: o$2, slots: r2, name: "Switch" })]);
|
|
1690
|
-
};
|
|
1691
|
-
} });
|
|
1692
|
-
T;
|
|
1693
|
-
E$1;
|
|
1694
|
-
function getWindow(node) {
|
|
1695
|
-
if (node == null) {
|
|
1696
|
-
return window;
|
|
1697
|
-
}
|
|
1698
|
-
if (node.toString() !== "[object Window]") {
|
|
1699
|
-
var ownerDocument = node.ownerDocument;
|
|
1700
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
1701
|
-
}
|
|
1702
|
-
return node;
|
|
1703
|
-
}
|
|
1704
|
-
function isElement(node) {
|
|
1705
|
-
var OwnElement = getWindow(node).Element;
|
|
1706
|
-
return node instanceof OwnElement || node instanceof Element;
|
|
1707
|
-
}
|
|
1708
|
-
function isHTMLElement(node) {
|
|
1709
|
-
var OwnElement = getWindow(node).HTMLElement;
|
|
1710
|
-
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
1711
|
-
}
|
|
1712
|
-
function isShadowRoot(node) {
|
|
1713
|
-
if (typeof ShadowRoot === "undefined") {
|
|
1714
|
-
return false;
|
|
1715
|
-
}
|
|
1716
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
|
1717
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
1718
|
-
}
|
|
1719
|
-
var round = Math.round;
|
|
1720
|
-
function getUAString() {
|
|
1721
|
-
var uaData = navigator.userAgentData;
|
|
1722
|
-
if (uaData != null && uaData.brands) {
|
|
1723
|
-
return uaData.brands.map(function(item) {
|
|
1724
|
-
return item.brand + "/" + item.version;
|
|
1725
|
-
}).join(" ");
|
|
1726
|
-
}
|
|
1727
|
-
return navigator.userAgent;
|
|
1728
|
-
}
|
|
1729
|
-
function isLayoutViewport() {
|
|
1730
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
1731
|
-
}
|
|
1732
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
1733
|
-
if (includeScale === void 0) {
|
|
1734
|
-
includeScale = false;
|
|
1735
|
-
}
|
|
1736
|
-
if (isFixedStrategy === void 0) {
|
|
1737
|
-
isFixedStrategy = false;
|
|
1738
|
-
}
|
|
1739
|
-
var clientRect = element.getBoundingClientRect();
|
|
1740
|
-
var scaleX = 1;
|
|
1741
|
-
var scaleY = 1;
|
|
1742
|
-
if (includeScale && isHTMLElement(element)) {
|
|
1743
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
1744
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
1745
|
-
}
|
|
1746
|
-
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
1747
|
-
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
1748
|
-
var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
1749
|
-
var y2 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
1750
|
-
var width2 = clientRect.width / scaleX;
|
|
1751
|
-
var height2 = clientRect.height / scaleY;
|
|
1752
|
-
return {
|
|
1753
|
-
width: width2,
|
|
1754
|
-
height: height2,
|
|
1755
|
-
top: y2,
|
|
1756
|
-
right: x2 + width2,
|
|
1757
|
-
bottom: y2 + height2,
|
|
1758
|
-
left: x2,
|
|
1759
|
-
x: x2,
|
|
1760
|
-
y: y2
|
|
1761
|
-
};
|
|
1762
|
-
}
|
|
1763
|
-
function getWindowScroll(node) {
|
|
1764
|
-
var win = getWindow(node);
|
|
1765
|
-
var scrollLeft = win.pageXOffset;
|
|
1766
|
-
var scrollTop = win.pageYOffset;
|
|
1767
|
-
return {
|
|
1768
|
-
scrollLeft,
|
|
1769
|
-
scrollTop
|
|
1770
|
-
};
|
|
1771
|
-
}
|
|
1772
|
-
function getHTMLElementScroll(element) {
|
|
1773
|
-
return {
|
|
1774
|
-
scrollLeft: element.scrollLeft,
|
|
1775
|
-
scrollTop: element.scrollTop
|
|
1776
|
-
};
|
|
1777
|
-
}
|
|
1778
|
-
function getNodeScroll(node) {
|
|
1779
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
1780
|
-
return getWindowScroll(node);
|
|
1781
|
-
} else {
|
|
1782
|
-
return getHTMLElementScroll(node);
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
function getNodeName(element) {
|
|
1786
|
-
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
1787
|
-
}
|
|
1788
|
-
function getDocumentElement(element) {
|
|
1789
|
-
return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
|
1790
|
-
}
|
|
1791
|
-
function getWindowScrollBarX(element) {
|
|
1792
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
1793
|
-
}
|
|
1794
|
-
function getComputedStyle(element) {
|
|
1795
|
-
return getWindow(element).getComputedStyle(element);
|
|
1796
|
-
}
|
|
1797
|
-
function isScrollParent(element) {
|
|
1798
|
-
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
1799
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
1800
|
-
}
|
|
1801
|
-
function isElementScaled(element) {
|
|
1802
|
-
var rect = element.getBoundingClientRect();
|
|
1803
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
1804
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
1805
|
-
return scaleX !== 1 || scaleY !== 1;
|
|
1806
|
-
}
|
|
1807
|
-
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
1808
|
-
if (isFixed === void 0) {
|
|
1809
|
-
isFixed = false;
|
|
1810
|
-
}
|
|
1811
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1812
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
1813
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
1814
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
1815
|
-
var scroll = {
|
|
1816
|
-
scrollLeft: 0,
|
|
1817
|
-
scrollTop: 0
|
|
1818
|
-
};
|
|
1819
|
-
var offsets = {
|
|
1820
|
-
x: 0,
|
|
1821
|
-
y: 0
|
|
1822
|
-
};
|
|
1823
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1824
|
-
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
|
1825
|
-
scroll = getNodeScroll(offsetParent);
|
|
1826
|
-
}
|
|
1827
|
-
if (isHTMLElement(offsetParent)) {
|
|
1828
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
1829
|
-
offsets.x += offsetParent.clientLeft;
|
|
1830
|
-
offsets.y += offsetParent.clientTop;
|
|
1831
|
-
} else if (documentElement) {
|
|
1832
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
return {
|
|
1836
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1837
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1838
|
-
width: rect.width,
|
|
1839
|
-
height: rect.height
|
|
1840
|
-
};
|
|
1841
|
-
}
|
|
1842
|
-
function getLayoutRect(element) {
|
|
1843
|
-
var clientRect = getBoundingClientRect(element);
|
|
1844
|
-
var width2 = element.offsetWidth;
|
|
1845
|
-
var height2 = element.offsetHeight;
|
|
1846
|
-
if (Math.abs(clientRect.width - width2) <= 1) {
|
|
1847
|
-
width2 = clientRect.width;
|
|
1848
|
-
}
|
|
1849
|
-
if (Math.abs(clientRect.height - height2) <= 1) {
|
|
1850
|
-
height2 = clientRect.height;
|
|
1851
|
-
}
|
|
1852
|
-
return {
|
|
1853
|
-
x: element.offsetLeft,
|
|
1854
|
-
y: element.offsetTop,
|
|
1855
|
-
width: width2,
|
|
1856
|
-
height: height2
|
|
1857
|
-
};
|
|
1858
|
-
}
|
|
1859
|
-
function getParentNode(element) {
|
|
1860
|
-
if (getNodeName(element) === "html") {
|
|
1861
|
-
return element;
|
|
1862
|
-
}
|
|
1863
|
-
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
|
1864
|
-
}
|
|
1865
|
-
function getScrollParent(node) {
|
|
1866
|
-
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
1867
|
-
return node.ownerDocument.body;
|
|
1868
|
-
}
|
|
1869
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
1870
|
-
return node;
|
|
1871
|
-
}
|
|
1872
|
-
return getScrollParent(getParentNode(node));
|
|
1873
|
-
}
|
|
1874
|
-
function listScrollParents(element, list) {
|
|
1875
|
-
var _element$ownerDocumen;
|
|
1876
|
-
if (list === void 0) {
|
|
1877
|
-
list = [];
|
|
1878
|
-
}
|
|
1879
|
-
var scrollParent = getScrollParent(element);
|
|
1880
|
-
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
1881
|
-
var win = getWindow(scrollParent);
|
|
1882
|
-
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
1883
|
-
var updatedList = list.concat(target);
|
|
1884
|
-
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
|
1885
|
-
}
|
|
1886
|
-
function isTableElement(element) {
|
|
1887
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
1888
|
-
}
|
|
1889
|
-
function getTrueOffsetParent(element) {
|
|
1890
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
1891
|
-
return null;
|
|
1892
|
-
}
|
|
1893
|
-
return element.offsetParent;
|
|
1894
|
-
}
|
|
1895
|
-
function getContainingBlock(element) {
|
|
1896
|
-
var isFirefox = /firefox/i.test(getUAString());
|
|
1897
|
-
var isIE = /Trident/i.test(getUAString());
|
|
1898
|
-
if (isIE && isHTMLElement(element)) {
|
|
1899
|
-
var elementCss = getComputedStyle(element);
|
|
1900
|
-
if (elementCss.position === "fixed") {
|
|
1901
|
-
return null;
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
var currentNode = getParentNode(element);
|
|
1905
|
-
if (isShadowRoot(currentNode)) {
|
|
1906
|
-
currentNode = currentNode.host;
|
|
1907
|
-
}
|
|
1908
|
-
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
1909
|
-
var css = getComputedStyle(currentNode);
|
|
1910
|
-
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") {
|
|
1911
|
-
return currentNode;
|
|
1912
|
-
} else {
|
|
1913
|
-
currentNode = currentNode.parentNode;
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
return null;
|
|
1917
|
-
}
|
|
1918
|
-
function getOffsetParent(element) {
|
|
1919
|
-
var window2 = getWindow(element);
|
|
1920
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
1921
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
1922
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1923
|
-
}
|
|
1924
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
|
1925
|
-
return window2;
|
|
1926
|
-
}
|
|
1927
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
1928
|
-
}
|
|
1929
|
-
var top = "top";
|
|
1930
|
-
var bottom = "bottom";
|
|
1931
|
-
var right = "right";
|
|
1932
|
-
var left = "left";
|
|
1933
|
-
var start = "start";
|
|
1934
|
-
var end = "end";
|
|
1935
|
-
var beforeRead = "beforeRead";
|
|
1936
|
-
var read = "read";
|
|
1937
|
-
var afterRead = "afterRead";
|
|
1938
|
-
var beforeMain = "beforeMain";
|
|
1939
|
-
var main = "main";
|
|
1940
|
-
var afterMain = "afterMain";
|
|
1941
|
-
var beforeWrite = "beforeWrite";
|
|
1942
|
-
var write = "write";
|
|
1943
|
-
var afterWrite = "afterWrite";
|
|
1944
|
-
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
1945
|
-
function order(modifiers) {
|
|
1946
|
-
var map = /* @__PURE__ */ new Map();
|
|
1947
|
-
var visited = /* @__PURE__ */ new Set();
|
|
1948
|
-
var result = [];
|
|
1949
|
-
modifiers.forEach(function(modifier) {
|
|
1950
|
-
map.set(modifier.name, modifier);
|
|
1951
|
-
});
|
|
1952
|
-
function sort(modifier) {
|
|
1953
|
-
visited.add(modifier.name);
|
|
1954
|
-
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
1955
|
-
requires.forEach(function(dep) {
|
|
1956
|
-
if (!visited.has(dep)) {
|
|
1957
|
-
var depModifier = map.get(dep);
|
|
1958
|
-
if (depModifier) {
|
|
1959
|
-
sort(depModifier);
|
|
1960
|
-
}
|
|
1961
|
-
}
|
|
1962
|
-
});
|
|
1963
|
-
result.push(modifier);
|
|
1964
|
-
}
|
|
1965
|
-
modifiers.forEach(function(modifier) {
|
|
1966
|
-
if (!visited.has(modifier.name)) {
|
|
1967
|
-
sort(modifier);
|
|
1968
|
-
}
|
|
1969
|
-
});
|
|
1970
|
-
return result;
|
|
1971
|
-
}
|
|
1972
|
-
function orderModifiers(modifiers) {
|
|
1973
|
-
var orderedModifiers = order(modifiers);
|
|
1974
|
-
return modifierPhases.reduce(function(acc, phase) {
|
|
1975
|
-
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
1976
|
-
return modifier.phase === phase;
|
|
1977
|
-
}));
|
|
1978
|
-
}, []);
|
|
1979
|
-
}
|
|
1980
|
-
function debounce(fn2) {
|
|
1981
|
-
var pending;
|
|
1982
|
-
return function() {
|
|
1983
|
-
if (!pending) {
|
|
1984
|
-
pending = new Promise(function(resolve) {
|
|
1985
|
-
Promise.resolve().then(function() {
|
|
1986
|
-
pending = void 0;
|
|
1987
|
-
resolve(fn2());
|
|
1988
|
-
});
|
|
1989
|
-
});
|
|
1990
|
-
}
|
|
1991
|
-
return pending;
|
|
1992
|
-
};
|
|
1993
|
-
}
|
|
1994
|
-
function getBasePlacement(placement) {
|
|
1995
|
-
return placement.split("-")[0];
|
|
1996
|
-
}
|
|
1997
|
-
function mergeByName(modifiers) {
|
|
1998
|
-
var merged = modifiers.reduce(function(merged2, current) {
|
|
1999
|
-
var existing = merged2[current.name];
|
|
2000
|
-
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
2001
|
-
options: Object.assign({}, existing.options, current.options),
|
|
2002
|
-
data: Object.assign({}, existing.data, current.data)
|
|
2003
|
-
}) : current;
|
|
2004
|
-
return merged2;
|
|
2005
|
-
}, {});
|
|
2006
|
-
return Object.keys(merged).map(function(key) {
|
|
2007
|
-
return merged[key];
|
|
2008
|
-
});
|
|
2009
|
-
}
|
|
2010
|
-
function getVariation(placement) {
|
|
2011
|
-
return placement.split("-")[1];
|
|
2012
|
-
}
|
|
2013
|
-
function getMainAxisFromPlacement(placement) {
|
|
2014
|
-
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
2015
|
-
}
|
|
2016
|
-
function computeOffsets(_ref) {
|
|
2017
|
-
var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
2018
|
-
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
2019
|
-
var variation = placement ? getVariation(placement) : null;
|
|
2020
|
-
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
2021
|
-
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
2022
|
-
var offsets;
|
|
2023
|
-
switch (basePlacement) {
|
|
2024
|
-
case top:
|
|
2025
|
-
offsets = {
|
|
2026
|
-
x: commonX,
|
|
2027
|
-
y: reference.y - element.height
|
|
2028
|
-
};
|
|
2029
|
-
break;
|
|
2030
|
-
case bottom:
|
|
2031
|
-
offsets = {
|
|
2032
|
-
x: commonX,
|
|
2033
|
-
y: reference.y + reference.height
|
|
2034
|
-
};
|
|
2035
|
-
break;
|
|
2036
|
-
case right:
|
|
2037
|
-
offsets = {
|
|
2038
|
-
x: reference.x + reference.width,
|
|
2039
|
-
y: commonY
|
|
2040
|
-
};
|
|
2041
|
-
break;
|
|
2042
|
-
case left:
|
|
2043
|
-
offsets = {
|
|
2044
|
-
x: reference.x - element.width,
|
|
2045
|
-
y: commonY
|
|
2046
|
-
};
|
|
2047
|
-
break;
|
|
2048
|
-
default:
|
|
2049
|
-
offsets = {
|
|
2050
|
-
x: reference.x,
|
|
2051
|
-
y: reference.y
|
|
2052
|
-
};
|
|
2053
|
-
}
|
|
2054
|
-
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
2055
|
-
if (mainAxis != null) {
|
|
2056
|
-
var len = mainAxis === "y" ? "height" : "width";
|
|
2057
|
-
switch (variation) {
|
|
2058
|
-
case start:
|
|
2059
|
-
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
2060
|
-
break;
|
|
2061
|
-
case end:
|
|
2062
|
-
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
2063
|
-
break;
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
return offsets;
|
|
2067
|
-
}
|
|
2068
|
-
var DEFAULT_OPTIONS = {
|
|
2069
|
-
placement: "bottom",
|
|
2070
|
-
modifiers: [],
|
|
2071
|
-
strategy: "absolute"
|
|
2072
|
-
};
|
|
2073
|
-
function areValidElements() {
|
|
2074
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2075
|
-
args[_key] = arguments[_key];
|
|
2076
|
-
}
|
|
2077
|
-
return !args.some(function(element) {
|
|
2078
|
-
return !(element && typeof element.getBoundingClientRect === "function");
|
|
2079
|
-
});
|
|
2080
|
-
}
|
|
2081
|
-
function popperGenerator(generatorOptions) {
|
|
2082
|
-
if (generatorOptions === void 0) {
|
|
2083
|
-
generatorOptions = {};
|
|
2084
|
-
}
|
|
2085
|
-
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;
|
|
2086
|
-
return function createPopper2(reference, popper, options) {
|
|
2087
|
-
if (options === void 0) {
|
|
2088
|
-
options = defaultOptions;
|
|
2089
|
-
}
|
|
2090
|
-
var state = {
|
|
2091
|
-
placement: "bottom",
|
|
2092
|
-
orderedModifiers: [],
|
|
2093
|
-
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
2094
|
-
modifiersData: {},
|
|
2095
|
-
elements: {
|
|
2096
|
-
reference,
|
|
2097
|
-
popper
|
|
2098
|
-
},
|
|
2099
|
-
attributes: {},
|
|
2100
|
-
styles: {}
|
|
2101
|
-
};
|
|
2102
|
-
var effectCleanupFns = [];
|
|
2103
|
-
var isDestroyed = false;
|
|
2104
|
-
var instance = {
|
|
2105
|
-
state,
|
|
2106
|
-
setOptions: function setOptions(setOptionsAction) {
|
|
2107
|
-
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
2108
|
-
cleanupModifierEffects();
|
|
2109
|
-
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
2110
|
-
state.scrollParents = {
|
|
2111
|
-
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
2112
|
-
popper: listScrollParents(popper)
|
|
2113
|
-
};
|
|
2114
|
-
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
2115
|
-
state.orderedModifiers = orderedModifiers.filter(function(m2) {
|
|
2116
|
-
return m2.enabled;
|
|
2117
|
-
});
|
|
2118
|
-
runModifierEffects();
|
|
2119
|
-
return instance.update();
|
|
2120
|
-
},
|
|
2121
|
-
forceUpdate: function forceUpdate() {
|
|
2122
|
-
if (isDestroyed) {
|
|
2123
|
-
return;
|
|
2124
|
-
}
|
|
2125
|
-
var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;
|
|
2126
|
-
if (!areValidElements(reference2, popper2)) {
|
|
2127
|
-
return;
|
|
2128
|
-
}
|
|
2129
|
-
state.rects = {
|
|
2130
|
-
reference: getCompositeRect(reference2, getOffsetParent(popper2), state.options.strategy === "fixed"),
|
|
2131
|
-
popper: getLayoutRect(popper2)
|
|
2132
|
-
};
|
|
2133
|
-
state.reset = false;
|
|
2134
|
-
state.placement = state.options.placement;
|
|
2135
|
-
state.orderedModifiers.forEach(function(modifier) {
|
|
2136
|
-
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
2137
|
-
});
|
|
2138
|
-
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
2139
|
-
if (state.reset === true) {
|
|
2140
|
-
state.reset = false;
|
|
2141
|
-
index = -1;
|
|
2142
|
-
continue;
|
|
2143
|
-
}
|
|
2144
|
-
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;
|
|
2145
|
-
if (typeof fn2 === "function") {
|
|
2146
|
-
state = fn2({
|
|
2147
|
-
state,
|
|
2148
|
-
options: _options,
|
|
2149
|
-
name,
|
|
2150
|
-
instance
|
|
2151
|
-
}) || state;
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
},
|
|
2155
|
-
update: debounce(function() {
|
|
2156
|
-
return new Promise(function(resolve) {
|
|
2157
|
-
instance.forceUpdate();
|
|
2158
|
-
resolve(state);
|
|
2159
|
-
});
|
|
2160
|
-
}),
|
|
2161
|
-
destroy: function destroy() {
|
|
2162
|
-
cleanupModifierEffects();
|
|
2163
|
-
isDestroyed = true;
|
|
2164
|
-
}
|
|
2165
|
-
};
|
|
2166
|
-
if (!areValidElements(reference, popper)) {
|
|
2167
|
-
return instance;
|
|
2168
|
-
}
|
|
2169
|
-
instance.setOptions(options).then(function(state2) {
|
|
2170
|
-
if (!isDestroyed && options.onFirstUpdate) {
|
|
2171
|
-
options.onFirstUpdate(state2);
|
|
2172
|
-
}
|
|
2173
|
-
});
|
|
2174
|
-
function runModifierEffects() {
|
|
2175
|
-
state.orderedModifiers.forEach(function(_ref3) {
|
|
2176
|
-
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
|
2177
|
-
if (typeof effect2 === "function") {
|
|
2178
|
-
var cleanupFn = effect2({
|
|
2179
|
-
state,
|
|
2180
|
-
name,
|
|
2181
|
-
instance,
|
|
2182
|
-
options: options2
|
|
2183
|
-
});
|
|
2184
|
-
var noopFn = function noopFn2() {
|
|
2185
|
-
};
|
|
2186
|
-
effectCleanupFns.push(cleanupFn || noopFn);
|
|
2187
|
-
}
|
|
2188
|
-
});
|
|
2189
|
-
}
|
|
2190
|
-
function cleanupModifierEffects() {
|
|
2191
|
-
effectCleanupFns.forEach(function(fn2) {
|
|
2192
|
-
return fn2();
|
|
2193
|
-
});
|
|
2194
|
-
effectCleanupFns = [];
|
|
2195
|
-
}
|
|
2196
|
-
return instance;
|
|
2197
|
-
};
|
|
2198
|
-
}
|
|
2199
|
-
var passive = {
|
|
2200
|
-
passive: true
|
|
2201
|
-
};
|
|
2202
|
-
function effect$1(_ref) {
|
|
2203
|
-
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
2204
|
-
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;
|
|
2205
|
-
var window2 = getWindow(state.elements.popper);
|
|
2206
|
-
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
2207
|
-
if (scroll) {
|
|
2208
|
-
scrollParents.forEach(function(scrollParent) {
|
|
2209
|
-
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
2210
|
-
});
|
|
2211
|
-
}
|
|
2212
|
-
if (resize) {
|
|
2213
|
-
window2.addEventListener("resize", instance.update, passive);
|
|
2214
|
-
}
|
|
2215
|
-
return function() {
|
|
2216
|
-
if (scroll) {
|
|
2217
|
-
scrollParents.forEach(function(scrollParent) {
|
|
2218
|
-
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
2219
|
-
});
|
|
2220
|
-
}
|
|
2221
|
-
if (resize) {
|
|
2222
|
-
window2.removeEventListener("resize", instance.update, passive);
|
|
2223
|
-
}
|
|
2224
|
-
};
|
|
2225
|
-
}
|
|
2226
|
-
var eventListeners = {
|
|
2227
|
-
name: "eventListeners",
|
|
2228
|
-
enabled: true,
|
|
2229
|
-
phase: "write",
|
|
2230
|
-
fn: function fn() {
|
|
2231
|
-
},
|
|
2232
|
-
effect: effect$1,
|
|
2233
|
-
data: {}
|
|
2234
|
-
};
|
|
2235
|
-
function popperOffsets(_ref) {
|
|
2236
|
-
var state = _ref.state, name = _ref.name;
|
|
2237
|
-
state.modifiersData[name] = computeOffsets({
|
|
2238
|
-
reference: state.rects.reference,
|
|
2239
|
-
element: state.rects.popper,
|
|
2240
|
-
strategy: "absolute",
|
|
2241
|
-
placement: state.placement
|
|
2242
|
-
});
|
|
2243
|
-
}
|
|
2244
|
-
var popperOffsets$1 = {
|
|
2245
|
-
name: "popperOffsets",
|
|
2246
|
-
enabled: true,
|
|
2247
|
-
phase: "read",
|
|
2248
|
-
fn: popperOffsets,
|
|
2249
|
-
data: {}
|
|
2250
|
-
};
|
|
2251
|
-
var unsetSides = {
|
|
2252
|
-
top: "auto",
|
|
2253
|
-
right: "auto",
|
|
2254
|
-
bottom: "auto",
|
|
2255
|
-
left: "auto"
|
|
2256
|
-
};
|
|
2257
|
-
function roundOffsetsByDPR(_ref) {
|
|
2258
|
-
var x2 = _ref.x, y2 = _ref.y;
|
|
2259
|
-
var win = window;
|
|
2260
|
-
var dpr = win.devicePixelRatio || 1;
|
|
2261
|
-
return {
|
|
2262
|
-
x: round(x2 * dpr) / dpr || 0,
|
|
2263
|
-
y: round(y2 * dpr) / dpr || 0
|
|
2264
|
-
};
|
|
2265
|
-
}
|
|
2266
|
-
function mapToStyles(_ref2) {
|
|
2267
|
-
var _Object$assign2;
|
|
2268
|
-
var popper = _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;
|
|
2269
|
-
var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y2 = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
2270
|
-
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
2271
|
-
x: x2,
|
|
2272
|
-
y: y2
|
|
2273
|
-
}) : {
|
|
2274
|
-
x: x2,
|
|
2275
|
-
y: y2
|
|
2276
|
-
};
|
|
2277
|
-
x2 = _ref3.x;
|
|
2278
|
-
y2 = _ref3.y;
|
|
2279
|
-
var hasX = offsets.hasOwnProperty("x");
|
|
2280
|
-
var hasY = offsets.hasOwnProperty("y");
|
|
2281
|
-
var sideX = left;
|
|
2282
|
-
var sideY = top;
|
|
2283
|
-
var win = window;
|
|
2284
|
-
if (adaptive) {
|
|
2285
|
-
var offsetParent = getOffsetParent(popper);
|
|
2286
|
-
var heightProp = "clientHeight";
|
|
2287
|
-
var widthProp = "clientWidth";
|
|
2288
|
-
if (offsetParent === getWindow(popper)) {
|
|
2289
|
-
offsetParent = getDocumentElement(popper);
|
|
2290
|
-
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
|
2291
|
-
heightProp = "scrollHeight";
|
|
2292
|
-
widthProp = "scrollWidth";
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
offsetParent = offsetParent;
|
|
2296
|
-
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
2297
|
-
sideY = bottom;
|
|
2298
|
-
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
|
2299
|
-
y2 -= offsetY - popperRect.height;
|
|
2300
|
-
y2 *= gpuAcceleration ? 1 : -1;
|
|
2301
|
-
}
|
|
2302
|
-
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
2303
|
-
sideX = right;
|
|
2304
|
-
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
|
2305
|
-
x2 -= offsetX - popperRect.width;
|
|
2306
|
-
x2 *= gpuAcceleration ? 1 : -1;
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
var commonStyles = Object.assign({
|
|
2310
|
-
position
|
|
2311
|
-
}, adaptive && unsetSides);
|
|
2312
|
-
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
2313
|
-
x: x2,
|
|
2314
|
-
y: y2
|
|
2315
|
-
}) : {
|
|
2316
|
-
x: x2,
|
|
2317
|
-
y: y2
|
|
2318
|
-
};
|
|
2319
|
-
x2 = _ref4.x;
|
|
2320
|
-
y2 = _ref4.y;
|
|
2321
|
-
if (gpuAcceleration) {
|
|
2322
|
-
var _Object$assign;
|
|
2323
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _Object$assign));
|
|
2324
|
-
}
|
|
2325
|
-
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
2326
|
-
}
|
|
2327
|
-
function computeStyles(_ref5) {
|
|
2328
|
-
var state = _ref5.state, options = _ref5.options;
|
|
2329
|
-
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;
|
|
2330
|
-
var commonStyles = {
|
|
2331
|
-
placement: getBasePlacement(state.placement),
|
|
2332
|
-
variation: getVariation(state.placement),
|
|
2333
|
-
popper: state.elements.popper,
|
|
2334
|
-
popperRect: state.rects.popper,
|
|
2335
|
-
gpuAcceleration,
|
|
2336
|
-
isFixed: state.options.strategy === "fixed"
|
|
2337
|
-
};
|
|
2338
|
-
if (state.modifiersData.popperOffsets != null) {
|
|
2339
|
-
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
2340
|
-
offsets: state.modifiersData.popperOffsets,
|
|
2341
|
-
position: state.options.strategy,
|
|
2342
|
-
adaptive,
|
|
2343
|
-
roundOffsets
|
|
2344
|
-
})));
|
|
2345
|
-
}
|
|
2346
|
-
if (state.modifiersData.arrow != null) {
|
|
2347
|
-
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
2348
|
-
offsets: state.modifiersData.arrow,
|
|
2349
|
-
position: "absolute",
|
|
2350
|
-
adaptive: false,
|
|
2351
|
-
roundOffsets
|
|
2352
|
-
})));
|
|
2353
|
-
}
|
|
2354
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
2355
|
-
"data-popper-placement": state.placement
|
|
2356
|
-
});
|
|
2357
|
-
}
|
|
2358
|
-
var computeStyles$1 = {
|
|
2359
|
-
name: "computeStyles",
|
|
2360
|
-
enabled: true,
|
|
2361
|
-
phase: "beforeWrite",
|
|
2362
|
-
fn: computeStyles,
|
|
2363
|
-
data: {}
|
|
2364
|
-
};
|
|
2365
|
-
function applyStyles(_ref) {
|
|
2366
|
-
var state = _ref.state;
|
|
2367
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
2368
|
-
var style = state.styles[name] || {};
|
|
2369
|
-
var attributes = state.attributes[name] || {};
|
|
2370
|
-
var element = state.elements[name];
|
|
2371
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
2372
|
-
return;
|
|
2373
|
-
}
|
|
2374
|
-
Object.assign(element.style, style);
|
|
2375
|
-
Object.keys(attributes).forEach(function(name2) {
|
|
2376
|
-
var value = attributes[name2];
|
|
2377
|
-
if (value === false) {
|
|
2378
|
-
element.removeAttribute(name2);
|
|
2379
|
-
} else {
|
|
2380
|
-
element.setAttribute(name2, value === true ? "" : value);
|
|
2381
|
-
}
|
|
2382
|
-
});
|
|
2383
|
-
});
|
|
2384
|
-
}
|
|
2385
|
-
function effect(_ref2) {
|
|
2386
|
-
var state = _ref2.state;
|
|
2387
|
-
var initialStyles = {
|
|
2388
|
-
popper: {
|
|
2389
|
-
position: state.options.strategy,
|
|
2390
|
-
left: "0",
|
|
2391
|
-
top: "0",
|
|
2392
|
-
margin: "0"
|
|
2393
|
-
},
|
|
2394
|
-
arrow: {
|
|
2395
|
-
position: "absolute"
|
|
2396
|
-
},
|
|
2397
|
-
reference: {}
|
|
2398
|
-
};
|
|
2399
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
2400
|
-
state.styles = initialStyles;
|
|
2401
|
-
if (state.elements.arrow) {
|
|
2402
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
2403
|
-
}
|
|
2404
|
-
return function() {
|
|
2405
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
2406
|
-
var element = state.elements[name];
|
|
2407
|
-
var attributes = state.attributes[name] || {};
|
|
2408
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
2409
|
-
var style = styleProperties.reduce(function(style2, property) {
|
|
2410
|
-
style2[property] = "";
|
|
2411
|
-
return style2;
|
|
2412
|
-
}, {});
|
|
2413
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
2414
|
-
return;
|
|
2415
|
-
}
|
|
2416
|
-
Object.assign(element.style, style);
|
|
2417
|
-
Object.keys(attributes).forEach(function(attribute) {
|
|
2418
|
-
element.removeAttribute(attribute);
|
|
2419
|
-
});
|
|
2420
|
-
});
|
|
2421
|
-
};
|
|
2422
|
-
}
|
|
2423
|
-
var applyStyles$1 = {
|
|
2424
|
-
name: "applyStyles",
|
|
2425
|
-
enabled: true,
|
|
2426
|
-
phase: "write",
|
|
2427
|
-
fn: applyStyles,
|
|
2428
|
-
effect,
|
|
2429
|
-
requires: ["computeStyles"]
|
|
2430
|
-
};
|
|
2431
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
|
2432
|
-
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
2433
|
-
defaultModifiers
|
|
2434
|
-
});
|
|
2435
|
-
function usePopper(options) {
|
|
2436
|
-
const reference = ref(null);
|
|
2437
|
-
const popper = ref(null);
|
|
2438
|
-
onMounted(() => {
|
|
2439
|
-
watchEffect((onInvalidate) => {
|
|
2440
|
-
if (!popper.value)
|
|
2441
|
-
return;
|
|
2442
|
-
if (!reference.value)
|
|
2443
|
-
return;
|
|
2444
|
-
const popperEl = popper.value.el || popper.value;
|
|
2445
|
-
const referenceEl = reference.value.el || reference.value;
|
|
2446
|
-
if (!(referenceEl instanceof HTMLElement))
|
|
2447
|
-
return;
|
|
2448
|
-
if (!(popperEl instanceof HTMLElement))
|
|
2449
|
-
return;
|
|
2450
|
-
const { destroy } = createPopper(referenceEl, popperEl, options);
|
|
2451
|
-
onInvalidate(destroy);
|
|
2452
|
-
});
|
|
2453
|
-
});
|
|
2454
|
-
return [reference, popper];
|
|
2455
|
-
}
|
|
2456
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2457
|
-
__name: "MenuContainer",
|
|
2458
|
-
props: {
|
|
2459
|
-
position: { default: "left" },
|
|
2460
|
-
usePortal: { type: [Boolean, String], default: false }
|
|
2461
|
-
},
|
|
2462
|
-
setup(__props) {
|
|
2463
|
-
const props = __props;
|
|
2464
|
-
const placement = props.position === "left" ? "bottom-end" : "bottom-start";
|
|
2465
|
-
const [button, container] = usePopper({ placement });
|
|
2466
|
-
return (_ctx, _cache) => {
|
|
2467
|
-
return openBlock(), createBlock(unref(ge), {
|
|
2468
|
-
as: "div",
|
|
2469
|
-
class: "relative inline-block text-left"
|
|
2470
|
-
}, {
|
|
2471
|
-
default: withCtx(({ open }) => [
|
|
2472
|
-
createVNode(unref(Se), {
|
|
2473
|
-
class: "focus:outline-none",
|
|
2474
|
-
ref_key: "button",
|
|
2475
|
-
ref: button
|
|
2476
|
-
}, {
|
|
2477
|
-
default: withCtx(() => [
|
|
2478
|
-
renderSlot(_ctx.$slots, "button", {}, () => [
|
|
2479
|
-
createVNode(unref(_sfc_main$b), {
|
|
2480
|
-
class: "fill-current",
|
|
2481
|
-
name: "ellipsis-h"
|
|
2482
|
-
})
|
|
2483
|
-
])
|
|
2484
|
-
]),
|
|
2485
|
-
_: 3
|
|
2486
|
-
}, 512),
|
|
2487
|
-
(openBlock(), createBlock(Teleport, {
|
|
2488
|
-
to: typeof __props.usePortal === "string" ? __props.usePortal : "body",
|
|
2489
|
-
disabled: !__props.usePortal
|
|
2490
|
-
}, [
|
|
2491
|
-
createElementVNode("div", {
|
|
2492
|
-
ref_key: "container",
|
|
2493
|
-
ref: container,
|
|
2494
|
-
class: normalizeClass(["w-56", open ? "mt-" : "mt-px"])
|
|
2495
|
-
}, [
|
|
2496
|
-
createVNode(Transition, {
|
|
2497
|
-
"enter-active-class": "transition duration-200 ease-in-out",
|
|
2498
|
-
"enter-from-class": "transform -translate-y-4 opacity-0",
|
|
2499
|
-
"enter-to-class": "transform opacity-100",
|
|
2500
|
-
"leave-active-class": "transition duration-100 ease-in-out",
|
|
2501
|
-
"leave-from-class": "transform opacity-100",
|
|
2502
|
-
"leave-to-class": "transform -translate-y-2 opacity-0"
|
|
2503
|
-
}, {
|
|
2504
|
-
default: withCtx(() => [
|
|
2505
|
-
createVNode(unref(be), {
|
|
2506
|
-
class: normalizeClass([
|
|
2507
|
-
{
|
|
2508
|
-
"absolute left-0 origin-top-left": !__props.usePortal && __props.position === "right",
|
|
2509
|
-
"absolute right-0 origin-top-right": !__props.usePortal && __props.position === "left"
|
|
2510
|
-
},
|
|
2511
|
-
"z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"
|
|
2512
|
-
])
|
|
2513
|
-
}, {
|
|
2514
|
-
default: withCtx(() => [
|
|
2515
|
-
renderSlot(_ctx.$slots, "default")
|
|
2516
|
-
]),
|
|
2517
|
-
_: 3
|
|
2518
|
-
}, 8, ["class"])
|
|
2519
|
-
]),
|
|
2520
|
-
_: 3
|
|
2521
|
-
})
|
|
2522
|
-
], 2)
|
|
2523
|
-
], 8, ["to", "disabled"]))
|
|
2524
|
-
]),
|
|
2525
|
-
_: 3
|
|
2526
|
-
});
|
|
2527
|
-
};
|
|
2528
|
-
}
|
|
2529
|
-
});
|
|
2530
|
-
const _hoisted_1$4 = {
|
|
2531
|
-
key: 0,
|
|
2532
|
-
class: "bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"
|
|
2533
|
-
};
|
|
2534
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2535
|
-
__name: "MenuLink",
|
|
2536
|
-
props: {
|
|
2537
|
-
label: null,
|
|
2538
|
-
meta: null,
|
|
2539
|
-
disabled: { type: Boolean },
|
|
2540
|
-
as: null
|
|
2541
|
-
},
|
|
2542
|
-
setup(__props) {
|
|
2543
|
-
return (_ctx, _cache) => {
|
|
2544
|
-
return openBlock(), createBlock(unref(Me), normalizeProps(guardReactiveProps({ disabled: __props.disabled })), {
|
|
2545
|
-
default: withCtx(({ active }) => [
|
|
2546
|
-
(openBlock(), createBlock(resolveDynamicComponent(__props.as || "span"), {
|
|
2547
|
-
class: normalizeClass(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
|
|
2548
|
-
active ? "bg-grey-200" : "",
|
|
2549
|
-
__props.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
|
|
2550
|
-
]])
|
|
2551
|
-
}, {
|
|
2552
|
-
default: withCtx(() => [
|
|
2553
|
-
createElementVNode("span", null, toDisplayString(__props.label), 1),
|
|
2554
|
-
__props.meta ? (openBlock(), createElementBlock("span", _hoisted_1$4, toDisplayString(__props.meta), 1)) : createCommentVNode("", true)
|
|
2555
|
-
]),
|
|
2556
|
-
_: 2
|
|
2557
|
-
}, 1032, ["class"]))
|
|
2558
|
-
]),
|
|
2559
|
-
_: 1
|
|
2560
|
-
}, 16);
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
});
|
|
2564
|
-
const _hoisted_1$3 = { class: "relative" };
|
|
2565
|
-
const _hoisted_2$2 = {
|
|
2566
|
-
key: 0,
|
|
2567
|
-
class: "absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"
|
|
2568
|
-
};
|
|
2569
|
-
const _hoisted_3$1 = {
|
|
2570
|
-
key: 1,
|
|
2571
|
-
class: "block truncate"
|
|
2572
|
-
};
|
|
2573
|
-
const _hoisted_4$1 = {
|
|
2574
|
-
key: 2,
|
|
2575
|
-
class: "text-grey-500 truncate"
|
|
2576
|
-
};
|
|
2577
|
-
const _hoisted_5$1 = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" };
|
|
2578
|
-
const _hoisted_6$1 = { class: "absolute right-2 inset-y-0 flex items-center" };
|
|
2579
|
-
const _hoisted_7 = {
|
|
2580
|
-
key: 0,
|
|
2581
|
-
class: "bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"
|
|
2582
|
-
};
|
|
2583
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2584
|
-
__name: "Select",
|
|
2585
|
-
props: {
|
|
2586
|
-
modelValue: null,
|
|
2587
|
-
size: { default: "medium" },
|
|
2588
|
-
icon: null,
|
|
2589
|
-
placeholder: null,
|
|
2590
|
-
isDisabled: { type: Boolean, default: false },
|
|
2591
|
-
options: null,
|
|
2592
|
-
disabledBadge: null
|
|
2593
|
-
},
|
|
2594
|
-
emits: ["update:modelValue"],
|
|
2595
|
-
setup(__props, { emit }) {
|
|
2596
|
-
const props = __props;
|
|
2597
|
-
const selected = props.modelValue ? ref(props.modelValue) : ref(void 0);
|
|
2598
|
-
const { inputClasses, disabledClasses, textSizeClasses } = useFormClasses(props);
|
|
2599
|
-
watch(() => props.modelValue, (value) => {
|
|
2600
|
-
var _a2;
|
|
2601
|
-
if (!value)
|
|
2602
|
-
return;
|
|
2603
|
-
if (value.id !== ((_a2 = selected.value) == null ? void 0 : _a2.id)) {
|
|
2604
|
-
selected.value = value;
|
|
2605
|
-
}
|
|
2606
|
-
});
|
|
2607
|
-
watch(selected, (value) => {
|
|
2608
|
-
if (value) {
|
|
2609
|
-
emit("update:modelValue", value);
|
|
2610
|
-
}
|
|
2611
|
-
});
|
|
2612
|
-
return (_ctx, _cache) => {
|
|
2613
|
-
return openBlock(), createBlock(unref(Ee), {
|
|
2614
|
-
as: "div",
|
|
2615
|
-
modelValue: unref(selected),
|
|
2616
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(selected) ? selected.value = $event : null),
|
|
2617
|
-
disabled: __props.isDisabled
|
|
2618
|
-
}, {
|
|
2619
|
-
default: withCtx(() => [
|
|
2620
|
-
createElementVNode("div", _hoisted_1$3, [
|
|
2621
|
-
createVNode(unref(Ae), {
|
|
2622
|
-
class: normalizeClass(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [unref(inputClasses), unref(textSizeClasses), unref(disabledClasses)]])
|
|
2623
|
-
}, {
|
|
2624
|
-
default: withCtx(() => {
|
|
2625
|
-
var _a2, _b;
|
|
2626
|
-
return [
|
|
2627
|
-
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_2$2, [
|
|
2628
|
-
createVNode(_sfc_main$b, {
|
|
2629
|
-
name: (_b = (_a2 = unref(selected)) == null ? void 0 : _a2.icon) != null ? _b : __props.icon
|
|
2630
|
-
}, null, 8, ["name"])
|
|
2631
|
-
])) : createCommentVNode("", true),
|
|
2632
|
-
unref(selected) ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(unref(selected).label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(__props.placeholder), 1)),
|
|
2633
|
-
createElementVNode("span", _hoisted_5$1, [
|
|
2634
|
-
createVNode(_sfc_main$b, {
|
|
2635
|
-
class: "text-grey-400",
|
|
2636
|
-
name: "chevron-down",
|
|
2637
|
-
"aria-hidden": "true"
|
|
2638
|
-
})
|
|
2639
|
-
])
|
|
2640
|
-
];
|
|
2641
|
-
}),
|
|
2642
|
-
_: 1
|
|
2643
|
-
}, 8, ["class"]),
|
|
2644
|
-
createVNode(Transition, {
|
|
2645
|
-
"leave-active-class": "transition ease-in duration-100",
|
|
2646
|
-
"leave-from-class": "opacity-100",
|
|
2647
|
-
"leave-to-class": "opacity-0"
|
|
2648
|
-
}, {
|
|
2649
|
-
default: withCtx(() => [
|
|
2650
|
-
createVNode(unref(Fe), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
|
|
2651
|
-
default: withCtx(() => [
|
|
2652
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item) => {
|
|
2653
|
-
return openBlock(), createBlock(unref(Be), {
|
|
2654
|
-
as: "template",
|
|
2655
|
-
key: item.id,
|
|
2656
|
-
value: item,
|
|
2657
|
-
disabled: item.disabled
|
|
2658
|
-
}, {
|
|
2659
|
-
default: withCtx(({ active, selected: selected2 }) => [
|
|
2660
|
-
createElementVNode("li", {
|
|
2661
|
-
class: normalizeClass([
|
|
2662
|
-
active ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
|
|
2663
|
-
"cursor-default select-none relative py-2 pl-3 pr-12",
|
|
2664
|
-
{ "opacity-50 bg-grey-100": item.disabled }
|
|
2665
|
-
])
|
|
2666
|
-
}, [
|
|
2667
|
-
createElementVNode("div", _hoisted_6$1, [
|
|
2668
|
-
item.disabled && __props.disabledBadge ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(__props.disabledBadge), 1)) : createCommentVNode("", true)
|
|
2669
|
-
]),
|
|
2670
|
-
createElementVNode("span", {
|
|
2671
|
-
class: normalizeClass([
|
|
2672
|
-
selected2 ? "font-semibold" : "font-normal",
|
|
2673
|
-
"block truncate"
|
|
2674
|
-
])
|
|
2675
|
-
}, [
|
|
2676
|
-
item.icon ? (openBlock(), createBlock(_sfc_main$b, {
|
|
2677
|
-
key: 0,
|
|
2678
|
-
class: "inline-block mr-1",
|
|
2679
|
-
name: item.icon
|
|
2680
|
-
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
2681
|
-
createTextVNode(" " + toDisplayString(item.label), 1)
|
|
2682
|
-
], 2),
|
|
2683
|
-
selected2 ? (openBlock(), createElementBlock("span", {
|
|
2684
|
-
key: 0,
|
|
2685
|
-
class: normalizeClass([
|
|
2686
|
-
active ? "text-blue-100" : "text-blue-500",
|
|
2687
|
-
"absolute inset-y-0 right-0 flex items-center pr-4"
|
|
2688
|
-
])
|
|
2689
|
-
}, [
|
|
2690
|
-
createVNode(_sfc_main$b, {
|
|
2691
|
-
name: "check",
|
|
2692
|
-
class: "h-5 w-5",
|
|
2693
|
-
"aria-hidden": "true"
|
|
2694
|
-
})
|
|
2695
|
-
], 2)) : createCommentVNode("", true)
|
|
2696
|
-
], 2)
|
|
2697
|
-
]),
|
|
2698
|
-
_: 2
|
|
2699
|
-
}, 1032, ["value", "disabled"]);
|
|
2700
|
-
}), 128))
|
|
2701
|
-
]),
|
|
2702
|
-
_: 1
|
|
2703
|
-
})
|
|
2704
|
-
]),
|
|
2705
|
-
_: 1
|
|
2706
|
-
})
|
|
2707
|
-
])
|
|
2708
|
-
]),
|
|
2709
|
-
_: 1
|
|
2710
|
-
}, 8, ["modelValue", "disabled"]);
|
|
2711
|
-
};
|
|
2712
|
-
}
|
|
2713
|
-
});
|
|
2714
|
-
const _hoisted_1$2 = { class: "animate-pulse" };
|
|
2715
|
-
const _hoisted_2$1 = { class: "flex items-center justify-between space-x-4" };
|
|
2716
|
-
const _hoisted_3 = {
|
|
2717
|
-
key: 0,
|
|
2718
|
-
class: "w-12 h-12 bg-current rounded-full shrink-0"
|
|
2719
|
-
};
|
|
2720
|
-
const _hoisted_4 = {
|
|
2721
|
-
key: 1,
|
|
2722
|
-
class: "w-full h-8 bg-current rounded-lg"
|
|
2723
|
-
};
|
|
2724
|
-
const _hoisted_5 = {
|
|
2725
|
-
key: 0,
|
|
2726
|
-
class: "mt-6 space-y-2"
|
|
2727
|
-
};
|
|
2728
|
-
const _hoisted_6 = {
|
|
2729
|
-
key: 1,
|
|
2730
|
-
class: "w-1/3 h-10 mt-6 bg-current rounded-lg"
|
|
2731
|
-
};
|
|
2732
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2733
|
-
__name: "Skeleton",
|
|
2734
|
-
props: {
|
|
2735
|
-
avatar: { type: Boolean, default: false },
|
|
2736
|
-
title: { type: Boolean, default: true },
|
|
2737
|
-
lines: { default: 3 },
|
|
2738
|
-
footer: { type: Boolean, default: false }
|
|
2739
|
-
},
|
|
2740
|
-
setup(__props) {
|
|
2741
|
-
const props = __props;
|
|
2742
|
-
const lineSettings = new Array(props.lines).fill(void 0).map(() => {
|
|
2743
|
-
const margins = [4, 5, 6, 8, 10, 16, 24, 32];
|
|
2744
|
-
const margin = margins[Math.floor(Math.random() * margins.length)];
|
|
2745
|
-
return {
|
|
2746
|
-
margin: `mr-${margin}`
|
|
2747
|
-
};
|
|
2748
|
-
});
|
|
2749
|
-
return (_ctx, _cache) => {
|
|
2750
|
-
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
2751
|
-
createElementVNode("div", _hoisted_2$1, [
|
|
2752
|
-
__props.avatar ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true),
|
|
2753
|
-
__props.title ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
|
|
2754
|
-
]),
|
|
2755
|
-
__props.lines > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
2756
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(lineSettings), (setting, index) => {
|
|
2757
|
-
return openBlock(), createElementBlock("div", {
|
|
2758
|
-
class: normalizeClass(["h-4 bg-current rounded-lg", setting.margin]),
|
|
2759
|
-
key: index
|
|
2760
|
-
}, null, 2);
|
|
2761
|
-
}), 128))
|
|
2762
|
-
])) : createCommentVNode("", true),
|
|
2763
|
-
__props.footer ? (openBlock(), createElementBlock("div", _hoisted_6)) : createCommentVNode("", true)
|
|
2764
|
-
]);
|
|
2765
|
-
};
|
|
2766
|
-
}
|
|
2767
|
-
});
|
|
2768
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
2769
|
-
__name: "Spinner",
|
|
2770
|
-
setup(__props) {
|
|
2771
|
-
return (_ctx, _cache) => {
|
|
2772
|
-
return openBlock(), createBlock(unref(_sfc_main$b), {
|
|
2773
|
-
class: "animate-spin",
|
|
2774
|
-
name: "circle-notch"
|
|
2775
|
-
});
|
|
2776
|
-
};
|
|
2777
|
-
}
|
|
2778
|
-
});
|
|
2779
|
-
const _hoisted_1$1 = { class: "sr-only" };
|
|
2780
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2781
|
-
__name: "Switch",
|
|
2782
|
-
props: {
|
|
2783
|
-
id: { default: v4() },
|
|
2784
|
-
label: null,
|
|
2785
|
-
modelValue: { type: Boolean },
|
|
2786
|
-
description: null,
|
|
2787
|
-
onLabel: { default: "on" },
|
|
2788
|
-
offLabel: { default: "off" }
|
|
2789
|
-
},
|
|
2790
|
-
emits: ["update:modelValue", "change"],
|
|
2791
|
-
setup(__props, { emit: emits }) {
|
|
2792
|
-
const update = (newValue) => {
|
|
2793
|
-
emits("update:modelValue", newValue);
|
|
2794
|
-
emits("change", newValue);
|
|
2795
|
-
};
|
|
2796
|
-
return (_ctx, _cache) => {
|
|
2797
|
-
return openBlock(), createBlock(unref(ue), {
|
|
2798
|
-
modelValue: __props.modelValue,
|
|
2799
|
-
label: __props.label,
|
|
2800
|
-
class: normalizeClass([__props.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
|
|
2801
|
-
"onUpdate:modelValue": update
|
|
2802
|
-
}, {
|
|
2803
|
-
default: withCtx(() => [
|
|
2804
|
-
createElementVNode("span", {
|
|
2805
|
-
class: normalizeClass(["absolute text-xs text-center text-white inset-x-2", __props.modelValue ? "pr-3" : "pl-3"])
|
|
2806
|
-
}, toDisplayString(__props.modelValue === true ? __props.onLabel : __props.offLabel), 3),
|
|
2807
|
-
createElementVNode("span", _hoisted_1$1, toDisplayString(__props.label), 1),
|
|
2808
|
-
createElementVNode("span", {
|
|
2809
|
-
class: normalizeClass([__props.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
|
|
2810
|
-
}, null, 2)
|
|
2811
|
-
]),
|
|
2812
|
-
_: 1
|
|
2813
|
-
}, 8, ["modelValue", "label", "class"]);
|
|
2814
|
-
};
|
|
2815
|
-
}
|
|
2816
|
-
});
|
|
2817
|
-
const _hoisted_1 = { class: "relative" };
|
|
2818
|
-
const _hoisted_2 = ["tabindex", "value"];
|
|
2819
|
-
const __default__ = {
|
|
2820
|
-
inheritAttrs: false
|
|
2821
|
-
};
|
|
2822
|
-
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
2823
|
-
__name: "Textarea",
|
|
2824
|
-
props: {
|
|
2825
|
-
modelValue: null,
|
|
2826
|
-
size: { default: "medium" },
|
|
2827
|
-
isDisabled: { type: Boolean, default: false },
|
|
2828
|
-
block: { type: Boolean }
|
|
2829
|
-
},
|
|
2830
|
-
emits: ["update:modelValue"],
|
|
2831
|
-
setup(__props, { expose, emit }) {
|
|
2832
|
-
const props = __props;
|
|
2833
|
-
const { inputClasses, disabledClasses, textSizeClasses } = useFormClasses(props);
|
|
2834
|
-
const onInput = function(payload) {
|
|
2835
|
-
emit("update:modelValue", (payload == null ? void 0 : payload.target).value);
|
|
2836
|
-
};
|
|
2837
|
-
const input = ref(null);
|
|
2838
|
-
const focus = () => {
|
|
2839
|
-
if (!props.isDisabled) {
|
|
2840
|
-
input.value.focus();
|
|
2841
|
-
}
|
|
2842
|
-
};
|
|
2843
|
-
expose({
|
|
2844
|
-
focus
|
|
2845
|
-
});
|
|
2846
|
-
return (_ctx, _cache) => {
|
|
2847
|
-
var _a2;
|
|
2848
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
2849
|
-
createElementVNode("textarea", mergeProps({
|
|
2850
|
-
class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [unref(inputClasses), unref(textSizeClasses), unref(disabledClasses)]],
|
|
2851
|
-
tabindex: __props.isDisabled ? "-1" : void 0,
|
|
2852
|
-
value: (_a2 = __props.modelValue) != null ? _a2 : ""
|
|
2853
|
-
}, _ctx.$attrs, {
|
|
2854
|
-
ref_key: "input",
|
|
2855
|
-
ref: input,
|
|
2856
|
-
cols: "56",
|
|
2857
|
-
rows: "8",
|
|
2858
|
-
onInput
|
|
2859
|
-
}), "\n ", 16, _hoisted_2)
|
|
2860
|
-
]);
|
|
2861
|
-
};
|
|
2862
|
-
}
|
|
2863
|
-
}));
|
|
2864
|
-
export { _sfc_main$a as D9Button, _sfc_main$9 as D9Checkbox, _sfc_main$b as D9Icon, _sfc_main$8 as D9Input, _sfc_main$7 as D9Label, _sfc_main$6 as D9Menu, _sfc_main$5 as D9MenuLink, _sfc_main$4 as D9Select, _sfc_main$3 as D9Skeleton, _sfc_main$2 as D9Spinner, _sfc_main$1 as D9Switch, _sfc_main as D9Textarea, brands, icons };
|