@pnkx-lib/ui 1.9.76 → 1.9.77
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/chunks/{index-gDC7HlTI.js → index-Co23tgty.js} +14 -2
- package/es/index.js +1 -1
- package/es/ui/index.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +2 -1
- package/types/ui.d.ts +2 -1
@@ -5634,6 +5634,7 @@ const Table = ({
|
|
5634
5634
|
renderHeadingSearch,
|
5635
5635
|
rightHeadingContent,
|
5636
5636
|
menu,
|
5637
|
+
showIndexColumn = true,
|
5637
5638
|
...rest
|
5638
5639
|
}) => {
|
5639
5640
|
//! State
|
@@ -5729,6 +5730,18 @@ const Table = ({
|
|
5729
5730
|
// disabled: !status,
|
5730
5731
|
// }),
|
5731
5732
|
};
|
5733
|
+
const startIndex = (filters.page_number - 1) * filters.page_size;
|
5734
|
+
const columnsWithIndex = showIndexColumn ? [
|
5735
|
+
{
|
5736
|
+
title: "STT",
|
5737
|
+
dataIndex: "index",
|
5738
|
+
key: "index",
|
5739
|
+
width: 70,
|
5740
|
+
align: "center",
|
5741
|
+
render: (_, __, index) => startIndex + index + 1
|
5742
|
+
},
|
5743
|
+
...columns
|
5744
|
+
] : columns;
|
5732
5745
|
//! Function
|
5733
5746
|
useEffect(() => {
|
5734
5747
|
setData(Array.isArray(dataSource) ? dataSource : []);
|
@@ -5766,7 +5779,7 @@ const Table = ({
|
|
5766
5779
|
{
|
5767
5780
|
rowKey,
|
5768
5781
|
dataSource: data,
|
5769
|
-
columns,
|
5782
|
+
columns: columnsWithIndex,
|
5770
5783
|
pagination: !lodashExports.isEmpty(data) ? paginationConfig : false,
|
5771
5784
|
loading,
|
5772
5785
|
rowSelection: rowsSelected ? rowSelection : void 0,
|
@@ -5778,7 +5791,6 @@ const Table = ({
|
|
5778
5791
|
emptyText: /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyTable, {})
|
5779
5792
|
},
|
5780
5793
|
rowClassName: (_, index) => `table-row-${index % 2 === 0 ? "even" : "odd"}`,
|
5781
|
-
scroll: { x: "max-content", y: 90 * 8 },
|
5782
5794
|
...rest
|
5783
5795
|
}
|
5784
5796
|
),
|
package/es/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/index-
|
1
|
+
export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/index-Co23tgty.js';
|
2
2
|
export { C as CheckboxField, D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, a as TINY_API, b as TinyMCE, T as Typography } from './chunks/AntdIcon-BhLLkfpo.js';
|
3
3
|
import 'react-router';
|
4
4
|
export { P as PAGE_INDEX, b as PAGE_SIZE, c as SORT_BY, d as SORT_DESC, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable, u as useToast } from './chunks/table-mj-07ZtC.js';
|
package/es/ui/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/index-
|
1
|
+
export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/index-Co23tgty.js';
|
2
2
|
export { E as ErrorMessage, L as Label, a as TINY_API, T as Typography } from '../chunks/AntdIcon-BhLLkfpo.js';
|
3
3
|
import 'react-router';
|
4
4
|
export { P as PAGE_INDEX, b as PAGE_SIZE, c as SORT_BY, d as SORT_DESC, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable } from '../chunks/table-mj-07ZtC.js';
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
@@ -723,7 +723,7 @@ declare type TabItem = {
|
|
723
723
|
disabled?: boolean;
|
724
724
|
};
|
725
725
|
|
726
|
-
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, ...rest }: TableCommonProps<T>) => JSX.Element;
|
726
|
+
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, showIndexColumn, ...rest }: TableCommonProps<T>) => JSX.Element;
|
727
727
|
|
728
728
|
export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
|
729
729
|
|
@@ -750,6 +750,7 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
|
|
750
750
|
renderHeadingSearch: () => ReactNode;
|
751
751
|
rightHeadingContent: ReactNode;
|
752
752
|
menu: Array<MenuProps>;
|
753
|
+
showIndexColumn?: boolean;
|
753
754
|
}
|
754
755
|
|
755
756
|
export declare const Tabs: default_2.FC<TabsProps>;
|
package/types/ui.d.ts
CHANGED
@@ -564,7 +564,7 @@ declare type TabItem = {
|
|
564
564
|
disabled?: boolean;
|
565
565
|
};
|
566
566
|
|
567
|
-
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, ...rest }: TableCommonProps<T>) => JSX.Element;
|
567
|
+
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, showIndexColumn, ...rest }: TableCommonProps<T>) => JSX.Element;
|
568
568
|
|
569
569
|
export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
|
570
570
|
|
@@ -591,6 +591,7 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
|
|
591
591
|
renderHeadingSearch: () => ReactNode;
|
592
592
|
rightHeadingContent: ReactNode;
|
593
593
|
menu: Array<MenuProps>;
|
594
|
+
showIndexColumn?: boolean;
|
594
595
|
}
|
595
596
|
|
596
597
|
export declare const Tabs: default_2.FC<TabsProps>;
|