@skalfa/skalfa-component 1.0.3 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { ApiFilterType } from "@utils";
2
+ import { ApiFilterType, conversion } from "@utils";
3
3
  import { ControlBarOptionType } from "./ControlBar.component";
4
4
  import { PaginationProps } from "./Pagination.component";
5
5
  import { SwipeActionType } from "../wrap/Swipe.component";
@@ -18,6 +18,7 @@ export interface TableColumnType {
18
18
  value: any;
19
19
  }[];
20
20
  };
21
+ conversion?: keyof typeof conversion;
21
22
  className?: string;
22
23
  item?: (data: any) => string | ReactNode;
23
24
  tip?: string | ((data: any) => string);
@@ -49,7 +49,10 @@ function TableComponent({ id, controlBar, columns, data, pagination, loading, so
49
49
  if (column?.item) {
50
50
  return column.item(item);
51
51
  }
52
- const value = item[column.selector];
52
+ let value = item[column.selector];
53
+ if (column.conversion && _utils_1.conversion[column.conversion]) {
54
+ value = _utils_1.conversion[column.conversion](value);
55
+ }
53
56
  if ((0, react_1.isValidElement)(value)) {
54
57
  return value;
55
58
  }
package/package.json CHANGED
@@ -1,37 +1,30 @@
1
1
  {
2
2
  "name": "@skalfa/skalfa-component",
3
- "version": "1.0.3",
4
- "description": "Core reusable UI components for Skalfa applications.",
3
+ "version": "1.0.5",
4
+ "description": "Reusable UI components for Skalfa App.",
5
+ "license": "MIT",
6
+ "keywords": ["skalfa", "skalfa-app", "skalfa-component", "next-framework", "next-template"],
5
7
  "main": "dist/index.js",
6
8
  "types": "dist/index.d.ts",
7
- "files": [
8
- "dist"
9
- ],
9
+ "files": ["dist"],
10
10
  "scripts": {
11
11
  "build": "tsc -p tsconfig.json",
12
12
  "postbuild": "bun fix-exports.js"
13
13
  },
14
- "keywords": [
15
- "skalfa",
16
- "components",
17
- "ui"
18
- ],
19
- "author": "",
20
- "license": "MIT",
21
14
  "peerDependencies": {
15
+ "@skalfa/skalfa-app-core": "*",
22
16
  "@fortawesome/react-fontawesome": "^0.2.2",
23
- "@skalfa/skalfa-app-core": "^1.0.11",
24
17
  "next": "^15.0.0 || ^16.0.0",
25
18
  "react": "^19.0.0",
26
19
  "react-dom": "^19.0.0"
27
20
  },
28
21
  "devDependencies": {
22
+ "@skalfa/skalfa-app-core": "*",
29
23
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
30
24
  "@fortawesome/free-brands-svg-icons": "^6.7.2",
31
25
  "@fortawesome/free-regular-svg-icons": "^6.7.2",
32
26
  "@fortawesome/free-solid-svg-icons": "^6.7.2",
33
27
  "@fortawesome/react-fontawesome": "^0.2.2",
34
- "@skalfa/skalfa-app-core": "^1.0.7",
35
28
  "@react-google-maps/api": "^2.20.7",
36
29
  "@types/google.maps": "^3.58.1",
37
30
  "@types/node": "^20.0.0",