oxy-uni-ui 1.2.0 → 2.0.0
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/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +396 -321
- package/components/common/path.ts +9 -0
- package/components/common/util.ts +200 -5
- package/components/composables/index.ts +1 -0
- package/components/composables/useGlobalLoading.ts +42 -0
- package/components/composables/useGlobalMessage.ts +48 -0
- package/components/composables/useGlobalToast.ts +84 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +13 -11
- package/components/composables/useWindowResize.ts +35 -0
- package/components/oxy-action-sheet/index.scss +24 -11
- package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
- package/components/oxy-action-sheet/types.ts +7 -0
- package/components/oxy-backtop/index.scss +3 -3
- package/components/oxy-backtop/oxy-backtop.vue +9 -6
- package/components/oxy-backtop/types.ts +7 -7
- package/components/oxy-badge/index.scss +4 -4
- package/components/oxy-badge/oxy-badge.vue +3 -3
- package/components/oxy-badge/types.ts +2 -2
- package/components/oxy-button/index.scss +5 -5
- package/components/oxy-button/oxy-button.vue +5 -1
- package/components/oxy-calendar/index.scss +11 -11
- package/components/oxy-calendar/oxy-calendar.vue +1 -0
- package/components/oxy-calendar/types.ts +5 -0
- package/components/oxy-calendar-view/month/index.scss +4 -4
- package/components/oxy-calendar-view/month/types.ts +36 -0
- package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
- package/components/oxy-card/index.scss +2 -2
- package/components/oxy-cell/index.scss +8 -8
- package/components/oxy-cell/oxy-cell.vue +15 -2
- package/components/oxy-cell/types.ts +4 -0
- package/components/oxy-checkbox/index.scss +8 -8
- package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
- package/components/oxy-checkbox-group/index.scss +2 -2
- package/components/oxy-circle/oxy-circle.vue +10 -7
- package/components/oxy-circle/types.ts +5 -5
- package/components/oxy-col/oxy-col.vue +2 -2
- package/components/oxy-col-picker/index.scss +4 -4
- package/components/oxy-col-picker/oxy-col-picker.vue +9 -5
- package/components/oxy-col-picker/types.ts +12 -3
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
- package/components/oxy-corner/index.scss +32 -32
- package/components/oxy-corner/oxy-corner.vue +15 -3
- package/components/oxy-corner/types.ts +15 -1
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-curtain/index.scss +15 -15
- package/components/oxy-curtain/oxy-curtain.vue +4 -2
- package/components/oxy-curtain/types.ts +6 -1
- package/components/oxy-date-strip/index.scss +10 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
- package/components/oxy-date-strip/types.ts +98 -0
- package/components/oxy-date-strip/utils.ts +67 -0
- package/components/oxy-date-strip-item/index.scss +94 -0
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
- package/components/oxy-date-strip-item/types.ts +53 -0
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
- package/components/oxy-datetime-picker/types.ts +10 -1
- package/components/oxy-drop-menu/index.scss +3 -3
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +1 -1
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
- package/components/oxy-drop-menu-item/types.ts +5 -0
- package/components/oxy-echarts/index.scss +17 -0
- package/components/oxy-echarts/index.ts +1 -0
- package/components/oxy-echarts/oxy-echarts.vue +32 -0
- package/components/oxy-echarts/types.ts +18 -0
- package/components/oxy-fab/index.scss +8 -8
- package/components/oxy-fab/oxy-fab.vue +22 -3
- package/components/oxy-file-list/index.scss +42 -15
- package/components/oxy-file-list/oxy-file-list.vue +208 -34
- package/components/oxy-file-list/types.ts +58 -2
- package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
- package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
- package/components/oxy-footer/index.scss +19 -0
- package/components/oxy-footer/oxy-footer.vue +78 -0
- package/components/oxy-footer/types.ts +17 -0
- package/components/oxy-form-item/types.ts +22 -1
- package/components/oxy-gap/oxy-gap.vue +2 -2
- package/components/oxy-gap/types.ts +2 -2
- package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
- package/components/oxy-global-message/oxy-global-message.vue +64 -0
- package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid/types.ts +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
- package/components/oxy-grid-item/types.ts +1 -1
- package/components/oxy-guidance/index.scss +75 -0
- package/components/oxy-guidance/oxy-guidance.vue +201 -0
- package/components/oxy-guidance/types.ts +33 -0
- package/components/oxy-icon/oxy-icon.vue +2 -2
- package/components/oxy-icon/types.ts +1 -1
- package/components/oxy-img/oxy-img.vue +4 -4
- package/components/oxy-img/types.ts +3 -3
- package/components/oxy-img-cropper/index.scss +12 -12
- package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
- package/components/oxy-img-cropper/types.ts +2 -2
- package/components/oxy-img-lazy/index.scss +17 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
- package/components/oxy-img-lazy/types.ts +69 -0
- package/components/oxy-index-anchor/index.scss +2 -2
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
- package/components/oxy-index-bar/index.scss +3 -3
- package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
- package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
- package/components/oxy-input/index.scss +1 -1
- package/components/oxy-input-number/index.scss +5 -5
- package/components/oxy-input-number/oxy-input-number.vue +2 -2
- package/components/oxy-input-number/types.ts +3 -2
- package/components/oxy-keyboard/index.scss +5 -5
- package/components/oxy-keyboard/key/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -2
- package/components/oxy-keyboard/key/types.ts +15 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
- package/components/oxy-keyboard/types.ts +5 -0
- package/components/oxy-link/index.scss +57 -0
- package/components/oxy-link/oxy-link.vue +130 -0
- package/components/oxy-link/types.ts +81 -0
- package/components/oxy-list/index.scss +7 -1
- package/components/oxy-list/oxy-list.vue +4 -3
- package/components/oxy-list/types.ts +1 -1
- package/components/oxy-loading/oxy-loading.vue +8 -4
- package/components/oxy-loading/types.ts +1 -1
- package/components/oxy-loadmore/index.scss +3 -3
- package/components/oxy-long-press-menu/index.scss +93 -0
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
- package/components/oxy-long-press-menu/types.ts +34 -0
- package/components/oxy-message-box/index.scss +12 -11
- package/components/oxy-message-box/oxy-message-box.vue +11 -3
- package/components/oxy-message-box/types.ts +14 -0
- package/components/oxy-navbar/index.scss +2 -2
- package/components/oxy-navbar/oxy-navbar.vue +58 -13
- package/components/oxy-navbar/types.ts +8 -1
- package/components/oxy-navbar-capsule/types.ts +3 -0
- package/components/oxy-notice-bar/index.scss +3 -3
- package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
- package/components/oxy-notice-bar/types.ts +3 -3
- package/components/oxy-notify/index.ts +1 -0
- package/components/oxy-notify/oxy-notify.vue +3 -2
- package/components/oxy-notify/types.ts +7 -0
- package/components/oxy-pagination/index.scss +1 -1
- package/components/oxy-password-input/oxy-password-input.vue +2 -2
- package/components/oxy-password-input/types.ts +1 -1
- package/components/oxy-picker/index.scss +45 -2
- package/components/oxy-picker/oxy-picker.vue +103 -14
- package/components/oxy-picker/types.ts +33 -1
- package/components/oxy-picker-view/index.scss +3 -3
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +9 -9
- package/components/oxy-popup/index.scss +2 -2
- package/components/oxy-popup/oxy-popup.vue +35 -2
- package/components/oxy-popup/types.ts +8 -1
- package/components/oxy-progress/index.scss +3 -3
- package/components/oxy-qrcode/draw.ts +398 -0
- package/components/oxy-qrcode/index.scss +2 -0
- package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
- package/components/oxy-qrcode/qrcode.ts +936 -0
- package/components/oxy-qrcode/types.ts +42 -0
- package/components/oxy-radio/index.scss +13 -13
- package/components/oxy-radio/oxy-radio.vue +1 -1
- package/components/oxy-radio-group/index.scss +2 -2
- package/components/oxy-rate/types.ts +4 -4
- package/components/oxy-resize/index.scss +2 -2
- package/components/oxy-resize/oxy-resize.vue +4 -4
- package/components/oxy-resize/types.ts +3 -0
- package/components/oxy-rich-text/icon/emjio.svg +1 -0
- package/components/oxy-rich-text/icon/quote.svg +1 -0
- package/components/oxy-rich-text/icon/text.svg +1 -0
- package/components/oxy-rich-text/icon/title.svg +1 -0
- package/components/oxy-rich-text/index.scss +160 -0
- package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
- package/components/oxy-rich-text/mp-html/card/index.js +7 -0
- package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
- package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
- package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
- package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
- package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
- package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
- package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
- package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
- package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
- package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
- package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
- package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
- package/components/oxy-rich-text/mp-html/parser.js +1428 -0
- package/components/oxy-rich-text/mp-html/search/index.js +132 -0
- package/components/oxy-rich-text/mp-html/style/index.js +129 -0
- package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
- package/components/oxy-rich-text/mp-html/template/index.js +67 -0
- package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
- package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
- package/components/oxy-rich-text/types.ts +76 -0
- package/components/oxy-row/oxy-row.vue +3 -3
- package/components/oxy-row/types.ts +1 -1
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-segmented/index.scss +16 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +331 -0
- package/components/oxy-select/oxy-select.vue +456 -0
- package/components/oxy-select/types.ts +83 -0
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
- package/components/oxy-select-picker/types.ts +7 -1
- package/components/oxy-sidebar-item/index.scss +1 -1
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +3 -3
- package/components/oxy-sort-button/index.scss +8 -8
- package/components/oxy-status-tip/index.scss +4 -4
- package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
- package/components/oxy-status-tip/types.ts +3 -3
- package/components/oxy-step/index.scss +14 -14
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/index.scss +6 -0
- package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
- package/components/oxy-stream-render/types.ts +8 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
- package/components/oxy-swiper/oxy-swiper.vue +6 -6
- package/components/oxy-swiper/types.ts +5 -5
- package/components/oxy-switch/index.scss +8 -8
- package/components/oxy-switch/oxy-switch.vue +2 -2
- package/components/oxy-switch/types.ts +1 -1
- package/components/oxy-tab/index.scss +11 -1
- package/components/oxy-tabbar/index.scss +1 -1
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +5 -5
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- package/components/oxy-table-col/oxy-table-col.vue +3 -3
- package/components/oxy-table-col/types.ts +2 -2
- package/components/oxy-tabs/index.scss +43 -15
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +15 -15
- package/components/oxy-text/index.scss +5 -1
- package/components/oxy-text/oxy-text.vue +76 -7
- package/components/oxy-text/types.ts +12 -0
- package/components/oxy-textarea/index.scss +6 -6
- package/components/oxy-toast/oxy-toast.vue +24 -8
- package/components/oxy-tooltip/index.scss +9 -9
- package/components/oxy-tree/index.scss +61 -9
- package/components/oxy-tree/oxy-tree.vue +102 -17
- package/components/oxy-tree/types.ts +23 -10
- package/components/oxy-upload/index.scss +21 -21
- package/components/oxy-upload/types.ts +2 -2
- package/components/oxy-verification-code/index.scss +6 -0
- package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
- package/components/oxy-verification-code/types.ts +82 -0
- package/components/oxy-video-preview/index.scss +4 -4
- package/components/oxy-virtual-scroll/index.scss +4 -4
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
- package/components/oxy-virtual-scroll/types.ts +14 -14
- package/components/oxy-voice-player/index.scss +908 -0
- package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
- package/components/oxy-voice-player/types.ts +567 -0
- package/components/oxy-waterfall/index.scss +18 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
- package/components/oxy-waterfall/types.ts +90 -0
- package/components/oxy-waterfall-item/index.scss +8 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
- package/components/oxy-waterfall-item/types.ts +16 -0
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +9 -0
- package/index.ts +3 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +29 -0
- package/locale/lang/zh-CN.ts +29 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- package/uni-echarts/changelog.md +2 -0
- package/uni-echarts/components/index.js +1 -0
- package/uni-echarts/components/uni-echarts/events.js +95 -0
- package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
- package/uni-echarts/components/uni-echarts/types.js +1 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
- package/uni-echarts/global.d.ts +7 -0
- package/uni-echarts/index.d.ts +440 -0
- package/uni-echarts/index.js +2 -0
- package/uni-echarts/package.json +105 -0
- package/uni-echarts/shared-core.d.ts +269 -0
- package/uni-echarts/shared-core.js +900 -0
- package/web-types.json +1 -1
- package/components/oxy-number-keyboard/index.scss +0 -78
- package/components/oxy-number-keyboard/key/index.scss +0 -81
- package/components/oxy-number-keyboard/key/index.vue +0 -78
- package/components/oxy-number-keyboard/key/types.ts +0 -11
- package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
- package/components/oxy-number-keyboard/types.ts +0 -83
- package/components/oxy-tree/components/tree-node-content.vue +0 -72
- package/components/oxy-tree/index.ts +0 -51
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { ECElementEvent, ElementEvent } from "echarts/core";
|
|
2
|
+
import type { StyleValue } from "vue";
|
|
3
|
+
import type {
|
|
4
|
+
AutoResize,
|
|
5
|
+
ChartOption,
|
|
6
|
+
ChartTheme,
|
|
7
|
+
EChartsType,
|
|
8
|
+
InitOptions,
|
|
9
|
+
LoadingOptions,
|
|
10
|
+
NullableValue,
|
|
11
|
+
PublicApi,
|
|
12
|
+
UpdateOptions
|
|
13
|
+
} from "../../shared-core";
|
|
14
|
+
|
|
15
|
+
export interface UniEchartsProps {
|
|
16
|
+
/**
|
|
17
|
+
* Custom root el class.
|
|
18
|
+
*/
|
|
19
|
+
customClass?: any;
|
|
20
|
+
/**
|
|
21
|
+
* Custom root el style.
|
|
22
|
+
*/
|
|
23
|
+
customStyle?: StyleValue;
|
|
24
|
+
/**
|
|
25
|
+
* Same as the option of echarts.
|
|
26
|
+
*/
|
|
27
|
+
option?: ChartOption;
|
|
28
|
+
/**
|
|
29
|
+
* Option inject key.
|
|
30
|
+
*/
|
|
31
|
+
optionKey?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Theme to be applied.
|
|
34
|
+
*/
|
|
35
|
+
theme?: ChartTheme;
|
|
36
|
+
/**
|
|
37
|
+
* Optional chart init configurations.
|
|
38
|
+
*/
|
|
39
|
+
initOptions?: InitOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Options for updating chart option.
|
|
42
|
+
*/
|
|
43
|
+
updateOptions?: UpdateOptions;
|
|
44
|
+
/**
|
|
45
|
+
* Group name to be used in chart connection.
|
|
46
|
+
*/
|
|
47
|
+
group?: string;
|
|
48
|
+
/**
|
|
49
|
+
* For performance critical scenarios (having a large dataset) we'd better bypass Vue's reactivity system for `option` prop.
|
|
50
|
+
*/
|
|
51
|
+
manualUpdate?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the chart should be resized automatically whenever its root is resized.
|
|
54
|
+
*/
|
|
55
|
+
autoresize?: AutoResize;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the chart is in loading state.
|
|
58
|
+
*/
|
|
59
|
+
loading?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Configuration item of loading animation.
|
|
62
|
+
*/
|
|
63
|
+
loadingOptions?: LoadingOptions;
|
|
64
|
+
/**
|
|
65
|
+
* Canvas type.
|
|
66
|
+
*/
|
|
67
|
+
canvasType?: "2d" | "legacy";
|
|
68
|
+
/**
|
|
69
|
+
* Prevent screen scroll when touching the canvas.
|
|
70
|
+
*/
|
|
71
|
+
disableScroll?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Support mouse hover behavior in PC.
|
|
74
|
+
*/
|
|
75
|
+
supportHover?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Init delay time(ms).
|
|
78
|
+
*/
|
|
79
|
+
initDelay?: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type MouseEventName =
|
|
83
|
+
| "click"
|
|
84
|
+
| "dblclick"
|
|
85
|
+
| "mouseout"
|
|
86
|
+
| "mouseover"
|
|
87
|
+
| "mouseup"
|
|
88
|
+
| "mousedown"
|
|
89
|
+
| "mousemove"
|
|
90
|
+
| "contextmenu"
|
|
91
|
+
| "globalout";
|
|
92
|
+
|
|
93
|
+
type ElementEventName =
|
|
94
|
+
| MouseEventName
|
|
95
|
+
| "mousewheel"
|
|
96
|
+
| "drag"
|
|
97
|
+
| "dragstart"
|
|
98
|
+
| "dragend"
|
|
99
|
+
| "dragenter"
|
|
100
|
+
| "dragleave"
|
|
101
|
+
| "dragover"
|
|
102
|
+
| "drop";
|
|
103
|
+
|
|
104
|
+
type ZRenderEventName = `zr:${ElementEventName}`;
|
|
105
|
+
|
|
106
|
+
type OtherEventName =
|
|
107
|
+
| "highlight"
|
|
108
|
+
| "downplay"
|
|
109
|
+
| "selectchanged"
|
|
110
|
+
| "legendselectchanged"
|
|
111
|
+
| "legendselected"
|
|
112
|
+
| "legendunselected"
|
|
113
|
+
| "legendselectall"
|
|
114
|
+
| "legendinverseselect"
|
|
115
|
+
| "legendscroll"
|
|
116
|
+
| "datazoom"
|
|
117
|
+
| "datarangeselected"
|
|
118
|
+
| "graphroam"
|
|
119
|
+
| "georoam"
|
|
120
|
+
| "treeroam"
|
|
121
|
+
| "timelinechanged"
|
|
122
|
+
| "timelineplaychanged"
|
|
123
|
+
| "restore"
|
|
124
|
+
| "dataviewchanged"
|
|
125
|
+
| "magictypechanged"
|
|
126
|
+
| "geoselectchanged"
|
|
127
|
+
| "geoselected"
|
|
128
|
+
| "geounselected"
|
|
129
|
+
| "axisareaselected"
|
|
130
|
+
| "brush"
|
|
131
|
+
| "brushEnd"
|
|
132
|
+
| "brushselected"
|
|
133
|
+
| "globalcursortaken"
|
|
134
|
+
| "showtip"
|
|
135
|
+
| "hidetip";
|
|
136
|
+
|
|
137
|
+
type UniEventName =
|
|
138
|
+
| "touchstart"
|
|
139
|
+
| "touchmove"
|
|
140
|
+
| "touchcancel"
|
|
141
|
+
| "touchend"
|
|
142
|
+
| "tap"
|
|
143
|
+
| "longpress"
|
|
144
|
+
| "longtap"
|
|
145
|
+
| "transitionend"
|
|
146
|
+
| "animationstart"
|
|
147
|
+
| "animationiteration"
|
|
148
|
+
| "animationend"
|
|
149
|
+
| "touchforcechange";
|
|
150
|
+
|
|
151
|
+
type NativeEventName = `native:${ElementEventName}` | `native:${UniEventName}`;
|
|
152
|
+
|
|
153
|
+
type MouseEmits = {
|
|
154
|
+
[key in MouseEventName]: (params: ECElementEvent) => void;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type ZRenderEmits = {
|
|
158
|
+
[key in ZRenderEventName]: (params: ElementEvent) => void;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
type OtherEmits = {
|
|
162
|
+
[key in OtherEventName]: (params: any) => void;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
type NativeEmits = {
|
|
166
|
+
[key in NativeEventName]: (params: any) => void;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export type UniEchartsEmits = MouseEmits & ZRenderEmits & OtherEmits & NativeEmits & {
|
|
170
|
+
rendered: (params: { elapsedTime: number }) => void;
|
|
171
|
+
finished: () => void;
|
|
172
|
+
inited: () => void;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export interface UniEchartsInst extends PublicApi, Pick<
|
|
176
|
+
EChartsType,
|
|
177
|
+
"setOption" | "resize"
|
|
178
|
+
> {
|
|
179
|
+
root: NullableValue<HTMLElement>;
|
|
180
|
+
canvasId: string;
|
|
181
|
+
chart: NullableValue<EChartsType>;
|
|
182
|
+
toTempFilePath: (options?: Omit<UniApp.CanvasToTempFilePathOptions, "canvasId" | "canvas">) => Promise<UniApp.CanvasToTempFilePathRes>;
|
|
183
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
ref="root"
|
|
4
|
+
class="uni-echarts"
|
|
5
|
+
:class="props.customClass"
|
|
6
|
+
:style="props.customStyle"
|
|
7
|
+
@click="emit('native:click', $event)"
|
|
8
|
+
@dblclick="emit('native:dblclick', $event)"
|
|
9
|
+
@mouseout="emit('native:mouseout', $event)"
|
|
10
|
+
@mouseover="emit('native:mouseover', $event)"
|
|
11
|
+
@mouseup="emit('native:mouseup', $event)"
|
|
12
|
+
@mousedown="emit('native:mousedown', $event)"
|
|
13
|
+
@mousemove="emit('native:mousemove', $event)"
|
|
14
|
+
@contextmenu="emit('native:contextmenu', $event)"
|
|
15
|
+
@mousewheel="emit('native:mousewheel', $event)"
|
|
16
|
+
@drag="emit('native:drag', $event)"
|
|
17
|
+
@dragstart="emit('native:dragstart', $event)"
|
|
18
|
+
@dragend="emit('native:dragend', $event)"
|
|
19
|
+
@dragenter="emit('native:dragenter', $event)"
|
|
20
|
+
@dragleave="emit('native:dragleave', $event)"
|
|
21
|
+
@dragover="emit('native:dragover', $event)"
|
|
22
|
+
@drop="emit('native:drop', $event)"
|
|
23
|
+
@touchstart="emit('native:touchstart', $event)"
|
|
24
|
+
@touchmove="emit('native:touchmove', $event)"
|
|
25
|
+
@touchcancel="emit('native:touchcancel', $event)"
|
|
26
|
+
@touchend="emit('native:touchend', $event)"
|
|
27
|
+
@tap="emit('native:tap', $event)"
|
|
28
|
+
@longpress="emit('native:longpress', $event)"
|
|
29
|
+
@longtap="emit('native:longtap', $event)"
|
|
30
|
+
@transitionend="emit('native:transitionend', $event)"
|
|
31
|
+
@animationstart="emit('native:animationstart', $event)"
|
|
32
|
+
@animationiteration="emit('native:animationiteration', $event)"
|
|
33
|
+
@animationend="emit('native:animationend', $event)"
|
|
34
|
+
@touchforcechange="emit('native:touchforcechange', $event)"
|
|
35
|
+
>
|
|
36
|
+
<canvas
|
|
37
|
+
v-if="useCanvas2D"
|
|
38
|
+
:id="canvasId"
|
|
39
|
+
class="uni-echarts__canvas"
|
|
40
|
+
type="2d"
|
|
41
|
+
:disable-scroll="props.disableScroll"
|
|
42
|
+
@touchstart="touch.onStart"
|
|
43
|
+
@touchmove="touch.onMove"
|
|
44
|
+
@touchend="touch.onEnd"
|
|
45
|
+
></canvas>
|
|
46
|
+
|
|
47
|
+
<canvas
|
|
48
|
+
v-else
|
|
49
|
+
:id="canvasId"
|
|
50
|
+
class="uni-echarts__canvas"
|
|
51
|
+
:canvas-id="canvasId"
|
|
52
|
+
:disable-scroll="props.disableScroll"
|
|
53
|
+
@touchstart="touch.onStart"
|
|
54
|
+
@touchmove="touch.onMove"
|
|
55
|
+
@touchend="touch.onEnd"
|
|
56
|
+
></canvas>
|
|
57
|
+
|
|
58
|
+
<view
|
|
59
|
+
v-if="isPc || isMpAlipay"
|
|
60
|
+
class="uni-echarts__mask"
|
|
61
|
+
@mousedown="touch.onStart"
|
|
62
|
+
@mousemove="touch.onMove"
|
|
63
|
+
@mouseup="touch.onEnd"
|
|
64
|
+
@touchstart="touch.onStart"
|
|
65
|
+
@touchmove="touch.onMove"
|
|
66
|
+
@touchend="touch.onEnd"
|
|
67
|
+
></view>
|
|
68
|
+
|
|
69
|
+
<slot></slot>
|
|
70
|
+
</view>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup>
|
|
74
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, shallowRef, watch, watchEffect } from 'vue'
|
|
75
|
+
import {
|
|
76
|
+
canIUseCanvas2d,
|
|
77
|
+
defaultTo,
|
|
78
|
+
getIsPc,
|
|
79
|
+
getWindowInfo,
|
|
80
|
+
isEmpty,
|
|
81
|
+
isMpAlipay,
|
|
82
|
+
querySelect,
|
|
83
|
+
setupEchartsCanvas,
|
|
84
|
+
sleep,
|
|
85
|
+
UniCanvas,
|
|
86
|
+
useAutoresize,
|
|
87
|
+
useEcharts,
|
|
88
|
+
useEchartsInitOptions,
|
|
89
|
+
useEchartsMouseWheel,
|
|
90
|
+
useEchartsOption,
|
|
91
|
+
useEchartsTheme,
|
|
92
|
+
useEchartsTouch,
|
|
93
|
+
useEchartsUpdateOptions,
|
|
94
|
+
useLoading,
|
|
95
|
+
usePublicApi,
|
|
96
|
+
useUid,
|
|
97
|
+
useVueThis
|
|
98
|
+
} from '../../shared-core'
|
|
99
|
+
import { ECHARTS_EVENTS, EVENTS } from './events'
|
|
100
|
+
|
|
101
|
+
defineOptions({
|
|
102
|
+
name: 'UniEcharts',
|
|
103
|
+
options: {
|
|
104
|
+
// #ifdef MP-WEIXIN || MP-ALIPAY
|
|
105
|
+
virtualHost: true
|
|
106
|
+
// #endif
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const props = defineProps({
|
|
111
|
+
customClass: [String, Object, Array],
|
|
112
|
+
customStyle: [String, Object],
|
|
113
|
+
option: Object,
|
|
114
|
+
optionKey: String,
|
|
115
|
+
theme: [Object, String],
|
|
116
|
+
initOptions: Object,
|
|
117
|
+
updateOptions: Object,
|
|
118
|
+
group: String,
|
|
119
|
+
manualUpdate: Boolean,
|
|
120
|
+
autoresize: [Boolean, Object],
|
|
121
|
+
loading: Boolean,
|
|
122
|
+
loadingOptions: Object,
|
|
123
|
+
canvasType: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: '2d'
|
|
126
|
+
},
|
|
127
|
+
disableScroll: Boolean,
|
|
128
|
+
supportHover: Boolean,
|
|
129
|
+
initDelay: {
|
|
130
|
+
type: Number,
|
|
131
|
+
default: 30
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const emit = defineEmits(EVENTS)
|
|
136
|
+
|
|
137
|
+
const vueThis = useVueThis()
|
|
138
|
+
|
|
139
|
+
const echarts = useEcharts()
|
|
140
|
+
|
|
141
|
+
const isPc = getIsPc()
|
|
142
|
+
|
|
143
|
+
const root = shallowRef(null)
|
|
144
|
+
|
|
145
|
+
const canvasId = `uni-chart${useUid()}`
|
|
146
|
+
|
|
147
|
+
const chart = shallowRef(null)
|
|
148
|
+
|
|
149
|
+
const manualOption = shallowRef(null)
|
|
150
|
+
|
|
151
|
+
const { innerOption, injectOption } = useEchartsOption(props.optionKey, () => defaultTo(manualOption.value, props.option))
|
|
152
|
+
const { innerTheme } = useEchartsTheme(() => props.theme)
|
|
153
|
+
const { innerInitOptions } = useEchartsInitOptions(() => props.initOptions)
|
|
154
|
+
const { innerUpdateOptions } = useEchartsUpdateOptions(() => props.updateOptions)
|
|
155
|
+
|
|
156
|
+
const useCanvas2D = computed(() => {
|
|
157
|
+
if (!canIUseCanvas2d()) {
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return props.canvasType === '2d'
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
const canvasRect = reactive({
|
|
165
|
+
top: 0,
|
|
166
|
+
left: 0,
|
|
167
|
+
width: 0,
|
|
168
|
+
height: 0
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
function getFirstTouch(touches) {
|
|
172
|
+
if (isEmpty(touches)) {
|
|
173
|
+
return null
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return touches[0]
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function getRelativeTouch(event, touches) {
|
|
180
|
+
let clientX = 0
|
|
181
|
+
let clientY = 0
|
|
182
|
+
|
|
183
|
+
const touch = getFirstTouch(touches)
|
|
184
|
+
|
|
185
|
+
if (touch != null) {
|
|
186
|
+
clientX = touch.clientX
|
|
187
|
+
clientY = touch.clientY
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
x: Math.max(0, clientX - canvasRect.left),
|
|
192
|
+
y: Math.max(0, clientY - canvasRect.top),
|
|
193
|
+
wheelDelta: defaultTo(event.wheelDelta, 0)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function getTouch(event, touches) {
|
|
198
|
+
const touch = defaultTo(getFirstTouch(touches), {})
|
|
199
|
+
|
|
200
|
+
return touch.x != null ? touch : getRelativeTouch(event, touches)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const touch = useEchartsTouch({
|
|
204
|
+
vueThis,
|
|
205
|
+
supportHover: () => props.supportHover,
|
|
206
|
+
isPc,
|
|
207
|
+
canvasId,
|
|
208
|
+
chart,
|
|
209
|
+
canvasRect,
|
|
210
|
+
getTouch
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
// #ifdef WEB
|
|
214
|
+
|
|
215
|
+
useEchartsMouseWheel({
|
|
216
|
+
isPc,
|
|
217
|
+
chart,
|
|
218
|
+
getTouch
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
// #endif
|
|
222
|
+
|
|
223
|
+
async function getContext() {
|
|
224
|
+
const { top, left, width, height, node } = await querySelect(vueThis, `#${canvasId}`, {
|
|
225
|
+
rect: true,
|
|
226
|
+
size: true,
|
|
227
|
+
node: useCanvas2D.value
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
const devicePixelRatio = getWindowInfo().pixelRatio
|
|
231
|
+
|
|
232
|
+
let dpr = devicePixelRatio
|
|
233
|
+
|
|
234
|
+
let canvas
|
|
235
|
+
|
|
236
|
+
if (node != null) {
|
|
237
|
+
canvas = new UniCanvas(canvasId, node.getContext('2d'), node)
|
|
238
|
+
} else {
|
|
239
|
+
// #ifdef WEB
|
|
240
|
+
dpr = 1
|
|
241
|
+
// #endif
|
|
242
|
+
// #ifdef MP-ALIPAY || MP-LARK
|
|
243
|
+
dpr = devicePixelRatio
|
|
244
|
+
// #endif
|
|
245
|
+
// #ifdef MP-TOUTIAO
|
|
246
|
+
dpr = isPc ? 1 : devicePixelRatio
|
|
247
|
+
// #endif
|
|
248
|
+
// #ifndef WEB || MP-ALIPAY || MP-LARK || MP-TOUTIAO
|
|
249
|
+
dpr = isPc ? devicePixelRatio : 1
|
|
250
|
+
// #endif
|
|
251
|
+
|
|
252
|
+
canvas = new UniCanvas(canvasId, uni.createCanvasContext(canvasId, vueThis), null)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return {
|
|
256
|
+
top,
|
|
257
|
+
left,
|
|
258
|
+
width,
|
|
259
|
+
height,
|
|
260
|
+
node,
|
|
261
|
+
canvas,
|
|
262
|
+
dpr
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
async function init(option) {
|
|
267
|
+
if (props.initDelay > 0) {
|
|
268
|
+
await sleep(props.initDelay)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const context = await getContext()
|
|
272
|
+
|
|
273
|
+
canvasRect.top = context.top
|
|
274
|
+
canvasRect.left = context.left
|
|
275
|
+
canvasRect.width = context.width
|
|
276
|
+
canvasRect.height = context.height
|
|
277
|
+
|
|
278
|
+
setupEchartsCanvas(echarts, {
|
|
279
|
+
canvas: context.canvas,
|
|
280
|
+
node: context.node
|
|
281
|
+
})
|
|
282
|
+
chart.value = echarts.init(context.canvas, innerTheme.value, {
|
|
283
|
+
devicePixelRatio: context.dpr,
|
|
284
|
+
renderer: 'canvas',
|
|
285
|
+
width: context.width,
|
|
286
|
+
height: context.height,
|
|
287
|
+
...innerInitOptions.value
|
|
288
|
+
})
|
|
289
|
+
const instance = chart.value
|
|
290
|
+
|
|
291
|
+
if (props.group) {
|
|
292
|
+
instance.group = props.group
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const zr = instance.getZr()
|
|
296
|
+
|
|
297
|
+
for (const evt of ECHARTS_EVENTS) {
|
|
298
|
+
if (evt.indexOf('zr:') === 0) {
|
|
299
|
+
zr.on(evt.substring(3), (...args) => {
|
|
300
|
+
emit(evt, ...args)
|
|
301
|
+
})
|
|
302
|
+
} else {
|
|
303
|
+
instance.on(evt, (...args) => {
|
|
304
|
+
emit(evt, ...args)
|
|
305
|
+
})
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// #ifdef WEB
|
|
310
|
+
const _resize = () => {
|
|
311
|
+
if (instance == null || instance.isDisposed()) {
|
|
312
|
+
return
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const { offsetWidth, offsetHeight } = root.value.$el
|
|
316
|
+
|
|
317
|
+
instance.resize({
|
|
318
|
+
width: offsetWidth,
|
|
319
|
+
height: offsetHeight
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
// #endif
|
|
323
|
+
|
|
324
|
+
const _commit = () => {
|
|
325
|
+
emit('inited')
|
|
326
|
+
|
|
327
|
+
const opt = defaultTo(option, innerOption.value)
|
|
328
|
+
|
|
329
|
+
if (isEmpty(opt)) {
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
instance.setOption(opt, innerUpdateOptions.value)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// #ifdef WEB
|
|
337
|
+
if (props.autoresize) {
|
|
338
|
+
await nextTick()
|
|
339
|
+
|
|
340
|
+
_resize()
|
|
341
|
+
_commit()
|
|
342
|
+
} else {
|
|
343
|
+
_commit()
|
|
344
|
+
}
|
|
345
|
+
// #endif
|
|
346
|
+
|
|
347
|
+
// #ifndef WEB
|
|
348
|
+
_commit()
|
|
349
|
+
// #endif
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function setOption(option, updateOptions) {
|
|
353
|
+
if (props.manualUpdate) {
|
|
354
|
+
manualOption.value = option
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (chart.value == null) {
|
|
358
|
+
init(option)
|
|
359
|
+
} else {
|
|
360
|
+
chart.value.setOption(option, defaultTo(updateOptions, {}))
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
async function resize(options = {}) {
|
|
365
|
+
if (chart.value == null) {
|
|
366
|
+
return
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
let { width, height } = options
|
|
370
|
+
|
|
371
|
+
const updateWidth = isEmpty(width) || width === 'auto'
|
|
372
|
+
const updateHeight = isEmpty(height) || height === 'auto'
|
|
373
|
+
|
|
374
|
+
if (updateWidth || updateHeight) {
|
|
375
|
+
const el = await querySelect(vueThis, `#${canvasId}`, {
|
|
376
|
+
size: true
|
|
377
|
+
})
|
|
378
|
+
|
|
379
|
+
if (updateWidth) {
|
|
380
|
+
width = el.width
|
|
381
|
+
}
|
|
382
|
+
if (updateHeight) {
|
|
383
|
+
height = el.height
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
chart.value.resize({
|
|
388
|
+
...options,
|
|
389
|
+
width,
|
|
390
|
+
height
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function cleanup() {
|
|
395
|
+
if (chart.value == null) {
|
|
396
|
+
return
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
touch.cleanup()
|
|
400
|
+
|
|
401
|
+
chart.value.dispose()
|
|
402
|
+
chart.value = null
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
let unwatchOption
|
|
406
|
+
|
|
407
|
+
watch(
|
|
408
|
+
() => props.manualUpdate,
|
|
409
|
+
(manual) => {
|
|
410
|
+
if (typeof unwatchOption === 'function') {
|
|
411
|
+
unwatchOption()
|
|
412
|
+
unwatchOption = null
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (manual) {
|
|
416
|
+
return
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
unwatchOption = watch(
|
|
420
|
+
() => defaultTo(props.option, injectOption.value),
|
|
421
|
+
(value, oldValue) => {
|
|
422
|
+
if (isEmpty(value)) {
|
|
423
|
+
return
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (chart.value == null) {
|
|
427
|
+
init()
|
|
428
|
+
} else {
|
|
429
|
+
chart.value.setOption(value, {
|
|
430
|
+
notMerge: value !== oldValue,
|
|
431
|
+
...innerUpdateOptions.value
|
|
432
|
+
})
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
deep: true
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
immediate: true
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
|
|
445
|
+
watch(
|
|
446
|
+
[innerTheme, innerInitOptions],
|
|
447
|
+
() => {
|
|
448
|
+
cleanup()
|
|
449
|
+
init()
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
deep: true
|
|
453
|
+
}
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
watchEffect(() => {
|
|
457
|
+
if (props.group && chart.value != null) {
|
|
458
|
+
chart.value.group = props.group
|
|
459
|
+
}
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
const publicApi = usePublicApi(chart)
|
|
463
|
+
|
|
464
|
+
useLoading(chart, {
|
|
465
|
+
loading: () => props.loading,
|
|
466
|
+
loadingOptions: () => props.loadingOptions
|
|
467
|
+
})
|
|
468
|
+
|
|
469
|
+
// #ifdef WEB
|
|
470
|
+
|
|
471
|
+
useAutoresize(chart, {
|
|
472
|
+
echarts,
|
|
473
|
+
autoresize: () => props.autoresize,
|
|
474
|
+
root
|
|
475
|
+
})
|
|
476
|
+
|
|
477
|
+
// #endif
|
|
478
|
+
|
|
479
|
+
function toTempFilePath(options) {
|
|
480
|
+
if (chart.value == null || chart.value.isDisposed()) {
|
|
481
|
+
return
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const canvas = chart.value.getDom()
|
|
485
|
+
|
|
486
|
+
if (canvas == null) {
|
|
487
|
+
return
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
return canvas.toTempFilePath(options)
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
onMounted(() => {
|
|
494
|
+
init()
|
|
495
|
+
})
|
|
496
|
+
|
|
497
|
+
onBeforeUnmount(() => {
|
|
498
|
+
cleanup()
|
|
499
|
+
})
|
|
500
|
+
|
|
501
|
+
defineExpose({
|
|
502
|
+
root,
|
|
503
|
+
canvasId,
|
|
504
|
+
chart,
|
|
505
|
+
setOption,
|
|
506
|
+
resize,
|
|
507
|
+
...publicApi,
|
|
508
|
+
toTempFilePath
|
|
509
|
+
})
|
|
510
|
+
</script>
|
|
511
|
+
|
|
512
|
+
<style scoped>
|
|
513
|
+
.uni-echarts {
|
|
514
|
+
position: relative;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.uni-echarts__canvas {
|
|
518
|
+
width: 100%;
|
|
519
|
+
height: 100%;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.uni-echarts__mask {
|
|
523
|
+
position: absolute;
|
|
524
|
+
top: 0;
|
|
525
|
+
right: 0;
|
|
526
|
+
bottom: 0;
|
|
527
|
+
left: 0;
|
|
528
|
+
z-index: 1;
|
|
529
|
+
}
|
|
530
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable ts/no-empty-object-type */
|
|
2
|
+
import type { DefineComponent } from "vue";
|
|
3
|
+
import type { AllowedComponentProps } from "../../shared-core";
|
|
4
|
+
import type { UniEchartsEmits, UniEchartsProps } from "./types";
|
|
5
|
+
|
|
6
|
+
type UniEcharts = DefineComponent<
|
|
7
|
+
AllowedComponentProps & UniEchartsProps,
|
|
8
|
+
{},
|
|
9
|
+
{},
|
|
10
|
+
{},
|
|
11
|
+
{},
|
|
12
|
+
{},
|
|
13
|
+
{},
|
|
14
|
+
UniEchartsEmits
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
declare const _default: UniEcharts;
|
|
18
|
+
|
|
19
|
+
export default _default;
|