@akinon/akitable 0.0.3 → 0.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.
package/dist/types.d.ts CHANGED
@@ -1,20 +1,17 @@
1
- /// <reference types="react" />
2
- export type DataTablePagination = {
1
+ export type AkitablePagination = {
3
2
  currentPage: number;
4
3
  pageSize: number;
5
4
  totalDataLength: number;
6
5
  paginationLabel?: string;
7
6
  };
8
- export type UseDataTablePagination = [
9
- DataTablePagination,
10
- React.Dispatch<React.SetStateAction<DataTablePagination>>
7
+ export type UseAkitablePagination = [
8
+ AkitablePagination,
9
+ React.Dispatch<React.SetStateAction<AkitablePagination>>
11
10
  ];
12
- export type TableAction<T> = {
13
- value?: string;
11
+ export type HeaderAction<IData> = {
14
12
  label: string;
15
- actionHandler?: (selectedRows?: T[]) => void;
16
- isSelectionRequired?: boolean;
17
- isSingleSelectionRequired?: boolean;
18
- isDisabled?: boolean;
13
+ handler: (selectedRows: IData[]) => void;
14
+ disabled?: boolean;
19
15
  };
16
+ export type AnyObject = Record<string, any>;
20
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.tsx"],"names":[],"mappings":";AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,mBAAmB;IACnB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC7C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,kBAAkB;IAClB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,KAAK,IAAI;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/akitable",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,20 +11,20 @@
11
11
  "dependencies": {
12
12
  "antd": "5.11.0",
13
13
  "use-immer": "^0.9.0",
14
+ "@akinon/ui-card": "0.0.5",
15
+ "@akinon/ui-theme": "0.1.0",
14
16
  "@akinon/ui-table": "0.0.2",
15
- "@akinon/ui-select": "0.0.2",
16
- "@akinon/ui-theme": "0.0.2",
17
17
  "@akinon/ui-pagination": "0.0.2",
18
- "@akinon/ui-card": "0.0.3",
18
+ "@akinon/ui-select": "0.0.2",
19
19
  "@akinon/ui-space": "0.0.2",
20
20
  "@akinon/ui-typography": "0.0.2",
21
- "@akinon/ui-button": "0.0.2"
21
+ "@akinon/ui-button": "0.1.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "clean-package": "2.2.0",
25
25
  "@akinon/vite-config": "^0.1.1",
26
- "tsconfig": "0.0.0",
27
- "eslint-config-custom": "0.1.0"
26
+ "@akinon/eslint-config": "0.1.0",
27
+ "@akinon/typescript-config": "0.0.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=18",
@@ -46,6 +46,7 @@
46
46
  "test": "vitest run",
47
47
  "test:ui": "vitest --ui",
48
48
  "test:watch": "vitest watch",
49
+ "test:coverage": "vitest run --coverage",
49
50
  "typecheck": "tsc --noEmit"
50
51
  }
51
52
  }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { TableAction } from '../../types';
3
- interface DataTableActionsProps<T> {
4
- selectedRows?: T[];
5
- tableActions: TableAction<T>[];
6
- placeholder: string;
7
- applyButtonLabel: string;
8
- }
9
- export declare const DataTableActions: <T>({ selectedRows, tableActions, placeholder, applyButtonLabel }: DataTableActionsProps<T>) => React.JSX.Element;
10
- export {};
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/actions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAKtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,UAAU,qBAAqB,CAAC,CAAC;IAC/B,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;IACnB,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,mHAsD5B,CAAC"}
@@ -1,23 +0,0 @@
1
- import React, { Dispatch, ReactNode } from 'react';
2
- import type { UseDataTablePagination } from '../../types';
3
- export type Action = {
4
- type: 'RESET';
5
- } | {
6
- type: 'SET_EMPTY';
7
- payload: boolean;
8
- };
9
- export type DataTableContext = {
10
- state: {
11
- empty: boolean;
12
- };
13
- dispatch: Dispatch<Action>;
14
- useDataTablePagination: UseDataTablePagination;
15
- };
16
- interface DataTableContextProviderProps {
17
- useDataTablePagination: UseDataTablePagination;
18
- children: ReactNode;
19
- }
20
- export declare const DataTableContextProvider: React.FC<DataTableContextProviderProps>;
21
- export declare const useDataTableContext: () => DataTableContext;
22
- export {};
23
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE;QACL,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC;AAKF,UAAU,6BAA6B;IACrC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAC7C,6BAA6B,CA2B9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,wBAU/B,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const DataTableFooter: () => React.JSX.Element;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,eAAe,yBAM3B,CAAC"}
@@ -1,14 +0,0 @@
1
- import { TableRowSelection } from 'antd/es/table/interface';
2
- import React from 'react';
3
- import { TableAction } from '../../types';
4
- interface DataTableHeaderProps<T> {
5
- title: string;
6
- description: string;
7
- selectedRows?: T[];
8
- tableActions?: TableAction<T>[];
9
- rowSelection?: TableRowSelection<T>;
10
- headerMiddleBlock?: React.ReactNode;
11
- }
12
- export declare const DataTableHeader: <T>({ title, description, tableActions, selectedRows, headerMiddleBlock }: DataTableHeaderProps<T>) => React.JSX.Element;
13
- export {};
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,UAAU,oBAAoB,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,0HAkC3B,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const DataTablePagination: () => React.JSX.Element;
3
- //# sourceMappingURL=index.d.ts.map