Skip to content

Commit de76c38

Browse files
committed
feat: table component
1 parent bf3f420 commit de76c38

File tree

8 files changed

+832
-203
lines changed

8 files changed

+832
-203
lines changed

src/Common/Hooks/UseRegisterShortcut/types.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import { IS_PLATFORM_MAC_OS } from '@Common/Constants'
1818

19+
// NOTE: check this link for more info on keyboard keys: https://w3c.github.io/uievents-key/
1920
export const KEYBOARD_KEYS_MAP = {
2021
Control: 'Ctrl',
2122
Shift: '⇧',
@@ -25,8 +26,21 @@ export const KEYBOARD_KEYS_MAP = {
2526
E: 'E',
2627
R: 'R',
2728
K: 'K',
29+
X: 'X',
2830
Escape: 'Esc',
2931
Enter: '↩',
32+
ArrowLeft: '←',
33+
ArrowRight: '→',
34+
ArrowUp: '↑',
35+
ArrowDown: '↓',
36+
PageUp: 'PgUp',
37+
PageDown: 'PgDn',
38+
Home: 'Home',
39+
End: 'End',
40+
Backspace: '⌫',
41+
Delete: '⌦',
42+
Dot: '.',
43+
Space: 'Space',
3044
} as const
3145

3246
export type SupportedKeyboardKeysType = keyof typeof KEYBOARD_KEYS_MAP
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2024. Devtron Inc.
3+
*/
4+
5+
import { ReactComponent as ICClose } from '@Icons/ic-close.svg'
6+
import { DraggableButton, DraggablePositionVariant, DraggableWrapper } from '@Common/DraggableWrapper'
7+
import { ComponentSizeType } from '@Shared/constants'
8+
import { BulkSelectionActionWidgetProps } from './types'
9+
import { Button, ButtonComponentType, ButtonStyleType, ButtonVariantType } from '../Button'
10+
11+
const BulkSelectionActionWidget = ({
12+
count,
13+
handleClearBulkSelection,
14+
parentRef,
15+
BulkActionsComponent,
16+
}: BulkSelectionActionWidgetProps) => (
17+
<DraggableWrapper
18+
dragSelector=".drag-selector"
19+
positionVariant={DraggablePositionVariant.PARENT_BOTTOM_CENTER}
20+
zIndex="calc(var(--modal-index) - 1)"
21+
parentRef={parentRef}
22+
>
23+
<div className="dc__separated-flexbox dc__separated-flexbox--gap-8 pt-12 pb-12 pr-12 pl-12 bulk-selection-widget br-8">
24+
<div className="flexbox dc__gap-8">
25+
<DraggableButton dragClassName="drag-selector" />
26+
27+
<div className="fs-13 lh-20 fw-6 flex dc__gap-12">
28+
<span className="flex dc__gap-2 bcb-5 cn-0 br-4 pr-6 pl-6">{count}</span>
29+
<span className="cn-9">Selected</span>
30+
</div>
31+
</div>
32+
33+
<BulkActionsComponent />
34+
35+
<Button
36+
icon={<ICClose />}
37+
dataTestId="table__action-widget--close"
38+
component={ButtonComponentType.button}
39+
style={ButtonStyleType.negativeGrey}
40+
variant={ButtonVariantType.borderLess}
41+
ariaLabel="Clear selection(s)"
42+
size={ComponentSizeType.small}
43+
onClick={handleClearBulkSelection}
44+
showAriaLabelInTippy
45+
/>
46+
</div>
47+
</DraggableWrapper>
48+
)
49+
50+
export default BulkSelectionActionWidget

0 commit comments

Comments
 (0)