Skip to content

Commit d9598ed

Browse files
committed
updates
1 parent a86e959 commit d9598ed

File tree

5 files changed

+29
-13
lines changed

5 files changed

+29
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "beautiful-react-table",
3-
"version": "7.8.1",
3+
"version": "7.8.2",
44
"description": "My first react typescript package",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.js",

src/Models/table.models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export interface IProps<T extends Object> {
6363
handleSorting?(option: string): void
6464
handleArgChange?(columnName: string, type: string): void
6565
handleDeleteAll?: () => void
66+
staticAction?(): JSX.Element
6667
}
6768

6869
export interface ItemFields {

src/table/MainHeader/ColumnsCustomizer/style.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
}
88
.G-costumize-wrapper{
99
margin-left: 5px;
10-
flex: 1 1 auto;
1110
}
1211
.G-costumize-modal{
1312
border-radius: 4px;

src/table/MainHeader/index.tsx

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ interface IActionsHeader<T extends Object> {
5353
getDownloadType?: (option: string, checkedRows: T[] | string) => void
5454
customHeaderAction?(option: T[] | string): JSX.Element
5555
handleDeleteAll?: () => void
56+
staticAction?(): JSX.Element
5657
}
5758
const MainHeader = <T extends Object>({
5859
columnsConfigStructure,
@@ -85,6 +86,7 @@ const MainHeader = <T extends Object>({
8586
getDownloadType,
8687
customHeaderAction,
8788
handleDeleteAll,
89+
staticAction,
8890
}: IActionsHeader<T>) => {
8991
return (
9092
<div className='G-justify-start G-table-actions-header'>
@@ -118,7 +120,9 @@ const MainHeader = <T extends Object>({
118120
{/* {selectedType === CheckedItems.SELECTED_ALL || checkedRows.length
119121
? customHeaderAction?.(checkedRows)
120122
: null} */}
121-
{customHeaderAction?.(checkedRows)}
123+
{selectedType === CheckedItems.SELECTED_ALL || checkedRows.length
124+
? customHeaderAction?.(checkedRows)
125+
: null}
122126
{/* {handleDeleteAll && data.length > 1 && (
123127
<div className="G-flex G-delete" onClick={handleDeleteAll}>
124128
<div className="G-center G-delete-icon">
@@ -130,16 +134,26 @@ const MainHeader = <T extends Object>({
130134
</div>
131135
</>
132136
) : null}
133-
{draggableColumns ? (
134-
<ColumnsCustomizer
135-
columnsConfigStructure={columnsConfigStructure}
136-
setColumnsConfigStructure={setColumnsConfigStructure}
137-
columnsHeaderStructure={columnsHeaderStructure}
138-
setColumnHeaderStructure={setColumnHeaderStructure}
139-
translations={translations}
140-
storeStructure={storeStructure}
141-
/>
142-
) : null}
137+
<div
138+
style={{
139+
display: 'flex',
140+
alignItems: 'center',
141+
gap: '32px',
142+
flex: '1 1 auto',
143+
}}
144+
>
145+
{draggableColumns ? (
146+
<ColumnsCustomizer
147+
columnsConfigStructure={columnsConfigStructure}
148+
setColumnsConfigStructure={setColumnsConfigStructure}
149+
columnsHeaderStructure={columnsHeaderStructure}
150+
setColumnHeaderStructure={setColumnHeaderStructure}
151+
translations={translations}
152+
storeStructure={storeStructure}
153+
/>
154+
) : null}
155+
{staticAction?.()}
156+
</div>
143157

144158
{hasFilters ? (
145159
<Filter

src/table/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function Table<T extends Object>({
6969
handleSorting,
7070
handleArgChange,
7171
handleDeleteAll,
72+
staticAction,
7273
}: IProps<T>) {
7374
const {
7475
freezedRows,
@@ -125,6 +126,7 @@ function Table<T extends Object>({
125126
getDownloadType={getDownloadType}
126127
customHeaderAction={customHeaderAction}
127128
handleDeleteAll={handleDeleteAll}
129+
staticAction={staticAction}
128130
/>
129131
) : null}
130132

0 commit comments

Comments
 (0)