hfn-components 0.6.1 → 0.6.2
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.
- package/dist/index.css +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/component.d.ts +3 -0
- package/es/component.mjs +14 -0
- package/es/components/chart/index.d.ts +201 -0
- package/es/components/chart/index.mjs +7 -0
- package/es/components/chart/src/HtChart.d.ts +77 -0
- package/es/components/chart/src/HtChart.mjs +93 -0
- package/es/components/chart/src/HtChart.vue.d.ts +207 -0
- package/es/components/chart/src/HtChart.vue.mjs +90 -0
- package/es/components/chart/src/HtChart.vue2.mjs +109 -0
- package/es/components/chart/src/chartConfig.d.ts +7 -0
- package/es/components/chart/src/chartConfig.mjs +88 -0
- package/es/components/chart/style/index.d.ts +1 -0
- package/es/components/chart/style/index.mjs +1 -0
- package/es/components/elTable/index.d.ts +821 -0
- package/es/components/elTable/index.mjs +7 -0
- package/es/components/elTable/src/columnDeal.vue.d.ts +65 -0
- package/es/components/elTable/src/columnDeal.vue.mjs +42 -0
- package/es/components/elTable/src/columnDeal.vue2.mjs +19 -0
- package/es/components/elTable/src/elTable.d.ts +56 -0
- package/es/components/elTable/src/elTable.mjs +49 -0
- package/es/components/elTable/src/elTable.vue.d.ts +820 -0
- package/es/components/elTable/src/elTable.vue.mjs +114 -0
- package/es/components/elTable/src/elTable.vue2.mjs +51 -0
- package/es/components/htTarget/index.d.ts +2028 -0
- package/es/components/htTarget/index.mjs +6 -0
- package/es/components/htTarget/src/htTarget.d.ts +25 -0
- package/es/components/htTarget/src/htTarget.mjs +20 -0
- package/es/components/htTarget/src/htTarget.vue.d.ts +2027 -0
- package/es/components/htTarget/src/htTarget.vue.mjs +240 -0
- package/es/components/htTarget/src/htTarget.vue2.mjs +158 -0
- package/es/components/htTarget/style/index.d.ts +1 -0
- package/es/components/htTarget/style/index.mjs +1 -0
- package/es/components/index.d.ts +4 -0
- package/es/components/index.mjs +7 -0
- package/es/components/pieChart/index.d.ts +104 -0
- package/es/components/pieChart/index.mjs +7 -0
- package/es/components/pieChart/src/HtPieChart.d.ts +36 -0
- package/es/components/pieChart/src/HtPieChart.mjs +42 -0
- package/es/components/pieChart/src/HtPieChart.vue.d.ts +109 -0
- package/es/components/pieChart/src/HtPieChart.vue.mjs +61 -0
- package/es/components/pieChart/src/HtPieChart.vue2.mjs +103 -0
- package/es/components/pieChart/style/index.d.ts +1 -0
- package/es/components/pieChart/style/index.mjs +1 -0
- package/es/components/table/HtTable.d.ts +142 -0
- package/es/components/table/HtTable.mjs +136 -0
- package/es/components/table/HtTable.vue.d.ts +1847 -0
- package/es/components/table/HtTable.vue.mjs +449 -0
- package/es/components/table/HtTable.vue2.mjs +124 -0
- package/es/components/table/index.d.ts +1845 -0
- package/es/components/table/index.mjs +7 -0
- package/es/constants/chartConfig.d.ts +8 -0
- package/es/constants/chartConfig.mjs +148 -0
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.mjs +4 -0
- package/es/constants/key.d.ts +1 -0
- package/es/constants/key.mjs +3 -0
- package/es/constants/table.d.ts +125 -0
- package/es/constants/table.mjs +156 -0
- package/es/constants/target.d.ts +15 -0
- package/es/constants/target.mjs +59 -0
- package/es/defaults.d.ts +4 -0
- package/es/defaults.mjs +7 -0
- package/es/index.d.ts +5 -0
- package/es/index.mjs +13 -0
- package/es/make-installer.d.ts +4 -0
- package/es/make-installer.mjs +15 -0
- package/es/plugin.d.ts +2 -0
- package/es/plugin.mjs +3 -0
- package/es/utils/chart.d.ts +8 -0
- package/es/utils/chart.mjs +197 -0
- package/es/utils/common.d.ts +3 -0
- package/es/utils/common.mjs +15 -0
- package/es/utils/index.d.ts +4 -0
- package/es/utils/index.mjs +4 -0
- package/es/utils/table.d.ts +2 -0
- package/es/utils/table.mjs +31 -0
- package/es/utils/tool.d.ts +2 -0
- package/es/utils/tool.mjs +42 -0
- package/global.d.ts +14 -0
- package/package.json +1 -1
- package/theme-chalk/ht-chart.css +1 -0
- package/theme-chalk/ht-table.css +1 -0
- package/theme-chalk/ht-target.css +1 -0
- package/theme-chalk/index.css +1 -0
- package/theme-chalk/src/chart.scss +58 -0
- package/theme-chalk/src/index.scss +3 -0
- package/theme-chalk/src/table.scss +45 -0
- package/theme-chalk/src/target.scss +39 -0
- package/component.ts +0 -15
- package/defaults.ts +0 -5
- package/index.ts +0 -6
- package/make-installer.ts +0 -17
- package/plugin.ts +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import _sfc_main from './elTable.vue2.mjs';
|
|
2
|
+
import { withDirectives, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, renderSlot } from 'vue';
|
|
3
|
+
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
|
+
|
|
5
|
+
const _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "header-text-wrap"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_2 = { key: 0 };
|
|
10
|
+
const _hoisted_3 = { key: 1 };
|
|
11
|
+
const _hoisted_4 = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "header-text-wrap"
|
|
14
|
+
};
|
|
15
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
16
|
+
return withDirectives((openBlock(), createBlock($setup["ElTable"], {
|
|
17
|
+
data: $setup.props.dataSource,
|
|
18
|
+
style: { "width": "100%" },
|
|
19
|
+
height: "100%",
|
|
20
|
+
border: $setup.props.resizable,
|
|
21
|
+
class: normalizeClass({ "header-only-border": $setup.props.resizable }),
|
|
22
|
+
"header-cell-style": {
|
|
23
|
+
background: $setup.props.headerColor,
|
|
24
|
+
color: "#000",
|
|
25
|
+
"font-weight": 500,
|
|
26
|
+
"font-size": "12px"
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
default: withCtx(() => [
|
|
30
|
+
(openBlock(true), createElementBlock(
|
|
31
|
+
Fragment,
|
|
32
|
+
null,
|
|
33
|
+
renderList($setup.props.tableColumn, (item) => {
|
|
34
|
+
return openBlock(), createBlock($setup["ElTableColumn"], {
|
|
35
|
+
resizable: $setup.props.resizable,
|
|
36
|
+
key: item.key,
|
|
37
|
+
prop: item.key,
|
|
38
|
+
width: item.width
|
|
39
|
+
}, {
|
|
40
|
+
header: withCtx(() => [
|
|
41
|
+
item.customizeLabel ? (openBlock(), createElementBlock("span", _hoisted_1, [
|
|
42
|
+
item.customizeLabel === "target" ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
43
|
+
createElementVNode(
|
|
44
|
+
"div",
|
|
45
|
+
null,
|
|
46
|
+
toDisplayString($setup.targetHead.filter((items) => items.key === item.key.split("_")[0])[0].name),
|
|
47
|
+
1
|
|
48
|
+
/* TEXT */
|
|
49
|
+
),
|
|
50
|
+
createElementVNode(
|
|
51
|
+
"div",
|
|
52
|
+
null,
|
|
53
|
+
toDisplayString($setup.TARGET_END_KEY.filter((items) => items.key === item.key.split("_")[1])[0].name),
|
|
54
|
+
1
|
|
55
|
+
/* TEXT */
|
|
56
|
+
)
|
|
57
|
+
])) : (openBlock(), createElementBlock(
|
|
58
|
+
"div",
|
|
59
|
+
_hoisted_3,
|
|
60
|
+
toDisplayString($setup.wrapText(item.customizeLabel)),
|
|
61
|
+
1
|
|
62
|
+
/* TEXT */
|
|
63
|
+
))
|
|
64
|
+
])) : (openBlock(), createElementBlock(
|
|
65
|
+
"span",
|
|
66
|
+
_hoisted_4,
|
|
67
|
+
toDisplayString($setup.wrapText($setup.TABLE_KEY[item.key])),
|
|
68
|
+
1
|
|
69
|
+
/* TEXT */
|
|
70
|
+
))
|
|
71
|
+
]),
|
|
72
|
+
default: withCtx((scope) => [
|
|
73
|
+
item.dealType === "other" ? (openBlock(), createBlock($setup["ColumnDeal"], {
|
|
74
|
+
key: 0,
|
|
75
|
+
dealType: scope.row.dealType,
|
|
76
|
+
text: $setup.convertKey(scope.row, item.key)
|
|
77
|
+
}, null, 8, ["dealType", "text"])) : item.dealType === "customSlot" ? (openBlock(), createBlock($setup["ColumnDeal"], {
|
|
78
|
+
key: 1,
|
|
79
|
+
dealType: item.dealType,
|
|
80
|
+
slot: item.slot
|
|
81
|
+
}, {
|
|
82
|
+
[item.slot]: withCtx(() => [
|
|
83
|
+
renderSlot(_ctx.$slots, item.slot, {
|
|
84
|
+
text: $setup.convertKey(scope.row, item.key),
|
|
85
|
+
row: scope.row
|
|
86
|
+
})
|
|
87
|
+
]),
|
|
88
|
+
_: 2
|
|
89
|
+
/* DYNAMIC */
|
|
90
|
+
}, 1032, ["dealType", "slot"])) : (openBlock(), createBlock($setup["ColumnDeal"], {
|
|
91
|
+
key: 2,
|
|
92
|
+
dealType: item.dealType,
|
|
93
|
+
text: $setup.convertKey(scope.row, item.key),
|
|
94
|
+
row: scope.row,
|
|
95
|
+
"deal-function": item.dealFunction
|
|
96
|
+
}, null, 8, ["dealType", "text", "row", "deal-function"]))
|
|
97
|
+
]),
|
|
98
|
+
_: 2
|
|
99
|
+
/* DYNAMIC */
|
|
100
|
+
}, 1032, ["resizable", "prop", "width"]);
|
|
101
|
+
}),
|
|
102
|
+
128
|
|
103
|
+
/* KEYED_FRAGMENT */
|
|
104
|
+
))
|
|
105
|
+
]),
|
|
106
|
+
_: 3
|
|
107
|
+
/* FORWARDED */
|
|
108
|
+
}, 8, ["data", "border", "class", "header-cell-style"])), [
|
|
109
|
+
[$setup["vLoading"], $setup.props.loading]
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
var elTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/elTable/src/elTable.vue"]]);
|
|
113
|
+
|
|
114
|
+
export { elTable as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted } from 'vue';
|
|
2
|
+
import { ElTable, ElTableColumn, vLoading } from 'element-plus';
|
|
3
|
+
import { TABLE_KEY, convertKey } from '../../../constants/table.mjs';
|
|
4
|
+
import { TARGET_HEAD_KEY, TARGET_END_KEY } from '../../../constants/target.mjs';
|
|
5
|
+
import '../../../constants/chartConfig.mjs';
|
|
6
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
7
|
+
import ColumnDeal from './columnDeal.vue.mjs';
|
|
8
|
+
import { elTableProps } from './elTable.mjs';
|
|
9
|
+
|
|
10
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "elTable",
|
|
12
|
+
props: elTableProps,
|
|
13
|
+
setup(__props, { expose: __expose }) {
|
|
14
|
+
__expose();
|
|
15
|
+
const targetHead = ref(cloneDeep(TARGET_HEAD_KEY));
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
let startYear = 2018;
|
|
18
|
+
const nowYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
19
|
+
while (startYear <= nowYear) {
|
|
20
|
+
targetHead.value.push({
|
|
21
|
+
name: `${startYear}`,
|
|
22
|
+
key: `${startYear}`
|
|
23
|
+
});
|
|
24
|
+
startYear++;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const props = __props;
|
|
28
|
+
const wrapText = (text, charsPerLine = 6) => {
|
|
29
|
+
if (!text) return "";
|
|
30
|
+
const regex = new RegExp(`.{1,${charsPerLine}}`, "g");
|
|
31
|
+
return text.match(regex)?.join("\n") || text;
|
|
32
|
+
};
|
|
33
|
+
const __returned__ = { targetHead, props, wrapText, get ElTable() {
|
|
34
|
+
return ElTable;
|
|
35
|
+
}, get ElTableColumn() {
|
|
36
|
+
return ElTableColumn;
|
|
37
|
+
}, get vLoading() {
|
|
38
|
+
return vLoading;
|
|
39
|
+
}, get TABLE_KEY() {
|
|
40
|
+
return TABLE_KEY;
|
|
41
|
+
}, get convertKey() {
|
|
42
|
+
return convertKey;
|
|
43
|
+
}, get TARGET_END_KEY() {
|
|
44
|
+
return TARGET_END_KEY;
|
|
45
|
+
}, ColumnDeal };
|
|
46
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
47
|
+
return __returned__;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export { _sfc_main as default };
|