hfn-components 0.1.4 → 0.1.5

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.
@@ -11,11 +11,16 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
11
11
  readonly type: BooleanConstructor;
12
12
  readonly default: false;
13
13
  };
14
+ readonly headerColor: {
15
+ readonly type: StringConstructor;
16
+ readonly default: "#f0f0f0";
17
+ };
14
18
  }, {
15
19
  props: import("@vue/shared").LooseRequired<{
16
20
  readonly loading: boolean;
17
21
  readonly dataSource: unknown[];
18
22
  readonly tableColumn: import("./src/elTable").ElTableColumns[];
23
+ readonly headerColor: string;
19
24
  } & {}>;
20
25
  readonly ElTable: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
21
26
  data: {
@@ -632,6 +637,7 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
632
637
  readonly MonthlyPositiveRatio: "月胜率";
633
638
  readonly all_year: "全年";
634
639
  };
640
+ readonly convertKey: (data: any, key: string) => any;
635
641
  ColumnDeal: import("vue").DefineComponent<{
636
642
  readonly dealType: {
637
643
  readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
@@ -679,10 +685,15 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
679
685
  readonly type: BooleanConstructor;
680
686
  readonly default: false;
681
687
  };
688
+ readonly headerColor: {
689
+ readonly type: StringConstructor;
690
+ readonly default: "#f0f0f0";
691
+ };
682
692
  }>>, {
683
693
  readonly loading: boolean;
684
694
  readonly dataSource: unknown[];
685
695
  readonly tableColumn: import("./src/elTable").ElTableColumns[];
696
+ readonly headerColor: string;
686
697
  }, {}>> & Record<string, any>;
687
698
  export default HtElTable;
688
699
  export * from './src/elTable';
@@ -18,6 +18,10 @@ export declare const elTableProps: {
18
18
  readonly type: BooleanConstructor;
19
19
  readonly default: false;
20
20
  };
21
+ readonly headerColor: {
22
+ readonly type: StringConstructor;
23
+ readonly default: "#f0f0f0";
24
+ };
21
25
  };
22
26
  export declare const columnDealProps: {
23
27
  readonly dealType: {
@@ -10,6 +10,10 @@ const elTableProps = {
10
10
  loading: {
11
11
  type: Boolean,
12
12
  default: false
13
+ },
14
+ headerColor: {
15
+ type: String,
16
+ default: "#f0f0f0"
13
17
  }
14
18
  };
15
19
  const columnDealProps = {
@@ -11,11 +11,16 @@ declare const _default: import("vue").DefineComponent<{
11
11
  readonly type: BooleanConstructor;
12
12
  readonly default: false;
13
13
  };
14
+ readonly headerColor: {
15
+ readonly type: StringConstructor;
16
+ readonly default: "#f0f0f0";
17
+ };
14
18
  }, {
15
19
  props: import("@vue/shared").LooseRequired<{
16
20
  readonly loading: boolean;
17
21
  readonly dataSource: unknown[];
18
22
  readonly tableColumn: import("./elTable").ElTableColumns[];
23
+ readonly headerColor: string;
19
24
  } & {}>;
20
25
  readonly ElTable: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
21
26
  data: {
@@ -632,6 +637,7 @@ declare const _default: import("vue").DefineComponent<{
632
637
  readonly MonthlyPositiveRatio: "月胜率";
633
638
  readonly all_year: "全年";
634
639
  };
640
+ readonly convertKey: (data: any, key: string) => any;
635
641
  ColumnDeal: import("vue").DefineComponent<{
636
642
  readonly dealType: {
637
643
  readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
@@ -679,9 +685,14 @@ declare const _default: import("vue").DefineComponent<{
679
685
  readonly type: BooleanConstructor;
680
686
  readonly default: false;
681
687
  };
688
+ readonly headerColor: {
689
+ readonly type: StringConstructor;
690
+ readonly default: "#f0f0f0";
691
+ };
682
692
  }>>, {
683
693
  readonly loading: boolean;
684
694
  readonly dataSource: unknown[];
685
695
  readonly tableColumn: import("./elTable").ElTableColumns[];
696
+ readonly headerColor: string;
686
697
  }, {}>;
687
698
  export default _default;
@@ -8,7 +8,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8
8
  style: { "width": "100%" },
9
9
  height: "100%",
10
10
  "header-cell-style": {
11
- background: "#f0f0f0",
11
+ background: $setup.props.headerColor,
12
12
  color: "#000",
13
13
  "font-weight": 500,
14
14
  "font-size": "12px"
@@ -28,7 +28,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
28
28
  default: withCtx((scope) => [
29
29
  createVNode($setup["ColumnDeal"], {
30
30
  dealType: item.dealType,
31
- text: scope.row[item.key]
31
+ text: $setup.convertKey(scope.row, item.key)
32
32
  }, null, 8, ["dealType", "text"])
33
33
  ]),
34
34
  _: 2
@@ -41,7 +41,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
41
41
  ]),
42
42
  _: 1
43
43
  /* STABLE */
44
- }, 8, ["data"])), [
44
+ }, 8, ["data", "header-cell-style"])), [
45
45
  [$setup["vLoading"], $setup.props.loading]
46
46
  ]);
47
47
  }
@@ -1,6 +1,6 @@
1
1
  import { defineComponent } from 'vue';
2
2
  import { ElTable, ElTableColumn, vLoading } from 'element-plus';
3
- import { TABLE_KEY } from '../../../constants/table.mjs';
3
+ import { TABLE_KEY, convertKey } from '../../../constants/table.mjs';
4
4
  import ColumnDeal from './columnDeal.vue.mjs';
5
5
  import { elTableProps } from './elTable.mjs';
6
6
 
@@ -18,6 +18,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  return vLoading;
19
19
  }, get TABLE_KEY() {
20
20
  return TABLE_KEY;
21
+ }, get convertKey() {
22
+ return convertKey;
21
23
  }, ColumnDeal };
22
24
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
23
25
  return __returned__;
@@ -1,2 +1,2 @@
1
1
  export { INSTALLED_KEY } from './key.mjs';
2
- export { CLOUMN_DEAL, TABLE_KEY } from './table.mjs';
2
+ export { CLOUMN_DEAL, TABLE_KEY, convertKey } from './table.mjs';
@@ -41,5 +41,6 @@ export declare const CLOUMN_DEAL: {
41
41
  percentage: (val: number | string | undefined) => string;
42
42
  notProcessed: null;
43
43
  };
44
+ export declare const convertKey: (data: any, key: string) => any;
44
45
  export type clounmKyeType = keyof typeof TABLE_KEY;
45
46
  export type dealKeyType = keyof typeof CLOUMN_DEAL;
@@ -47,5 +47,9 @@ const CLOUMN_DEAL = {
47
47
  percentage,
48
48
  notProcessed: null
49
49
  };
50
+ const convertKey = (data, key) => {
51
+ const newKey = key.replace(/([A-Z])/g, "_$1").toLowerCase();
52
+ return data[key] || data[newKey];
53
+ };
50
54
 
51
- export { CLOUMN_DEAL, TABLE_KEY };
55
+ export { CLOUMN_DEAL, TABLE_KEY, convertKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",