schummar-table 0.12.5 → 0.13.1

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.
@@ -4,4 +4,4 @@ export declare function Virtualized<T>({ header, footer, children, ...props }: {
4
4
  header: ReactNode;
5
5
  footer: ReactNode;
6
6
  children: (itemIds: Id[], startIndex: number) => ReactNode;
7
- } & HTMLProps<HTMLDivElement>): JSX.Element;
7
+ } & Omit<HTMLProps<HTMLDivElement>, 'children'>): JSX.Element;
@@ -13,7 +13,7 @@ export declare type KeyOfType<T, S> = {
13
13
  }[keyof T];
14
14
  export declare type FunctionWithDeps<F extends (...args: any[]) => any> = F | [function: F, ...deps: DependencyList];
15
15
  export declare type MemoizedFunctions<T> = {
16
- [K in keyof T]: Exclude<T[K], [function: (...args: any[]) => any, ...deps: DependencyList[]]>;
16
+ [K in keyof T]: Exclude<T[K], [function: (...args: any[]) => any, ...deps: DependencyList]>;
17
17
  };
18
18
  export interface TableTheme<T = unknown> {
19
19
  /** Define display texts. */
@@ -139,6 +139,8 @@ export interface TableProps<T> extends PartialTableTheme<T> {
139
139
  onSortChange?: (sort: Sort[]) => void;
140
140
  /** Handle sorting externally, e.g. server side */
141
141
  externalSort?: boolean;
142
+ /** Disable sort for all columns (can be override per column) */
143
+ disableSort?: boolean;
142
144
  /** Default selection. */
143
145
  defaultSelection?: Set<Id>;
144
146
  /** If given, controls the selection. */
@@ -253,9 +255,9 @@ export declare type Column<T, V> = {
253
255
  */
254
256
  id?: string;
255
257
  /** Render table header for this column. */
256
- header?: ReactNode | FunctionWithDeps<(values: V[], items: T[]) => ReactNode>;
258
+ header?: ReactNode;
257
259
  /** Render table header for this column. */
258
- footer?: ReactNode | FunctionWithDeps<(values: V[], items: T[]) => ReactNode>;
260
+ footer?: ReactNode;
259
261
  /** Extract value for this column */
260
262
  value: FunctionWithDeps<(item: T) => V>;
261
263
  /** Render table cell. If not provided, a string representation of the value will be rendered. */
@@ -264,6 +266,8 @@ export declare type Column<T, V> = {
264
266
  exportCell?: (value: V, item: T) => string | number;
265
267
  /** Customize sort criteria. By default it will be the value itself in case it's a number or Date, or a string representation of the value otherwise. */
266
268
  sortBy?: FunctionWithDeps<(value: V, item: T) => unknown>[];
269
+ /** Disable sort for this column */
270
+ disableSort?: boolean;
267
271
  /** Set filter component that will be displayed in the column header */
268
272
  filter?: ReactNode;
269
273
  /** Prevent hiding the column. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schummar-table",
3
3
  "repository": "schummar/schummar-table",
4
- "version": "0.12.5",
4
+ "version": "0.13.1",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -45,15 +45,15 @@
45
45
  "license": "ISC",
46
46
  "scripts": {
47
47
  "start": "npm -w docs start",
48
- "build": "runp build:clean :p build:compile:* :s build:cjsPackage",
48
+ "build": "npm-run-all build:clean -p build:compile:* -s build:cjsPackage",
49
49
  "build:clean": "rimraf \"dist/**/*\"",
50
50
  "build:compile:js": "vite build",
51
51
  "build:compile:types": "tsc",
52
52
  "build:cjsPackage": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
53
- "lint": "runp lint:*",
53
+ "lint": "run-p lint:*",
54
54
  "lint:eslint": "eslint src",
55
55
  "lint:tsc": "tsc --emitDeclarationOnly false --noEmit",
56
- "prepublishOnly": "runp :s lint build",
56
+ "prepublishOnly": "run-s lint build",
57
57
  "docs:build": "npm -w docs run build"
58
58
  },
59
59
  "dependencies": {
@@ -63,8 +63,8 @@
63
63
  "schummar-state": "0.2.1-experimental-13"
64
64
  },
65
65
  "peerDependencies": {
66
- "@material-ui/core": "^4.12.3",
67
- "@mui/material": "^5.4.0",
66
+ "@material-ui/core": ">=4",
67
+ "@mui/material": ">=5",
68
68
  "@types/react": ">=17",
69
69
  "@types/react-dom": ">=17",
70
70
  "react": ">=17",
@@ -82,24 +82,25 @@
82
82
  }
83
83
  },
84
84
  "devDependencies": {
85
- "@emotion/styled": "^11.10.4",
86
- "@material-ui/core": "^4.12.4",
87
- "@mui/material": "^5.10.3",
88
- "@schummar/runp": "^1.5.3",
89
- "@types/react": "17",
90
- "@types/react-dom": "^17.0.13",
91
- "@typescript-eslint/eslint-plugin": "^5.36.1",
92
- "@typescript-eslint/parser": "^5.36.1",
93
- "@vitejs/plugin-react": "^2.0.1",
94
- "eslint": "^8.23.0",
95
- "eslint-plugin-storybook": "^0.6.4",
96
- "prettier": "^2.7.1",
97
- "react": "17",
98
- "react-dom": "17",
99
- "rimraf": "^3.0.2",
100
- "semantic-release": "^19.0.5",
101
- "typescript": "^4.8.2",
102
- "vite": "^3.0.9"
85
+ "@emotion/styled": "11.10.4",
86
+ "@material-ui/core": "4.12.4",
87
+ "@mui/material": "5.10.3",
88
+ "@schummar/runp": "1.5.3",
89
+ "@types/react": "18.0.18",
90
+ "@types/react-dom": "18.0.6",
91
+ "@typescript-eslint/eslint-plugin": "5.36.1",
92
+ "@typescript-eslint/parser": "5.36.1",
93
+ "@vitejs/plugin-react": "2.0.1",
94
+ "eslint": "8.23.0",
95
+ "eslint-plugin-storybook": "0.6.4",
96
+ "npm-run-all": "^4.1.5",
97
+ "prettier": "2.7.1",
98
+ "react": "18.2.0",
99
+ "react-dom": "18.2.0",
100
+ "rimraf": "3.0.2",
101
+ "semantic-release": "19.0.5",
102
+ "typescript": "4.8.2",
103
+ "vite": "3.0.9"
103
104
  },
104
105
  "files": [
105
106
  "dist"