hfn-components 0.6.0 → 0.6.1

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 (94) hide show
  1. package/component.ts +15 -0
  2. package/defaults.ts +5 -0
  3. package/index.ts +6 -0
  4. package/make-installer.ts +17 -0
  5. package/package.json +1 -1
  6. package/plugin.ts +1 -0
  7. package/dist/index.css +0 -1
  8. package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
  9. package/es/component.d.ts +0 -3
  10. package/es/component.mjs +0 -14
  11. package/es/components/chart/index.d.ts +0 -201
  12. package/es/components/chart/index.mjs +0 -7
  13. package/es/components/chart/src/HtChart.d.ts +0 -77
  14. package/es/components/chart/src/HtChart.mjs +0 -93
  15. package/es/components/chart/src/HtChart.vue.d.ts +0 -207
  16. package/es/components/chart/src/HtChart.vue.mjs +0 -90
  17. package/es/components/chart/src/HtChart.vue2.mjs +0 -109
  18. package/es/components/chart/src/chartConfig.d.ts +0 -7
  19. package/es/components/chart/src/chartConfig.mjs +0 -88
  20. package/es/components/chart/style/index.d.ts +0 -1
  21. package/es/components/chart/style/index.mjs +0 -1
  22. package/es/components/elTable/index.d.ts +0 -810
  23. package/es/components/elTable/index.mjs +0 -7
  24. package/es/components/elTable/src/columnDeal.vue.d.ts +0 -65
  25. package/es/components/elTable/src/columnDeal.vue.mjs +0 -42
  26. package/es/components/elTable/src/columnDeal.vue2.mjs +0 -19
  27. package/es/components/elTable/src/elTable.d.ts +0 -52
  28. package/es/components/elTable/src/elTable.mjs +0 -44
  29. package/es/components/elTable/src/elTable.vue.d.ts +0 -809
  30. package/es/components/elTable/src/elTable.vue.mjs +0 -108
  31. package/es/components/elTable/src/elTable.vue2.mjs +0 -46
  32. package/es/components/htTarget/index.d.ts +0 -2028
  33. package/es/components/htTarget/index.mjs +0 -6
  34. package/es/components/htTarget/src/htTarget.d.ts +0 -25
  35. package/es/components/htTarget/src/htTarget.mjs +0 -20
  36. package/es/components/htTarget/src/htTarget.vue.d.ts +0 -2027
  37. package/es/components/htTarget/src/htTarget.vue.mjs +0 -240
  38. package/es/components/htTarget/src/htTarget.vue2.mjs +0 -158
  39. package/es/components/htTarget/style/index.d.ts +0 -1
  40. package/es/components/htTarget/style/index.mjs +0 -1
  41. package/es/components/index.d.ts +0 -4
  42. package/es/components/index.mjs +0 -7
  43. package/es/components/pieChart/index.d.ts +0 -104
  44. package/es/components/pieChart/index.mjs +0 -7
  45. package/es/components/pieChart/src/HtPieChart.d.ts +0 -36
  46. package/es/components/pieChart/src/HtPieChart.mjs +0 -42
  47. package/es/components/pieChart/src/HtPieChart.vue.d.ts +0 -109
  48. package/es/components/pieChart/src/HtPieChart.vue.mjs +0 -61
  49. package/es/components/pieChart/src/HtPieChart.vue2.mjs +0 -103
  50. package/es/components/pieChart/style/index.d.ts +0 -1
  51. package/es/components/pieChart/style/index.mjs +0 -1
  52. package/es/components/table/HtTable.d.ts +0 -142
  53. package/es/components/table/HtTable.mjs +0 -136
  54. package/es/components/table/HtTable.vue.d.ts +0 -1847
  55. package/es/components/table/HtTable.vue.mjs +0 -449
  56. package/es/components/table/HtTable.vue2.mjs +0 -124
  57. package/es/components/table/index.d.ts +0 -1845
  58. package/es/components/table/index.mjs +0 -7
  59. package/es/constants/chartConfig.d.ts +0 -8
  60. package/es/constants/chartConfig.mjs +0 -148
  61. package/es/constants/index.d.ts +0 -4
  62. package/es/constants/index.mjs +0 -4
  63. package/es/constants/key.d.ts +0 -1
  64. package/es/constants/key.mjs +0 -3
  65. package/es/constants/table.d.ts +0 -125
  66. package/es/constants/table.mjs +0 -156
  67. package/es/constants/target.d.ts +0 -15
  68. package/es/constants/target.mjs +0 -59
  69. package/es/css/index.css +0 -59
  70. package/es/defaults.d.ts +0 -4
  71. package/es/defaults.mjs +0 -7
  72. package/es/index.d.ts +0 -5
  73. package/es/index.mjs +0 -13
  74. package/es/make-installer.d.ts +0 -4
  75. package/es/make-installer.mjs +0 -15
  76. package/es/plugin.d.ts +0 -2
  77. package/es/plugin.mjs +0 -3
  78. package/es/utils/chart.d.ts +0 -8
  79. package/es/utils/chart.mjs +0 -197
  80. package/es/utils/common.d.ts +0 -3
  81. package/es/utils/common.mjs +0 -15
  82. package/es/utils/index.d.ts +0 -4
  83. package/es/utils/index.mjs +0 -4
  84. package/es/utils/table.d.ts +0 -2
  85. package/es/utils/table.mjs +0 -31
  86. package/es/utils/tool.d.ts +0 -2
  87. package/es/utils/tool.mjs +0 -42
  88. package/global.d.ts +0 -14
  89. package/theme-chalk/ht-chart.css +0 -1
  90. package/theme-chalk/ht-target.css +0 -1
  91. package/theme-chalk/index.css +0 -1
  92. package/theme-chalk/src/chart.scss +0 -58
  93. package/theme-chalk/src/index.scss +0 -2
  94. package/theme-chalk/src/target.scss +0 -39
@@ -1,90 +0,0 @@
1
- import _sfc_main from './HtChart.vue2.mjs';
2
- import { openBlock, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
3
- import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
4
-
5
- const _hoisted_1 = { class: "echart-box" };
6
- const _hoisted_2 = {
7
- key: 0,
8
- class: "echart-lenged"
9
- };
10
- const _hoisted_3 = ["onClick", "onMouseover"];
11
- const _hoisted_4 = ["id"];
12
- const _hoisted_5 = {
13
- key: 1,
14
- class: "noData"
15
- };
16
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
17
- return openBlock(), createElementBlock("div", _hoisted_1, [
18
- _ctx.showLegend && !$setup.isEmpty ? (openBlock(), createElementBlock("div", _hoisted_2, [
19
- (openBlock(true), createElementBlock(
20
- Fragment,
21
- null,
22
- renderList($setup.allLegend, (item, index) => {
23
- return openBlock(), createElementBlock("div", {
24
- class: "span-box mb10",
25
- key: index,
26
- onClick: ($event) => $setup.legendStatus(item, index),
27
- onMouseover: ($event) => $setup.legendEnter(index),
28
- onMouseleave: _cache[0] || (_cache[0] = ($event) => $setup.legendLeave())
29
- }, [
30
- item.lineType === "line" ? (openBlock(), createElementBlock(
31
- "span",
32
- {
33
- key: 0,
34
- class: "bg-span",
35
- style: normalizeStyle({ background: item.isShow ? item.color : "#ccc" })
36
- },
37
- null,
38
- 4
39
- /* STYLE */
40
- )) : createCommentVNode("v-if", true),
41
- item.lineType === "bar" ? (openBlock(), createElementBlock(
42
- "span",
43
- {
44
- key: 1,
45
- class: "bg-span-bar",
46
- style: normalizeStyle({ background: item.isShow ? item.color : "#ccc" })
47
- },
48
- null,
49
- 4
50
- /* STYLE */
51
- )) : createCommentVNode("v-if", true),
52
- createElementVNode(
53
- "span",
54
- {
55
- style: normalizeStyle({ color: item.isShow ? "#000" : "#ccc" })
56
- },
57
- toDisplayString(item.name),
58
- 5
59
- /* TEXT, STYLE */
60
- ),
61
- createCommentVNode(` <span
62
- v-if="isLegend"
63
- class="returnRatio"
64
- :style="{ color: item.isShow ? (item.returnRatio > 0 ? 'red' : item.returnRatio < 0 ? 'green' : '#000') : '#ccc' }"
65
- >
66
- {{
67
- item.name !== '\u57FA\u91D1\u89C4\u6A21' && item.name !== '\u603B\u5E02\u503C' && item.name !== '\u6D41\u901A\u5E02\u503C'
68
- ? item.returnRatio === ''
69
- ? ''
70
- : item.returnRatio.toFixed(2) + (isPercent || specialPercent ? '%' : '')
71
- : \`\${item.returnRatio}\${props.tooltipUnit}\`
72
- }}
73
- </span> `)
74
- ], 40, _hoisted_3);
75
- }),
76
- 128
77
- /* KEYED_FRAGMENT */
78
- ))
79
- ])) : createCommentVNode("v-if", true),
80
- createElementVNode("div", {
81
- class: "echart-content",
82
- id: _ctx.chartId
83
- }, null, 8, _hoisted_4),
84
- createCommentVNode(" \u56FE\u4F8B\u5168\u7F6E\u7070\u76D2\u5B50 "),
85
- $setup.noData ? (openBlock(), createElementBlock("div", _hoisted_5, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
86
- ]);
87
- }
88
- var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/chart/src/HtChart.vue"]]);
89
-
90
- export { chart as default };
@@ -1,109 +0,0 @@
1
- import { defineComponent, shallowRef, ref, reactive, watch } from 'vue';
2
- import { BASIC_CHART_CONFIG } from '../../../constants/chartConfig.mjs';
3
- import { chartProps } from './HtChart.mjs';
4
- import cloneDeep from 'lodash.clonedeep';
5
- import { setEchartTitle, setEchartXAxis, setEchartYAxis, setEchartTooltip, legendEnterOperate, legendLeaveOperate } from '../../../utils/chart.mjs';
6
- import * as echarts from 'echarts/core';
7
-
8
- var _sfc_main = /* @__PURE__ */ defineComponent({
9
- __name: "HtChart",
10
- props: chartProps,
11
- setup(__props, { expose: __expose }) {
12
- __expose();
13
- const props = __props;
14
- const myChart = shallowRef();
15
- const isEmpty = ref(false);
16
- const echartOptions = reactive(cloneDeep(BASIC_CHART_CONFIG));
17
- watch(
18
- () => props.chartData,
19
- (val) => {
20
- echartOptions.series = cloneDeep(val);
21
- drawGraph();
22
- },
23
- {
24
- deep: true
25
- }
26
- );
27
- watch(
28
- () => props.watchResize,
29
- () => {
30
- chartResize();
31
- }
32
- );
33
- watch(
34
- () => props.lineColor,
35
- (val) => {
36
- if (val && val.length > 0) {
37
- echartOptions.color = props.lineColor;
38
- if (myChart.value) {
39
- echartInit();
40
- }
41
- }
42
- },
43
- { deep: true, immediate: true }
44
- );
45
- const drawGraph = () => {
46
- if (props.lineColor && props.lineColor.length > 0) {
47
- echartOptions.color = props.lineColor;
48
- }
49
- setEchartTitle(echartOptions, props);
50
- setEchartXAxis(echartOptions, props.chartType, props.xAxisData);
51
- setEchartYAxis(echartOptions, props);
52
- setEchartTooltip(echartOptions, props);
53
- lengedDeal();
54
- echartInit();
55
- };
56
- const lengedDeal = () => {
57
- allLegend.value = [];
58
- props.chartData.forEach((item, index) => {
59
- const data = {
60
- name: item.name,
61
- isShow: true,
62
- lineType: item.type,
63
- color: echartOptions.color[index % echartOptions.color.length]
64
- };
65
- allLegend.value.push(data);
66
- });
67
- };
68
- const echartInit = () => {
69
- setTimeout(() => {
70
- if (!myChart.value) {
71
- const ele = document.getElementById(props.chartId);
72
- myChart.value = echarts.init(ele, null, { devicePixelRatio: 2, locale: "ZH" });
73
- }
74
- myChart.value.setOption(echartOptions, true);
75
- }, 200);
76
- };
77
- const chartResize = () => {
78
- myChart.value.resize();
79
- };
80
- const allLegend = ref([]);
81
- const noData = ref(false);
82
- const legendStatus = (item, index) => {
83
- const status = !item.isShow;
84
- allLegend.value[index].isShow = status;
85
- if (allLegend.value.every((item2) => item2.isShow === false)) {
86
- noData.value = true;
87
- } else {
88
- noData.value = false;
89
- }
90
- myChart.value.dispatchAction({
91
- type: "legendToggleSelect",
92
- name: item.name
93
- });
94
- };
95
- const legendEnter = (index) => {
96
- legendEnterOperate(echartOptions, allLegend.value[index].name);
97
- myChart.value.setOption(echartOptions);
98
- };
99
- const legendLeave = () => {
100
- legendLeaveOperate(echartOptions);
101
- myChart.value.setOption(echartOptions);
102
- };
103
- const __returned__ = { props, myChart, isEmpty, echartOptions, drawGraph, lengedDeal, echartInit, chartResize, allLegend, noData, legendStatus, legendEnter, legendLeave };
104
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
105
- return __returned__;
106
- }
107
- });
108
-
109
- export { _sfc_main as default };
@@ -1,7 +0,0 @@
1
- import * as echarts from 'echarts/core';
2
- import type { BarSeriesOption, LineSeriesOption } from 'echarts/charts';
3
- import type { TitleComponentOption, TooltipComponentOption, GridComponentOption, DatasetComponentOption } from 'echarts/components';
4
- import type { ComposeOption } from 'echarts/core';
5
- export type ECOption = ComposeOption<BarSeriesOption | LineSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | DatasetComponentOption>;
6
- export default echarts;
7
- export declare const BASIC_CHART_CONFIG: any;
@@ -1,88 +0,0 @@
1
- import * as echarts from 'echarts/core';
2
- export { echarts as default };
3
- import { BarChart, LineChart } from 'echarts/charts';
4
- import { TitleComponent, TooltipComponent, GridComponent, LegendComponent, DatasetComponent, TransformComponent } from 'echarts/components';
5
- import { LabelLayout, UniversalTransition } from 'echarts/features';
6
- import { CanvasRenderer } from 'echarts/renderers';
7
-
8
- echarts.use([
9
- TitleComponent,
10
- TooltipComponent,
11
- GridComponent,
12
- LegendComponent,
13
- DatasetComponent,
14
- TransformComponent,
15
- BarChart,
16
- LineChart,
17
- LabelLayout,
18
- UniversalTransition,
19
- CanvasRenderer
20
- ]);
21
- const BASIC_CHART_CONFIG = {
22
- title: {
23
- text: "",
24
- // top: '5%',
25
- left: "0%",
26
- textStyle: {
27
- fontSize: 12,
28
- color: "rgba(0,0,0,0.7)",
29
- fontWeight: "normal"
30
- }
31
- },
32
- // 图例
33
- legend: {
34
- left: "0%",
35
- show: false
36
- },
37
- xAxis: {},
38
- yAxis: {},
39
- grid: {
40
- // top: '12%',
41
- top: "8%",
42
- left: "3%",
43
- right: "3%",
44
- bottom: "1%",
45
- containLabel: true
46
- },
47
- // 线条颜色
48
- color: [
49
- "#C13431",
50
- "#1E85D2",
51
- "#FD984F",
52
- "#63B9BB",
53
- "#BBB162",
54
- "#AE76C1",
55
- "#5E92F6",
56
- "#F5BC32",
57
- "#DA8484",
58
- "#41982E",
59
- "#437095",
60
- "#8060A7",
61
- "#7D0A0D",
62
- "#572AFF",
63
- "#2BE8F8",
64
- "#FF1493",
65
- "#E066FF",
66
- "#27408B",
67
- "#5191A3",
68
- "#D5634C",
69
- "#92d6fd",
70
- "#b92e2d",
71
- "#187bc9",
72
- "#90bae0",
73
- "#187bc9",
74
- "#0070C9",
75
- "#5470c6",
76
- "#91cc75",
77
- "#fac858",
78
- "#ee6666",
79
- "#73c0de",
80
- "#3ba272",
81
- "#fc8452",
82
- "#9a60b4",
83
- "#ea7ccc"
84
- ],
85
- series: []
86
- };
87
-
88
- export { BASIC_CHART_CONFIG };
@@ -1 +0,0 @@
1
- import 'hfn-components/theme-chalk/src/chart.scss';
@@ -1 +0,0 @@
1
- import 'hfn-components/theme-chalk/src/chart.scss';