cnhis-design-vue 3.1.12-beta.5 → 3.1.12

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 (68) hide show
  1. package/es/packages/big-table/index.d.ts +4 -9
  2. package/es/packages/big-table/src/BigTable.vue.d.ts +15 -12
  3. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +87 -63
  4. package/es/packages/big-table/src/bigTableState.d.ts +2 -0
  5. package/es/packages/big-table/src/bigTableState.js +1 -1
  6. package/es/packages/big-table/src/hooks/useFormat.js +1 -1
  7. package/es/packages/big-table/src/hooks/useNestTable.js +1 -1
  8. package/es/packages/big-table/src/utils.d.ts +5 -1
  9. package/es/packages/big-table/src/utils.js +100 -78
  10. package/es/packages/fabric-chart/index.d.ts +195 -1
  11. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +196 -1
  12. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +269 -6
  13. package/es/packages/fabric-chart/src/components/PopupMenu.d.ts +46 -0
  14. package/es/packages/fabric-chart/src/components/PopupMenu.js +105 -0
  15. package/es/packages/fabric-chart/src/components/PopupTip.js +4 -0
  16. package/es/packages/fabric-chart/src/components/PopupTip.vue.d.ts +63 -0
  17. package/es/packages/fabric-chart/src/components/PopupTip.vue_vue_type_script_setup_true_lang.js +32 -0
  18. package/es/packages/fabric-chart/src/components/useStyle.d.ts +7 -0
  19. package/es/packages/fabric-chart/src/components/useStyle.js +36 -0
  20. package/es/packages/fabric-chart/src/hooks/constant.d.ts +14 -0
  21. package/es/packages/fabric-chart/src/hooks/constant.js +36 -0
  22. package/es/packages/fabric-chart/src/hooks/index.d.ts +9 -0
  23. package/es/packages/fabric-chart/src/hooks/index.js +9 -0
  24. package/es/packages/fabric-chart/src/hooks/useBottom.d.ts +4 -0
  25. package/es/packages/fabric-chart/src/hooks/useBottom.js +86 -0
  26. package/es/packages/fabric-chart/src/hooks/useCenter.d.ts +29 -0
  27. package/es/packages/fabric-chart/src/hooks/useCenter.js +469 -0
  28. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +7 -0
  29. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +44 -0
  30. package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +42 -0
  31. package/es/packages/fabric-chart/src/hooks/useDraw.js +86 -0
  32. package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +1 -0
  33. package/es/packages/fabric-chart/src/hooks/useEvent.js +10 -0
  34. package/es/packages/fabric-chart/src/hooks/useGrid.d.ts +4 -0
  35. package/es/packages/fabric-chart/src/hooks/useGrid.js +44 -0
  36. package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +4 -0
  37. package/es/packages/fabric-chart/src/hooks/useLeft.js +180 -0
  38. package/es/packages/fabric-chart/src/hooks/useOther.d.ts +4 -0
  39. package/es/packages/fabric-chart/src/hooks/useOther.js +34 -0
  40. package/es/packages/fabric-chart/src/hooks/useRight.d.ts +4 -0
  41. package/es/packages/fabric-chart/src/hooks/useRight.js +89 -0
  42. package/es/packages/fabric-chart/src/hooks/useShadow.d.ts +6 -0
  43. package/es/packages/fabric-chart/src/hooks/useShadow.js +127 -0
  44. package/es/packages/fabric-chart/src/hooks/useTop.d.ts +4 -0
  45. package/es/packages/fabric-chart/src/hooks/useTop.js +148 -0
  46. package/es/packages/fabric-chart/src/interface.d.ts +115 -0
  47. package/es/packages/fabric-chart/src/interface.js +3 -0
  48. package/es/packages/fabric-chart/src/utils/index.d.ts +2 -0
  49. package/es/packages/fabric-chart/src/utils/index.js +15081 -0
  50. package/es/packages/fabric-chart/style/index.css +43 -0
  51. package/es/packages/form-render/src/components/renderer/cascader.js +14 -0
  52. package/es/packages/form-render/src/components/renderer/checkbox.d.ts +2 -0
  53. package/es/packages/form-render/src/components/renderer/checkbox.js +4 -5
  54. package/es/packages/form-render/src/components/renderer/date.js +42 -10
  55. package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
  56. package/es/packages/form-render/src/components/renderer/index.js +1 -0
  57. package/es/packages/form-render/src/components/renderer/linebar.js +1 -1
  58. package/es/packages/form-render/src/components/renderer/select.js +11 -0
  59. package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +2 -0
  60. package/es/packages/form-render/src/components/renderer/simpleComponent.js +64 -0
  61. package/es/packages/form-render/src/components/renderer/slider.js +1 -1
  62. package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
  63. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +24 -15
  64. package/es/packages/index.css +50 -0
  65. package/es/packages/scale-view/src/hooks/scaleview-computed.js +7 -12
  66. package/es/packages/scale-view/src/hooks/scaleview-init.js +1 -6
  67. package/es/packages/select-label/style/index.css +7 -0
  68. package/package.json +2 -2
@@ -1,2 +1,197 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ import { IData } from './interface';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ data: {
4
+ type: null;
5
+ required: true;
6
+ };
7
+ addRenderItem: {
8
+ type: FunctionConstructor;
9
+ required: false;
10
+ };
11
+ }, {
12
+ defaultHeight: number;
13
+ props: {
14
+ data: IData;
15
+ addRenderItem?: Function | undefined;
16
+ };
17
+ emits: (event: "change" | "add", ...args: any[]) => void;
18
+ canvasRef: any;
19
+ canvas: import("vue").Ref<any>;
20
+ dateHeight: import("vue").ComputedRef<number>;
21
+ hospitalDaysHeight: import("vue").ComputedRef<number>;
22
+ operationDaysHeight: import("vue").ComputedRef<number>;
23
+ xScalevalueHeight: import("vue").ComputedRef<number>;
24
+ breathingHeight: import("vue").ComputedRef<any>;
25
+ gridXNumber: import("vue").ComputedRef<number>;
26
+ gridYNumber: import("vue").ComputedRef<number>;
27
+ endX: import("vue").ComputedRef<number>;
28
+ originX: import("vue").ComputedRef<any>;
29
+ endY: import("vue").ComputedRef<number>;
30
+ originY: import("vue").ComputedRef<number>;
31
+ xCellWidth: import("vue").ComputedRef<number>;
32
+ yCellHeight: import("vue").ComputedRef<number>;
33
+ xScaleList: import("vue").ComputedRef<number[]>;
34
+ iconsWidth: import("vue").ComputedRef<any>;
35
+ xScaleCell: import("vue").ComputedRef<number>;
36
+ breatheYCell: import("vue").ComputedRef<number>;
37
+ pulseYCell: import("vue").ComputedRef<number>;
38
+ temperatureYCell: import("vue").ComputedRef<number>;
39
+ painYCell: import("vue").ComputedRef<number>;
40
+ event: import("vue").ComputedRef<any>;
41
+ itemList: import("vue").ComputedRef<any[]>;
42
+ painIndex: import("vue").ComputedRef<number>;
43
+ painHeight: import("vue").ComputedRef<number>;
44
+ painOriginY: import("vue").ComputedRef<{
45
+ originY: number;
46
+ endY: number;
47
+ }>;
48
+ vitalSignsOriginY: import("vue").ComputedRef<{
49
+ originY: number;
50
+ endY: number;
51
+ }>;
52
+ propItems: any;
53
+ cumputedX: (value: string | number) => number;
54
+ cumputedY: (type: import("./interface").IPointType, scaleValueList: number[], value: string | number) => number;
55
+ getXValue: (pointX: number) => string;
56
+ getYValue: (type: import("./interface").IPointType, pointY: number) => number;
57
+ pointTipProps: {
58
+ show: boolean;
59
+ point: {
60
+ x: number;
61
+ y: number;
62
+ };
63
+ list: string[];
64
+ };
65
+ pointMenuProps: {
66
+ show: boolean;
67
+ point: {
68
+ x: number;
69
+ y: number;
70
+ };
71
+ list: any[];
72
+ target: any;
73
+ };
74
+ clickMenu: ({ item, target }: {
75
+ item: any;
76
+ target: any;
77
+ }) => void;
78
+ setPopup: (point: any) => void;
79
+ getEqualXTypes: (pointX: number) => import("./interface").IPointType[];
80
+ PopupTip: import("vue").DefineComponent<{
81
+ show: {
82
+ type: BooleanConstructor;
83
+ required: true;
84
+ default: boolean;
85
+ };
86
+ point: {
87
+ type: null;
88
+ required: true;
89
+ };
90
+ list: {
91
+ type: ArrayConstructor;
92
+ required: false;
93
+ default: () => never[];
94
+ };
95
+ propItems: {
96
+ type: null;
97
+ required: true;
98
+ };
99
+ }, {
100
+ props: {
101
+ show: boolean;
102
+ point: import("./interface").ICoordinateValue;
103
+ list: string[];
104
+ propItems: import("./interface").IPropItems;
105
+ };
106
+ pointStyle: import("vue").ComputedRef<{
107
+ top: string;
108
+ bottom: string;
109
+ left: string;
110
+ right: string;
111
+ 'transform-origin': string;
112
+ }>;
113
+ Teleport: {
114
+ new (): {
115
+ $props: import("vue").VNodeProps & import("vue").TeleportProps;
116
+ };
117
+ __isTeleport: true;
118
+ };
119
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
120
+ show: {
121
+ type: BooleanConstructor;
122
+ required: true;
123
+ default: boolean;
124
+ };
125
+ point: {
126
+ type: null;
127
+ required: true;
128
+ };
129
+ list: {
130
+ type: ArrayConstructor;
131
+ required: false;
132
+ default: () => never[];
133
+ };
134
+ propItems: {
135
+ type: null;
136
+ required: true;
137
+ };
138
+ }>>, {
139
+ list: unknown[];
140
+ }>;
141
+ PopupMenu: import("vue").DefineComponent<{
142
+ show: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
146
+ list: {
147
+ type: ArrayConstructor;
148
+ default: () => never[];
149
+ };
150
+ point: {
151
+ type: import("vue").PropType<import("./interface").ICoordinateValue>;
152
+ };
153
+ propItems: {
154
+ type: import("vue").PropType<import("./interface").IPropItems>;
155
+ };
156
+ target: {
157
+ type: import("vue").PropType<any>;
158
+ };
159
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:show" | "clickMenu")[], "clickMenu" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
160
+ show: {
161
+ type: BooleanConstructor;
162
+ default: boolean;
163
+ };
164
+ list: {
165
+ type: ArrayConstructor;
166
+ default: () => never[];
167
+ };
168
+ point: {
169
+ type: import("vue").PropType<import("./interface").ICoordinateValue>;
170
+ };
171
+ propItems: {
172
+ type: import("vue").PropType<import("./interface").IPropItems>;
173
+ };
174
+ target: {
175
+ type: import("vue").PropType<any>;
176
+ };
177
+ }>> & {
178
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
179
+ onClickMenu?: ((...args: any[]) => any) | undefined;
180
+ }, {
181
+ show: boolean;
182
+ list: unknown[];
183
+ }>;
184
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "add")[], "change" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
185
+ data: {
186
+ type: null;
187
+ required: true;
188
+ };
189
+ addRenderItem: {
190
+ type: FunctionConstructor;
191
+ required: false;
192
+ };
193
+ }>> & {
194
+ onChange?: ((...args: any[]) => any) | undefined;
195
+ onAdd?: ((...args: any[]) => any) | undefined;
196
+ }, {}>;
2
197
  export default _default;
@@ -1,13 +1,276 @@
1
- import { defineComponent, openBlock, createElementBlock, createCommentVNode } from 'vue';
1
+ import { defineComponent, ref, computed, reactive, onMounted, onBeforeUnmount, openBlock, createElementBlock, Fragment, createElementVNode, unref, createBlock, mergeProps, createCommentVNode } from 'vue';
2
+ import { fabric } from './utils/index.js';
3
+ import './components/PopupTip.js';
4
+ import PopupMenu from './components/PopupMenu.js';
5
+ import { defaultBorderStyle } from './hooks/useDraw.js';
6
+ import { useTop } from './hooks/useTop.js';
7
+ import { useCenter } from './hooks/useCenter.js';
8
+ import { useLeft } from './hooks/useLeft.js';
9
+ import { useRight } from './hooks/useRight.js';
10
+ import { useBottom } from './hooks/useBottom.js';
11
+ import { useOther } from './hooks/useOther.js';
12
+ import { useEvent } from './hooks/useEvent.js';
13
+ import script$1 from './components/PopupTip.vue_vue_type_script_setup_true_lang.js';
14
+ import { useCumputedPoint } from './hooks/useCumputedPoint.js';
2
15
 
3
- const _hoisted_1 = { class: "c-fabric-chart" };
4
16
  var script = /* @__PURE__ */ defineComponent({
5
17
  __name: "FabricChart",
6
- setup(__props) {
18
+ props: {
19
+ data: { type: null, required: true },
20
+ addRenderItem: { type: Function, required: false }
21
+ },
22
+ emits: ["change", "add"],
23
+ setup(__props, { emit: emits }) {
24
+ const props = __props;
25
+ const defaultHeight = 15;
26
+ const canvasRef = ref(null);
27
+ let canvas = ref();
28
+ const dateHeight = computed(() => {
29
+ const { top } = props.data;
30
+ return top.date.show && (top.date.height || defaultHeight) || 0;
31
+ });
32
+ const hospitalDaysHeight = computed(() => {
33
+ var _a;
34
+ const { top } = props.data;
35
+ return ((_a = top.hospitalDays) == null ? void 0 : _a.show) && (top.hospitalDays.height || defaultHeight) || 0;
36
+ });
37
+ const operationDaysHeight = computed(() => {
38
+ var _a;
39
+ const { top } = props.data;
40
+ return ((_a = top.operationDays) == null ? void 0 : _a.show) && (top.operationDays.height || defaultHeight) || 0;
41
+ });
42
+ const xScalevalueHeight = computed(() => {
43
+ var _a, _b;
44
+ const { top } = props.data;
45
+ const height = ((_a = top.xScalevalue) == null ? void 0 : _a.show) && (top.xScalevalue.height || defaultHeight) || 0;
46
+ const dayHeight = ((_b = top.xScalevalue) == null ? void 0 : _b.show) ? top.dayHeight || 0 : 0;
47
+ return height + dayHeight;
48
+ });
49
+ const breathingHeight = computed(() => {
50
+ var _a;
51
+ const { bottom } = props.data;
52
+ return ((_a = bottom == null ? void 0 : bottom.breathing) == null ? void 0 : _a.show) && (bottom.breathing.height || defaultHeight * 2) || 0;
53
+ });
54
+ const gridXNumber = computed(() => {
55
+ const { grid } = props.data;
56
+ return grid.mainXCell * grid.subXCell;
57
+ });
58
+ const gridYNumber = computed(() => {
59
+ const { grid } = props.data;
60
+ return grid.mainYCell * grid.subYCell;
61
+ });
62
+ const endX = computed(() => {
63
+ const { width, right = null } = props.data;
64
+ if (!right)
65
+ return width;
66
+ const endWidth = right.width || 50;
67
+ return width - endWidth;
68
+ });
69
+ const originX = computed(() => {
70
+ const { top, left } = props.data;
71
+ const originX2 = top.titleWidth + iconsWidth.value;
72
+ const residue = (endX.value - originX2) % gridXNumber.value;
73
+ return originX2 + residue;
74
+ });
75
+ const endY = computed(() => {
76
+ const { bottom = null, height } = props.data;
77
+ if (!bottom)
78
+ return height;
79
+ const endHeight = bottom.height || 30;
80
+ const endY2 = height - endHeight;
81
+ const residue = (endY2 - originY.value) % gridYNumber.value;
82
+ return endY2 - residue;
83
+ });
84
+ const originY = computed(() => {
85
+ const { top } = props.data;
86
+ const dayHeight = top.xScalevalue.show && (top.dayHeight || defaultHeight) || 0;
87
+ const xScaleHeight = top.xScalevalue.show && (top.xScalevalue.height || defaultHeight) || 0;
88
+ const topHeight = dateHeight.value + dayHeight + xScaleHeight + hospitalDaysHeight.value + operationDaysHeight.value;
89
+ return topHeight;
90
+ });
91
+ const xCellWidth = computed(() => {
92
+ return (endX.value - originX.value) / gridXNumber.value;
93
+ });
94
+ const yCellHeight = computed(() => {
95
+ return (endY.value - originY.value) / gridYNumber.value;
96
+ });
97
+ const xScaleList = computed(() => {
98
+ const { top } = props.data;
99
+ const dateList = top.date.list;
100
+ const dayList = top.xScalevalue.list;
101
+ const timeList = dateList.map((item) => {
102
+ return dayList.map((v) => {
103
+ return new Date(`${item} ${v}:00`).getTime();
104
+ });
105
+ });
106
+ return timeList.flat();
107
+ });
108
+ const iconsWidth = computed(() => {
109
+ var _a, _b;
110
+ const { left } = props.data;
111
+ return ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
112
+ });
113
+ const xScaleCell = computed(() => {
114
+ return xScaleList.value[1] - xScaleList.value[0];
115
+ });
116
+ const breatheYCell = computed(() => {
117
+ var _a;
118
+ const { yScaleValue, spaceGridNumber = 5 } = props.data.left;
119
+ const list = (_a = yScaleValue.find((v) => v.type === "breathe")) == null ? void 0 : _a.list;
120
+ return list ? yCellHeight.value / ((parseInt(list[1]) - parseInt(list[0])) / spaceGridNumber) : 0;
121
+ });
122
+ const pulseYCell = computed(() => {
123
+ const { yScaleValue, spaceGridNumber = 5 } = props.data.left;
124
+ const list = yScaleValue.find((v) => v.type === "pulse").list;
125
+ return yCellHeight.value / ((parseInt(list[1]) - parseInt(list[0])) / spaceGridNumber);
126
+ });
127
+ const temperatureYCell = computed(() => {
128
+ const { yScaleValue, spaceGridNumber = 5 } = props.data.left;
129
+ const list = yScaleValue.find((v) => v.type === "temperature").list;
130
+ return yCellHeight.value / ((parseInt(list[1]) - parseInt(list[0])) / spaceGridNumber);
131
+ });
132
+ const painYCell = computed(() => {
133
+ const { yScaleValue, spaceGridNumber = 5 } = props.data.left;
134
+ const item = yScaleValue.find((v) => v.type === "pain");
135
+ const list = (item == null ? void 0 : item.list) || [];
136
+ if (!list.length)
137
+ return 0;
138
+ return yCellHeight.value / ((parseInt(list[1]) - parseInt(list[0])) / item.spaceGridNumber);
139
+ });
140
+ const event = computed(() => {
141
+ var _a;
142
+ return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true };
143
+ });
144
+ const itemList = computed(() => {
145
+ const { left } = props.data;
146
+ return left.yScaleValue.map((item) => {
147
+ return item.dataList.map((v, dataIndex) => {
148
+ return {
149
+ ...v,
150
+ bigType: item.type,
151
+ titleStyle: item.style,
152
+ unit: item.unit,
153
+ dataIndex
154
+ };
155
+ });
156
+ }).flat();
157
+ });
158
+ const painIndex = computed(() => {
159
+ const { left } = props.data;
160
+ return left.yScaleValue.findIndex((v) => v.type === "pain");
161
+ });
162
+ const painHeight = computed(() => {
163
+ const { grid } = props.data;
164
+ return painIndex.value === -1 ? 0 : yCellHeight.value * grid.subYCell;
165
+ });
166
+ const painOriginY = computed(() => {
167
+ const { left } = props.data;
168
+ let obj = {
169
+ originY: endY.value,
170
+ endY: endY.value
171
+ };
172
+ if (painIndex.value === 0) {
173
+ obj.originY = originY.value;
174
+ obj.endY = originY.value + painHeight.value;
175
+ } else if (painIndex.value === left.yScaleValue.length - 1) {
176
+ obj.originY = endY.value - painHeight.value;
177
+ obj.endY = endY.value;
178
+ }
179
+ return obj;
180
+ });
181
+ const vitalSignsOriginY = computed(() => {
182
+ const { left } = props.data;
183
+ let obj = {
184
+ originY: originY.value,
185
+ endY: endY.value
186
+ };
187
+ if (painIndex.value === 0) {
188
+ obj.originY = originY.value + painHeight.value;
189
+ obj.endY = endY.value;
190
+ } else if (painIndex.value === left.yScaleValue.length - 1) {
191
+ obj.originY = originY.value;
192
+ obj.endY = endY.value - painHeight.value;
193
+ }
194
+ return obj;
195
+ });
196
+ const propItems = reactive({
197
+ canvasWidth: props.data.width,
198
+ canvasHeight: props.data.height,
199
+ borderStyle: props.data.borderStyle || defaultBorderStyle,
200
+ dateHeight: dateHeight.value,
201
+ hospitalDaysHeight: hospitalDaysHeight.value,
202
+ operationDaysHeight: operationDaysHeight.value,
203
+ xScalevalueHeight: xScalevalueHeight.value,
204
+ breathingHeight: breathingHeight.value,
205
+ grid: props.data.grid,
206
+ top: props.data.top,
207
+ left: props.data.left,
208
+ right: props.data.right,
209
+ bottom: props.data.bottom,
210
+ other: props.data.other,
211
+ painIndex: painIndex.value,
212
+ painHeight: painHeight.value,
213
+ painOriginY: painOriginY.value,
214
+ vitalSignsOriginY: vitalSignsOriginY.value,
215
+ gridXNumber: gridXNumber.value,
216
+ gridYNumber: gridYNumber.value,
217
+ iconsWidth: iconsWidth.value,
218
+ originX: originX.value,
219
+ originY: originY.value,
220
+ endX: endX.value,
221
+ endY: endY.value,
222
+ xCellWidth: xCellWidth.value,
223
+ yCellHeight: yCellHeight.value,
224
+ xScaleList: xScaleList.value,
225
+ xScaleCell: xScaleCell.value,
226
+ breatheYCell: breatheYCell.value,
227
+ pulseYCell: pulseYCell.value,
228
+ temperatureYCell: temperatureYCell.value,
229
+ painYCell: painYCell.value,
230
+ event: event.value,
231
+ itemList: itemList.value
232
+ });
233
+ const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
234
+ useTop(canvas, propItems);
235
+ const { pointTipProps, pointMenuProps, clickMenu, setPopup, getEqualXTypes } = useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, props.addRenderItem);
236
+ useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes);
237
+ useRight(canvas, propItems);
238
+ useBottom(canvas, propItems);
239
+ useOther(canvas, propItems, cumputedX);
240
+ onMounted(() => {
241
+ canvas.value = new fabric.Canvas(canvasRef.value, {
242
+ width: propItems.canvasWidth,
243
+ height: propItems.canvasHeight,
244
+ backgroundColor: "#fff",
245
+ selection: false,
246
+ containerClass: "c-fabric-chart",
247
+ fireRightClick: true
248
+ });
249
+ useEvent(canvasRef.value);
250
+ });
251
+ onBeforeUnmount(() => {
252
+ canvas.value.clear();
253
+ canvas.value = null;
254
+ });
7
255
  return (_ctx, _cache) => {
8
- return openBlock(), createElementBlock("div", _hoisted_1, [
9
- createCommentVNode(' <canvas ref="canvasRef"></canvas> ')
10
- ]);
256
+ return openBlock(), createElementBlock(Fragment, null, [
257
+ createElementVNode("canvas", {
258
+ ref_key: "canvasRef",
259
+ ref: canvasRef
260
+ }, null, 512),
261
+ unref(canvas) ? (openBlock(), createBlock(script$1, mergeProps({
262
+ key: 0,
263
+ propItems
264
+ }, unref(pointTipProps)), null, 16, ["propItems"])) : createCommentVNode("v-if", true),
265
+ unref(canvas) ? (openBlock(), createBlock(unref(PopupMenu), mergeProps({
266
+ key: 1,
267
+ propItems
268
+ }, unref(pointMenuProps), {
269
+ show: unref(pointMenuProps).show,
270
+ "onUpdate:show": _cache[0] || (_cache[0] = ($event) => unref(pointMenuProps).show = $event),
271
+ onClickMenu: unref(clickMenu)
272
+ }), null, 16, ["propItems", "show", "onClickMenu"])) : createCommentVNode("v-if", true)
273
+ ], 64);
11
274
  };
12
275
  }
13
276
  });
@@ -0,0 +1,46 @@
1
+ import { PropType } from 'vue';
2
+ import { IPropItems, ICoordinateValue } from '../interface';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ show: {
5
+ type: BooleanConstructor;
6
+ default: boolean;
7
+ };
8
+ list: {
9
+ type: ArrayConstructor;
10
+ default: () => never[];
11
+ };
12
+ point: {
13
+ type: PropType<ICoordinateValue>;
14
+ };
15
+ propItems: {
16
+ type: PropType<IPropItems>;
17
+ };
18
+ target: {
19
+ type: PropType<any>;
20
+ };
21
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:show" | "clickMenu")[], "clickMenu" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
22
+ show: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ list: {
27
+ type: ArrayConstructor;
28
+ default: () => never[];
29
+ };
30
+ point: {
31
+ type: PropType<ICoordinateValue>;
32
+ };
33
+ propItems: {
34
+ type: PropType<IPropItems>;
35
+ };
36
+ target: {
37
+ type: PropType<any>;
38
+ };
39
+ }>> & {
40
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
41
+ onClickMenu?: ((...args: any[]) => any) | undefined;
42
+ }, {
43
+ show: boolean;
44
+ list: unknown[];
45
+ }>;
46
+ export default _default;
@@ -0,0 +1,105 @@
1
+ import { defineComponent, ref, createVNode, Teleport, withDirectives, vShow } from 'vue';
2
+ import { NSpace, NInputNumber } from 'naive-ui';
3
+ import useStyle from './useStyle.js';
4
+ import { onClickOutside } from '@vueuse/core';
5
+
6
+ var PopupMenu = defineComponent({
7
+ name: "PopupMenu",
8
+ inheritAttrs: false,
9
+ props: {
10
+ show: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ list: {
15
+ type: Array,
16
+ default: () => []
17
+ },
18
+ point: {
19
+ type: Object
20
+ },
21
+ propItems: {
22
+ type: Object
23
+ },
24
+ target: {
25
+ type: Object
26
+ }
27
+ },
28
+ emits: ["update:show", "clickMenu"],
29
+ setup(props, {
30
+ attrs,
31
+ slots,
32
+ emit
33
+ }) {
34
+ const popupRef = ref(null);
35
+ onClickOutside(popupRef, (event) => {
36
+ emit("update:show", false);
37
+ });
38
+ const {
39
+ left
40
+ } = props.propItems;
41
+ const pointStyle = useStyle(props);
42
+ function setNoClick(item) {
43
+ if (typeof item === "string" && item.startsWith("\u65B0\u589E")) {
44
+ return true;
45
+ }
46
+ }
47
+ function getItemContent(item) {
48
+ var _a;
49
+ if (typeof item === "string")
50
+ return item;
51
+ if (typeof item.value === "boolean")
52
+ return item.label;
53
+ if (!props.target)
54
+ return item.renderItem();
55
+ const min = +(((_a = left.yScaleValue.find((v) => v.type === props.target.origin.type)) == null ? void 0 : _a.list[0]) || 0);
56
+ return createVNode(NSpace, {
57
+ "inline": true,
58
+ "align": "center"
59
+ }, {
60
+ default: () => [createVNode("span", null, [item.label]), createVNode(NInputNumber, {
61
+ "style": "width: 120px",
62
+ "size": "small",
63
+ "value": item.value,
64
+ "onUpdate:value": ($event) => item.value = $event,
65
+ "clearable": true,
66
+ "placeholder": "\u8BF7\u8F93\u5165\u6570\u503C",
67
+ "max": props.target.origin.data.value,
68
+ "min": min,
69
+ "onFocus": () => emit("update:show", true)
70
+ }, null)]
71
+ });
72
+ }
73
+ function clickItem(event, item) {
74
+ if (setNoClick(item))
75
+ return void 0;
76
+ if ((event == null ? void 0 : event.target.className) === "") {
77
+ emit("update:show", false);
78
+ emit("clickMenu", {
79
+ item,
80
+ target: props.target
81
+ });
82
+ }
83
+ }
84
+ return () => {
85
+ return createVNode(Teleport, {
86
+ "to": ".c-fabric-chart"
87
+ }, {
88
+ default: () => [withDirectives(createVNode("ul", {
89
+ "ref": popupRef,
90
+ "class": "c-fabric-chart-popup-menu",
91
+ "style": pointStyle.value
92
+ }, [props.list.map((item) => {
93
+ return createVNode("li", {
94
+ "class": {
95
+ "no-click": setNoClick(item)
96
+ },
97
+ "onClick": (event) => clickItem(event, item)
98
+ }, [getItemContent(item)]);
99
+ })]), [[vShow, props.show]])]
100
+ });
101
+ };
102
+ }
103
+ });
104
+
105
+ export { PopupMenu as default };
@@ -0,0 +1,4 @@
1
+ import script from './PopupTip.vue_vue_type_script_setup_true_lang.js';
2
+ export { default } from './PopupTip.vue_vue_type_script_setup_true_lang.js';
3
+
4
+ script.__file = "packages/fabric-chart/src/components/PopupTip.vue";