1import { Y as Ye, H as he, I as Ge, J as render, S as Se } from "./app-DHoh64oC.js"; 2import { b as openBlock, p as createBlock, g as withCtx, e as createVNode, k as unref, E as normalizeStyle, C as createBaseVNode, v as normalizeClass, c as createElementBlock, q as createCommentVNode, h as renderSlot, z as computed, x as ref } from "./vendor-CmzCb6hx.js"; 3const _hoisted_1 = { class: "fixed inset-0 z-10 w-screen overflow-y-auto" }; 4const _hoisted_2 = { class: "flex min-h-full items-end justify-center p-0 sm:items-center sm:p-4 text-center" }; 5const _hoisted_3 = { 6 key: 0, 7 class: "absolute top-0 right-0 pt-4 pr-4 z-10" 8}; 9const _hoisted_4 = { class: "overflow-y-auto p-4 sm:p-6 max-h-[80vh]" }; 10const _sfc_main = { 11 __name: "Modal", 12 props: { 13 modelValue: { type: Boolean, default: null }, 14 maxWidth: { type: String, default: "lg" }, 15 showCloseButton: { type: Boolean, default: true }, 16 closeOnConfirm: { type: Boolean, default: true }, 17 closeOnCancel: { type: Boolean, default: true }, 18 preventAutoClose: { type: Boolean, default: false }, 19 zIndex: { type: Number, default: 3e3 } 20 }, 21 emits: [ 22 "confirm", 23 "cancel", 24 "close", 25 "update:modelValue" 26 ], 27 setup(__props, { expose: __expose, emit: __emit }) { 28 const props = __props; 29 const emit = __emit; 30 const internalOpen = ref(false); 31 const isOpen = computed( 32 () => props.modelValue !== null ? props.modelValue : internalOpen.value 33 ); 34 const handleConfirm = () => { 35 emit("confirm"); 36 if (props.closeOnConfirm) { 37 closeModal(); 38 } 39 }; 40 const handleCancel = () => { 41 emit("cancel"); 42 if (props.closeOnCancel) { 43 closeModal(); 44 } 45 }; 46 const panelClasses = computed(() => { 47 const maxWidthClasses = { 48 sm: "sm:max-w-sm", 49 md: "sm:max-w-md", 50 lg: "sm:max-w-lg", 51 xl: "sm:max-w-xl", 52 "2xl": "sm:max-w-2xl", 53 "3xl": "sm:max-w-3xl", 54 "4xl": "sm:max-w-4xl", 55 "5xl": "sm:max-w-5xl", 56 "6xl": "sm:max-w-6xl", 57 "7xl": "sm:max-w-7xl", 58 full: "sm:max-w-full" 59 }; 60 return `relative transform overflow-visible rounded-t-2xl sm:rounded-lg bg-white text-left shadow-xl transition-all w-full max-h-[90vh] sm:max-h-[85vh] m-0 sm:m-4 sm:my-8 sm:w-full sm:min-w-[500px] ${maxWidthClasses[props.maxWidth] || maxWidthClasses.lg}`; 61 }); 62 const handleClose = (source) => { 63 if (props.preventAutoClose) return; 64 if (!props.suppressCloseEvent) { 65 emit("close", source); 66 } 67 if (props.modelValue !== null) { 68 emit("update:modelValue", false); 69 } else { 70 internalOpen.value = false; 71 } 72 }; 73 const openModal = () => { 74 if (props.modelValue !== null) { 75 emit("update:modelValue", true); 76 } else { 77 internalOpen.value = true; 78 } 79 }; 80 const closeModal = () => { 81 if (!props.preventAutoClose) { 82 if (props.modelValue !== null) { 83 emit("update:modelValue", false); 84 } else { 85 internalOpen.value = false; 86 } 87 } 88 }; 89 const forceCloseModal = () => { 90 if (props.modelValue !== null) { 91 emit("update:modelValue", false); 92 } else { 93 internalOpen.value = false; 94 } 95 }; 96 __expose({ 97 openModal, 98 closeModal, 99 forceCloseModal, 100 handleConfirm, 101 handleCancel 102 }); 103 return (_ctx, _cache) => { 104 return openBlock(), createBlock(unref(Se), { 105 as: "template", 106 show: isOpen.value 107 }, { 108 default: withCtx(() => [ 109 createVNode(unref(Ye), { 110 class: "relative z-[3000]", 111 style: normalizeStyle(props.zIndex !== 3e3 ? { zIndex: props.zIndex } : {}), 112 onClose: handleClose 113 }, { 114 default: withCtx(() => [ 115 createVNode(unref(he), { 116 as: "template", 117 enter: "ease-out duration-300", 118 "enter-from": "opacity-0", 119 "enter-to": "", 120 leave: "ease-in duration-200", 121 "leave-from": "", 122 "leave-to": "opacity-0" 123 }, { 124 default: withCtx(() => [..._cache[1] || (_cache[1] = [ 125 createBaseVNode("div", { class: "fixed inset-0 bg-gray-500/75 transition-opacity" }, null, -1) 126 ])]), 127 _: 1 128 }), 129 createBaseVNode("div", _hoisted_1, [ 130 createBaseVNode("div", _hoisted_2, [ 131 createVNode(unref(he), { 132 as: "template", 133 enter: "ease-out duration-300", 134 "enter-from": "opacity-0 translate-y-full sm:translate-y-0 sm:scale-95", 135 "enter-to": "translate-y-0 sm:scale-100", 136 leave: "ease-in duration-200", 137 "leave-from": "translate-y-0 sm:scale-100", 138 "leave-to": "opacity-0 translate-y-full sm:translate-y-0 sm:scale-95" 139 }, { 140 default: withCtx(() => [ 141 createVNode(unref(Ge), { 142 class: normalizeClass(panelClasses.value) 143 }, { 144 default: withCtx(() => [ 145 __props.showCloseButton ? (openBlock(), createElementBlock("div", _hoisted_3, [ 146 createBaseVNode("button", { 147 type: "button", 148 class: "rounded-md bg-white text-gray-400 hover:text-gray-500", 149 onClick: _cache[0] || (_cache[0] = ($event) => handleClose("x-button")) 150 }, [ 151 _cache[2] || (_cache[2] = createBaseVNode("span", { class: "sr-only" }, "Close", -1)), 152 createVNode(unref(render), { 153 class: "size-6", 154 "aria-hidden": "true" 155 }) 156 ]) 157 ])) : createCommentVNode("", true), 158 createBaseVNode("div", _hoisted_4, [ 159 renderSlot(_ctx.$slots, "default") 160 ]) 161 ]), 162 _: 3 163 }, 8, ["class"]) 164 ]), 165 _: 3 166 }) 167 ]) 168 ]) 169 ]), 170 _: 3 171 }, 8, ["style"]) 172 ]), 173 _: 3 174 }, 8, ["show"]); 175 }; 176 } 177}; 178export { 179 _sfc_main as _ 180};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.