cnhis-design-vue 3.1.12-beta.4 → 3.1.12-beta.7

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 (66) hide show
  1. package/es/packages/big-table/index.d.ts +0 -8
  2. package/es/packages/big-table/src/BigTable.vue.d.ts +0 -8
  3. package/es/packages/big-table/src/bigTableState.js +1 -1
  4. package/es/packages/fabric-chart/index.d.ts +195 -1
  5. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +196 -1
  6. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +269 -6
  7. package/es/packages/fabric-chart/src/components/PopupMenu.d.ts +46 -0
  8. package/es/packages/fabric-chart/src/components/PopupMenu.js +105 -0
  9. package/es/packages/fabric-chart/src/components/PopupTip.js +4 -0
  10. package/es/packages/fabric-chart/src/components/PopupTip.vue.d.ts +63 -0
  11. package/es/packages/fabric-chart/src/components/PopupTip.vue_vue_type_script_setup_true_lang.js +32 -0
  12. package/es/packages/fabric-chart/src/components/useStyle.d.ts +7 -0
  13. package/es/packages/fabric-chart/src/components/useStyle.js +36 -0
  14. package/es/packages/fabric-chart/src/hooks/constant.d.ts +14 -0
  15. package/es/packages/fabric-chart/src/hooks/constant.js +36 -0
  16. package/es/packages/fabric-chart/src/hooks/index.d.ts +9 -0
  17. package/es/packages/fabric-chart/src/hooks/index.js +9 -0
  18. package/es/packages/fabric-chart/src/hooks/useBottom.d.ts +4 -0
  19. package/es/packages/fabric-chart/src/hooks/useBottom.js +86 -0
  20. package/es/packages/fabric-chart/src/hooks/useCenter.d.ts +29 -0
  21. package/es/packages/fabric-chart/src/hooks/useCenter.js +475 -0
  22. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +7 -0
  23. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +53 -0
  24. package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +42 -0
  25. package/es/packages/fabric-chart/src/hooks/useDraw.js +86 -0
  26. package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +1 -0
  27. package/es/packages/fabric-chart/src/hooks/useEvent.js +10 -0
  28. package/es/packages/fabric-chart/src/hooks/useGrid.d.ts +4 -0
  29. package/es/packages/fabric-chart/src/hooks/useGrid.js +44 -0
  30. package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +4 -0
  31. package/es/packages/fabric-chart/src/hooks/useLeft.js +180 -0
  32. package/es/packages/fabric-chart/src/hooks/useOther.d.ts +4 -0
  33. package/es/packages/fabric-chart/src/hooks/useOther.js +34 -0
  34. package/es/packages/fabric-chart/src/hooks/useRight.d.ts +4 -0
  35. package/es/packages/fabric-chart/src/hooks/useRight.js +87 -0
  36. package/es/packages/fabric-chart/src/hooks/useShadow.d.ts +6 -0
  37. package/es/packages/fabric-chart/src/hooks/useShadow.js +127 -0
  38. package/es/packages/fabric-chart/src/hooks/useTop.d.ts +4 -0
  39. package/es/packages/fabric-chart/src/hooks/useTop.js +148 -0
  40. package/es/packages/fabric-chart/src/interface.d.ts +115 -0
  41. package/es/packages/fabric-chart/src/interface.js +3 -0
  42. package/es/packages/fabric-chart/src/utils/index.d.ts +2 -0
  43. package/es/packages/fabric-chart/src/utils/index.js +15334 -0
  44. package/es/packages/fabric-chart/style/index.css +43 -0
  45. package/es/packages/form-render/src/components/renderer/cascader.js +14 -0
  46. package/es/packages/form-render/src/components/renderer/checkbox.d.ts +2 -0
  47. package/es/packages/form-render/src/components/renderer/checkbox.js +4 -5
  48. package/es/packages/form-render/src/components/renderer/date.js +42 -10
  49. package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
  50. package/es/packages/form-render/src/components/renderer/index.js +1 -0
  51. package/es/packages/form-render/src/components/renderer/linebar.js +1 -1
  52. package/es/packages/form-render/src/components/renderer/select.js +11 -0
  53. package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +2 -0
  54. package/es/packages/form-render/src/components/renderer/simpleComponent.js +64 -0
  55. package/es/packages/form-render/src/components/renderer/slider.js +1 -1
  56. package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
  57. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +24 -15
  58. package/es/packages/index.css +50 -2
  59. package/es/packages/scale-view/src/components/formitem/r-collection.d.ts +1 -1
  60. package/es/packages/scale-view/src/components/formitem/r-collection.js +2 -4
  61. package/es/packages/scale-view/src/hooks/scaleview-computed.js +1 -1
  62. package/es/packages/scale-view/src/hooks/scaleview-init.js +3 -1
  63. package/es/packages/scale-view/src/hooks/use-component.d.ts +5 -5
  64. package/es/packages/scale-view/style/index.css +0 -2
  65. package/es/packages/select-label/style/index.css +7 -0
  66. package/package.json +2 -2
@@ -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";
@@ -0,0 +1,63 @@
1
+ import { IPropItems, ICoordinateValue } from '../interface';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ show: {
4
+ type: BooleanConstructor;
5
+ required: true;
6
+ default: boolean;
7
+ };
8
+ point: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ list: {
13
+ type: ArrayConstructor;
14
+ required: false;
15
+ default: () => never[];
16
+ };
17
+ propItems: {
18
+ type: null;
19
+ required: true;
20
+ };
21
+ }, {
22
+ props: {
23
+ show: boolean;
24
+ point: ICoordinateValue;
25
+ list: Array<string>;
26
+ propItems: IPropItems;
27
+ };
28
+ pointStyle: import("vue").ComputedRef<{
29
+ top: string;
30
+ bottom: string;
31
+ left: string;
32
+ right: string;
33
+ 'transform-origin': string;
34
+ }>;
35
+ Teleport: {
36
+ new (): {
37
+ $props: import("vue").VNodeProps & import("vue").TeleportProps;
38
+ };
39
+ __isTeleport: true;
40
+ };
41
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
42
+ show: {
43
+ type: BooleanConstructor;
44
+ required: true;
45
+ default: boolean;
46
+ };
47
+ point: {
48
+ type: null;
49
+ required: true;
50
+ };
51
+ list: {
52
+ type: ArrayConstructor;
53
+ required: false;
54
+ default: () => never[];
55
+ };
56
+ propItems: {
57
+ type: null;
58
+ required: true;
59
+ };
60
+ }>>, {
61
+ list: unknown[];
62
+ }>;
63
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { defineComponent, openBlock, createBlock, Teleport, withDirectives, createElementVNode, normalizeStyle, unref, createElementBlock, Fragment, renderList, toDisplayString, vShow } from 'vue';
2
+ import useStyle from './useStyle.js';
3
+
4
+ var script = /* @__PURE__ */ defineComponent({
5
+ __name: "PopupTip",
6
+ props: {
7
+ show: { type: Boolean, required: true, default: false },
8
+ point: { type: null, required: true },
9
+ list: { type: Array, required: false, default: () => [] },
10
+ propItems: { type: null, required: true }
11
+ },
12
+ setup(__props) {
13
+ const props = __props;
14
+ const pointStyle = useStyle(props);
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createBlock(Teleport, { to: ".c-fabric-chart" }, [
17
+ withDirectives(createElementVNode("ul", {
18
+ class: "c-fabric-chart-popup-tip",
19
+ style: normalizeStyle(unref(pointStyle))
20
+ }, [
21
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item) => {
22
+ return openBlock(), createElementBlock("li", null, toDisplayString(item), 1);
23
+ }), 256))
24
+ ], 4), [
25
+ [vShow, __props.show]
26
+ ])
27
+ ]);
28
+ };
29
+ }
30
+ });
31
+
32
+ export { script as default };
@@ -0,0 +1,7 @@
1
+ export default function useStyle(props: any): import("vue").ComputedRef<{
2
+ top: string;
3
+ bottom: string;
4
+ left: string;
5
+ right: string;
6
+ 'transform-origin': string;
7
+ }>;
@@ -0,0 +1,36 @@
1
+ import { computed } from 'vue';
2
+
3
+ function useStyle(props) {
4
+ const { canvasWidth, canvasHeight } = props.propItems;
5
+ const pointStyle = computed(() => {
6
+ const { x, y } = props.point;
7
+ const marginLeft = 15;
8
+ const marginTop = -15;
9
+ const style = {
10
+ top: "",
11
+ bottom: "",
12
+ left: "",
13
+ right: "",
14
+ "transform-origin": ""
15
+ };
16
+ const height = 200;
17
+ if (canvasWidth - (x + marginLeft) < height) {
18
+ style.right = canvasWidth - x + marginLeft + "px";
19
+ style["transform-origin"] = "right";
20
+ } else {
21
+ style.left = x + marginLeft + "px";
22
+ style["transform-origin"] = "left";
23
+ }
24
+ if (canvasHeight - (y + marginTop) < height) {
25
+ style.bottom = canvasHeight - y + marginTop + "px";
26
+ style["transform-origin"] += " bottom";
27
+ } else {
28
+ style.top = y + marginTop + "px";
29
+ style["transform-origin"] += " top";
30
+ }
31
+ return style;
32
+ });
33
+ return pointStyle;
34
+ }
35
+
36
+ export { useStyle as default };
@@ -0,0 +1,14 @@
1
+ export declare const TEMPERATURE_MENU: ({
2
+ label: string;
3
+ value: boolean;
4
+ type: string;
5
+ } | {
6
+ label: string;
7
+ value: undefined;
8
+ type: string;
9
+ })[];
10
+ export declare const PAIN_MENU: {
11
+ label: string;
12
+ value: undefined;
13
+ type: string;
14
+ }[];
@@ -0,0 +1,36 @@
1
+ const TEMPERATURE_MENU = [
2
+ {
3
+ label: "\u5347\u6E29",
4
+ value: false,
5
+ type: "rise"
6
+ },
7
+ {
8
+ label: "\u836F\u7269\u964D\u6E29",
9
+ value: void 0,
10
+ type: "drugCooling"
11
+ },
12
+ {
13
+ label: "\u7269\u7406\u964D\u6E29",
14
+ value: void 0,
15
+ type: "physicalCooling"
16
+ },
17
+ {
18
+ label: "\u4E0D\u5347",
19
+ value: false,
20
+ type: "noRise"
21
+ }
22
+ ];
23
+ const PAIN_MENU = [
24
+ {
25
+ label: "\u836F\u7269\u964D\u75DB",
26
+ value: void 0,
27
+ type: "drugReducePain"
28
+ },
29
+ {
30
+ label: "\u7269\u7406\u964D\u75DB",
31
+ value: void 0,
32
+ type: "physicalReducePain"
33
+ }
34
+ ];
35
+
36
+ export { PAIN_MENU, TEMPERATURE_MENU };
@@ -0,0 +1,9 @@
1
+ export { defaultBorderStyle } from './useDraw';
2
+ export * from './useCumputedPoint';
3
+ export * from './useTop';
4
+ export * from './useLeft';
5
+ export * from './useRight';
6
+ export * from './useCenter';
7
+ export * from './useBottom';
8
+ export * from './useOther';
9
+ export * from './useEvent';
@@ -0,0 +1,9 @@
1
+ export { defaultBorderStyle } from './useDraw.js';
2
+ export { useCumputedPoint } from './useCumputedPoint.js';
3
+ export { useTop } from './useTop.js';
4
+ export { useLeft } from './useLeft.js';
5
+ export { useRight } from './useRight.js';
6
+ export { useCenter } from './useCenter.js';
7
+ export { useBottom } from './useBottom.js';
8
+ export { useOther } from './useOther.js';
9
+ export { useEvent } from './useEvent.js';
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../utils';
3
+ import { IPropItems } from '../interface';
4
+ export declare function useBottom(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;