hfn-components 0.6.5 → 0.6.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.
- package/dist/index.css +1 -1
- package/es/component.mjs +3 -3
- package/es/components/chart/index.d.ts +1 -35
- package/es/components/chart/index.mjs +1 -0
- package/es/components/chart/src/HtChart.vue.d.ts +1 -36
- package/es/components/chart/src/HtChart.vue.mjs +1 -1
- package/es/components/chart/src/HtChart.vue2.mjs +3 -0
- package/es/components/htTable/index.d.ts +252 -0
- package/es/components/htTable/index.mjs +8 -0
- package/es/components/htTable/src/columnDeal.vue.d.ts +41 -0
- package/es/components/{elTable → htTable}/src/columnDeal.vue.mjs +18 -14
- package/es/components/{elTable → htTable}/src/columnDeal.vue2.mjs +1 -1
- package/es/components/htTable/src/composables/index.d.ts +3 -0
- package/es/components/htTable/src/composables/index.mjs +3 -0
- package/es/components/htTable/src/composables/use-copy.d.ts +3 -0
- package/es/components/htTable/src/composables/use-copy.mjs +24 -0
- package/es/components/htTable/src/composables/use-pagination.d.ts +13 -0
- package/es/components/htTable/src/composables/use-pagination.mjs +33 -0
- package/es/components/htTable/src/composables/use-selection.d.ts +12 -0
- package/es/components/htTable/src/composables/use-selection.mjs +58 -0
- package/es/components/{elTable/src/elTable.d.ts → htTable/src/htTable.d.ts} +38 -7
- package/es/components/{elTable/src/elTable.mjs → htTable/src/htTable.mjs} +22 -4
- package/es/components/htTable/src/htTable.vue.d.ts +115 -0
- package/es/components/htTable/src/htTable.vue.mjs +216 -0
- package/es/components/htTable/src/htTable.vue2.mjs +84 -0
- package/es/components/htTarget/index.d.ts +7 -1987
- package/es/components/htTarget/index.mjs +1 -0
- package/es/components/htTarget/src/htTarget.vue.d.ts +5 -1985
- package/es/components/htTarget/src/htTarget.vue.mjs +54 -59
- package/es/components/htTarget/src/htTarget.vue2.mjs +26 -24
- package/es/components/index.d.ts +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/pieChart/index.d.ts +1 -27
- package/es/components/pieChart/index.mjs +1 -0
- package/es/components/pieChart/src/HtPieChart.vue.d.ts +1 -27
- package/es/components/pieChart/src/HtPieChart.vue.mjs +1 -1
- package/es/components/pieChart/src/HtPieChart.vue2.mjs +3 -0
- package/es/constants/icons.d.ts +1 -0
- package/es/constants/icons.mjs +3 -0
- package/es/constants/index.mjs +1 -1
- package/es/constants/table.d.ts +102 -83
- package/es/constants/table.mjs +73 -45
- package/es/constants/target.d.ts +166 -15
- package/es/hfn-components/component.d.ts +3 -0
- package/es/hfn-components/defaults.d.ts +4 -0
- package/es/hfn-components/index.d.ts +5 -0
- package/es/hfn-components/make-installer.d.ts +4 -0
- package/es/hfn-components/plugin.d.ts +2 -0
- package/es/icons/index.d.ts +1 -0
- package/es/icons/index.mjs +1 -0
- package/es/icons/svg/empty-simple.svg.mjs +3 -0
- package/es/index.mjs +2 -2
- package/es/utils/index.mjs +1 -1
- package/es/utils/table.d.ts +11 -2
- package/es/utils/table.mjs +36 -26
- package/es/utils/tool.d.ts +1 -1
- package/es/utils/tool.mjs +8 -36
- package/package.json +6 -8
- package/theme-chalk/ht-table.css +1 -1
- package/theme-chalk/ht-target.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/table.scss +61 -4
- package/theme-chalk/src/target.scss +23 -3
- package/es/components/chart/src/chartConfig.d.ts +0 -7
- package/es/components/chart/src/chartConfig.mjs +0 -88
- package/es/components/elTable/index.d.ts +0 -828
- package/es/components/elTable/index.mjs +0 -7
- package/es/components/elTable/src/columnDeal.vue.d.ts +0 -65
- package/es/components/elTable/src/elTable.vue.d.ts +0 -827
- package/es/components/elTable/src/elTable.vue.mjs +0 -111
- package/es/components/elTable/src/elTable.vue2.mjs +0 -51
- package/es/components/table/HtTable.d.ts +0 -142
- package/es/components/table/HtTable.mjs +0 -136
- package/es/components/table/HtTable.vue.d.ts +0 -1847
- package/es/components/table/HtTable.vue.mjs +0 -449
- package/es/components/table/HtTable.vue2.mjs +0 -124
- package/es/components/table/index.d.ts +0 -1845
- package/es/components/table/index.mjs +0 -7
- package/es/css/index.css +0 -59
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.echart-box{display:flex;flex-direction:column;height:100%;position:relative;width:100%}.echart-content{flex:auto}.echart-lenged{box-sizing:border-box;display:flex;flex-wrap:wrap;font-size:12px;height:auto;margin-top:6px;padding-right:22px;position:relative;width:100%;z-index:999}.bg-span{height:2px;width:14px}.bg-span,.bg-span-bar{display:inline-block;margin-right:6px}.bg-span-bar{border-radius:2px;height:10px;width:16px}.span-box{cursor:pointer;margin-left:5px;margin-right:6px}.noData,.span-box{align-items:center;display:flex}.noData{bottom:0;color:#ccc;font-size:16px;justify-content:center;position:absolute}._100,.noData{height:100%;width:100%}.dialog{padding:24px!important;width:860px!important}.factor-content{display:flex;flex-direction:column;flex-wrap:wrap;height:380px;width:100%}.factor_item{width:33.33%}.check_item,.factor_item{display:flex;margin-bottom:10px}.check_item{justify-content:space-between}.flex-alignCnter{align-items:center;cursor:pointer;display:flex}.target-head{display:grid;grid:auto/repeat(5,1fr)}.flow-col{border-left:1px solid #e8e8e8;height:520px;overflow-y:auto;padding-left:10px}.
|
|
1
|
+
.echart-box{display:flex;flex-direction:column;height:100%;position:relative;width:100%}.echart-content{flex:auto}.echart-lenged{box-sizing:border-box;display:flex;flex-wrap:wrap;font-size:12px;height:auto;margin-top:6px;padding-right:22px;position:relative;width:100%;z-index:999}.bg-span{height:2px;width:14px}.bg-span,.bg-span-bar{display:inline-block;margin-right:6px}.bg-span-bar{border-radius:2px;height:10px;width:16px}.span-box{cursor:pointer;margin-left:5px;margin-right:6px}.noData,.span-box{align-items:center;display:flex}.noData{bottom:0;color:#ccc;font-size:16px;justify-content:center;position:absolute}._100,.noData{height:100%;width:100%}.dialog{padding:24px!important;width:860px!important}.factor-content{display:flex;flex-direction:column;flex-wrap:wrap;height:380px;width:100%}.factor_item{width:33.33%}.check_item,.factor_item{display:flex;margin-bottom:10px}.check_item{justify-content:space-between}.flex-alignCnter{align-items:center;cursor:pointer;display:flex}.target-head{display:grid;grid:auto/repeat(5,1fr)}.flow-col{border-left:1px solid #e8e8e8;height:520px;overflow-y:auto;padding-left:10px}.check_item{align-items:center;cursor:grab}.check_item:active{cursor:grabbing}.ghost{background:#f0f0f0;opacity:.5}.close-icon{cursor:pointer}.close-icon:hover{color:#909399!important}.ht-table-wrapper{display:flex;flex-direction:column;height:100%}.ht-table-wrapper .el-table{flex:1;min-height:0}.ht-table-wrapper .el-table__empty-text{line-height:normal}.ht-table-cell-copy{align-items:center;display:inline-flex;gap:4px;width:100%}.ht-table-cell-text{flex:none;max-width:calc(100% - 22px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ht-copy-icon{color:#909399;cursor:pointer;flex-shrink:0;font-size:14px;opacity:0;transition:opacity .2s}.ht-copy-icon:hover{color:#d70c19}.el-table__row:hover .ht-copy-icon{opacity:1}.ht-table-pagination{align-items:center;display:flex;justify-content:flex-end;padding:12px 0}.ht-table-wrapper .el-table__column-filter-trigger .el-icon svg{display:none}.ht-table-wrapper .el-table__column-filter-trigger .el-icon:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath fill='%23909399' d='M384 523.392V928a32 32 0 0 0 46.336 28.608l192-96A32 32 0 0 0 640 832V523.392l280.768-343.104a32 32 0 1 0-49.536-40.576l-288 352A32 32 0 0 0 576 512v300.224l-128 64V512a32 32 0 0 0-7.232-20.288L195.52 192H704a32 32 0 1 0 0-64H128a32 32 0 0 0-24.768 52.288z'/%3E%3C/svg%3E") no-repeat 50%;background-size:contain;content:"";display:inline-block;height:14px;width:14px}
|
package/es/component.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HtTable } from './components/htTable/index.mjs';
|
|
2
2
|
import { HtChart } from './components/chart/index.mjs';
|
|
3
3
|
import { HtPieChart } from './components/pieChart/index.mjs';
|
|
4
4
|
import { HtTarget } from './components/htTarget/index.mjs';
|
|
5
5
|
|
|
6
6
|
var Components = [
|
|
7
|
-
//
|
|
7
|
+
//
|
|
8
8
|
HtChart,
|
|
9
|
-
|
|
9
|
+
HtTable,
|
|
10
10
|
HtPieChart,
|
|
11
11
|
HtTarget
|
|
12
12
|
];
|
|
@@ -75,41 +75,7 @@ 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
|
-
}, {
|
|
79
|
-
props: import("@vue/shared").LooseRequired<{
|
|
80
|
-
readonly chartData: any[];
|
|
81
|
-
readonly chartId: string;
|
|
82
|
-
readonly chartType: import("hfn-components/es/utils").chartType;
|
|
83
|
-
readonly titleText: string;
|
|
84
|
-
readonly titleText2: string;
|
|
85
|
-
readonly xAxisData: string[];
|
|
86
|
-
readonly collation: string;
|
|
87
|
-
readonly isReturn: boolean;
|
|
88
|
-
readonly isPercent: boolean;
|
|
89
|
-
readonly floatNumber: number;
|
|
90
|
-
readonly yAxisUnit: string;
|
|
91
|
-
readonly yAxisObj: Record<string, any>;
|
|
92
|
-
readonly xAxisObj: Record<string, any>;
|
|
93
|
-
readonly tooltipUnit: string;
|
|
94
|
-
readonly watchResize: boolean;
|
|
95
|
-
readonly showLegend: boolean;
|
|
96
|
-
readonly auxiliaryData: Record<string, any>;
|
|
97
|
-
readonly downLoadAutn: boolean;
|
|
98
|
-
readonly lineColor: string[];
|
|
99
|
-
} & {}>;
|
|
100
|
-
myChart: import("vue").ShallowRef<any>;
|
|
101
|
-
isEmpty: import("vue").Ref<boolean>;
|
|
102
|
-
echartOptions: any;
|
|
103
|
-
drawGraph: () => void;
|
|
104
|
-
lengedDeal: () => void;
|
|
105
|
-
echartInit: () => void;
|
|
106
|
-
chartResize: () => void;
|
|
107
|
-
allLegend: import("vue").Ref<import("./src/HtChart.vue").Legend[]>;
|
|
108
|
-
noData: import("vue").Ref<boolean>;
|
|
109
|
-
legendStatus: (item: import("./src/HtChart.vue").Legend, index: number) => void;
|
|
110
|
-
legendEnter: (index: number) => void;
|
|
111
|
-
legendLeave: () => void;
|
|
112
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
78
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
113
79
|
readonly chartData: {
|
|
114
80
|
readonly type: import("vue").PropType<any[]>;
|
|
115
81
|
readonly default: () => never[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Ref } from 'vue';
|
|
2
1
|
export interface Legend {
|
|
3
2
|
name: string;
|
|
4
3
|
lineType: string;
|
|
@@ -82,41 +81,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
81
|
readonly type: import("vue").PropType<string[]>;
|
|
83
82
|
readonly default: readonly [];
|
|
84
83
|
};
|
|
85
|
-
}, {
|
|
86
|
-
props: import("@vue/shared").LooseRequired<{
|
|
87
|
-
readonly chartData: any[];
|
|
88
|
-
readonly chartId: string;
|
|
89
|
-
readonly chartType: import("hfn-components/es/utils").chartType;
|
|
90
|
-
readonly titleText: string;
|
|
91
|
-
readonly titleText2: string;
|
|
92
|
-
readonly xAxisData: string[];
|
|
93
|
-
readonly collation: string;
|
|
94
|
-
readonly isReturn: boolean;
|
|
95
|
-
readonly isPercent: boolean;
|
|
96
|
-
readonly floatNumber: number;
|
|
97
|
-
readonly yAxisUnit: string;
|
|
98
|
-
readonly yAxisObj: Record<string, any>;
|
|
99
|
-
readonly xAxisObj: Record<string, any>;
|
|
100
|
-
readonly tooltipUnit: string;
|
|
101
|
-
readonly watchResize: boolean;
|
|
102
|
-
readonly showLegend: boolean;
|
|
103
|
-
readonly auxiliaryData: Record<string, any>;
|
|
104
|
-
readonly downLoadAutn: boolean;
|
|
105
|
-
readonly lineColor: string[];
|
|
106
|
-
} & {}>;
|
|
107
|
-
myChart: import("vue").ShallowRef<any>;
|
|
108
|
-
isEmpty: Ref<boolean>;
|
|
109
|
-
echartOptions: any;
|
|
110
|
-
drawGraph: () => void;
|
|
111
|
-
lengedDeal: () => void;
|
|
112
|
-
echartInit: () => void;
|
|
113
|
-
chartResize: () => void;
|
|
114
|
-
allLegend: Ref<Legend[]>;
|
|
115
|
-
noData: Ref<boolean>;
|
|
116
|
-
legendStatus: (item: Legend, index: number) => void;
|
|
117
|
-
legendEnter: (index: number) => void;
|
|
118
|
-
legendLeave: () => void;
|
|
119
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
84
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
120
85
|
readonly chartData: {
|
|
121
86
|
readonly type: import("vue").PropType<any[]>;
|
|
122
87
|
readonly default: () => never[];
|
|
@@ -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/
|
|
88
|
+
var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/chart/src/HtChart.vue"]]);
|
|
89
89
|
|
|
90
90
|
export { chart as default };
|
|
@@ -6,6 +6,9 @@ import { setEchartTitle, setEchartXAxis, setEchartYAxis, setEchartTooltip, legen
|
|
|
6
6
|
import * as echarts from 'echarts/core';
|
|
7
7
|
|
|
8
8
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "HtChart"
|
|
11
|
+
},
|
|
9
12
|
__name: "HtChart",
|
|
10
13
|
props: chartProps,
|
|
11
14
|
setup(__props, { expose: __expose }) {
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
export declare const HtTable: import("hfn-components/es/utils").SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
readonly dataSource: {
|
|
4
|
+
readonly type: ArrayConstructor;
|
|
5
|
+
readonly default: () => never[];
|
|
6
|
+
};
|
|
7
|
+
readonly tableColumn: {
|
|
8
|
+
readonly type: import("vue").PropType<import("./src/htTable").ElTableColumns[]>;
|
|
9
|
+
readonly default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
readonly loading: {
|
|
12
|
+
readonly type: BooleanConstructor;
|
|
13
|
+
readonly default: false;
|
|
14
|
+
};
|
|
15
|
+
readonly headerColor: {
|
|
16
|
+
readonly type: StringConstructor;
|
|
17
|
+
readonly default: "#f0f0f0";
|
|
18
|
+
};
|
|
19
|
+
readonly resizable: {
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly default: true;
|
|
22
|
+
};
|
|
23
|
+
readonly selectable: {
|
|
24
|
+
readonly type: BooleanConstructor;
|
|
25
|
+
readonly default: false;
|
|
26
|
+
};
|
|
27
|
+
readonly rowKey: {
|
|
28
|
+
readonly type: StringConstructor;
|
|
29
|
+
readonly default: "";
|
|
30
|
+
};
|
|
31
|
+
readonly selectedRows: {
|
|
32
|
+
readonly type: ArrayConstructor;
|
|
33
|
+
readonly default: () => never[];
|
|
34
|
+
};
|
|
35
|
+
readonly pagination: {
|
|
36
|
+
readonly type: import("vue").PropType<import("./src/htTable").PaginationConfig>;
|
|
37
|
+
readonly default: undefined;
|
|
38
|
+
};
|
|
39
|
+
}>> & {
|
|
40
|
+
"onSelection-change"?: ((rows: any[]) => any) | undefined;
|
|
41
|
+
"onSort-change"?: ((args_0: {
|
|
42
|
+
field: string;
|
|
43
|
+
order: "ascending" | "descending" | null;
|
|
44
|
+
}) => any) | undefined;
|
|
45
|
+
"onFilter-change"?: ((args_0: Record<string, string[]>) => any) | undefined;
|
|
46
|
+
"onPage-change"?: ((current: number) => any) | undefined;
|
|
47
|
+
"onSize-change"?: ((pageSize: number) => any) | undefined;
|
|
48
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
49
|
+
"selection-change": (rows: any[]) => void;
|
|
50
|
+
"sort-change": (args_0: {
|
|
51
|
+
field: string;
|
|
52
|
+
order: "ascending" | "descending" | null;
|
|
53
|
+
}) => void;
|
|
54
|
+
"filter-change": (args_0: Record<string, string[]>) => void;
|
|
55
|
+
"page-change": (current: number) => void;
|
|
56
|
+
"size-change": (pageSize: number) => void;
|
|
57
|
+
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
readonly dataSource: {
|
|
59
|
+
readonly type: ArrayConstructor;
|
|
60
|
+
readonly default: () => never[];
|
|
61
|
+
};
|
|
62
|
+
readonly tableColumn: {
|
|
63
|
+
readonly type: import("vue").PropType<import("./src/htTable").ElTableColumns[]>;
|
|
64
|
+
readonly default: () => never[];
|
|
65
|
+
};
|
|
66
|
+
readonly loading: {
|
|
67
|
+
readonly type: BooleanConstructor;
|
|
68
|
+
readonly default: false;
|
|
69
|
+
};
|
|
70
|
+
readonly headerColor: {
|
|
71
|
+
readonly type: StringConstructor;
|
|
72
|
+
readonly default: "#f0f0f0";
|
|
73
|
+
};
|
|
74
|
+
readonly resizable: {
|
|
75
|
+
readonly type: BooleanConstructor;
|
|
76
|
+
readonly default: true;
|
|
77
|
+
};
|
|
78
|
+
readonly selectable: {
|
|
79
|
+
readonly type: BooleanConstructor;
|
|
80
|
+
readonly default: false;
|
|
81
|
+
};
|
|
82
|
+
readonly rowKey: {
|
|
83
|
+
readonly type: StringConstructor;
|
|
84
|
+
readonly default: "";
|
|
85
|
+
};
|
|
86
|
+
readonly selectedRows: {
|
|
87
|
+
readonly type: ArrayConstructor;
|
|
88
|
+
readonly default: () => never[];
|
|
89
|
+
};
|
|
90
|
+
readonly pagination: {
|
|
91
|
+
readonly type: import("vue").PropType<import("./src/htTable").PaginationConfig>;
|
|
92
|
+
readonly default: undefined;
|
|
93
|
+
};
|
|
94
|
+
}>> & {
|
|
95
|
+
"onSelection-change"?: ((rows: any[]) => any) | undefined;
|
|
96
|
+
"onSort-change"?: ((args_0: {
|
|
97
|
+
field: string;
|
|
98
|
+
order: "ascending" | "descending" | null;
|
|
99
|
+
}) => any) | undefined;
|
|
100
|
+
"onFilter-change"?: ((args_0: Record<string, string[]>) => any) | undefined;
|
|
101
|
+
"onPage-change"?: ((current: number) => any) | undefined;
|
|
102
|
+
"onSize-change"?: ((pageSize: number) => any) | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
readonly dataSource: unknown[];
|
|
105
|
+
readonly tableColumn: import("./src/htTable").ElTableColumns[];
|
|
106
|
+
readonly loading: boolean;
|
|
107
|
+
readonly headerColor: string;
|
|
108
|
+
readonly resizable: boolean;
|
|
109
|
+
readonly selectable: boolean;
|
|
110
|
+
readonly rowKey: string;
|
|
111
|
+
readonly selectedRows: unknown[];
|
|
112
|
+
readonly pagination: import("./src/htTable").PaginationConfig;
|
|
113
|
+
}, true, {}, {}, {
|
|
114
|
+
P: {};
|
|
115
|
+
B: {};
|
|
116
|
+
D: {};
|
|
117
|
+
C: {};
|
|
118
|
+
M: {};
|
|
119
|
+
Defaults: {};
|
|
120
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
121
|
+
readonly dataSource: {
|
|
122
|
+
readonly type: ArrayConstructor;
|
|
123
|
+
readonly default: () => never[];
|
|
124
|
+
};
|
|
125
|
+
readonly tableColumn: {
|
|
126
|
+
readonly type: import("vue").PropType<import("./src/htTable").ElTableColumns[]>;
|
|
127
|
+
readonly default: () => never[];
|
|
128
|
+
};
|
|
129
|
+
readonly loading: {
|
|
130
|
+
readonly type: BooleanConstructor;
|
|
131
|
+
readonly default: false;
|
|
132
|
+
};
|
|
133
|
+
readonly headerColor: {
|
|
134
|
+
readonly type: StringConstructor;
|
|
135
|
+
readonly default: "#f0f0f0";
|
|
136
|
+
};
|
|
137
|
+
readonly resizable: {
|
|
138
|
+
readonly type: BooleanConstructor;
|
|
139
|
+
readonly default: true;
|
|
140
|
+
};
|
|
141
|
+
readonly selectable: {
|
|
142
|
+
readonly type: BooleanConstructor;
|
|
143
|
+
readonly default: false;
|
|
144
|
+
};
|
|
145
|
+
readonly rowKey: {
|
|
146
|
+
readonly type: StringConstructor;
|
|
147
|
+
readonly default: "";
|
|
148
|
+
};
|
|
149
|
+
readonly selectedRows: {
|
|
150
|
+
readonly type: ArrayConstructor;
|
|
151
|
+
readonly default: () => never[];
|
|
152
|
+
};
|
|
153
|
+
readonly pagination: {
|
|
154
|
+
readonly type: import("vue").PropType<import("./src/htTable").PaginationConfig>;
|
|
155
|
+
readonly default: undefined;
|
|
156
|
+
};
|
|
157
|
+
}>> & {
|
|
158
|
+
"onSelection-change"?: ((rows: any[]) => any) | undefined;
|
|
159
|
+
"onSort-change"?: ((args_0: {
|
|
160
|
+
field: string;
|
|
161
|
+
order: "ascending" | "descending" | null;
|
|
162
|
+
}) => any) | undefined;
|
|
163
|
+
"onFilter-change"?: ((args_0: Record<string, string[]>) => any) | undefined;
|
|
164
|
+
"onPage-change"?: ((current: number) => any) | undefined;
|
|
165
|
+
"onSize-change"?: ((pageSize: number) => any) | undefined;
|
|
166
|
+
}, {}, {}, {}, {}, {
|
|
167
|
+
readonly dataSource: unknown[];
|
|
168
|
+
readonly tableColumn: import("./src/htTable").ElTableColumns[];
|
|
169
|
+
readonly loading: boolean;
|
|
170
|
+
readonly headerColor: string;
|
|
171
|
+
readonly resizable: boolean;
|
|
172
|
+
readonly selectable: boolean;
|
|
173
|
+
readonly rowKey: string;
|
|
174
|
+
readonly selectedRows: unknown[];
|
|
175
|
+
readonly pagination: import("./src/htTable").PaginationConfig;
|
|
176
|
+
}>;
|
|
177
|
+
__isFragment?: never;
|
|
178
|
+
__isTeleport?: never;
|
|
179
|
+
__isSuspense?: never;
|
|
180
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
181
|
+
readonly dataSource: {
|
|
182
|
+
readonly type: ArrayConstructor;
|
|
183
|
+
readonly default: () => never[];
|
|
184
|
+
};
|
|
185
|
+
readonly tableColumn: {
|
|
186
|
+
readonly type: import("vue").PropType<import("./src/htTable").ElTableColumns[]>;
|
|
187
|
+
readonly default: () => never[];
|
|
188
|
+
};
|
|
189
|
+
readonly loading: {
|
|
190
|
+
readonly type: BooleanConstructor;
|
|
191
|
+
readonly default: false;
|
|
192
|
+
};
|
|
193
|
+
readonly headerColor: {
|
|
194
|
+
readonly type: StringConstructor;
|
|
195
|
+
readonly default: "#f0f0f0";
|
|
196
|
+
};
|
|
197
|
+
readonly resizable: {
|
|
198
|
+
readonly type: BooleanConstructor;
|
|
199
|
+
readonly default: true;
|
|
200
|
+
};
|
|
201
|
+
readonly selectable: {
|
|
202
|
+
readonly type: BooleanConstructor;
|
|
203
|
+
readonly default: false;
|
|
204
|
+
};
|
|
205
|
+
readonly rowKey: {
|
|
206
|
+
readonly type: StringConstructor;
|
|
207
|
+
readonly default: "";
|
|
208
|
+
};
|
|
209
|
+
readonly selectedRows: {
|
|
210
|
+
readonly type: ArrayConstructor;
|
|
211
|
+
readonly default: () => never[];
|
|
212
|
+
};
|
|
213
|
+
readonly pagination: {
|
|
214
|
+
readonly type: import("vue").PropType<import("./src/htTable").PaginationConfig>;
|
|
215
|
+
readonly default: undefined;
|
|
216
|
+
};
|
|
217
|
+
}>> & {
|
|
218
|
+
"onSelection-change"?: ((rows: any[]) => any) | undefined;
|
|
219
|
+
"onSort-change"?: ((args_0: {
|
|
220
|
+
field: string;
|
|
221
|
+
order: "ascending" | "descending" | null;
|
|
222
|
+
}) => any) | undefined;
|
|
223
|
+
"onFilter-change"?: ((args_0: Record<string, string[]>) => any) | undefined;
|
|
224
|
+
"onPage-change"?: ((current: number) => any) | undefined;
|
|
225
|
+
"onSize-change"?: ((pageSize: number) => any) | undefined;
|
|
226
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
227
|
+
"selection-change": (rows: any[]) => void;
|
|
228
|
+
"sort-change": (args_0: {
|
|
229
|
+
field: string;
|
|
230
|
+
order: "ascending" | "descending" | null;
|
|
231
|
+
}) => void;
|
|
232
|
+
"filter-change": (args_0: Record<string, string[]>) => void;
|
|
233
|
+
"page-change": (current: number) => void;
|
|
234
|
+
"size-change": (pageSize: number) => void;
|
|
235
|
+
}, string, {
|
|
236
|
+
readonly dataSource: unknown[];
|
|
237
|
+
readonly tableColumn: import("./src/htTable").ElTableColumns[];
|
|
238
|
+
readonly loading: boolean;
|
|
239
|
+
readonly headerColor: string;
|
|
240
|
+
readonly resizable: boolean;
|
|
241
|
+
readonly selectable: boolean;
|
|
242
|
+
readonly rowKey: string;
|
|
243
|
+
readonly selectedRows: unknown[];
|
|
244
|
+
readonly pagination: import("./src/htTable").PaginationConfig;
|
|
245
|
+
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
246
|
+
$slots: Partial<Record<string, (_: {}) => any>> & Partial<Record<string, (_: {
|
|
247
|
+
text: any;
|
|
248
|
+
row: any;
|
|
249
|
+
}) => any>>;
|
|
250
|
+
})> & Record<string, any>;
|
|
251
|
+
export default HtTable;
|
|
252
|
+
export * from './src/htTable';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import elTable from './src/htTable.vue.mjs';
|
|
2
|
+
import { withInstall } from '../../utils/common.mjs';
|
|
3
|
+
import '../../constants/chartConfig.mjs';
|
|
4
|
+
export { columnDealProps, elTableProps } from './src/htTable.mjs';
|
|
5
|
+
|
|
6
|
+
const HtTable = withInstall(elTable);
|
|
7
|
+
|
|
8
|
+
export { HtTable, HtTable as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
readonly dealType: {
|
|
3
|
+
readonly type: import("vue").PropType<import("hfn-components/es/constants").dealKeyType>;
|
|
4
|
+
readonly default: "";
|
|
5
|
+
};
|
|
6
|
+
readonly text: {
|
|
7
|
+
readonly type: import("vue").PropType<string | number | undefined>;
|
|
8
|
+
readonly default: undefined;
|
|
9
|
+
};
|
|
10
|
+
readonly dealFunction: {
|
|
11
|
+
readonly type: FunctionConstructor;
|
|
12
|
+
readonly default: () => void;
|
|
13
|
+
};
|
|
14
|
+
readonly row: {
|
|
15
|
+
readonly type: ObjectConstructor;
|
|
16
|
+
readonly default: () => void;
|
|
17
|
+
};
|
|
18
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
readonly dealType: {
|
|
20
|
+
readonly type: import("vue").PropType<import("hfn-components/es/constants").dealKeyType>;
|
|
21
|
+
readonly default: "";
|
|
22
|
+
};
|
|
23
|
+
readonly text: {
|
|
24
|
+
readonly type: import("vue").PropType<string | number | undefined>;
|
|
25
|
+
readonly default: undefined;
|
|
26
|
+
};
|
|
27
|
+
readonly dealFunction: {
|
|
28
|
+
readonly type: FunctionConstructor;
|
|
29
|
+
readonly default: () => void;
|
|
30
|
+
};
|
|
31
|
+
readonly row: {
|
|
32
|
+
readonly type: ObjectConstructor;
|
|
33
|
+
readonly default: () => void;
|
|
34
|
+
};
|
|
35
|
+
}>>, {
|
|
36
|
+
readonly text: string | number | undefined;
|
|
37
|
+
readonly dealType: "colorPercentage" | "percentage" | "basicText4" | "notProcessed" | "colorText" | "percentage4" | "absPercentage" | "thousandText2" | "thousandText4" | "other" | "customDeal" | "customSlot";
|
|
38
|
+
readonly dealFunction: Function;
|
|
39
|
+
readonly row: Record<string, any>;
|
|
40
|
+
}, {}>;
|
|
41
|
+
export default _default;
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import _sfc_main from './columnDeal.vue2.mjs';
|
|
2
|
-
import { openBlock, createElementBlock, toDisplayString, createElementVNode, normalizeStyle
|
|
2
|
+
import { openBlock, createElementBlock, toDisplayString, createElementVNode, normalizeStyle } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { key: 0 };
|
|
6
6
|
const _hoisted_2 = { key: 1 };
|
|
7
|
-
const _hoisted_3 =
|
|
8
|
-
const _hoisted_4 =
|
|
7
|
+
const _hoisted_3 = { key: 2 };
|
|
8
|
+
const _hoisted_4 = ["innerHTML"];
|
|
9
9
|
const _hoisted_5 = { key: 4 };
|
|
10
10
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
-
return _ctx.dealType === "notProcessed"
|
|
12
|
-
"
|
|
11
|
+
return _ctx.dealType === "notProcessed" ? (openBlock(), createElementBlock(
|
|
12
|
+
"span",
|
|
13
13
|
_hoisted_1,
|
|
14
|
-
toDisplayString(_ctx.text),
|
|
14
|
+
toDisplayString(_ctx.text ?? "-"),
|
|
15
15
|
1
|
|
16
16
|
/* TEXT */
|
|
17
|
-
)) : _ctx.dealType === "
|
|
17
|
+
)) : _ctx.dealType === "other" ? (openBlock(), createElementBlock(
|
|
18
|
+
"span",
|
|
19
|
+
_hoisted_2,
|
|
20
|
+
toDisplayString(_ctx.text ?? "-"),
|
|
21
|
+
1
|
|
22
|
+
/* TEXT */
|
|
23
|
+
)) : _ctx.dealType === "colorText" || _ctx.dealType === "colorPercentage" ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
18
24
|
createElementVNode(
|
|
19
25
|
"span",
|
|
20
26
|
{
|
|
@@ -24,19 +30,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
24
30
|
5
|
|
25
31
|
/* TEXT, STYLE */
|
|
26
32
|
)
|
|
27
|
-
])) : _ctx.dealType === "customDeal" ? (openBlock(), createElementBlock("
|
|
28
|
-
key:
|
|
33
|
+
])) : _ctx.dealType === "customDeal" ? (openBlock(), createElementBlock("span", {
|
|
34
|
+
key: 3,
|
|
29
35
|
innerHTML: _ctx.dealFunction(_ctx.row, _ctx.text)
|
|
30
|
-
}, null, 8,
|
|
31
|
-
|
|
32
|
-
])) : (openBlock(), createElementBlock(
|
|
33
|
-
"div",
|
|
36
|
+
}, null, 8, _hoisted_4)) : (openBlock(), createElementBlock(
|
|
37
|
+
"span",
|
|
34
38
|
_hoisted_5,
|
|
35
39
|
toDisplayString(_ctx.text !== void 0 ? $setup.CLOUMN_DEAL[_ctx.dealType](_ctx.text) : "-"),
|
|
36
40
|
1
|
|
37
41
|
/* TEXT */
|
|
38
42
|
));
|
|
39
43
|
}
|
|
40
|
-
var ColumnDeal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
44
|
+
var ColumnDeal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/htTable/src/columnDeal.vue"]]);
|
|
41
45
|
|
|
42
46
|
export { ColumnDeal as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import { CLOUMN_DEAL } from '../../../constants/table.mjs';
|
|
3
3
|
import '../../../constants/chartConfig.mjs';
|
|
4
|
-
import { columnDealProps } from './
|
|
4
|
+
import { columnDealProps } from './htTable.mjs';
|
|
5
5
|
|
|
6
6
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "columnDeal",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElMessage } from 'element-plus';
|
|
2
|
+
|
|
3
|
+
function useCopy() {
|
|
4
|
+
const handleCopy = async (text) => {
|
|
5
|
+
if (text === void 0 || text === null) return;
|
|
6
|
+
try {
|
|
7
|
+
await navigator.clipboard.writeText(String(text));
|
|
8
|
+
ElMessage.success({ message: "\u590D\u5236\u6210\u529F", offset: window.innerHeight / 3, plain: true });
|
|
9
|
+
} catch {
|
|
10
|
+
const textarea = document.createElement("textarea");
|
|
11
|
+
textarea.value = String(text);
|
|
12
|
+
textarea.style.position = "fixed";
|
|
13
|
+
textarea.style.opacity = "0";
|
|
14
|
+
document.body.appendChild(textarea);
|
|
15
|
+
textarea.select();
|
|
16
|
+
document.execCommand("copy");
|
|
17
|
+
document.body.removeChild(textarea);
|
|
18
|
+
ElMessage.success({ message: "\u590D\u5236\u6210\u529F", offset: window.innerHeight / 3, plain: true });
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return { handleCopy };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { useCopy };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PaginationConfig } from '../htTable';
|
|
2
|
+
interface UsePaginationOptions {
|
|
3
|
+
pagination: () => PaginationConfig | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function usePagination(options: UsePaginationOptions): {
|
|
6
|
+
currentPage: import("vue").ComputedRef<number>;
|
|
7
|
+
pageSize: import("vue").ComputedRef<number>;
|
|
8
|
+
total: import("vue").ComputedRef<number>;
|
|
9
|
+
getRowIndex: (index: number) => number;
|
|
10
|
+
handleCurrentChange: (page: number, emit: (event: "page-change", payload: number) => void) => void;
|
|
11
|
+
handleSizeChange: (size: number, emit: (event: "size-change", payload: number) => void) => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
|
|
3
|
+
function usePagination(options) {
|
|
4
|
+
const { pagination } = options;
|
|
5
|
+
const currentPage = computed(() => {
|
|
6
|
+
return pagination()?.current || 1;
|
|
7
|
+
});
|
|
8
|
+
const pageSize = computed(() => {
|
|
9
|
+
return pagination()?.pageSize || 10;
|
|
10
|
+
});
|
|
11
|
+
const total = computed(() => {
|
|
12
|
+
return pagination()?.total || 0;
|
|
13
|
+
});
|
|
14
|
+
const getRowIndex = (index) => {
|
|
15
|
+
return (currentPage.value - 1) * pageSize.value + index + 1;
|
|
16
|
+
};
|
|
17
|
+
const handleCurrentChange = (page, emit) => {
|
|
18
|
+
emit("page-change", page);
|
|
19
|
+
};
|
|
20
|
+
const handleSizeChange = (size, emit) => {
|
|
21
|
+
emit("size-change", size);
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
currentPage,
|
|
25
|
+
pageSize,
|
|
26
|
+
total,
|
|
27
|
+
getRowIndex,
|
|
28
|
+
handleCurrentChange,
|
|
29
|
+
handleSizeChange
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { usePagination };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import type { ElTable } from 'element-plus';
|
|
3
|
+
interface UseSelectionOptions {
|
|
4
|
+
tableRef: Ref<InstanceType<typeof ElTable> | undefined>;
|
|
5
|
+
dataSource: () => any[];
|
|
6
|
+
selectedRows: () => any[];
|
|
7
|
+
rowKey: () => string;
|
|
8
|
+
}
|
|
9
|
+
export declare function useSelection(options: UseSelectionOptions, onSelectionChange: (rows: any[]) => void): {
|
|
10
|
+
handleSelectionChange: (rows: any[]) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|