@akinon/akitable 0.2.1 → 0.3.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.
- package/dist/cjs/akitable-context.d.ts +18 -0
- package/dist/cjs/akitable-context.d.ts.map +1 -0
- package/dist/cjs/akitable-context.js +19 -0
- package/dist/cjs/akitable.css +8 -0
- package/dist/cjs/akitable.d.ts +5 -0
- package/dist/cjs/akitable.d.ts.map +1 -0
- package/dist/cjs/akitable.js +37 -0
- package/dist/cjs/common/theme-overrides.d.ts +3 -0
- package/dist/cjs/common/theme-overrides.d.ts.map +1 -0
- package/dist/cjs/common/theme-overrides.js +60 -0
- package/dist/cjs/components/actions.css +19 -0
- package/dist/cjs/components/actions.d.ts +4 -0
- package/dist/cjs/components/actions.d.ts.map +1 -0
- package/dist/cjs/components/actions.js +35 -0
- package/dist/cjs/components/controls.css +5 -0
- package/dist/cjs/components/controls.d.ts +4 -0
- package/dist/cjs/components/controls.d.ts.map +1 -0
- package/dist/cjs/components/controls.js +18 -0
- package/dist/cjs/components/datatable.css +57 -0
- package/dist/cjs/components/datatable.d.ts +5 -0
- package/dist/cjs/components/datatable.d.ts.map +1 -0
- package/dist/cjs/components/datatable.js +29 -0
- package/dist/cjs/components/footer.css +5 -0
- package/dist/cjs/components/footer.d.ts +5 -0
- package/dist/cjs/components/footer.d.ts.map +1 -0
- package/dist/cjs/components/footer.js +19 -0
- package/dist/cjs/components/header.css +23 -0
- package/dist/cjs/components/header.d.ts +5 -0
- package/dist/cjs/components/header.d.ts.map +1 -0
- package/dist/cjs/components/header.js +25 -0
- package/dist/cjs/components/pagination.css +3 -0
- package/dist/{esm/components/Pagination/index.d.ts → cjs/components/pagination.d.ts} +2 -2
- package/dist/cjs/components/pagination.d.ts.map +1 -0
- package/dist/cjs/components/pagination.js +17 -0
- package/dist/cjs/i18n/index.d.ts +5 -0
- package/dist/cjs/i18n/index.d.ts.map +1 -0
- package/dist/cjs/i18n/index.js +14 -0
- package/dist/cjs/i18n/translations/en.d.ts +9 -0
- package/dist/cjs/i18n/translations/en.d.ts.map +1 -0
- package/dist/cjs/i18n/translations/en.js +10 -0
- package/dist/cjs/i18n/translations/tr.d.ts +9 -0
- package/dist/cjs/i18n/translations/tr.d.ts.map +1 -0
- package/dist/cjs/i18n/translations/tr.js +10 -0
- package/dist/cjs/index.d.ts +2 -18
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +15 -93
- package/dist/cjs/types.d.ts +50 -16
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/akitable-context.d.ts +18 -0
- package/dist/esm/akitable-context.d.ts.map +1 -0
- package/dist/esm/akitable-context.js +14 -0
- package/dist/esm/akitable.css +8 -0
- package/dist/esm/akitable.d.ts +5 -0
- package/dist/esm/akitable.d.ts.map +1 -0
- package/dist/esm/akitable.js +33 -0
- package/dist/esm/common/theme-overrides.d.ts +3 -0
- package/dist/esm/common/theme-overrides.d.ts.map +1 -0
- package/dist/esm/common/theme-overrides.js +57 -0
- package/dist/esm/components/actions.css +19 -0
- package/dist/esm/components/actions.d.ts +4 -0
- package/dist/esm/components/actions.d.ts.map +1 -0
- package/dist/esm/components/actions.js +31 -0
- package/dist/esm/components/controls.css +5 -0
- package/dist/esm/components/controls.d.ts +4 -0
- package/dist/esm/components/controls.d.ts.map +1 -0
- package/dist/esm/components/controls.js +14 -0
- package/dist/esm/components/datatable.css +57 -0
- package/dist/esm/components/datatable.d.ts +5 -0
- package/dist/esm/components/datatable.d.ts.map +1 -0
- package/dist/esm/components/datatable.js +25 -0
- package/dist/esm/components/footer.css +5 -0
- package/dist/esm/components/footer.d.ts +5 -0
- package/dist/esm/components/footer.d.ts.map +1 -0
- package/dist/esm/components/footer.js +15 -0
- package/dist/esm/components/header.css +23 -0
- package/dist/esm/components/header.d.ts +5 -0
- package/dist/esm/components/header.d.ts.map +1 -0
- package/dist/esm/components/header.js +21 -0
- package/dist/esm/components/pagination.css +3 -0
- package/dist/{cjs/components/Pagination/index.d.ts → esm/components/pagination.d.ts} +2 -2
- package/dist/esm/components/pagination.d.ts.map +1 -0
- package/dist/esm/components/pagination.js +13 -0
- package/dist/esm/i18n/index.d.ts +5 -0
- package/dist/esm/i18n/index.d.ts.map +1 -0
- package/dist/esm/i18n/index.js +11 -0
- package/dist/esm/i18n/translations/en.d.ts +9 -0
- package/dist/esm/i18n/translations/en.d.ts.map +1 -0
- package/dist/esm/i18n/translations/en.js +8 -0
- package/dist/esm/i18n/translations/tr.d.ts +9 -0
- package/dist/esm/i18n/translations/tr.d.ts.map +1 -0
- package/dist/esm/i18n/translations/tr.js +8 -0
- package/dist/esm/index.d.ts +2 -18
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -92
- package/dist/esm/types.d.ts +50 -16
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +19 -15
- package/dist/cjs/components/AntdTable/index.d.ts +0 -6
- package/dist/cjs/components/AntdTable/index.d.ts.map +0 -1
- package/dist/cjs/components/AntdTable/index.js +0 -33
- package/dist/cjs/components/Footer/index.css +0 -6
- package/dist/cjs/components/Footer/index.d.ts +0 -4
- package/dist/cjs/components/Footer/index.d.ts.map +0 -1
- package/dist/cjs/components/Footer/index.js +0 -16
- package/dist/cjs/components/Header/index.css +0 -84
- package/dist/cjs/components/Header/index.d.ts +0 -10
- package/dist/cjs/components/Header/index.d.ts.map +0 -1
- package/dist/cjs/components/Header/index.js +0 -25
- package/dist/cjs/components/HeaderActions/index.css +0 -30
- package/dist/cjs/components/HeaderActions/index.d.ts +0 -9
- package/dist/cjs/components/HeaderActions/index.d.ts.map +0 -1
- package/dist/cjs/components/HeaderActions/index.js +0 -39
- package/dist/cjs/components/Pagination/index.css +0 -96
- package/dist/cjs/components/Pagination/index.d.ts.map +0 -1
- package/dist/cjs/components/Pagination/index.js +0 -20
- package/dist/cjs/components/index.d.ts +0 -6
- package/dist/cjs/components/index.d.ts.map +0 -1
- package/dist/cjs/components/index.js +0 -13
- package/dist/cjs/context/index.d.ts +0 -25
- package/dist/cjs/context/index.d.ts.map +0 -1
- package/dist/cjs/context/index.js +0 -35
- package/dist/cjs/index.css +0 -28
- package/dist/esm/components/AntdTable/index.d.ts +0 -6
- package/dist/esm/components/AntdTable/index.d.ts.map +0 -1
- package/dist/esm/components/AntdTable/index.js +0 -29
- package/dist/esm/components/Footer/index.css +0 -6
- package/dist/esm/components/Footer/index.d.ts +0 -4
- package/dist/esm/components/Footer/index.d.ts.map +0 -1
- package/dist/esm/components/Footer/index.js +0 -12
- package/dist/esm/components/Header/index.css +0 -84
- package/dist/esm/components/Header/index.d.ts +0 -10
- package/dist/esm/components/Header/index.d.ts.map +0 -1
- package/dist/esm/components/Header/index.js +0 -21
- package/dist/esm/components/HeaderActions/index.css +0 -30
- package/dist/esm/components/HeaderActions/index.d.ts +0 -9
- package/dist/esm/components/HeaderActions/index.d.ts.map +0 -1
- package/dist/esm/components/HeaderActions/index.js +0 -35
- package/dist/esm/components/Pagination/index.css +0 -96
- package/dist/esm/components/Pagination/index.d.ts.map +0 -1
- package/dist/esm/components/Pagination/index.js +0 -16
- package/dist/esm/components/index.d.ts +0 -6
- package/dist/esm/components/index.d.ts.map +0 -1
- package/dist/esm/components/index.js +0 -5
- package/dist/esm/context/index.d.ts +0 -25
- package/dist/esm/context/index.d.ts.map +0 -1
- package/dist/esm/context/index.js +0 -30
- package/dist/esm/index.css +0 -28
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,kBAAkB,yBAoB9B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './pagination.css';
|
|
2
|
+
import { Pagination } from '@akinon/ui-pagination';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useAkitableContext } from '../akitable-context';
|
|
5
|
+
import { i18n } from '../i18n';
|
|
6
|
+
export const AkitablePagination = () => {
|
|
7
|
+
const { isLoading, pagination, onPaginationChanged } = useAkitableContext();
|
|
8
|
+
const { t } = i18n;
|
|
9
|
+
return (React.createElement("div", null,
|
|
10
|
+
React.createElement(Pagination, { simple: true, disabled: isLoading, current: pagination === null || pagination === void 0 ? void 0 : pagination.page, pageSize: pagination === null || pagination === void 0 ? void 0 : pagination.size, pageSizeOptions: [20, 50, 100, 250], total: pagination === null || pagination === void 0 ? void 0 : pagination.total, onChange: (page, size) => onPaginationChanged === null || onPaginationChanged === void 0 ? void 0 : onPaginationChanged(page, size), locale: {
|
|
11
|
+
items_per_page: t('itemsPerPage')
|
|
12
|
+
} })));
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI;;;CAOf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const translations: {
|
|
2
|
+
readonly resultsFound: "{{count}} result(s) found.";
|
|
3
|
+
readonly itemsPerPage: "/ page";
|
|
4
|
+
readonly selectAction: "Select Action";
|
|
5
|
+
readonly selectedCount: "Selected {{count}} record(s).";
|
|
6
|
+
readonly apply: "Apply";
|
|
7
|
+
};
|
|
8
|
+
export default translations;
|
|
9
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;CAMR,CAAC;AAEX,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const translations: {
|
|
2
|
+
readonly resultsFound: "{{count}} sonuç bulundu.";
|
|
3
|
+
readonly itemsPerPage: "/ sayfa";
|
|
4
|
+
readonly selectAction: "Aksiyon Seçiniz";
|
|
5
|
+
readonly selectedCount: "{{count}} kayit seçildi.";
|
|
6
|
+
readonly apply: "Uygula";
|
|
7
|
+
};
|
|
8
|
+
export default translations;
|
|
9
|
+
//# sourceMappingURL=tr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/tr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;CAMR,CAAC;AAEX,eAAe,YAAY,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { AntdTableProps } from './components/AntdTable';
|
|
4
|
-
import type { AnyObject, HeaderAction, UseAkitablePagination } from './types';
|
|
5
|
-
export type { AkitablePagination, HeaderAction, UseAkitablePagination } from './types';
|
|
6
|
-
export type AkitableProps<IData> = AntdTableProps<IData> & {
|
|
7
|
-
title: string;
|
|
8
|
-
description: string;
|
|
9
|
-
useAkitablePagination: UseAkitablePagination;
|
|
10
|
-
headerActions?: HeaderAction<IData>[];
|
|
11
|
-
headerMiddleBlock?: React.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Akitable component
|
|
15
|
-
* @param {AkitableProps} props
|
|
16
|
-
* @returns {React.ReactElement}
|
|
17
|
-
*/
|
|
18
|
-
export declare const Akitable: <IData extends AnyObject>({ useAkitablePagination, title, description, headerActions, headerMiddleBlock, ...restProps }: AkitableProps<IData>) => React.JSX.Element;
|
|
1
|
+
export * from './akitable';
|
|
2
|
+
export * from './types';
|
|
19
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,92 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import './index.css';
|
|
13
|
-
import { fontSize, theme } from '@akinon/ui-theme';
|
|
14
|
-
import { ConfigProvider, theme as antdTheme } from 'antd';
|
|
15
|
-
import * as React from 'react';
|
|
16
|
-
import { AkitableFooter, AkitableHeader, AntdTable } from './components';
|
|
17
|
-
import { AkitableContextProvider } from './context';
|
|
18
|
-
/**
|
|
19
|
-
* Akitable component
|
|
20
|
-
* @param {AkitableProps} props
|
|
21
|
-
* @returns {React.ReactElement}
|
|
22
|
-
*/
|
|
23
|
-
export const Akitable = (_a) => {
|
|
24
|
-
var { useAkitablePagination, title, description, headerActions, headerMiddleBlock } = _a, restProps = __rest(_a, ["useAkitablePagination", "title", "description", "headerActions", "headerMiddleBlock"]);
|
|
25
|
-
return (React.createElement("div", { className: "akitable-container" },
|
|
26
|
-
React.createElement(ConfigProvider, { prefixCls: "akinon", theme: {
|
|
27
|
-
components: {
|
|
28
|
-
Checkbox: {
|
|
29
|
-
colorBgBase: theme.colors.neutral['50'],
|
|
30
|
-
algorithm: antdTheme.defaultAlgorithm
|
|
31
|
-
},
|
|
32
|
-
Card: {
|
|
33
|
-
paddingLG: 0,
|
|
34
|
-
colorBgContainer: theme.colors.neutral['50'],
|
|
35
|
-
colorBgBase: theme.colors.neutral['50'],
|
|
36
|
-
colorTextBase: theme.colors.neutral['950'],
|
|
37
|
-
algorithm: antdTheme.defaultAlgorithm
|
|
38
|
-
},
|
|
39
|
-
Typography: {
|
|
40
|
-
colorTextHeading: theme.colors.neutral['950'],
|
|
41
|
-
colorText: theme.colors.neutral['500'],
|
|
42
|
-
titleMarginBottom: 0,
|
|
43
|
-
fontWeightStrong: 500
|
|
44
|
-
},
|
|
45
|
-
Select: {
|
|
46
|
-
colorText: theme.colors.neutral['950'],
|
|
47
|
-
selectorBg: theme.colors.neutral['50'],
|
|
48
|
-
colorBgElevated: theme.colors.neutral['100'],
|
|
49
|
-
colorBorder: theme.colors.neutral['350'],
|
|
50
|
-
colorTextQuaternary: theme.colors.neutral['500'],
|
|
51
|
-
optionSelectedBg: theme.colors.azure['100'],
|
|
52
|
-
algorithm: antdTheme.defaultAlgorithm
|
|
53
|
-
},
|
|
54
|
-
Pagination: {
|
|
55
|
-
colorText: theme.colors.neutral['950'],
|
|
56
|
-
itemInputBg: theme.colors.neutral['75'],
|
|
57
|
-
colorBorder: theme.colors.neutral['350'],
|
|
58
|
-
borderRadius: 0,
|
|
59
|
-
itemActiveBg: theme.colors.neutral['500'],
|
|
60
|
-
colorTextDisabled: theme.colors.neutral['375'],
|
|
61
|
-
marginXS: 0,
|
|
62
|
-
itemSizeSM: 38
|
|
63
|
-
},
|
|
64
|
-
Spin: {
|
|
65
|
-
colorBgContainer: theme.colors.neutral['50']
|
|
66
|
-
},
|
|
67
|
-
Table: {
|
|
68
|
-
headerBorderRadius: 0,
|
|
69
|
-
headerBg: theme.colors.neutral['150'],
|
|
70
|
-
headerColor: theme.colors.neutral['500'],
|
|
71
|
-
borderColor: theme.colors.neutral['350'],
|
|
72
|
-
fontSize: fontSize * 0.875,
|
|
73
|
-
colorBgContainer: theme.colors.neutral['50'],
|
|
74
|
-
colorText: theme.colors.neutral['500'],
|
|
75
|
-
cellPaddingInline: 28,
|
|
76
|
-
colorBgBase: theme.colors.neutral['50'],
|
|
77
|
-
algorithm: antdTheme.defaultAlgorithm
|
|
78
|
-
},
|
|
79
|
-
Button: {
|
|
80
|
-
colorBgBase: theme.colors.neutral['50'],
|
|
81
|
-
colorTextBase: theme.colors.azure['500'],
|
|
82
|
-
colorBorder: theme.colors.azure['500'],
|
|
83
|
-
borderColorDisabled: theme.colors.neutral['350'],
|
|
84
|
-
algorithm: antdTheme.defaultAlgorithm
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
} },
|
|
88
|
-
React.createElement(AkitableContextProvider, { useAkitablePagination: useAkitablePagination, headerActions: headerActions },
|
|
89
|
-
React.createElement(AkitableHeader, { title: title, description: description, headerMiddleBlock: headerMiddleBlock }),
|
|
90
|
-
React.createElement(AntdTable, Object.assign({}, restProps)),
|
|
91
|
-
React.createElement(AkitableFooter, null)))));
|
|
92
|
-
};
|
|
1
|
+
export * from './akitable';
|
|
2
|
+
export * from './types';
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,18 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { TableColumnType } from 'antd';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type RowClickEvent = (record: AkitableData, event?: React.MouseEvent<HTMLElement>, rowIndex?: number) => void;
|
|
4
|
+
export type PaginationChangeEvent = (page: number, size: number) => void;
|
|
5
|
+
export interface AkitableProps {
|
|
6
|
+
actions?: AkitableAction[];
|
|
7
|
+
columns: AkitableColumn[];
|
|
8
|
+
data: AkitableData[] | AkitablePaginatedData;
|
|
9
|
+
header?: AkitableHeaderProps;
|
|
10
|
+
footer?: AkitableFooterProps;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
pagination?: AkitablePaginationProps;
|
|
13
|
+
rowKey: string;
|
|
14
|
+
onPaginationChanged?: PaginationChangeEvent;
|
|
15
|
+
onRowClick?: RowClickEvent;
|
|
16
|
+
}
|
|
17
|
+
export interface AkitableHeaderProps {
|
|
18
|
+
title?: string;
|
|
19
|
+
extra?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface AkitableFooterProps {
|
|
22
|
+
extra?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface AkitableDataTableProps {
|
|
25
|
+
columns: AkitableColumn[];
|
|
26
|
+
data: AkitableData[];
|
|
27
|
+
rowKey: string;
|
|
28
|
+
onRowClick?: RowClickEvent;
|
|
29
|
+
}
|
|
30
|
+
export type AkitablePageSizes = 20 | 50 | 100 | 250;
|
|
31
|
+
export interface AkitablePaginationProps {
|
|
32
|
+
page: number;
|
|
33
|
+
size: AkitablePageSizes;
|
|
34
|
+
}
|
|
35
|
+
export interface AkitableColumn extends TableColumnType<AkitableData> {
|
|
36
|
+
copyable?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface AkitableData {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
41
|
+
export interface AkitablePaginatedData {
|
|
42
|
+
count: number;
|
|
43
|
+
next?: string | null;
|
|
44
|
+
previous?: string | null;
|
|
45
|
+
results: AkitableData[];
|
|
46
|
+
}
|
|
47
|
+
export interface AkitableAction {
|
|
13
48
|
label: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export type AnyObject = Record<string, any>;
|
|
49
|
+
onSelect: (selectedRowKeys: React.Key[]) => void;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
18
52
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,KAAK,aAAa,GAAG,CACnB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,KACd,IAAI,CAAC;AAEV,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzE,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,IAAI,EAAE,YAAY,EAAE,GAAG,qBAAqB,CAAC;IAC7C,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,qBAAqB,CAAC;IAC5C,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAEpD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAGD,MAAM,WAAW,cAAe,SAAQ,eAAe,CAAC,YAAY,CAAC;IAEnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAE3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC;CAClD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/akitable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -9,25 +9,29 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"antd": "5.
|
|
13
|
-
"
|
|
14
|
-
"@akinon/
|
|
15
|
-
"@akinon/
|
|
16
|
-
"@akinon/ui-
|
|
17
|
-
"@akinon/ui-
|
|
18
|
-
"@akinon/ui-pagination": "0.
|
|
19
|
-
"@akinon/ui-
|
|
20
|
-
"@akinon/ui-
|
|
21
|
-
"@akinon/ui-
|
|
12
|
+
"antd": "5.17.0",
|
|
13
|
+
"clsx": "^2.0.0",
|
|
14
|
+
"@akinon/akilocale": "0.10.0",
|
|
15
|
+
"@akinon/icons": "0.4.0",
|
|
16
|
+
"@akinon/ui-button": "0.5.0",
|
|
17
|
+
"@akinon/ui-card": "0.3.0",
|
|
18
|
+
"@akinon/ui-pagination": "0.3.0",
|
|
19
|
+
"@akinon/ui-select": "0.3.0",
|
|
20
|
+
"@akinon/ui-skeleton": "0.3.0",
|
|
21
|
+
"@akinon/ui-space": "0.3.0",
|
|
22
|
+
"@akinon/ui-spin": "0.3.0",
|
|
23
|
+
"@akinon/ui-table": "0.3.0",
|
|
24
|
+
"@akinon/ui-theme": "0.5.0",
|
|
25
|
+
"@akinon/ui-typography": "0.3.0"
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
28
|
"clean-package": "2.2.0",
|
|
25
29
|
"copyfiles": "^2.4.1",
|
|
26
30
|
"rimraf": "^5.0.5",
|
|
27
31
|
"typescript": "^5.2.2",
|
|
28
|
-
"@akinon/
|
|
29
|
-
"@akinon/typescript-config": "0.
|
|
30
|
-
"@akinon/
|
|
32
|
+
"@akinon/eslint-config": "0.1.0",
|
|
33
|
+
"@akinon/typescript-config": "0.2.0",
|
|
34
|
+
"@akinon/vite-config": "0.4.0"
|
|
31
35
|
},
|
|
32
36
|
"peerDependencies": {
|
|
33
37
|
"react": ">=18",
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
|
|
48
52
|
"build:esm": "tsc --outDir dist/esm",
|
|
49
53
|
"build:commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
50
|
-
"copy:files": "copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
|
|
54
|
+
"copy:files": "copyfiles -u 1 src/*.css dist/esm && copyfiles -u 1 src/*.css dist/cjs && copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
|
|
51
55
|
"clean": "rimraf dist/",
|
|
52
56
|
"lint": "eslint *.ts*",
|
|
53
57
|
"test": "vitest run",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TableProps } from 'antd/lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { AnyObject } from '../../types';
|
|
4
|
-
export type AntdTableProps<IData> = Omit<TableProps<IData>, 'title' | 'description' | 'pagination' | 'bordered'>;
|
|
5
|
-
export declare const AntdTable: <IData extends AnyObject>({ rowSelection, ...restProps }: AntdTableProps<IData>) => React.JSX.Element;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AntdTable/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,IAAI,CACtC,UAAU,CAAC,KAAK,CAAC,EACjB,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,UAAU,CACpD,CAAC;AAEF,eAAO,MAAM,SAAS,uGA6BrB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.AntdTable = void 0;
|
|
15
|
-
const ui_table_1 = require("@akinon/ui-table");
|
|
16
|
-
const react_1 = require("react");
|
|
17
|
-
const context_1 = require("../../context");
|
|
18
|
-
const AntdTable = (_a) => {
|
|
19
|
-
var { rowSelection } = _a, restProps = __rest(_a, ["rowSelection"]);
|
|
20
|
-
const { dispatch } = (0, context_1.useAkitableContext)();
|
|
21
|
-
const customRowSelection = rowSelection && Object.assign(Object.assign({}, rowSelection), { onChange: (selectedRowKeys, selectedRows) => {
|
|
22
|
-
// if akitable provides rowSelection.onChange, call it
|
|
23
|
-
if (rowSelection.onChange) {
|
|
24
|
-
rowSelection.onChange(selectedRowKeys, selectedRows, { type: 'all' });
|
|
25
|
-
}
|
|
26
|
-
dispatch({
|
|
27
|
-
type: 'SET_SELECTED_ROWS',
|
|
28
|
-
payload: selectedRows
|
|
29
|
-
});
|
|
30
|
-
} });
|
|
31
|
-
return (react_1.default.createElement(ui_table_1.Table, Object.assign({ bordered: true, pagination: false, rowSelection: customRowSelection }, restProps)));
|
|
32
|
-
};
|
|
33
|
-
exports.AntdTable = AntdTable;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,cAAc,yBAa1B,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AkitableFooter = void 0;
|
|
4
|
-
require("./index.css");
|
|
5
|
-
const ui_card_1 = require("@akinon/ui-card");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const index_1 = require("../index");
|
|
8
|
-
const AkitableFooter = () => {
|
|
9
|
-
return (react_1.default.createElement(ui_card_1.Card, { style: {
|
|
10
|
-
borderTopLeftRadius: 0,
|
|
11
|
-
borderTopRightRadius: 0
|
|
12
|
-
} },
|
|
13
|
-
react_1.default.createElement("div", { className: "akitable-footer" },
|
|
14
|
-
react_1.default.createElement(index_1.AkitablePagination, null))));
|
|
15
|
-
};
|
|
16
|
-
exports.AkitableFooter = AkitableFooter;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
.akitable-header {
|
|
2
|
-
padding: 20px 32px 16px;
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
gap: 16px;
|
|
6
|
-
|
|
7
|
-
/* Push pagination to the right
|
|
8
|
-
even if table actions are hidden. */
|
|
9
|
-
& .akinon-pagination {
|
|
10
|
-
margin-left: auto;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&__left-block {
|
|
14
|
-
flex: 1;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&__middle-block {
|
|
18
|
-
color: black;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&__right-block {
|
|
22
|
-
display: flex;
|
|
23
|
-
justify-content: flex-end;
|
|
24
|
-
align-items: flex-end;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
gap: 20px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__export-options {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
gap: 12px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&__export-option {
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
align-items: center;
|
|
41
|
-
background-color: #4482ff;
|
|
42
|
-
color: white;
|
|
43
|
-
width: 36px;
|
|
44
|
-
height: 36px;
|
|
45
|
-
border-radius: 5px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&__export-option-icon {
|
|
49
|
-
height: 16px;
|
|
50
|
-
& > i {
|
|
51
|
-
color: white;
|
|
52
|
-
margin: 0;
|
|
53
|
-
font-size: 10px;
|
|
54
|
-
font-weight: bold;
|
|
55
|
-
|
|
56
|
-
&::before {
|
|
57
|
-
color: white;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&__export-option-label {
|
|
63
|
-
font-weight: bold;
|
|
64
|
-
font-size: 11px;
|
|
65
|
-
user-select: none;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&__info {
|
|
70
|
-
margin-bottom: 0.5rem;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&__title.akinon-typography {
|
|
74
|
-
font-size: 20px;
|
|
75
|
-
margin: 0.5rem 0 0.1rem;
|
|
76
|
-
font-weight: 700;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&__description.akinon-typography {
|
|
80
|
-
font-size: 13px;
|
|
81
|
-
color: #797979;
|
|
82
|
-
font-weight: 400;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface AkitableHeaderProps {
|
|
4
|
-
title: string;
|
|
5
|
-
description: string;
|
|
6
|
-
headerMiddleBlock?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare const AkitableHeader: ({ title, description, headerMiddleBlock }: AkitableHeaderProps) => React.JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# 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,aAAa,CAAC;AAIrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,8CAIxB,mBAAmB,sBA+BrB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AkitableHeader = void 0;
|
|
4
|
-
require("./index.css");
|
|
5
|
-
const ui_card_1 = require("@akinon/ui-card");
|
|
6
|
-
const Typography = require("@akinon/ui-typography");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const index_1 = require("../index");
|
|
9
|
-
const { Title, Text } = Typography;
|
|
10
|
-
const AkitableHeader = ({ title, description, headerMiddleBlock }) => {
|
|
11
|
-
return (react_1.default.createElement(ui_card_1.Card, { style: {
|
|
12
|
-
borderBottomLeftRadius: 0,
|
|
13
|
-
borderBottomRightRadius: 0
|
|
14
|
-
} },
|
|
15
|
-
react_1.default.createElement("div", { className: "akitable-header" },
|
|
16
|
-
react_1.default.createElement("div", { className: "akitable-header__left-block" },
|
|
17
|
-
react_1.default.createElement("div", { className: "akitable-header__info" },
|
|
18
|
-
react_1.default.createElement(Title, { className: "akitable-header__title", level: 5 }, title),
|
|
19
|
-
react_1.default.createElement(Text, { className: "akitable-header__description" }, description)),
|
|
20
|
-
react_1.default.createElement(index_1.HeaderActions, { placeholder: 'Please select an action', applyButtonLabel: 'Apply' })),
|
|
21
|
-
react_1.default.createElement("div", { className: "akitable-header__middle-block" }, headerMiddleBlock),
|
|
22
|
-
react_1.default.createElement("div", { className: "akitable-header__right-block" },
|
|
23
|
-
react_1.default.createElement(index_1.AkitablePagination, null)))));
|
|
24
|
-
};
|
|
25
|
-
exports.AkitableHeader = AkitableHeader;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.header-actions {
|
|
2
|
-
&__apply-button.akinon-btn {
|
|
3
|
-
font-weight: 600;
|
|
4
|
-
height: 40px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.akinon-select-single:not(.akinon-select-customize-input)
|
|
8
|
-
.akinon-select-selector {
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
height: 40px;
|
|
11
|
-
align-items: center;
|
|
12
|
-
border-radius: 5px;
|
|
13
|
-
border: solid 1px #c8daec;
|
|
14
|
-
width: 150px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.akinon-select-focused:not(.akinon-select-disabled).akinon-select:not(
|
|
18
|
-
.akinon-select-customize-input
|
|
19
|
-
)
|
|
20
|
-
.akinon-select-selector {
|
|
21
|
-
border-right-width: 0 !important;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.akinon-select-arrow {
|
|
25
|
-
top: 70%;
|
|
26
|
-
}
|
|
27
|
-
.akinon-select-selector {
|
|
28
|
-
min-width: 220px;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface HeaderActionsProps {
|
|
4
|
-
placeholder: string;
|
|
5
|
-
applyButtonLabel: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const HeaderActions: ({ placeholder, applyButtonLabel }: HeaderActionsProps) => React.JSX.Element | undefined;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/HeaderActions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAMrB,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,sCAGvB,kBAAkB,kCAwDpB,CAAC"}
|