sti-antd-package 0.1.2 → 0.1.3
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.
|
@@ -17,7 +17,7 @@ const styleProps = {
|
|
|
17
17
|
sm: 12,
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
|
-
const TableComponent$1 = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames = [], classNames = [], className, rowClassName, size, indentSize, title, caption, columns, rowKey, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }) => {
|
|
20
|
+
const TableComponent$1 = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames = [], classNames = [], className, rowClassName, size, indentSize, title, caption, columns, rowKey, data, locale, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }) => {
|
|
21
21
|
var _a, _b;
|
|
22
22
|
const rowSelectionTable = rowSelection
|
|
23
23
|
? Object.assign({ type: (_a = rowSelection.type) !== null && _a !== void 0 ? _a : 'checkbox' }, rowSelection) : undefined;
|
|
@@ -31,7 +31,7 @@ const TableComponent$1 = ({ noPagination, buttonReload, buttonAdd, buttonMiddle,
|
|
|
31
31
|
};
|
|
32
32
|
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [(buttonReload || buttonAdd || buttonMiddle || buttonDelete || search || buttonFilter) && (jsxRuntimeExports.jsxs(Row, { className: styleTable['row-top'], children: [jsxRuntimeExports.jsxs(Col, Object.assign({}, styleProps.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent, { tooltip: !buttonReload.text ? { title: 'Reload' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon, {}), classNames: [styleTable['button']], loading: loading, onClick: buttonReload.onClick, href: buttonReload.href, children: buttonReload.text ? 'Reload' : undefined })), buttonAdd && (jsxRuntimeExports.jsx(ButtonComponent, { type: "primary", tooltip: !buttonAdd.text ? { title: 'Add' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: [styleTable['button']], disabled: buttonAdd.disabled, onClick: buttonAdd.onClick, href: buttonAdd.href, children: buttonAdd.text ? 'Add' : undefined })), (_b = buttonMiddle === null || buttonMiddle === void 0 ? void 0 : buttonMiddle.map) === null || _b === void 0 ? void 0 : _b.call(buttonMiddle, buttonMiddleClone), buttonDelete && (jsxRuntimeExports.jsx(ButtonComponent, { type: "primary", tooltip: !buttonDelete.text ? { title: 'Delete' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$2, {}), classNames: [styleTable['button']], disabled: buttonDelete.disabled || loading, onClick: event => { var _a; (_a = buttonDelete.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonDelete, event, undefined); }, children: buttonDelete.text ? 'Delete' : undefined }))] })), jsxRuntimeExports.jsxs(Col, Object.assign({}, styleProps.col, { children: [search && (jsxRuntimeExports.jsx(InputComponent, { noItem: true, placeholder: "Search", classNames: [styleTable['input-search']], readOnly: loading, onChange: search.onChange, onPressEnter: search.onPressEnter, suffix: jsxRuntimeExports.jsx(RefIcon$4, { onClick: search.onSearch }), allowClear: {
|
|
33
33
|
clearIcon: (jsxRuntimeExports.jsx(RefIcon$3, { onClick: search.onClear })),
|
|
34
|
-
} })), buttonFilter] }))] })), jsxRuntimeExports.jsx(Table, { showSorterTooltip: true, bordered: bordered, rowHoverable: rowHoverable, virtual: virtual, tableLayout: "fixed", rootClassName: rootClassNames.join(' '), className: ['table-data', ...classNames].join(' '), classNames: className, rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', indentSize: indentSize, title: title, caption: caption, columns: columns, rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : 'id', dataSource: data, expandable: expandable, pagination: !noPagination && Object.assign({ pageSizeOptions: ['10', '20', '50', '100', '200'], showSizeChanger: true, showQuickJumper: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items` }, pagination), loading: loading, scroll: scroll !== null && scroll !== void 0 ? scroll : { y: 'calc(100vh - 300px)' }, sticky: sticky, components: components, summary: summary, onChange: onChange, rowSelection: rowSelectionTable, style: style })] }));
|
|
34
|
+
} })), buttonFilter] }))] })), jsxRuntimeExports.jsx(Table, { showSorterTooltip: true, bordered: bordered, rowHoverable: rowHoverable, virtual: virtual, tableLayout: "fixed", rootClassName: rootClassNames.join(' '), className: ['table-data', ...classNames].join(' '), classNames: className, rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', indentSize: indentSize, title: title, caption: caption, columns: columns, rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : 'id', dataSource: data, locale: locale, expandable: expandable, pagination: !noPagination && Object.assign({ pageSizeOptions: ['10', '20', '50', '100', '200'], showSizeChanger: true, showQuickJumper: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items` }, pagination), loading: loading, scroll: scroll !== null && scroll !== void 0 ? scroll : { y: 'calc(100vh - 300px)' }, sticky: sticky, components: components, summary: summary, onChange: onChange, rowSelection: rowSelectionTable, style: style })] }));
|
|
35
35
|
};
|
|
36
36
|
var TableComponent = React__default.memo(TableComponent$1);
|
|
37
37
|
|
|
@@ -19,7 +19,7 @@ const styleProps = {
|
|
|
19
19
|
sm: 12,
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames = [], classNames = [], className, rowClassName, size, indentSize, title, caption, columns, rowKey, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }) => {
|
|
22
|
+
const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames = [], classNames = [], className, rowClassName, size, indentSize, title, caption, columns, rowKey, data, locale, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }) => {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
const rowSelectionTable = rowSelection
|
|
25
25
|
? Object.assign({ type: (_a = rowSelection.type) !== null && _a !== void 0 ? _a : 'checkbox' }, rowSelection) : undefined;
|
|
@@ -33,7 +33,7 @@ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, b
|
|
|
33
33
|
};
|
|
34
34
|
return (jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [(buttonReload || buttonAdd || buttonMiddle || buttonDelete || search || buttonFilter) && (jsxRuntime.jsxRuntimeExports.jsxs(antd.Row, { className: style_module['row-top'], children: [jsxRuntime.jsxRuntimeExports.jsxs(antd.Col, Object.assign({}, styleProps.col, { children: [buttonReload && (jsxRuntime.jsxRuntimeExports.jsx(Component, { tooltip: !buttonReload.text ? { title: 'Reload' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(SyncOutlined, {}), classNames: [style_module['button']], loading: loading, onClick: buttonReload.onClick, href: buttonReload.href, children: buttonReload.text ? 'Reload' : undefined })), buttonAdd && (jsxRuntime.jsxRuntimeExports.jsx(Component, { type: "primary", tooltip: !buttonAdd.text ? { title: 'Add' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(PlusOutlined, {}), classNames: [style_module['button']], disabled: buttonAdd.disabled, onClick: buttonAdd.onClick, href: buttonAdd.href, children: buttonAdd.text ? 'Add' : undefined })), (_b = buttonMiddle === null || buttonMiddle === void 0 ? void 0 : buttonMiddle.map) === null || _b === void 0 ? void 0 : _b.call(buttonMiddle, buttonMiddleClone), buttonDelete && (jsxRuntime.jsxRuntimeExports.jsx(Component, { type: "primary", tooltip: !buttonDelete.text ? { title: 'Delete' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(DeleteOutlined, {}), classNames: [style_module['button']], disabled: buttonDelete.disabled || loading, onClick: event => { var _a; (_a = buttonDelete.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonDelete, event, undefined); }, children: buttonDelete.text ? 'Delete' : undefined }))] })), jsxRuntime.jsxRuntimeExports.jsxs(antd.Col, Object.assign({}, styleProps.col, { children: [search && (jsxRuntime.jsxRuntimeExports.jsx(Component$1, { noItem: true, placeholder: "Search", classNames: [style_module['input-search']], readOnly: loading, onChange: search.onChange, onPressEnter: search.onPressEnter, suffix: jsxRuntime.jsxRuntimeExports.jsx(SearchOutlined, { onClick: search.onSearch }), allowClear: {
|
|
35
35
|
clearIcon: (jsxRuntime.jsxRuntimeExports.jsx(CloseCircleFilled, { onClick: search.onClear })),
|
|
36
|
-
} })), buttonFilter] }))] })), jsxRuntime.jsxRuntimeExports.jsx(antd.Table, { showSorterTooltip: true, bordered: bordered, rowHoverable: rowHoverable, virtual: virtual, tableLayout: "fixed", rootClassName: rootClassNames.join(' '), className: ['table-data', ...classNames].join(' '), classNames: className, rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', indentSize: indentSize, title: title, caption: caption, columns: columns, rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : 'id', dataSource: data, expandable: expandable, pagination: !noPagination && Object.assign({ pageSizeOptions: ['10', '20', '50', '100', '200'], showSizeChanger: true, showQuickJumper: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items` }, pagination), loading: loading, scroll: scroll !== null && scroll !== void 0 ? scroll : { y: 'calc(100vh - 300px)' }, sticky: sticky, components: components, summary: summary, onChange: onChange, rowSelection: rowSelectionTable, style: style })] }));
|
|
36
|
+
} })), buttonFilter] }))] })), jsxRuntime.jsxRuntimeExports.jsx(antd.Table, { showSorterTooltip: true, bordered: bordered, rowHoverable: rowHoverable, virtual: virtual, tableLayout: "fixed", rootClassName: rootClassNames.join(' '), className: ['table-data', ...classNames].join(' '), classNames: className, rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', indentSize: indentSize, title: title, caption: caption, columns: columns, rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : 'id', dataSource: data, locale: locale, expandable: expandable, pagination: !noPagination && Object.assign({ pageSizeOptions: ['10', '20', '50', '100', '200'], showSizeChanger: true, showQuickJumper: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items` }, pagination), loading: loading, scroll: scroll !== null && scroll !== void 0 ? scroll : { y: 'calc(100vh - 300px)' }, sticky: sticky, components: components, summary: summary, onChange: onChange, rowSelection: rowSelectionTable, style: style })] }));
|
|
37
37
|
};
|
|
38
38
|
var TableComponent$1 = React.memo(TableComponent);
|
|
39
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from "../../models";
|
|
2
2
|
import { TableComponentProps } from "./types";
|
|
3
3
|
import { AnyObject } from "antd/es/_util/type";
|
|
4
|
-
declare const TableComponent: <T extends (BaseModel<T> | AnyObject)>({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames, classNames, className, rowClassName, size, indentSize, title, caption, columns, rowKey, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }: TableComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const TableComponent: <T extends (BaseModel<T> | AnyObject)>({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames, classNames, className, rowClassName, size, indentSize, title, caption, columns, rowKey, data, locale, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }: TableComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const _default: typeof TableComponent;
|
|
6
6
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from "../../models";
|
|
2
2
|
import { AnyObject } from "antd/es/_util/type";
|
|
3
3
|
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
|
-
import { ColumnsType, FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig, TableRowSelection } from "antd/es/table/interface";
|
|
4
|
+
import { ColumnsType, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, TablePaginationConfig, TableRowSelection } from "antd/es/table/interface";
|
|
5
5
|
import { TableClassNamesType } from "antd/es/table/InternalTable";
|
|
6
6
|
import { TableProps } from "rc-table";
|
|
7
7
|
import { ExpandableConfig, GetRowKey, PanelRender } from "rc-table/lib/interface";
|
|
@@ -50,6 +50,7 @@ export interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
|
|
|
50
50
|
columns?: ColumnsType<T>;
|
|
51
51
|
rowKey?: string | GetRowKey<T>;
|
|
52
52
|
data?: T[];
|
|
53
|
+
locale?: TableLocale;
|
|
53
54
|
expandable?: ExpandableConfig<T>;
|
|
54
55
|
pagination?: false | TablePaginationConfig;
|
|
55
56
|
loading?: boolean;
|