@qynpm/ui 0.0.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/README.md +137 -0
- package/dist/ui.es.js +994 -0
- package/dist/ui.umd.js +2 -0
- package/index.d.ts +20 -0
- package/index.js +9 -0
- package/package.json +59 -0
package/dist/ui.umd.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.icon-\\[ion--cloud-upload-outline\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M320 367.79h76c55 0 100-29.21 100-83.6s-53-81.47-96-83.6c-8.89-85.06-71-136.8-144-136.8c-69 0-113.44 45.79-128 91.2c-60 5.7-112 43.88-112 106.4s54 106.4 120 106.4h56'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='m320 255.79l-64-64l-64 64m64 192.42V207.79'/%3E%3C/svg%3E") }.icon-\\[line-md--loading-twotone-loop\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath stroke-dasharray='16' stroke-dashoffset='16' d='M12 3c4.97 0 9 4.03 9 9'%3E%3Canimate fill='freeze' attributeName='stroke-dashoffset' dur='0.3s' values='16;0'/%3E%3CanimateTransform attributeName='transform' dur='1.5s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3Cpath stroke-dasharray='64' stroke-dashoffset='64' stroke-opacity='.3' d='M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z'%3E%3Canimate fill='freeze' attributeName='stroke-dashoffset' dur='1.2s' values='64;0'/%3E%3C/path%3E%3C/g%3E%3C/svg%3E") }.icon-\\[material-symbols--minimize\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M6 21v-2h12v2z'/%3E%3C/svg%3E") }.icon-\\[material-symbols--square-outline-rounded\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5z'/%3E%3C/svg%3E") }.icon-\\[mdi--close\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E") }.icon-\\[mdi--window-maximize\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M4 4h16v16H4zm2 4v10h12V8z'/%3E%3C/svg%3E") }.icon-\\[mdi--window-restore\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M4 8h4V4h12v12h-4v4H4zm12 0v6h2V6h-8v2zM6 12v6h8v-6z'/%3E%3C/svg%3E") }.icon-\\[ph--images-thin\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' width='256' height='256'%3E%3Cpath fill='black' d='M216 44H72a12 12 0 0 0-12 12v20H40a12 12 0 0 0-12 12v112a12 12 0 0 0 12 12h144a12 12 0 0 0 12-12v-20h20a12 12 0 0 0 12-12V56a12 12 0 0 0-12-12M68 56a4 4 0 0 1 4-4h144a4 4 0 0 1 4 4v72.4l-16.89-16.89a12 12 0 0 0-17 0l-22.83 22.83l-46.79-46.83a12 12 0 0 0-17 0L68 119Zm120 144a4 4 0 0 1-4 4H40a4 4 0 0 1-4-4V88a4 4 0 0 1 4-4h20v84a12 12 0 0 0 12 12h116Zm28-28H72a4 4 0 0 1-4-4v-37.66l37.17-37.17a4 4 0 0 1 5.66 0l49.66 49.66a4 4 0 0 0 5.65 0l25.66-25.66a4 4 0 0 1 5.66 0L220 139.71V168a4 4 0 0 1-4 4m-52-88a8 8 0 1 1 8 8a8 8 0 0 1-8-8'/%3E%3C/svg%3E") }.icon-\\[ri--close-line\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z'/%3E%3C/svg%3E") }.icon-\\[tdesign--fullscreen-exit-1\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M14 20v-6h6v2h-4v4zm-6 0v-4H4v-2h6v6zm12-10h-6V4h2v4h4zm-10 0H4V8h4V4h2z'/%3E%3C/svg%3E") }.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.-right-12{right:-3rem}.left-0{left:0}.top-0{top:0}.top-2{top:.5rem}.z-\\[9999\\]{z-index:9999}.mb-3{margin-bottom:.75rem}.ml-2{margin-left:.5rem}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.h-9{height:2.25rem}.h-\\[var\\(--footer-height\\)\\]{height:var(--footer-height)}.h-\\[var\\(--header-height\\)\\]{height:var(--header-height)}.h-full{height:100%}.min-h-\\[var\\(--footer-height\\)\\]{min-height:var(--footer-height)}.w-9{width:2.25rem}.w-\\[56px\\]{width:56px}.w-full{width:100%}.max-w-\\[200px\\]{max-width:200px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.px-\\[var\\(--content-padding\\)\\]{padding-left:var(--content-padding);padding-right:var(--content-padding)}.pl-1{padding-left:.25rem}.pl-\\[var\\(--content-padding\\)\\]{padding-left:var(--content-padding)}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.text-\\[1rem\\]{font-size:1rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.uppercase{text-transform:uppercase}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:bg-gray-600\\/80:hover{background-color:#4b5563cc}.hover\\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.active\\:scale-75:active{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_\\.el-dialog\\\\_\\\\_header\\]\\:\\!hidden .el-dialog__header{display:none!important}.qy-upload[data-v-12bbc6cc]{--qy-upload-size: 140px;--el-upload-picture-card-size: var(--qy-upload-size);display:inline-flex;flex-direction:column;gap:8px;vertical-align:top}.qy-upload[data-v-12bbc6cc] .el-upload--picture-card{width:var(--qy-upload-size)!important;height:var(--qy-upload-size)!important;line-height:1;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.qy-upload[data-v-12bbc6cc] .el-upload-list--picture-card .el-upload-list__item{width:var(--qy-upload-size)!important;height:var(--qy-upload-size)!important;margin:0 8px 8px 0}.qy-upload__trigger[data-v-12bbc6cc]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;overflow:hidden;padding:4px 4px clamp(26px,var(--qy-upload-size) * .28,36px);box-sizing:border-box}.qy-upload__icon[data-v-12bbc6cc]{font-size:clamp(14px,var(--qy-upload-size) * .2,28px);color:#8c939d;flex-shrink:0}.qy-upload__trigger.is-dragover[data-v-12bbc6cc]{border:2px dashed var(--el-color-primary)!important;background-color:var(--el-color-primary-light-9)!important}.qy-upload__trigger.is-dragover .qy-upload__icon[data-v-12bbc6cc]{color:var(--el-color-primary)}.qy-upload__label[data-v-12bbc6cc]{font-size:13px;color:#606266}.qy-upload__hint[data-v-12bbc6cc]{font-size:11px;color:#909399}.qy-upload__text[data-v-12bbc6cc]{position:absolute;bottom:5px;left:5px;right:5px}.qy-upload__text-preview[data-v-12bbc6cc]{height:20px;line-height:20px;padding:0 5px;background:#ffffffe6;border:1px solid #dcdfe6;border-radius:4px;font-size:clamp(10px,var(--qy-upload-size) * .08,12px);color:#303133;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:text;transition:border-color .2s}.qy-upload__text-preview[data-v-12bbc6cc]:hover{border-color:#409eff}.qy-upload__text-preview.is-placeholder[data-v-12bbc6cc]{color:#c0c4cc}.qy-upload__tip[data-v-12bbc6cc]{display:flex;align-items:center;gap:4px;font-size:12px;color:#909399;line-height:1.4}.qy-upload__tip .error[data-v-12bbc6cc]{color:var(--el-color-danger)}.qy-upload--video[data-v-12bbc6cc]{display:flex;flex-direction:column;gap:8px}.qy-upload--video[data-v-12bbc6cc] .el-upload{display:block;width:100%}.qy-upload--video .qy-upload__trigger[data-v-12bbc6cc]{position:relative;flex-direction:row;gap:10px;height:80px;padding:0 20px 30px;border:1px dashed var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:#fafcff;transition:border-color .2s}.qy-upload--video .qy-upload__trigger[data-v-12bbc6cc]:hover{border-color:var(--el-color-primary)}.qy-upload--video .qy-upload__trigger .qy-upload__text-preview[data-v-12bbc6cc]{font-size:13px;height:22px;line-height:22px;background:#fffffff2}.qy-upload--video .qy-upload__icon[data-v-12bbc6cc]{font-size:24px;color:var(--el-color-primary)}.qy-upload--video .qy-upload__label[data-v-12bbc6cc]{font-size:14px;font-weight:500}.qy-upload--reached-limit[data-v-12bbc6cc] .el-upload--picture-card{display:none!important}.qy-upload--disabled[data-v-12bbc6cc] .el-upload--picture-card{cursor:not-allowed;background-color:#f5f7fa}.qy-upload--disabled .qy-upload__trigger[data-v-12bbc6cc]{cursor:not-allowed;color:#c0c4cc}.qy-upload__text-popover.el-popover{padding:10px!important}.qy-upload__text-popover .el-textarea__inner{font-size:13px;line-height:1.6}.qy-dialog{--small-content-padding: 16px;--content-padding: 24px;--header-height: 50px;--footer-height: 60px;--sides-gap: 10px;--block-outline-color: #e9e9e9}.qy-dialog .el-dialog__footer{padding:0}.qy-dialog .el-dialog__header{margin:0;padding:0}.qy-dialog__wrapper-container{position:relative;overflow:auto;width:100%!important;height:100%;min-width:300px;min-height:200px}.qy-dialog__wrapper-container::-webkit-scrollbar{width:6px;height:6px}.qy-dialog__wrapper-container::-webkit-scrollbar-track{background:transparent}.qy-dialog__wrapper-container::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.qy-dialog__wrapper-container::-webkit-scrollbar-thumb:hover{background-color:#90939980}.qy-dialog .el-dialog{display:flex;flex-direction:column;max-height:90vh}.qy-dialog .el-dialog__body{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}.qy-dialog__btn{display:flex;height:100%;width:56px;align-items:center;justify-content:center;font-size:1rem;cursor:pointer!important;z-index:10}.qy-dialog__btn:active{opacity:.6}.qy-dialog__btn--default:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.qy-dialog__btn--danger:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.qy-dialog__wrapper{overflow-y:auto}.qy-dialog__wrapper--fullscreen{min-height:calc(100vh - var(--header-height) - var(--footer-height))}.qy-dialog__footer{border-top:1px solid transparent;transition:border-color .2s linear}.qy-dialog__footer--outline{border-top-color:var(--block-outline-color)}.fixed.left-0.top-0.bg-white.rounded{-webkit-user-select:none;-moz-user-select:none;user-select:none}.fixed.left-0.top-0.bg-white.rounded *{-moz-user-select:none;user-select:none;-webkit-user-select:none}.qy-remark-image[data-v-00916fb4]{width:100%}.qy-remark-image__field[data-v-00916fb4]{position:relative;width:100%}.qy-remark-image__upload-anchor[data-v-00916fb4]{position:absolute;right:6px;top:14px;z-index:2}.qy-remark-image__upload[data-v-00916fb4]{width:20px;color:#6b7280;cursor:pointer;transition:color .2s ease;transform:translateY(-35%)}.qy-remark-image__upload[data-v-00916fb4]:hover{color:#2563eb}.qy-remark-image__popover[data-v-00916fb4]{padding:8px}.qy-remark-image__preview-img[data-v-00916fb4]{display:block;width:100%}.qy-remark-image__popover-footer[data-v-00916fb4]{margin-top:8px;padding:8px 12px;border-radius:6px;background:#f3f4f6;display:flex;align-items:center;justify-content:space-between}.qy-remark-image__popover-tip[data-v-00916fb4]{color:#6b7280;font-size:12px}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(k,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("element-plus/es"),require("vue"),require("@element-plus/icons-vue"),require("element-plus"),require("clsx"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","vue","@element-plus/icons-vue","element-plus","clsx","@vueuse/core"],M):(k=typeof globalThis<"u"?globalThis:k||self,M(k.QyUI={},k.ElementPlus,k.Vue,k.ElementPlusIconsVue,k.ElementPlus,k.clsx,k.VueUse))})(this,function(k,M,e,se,_,he,de){"use strict";/*! js-cookie v3.0.1 | MIT */function J(n){for(var y=1;y<arguments.length;y++){var B=arguments[y];for(var l in B)n[l]=B[l]}return n}var we={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function le(n,y){function B(s,b,i){if(!(typeof document>"u")){i=J({},y,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var w="";for(var p in i)i[p]&&(w+="; "+p,i[p]!==!0&&(w+="="+i[p].split(";")[0]));return document.cookie=s+"="+n.write(b,s)+w}}function l(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var b=document.cookie?document.cookie.split("; "):[],i={},w=0;w<b.length;w++){var p=b[w].split("="),D=p.slice(1).join("=");try{var z=decodeURIComponent(p[0]);if(i[z]=n.read(D,z),s===z)break}catch{}}return s?i[s]:i}}return Object.create({set:B,get:l,remove:function(s,b){B(s,"",J({},b,{expires:-1}))},withAttributes:function(s){return le(this.converter,J({},this.attributes,s))},withConverter:function(s){return le(J({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(y)},converter:{value:Object.freeze(n)}})}var ce=le(we,{path:"/"});const xe="Admin-Token";function ke(n=xe){return ce.get(n)}const ue=(n,y)=>{const B=n.__vccOpts||n;for(const[l,s]of y)B[l]=s;return B},Ve={class:"qy-upload__hint"},_e=["src"],Ee={key:1,class:"qy-upload__tip"},be={class:"error"},Ce={class:"error"},ne=ue({__name:"index",props:{defaultValue:{type:Object,default:()=>({files:"",text:""})},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},fileType:{type:Array,default:()=>[]},fileSize:{type:Number,default:10},limit:{type:Number,default:9},isShowTip:{type:Boolean,default:!1},api:{type:String,default:"/permission-api/common/uploads"},name:{type:String,default:"file"},tokenKey:{type:String,default:"Admin-Token"},supportVideo:{type:Boolean,default:!1},size:{type:String,default:"default"},disableDrag:{type:Boolean,default:!1},callBack:{type:Function,default:null},extraData:{type:Object,default:()=>({})}},emits:["change","success","error","remove"],setup(n,{expose:y,emit:B}){const l=n,s=B,b=e.ref(null),i=e.ref([]),w=e.ref(null),p=[],D=e.ref(!1),z=e.ref([]),L=e.ref(0),$=e.ref(!1),j=e.ref(""),U=e.ref(""),q=new Set,I=e.ref(!1),C=e.ref(""),N=e.ref(!1);e.onMounted(()=>{const o=l.defaultValue;if(!o)return;C.value=o.text??"";const t=o.files??"",c=Array.isArray(t)?t.filter(Boolean):String(t).split(",").filter(Boolean);c.length&&(i.value=c.map((r,f)=>({name:r.split("/").pop()||`file-${f}`,url:r,status:"success",uid:Date.now()+f})))});const a=e.computed(()=>({large:"160px",default:"140px",small:"80px"})[l.size]??l.size),h=e.computed(()=>l.disabled),R=e.computed(()=>{var o;return l.isShowTip&&(l.fileSize||((o=V.value)==null?void 0:o.length))}),V=e.computed(()=>{var o;return(o=l.fileType)!=null&&o.length?l.fileType.map(t=>t.toLowerCase()):l.supportVideo?["mp4","mov","avi"]:["jpg","jpeg","png","gif","webp"]}),v=e.computed(()=>{const o=l.supportVideo?1:l.limit;return i.value.length>=o}),A=e.computed(()=>V.value.map(o=>`.${o}`).join(",")),W=e.computed(()=>({"qy-upload--reached-limit":v.value,"qy-upload--disabled":l.disabled,"qy-upload--video":l.supportVideo}));e.watch(C,()=>m());function X(){var o;(o=w.value)==null||o.focus()}function m(o){const r={files:(o??i.value).filter(f=>f.status==="success"&&f.url).map(f=>f.url),text:C.value};s("change",r),l.callBack&&l.callBack(r)}function O(o,t){m(t)}function ee(o){var r;if(!(o.size/1024/1024<l.fileSize))return _.ElMessage.warning(`文件大小不能超过${l.fileSize}M`),!1;const c=((r=o.name.split(".").pop())==null?void 0:r.toLowerCase())||"";return V.value.includes(c)?!0:(_.ElMessage.warning(`格式不支持,仅允许: ${V.value.join("/")}`),!1)}function K(o,t,c,r){var ge,ye;const f=l.api.startsWith("http")?l.api:window.location.origin+l.api.replace(/^([^/])/,"/$1"),E=new FormData;E.append(l.name,o),l.extraData&&Object.entries(l.extraData).forEach(([x,Pe])=>E.append(x,Pe));const g=new XMLHttpRequest;p.push(g);const Z=((ge=b.value)==null?void 0:ge.$el.querySelector(".el-upload--picture-card"))||((ye=b.value)==null?void 0:ye.$el),oe=_.ElLoading.service({target:Z,text:"上传中",background:"rgba(255,255,255,0.7)"}),S=()=>{const x=p.indexOf(g);x!==-1&&p.splice(x,1),oe.close()};g.open("POST",f);const me=ke(l.tokenKey);me&&g.setRequestHeader("Authorization",`Bearer ${me}`),g.upload.onprogress=x=>{x.total>0&&(t==null||t({percent:x.loaded/x.total*100}))},g.onload=()=>{if(S(),g.status<200||g.status>=300){const x=`上传失败 (HTTP ${g.status})`;_.ElMessage.error(x),s("error",{msg:x,status:g.status}),r==null||r(new Error(x));return}try{const x=JSON.parse(g.responseText);x.code===200&&x.urls?(_.ElMessage.success("上传成功"),c==null||c({...x,url:x.urls})):(_.ElMessage.error(x.msg||"上传失败"),s("error",x),r==null||r(x))}catch{_.ElMessage.error("上传失败,响应格式错误"),s("error",new Error("Response parse error")),r==null||r(new Error("Response parse error"))}},g.onerror=()=>{S(),_.ElMessage.error("上传失败,网络异常"),s("error",new Error("Network error")),r==null||r(new Error("Network error"))},g.send(E)}function H(o){return l.disabled?!1:ee(o)}function te(o){K(o.file,o.onProgress,t=>{o.onSuccess(t),m(),s("success",t)},t=>o.onError(t))}function u(o){var r;if(!o.url)return;const t=((r=o.url.split(".").pop())==null?void 0:r.toLowerCase())||"";if(["mp4","mov","avi","webm"].includes(t)){j.value=o.url,U.value=o.name||"视频预览",$.value=!0;return}const c=i.value.filter(f=>{var E;return f.status==="success"&&f.url&&!["mp4","mov","avi","webm"].includes((E=f.url.split(".").pop())==null?void 0:E.toLowerCase())});z.value=c.map(f=>f.url),L.value=c.findIndex(f=>f.uid===o.uid)||0,D.value=!0}function d(){D.value=!1,z.value=[]}function T(o){for(let t=0;t<o.length;t++){const c=o[t];if(!H(c))continue;const r=Date.now()+t,f=URL.createObjectURL(c);q.add(f),i.value.push({uid:r,name:c.name||`file-${r}`,status:"uploading",percentage:0,url:f}),K(c,E=>{const g=i.value.find(Z=>Z.uid===r);g&&(g.percentage=E.percent)},E=>{const g=i.value.find(Z=>Z.uid===r);g&&(g.status="success",g.url=E.url,m(),s("success",E))},()=>Q(r))}}function F(o){var r;if(l.disabled)return;const t=(r=o.clipboardData)==null?void 0:r.items;if(!t)return;const c=[];for(let f=0;f<t.length;f++){const E=t[f];if(E.kind==="file"&&E.type.startsWith("image/")){const g=E.getAsFile();g&&c.push(g)}}c.length&&(o.preventDefault(),T(c))}function P(o){var c;if(I.value=!1,l.disabled||v.value)return;const t=Array.from(((c=o.dataTransfer)==null?void 0:c.files)||[]).filter(r=>{var f;return V.value.includes((f=r.name.split(".").pop())==null?void 0:f.toLowerCase())});t.length&&T(t)}function Q(o){var c;const t=i.value.findIndex(r=>r.uid===o);t!==-1&&((c=i.value[t].url)!=null&&c.startsWith("blob:")&&(URL.revokeObjectURL(i.value[t].url),q.delete(i.value[t].url)),i.value.splice(t,1))}return e.onBeforeUnmount(()=>{p.forEach(o=>o.abort()),p.length=0,q.forEach(o=>URL.revokeObjectURL(o)),q.clear()}),y({openFileDialog:()=>{var o,t;l.disabled||v.value||(t=(o=b.value)==null?void 0:o.$el.querySelector('input[type="file"]'))==null||t.click()},getPathList:()=>i.value.filter(o=>o.status==="success").map(o=>o.url),clearFiles:()=>{i.value=[],C.value="",m()},getValue:()=>({files:i.value.filter(o=>o.status==="success"&&o.url).map(o=>o.url),text:C.value})}),(o,t)=>{var oe;const c=M.ElIcon,r=M.ElInput,f=M.ElPopover,E=M.ElUpload,g=M.ElImageViewer,Z=M.ElDialog;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-upload",W.value]),style:e.normalizeStyle({"--qy-upload-size":a.value})},[e.createVNode(E,{ref_key:"uploadRef",ref:b,"file-list":i.value,"onUpdate:fileList":t[6]||(t[6]=S=>i.value=S),action:"#",multiple:n.supportVideo?!1:n.multiple,limit:n.supportVideo?1:n.limit,"list-type":n.supportVideo?"text":"picture-card",accept:A.value,disabled:h.value,"http-request":te,"before-upload":H,"on-preview":u,"on-remove":O},{default:e.withCtx(()=>[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["qy-upload__trigger",{"is-dragover":I.value}]),onPaste:F,onDragover:t[4]||(t[4]=e.withModifiers(S=>I.value=!0,["prevent"])),onDragleave:t[5]||(t[5]=e.withModifiers(S=>I.value=!1,["prevent"])),onDrop:e.withModifiers(P,["prevent"])},[e.createVNode(c,{class:"qy-upload__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(se.Plus))]),_:1}),n.supportVideo?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t[9]||(t[9]=e.createElementVNode("span",{class:"qy-upload__label"},"点击上传视频",-1)),e.createElementVNode("span",Ve,"支持 "+e.toDisplayString(V.value.join(" / "))+",不超过 "+e.toDisplayString(n.fileSize)+"MB",1)],64)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"qy-upload__text",onClick:t[3]||(t[3]=e.withModifiers(()=>{},["stop"])),onPaste:e.withModifiers(F,["stop"])},[e.createVNode(f,{visible:N.value,"onUpdate:visible":t[2]||(t[2]=S=>N.value=S),placement:"bottom-start",width:220,trigger:"click","popper-class":"qy-upload__text-popover",onAfterEnter:X},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["qy-upload__text-preview",{"is-placeholder":!C.value}])},e.toDisplayString(C.value||"输入文字"),3)]),default:e.withCtx(()=>[e.createVNode(r,{ref_key:"inputRef",ref:w,modelValue:C.value,"onUpdate:modelValue":t[0]||(t[0]=S=>C.value=S),type:"textarea",autosize:{minRows:2,maxRows:5},placeholder:"输入文字或粘贴图片",disabled:n.disabled,onBlur:t[1]||(t[1]=S=>N.value=!1),onPaste:e.withModifiers(F,["stop"])},null,8,["modelValue","disabled"])]),_:1},8,["visible"])],32)],34))]),_:1},8,["file-list","multiple","limit","list-type","accept","disabled"]),D.value?(e.openBlock(),e.createBlock(g,{key:0,"url-list":z.value,"initial-index":L.value,onClose:d},null,8,["url-list","initial-index"])):e.createCommentVNode("",!0),e.createVNode(Z,{modelValue:$.value,"onUpdate:modelValue":t[7]||(t[7]=S=>$.value=S),title:U.value,width:"640px","append-to-body":"","destroy-on-close":"",onClose:t[8]||(t[8]=S=>$.value=!1)},{default:e.withCtx(()=>[$.value?(e.openBlock(),e.createElementBlock("video",{key:0,src:j.value,controls:"",autoplay:"",style:{width:"100%","max-height":"400px","border-radius":"4px"}},null,8,_e)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),R.value?(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(e.unref(se.InfoFilled))]),_:1}),e.createElementVNode("span",null,[t[12]||(t[12]=e.createTextVNode(" 请上传 ",-1)),n.fileSize?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t[10]||(t[10]=e.createTextVNode("大小不超过 ",-1)),e.createElementVNode("b",be,e.toDisplayString(n.fileSize)+"MB",1)],64)):e.createCommentVNode("",!0),(oe=V.value)!=null&&oe.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t[11]||(t[11]=e.createTextVNode(",格式为 ",-1)),e.createElementVNode("b",Ce,e.toDisplayString(V.value.join("/")),1)],64)):e.createCommentVNode("",!0),t[13]||(t[13]=e.createTextVNode(" 的文件。 ",-1))])])):e.createCommentVNode("",!0)],6)}}},[["__scopeId","data-v-12bbc6cc"]]),Be={class:"text-lg flex items-center pt-2 pl-[var(--content-padding)]"},Ne={key:0},Se={key:1},ze={key:0,class:"icon-[material-symbols--square-outline-rounded]",role:"img","aria-hidden":"true"},qe={key:1,class:"icon-[tdesign--fullscreen-exit-1]",role:"img","aria-hidden":"true"},Me={key:0,class:"fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"},De={class:"flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center"},Ie={class:"flex items-center justify-between w-full pl-1 pr-4 h-full ml-2"},$e={class:"flex items-center gap-2"},ve={class:"text-sm text-gray-700 truncate max-w-[200px]"},Ue={class:"flex items-center gap-2"},fe=5,ae=2e3,Y=e.defineComponent({__name:"index",props:e.mergeModels({layout:{type:[Array,String,Boolean],default:()=>["confirm","cancel"]},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},confirmProps:{default:()=>({})},size:{default:"default"},zIndex:{default:2e3}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["confirm","cancel","close","opened","ok"],["update:modelValue"]),setup(n,{expose:y,emit:B}){const l=n,s=e.useSlots(),b=e.ref(!0),i=e.ref(!1),w=e.ref(ae),D=de.useBreakpoints({mobile:0,tablet:640,laptop:1024,desktop:1280}).isSmaller("tablet"),z=e.computed(()=>{if(Array.isArray(l.layout))return l.layout;if(typeof l.layout=="string")return l.layout.split(",").map(u=>u.trim())}),L=e.computed(()=>({CancelButton:e.createVNode(K),ConfirmButton:e.createVNode(ee)})),$=e.computed(()=>s.footer||l.layout!==!1),j=e.ref(!1),U=e.ref(l.showFullscreen&&D?!0:l.fullscreen),q=B,I=e.useModel(n,"modelValue");e.watchEffect(()=>{I.value&&(j.value=!1)}),y({});const C=e.useAttrs(),N=`qy-dialog-${Math.random().toString(36).slice(2,11)}`,a=e.ref(!1),h=e.ref(null);window.minimizedCount||(window.minimizedCount=0);const{x:R,y:V}=de.useDraggable(h,{initialValue:{x:5,y:window.innerHeight-100-(window.minimizedCount||0)*60},onMove(u){var d;(d=h.value)==null||d.classList.add("dragging"),document.body.classList.add("qy-dialog--dragging"),R.value=Math.max(0,Math.min(window.innerWidth-300,u.x)),V.value=Math.max(0,Math.min(window.innerHeight-50,u.y))},onEnd(){var u;(u=h.value)==null||u.classList.remove("dragging"),document.body.classList.remove("qy-dialog--dragging")}}),v=e.computed(()=>({transform:`translate(${R.value}px, ${V.value}px)`,willChange:"transform"}));function A(u){const d=u.target,{scrollTop:T,scrollHeight:F,clientHeight:P}=d;b.value=T<=fe,i.value=F-(T+P)<=fe}function W(){document.querySelector(`.${N}.el-dialog`).addEventListener("scroll",A),H(),q("opened")}function X(){U.value=!U.value,H()}function m(){j.value||(j.value=!0,a.value=!1,I.value=!1,q("cancel"),q("close"))}function O(u){l.showFullscreen&&u.detail>=2&&X()}function ee(){return e.h(_.ElButton,{...e.unref(l.confirmProps),type:"primary",class:"dialog__footerBtn",onClick:()=>{q("confirm"),q("ok")}},()=>e.unref(l.confirmProps).title||"确 认")}function K(){return e.h(_.ElButton,{class:"dialog__footerBtn",onClick:()=>m()},()=>"取 消")}e.onMounted(()=>{typeof window.qyDialogMaxZIndex>"u"&&(window.qyDialogMaxZIndex=ae),H()});function H(){var o;const u=Array.from(document.querySelectorAll(".el-overlay")).filter(t=>window.getComputedStyle(t).display!=="none"&&!t.classList.contains("is-message")),d=(o=document.querySelector(`.${N}`))==null?void 0:o.closest(".el-overlay"),T=document.querySelector(`.${N}.el-dialog`);if(!d||!T)return;const F=ae;window.qyDialogMaxZIndex=window.qyDialogMaxZIndex||F;const Q=Math.max(window.qyDialogMaxZIndex,...u.map(t=>parseInt(window.getComputedStyle(t).zIndex||F.toString())))+2;window.qyDialogMaxZIndex=Q,e.nextTick(()=>{d.style.zIndex=Q.toString(),T.style.zIndex=(Q+1).toString(),w.value=Q+1})}e.onUnmounted(()=>{const u=document.querySelector(`.${N} .qy-dialog__wrapper-container`);u&&u.removeEventListener("scroll",A),a.value&&window.minimizedCount--});function te(){var d;a.value=!a.value;const u=(d=document.querySelector(`.${N}`))==null?void 0:d.closest(".el-overlay");a.value?(u.style.display="none",window.minimizedCount++,V.value=window.innerHeight-50-(window.minimizedCount||0)*60):(u.style.display="block",window.minimizedCount--,H())}return(u,d)=>{const T=e.resolveComponent("Close"),F=M.ElIcon,P=M.ElDialog;return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(P,e.mergeProps({ref:"dialogRef",class:["qy-dialog",[l.size==="small"&&"[&_.el-dialog__header]:!hidden",N]],"model-value":I.value,"align-center":"","append-to-body":"",style:{"--el-dialog-padding-primary":0},"show-close":!1,fullscreen:U.value,"z-index":w.value,onClosed:m,onOpened:W,draggable:""},e.unref(C)),e.createSlots({header:e.withCtx(()=>[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({borderBottom:"1px solid",borderColor:b.value?"transparent":"var(--block-outline-color)",transition:"border-color .2s linear"}),class:"flex justify-between h-[var(--header-height)]",onDblclick:O},[e.createElementVNode("div",Be,[e.unref(s).header?e.unref(s).header?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(u.$slots,"header")])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(e.unref(C).title),1))]),e.createElementVNode("div",{class:"flex",onMousedown:d[3]||(d[3]=e.withModifiers(()=>{},["stop"]))},[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(te,["stop"]),onMousedown:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},d[4]||(d[4]=[e.createElementVNode("span",{class:"icon-[material-symbols--minimize] text-xl mb-3",role:"img","aria-hidden":"true"},null,-1)]),32)):e.createCommentVNode("",!0),l.showFullscreen?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(X,["stop"]),onMousedown:d[1]||(d[1]=e.withModifiers(()=>{},["stop"]))},[U.value?(e.openBlock(),e.createElementBlock("span",qe)):(e.openBlock(),e.createElementBlock("span",ze))],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"qy-dialog__btn qy-dialog__btn--danger",onClick:e.withModifiers(m,["stop"]),onMousedown:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},d[5]||(d[5]=[e.createElementVNode("span",{class:"icon-[ri--close-line] text-xl",role:"img","aria-hidden":"true"},null,-1)]),32)],32)],36)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["qy-dialog__wrapper",e.unref(he)(U.value&&"qy-dialog__wrapper--fullscreen")]),style:e.normalizeStyle({maxHeight:$.value?"calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))":"calc(100vh - var(--header-height) - var(--sides-gap))",padding:l.size==="small"?"var(--small-content-padding)":"var(--content-padding)"})},[l.size==="small"?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(F,{size:36,class:"cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",onClick:m},{default:e.withCtx(()=>[e.createVNode(T)]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default")],6)]),_:2},[!u.$slots.footer&&Array.isArray(z.value)?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",De,[e.createElementVNode("div",null,[e.renderSlot(u.$slots,"footer-left")]),e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":i.value},"qy-dialog__footer flex items-center justify-end"])},[z.value.includes("cancel")?(e.openBlock(),e.createBlock(K,{key:0})):e.createCommentVNode("",!0),z.value.includes("confirm")?(e.openBlock(),e.createBlock(ee,{key:1})):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"footer-append")],2)])]),key:"0"}:$.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":i.value},"qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])},[e.renderSlot(u.$slots,"footer",{layouts:L.value,layoutsNode:Object.values(L.value)})],2)]),key:"1"}:void 0]),1040,["class","model-value","fullscreen","z-index"]),e.withDirectives(e.createElementVNode("div",{ref_key:"minimizedRef",ref:h,class:"fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",style:e.normalizeStyle([v.value,{width:"300px",height:"50px","will-change":"transform"}])},[e.createElementVNode("div",Ie,[e.createElementVNode("div",$e,[d[6]||(d[6]=e.createElementVNode("div",{class:"icon-[mdi--window-restore] text-gray-600"},null,-1)),e.createElementVNode("span",ve,e.toDisplayString(e.unref(C).title),1)]),e.createElementVNode("div",Ue,[e.createElementVNode("div",{class:"p-1 hover:bg-gray-200 rounded",onClick:e.withModifiers(te,["stop"])},d[7]||(d[7]=[e.createElementVNode("div",{class:"icon-[mdi--window-maximize] text-gray-600"},null,-1)])),e.createElementVNode("div",{class:"p-1 hover:bg-red-100 rounded",onClick:e.withModifiers(m,["stop"])},d[8]||(d[8]=[e.createElementVNode("div",{class:"icon-[mdi--close] text-red-600"},null,-1)]))])])],4),[[e.vShow,a.value]])])}}});function ie(n){const y=n==null?void 0:n.match(/(\[url\:(.*?)\])(.*)/);return y?{imageUrl:y[2],text:y[3]}:{imageUrl:"",text:n||""}}function pe(n){const y=String(n||"").match(/(\[url\:.*?\])([\s\S]*)/);return y?y[2]:n}function re(n,y){return y?`[url:${y}]${n}`:n}const Re={class:"qy-remark-image__field"},Te={class:"qy-remark-image__upload-anchor"},Fe={key:0,class:"icon-[line-md--loading-twotone-loop]",role:"img","aria-hidden":"true"},Ae={key:1,class:"icon-[ion--cloud-upload-outline]",role:"img","aria-hidden":"true"},Le={key:2,class:"icon-[ph--images-thin]",role:"img","aria-hidden":"true"},je={class:"qy-remark-image__popover"},Oe=["src"],He={class:"qy-remark-image__popover-footer"},Ze=e.defineComponent({__name:"index",props:{defaultValue:{default:""},defaultImage:{default:""},rows:{default:6},width:{default:""},autosize:{type:[Boolean,Object],default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:"粘贴图片上传"},type:{default:"textarea"},api:{default:"/permission-api/common/uploads"},tokenKey:{default:"Admin-Token"}},emits:["change"],setup(n,{expose:y,emit:B}){const l=n,s=B,b=e.useAttrs(),i=e.ref(null),w=e.ref(""),p=e.ref(""),D=e.ref(!1),z=e.computed(()=>l.type==="text"?"text":"textarea"),L=e.computed(()=>{if(l.width)return{width:typeof l.width=="number"?`${l.width}px`:l.width}});e.watch(()=>l.defaultValue,a=>{const h=ie(a||"");w.value=h.text,p.value=h.imageUrl||l.defaultImage||""},{immediate:!0}),e.watch(()=>l.defaultImage,a=>{a!==void 0&&!ie(l.defaultValue||"").imageUrl&&(p.value=a||"")},{immediate:!0}),e.onMounted(()=>{e.nextTick(j)}),e.onUnmounted(()=>{const a=$();a&&a.removeEventListener("paste",I)});function $(){var a,h;return((a=i.value)==null?void 0:a.textarea)||((h=i.value)==null?void 0:h.input)||null}function j(){const a=$();a&&(a.removeEventListener("paste",I),a.addEventListener("paste",I))}function U(a){w.value=pe(a||"")}function q(){p.value="",N()}async function I(a){var V;const R=Array.from(((V=a.clipboardData)==null?void 0:V.files)||[]).find(v=>v.type.startsWith("image/"));R&&(a.preventDefault(),await C({file:R,onError:()=>{},onProgress:()=>{},onSuccess:()=>{}}))}async function C(a){var h,R,V,v;if(a.file.size>51200*1e3)return _.ElMessage.error("图片过大"),!1;D.value=!0;try{const A=new FormData;A.append("files",a.file);const W=ce.get(l.tokenKey),m=await(await fetch(l.api,{method:"POST",body:A,credentials:"include",headers:W?{Authorization:`Bearer ${W}`}:void 0})).json(),O=(m==null?void 0:m.urls)??((h=m==null?void 0:m.data)==null?void 0:h.urls)??((R=m==null?void 0:m.data)==null?void 0:R.url)??(m==null?void 0:m.url)??"";return p.value=Array.isArray(O)?O[0]:O,N(),_.ElMessage.success("上传图片成功"),(V=a.onSuccess)==null||V.call(a,m),!0}catch(A){return(v=a.onError)==null||v.call(a,A),_.ElMessage.error("上传失败"),!1}finally{D.value=!1}}function N(){s("change",re(w.value||"",p.value||""),p.value||"")}return y({deleteImage:q,getValue:()=>({text:w.value||"",imageUrl:p.value||"",value:re(w.value||"",p.value||"")})}),(a,h)=>(e.openBlock(),e.createElementBlock("div",{class:"qy-remark-image",style:e.normalizeStyle(L.value)},[e.createElementVNode("div",Re,[e.createVNode(e.unref(_.ElInput),e.mergeProps({ref_key:"inputRef",ref:i,"model-value":w.value,type:z.value,rows:a.rows,autosize:a.autosize,disabled:a.disabled,placeholder:a.placeholder},e.unref(b),{"onUpdate:modelValue":U,onBlur:N}),null,16,["model-value","type","rows","autosize","disabled","placeholder"]),e.createVNode(e.unref(_.ElPopover),{placement:"top-start",width:400,trigger:"hover",disabled:!p.value},{reference:e.withCtx(()=>[e.createElementVNode("div",Te,[e.createVNode(e.unref(_.ElUpload),{disabled:D.value||a.disabled,class:"qy-remark-image__upload","show-file-list":!1,"http-request":C},{default:e.withCtx(()=>[D.value?(e.openBlock(),e.createElementBlock("span",Fe)):p.value?(e.openBlock(),e.createElementBlock("span",Le)):(e.openBlock(),e.createElementBlock("span",Ae))]),_:1},8,["disabled"])])]),default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createElementVNode("img",{src:p.value,class:"qy-remark-image__preview-img"},null,8,Oe),e.createElementVNode("div",He,[h[1]||(h[1]=e.createElementVNode("span",{class:"qy-remark-image__popover-tip"},"再次点击按钮可更换图片",-1)),e.createVNode(e.unref(_.ElButton),{link:"",size:"small",type:"danger",disabled:a.disabled,onClick:q},{default:e.withCtx(()=>h[0]||(h[0]=[e.createTextVNode(" 删除图片 ",-1)])),_:1,__:[0]},8,["disabled"])])])]),_:1},8,["disabled"])])],4))}}),G=ue(Ze,[["__scopeId","data-v-00916fb4"]]),We={install:n=>{n.component("Upload",ne),n.component("QyDialog",Y),n.component("qyDialog",Y),n.component("RemarkImage",G),n.component("QyRemarkImage",G)},Upload:ne,QyDialog:Y,RemarkImage:G};k.QyDialog=Y,k.RemarkImage=G,k.Upload=ne,k.default=We,k.formatRemarkText=pe,k.parseRemarkText=ie,k.parseRemarkWithImage=re,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
|
|
3
|
+
export const Upload: Plugin
|
|
4
|
+
export const QyDialog: Plugin
|
|
5
|
+
export const RemarkImage: Plugin
|
|
6
|
+
export function parseRemarkText(remarkText: string): {
|
|
7
|
+
imageUrl: string
|
|
8
|
+
text: string
|
|
9
|
+
}
|
|
10
|
+
export function formatRemarkText(text: string): string
|
|
11
|
+
export function parseRemarkWithImage(text: string, imageUrl?: string): string
|
|
12
|
+
|
|
13
|
+
declare const _default: Plugin & {
|
|
14
|
+
install(app: App): void
|
|
15
|
+
Upload: typeof Upload
|
|
16
|
+
QyDialog: typeof QyDialog
|
|
17
|
+
RemarkImage: typeof RemarkImage
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default _default
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qynpm/ui",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "起印公共 UI 组件包。",
|
|
5
|
+
"author": "qy",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/ui.umd.js",
|
|
8
|
+
"module": "./dist/ui.es.js",
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"import": "./dist/ui.es.js",
|
|
14
|
+
"require": "./dist/ui.umd.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"index.d.ts",
|
|
19
|
+
"index.js",
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"vue": "^3.4.0",
|
|
28
|
+
"element-plus": "^2.0.0",
|
|
29
|
+
"@element-plus/icons-vue": "^2.0.0",
|
|
30
|
+
"@vueuse/core": ">=10.0.0",
|
|
31
|
+
"clsx": ">=2.0.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"js-cookie": "^3.0.5",
|
|
35
|
+
"lodash-es": "^4.17.21",
|
|
36
|
+
"mitt": "^3.0.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@element-plus/icons-vue": "^2.0.0",
|
|
40
|
+
"@iconify/json": "*",
|
|
41
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
42
|
+
"@vueuse/core": "^10.0.0",
|
|
43
|
+
"autoprefixer": "^10.4.0",
|
|
44
|
+
"clsx": "^2.0.0",
|
|
45
|
+
"element-plus": "^2.0.0",
|
|
46
|
+
"sass": "^1.70.0",
|
|
47
|
+
"tailwindcss": "3.4.6",
|
|
48
|
+
"unplugin-auto-import": "^0.18.0",
|
|
49
|
+
"unplugin-vue-components": "^0.27.0",
|
|
50
|
+
"vite": "^5.0.0",
|
|
51
|
+
"vite-plugin-css-injected-by-js": "^3.5.2"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "vite",
|
|
55
|
+
"build": "vite build",
|
|
56
|
+
"preview": "vite preview",
|
|
57
|
+
"release": "node scripts/publish.js"
|
|
58
|
+
}
|
|
59
|
+
}
|