sti-antd-package 0.0.38 → 0.0.39

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,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, size, rowClassName, rowKey, rowSelection, columns, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, 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, 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;
5
5
  declare const _default: typeof TableComponent;
6
6
  export default _default;
@@ -3,7 +3,7 @@ import { AnyObject } from "antd/es/_util/type";
3
3
  import { SizeType } from "antd/es/config-provider/SizeContext";
4
4
  import { ColumnsType, FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig, TableRowSelection } from "antd/es/table/interface";
5
5
  import { TableProps } from "rc-table";
6
- import { ExpandableConfig, GetRowKey } from "rc-table/lib/interface";
6
+ import { ExpandableConfig, GetRowKey, PanelRender } from "rc-table/lib/interface";
7
7
  import { JSXElementConstructor } from "react";
8
8
  export interface TableButtonMiddle {
9
9
  classNames?: string[];
@@ -35,11 +35,18 @@ export interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
35
35
  onClear?: React.MouseEventHandler<HTMLSpanElement>;
36
36
  };
37
37
  buttonFilter?: React.ReactElement<any, string | JSXElementConstructor<any>>;
38
- size?: SizeType;
38
+ bordered?: boolean;
39
+ rowHoverable?: boolean;
40
+ virtual?: boolean;
41
+ rootClassNames?: string[];
42
+ classNames?: string[];
39
43
  rowClassName?: TableProps<T>['rowClassName'];
40
- rowKey?: string | GetRowKey<T>;
41
- rowSelection?: TableRowSelection<T>;
44
+ size?: SizeType;
45
+ indentSize?: number;
46
+ title?: PanelRender<T>;
47
+ caption?: React.ReactNode;
42
48
  columns?: ColumnsType<T>;
49
+ rowKey?: string | GetRowKey<T>;
43
50
  data?: T[];
44
51
  expandable?: ExpandableConfig<T>;
45
52
  pagination?: false | TablePaginationConfig;
@@ -54,5 +61,6 @@ export interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
54
61
  components?: TableProps<T>['components'];
55
62
  summary?: (data: readonly T[]) => React.ReactNode;
56
63
  onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<T> | SorterResult<T>[], extra: TableCurrentDataSource<T>) => void;
64
+ rowSelection?: TableRowSelection<T>;
57
65
  style?: React.CSSProperties;
58
66
  }
package/dist/index.d.ts CHANGED
@@ -26,9 +26,9 @@ import { OnValueChange } from 'react-number-format';
26
26
  import { RadioGroupButtonStyle, RadioGroupOptionType } from 'antd/lib/radio';
27
27
  import { DefaultOptionType as DefaultOptionType$1 } from 'antd/es/select';
28
28
  import { ClassTransformOptions } from 'class-transformer';
29
- import { TableRowSelection, ColumnsType, TablePaginationConfig, FilterValue, SorterResult, TableCurrentDataSource, ColumnType, ColumnGroupType } from 'antd/es/table/interface';
29
+ import { ColumnsType, TablePaginationConfig, FilterValue, SorterResult, TableCurrentDataSource, TableRowSelection, ColumnType, ColumnGroupType } from 'antd/es/table/interface';
30
30
  import { TableProps } from 'rc-table';
31
- import { GetRowKey, ExpandableConfig } from 'rc-table/lib/interface';
31
+ import { PanelRender, GetRowKey, ExpandableConfig } from 'rc-table/lib/interface';
32
32
  import { TabsType, TabsPosition, TabsProps } from 'antd/es/tabs';
33
33
  import { RcFile } from 'antd/es/upload';
34
34
  import { UploadListType, UploadChangeParam, UploadFile } from 'antd/es/upload/interface';
@@ -758,11 +758,18 @@ interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
758
758
  onClear?: React.MouseEventHandler<HTMLSpanElement>;
759
759
  };
760
760
  buttonFilter?: React.ReactElement<any, string | JSXElementConstructor<any>>;
761
- size?: SizeType;
761
+ bordered?: boolean;
762
+ rowHoverable?: boolean;
763
+ virtual?: boolean;
764
+ rootClassNames?: string[];
765
+ classNames?: string[];
762
766
  rowClassName?: TableProps<T>['rowClassName'];
763
- rowKey?: string | GetRowKey<T>;
764
- rowSelection?: TableRowSelection<T>;
767
+ size?: SizeType;
768
+ indentSize?: number;
769
+ title?: PanelRender<T>;
770
+ caption?: React.ReactNode;
765
771
  columns?: ColumnsType<T>;
772
+ rowKey?: string | GetRowKey<T>;
766
773
  data?: T[];
767
774
  expandable?: ExpandableConfig<T>;
768
775
  pagination?: false | TablePaginationConfig;
@@ -777,10 +784,11 @@ interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
777
784
  components?: TableProps<T>['components'];
778
785
  summary?: (data: readonly T[]) => React.ReactNode;
779
786
  onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<T> | SorterResult<T>[], extra: TableCurrentDataSource<T>) => void;
787
+ rowSelection?: TableRowSelection<T>;
780
788
  style?: React.CSSProperties;
781
789
  }
782
790
 
783
- declare const TableComponent: <T extends (BaseModel<T> | AnyObject)>({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, size, rowClassName, rowKey, rowSelection, columns, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, style, }: TableComponentProps<T>) => react_jsx_runtime.JSX.Element;
791
+ declare const TableComponent: <T extends (BaseModel<T> | AnyObject)>({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames, classNames, rowClassName, size, indentSize, title, caption, columns, rowKey, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }: TableComponentProps<T>) => react_jsx_runtime.JSX.Element;
784
792
  declare const _default$3: typeof TableComponent;
785
793
 
786
794
  type TableAsyncSearchItemType = "text" | "select" | "select-multiple" | "switch" | "checkbox" | "date" | "date-range";
package/dist/index.esm.js CHANGED
@@ -8404,7 +8404,7 @@ const styleProps$1 = {
8404
8404
  sm: 12,
8405
8405
  },
8406
8406
  };
8407
- const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, size, rowClassName, rowKey, rowSelection, columns, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, style, }) => {
8407
+ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames = [], classNames = [], rowClassName, size, indentSize, title, caption, columns, rowKey, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }) => {
8408
8408
  var _a, _b;
8409
8409
  const rowSelectionTable = rowSelection
8410
8410
  ? Object.assign({ type: (_a = rowSelection.type) !== null && _a !== void 0 ? _a : 'checkbox' }, rowSelection) : undefined;
@@ -8418,7 +8418,7 @@ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, b
8418
8418
  };
8419
8419
  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$1.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent$1, { tooltip: !buttonReload.text ? { title: 'Reload' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: [styleTable['button']], loading: loading, onClick: buttonReload.onClick, href: buttonReload.href, children: buttonReload.text ? 'Reload' : undefined })), buttonAdd && (jsxRuntimeExports.jsx(ButtonComponent$1, { type: "primary", tooltip: !buttonAdd.text ? { title: 'Add' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$5, {}), 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$1, { type: "primary", tooltip: !buttonDelete.text ? { title: 'Delete' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$b, {}), 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$1.col, { children: [search && (jsxRuntimeExports.jsx(InputComponent$1, { noItem: true, placeholder: "Search", classNames: [styleTable['input-search']], readOnly: loading, onChange: search.onChange, onPressEnter: search.onPressEnter, suffix: jsxRuntimeExports.jsx(RefIcon$2, { onClick: search.onSearch }), allowClear: {
8420
8420
  clearIcon: (jsxRuntimeExports.jsx(RefIcon$e, { onClick: search.onClear })),
8421
- } })), buttonFilter] }))] })), jsxRuntimeExports.jsx(Table, { showSorterTooltip: true, tableLayout: "fixed", className: "table-data", rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', 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 })] }));
8421
+ } })), buttonFilter] }))] })), jsxRuntimeExports.jsx(Table, { showSorterTooltip: true, bordered: bordered, rowHoverable: rowHoverable, virtual: virtual, tableLayout: "fixed", rootClassName: rootClassNames.join(' '), className: ['table-data', ...classNames].join(' '), 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 })] }));
8422
8422
  };
8423
8423
  var TableComponent$1 = React__default.memo(TableComponent);
8424
8424
 
package/dist/index.js CHANGED
@@ -8423,7 +8423,7 @@ const styleProps$1 = {
8423
8423
  sm: 12,
8424
8424
  },
8425
8425
  };
8426
- const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, size, rowClassName, rowKey, rowSelection, columns, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, style, }) => {
8426
+ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, bordered, rowHoverable, virtual, rootClassNames = [], classNames = [], rowClassName, size, indentSize, title, caption, columns, rowKey, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, rowSelection, style, }) => {
8427
8427
  var _a, _b;
8428
8428
  const rowSelectionTable = rowSelection
8429
8429
  ? Object.assign({ type: (_a = rowSelection.type) !== null && _a !== void 0 ? _a : 'checkbox' }, rowSelection) : undefined;
@@ -8437,7 +8437,7 @@ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, b
8437
8437
  };
8438
8438
  return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [(buttonReload || buttonAdd || buttonMiddle || buttonDelete || search || buttonFilter) && (jsxRuntimeExports.jsxs(antd.Row, { className: styleTable['row-top'], children: [jsxRuntimeExports.jsxs(antd.Col, Object.assign({}, styleProps$1.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent$1, { tooltip: !buttonReload.text ? { title: 'Reload' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: [styleTable['button']], loading: loading, onClick: buttonReload.onClick, href: buttonReload.href, children: buttonReload.text ? 'Reload' : undefined })), buttonAdd && (jsxRuntimeExports.jsx(ButtonComponent$1, { type: "primary", tooltip: !buttonAdd.text ? { title: 'Add' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$5, {}), 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$1, { type: "primary", tooltip: !buttonDelete.text ? { title: 'Delete' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$b, {}), 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(antd.Col, Object.assign({}, styleProps$1.col, { children: [search && (jsxRuntimeExports.jsx(InputComponent$1, { noItem: true, placeholder: "Search", classNames: [styleTable['input-search']], readOnly: loading, onChange: search.onChange, onPressEnter: search.onPressEnter, suffix: jsxRuntimeExports.jsx(RefIcon$2, { onClick: search.onSearch }), allowClear: {
8439
8439
  clearIcon: (jsxRuntimeExports.jsx(RefIcon$e, { onClick: search.onClear })),
8440
- } })), buttonFilter] }))] })), jsxRuntimeExports.jsx(antd.Table, { showSorterTooltip: true, tableLayout: "fixed", className: "table-data", rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', 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 })] }));
8440
+ } })), buttonFilter] }))] })), jsxRuntimeExports.jsx(antd.Table, { showSorterTooltip: true, bordered: bordered, rowHoverable: rowHoverable, virtual: virtual, tableLayout: "fixed", rootClassName: rootClassNames.join(' '), className: ['table-data', ...classNames].join(' '), 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 })] }));
8441
8441
  };
8442
8442
  var TableComponent$1 = React.memo(TableComponent);
8443
8443
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sti-antd-package",
3
3
  "description": "STI ANT Design",
4
- "version": "0.0.38",
4
+ "version": "0.0.39",
5
5
  "type": "module",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",