@veltra/desktop 1.1.7 → 1.1.9

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.
Files changed (32) hide show
  1. package/dist/components/action/action-group.vue.d.ts +1 -1
  2. package/dist/components/action/action.vue.d.ts +1 -1
  3. package/dist/components/cascade/cascade.vue.d.ts +5 -5
  4. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
  5. package/dist/components/file-viewer/previewers/image-previewer.js +2 -2
  6. package/dist/components/file-viewer/previewers/image-previewer.js.map +1 -1
  7. package/dist/components/file-viewer/previewers/pdf-previewer.js +2 -2
  8. package/dist/components/file-viewer/previewers/pdf-previewer.js.map +1 -1
  9. package/dist/components/file-viewer/previewers/video-previewer.js +2 -2
  10. package/dist/components/file-viewer/previewers/video-previewer.js.map +1 -1
  11. package/dist/components/input/input.vue.d.ts +2 -2
  12. package/dist/components/multi-select/multi-select.vue.d.ts +1 -1
  13. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +3 -3
  14. package/dist/components/notification/notification.vue.d.ts +1 -1
  15. package/dist/components/number-input/number-input.vue.d.ts +2 -2
  16. package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
  17. package/dist/components/select/select.vue.d.ts +1 -1
  18. package/dist/components/tabs/tabs-horizontal.vue.d.ts +1 -1
  19. package/dist/components/tabs/tabs.vue.d.ts +1 -1
  20. package/dist/components/textarea/textarea.vue.d.ts +2 -2
  21. package/dist/components/tip/tip.vue.d.ts +1 -1
  22. package/dist/components/tree/tree.vue.d.ts +1 -1
  23. package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
  24. package/package.json +11 -11
  25. package/src/components/button/style.scss +27 -6
  26. package/src/components/cascade/style.scss +5 -1
  27. package/src/components/expression-editor/style.scss +10 -2
  28. package/src/components/file-viewer/previewers/image-previewer.vue +2 -2
  29. package/src/components/file-viewer/previewers/pdf-previewer.vue +2 -2
  30. package/src/components/file-viewer/previewers/video-previewer.vue +2 -2
  31. package/src/components/paginator/style.scss +10 -2
  32. package/src/components/tree/style.scss +5 -1
@@ -10,9 +10,9 @@ type __VLS_Slots = {
10
10
  declare const __VLS_base: _$vue.DefineComponent<ActionGroupProps, _ActionGroupExposed, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<ActionGroupProps> & Readonly<{}>, {
11
11
  type: _$_veltra_utils0.ColorType;
12
12
  size: "small" | "default" | "large";
13
+ text: boolean;
13
14
  circle: boolean;
14
15
  max: number;
15
- text: boolean;
16
16
  loading: boolean;
17
17
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
18
18
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -17,8 +17,8 @@ declare const __VLS_base: _$vue.DefineComponent<ActionProps, {}, {}, {}, {}, _$v
17
17
  }>, {
18
18
  type: ButtonType;
19
19
  size: _$_veltra_utils0.ComponentSize;
20
- circle: boolean;
21
20
  text: boolean;
21
+ circle: boolean;
22
22
  loading: boolean;
23
23
  inDropdown: boolean;
24
24
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
@@ -4,23 +4,23 @@ import * as _$vue from "vue";
4
4
  //#region src/components/cascade/cascade.vue.d.ts
5
5
  declare const __VLS_export: _$vue.DefineComponent<CascadeProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {} & {
6
6
  "update:modelValue": (value?: string | string[] | undefined) => any;
7
- change: (...args: [value?: string | undefined, label?: string | undefined, item?: Record<string, any> | undefined] | [value: string[], label: string[], data: Record<string, any>[]]) => any;
8
7
  clear: () => any;
8
+ change: (...args: [value?: string | undefined, label?: string | undefined, item?: Record<string, any> | undefined] | [value: string[], label: string[], data: Record<string, any>[]]) => any;
9
9
  }, string, _$vue.PublicProps, Readonly<CascadeProps> & Readonly<{
10
10
  "onUpdate:modelValue"?: ((value?: string | string[] | undefined) => any) | undefined;
11
- onChange?: ((...args: [value?: string | undefined, label?: string | undefined, item?: Record<string, any> | undefined] | [value: string[], label: string[], data: Record<string, any>[]]) => any) | undefined;
12
11
  onClear?: (() => any) | undefined;
12
+ onChange?: ((...args: [value?: string | undefined, label?: string | undefined, item?: Record<string, any> | undefined] | [value: string[], label: string[], data: Record<string, any>[]]) => any) | undefined;
13
13
  }>, {
14
14
  disabled: boolean;
15
+ data: Record<string, any>[];
16
+ readonly: boolean;
15
17
  labelKey: string;
16
18
  valueKey: string;
17
19
  childrenKey: string;
18
- data: Record<string, any>[];
19
- readonly: boolean;
20
20
  placeholder: string;
21
21
  clearable: boolean;
22
- separator: string;
23
22
  filterable: boolean;
23
+ separator: string;
24
24
  visibilityLimit: number;
25
25
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
26
26
  declare const _default: typeof __VLS_export;
@@ -15,9 +15,9 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
15
15
  "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
16
16
  }>, {
17
17
  disabled: boolean;
18
+ readonly: boolean;
18
19
  labelKey: string;
19
20
  valueKey: string;
20
- readonly: boolean;
21
21
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { toBlobUrl } from "../helper.js";
1
2
  import { createCommentVNode, createElementBlock, defineComponent, mergeProps, normalizeClass, onBeforeUnmount, openBlock, ref, shallowRef, unref, useAttrs, watch } from "vue";
2
3
  import { bem } from "@veltra/utils";
3
4
  //#region src/components/file-viewer/previewers/image-previewer.vue
@@ -17,11 +18,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
18
  const loading = ref(true);
18
19
  const failed = ref(false);
19
20
  let revoke;
20
- async function load() {
21
+ function load() {
21
22
  loading.value = true;
22
23
  failed.value = false;
23
24
  revoke?.();
24
- const { toBlobUrl } = await import("../helper.js");
25
25
  const r = toBlobUrl(props.file.src, props.file.mime);
26
26
  url.value = r.url;
27
27
  revoke = r.revoke;
@@ -1 +1 @@
1
- {"version":3,"file":"image-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/image-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('image')\" v-bind=\"attrs\">\n <img\n v-if=\"url\"\n :src=\"url\"\n :alt=\"file.name\"\n draggable=\"false\"\n @load=\"loading = false\"\n @error=\"onImgError\"\n />\n <div v-if=\"loading\" :class=\"cls.e('loading')\">加载中…</div>\n <div v-if=\"failed\" :class=\"cls.e('loading')\">图片加载失败</div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { onBeforeUnmount, ref, shallowRef, useAttrs, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\n\ndefineOptions({ name: 'FileViewerImagePreviewer', inheritAttrs: false })\n\nconst props = defineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\nconst attrs = useAttrs()\n\nconst url = shallowRef<string>('')\nconst loading = ref(true)\nconst failed = ref(false)\n\nlet revoke: (() => void) | undefined\n\nasync function load() {\n loading.value = true\n failed.value = false\n revoke?.()\n const { toBlobUrl } = await import('../helper')\n const r = toBlobUrl(props.file.src, props.file.mime)\n url.value = r.url\n revoke = r.revoke\n}\n\nfunction onImgError(e: Event) {\n loading.value = false\n failed.value = true\n emit('error', e)\n}\n\nwatch(\n () => props.file,\n () => load(),\n { immediate: true }\n)\n\nonBeforeUnmount(() => {\n revoke?.()\n url.value = ''\n})\n</script>\n"],"mappings":";;;;;;;;;;;EAuBA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,cAAa;EAC7B,MAAM,QAAQ,UAAS;EAEvB,MAAM,MAAM,WAAmB,GAAE;EACjC,MAAM,UAAU,IAAI,KAAI;EACxB,MAAM,SAAS,IAAI,MAAK;EAExB,IAAI;EAEJ,eAAe,OAAO;AACpB,WAAQ,QAAQ;AAChB,UAAO,QAAQ;AACf,aAAS;GACT,MAAM,EAAE,cAAc,MAAM,OAAO;GACnC,MAAM,IAAI,UAAU,MAAM,KAAK,KAAK,MAAM,KAAK,KAAI;AACnD,OAAI,QAAQ,EAAE;AACd,YAAS,EAAE;;EAGb,SAAS,WAAW,GAAU;AAC5B,WAAQ,QAAQ;AAChB,UAAO,QAAQ;AACf,QAAK,SAAS,EAAC;;AAGjB,cACQ,MAAM,YACN,MAAM,EACZ,EAAE,WAAW,MAAK,CACpB;AAEA,wBAAsB;AACpB,aAAS;AACT,OAAI,QAAQ;IACb;;uBA5DC,mBAWM,OAXN,WAWM,EAXA,OAAO,MAAA,IAAG,CAAC,EAAC,QAAA,EAAA,EAAmB,MAAA,MAAK,CAAA,EAAA;IAEhC,IAAA,SAAA,WAAA,EADR,mBAOE,OAAA;;KALC,KAAK,IAAA;KACL,KAAK,QAAA,KAAK;KACX,WAAU;KACT,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,QAAO;KACb,SAAO;;IAEC,QAAA,SAAA,WAAA,EAAX,mBAAwD,OAAA;;KAAnC,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,UAAA,CAAA;OAAa,QAAI,EAAA,IAAA,mBAAA,QAAA,KAAA;IACvC,OAAA,SAAA,WAAA,EAAX,mBAAyD,OAAA;;KAArC,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,UAAA,CAAA;OAAa,UAAM,EAAA,IAAA,mBAAA,QAAA,KAAA"}
1
+ {"version":3,"file":"image-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/image-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('image')\" v-bind=\"attrs\">\n <img\n v-if=\"url\"\n :src=\"url\"\n :alt=\"file.name\"\n draggable=\"false\"\n @load=\"loading = false\"\n @error=\"onImgError\"\n />\n <div v-if=\"loading\" :class=\"cls.e('loading')\">加载中…</div>\n <div v-if=\"failed\" :class=\"cls.e('loading')\">图片加载失败</div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { onBeforeUnmount, ref, shallowRef, useAttrs, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\nimport { toBlobUrl } from '../helper'\n\ndefineOptions({ name: 'FileViewerImagePreviewer', inheritAttrs: false })\n\nconst props = defineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\nconst attrs = useAttrs()\n\nconst url = shallowRef<string>('')\nconst loading = ref(true)\nconst failed = ref(false)\n\nlet revoke: (() => void) | undefined\n\nfunction load() {\n loading.value = true\n failed.value = false\n revoke?.()\n const r = toBlobUrl(props.file.src, props.file.mime)\n url.value = r.url\n revoke = r.revoke\n}\n\nfunction onImgError(e: Event) {\n loading.value = false\n failed.value = true\n emit('error', e)\n}\n\nwatch(\n () => props.file,\n () => load(),\n { immediate: true }\n)\n\nonBeforeUnmount(() => {\n revoke?.()\n url.value = ''\n})\n</script>\n"],"mappings":";;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,cAAa;EAC7B,MAAM,QAAQ,UAAS;EAEvB,MAAM,MAAM,WAAmB,GAAE;EACjC,MAAM,UAAU,IAAI,KAAI;EACxB,MAAM,SAAS,IAAI,MAAK;EAExB,IAAI;EAEJ,SAAS,OAAO;AACd,WAAQ,QAAQ;AAChB,UAAO,QAAQ;AACf,aAAS;GACT,MAAM,IAAI,UAAU,MAAM,KAAK,KAAK,MAAM,KAAK,KAAI;AACnD,OAAI,QAAQ,EAAE;AACd,YAAS,EAAE;;EAGb,SAAS,WAAW,GAAU;AAC5B,WAAQ,QAAQ;AAChB,UAAO,QAAQ;AACf,QAAK,SAAS,EAAC;;AAGjB,cACQ,MAAM,YACN,MAAM,EACZ,EAAE,WAAW,MAAK,CACpB;AAEA,wBAAsB;AACpB,aAAS;AACT,OAAI,QAAQ;IACb;;uBA5DC,mBAWM,OAXN,WAWM,EAXA,OAAO,MAAA,IAAG,CAAC,EAAC,QAAA,EAAA,EAAmB,MAAA,MAAK,CAAA,EAAA;IAEhC,IAAA,SAAA,WAAA,EADR,mBAOE,OAAA;;KALC,KAAK,IAAA;KACL,KAAK,QAAA,KAAK;KACX,WAAU;KACT,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,QAAO;KACb,SAAO;;IAEC,QAAA,SAAA,WAAA,EAAX,mBAAwD,OAAA;;KAAnC,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,UAAA,CAAA;OAAa,QAAI,EAAA,IAAA,mBAAA,QAAA,KAAA;IACvC,OAAA,SAAA,WAAA,EAAX,mBAAyD,OAAA;;KAArC,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,UAAA,CAAA;OAAa,UAAM,EAAA,IAAA,mBAAA,QAAA,KAAA"}
@@ -1,3 +1,4 @@
1
+ import { toBlobUrl } from "../helper.js";
1
2
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, shallowRef, unref, useAttrs, watch, withCtx } from "vue";
2
3
  import { bem } from "@veltra/utils";
3
4
  import { createPluginRegistration } from "@embedpdf/core";
@@ -22,9 +23,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
23
  const { engine, isLoading, error } = usePdfiumEngine();
23
24
  const pdfUrl = shallowRef("");
24
25
  let revoke;
25
- async function load() {
26
+ function load() {
26
27
  revoke?.();
27
- const { toBlobUrl } = await import("../helper.js");
28
28
  const r = toBlobUrl(props.file.src, props.file.mime ?? "application/pdf");
29
29
  pdfUrl.value = r.url;
30
30
  revoke = r.revoke;
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/pdf-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('pdf')\" v-bind=\"attrs\">\n <div v-if=\"!engine || isLoading\" :class=\"cls.e('loading')\">正在加载 PDF 引擎…</div>\n <EmbedPDF v-else-if=\"pdfUrl\" :engine=\"engine\" :plugins=\"plugins\" v-slot=\"{ activeDocumentId }\">\n <DocumentContent\n v-if=\"activeDocumentId\"\n :document-id=\"activeDocumentId\"\n v-slot=\"{ isLoaded }\"\n >\n <Viewport v-if=\"isLoaded\" :document-id=\"activeDocumentId\" :class=\"cls.e('pdf-viewport')\">\n <Scroller :document-id=\"activeDocumentId\">\n <template #default=\"{ page }\">\n <div\n :class=\"cls.e('pdf-page')\"\n :style=\"{ width: page.width + 'px', height: page.height + 'px' }\"\n >\n <RenderLayer :document-id=\"activeDocumentId\" :page-index=\"page.pageIndex\" />\n </div>\n </template>\n </Scroller>\n </Viewport>\n </DocumentContent>\n </EmbedPDF>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createPluginRegistration } from '@embedpdf/core'\nimport { EmbedPDF } from '@embedpdf/core/vue'\nimport { usePdfiumEngine } from '@embedpdf/engines/vue'\nimport {\n DocumentContent,\n DocumentManagerPluginPackage\n} from '@embedpdf/plugin-document-manager/vue'\nimport { RenderLayer, RenderPluginPackage } from '@embedpdf/plugin-render/vue'\nimport { ScrollPluginPackage, Scroller } from '@embedpdf/plugin-scroll/vue'\nimport { ViewportPluginPackage, Viewport } from '@embedpdf/plugin-viewport/vue'\nimport { bem } from '@veltra/utils'\nimport { computed, onBeforeUnmount, shallowRef, useAttrs, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\n\ndefineOptions({ name: 'FileViewerPdfPreviewer', inheritAttrs: false })\n\nconst props = defineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\nconst attrs = useAttrs()\n\nconst { engine, isLoading, error } = usePdfiumEngine()\n\nconst pdfUrl = shallowRef<string>('')\nlet revoke: (() => void) | undefined\n\nasync function load() {\n revoke?.()\n const { toBlobUrl } = await import('../helper')\n const r = toBlobUrl(props.file.src, props.file.mime ?? 'application/pdf')\n pdfUrl.value = r.url\n revoke = r.revoke\n}\n\nconst plugins = computed(() => {\n if (!pdfUrl.value) return []\n return [\n createPluginRegistration(DocumentManagerPluginPackage, {\n initialDocuments: [{ url: pdfUrl.value }]\n }),\n createPluginRegistration(ViewportPluginPackage),\n createPluginRegistration(ScrollPluginPackage),\n createPluginRegistration(RenderPluginPackage)\n ]\n})\n\nwatch(\n () => props.file,\n () => load(),\n { immediate: true }\n)\n\nwatch(error, (err) => {\n if (err) emit('error', err)\n})\n\nonBeforeUnmount(() => {\n revoke?.()\n pdfUrl.value = ''\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;EA4CA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,cAAa;EAC7B,MAAM,QAAQ,UAAS;EAEvB,MAAM,EAAE,QAAQ,WAAW,UAAU,iBAAgB;EAErD,MAAM,SAAS,WAAmB,GAAE;EACpC,IAAI;EAEJ,eAAe,OAAO;AACpB,aAAS;GACT,MAAM,EAAE,cAAc,MAAM,OAAO;GACnC,MAAM,IAAI,UAAU,MAAM,KAAK,KAAK,MAAM,KAAK,QAAQ,kBAAiB;AACxE,UAAO,QAAQ,EAAE;AACjB,YAAS,EAAE;;EAGb,MAAM,UAAU,eAAe;AAC7B,OAAI,CAAC,OAAO,MAAO,QAAO,EAAC;AAC3B,UAAO;IACL,yBAAyB,8BAA8B,EACrD,kBAAkB,CAAC,EAAE,KAAK,OAAO,OAAO,CAAA,EACzC,CAAC;IACF,yBAAyB,sBAAsB;IAC/C,yBAAyB,oBAAoB;IAC7C,yBAAyB,oBAAmB;IAC9C;IACD;AAED,cACQ,MAAM,YACN,MAAM,EACZ,EAAE,WAAW,MAAK,CACpB;AAEA,QAAM,QAAQ,QAAQ;AACpB,OAAI,IAAK,MAAK,SAAS,IAAG;IAC3B;AAED,wBAAsB;AACpB,aAAS;AACT,UAAO,QAAQ;IAChB;;uBAxFC,mBAsBM,OAtBN,WAsBM,EAtBA,OAAO,MAAA,IAAG,CAAC,EAAC,MAAA,EAAA,EAAiB,MAAA,MAAK,CAAA,EAAA,CAAA,CAC1B,MAAA,OAAM,IAAI,MAAA,UAAS,IAAA,WAAA,EAA/B,mBAA6E,OAAA;;IAA3C,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,UAAA,CAAA;MAAa,gBAAY,EAAA,IAClD,OAAA,SAAA,WAAA,EAArB,YAmBW,MAAA,SAAA,EAAA;;IAnBmB,QAAQ,MAAA,OAAM;IAAG,SAAS,QAAA;;sBAkBpC,EAlBuD,uBAAgB,CAEjF,oBAAA,WAAA,EADR,YAiBkB,MAAA,gBAAA,EAAA;;KAff,eAAa;;uBAcH,EAbD,eAAQ,CAEF,YAAA,WAAA,EAAhB,YAWW,MAAA,SAAA,EAAA;;MAXgB,eAAa;MAAmB,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,eAAA,CAAA;;6BAU1D,CATX,YASW,MAAA,SAAA,EAAA,EATA,eAAa,kBAAgB,EAAA;OAC3B,SAAO,SAMV,EANc,WAAI,CACxB,mBAKM,OAAA;QAJH,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,WAAA,CAAA;QACZ,OAAK,eAAA;SAAA,OAAW,KAAK,QAAK;SAAA,QAAiB,KAAK,SAAM;SAAA,CAAA;WAEvD,YAA4E,MAAA,YAAA,EAAA;QAA9D,eAAa;QAAmB,cAAY,KAAK"}
1
+ {"version":3,"file":"pdf-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/pdf-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('pdf')\" v-bind=\"attrs\">\n <div v-if=\"!engine || isLoading\" :class=\"cls.e('loading')\">正在加载 PDF 引擎…</div>\n <EmbedPDF v-else-if=\"pdfUrl\" :engine=\"engine\" :plugins=\"plugins\" v-slot=\"{ activeDocumentId }\">\n <DocumentContent\n v-if=\"activeDocumentId\"\n :document-id=\"activeDocumentId\"\n v-slot=\"{ isLoaded }\"\n >\n <Viewport v-if=\"isLoaded\" :document-id=\"activeDocumentId\" :class=\"cls.e('pdf-viewport')\">\n <Scroller :document-id=\"activeDocumentId\">\n <template #default=\"{ page }\">\n <div\n :class=\"cls.e('pdf-page')\"\n :style=\"{ width: page.width + 'px', height: page.height + 'px' }\"\n >\n <RenderLayer :document-id=\"activeDocumentId\" :page-index=\"page.pageIndex\" />\n </div>\n </template>\n </Scroller>\n </Viewport>\n </DocumentContent>\n </EmbedPDF>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createPluginRegistration } from '@embedpdf/core'\nimport { EmbedPDF } from '@embedpdf/core/vue'\nimport { usePdfiumEngine } from '@embedpdf/engines/vue'\nimport {\n DocumentContent,\n DocumentManagerPluginPackage\n} from '@embedpdf/plugin-document-manager/vue'\nimport { RenderLayer, RenderPluginPackage } from '@embedpdf/plugin-render/vue'\nimport { ScrollPluginPackage, Scroller } from '@embedpdf/plugin-scroll/vue'\nimport { ViewportPluginPackage, Viewport } from '@embedpdf/plugin-viewport/vue'\nimport { bem } from '@veltra/utils'\nimport { computed, onBeforeUnmount, shallowRef, useAttrs, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\nimport { toBlobUrl } from '../helper'\n\ndefineOptions({ name: 'FileViewerPdfPreviewer', inheritAttrs: false })\n\nconst props = defineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\nconst attrs = useAttrs()\n\nconst { engine, isLoading, error } = usePdfiumEngine()\n\nconst pdfUrl = shallowRef<string>('')\nlet revoke: (() => void) | undefined\n\nfunction load() {\n revoke?.()\n const r = toBlobUrl(props.file.src, props.file.mime ?? 'application/pdf')\n pdfUrl.value = r.url\n revoke = r.revoke\n}\n\nconst plugins = computed(() => {\n if (!pdfUrl.value) return []\n return [\n createPluginRegistration(DocumentManagerPluginPackage, {\n initialDocuments: [{ url: pdfUrl.value }]\n }),\n createPluginRegistration(ViewportPluginPackage),\n createPluginRegistration(ScrollPluginPackage),\n createPluginRegistration(RenderPluginPackage)\n ]\n})\n\nwatch(\n () => props.file,\n () => load(),\n { immediate: true }\n)\n\nwatch(error, (err) => {\n if (err) emit('error', err)\n})\n\nonBeforeUnmount(() => {\n revoke?.()\n pdfUrl.value = ''\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,cAAa;EAC7B,MAAM,QAAQ,UAAS;EAEvB,MAAM,EAAE,QAAQ,WAAW,UAAU,iBAAgB;EAErD,MAAM,SAAS,WAAmB,GAAE;EACpC,IAAI;EAEJ,SAAS,OAAO;AACd,aAAS;GACT,MAAM,IAAI,UAAU,MAAM,KAAK,KAAK,MAAM,KAAK,QAAQ,kBAAiB;AACxE,UAAO,QAAQ,EAAE;AACjB,YAAS,EAAE;;EAGb,MAAM,UAAU,eAAe;AAC7B,OAAI,CAAC,OAAO,MAAO,QAAO,EAAC;AAC3B,UAAO;IACL,yBAAyB,8BAA8B,EACrD,kBAAkB,CAAC,EAAE,KAAK,OAAO,OAAO,CAAA,EACzC,CAAC;IACF,yBAAyB,sBAAsB;IAC/C,yBAAyB,oBAAoB;IAC7C,yBAAyB,oBAAmB;IAC9C;IACD;AAED,cACQ,MAAM,YACN,MAAM,EACZ,EAAE,WAAW,MAAK,CACpB;AAEA,QAAM,QAAQ,QAAQ;AACpB,OAAI,IAAK,MAAK,SAAS,IAAG;IAC3B;AAED,wBAAsB;AACpB,aAAS;AACT,UAAO,QAAQ;IAChB;;uBAxFC,mBAsBM,OAtBN,WAsBM,EAtBA,OAAO,MAAA,IAAG,CAAC,EAAC,MAAA,EAAA,EAAiB,MAAA,MAAK,CAAA,EAAA,CAAA,CAC1B,MAAA,OAAM,IAAI,MAAA,UAAS,IAAA,WAAA,EAA/B,mBAA6E,OAAA;;IAA3C,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,UAAA,CAAA;MAAa,gBAAY,EAAA,IAClD,OAAA,SAAA,WAAA,EAArB,YAmBW,MAAA,SAAA,EAAA;;IAnBmB,QAAQ,MAAA,OAAM;IAAG,SAAS,QAAA;;sBAkBpC,EAlBuD,uBAAgB,CAEjF,oBAAA,WAAA,EADR,YAiBkB,MAAA,gBAAA,EAAA;;KAff,eAAa;;uBAcH,EAbD,eAAQ,CAEF,YAAA,WAAA,EAAhB,YAWW,MAAA,SAAA,EAAA;;MAXgB,eAAa;MAAmB,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,eAAA,CAAA;;6BAU1D,CATX,YASW,MAAA,SAAA,EAAA,EATA,eAAa,kBAAgB,EAAA;OAC3B,SAAO,SAMV,EANc,WAAI,CACxB,mBAKM,OAAA;QAJH,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,WAAA,CAAA;QACZ,OAAK,eAAA;SAAA,OAAW,KAAK,QAAK;SAAA,QAAiB,KAAK,SAAM;SAAA,CAAA;WAEvD,YAA4E,MAAA,YAAA,EAAA;QAA9D,eAAa;QAAmB,cAAY,KAAK"}
@@ -1,3 +1,4 @@
1
+ import { toBlobUrl } from "../helper.js";
1
2
  import { createCommentVNode, createElementBlock, defineComponent, normalizeClass, onBeforeUnmount, openBlock, shallowRef, unref, useTemplateRef, watch } from "vue";
2
3
  import { bem } from "@veltra/utils";
3
4
  //#region src/components/file-viewer/previewers/video-previewer.vue
@@ -15,9 +16,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
16
  const videoRef = useTemplateRef("videoRef");
16
17
  let revoke;
17
18
  let unmounting = false;
18
- async function load() {
19
+ function load() {
19
20
  revoke?.();
20
- const { toBlobUrl } = await import("../helper.js");
21
21
  const r = toBlobUrl(props.file.src, props.file.mime);
22
22
  url.value = r.url;
23
23
  revoke = r.revoke;
@@ -1 +1 @@
1
- {"version":3,"file":"video-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/video-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('video')\">\n <video\n v-if=\"url\"\n ref=\"videoRef\"\n :src=\"url\"\n :type=\"file.mime\"\n controls\n preload=\"metadata\"\n playsinline\n @error=\"onVideoError\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { onBeforeUnmount, shallowRef, useTemplateRef, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\n\ndefineOptions({ name: 'FileViewerVideoPreviewer' })\n\nconst props = defineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\n\nconst url = shallowRef<string>('')\nconst videoRef = useTemplateRef<HTMLVideoElement>('videoRef')\n\nlet revoke: (() => void) | undefined\nlet unmounting = false\n\nasync function load() {\n revoke?.()\n const { toBlobUrl } = await import('../helper')\n const r = toBlobUrl(props.file.src, props.file.mime)\n url.value = r.url\n revoke = r.revoke\n}\n\nfunction onVideoError(e: Event) {\n if (unmounting) return\n const v = e.target as HTMLVideoElement | null\n if (!v?.src) return\n emit('error', e)\n}\n\nwatch(\n () => props.file,\n () => load(),\n { immediate: true }\n)\n\nonBeforeUnmount(() => {\n unmounting = true\n const v = videoRef.value\n if (v) {\n v.pause()\n v.removeAttribute('src')\n try {\n v.load()\n } catch {\n /* noop */\n }\n }\n revoke?.()\n url.value = ''\n})\n</script>\n"],"mappings":";;;;;;;;;;EAuBA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,cAAa;EAE7B,MAAM,MAAM,WAAmB,GAAE;EACjC,MAAM,WAAW,eAAiC,WAAU;EAE5D,IAAI;EACJ,IAAI,aAAa;EAEjB,eAAe,OAAO;AACpB,aAAS;GACT,MAAM,EAAE,cAAc,MAAM,OAAO;GACnC,MAAM,IAAI,UAAU,MAAM,KAAK,KAAK,MAAM,KAAK,KAAI;AACnD,OAAI,QAAQ,EAAE;AACd,YAAS,EAAE;;EAGb,SAAS,aAAa,GAAU;AAC9B,OAAI,WAAY;AAEhB,OAAI,CADM,EAAE,QACJ,IAAK;AACb,QAAK,SAAS,EAAC;;AAGjB,cACQ,MAAM,YACN,MAAM,EACZ,EAAE,WAAW,MAAK,CACpB;AAEA,wBAAsB;AACpB,gBAAa;GACb,MAAM,IAAI,SAAS;AACnB,OAAI,GAAG;AACL,MAAE,OAAM;AACR,MAAE,gBAAgB,MAAK;AACvB,QAAI;AACF,OAAE,MAAK;YACD;;AAIV,aAAS;AACT,OAAI,QAAQ;IACb;;uBArEC,mBAWM,OAAA,EAXA,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,QAAA,CAAA,EAAA,EAAA,CAER,IAAA,SAAA,WAAA,EADR,mBASE,SAAA;;aAPI;IAAJ,KAAI;IACH,KAAK,IAAA;IACL,MAAM,QAAA,KAAK;IACZ,UAAA;IACA,SAAQ;IACR,aAAA;IACC,SAAO"}
1
+ {"version":3,"file":"video-previewer.js","names":[],"sources":["../../../../src/components/file-viewer/previewers/video-previewer.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('video')\">\n <video\n v-if=\"url\"\n ref=\"videoRef\"\n :src=\"url\"\n :type=\"file.mime\"\n controls\n preload=\"metadata\"\n playsinline\n @error=\"onVideoError\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { onBeforeUnmount, shallowRef, useTemplateRef, watch } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\nimport { toBlobUrl } from '../helper'\n\ndefineOptions({ name: 'FileViewerVideoPreviewer' })\n\nconst props = defineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{ (e: 'error', err: unknown): void }>()\n\nconst cls = bem('file-viewer')\n\nconst url = shallowRef<string>('')\nconst videoRef = useTemplateRef<HTMLVideoElement>('videoRef')\n\nlet revoke: (() => void) | undefined\nlet unmounting = false\n\nfunction load() {\n revoke?.()\n const r = toBlobUrl(props.file.src, props.file.mime)\n url.value = r.url\n revoke = r.revoke\n}\n\nfunction onVideoError(e: Event) {\n if (unmounting) return\n const v = e.target as HTMLVideoElement | null\n if (!v?.src) return\n emit('error', e)\n}\n\nwatch(\n () => props.file,\n () => load(),\n { immediate: true }\n)\n\nonBeforeUnmount(() => {\n unmounting = true\n const v = videoRef.value\n if (v) {\n v.pause()\n v.removeAttribute('src')\n try {\n v.load()\n } catch {\n /* noop */\n }\n }\n revoke?.()\n url.value = ''\n})\n</script>\n"],"mappings":";;;;;;;;;;;EAwBA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,cAAa;EAE7B,MAAM,MAAM,WAAmB,GAAE;EACjC,MAAM,WAAW,eAAiC,WAAU;EAE5D,IAAI;EACJ,IAAI,aAAa;EAEjB,SAAS,OAAO;AACd,aAAS;GACT,MAAM,IAAI,UAAU,MAAM,KAAK,KAAK,MAAM,KAAK,KAAI;AACnD,OAAI,QAAQ,EAAE;AACd,YAAS,EAAE;;EAGb,SAAS,aAAa,GAAU;AAC9B,OAAI,WAAY;AAEhB,OAAI,CADM,EAAE,QACJ,IAAK;AACb,QAAK,SAAS,EAAC;;AAGjB,cACQ,MAAM,YACN,MAAM,EACZ,EAAE,WAAW,MAAK,CACpB;AAEA,wBAAsB;AACpB,gBAAa;GACb,MAAM,IAAI,SAAS;AACnB,OAAI,GAAG;AACL,MAAE,OAAM;AACR,MAAE,gBAAgB,MAAK;AACvB,QAAI;AACF,OAAE,MAAK;YACD;;AAIV,aAAS;AACT,OAAI,QAAQ;IACb;;uBArEC,mBAWM,OAAA,EAXA,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,QAAA,CAAA,EAAA,EAAA,CAER,IAAA,SAAA,WAAA,EADR,mBASE,SAAA;;aAPI;IAAJ,KAAI;IACH,KAAK,IAAA;IACL,MAAM,QAAA,KAAK;IACZ,UAAA;IACA,SAAQ;IACR,aAAA;IACC,SAAO"}
@@ -17,20 +17,20 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, _InputExposed
17
17
  "update:modelValue": (value: string | undefined) => any;
18
18
  } & {
19
19
  "update:modelValue": (value: string) => any;
20
+ clear: () => any;
20
21
  change: (value: string) => any;
21
22
  "suffix:click": (value?: string | undefined) => any;
22
23
  "prefix:click": (value?: string | undefined) => any;
23
24
  focus: (value?: string | undefined) => any;
24
- clear: () => any;
25
25
  blur: (value?: string | undefined) => any;
26
26
  "native:input": (ev: Event) => any;
27
27
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
28
28
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
29
+ onClear?: (() => any) | undefined;
29
30
  onChange?: ((value: string) => any) | undefined;
30
31
  "onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
31
32
  "onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
32
33
  onFocus?: ((value?: string | undefined) => any) | undefined;
33
- onClear?: (() => any) | undefined;
34
34
  onBlur?: ((value?: string | undefined) => any) | undefined;
35
35
  "onNative:input"?: ((ev: Event) => any) | undefined;
36
36
  }>, {
@@ -30,9 +30,9 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
30
30
  }>, {
31
31
  minWidth: string;
32
32
  disabled: boolean;
33
+ readonly: boolean;
33
34
  labelKey: string;
34
35
  valueKey: string;
35
- readonly: boolean;
36
36
  placeholder: string;
37
37
  clearable: boolean;
38
38
  visibilityLimit: number;
@@ -15,19 +15,19 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
15
15
  "update:modelValue": (value: (string | number)[]) => any;
16
16
  } & {
17
17
  "update:modelValue": (value: any[]) => any;
18
- change: (checked: Record<string, any>[]) => any;
19
18
  clear: () => any;
19
+ change: (checked: Record<string, any>[]) => any;
20
20
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
21
  "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
22
- onChange?: ((checked: Record<string, any>[]) => any) | undefined;
23
22
  onClear?: (() => any) | undefined;
23
+ onChange?: ((checked: Record<string, any>[]) => any) | undefined;
24
24
  }>, {
25
25
  minWidth: string;
26
26
  disabled: boolean;
27
+ readonly: boolean;
27
28
  expandAll: boolean;
28
29
  labelKey: string;
29
30
  valueKey: string;
30
- readonly: boolean;
31
31
  placeholder: string;
32
32
  clearable: boolean;
33
33
  filterable: boolean;
@@ -4,9 +4,9 @@ import * as _$_veltra_utils0 from "@veltra/utils";
4
4
 
5
5
  //#region src/components/notification/notification.vue.d.ts
6
6
  declare const __VLS_export: _$vue.DefineComponent<NotificationProps, _$_veltra_utils0.DeconstructValue<_NotificationExposed>, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<NotificationProps> & Readonly<{}>, {
7
- duration: number;
8
7
  closable: boolean;
9
8
  position: "top-left" | "top-right" | "bottom-left" | "bottom-right";
9
+ duration: number;
10
10
  offset: number;
11
11
  buttonText: string;
12
12
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
@@ -15,12 +15,12 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
15
15
  "update:modelValue": (value: number | undefined) => any;
16
16
  } & {
17
17
  "update:modelValue": (value?: number | undefined) => any;
18
- change: (value?: number | undefined) => any;
19
18
  clear: () => any;
19
+ change: (value?: number | undefined) => any;
20
20
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
21
  "onUpdate:modelValue"?: ((value?: number | undefined) => any) | undefined;
22
- onChange?: ((value?: number | undefined) => any) | undefined;
23
22
  onClear?: (() => any) | undefined;
23
+ onChange?: ((value?: number | undefined) => any) | undefined;
24
24
  }>, {
25
25
  disabled: boolean;
26
26
  readonly: boolean;
@@ -17,9 +17,9 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
17
17
  onChange?: ((item: Record<string, any>) => any) | undefined;
18
18
  }>, {
19
19
  disabled: boolean;
20
+ readonly: boolean;
20
21
  labelKey: string;
21
22
  valueKey: string;
22
- readonly: boolean;
23
23
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  //#endregion
@@ -27,9 +27,9 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
27
27
  "onUpdate:label"?: ((label?: string | undefined) => any) | undefined;
28
28
  }>, {
29
29
  disabled: boolean;
30
+ readonly: boolean;
30
31
  labelKey: string;
31
32
  valueKey: string;
32
- readonly: boolean;
33
33
  placeholder: string;
34
34
  clearable: boolean;
35
35
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
@@ -23,10 +23,10 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
23
23
  onClick?: ((item: TabItem, index: number) => any) | undefined;
24
24
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
25
25
  }>, {
26
- block: boolean;
27
26
  closable: boolean;
28
27
  rounded: boolean;
29
28
  position: "top" | "bottom";
29
+ block: boolean;
30
30
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
31
31
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
32
  declare const _default: typeof __VLS_export;
@@ -18,10 +18,10 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
18
18
  onClick?: ((item: TabItem, index: number) => any) | undefined;
19
19
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
20
20
  }>, {
21
- block: boolean;
22
21
  closable: boolean;
23
22
  rounded: boolean;
24
23
  position: "left" | "right" | "top" | "bottom";
24
+ block: boolean;
25
25
  keepAlive: boolean;
26
26
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
@@ -11,15 +11,15 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
11
11
  "update:modelValue": (value: string | undefined) => any;
12
12
  } & {
13
13
  "update:modelValue": (value: string) => any;
14
+ clear: () => any;
14
15
  change: (value: string) => any;
15
16
  focus: () => any;
16
- clear: () => any;
17
17
  blur: () => any;
18
18
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
19
19
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
20
+ onClear?: (() => any) | undefined;
20
21
  onChange?: ((value: string) => any) | undefined;
21
22
  onFocus?: (() => any) | undefined;
22
- onClear?: (() => any) | undefined;
23
23
  onBlur?: (() => any) | undefined;
24
24
  }>, {
25
25
  disabled: boolean;
@@ -14,8 +14,8 @@ declare const __VLS_base: _$vue.DefineComponent<TipProps, {}, {}, {}, {}, _$vue.
14
14
  trigger: "hover" | "click";
15
15
  contentTag: string;
16
16
  visible: boolean;
17
- content: string;
18
17
  direction: TipDirection;
18
+ content: string;
19
19
  alignment: TipAlign;
20
20
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
21
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -21,11 +21,11 @@ declare const __VLS_base: _$vue.DefineComponent<TreeProps, _TreeExposed, {}, {},
21
21
  "onNode-contextmenu"?: ((event: MouseEvent, node: TreeNode<Record<string, any>>) => any) | undefined;
22
22
  "onSelected-synced"?: ((selected?: Record<string, any> | undefined) => any) | undefined;
23
23
  }>, {
24
+ data: Record<string, any>[];
24
25
  expandOnClickNode: boolean;
25
26
  labelKey: string;
26
27
  valueKey: string;
27
28
  childrenKey: string;
28
- data: Record<string, any>[];
29
29
  checkStrictly: boolean;
30
30
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
31
31
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -15,21 +15,21 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
15
15
  declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
16
16
  "update:modelValue": (value: string | number | undefined) => any;
17
17
  } & {
18
- change: (value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any;
19
18
  clear: () => any;
19
+ change: (value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any;
20
20
  "update:text": (text?: string | undefined) => any;
21
21
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
22
  "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
23
- onChange?: ((value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any) | undefined;
24
23
  onClear?: (() => any) | undefined;
24
+ onChange?: ((value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any) | undefined;
25
25
  "onUpdate:text"?: ((text?: string | undefined) => any) | undefined;
26
26
  }>, {
27
27
  minWidth: string;
28
28
  disabled: boolean;
29
+ readonly: boolean;
29
30
  expandAll: boolean;
30
31
  labelKey: string;
31
32
  valueKey: string;
32
- readonly: boolean;
33
33
  placeholder: string;
34
34
  clearable: boolean;
35
35
  filterable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -61,22 +61,22 @@
61
61
  "@lexical/rich-text": "^0.43.0",
62
62
  "@lexical/selection": "^0.43.0",
63
63
  "@lexical/utils": "^0.43.0",
64
- "@veltra/compositions": "1.1.7",
65
- "@veltra/directives": "1.1.7",
66
- "@veltra/icons": "1.1.7",
67
- "@veltra/styles": "1.1.7",
68
- "@veltra/utils": "1.1.7",
64
+ "@veltra/compositions": "1.1.9",
65
+ "@veltra/directives": "1.1.9",
66
+ "@veltra/icons": "1.1.9",
67
+ "@veltra/styles": "1.1.9",
68
+ "@veltra/utils": "1.1.9",
69
69
  "@visactor/vtable": "^1.26.0",
70
70
  "codemirror": "^6.0.2",
71
71
  "docx-preview": "^0.3.7",
72
72
  "lexical": "^0.43.0"
73
73
  },
74
74
  "peerDependencies": {
75
- "@veltra/compositions": "1.1.7",
76
- "@veltra/directives": "1.1.7",
77
- "@veltra/icons": "1.1.7",
78
- "@veltra/styles": "1.1.7",
79
- "@veltra/utils": "1.1.7",
75
+ "@veltra/compositions": "1.1.9",
76
+ "@veltra/directives": "1.1.9",
77
+ "@veltra/icons": "1.1.9",
78
+ "@veltra/styles": "1.1.9",
79
+ "@veltra/utils": "1.1.9",
80
80
  "vue": "^3.5.33"
81
81
  }
82
82
  }
@@ -31,7 +31,11 @@ $root-name: button;
31
31
  @include m.flex($display: inline-flex, $justify: center);
32
32
 
33
33
  &:hover {
34
- background-color: fn.component-var(button, default-hover-bg, fn.use-var(color, default, 'dark-1'));
34
+ background-color: fn.component-var(
35
+ button,
36
+ default-hover-bg,
37
+ fn.use-var(color, default, 'dark-1')
38
+ );
35
39
  border-color: fn.component-var(button, default-hover-border, transparent);
36
40
  }
37
41
 
@@ -89,8 +93,16 @@ $root-name: button;
89
93
  color: fn.component-var(button, #{$type}-text-color, fn.use-var(text-color, white));
90
94
 
91
95
  &:hover {
92
- background-color: fn.component-var(button, #{$type}-hover-bg, fn.use-var(color, $type, dark-1));
93
- color: fn.component-var(button, #{$type}-hover-color, fn.component-var(button, #{$type}-text-color, fn.use-var(text-color, white)));
96
+ background-color: fn.component-var(
97
+ button,
98
+ #{$type}-hover-bg,
99
+ fn.use-var(color, $type, dark-1)
100
+ );
101
+ color: fn.component-var(
102
+ button,
103
+ #{$type}-hover-color,
104
+ fn.component-var(button, #{$type}-text-color, fn.use-var(text-color, white))
105
+ );
94
106
  }
95
107
 
96
108
  // 禁用
@@ -112,7 +124,11 @@ $root-name: button;
112
124
  @include m.is-not(disabled, loading) {
113
125
  &:hover,
114
126
  &:focus {
115
- background-color: fn.component-var(button, #{$type}-plain-bg, fn.use-var(color, $type, 'light-9'));
127
+ background-color: fn.component-var(
128
+ button,
129
+ #{$type}-plain-bg,
130
+ fn.use-var(color, $type, 'light-9')
131
+ );
116
132
  }
117
133
  }
118
134
 
@@ -123,8 +139,13 @@ $root-name: button;
123
139
 
124
140
  @include m.is(plain) {
125
141
  color: fn.component-var(button, #{$type}-plain-color, fn.use-var(color, $type));
126
- background-color: fn.component-var(button, #{$type}-plain-bg, fn.use-var(color, $type, light-9));
127
- box-shadow: 0px 0px 2px 1px fn.component-var(button, #{$type}-plain-shadow, fn.use-var(color, $type, light-5));
142
+ background-color: fn.component-var(
143
+ button,
144
+ #{$type}-plain-bg,
145
+ fn.use-var(color, $type, light-9)
146
+ );
147
+ box-shadow: 0px 0px 2px 1px
148
+ fn.component-var(button, #{$type}-plain-shadow, fn.use-var(color, $type, light-5));
128
149
 
129
150
  &:active {
130
151
  box-shadow: none;
@@ -116,7 +116,11 @@ $menu-name: $root-name + '-panel-item';
116
116
  }
117
117
 
118
118
  @include m.is(active) {
119
- background-color: fn.component-var(cascade, node-active-bg, fn.use-var(color, primary, light-9));
119
+ background-color: fn.component-var(
120
+ cascade,
121
+ node-active-bg,
122
+ fn.use-var(color, primary, light-9)
123
+ );
120
124
  color: fn.component-var(cascade, node-active-color, fn.use-var(color, primary));
121
125
  border-radius: fn.use-var(radius, default);
122
126
  }
@@ -85,7 +85,11 @@ $root-name: expression-editor;
85
85
  line-height: 1;
86
86
  font-size: 12px;
87
87
  color: fn.component-var(expression-editor, chip-color, fn.use-var(color, primary));
88
- background-color: fn.component-var(expression-editor, chip-bg, fn.use-var(color, primary, light-9));
88
+ background-color: fn.component-var(
89
+ expression-editor,
90
+ chip-bg,
91
+ fn.use-var(color, primary, light-9)
92
+ );
89
93
  border-radius: 999px;
90
94
  cursor: pointer;
91
95
  user-select: none;
@@ -95,7 +99,11 @@ $root-name: expression-editor;
95
99
 
96
100
  &:hover {
97
101
  color: fn.component-var(expression-editor, chip-color, fn.use-var(color, primary));
98
- background-color: fn.component-var(expression-editor, chip-bg, fn.use-var(color, primary, light-8));
102
+ background-color: fn.component-var(
103
+ expression-editor,
104
+ chip-bg,
105
+ fn.use-var(color, primary, light-8)
106
+ );
99
107
  box-shadow: 0 1px 4px fn.use-var(shadow, color);
100
108
 
101
109
  .#{vars.$namespace}#{$root-name}__chip-close {
@@ -18,6 +18,7 @@ import { bem } from '@veltra/utils'
18
18
  import { onBeforeUnmount, ref, shallowRef, useAttrs, watch } from 'vue'
19
19
 
20
20
  import type { FileViewerItem } from '../../../types/file-viewer'
21
+ import { toBlobUrl } from '../helper'
21
22
 
22
23
  defineOptions({ name: 'FileViewerImagePreviewer', inheritAttrs: false })
23
24
 
@@ -34,11 +35,10 @@ const failed = ref(false)
34
35
 
35
36
  let revoke: (() => void) | undefined
36
37
 
37
- async function load() {
38
+ function load() {
38
39
  loading.value = true
39
40
  failed.value = false
40
41
  revoke?.()
41
- const { toBlobUrl } = await import('../helper')
42
42
  const r = toBlobUrl(props.file.src, props.file.mime)
43
43
  url.value = r.url
44
44
  revoke = r.revoke
@@ -39,6 +39,7 @@ import { bem } from '@veltra/utils'
39
39
  import { computed, onBeforeUnmount, shallowRef, useAttrs, watch } from 'vue'
40
40
 
41
41
  import type { FileViewerItem } from '../../../types/file-viewer'
42
+ import { toBlobUrl } from '../helper'
42
43
 
43
44
  defineOptions({ name: 'FileViewerPdfPreviewer', inheritAttrs: false })
44
45
 
@@ -54,9 +55,8 @@ const { engine, isLoading, error } = usePdfiumEngine()
54
55
  const pdfUrl = shallowRef<string>('')
55
56
  let revoke: (() => void) | undefined
56
57
 
57
- async function load() {
58
+ function load() {
58
59
  revoke?.()
59
- const { toBlobUrl } = await import('../helper')
60
60
  const r = toBlobUrl(props.file.src, props.file.mime ?? 'application/pdf')
61
61
  pdfUrl.value = r.url
62
62
  revoke = r.revoke
@@ -18,6 +18,7 @@ import { bem } from '@veltra/utils'
18
18
  import { onBeforeUnmount, shallowRef, useTemplateRef, watch } from 'vue'
19
19
 
20
20
  import type { FileViewerItem } from '../../../types/file-viewer'
21
+ import { toBlobUrl } from '../helper'
21
22
 
22
23
  defineOptions({ name: 'FileViewerVideoPreviewer' })
23
24
 
@@ -33,9 +34,8 @@ const videoRef = useTemplateRef<HTMLVideoElement>('videoRef')
33
34
  let revoke: (() => void) | undefined
34
35
  let unmounting = false
35
36
 
36
- async function load() {
37
+ function load() {
37
38
  revoke?.()
38
- const { toBlobUrl } = await import('../helper')
39
39
  const r = toBlobUrl(props.file.src, props.file.mime)
40
40
  url.value = r.url
41
41
  revoke = r.revoke
@@ -39,12 +39,20 @@ $root-name: paginator;
39
39
  @include m.flex($justify: center);
40
40
 
41
41
  &:hover {
42
- background-color: fn.component-var(paginator, btn-hover-bg, fn.use-var(color, primary, 'light-9'));
42
+ background-color: fn.component-var(
43
+ paginator,
44
+ btn-hover-bg,
45
+ fn.use-var(color, primary, 'light-9')
46
+ );
43
47
  color: fn.component-var(paginator, btn-hover-color, fn.use-var(text, color, title));
44
48
  }
45
49
 
46
50
  @include m.is(active) {
47
- background-color: fn.component-var(paginator, btn-active-bg, fn.use-var(color, primary, 'light-9'));
51
+ background-color: fn.component-var(
52
+ paginator,
53
+ btn-active-bg,
54
+ fn.use-var(color, primary, 'light-9')
55
+ );
48
56
  color: fn.component-var(paginator, btn-active-color, fn.use-var(color, primary));
49
57
  }
50
58
 
@@ -74,7 +74,11 @@ $indent-width: 20px;
74
74
 
75
75
  @include m.is(selected) {
76
76
  @include m.bem($root-name, node-content) {
77
- background-color: fn.component-var(tree, node-selected-bg, fn.use-var(color, primary, light-9));
77
+ background-color: fn.component-var(
78
+ tree,
79
+ node-selected-bg,
80
+ fn.use-var(color, primary, light-9)
81
+ );
78
82
  color: fn.component-var(tree, node-selected-color, fn.use-var(color, primary));
79
83
  font-weight: 500;
80
84