hfn-components 0.2.5 → 0.2.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 (69) hide show
  1. package/component.ts +13 -0
  2. package/defaults.ts +5 -0
  3. package/index.ts +6 -0
  4. package/make-installer.ts +17 -0
  5. package/package.json +2 -2
  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 -10
  11. package/es/components/chart/index.d.ts +0 -171
  12. package/es/components/chart/index.mjs +0 -7
  13. package/es/components/chart/src/HtChart.d.ts +0 -65
  14. package/es/components/chart/src/HtChart.mjs +0 -86
  15. package/es/components/chart/src/HtChart.vue.d.ts +0 -177
  16. package/es/components/chart/src/HtChart.vue.mjs +0 -91
  17. package/es/components/chart/src/HtChart.vue2.mjs +0 -104
  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 -714
  23. package/es/components/elTable/index.mjs +0 -7
  24. package/es/components/elTable/src/columnDeal.vue.d.ts +0 -37
  25. package/es/components/elTable/src/columnDeal.vue.mjs +0 -35
  26. package/es/components/elTable/src/columnDeal.vue2.mjs +0 -19
  27. package/es/components/elTable/src/elTable.d.ts +0 -38
  28. package/es/components/elTable/src/elTable.mjs +0 -30
  29. package/es/components/elTable/src/elTable.vue.d.ts +0 -713
  30. package/es/components/elTable/src/elTable.vue.mjs +0 -56
  31. package/es/components/elTable/src/elTable.vue2.mjs +0 -29
  32. package/es/components/index.d.ts +0 -2
  33. package/es/components/index.mjs +0 -4
  34. package/es/components/table/HtTable.d.ts +0 -142
  35. package/es/components/table/HtTable.mjs +0 -136
  36. package/es/components/table/HtTable.vue.d.ts +0 -1847
  37. package/es/components/table/HtTable.vue.mjs +0 -449
  38. package/es/components/table/HtTable.vue2.mjs +0 -124
  39. package/es/components/table/index.d.ts +0 -1845
  40. package/es/components/table/index.mjs +0 -7
  41. package/es/constants/index.d.ts +0 -2
  42. package/es/constants/index.mjs +0 -2
  43. package/es/constants/key.d.ts +0 -1
  44. package/es/constants/key.mjs +0 -3
  45. package/es/constants/table.d.ts +0 -61
  46. package/es/constants/table.mjs +0 -73
  47. package/es/defaults.d.ts +0 -4
  48. package/es/defaults.mjs +0 -7
  49. package/es/index.d.ts +0 -5
  50. package/es/index.mjs +0 -10
  51. package/es/make-installer.d.ts +0 -4
  52. package/es/make-installer.mjs +0 -14
  53. package/es/plugin.d.ts +0 -2
  54. package/es/plugin.mjs +0 -3
  55. package/es/utils/chart.d.ts +0 -7
  56. package/es/utils/chart.mjs +0 -172
  57. package/es/utils/common.d.ts +0 -3
  58. package/es/utils/common.mjs +0 -15
  59. package/es/utils/index.d.ts +0 -4
  60. package/es/utils/index.mjs +0 -4
  61. package/es/utils/table.d.ts +0 -2
  62. package/es/utils/table.mjs +0 -31
  63. package/es/utils/tool.d.ts +0 -2
  64. package/es/utils/tool.mjs +0 -42
  65. package/global.d.ts +0 -14
  66. package/theme-chalk/ht-chart.css +0 -1
  67. package/theme-chalk/index.css +0 -1
  68. package/theme-chalk/src/chart.scss +0 -53
  69. package/theme-chalk/src/index.scss +0 -1
@@ -1,91 +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
- ref: "chartDom"
84
- }, null, 8, _hoisted_4),
85
- createCommentVNode(" \u56FE\u4F8B\u5168\u7F6E\u7070\u76D2\u5B50 "),
86
- $setup.noData ? (openBlock(), createElementBlock("div", _hoisted_5, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
87
- ]);
88
- }
89
- var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/chart/src/HtChart.vue"]]);
90
-
91
- export { chart as default };
@@ -1,104 +0,0 @@
1
- import { defineComponent, shallowRef, ref, reactive, watch } from 'vue';
2
- import { BASIC_CHART_CONFIG } from './chartConfig.mjs';
3
- import { chartProps } from './HtChart.mjs';
4
- import cloneDeep from 'lodash.clonedeep';
5
- import { 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
- () => {
36
- echartOptions.color = props.lineColor;
37
- if (myChart.value) {
38
- echartInit();
39
- }
40
- },
41
- { deep: true, immediate: true }
42
- );
43
- const drawGraph = () => {
44
- echartOptions.color = props.lineColor;
45
- setEchartXAxis(echartOptions, props.chartType, props.xAxisData);
46
- setEchartYAxis(echartOptions, props);
47
- setEchartTooltip(echartOptions, props);
48
- lengedDeal();
49
- echartInit();
50
- };
51
- const lengedDeal = () => {
52
- allLegend.value = [];
53
- props.chartData.forEach((item, index) => {
54
- const data = {
55
- name: item.name,
56
- isShow: true,
57
- lineType: item.type,
58
- color: echartOptions.color[index % echartOptions.color.length]
59
- };
60
- allLegend.value.push(data);
61
- });
62
- };
63
- const echartInit = () => {
64
- setTimeout(() => {
65
- if (!myChart.value) {
66
- const ele = document.getElementById(props.chartId);
67
- myChart.value = echarts.init(ele, null, { devicePixelRatio: 2, locale: "ZH" });
68
- }
69
- myChart.value.setOption(echartOptions, true);
70
- }, 200);
71
- };
72
- const chartResize = () => {
73
- myChart.value.resize();
74
- };
75
- const allLegend = ref([]);
76
- const noData = ref(false);
77
- const legendStatus = (item, index) => {
78
- const status = !item.isShow;
79
- allLegend.value[index].isShow = status;
80
- if (allLegend.value.every((item2) => item2.isShow === false)) {
81
- noData.value = true;
82
- } else {
83
- noData.value = false;
84
- }
85
- myChart.value.dispatchAction({
86
- type: "legendToggleSelect",
87
- name: item.name
88
- });
89
- };
90
- const legendEnter = (index) => {
91
- legendEnterOperate(echartOptions, allLegend.value[index].name);
92
- myChart.value.setOption(echartOptions);
93
- };
94
- const legendLeave = () => {
95
- legendLeaveOperate(echartOptions);
96
- myChart.value.setOption(echartOptions);
97
- };
98
- const __returned__ = { props, myChart, isEmpty, echartOptions, drawGraph, lengedDeal, echartInit, chartResize, allLegend, noData, legendStatus, legendEnter, legendLeave };
99
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
100
- return __returned__;
101
- }
102
- });
103
-
104
- 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';