@veltra/desktop 1.6.3 → 1.6.4
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/components/action/action-group.js.map +1 -1
- package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/file-viewer/previewers/sheet-previewer.js +5 -1
- package/dist/components/file-viewer/previewers/sheet-previewer.js.map +1 -1
- package/package.json +6 -6
- package/src/components/action/action-group.vue +8 -25
- package/src/components/file-viewer/previewers/sheet-previewer.vue +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-group.js","names":[],"sources":["../../../src/components/action/action-group.vue"],"sourcesContent":["<template>\n <component v-for=\"node of getSlotsNodes()\" :key=\"node.key\" :is=\"node\" />\n</template>\n\n<script lang=\"tsx\" setup>\nimport { MoreFilled } from '@veltra/icons/normal'\nimport { bem, extractNormalVNodes } from '@veltra/utils'\nimport { cloneVNode, provide, shallowRef, type VNode } from 'vue'\n\nimport type { _ActionGroupExposed, ActionGroupProps } from '../../types'\nimport { UButton } from '../button'\nimport { UTip } from '../tip'\nimport { ActionDIKey } from './di'\n\ndefineOptions({
|
|
1
|
+
{"version":3,"file":"action-group.js","names":[],"sources":["../../../src/components/action/action-group.vue"],"sourcesContent":["<template>\n <component v-for=\"node of getSlotsNodes()\" :key=\"node.key\" :is=\"node\" />\n</template>\n\n<script lang=\"tsx\" setup>\nimport { MoreFilled } from '@veltra/icons/normal'\nimport { bem, extractNormalVNodes } from '@veltra/utils'\nimport { cloneVNode, provide, shallowRef, type VNode } from 'vue'\n\nimport type { _ActionGroupExposed, ActionGroupProps } from '../../types'\nimport { UButton } from '../button'\nimport { UTip } from '../tip'\nimport { ActionDIKey } from './di'\n\ndefineOptions({ name: 'UActionGroup', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ActionGroupProps>(), {\n max: 3,\n loading: false,\n circle: false,\n size: 'small',\n text: true,\n type: 'primary'\n})\n\nconst cls = bem('action-group')\n\nconst slots = defineSlots<{ default?: () => VNode[] }>()\n\nfunction isInDropdownNode(node: VNode): boolean {\n const p = node.props as Record<string, unknown> | null\n if (!p) return false\n const v = p.inDropdown ?? p['in-dropdown']\n return v === true || v === '' || v === 'true'\n}\n\nconst tipVisible = shallowRef(false)\n\nfunction closeTip() {\n tipVisible.value = false\n}\n\nfunction withSeparators(nodes: VNode[]) {\n return nodes.flatMap((node, index) => {\n if (index === 0) return [node]\n\n return [<i key={`separator-${index}`} class={cls.e('separator')} aria-hidden='true' />, node]\n })\n}\n\nfunction getSlotsNodes() {\n const nodes = slots.default?.()\n if (!nodes) return []\n\n const extracted = extractNormalVNodes(nodes).filter(\n (node) => (node.type as { name?: string } | null | undefined)?.name === 'UAction'\n )\n\n const visible: VNode[] = []\n const fixedHidden: VNode[] = []\n\n extracted.forEach((node) => {\n if (isInDropdownNode(node)) {\n fixedHidden.push(node)\n } else {\n visible.push(node)\n }\n })\n\n const willOverflow = visible.length > props.max\n const overflow = willOverflow ? visible.splice(props.max - 1) : []\n\n const hiddenNodes = [...overflow, ...fixedHidden]\n\n const dropdownNodes = hiddenNodes.map((node) =>\n cloneVNode(node, { inDropdown: true, circle: false })\n )\n\n const dropdown = hiddenNodes.length ? (\n <UTip\n direction='bottom'\n alignment='end'\n trigger='click'\n class={cls.e('dropdown')}\n visible={tipVisible.value}\n onUpdate:visible={(val: boolean) => {\n tipVisible.value = val\n }}\n >\n {{\n content: () => dropdownNodes,\n default: () => (\n <UButton\n class={cls.e('more')}\n type={props.type}\n size={props.size}\n text={props.text}\n circle\n icon={MoreFilled}\n />\n )\n }}\n </UTip>\n ) : null\n\n return withSeparators(dropdown ? [...visible, dropdown] : visible)\n}\n\nprovide(ActionDIKey, { groupProps: props, closeTip })\n\ndefineExpose<_ActionGroupExposed>({ closeTip })\n</script>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-group.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/action/action-group.vue"],"sourcesContent":["<template>\n <component v-for=\"node of getSlotsNodes()\" :key=\"node.key\" :is=\"node\" />\n</template>\n\n<script lang=\"tsx\" setup>\nimport { MoreFilled } from '@veltra/icons/normal'\nimport { bem, extractNormalVNodes } from '@veltra/utils'\nimport { cloneVNode, provide, shallowRef, type VNode } from 'vue'\n\nimport type { _ActionGroupExposed, ActionGroupProps } from '../../types'\nimport { UButton } from '../button'\nimport { UTip } from '../tip'\nimport { ActionDIKey } from './di'\n\ndefineOptions({
|
|
1
|
+
{"version":3,"file":"action-group.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/action/action-group.vue"],"sourcesContent":["<template>\n <component v-for=\"node of getSlotsNodes()\" :key=\"node.key\" :is=\"node\" />\n</template>\n\n<script lang=\"tsx\" setup>\nimport { MoreFilled } from '@veltra/icons/normal'\nimport { bem, extractNormalVNodes } from '@veltra/utils'\nimport { cloneVNode, provide, shallowRef, type VNode } from 'vue'\n\nimport type { _ActionGroupExposed, ActionGroupProps } from '../../types'\nimport { UButton } from '../button'\nimport { UTip } from '../tip'\nimport { ActionDIKey } from './di'\n\ndefineOptions({ name: 'UActionGroup', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ActionGroupProps>(), {\n max: 3,\n loading: false,\n circle: false,\n size: 'small',\n text: true,\n type: 'primary'\n})\n\nconst cls = bem('action-group')\n\nconst slots = defineSlots<{ default?: () => VNode[] }>()\n\nfunction isInDropdownNode(node: VNode): boolean {\n const p = node.props as Record<string, unknown> | null\n if (!p) return false\n const v = p.inDropdown ?? p['in-dropdown']\n return v === true || v === '' || v === 'true'\n}\n\nconst tipVisible = shallowRef(false)\n\nfunction closeTip() {\n tipVisible.value = false\n}\n\nfunction withSeparators(nodes: VNode[]) {\n return nodes.flatMap((node, index) => {\n if (index === 0) return [node]\n\n return [<i key={`separator-${index}`} class={cls.e('separator')} aria-hidden='true' />, node]\n })\n}\n\nfunction getSlotsNodes() {\n const nodes = slots.default?.()\n if (!nodes) return []\n\n const extracted = extractNormalVNodes(nodes).filter(\n (node) => (node.type as { name?: string } | null | undefined)?.name === 'UAction'\n )\n\n const visible: VNode[] = []\n const fixedHidden: VNode[] = []\n\n extracted.forEach((node) => {\n if (isInDropdownNode(node)) {\n fixedHidden.push(node)\n } else {\n visible.push(node)\n }\n })\n\n const willOverflow = visible.length > props.max\n const overflow = willOverflow ? visible.splice(props.max - 1) : []\n\n const hiddenNodes = [...overflow, ...fixedHidden]\n\n const dropdownNodes = hiddenNodes.map((node) =>\n cloneVNode(node, { inDropdown: true, circle: false })\n )\n\n const dropdown = hiddenNodes.length ? (\n <UTip\n direction='bottom'\n alignment='end'\n trigger='click'\n class={cls.e('dropdown')}\n visible={tipVisible.value}\n onUpdate:visible={(val: boolean) => {\n tipVisible.value = val\n }}\n >\n {{\n content: () => dropdownNodes,\n default: () => (\n <UButton\n class={cls.e('more')}\n type={props.type}\n size={props.size}\n text={props.text}\n circle\n icon={MoreFilled}\n />\n )\n }}\n </UTip>\n ) : null\n\n return withSeparators(dropdown ? [...visible, dropdown] : visible)\n}\n\nprovide(ActionDIKey, { groupProps: props, closeTip })\n\ndefineExpose<_ActionGroupExposed>({ closeTip })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EASd,MAAM,MAAM,IAAI,cAAc;EAE9B,MAAM,QAAQ,SAAA;EAEd,SAAS,iBAAiB,MAAsB;GAC9C,MAAM,IAAI,KAAK;GACf,IAAI,CAAC,GAAG,OAAO;GACf,MAAM,IAAI,EAAE,cAAc,EAAE;GAC5B,OAAO,MAAM,QAAQ,MAAM,MAAM,MAAM;EACzC;EAEA,MAAM,aAAa,WAAW,KAAK;EAEnC,SAAS,WAAW;GAClB,WAAW,QAAQ;EACrB;EAEA,SAAS,eAAe,OAAgB;GACtC,OAAO,MAAM,SAAS,MAAM,UAAU;IACpC,IAAI,UAAU,GAAG,OAAO,CAAC,IAAI;IAE7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mBAAwE,UAAA,MAAA,WAA9C,cAAa,IAArB,SAAI;IAAtB,OAAA,UAAA,GAAA,YAAwE,wBAAR,IAAI,GAAA,EAAxB,KAAK,KAAK,IAAA,CAAA"}
|
|
@@ -37,7 +37,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
37
37
|
async function resolveSheetCore() {
|
|
38
38
|
if (sheetCore) return sheetCore;
|
|
39
39
|
try {
|
|
40
|
-
|
|
40
|
+
const [core, grid] = await Promise.all([import("@veltra/sheet-core"), import("@veltra/sheet-core/grid")]);
|
|
41
|
+
sheetCore = {
|
|
42
|
+
...core,
|
|
43
|
+
...grid
|
|
44
|
+
};
|
|
41
45
|
return sheetCore;
|
|
42
46
|
} catch {
|
|
43
47
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/sheet-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('sheet')\">\n <div v-if=\"unavailable\" :class=\"cls.e('empty')\">\n <u-empty text=\"无法预览表格:未安装 @veltra/sheet-core\" :size=\"32\" />\n </div>\n <template v-else>\n <div v-if=\"truncated\" :class=\"cls.e('sheet-note')\">\n 共 {{ totalRows.toLocaleString() }} 行,超出预览上限\n {{ maxRows.toLocaleString() }} 行,已全量加载\n </div>\n <div v-if=\"sheets.length > 1\" :class=\"cls.e('sheet-tabs')\">\n <button\n v-for=\"(s, i) in sheets\"\n :key=\"s.name\"\n :class=\"[cls.e('sheet-tab'), bem.is('active', i === activeSheetIndex)]\"\n @click=\"activeSheetIndex = i\"\n >\n {{ s.name }}\n </button>\n </div>\n <div ref=\"container\" :class=\"cls.e('sheet-stage')\" />\n <div v-if=\"loading\" :class=\"cls.e('loading')\">加载中…</div>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { onBeforeUnmount, ref, shallowRef, useTemplateRef, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\nimport { UEmpty } from '../../empty'\nimport { getExtension, toArrayBuffer } from '../helper'\n\ndefineOptions({ name: 'UFileViewerSheetPreviewer' })\n\n/** 仅类型查询;运行时通过动态 import 加载,未安装时不炸主入口 */\ntype SheetCoreModule = typeof import('@veltra/sheet-core')\ntype Sheet = InstanceType<SheetCoreModule['Sheet']>\ntype SheetGrid = InstanceType<SheetCoreModule['SheetGrid']>\n\nconst props = withDefaults(defineProps<{ file: FileViewerItem; maxRows?: number }>(), {\n maxRows: 50_000\n})\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\nconst container = useTemplateRef<HTMLDivElement>('container')\nconst loading = ref(true)\nconst unavailable = ref(false)\nconst truncated = ref(false)\nconst totalRows = ref(0)\nconst sheets = shallowRef<Sheet[]>([])\nconst activeSheetIndex = ref(0)\n\nlet controller: AbortController | undefined\n/** 递增 token:importXlsx 无 AbortSignal,靠它防止切文件后旧解析结果落地 */\nlet loadToken = 0\nlet grid: SheetGrid | undefined\nlet sheetCore: SheetCoreModule | undefined\n\nfunction releaseGrid() {\n grid?.release()\n grid = undefined\n}\n\n/** 动态加载 sheet-core;未安装 optional peer 时返回 undefined */\nasync function resolveSheetCore(): Promise<SheetCoreModule | undefined> {\n if (sheetCore) return sheetCore\n try {\n
|
|
1
|
+
{"version":3,"file":"sheet-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/sheet-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('sheet')\">\n <div v-if=\"unavailable\" :class=\"cls.e('empty')\">\n <u-empty text=\"无法预览表格:未安装 @veltra/sheet-core\" :size=\"32\" />\n </div>\n <template v-else>\n <div v-if=\"truncated\" :class=\"cls.e('sheet-note')\">\n 共 {{ totalRows.toLocaleString() }} 行,超出预览上限\n {{ maxRows.toLocaleString() }} 行,已全量加载\n </div>\n <div v-if=\"sheets.length > 1\" :class=\"cls.e('sheet-tabs')\">\n <button\n v-for=\"(s, i) in sheets\"\n :key=\"s.name\"\n :class=\"[cls.e('sheet-tab'), bem.is('active', i === activeSheetIndex)]\"\n @click=\"activeSheetIndex = i\"\n >\n {{ s.name }}\n </button>\n </div>\n <div ref=\"container\" :class=\"cls.e('sheet-stage')\" />\n <div v-if=\"loading\" :class=\"cls.e('loading')\">加载中…</div>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { onBeforeUnmount, ref, shallowRef, useTemplateRef, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\nimport { UEmpty } from '../../empty'\nimport { getExtension, toArrayBuffer } from '../helper'\n\ndefineOptions({ name: 'UFileViewerSheetPreviewer' })\n\n/** 仅类型查询;运行时通过动态 import 加载,未安装时不炸主入口 */\ntype SheetCoreModule = typeof import('@veltra/sheet-core') &\n typeof import('@veltra/sheet-core/grid')\ntype Sheet = InstanceType<SheetCoreModule['Sheet']>\ntype SheetGrid = InstanceType<SheetCoreModule['SheetGrid']>\n\nconst props = withDefaults(defineProps<{ file: FileViewerItem; maxRows?: number }>(), {\n maxRows: 50_000\n})\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\nconst container = useTemplateRef<HTMLDivElement>('container')\nconst loading = ref(true)\nconst unavailable = ref(false)\nconst truncated = ref(false)\nconst totalRows = ref(0)\nconst sheets = shallowRef<Sheet[]>([])\nconst activeSheetIndex = ref(0)\n\nlet controller: AbortController | undefined\n/** 递增 token:importXlsx 无 AbortSignal,靠它防止切文件后旧解析结果落地 */\nlet loadToken = 0\nlet grid: SheetGrid | undefined\nlet sheetCore: SheetCoreModule | undefined\n\nfunction releaseGrid() {\n grid?.release()\n grid = undefined\n}\n\n/** 动态加载 sheet-core;未安装 optional peer 时返回 undefined */\nasync function resolveSheetCore(): Promise<SheetCoreModule | undefined> {\n if (sheetCore) return sheetCore\n try {\n const [core, grid] = await Promise.all([\n import('@veltra/sheet-core'),\n import('@veltra/sheet-core/grid')\n ])\n sheetCore = { ...core, ...grid }\n return sheetCore\n } catch {\n return undefined\n }\n}\n\n/** 解析文件为 Sheet 列表:xlsx 多表(importXlsx 建工作簿);csv 单表,表名取文件名 */\nasync function parseFile(\n core: SheetCoreModule,\n file: FileViewerItem,\n signal?: AbortSignal\n): Promise<Sheet[]> {\n const buf = await toArrayBuffer(file.src, signal)\n if (getExtension(file.name) === 'csv') {\n const text = new TextDecoder('utf-8', { fatal: false }).decode(buf)\n const sheet = new core.Sheet(file.name)\n core.importCsv(text, sheet)\n return [sheet]\n }\n const workbook = await core.importXlsx(buf)\n return workbook.getSheets()\n}\n\nfunction renderActive() {\n const sheet = sheets.value[activeSheetIndex.value]\n const el = container.value\n releaseGrid()\n if (!sheet || !el || !sheetCore) return\n\n // SheetGrid 的 rows 选项是渲染行数下限(构造时数据高水位恒并入渲染尺寸),\n // 不能用作行数上限;deleteRows 硬裁又会让引用被裁区域的公式显示 #REF!,\n // 故 maxRows 只驱动截断提示,不裁模型\n const total = sheet.rowCount\n totalRows.value = total\n truncated.value = props.maxRows > 0 && total > props.maxRows\n\n grid = new sheetCore.SheetGrid({ container: el, sheet, readonly: true })\n}\n\nasync function load() {\n const token = ++loadToken\n controller?.abort()\n controller = new AbortController()\n loading.value = true\n truncated.value = false\n releaseGrid()\n sheets.value = []\n activeSheetIndex.value = 0\n\n try {\n const core = await resolveSheetCore()\n if (token !== loadToken) return\n if (!core) {\n unavailable.value = true\n emit('error', new Error('未安装 @veltra/sheet-core,无法预览 Excel/CSV'))\n return\n }\n unavailable.value = false\n\n const parsed = await parseFile(core, props.file, controller.signal)\n if (token !== loadToken) return\n sheets.value = parsed\n renderActive()\n } catch (err) {\n if (token !== loadToken) return\n if ((err as { name?: string })?.name === 'AbortError') return\n emit('error', err)\n } finally {\n if (token === loadToken) loading.value = false\n }\n}\n\nwatch(() => props.file, load, { immediate: true })\nwatch(activeSheetIndex, renderActive)\n\nonBeforeUnmount(() => {\n controller?.abort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|
|
4
4
|
"homepage": "https://github.com/cabinet-fe/ultra-ui#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/cabinet-fe/ultra-ui/issues"
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@cat-kit/core": ">=1.1.8",
|
|
82
82
|
"@cat-kit/fe": ">=1.1.8",
|
|
83
|
-
"@veltra/compositions": "^1.6.
|
|
84
|
-
"@veltra/directives": "^1.6.
|
|
83
|
+
"@veltra/compositions": "^1.6.4",
|
|
84
|
+
"@veltra/directives": "^1.6.4",
|
|
85
85
|
"@veltra/icons": "^1.5.0",
|
|
86
|
-
"@veltra/sheet-core": "^2.3.
|
|
87
|
-
"@veltra/styles": "^1.6.
|
|
88
|
-
"@veltra/utils": "^1.6.
|
|
86
|
+
"@veltra/sheet-core": "^2.3.2",
|
|
87
|
+
"@veltra/styles": "^1.6.4",
|
|
88
|
+
"@veltra/utils": "^1.6.4",
|
|
89
89
|
"vue": ">=3.5.41"
|
|
90
90
|
},
|
|
91
91
|
"peerDependenciesMeta": {
|
|
@@ -12,10 +12,7 @@ import { UButton } from '../button'
|
|
|
12
12
|
import { UTip } from '../tip'
|
|
13
13
|
import { ActionDIKey } from './di'
|
|
14
14
|
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'UActionGroup',
|
|
17
|
-
inheritAttrs: false
|
|
18
|
-
})
|
|
15
|
+
defineOptions({ name: 'UActionGroup', inheritAttrs: false })
|
|
19
16
|
|
|
20
17
|
const props = withDefaults(defineProps<ActionGroupProps>(), {
|
|
21
18
|
max: 3,
|
|
@@ -28,9 +25,7 @@ const props = withDefaults(defineProps<ActionGroupProps>(), {
|
|
|
28
25
|
|
|
29
26
|
const cls = bem('action-group')
|
|
30
27
|
|
|
31
|
-
const slots = defineSlots<{
|
|
32
|
-
default?: () => VNode[]
|
|
33
|
-
}>()
|
|
28
|
+
const slots = defineSlots<{ default?: () => VNode[] }>()
|
|
34
29
|
|
|
35
30
|
function isInDropdownNode(node: VNode): boolean {
|
|
36
31
|
const p = node.props as Record<string, unknown> | null
|
|
@@ -49,14 +44,7 @@ function withSeparators(nodes: VNode[]) {
|
|
|
49
44
|
return nodes.flatMap((node, index) => {
|
|
50
45
|
if (index === 0) return [node]
|
|
51
46
|
|
|
52
|
-
return [
|
|
53
|
-
<i
|
|
54
|
-
key={`separator-${index}`}
|
|
55
|
-
class={cls.e('separator')}
|
|
56
|
-
aria-hidden="true"
|
|
57
|
-
/>,
|
|
58
|
-
node
|
|
59
|
-
]
|
|
47
|
+
return [<i key={`separator-${index}`} class={cls.e('separator')} aria-hidden='true' />, node]
|
|
60
48
|
})
|
|
61
49
|
}
|
|
62
50
|
|
|
@@ -90,9 +78,9 @@ function getSlotsNodes() {
|
|
|
90
78
|
|
|
91
79
|
const dropdown = hiddenNodes.length ? (
|
|
92
80
|
<UTip
|
|
93
|
-
direction=
|
|
94
|
-
alignment=
|
|
95
|
-
trigger=
|
|
81
|
+
direction='bottom'
|
|
82
|
+
alignment='end'
|
|
83
|
+
trigger='click'
|
|
96
84
|
class={cls.e('dropdown')}
|
|
97
85
|
visible={tipVisible.value}
|
|
98
86
|
onUpdate:visible={(val: boolean) => {
|
|
@@ -118,12 +106,7 @@ function getSlotsNodes() {
|
|
|
118
106
|
return withSeparators(dropdown ? [...visible, dropdown] : visible)
|
|
119
107
|
}
|
|
120
108
|
|
|
121
|
-
provide(ActionDIKey, {
|
|
122
|
-
groupProps: props,
|
|
123
|
-
closeTip
|
|
124
|
-
})
|
|
109
|
+
provide(ActionDIKey, { groupProps: props, closeTip })
|
|
125
110
|
|
|
126
|
-
defineExpose<_ActionGroupExposed>({
|
|
127
|
-
closeTip
|
|
128
|
-
})
|
|
111
|
+
defineExpose<_ActionGroupExposed>({ closeTip })
|
|
129
112
|
</script>
|
|
@@ -35,7 +35,8 @@ import { getExtension, toArrayBuffer } from '../helper'
|
|
|
35
35
|
defineOptions({ name: 'UFileViewerSheetPreviewer' })
|
|
36
36
|
|
|
37
37
|
/** 仅类型查询;运行时通过动态 import 加载,未安装时不炸主入口 */
|
|
38
|
-
type SheetCoreModule = typeof import('@veltra/sheet-core')
|
|
38
|
+
type SheetCoreModule = typeof import('@veltra/sheet-core') &
|
|
39
|
+
typeof import('@veltra/sheet-core/grid')
|
|
39
40
|
type Sheet = InstanceType<SheetCoreModule['Sheet']>
|
|
40
41
|
type SheetGrid = InstanceType<SheetCoreModule['SheetGrid']>
|
|
41
42
|
|
|
@@ -69,7 +70,11 @@ function releaseGrid() {
|
|
|
69
70
|
async function resolveSheetCore(): Promise<SheetCoreModule | undefined> {
|
|
70
71
|
if (sheetCore) return sheetCore
|
|
71
72
|
try {
|
|
72
|
-
|
|
73
|
+
const [core, grid] = await Promise.all([
|
|
74
|
+
import('@veltra/sheet-core'),
|
|
75
|
+
import('@veltra/sheet-core/grid')
|
|
76
|
+
])
|
|
77
|
+
sheetCore = { ...core, ...grid }
|
|
73
78
|
return sheetCore
|
|
74
79
|
} catch {
|
|
75
80
|
return undefined
|