@pnkx-lib/ui 1.9.237 → 1.9.238
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/es/ui/index.js
CHANGED
|
@@ -5181,6 +5181,7 @@ const Table = ({
|
|
|
5181
5181
|
size = "small",
|
|
5182
5182
|
defaultEllipsis = true,
|
|
5183
5183
|
onDoubleClickRow,
|
|
5184
|
+
handleSubmit,
|
|
5184
5185
|
...rest
|
|
5185
5186
|
}) => {
|
|
5186
5187
|
//! State
|
|
@@ -5256,8 +5257,7 @@ const Table = ({
|
|
|
5256
5257
|
minHeight: 200
|
|
5257
5258
|
// chiều cao tối thiểu
|
|
5258
5259
|
});
|
|
5259
|
-
|
|
5260
|
-
return /* @__PURE__ */ jsxs(
|
|
5260
|
+
const tableContent = /* @__PURE__ */ jsxs(
|
|
5261
5261
|
"div",
|
|
5262
5262
|
{
|
|
5263
5263
|
id: "layout-wrapper-table",
|
|
@@ -5336,6 +5336,14 @@ const Table = ({
|
|
|
5336
5336
|
]
|
|
5337
5337
|
}
|
|
5338
5338
|
);
|
|
5339
|
+
const renderTable = () => {
|
|
5340
|
+
if (handleSubmit) {
|
|
5341
|
+
return /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, children: tableContent });
|
|
5342
|
+
}
|
|
5343
|
+
return tableContent;
|
|
5344
|
+
};
|
|
5345
|
+
//! Render
|
|
5346
|
+
return renderTable();
|
|
5339
5347
|
};
|
|
5340
5348
|
const EmptyTable = () => {
|
|
5341
5349
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center text-center", children: [
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
1
|
+
import { default as React, FormEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { TableColumnsType as TableColumnsTypeAntd } from 'antd';
|
|
3
3
|
import { TableProps } from 'antd/lib/table';
|
|
4
4
|
import { SorterResult } from 'antd/es/table/interface';
|
|
@@ -42,5 +42,6 @@ export interface TableCommonProps<T> extends Omit<TableProps<T>, "columns"> {
|
|
|
42
42
|
bulkActionHandlers?: BulkActionHandlers;
|
|
43
43
|
renderHeadingSearch?: () => ReactNode;
|
|
44
44
|
rightHeadingContent?: ReactNode;
|
|
45
|
+
handleSubmit?: FormEventHandler<any>;
|
|
45
46
|
}
|
|
46
|
-
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, titleSettingTableModal, showSetting, setColumns, renderHeadingSearch, rightHeadingContent, menu, groupHeadingButtonItems, showIndexColumn, setFilters, noBreadcum, bulkActionHandlers, size, defaultEllipsis, onDoubleClickRow, ...rest }: TableCommonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, titleSettingTableModal, showSetting, setColumns, renderHeadingSearch, rightHeadingContent, menu, groupHeadingButtonItems, showIndexColumn, setFilters, noBreadcum, bulkActionHandlers, size, defaultEllipsis, onDoubleClickRow, handleSubmit, ...rest }: TableCommonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DefaultValues } from 'react-hook-form';
|
|
2
|
-
import { TableColumnsType as TableColumnsTypeAntd } from 'antd';
|
|
3
|
-
import { ColumnTypes, RowCommon, TableCommonProps } from '../Table';
|
|
4
|
-
import * as yup from "yup";
|
|
5
|
-
export interface EditableTableCommonProps<T> extends TableCommonProps<T> {
|
|
6
|
-
onSave?: (data: T) => void;
|
|
7
|
-
schema?: yup.AnyObjectSchema;
|
|
8
|
-
initialValueForm?: DefaultValues<T>;
|
|
9
|
-
}
|
|
10
|
-
export type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
|
|
11
|
-
editable?: boolean;
|
|
12
|
-
})[];
|
|
13
|
-
export type TableColumnsType<T> = TableColumnsTypeAntd<T> & TableColumnsTypeEditable<T>;
|
|
14
|
-
export declare const EditableTable: <T extends RowCommon>({ onSave, schema, initialValueForm, rowKey, columns, ...rest }: EditableTableCommonProps<T>) => import("react/jsx-runtime").JSX.Element;
|