hfn-components 0.7.4 → 0.7.6

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.
@@ -75,6 +75,10 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
75
75
  readonly type: import("vue").PropType<string[]>;
76
76
  readonly default: readonly [];
77
77
  };
78
+ readonly gridObj: {
79
+ readonly type: ObjectConstructor;
80
+ readonly default: null;
81
+ };
78
82
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
79
83
  readonly chartData: {
80
84
  readonly type: import("vue").PropType<any[]>;
@@ -152,9 +156,16 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
152
156
  readonly type: import("vue").PropType<string[]>;
153
157
  readonly default: readonly [];
154
158
  };
159
+ readonly gridObj: {
160
+ readonly type: ObjectConstructor;
161
+ readonly default: null;
162
+ };
155
163
  }>>, {
156
164
  readonly chartData: any[];
157
165
  readonly chartId: string;
166
+ readonly floatNumber: number;
167
+ readonly watchResize: boolean;
168
+ readonly lineColor: string[];
158
169
  readonly chartType: import("hfn-components/es/utils").chartType;
159
170
  readonly titleText: string;
160
171
  readonly titleText2: string;
@@ -162,16 +173,14 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
162
173
  readonly collation: string;
163
174
  readonly isReturn: boolean;
164
175
  readonly isPercent: boolean;
165
- readonly floatNumber: number;
166
176
  readonly yAxisUnit: string;
167
177
  readonly yAxisObj: Record<string, any>;
168
178
  readonly xAxisObj: Record<string, any>;
169
179
  readonly tooltipUnit: string;
170
- readonly watchResize: boolean;
171
180
  readonly showLegend: boolean;
172
181
  readonly auxiliaryData: Record<string, any>;
173
182
  readonly downLoadAutn: boolean;
174
- readonly lineColor: string[];
183
+ readonly gridObj: Record<string, any>;
175
184
  }, {}>> & Record<string, any>;
176
185
  export default HtChart;
177
186
  export * from './src/HtChart';
@@ -77,5 +77,9 @@ export declare const chartProps: {
77
77
  readonly type: PropType<string[]>;
78
78
  readonly default: readonly [];
79
79
  };
80
+ readonly gridObj: {
81
+ readonly type: ObjectConstructor;
82
+ readonly default: null;
83
+ };
80
84
  };
81
85
  export type chartProp = ExtractPropTypes<typeof chartProps>;
@@ -93,6 +93,11 @@ const chartProps = {
93
93
  lineColor: {
94
94
  type: Array,
95
95
  default: []
96
+ },
97
+ // 图表样式
98
+ gridObj: {
99
+ type: Object,
100
+ default: null
96
101
  }
97
102
  };
98
103
 
@@ -81,6 +81,10 @@ declare const _default: import("vue").DefineComponent<{
81
81
  readonly type: import("vue").PropType<string[]>;
82
82
  readonly default: readonly [];
83
83
  };
84
+ readonly gridObj: {
85
+ readonly type: ObjectConstructor;
86
+ readonly default: null;
87
+ };
84
88
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
85
89
  readonly chartData: {
86
90
  readonly type: import("vue").PropType<any[]>;
@@ -158,9 +162,16 @@ declare const _default: import("vue").DefineComponent<{
158
162
  readonly type: import("vue").PropType<string[]>;
159
163
  readonly default: readonly [];
160
164
  };
165
+ readonly gridObj: {
166
+ readonly type: ObjectConstructor;
167
+ readonly default: null;
168
+ };
161
169
  }>>, {
162
170
  readonly chartData: any[];
163
171
  readonly chartId: string;
172
+ readonly floatNumber: number;
173
+ readonly watchResize: boolean;
174
+ readonly lineColor: string[];
164
175
  readonly chartType: import("hfn-components/es/utils").chartType;
165
176
  readonly titleText: string;
166
177
  readonly titleText2: string;
@@ -168,15 +179,13 @@ declare const _default: import("vue").DefineComponent<{
168
179
  readonly collation: string;
169
180
  readonly isReturn: boolean;
170
181
  readonly isPercent: boolean;
171
- readonly floatNumber: number;
172
182
  readonly yAxisUnit: string;
173
183
  readonly yAxisObj: Record<string, any>;
174
184
  readonly xAxisObj: Record<string, any>;
175
185
  readonly tooltipUnit: string;
176
- readonly watchResize: boolean;
177
186
  readonly showLegend: boolean;
178
187
  readonly auxiliaryData: Record<string, any>;
179
188
  readonly downLoadAutn: boolean;
180
- readonly lineColor: string[];
189
+ readonly gridObj: Record<string, any>;
181
190
  }, {}>;
182
191
  export default _default;
@@ -85,6 +85,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
85
85
  $setup.noData ? (openBlock(), createElementBlock("div", _hoisted_5, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
86
86
  ]);
87
87
  }
88
- var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/chart/src/HtChart.vue"]]);
88
+ var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cengzewei/Desktop/fof/component-library/packages/components/chart/src/HtChart.vue"]]);
89
89
 
90
90
  export { chart as default };
@@ -17,6 +17,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  const myChart = shallowRef();
18
18
  const isEmpty = ref(false);
19
19
  const echartOptions = reactive(cloneDeep(BASIC_CHART_CONFIG));
20
+ echartOptions.grid = { ...echartOptions.grid, ...props.gridObj };
20
21
  watch(
21
22
  () => props.chartData,
22
23
  (val) => {
@@ -41,6 +41,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
41
41
  /* TEXT */
42
42
  ));
43
43
  }
44
- var ColumnDeal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/htTable/src/columnDeal.vue"]]);
44
+ var ColumnDeal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cengzewei/Desktop/fof/component-library/packages/components/htTable/src/columnDeal.vue"]]);
45
45
 
46
46
  export { ColumnDeal as default };
@@ -211,6 +211,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
211
211
  ])) : createCommentVNode("v-if", true)
212
212
  ]);
213
213
  }
214
- var elTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/htTable/src/htTable.vue"]]);
214
+ var elTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cengzewei/Desktop/fof/component-library/packages/components/htTable/src/htTable.vue"]]);
215
215
 
216
216
  export { elTable as default };
@@ -230,6 +230,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
230
230
  }, 8, ["modelValue"])
231
231
  ]);
232
232
  }
233
- var htTarget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/htTarget/src/htTarget.vue"]]);
233
+ var htTarget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cengzewei/Desktop/fof/component-library/packages/components/htTarget/src/htTarget.vue"]]);
234
234
 
235
235
  export { htTarget as default };
@@ -31,6 +31,14 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
31
31
  readonly type: import("vue").PropType<string[]>;
32
32
  readonly default: readonly [];
33
33
  };
34
+ readonly isCustomTooltip: {
35
+ readonly type: BooleanConstructor;
36
+ readonly default: false;
37
+ };
38
+ readonly toolTipFuc: {
39
+ readonly type: FunctionConstructor;
40
+ readonly default: () => void;
41
+ };
34
42
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
43
  readonly chartData: {
36
44
  readonly type: import("vue").PropType<any[]>;
@@ -64,15 +72,25 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
64
72
  readonly type: import("vue").PropType<string[]>;
65
73
  readonly default: readonly [];
66
74
  };
75
+ readonly isCustomTooltip: {
76
+ readonly type: BooleanConstructor;
77
+ readonly default: false;
78
+ };
79
+ readonly toolTipFuc: {
80
+ readonly type: FunctionConstructor;
81
+ readonly default: () => void;
82
+ };
67
83
  }>>, {
68
84
  readonly chartData: any[];
85
+ readonly legendData: Record<string, any>;
86
+ readonly legendType: string;
69
87
  readonly chartId: string;
70
88
  readonly floatNumber: number;
89
+ readonly legendFormatter: Function;
71
90
  readonly watchResize: boolean;
72
91
  readonly lineColor: string[];
73
- readonly legendData: Record<string, any>;
74
- readonly legendType: string;
75
- readonly legendFormatter: Function;
92
+ readonly isCustomTooltip: boolean;
93
+ readonly toolTipFuc: Function;
76
94
  }, {}>> & Record<string, any>;
77
95
  export default HtPieChart;
78
96
  export * from './src/HtPieChart';
@@ -32,5 +32,13 @@ export declare const pieProps: {
32
32
  readonly type: PropType<string[]>;
33
33
  readonly default: readonly [];
34
34
  };
35
+ readonly isCustomTooltip: {
36
+ readonly type: BooleanConstructor;
37
+ readonly default: false;
38
+ };
39
+ readonly toolTipFuc: {
40
+ readonly type: FunctionConstructor;
41
+ readonly default: () => void;
42
+ };
35
43
  };
36
44
  export type pieProps = ExtractPropTypes<typeof pieProps>;
@@ -36,6 +36,16 @@ const pieProps = {
36
36
  lineColor: {
37
37
  type: Array,
38
38
  default: []
39
+ },
40
+ // 自定义tooltip函数
41
+ isCustomTooltip: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ toolTipFuc: {
46
+ type: Function,
47
+ default: () => {
48
+ }
39
49
  }
40
50
  };
41
51
 
@@ -37,6 +37,14 @@ declare const _default: import("vue").DefineComponent<{
37
37
  readonly type: import("vue").PropType<string[]>;
38
38
  readonly default: readonly [];
39
39
  };
40
+ readonly isCustomTooltip: {
41
+ readonly type: BooleanConstructor;
42
+ readonly default: false;
43
+ };
44
+ readonly toolTipFuc: {
45
+ readonly type: FunctionConstructor;
46
+ readonly default: () => void;
47
+ };
40
48
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
49
  readonly chartData: {
42
50
  readonly type: import("vue").PropType<any[]>;
@@ -70,14 +78,24 @@ declare const _default: import("vue").DefineComponent<{
70
78
  readonly type: import("vue").PropType<string[]>;
71
79
  readonly default: readonly [];
72
80
  };
81
+ readonly isCustomTooltip: {
82
+ readonly type: BooleanConstructor;
83
+ readonly default: false;
84
+ };
85
+ readonly toolTipFuc: {
86
+ readonly type: FunctionConstructor;
87
+ readonly default: () => void;
88
+ };
73
89
  }>>, {
74
90
  readonly chartData: any[];
91
+ readonly legendData: Record<string, any>;
92
+ readonly legendType: string;
75
93
  readonly chartId: string;
76
94
  readonly floatNumber: number;
95
+ readonly legendFormatter: Function;
77
96
  readonly watchResize: boolean;
78
97
  readonly lineColor: string[];
79
- readonly legendData: Record<string, any>;
80
- readonly legendType: string;
81
- readonly legendFormatter: Function;
98
+ readonly isCustomTooltip: boolean;
99
+ readonly toolTipFuc: Function;
82
100
  }, {}>;
83
101
  export default _default;
@@ -56,6 +56,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
56
56
  $setup.noData ? (openBlock(), createElementBlock("div", _hoisted_5, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
57
57
  ]);
58
58
  }
59
- var htPieChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/pieChart/src/HtPieChart.vue"]]);
59
+ var htPieChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cengzewei/Desktop/fof/component-library/packages/components/pieChart/src/HtPieChart.vue"]]);
60
60
 
61
61
  export { htPieChart as default };
@@ -41,6 +41,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
41
41
  },
42
42
  { deep: true, immediate: true }
43
43
  );
44
+ watch(
45
+ () => props.isCustomTooltip,
46
+ () => {
47
+ drawGraph();
48
+ }
49
+ );
44
50
  const chartResize = () => {
45
51
  myChart.value.resize();
46
52
  };
@@ -64,16 +70,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
64
70
  });
65
71
  };
66
72
  const setEchartTooltip = () => {
73
+ const tooltip = function(params) {
74
+ let html;
75
+ html = `<div>${params.seriesName}</div>`;
76
+ html += `<span> ${params.name}:
77
+ ${params.data.percent ? (params.data.percent * 100).toFixed(props.floatNumber) : params.percent.toFixed(props.floatNumber)}%<span>`;
78
+ return html;
79
+ };
67
80
  echartOptions.tooltip = {
68
81
  trigger: "item",
69
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
- formatter: function(params) {
71
- let html;
72
- html = `<div>${params.seriesName}</div>`;
73
- html += `<span> ${params.name}:
74
- ${params.data.percent ? (params.data.percent * 100).toFixed(props.floatNumber) : params.percent.toFixed(props.floatNumber)}%<span>`;
75
- return html;
76
- }
82
+ formatter: props.isCustomTooltip ? props.toolTipFuc : tooltip
77
83
  };
78
84
  };
79
85
  const legendStatus = (item, index) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "",
5
5
  "main": "es/index.mjs",
6
6
  "module": "es/index.mjs",