giime 0.6.21 → 0.6.23
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/index.css +134 -134
- package/es/components/src/base/dialog/dialog.d.ts +2 -0
- package/es/components/src/base/dialog/dialog.mjs.map +1 -1
- package/es/components/src/base/timeSelect/TimeSelect.vue2.mjs.map +1 -1
- package/es/components/src/base/timeSelect/timeSelect.mjs +1 -1
- package/es/components/src/base/timeSelect/timeSelect.mjs.map +1 -1
- package/es/components/src/base/tourStep/TourStep.vue.d.ts +9 -9
- package/es/components/src/base/tourStep/TourStep.vue2.mjs +1 -1
- package/es/components/src/base/tourStep/TourStep.vue2.mjs.map +1 -1
- package/es/components/src/base/tourStep/tourStep.d.ts +4 -4
- package/es/components/src/base/tourStep/tourStep.mjs +1 -1
- package/es/components/src/base/tourStep/tourStep.mjs.map +1 -1
- package/es/components/src/business/uploadMaterial/UploadMaterial.vue.d.ts +9 -0
- package/es/components/src/business/uploadMaterial/index.d.ts +19 -0
- package/es/components/src/business/uploadMaterial/uploadMaterial.d.ts +4 -0
- package/es/components/src/composite/fileComponent/FileComponent.vue.d.ts +9 -0
- package/es/components/src/composite/fileComponent/FileComponent.vue2.mjs +26 -6
- package/es/components/src/composite/fileComponent/FileComponent.vue2.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/fileComponent.d.ts +5 -0
- package/es/components/src/composite/fileComponent/fileComponent.mjs +5 -0
- package/es/components/src/composite/fileComponent/fileComponent.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/index.d.ts +9 -0
- package/es/components/src/composite/importDialog/ImportDialog.vue.d.ts +17 -0
- package/es/components/src/composite/importDialog/ImportDialog.vue2.mjs +5 -8
- package/es/components/src/composite/importDialog/ImportDialog.vue2.mjs.map +1 -1
- package/es/components/src/composite/importDialog/importDialog.d.ts +11 -0
- package/es/components/src/composite/importDialog/importDialog.mjs +10 -0
- package/es/components/src/composite/importDialog/importDialog.mjs.map +1 -1
- package/es/components/src/composite/importDialog/index.d.ts +35 -0
- package/es/components/src/composite/previewFile/PreviewFile.vue.d.ts +9 -0
- package/es/components/src/composite/previewFile/PreviewFile.vue2.mjs +36 -5
- package/es/components/src/composite/previewFile/PreviewFile.vue2.mjs.map +1 -1
- package/es/components/src/composite/previewFile/index.d.ts +9 -0
- package/es/components/src/composite/previewFile/previewFile.d.ts +4 -0
- package/es/components/src/composite/uploadFile/UploadFile.vue.d.ts +12 -1
- package/es/components/src/composite/uploadFile/UploadFile.vue.mjs +1 -1
- package/es/components/src/composite/uploadFile/UploadFile.vue2.mjs +3 -2
- package/es/components/src/composite/uploadFile/UploadFile.vue2.mjs.map +1 -1
- package/es/components/src/composite/uploadFile/index.d.ts +19 -0
- package/es/components/src/composite/uploadFile/uploadFile.d.ts +4 -0
- package/es/giime/index.mjs +1 -1
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/index.css +134 -134
- package/es/utils/index.mjs +1 -1
- package/es/utils/src/file.d.ts +6 -0
- package/es/utils/src/file.mjs +9 -1
- package/es/utils/src/file.mjs.map +1 -1
- package/lib/components/src/base/dialog/dialog.d.ts +2 -0
- package/lib/components/src/base/dialog/dialog.js.map +1 -1
- package/lib/components/src/base/timeSelect/TimeSelect.vue2.js.map +1 -1
- package/lib/components/src/base/timeSelect/timeSelect.js +2 -2
- package/lib/components/src/base/timeSelect/timeSelect.js.map +1 -1
- package/lib/components/src/base/tourStep/TourStep.vue.d.ts +9 -9
- package/lib/components/src/base/tourStep/TourStep.vue2.js +2 -2
- package/lib/components/src/base/tourStep/TourStep.vue2.js.map +1 -1
- package/lib/components/src/base/tourStep/tourStep.d.ts +4 -4
- package/lib/components/src/base/tourStep/tourStep.js +3 -3
- package/lib/components/src/base/tourStep/tourStep.js.map +1 -1
- package/lib/components/src/business/uploadMaterial/UploadMaterial.vue.d.ts +9 -0
- package/lib/components/src/business/uploadMaterial/index.d.ts +19 -0
- package/lib/components/src/business/uploadMaterial/uploadMaterial.d.ts +4 -0
- package/lib/components/src/composite/fileComponent/FileComponent.vue.d.ts +9 -0
- package/lib/components/src/composite/fileComponent/FileComponent.vue2.js +25 -5
- package/lib/components/src/composite/fileComponent/FileComponent.vue2.js.map +1 -1
- package/lib/components/src/composite/fileComponent/fileComponent.d.ts +5 -0
- package/lib/components/src/composite/fileComponent/fileComponent.js +5 -0
- package/lib/components/src/composite/fileComponent/fileComponent.js.map +1 -1
- package/lib/components/src/composite/fileComponent/index.d.ts +9 -0
- package/lib/components/src/composite/importDialog/ImportDialog.vue.d.ts +17 -0
- package/lib/components/src/composite/importDialog/ImportDialog.vue2.js +4 -7
- package/lib/components/src/composite/importDialog/ImportDialog.vue2.js.map +1 -1
- package/lib/components/src/composite/importDialog/importDialog.d.ts +11 -0
- package/lib/components/src/composite/importDialog/importDialog.js +10 -0
- package/lib/components/src/composite/importDialog/importDialog.js.map +1 -1
- package/lib/components/src/composite/importDialog/index.d.ts +35 -0
- package/lib/components/src/composite/previewFile/PreviewFile.vue.d.ts +9 -0
- package/lib/components/src/composite/previewFile/PreviewFile.vue2.js +35 -4
- package/lib/components/src/composite/previewFile/PreviewFile.vue2.js.map +1 -1
- package/lib/components/src/composite/previewFile/index.d.ts +9 -0
- package/lib/components/src/composite/previewFile/previewFile.d.ts +4 -0
- package/lib/components/src/composite/uploadFile/UploadFile.vue.d.ts +12 -1
- package/lib/components/src/composite/uploadFile/UploadFile.vue.js +1 -1
- package/lib/components/src/composite/uploadFile/UploadFile.vue2.js +3 -2
- package/lib/components/src/composite/uploadFile/UploadFile.vue2.js.map +1 -1
- package/lib/components/src/composite/uploadFile/index.d.ts +19 -0
- package/lib/components/src/composite/uploadFile/uploadFile.d.ts +4 -0
- package/lib/giime/index.js +1 -0
- package/lib/giime/index.js.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/index.css +134 -134
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/src/file.d.ts +6 -0
- package/lib/utils/src/file.js +9 -0
- package/lib/utils/src/file.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadFile.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/uploadFile/UploadFile.vue"],"sourcesContent":["<template>\n <div>\n <div\n ref=\"pasteFileRef\"\n :class=\"{ 'gm-upload-file-picture-card': listType === 'picture-card', 'gm-upload-file-disabled': disabled }\"\n class=\"gm-upload-file\"\n >\n <el-checkbox-group v-model=\"checkoutFiles\">\n <el-upload\n ref=\"uploadFileRef\"\n v-bind=\"props\"\n v-model:file-list=\"fileList\"\n :before-remove=\"beforeRemove\"\n action=\"\"\n :http-request=\"httpRequest\"\n >\n <slot v-if=\"!disabled\">\n <template v-if=\"listType === 'picture-card'\">\n <div\n class=\"gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-border gm-border-dashed gm-p-1\"\n style=\"flex-direction: column\"\n :style=\"{ width: width + 'px', height: height + 'px' }\"\n >\n <el-icon :size=\"30\" color=\"#999\">\n <UploadFilled />\n </el-icon>\n <div class=\"el-upload__text gm-text-center !gm-text-xs gm-text-gray-500\">\n 将文件拖到此处,复制粘贴,或 <em class=\"gm-text-blue-700\">点击上传</em>\n </div>\n </div>\n </template>\n <template v-else>\n <el-button type=\"primary\" size=\"default\">点击上传</el-button>\n </template>\n </slot>\n <template v-if=\"showFileList && listType === 'picture-card'\" #file=\"{ file }\">\n <el-checkbox v-if=\"checkbox\" :value=\"file\" />\n <slot name=\"file\" :file=\"file\">\n <div class=\"gm-flex gm-items-center gm-justify-center gm-rounded-md\" :style=\"{ width: width + 'px', height: height + 'px' }\">\n <GmFileComponent :file=\"file\" :size=\"width - 40\" :url=\"url\" :controls=\"false\" />\n </div>\n <div class=\"el-upload-list__item-actions\">\n <span class=\"el-upload-list__item-preview\" @click=\"handlePreview(file)\">\n <el-icon><View /></el-icon>\n </span>\n <span v-if=\"showDelete\" class=\"el-upload-list__item-delete\" @click=\"handleRemove(file, fileList)\">\n <el-icon><Delete /></el-icon>\n </span>\n </div>\n </slot>\n </template>\n </el-upload>\n </el-checkbox-group>\n\n <GmPreviewFile\n v-model:dialogVisible=\"dialogVisible\"\n v-model:file-index=\"fileIndex\"\n :file-list=\"fileList\"\n :controls=\"controls\"\n :oncontextmenu=\"oncontextmenu\"\n :controlslist=\"controlslist\"\n :field=\"field\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { ElMessageBox } from 'element-plus';\nimport { useAliossHookStore } from '@giime/utils/src/alioss/aliossPutHook';\nimport { fileValidType } from '@giime/utils/src/file';\n// import { pasteFile } from '@giime/utils/src/pasteFile';\nimport { usePasteFile } from '@giime/hooks/base/usePasteFile';\nimport { Delete, UploadFilled, View } from '@element-plus/icons-vue';\nimport GmFileComponent from '../fileComponent';\nimport GmPreviewFile from '../previewFile';\nimport { uploadFileProps } from './uploadFile';\nimport type { UploadFile, UploadFiles, UploadInstance, UploadRawFile, UploadRequestOptions, UploadStatus } from 'element-plus';\nimport type { AliOssResponse } from '@giime/utils/src/alioss/aliossPutHook';\n\ndefineOptions({\n name: 'GmUploadFile',\n});\n\nconst props = defineProps(uploadFileProps);\nconst emit = defineEmits([\"handleRemove\", \"handleSaveFileSuccess\"]);\n\nconst { uploadFile, saveFileResult } = useAliossHookStore();\n\nsaveFileResult((res: AliOssResponse) => {\n emit('handleSaveFileSuccess', res);\n});\n\n/** 上传文件 */\nconst fileList = defineModel<UploadFile[]>('fileList', { required: true, default: () => [] });\n/** 多选数据 */\nconst checkoutFiles = defineModel<any[]>('checkoutFiles', { default: () => [] });\n\n/* 上传 */\nconst httpRequest = async (params: UploadRequestOptions) => {\n const { file } = params;\n\n // 验证文件类型\n if (props.accept && props.accept !== '*') {\n const isValidType = fileValidType(file, props.accept);\n if (!isValidType) {\n throw new Error(`文件类型不支持,请上传 ${props.accept} 格式的文件`);\n }\n }\n\n const res = await uploadFile({\n file,\n fileName: props.fileName,\n folder: props.folder,\n seat: props.seat,\n partSize: props.partSize,\n parallel: props.parallel,\n options: props.options,\n bucket: props.bucket,\n saveStore: props.saveStore,\n platform: props.platform,\n cdn: props.cdn,\n });\n return res;\n};\n\n/* 删除文件前 */\nconst beforeRemove = (file: UploadFile, files: UploadFiles) => {\n if (props.disabled) {\n return false;\n }\n return props.beforeRemove ? props.beforeRemove(file, files) : true;\n};\n\n/* 删除文件 */\nconst handleRemove = (file: UploadFile, uploadFiles: UploadFiles) => {\n ElMessageBox.confirm('确定删除该文件吗?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning',\n })\n .then(() => {\n const index = fileList.value.indexOf(file);\n if (index > -1) {\n fileList.value.splice(index, 1);\n emit('handleRemove', { file, index });\n return props.onRemove?.(file, uploadFiles);\n }\n })\n .catch(() => {});\n};\n\nconst uploadFileRef = ref<UploadInstance>();\nconst pasteFileRef = ref<HTMLElement>();\n/* 手动上传 */\nconst submit = () => {\n uploadFileRef.value!.submit();\n};\n\n/** 取消上传 */\nconst abort = (file: UploadFile) => {\n uploadFileRef.value!.abort(file);\n};\n\n/** 清空已上传的文件列表 */\nconst clearFiles = (status?: UploadStatus[]) => {\n uploadFileRef.value!.clearFiles(status);\n};\n\n/** 手动选择文件 */\nconst handleStart = (rawFile: UploadRawFile) => {\n uploadFileRef.value!.handleStart(rawFile);\n};\n\n/** 预览 */\nconst dialogVisible = ref(false);\nconst fileIndex = ref(0);\nconst handlePreview = (file: UploadFile) => {\n fileIndex.value = fileList.value.indexOf(file);\n dialogVisible.value = true;\n};\n\n//** 复制粘贴 */\nconst { onSuccess, onError } = usePasteFile(pasteFileRef, { accept: props.accept, disabled: props.disabled });\nonSuccess((files: File[]) => {\n if (Array.isArray(files) && files.length > 0) {\n files.forEach(file => {\n if (file instanceof File) {\n const rawFile = file as UploadRawFile;\n handleStart(rawFile);\n\n // 粘贴成功自动上传\n if (props.autoUpload) {\n submit();\n }\n }\n });\n }\n});\n\nonError((error: Error) => {\n console.error('粘贴错误:', error);\n ElMessageBox.alert(error.message, '提示', {\n type: 'error',\n });\n});\n\ndefineExpose({\n submit,\n abort,\n clearFiles,\n handleStart,\n uploadFileRef,\n});\n</script>\n\n<style scoped lang=\"scss\">\n.gm-upload-preview-dialog {\n :deep(.el-dialog__body) {\n padding: 0;\n }\n}\n.gm-upload-file-picture-card {\n :deep(.el-upload-list__item),\n :deep(.el-upload--picture-card) {\n width: auto;\n height: auto;\n }\n}\n</style>\n<style lang=\"scss\">\n.gm-upload-file {\n line-height: normal;\n .el-checkbox {\n position: absolute;\n left: 10px;\n top: 0;\n z-index: 9;\n }\n .el-upload-list__item-file-name {\n line-height: normal;\n }\n .el-upload-dragger {\n padding: 0;\n border: none;\n width: 100%;\n height: 100%;\n display: flex;\n }\n .el-upload--picture-card {\n border: none;\n }\n}\n.gm-upload-file-disabled {\n .el-upload--picture-card {\n display: none;\n }\n .el-upload-list__item-status-label {\n display: none;\n }\n}\n</style>\n"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,kBAAmB,EAAA,CAAA;AAE1D,IAAA,cAAA,CAAe,CAAC,GAAwB,KAAA;AACtC,MAAA,IAAA,CAAK,yBAAyB,GAAG,CAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAGD,IAAM,MAAA,QAAA,GAAWA,QAA0B,CAAA,OAAA,EAAA,UAAiD,CAAA,CAAA;AAE5F,IAAM,MAAA,aAAA,GAAgBA,kBAAmB,eAAsC,CAAA,CAAA;AAG/E,IAAM,MAAA,WAAA,GAAc,OAAO,MAAiC,KAAA;AAC1D,MAAM,MAAA,EA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A;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"UploadFile.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/uploadFile/UploadFile.vue"],"sourcesContent":["<template>\n <div>\n <div\n ref=\"pasteFileRef\"\n :class=\"{ 'gm-upload-file-picture-card': listType === 'picture-card', 'gm-upload-file-disabled': disabled }\"\n class=\"gm-upload-file\"\n >\n <el-checkbox-group v-model=\"checkoutFiles\">\n <el-upload\n ref=\"uploadFileRef\"\n v-bind=\"props\"\n v-model:file-list=\"fileList\"\n :before-remove=\"beforeRemove\"\n action=\"\"\n :http-request=\"httpRequest\"\n >\n <slot v-if=\"!disabled\">\n <template v-if=\"listType === 'picture-card'\">\n <div\n class=\"gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-border gm-border-dashed gm-p-1\"\n style=\"flex-direction: column\"\n :style=\"{ width: width + 'px', height: height + 'px' }\"\n >\n <el-icon :size=\"30\" color=\"#999\">\n <UploadFilled />\n </el-icon>\n <div class=\"el-upload__text gm-text-center !gm-text-xs gm-text-gray-500\">\n 将文件拖到此处,复制粘贴,或 <em class=\"gm-text-blue-700\">点击上传</em>\n </div>\n </div>\n </template>\n <template v-else>\n <el-button type=\"primary\" size=\"default\">点击上传</el-button>\n </template>\n </slot>\n <template v-if=\"showFileList && listType === 'picture-card'\" #file=\"{ file }\">\n <el-checkbox v-if=\"checkbox\" :value=\"file\" />\n <slot name=\"file\" :file=\"file\">\n <div class=\"gm-flex gm-items-center gm-justify-center gm-rounded-md\" :style=\"{ width: width + 'px', height: height + 'px' }\">\n <GmFileComponent :file=\"file\" :size=\"width - 40\" :url=\"url\" :controls=\"false\" :show-icon=\"true\" />\n </div>\n <div class=\"el-upload-list__item-actions\">\n <span class=\"el-upload-list__item-preview\" @click=\"handlePreview(file)\">\n <el-icon><View /></el-icon>\n </span>\n <span v-if=\"showDelete\" class=\"el-upload-list__item-delete\" @click=\"handleRemove(file, fileList)\">\n <el-icon><Delete /></el-icon>\n </span>\n </div>\n </slot>\n </template>\n </el-upload>\n </el-checkbox-group>\n\n <GmPreviewFile\n v-model:dialogVisible=\"dialogVisible\"\n v-model:file-index=\"fileIndex\"\n :file-list=\"fileList\"\n :controls=\"controls\"\n :oncontextmenu=\"oncontextmenu\"\n :controlslist=\"controlslist\"\n :field=\"field\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { ElMessageBox } from 'element-plus';\nimport { useAliossHookStore } from '@giime/utils/src/alioss/aliossPutHook';\nimport { fileValidType } from '@giime/utils/src/file';\n// import { pasteFile } from '@giime/utils/src/pasteFile';\nimport { usePasteFile } from '@giime/hooks/base/usePasteFile';\nimport { Delete, UploadFilled, View } from '@element-plus/icons-vue';\nimport GmFileComponent from '../fileComponent';\nimport GmPreviewFile from '../previewFile';\nimport { uploadFileProps } from './uploadFile';\nimport type { UploadFile, UploadFiles, UploadInstance, UploadRawFile, UploadRequestOptions, UploadStatus } from 'element-plus';\nimport type { AliOssResponse } from '@giime/utils/src/alioss/aliossPutHook';\n\ndefineOptions({\n name: 'GmUploadFile',\n});\n\nconst props = defineProps(uploadFileProps);\nconst emit = defineEmits([\"handleRemove\", \"handleSaveFileSuccess\"]);\n\nconst { uploadFile, saveFileResult } = useAliossHookStore();\n\nsaveFileResult((res: AliOssResponse) => {\n emit('handleSaveFileSuccess', res);\n});\n\n/** 上传文件 */\nconst fileList = defineModel<UploadFile[]>('fileList', { required: true, default: () => [] });\n/** 多选数据 */\nconst checkoutFiles = defineModel<any[]>('checkoutFiles', { default: () => [] });\n\n/* 上传 */\nconst httpRequest = async (params: UploadRequestOptions) => {\n const { file } = params;\n\n // 验证文件类型\n if (props.accept && props.accept !== '*') {\n const isValidType = fileValidType(file, props.accept);\n if (!isValidType) {\n throw new Error(`文件类型不支持,请上传 ${props.accept} 格式的文件`);\n }\n }\n\n const res = await uploadFile({\n file,\n fileName: props.fileName,\n folder: props.folder,\n seat: props.seat,\n partSize: props.partSize,\n parallel: props.parallel,\n options: props.options,\n bucket: props.bucket,\n saveStore: props.saveStore,\n platform: props.platform,\n cdn: props.cdn,\n });\n return res;\n};\n\n/* 删除文件前 */\nconst beforeRemove = (file: UploadFile, files: UploadFiles) => {\n if (props.disabled) {\n return false;\n }\n return props.beforeRemove ? props.beforeRemove(file, files) : true;\n};\n\n/* 删除文件 */\nconst handleRemove = (file: UploadFile, uploadFiles: UploadFiles) => {\n ElMessageBox.confirm('确定删除该文件吗?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning',\n })\n .then(() => {\n const index = fileList.value.indexOf(file);\n if (index > -1) {\n fileList.value.splice(index, 1);\n emit('handleRemove', { file, index });\n return props.onRemove?.(file, uploadFiles);\n }\n })\n .catch(() => {});\n};\n\nconst uploadFileRef = ref<UploadInstance>();\nconst pasteFileRef = ref<HTMLElement>();\n/* 手动上传 */\nconst submit = () => {\n uploadFileRef.value!.submit();\n};\n\n/** 取消上传 */\nconst abort = (file: UploadFile) => {\n uploadFileRef.value!.abort(file);\n};\n\n/** 清空已上传的文件列表 */\nconst clearFiles = (status?: UploadStatus[]) => {\n uploadFileRef.value!.clearFiles(status);\n};\n\n/** 手动选择文件 */\nconst handleStart = (rawFile: UploadRawFile) => {\n uploadFileRef.value!.handleStart(rawFile);\n};\n\n/** 预览 */\nconst dialogVisible = ref(false);\nconst fileIndex = ref(0);\nconst handlePreview = (file: UploadFile) => {\n fileIndex.value = fileList.value.indexOf(file);\n dialogVisible.value = true;\n};\n\n//** 复制粘贴 */\nconst { onSuccess, onError } = usePasteFile(pasteFileRef, { accept: props.accept, disabled: props.disabled });\nonSuccess((files: File[]) => {\n if (Array.isArray(files) && files.length > 0) {\n files.forEach(file => {\n if (file instanceof File) {\n const rawFile = file as UploadRawFile;\n handleStart(rawFile);\n\n // 粘贴成功自动上传\n if (props.autoUpload) {\n submit();\n }\n }\n });\n }\n});\n\nonError((error: Error) => {\n console.error('粘贴错误:', error);\n ElMessageBox.alert(error.message, '提示', {\n type: 'error',\n });\n});\n\ndefineExpose({\n submit,\n abort,\n clearFiles,\n handleStart,\n uploadFileRef,\n});\n</script>\n\n<style scoped lang=\"scss\">\n.gm-upload-preview-dialog {\n :deep(.el-dialog__body) {\n padding: 0;\n }\n}\n.gm-upload-file-picture-card {\n :deep(.el-upload-list__item),\n :deep(.el-upload--picture-card) {\n width: auto;\n height: auto;\n }\n}\n</style>\n<style lang=\"scss\">\n.gm-upload-file {\n line-height: normal;\n .el-checkbox {\n position: absolute;\n left: 10px;\n top: 0;\n z-index: 9;\n }\n .el-upload-list__item-file-name {\n line-height: normal;\n }\n .el-upload-dragger {\n padding: 0;\n border: none;\n width: 100%;\n height: 100%;\n display: flex;\n }\n .el-upload--picture-card {\n border: none;\n }\n}\n.gm-upload-file-disabled {\n .el-upload--picture-card {\n display: none;\n }\n .el-upload-list__item-status-label {\n display: none;\n }\n}\n</style>\n"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,kBAAmB,EAAA,CAAA;AAE1D,IAAA,cAAA,CAAe,CAAC,GAAwB,KAAA;AACtC,MAAA,IAAA,CAAK,yBAAyB,GAAG,CAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAGD,IAAM,MAAA,QAAA,GAAWA,QAA0B,CAAA,OAAA,EAAA,UAAiD,CAAA,CAAA;AAE5F,IAAM,MAAA,aAAA,GAAgBA,kBAAmB,eAAsC,CAAA,CA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MACX,MAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -110,6 +110,10 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
110
110
|
type: BooleanConstructor;
|
|
111
111
|
default: boolean;
|
|
112
112
|
};
|
|
113
|
+
showIcon: {
|
|
114
|
+
type: BooleanConstructor;
|
|
115
|
+
default: boolean;
|
|
116
|
+
};
|
|
113
117
|
beforeUpload: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | (() => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | {
|
|
114
118
|
(): (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
115
119
|
new (): any;
|
|
@@ -823,6 +827,10 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
823
827
|
type: BooleanConstructor;
|
|
824
828
|
default: boolean;
|
|
825
829
|
};
|
|
830
|
+
showIcon: {
|
|
831
|
+
type: BooleanConstructor;
|
|
832
|
+
default: boolean;
|
|
833
|
+
};
|
|
826
834
|
beforeUpload: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | (() => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | {
|
|
827
835
|
(): (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
828
836
|
new (): any;
|
|
@@ -955,6 +963,7 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
955
963
|
file: Partial<import("element-plus").UploadFile>;
|
|
956
964
|
onError: (error: Error, uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
957
965
|
onChange: (uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
966
|
+
showIcon: boolean;
|
|
958
967
|
controls: boolean;
|
|
959
968
|
beforeUpload: (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
960
969
|
onRemove: (uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
@@ -1098,6 +1107,10 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
1098
1107
|
type: BooleanConstructor;
|
|
1099
1108
|
default: boolean;
|
|
1100
1109
|
};
|
|
1110
|
+
showIcon: {
|
|
1111
|
+
type: BooleanConstructor;
|
|
1112
|
+
default: boolean;
|
|
1113
|
+
};
|
|
1101
1114
|
beforeUpload: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | (() => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | {
|
|
1102
1115
|
(): (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
1103
1116
|
new (): any;
|
|
@@ -1710,6 +1723,7 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
1710
1723
|
file: Partial<import("element-plus").UploadFile>;
|
|
1711
1724
|
onError: (error: Error, uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
1712
1725
|
onChange: (uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
1726
|
+
showIcon: boolean;
|
|
1713
1727
|
controls: boolean;
|
|
1714
1728
|
beforeUpload: (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
1715
1729
|
onRemove: (uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
@@ -1850,6 +1864,10 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
1850
1864
|
type: BooleanConstructor;
|
|
1851
1865
|
default: boolean;
|
|
1852
1866
|
};
|
|
1867
|
+
showIcon: {
|
|
1868
|
+
type: BooleanConstructor;
|
|
1869
|
+
default: boolean;
|
|
1870
|
+
};
|
|
1853
1871
|
beforeUpload: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | (() => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>) | {
|
|
1854
1872
|
(): (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
1855
1873
|
new (): any;
|
|
@@ -2470,6 +2488,7 @@ export declare const GmUploadFile: import("../../../../utils").SFCWithInstall<{
|
|
|
2470
2488
|
file: Partial<import("element-plus").UploadFile>;
|
|
2471
2489
|
onError: (error: Error, uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
2472
2490
|
onChange: (uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
2491
|
+
showIcon: boolean;
|
|
2473
2492
|
controls: boolean;
|
|
2474
2493
|
beforeUpload: (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils/typescript.js").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
2475
2494
|
onRemove: (uploadFile: import("element-plus").UploadFile, uploadFiles: import("element-plus").UploadFiles) => void;
|
|
@@ -126,6 +126,10 @@ export declare const uploadFileProps: {
|
|
|
126
126
|
type: BooleanConstructor;
|
|
127
127
|
default: boolean;
|
|
128
128
|
};
|
|
129
|
+
showIcon: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
default: boolean;
|
|
132
|
+
};
|
|
129
133
|
beforeUpload: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils").Awaitable<boolean | void | Blob | File | null | undefined>) | (() => (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils").Awaitable<boolean | void | Blob | File | null | undefined>) | {
|
|
130
134
|
(): (rawFile: import("element-plus").UploadRawFile) => import("element-plus/es/utils").Awaitable<boolean | void | Blob | File | null | undefined>;
|
|
131
135
|
new (): any;
|
package/es/giime/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export { giimeDevProxy } from '../utils/src/http/devProxy.mjs';
|
|
|
16
16
|
export { getDomain } from '../utils/src/http/url.mjs';
|
|
17
17
|
export { getModifiedData, hasOwn, keysOf, resetObject } from '../utils/src/objects.mjs';
|
|
18
18
|
export { getDateShortcuts } from '../utils/src/date/dateShortcuts.mjs';
|
|
19
|
-
export { base64ToBlob, base64ToFile, blobToBase64, blobToFile, fileMd5, fileToBase64, fileToBlob, fileToUrl, fileValidType, getImageInfo, getVideoInfo, urlToBlob, urlToFile } from '../utils/src/file.mjs';
|
|
19
|
+
export { base64ToBlob, base64ToFile, blobToBase64, blobToFile, downloadFile, fileMd5, fileToBase64, fileToBlob, fileToUrl, fileValidType, getImageInfo, getVideoInfo, urlToBlob, urlToFile } from '../utils/src/file.mjs';
|
|
20
20
|
export { compareVersions, isVersionGreaterOrEqual, omitOnEvents, remove } from '../utils/src/general.mjs';
|
|
21
21
|
export { b64_hmac_md5, b64_md5, hex_hmac_md5, hex_md5, str_hmac_md5, str_md5, ts_md5_file } from '../utils/src/crypto/md5.mjs';
|
|
22
22
|
export { any_hmac_sha1, any_sha1, b64_hmac_sha1, b64_sha1, hex_hmac_sha1, hex_sha1 } from '../utils/src/crypto/sha1.mjs';
|
package/es/giime/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.6.
|
|
1
|
+
export declare const version = "0.6.23";
|
package/es/giime/version.mjs
CHANGED
package/es/giime/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.6.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.6.23';\n"],"names":[],"mappings":"AAAO,MAAM,OAAU,GAAA;;;;"}
|
package/es/index.css
CHANGED
|
@@ -1,137 +1,3 @@
|
|
|
1
|
-
.gm-flex-center[data-v-c17deec9] {
|
|
2
|
-
align-items: center;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.gm-flex-justify-between[data-v-c17deec9] {
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
}
|
|
8
|
-
.gm-upload-preview-dialog[data-v-9390650b] [data-v-9390650b] .el-dialog__body {
|
|
9
|
-
padding: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.gm-upload-file-picture-card[data-v-9390650b] [data-v-9390650b] .el-upload-list__item, .gm-upload-file-picture-card[data-v-9390650b] [data-v-9390650b] .el-upload--picture-card {
|
|
13
|
-
width: auto;
|
|
14
|
-
height: auto;
|
|
15
|
-
}
|
|
16
|
-
.gm-upload-file {
|
|
17
|
-
line-height: normal;
|
|
18
|
-
}
|
|
19
|
-
.gm-upload-file .el-checkbox {
|
|
20
|
-
position: absolute;
|
|
21
|
-
left: 10px;
|
|
22
|
-
top: 0;
|
|
23
|
-
z-index: 9;
|
|
24
|
-
}
|
|
25
|
-
.gm-upload-file .el-upload-list__item-file-name {
|
|
26
|
-
line-height: normal;
|
|
27
|
-
}
|
|
28
|
-
.gm-upload-file .el-upload-dragger {
|
|
29
|
-
padding: 0;
|
|
30
|
-
border: none;
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
display: flex;
|
|
34
|
-
}
|
|
35
|
-
.gm-upload-file .el-upload--picture-card {
|
|
36
|
-
border: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.gm-upload-file-disabled .el-upload--picture-card {
|
|
40
|
-
display: none;
|
|
41
|
-
}
|
|
42
|
-
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
43
|
-
display: none;
|
|
44
|
-
}
|
|
45
|
-
.circular[data-v-d7b04fae] {
|
|
46
|
-
animation: loading-rotate-d7b04fae 2s linear infinite;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.path[data-v-d7b04fae] {
|
|
50
|
-
animation: loading-dash-d7b04fae 1.5s ease-in-out infinite;
|
|
51
|
-
stroke-dasharray: 90, 150;
|
|
52
|
-
stroke-dashoffset: 0;
|
|
53
|
-
stroke: var(--el-color-primary);
|
|
54
|
-
stroke-linecap: round;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@keyframes loading-rotate-d7b04fae {
|
|
58
|
-
to {
|
|
59
|
-
transform: rotate(360deg);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
@keyframes loading-dash-d7b04fae {
|
|
63
|
-
0% {
|
|
64
|
-
stroke-dasharray: 1, 200;
|
|
65
|
-
stroke-dashoffset: 0;
|
|
66
|
-
}
|
|
67
|
-
50% {
|
|
68
|
-
stroke-dasharray: 90, 150;
|
|
69
|
-
stroke-dashoffset: -40px;
|
|
70
|
-
}
|
|
71
|
-
100% {
|
|
72
|
-
stroke-dasharray: 90, 150;
|
|
73
|
-
stroke-dashoffset: -120px;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.gm-range-number .el-form-item[data-v-1ae16d96] {
|
|
78
|
-
margin: 0;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
[data-v-488ca110] .gmSearchForm .el-form-item {
|
|
82
|
-
margin-right: 0;
|
|
83
|
-
margin-bottom: 4px;
|
|
84
|
-
}
|
|
85
|
-
[data-v-2c351ff8] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
86
|
-
border-right: none;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
[data-v-2c351ff8] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
90
|
-
height: 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
[data-v-2c351ff8] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
94
|
-
height: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:after {
|
|
98
|
-
height: 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:before {
|
|
102
|
-
height: 0;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
[data-v-2c351ff8] .gmTableNoBorder .el-table__border-left-patch {
|
|
106
|
-
height: 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.pagination-container[data-v-47d35e7b] {
|
|
110
|
-
background: #fff;
|
|
111
|
-
padding-top: 12px;
|
|
112
|
-
}
|
|
113
|
-
.pagination-container.hidden[data-v-47d35e7b] {
|
|
114
|
-
display: none;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.gm-number-interval-single[data-v-4e6f4d6f] {
|
|
118
|
-
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
119
|
-
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
120
|
-
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
121
|
-
}
|
|
122
|
-
.gm-number-interval-single[data-v-4e6f4d6f] [data-v-4e6f4d6f] .el-input__wrapper {
|
|
123
|
-
box-shadow: none;
|
|
124
|
-
background: none;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.gm-number-interval-close[data-v-4e6f4d6f] {
|
|
128
|
-
display: none;
|
|
129
|
-
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.gm-number-interval-single[data-v-4e6f4d6f]:hover .gm-number-interval-close[data-v-4e6f4d6f] {
|
|
133
|
-
display: flex;
|
|
134
|
-
}
|
|
135
1
|
/*
|
|
136
2
|
! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com
|
|
137
3
|
*//*
|
|
@@ -937,4 +803,138 @@ video {
|
|
|
937
803
|
}
|
|
938
804
|
.gm-group:hover .group-hover\:gm-block {
|
|
939
805
|
display: block;
|
|
806
|
+
}
|
|
807
|
+
.gm-flex-center[data-v-c17deec9] {
|
|
808
|
+
align-items: center;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.gm-flex-justify-between[data-v-c17deec9] {
|
|
812
|
+
justify-content: space-between;
|
|
813
|
+
}
|
|
814
|
+
.gm-upload-preview-dialog[data-v-921404ff] [data-v-921404ff] .el-dialog__body {
|
|
815
|
+
padding: 0;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.gm-upload-file-picture-card[data-v-921404ff] [data-v-921404ff] .el-upload-list__item, .gm-upload-file-picture-card[data-v-921404ff] [data-v-921404ff] .el-upload--picture-card {
|
|
819
|
+
width: auto;
|
|
820
|
+
height: auto;
|
|
821
|
+
}
|
|
822
|
+
.gm-upload-file {
|
|
823
|
+
line-height: normal;
|
|
824
|
+
}
|
|
825
|
+
.gm-upload-file .el-checkbox {
|
|
826
|
+
position: absolute;
|
|
827
|
+
left: 10px;
|
|
828
|
+
top: 0;
|
|
829
|
+
z-index: 9;
|
|
830
|
+
}
|
|
831
|
+
.gm-upload-file .el-upload-list__item-file-name {
|
|
832
|
+
line-height: normal;
|
|
833
|
+
}
|
|
834
|
+
.gm-upload-file .el-upload-dragger {
|
|
835
|
+
padding: 0;
|
|
836
|
+
border: none;
|
|
837
|
+
width: 100%;
|
|
838
|
+
height: 100%;
|
|
839
|
+
display: flex;
|
|
840
|
+
}
|
|
841
|
+
.gm-upload-file .el-upload--picture-card {
|
|
842
|
+
border: none;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.gm-upload-file-disabled .el-upload--picture-card {
|
|
846
|
+
display: none;
|
|
847
|
+
}
|
|
848
|
+
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
849
|
+
display: none;
|
|
850
|
+
}
|
|
851
|
+
.circular[data-v-d7b04fae] {
|
|
852
|
+
animation: loading-rotate-d7b04fae 2s linear infinite;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.path[data-v-d7b04fae] {
|
|
856
|
+
animation: loading-dash-d7b04fae 1.5s ease-in-out infinite;
|
|
857
|
+
stroke-dasharray: 90, 150;
|
|
858
|
+
stroke-dashoffset: 0;
|
|
859
|
+
stroke: var(--el-color-primary);
|
|
860
|
+
stroke-linecap: round;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
@keyframes loading-rotate-d7b04fae {
|
|
864
|
+
to {
|
|
865
|
+
transform: rotate(360deg);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
@keyframes loading-dash-d7b04fae {
|
|
869
|
+
0% {
|
|
870
|
+
stroke-dasharray: 1, 200;
|
|
871
|
+
stroke-dashoffset: 0;
|
|
872
|
+
}
|
|
873
|
+
50% {
|
|
874
|
+
stroke-dasharray: 90, 150;
|
|
875
|
+
stroke-dashoffset: -40px;
|
|
876
|
+
}
|
|
877
|
+
100% {
|
|
878
|
+
stroke-dasharray: 90, 150;
|
|
879
|
+
stroke-dashoffset: -120px;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.gm-range-number .el-form-item[data-v-1ae16d96] {
|
|
884
|
+
margin: 0;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
[data-v-488ca110] .gmSearchForm .el-form-item {
|
|
888
|
+
margin-right: 0;
|
|
889
|
+
margin-bottom: 4px;
|
|
890
|
+
}
|
|
891
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
892
|
+
border-right: none;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
896
|
+
height: 0;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
900
|
+
height: 0;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:after {
|
|
904
|
+
height: 0;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:before {
|
|
908
|
+
height: 0;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__border-left-patch {
|
|
912
|
+
height: 0;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.pagination-container[data-v-47d35e7b] {
|
|
916
|
+
background: #fff;
|
|
917
|
+
padding-top: 12px;
|
|
918
|
+
}
|
|
919
|
+
.pagination-container.hidden[data-v-47d35e7b] {
|
|
920
|
+
display: none;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.gm-number-interval-single[data-v-4e6f4d6f] {
|
|
924
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
925
|
+
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
926
|
+
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
927
|
+
}
|
|
928
|
+
.gm-number-interval-single[data-v-4e6f4d6f] [data-v-4e6f4d6f] .el-input__wrapper {
|
|
929
|
+
box-shadow: none;
|
|
930
|
+
background: none;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.gm-number-interval-close[data-v-4e6f4d6f] {
|
|
934
|
+
display: none;
|
|
935
|
+
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.gm-number-interval-single[data-v-4e6f4d6f]:hover .gm-number-interval-close[data-v-4e6f4d6f] {
|
|
939
|
+
display: flex;
|
|
940
940
|
}
|
package/es/utils/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import './src/http/index.mjs';
|
|
|
5
5
|
export { getModifiedData, hasOwn, keysOf, resetObject } from './src/objects.mjs';
|
|
6
6
|
import './src/types.mjs';
|
|
7
7
|
import './src/date/index.mjs';
|
|
8
|
-
export { base64ToBlob, base64ToFile, blobToBase64, blobToFile, fileMd5, fileToBase64, fileToBlob, fileToUrl, fileValidType, getImageInfo, getVideoInfo, urlToBlob, urlToFile } from './src/file.mjs';
|
|
8
|
+
export { base64ToBlob, base64ToFile, blobToBase64, blobToFile, downloadFile, fileMd5, fileToBase64, fileToBlob, fileToUrl, fileValidType, getImageInfo, getVideoInfo, urlToBlob, urlToFile } from './src/file.mjs';
|
|
9
9
|
export { compareVersions, isVersionGreaterOrEqual, omitOnEvents, remove } from './src/general.mjs';
|
|
10
10
|
import './src/crypto/index.mjs';
|
|
11
11
|
export { formatNumberWithCommas } from './src/number.mjs';
|
package/es/utils/src/file.d.ts
CHANGED
package/es/utils/src/file.mjs
CHANGED
|
@@ -103,6 +103,14 @@ const getVideoInfo = (url) => {
|
|
|
103
103
|
video.src = url;
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
+
const downloadFile = (url, filename = "\u4E0B\u8F7D\u6587\u4EF6") => {
|
|
107
|
+
fetch(url).then((response) => response.blob()).then((blob) => {
|
|
108
|
+
const a = document.createElement("a");
|
|
109
|
+
a.href = URL.createObjectURL(blob);
|
|
110
|
+
a.download = filename;
|
|
111
|
+
a.click();
|
|
112
|
+
});
|
|
113
|
+
};
|
|
106
114
|
|
|
107
|
-
export { base64ToBlob, base64ToFile, blobToBase64, blobToFile, fileMd5, fileToBase64, fileToBlob, fileToUrl, fileValidType, getImageInfo, getVideoInfo, urlToBlob, urlToFile };
|
|
115
|
+
export { base64ToBlob, base64ToFile, blobToBase64, blobToFile, downloadFile, fileMd5, fileToBase64, fileToBlob, fileToUrl, fileValidType, getImageInfo, getVideoInfo, urlToBlob, urlToFile };
|
|
108
116
|
//# sourceMappingURL=file.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.mjs","sources":["../../../../../packages/utils/src/file.ts"],"sourcesContent":["import { md5 } from 'js-md5';\n\nexport interface FileConversionOptions {\n mimeType?: string;\n}\n/**\n * 将 URL 转换为 Blob\n * @param url\n * @returns\n */\nexport async function urlToBlob(url: string): Promise<Blob> {\n const response = await fetch(url);\n return response.blob();\n}\n\n/**\n * 将 URL 转换为 File\n * @param url\n * @param filename\n * @param options\n * @returns\n */\nexport async function urlToFile(url: string, filename: string, options?: FileConversionOptions): Promise<File> {\n const blob = await urlToBlob(url);\n return new File([blob], filename, { type: options?.mimeType ?? blob.type });\n}\n\n/**\n * 将 Base64 字符串转换为 File\n * @param base64\n * @param filename\n * @param options\n * @returns\n */\nexport function base64ToFile(base64: string, filename: string, options?: FileConversionOptions): File {\n const bolb = base64ToBlob(base64, { mimeType: options?.mimeType });\n return blobToFile(bolb, filename);\n}\n\n/**\n * 将 File 转换为 Base64 字符串\n * @param file\n * @returns\n */\nexport function fileToBase64(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(file);\n });\n}\n\n/**\n * 将 Blob 转换为 Base64 字符串\n * @param blob\n * @returns\n */\nexport function blobToBase64(blob: Blob): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\n/**\n * 将 File 转换为 Blob\n * @param file\n * @param options\n * @returns\n */\nexport function fileToBlob(file: File, options?: FileConversionOptions): Blob {\n return new Blob([file], { type: options?.mimeType ?? file.type });\n}\n\n/**\n * 将 Blob 转换为 File\n * @param blob\n * @param filename\n * @param options\n * @returns\n */\nexport function blobToFile(blob: Blob, filename: string, options?: FileConversionOptions): File {\n return new File([blob], filename, { type: options?.mimeType ?? blob.type });\n}\n\n/**\n * 将 Base64 字符串转换为 Blob\n * @param base64\n * @param options\n * @returns\n */\nexport function base64ToBlob(base64: string, options?: FileConversionOptions): Blob {\n const matches = base64.match(/^data:(.+);base64,(.*)$/);\n\n if (!matches || matches.length !== 3) {\n throw new Error('Invalid Base64 string');\n }\n\n const mimeType = options?.mimeType ?? matches[1];\n const byteString = atob(matches[2]);\n const arrayBuffer = new ArrayBuffer(byteString.length);\n const intArray = new Uint8Array(arrayBuffer);\n\n for (let i = 0; i < byteString.length; i++) {\n intArray[i] = byteString.charCodeAt(i);\n }\n\n return new Blob([intArray], { type: mimeType });\n}\n/**\n * 文件转本地url\n * @param file\n * @returns\n */\nexport function fileToUrl(file: File | Blob) {\n return URL.createObjectURL(file);\n}\n\n// 导出一个函数,用于检查文件类型是否合法\nexport function fileValidType(file: File, validTypes: string) {\n // 获取文件的 MIME 类型\n const fileType = file.type || '';\n // 获取文件的扩展名\n const fileExtension = file.name.slice(Math.max(0, file.name.lastIndexOf('.')));\n // 将合法的文件类型字符串分割成数组\n const acceptTypes = validTypes.split(',').map(type => type.trim());\n // 遍历合法的文件类型数组,检查文件类型是否合法\n return acceptTypes.some(type => {\n // 如果文件类型以 . 开头,则检查文件扩展名\n if (type.startsWith('.')) {\n // 检查文件扩展名是否与合法的文件类型匹配\n return fileExtension.toLowerCase() === type.toLowerCase();\n // 如果文件类型包含 /*,则检查 MIME 类型组,如 image/*\n } else if (type.includes('/*')) {\n // 检查 MIME 类型组,如 image/*\n const [mainType] = type.split('/');\n return fileType.startsWith(`${mainType}/`);\n } else {\n // 检查具体 MIME 类型\n return fileType === type;\n }\n });\n}\n\n/**\n * 计算文件的MD5哈希值\n * @param file 要计算哈希值的文件\n * @returns 文件的MD5哈希值\n */\nexport const fileMd5 = (file: File): Promise<string> => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = e => {\n try {\n const binary = (e.target as FileReader).result;\n if (binary) {\n resolve(md5(binary));\n } else {\n reject(new Error('读取文件内容失败'));\n }\n } catch (error) {\n reject(new Error(`计算MD5失败: ${error instanceof Error ? error.message : String(error)}`));\n }\n };\n\n reader.onerror = () => {\n reject(new Error('读取文件失败'));\n };\n\n reader.readAsArrayBuffer(file);\n });\n};\n\n/**\n * 获取图片宽高信息\n * @param url 图片链接\n * @returns 图片宽高信息\n */\nexport const getImageInfo = (url: string): Promise<{ width: number; height: number }> => {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve({ width: img.width, height: img.height });\n img.onerror = reject;\n img.src = url;\n });\n};\n\n/**\n * 获取视频信息\n * @param url 视频链接\n * @returns 视频宽高信息\n */\nexport const getVideoInfo = (url: string): Promise<{ width: number; height: number; duration: number }> => {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.onloadedmetadata = () => resolve({ width: video.videoWidth, height: video.videoHeight, duration: video.duration });\n video.onerror = reject;\n video.src = url;\n });\n};\n"],"names":[],"mappings":";;AAUA,eAAsB,UAAU,GAA4B,EAAA;AAC1D,EAAM,MAAA,QAAA,GAAW,MAAM,KAAA,CAAM,GAAG,CAAA,CAAA;AAChC,EAAA,OAAO,SAAS,IAAK,EAAA,CAAA;AACvB,CAAA;AASsB,eAAA,SAAA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A;AAOa,MAAA,YAAA,GAAe,CAAC,GAA8E,KAAA;AACzG,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAW,KAAA;AACtC,IAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,aAAA,CAAc,OAAO,CAAA,CAAA;AAC5C,IAAA,KAAA,CAAM,gBAAmB,GAAA,MAAM,OAAQ,CAAA,EAAE,KAAO,EAAA,KAAA,CAAM,UAAY,EAAA,MAAA,EAAQ,KAAM,CAAA,WAAA,EAAa,QAAU,EAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACvH,IAAA,KAAA,CAAM,OAAU,GAAA,MAAA,CAAA;AAChB,IAAA,KAAA,CAAM,GAAM,GAAA,GAAA,CAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"file.mjs","sources":["../../../../../packages/utils/src/file.ts"],"sourcesContent":["import { md5 } from 'js-md5';\n\nexport interface FileConversionOptions {\n mimeType?: string;\n}\n/**\n * 将 URL 转换为 Blob\n * @param url\n * @returns\n */\nexport async function urlToBlob(url: string): Promise<Blob> {\n const response = await fetch(url);\n return response.blob();\n}\n\n/**\n * 将 URL 转换为 File\n * @param url\n * @param filename\n * @param options\n * @returns\n */\nexport async function urlToFile(url: string, filename: string, options?: FileConversionOptions): Promise<File> {\n const blob = await urlToBlob(url);\n return new File([blob], filename, { type: options?.mimeType ?? blob.type });\n}\n\n/**\n * 将 Base64 字符串转换为 File\n * @param base64\n * @param filename\n * @param options\n * @returns\n */\nexport function base64ToFile(base64: string, filename: string, options?: FileConversionOptions): File {\n const bolb = base64ToBlob(base64, { mimeType: options?.mimeType });\n return blobToFile(bolb, filename);\n}\n\n/**\n * 将 File 转换为 Base64 字符串\n * @param file\n * @returns\n */\nexport function fileToBase64(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(file);\n });\n}\n\n/**\n * 将 Blob 转换为 Base64 字符串\n * @param blob\n * @returns\n */\nexport function blobToBase64(blob: Blob): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\n/**\n * 将 File 转换为 Blob\n * @param file\n * @param options\n * @returns\n */\nexport function fileToBlob(file: File, options?: FileConversionOptions): Blob {\n return new Blob([file], { type: options?.mimeType ?? file.type });\n}\n\n/**\n * 将 Blob 转换为 File\n * @param blob\n * @param filename\n * @param options\n * @returns\n */\nexport function blobToFile(blob: Blob, filename: string, options?: FileConversionOptions): File {\n return new File([blob], filename, { type: options?.mimeType ?? blob.type });\n}\n\n/**\n * 将 Base64 字符串转换为 Blob\n * @param base64\n * @param options\n * @returns\n */\nexport function base64ToBlob(base64: string, options?: FileConversionOptions): Blob {\n const matches = base64.match(/^data:(.+);base64,(.*)$/);\n\n if (!matches || matches.length !== 3) {\n throw new Error('Invalid Base64 string');\n }\n\n const mimeType = options?.mimeType ?? matches[1];\n const byteString = atob(matches[2]);\n const arrayBuffer = new ArrayBuffer(byteString.length);\n const intArray = new Uint8Array(arrayBuffer);\n\n for (let i = 0; i < byteString.length; i++) {\n intArray[i] = byteString.charCodeAt(i);\n }\n\n return new Blob([intArray], { type: mimeType });\n}\n/**\n * 文件转本地url\n * @param file\n * @returns\n */\nexport function fileToUrl(file: File | Blob) {\n return URL.createObjectURL(file);\n}\n\n// 导出一个函数,用于检查文件类型是否合法\nexport function fileValidType(file: File, validTypes: string) {\n // 获取文件的 MIME 类型\n const fileType = file.type || '';\n // 获取文件的扩展名\n const fileExtension = file.name.slice(Math.max(0, file.name.lastIndexOf('.')));\n // 将合法的文件类型字符串分割成数组\n const acceptTypes = validTypes.split(',').map(type => type.trim());\n // 遍历合法的文件类型数组,检查文件类型是否合法\n return acceptTypes.some(type => {\n // 如果文件类型以 . 开头,则检查文件扩展名\n if (type.startsWith('.')) {\n // 检查文件扩展名是否与合法的文件类型匹配\n return fileExtension.toLowerCase() === type.toLowerCase();\n // 如果文件类型包含 /*,则检查 MIME 类型组,如 image/*\n } else if (type.includes('/*')) {\n // 检查 MIME 类型组,如 image/*\n const [mainType] = type.split('/');\n return fileType.startsWith(`${mainType}/`);\n } else {\n // 检查具体 MIME 类型\n return fileType === type;\n }\n });\n}\n\n/**\n * 计算文件的MD5哈希值\n * @param file 要计算哈希值的文件\n * @returns 文件的MD5哈希值\n */\nexport const fileMd5 = (file: File): Promise<string> => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = e => {\n try {\n const binary = (e.target as FileReader).result;\n if (binary) {\n resolve(md5(binary));\n } else {\n reject(new Error('读取文件内容失败'));\n }\n } catch (error) {\n reject(new Error(`计算MD5失败: ${error instanceof Error ? error.message : String(error)}`));\n }\n };\n\n reader.onerror = () => {\n reject(new Error('读取文件失败'));\n };\n\n reader.readAsArrayBuffer(file);\n });\n};\n\n/**\n * 获取图片宽高信息\n * @param url 图片链接\n * @returns 图片宽高信息\n */\nexport const getImageInfo = (url: string): Promise<{ width: number; height: number }> => {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve({ width: img.width, height: img.height });\n img.onerror = reject;\n img.src = url;\n });\n};\n\n/**\n * 获取视频信息\n * @param url 视频链接\n * @returns 视频宽高信息\n */\nexport const getVideoInfo = (url: string): Promise<{ width: number; height: number; duration: number }> => {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.onloadedmetadata = () => resolve({ width: video.videoWidth, height: video.videoHeight, duration: video.duration });\n video.onerror = reject;\n video.src = url;\n });\n};\n\n/**\n * 下载文件\n * @param url 文件链接\n * @param filename 文件名\n */\nexport const downloadFile = (url: string, filename: string = '下载文件') => {\n fetch(url)\n .then(response => response.blob())\n .then(blob => {\n const a = document.createElement('a');\n a.href = URL.createObjectURL(blob);\n a.download = filename;\n a.click();\n });\n};\n"],"names":[],"mappings":";;AAUA,e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appendToBody: BooleanConstructor;
|
|
3
4
|
appendTo: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | ((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement))[], unknown, unknown, "body", boolean>;
|
|
@@ -60,3 +61,4 @@ export declare const dialogEmits: {
|
|
|
60
61
|
openAutoFocus: () => boolean;
|
|
61
62
|
closeAutoFocus: () => boolean;
|
|
62
63
|
};
|
|
64
|
+
export type DialogProps = ExtractPropTypes<typeof dialogProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../../../../../../packages/components/src/base/dialog/dialog.ts"],"sourcesContent":["import { dialogEmits as elDialogEmits, dialogProps as elDialogProps } from 'element-plus';\n// import type { ExtractPropTypes } from 'vue';\n\nexport const dialogProps = {\n ...elDialogProps,\n};\n\nexport const dialogEmits = {\n ...elDialogEmits,\n // 自定义事件\n // submit: (value: any) => !!value,\n};\n"],"names":["elDialogProps","elDialogEmits"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../../../../../../packages/components/src/base/dialog/dialog.ts"],"sourcesContent":["import { dialogEmits as elDialogEmits, dialogProps as elDialogProps } from 'element-plus';\nimport type { ExtractPropTypes } from 'vue';\n// import type { ExtractPropTypes } from 'vue';\n\nexport const dialogProps = {\n ...elDialogProps,\n};\n\nexport const dialogEmits = {\n ...elDialogEmits,\n // 自定义事件\n // submit: (value: any) => !!value,\n};\nexport type DialogProps = ExtractPropTypes<typeof dialogProps>;\n"],"names":["elDialogProps","elDialogEmits"],"mappings":";;;;AAIO,MAAM,WAAc,GAAA;AAAA,EACzB,GAAGA,uBAAA;AACL,EAAA;AAEO,MAAM,WAAc,GAAA;AAAA,EACzB,GAAGC,uBAAA;AAAA;AAAA;AAGL;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeSelect.vue2.js","sources":["../../../../../../../packages/components/src/base/timeSelect/TimeSelect.vue"],"sourcesContent":["<template>\n <el-time-select ref=\"elRef\" v-bind=\"props\" v-on=\"elEvents\">\n <template v-if=\"slots.default\" #default=\"slotValue\">\n <slot v-bind=\"slotValue\" />\n </template>\n </el-time-select>\n</template>\n<script lang=\"ts\" setup>\nimport { ref, useSlots } from 'vue';\nimport { getGmEvent, getGmExports } from '@giime/utils';\nimport { ElTimeSelect } from 'element-plus';\nimport { elTimeSelectEmits, timeSelectEmits, timeSelectProps } from './timeSelect';\nimport type { TimeSelectInstance } from 'element-plus/es/components/time-select/
|
|
1
|
+
{"version":3,"file":"TimeSelect.vue2.js","sources":["../../../../../../../packages/components/src/base/timeSelect/TimeSelect.vue"],"sourcesContent":["<template>\n <el-time-select ref=\"elRef\" v-bind=\"props\" v-on=\"elEvents\">\n <template v-if=\"slots.default\" #default=\"slotValue\">\n <slot v-bind=\"slotValue\" />\n </template>\n </el-time-select>\n</template>\n<script lang=\"ts\" setup>\nimport { ref, useSlots } from 'vue';\nimport { getGmEvent, getGmExports } from '@giime/utils';\nimport { ElTimeSelect } from 'element-plus';\nimport { elTimeSelectEmits, timeSelectEmits, timeSelectProps } from './timeSelect';\nimport type { TimeSelectInstance } from 'element-plus/es/components/time-select/index';\ndefineOptions({\n name: 'GmTimeSelect',\n});\nconst slots = useSlots();\nconst props = defineProps(timeSelectProps);\nconst emit = defineEmits(timeSelectEmits);\n// 重发el的事件\nconst elEvents = getGmEvent(elTimeSelectEmits, emit);\nconst elRef = ref<TimeSelectInstance>();\nconst exposeEvents = ['focus', 'blur'] as const;\nconst { exposeFns } = getGmExports(elRef, exposeEvents);\ndefineExpose({\n ...exposeFns,\n});\n</script>\n"],"names":["useSlots","getGmEvent","elTimeSelectEmits","ref","getGmExports"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AACvB,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAM,MAAA,QAAA,GAAWC,gBAAW,CAAAC,4BAAA,EAAmB,IAAI,CAAA,CAAA;AACnD,IAAA,MAAM,QAAQC,OAAwB,EAAA,CAAA;AACtC,IAAM,MAAA,YAAA,GAAe,CAAC,OAAA,EAAS,MAAM,CAAA,CAAA;AACrC,IAAA,MAAM,EAAE,SAAA,EAAc,GAAAC,sBAAA,CAAa,OAAO,YAAY,CAAA,CAAA;AACtD,IAAa,QAAA,CAAA;AAAA,MACX,GAAG,SAAA;AAAA,KACJ,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var index = require('element-plus/es/components/time-select/index');
|
|
4
4
|
|
|
5
5
|
const timeSelectProps = {
|
|
6
|
-
...
|
|
6
|
+
...index.timeSelectProps
|
|
7
7
|
};
|
|
8
8
|
const elTimeSelectEmits = {
|
|
9
9
|
"update:modelValue": (val) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeSelect.js","sources":["../../../../../../../packages/components/src/base/timeSelect/timeSelect.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { timeSelectProps as elTimeSelectProps } from 'element-plus/es/components/time-select/
|
|
1
|
+
{"version":3,"file":"timeSelect.js","sources":["../../../../../../../packages/components/src/base/timeSelect/timeSelect.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { timeSelectProps as elTimeSelectProps } from 'element-plus/es/components/time-select/index';\nexport const timeSelectProps = {\n ...elTimeSelectProps,\n};\n\nexport const elTimeSelectEmits = {\n 'update:modelValue': (val: any) => {},\n change: (val: any) => {},\n blur: (event: FocusEvent) => {},\n focus: (event: FocusEvent) => {},\n};\n\nexport const timeSelectEmits = {\n ...elTimeSelectEmits,\n // 自定义事件\n // submit: (value: any) => !!value,\n};\n"],"names":["elTimeSelectProps"],"mappings":";;;;AAEO,MAAM,eAAkB,GAAA;AAAA,EAC7B,GAAGA,qBAAA;AACL,EAAA;AAEO,MAAM,iBAAoB,GAAA;AAAA,EAC/B,mBAAA,EAAqB,CAAC,GAAa,KAAA;AAAA,GAAC;AAAA,EACpC,MAAA,EAAQ,CAAC,GAAa,KAAA;AAAA,GAAC;AAAA,EACvB,IAAA,EAAM,CAAC,KAAsB,KAAA;AAAA,GAAC;AAAA,EAC9B,KAAA,EAAO,CAAC,KAAsB,KAAA;AAAA,GAAC;AACjC,EAAA;AAEO,MAAM,eAAkB,GAAA;AAAA,EAC7B,GAAG,iBAAA;AAAA;AAAA;AAGL;;;;;;"}
|